humanish 0.0.1 → 0.15.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/AGENTS.md +77 -0
- package/CONTRIBUTING.md +39 -0
- package/LICENSE +21 -0
- package/README.md +435 -8
- package/SECURITY.md +34 -0
- package/dist/actor-contract.d.ts +107 -0
- package/dist/actor-contract.js +286 -0
- package/dist/actor-contract.js.map +1 -0
- package/dist/actor-registry.d.ts +73 -0
- package/dist/actor-registry.js +93 -0
- package/dist/actor-registry.js.map +1 -0
- package/dist/adapter-extension.d.ts +54 -0
- package/dist/adapter-extension.js +214 -0
- package/dist/adapter-extension.js.map +1 -0
- package/dist/argv.d.ts +1 -0
- package/dist/argv.js +8 -0
- package/dist/argv.js.map +1 -0
- package/dist/artifact-reference.d.ts +22 -0
- package/dist/artifact-reference.js +47 -0
- package/dist/artifact-reference.js.map +1 -0
- package/dist/browser-evidence-hygiene.d.ts +7 -0
- package/dist/browser-evidence-hygiene.js +40 -0
- package/dist/browser-evidence-hygiene.js.map +1 -0
- package/dist/claude-agent-sdk.d.ts +94 -0
- package/dist/claude-agent-sdk.js +356 -0
- package/dist/claude-agent-sdk.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +5 -0
- package/dist/cli.js.map +1 -0
- package/dist/codex-app-server-ui.d.ts +39 -0
- package/dist/codex-app-server-ui.js +327 -0
- package/dist/codex-app-server-ui.js.map +1 -0
- package/dist/codex-app-server.d.ts +141 -0
- package/dist/codex-app-server.js +747 -0
- package/dist/codex-app-server.js.map +1 -0
- package/dist/command-failure.d.ts +29 -0
- package/dist/command-failure.js +54 -0
- package/dist/command-failure.js.map +1 -0
- package/dist/computer-use-actor.d.ts +52 -0
- package/dist/computer-use-actor.js +48 -0
- package/dist/computer-use-actor.js.map +1 -0
- package/dist/computer-use.d.ts +232 -0
- package/dist/computer-use.js +615 -0
- package/dist/computer-use.js.map +1 -0
- package/dist/concurrency.d.ts +1 -0
- package/dist/concurrency.js +27 -0
- package/dist/concurrency.js.map +1 -0
- package/dist/concurrent-shared-world-lab.d.ts +115 -0
- package/dist/concurrent-shared-world-lab.js +1092 -0
- package/dist/concurrent-shared-world-lab.js.map +1 -0
- package/dist/core/git-state.d.ts +31 -0
- package/dist/core/git-state.js +142 -0
- package/dist/core/git-state.js.map +1 -0
- package/dist/core/index.d.ts +4 -0
- package/dist/core/index.js +3 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/run-primitives.d.ts +66 -0
- package/dist/core/run-primitives.js +120 -0
- package/dist/core/run-primitives.js.map +1 -0
- package/dist/cua-actor-lab.d.ts +620 -0
- package/dist/cua-actor-lab.js +2834 -0
- package/dist/cua-actor-lab.js.map +1 -0
- package/dist/device-presets.d.ts +67 -0
- package/dist/device-presets.js +50 -0
- package/dist/device-presets.js.map +1 -0
- package/dist/e2b-desktop-executor.d.ts +101 -0
- package/dist/e2b-desktop-executor.js +309 -0
- package/dist/e2b-desktop-executor.js.map +1 -0
- package/dist/e2b-desktop-launch.d.ts +144 -0
- package/dist/e2b-desktop-launch.js +59 -0
- package/dist/e2b-desktop-launch.js.map +1 -0
- package/dist/e2b-detached.d.ts +53 -0
- package/dist/e2b-detached.js +130 -0
- package/dist/e2b-detached.js.map +1 -0
- package/dist/e2b-terminal-lab.d.ts +345 -0
- package/dist/e2b-terminal-lab.js +1467 -0
- package/dist/e2b-terminal-lab.js.map +1 -0
- package/dist/env-file.d.ts +14 -0
- package/dist/env-file.js +108 -0
- package/dist/env-file.js.map +1 -0
- package/dist/feedback.d.ts +51 -0
- package/dist/feedback.js +313 -0
- package/dist/feedback.js.map +1 -0
- package/dist/image-evidence.d.ts +2 -0
- package/dist/image-evidence.js +33 -0
- package/dist/image-evidence.js.map +1 -0
- package/dist/index.d.ts +63 -0
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -0
- package/dist/init-templates.d.ts +12 -0
- package/dist/init-templates.js +369 -0
- package/dist/init-templates.js.map +1 -0
- package/dist/init.d.ts +26 -0
- package/dist/init.js +343 -0
- package/dist/init.js.map +1 -0
- package/dist/lab-app-runner.d.ts +78 -0
- package/dist/lab-app-runner.js +403 -0
- package/dist/lab-app-runner.js.map +1 -0
- package/dist/lab-config.d.ts +578 -0
- package/dist/lab-config.js +1751 -0
- package/dist/lab-config.js.map +1 -0
- package/dist/lab-engine.d.ts +77 -0
- package/dist/lab-engine.js +216 -0
- package/dist/lab-engine.js.map +1 -0
- package/dist/lab-preflight.d.ts +67 -0
- package/dist/lab-preflight.js +385 -0
- package/dist/lab-preflight.js.map +1 -0
- package/dist/labs.d.ts +53 -0
- package/dist/labs.js +176 -0
- package/dist/labs.js.map +1 -0
- package/dist/observer-assets.d.ts +2 -0
- package/dist/observer-assets.js +2630 -0
- package/dist/observer-assets.js.map +1 -0
- package/dist/observer-data.d.ts +63 -0
- package/dist/observer-data.js +145 -0
- package/dist/observer-data.js.map +1 -0
- package/dist/observer-static.d.ts +39 -0
- package/dist/observer-static.js +192 -0
- package/dist/observer-static.js.map +1 -0
- package/dist/observer.d.ts +46 -0
- package/dist/observer.js +353 -0
- package/dist/observer.js.map +1 -0
- package/dist/openai-responses-cu.d.ts +113 -0
- package/dist/openai-responses-cu.js +531 -0
- package/dist/openai-responses-cu.js.map +1 -0
- package/dist/oss-lab.d.ts +52 -0
- package/dist/oss-lab.js +299 -0
- package/dist/oss-lab.js.map +1 -0
- package/dist/oss-meta-lab-scoring.d.ts +15 -0
- package/dist/oss-meta-lab-scoring.js +145 -0
- package/dist/oss-meta-lab-scoring.js.map +1 -0
- package/dist/oss-meta-lab.d.ts +279 -0
- package/dist/oss-meta-lab.js +4889 -0
- package/dist/oss-meta-lab.js.map +1 -0
- package/dist/oss-remote-telemetry.d.ts +77 -0
- package/dist/oss-remote-telemetry.js +403 -0
- package/dist/oss-remote-telemetry.js.map +1 -0
- package/dist/persona.d.ts +35 -0
- package/dist/persona.js +133 -0
- package/dist/persona.js.map +1 -0
- package/dist/pi-agent-core.d.ts +77 -0
- package/dist/pi-agent-core.js +203 -0
- package/dist/pi-agent-core.js.map +1 -0
- package/dist/program.d.ts +54 -0
- package/dist/program.js +2347 -0
- package/dist/program.js.map +1 -0
- package/dist/redaction.d.ts +90 -0
- package/dist/redaction.js +292 -0
- package/dist/redaction.js.map +1 -0
- package/dist/run.d.ts +784 -0
- package/dist/run.js +4555 -0
- package/dist/run.js.map +1 -0
- package/dist/scripted-browser-actor.d.ts +294 -0
- package/dist/scripted-browser-actor.js +1286 -0
- package/dist/scripted-browser-actor.js.map +1 -0
- package/dist/scripted-browser-lab.d.ts +107 -0
- package/dist/scripted-browser-lab.js +738 -0
- package/dist/scripted-browser-lab.js.map +1 -0
- package/dist/shared-world-lab.d.ts +208 -0
- package/dist/shared-world-lab.js +1048 -0
- package/dist/shared-world-lab.js.map +1 -0
- package/dist/source-archive.d.ts +82 -0
- package/dist/source-archive.js +365 -0
- package/dist/source-archive.js.map +1 -0
- package/dist/stop-conditions.d.ts +26 -0
- package/dist/stop-conditions.js +66 -0
- package/dist/stop-conditions.js.map +1 -0
- package/dist/terminal-agent-actor.d.ts +36 -0
- package/dist/terminal-agent-actor.js +23 -0
- package/dist/terminal-agent-actor.js.map +1 -0
- package/docs/architecture/actor-contract.md +431 -0
- package/docs/architecture/github-feedback-loop.md +189 -0
- package/docs/architecture/local-codex-tui-actor.md +213 -0
- package/docs/architecture/observer.md +118 -0
- package/docs/architecture/oss-lab-poc.md +242 -0
- package/docs/architecture/project-layout.md +166 -0
- package/docs/architecture/state-driven-executor.md +203 -0
- package/docs/architecture/terminal-product-lane.md +148 -0
- package/docs/contracts/adapter-fixtures.md +80 -0
- package/docs/contracts/core.md +71 -0
- package/docs/contracts/feedback.md +145 -0
- package/docs/contracts/policy.md +305 -0
- package/docs/contracts/run-bundle.md +358 -0
- package/docs/contracts/schemas.md +984 -0
- package/docs/goals/current.md +409 -0
- package/docs/principles/invariants-and-defaults.md +135 -0
- package/docs/principles/self-driving-harness.md +129 -0
- package/docs/product/open-source-install-experience.md +229 -0
- package/docs/ramp/README.md +200 -0
- package/docs/release/open-source-readiness.md +208 -0
- package/docs/release/public-readiness-standard.md +205 -0
- package/docs/roadmap/world-class-open-source-v0.md +311 -0
- package/package.json +102 -8
- package/skills/humanish/SKILL.md +244 -0
- package/skills/humanish/agents/openai.yaml +7 -0
- package/index.js +0 -1
|
@@ -0,0 +1,2630 @@
|
|
|
1
|
+
// Humanish Observer: client assets (CSS + browser JS).
|
|
2
|
+
//
|
|
3
|
+
// This file is the redesigned Observer surface ported from the Claude Design
|
|
4
|
+
// handoff (HTML/CSS/JS prototype) into the repo's self-contained renderer.
|
|
5
|
+
// `observer.ts` injects `observerCss()` into a <style> and `observerClientJs()`
|
|
6
|
+
// into a <script>, then hydrates from an embedded `observer-data.v1` JSON blob
|
|
7
|
+
// and polls `observer-data.json` (served mode) for live updates.
|
|
8
|
+
//
|
|
9
|
+
// IMPORTANT: `observerClientJs()` runs verbatim in the browser. It is emitted
|
|
10
|
+
// from a TS template literal, so it intentionally avoids backticks, `${`, and
|
|
11
|
+
// backslash escapes; literal UTF-8 characters and `String.fromCharCode` are
|
|
12
|
+
// used instead. Keep it that way when editing.
|
|
13
|
+
export function observerCss() {
|
|
14
|
+
return `
|
|
15
|
+
/* ============================================================
|
|
16
|
+
Humanish Observer · redesign
|
|
17
|
+
Design tokens + shell. Dark is default; [data-theme="light"]
|
|
18
|
+
on <html> flips the palette. All accent/status colors are
|
|
19
|
+
semantic tokens so the whole UI re-themes from one place.
|
|
20
|
+
============================================================ */
|
|
21
|
+
|
|
22
|
+
:root {
|
|
23
|
+
/* surfaces */
|
|
24
|
+
--bg: #0a0b0d;
|
|
25
|
+
--surface-0: #0d0f12;
|
|
26
|
+
--surface-1: #14171b;
|
|
27
|
+
--surface-2: #1a1e23;
|
|
28
|
+
--surface-3: #232830;
|
|
29
|
+
--stream-void: #050608;
|
|
30
|
+
|
|
31
|
+
/* hairlines */
|
|
32
|
+
--line: rgba(255, 255, 255, 0.065);
|
|
33
|
+
--line-2: rgba(255, 255, 255, 0.11);
|
|
34
|
+
--line-3: rgba(255, 255, 255, 0.18);
|
|
35
|
+
|
|
36
|
+
/* text */
|
|
37
|
+
--text-1: #f2f4f6;
|
|
38
|
+
--text-2: #a6aeb6;
|
|
39
|
+
--text-3: #6d747d;
|
|
40
|
+
--text-4: #464c54;
|
|
41
|
+
|
|
42
|
+
/* brand + status */
|
|
43
|
+
--accent: #4d7cfe;
|
|
44
|
+
--accent-2: #7ea6ff;
|
|
45
|
+
--accent-ink: #cdddff;
|
|
46
|
+
--cyan: #41c8e6;
|
|
47
|
+
--green: #34d399;
|
|
48
|
+
--teal: #2dc3a6;
|
|
49
|
+
--amber: #f0a92b;
|
|
50
|
+
--red: #fb5d52;
|
|
51
|
+
--violet: #a78bfa;
|
|
52
|
+
|
|
53
|
+
--accent-soft: color-mix(in oklab, var(--accent) 18%, transparent);
|
|
54
|
+
--green-soft: color-mix(in oklab, var(--green) 16%, transparent);
|
|
55
|
+
--amber-soft: color-mix(in oklab, var(--amber) 16%, transparent);
|
|
56
|
+
--red-soft: color-mix(in oklab, var(--red) 16%, transparent);
|
|
57
|
+
--cyan-soft: color-mix(in oklab, var(--cyan) 16%, transparent);
|
|
58
|
+
|
|
59
|
+
--radius: 10px;
|
|
60
|
+
--radius-sm: 7px;
|
|
61
|
+
--radius-lg: 16px;
|
|
62
|
+
--radius-pill: 999px;
|
|
63
|
+
|
|
64
|
+
--shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
|
|
65
|
+
--shadow-2: 0 8px 30px rgba(0, 0, 0, 0.4);
|
|
66
|
+
--shadow-pop: 0 20px 60px rgba(0, 0, 0, 0.55);
|
|
67
|
+
|
|
68
|
+
--sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
|
|
69
|
+
--mono: "Geist Mono", ui-monospace, "SF Mono", "JetBrains Mono", Consolas, monospace;
|
|
70
|
+
|
|
71
|
+
--ease: cubic-bezier(0.22, 1, 0.36, 1);
|
|
72
|
+
--ease-out: cubic-bezier(0.16, 1, 0.3, 1);
|
|
73
|
+
--header-h: 54px;
|
|
74
|
+
--toolbar-h: 50px;
|
|
75
|
+
|
|
76
|
+
--tile-min: 380px;
|
|
77
|
+
--accent-color: var(--accent); /* overridable by Tweaks */
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
html[data-theme="light"] {
|
|
81
|
+
--bg: #eef0f3;
|
|
82
|
+
--surface-0: #f6f7f9;
|
|
83
|
+
--surface-1: #ffffff;
|
|
84
|
+
--surface-2: #ffffff;
|
|
85
|
+
--surface-3: #eceef2;
|
|
86
|
+
--stream-void: #0b0d10;
|
|
87
|
+
--line: rgba(15, 20, 30, 0.09);
|
|
88
|
+
--line-2: rgba(15, 20, 30, 0.14);
|
|
89
|
+
--line-3: rgba(15, 20, 30, 0.22);
|
|
90
|
+
--text-1: #14171c;
|
|
91
|
+
--text-2: #525a64;
|
|
92
|
+
--text-3: #828a94;
|
|
93
|
+
--text-4: #aeb5bd;
|
|
94
|
+
--shadow-1: 0 1px 2px rgba(20, 28, 40, 0.08);
|
|
95
|
+
--shadow-2: 0 8px 30px rgba(20, 28, 40, 0.12);
|
|
96
|
+
--shadow-pop: 0 20px 60px rgba(20, 28, 40, 0.22);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
* { box-sizing: border-box; }
|
|
100
|
+
|
|
101
|
+
html, body {
|
|
102
|
+
margin: 0;
|
|
103
|
+
height: 100%;
|
|
104
|
+
overflow: hidden;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
body {
|
|
108
|
+
background: var(--bg);
|
|
109
|
+
color: var(--text-1);
|
|
110
|
+
font-family: var(--sans);
|
|
111
|
+
font-size: 13px;
|
|
112
|
+
line-height: 1.5;
|
|
113
|
+
-webkit-font-smoothing: antialiased;
|
|
114
|
+
text-rendering: optimizeLegibility;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
button { font-family: inherit; cursor: pointer; color: inherit; background: none; border: none; }
|
|
118
|
+
a { color: inherit; text-decoration: none; }
|
|
119
|
+
|
|
120
|
+
:focus-visible {
|
|
121
|
+
outline: 2px solid var(--accent-color);
|
|
122
|
+
outline-offset: 2px;
|
|
123
|
+
border-radius: 4px;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
::-webkit-scrollbar { width: 10px; height: 10px; }
|
|
127
|
+
::-webkit-scrollbar-track { background: transparent; }
|
|
128
|
+
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
|
|
129
|
+
::-webkit-scrollbar-thumb:hover { background: var(--line-3); background-clip: padding-box; }
|
|
130
|
+
|
|
131
|
+
.mono { font-family: var(--mono); font-feature-settings: "tnum" 1, "zero" 1; }
|
|
132
|
+
.eyebrow {
|
|
133
|
+
font-family: var(--mono);
|
|
134
|
+
font-size: 9.5px;
|
|
135
|
+
letter-spacing: 0.16em;
|
|
136
|
+
text-transform: uppercase;
|
|
137
|
+
color: var(--text-3);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* ============================================================ APP SHELL */
|
|
141
|
+
.app {
|
|
142
|
+
display: flex;
|
|
143
|
+
flex-direction: column;
|
|
144
|
+
height: 100vh;
|
|
145
|
+
height: 100dvh;
|
|
146
|
+
position: relative;
|
|
147
|
+
}
|
|
148
|
+
.hdr, .toolbar { flex: none; }
|
|
149
|
+
.stage { flex: 1 1 0; }
|
|
150
|
+
|
|
151
|
+
/* top-edge run progress line */
|
|
152
|
+
.runline {
|
|
153
|
+
position: absolute;
|
|
154
|
+
top: 0; left: 0; right: 0;
|
|
155
|
+
height: 2px;
|
|
156
|
+
z-index: 60;
|
|
157
|
+
background: transparent;
|
|
158
|
+
pointer-events: none;
|
|
159
|
+
}
|
|
160
|
+
.runline > span {
|
|
161
|
+
display: block;
|
|
162
|
+
height: 100%;
|
|
163
|
+
background: linear-gradient(90deg, var(--accent-color), var(--accent-2));
|
|
164
|
+
box-shadow: 0 0 12px color-mix(in oklab, var(--accent-color) 70%, transparent);
|
|
165
|
+
transition: width 900ms var(--ease-out);
|
|
166
|
+
border-radius: 0 2px 2px 0;
|
|
167
|
+
}
|
|
168
|
+
.runline[data-status="failed"] > span { background: linear-gradient(90deg, var(--red), #ff8b82); box-shadow: 0 0 12px var(--red-soft); }
|
|
169
|
+
.runline[data-status="passed"] > span,
|
|
170
|
+
.runline[data-status="complete"] > span { background: linear-gradient(90deg, var(--green), #7ef0c4); box-shadow: 0 0 12px var(--green-soft); }
|
|
171
|
+
|
|
172
|
+
/* ============================================================ HEADER */
|
|
173
|
+
.hdr {
|
|
174
|
+
display: flex;
|
|
175
|
+
align-items: center;
|
|
176
|
+
gap: 14px;
|
|
177
|
+
height: var(--header-h);
|
|
178
|
+
padding: 0 16px;
|
|
179
|
+
background: var(--surface-0);
|
|
180
|
+
border-bottom: 1px solid var(--line);
|
|
181
|
+
position: relative;
|
|
182
|
+
z-index: 40;
|
|
183
|
+
}
|
|
184
|
+
.hdr-brand { display: flex; align-items: center; gap: 10px; flex: none; }
|
|
185
|
+
.brand-mark {
|
|
186
|
+
width: 26px; height: 26px; border-radius: 8px;
|
|
187
|
+
display: grid; place-items: center;
|
|
188
|
+
background: radial-gradient(circle at 30% 25%, color-mix(in oklab, var(--accent-color) 55%, transparent), transparent 70%), var(--surface-2);
|
|
189
|
+
border: 1px solid var(--line-2);
|
|
190
|
+
position: relative;
|
|
191
|
+
overflow: hidden;
|
|
192
|
+
color: var(--accent-ink);
|
|
193
|
+
}
|
|
194
|
+
.brand-mark svg { width: 16px; height: 16px; }
|
|
195
|
+
.brand-word { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; }
|
|
196
|
+
.brand-word b { color: var(--accent-color); font-weight: 600; }
|
|
197
|
+
|
|
198
|
+
.hdr-run {
|
|
199
|
+
display: flex; flex-direction: column; gap: 1px; min-width: 0;
|
|
200
|
+
padding-left: 14px; margin-left: 2px;
|
|
201
|
+
border-left: 1px solid var(--line);
|
|
202
|
+
}
|
|
203
|
+
.hdr-run-title {
|
|
204
|
+
font-size: 13.5px; font-weight: 560; color: var(--text-1);
|
|
205
|
+
white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw;
|
|
206
|
+
letter-spacing: -0.01em;
|
|
207
|
+
}
|
|
208
|
+
.hdr-run-sub {
|
|
209
|
+
display: flex; align-items: center; gap: 7px;
|
|
210
|
+
font-size: 11px; color: var(--text-3); min-width: 0;
|
|
211
|
+
}
|
|
212
|
+
.hdr-run-sub .dot-sep { width: 2.5px; height: 2.5px; border-radius: 50%; background: var(--text-4); flex: none; }
|
|
213
|
+
.hdr-persona { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
214
|
+
.run-chip {
|
|
215
|
+
font-family: var(--mono); font-size: 10px; color: var(--text-3);
|
|
216
|
+
background: var(--surface-2); border: 1px solid var(--line);
|
|
217
|
+
padding: 1px 6px; border-radius: var(--radius-sm); cursor: pointer;
|
|
218
|
+
white-space: nowrap; transition: border-color .15s, color .15s;
|
|
219
|
+
}
|
|
220
|
+
.run-chip:hover { border-color: var(--line-3); color: var(--text-1); }
|
|
221
|
+
|
|
222
|
+
.hdr-spacer { flex: 1; }
|
|
223
|
+
|
|
224
|
+
/* status pill */
|
|
225
|
+
.status-pill {
|
|
226
|
+
display: inline-flex; align-items: center; gap: 8px;
|
|
227
|
+
height: 30px; padding: 0 12px 0 11px;
|
|
228
|
+
border-radius: var(--radius-pill);
|
|
229
|
+
background: var(--surface-2);
|
|
230
|
+
border: 1px solid var(--line-2);
|
|
231
|
+
font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
|
|
232
|
+
color: var(--text-1); flex: none;
|
|
233
|
+
}
|
|
234
|
+
.status-pill[data-tone="running"] { background: var(--accent-soft); border-color: color-mix(in oklab, var(--accent) 35%, transparent); color: var(--accent-ink); }
|
|
235
|
+
.status-pill[data-tone="passed"], .status-pill[data-tone="complete"] { background: var(--green-soft); border-color: color-mix(in oklab, var(--green) 35%, transparent); color: color-mix(in oklab, var(--green) 70%, white); }
|
|
236
|
+
.status-pill[data-tone="blocked"] { background: var(--amber-soft); border-color: color-mix(in oklab, var(--amber) 35%, transparent); color: color-mix(in oklab, var(--amber) 80%, white); }
|
|
237
|
+
.status-pill[data-tone="failed"] { background: var(--red-soft); border-color: color-mix(in oklab, var(--red) 35%, transparent); color: color-mix(in oklab, var(--red) 75%, white); }
|
|
238
|
+
.status-pill .pct { color: inherit; opacity: .65; }
|
|
239
|
+
|
|
240
|
+
/* lane counts */
|
|
241
|
+
.lane-counts { display: flex; align-items: center; gap: 2px; flex: none; }
|
|
242
|
+
.lane-count {
|
|
243
|
+
display: inline-flex; align-items: center; gap: 6px;
|
|
244
|
+
padding: 5px 9px; border-radius: var(--radius-sm);
|
|
245
|
+
font-family: var(--mono); font-size: 11px; color: var(--text-2);
|
|
246
|
+
transition: background .15s;
|
|
247
|
+
}
|
|
248
|
+
.lane-count:hover { background: var(--surface-2); }
|
|
249
|
+
.lane-count b { color: var(--text-1); font-weight: 600; }
|
|
250
|
+
.lane-count[data-dim="true"] { opacity: .4; }
|
|
251
|
+
|
|
252
|
+
.icon-btn {
|
|
253
|
+
width: 32px; height: 32px; border-radius: var(--radius-sm);
|
|
254
|
+
display: grid; place-items: center; color: var(--text-2);
|
|
255
|
+
border: 1px solid transparent; transition: background .15s, color .15s, border-color .15s; flex: none;
|
|
256
|
+
}
|
|
257
|
+
.icon-btn:hover { background: var(--surface-2); color: var(--text-1); }
|
|
258
|
+
.icon-btn[aria-pressed="true"] { background: var(--surface-3); color: var(--text-1); border-color: var(--line-2); }
|
|
259
|
+
.icon-btn svg { width: 17px; height: 17px; }
|
|
260
|
+
|
|
261
|
+
.hdr-runs {
|
|
262
|
+
display: inline-flex; align-items: center; gap: 7px;
|
|
263
|
+
height: 32px; padding: 0 12px; border-radius: var(--radius-sm);
|
|
264
|
+
border: 1px solid var(--line-2); color: var(--text-2);
|
|
265
|
+
font-size: 12px; transition: background .15s, color .15s; flex: none;
|
|
266
|
+
}
|
|
267
|
+
.hdr-runs:hover { background: var(--surface-2); color: var(--text-1); }
|
|
268
|
+
.hdr-runs svg { width: 15px; height: 15px; }
|
|
269
|
+
|
|
270
|
+
/* ============================================================ TOOLBAR */
|
|
271
|
+
.toolbar {
|
|
272
|
+
display: flex; align-items: center; gap: 10px;
|
|
273
|
+
height: var(--toolbar-h); padding: 0 16px;
|
|
274
|
+
background: var(--surface-0); border-bottom: 1px solid var(--line);
|
|
275
|
+
position: relative; z-index: 30;
|
|
276
|
+
overflow-x: auto; overflow-y: hidden;
|
|
277
|
+
scrollbar-width: none;
|
|
278
|
+
}
|
|
279
|
+
.toolbar::-webkit-scrollbar { display: none; }
|
|
280
|
+
|
|
281
|
+
.filter-group { display: flex; align-items: center; gap: 3px; flex: none; }
|
|
282
|
+
.chip {
|
|
283
|
+
display: inline-flex; align-items: center; gap: 6px;
|
|
284
|
+
height: 28px; padding: 0 10px; border-radius: var(--radius-pill);
|
|
285
|
+
border: 1px solid var(--line); color: var(--text-2);
|
|
286
|
+
font-size: 11.5px; white-space: nowrap;
|
|
287
|
+
transition: background .15s, color .15s, border-color .15s;
|
|
288
|
+
}
|
|
289
|
+
.chip:hover { border-color: var(--line-2); color: var(--text-1); }
|
|
290
|
+
.chip[aria-pressed="true"] { background: var(--surface-3); color: var(--text-1); border-color: var(--line-2); }
|
|
291
|
+
.chip .chip-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
|
|
292
|
+
.chip .chip-n { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); }
|
|
293
|
+
.chip[aria-pressed="true"] .chip-n { color: var(--text-2); }
|
|
294
|
+
|
|
295
|
+
.tb-sep { width: 1px; height: 22px; background: var(--line); flex: none; }
|
|
296
|
+
.tb-spacer { flex: 1; min-width: 8px; }
|
|
297
|
+
|
|
298
|
+
/* search */
|
|
299
|
+
.tb-search {
|
|
300
|
+
display: flex; align-items: center; gap: 7px;
|
|
301
|
+
height: 28px; padding: 0 10px; border-radius: var(--radius-sm);
|
|
302
|
+
border: 1px solid var(--line); color: var(--text-3); flex: none;
|
|
303
|
+
min-width: 150px; transition: border-color .15s;
|
|
304
|
+
}
|
|
305
|
+
.tb-search:focus-within { border-color: var(--line-3); }
|
|
306
|
+
.tb-search svg { width: 14px; height: 14px; flex: none; }
|
|
307
|
+
.tb-search input {
|
|
308
|
+
background: none; border: none; color: var(--text-1); font-family: var(--sans);
|
|
309
|
+
font-size: 12px; width: 100%; outline: none;
|
|
310
|
+
}
|
|
311
|
+
.tb-search input::placeholder { color: var(--text-4); }
|
|
312
|
+
|
|
313
|
+
/* segmented control (density, media, view) */
|
|
314
|
+
.seg {
|
|
315
|
+
display: inline-flex; align-items: center; padding: 2px;
|
|
316
|
+
background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius-sm); flex: none;
|
|
317
|
+
}
|
|
318
|
+
.seg button {
|
|
319
|
+
display: inline-flex; align-items: center; gap: 6px;
|
|
320
|
+
height: 24px; padding: 0 9px; border-radius: 5px;
|
|
321
|
+
font-size: 11px; color: var(--text-3); white-space: nowrap;
|
|
322
|
+
transition: color .15s, background .15s;
|
|
323
|
+
}
|
|
324
|
+
.seg button svg { width: 14px; height: 14px; }
|
|
325
|
+
.seg button:hover { color: var(--text-1); }
|
|
326
|
+
.seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--text-1); box-shadow: var(--shadow-1); }
|
|
327
|
+
.seg button:disabled { opacity: .4; cursor: not-allowed; }
|
|
328
|
+
|
|
329
|
+
.tb-label { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-4); font-family: var(--mono); flex: none; }
|
|
330
|
+
|
|
331
|
+
/* ============================================================ GRID */
|
|
332
|
+
.stage { position: relative; min-height: 0; overflow: hidden; }
|
|
333
|
+
.grid-scroll { height: 100%; overflow-y: auto; overflow-x: hidden; padding: 16px; }
|
|
334
|
+
.grid {
|
|
335
|
+
display: grid;
|
|
336
|
+
gap: 14px;
|
|
337
|
+
grid-template-columns: repeat(auto-fill, minmax(min(var(--tile-min), 100%), 1fr));
|
|
338
|
+
align-content: start;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.tile {
|
|
342
|
+
display: flex; flex-direction: column;
|
|
343
|
+
background: var(--surface-1);
|
|
344
|
+
border: 1px solid var(--line);
|
|
345
|
+
border-radius: var(--radius);
|
|
346
|
+
overflow: hidden;
|
|
347
|
+
cursor: pointer;
|
|
348
|
+
position: relative;
|
|
349
|
+
transition: border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
|
|
350
|
+
}
|
|
351
|
+
.tile:hover { border-color: var(--line-3); transform: translateY(-2px); box-shadow: var(--shadow-2); }
|
|
352
|
+
.tile:hover .tile-open { opacity: 1; transform: none; }
|
|
353
|
+
.tile[data-selected="true"] { border-color: color-mix(in oklab, var(--accent) 60%, transparent); box-shadow: 0 0 0 1px color-mix(in oklab, var(--accent) 45%, transparent); }
|
|
354
|
+
|
|
355
|
+
.tile-head {
|
|
356
|
+
display: flex; align-items: center; gap: 8px;
|
|
357
|
+
padding: 0 10px; height: 32px; flex: none;
|
|
358
|
+
border-bottom: 1px solid var(--line);
|
|
359
|
+
background: var(--surface-1);
|
|
360
|
+
}
|
|
361
|
+
.tile-idx { font-family: var(--mono); font-size: 10px; color: var(--text-4); flex: none; }
|
|
362
|
+
.tile-name { font-size: 12px; font-weight: 520; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
|
|
363
|
+
.kind-badge {
|
|
364
|
+
font-family: var(--mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase;
|
|
365
|
+
padding: 2px 6px; border-radius: 5px; flex: none;
|
|
366
|
+
background: var(--surface-3); color: var(--text-2);
|
|
367
|
+
}
|
|
368
|
+
.kind-badge[data-kind="ui"], .kind-badge[data-kind="browser"] { color: var(--violet); background: color-mix(in oklab, var(--violet) 14%, transparent); }
|
|
369
|
+
.kind-badge[data-kind="terminal"] { color: var(--green); background: var(--green-soft); }
|
|
370
|
+
.kind-badge[data-kind="tui"] { color: var(--cyan); background: var(--cyan-soft); }
|
|
371
|
+
.kind-badge[data-kind="codex-ui"] { color: var(--accent-2); background: var(--accent-soft); }
|
|
372
|
+
.tile-dims { font-family: var(--mono); font-size: 9px; color: var(--text-4); flex: none; }
|
|
373
|
+
.tile-open {
|
|
374
|
+
width: 22px; height: 22px; border-radius: 5px; display: grid; place-items: center;
|
|
375
|
+
color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line-2);
|
|
376
|
+
opacity: 0; transform: translateX(3px); transition: opacity .15s, transform .15s; flex: none;
|
|
377
|
+
}
|
|
378
|
+
.tile-open svg { width: 13px; height: 13px; }
|
|
379
|
+
|
|
380
|
+
/* status pip */
|
|
381
|
+
.pip { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--text-4); position: relative; }
|
|
382
|
+
.pip[data-status="queued"] { background: var(--text-4); }
|
|
383
|
+
.pip[data-status="preparing"]{ background: var(--cyan); }
|
|
384
|
+
.pip[data-status="running"] { background: var(--accent); }
|
|
385
|
+
.pip[data-status="passed"], .pip[data-status="complete"] { background: var(--green); }
|
|
386
|
+
.pip[data-status="contract_proof_only"] { background: var(--teal); }
|
|
387
|
+
.pip[data-status="blocked"], .pip[data-status="timed_out"] { background: var(--amber); }
|
|
388
|
+
.pip[data-status="failed"] { background: var(--red); }
|
|
389
|
+
.pip[data-live="true"]::after {
|
|
390
|
+
content: ""; position: absolute; inset: -3px; border-radius: 50%;
|
|
391
|
+
background: currentColor; opacity: .35; animation: ping 1.6s var(--ease-out) infinite;
|
|
392
|
+
}
|
|
393
|
+
.pip[data-status="running"][data-live="true"] { color: var(--accent); }
|
|
394
|
+
.pip[data-status="preparing"][data-live="true"] { color: var(--cyan); }
|
|
395
|
+
|
|
396
|
+
.tile-surface {
|
|
397
|
+
position: relative; background: var(--stream-void);
|
|
398
|
+
aspect-ratio: var(--aspect, 16 / 9);
|
|
399
|
+
width: 100%; overflow: hidden; flex: none;
|
|
400
|
+
}
|
|
401
|
+
.tile-foot {
|
|
402
|
+
display: flex; align-items: center; gap: 8px;
|
|
403
|
+
padding: 0 10px; height: 30px; flex: none;
|
|
404
|
+
border-top: 1px solid var(--line); background: var(--surface-1);
|
|
405
|
+
}
|
|
406
|
+
.tile-foot-text { font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
|
|
407
|
+
.tile-foot-text .now-dot { color: var(--accent); margin-right: 6px; }
|
|
408
|
+
.mini-prog { width: 46px; height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; flex: none; }
|
|
409
|
+
.mini-prog > span { display: block; height: 100%; background: var(--accent); transition: width .6s var(--ease-out); }
|
|
410
|
+
.tile-foot[data-status="failed"] .mini-prog > span { background: var(--red); }
|
|
411
|
+
.tile-foot[data-status="blocked"] .mini-prog > span,
|
|
412
|
+
.tile-foot[data-status="timed_out"] .mini-prog > span { background: var(--amber); }
|
|
413
|
+
.tile-foot[data-status="passed"] .mini-prog > span,
|
|
414
|
+
.tile-foot[data-status="complete"] .mini-prog > span,
|
|
415
|
+
.tile-foot[data-status="contract_proof_only"] .mini-prog > span { background: var(--green); }
|
|
416
|
+
|
|
417
|
+
/* ============================================================ STREAM SURFACES */
|
|
418
|
+
.surface-fill { position: absolute; inset: 0; width: 100%; height: 100%; }
|
|
419
|
+
.live-stream-mount { position: absolute; inset: 0; overflow: hidden; background: #000; }
|
|
420
|
+
.live-stream-overlay { position: absolute; overflow: hidden; pointer-events: none; z-index: 2; }
|
|
421
|
+
.live-stream-overlay[data-focus="true"] .bw-lab-dock { max-height: 86px; }
|
|
422
|
+
.live-stream-overlay[data-focus="true"] .bw-chip-v { max-width: min(420px, 38vw); }
|
|
423
|
+
|
|
424
|
+
/* browser/ui mock */
|
|
425
|
+
.bw { position: absolute; inset: 0; display: flex; flex-direction: column; background: #0b0d10; }
|
|
426
|
+
.bw-chrome {
|
|
427
|
+
display: flex; align-items: center; gap: 6px; padding: 0 9px; height: 26px; flex: none;
|
|
428
|
+
background: #16181c; border-bottom: 1px solid rgba(255,255,255,.06);
|
|
429
|
+
}
|
|
430
|
+
.bw-dots { display: flex; gap: 4px; }
|
|
431
|
+
.bw-dots i { width: 7px; height: 7px; border-radius: 50%; background: #353a40; }
|
|
432
|
+
.bw-url {
|
|
433
|
+
flex: 1; height: 16px; border-radius: 4px; background: #0d0f12; border: 1px solid rgba(255,255,255,.06);
|
|
434
|
+
display: flex; align-items: center; padding: 0 7px; gap: 5px;
|
|
435
|
+
font-family: var(--mono); font-size: 8.5px; color: #6f767e; min-width: 0;
|
|
436
|
+
}
|
|
437
|
+
.bw-url svg { width: 8px; height: 8px; flex: none; }
|
|
438
|
+
.bw-url span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
439
|
+
.bw-viewport { flex: 1; position: relative; overflow: hidden; background: #fbfcfd; }
|
|
440
|
+
.bw-app-wait { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 8px; background: #fbfcfd; color: #5a626c; text-align: center; padding: 16px; }
|
|
441
|
+
.bw-app-wait .wait-spinner { border-color: rgba(20,28,40,.12); border-top-color: var(--accent); }
|
|
442
|
+
.bw-lab-dock {
|
|
443
|
+
position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 8;
|
|
444
|
+
display: flex; align-items: flex-end; gap: 5px; flex-wrap: wrap;
|
|
445
|
+
max-height: 54px; overflow: hidden; pointer-events: none;
|
|
446
|
+
}
|
|
447
|
+
.bw-lab-chip {
|
|
448
|
+
min-width: 0; max-width: 100%; pointer-events: auto;
|
|
449
|
+
display: inline-flex; align-items: center; gap: 5px;
|
|
450
|
+
padding: 3px 7px; border-radius: 6px;
|
|
451
|
+
background: rgba(8,10,13,.78); backdrop-filter: blur(8px);
|
|
452
|
+
border: 1px solid rgba(255,255,255,.12);
|
|
453
|
+
color: var(--text-2); box-shadow: var(--shadow-1);
|
|
454
|
+
}
|
|
455
|
+
a.bw-lab-chip:hover { border-color: rgba(255,255,255,.22); color: var(--text-1); }
|
|
456
|
+
.bw-lab-chip[data-tone="live"] { color: var(--accent-2); border-color: color-mix(in oklab, var(--accent) 35%, transparent); }
|
|
457
|
+
.bw-lab-chip[data-tone="ok"] { color: var(--green); border-color: color-mix(in oklab, var(--green) 34%, transparent); }
|
|
458
|
+
.bw-lab-chip[data-tone="warn"] { color: var(--amber); border-color: color-mix(in oklab, var(--amber) 34%, transparent); }
|
|
459
|
+
.bw-lab-chip[data-tone="err"] { color: var(--red); border-color: color-mix(in oklab, var(--red) 34%, transparent); }
|
|
460
|
+
.bw-chip-k {
|
|
461
|
+
flex: none; font-family: var(--mono); font-size: 8.5px; letter-spacing: .08em;
|
|
462
|
+
text-transform: uppercase; color: currentColor;
|
|
463
|
+
}
|
|
464
|
+
.bw-chip-v {
|
|
465
|
+
min-width: 0; max-width: min(240px, 42vw);
|
|
466
|
+
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
|
467
|
+
font-family: var(--mono); font-size: 9px; color: var(--text-2);
|
|
468
|
+
}
|
|
469
|
+
.focus-stage-area .bw-lab-dock { max-height: 86px; }
|
|
470
|
+
.focus-stage-area .bw-chip-v { max-width: min(420px, 38vw); }
|
|
471
|
+
.bw-cursor {
|
|
472
|
+
position: absolute; width: 16px; height: 16px; z-index: 5; pointer-events: none;
|
|
473
|
+
transition: left 1.1s var(--ease), top 1.1s var(--ease);
|
|
474
|
+
filter: drop-shadow(0 1px 2px rgba(0,0,0,.4));
|
|
475
|
+
}
|
|
476
|
+
.bw-click {
|
|
477
|
+
position: absolute; width: 26px; height: 26px; border-radius: 50%; z-index: 4;
|
|
478
|
+
border: 2px solid var(--accent); margin: -13px 0 0 -13px; pointer-events: none;
|
|
479
|
+
animation: clickpulse 1.4s var(--ease-out) infinite;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
/* the fake app being driven */
|
|
483
|
+
.app-mock { position: absolute; inset: 0; padding: 14px; color: #1a1d22; font-size: 10px; }
|
|
484
|
+
.app-mock .am-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
|
|
485
|
+
.am-logo { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 11px; color: #14171c; }
|
|
486
|
+
.am-logo i { width: 14px; height: 14px; border-radius: 4px; background: linear-gradient(135deg, var(--accent), var(--violet)); }
|
|
487
|
+
.am-nav { display: flex; gap: 10px; color: #8a929b; font-size: 9px; }
|
|
488
|
+
.am-h { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; color: #11141a; margin: 6px 0 3px; }
|
|
489
|
+
.am-p { color: #6a727b; line-height: 1.45; max-width: 80%; }
|
|
490
|
+
.am-field { margin-top: 10px; height: 26px; border-radius: 6px; border: 1px solid #e2e6ea; background: #fff; display: flex; align-items: center; padding: 0 9px; color: #9aa0a8; font-size: 9px; }
|
|
491
|
+
.am-field[data-focus="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 18%, transparent); }
|
|
492
|
+
.am-btn { margin-top: 9px; height: 28px; border-radius: 7px; background: #11141a; color: #fff; display: inline-flex; align-items: center; padding: 0 16px; font-size: 10px; font-weight: 600; }
|
|
493
|
+
.am-btn[data-variant="accent"] { background: var(--accent); }
|
|
494
|
+
.am-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
|
|
495
|
+
.am-card { border: 1px solid #e6e9ed; border-radius: 8px; padding: 9px; background: #fff; }
|
|
496
|
+
.am-card .am-ck { height: 5px; width: 40%; background: #e9edf1; border-radius: 3px; margin-bottom: 6px; }
|
|
497
|
+
.am-card .am-cl { height: 4px; width: 80%; background: #f0f3f6; border-radius: 3px; margin-bottom: 4px; }
|
|
498
|
+
|
|
499
|
+
/* terminal */
|
|
500
|
+
.term { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--stream-void); font-family: var(--mono); }
|
|
501
|
+
.term-bar { display: flex; align-items: center; gap: 7px; padding: 0 10px; height: 24px; flex: none; background: rgba(255,255,255,.03); border-bottom: 1px solid var(--line); }
|
|
502
|
+
.term-bar .tprompt { color: var(--green); font-size: 11px; }
|
|
503
|
+
.term-bar .ttitle { flex: 1; font-size: 10px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
504
|
+
.term-bar .tstat { font-size: 8.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
|
|
505
|
+
.term-body { flex: 1; min-height: 0; overflow: hidden; padding: 9px 10px; font-size: 11px; line-height: 1.55; display: flex; flex-direction: column; justify-content: flex-end; }
|
|
506
|
+
.focus-stage-area .term-body { justify-content: flex-start; overflow-y: auto; font-size: 12.5px; }
|
|
507
|
+
.term-line { display: flex; gap: 9px; white-space: pre-wrap; overflow-wrap: anywhere; animation: line-in .25s var(--ease-out) both; }
|
|
508
|
+
.term-num { color: var(--text-4); flex: none; width: 18px; text-align: right; user-select: none; }
|
|
509
|
+
.term-txt { color: var(--text-2); }
|
|
510
|
+
.term-txt.ok { color: var(--green); }
|
|
511
|
+
.term-txt.warn { color: var(--amber); }
|
|
512
|
+
.term-txt.err { color: var(--red); }
|
|
513
|
+
.term-txt.cmd { color: var(--text-1); }
|
|
514
|
+
.term-txt.dim { color: var(--text-3); }
|
|
515
|
+
.term-caret { display: inline-block; width: 7px; height: 13px; background: var(--green); vertical-align: middle; animation: blink 1.1s steps(2) infinite; margin-left: 2px; }
|
|
516
|
+
|
|
517
|
+
/* codex agent session */
|
|
518
|
+
.codex { position: absolute; inset: 0; display: flex; flex-direction: column; background: #0c0e11; }
|
|
519
|
+
.codex-bar { display: flex; align-items: center; gap: 7px; padding: 0 10px; height: 26px; flex: none; background: #131519; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 9px; color: var(--text-3); }
|
|
520
|
+
.codex-bar .cx-spark { color: var(--accent-2); display: inline-flex; }
|
|
521
|
+
.codex-body { flex: 1; min-height: 0; overflow: hidden; padding: 11px; display: flex; flex-direction: column; gap: 8px; }
|
|
522
|
+
.focus-stage-area .codex-body { overflow-y: auto; }
|
|
523
|
+
.cx-msg { max-width: 86%; padding: 7px 10px; border-radius: 10px; font-size: 10.5px; line-height: 1.45; animation: line-in .3s var(--ease-out) both; }
|
|
524
|
+
.cx-msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 3px; }
|
|
525
|
+
.cx-msg.agent { align-self: flex-start; background: var(--surface-2); color: var(--text-1); border: 1px solid var(--line); border-bottom-left-radius: 3px; }
|
|
526
|
+
.cx-tool { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 9.5px; color: var(--text-3); padding: 5px 9px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface-1); }
|
|
527
|
+
.cx-tool .cx-spin { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--line-3); border-top-color: var(--accent); animation: spin 1s linear infinite; flex: none; }
|
|
528
|
+
.cx-tool svg { width: 12px; height: 12px; color: var(--green); }
|
|
529
|
+
.cx-chips { display: flex; flex-wrap: wrap; gap: 5px; min-height: 0; }
|
|
530
|
+
.cx-chip {
|
|
531
|
+
min-width: 0; max-width: 100%;
|
|
532
|
+
display: inline-flex; align-items: center; gap: 5px;
|
|
533
|
+
padding: 3px 7px; border-radius: 6px;
|
|
534
|
+
border: 1px solid var(--line); background: var(--surface-1);
|
|
535
|
+
font-family: var(--mono); font-size: 9px; color: var(--text-2);
|
|
536
|
+
}
|
|
537
|
+
.cx-chip[data-tone="live"] { color: var(--accent-2); border-color: color-mix(in oklab, var(--accent) 34%, transparent); background: var(--accent-soft); }
|
|
538
|
+
.cx-chip[data-tone="ok"] { color: var(--green); border-color: color-mix(in oklab, var(--green) 34%, transparent); background: var(--green-soft); }
|
|
539
|
+
.cx-chip[data-tone="warn"] { color: var(--amber); border-color: color-mix(in oklab, var(--amber) 34%, transparent); background: var(--amber-soft); }
|
|
540
|
+
.cx-chip[data-tone="err"] { color: var(--red); border-color: color-mix(in oklab, var(--red) 34%, transparent); background: var(--red-soft); }
|
|
541
|
+
.cx-chip-k { flex: none; text-transform: uppercase; letter-spacing: .08em; color: currentColor; }
|
|
542
|
+
.cx-chip-v { min-width: 0; max-width: min(260px, 46vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
|
|
543
|
+
.cx-lanes { display: flex; flex-direction: column; gap: 7px; min-height: 0; }
|
|
544
|
+
.cx-lane {
|
|
545
|
+
display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px;
|
|
546
|
+
padding: 8px; border-radius: 8px; border: 1px solid var(--line);
|
|
547
|
+
background: color-mix(in oklab, var(--surface-1) 88%, black);
|
|
548
|
+
animation: line-in .24s var(--ease-out) both;
|
|
549
|
+
}
|
|
550
|
+
.cx-lane-ic {
|
|
551
|
+
width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center;
|
|
552
|
+
background: var(--surface-2); border: 1px solid var(--line); color: var(--text-3);
|
|
553
|
+
}
|
|
554
|
+
.cx-lane[data-cx-kind="message"] .cx-lane-ic { color: var(--accent-2); }
|
|
555
|
+
.cx-lane[data-cx-kind="reasoning"] .cx-lane-ic { color: var(--violet); }
|
|
556
|
+
.cx-lane[data-cx-kind="tool"] .cx-lane-ic { color: var(--green); }
|
|
557
|
+
.cx-lane[data-cx-kind="file"] .cx-lane-ic { color: var(--cyan); }
|
|
558
|
+
.cx-lane[data-cx-kind="command"] .cx-lane-ic { color: var(--amber); }
|
|
559
|
+
.cx-lane-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
|
|
560
|
+
.cx-lane-head { display: flex; align-items: center; gap: 7px; min-width: 0; }
|
|
561
|
+
.cx-lane-kind { font-family: var(--mono); font-size: 8.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); flex: none; }
|
|
562
|
+
.cx-lane-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; color: var(--text-1); }
|
|
563
|
+
.cx-lane-body { color: var(--text-2); font-size: 10.5px; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap; }
|
|
564
|
+
.cx-lane-meta { font-family: var(--mono); font-size: 8.5px; color: var(--text-4); }
|
|
565
|
+
.cx-artifacts { display: flex; flex-wrap: wrap; gap: 5px; padding-top: 2px; }
|
|
566
|
+
.cx-artifact {
|
|
567
|
+
display: inline-flex; align-items: center; gap: 5px; min-width: 0; max-width: 100%;
|
|
568
|
+
padding: 4px 7px; border-radius: 6px; border: 1px solid var(--line);
|
|
569
|
+
background: var(--surface-1); color: var(--text-2); font-family: var(--mono); font-size: 9px;
|
|
570
|
+
}
|
|
571
|
+
a.cx-artifact:hover { border-color: var(--line-3); color: var(--text-1); }
|
|
572
|
+
.cx-artifact span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
573
|
+
|
|
574
|
+
/* waiting / proof / empty surface */
|
|
575
|
+
.wait { position: absolute; inset: 0; display: grid; place-items: center; background:
|
|
576
|
+
radial-gradient(circle at 50% 38%, color-mix(in oklab, var(--accent) 12%, transparent), transparent 42%),
|
|
577
|
+
repeating-linear-gradient(0deg, transparent 0 26px, color-mix(in oklab, white 3%, transparent) 26px 27px);
|
|
578
|
+
text-align: center; padding: 16px;
|
|
579
|
+
}
|
|
580
|
+
.wait-inner { display: grid; justify-items: center; gap: 11px; max-width: 80%; }
|
|
581
|
+
.wait-spinner { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin 1.1s linear infinite; }
|
|
582
|
+
.wait-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line-2); }
|
|
583
|
+
.wait-icon svg { width: 18px; height: 18px; }
|
|
584
|
+
.wait-icon[data-tone="amber"] { color: var(--amber); border-color: color-mix(in oklab, var(--amber) 35%, transparent); }
|
|
585
|
+
.wait-icon[data-tone="red"] { color: var(--red); border-color: color-mix(in oklab, var(--red) 35%, transparent); }
|
|
586
|
+
.wait-icon[data-tone="green"] { color: var(--green); border-color: color-mix(in oklab, var(--green) 35%, transparent); }
|
|
587
|
+
.wait-title { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-1); }
|
|
588
|
+
.wait-sub { font-size: 11px; color: var(--text-3); line-height: 1.5; }
|
|
589
|
+
|
|
590
|
+
/* tile live tag overlay */
|
|
591
|
+
.live-tag {
|
|
592
|
+
position: absolute; top: 8px; right: 8px; z-index: 6;
|
|
593
|
+
display: inline-flex; align-items: center; gap: 5px;
|
|
594
|
+
padding: 3px 8px; border-radius: var(--radius-pill);
|
|
595
|
+
background: rgba(8,10,13,.7); backdrop-filter: blur(8px);
|
|
596
|
+
border: 1px solid var(--line-2);
|
|
597
|
+
font-family: var(--mono); font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-1);
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
/* ============================================================ FOCUS VIEW */
|
|
601
|
+
.focus {
|
|
602
|
+
display: grid;
|
|
603
|
+
grid-template-columns: minmax(0, var(--rail-w, 188px)) minmax(0, 1fr) minmax(0, var(--side-w, 360px));
|
|
604
|
+
height: 100%; min-height: 0;
|
|
605
|
+
transition: grid-template-columns .22s var(--ease);
|
|
606
|
+
}
|
|
607
|
+
.focus[data-rail="collapsed"] { --rail-w: 0px; }
|
|
608
|
+
.focus[data-side="collapsed"] { --side-w: 0px; }
|
|
609
|
+
|
|
610
|
+
/* left lane rail; focus navigation lives in the toolbar */
|
|
611
|
+
.focus-rail {
|
|
612
|
+
background: var(--surface-0); border-right: 1px solid var(--line);
|
|
613
|
+
display: flex; flex-direction: column; min-height: 0; overflow: hidden;
|
|
614
|
+
min-width: 0;
|
|
615
|
+
transition: opacity .18s var(--ease), transform .22s var(--ease), border-color .18s var(--ease);
|
|
616
|
+
}
|
|
617
|
+
.focus[data-rail="collapsed"] .focus-rail { opacity: 0; pointer-events: none; transform: translateX(-10px); border-right-color: transparent; }
|
|
618
|
+
.focus-rail-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 8px; }
|
|
619
|
+
.focus-rail-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 12px; display: flex; flex-direction: column; gap: 4px; }
|
|
620
|
+
.rail-item {
|
|
621
|
+
display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: var(--radius-sm);
|
|
622
|
+
text-align: left; width: 100%; transition: background .14s; position: relative;
|
|
623
|
+
}
|
|
624
|
+
.rail-item:hover { background: var(--surface-2); }
|
|
625
|
+
.rail-item[data-selected="true"] { background: var(--surface-3); }
|
|
626
|
+
.rail-item[data-selected="true"]::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--accent); }
|
|
627
|
+
.rail-thumb { width: 40px; height: 26px; border-radius: 5px; background: var(--stream-void); border: 1px solid var(--line); flex: none; overflow: hidden; position: relative; display: grid; place-items: center; color: var(--text-3); }
|
|
628
|
+
.rail-meta { min-width: 0; flex: 1; }
|
|
629
|
+
.rail-name { font-size: 11.5px; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
630
|
+
.rail-sub { font-family: var(--mono); font-size: 9px; color: var(--text-3); display: flex; align-items: center; gap: 5px; }
|
|
631
|
+
|
|
632
|
+
.focus-stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
|
|
633
|
+
.focus-bar {
|
|
634
|
+
display: flex; align-items: center; gap: 12px; padding: 0 14px; height: 46px; flex: none;
|
|
635
|
+
background: var(--surface-0); border-bottom: 1px solid var(--line);
|
|
636
|
+
}
|
|
637
|
+
.toolbar.focus-toolbar { overflow-x: auto; gap: 12px; }
|
|
638
|
+
.toolbar.focus-toolbar .crumbs { flex: 1 1 auto; }
|
|
639
|
+
.toolbar.focus-toolbar .focus-status { flex: none; }
|
|
640
|
+
.crumbs { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-3); min-width: 0; }
|
|
641
|
+
.crumbs button { color: var(--text-3); transition: color .15s; white-space: nowrap; }
|
|
642
|
+
.crumbs button:hover { color: var(--text-1); }
|
|
643
|
+
.crumbs .sep { color: var(--text-4); }
|
|
644
|
+
.crumbs .cur { color: var(--text-1); font-weight: 520; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
645
|
+
.crumbs .crumb-rail-toggle { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--line-2); }
|
|
646
|
+
.crumbs .crumb-rail-toggle:hover { background: var(--surface-2); }
|
|
647
|
+
.crumbs .crumb-rail-toggle svg { width: 15px; height: 15px; }
|
|
648
|
+
.focus-status { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: var(--radius-pill); font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; background: var(--surface-2); border: 1px solid var(--line-2); }
|
|
649
|
+
.focus-nav { display: flex; align-items: center; gap: 2px; }
|
|
650
|
+
.focus-stepper { font-family: var(--mono); font-size: 10px; color: var(--text-3); padding: 0 4px; }
|
|
651
|
+
|
|
652
|
+
.focus-stage-area { flex: 1; min-height: 0; min-width: 0; display: grid; place-items: center; padding: 22px; overflow: auto; position: relative; }
|
|
653
|
+
.focus-frame {
|
|
654
|
+
position: relative; background: var(--stream-void); border-radius: var(--radius-lg);
|
|
655
|
+
border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); overflow: hidden;
|
|
656
|
+
aspect-ratio: var(--aspect, 16 / 9);
|
|
657
|
+
max-width: 100%; max-height: 100%;
|
|
658
|
+
width: auto; height: 100%;
|
|
659
|
+
}
|
|
660
|
+
@supports not (aspect-ratio: 1) { .focus-frame { height: 100%; width: 100%; } }
|
|
661
|
+
|
|
662
|
+
/* side panel */
|
|
663
|
+
.focus-side {
|
|
664
|
+
background: var(--surface-0); border-left: 1px solid var(--line);
|
|
665
|
+
display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden;
|
|
666
|
+
transition: opacity .18s var(--ease), transform .22s var(--ease), border-color .18s var(--ease);
|
|
667
|
+
}
|
|
668
|
+
.focus[data-side="collapsed"] .focus-side { opacity: 0; pointer-events: none; transform: translateX(10px); border-left-color: transparent; }
|
|
669
|
+
.side-context { flex: none; padding: 16px; border-bottom: 1px solid var(--line); }
|
|
670
|
+
.side-persona-row { display: flex; align-items: center; gap: 10px; }
|
|
671
|
+
.side-avatar { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--accent-2); font-weight: 600; font-size: 13px; flex: none; }
|
|
672
|
+
.side-persona-name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
673
|
+
.side-persona-id { font-family: var(--mono); font-size: 10px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
674
|
+
.side-goal { margin-top: 13px; }
|
|
675
|
+
.side-goal-text { font-size: 12.5px; color: var(--text-2); margin-top: 4px; line-height: 1.5; }
|
|
676
|
+
.side-now { margin-top: 13px; padding: 10px 11px; border-radius: var(--radius-sm); background: var(--surface-1); border: 1px solid var(--line); }
|
|
677
|
+
.side-now-row { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
|
|
678
|
+
.side-now-text { font-size: 12.5px; color: var(--text-1); line-height: 1.45; }
|
|
679
|
+
|
|
680
|
+
.side-tabs { display: flex; flex: none; padding: 0 8px; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
|
|
681
|
+
.side-tabs::-webkit-scrollbar { display: none; }
|
|
682
|
+
.side-tab { display: inline-flex; align-items: center; gap: 6px; padding: 11px 10px; font-size: 11.5px; color: var(--text-3); border-bottom: 2px solid transparent; white-space: nowrap; transition: color .15s; }
|
|
683
|
+
.side-tab:hover { color: var(--text-1); }
|
|
684
|
+
.side-tab[aria-selected="true"] { color: var(--text-1); border-bottom-color: var(--accent); }
|
|
685
|
+
.side-tab .tab-n { font-family: var(--mono); font-size: 9.5px; padding: 1px 5px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); }
|
|
686
|
+
.side-body { flex: 1; min-height: 0; overflow-y: auto; }
|
|
687
|
+
|
|
688
|
+
.evt { display: grid; grid-template-columns: auto 1fr; gap: 11px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
|
|
689
|
+
.evt-rail { display: flex; flex-direction: column; align-items: center; gap: 4px; }
|
|
690
|
+
.evt-icon { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); flex: none; }
|
|
691
|
+
.evt-icon svg { width: 12px; height: 12px; color: var(--text-3); }
|
|
692
|
+
.evt[data-level="warn"] .evt-icon { color: var(--amber); border-color: color-mix(in oklab, var(--amber) 30%, transparent); }
|
|
693
|
+
.evt[data-level="warn"] .evt-icon svg { color: var(--amber); }
|
|
694
|
+
.evt[data-level="error"] .evt-icon { color: var(--red); border-color: color-mix(in oklab, var(--red) 30%, transparent); }
|
|
695
|
+
.evt[data-level="error"] .evt-icon svg { color: var(--red); }
|
|
696
|
+
.evt-conn { flex: 1; width: 1px; background: var(--line); min-height: 8px; }
|
|
697
|
+
.evt-text { font-size: 12px; color: var(--text-1); line-height: 1.45; }
|
|
698
|
+
.evt-meta { font-family: var(--mono); font-size: 9.5px; color: var(--text-3); margin-top: 4px; letter-spacing: .04em; display: flex; gap: 7px; flex-wrap: wrap; }
|
|
699
|
+
.evt-type { color: var(--text-2); }
|
|
700
|
+
|
|
701
|
+
.file-row { display: flex; align-items: center; gap: 11px; padding: 11px 16px; border-bottom: 1px solid var(--line); transition: background .14s; }
|
|
702
|
+
.file-row:hover { background: var(--surface-1); }
|
|
703
|
+
.file-row[data-selected="true"] { background: var(--surface-2); box-shadow: inset 2px 0 0 var(--accent); }
|
|
704
|
+
.file-row > button, .file-row > a:not(.file-open) { display: flex; align-items: center; gap: 11px; min-width: 0; flex: 1; text-align: left; }
|
|
705
|
+
.file-ic { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); flex: none; }
|
|
706
|
+
.file-ic svg { width: 14px; height: 14px; }
|
|
707
|
+
.file-meta { min-width: 0; flex: 1; }
|
|
708
|
+
.file-name { font-size: 12.5px; color: var(--text-1); }
|
|
709
|
+
.file-path { font-family: var(--mono); font-size: 9.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
710
|
+
.file-kind { font-family: var(--mono); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 2px 7px; border-radius: 5px; background: var(--surface-2); flex: none; }
|
|
711
|
+
.file-open { font-family: var(--mono); font-size: 9px; color: var(--accent-2); padding: 3px 6px; border-radius: 5px; border: 1px solid var(--line); flex: none; }
|
|
712
|
+
.file-open:hover { background: var(--surface-3); }
|
|
713
|
+
.file-inspector { border-bottom: 1px solid var(--line); background: var(--surface-1); }
|
|
714
|
+
.meaning-card { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-1); }
|
|
715
|
+
.meaning-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
|
|
716
|
+
.meaning-score { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; padding: 4px 8px; border-radius: var(--radius-pill); border: 1px solid var(--line-2); color: var(--text-2); }
|
|
717
|
+
.meaning-score[data-status="pass"] { color: color-mix(in oklab, var(--green) 72%, white); background: var(--green-soft); border-color: color-mix(in oklab, var(--green) 35%, transparent); }
|
|
718
|
+
.meaning-score[data-status="partial"] { color: color-mix(in oklab, var(--amber) 82%, white); background: var(--amber-soft); border-color: color-mix(in oklab, var(--amber) 35%, transparent); }
|
|
719
|
+
.meaning-score[data-status="fail"] { color: color-mix(in oklab, var(--red) 75%, white); background: var(--red-soft); border-color: color-mix(in oklab, var(--red) 35%, transparent); }
|
|
720
|
+
.meaning-summary { color: var(--text-2); font-size: 11.5px; line-height: 1.45; }
|
|
721
|
+
.meaning-components { display: grid; gap: 6px; margin-top: 10px; }
|
|
722
|
+
.meaning-comp { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: start; padding: 8px; border-radius: var(--radius-sm); background: var(--surface-0); border: 1px solid var(--line); }
|
|
723
|
+
.meaning-comp-dot { width: 8px; height: 8px; border-radius: 999px; margin-top: 5px; background: var(--text-4); }
|
|
724
|
+
.meaning-comp[data-status="pass"] .meaning-comp-dot { background: var(--green); }
|
|
725
|
+
.meaning-comp[data-status="partial"] .meaning-comp-dot { background: var(--amber); }
|
|
726
|
+
.meaning-comp[data-status="fail"] .meaning-comp-dot { background: var(--red); }
|
|
727
|
+
.meaning-comp-name { color: var(--text-1); font-weight: 560; font-size: 11.5px; }
|
|
728
|
+
.meaning-comp-detail { color: var(--text-3); font-size: 10.5px; line-height: 1.35; margin-top: 1px; }
|
|
729
|
+
.meaning-comp-score { font-family: var(--mono); color: var(--text-3); font-size: 10px; }
|
|
730
|
+
.fi-head { padding: 14px 16px 12px; border-bottom: 1px solid var(--line); }
|
|
731
|
+
.fi-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
|
|
732
|
+
.fi-title h3 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: -0.01em; }
|
|
733
|
+
.fi-status { font-family: var(--mono); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; padding: 2px 7px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); }
|
|
734
|
+
.fi-status[data-status="passed"] { background: var(--green-soft); color: var(--green); }
|
|
735
|
+
.fi-status[data-status="needs_review"], .fi-status[data-status="blocked"] { background: var(--amber-soft); color: var(--amber); }
|
|
736
|
+
.fi-summary { margin-top: 7px; color: var(--text-2); font-size: 11.5px; line-height: 1.45; }
|
|
737
|
+
.fi-section { padding: 12px 16px; border-bottom: 1px solid var(--line); }
|
|
738
|
+
.fi-section:last-child { border-bottom: 0; }
|
|
739
|
+
.fi-section-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
|
|
740
|
+
.fi-section-title span:first-child { font-family: var(--mono); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
|
|
741
|
+
.fi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
|
|
742
|
+
.fi-stat { padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-0); min-width: 0; }
|
|
743
|
+
.fi-stat-k { font-family: var(--mono); font-size: 8.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }
|
|
744
|
+
.fi-stat-v { margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--text-1); overflow-wrap: anywhere; }
|
|
745
|
+
.fi-check { display: grid; grid-template-columns: auto 1fr; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
|
|
746
|
+
.fi-check:first-child { border-top: 0; padding-top: 0; }
|
|
747
|
+
.fi-dot { width: 18px; height: 18px; border-radius: 6px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-3); }
|
|
748
|
+
.fi-check[data-ok="true"] .fi-dot { color: var(--green); border-color: color-mix(in oklab, var(--green) 30%, transparent); background: var(--green-soft); }
|
|
749
|
+
.fi-check[data-ok="false"] .fi-dot { color: var(--amber); border-color: color-mix(in oklab, var(--amber) 30%, transparent); background: var(--amber-soft); }
|
|
750
|
+
.fi-check-name { font-size: 12px; color: var(--text-1); }
|
|
751
|
+
.fi-check-detail { margin-top: 2px; font-size: 11px; color: var(--text-3); line-height: 1.4; }
|
|
752
|
+
.fi-tree { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-0); padding: 7px 0; }
|
|
753
|
+
.fi-tree-row { display: grid; grid-template-columns: auto 1fr auto; gap: 7px; padding: 3px 9px; font-family: var(--mono); font-size: 9.5px; color: var(--text-2); }
|
|
754
|
+
.fi-tree-row[data-type="directory"] { color: var(--accent-2); }
|
|
755
|
+
.fi-tree-size { color: var(--text-4); }
|
|
756
|
+
.fi-pre { margin: 0; max-height: 320px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-size: 10px; line-height: 1.45; background: var(--surface-0); border: 1px solid var(--line); border-radius: 7px; padding: 10px; color: var(--text-2); }
|
|
757
|
+
.fi-preview + .fi-preview { margin-top: 10px; }
|
|
758
|
+
.fi-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; font-family: var(--mono); font-size: 9.5px; color: var(--text-3); }
|
|
759
|
+
.fi-load { padding: 24px 16px; color: var(--text-3); text-align: center; }
|
|
760
|
+
|
|
761
|
+
.tab-empty { padding: 36px 24px; text-align: center; color: var(--text-3); font-size: 12px; }
|
|
762
|
+
.log-panel { height: 100%; min-height: 0; display: flex; flex-direction: column; background: var(--stream-void); }
|
|
763
|
+
.log-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 14px 18px; font-family: var(--mono); font-size: 11px; line-height: 1.55; }
|
|
764
|
+
.log-section + .log-section { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
|
|
765
|
+
.log-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; color: var(--text-3); }
|
|
766
|
+
.log-section-title { font-size: 9px; letter-spacing: .14em; text-transform: uppercase; }
|
|
767
|
+
.log-section-count { font-size: 9px; color: var(--text-4); }
|
|
768
|
+
.log-row { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; }
|
|
769
|
+
.log-row + .log-row { margin-top: 1px; }
|
|
770
|
+
.log-num { color: var(--text-4); text-align: right; user-select: none; }
|
|
771
|
+
.log-txt { color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
772
|
+
.log-txt.ok { color: var(--green); }
|
|
773
|
+
.log-txt.warn { color: var(--amber); }
|
|
774
|
+
.log-txt.err { color: var(--red); }
|
|
775
|
+
.log-txt.cmd { color: var(--text-1); }
|
|
776
|
+
.log-txt.dim { color: var(--text-3); }
|
|
777
|
+
|
|
778
|
+
/* ============================================================ HISTORY DRAWER */
|
|
779
|
+
.scrim { position: fixed; inset: 0; background: rgba(4,6,9,.5); backdrop-filter: blur(2px); z-index: 70; animation: fade-in .2s ease; }
|
|
780
|
+
html[data-theme="light"] .scrim { background: rgba(20,28,40,.32); }
|
|
781
|
+
.drawer {
|
|
782
|
+
position: fixed; top: 0; bottom: 0; right: 0; z-index: 71;
|
|
783
|
+
width: min(420px, 100vw); background: var(--surface-0);
|
|
784
|
+
border-left: 1px solid var(--line-2); box-shadow: var(--shadow-pop);
|
|
785
|
+
display: flex; flex-direction: column; animation: slide-in .28s var(--ease);
|
|
786
|
+
}
|
|
787
|
+
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 18px 18px 14px; border-bottom: 1px solid var(--line); }
|
|
788
|
+
.drawer-head h2 { margin: 4px 0 0; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
|
|
789
|
+
.drawer-list { flex: 1; min-height: 0; overflow-y: auto; padding: 8px; }
|
|
790
|
+
.run-row { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 11px; align-items: center; padding: 12px; border-radius: var(--radius); transition: background .14s; width: 100%; text-align: left; }
|
|
791
|
+
.run-row:hover { background: var(--surface-1); }
|
|
792
|
+
.run-row[data-active="true"] { background: var(--surface-2); box-shadow: inset 2px 0 0 var(--accent); }
|
|
793
|
+
.run-row .pip { grid-row: span 2; }
|
|
794
|
+
.run-row-id { font-family: var(--mono); font-size: 11.5px; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
795
|
+
.run-row-meta { font-family: var(--mono); font-size: 9.5px; color: var(--text-3); }
|
|
796
|
+
.run-row-stat { font-family: var(--mono); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); grid-row: span 2; justify-self: end; }
|
|
797
|
+
|
|
798
|
+
/* ============================================================ POPOVER (run details) */
|
|
799
|
+
.pop { position: absolute; z-index: 55; top: calc(var(--header-h) - 4px); left: 16px; width: 300px;
|
|
800
|
+
background: var(--surface-1); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-pop);
|
|
801
|
+
padding: 6px; animation: pop-in .16s var(--ease-out); }
|
|
802
|
+
.pop-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 9px; border-radius: var(--radius-sm); }
|
|
803
|
+
.pop-row + .pop-row { border-top: 1px solid var(--line); }
|
|
804
|
+
.pop-k { font-size: 11px; color: var(--text-3); }
|
|
805
|
+
.pop-v { font-family: var(--mono); font-size: 11px; color: var(--text-1); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 190px; }
|
|
806
|
+
.pop-v .tag { padding: 1px 6px; border-radius: 5px; background: var(--surface-3); display: inline-flex; align-items: center; gap: 5px; }
|
|
807
|
+
.pop-v .tag[data-tone="green"] { color: var(--green); background: var(--green-soft); }
|
|
808
|
+
|
|
809
|
+
/* ============================================================ TWEAKS POPOVER */
|
|
810
|
+
.tweaks-pop { position: absolute; z-index: 56; top: calc(var(--header-h) - 4px); right: 16px; width: 264px;
|
|
811
|
+
background: var(--surface-1); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-pop);
|
|
812
|
+
padding: 12px; animation: pop-in .16s var(--ease-out); }
|
|
813
|
+
.tw-sec { font-family: var(--mono); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-4); margin: 10px 2px 7px; }
|
|
814
|
+
.tw-sec:first-child { margin-top: 2px; }
|
|
815
|
+
.tw-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
|
|
816
|
+
.tw-label { font-size: 12px; color: var(--text-2); }
|
|
817
|
+
.tw-seg { display: inline-flex; padding: 2px; background: var(--surface-0); border: 1px solid var(--line); border-radius: var(--radius-sm); }
|
|
818
|
+
.tw-seg button { height: 22px; padding: 0 8px; border-radius: 5px; font-size: 10.5px; color: var(--text-3); text-transform: capitalize; }
|
|
819
|
+
.tw-seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--text-1); }
|
|
820
|
+
.tw-swatches { display: inline-flex; gap: 6px; }
|
|
821
|
+
.tw-swatch { width: 18px; height: 18px; border-radius: 50%; border: 2px solid transparent; }
|
|
822
|
+
.tw-swatch[aria-pressed="true"] { border-color: var(--text-1); }
|
|
823
|
+
|
|
824
|
+
/* ============================================================ EMPTY STATE (no matches) */
|
|
825
|
+
.grid-empty { grid-column: 1 / -1; display: grid; place-items: center; padding: 60px 20px; text-align: center; gap: 12px; color: var(--text-3); }
|
|
826
|
+
.grid-empty .ge-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-1); border: 1px solid var(--line-2); color: var(--text-3); }
|
|
827
|
+
.grid-empty h3 { margin: 0; font-size: 14px; color: var(--text-1); font-weight: 560; }
|
|
828
|
+
.grid-empty button.linklike { color: var(--accent-2); }
|
|
829
|
+
|
|
830
|
+
/* ============================================================ RESPONSIVE */
|
|
831
|
+
@media (max-width: 1100px) {
|
|
832
|
+
:root { --side-w: 320px; }
|
|
833
|
+
.hdr-run-title { max-width: 32vw; }
|
|
834
|
+
.lane-count .lc-label { display: none; }
|
|
835
|
+
}
|
|
836
|
+
@media (max-width: 860px) {
|
|
837
|
+
.focus { display: block; height: 100%; min-height: 0; overflow-y: auto; }
|
|
838
|
+
.focus-rail { display: none; }
|
|
839
|
+
.focus[data-rail="collapsed"] .focus-rail { display: none; }
|
|
840
|
+
.focus-stage { min-height: auto; }
|
|
841
|
+
.focus-stage-area {
|
|
842
|
+
display: block; min-height: min(60vh, 560px); height: auto;
|
|
843
|
+
padding: 14px; overflow: visible;
|
|
844
|
+
}
|
|
845
|
+
.focus-frame {
|
|
846
|
+
width: 100%; height: auto; max-height: none;
|
|
847
|
+
min-height: 280px;
|
|
848
|
+
}
|
|
849
|
+
.focus-side {
|
|
850
|
+
position: relative; left: auto; right: auto; bottom: auto; top: auto; z-index: auto;
|
|
851
|
+
min-height: 360px; max-height: none; border-left: none; border-top: 1px solid var(--line-2);
|
|
852
|
+
border-radius: 0; box-shadow: none; transform: none;
|
|
853
|
+
}
|
|
854
|
+
.focus[data-side="collapsed"] .focus-side { display: none; }
|
|
855
|
+
.focus-side[data-sheet="open"], .focus-side[data-sheet="closed"] { transform: none; }
|
|
856
|
+
.sheet-grip { display: none; }
|
|
857
|
+
}
|
|
858
|
+
.sheet-grip { display: none; align-items: center; justify-content: center; gap: 8px; height: 40px; flex: none; border-bottom: 1px solid var(--line); cursor: grab; }
|
|
859
|
+
.sheet-grip::before { content: ""; width: 36px; height: 4px; border-radius: 2px; background: var(--line-3); }
|
|
860
|
+
|
|
861
|
+
@media (max-width: 720px) {
|
|
862
|
+
:root { --header-h: 50px; }
|
|
863
|
+
.brand-word, .hdr-runs span { display: none; }
|
|
864
|
+
.hdr-run { padding-left: 10px; }
|
|
865
|
+
.hdr-run-title { max-width: 40vw; font-size: 12.5px; }
|
|
866
|
+
.lane-counts { display: none; }
|
|
867
|
+
.run-chip { display: none; }
|
|
868
|
+
.toolbar { gap: 7px; }
|
|
869
|
+
.tb-search { min-width: 0; width: 130px; }
|
|
870
|
+
.tb-label { display: none; }
|
|
871
|
+
.grid-scroll { padding: 12px; }
|
|
872
|
+
.grid { gap: 11px; grid-template-columns: 1fr; }
|
|
873
|
+
.seg.density-seg button span { display: none; }
|
|
874
|
+
}
|
|
875
|
+
@media (max-width: 480px) {
|
|
876
|
+
.seg.media-seg button span, .seg.view-seg button span { display: none; }
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
/* ============================================================ KEYFRAMES */
|
|
880
|
+
@keyframes ping { 0% { transform: scale(.6); opacity: .5; } 100% { transform: scale(2.4); opacity: 0; } }
|
|
881
|
+
@keyframes spin { to { transform: rotate(360deg); } }
|
|
882
|
+
@keyframes blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
|
|
883
|
+
@keyframes tile-in { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
|
|
884
|
+
@keyframes line-in { from { transform: translateY(4px); } to { transform: none; } }
|
|
885
|
+
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
|
|
886
|
+
@keyframes slide-in { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }
|
|
887
|
+
@keyframes pop-in { from { transform: translateY(-6px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
|
|
888
|
+
@keyframes clickpulse { 0% { transform: scale(.5); opacity: .9; } 100% { transform: scale(1.5); opacity: 0; } }
|
|
889
|
+
@keyframes console-up { from { opacity: 0; } to { opacity: 1; } }
|
|
890
|
+
|
|
891
|
+
@media (prefers-reduced-motion: reduce) {
|
|
892
|
+
*, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
|
|
893
|
+
}
|
|
894
|
+
html[data-motion="reduced"] *, html[data-motion="reduced"] *::before, html[data-motion="reduced"] *::after {
|
|
895
|
+
animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important;
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
/* ============================================================ DROPDOWN FILTERS */
|
|
899
|
+
.dd { position: relative; flex: none; }
|
|
900
|
+
.dd-trigger {
|
|
901
|
+
display: inline-flex; align-items: center; gap: 7px;
|
|
902
|
+
height: 30px; padding: 0 9px 0 11px; border-radius: var(--radius-sm);
|
|
903
|
+
border: 1px solid var(--line-2); color: var(--text-2); font-size: 12px;
|
|
904
|
+
transition: background .15s, color .15s, border-color .15s; white-space: nowrap;
|
|
905
|
+
}
|
|
906
|
+
.dd-trigger:hover { background: var(--surface-2); color: var(--text-1); }
|
|
907
|
+
.dd-trigger[data-active="true"] { background: var(--surface-3); color: var(--text-1); border-color: var(--line-3); }
|
|
908
|
+
.dd-trigger svg:last-child { color: var(--text-3); }
|
|
909
|
+
.dd-trigger-inner { display: inline-flex; align-items: center; gap: 7px; }
|
|
910
|
+
.dd-badge {
|
|
911
|
+
min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
|
|
912
|
+
background: var(--accent-color); color: #fff; font-family: var(--mono); font-size: 9.5px;
|
|
913
|
+
display: inline-grid; place-items: center; font-weight: 600;
|
|
914
|
+
}
|
|
915
|
+
.dd-menu {
|
|
916
|
+
position: fixed; z-index: 90;
|
|
917
|
+
background: var(--surface-1); border: 1px solid var(--line-2); border-radius: var(--radius);
|
|
918
|
+
box-shadow: var(--shadow-pop); padding: 5px; animation: pop-in .14s var(--ease-out);
|
|
919
|
+
}
|
|
920
|
+
.dd-row {
|
|
921
|
+
display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 9px;
|
|
922
|
+
border-radius: var(--radius-sm); text-align: left; color: var(--text-2); font-size: 12.5px;
|
|
923
|
+
transition: background .12s;
|
|
924
|
+
}
|
|
925
|
+
.dd-row:hover { background: var(--surface-2); color: var(--text-1); }
|
|
926
|
+
.dd-row-all { color: var(--text-1); }
|
|
927
|
+
.dd-row-label { flex: 1; }
|
|
928
|
+
.dd-row-n { color: var(--text-3); font-size: 11px; }
|
|
929
|
+
.dd-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
|
|
930
|
+
.dd-check {
|
|
931
|
+
width: 16px; height: 16px; border-radius: 5px; border: 1px solid var(--line-3);
|
|
932
|
+
display: grid; place-items: center; flex: none; color: #fff; transition: background .12s, border-color .12s;
|
|
933
|
+
}
|
|
934
|
+
.dd-check[data-on="true"] { background: var(--accent-color); border-color: var(--accent-color); }
|
|
935
|
+
.dd-check svg { width: 11px; height: 11px; }
|
|
936
|
+
.dd-sep { height: 1px; background: var(--line); margin: 5px 4px; }
|
|
937
|
+
|
|
938
|
+
.tb-result { font-family: var(--mono); font-size: 11px; color: var(--text-3); flex: none; padding-left: 2px; }
|
|
939
|
+
.lane-groups { display: inline-flex; align-items: center; gap: 5px; flex: none; min-width: 0; }
|
|
940
|
+
.lane-group-chip {
|
|
941
|
+
display: inline-flex; align-items: center; gap: 5px;
|
|
942
|
+
height: 24px; padding: 0 8px; border-radius: var(--radius-pill);
|
|
943
|
+
border: 1px solid var(--line); color: var(--text-2); background: var(--surface-1);
|
|
944
|
+
font-size: 10.5px; white-space: nowrap; max-width: 170px;
|
|
945
|
+
}
|
|
946
|
+
.lane-group-k { color: var(--text-4); font-family: var(--mono); }
|
|
947
|
+
.lane-group-v { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
|
|
948
|
+
.lane-group-n { color: var(--text-3); font-family: var(--mono); }
|
|
949
|
+
|
|
950
|
+
/* compact icon-only segmented controls on the right */
|
|
951
|
+
.seg.view-seg button, .seg.media-seg button, .seg.density-seg button { width: 30px; padding: 0; justify-content: center; }
|
|
952
|
+
|
|
953
|
+
/* ============================================================ STATUS INDICATOR (header) */
|
|
954
|
+
.si-badges { display: inline-flex; align-items: center; gap: 4px; flex: none; }
|
|
955
|
+
.si-badge {
|
|
956
|
+
display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 9px;
|
|
957
|
+
border-radius: var(--radius-pill); border: 1px solid transparent; transition: background .15s, border-color .15s;
|
|
958
|
+
}
|
|
959
|
+
.si-badge:hover { background: var(--surface-2); }
|
|
960
|
+
.si-badge[aria-pressed="true"] { background: var(--surface-3); border-color: var(--line-2); }
|
|
961
|
+
.si-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
|
|
962
|
+
.si-n { font-size: 12px; color: var(--text-1); font-weight: 600; }
|
|
963
|
+
|
|
964
|
+
.si-bar { display: inline-flex; align-items: center; gap: 9px; flex: none; min-width: 140px; }
|
|
965
|
+
.si-bar-track { display: flex; height: 8px; flex: 1; border-radius: 999px; overflow: hidden; background: var(--surface-3); gap: 2px; }
|
|
966
|
+
.si-bar-seg { min-width: 4px; cursor: pointer; transition: filter .15s; }
|
|
967
|
+
.si-bar-seg:hover { filter: brightness(1.2); }
|
|
968
|
+
.si-bar-label { font-size: 11px; color: var(--text-2); }
|
|
969
|
+
|
|
970
|
+
.si-ring { display: inline-flex; align-items: center; gap: 8px; padding: 2px 6px 2px 2px; border-radius: var(--radius-pill); transition: background .15s; }
|
|
971
|
+
.si-ring:hover { background: var(--surface-2); }
|
|
972
|
+
.si-ring-meta { display: flex; flex-direction: column; line-height: 1.1; align-items: flex-start; }
|
|
973
|
+
.si-ring-pct { font-size: 12px; color: var(--text-1); font-weight: 600; }
|
|
974
|
+
.si-ring-issue { font-size: 9.5px; }
|
|
975
|
+
|
|
976
|
+
/* ============================================================ RUN CONSOLE */
|
|
977
|
+
.console {
|
|
978
|
+
display: flex; flex-direction: column; min-height: 0; flex: none;
|
|
979
|
+
background: var(--surface-0); border-top: 1px solid var(--line-2);
|
|
980
|
+
box-shadow: 0 -10px 30px rgba(0,0,0,.25); animation: console-up .26s var(--ease);
|
|
981
|
+
}
|
|
982
|
+
.console-head { display: flex; align-items: center; gap: 11px; padding: 0 12px; height: 38px; flex: none; border-bottom: 1px solid var(--line); }
|
|
983
|
+
.console-title { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-1); font-weight: 520; }
|
|
984
|
+
.console-title svg { color: var(--text-3); }
|
|
985
|
+
.console-cmd { font-size: 10.5px; color: var(--text-3); background: var(--surface-2); padding: 2px 7px; border-radius: 5px; }
|
|
986
|
+
.console-live { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-2); }
|
|
987
|
+
.console-meta { font-size: 10.5px; color: var(--text-3); }
|
|
988
|
+
.console-body { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 12px; font-size: 11.5px; line-height: 1.6; }
|
|
989
|
+
.console-line { display: flex; gap: 12px; }
|
|
990
|
+
.console-t { color: var(--text-4); flex: none; user-select: none; }
|
|
991
|
+
.console-txt { color: var(--text-2); overflow-wrap: anywhere; }
|
|
992
|
+
.console-txt.info { color: var(--text-2); }
|
|
993
|
+
.console-txt.ok { color: var(--green); }
|
|
994
|
+
.console-txt.warn { color: var(--amber); }
|
|
995
|
+
.console-txt.err { color: var(--red); }
|
|
996
|
+
.console-txt.dim { color: var(--text-3); }
|
|
997
|
+
|
|
998
|
+
@media (max-width: 720px) {
|
|
999
|
+
.tb-result { display: none; }
|
|
1000
|
+
.lane-groups { display: none; }
|
|
1001
|
+
.dd-trigger-inner span { max-width: 64px; overflow: hidden; text-overflow: ellipsis; }
|
|
1002
|
+
.console { height: 200px !important; }
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
/* ============================================================ STATUS BAR (persistent footer) */
|
|
1006
|
+
.statusbar {
|
|
1007
|
+
display: flex; align-items: center; gap: 12px; flex: none;
|
|
1008
|
+
height: 30px; padding: 0 12px;
|
|
1009
|
+
background: var(--surface-0); border-top: 1px solid var(--line-2);
|
|
1010
|
+
font-size: 11.5px; position: relative; z-index: 25;
|
|
1011
|
+
}
|
|
1012
|
+
.sb-status { display: inline-flex; align-items: center; gap: 7px; flex: none; }
|
|
1013
|
+
.sb-status-label { font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); }
|
|
1014
|
+
.sb-status[data-tone="running"] .sb-status-label { color: var(--accent-2); }
|
|
1015
|
+
.sb-status[data-tone="failed"] .sb-status-label { color: var(--red); }
|
|
1016
|
+
.sb-status[data-tone="blocked"] .sb-status-label { color: var(--amber); }
|
|
1017
|
+
.sb-status[data-tone="complete"] .sb-status-label { color: var(--green); }
|
|
1018
|
+
.sb-pct { color: var(--text-3); font-size: 11px; }
|
|
1019
|
+
.sb-prog { width: 90px; height: 4px; border-radius: 999px; background: var(--surface-3); overflow: hidden; flex: none; }
|
|
1020
|
+
.sb-prog > span { display: block; height: 100%; background: var(--accent-color); transition: width .6s var(--ease-out); }
|
|
1021
|
+
.sb-prog > span[data-tone="failed"] { background: var(--red); }
|
|
1022
|
+
.sb-prog > span[data-tone="complete"] { background: var(--green); }
|
|
1023
|
+
.sb-prog > span[data-tone="blocked"] { background: var(--amber); }
|
|
1024
|
+
.sb-counts { display: inline-flex; align-items: center; gap: 8px; flex: none; }
|
|
1025
|
+
.sb-count { display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); }
|
|
1026
|
+
.sb-count .si-dot { width: 7px; height: 7px; border-radius: 50%; }
|
|
1027
|
+
.sb-run { color: var(--text-4); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
1028
|
+
|
|
1029
|
+
.sb-console {
|
|
1030
|
+
display: inline-flex; align-items: center; gap: 8px; flex: none; max-width: 52vw;
|
|
1031
|
+
height: 30px; padding: 0 4px 0 11px; color: var(--text-2);
|
|
1032
|
+
border-left: 1px solid var(--line); transition: color .15s, background .15s;
|
|
1033
|
+
}
|
|
1034
|
+
.sb-console:hover { color: var(--text-1); background: var(--surface-1); }
|
|
1035
|
+
.sb-console[aria-expanded="true"] { color: var(--text-1); background: var(--surface-2); }
|
|
1036
|
+
.sb-console svg:first-child { color: var(--text-3); }
|
|
1037
|
+
.sb-console-label { font-size: 11.5px; flex: none; }
|
|
1038
|
+
.sb-console-peek { display: inline-flex; align-items: center; gap: 8px; min-width: 0; padding-left: 8px; border-left: 1px solid var(--line); }
|
|
1039
|
+
.sb-peek-t { color: var(--text-4); flex: none; font-size: 10px; }
|
|
1040
|
+
.sb-peek-txt { color: var(--text-3); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30vw; }
|
|
1041
|
+
.sb-peek-txt.ok { color: color-mix(in oklab, var(--green) 80%, var(--text-2)); }
|
|
1042
|
+
.sb-peek-txt.warn { color: color-mix(in oklab, var(--amber) 85%, var(--text-2)); }
|
|
1043
|
+
.sb-peek-txt.err { color: color-mix(in oklab, var(--red) 85%, var(--text-2)); }
|
|
1044
|
+
.sb-chev { display: inline-grid; place-items: center; color: var(--text-3); transition: transform .2s var(--ease); }
|
|
1045
|
+
.sb-chev.open { transform: rotate(180deg); }
|
|
1046
|
+
/* when docked above the bar, drop the console's bottom rounding/shadow seam */
|
|
1047
|
+
.console + .statusbar { border-top-color: var(--line); }
|
|
1048
|
+
|
|
1049
|
+
@media (max-width: 720px) {
|
|
1050
|
+
.sb-counts, .sb-run, .sb-prog { display: none; }
|
|
1051
|
+
.sb-console-label { display: none; }
|
|
1052
|
+
.sb-peek-txt { max-width: 44vw; }
|
|
1053
|
+
}
|
|
1054
|
+
@media (max-width: 480px) {
|
|
1055
|
+
.sb-console-peek { display: none; }
|
|
1056
|
+
}
|
|
1057
|
+
`;
|
|
1058
|
+
}
|
|
1059
|
+
export function observerClientJs() {
|
|
1060
|
+
return `
|
|
1061
|
+
(function () {
|
|
1062
|
+
"use strict";
|
|
1063
|
+
|
|
1064
|
+
// ---------------------------------------------------------------- hydrate
|
|
1065
|
+
var DATA_FILE = "observer-data.json";
|
|
1066
|
+
var REFRESH_MS = 5000;
|
|
1067
|
+
var dataEl = document.getElementById("observer-data");
|
|
1068
|
+
var currentData = null;
|
|
1069
|
+
try { currentData = JSON.parse((dataEl && dataEl.textContent) || "null"); } catch (e) { currentData = null; }
|
|
1070
|
+
if (!currentData || typeof currentData !== "object") currentData = {};
|
|
1071
|
+
if (!currentData.run) currentData.run = {};
|
|
1072
|
+
if (!currentData.streams) currentData.streams = [];
|
|
1073
|
+
if (!currentData.events) currentData.events = [];
|
|
1074
|
+
if (!currentData.laneGroups) currentData.laneGroups = [];
|
|
1075
|
+
|
|
1076
|
+
var app = document.getElementById("app");
|
|
1077
|
+
var historyIndex = null;
|
|
1078
|
+
var refreshTimer = null;
|
|
1079
|
+
var historyTimer = null;
|
|
1080
|
+
var openDd = null;
|
|
1081
|
+
var NL = String.fromCharCode(10);
|
|
1082
|
+
var CR = String.fromCharCode(13);
|
|
1083
|
+
var TIMES = String.fromCharCode(215);
|
|
1084
|
+
|
|
1085
|
+
// ---------------------------------------------------------------- prefs
|
|
1086
|
+
function readPref(key, fallback) {
|
|
1087
|
+
try { var raw = window.localStorage.getItem("humanish-observer:" + key); return raw == null ? fallback : JSON.parse(raw); }
|
|
1088
|
+
catch (e) { return fallback; }
|
|
1089
|
+
}
|
|
1090
|
+
function writePref(key, value) {
|
|
1091
|
+
try { window.localStorage.setItem("humanish-observer:" + key, JSON.stringify(value)); } catch (e) {}
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
function focusFromHash() {
|
|
1095
|
+
var h = String(window.location.hash || "");
|
|
1096
|
+
if (h.indexOf("focus=") < 0) return null;
|
|
1097
|
+
try { return decodeURIComponent(h.split("focus=")[1].split("&")[0]); } catch (e) { return null; }
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
// ---------------------------------------------------------------- state
|
|
1101
|
+
var initialFocusId = focusFromHash();
|
|
1102
|
+
var S = {
|
|
1103
|
+
view: initialFocusId ? "focus" : "grid",
|
|
1104
|
+
focusedId: initialFocusId,
|
|
1105
|
+
statusSel: [],
|
|
1106
|
+
kindSel: [],
|
|
1107
|
+
query: "",
|
|
1108
|
+
media: "live",
|
|
1109
|
+
historyOpen: false,
|
|
1110
|
+
detailsOpen: false,
|
|
1111
|
+
tweaksOpen: false,
|
|
1112
|
+
consoleOpen: false,
|
|
1113
|
+
filePath: null,
|
|
1114
|
+
railCollapsed: !!readPref("railCollapsed", false),
|
|
1115
|
+
sideCollapsed: !!readPref("sideCollapsed", false),
|
|
1116
|
+
sheetOpen: false,
|
|
1117
|
+
tab: "logs",
|
|
1118
|
+
theme: readPref("theme", "dark"),
|
|
1119
|
+
accent: readPref("accent", "#4d7cfe"),
|
|
1120
|
+
density: readPref("density", "comfortable"),
|
|
1121
|
+
statusViz: readPref("statusViz", "badges"),
|
|
1122
|
+
motion: readPref("motion", "full")
|
|
1123
|
+
};
|
|
1124
|
+
var artifactCache = {};
|
|
1125
|
+
var liveStreamFrames = {};
|
|
1126
|
+
var liveStreamHost = null;
|
|
1127
|
+
var liveStreamLayoutRaf = null;
|
|
1128
|
+
|
|
1129
|
+
// ---------------------------------------------------------------- tone / labels
|
|
1130
|
+
var TONE = {
|
|
1131
|
+
queued: "queued", preparing: "running", running: "running",
|
|
1132
|
+
passed: "complete", complete: "complete", contract_proof_only: "complete",
|
|
1133
|
+
blocked: "blocked", timed_out: "blocked", failed: "failed"
|
|
1134
|
+
};
|
|
1135
|
+
var STATUS_LABEL = {
|
|
1136
|
+
queued: "Queued", preparing: "Preparing", running: "Running", passed: "Passed",
|
|
1137
|
+
complete: "Complete", contract_proof_only: "Proof only", blocked: "Blocked",
|
|
1138
|
+
timed_out: "Timed out", failed: "Failed"
|
|
1139
|
+
};
|
|
1140
|
+
function tone(s) { return TONE[s] || "queued"; }
|
|
1141
|
+
function statusLabel(s) { return STATUS_LABEL[s] || s || "Unknown"; }
|
|
1142
|
+
function kindGroup(k) { return k === "browser" ? "ui" : k; }
|
|
1143
|
+
|
|
1144
|
+
// ---------------------------------------------------------------- esc / icons
|
|
1145
|
+
function esc(v) {
|
|
1146
|
+
return String(v == null ? "" : v)
|
|
1147
|
+
.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
1148
|
+
}
|
|
1149
|
+
function pad2(n) { return (n < 10 ? "0" : "") + n; }
|
|
1150
|
+
|
|
1151
|
+
var P = ' fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"';
|
|
1152
|
+
var ICONS = {
|
|
1153
|
+
grid: '<rect x="3" y="3" width="7" height="7" rx="1.4"' + P + '/><rect x="14" y="3" width="7" height="7" rx="1.4"' + P + '/><rect x="3" y="14" width="7" height="7" rx="1.4"' + P + '/><rect x="14" y="14" width="7" height="7" rx="1.4"' + P + '/>',
|
|
1154
|
+
focus: '<rect x="3" y="4" width="18" height="16" rx="2"' + P + '/><path d="M3 9h18"' + P + '/>',
|
|
1155
|
+
expand: '<path d="M9 4H5a1 1 0 0 0-1 1v4M15 4h4a1 1 0 0 1 1 1v4M9 20H5a1 1 0 0 1-1-1v-4M15 20h4a1 1 0 0 0 1-1v-4"' + P + '/>',
|
|
1156
|
+
search: '<circle cx="11" cy="11" r="7"' + P + '/><path d="m20 20-3-3"' + P + '/>',
|
|
1157
|
+
clock: '<circle cx="12" cy="12" r="9"' + P + '/><path d="M12 7v5l3 2"' + P + '/>',
|
|
1158
|
+
sun: '<circle cx="12" cy="12" r="4"' + P + '/><path d="M12 2v2M12 20v2M4 12H2M22 12h-2M5 5l1.5 1.5M17.5 17.5 19 19M19 5l-1.5 1.5M6.5 17.5 5 19"' + P + '/>',
|
|
1159
|
+
moon: '<path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8Z"' + P + '/>',
|
|
1160
|
+
chevL: '<path d="m15 18-6-6 6-6"' + P + '/>',
|
|
1161
|
+
chevR: '<path d="m9 18 6-6-6-6"' + P + '/>',
|
|
1162
|
+
x: '<path d="M6 6l12 12M18 6 6 18"' + P + '/>',
|
|
1163
|
+
sliders: '<path d="M4 6h10M18 6h2M4 12h2M10 12h10M4 18h7M15 18h5"' + P + '/><circle cx="16" cy="6" r="2"' + P + '/><circle cx="8" cy="12" r="2"' + P + '/><circle cx="13" cy="18" r="2"' + P + '/>',
|
|
1164
|
+
comfy: '<rect x="3" y="4" width="18" height="7" rx="1.4"' + P + '/><rect x="3" y="13" width="18" height="7" rx="1.4"' + P + '/>',
|
|
1165
|
+
compact: '<rect x="3" y="4" width="8" height="7" rx="1.2"' + P + '/><rect x="13" y="4" width="8" height="7" rx="1.2"' + P + '/><rect x="3" y="13" width="8" height="7" rx="1.2"' + P + '/><rect x="13" y="13" width="8" height="7" rx="1.2"' + P + '/>',
|
|
1166
|
+
dense: '<rect x="3" y="4" width="5" height="5" rx="1"' + P + '/><rect x="10" y="4" width="5" height="5" rx="1"' + P + '/><rect x="17" y="4" width="4" height="5" rx="1"' + P + '/><rect x="3" y="11" width="5" height="5" rx="1"' + P + '/><rect x="10" y="11" width="5" height="5" rx="1"' + P + '/><rect x="17" y="11" width="4" height="5" rx="1"' + P + '/>',
|
|
1167
|
+
image: '<rect x="3" y="4" width="18" height="16" rx="2"' + P + '/><circle cx="9" cy="10" r="1.6"' + P + '/><path d="m4 18 5-4 4 3 3-2 4 3"' + P + '/>',
|
|
1168
|
+
live: '<circle cx="12" cy="12" r="3"' + P + '/><path d="M6.5 6.5a8 8 0 0 0 0 11M17.5 6.5a8 8 0 0 1 0 11M4 4a12 12 0 0 0 0 16M20 4a12 12 0 0 1 0 16"' + P + '/>',
|
|
1169
|
+
file: '<path d="M14 3v5h5"' + P + '/><path d="M6 3h8l5 5v11a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Z"' + P + '/>',
|
|
1170
|
+
list: '<path d="M8 6h12M8 12h12M8 18h12M3.5 6h.01M3.5 12h.01M3.5 18h.01"' + P + '/>',
|
|
1171
|
+
terminal: '<path d="m6 8 3.5 3L6 14M13 15h5"' + P + '/><rect x="3" y="4" width="18" height="16" rx="2"' + P + '/>',
|
|
1172
|
+
spark: '<path d="M12 3v4M12 17v4M3 12h4M17 12h4M6 6l2.5 2.5M15.5 15.5 18 18M18 6l-2.5 2.5M8.5 15.5 6 18"' + P + '/>',
|
|
1173
|
+
check: '<path d="m4 12 5 5L20 6"' + P + '/>',
|
|
1174
|
+
alert: '<path d="M12 8v5M12 16.5h.01"' + P + '/><path d="M10.3 3.9 2.4 18a2 2 0 0 0 1.7 3h15.8a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z"' + P + '/>',
|
|
1175
|
+
info: '<circle cx="12" cy="12" r="9"' + P + '/><path d="M12 11v5M12 8h.01"' + P + '/>',
|
|
1176
|
+
globe: '<circle cx="12" cy="12" r="9"' + P + '/><path d="M3 12h18M12 3c2.5 2.7 2.5 15.3 0 18M12 3c-2.5 2.7-2.5 15.3 0 18"' + P + '/>',
|
|
1177
|
+
lock: '<rect x="4.5" y="10" width="15" height="10" rx="2"' + P + '/><path d="M8 10V7a4 4 0 0 1 8 0v3"' + P + '/>',
|
|
1178
|
+
caret: '<path d="m6 9 6 6 6-6"' + P + '/>',
|
|
1179
|
+
filter: '<path d="M3 5h18l-7 8.2V20l-4-2.2v-4.6L3 5Z"' + P + '/>',
|
|
1180
|
+
panelRight: '<rect x="3" y="4" width="18" height="16" rx="2"' + P + '/><path d="M15 4v16"' + P + '/>'
|
|
1181
|
+
};
|
|
1182
|
+
function icon(name, size) {
|
|
1183
|
+
var s = size || 18;
|
|
1184
|
+
return '<svg viewBox="0 0 24 24" width="' + s + '" height="' + s + '" aria-hidden="true">' + (ICONS[name] || ICONS.info) + '</svg>';
|
|
1185
|
+
}
|
|
1186
|
+
function pip(status, live) {
|
|
1187
|
+
return '<span class="pip" data-status="' + esc(status) + '" data-live="' + (live ? "true" : "false") + '"></span>';
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
// ---------------------------------------------------------------- derive (observer-data.v1 -> display)
|
|
1191
|
+
function laneName(s) { return s.label || (s.sim && s.sim.summary) || s.id || "lane"; }
|
|
1192
|
+
function laneRoute(s) { return (s.ui && (s.ui.route || s.ui.appUrl || s.ui.nestedObserverUrl)) || s.url || (s.terminal && s.terminal.title) || ""; }
|
|
1193
|
+
function laneProgress(s) {
|
|
1194
|
+
if (s.sim && typeof s.sim.progress === "number") return Math.max(0, Math.min(100, Math.round(s.sim.progress)));
|
|
1195
|
+
var t = tone(s.status);
|
|
1196
|
+
return (t === "complete" || t === "failed") ? 100 : 0;
|
|
1197
|
+
}
|
|
1198
|
+
function laneStep(s) { return (s.sim && s.sim.currentStep) || s.statusLabel || statusLabel(s.status); }
|
|
1199
|
+
function laneSummary(s) { return (s.sim && s.sim.summary) || ""; }
|
|
1200
|
+
function laneEvents(s) { return s.timeline || []; }
|
|
1201
|
+
function laneArtifacts(s) { return s.artifacts || []; }
|
|
1202
|
+
|
|
1203
|
+
function aspectFor(s) {
|
|
1204
|
+
if (s.kind === "terminal" || s.kind === "tui") return "16 / 10";
|
|
1205
|
+
var vp = s.viewport;
|
|
1206
|
+
if (vp && vp.height > vp.width) return vp.width + " / " + vp.height;
|
|
1207
|
+
return "16 / 9";
|
|
1208
|
+
}
|
|
1209
|
+
function dimsFor(s) {
|
|
1210
|
+
if (s.kind === "terminal") return "CLI";
|
|
1211
|
+
if (s.kind === "tui") return "TUI";
|
|
1212
|
+
if (s.kind === "codex-ui") return "CODEX";
|
|
1213
|
+
var vp = s.viewport;
|
|
1214
|
+
if (vp) return vp.width > vp.height ? (vp.width + TIMES + vp.height) : "MOB";
|
|
1215
|
+
return "SIM";
|
|
1216
|
+
}
|
|
1217
|
+
function initials(name) {
|
|
1218
|
+
var parts = String(name || "").replace(/[^a-zA-Z0-9]+/g, " ").trim().split(" ");
|
|
1219
|
+
return (((parts[0] || "")[0] || "") + ((parts[1] || "")[0] || "")).toUpperCase();
|
|
1220
|
+
}
|
|
1221
|
+
function laneCounts(streams) {
|
|
1222
|
+
var c = { running: 0, complete: 0, blocked: 0, failed: 0 };
|
|
1223
|
+
streams.forEach(function (s) {
|
|
1224
|
+
var t = tone(s.status);
|
|
1225
|
+
if (t === "running") c.running += 1;
|
|
1226
|
+
else if (t === "complete") c.complete += 1;
|
|
1227
|
+
else if (t === "blocked") c.blocked += 1;
|
|
1228
|
+
else if (t === "failed") c.failed += 1;
|
|
1229
|
+
});
|
|
1230
|
+
return c;
|
|
1231
|
+
}
|
|
1232
|
+
function shortTime(v) {
|
|
1233
|
+
if (!v) return "";
|
|
1234
|
+
var d = new Date(v);
|
|
1235
|
+
if (isNaN(d.getTime())) return String(v);
|
|
1236
|
+
return d.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", second: "2-digit" });
|
|
1237
|
+
}
|
|
1238
|
+
function shortStamp(v) {
|
|
1239
|
+
if (!v) return "";
|
|
1240
|
+
var d = new Date(v);
|
|
1241
|
+
if (isNaN(d.getTime())) return String(v);
|
|
1242
|
+
return d.toLocaleString([], { month: "short", day: "numeric", hour: "2-digit", minute: "2-digit" });
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
function hasText(low, list) {
|
|
1246
|
+
for (var i = 0; i < list.length; i += 1) { if (low.indexOf(list[i]) >= 0) return true; }
|
|
1247
|
+
return false;
|
|
1248
|
+
}
|
|
1249
|
+
function classify(line) {
|
|
1250
|
+
var t = String(line == null ? "" : line).trim();
|
|
1251
|
+
if (!t) return "dim";
|
|
1252
|
+
var c0 = t.charAt(0);
|
|
1253
|
+
if (c0 === "$" || c0 === "#" || c0 === ">") return "cmd";
|
|
1254
|
+
var low = t.toLowerCase();
|
|
1255
|
+
if (t.indexOf("FAIL") >= 0 || t.indexOf("✗") >= 0 || t.indexOf("✘") >= 0 ||
|
|
1256
|
+
hasText(low, ["fail", "error", "not found", "missing", "cannot", "denied", "unreachable", "unresolved"])) return "err";
|
|
1257
|
+
if (t.indexOf("✓") >= 0 || t.indexOf("✔") >= 0 ||
|
|
1258
|
+
hasText(low, ["ok ", " ok", "passed", "granted", "ready", "success", "succeeded", "completed", "emitted", "scaffolded"])) return "ok";
|
|
1259
|
+
if (t.indexOf("⚠") >= 0 || hasText(low, ["warn", "pending", "timeout", "timed out", "retry", "skipped", "best-effort", "blocked"])) return "warn";
|
|
1260
|
+
if ("┌│└├─╭╰╮╯═┐┘".indexOf(c0) >= 0) return "dim";
|
|
1261
|
+
return "";
|
|
1262
|
+
}
|
|
1263
|
+
function termLines(s) {
|
|
1264
|
+
var raw = (s.terminalPlain != null ? s.terminalPlain : (s.terminal ? s.terminal.tail : "")) || "";
|
|
1265
|
+
var arr = String(raw).split(NL);
|
|
1266
|
+
while (arr.length && arr[arr.length - 1].trim() === "") arr.pop();
|
|
1267
|
+
return arr.map(function (line) { return { text: line, cls: classify(line) }; });
|
|
1268
|
+
}
|
|
1269
|
+
function cleanLogText(v) {
|
|
1270
|
+
return String(v == null ? "" : v).split(CR).join("").trim();
|
|
1271
|
+
}
|
|
1272
|
+
function splitLogText(v) {
|
|
1273
|
+
var raw = cleanLogText(v);
|
|
1274
|
+
if (!raw) return [];
|
|
1275
|
+
var arr = raw.split(NL);
|
|
1276
|
+
while (arr.length && arr[arr.length - 1].trim() === "") arr.pop();
|
|
1277
|
+
return arr.map(function (line) { return { text: line, cls: classify(line) }; });
|
|
1278
|
+
}
|
|
1279
|
+
function logSections(s) {
|
|
1280
|
+
var c = s.completion || {};
|
|
1281
|
+
var sections = [];
|
|
1282
|
+
var actorLast = splitLogText(c.actorLastMessageTail || "");
|
|
1283
|
+
var actorLog = splitLogText(c.actorLogTail || "");
|
|
1284
|
+
var bootstrap = splitLogText(c.logTail || "");
|
|
1285
|
+
var terminal = termLines(s);
|
|
1286
|
+
var terminalRaw = cleanLogText(s.terminalPlain != null ? s.terminalPlain : (s.terminal ? s.terminal.tail : ""));
|
|
1287
|
+
var actorRaw = cleanLogText((c.actorLastMessageTail || "") + NL + (c.actorLogTail || "") + NL + (c.logTail || ""));
|
|
1288
|
+
if (actorLast.length) sections.push({ id: "actor-last", title: "Actor last message", lines: actorLast });
|
|
1289
|
+
if (actorLog.length) sections.push({ id: "actor-log", title: "Codex agent log", lines: actorLog });
|
|
1290
|
+
if (bootstrap.length) sections.push({ id: "bootstrap-log", title: "Bootstrap log", lines: bootstrap });
|
|
1291
|
+
if (terminal.length && (!actorRaw || actorRaw.indexOf(terminalRaw) < 0)) {
|
|
1292
|
+
sections.push({ id: "lane-summary", title: actorRaw ? "Lane summary" : "Lane log", lines: terminal });
|
|
1293
|
+
}
|
|
1294
|
+
return sections;
|
|
1295
|
+
}
|
|
1296
|
+
function hasAgentLogs(s) {
|
|
1297
|
+
var c = s.completion || {};
|
|
1298
|
+
return !!(cleanLogText(c.actorLastMessageTail || "") || cleanLogText(c.actorLogTail || ""));
|
|
1299
|
+
}
|
|
1300
|
+
function logLineCount(s) {
|
|
1301
|
+
return logSections(s).reduce(function (sum, section) { return sum + section.lines.length; }, 0);
|
|
1302
|
+
}
|
|
1303
|
+
function clip(v, n) {
|
|
1304
|
+
var s = String(v == null ? "" : v).trim();
|
|
1305
|
+
if (!s) return "";
|
|
1306
|
+
return s.length > n ? (s.slice(0, Math.max(0, n - 1)) + "…") : s;
|
|
1307
|
+
}
|
|
1308
|
+
function shortSurfaceValue(v) {
|
|
1309
|
+
var s = String(v == null ? "" : v).trim();
|
|
1310
|
+
if (!s) return "";
|
|
1311
|
+
var cut = s.split("?")[0].split("#")[0];
|
|
1312
|
+
var parts = cut.split("/");
|
|
1313
|
+
var tail = parts.filter(function (p) { return !!p; }).slice(-2).join("/");
|
|
1314
|
+
return clip(tail || cut || s, 48);
|
|
1315
|
+
}
|
|
1316
|
+
function linkHref(v, artifactPath) {
|
|
1317
|
+
var raw = String(v == null ? "" : v).trim();
|
|
1318
|
+
var low = raw.toLowerCase();
|
|
1319
|
+
if (!raw) return "";
|
|
1320
|
+
if (low.indexOf("http://") === 0 || low.indexOf("https://") === 0 || low.indexOf("file:") === 0) return raw;
|
|
1321
|
+
if (raw.indexOf("://") >= 0) return "";
|
|
1322
|
+
if (raw.charAt(0) === "/" || raw.indexOf("..") >= 0) return "";
|
|
1323
|
+
return artifactPath ? ("../" + raw) : raw;
|
|
1324
|
+
}
|
|
1325
|
+
function runArtifactHref(v) {
|
|
1326
|
+
var raw = String(v == null ? "" : v).trim();
|
|
1327
|
+
var low = raw.toLowerCase();
|
|
1328
|
+
if (!raw) return "";
|
|
1329
|
+
if (low.indexOf("http://") === 0 || low.indexOf("https://") === 0 || low.indexOf("file:") === 0) return raw;
|
|
1330
|
+
if (raw.indexOf("://") >= 0 || raw.charAt(0) === "/") return "";
|
|
1331
|
+
if (raw.indexOf("../") === 0 && raw.indexOf("../..") !== 0 && raw.indexOf("/../") < 0) return raw;
|
|
1332
|
+
if (raw.indexOf("..") >= 0) return "";
|
|
1333
|
+
return "../" + raw;
|
|
1334
|
+
}
|
|
1335
|
+
function firstArtifactKind(s, kind) {
|
|
1336
|
+
var arts = laneArtifacts(s);
|
|
1337
|
+
for (var i = 0; i < arts.length; i += 1) {
|
|
1338
|
+
if (arts[i] && arts[i].kind === kind) return arts[i];
|
|
1339
|
+
}
|
|
1340
|
+
return null;
|
|
1341
|
+
}
|
|
1342
|
+
function artifactKinds(arts) {
|
|
1343
|
+
var seen = {}, out = [];
|
|
1344
|
+
arts.forEach(function (a) {
|
|
1345
|
+
var k = (a && a.kind) || "file";
|
|
1346
|
+
if (!seen[k]) { seen[k] = true; out.push(k); }
|
|
1347
|
+
});
|
|
1348
|
+
var shown = out.slice(0, 3).join("+");
|
|
1349
|
+
return shown + (out.length > 3 ? "+" : "");
|
|
1350
|
+
}
|
|
1351
|
+
function terminalExcerpt(s) {
|
|
1352
|
+
var lines = termLines(s).filter(function (ln) { return !!String(ln.text || "").trim(); });
|
|
1353
|
+
if (!lines.length) return "";
|
|
1354
|
+
return clip(lines[lines.length - 1].text, 88);
|
|
1355
|
+
}
|
|
1356
|
+
function completionTone(c) {
|
|
1357
|
+
var t = tone(c && c.status);
|
|
1358
|
+
return t === "running" ? "live" : t === "complete" ? "ok" : t === "blocked" ? "warn" : c && c.status === "failed" ? "err" : "info";
|
|
1359
|
+
}
|
|
1360
|
+
function completionText(c) {
|
|
1361
|
+
if (!c) return "";
|
|
1362
|
+
var bits = [statusLabel(c.status)];
|
|
1363
|
+
if (typeof c.exitCode === "number") bits.push("exit " + c.exitCode);
|
|
1364
|
+
if (typeof c.nestedObserverPresent === "boolean") bits.push("observer " + (c.nestedObserverPresent ? "present" : "missing"));
|
|
1365
|
+
if (typeof c.nestedVerifyPassed === "boolean") bits.push("verify " + (c.nestedVerifyPassed ? "passed" : "failed"));
|
|
1366
|
+
if (c.reason) bits.push(c.reason);
|
|
1367
|
+
return clip(bits.join(" · "), 110);
|
|
1368
|
+
}
|
|
1369
|
+
function meaningfulUseTone(m) {
|
|
1370
|
+
if (!m) return "info";
|
|
1371
|
+
return m.status === "pass" ? "ok" : m.status === "partial" ? "warn" : m.status === "fail" ? "err" : "info";
|
|
1372
|
+
}
|
|
1373
|
+
function meaningfulUseText(m) {
|
|
1374
|
+
if (!m) return "";
|
|
1375
|
+
return (m.status || "unknown") + " " + (typeof m.score === "number" ? Math.round(m.score) : 0) + "/100";
|
|
1376
|
+
}
|
|
1377
|
+
function buildMeaningfulUseCard(s) {
|
|
1378
|
+
var m = s.completion && s.completion.meaningfulUse;
|
|
1379
|
+
if (!m) return "";
|
|
1380
|
+
var comps = Array.isArray(m.components) ? m.components : [];
|
|
1381
|
+
return '<div class="meaning-card" aria-label="Meaningful-use score">'
|
|
1382
|
+
+ '<div class="meaning-head"><span class="eyebrow">Meaningful Use</span><span class="meaning-score" data-status="' + esc(m.status || "unknown") + '">' + esc(meaningfulUseText(m)) + '</span></div>'
|
|
1383
|
+
+ '<div class="meaning-summary">' + esc(m.summary || "No scoring summary captured.") + '</div>'
|
|
1384
|
+
+ (comps.length ? '<div class="meaning-components">' + comps.map(function (c) {
|
|
1385
|
+
return '<div class="meaning-comp" data-status="' + esc(c.status || "unknown") + '"><span class="meaning-comp-dot"></span><div><div class="meaning-comp-name">' + esc(c.label || c.id || "Component") + '</div><div class="meaning-comp-detail">' + esc(c.detail || "") + '</div></div><span class="meaning-comp-score">' + esc(String(typeof c.score === "number" ? Math.round(c.score) : 0)) + '</span></div>';
|
|
1386
|
+
}).join("") + '</div>' : "")
|
|
1387
|
+
+ '</div>';
|
|
1388
|
+
}
|
|
1389
|
+
function labChip(kind, label, detail, href, toneName) {
|
|
1390
|
+
var title = label + (detail ? ": " + detail : "");
|
|
1391
|
+
var inner = '<span class="bw-chip-k">' + esc(label) + '</span>' + (detail ? '<span class="bw-chip-v">' + esc(detail) + '</span>' : "");
|
|
1392
|
+
var attrs = ' class="bw-lab-chip" data-kind="' + esc(kind) + '" data-tone="' + esc(toneName || "info") + '" title="' + esc(title) + '"';
|
|
1393
|
+
if (href) return '<a' + attrs + ' href="' + esc(href) + '" target="_blank" rel="noopener noreferrer" data-action="external">' + inner + '</a>';
|
|
1394
|
+
return '<span' + attrs + '>' + inner + '</span>';
|
|
1395
|
+
}
|
|
1396
|
+
function browserLiveUrl(s) {
|
|
1397
|
+
return (s.embed && s.embed.kind === "iframe" && s.embed.url) || s.url || "";
|
|
1398
|
+
}
|
|
1399
|
+
function liveStreamMount(s, liveUrl) {
|
|
1400
|
+
return '<div class="live-stream-mount surface-fill" data-live-stream-id="' + esc(s.id) + '" data-live-stream-url="' + esc(liveUrl) + '" data-live-stream-title="' + esc(laneName(s) || "live stream") + '">'
|
|
1401
|
+
+ '<div class="bw-app-wait"><div class="wait-spinner" style="width:24px;height:24px"></div>'
|
|
1402
|
+
+ '<div class="mono" style="font-size:9px">connecting live stream</div></div></div>';
|
|
1403
|
+
}
|
|
1404
|
+
function browserShot(s) {
|
|
1405
|
+
var art = firstArtifactKind(s, "screenshot");
|
|
1406
|
+
return runArtifactHref(s.ui && s.ui.screenshotUrl)
|
|
1407
|
+
|| runArtifactHref(s.embed && s.embed.kind === "screenshot" && s.embed.url)
|
|
1408
|
+
|| runArtifactHref(art && art.path)
|
|
1409
|
+
|| "";
|
|
1410
|
+
}
|
|
1411
|
+
function browserHasLabSignals(s) {
|
|
1412
|
+
var ui = s.ui || {};
|
|
1413
|
+
return !!(browserLiveUrl(s) || browserShot(s) || ui.appUrl || ui.nestedObserverUrl || ui.nestedObserverPath || ui.state || s.completion || terminalExcerpt(s) || laneArtifacts(s).length);
|
|
1414
|
+
}
|
|
1415
|
+
function browserLabDock(s, shot) {
|
|
1416
|
+
var ui = s.ui || {};
|
|
1417
|
+
var chips = [];
|
|
1418
|
+
var appUrl = ui.appUrl || "";
|
|
1419
|
+
var nestedArt = firstArtifactKind(s, "observer");
|
|
1420
|
+
var nested = ui.nestedObserverUrl || ui.nestedObserverPath || (nestedArt && nestedArt.path) || "";
|
|
1421
|
+
var completion = s.completion || null;
|
|
1422
|
+
var shotArt = firstArtifactKind(s, "screenshot");
|
|
1423
|
+
var arts = laneArtifacts(s);
|
|
1424
|
+
var tail = terminalExcerpt(s);
|
|
1425
|
+
|
|
1426
|
+
if (appUrl) chips.push(labChip("app", "app", shortSurfaceValue(appUrl), linkHref(appUrl, false), "live"));
|
|
1427
|
+
if (nested) chips.push(labChip("observer", "observer", shortSurfaceValue(nested), linkHref(nested, !!(nestedArt && nested === nestedArt.path)), "info"));
|
|
1428
|
+
else if (completion && typeof completion.nestedObserverPresent === "boolean") chips.push(labChip("observer", "observer", completion.nestedObserverPresent ? "present" : "missing", "", completion.nestedObserverPresent ? "ok" : "warn"));
|
|
1429
|
+
if (completion) chips.push(labChip("completion", "status", completionText(completion), "", completionTone(completion)));
|
|
1430
|
+
if (completion && completion.meaningfulUse) chips.push(labChip("meaningful-use", "score", meaningfulUseText(completion.meaningfulUse), "", meaningfulUseTone(completion.meaningfulUse)));
|
|
1431
|
+
if (tail) chips.push(labChip("terminal", "terminal", tail, "", "info"));
|
|
1432
|
+
if (shot || shotArt) chips.push(labChip("screenshot", "shot", shot ? (S.media === "screenshot" ? "viewing fallback" : "fallback ready") : "artifact", shot || runArtifactHref(shotArt.path), "info"));
|
|
1433
|
+
if (arts.length) chips.push(labChip("artifact", "files", arts.length + " " + artifactKinds(arts), "", "info"));
|
|
1434
|
+
if (ui.state && !completion) chips.push(labChip("state", "state", clip(ui.state, 72), "", "info"));
|
|
1435
|
+
if (!chips.length) return "";
|
|
1436
|
+
return '<div class="bw-lab-dock" aria-label="Browser lane lab surfaces">' + chips.slice(0, 8).join("") + '</div>';
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
function consoleLines() {
|
|
1440
|
+
var rows = [];
|
|
1441
|
+
var lc = currentData.run.lifecycle || [];
|
|
1442
|
+
lc.forEach(function (e) { rows.push({ at: e.at, lvl: "info", text: e.message || e.event || "" }); });
|
|
1443
|
+
(currentData.events || []).forEach(function (e) {
|
|
1444
|
+
var prefix = e.simId ? (e.simId + " ") : "";
|
|
1445
|
+
rows.push({ at: e.at, lvl: (e.level === "error" ? "err" : e.level === "warn" ? "warn" : "info"), text: prefix + (e.message || e.type || "") });
|
|
1446
|
+
});
|
|
1447
|
+
rows.sort(function (a, b) { return String(a.at || "").localeCompare(String(b.at || "")); });
|
|
1448
|
+
if (!rows.length) rows.push({ at: "", lvl: "dim", text: "No orchestrator log lines recorded for this run." });
|
|
1449
|
+
return rows.map(function (r) { return { t: shortTime(r.at), lvl: r.lvl, text: r.text }; });
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
// ---------------------------------------------------------------- overall
|
|
1453
|
+
function overallStatus() {
|
|
1454
|
+
var ss = currentData.streams;
|
|
1455
|
+
if (ss.some(function (s) { return tone(s.status) === "running"; })) return "running";
|
|
1456
|
+
if (ss.some(function (s) { return s.status === "failed"; })) return "failed";
|
|
1457
|
+
if (ss.some(function (s) { return tone(s.status) === "blocked"; })) return "blocked";
|
|
1458
|
+
if (!ss.length) return currentData.run.status || "queued";
|
|
1459
|
+
return "complete";
|
|
1460
|
+
}
|
|
1461
|
+
function overallPct() {
|
|
1462
|
+
var ss = currentData.streams;
|
|
1463
|
+
if (!ss.length) return 0;
|
|
1464
|
+
var sum = 0;
|
|
1465
|
+
ss.forEach(function (s) { sum += laneProgress(s); });
|
|
1466
|
+
return Math.round(sum / ss.length);
|
|
1467
|
+
}
|
|
1468
|
+
function hasLive() { return currentData.streams.some(function (s) { return tone(s.status) === "running"; }); }
|
|
1469
|
+
|
|
1470
|
+
function statusCount(id) { return currentData.streams.filter(function (s) { return tone(s.status) === id; }).length; }
|
|
1471
|
+
function kindCount(id) { return currentData.streams.filter(function (s) { return kindGroup(s.kind) === id; }).length; }
|
|
1472
|
+
|
|
1473
|
+
function filteredStreams() {
|
|
1474
|
+
var q = S.query.trim().toLowerCase();
|
|
1475
|
+
return currentData.streams.filter(function (s) {
|
|
1476
|
+
if (S.statusSel.length && S.statusSel.indexOf(tone(s.status)) < 0) return false;
|
|
1477
|
+
if (S.kindSel.length && S.kindSel.indexOf(kindGroup(s.kind)) < 0) return false;
|
|
1478
|
+
if (q && (laneName(s) + " " + (s.kindLabel || "") + " " + laneRoute(s)).toLowerCase().indexOf(q) < 0) return false;
|
|
1479
|
+
return true;
|
|
1480
|
+
});
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1483
|
+
// ================================================================ SURFACES
|
|
1484
|
+
function liveTag() {
|
|
1485
|
+
return '<span class="live-tag">' + pip("running", true) + ' Live</span>';
|
|
1486
|
+
}
|
|
1487
|
+
function waitSurface(s) {
|
|
1488
|
+
var st = s.status, inner;
|
|
1489
|
+
if (st === "blocked" || st === "timed_out") {
|
|
1490
|
+
inner = '<div class="wait-icon" data-tone="amber">' + icon("alert") + '</div>'
|
|
1491
|
+
+ '<div class="wait-title">' + (st === "timed_out" ? "Lane timed out" : "Lane blocked") + '</div>'
|
|
1492
|
+
+ '<div class="wait-sub">' + esc(laneStep(s)) + '</div>';
|
|
1493
|
+
} else if (st === "failed") {
|
|
1494
|
+
inner = '<div class="wait-icon" data-tone="red">' + icon("x") + '</div>'
|
|
1495
|
+
+ '<div class="wait-title">Lane failed</div>'
|
|
1496
|
+
+ '<div class="wait-sub">' + esc(laneStep(s)) + '</div>';
|
|
1497
|
+
} else if (st === "contract_proof_only") {
|
|
1498
|
+
inner = '<div class="wait-icon" data-tone="green">' + icon("check") + '</div>'
|
|
1499
|
+
+ '<div class="wait-title">Contract proof only</div>'
|
|
1500
|
+
+ '<div class="wait-sub">' + esc(laneSummary(s) || laneStep(s)) + '</div>';
|
|
1501
|
+
} else {
|
|
1502
|
+
inner = '<div class="wait-spinner"></div>'
|
|
1503
|
+
+ '<div class="wait-title">Waiting for substrate</div>'
|
|
1504
|
+
+ '<div class="wait-sub">' + esc(laneRoute(s) || laneStep(s)) + '</div>';
|
|
1505
|
+
}
|
|
1506
|
+
return '<div class="wait"><div class="wait-inner">' + inner + '</div></div>';
|
|
1507
|
+
}
|
|
1508
|
+
function browserSurface(s, focus) {
|
|
1509
|
+
var live = tone(s.status) === "running";
|
|
1510
|
+
var route = laneRoute(s) || "(local)";
|
|
1511
|
+
var liveUrl = browserLiveUrl(s);
|
|
1512
|
+
var shot = browserShot(s);
|
|
1513
|
+
var dock = focus ? browserLabDock(s, shot) : "";
|
|
1514
|
+
var body;
|
|
1515
|
+
if (liveUrl && S.media === "live") body = liveStreamMount(s, liveUrl);
|
|
1516
|
+
else if (shot) body = '<img class="surface-fill" style="object-fit:cover;object-position:top" src="' + esc(shot) + '" alt="viewport screenshot"/>';
|
|
1517
|
+
else body = '<div class="bw-app-wait"><div class="wait-spinner" style="width:24px;height:24px"></div>'
|
|
1518
|
+
+ '<div class="mono" style="font-size:9px">' + esc(route) + '</div>'
|
|
1519
|
+
+ '<div style="font-size:10px">' + esc(laneStep(s)) + '</div></div>';
|
|
1520
|
+
return '<div class="bw">'
|
|
1521
|
+
+ '<div class="bw-chrome"><div class="bw-dots"><i></i><i></i><i></i></div>'
|
|
1522
|
+
+ '<div class="bw-url">' + icon("lock", 8) + '<span>' + esc(route) + '</span></div></div>'
|
|
1523
|
+
+ '<div class="bw-viewport">' + body + (liveUrl && S.media === "live" ? "" : dock) + '</div>'
|
|
1524
|
+
+ (live ? liveTag() : "")
|
|
1525
|
+
+ '</div>';
|
|
1526
|
+
}
|
|
1527
|
+
function terminalSurface(s, focus) {
|
|
1528
|
+
var lines = termLines(s);
|
|
1529
|
+
var live = tone(s.status) === "running";
|
|
1530
|
+
var shown = focus ? lines : lines.slice(-9);
|
|
1531
|
+
var start = lines.length - shown.length;
|
|
1532
|
+
var rows = shown.map(function (ln, i) {
|
|
1533
|
+
return '<div class="term-line">'
|
|
1534
|
+
+ (focus ? '<span class="term-num">' + pad2(start + i + 1) + '</span>' : '')
|
|
1535
|
+
+ '<span class="term-txt ' + ln.cls + '">' + esc(ln.text || " ") + '</span></div>';
|
|
1536
|
+
}).join("");
|
|
1537
|
+
var title = s.kind === "tui" ? (laneRoute(s) || "codex --tui") : (laneName(s) || laneRoute(s));
|
|
1538
|
+
var stat = s.kind === "tui" ? "PTY" : "SNAPSHOT";
|
|
1539
|
+
return '<div class="term">'
|
|
1540
|
+
+ '<div class="term-bar"><span class="tprompt">$</span><span class="ttitle">' + esc(title) + '</span><span class="tstat">' + stat + '</span></div>'
|
|
1541
|
+
+ '<div class="term-body">' + rows
|
|
1542
|
+
+ (live ? '<div class="term-line"><span class="term-txt cmd">$<span class="term-caret"></span></span></div>' : '')
|
|
1543
|
+
+ '</div></div>';
|
|
1544
|
+
}
|
|
1545
|
+
function codexTraceObject(s) {
|
|
1546
|
+
var c = s.codex || {};
|
|
1547
|
+
var meta = s.metadata || {};
|
|
1548
|
+
var trace = c.trace || c.traceMetadata || s.trace || meta.codex || meta.codexAppServer || meta.appServerTrace || {};
|
|
1549
|
+
if (!trace || typeof trace !== "object" || Array.isArray(trace)) trace = {};
|
|
1550
|
+
return { codex: c, trace: trace };
|
|
1551
|
+
}
|
|
1552
|
+
function isCodexAppServer(s) {
|
|
1553
|
+
var roots = codexTraceObject(s);
|
|
1554
|
+
return s.kind === "codex-ui" && (s.transport === "app-server" || roots.codex.provider === "codex-app-server" || roots.trace.provider === "codex-app-server" || roots.trace.service === "codex-app-server");
|
|
1555
|
+
}
|
|
1556
|
+
function codexField(s, names) {
|
|
1557
|
+
var roots = codexTraceObject(s);
|
|
1558
|
+
var list = [roots.trace, roots.codex, s];
|
|
1559
|
+
for (var i = 0; i < list.length; i += 1) {
|
|
1560
|
+
var obj = list[i] || {};
|
|
1561
|
+
for (var j = 0; j < names.length; j += 1) {
|
|
1562
|
+
var v = obj[names[j]];
|
|
1563
|
+
if (v != null && String(v).trim() !== "") return String(v);
|
|
1564
|
+
}
|
|
1565
|
+
}
|
|
1566
|
+
return "";
|
|
1567
|
+
}
|
|
1568
|
+
function codexTraceEvents(s) {
|
|
1569
|
+
if (!isCodexAppServer(s)) return [];
|
|
1570
|
+
var roots = codexTraceObject(s);
|
|
1571
|
+
var trace = roots.trace;
|
|
1572
|
+
var c = roots.codex;
|
|
1573
|
+
var groups = [
|
|
1574
|
+
c.events,
|
|
1575
|
+
c.traceEvents,
|
|
1576
|
+
trace.events,
|
|
1577
|
+
trace.messages,
|
|
1578
|
+
trace.reasoning,
|
|
1579
|
+
trace.commands,
|
|
1580
|
+
trace.fileChanges,
|
|
1581
|
+
trace.tools,
|
|
1582
|
+
trace.approvals,
|
|
1583
|
+
trace.items,
|
|
1584
|
+
trace.timeline,
|
|
1585
|
+
trace.traceEvents
|
|
1586
|
+
];
|
|
1587
|
+
var out = [];
|
|
1588
|
+
groups.forEach(function (items) {
|
|
1589
|
+
if (Array.isArray(items)) out = out.concat(items);
|
|
1590
|
+
});
|
|
1591
|
+
return out;
|
|
1592
|
+
}
|
|
1593
|
+
function codexKind(raw) {
|
|
1594
|
+
var k = String((raw && (raw.kind || raw.type || raw.event || raw.category)) || "").toLowerCase();
|
|
1595
|
+
if (k.indexOf("reason") >= 0) return "reasoning";
|
|
1596
|
+
if (k.indexOf("command") >= 0 || k.indexOf("shell") >= 0 || k.indexOf("exec") >= 0) return "command";
|
|
1597
|
+
if (k.indexOf("file") >= 0 || k.indexOf("patch") >= 0 || k.indexOf("diff") >= 0) return "file";
|
|
1598
|
+
if (k.indexOf("tool") >= 0 || k.indexOf("function") >= 0) return "tool";
|
|
1599
|
+
if (k.indexOf("message") >= 0 || k.indexOf("assistant") >= 0 || k.indexOf("user") >= 0) return "message";
|
|
1600
|
+
if (raw && (raw.command || raw.cmd)) return "command";
|
|
1601
|
+
if (raw && (raw.path || raw.file || raw.filePath)) return "file";
|
|
1602
|
+
if (raw && (raw.tool || raw.toolName || raw.name)) return "tool";
|
|
1603
|
+
return "message";
|
|
1604
|
+
}
|
|
1605
|
+
function codexEventValue(raw, names) {
|
|
1606
|
+
if (!raw) return "";
|
|
1607
|
+
for (var i = 0; i < names.length; i += 1) {
|
|
1608
|
+
var v = raw[names[i]];
|
|
1609
|
+
if (v == null) continue;
|
|
1610
|
+
if (typeof v === "string" || typeof v === "number" || typeof v === "boolean") {
|
|
1611
|
+
var out = String(v).trim();
|
|
1612
|
+
if (out) return out;
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1615
|
+
return "";
|
|
1616
|
+
}
|
|
1617
|
+
function codexEventTitle(raw, kind) {
|
|
1618
|
+
if (kind === "command") return codexEventValue(raw, ["title", "command", "cmd", "name"]) || "command";
|
|
1619
|
+
if (kind === "file") return codexEventValue(raw, ["title", "path", "filePath", "file", "name"]) || "file";
|
|
1620
|
+
if (kind === "tool") return codexEventValue(raw, ["title", "toolName", "tool", "name"]) || "tool";
|
|
1621
|
+
if (kind === "reasoning") return codexEventValue(raw, ["title", "summary", "phase"]) || "reasoning";
|
|
1622
|
+
return codexEventValue(raw, ["title", "role", "speaker", "name"]) || "message";
|
|
1623
|
+
}
|
|
1624
|
+
function codexEventBody(raw, kind) {
|
|
1625
|
+
if (kind === "command") return codexEventValue(raw, ["text", "summary", "command", "cmd", "output", "result"]);
|
|
1626
|
+
if (kind === "file") return codexEventValue(raw, ["text", "summary", "action", "path", "filePath", "file"]);
|
|
1627
|
+
if (kind === "tool") return codexEventValue(raw, ["text", "summary", "input", "output", "result", "status"]);
|
|
1628
|
+
return codexEventValue(raw, ["text", "content", "message", "summary", "delta"]);
|
|
1629
|
+
}
|
|
1630
|
+
function codexEventMeta(raw) {
|
|
1631
|
+
var bits = [];
|
|
1632
|
+
var at = codexEventValue(raw, ["at", "time", "timestamp", "createdAt"]);
|
|
1633
|
+
var status = codexEventValue(raw, ["status", "state"]);
|
|
1634
|
+
var exitCode = codexEventValue(raw, ["exitCode", "exit_code"]);
|
|
1635
|
+
if (at) bits.push(shortTime(at) || at);
|
|
1636
|
+
if (status) bits.push(status);
|
|
1637
|
+
if (exitCode) bits.push("exit " + exitCode);
|
|
1638
|
+
return bits.join(" · ");
|
|
1639
|
+
}
|
|
1640
|
+
function codexIcon(kind) {
|
|
1641
|
+
if (kind === "command") return "terminal";
|
|
1642
|
+
if (kind === "file") return "file";
|
|
1643
|
+
if (kind === "tool") return "check";
|
|
1644
|
+
if (kind === "reasoning") return "spark";
|
|
1645
|
+
return "info";
|
|
1646
|
+
}
|
|
1647
|
+
function codexChip(label, value, toneName) {
|
|
1648
|
+
if (!value) return "";
|
|
1649
|
+
return '<span class="cx-chip" data-cx-chip="' + esc(label) + '" data-tone="' + esc(toneName || "info") + '"><span class="cx-chip-k">' + esc(label) + '</span><span class="cx-chip-v">' + esc(clip(value, 64)) + '</span></span>';
|
|
1650
|
+
}
|
|
1651
|
+
function codexMetaChips(s) {
|
|
1652
|
+
if (!isCodexAppServer(s)) return "";
|
|
1653
|
+
var status = codexField(s, ["status", "state"]) || s.statusLabel || statusLabel(s.status);
|
|
1654
|
+
var thread = codexField(s, ["threadId", "thread_id", "thread", "sessionId", "session_id"]);
|
|
1655
|
+
var turn = codexField(s, ["turnId", "turn_id", "turn"]);
|
|
1656
|
+
var model = codexField(s, ["model", "modelName", "model_name"]);
|
|
1657
|
+
var service = codexField(s, ["service", "serviceName", "service_name", "provider"]) || (s.transport === "app-server" ? "codex-app-server" : "");
|
|
1658
|
+
var t = tone(s.status);
|
|
1659
|
+
return [
|
|
1660
|
+
codexChip("status", status, t === "running" ? "live" : t === "complete" ? "ok" : t === "blocked" ? "warn" : s.status === "failed" ? "err" : "info"),
|
|
1661
|
+
codexChip("thread", thread, "info"),
|
|
1662
|
+
codexChip("turn", turn, "info"),
|
|
1663
|
+
codexChip("model", model, "info"),
|
|
1664
|
+
codexChip("service", service, "info")
|
|
1665
|
+
].filter(function (x) { return !!x; }).join("");
|
|
1666
|
+
}
|
|
1667
|
+
function codexTraceRows(s) {
|
|
1668
|
+
var evs = codexTraceEvents(s);
|
|
1669
|
+
if (!evs.length) return "";
|
|
1670
|
+
return '<div class="cx-lanes" aria-label="Codex app-server trace events">' + evs.slice(-12).map(function (ev) {
|
|
1671
|
+
var kind = codexKind(ev);
|
|
1672
|
+
var title = codexEventTitle(ev, kind);
|
|
1673
|
+
var body = codexEventBody(ev, kind);
|
|
1674
|
+
var meta = codexEventMeta(ev);
|
|
1675
|
+
return '<div class="cx-lane" data-cx-kind="' + esc(kind) + '"><span class="cx-lane-ic">' + icon(codexIcon(kind), 13) + '</span><div class="cx-lane-main">'
|
|
1676
|
+
+ '<div class="cx-lane-head"><span class="cx-lane-kind">' + esc(kind) + '</span><span class="cx-lane-title">' + esc(title) + '</span></div>'
|
|
1677
|
+
+ (body ? '<div class="cx-lane-body">' + esc(clip(body, 220)) + '</div>' : '')
|
|
1678
|
+
+ (meta ? '<div class="cx-lane-meta">' + esc(meta) + '</div>' : '')
|
|
1679
|
+
+ '</div></div>';
|
|
1680
|
+
}).join("") + '</div>';
|
|
1681
|
+
}
|
|
1682
|
+
function codexArtifactLinks(s) {
|
|
1683
|
+
if (!isCodexAppServer(s)) return "";
|
|
1684
|
+
var arts = laneArtifacts(s).filter(function (a) { return !!artifactHref(a); }).slice(0, 5);
|
|
1685
|
+
if (!arts.length) return "";
|
|
1686
|
+
return '<div class="cx-artifacts" aria-label="Codex linked artifacts">' + arts.map(function (a) {
|
|
1687
|
+
return '<a class="cx-artifact" href="' + esc(artifactHref(a)) + '" target="_blank" rel="noopener noreferrer" data-action="external" data-kind="' + esc(a.kind || "artifact") + '">' + icon("file", 12) + '<span>' + esc(a.label || a.path) + '</span></a>';
|
|
1688
|
+
}).join("") + '</div>';
|
|
1689
|
+
}
|
|
1690
|
+
function codexSurface(s) {
|
|
1691
|
+
var live = tone(s.status) === "running";
|
|
1692
|
+
var parts = [];
|
|
1693
|
+
var summary = laneSummary(s) || (s.codex && s.codex.contract) || laneStep(s);
|
|
1694
|
+
var chips = codexMetaChips(s);
|
|
1695
|
+
var traceRows = codexTraceRows(s);
|
|
1696
|
+
var artifacts = codexArtifactLinks(s);
|
|
1697
|
+
if (chips) parts.push('<div class="cx-chips">' + chips + '</div>');
|
|
1698
|
+
if (summary) parts.push('<div class="cx-msg agent">' + esc(summary) + '</div>');
|
|
1699
|
+
if (traceRows) {
|
|
1700
|
+
parts.push(traceRows);
|
|
1701
|
+
} else {
|
|
1702
|
+
var receipts = termLines(s);
|
|
1703
|
+
receipts.forEach(function (ln, i) {
|
|
1704
|
+
var pending = live && i === receipts.length - 1;
|
|
1705
|
+
parts.push('<div class="cx-tool">' + (pending ? '<span class="cx-spin"></span>' : icon("check", 12)) + '<span>' + esc(ln.text) + '</span></div>');
|
|
1706
|
+
});
|
|
1707
|
+
}
|
|
1708
|
+
if (artifacts) parts.push(artifacts);
|
|
1709
|
+
if (live) parts.push('<div class="cx-tool"><span class="cx-spin"></span><span>thinking…</span></div>');
|
|
1710
|
+
return '<div class="codex">'
|
|
1711
|
+
+ '<div class="codex-bar"><span class="cx-spark">' + icon("spark", 11) + '</span> ' + esc(laneRoute(s) || "codex.app-server · session") + '</div>'
|
|
1712
|
+
+ '<div class="codex-body">' + parts.join("") + '</div>'
|
|
1713
|
+
+ (live ? liveTag() : "")
|
|
1714
|
+
+ '</div>';
|
|
1715
|
+
}
|
|
1716
|
+
function streamSurface(s, focus) {
|
|
1717
|
+
var k = s.kind, st = s.status;
|
|
1718
|
+
var hasTail = !!(s.terminal && s.terminal.tail && String(s.terminal.tail).trim());
|
|
1719
|
+
if ((st === "blocked" || st === "timed_out") && !hasTail && !((k === "ui" || k === "browser") && browserHasLabSignals(s))) return waitSurface(s);
|
|
1720
|
+
if (k === "ui" || k === "browser") {
|
|
1721
|
+
if ((st === "blocked" || st === "timed_out" || st === "failed" || st === "contract_proof_only") && !browserHasLabSignals(s)) return waitSurface(s);
|
|
1722
|
+
return browserSurface(s, focus);
|
|
1723
|
+
}
|
|
1724
|
+
if (k === "terminal" || k === "tui") return hasTail ? terminalSurface(s, focus) : waitSurface(s);
|
|
1725
|
+
if (k === "codex-ui") {
|
|
1726
|
+
if (st === "contract_proof_only" && !hasTail) return waitSurface(s);
|
|
1727
|
+
return codexSurface(s);
|
|
1728
|
+
}
|
|
1729
|
+
return waitSurface(s);
|
|
1730
|
+
}
|
|
1731
|
+
|
|
1732
|
+
// ================================================================ HEADER
|
|
1733
|
+
function statusCountsModel() {
|
|
1734
|
+
var lc = laneCounts(currentData.streams);
|
|
1735
|
+
return [
|
|
1736
|
+
{ id: "running", label: "live", color: "var(--accent-2)", count: lc.running },
|
|
1737
|
+
{ id: "complete", label: "done", color: "var(--green)", count: lc.complete },
|
|
1738
|
+
{ id: "blocked", label: "blocked", color: "var(--amber)", count: lc.blocked },
|
|
1739
|
+
{ id: "failed", label: "failed", color: "var(--red)", count: lc.failed }
|
|
1740
|
+
];
|
|
1741
|
+
}
|
|
1742
|
+
function buildStatusIndicator(counts, pct) {
|
|
1743
|
+
var shown = counts.filter(function (c) { return c.count > 0; });
|
|
1744
|
+
if (S.statusViz === "bar") {
|
|
1745
|
+
var segs = shown.map(function (c) {
|
|
1746
|
+
return '<span class="si-bar-seg" title="' + c.count + ' ' + c.label + '" data-action="status:' + c.id + '" style="flex-grow:' + c.count + ';background:' + c.color + '"></span>';
|
|
1747
|
+
}).join("");
|
|
1748
|
+
return '<div class="si-bar" role="group" aria-label="Lane status"><div class="si-bar-track">' + segs + '</div><span class="si-bar-label mono">' + pct + '%</span></div>';
|
|
1749
|
+
}
|
|
1750
|
+
if (S.statusViz === "ring") {
|
|
1751
|
+
var present = shown;
|
|
1752
|
+
var sum = present.reduce(function (a, c) { return a + c.count; }, 0) || 1;
|
|
1753
|
+
var issues = counts.filter(function (c) { return c.id === "blocked" || c.id === "failed"; }).reduce(function (a, c) { return a + c.count; }, 0);
|
|
1754
|
+
var running = (counts.filter(function (c) { return c.id === "running"; })[0] || {}).count || 0;
|
|
1755
|
+
var R = 9, CIRC = 2 * Math.PI * R, acc = 0;
|
|
1756
|
+
var arcs = present.map(function (c) {
|
|
1757
|
+
var frac = c.count / sum, len = frac * CIRC;
|
|
1758
|
+
var seg = '<circle cx="13" cy="13" r="' + R + '" fill="none" stroke="' + c.color + '" stroke-width="3.5" stroke-dasharray="' + len + ' ' + (CIRC - len) + '" stroke-dashoffset="' + (-acc * CIRC) + '" transform="rotate(-90 13 13)"></circle>';
|
|
1759
|
+
acc += frac;
|
|
1760
|
+
return seg;
|
|
1761
|
+
}).join("");
|
|
1762
|
+
var meta = issues > 0
|
|
1763
|
+
? '<span class="si-ring-issue mono" style="color:var(--amber)">' + issues + ' ⚠</span>'
|
|
1764
|
+
: running > 0
|
|
1765
|
+
? '<span class="si-ring-issue mono" style="color:var(--accent-2)">' + running + ' live</span>'
|
|
1766
|
+
: '<span class="si-ring-issue mono" style="color:var(--green)">done</span>';
|
|
1767
|
+
return '<button class="si-ring" data-action="status:' + (issues ? "blocked" : "all") + '" title="' + pct + '% complete">'
|
|
1768
|
+
+ '<svg width="26" height="26" viewBox="0 0 26 26"><circle cx="13" cy="13" r="' + R + '" fill="none" stroke="var(--line)" stroke-width="3.5"></circle>' + arcs + '</svg>'
|
|
1769
|
+
+ '<span class="si-ring-meta"><span class="si-ring-pct mono">' + pct + '%</span>' + meta + '</span></button>';
|
|
1770
|
+
}
|
|
1771
|
+
return '<div class="si-badges" role="group" aria-label="Lane status">' + shown.map(function (c) {
|
|
1772
|
+
var glow = c.id === "running" ? ";box-shadow:0 0 0 3px color-mix(in oklab, " + c.color + " 22%, transparent)" : "";
|
|
1773
|
+
return '<button class="si-badge" aria-pressed="' + (S.statusSel.indexOf(c.id) >= 0 ? "true" : "false") + '" title="' + c.count + ' ' + c.label + '" data-action="status:' + c.id + '">'
|
|
1774
|
+
+ '<span class="si-dot" style="background:' + c.color + glow + '"></span><span class="si-n mono">' + c.count + '</span></button>';
|
|
1775
|
+
}).join("") + '</div>';
|
|
1776
|
+
}
|
|
1777
|
+
function buildHeader() {
|
|
1778
|
+
var run = currentData.run;
|
|
1779
|
+
var overall = overallStatus(), pct = overallPct();
|
|
1780
|
+
var counts = statusCountsModel();
|
|
1781
|
+
var title = (run.scenario && run.scenario.title) || "Humanish run";
|
|
1782
|
+
var persona = (run.persona && run.persona.name) || "";
|
|
1783
|
+
return '<header class="hdr">'
|
|
1784
|
+
+ '<div class="hdr-brand"><span class="brand-mark">' + icon("live", 15) + '</span><span class="brand-word">Humanish <b>Observer</b></span></div>'
|
|
1785
|
+
+ '<div class="hdr-run">'
|
|
1786
|
+
+ '<div class="hdr-run-title" title="' + esc(title) + '">' + esc(title) + '</div>'
|
|
1787
|
+
+ '<div class="hdr-run-sub"><span class="hdr-persona">' + esc(persona) + '</span><span class="dot-sep"></span>'
|
|
1788
|
+
+ '<button class="run-chip mono" data-action="toggle-details" aria-expanded="' + (S.detailsOpen ? "true" : "false") + '">' + esc(run.runId || "run") + '</button></div></div>'
|
|
1789
|
+
+ '<div class="hdr-spacer"></div>'
|
|
1790
|
+
+ buildStatusIndicator(counts, pct)
|
|
1791
|
+
+ '<span class="status-pill" data-tone="' + tone(overall) + '">' + pip(overall, tone(overall) === "running") + statusLabel(overall) + '<span class="pct mono">' + pct + '%</span></span>'
|
|
1792
|
+
+ '<button class="hdr-runs" data-action="open-history">' + icon("clock", 15) + '<span>Runs</span></button>'
|
|
1793
|
+
+ '<button class="icon-btn" data-action="toggle-tweaks" aria-label="Settings" aria-pressed="' + (S.tweaksOpen ? "true" : "false") + '">' + icon("sliders") + '</button>'
|
|
1794
|
+
+ '<button class="icon-btn" data-action="toggle-theme" aria-label="Toggle theme">' + icon(S.theme === "light" ? "moon" : "sun") + '</button>'
|
|
1795
|
+
+ '</header>';
|
|
1796
|
+
}
|
|
1797
|
+
|
|
1798
|
+
// ================================================================ TOOLBAR
|
|
1799
|
+
var STATUS_OPTS = [
|
|
1800
|
+
{ id: "running", label: "Live", color: "var(--accent-2)" },
|
|
1801
|
+
{ id: "complete", label: "Done", color: "var(--green)" },
|
|
1802
|
+
{ id: "blocked", label: "Blocked", color: "var(--amber)" },
|
|
1803
|
+
{ id: "failed", label: "Failed", color: "var(--red)" }
|
|
1804
|
+
];
|
|
1805
|
+
var KIND_OPTS = [
|
|
1806
|
+
{ id: "ui", label: "Browser" },
|
|
1807
|
+
{ id: "terminal", label: "CLI" },
|
|
1808
|
+
{ id: "tui", label: "TUI" },
|
|
1809
|
+
{ id: "codex-ui", label: "Codex" }
|
|
1810
|
+
];
|
|
1811
|
+
function optLabel(opts, id) {
|
|
1812
|
+
for (var i = 0; i < opts.length; i += 1) { if (opts[i].id === id) return opts[i].label; }
|
|
1813
|
+
return id;
|
|
1814
|
+
}
|
|
1815
|
+
function ddTrigger(kind, label, iconName, sel, opts) {
|
|
1816
|
+
var allOn = sel.length === 0;
|
|
1817
|
+
var summary = allOn ? label : (sel.length === 1 ? optLabel(opts, sel[0]) : (sel.length + " selected"));
|
|
1818
|
+
return '<div class="dd"><button id="dd-trigger-' + kind + '" class="dd-trigger" data-action="dd:' + kind + '" data-active="' + (allOn ? "false" : "true") + '" aria-haspopup="true" aria-expanded="' + (openDd === kind ? "true" : "false") + '">'
|
|
1819
|
+
+ '<span class="dd-trigger-inner">' + (iconName ? icon(iconName, 14) : "") + '<span>' + esc(summary) + '</span></span>'
|
|
1820
|
+
+ (allOn ? "" : '<span class="dd-badge">' + sel.length + '</span>')
|
|
1821
|
+
+ icon("caret", 13) + '</button></div>';
|
|
1822
|
+
}
|
|
1823
|
+
function buildToolbar() {
|
|
1824
|
+
if (S.view === "focus") return buildFocusToolbar();
|
|
1825
|
+
var total = currentData.streams.length;
|
|
1826
|
+
var shown = filteredStreams().length;
|
|
1827
|
+
return '<div class="toolbar">'
|
|
1828
|
+
+ ddTrigger("status", "Status", "filter", S.statusSel, STATUS_OPTS)
|
|
1829
|
+
+ ddTrigger("kind", "Kind", null, S.kindSel, KIND_OPTS)
|
|
1830
|
+
+ '<label class="tb-search">' + icon("search", 14)
|
|
1831
|
+
+ '<input data-role="search" type="text" placeholder="Filter lanes…" value="' + esc(S.query) + '" aria-label="Filter lanes by name or persona"/></label>'
|
|
1832
|
+
+ '<span class="tb-result mono">' + shown + ' / ' + total + '</span>'
|
|
1833
|
+
+ buildLaneGroupSummary()
|
|
1834
|
+
+ '<div class="tb-spacer"></div>'
|
|
1835
|
+
+ '<div class="seg view-seg" role="group" aria-label="View mode">'
|
|
1836
|
+
+ '<button aria-pressed="' + (S.view === "grid" ? "true" : "false") + '" title="Grid view" data-action="view:grid">' + icon("grid", 15) + '</button>'
|
|
1837
|
+
+ '<button aria-pressed="' + (S.view === "focus" ? "true" : "false") + '" title="Focus view" data-action="view:focus">' + icon("focus", 15) + '</button></div>'
|
|
1838
|
+
+ '<div class="seg media-seg" role="group" aria-label="Media mode">'
|
|
1839
|
+
+ '<button aria-pressed="' + (S.media === "live" ? "true" : "false") + '"' + (hasLive() ? "" : " disabled") + ' title="Live streams" data-action="media:live">' + icon("live", 15) + '</button>'
|
|
1840
|
+
+ '<button aria-pressed="' + (S.media === "screenshot" ? "true" : "false") + '" title="Screenshots" data-action="media:screenshot">' + icon("image", 15) + '</button></div>'
|
|
1841
|
+
+ '<div class="seg density-seg" role="group" aria-label="Tile density">'
|
|
1842
|
+
+ '<button aria-pressed="' + (S.density === "comfortable" ? "true" : "false") + '" title="Comfortable" data-action="density:comfortable">' + icon("comfy", 15) + '</button>'
|
|
1843
|
+
+ '<button aria-pressed="' + (S.density === "compact" ? "true" : "false") + '" title="Compact" data-action="density:compact">' + icon("compact", 15) + '</button>'
|
|
1844
|
+
+ '<button aria-pressed="' + (S.density === "dense" ? "true" : "false") + '" title="Dense" data-action="density:dense">' + icon("dense", 15) + '</button></div>'
|
|
1845
|
+
+ '</div>';
|
|
1846
|
+
}
|
|
1847
|
+
function buildLaneGroupSummary() {
|
|
1848
|
+
var groups = currentData.laneGroups || [];
|
|
1849
|
+
if (!groups.length) return "";
|
|
1850
|
+
var rows = [];
|
|
1851
|
+
function add(key, value) {
|
|
1852
|
+
if (!value) return;
|
|
1853
|
+
var found = null;
|
|
1854
|
+
for (var i = 0; i < rows.length; i += 1) {
|
|
1855
|
+
if (rows[i].key === key && rows[i].value === value) { found = rows[i]; break; }
|
|
1856
|
+
}
|
|
1857
|
+
if (found) found.count += 1;
|
|
1858
|
+
else rows.push({ key: key, value: value, count: 1 });
|
|
1859
|
+
}
|
|
1860
|
+
groups.forEach(function (group) {
|
|
1861
|
+
add("actorType", group.actorType);
|
|
1862
|
+
add("surface", group.surface);
|
|
1863
|
+
add("caseGroup", group.caseGroup);
|
|
1864
|
+
});
|
|
1865
|
+
if (!rows.length) return "";
|
|
1866
|
+
return '<div class="lane-groups" aria-label="Lane groups">'
|
|
1867
|
+
+ rows.slice(0, 6).map(function (row) {
|
|
1868
|
+
var title = row.key + ": " + row.value + " (" + row.count + ")";
|
|
1869
|
+
return '<span class="lane-group-chip" data-lane-group="' + esc(row.key) + '" title="' + esc(title) + '">'
|
|
1870
|
+
+ '<span class="lane-group-k">' + esc(row.key) + '</span>'
|
|
1871
|
+
+ '<span class="lane-group-v">' + esc(row.value) + '</span>'
|
|
1872
|
+
+ '<span class="lane-group-n">' + row.count + '</span>'
|
|
1873
|
+
+ '</span>';
|
|
1874
|
+
}).join("")
|
|
1875
|
+
+ '</div>';
|
|
1876
|
+
}
|
|
1877
|
+
function buildFocusToolbar() {
|
|
1878
|
+
var ss = currentData.streams;
|
|
1879
|
+
if (!ss.length) return '<div class="toolbar focus-toolbar"><div class="crumbs"><span class="cur">No lanes</span></div></div>';
|
|
1880
|
+
var idx = focusIndex();
|
|
1881
|
+
var s = ss[idx];
|
|
1882
|
+
var live = tone(s.status) === "running";
|
|
1883
|
+
return '<div class="toolbar focus-toolbar">'
|
|
1884
|
+
+ '<div class="crumbs">'
|
|
1885
|
+
+ '<button class="crumb-rail-toggle" data-action="toggle-rail" aria-label="' + (S.railCollapsed ? "Show lane rail" : "Hide lane rail") + '" title="' + (S.railCollapsed ? "Show lane rail - [" : "Hide lane rail - [") + '">' + icon("list", 15) + '</button>'
|
|
1886
|
+
+ '<button data-action="exit-focus">Grid</button><span class="sep">/</span>'
|
|
1887
|
+
+ '<span class="mono" style="color:var(--text-3)">' + pad2(idx + 1) + '</span>'
|
|
1888
|
+
+ '<span class="cur" title="' + esc(laneName(s)) + '">' + esc(laneName(s)) + '</span></div>'
|
|
1889
|
+
+ '<span class="focus-status" data-tone="' + tone(s.status) + '" style="color:' + statusColor(s.status) + '">' + pip(s.status, live) + ' ' + statusLabel(s.status) + '</span>'
|
|
1890
|
+
+ '<div class="focus-nav"><button class="icon-btn" data-action="nav:-1" aria-label="Previous lane">' + icon("chevL") + '</button>'
|
|
1891
|
+
+ '<span class="focus-stepper mono">' + (idx + 1) + ' / ' + ss.length + '</span>'
|
|
1892
|
+
+ '<button class="icon-btn" data-action="nav:1" aria-label="Next lane">' + icon("chevR") + '</button></div>'
|
|
1893
|
+
+ '<button class="icon-btn" data-action="toggle-side" aria-pressed="' + (S.sideCollapsed ? "false" : "true") + '" aria-label="' + (S.sideCollapsed ? "Show details panel" : "Hide details panel") + '" title="' + (S.sideCollapsed ? "Show details panel - ]" : "Hide details panel - ]") + '">' + icon("panelRight") + '</button>'
|
|
1894
|
+
+ '<button class="icon-btn" data-action="exit-focus" aria-label="Close focus (Esc)">' + icon("x") + '</button>'
|
|
1895
|
+
+ '</div>';
|
|
1896
|
+
}
|
|
1897
|
+
function buildDdMenu() {
|
|
1898
|
+
if (!openDd) return "";
|
|
1899
|
+
var kind = openDd;
|
|
1900
|
+
var label = kind === "status" ? "Status" : "Kind";
|
|
1901
|
+
var opts = kind === "status" ? STATUS_OPTS : KIND_OPTS;
|
|
1902
|
+
var sel = kind === "status" ? S.statusSel : S.kindSel;
|
|
1903
|
+
var cnt = kind === "status" ? statusCount : kindCount;
|
|
1904
|
+
var allOn = sel.length === 0;
|
|
1905
|
+
var rows = '<button class="dd-row dd-row-all" data-action="dd-all:' + kind + '"><span class="dd-check" data-on="' + (allOn ? "true" : "false") + '">' + (allOn ? icon("check", 11) : "") + '</span><span class="dd-row-label">All ' + label.toLowerCase() + '</span></button><div class="dd-sep"></div>';
|
|
1906
|
+
rows += opts.map(function (o) {
|
|
1907
|
+
var on = sel.indexOf(o.id) >= 0;
|
|
1908
|
+
return '<button class="dd-row" data-action="dd-row:' + kind + ':' + o.id + '"><span class="dd-check" data-on="' + (on ? "true" : "false") + '">' + (on ? icon("check", 11) : "") + '</span>'
|
|
1909
|
+
+ (o.color ? '<span class="dd-dot" style="background:' + o.color + '"></span>' : "")
|
|
1910
|
+
+ '<span class="dd-row-label">' + o.label + '</span><span class="dd-row-n mono">' + cnt(o.id) + '</span></button>';
|
|
1911
|
+
}).join("");
|
|
1912
|
+
return '<div class="dd-menu" id="dd-menu" data-dd="' + kind + '" role="menu" style="visibility:hidden">' + rows + '</div>';
|
|
1913
|
+
}
|
|
1914
|
+
|
|
1915
|
+
// ================================================================ GRID
|
|
1916
|
+
var TILE_MIN = { comfortable: "440px", compact: "330px", dense: "240px" };
|
|
1917
|
+
function buildTile(s, i) {
|
|
1918
|
+
var live = tone(s.status) === "running";
|
|
1919
|
+
return '<article class="tile" data-selected="' + (s.id === S.focusedId ? "true" : "false") + '" tabindex="0" role="button" data-action="open:' + esc(s.id) + '" aria-label="Open lane ' + pad2(i + 1) + ': ' + esc(laneName(s)) + '">'
|
|
1920
|
+
+ '<header class="tile-head"><span class="tile-idx mono">' + pad2(i + 1) + '</span>' + pip(s.status, live)
|
|
1921
|
+
+ '<span class="tile-name" title="' + esc(laneName(s)) + '">' + esc(laneName(s)) + '</span>'
|
|
1922
|
+
+ '<span class="kind-badge" data-kind="' + esc(s.kind) + '">' + esc(s.kindLabel || s.kind) + '</span>'
|
|
1923
|
+
+ '<span class="tile-dims mono">' + esc(dimsFor(s)) + '</span>'
|
|
1924
|
+
+ '<span class="tile-open">' + icon("expand", 13) + '</span></header>'
|
|
1925
|
+
+ '<div class="tile-surface" style="--aspect:' + aspectFor(s) + '">' + streamSurface(s, false) + '</div>'
|
|
1926
|
+
+ '<footer class="tile-foot" data-status="' + esc(s.status) + '"><span class="tile-foot-text">' + (live ? '<span class="now-dot">▸</span>' : '') + esc(laneStep(s)) + '</span>'
|
|
1927
|
+
+ '<span class="mini-prog"><span style="width:' + laneProgress(s) + '%"></span></span></footer>'
|
|
1928
|
+
+ '</article>';
|
|
1929
|
+
}
|
|
1930
|
+
function buildGrid() {
|
|
1931
|
+
var streams = filteredStreams();
|
|
1932
|
+
if (!streams.length) {
|
|
1933
|
+
var msg = S.query ? ('Nothing matches "' + esc(S.query) + '".') : "Try a different status or kind.";
|
|
1934
|
+
return '<div class="grid-scroll"><div class="grid"><div class="grid-empty">'
|
|
1935
|
+
+ '<div class="ge-icon">' + icon("search", 20) + '</div><h3>No lanes match your filters</h3>'
|
|
1936
|
+
+ '<div>' + msg + ' <button class="linklike" data-action="clear-filters">Clear filters</button></div></div></div></div>';
|
|
1937
|
+
}
|
|
1938
|
+
var tiles = streams.map(function (s, i) { return buildTile(s, i); }).join("");
|
|
1939
|
+
return '<div class="grid-scroll"><div class="grid" style="--tile-min:' + TILE_MIN[S.density] + '">' + tiles + '</div></div>';
|
|
1940
|
+
}
|
|
1941
|
+
|
|
1942
|
+
// ================================================================ FOCUS
|
|
1943
|
+
function focusIndex() {
|
|
1944
|
+
var ss = currentData.streams;
|
|
1945
|
+
var idx = -1;
|
|
1946
|
+
for (var i = 0; i < ss.length; i += 1) { if (ss[i].id === S.focusedId) { idx = i; break; } }
|
|
1947
|
+
return idx < 0 ? 0 : idx;
|
|
1948
|
+
}
|
|
1949
|
+
function railIcon(kind) {
|
|
1950
|
+
if (kind === "terminal" || kind === "tui") return "terminal";
|
|
1951
|
+
if (kind === "codex-ui") return "spark";
|
|
1952
|
+
return "globe";
|
|
1953
|
+
}
|
|
1954
|
+
function artifactHref(a) {
|
|
1955
|
+
return a && a.path ? linkHref(a.path, true) : "";
|
|
1956
|
+
}
|
|
1957
|
+
function ensureArtifactLoaded(a) {
|
|
1958
|
+
if (!a || !a.path || a.kind !== "filesystem") return;
|
|
1959
|
+
var key = a.path;
|
|
1960
|
+
if (artifactCache[key]) return;
|
|
1961
|
+
if (location.protocol === "file:") {
|
|
1962
|
+
artifactCache[key] = { status: "offline", text: "", json: null };
|
|
1963
|
+
return;
|
|
1964
|
+
}
|
|
1965
|
+
var href = artifactHref(a);
|
|
1966
|
+
if (!href) {
|
|
1967
|
+
artifactCache[key] = { status: "error", text: "", json: null, error: "Artifact path is not fetchable." };
|
|
1968
|
+
return;
|
|
1969
|
+
}
|
|
1970
|
+
artifactCache[key] = { status: "loading", text: "", json: null };
|
|
1971
|
+
fetch(href, { cache: "no-store" }).then(function (r) {
|
|
1972
|
+
if (!r.ok) throw new Error("HTTP " + r.status);
|
|
1973
|
+
return r.text();
|
|
1974
|
+
}).then(function (text) {
|
|
1975
|
+
var json = null;
|
|
1976
|
+
try { json = JSON.parse(text); } catch (e) {}
|
|
1977
|
+
artifactCache[key] = { status: "loaded", text: text, json: json };
|
|
1978
|
+
render();
|
|
1979
|
+
}).catch(function (e) {
|
|
1980
|
+
artifactCache[key] = { status: "error", text: "", json: null, error: e && e.message ? e.message : "Fetch failed." };
|
|
1981
|
+
render();
|
|
1982
|
+
});
|
|
1983
|
+
}
|
|
1984
|
+
function formatBytes(n) {
|
|
1985
|
+
if (typeof n !== "number" || !isFinite(n)) return "";
|
|
1986
|
+
if (n < 1024) return n + "b";
|
|
1987
|
+
if (n < 1024 * 1024) return Math.round(n / 102.4) / 10 + "kb";
|
|
1988
|
+
return Math.round(n / 1024 / 102.4) / 10 + "mb";
|
|
1989
|
+
}
|
|
1990
|
+
function renderGenericArtifact(a, state) {
|
|
1991
|
+
if (!state || state.status === "loading") return '<div class="fi-load"><span class="wait-spinner" style="width:18px;height:18px;display:inline-block;vertical-align:middle;margin-right:8px"></span>Loading artifact…</div>';
|
|
1992
|
+
if (state.status === "offline") return '<div class="fi-load">Static file view cannot hydrate artifacts inline. Open the artifact link directly.</div>';
|
|
1993
|
+
if (state.status === "error") return '<div class="fi-load">Could not load artifact: ' + esc(state.error || "unknown error") + '</div>';
|
|
1994
|
+
return '<div class="file-inspector"><div class="fi-head"><div class="fi-title"><h3>' + esc(a.label || a.path) + '</h3><span class="fi-status">artifact</span></div>'
|
|
1995
|
+
+ '<div class="fi-summary mono">' + esc(a.path) + '</div></div>'
|
|
1996
|
+
+ '<div class="fi-section"><pre class="fi-pre">' + esc(state.text || "") + '</pre></div></div>';
|
|
1997
|
+
}
|
|
1998
|
+
function renderSetupQualityArtifact(a, state) {
|
|
1999
|
+
if (!state || state.status !== "loaded" || !state.json || state.json.schema !== "humanish.setup-quality.v1") {
|
|
2000
|
+
return renderGenericArtifact(a, state);
|
|
2001
|
+
}
|
|
2002
|
+
var q = state.json;
|
|
2003
|
+
var checks = q.checks || [];
|
|
2004
|
+
var mim = q.humanish || {};
|
|
2005
|
+
var scripts = q.packageScripts || {};
|
|
2006
|
+
var tree = q.tree || [];
|
|
2007
|
+
var previews = q.previews || [];
|
|
2008
|
+
var scriptRows = Object.keys(scripts).sort().slice(0, 18).map(function (key) {
|
|
2009
|
+
return '<div class="fi-tree-row"><span>$</span><span>' + esc(key) + '</span><span class="fi-tree-size">' + esc(scripts[key]) + '</span></div>';
|
|
2010
|
+
}).join("");
|
|
2011
|
+
var treeRows = tree.slice(0, 160).map(function (entry) {
|
|
2012
|
+
return '<div class="fi-tree-row" data-type="' + esc(entry.type || "file") + '"><span>' + (entry.type === "directory" ? "dir" : "file") + '</span><span>' + esc(entry.path) + '</span><span class="fi-tree-size">' + esc(formatBytes(entry.sizeBytes)) + '</span></div>';
|
|
2013
|
+
}).join("");
|
|
2014
|
+
var previewRows = previews.length ? previews.map(function (preview) {
|
|
2015
|
+
return '<div class="fi-preview"><div class="fi-preview-head"><span>' + esc(preview.path) + '</span><span>' + esc(preview.language || "text") + (preview.truncated ? " · truncated" : "") + '</span></div><pre class="fi-pre">' + esc(preview.text || "") + '</pre></div>';
|
|
2016
|
+
}).join("") : '<div class="tab-empty">No raw file previews persisted for this run.</div>';
|
|
2017
|
+
return '<div class="file-inspector"><div class="fi-head"><div class="fi-title"><h3>Setup quality</h3><span class="fi-status" data-status="' + esc(q.status || "unknown") + '">' + esc(q.status || "unknown") + '</span></div>'
|
|
2018
|
+
+ '<div class="fi-summary">' + esc(q.summary || "") + '</div><div class="fi-summary mono">' + esc(a.path) + '</div></div>'
|
|
2019
|
+
+ '<div class="fi-section"><div class="fi-grid">'
|
|
2020
|
+
+ '<div class="fi-stat"><div class="fi-stat-k">personas</div><div class="fi-stat-v">' + esc(mim.personaCount || 0) + '</div></div>'
|
|
2021
|
+
+ '<div class="fi-stat"><div class="fi-stat-k">scenarios</div><div class="fi-stat-v">' + esc(mim.scenarioCount || 0) + '</div></div>'
|
|
2022
|
+
+ '<div class="fi-stat"><div class="fi-stat-k">config</div><div class="fi-stat-v">' + (mim.configPresent ? "present" : "missing") + '</div></div>'
|
|
2023
|
+
+ '<div class="fi-stat"><div class="fi-stat-k">runtime ignore</div><div class="fi-stat-v">' + (mim.gitignoreContainsRuntimeIgnore ? "present" : "missing") + '</div></div>'
|
|
2024
|
+
+ '</div></div>'
|
|
2025
|
+
+ '<div class="fi-section"><div class="fi-section-title"><span>Checks</span><span class="mono">' + checks.filter(function (c) { return c.ok; }).length + ' / ' + checks.length + '</span></div>'
|
|
2026
|
+
+ checks.map(function (check) { return '<div class="fi-check" data-ok="' + (check.ok ? "true" : "false") + '"><span class="fi-dot">' + icon(check.ok ? "check" : "alert", 11) + '</span><div><div class="fi-check-name">' + esc(check.label) + '</div><div class="fi-check-detail">' + esc(check.detail) + '</div></div></div>'; }).join("") + '</div>'
|
|
2027
|
+
+ '<div class="fi-section"><div class="fi-section-title"><span>Package scripts</span><span class="mono">' + Object.keys(scripts).length + '</span></div><div class="fi-tree">' + (scriptRows || '<div class="tab-empty">No package scripts captured.</div>') + '</div></div>'
|
|
2028
|
+
+ '<div class="fi-section"><div class="fi-section-title"><span>Tree</span><span class="mono">' + tree.length + '</span></div><div class="fi-tree">' + (treeRows || '<div class="tab-empty">No tree entries captured.</div>') + '</div></div>'
|
|
2029
|
+
+ '<div class="fi-section"><div class="fi-section-title"><span>Previews</span><span class="mono">' + previews.length + '</span></div>' + previewRows + '</div></div>';
|
|
2030
|
+
}
|
|
2031
|
+
function buildFilesTab(s) {
|
|
2032
|
+
var arts = laneArtifacts(s);
|
|
2033
|
+
if (!arts.length) return '<div class="tab-empty">No evidence artifacts linked.</div>';
|
|
2034
|
+
var selected = null;
|
|
2035
|
+
for (var i = 0; i < arts.length; i += 1) {
|
|
2036
|
+
if (arts[i].path === S.filePath) { selected = arts[i]; break; }
|
|
2037
|
+
}
|
|
2038
|
+
if (!selected) {
|
|
2039
|
+
for (var j = 0; j < arts.length; j += 1) {
|
|
2040
|
+
if (arts[j].kind === "filesystem") { selected = arts[j]; break; }
|
|
2041
|
+
}
|
|
2042
|
+
}
|
|
2043
|
+
var inspector = "";
|
|
2044
|
+
if (selected && selected.kind === "filesystem") {
|
|
2045
|
+
ensureArtifactLoaded(selected);
|
|
2046
|
+
inspector = renderSetupQualityArtifact(selected, artifactCache[selected.path]);
|
|
2047
|
+
}
|
|
2048
|
+
var rows = arts.map(function (a) {
|
|
2049
|
+
var href = artifactHref(a);
|
|
2050
|
+
var isSelected = selected && selected.path === a.path;
|
|
2051
|
+
var inspectable = a.kind === "filesystem";
|
|
2052
|
+
var main = inspectable
|
|
2053
|
+
? '<button data-action="inspect-file:' + esc(a.path) + '"><span class="file-ic">' + icon("file", 14) + '</span><span class="file-meta"><div class="file-name">' + esc(a.label) + '</div><div class="file-path mono">' + esc(a.path) + '</div></span><span class="file-kind">' + esc(a.kind) + '</span></button>'
|
|
2054
|
+
: '<a href="' + esc(href) + '" target="_blank" rel="noopener noreferrer" data-action="external"><span class="file-ic">' + icon("file", 14) + '</span><span class="file-meta"><div class="file-name">' + esc(a.label) + '</div><div class="file-path mono">' + esc(a.path) + '</div></span><span class="file-kind">' + esc(a.kind) + '</span></a>';
|
|
2055
|
+
return '<div class="file-row" data-selected="' + (isSelected ? "true" : "false") + '">' + main
|
|
2056
|
+
+ (href ? '<a class="file-open" href="' + esc(href) + '" target="_blank" rel="noopener noreferrer" data-action="external">open</a>' : "")
|
|
2057
|
+
+ '</div>';
|
|
2058
|
+
}).join("");
|
|
2059
|
+
return inspector + rows;
|
|
2060
|
+
}
|
|
2061
|
+
function buildSideBody(s) {
|
|
2062
|
+
if (S.tab === "events") {
|
|
2063
|
+
var evs = laneEvents(s);
|
|
2064
|
+
if (!evs.length) return '<div class="tab-empty">No orchestrator lifecycle events recorded yet.</div>';
|
|
2065
|
+
return evs.map(function (ev, i) {
|
|
2066
|
+
var ic = (ev.level === "error" || ev.level === "warn") ? "alert" : "info";
|
|
2067
|
+
return '<div class="evt" data-level="' + esc(ev.level) + '"><div class="evt-rail"><span class="evt-icon">' + icon(ic, 12) + '</span>' + (i === evs.length - 1 ? '' : '<span class="evt-conn"></span>') + '</div>'
|
|
2068
|
+
+ '<div><div class="evt-text">' + esc(ev.message) + '</div><div class="evt-meta"><span class="evt-type mono">' + esc(ev.type) + '</span><span>· ' + esc(shortTime(ev.at) || "just now") + '</span></div></div></div>';
|
|
2069
|
+
}).join("");
|
|
2070
|
+
}
|
|
2071
|
+
if (S.tab === "files") {
|
|
2072
|
+
return buildFilesTab(s);
|
|
2073
|
+
}
|
|
2074
|
+
return buildLogsTab(s);
|
|
2075
|
+
}
|
|
2076
|
+
function buildLogsTab(s) {
|
|
2077
|
+
var sections = logSections(s);
|
|
2078
|
+
if (!sections.length) return '<div class="tab-empty">No agent or terminal log text recorded for this lane.</div>';
|
|
2079
|
+
return '<div class="log-panel"><div class="log-scroll">' + sections.map(function (section) {
|
|
2080
|
+
var rows = section.lines.map(function (ln, i) {
|
|
2081
|
+
return '<div class="log-row"><span class="log-num">' + pad2(i + 1) + '</span><span class="log-txt ' + ln.cls + '">' + esc(ln.text || " ") + '</span></div>';
|
|
2082
|
+
}).join("");
|
|
2083
|
+
return '<section class="log-section" data-log-section="' + esc(section.id) + '"><div class="log-section-head"><span class="log-section-title">' + esc(section.title) + '</span><span class="log-section-count">' + section.lines.length + ' lines</span></div>' + rows + '</section>';
|
|
2084
|
+
}).join("") + '</div></div>';
|
|
2085
|
+
}
|
|
2086
|
+
function buildFocus() {
|
|
2087
|
+
var ss = currentData.streams;
|
|
2088
|
+
if (!ss.length) return '<div class="grid-empty"><h3>No lanes in this run.</h3></div>';
|
|
2089
|
+
var idx = focusIndex();
|
|
2090
|
+
var s = ss[idx];
|
|
2091
|
+
var run = currentData.run;
|
|
2092
|
+
var live = tone(s.status) === "running";
|
|
2093
|
+
var tabs = [
|
|
2094
|
+
{ id: "logs", label: hasAgentLogs(s) ? "Agent Logs" : "Logs", n: logLineCount(s) },
|
|
2095
|
+
{ id: "files", label: "Files", n: laneArtifacts(s).length },
|
|
2096
|
+
{ id: "events", label: "Lifecycle", n: laneEvents(s).length }
|
|
2097
|
+
];
|
|
2098
|
+
var rail = '<aside class="focus-rail" aria-label="Lanes"><div class="focus-rail-head"><span class="eyebrow">' + ss.length + ' lanes</span>'
|
|
2099
|
+
+ '<button class="icon-btn" style="width:26px;height:26px" data-action="toggle-rail" aria-label="Collapse lane rail">' + icon("chevL", 15) + '</button></div>'
|
|
2100
|
+
+ '<div class="focus-rail-list">' + ss.map(function (r) {
|
|
2101
|
+
return '<button class="rail-item" data-selected="' + (r.id === s.id ? "true" : "false") + '" data-action="select:' + esc(r.id) + '">'
|
|
2102
|
+
+ '<span class="rail-thumb">' + icon(railIcon(r.kind), 13) + '</span>'
|
|
2103
|
+
+ '<span class="rail-meta"><span class="rail-name">' + esc(laneName(r)) + '</span><span class="rail-sub">' + pip(r.status, tone(r.status) === "running") + ' ' + esc(r.kindLabel || r.kind) + '</span></span></button>';
|
|
2104
|
+
}).join("") + '</div></aside>';
|
|
2105
|
+
|
|
2106
|
+
var stage = '<section class="focus-stage"><div class="focus-stage-area"><div class="focus-frame" style="--aspect:' + aspectFor(s) + '">' + streamSurface(s, true) + '</div></div></section>';
|
|
2107
|
+
|
|
2108
|
+
var side = '<aside class="focus-side" aria-hidden="' + (S.sideCollapsed ? "true" : "false") + '" data-sheet="' + (S.sheetOpen ? "open" : "closed") + '">'
|
|
2109
|
+
+ '<button class="sheet-grip" data-action="toggle-sheet" aria-label="Toggle details"></button>'
|
|
2110
|
+
+ '<div class="side-context"><div class="side-persona-row"><span class="side-avatar mono">' + esc(initials((run.persona && run.persona.name) || "")) + '</span>'
|
|
2111
|
+
+ '<div style="min-width:0"><div class="side-persona-name">' + esc((run.persona && run.persona.name) || "Persona") + '</div><div class="side-persona-id mono">persona driving · ' + esc(laneName(s)) + '</div></div></div>'
|
|
2112
|
+
+ '<div class="side-goal"><span class="eyebrow">Persona</span><div class="side-goal-text">' + esc((run.persona && run.persona.name) || "Synthetic persona") + ' is attempting this lane as a realistic setup operator.</div></div>'
|
|
2113
|
+
+ '<div class="side-goal"><span class="eyebrow">Scenario</span><div class="side-goal-text">' + esc((run.scenario && run.scenario.goal) || laneSummary(s)) + '</div></div>'
|
|
2114
|
+
+ '<div class="side-now"><div class="side-now-row">' + pip(s.status, live) + '<span class="eyebrow" style="color:' + (live ? "var(--accent-2)" : "var(--text-3)") + '">' + (live ? "Now" : "Last step") + '</span></div>'
|
|
2115
|
+
+ '<div class="side-now-text">' + esc(laneStep(s)) + '</div></div>' + buildMeaningfulUseCard(s) + '</div>'
|
|
2116
|
+
+ '<div class="side-tabs" role="tablist">' + tabs.map(function (t) {
|
|
2117
|
+
return '<button class="side-tab" role="tab" aria-selected="' + (S.tab === t.id ? "true" : "false") + '" data-action="tab:' + t.id + '">' + t.label + '<span class="tab-n">' + t.n + '</span></button>';
|
|
2118
|
+
}).join("") + '</div>'
|
|
2119
|
+
+ '<div class="side-body">' + buildSideBody(s) + '</div></aside>';
|
|
2120
|
+
return '<div class="focus" data-rail="' + (S.railCollapsed ? "collapsed" : "open") + '" data-side="' + (S.sideCollapsed ? "collapsed" : "open") + '">' + rail + stage + side + '</div>';
|
|
2121
|
+
}
|
|
2122
|
+
function statusColor(st) {
|
|
2123
|
+
var t = tone(st);
|
|
2124
|
+
return t === "running" ? "var(--accent-2)" : t === "complete" ? "var(--green)" : t === "blocked" ? "var(--amber)" : st === "failed" ? "var(--red)" : "var(--text-2)";
|
|
2125
|
+
}
|
|
2126
|
+
|
|
2127
|
+
// ================================================================ CONSOLE + STATUSBAR
|
|
2128
|
+
function buildConsole() {
|
|
2129
|
+
var lines = consoleLines();
|
|
2130
|
+
var rows = lines.map(function (ln) {
|
|
2131
|
+
return '<div class="console-line"><span class="console-t">' + esc(ln.t) + '</span><span class="console-txt ' + ln.lvl + '">' + esc(ln.text) + '</span></div>';
|
|
2132
|
+
}).join("");
|
|
2133
|
+
var caretT = lines.length ? lines[lines.length - 1].t : "";
|
|
2134
|
+
return '<section class="console" style="height:230px" role="dialog" aria-label="Run console">'
|
|
2135
|
+
+ '<header class="console-head"><span class="console-title">' + icon("terminal", 14) + ' Run console <span class="mono console-cmd">humanish watch</span></span>'
|
|
2136
|
+
+ (hasLive() ? '<span class="console-live">' + pip("running", true) + ' tailing</span>' : '')
|
|
2137
|
+
+ '<div class="tb-spacer"></div><span class="console-meta mono">' + lines.length + ' lines</span>'
|
|
2138
|
+
+ '<button class="icon-btn" style="width:28px;height:28px" data-action="toggle-console" aria-label="Close console">' + icon("x", 15) + '</button></header>'
|
|
2139
|
+
+ '<div class="console-body mono" id="console-body">' + rows
|
|
2140
|
+
+ '<div class="console-line"><span class="console-t">' + esc(caretT) + '</span><span class="console-txt"><span class="term-caret"></span></span></div></div></section>';
|
|
2141
|
+
}
|
|
2142
|
+
function buildStatusBar() {
|
|
2143
|
+
var overall = overallStatus(), pct = overallPct();
|
|
2144
|
+
var run = currentData.run;
|
|
2145
|
+
var counts = statusCountsModel().filter(function (c) { return c.count > 0; });
|
|
2146
|
+
var last = consoleLines();
|
|
2147
|
+
var lastLine = last[last.length - 1];
|
|
2148
|
+
var peek = (!S.consoleOpen && lastLine) ? ('<span class="sb-console-peek mono"><span class="sb-peek-t">' + esc(lastLine.t) + '</span><span class="sb-peek-txt ' + lastLine.lvl + '">' + esc(lastLine.text) + '</span></span>') : "";
|
|
2149
|
+
return '<footer class="statusbar">'
|
|
2150
|
+
+ '<span class="sb-status" data-tone="' + tone(overall) + '">' + pip(overall, tone(overall) === "running") + '<span class="sb-status-label mono">' + statusLabel(overall) + '</span><span class="sb-pct mono">' + pct + '%</span></span>'
|
|
2151
|
+
+ '<span class="sb-prog"><span style="width:' + pct + '%" data-tone="' + tone(overall) + '"></span></span>'
|
|
2152
|
+
+ '<span class="sb-counts">' + counts.map(function (c) { return '<span class="sb-count" title="' + c.count + ' ' + c.label + '"><span class="si-dot" style="background:' + c.color + '"></span><span class="mono">' + c.count + '</span></span>'; }).join("") + '</span>'
|
|
2153
|
+
+ '<span class="sb-run mono">' + esc((run.mode || "") + " · " + (run.runId || "")) + '</span>'
|
|
2154
|
+
+ '<div class="tb-spacer"></div>'
|
|
2155
|
+
+ '<button class="sb-console" aria-expanded="' + (S.consoleOpen ? "true" : "false") + '" data-action="toggle-console" title="Run console (backtick)">' + icon("terminal", 14)
|
|
2156
|
+
+ '<span class="sb-console-label">Run console</span>' + peek
|
|
2157
|
+
+ '<span class="sb-chev' + (S.consoleOpen ? " open" : "") + '">' + icon("caret", 13) + '</span></button>'
|
|
2158
|
+
+ '</footer>';
|
|
2159
|
+
}
|
|
2160
|
+
|
|
2161
|
+
// ================================================================ DRAWER + POPOVERS
|
|
2162
|
+
function buildPopover() {
|
|
2163
|
+
var run = currentData.run;
|
|
2164
|
+
return '<div class="pop" role="dialog" aria-label="Run details">'
|
|
2165
|
+
+ popRow("Run id", esc(run.runId || ""))
|
|
2166
|
+
+ popRow("Started", esc(shortStamp(run.createdAt)))
|
|
2167
|
+
+ popRow("Mode", '<span class="tag">' + esc(run.mode || "") + '</span>')
|
|
2168
|
+
+ popRow("Package", esc(run.packageName || "(none)"))
|
|
2169
|
+
+ popRow("Evidence", '<span class="tag" data-tone="green">' + icon("lock", 10) + ' local-only</span>')
|
|
2170
|
+
+ '</div>';
|
|
2171
|
+
}
|
|
2172
|
+
function popRow(k, v) { return '<div class="pop-row"><span class="pop-k">' + k + '</span><span class="pop-v">' + v + '</span></div>'; }
|
|
2173
|
+
|
|
2174
|
+
function buildTweaks() {
|
|
2175
|
+
return '<div class="tweaks-pop" role="dialog" aria-label="Settings">'
|
|
2176
|
+
+ '<div class="tw-sec">Appearance</div>'
|
|
2177
|
+
+ twSeg("Theme", "theme", S.theme, [["dark", "dark"], ["light", "light"]])
|
|
2178
|
+
+ '<div class="tw-row"><span class="tw-label">Accent</span><span class="tw-swatches">'
|
|
2179
|
+
+ ["#4d7cfe", "#7c5cff", "#34d399", "#f0a92b", "#fb5d52"].map(function (col) {
|
|
2180
|
+
return '<button class="tw-swatch" aria-pressed="' + (S.accent === col ? "true" : "false") + '" data-action="tweak:accent:' + col + '" style="background:' + col + '" title="' + col + '"></button>';
|
|
2181
|
+
}).join("") + '</span></div>'
|
|
2182
|
+
+ '<div class="tw-sec">Layout</div>'
|
|
2183
|
+
+ twSeg("Density", "density", S.density, [["comfortable", "comfy"], ["compact", "compact"], ["dense", "dense"]])
|
|
2184
|
+
+ twSeg("Status", "statusViz", S.statusViz, [["badges", "badges"], ["bar", "bar"], ["ring", "ring"]])
|
|
2185
|
+
+ '<div class="tw-sec">Motion</div>'
|
|
2186
|
+
+ twSeg("Motion", "motion", S.motion, [["full", "full"], ["reduced", "reduced"]])
|
|
2187
|
+
+ '</div>';
|
|
2188
|
+
}
|
|
2189
|
+
function twSeg(label, key, value, opts) {
|
|
2190
|
+
return '<div class="tw-row"><span class="tw-label">' + label + '</span><span class="tw-seg">'
|
|
2191
|
+
+ opts.map(function (o) { return '<button aria-pressed="' + (value === o[0] ? "true" : "false") + '" data-action="tweak:' + key + ':' + o[0] + '">' + o[1] + '</button>'; }).join("")
|
|
2192
|
+
+ '</span></div>';
|
|
2193
|
+
}
|
|
2194
|
+
|
|
2195
|
+
function historyRuns() {
|
|
2196
|
+
if (historyIndex && historyIndex.runs && historyIndex.runs.length) return historyIndex.runs;
|
|
2197
|
+
var run = currentData.run;
|
|
2198
|
+
return [{ runId: run.runId, createdAt: run.createdAt, mode: run.mode, status: overallStatus(), streamCount: currentData.streams.length, href: null }];
|
|
2199
|
+
}
|
|
2200
|
+
function buildDrawer() {
|
|
2201
|
+
var runs = historyRuns();
|
|
2202
|
+
var activeId = currentData.run.runId;
|
|
2203
|
+
var rows = runs.map(function (r) {
|
|
2204
|
+
var t = tone(r.status);
|
|
2205
|
+
var col = t === "running" ? "var(--accent-2)" : t === "complete" ? "var(--green)" : t === "blocked" ? "var(--amber)" : r.status === "failed" ? "var(--red)" : "var(--text-2)";
|
|
2206
|
+
var liveTagTxt = (r.runId === activeId && t === "running") ? '<span style="color:var(--accent-2)"> · live</span>' : "";
|
|
2207
|
+
return '<button class="run-row" data-active="' + (r.runId === activeId ? "true" : "false") + '" data-action="run:' + esc(r.runId) + '">'
|
|
2208
|
+
+ pip(r.status, t === "running")
|
|
2209
|
+
+ '<span class="run-row-id mono">' + esc(r.runId) + liveTagTxt + '</span>'
|
|
2210
|
+
+ '<span class="run-row-stat" style="color:' + col + '">' + statusLabel(r.status) + '</span>'
|
|
2211
|
+
+ '<span class="run-row-meta mono">' + esc((r.mode || "run") + " · " + (r.streamCount || 0) + " lanes · " + shortStamp(r.createdAt)) + '</span></button>';
|
|
2212
|
+
}).join("");
|
|
2213
|
+
return '<div class="scrim" data-action="close-history"></div><aside class="drawer" role="dialog" aria-label="Run history">'
|
|
2214
|
+
+ '<header class="drawer-head"><div><span class="eyebrow">Run history</span><h2>Recent runs</h2></div>'
|
|
2215
|
+
+ '<button class="icon-btn" data-action="close-history" aria-label="Close">' + icon("x") + '</button></header>'
|
|
2216
|
+
+ '<div class="drawer-list">' + rows + '</div></aside>';
|
|
2217
|
+
}
|
|
2218
|
+
|
|
2219
|
+
// ================================================================ RENDER
|
|
2220
|
+
function captureScrolls() {
|
|
2221
|
+
var map = {};
|
|
2222
|
+
[".grid-scroll", ".console-body", ".focus-rail-list", ".side-body", ".focus-stage-area", ".drawer-list", ".log-scroll"].forEach(function (sel) {
|
|
2223
|
+
var el = app.querySelector(sel);
|
|
2224
|
+
if (el) map[sel] = el.scrollTop;
|
|
2225
|
+
});
|
|
2226
|
+
return map;
|
|
2227
|
+
}
|
|
2228
|
+
function restoreScrolls(map) {
|
|
2229
|
+
Object.keys(map).forEach(function (sel) {
|
|
2230
|
+
var el = app.querySelector(sel);
|
|
2231
|
+
if (el) el.scrollTop = map[sel];
|
|
2232
|
+
});
|
|
2233
|
+
}
|
|
2234
|
+
function placeMenus() {
|
|
2235
|
+
var menu = document.getElementById("dd-menu");
|
|
2236
|
+
if (!menu) return;
|
|
2237
|
+
var kind = menu.getAttribute("data-dd");
|
|
2238
|
+
var trg = document.getElementById("dd-trigger-" + kind);
|
|
2239
|
+
if (!trg) { menu.style.visibility = "visible"; return; }
|
|
2240
|
+
var w = 210;
|
|
2241
|
+
var r = trg.getBoundingClientRect();
|
|
2242
|
+
var left = r.left;
|
|
2243
|
+
if (left + w > window.innerWidth - 8) left = Math.max(8, window.innerWidth - 8 - w);
|
|
2244
|
+
menu.style.width = w + "px";
|
|
2245
|
+
menu.style.top = (r.bottom + 6) + "px";
|
|
2246
|
+
menu.style.left = left + "px";
|
|
2247
|
+
menu.style.visibility = "visible";
|
|
2248
|
+
}
|
|
2249
|
+
function ensureLiveStreamHost() {
|
|
2250
|
+
if (liveStreamHost) return liveStreamHost;
|
|
2251
|
+
if (!document.createElement) return null;
|
|
2252
|
+
var host = document.body || document.documentElement;
|
|
2253
|
+
if (!host || !host.appendChild) return null;
|
|
2254
|
+
liveStreamHost = document.createElement("div");
|
|
2255
|
+
liveStreamHost.setAttribute("data-live-stream-host", "true");
|
|
2256
|
+
liveStreamHost.style.position = "fixed";
|
|
2257
|
+
liveStreamHost.style.inset = "0";
|
|
2258
|
+
liveStreamHost.style.overflow = "visible";
|
|
2259
|
+
liveStreamHost.style.pointerEvents = "none";
|
|
2260
|
+
liveStreamHost.style.zIndex = "20";
|
|
2261
|
+
host.appendChild(liveStreamHost);
|
|
2262
|
+
return liveStreamHost;
|
|
2263
|
+
}
|
|
2264
|
+
function createLiveStreamRecord(id, url, title) {
|
|
2265
|
+
var host = ensureLiveStreamHost();
|
|
2266
|
+
if (!host) return null;
|
|
2267
|
+
var wrapper = document.createElement("div");
|
|
2268
|
+
wrapper.setAttribute("data-live-stream-wrapper", id);
|
|
2269
|
+
wrapper.style.position = "fixed";
|
|
2270
|
+
wrapper.style.overflow = "hidden";
|
|
2271
|
+
wrapper.style.background = "#000";
|
|
2272
|
+
wrapper.style.pointerEvents = "none";
|
|
2273
|
+
wrapper.style.display = "none";
|
|
2274
|
+
var frame = document.createElement("iframe");
|
|
2275
|
+
frame.style.position = "absolute";
|
|
2276
|
+
frame.style.border = "0";
|
|
2277
|
+
frame.style.margin = "0";
|
|
2278
|
+
frame.style.display = "block";
|
|
2279
|
+
frame.setAttribute("allow", "clipboard-read; clipboard-write; fullscreen");
|
|
2280
|
+
frame.setAttribute("referrerpolicy", "no-referrer");
|
|
2281
|
+
frame.setAttribute("title", title || "live stream");
|
|
2282
|
+
frame.setAttribute("data-live-stream-frame", id);
|
|
2283
|
+
frame.src = url;
|
|
2284
|
+
var overlay = document.createElement("div");
|
|
2285
|
+
overlay.className = "live-stream-overlay";
|
|
2286
|
+
overlay.style.position = "absolute";
|
|
2287
|
+
overlay.style.overflow = "hidden";
|
|
2288
|
+
overlay.style.pointerEvents = "none";
|
|
2289
|
+
overlay.style.zIndex = "2";
|
|
2290
|
+
wrapper.appendChild(frame);
|
|
2291
|
+
wrapper.appendChild(overlay);
|
|
2292
|
+
host.appendChild(wrapper);
|
|
2293
|
+
return { url: url, wrapper: wrapper, frame: frame, overlay: overlay, overlayHtml: "" };
|
|
2294
|
+
}
|
|
2295
|
+
function removeLiveStreamRecord(id) {
|
|
2296
|
+
var rec = liveStreamFrames[id];
|
|
2297
|
+
if (rec && rec.wrapper && rec.wrapper.parentNode) rec.wrapper.parentNode.removeChild(rec.wrapper);
|
|
2298
|
+
delete liveStreamFrames[id];
|
|
2299
|
+
}
|
|
2300
|
+
function hideLiveStreamRecord(rec) {
|
|
2301
|
+
if (!rec || !rec.wrapper) return;
|
|
2302
|
+
rec.wrapper.style.display = "none";
|
|
2303
|
+
rec.wrapper.style.pointerEvents = "none";
|
|
2304
|
+
}
|
|
2305
|
+
function clipRect(rect) {
|
|
2306
|
+
var stage = app.querySelector && app.querySelector(".stage");
|
|
2307
|
+
var s = stage && stage.getBoundingClientRect ? stage.getBoundingClientRect() : null;
|
|
2308
|
+
var left = Math.max(rect.left, 0, s ? s.left : 0);
|
|
2309
|
+
var top = Math.max(rect.top, 0, s ? s.top : 0);
|
|
2310
|
+
var right = Math.min(rect.right, window.innerWidth || rect.right, s ? s.right : rect.right);
|
|
2311
|
+
var bottom = Math.min(rect.bottom, window.innerHeight || rect.bottom, s ? s.bottom : rect.bottom);
|
|
2312
|
+
return { left: left, top: top, right: right, bottom: bottom, width: Math.max(0, right - left), height: Math.max(0, bottom - top) };
|
|
2313
|
+
}
|
|
2314
|
+
function layoutLiveStreamRecord(rec, mount, overlayHtml) {
|
|
2315
|
+
if (!rec || !mount || !mount.getBoundingClientRect) return hideLiveStreamRecord(rec);
|
|
2316
|
+
var rect = mount.getBoundingClientRect();
|
|
2317
|
+
var clipped = clipRect(rect);
|
|
2318
|
+
if (rect.width < 2 || rect.height < 2 || clipped.width < 2 || clipped.height < 2) return hideLiveStreamRecord(rec);
|
|
2319
|
+
rec.wrapper.style.display = "block";
|
|
2320
|
+
rec.wrapper.style.left = clipped.left + "px";
|
|
2321
|
+
rec.wrapper.style.top = clipped.top + "px";
|
|
2322
|
+
rec.wrapper.style.width = clipped.width + "px";
|
|
2323
|
+
rec.wrapper.style.height = clipped.height + "px";
|
|
2324
|
+
rec.wrapper.style.pointerEvents = S.view === "focus" ? "auto" : "none";
|
|
2325
|
+
rec.frame.style.left = (rect.left - clipped.left) + "px";
|
|
2326
|
+
rec.frame.style.top = (rect.top - clipped.top) + "px";
|
|
2327
|
+
rec.frame.style.width = rect.width + "px";
|
|
2328
|
+
rec.frame.style.height = rect.height + "px";
|
|
2329
|
+
rec.frame.style.pointerEvents = S.view === "focus" ? "auto" : "none";
|
|
2330
|
+
if (rec.overlay) {
|
|
2331
|
+
rec.overlay.style.left = rec.frame.style.left;
|
|
2332
|
+
rec.overlay.style.top = rec.frame.style.top;
|
|
2333
|
+
rec.overlay.style.width = rec.frame.style.width;
|
|
2334
|
+
rec.overlay.style.height = rec.frame.style.height;
|
|
2335
|
+
rec.overlay.setAttribute("data-focus", S.view === "focus" ? "true" : "false");
|
|
2336
|
+
if (rec.overlayHtml !== overlayHtml) {
|
|
2337
|
+
rec.overlay.innerHTML = overlayHtml || "";
|
|
2338
|
+
rec.overlayHtml = overlayHtml || "";
|
|
2339
|
+
}
|
|
2340
|
+
}
|
|
2341
|
+
}
|
|
2342
|
+
function reconcileLiveStreams() {
|
|
2343
|
+
if (!app.querySelectorAll || !document.createElement) return;
|
|
2344
|
+
var known = {};
|
|
2345
|
+
currentData.streams.forEach(function (s) {
|
|
2346
|
+
var url = browserLiveUrl(s);
|
|
2347
|
+
if (url) known[s.id] = { url: url, stream: s };
|
|
2348
|
+
});
|
|
2349
|
+
var mounts = app.querySelectorAll("[data-live-stream-id]");
|
|
2350
|
+
var visible = {};
|
|
2351
|
+
Array.prototype.forEach.call(mounts, function (mount) {
|
|
2352
|
+
var id = mount.getAttribute("data-live-stream-id");
|
|
2353
|
+
var url = mount.getAttribute("data-live-stream-url") || "";
|
|
2354
|
+
var title = mount.getAttribute("data-live-stream-title") || "live stream";
|
|
2355
|
+
if (!id || !url) return;
|
|
2356
|
+
var knownStream = known[id] && known[id].stream;
|
|
2357
|
+
var overlayHtml = (S.view === "focus" && knownStream) ? browserLabDock(knownStream, browserShot(knownStream)) : "";
|
|
2358
|
+
var rec = liveStreamFrames[id];
|
|
2359
|
+
if (!rec || rec.url !== url) {
|
|
2360
|
+
removeLiveStreamRecord(id);
|
|
2361
|
+
rec = createLiveStreamRecord(id, url, title);
|
|
2362
|
+
if (!rec) return;
|
|
2363
|
+
liveStreamFrames[id] = rec;
|
|
2364
|
+
} else {
|
|
2365
|
+
rec.frame.setAttribute("title", title);
|
|
2366
|
+
}
|
|
2367
|
+
visible[id] = true;
|
|
2368
|
+
layoutLiveStreamRecord(rec, mount, overlayHtml);
|
|
2369
|
+
});
|
|
2370
|
+
Object.keys(liveStreamFrames).forEach(function (id) {
|
|
2371
|
+
var rec = liveStreamFrames[id];
|
|
2372
|
+
if (!known[id] || (rec && rec.url !== known[id].url)) removeLiveStreamRecord(id);
|
|
2373
|
+
else if (!visible[id]) hideLiveStreamRecord(rec);
|
|
2374
|
+
});
|
|
2375
|
+
}
|
|
2376
|
+
function scheduleLiveStreamLayout() {
|
|
2377
|
+
if (liveStreamLayoutRaf != null) return;
|
|
2378
|
+
var raf = window.requestAnimationFrame || function (fn) { return window.setTimeout(fn, 16); };
|
|
2379
|
+
liveStreamLayoutRaf = raf(function () {
|
|
2380
|
+
liveStreamLayoutRaf = null;
|
|
2381
|
+
reconcileLiveStreams();
|
|
2382
|
+
});
|
|
2383
|
+
}
|
|
2384
|
+
|
|
2385
|
+
function render() {
|
|
2386
|
+
var docEl = document.documentElement;
|
|
2387
|
+
docEl.setAttribute("data-theme", S.theme);
|
|
2388
|
+
docEl.setAttribute("data-motion", S.motion);
|
|
2389
|
+
docEl.style.setProperty("--accent-color", S.accent);
|
|
2390
|
+
docEl.style.setProperty("--accent", S.accent);
|
|
2391
|
+
|
|
2392
|
+
var ss = currentData.streams;
|
|
2393
|
+
if (!S.focusedId || !ss.some(function (s) { return s.id === S.focusedId; })) S.focusedId = ss.length ? ss[0].id : null;
|
|
2394
|
+
|
|
2395
|
+
var active = document.activeElement;
|
|
2396
|
+
var searchFocused = !!(active && active.getAttribute && active.getAttribute("data-role") === "search");
|
|
2397
|
+
var caret = searchFocused ? active.selectionStart : null;
|
|
2398
|
+
var scrolls = captureScrolls();
|
|
2399
|
+
|
|
2400
|
+
var parts = [];
|
|
2401
|
+
parts.push('<div class="runline" data-status="' + overallStatus() + '"><span style="width:' + overallPct() + '%"></span></div>');
|
|
2402
|
+
parts.push(buildHeader());
|
|
2403
|
+
if (S.detailsOpen) parts.push(buildPopover());
|
|
2404
|
+
if (S.tweaksOpen) parts.push(buildTweaks());
|
|
2405
|
+
parts.push(buildToolbar());
|
|
2406
|
+
parts.push('<main class="stage">' + (S.view === "grid" ? buildGrid() : buildFocus()) + '</main>');
|
|
2407
|
+
if (S.consoleOpen) parts.push(buildConsole());
|
|
2408
|
+
parts.push(buildStatusBar());
|
|
2409
|
+
if (S.historyOpen) parts.push(buildDrawer());
|
|
2410
|
+
parts.push(buildDdMenu());
|
|
2411
|
+
app.innerHTML = parts.join("");
|
|
2412
|
+
|
|
2413
|
+
restoreScrolls(scrolls);
|
|
2414
|
+
if (searchFocused) {
|
|
2415
|
+
var inp = app.querySelector('[data-role="search"]');
|
|
2416
|
+
if (inp) { inp.focus(); try { inp.setSelectionRange(caret, caret); } catch (e) {} }
|
|
2417
|
+
}
|
|
2418
|
+
placeMenus();
|
|
2419
|
+
reconcileLiveStreams();
|
|
2420
|
+
var cb = document.getElementById("console-body");
|
|
2421
|
+
if (cb && scrolls[".console-body"] == null) cb.scrollTop = cb.scrollHeight;
|
|
2422
|
+
}
|
|
2423
|
+
|
|
2424
|
+
// ================================================================ ACTIONS
|
|
2425
|
+
function toggleArr(arr, id) {
|
|
2426
|
+
var i = arr.indexOf(id);
|
|
2427
|
+
if (i >= 0) { arr.splice(i, 1); } else { arr.push(id); }
|
|
2428
|
+
}
|
|
2429
|
+
function writeHash(id) {
|
|
2430
|
+
var url = new URL(window.location.href);
|
|
2431
|
+
url.hash = id ? "focus=" + encodeURIComponent(id) : "";
|
|
2432
|
+
if (url.href !== window.location.href) window.history.replaceState({ focusedId: id }, "", url.href);
|
|
2433
|
+
}
|
|
2434
|
+
function openFocus(id) { S.focusedId = id; S.view = "focus"; writeHash(id); render(); }
|
|
2435
|
+
function exitFocus() { S.view = "grid"; writeHash(null); render(); }
|
|
2436
|
+
function navFocus(delta) {
|
|
2437
|
+
var ss = currentData.streams;
|
|
2438
|
+
if (!ss.length) return;
|
|
2439
|
+
var idx = focusIndex();
|
|
2440
|
+
var next = ((idx + delta) % ss.length + ss.length) % ss.length;
|
|
2441
|
+
S.focusedId = ss[next].id;
|
|
2442
|
+
writeHash(S.focusedId);
|
|
2443
|
+
render();
|
|
2444
|
+
}
|
|
2445
|
+
|
|
2446
|
+
function handleAction(action) {
|
|
2447
|
+
var parts = action.split(":");
|
|
2448
|
+
var cmd = parts[0];
|
|
2449
|
+
var arg = parts[1];
|
|
2450
|
+
var arg2 = parts[2];
|
|
2451
|
+
switch (cmd) {
|
|
2452
|
+
case "open": openFocus(arg); break;
|
|
2453
|
+
case "select": S.focusedId = arg; writeHash(arg); render(); break;
|
|
2454
|
+
case "exit-focus": exitFocus(); break;
|
|
2455
|
+
case "view":
|
|
2456
|
+
if (arg === "focus" && !S.focusedId && currentData.streams[0]) S.focusedId = currentData.streams[0].id;
|
|
2457
|
+
S.view = arg; writeHash(arg === "focus" ? S.focusedId : null); render(); break;
|
|
2458
|
+
case "nav": navFocus(Number(arg)); break;
|
|
2459
|
+
case "toggle-rail": S.railCollapsed = !S.railCollapsed; writePref("railCollapsed", S.railCollapsed); render(); break;
|
|
2460
|
+
case "toggle-side": S.sideCollapsed = !S.sideCollapsed; writePref("sideCollapsed", S.sideCollapsed); render(); break;
|
|
2461
|
+
case "toggle-sheet": S.sheetOpen = !S.sheetOpen; render(); break;
|
|
2462
|
+
case "tab": S.tab = arg; render(); break;
|
|
2463
|
+
case "density": S.density = arg; writePref("density", arg); render(); break;
|
|
2464
|
+
case "media": if (arg === "live" && !hasLive()) break; S.media = arg; render(); break;
|
|
2465
|
+
case "status":
|
|
2466
|
+
if (arg === "all") S.statusSel = [];
|
|
2467
|
+
else toggleArr(S.statusSel, arg);
|
|
2468
|
+
render(); break;
|
|
2469
|
+
case "clear-filters": S.statusSel = []; S.kindSel = []; S.query = ""; render(); break;
|
|
2470
|
+
case "dd": openDd = (openDd === arg ? null : arg); render(); break;
|
|
2471
|
+
case "dd-all":
|
|
2472
|
+
if (arg === "status") S.statusSel = []; else S.kindSel = [];
|
|
2473
|
+
render(); break;
|
|
2474
|
+
case "dd-row":
|
|
2475
|
+
if (arg === "status") toggleArr(S.statusSel, arg2); else toggleArr(S.kindSel, arg2);
|
|
2476
|
+
render(); break;
|
|
2477
|
+
case "toggle-console": S.consoleOpen = !S.consoleOpen; render(); break;
|
|
2478
|
+
case "inspect-file": S.filePath = action.slice("inspect-file:".length); S.tab = "files"; render(); break;
|
|
2479
|
+
case "toggle-details": S.detailsOpen = !S.detailsOpen; S.tweaksOpen = false; render(); break;
|
|
2480
|
+
case "toggle-tweaks": S.tweaksOpen = !S.tweaksOpen; S.detailsOpen = false; render(); break;
|
|
2481
|
+
case "toggle-theme": S.theme = (S.theme === "light" ? "dark" : "light"); writePref("theme", S.theme); render(); break;
|
|
2482
|
+
case "tweak":
|
|
2483
|
+
S[arg] = arg2; writePref(arg, arg2); render(); break;
|
|
2484
|
+
case "open-history": S.historyOpen = true; render(); refreshHistoryIndex(); break;
|
|
2485
|
+
case "close-history": S.historyOpen = false; render(); break;
|
|
2486
|
+
case "run": gotoRun(arg); break;
|
|
2487
|
+
default: break;
|
|
2488
|
+
}
|
|
2489
|
+
}
|
|
2490
|
+
function gotoRun(runId) {
|
|
2491
|
+
if (runId === currentData.run.runId) { S.historyOpen = false; render(); return; }
|
|
2492
|
+
if (location.protocol === "file:") { S.historyOpen = false; render(); return; }
|
|
2493
|
+
window.location.href = "/_humanish/runs/" + encodeURIComponent(runId) + "/observer/index.html";
|
|
2494
|
+
}
|
|
2495
|
+
|
|
2496
|
+
// ================================================================ EVENTS (bound once)
|
|
2497
|
+
app.addEventListener("click", function (e) {
|
|
2498
|
+
var t = e.target.closest ? e.target.closest("[data-action]") : null;
|
|
2499
|
+
if (!t || !app.contains(t)) return;
|
|
2500
|
+
var action = t.getAttribute("data-action");
|
|
2501
|
+
if (t.tagName !== "A") e.preventDefault();
|
|
2502
|
+
handleAction(action);
|
|
2503
|
+
});
|
|
2504
|
+
app.addEventListener("input", function (e) {
|
|
2505
|
+
var t = e.target;
|
|
2506
|
+
if (t && t.getAttribute && t.getAttribute("data-role") === "search") { S.query = t.value; render(); }
|
|
2507
|
+
});
|
|
2508
|
+
document.addEventListener("mousedown", function (e) {
|
|
2509
|
+
if (openDd) {
|
|
2510
|
+
var inMenu = e.target.closest && (e.target.closest(".dd-menu") || e.target.closest(".dd-trigger"));
|
|
2511
|
+
if (!inMenu) { openDd = null; render(); return; }
|
|
2512
|
+
}
|
|
2513
|
+
if (S.detailsOpen) {
|
|
2514
|
+
var inPop = e.target.closest && (e.target.closest(".pop") || e.target.closest(".run-chip"));
|
|
2515
|
+
if (!inPop) { S.detailsOpen = false; render(); }
|
|
2516
|
+
}
|
|
2517
|
+
if (S.tweaksOpen) {
|
|
2518
|
+
var inTw = e.target.closest && (e.target.closest(".tweaks-pop") || e.target.closest('[data-action="toggle-tweaks"]'));
|
|
2519
|
+
if (!inTw) { S.tweaksOpen = false; render(); }
|
|
2520
|
+
}
|
|
2521
|
+
});
|
|
2522
|
+
document.addEventListener("keydown", function (e) {
|
|
2523
|
+
var active = document.activeElement;
|
|
2524
|
+
var tag = active && active.tagName ? String(active.tagName).toUpperCase() : "";
|
|
2525
|
+
var typing = !!(active && (tag === "INPUT" || tag === "TEXTAREA" || tag === "SELECT" || active.isContentEditable));
|
|
2526
|
+
if (e.key === "Escape") {
|
|
2527
|
+
if (openDd) { openDd = null; return render(); }
|
|
2528
|
+
if (S.detailsOpen) { S.detailsOpen = false; return render(); }
|
|
2529
|
+
if (S.tweaksOpen) { S.tweaksOpen = false; return render(); }
|
|
2530
|
+
if (S.consoleOpen) { S.consoleOpen = false; return render(); }
|
|
2531
|
+
if (S.historyOpen) { S.historyOpen = false; return render(); }
|
|
2532
|
+
if (S.view === "focus") { return exitFocus(); }
|
|
2533
|
+
}
|
|
2534
|
+
if ((e.key === String.fromCharCode(96) || e.key === "~") && !typing) { e.preventDefault(); S.consoleOpen = !S.consoleOpen; render(); }
|
|
2535
|
+
if (e.key === "/" && S.view === "grid" && !typing) {
|
|
2536
|
+
e.preventDefault();
|
|
2537
|
+
var el = app.querySelector(".tb-search input");
|
|
2538
|
+
if (el) el.focus();
|
|
2539
|
+
}
|
|
2540
|
+
if (S.view === "focus" && e.key === "[" && !typing) {
|
|
2541
|
+
e.preventDefault();
|
|
2542
|
+
S.railCollapsed = !S.railCollapsed;
|
|
2543
|
+
writePref("railCollapsed", S.railCollapsed);
|
|
2544
|
+
render();
|
|
2545
|
+
}
|
|
2546
|
+
if (S.view === "focus" && e.key === "]" && !typing) {
|
|
2547
|
+
e.preventDefault();
|
|
2548
|
+
S.sideCollapsed = !S.sideCollapsed;
|
|
2549
|
+
writePref("sideCollapsed", S.sideCollapsed);
|
|
2550
|
+
render();
|
|
2551
|
+
}
|
|
2552
|
+
if (S.view === "focus" && (e.key === "ArrowRight" || e.key === "ArrowLeft") && !typing) {
|
|
2553
|
+
navFocus(e.key === "ArrowRight" ? 1 : -1);
|
|
2554
|
+
}
|
|
2555
|
+
});
|
|
2556
|
+
window.addEventListener("hashchange", function () {
|
|
2557
|
+
var next = focusFromHash();
|
|
2558
|
+
if (next && currentData.streams.some(function (s) { return s.id === next; })) {
|
|
2559
|
+
S.focusedId = next; if (S.view !== "focus") S.view = "focus"; render();
|
|
2560
|
+
}
|
|
2561
|
+
});
|
|
2562
|
+
window.addEventListener("resize", function () { if (openDd) placeMenus(); scheduleLiveStreamLayout(); });
|
|
2563
|
+
app.addEventListener("scroll", scheduleLiveStreamLayout, true);
|
|
2564
|
+
|
|
2565
|
+
// ================================================================ POLLING
|
|
2566
|
+
function dataKey(d) {
|
|
2567
|
+
var streams = (d.streams || []).map(function (s) {
|
|
2568
|
+
return {
|
|
2569
|
+
id: s.id,
|
|
2570
|
+
status: s.status,
|
|
2571
|
+
progress: laneProgress(s),
|
|
2572
|
+
step: laneStep(s),
|
|
2573
|
+
updatedAt: s.updatedAt,
|
|
2574
|
+
url: browserLiveUrl(s),
|
|
2575
|
+
route: laneRoute(s),
|
|
2576
|
+
tail: (s.terminalPlain || (s.terminal && s.terminal.tail) || "").slice(-1200),
|
|
2577
|
+
artifacts: (s.artifacts || []).map(function (a) { return [a.kind, a.path, a.label]; }),
|
|
2578
|
+
completion: s.completion || null
|
|
2579
|
+
};
|
|
2580
|
+
});
|
|
2581
|
+
var events = (d.events || []).slice(-200).map(function (e) { return [e.at, e.level, e.type, e.simId, e.streamId, e.message]; });
|
|
2582
|
+
var run = d.run || {};
|
|
2583
|
+
return JSON.stringify({
|
|
2584
|
+
run: [run.runId, run.status, (run.lifecycle || []).length, (run.knownGaps || []).length],
|
|
2585
|
+
summary: d.summary || {},
|
|
2586
|
+
laneGroups: (d.laneGroups || []).map(function (g) { return [g.roleId, g.simId, g.streamId, g.status, g.actorType, g.surface, g.caseGroup]; }),
|
|
2587
|
+
streams: streams,
|
|
2588
|
+
events: events
|
|
2589
|
+
});
|
|
2590
|
+
}
|
|
2591
|
+
function refresh() {
|
|
2592
|
+
if (location.protocol === "file:") return Promise.resolve();
|
|
2593
|
+
return fetch(DATA_FILE, { cache: "no-store" }).then(function (r) {
|
|
2594
|
+
if (!r.ok) return;
|
|
2595
|
+
return r.json().then(function (d) {
|
|
2596
|
+
if (!d || !d.streams) return;
|
|
2597
|
+
var prev = dataKey(currentData);
|
|
2598
|
+
currentData = d;
|
|
2599
|
+
if (!currentData.run) currentData.run = {};
|
|
2600
|
+
if (!currentData.streams) currentData.streams = [];
|
|
2601
|
+
if (!currentData.events) currentData.events = [];
|
|
2602
|
+
if (!currentData.laneGroups) currentData.laneGroups = [];
|
|
2603
|
+
if (dataKey(currentData) !== prev) render();
|
|
2604
|
+
});
|
|
2605
|
+
}).catch(function () {});
|
|
2606
|
+
}
|
|
2607
|
+
function refreshHistoryIndex() {
|
|
2608
|
+
if (location.protocol === "file:") return Promise.resolve();
|
|
2609
|
+
return fetch("/_humanish/history.json", { cache: "no-store" }).then(function (r) {
|
|
2610
|
+
if (!r.ok) throw new Error("history " + r.status);
|
|
2611
|
+
return r.json();
|
|
2612
|
+
}).then(function (d) {
|
|
2613
|
+
historyIndex = d;
|
|
2614
|
+
if (S.historyOpen) render();
|
|
2615
|
+
}).catch(function () { historyIndex = null; if (S.historyOpen) render(); });
|
|
2616
|
+
}
|
|
2617
|
+
|
|
2618
|
+
// ================================================================ BOOT
|
|
2619
|
+
render();
|
|
2620
|
+
refresh().then(function () {
|
|
2621
|
+
if (location.protocol !== "file:") {
|
|
2622
|
+
refreshTimer = setInterval(refresh, REFRESH_MS);
|
|
2623
|
+
refreshHistoryIndex();
|
|
2624
|
+
historyTimer = setInterval(refreshHistoryIndex, 30000);
|
|
2625
|
+
}
|
|
2626
|
+
});
|
|
2627
|
+
}());
|
|
2628
|
+
`;
|
|
2629
|
+
}
|
|
2630
|
+
//# sourceMappingURL=observer-assets.js.map
|