@basaltkit/deploy-ui 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/page.js ADDED
@@ -0,0 +1,470 @@
1
+ /**
2
+ * The page and its stylesheet, as strings (the way the `*-ui` packages ship
3
+ * markup): no inline script, no inline style — the CSP allows neither. The
4
+ * one module script is `/client/main.js`, compiled by tsc from `src/client`.
5
+ */
6
+ export const INDEX_HTML = `<!doctype html>
7
+ <html lang="en">
8
+ <head>
9
+ <meta charset="utf-8">
10
+ <meta name="viewport" content="width=device-width, initial-scale=1">
11
+ <meta name="referrer" content="no-referrer">
12
+ <meta name="color-scheme" content="light dark">
13
+ <title>Basalt deploy</title>
14
+ <link rel="stylesheet" href="/app.css">
15
+ <script type="module" src="/client/main.js"></script>
16
+ </head>
17
+ <body>
18
+ <div class="shell">
19
+ <aside class="sidebar">
20
+ <h1 class="brand">
21
+ <svg class="brand-mark" viewBox="40 40 120 120" width="28" height="28" aria-hidden="true" focusable="false">
22
+ <g stroke="#0B0E13" stroke-width="3" stroke-linejoin="round">
23
+ <polygon points="52.37,72.5 100,45 147.63,72.5 100,100" fill="#8B9AA7"/>
24
+ <polygon points="52.37,72.5 100,100 100,155 52.37,127.5" fill="#2C3843"/>
25
+ <polygon points="100,100 147.63,72.5 147.63,127.5 100,155" fill="#FF5A1F"/>
26
+ </g>
27
+ <line x1="100" y1="100" x2="100" y2="155" stroke="#FFB347" stroke-width="4" stroke-linecap="round"/>
28
+ </svg>
29
+ <span class="brand-text"><span class="brand-name">Basalt</span> <span class="brand-sub">Deploy</span></span>
30
+ </h1>
31
+ <nav id="nav" class="nav" aria-label="Screens"></nav>
32
+ <div class="sidebar-foot">
33
+ <p class="local-note" title="Local only: this page talks to 127.0.0.1, which talks to your servers over your own ssh.">
34
+ <svg class="icon" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M6 11h12v10H6zM8 11V7a4 4 0 0 1 8 0v4"/></svg>
35
+ <span>Local only <span aria-hidden="true">·</span> <span class="mono">127.0.0.1</span></span>
36
+ </p>
37
+ <div id="session" class="session"></div>
38
+ </div>
39
+ </aside>
40
+ <div class="main-col">
41
+ <div id="target-bar" class="target-bar" aria-live="polite"></div>
42
+ <main id="app" class="app">
43
+ <p class="muted">Starting…</p>
44
+ <noscript><p>This UI needs JavaScript (its own module only; nothing is loaded from elsewhere).</p></noscript>
45
+ </main>
46
+ </div>
47
+ </div>
48
+ </body>
49
+ </html>
50
+ `;
51
+ export const APP_CSS = `/* Basalt deploy: an operations console. Graphite neutrals, one molten accent used sparingly. */
52
+ :root {
53
+ color-scheme: light dark;
54
+ --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
55
+ --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
56
+ --fs-xs: 11px; --fs-sm: 12px; --fs-md: 13px; --fs-base: 14px; --fs-lg: 16px; --fs-xl: 20px;
57
+ --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;
58
+ --radius: 8px; --radius-sm: 6px; --radius-xs: 4px;
59
+ --control-h: 32px;
60
+ --sidebar-w: 240px;
61
+
62
+ --bg: #f5f6f8;
63
+ --surface: #ffffff;
64
+ --surface-2: #f9fafb;
65
+ --surface-3: #f0f2f5;
66
+ --border: #e2e6eb;
67
+ --border-strong: #cdd3da;
68
+ --text: #0f141a;
69
+ --text-2: #2c3843;
70
+ --muted: #5b6672;
71
+ --faint: #8a949f;
72
+
73
+ --molten: #ff5a1f;
74
+ --accent-text: #b93a0a;
75
+ --accent-soft: #fff1ea;
76
+ --primary-bg: #c93f0b;
77
+ --primary-bg-hover: #b23708;
78
+ --primary-fg: #ffffff;
79
+
80
+ --ok: #157f3b; --ok-soft: #e8f5ec; --ok-line: #b7dfc4;
81
+ --warn: #9a6200; --warn-soft: #fdf4e1; --warn-line: #f0d39a;
82
+ --err: #c4271d; --err-soft: #fdecea; --err-line: #f3bdb8;
83
+ --info: #44546a; --info-soft: #eef1f5; --info-line: #cfd7e1;
84
+ --protected-bg: #b42318; --protected-fg: #ffffff;
85
+
86
+ --term-bg: #0d1117; --term-border: #0d1117; --term-fg: #c9d1d9; --term-muted: #8b949e; --term-ts: #7d8590;
87
+ --term-warn: #e3b341; --term-err: #ff7b72; --term-ok: #56d364; --term-warn-bg: rgb(227 179 65 / 0.08); --term-err-bg: rgb(255 123 114 / 0.10);
88
+
89
+ --shadow-sm: 0 1px 2px rgb(15 20 26 / 0.05);
90
+ --shadow-md: 0 1px 2px rgb(15 20 26 / 0.06), 0 4px 12px rgb(15 20 26 / 0.06);
91
+ --shadow-lg: 0 2px 6px rgb(15 20 26 / 0.08), 0 24px 48px rgb(15 20 26 / 0.18);
92
+ --focus: 0 0 0 2px var(--surface), 0 0 0 4px var(--molten);
93
+ }
94
+ @media (prefers-color-scheme: dark) {
95
+ :root {
96
+ --bg: #0b0e13;
97
+ --surface: #121820;
98
+ --surface-2: #0f141b;
99
+ --surface-3: #18202a;
100
+ --border: #232c36;
101
+ --border-strong: #2f3a46;
102
+ --text: #e6eaef;
103
+ --text-2: #c3cad3;
104
+ --muted: #95a1ae;
105
+ --faint: #6b7784;
106
+
107
+ --accent-text: #ff8a5c;
108
+ --accent-soft: rgb(255 90 31 / 0.12);
109
+ --primary-bg: #ff5a1f;
110
+ --primary-bg-hover: #ff7340;
111
+ --primary-fg: #0b0e13;
112
+
113
+ --ok: #3fcf79; --ok-soft: rgb(63 207 121 / 0.10); --ok-line: rgb(63 207 121 / 0.32);
114
+ --warn: #f2b13d; --warn-soft: rgb(242 177 61 / 0.10); --warn-line: rgb(242 177 61 / 0.32);
115
+ --err: #ff6b5e; --err-soft: rgb(255 107 94 / 0.10); --err-line: rgb(255 107 94 / 0.34);
116
+ --info: #9aa8b8; --info-soft: rgb(154 168 184 / 0.10); --info-line: rgb(154 168 184 / 0.28);
117
+ --protected-bg: #b42318; --protected-fg: #ffffff;
118
+
119
+ --term-bg: #07090c; --term-border: #232c36;
120
+
121
+ --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
122
+ --shadow-md: 0 1px 2px rgb(0 0 0 / 0.4), 0 4px 12px rgb(0 0 0 / 0.3);
123
+ --shadow-lg: 0 2px 6px rgb(0 0 0 / 0.5), 0 24px 48px rgb(0 0 0 / 0.55);
124
+ }
125
+ }
126
+
127
+ /* Base */
128
+ *, *::before, *::after { box-sizing: border-box; }
129
+ html, body { margin: 0; background: var(--bg); color: var(--text); }
130
+ body { font: var(--fs-base)/20px var(--font-sans); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; text-rendering: optimizeLegibility; }
131
+ h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
132
+ h2 { font-size: var(--fs-xl); line-height: 28px; letter-spacing: -0.015em; }
133
+ h3 { font-size: var(--fs-base); line-height: 20px; }
134
+ p { margin: 0; }
135
+ p + p { margin-top: var(--sp-2); }
136
+ a { color: var(--accent-text); }
137
+ .muted { color: var(--muted); }
138
+ .mono, code, kbd, pre { font-family: var(--font-mono); font-size: 12.5px; }
139
+ code { background: var(--surface-3); border: 1px solid var(--border); padding: 0 5px; border-radius: var(--radius-xs); overflow-wrap: anywhere; color: var(--text-2); line-height: 18px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
140
+ .num, time { font-variant-numeric: tabular-nums; }
141
+ .section-label { display: block; font-size: var(--fs-xs); line-height: 16px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
142
+ .hidden { display: none !important; }
143
+ .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
144
+ ::selection { background: rgb(255 90 31 / 0.22); }
145
+
146
+ /* Shell */
147
+ .shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; background: linear-gradient(to right, var(--surface) calc(var(--sidebar-w) - 1px), var(--border) calc(var(--sidebar-w) - 1px) var(--sidebar-w), transparent var(--sidebar-w)); }
148
+ .sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: var(--sp-5); padding: var(--sp-4) var(--sp-3); background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto; }
149
+ .brand { display: flex; align-items: center; gap: 10px; padding: var(--sp-1) var(--sp-2); font-size: var(--fs-base); }
150
+ .brand-mark { flex: none; }
151
+ .brand-text { display: flex; flex-direction: column; line-height: 1.15; }
152
+ .brand-name { font-size: 15px; font-weight: 650; letter-spacing: -0.02em; }
153
+ .brand-sub { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
154
+ .nav { display: flex; flex-direction: column; gap: var(--sp-5); }
155
+ .nav-target { display: grid; gap: 6px; padding: 0 var(--sp-2); }
156
+ .nav-target .section-label { padding: 0; }
157
+ .nav-list { display: flex; flex-direction: column; gap: 2px; }
158
+ .nav .nav-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); font-weight: 500; text-align: left; justify-content: flex-start; position: relative; box-shadow: none; }
159
+ .nav .nav-item .icon { color: var(--faint); }
160
+ .nav .nav-item:hover { background: var(--surface-3); color: var(--text); border-color: transparent; }
161
+ .nav .nav-item:hover .icon { color: var(--text-2); }
162
+ .nav .nav-item[aria-current="page"] { background: var(--surface-3); color: var(--text); font-weight: 600; }
163
+ .nav .nav-item[aria-current="page"] .icon { color: var(--molten); }
164
+ .nav .nav-item[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--molten); }
165
+ .sidebar-foot { margin-top: auto; display: grid; gap: var(--sp-3); padding: var(--sp-3) var(--sp-2) 0; border-top: 1px solid var(--border); }
166
+ .local-note { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--muted); }
167
+ .local-note .mono { font-size: var(--fs-sm); }
168
+ .session:empty { display: none; }
169
+ .session button { width: 100%; justify-content: flex-start; }
170
+
171
+ .main-col { min-width: 0; display: flex; flex-direction: column; }
172
+ .app { width: 100%; max-width: 1200px; padding: var(--sp-5) var(--sp-6) var(--sp-7); }
173
+ .app > section > * + * { margin-top: var(--sp-4); }
174
+
175
+ /* Context strip: which target every screen acts on */
176
+ .target-bar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--sp-3); min-height: 52px; padding: 10px var(--sp-6); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--border); font-size: var(--fs-md); }
177
+ .target-bar:empty { display: none; }
178
+ .target-bar.is-protected { box-shadow: inset 0 3px 0 var(--protected-bg); }
179
+ .ctx-target { display: inline-flex; align-items: center; gap: var(--sp-2); }
180
+ .ctx-name { font-size: var(--fs-base); font-weight: 600; letter-spacing: -0.01em; }
181
+ .ctx-sep { display: inline-block; width: 1px; height: 16px; background: var(--border-strong); font-size: 0; line-height: 0; overflow: hidden; color: transparent; }
182
+ .ctx-item { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); min-width: 0; }
183
+ .ctx-item .icon { color: var(--faint); flex: none; }
184
+ .ctx-label { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
185
+ .ctx-val { font-family: var(--font-mono); font-size: 12.5px; color: var(--text); overflow-wrap: anywhere; }
186
+ .badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 650; letter-spacing: 0.05em; line-height: 1; white-space: nowrap; }
187
+ .badge .icon { width: 12px; height: 12px; }
188
+ .badge-protected { background: var(--protected-bg); color: var(--protected-fg); box-shadow: 0 0 0 3px rgb(180 35 24 / 0.16); }
189
+ .badge-neutral { background: var(--surface-3); color: var(--muted); border: 1px solid var(--border); }
190
+
191
+ /* Page header */
192
+ .page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--sp-3) var(--sp-4); padding-bottom: var(--sp-4); margin-bottom: var(--sp-5); border-bottom: 1px solid var(--border); }
193
+ .app > section > .page-head + * { margin-top: 0; }
194
+ .page-title { min-width: 0; display: grid; gap: var(--sp-1); }
195
+ .page-title h2 { overflow-wrap: anywhere; }
196
+ .page-title h2.mono-title { font-family: var(--font-mono); font-size: 18px; letter-spacing: -0.01em; font-weight: 600; }
197
+ .page-sub { color: var(--muted); max-width: 72ch; }
198
+ .page-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
199
+
200
+ /* Buttons */
201
+ button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--control-h); padding: 0 12px; font: 500 var(--fs-base)/1 var(--font-sans); white-space: nowrap; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; box-shadow: var(--shadow-sm); transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease; }
202
+ button:hover { background: var(--surface-3); border-color: var(--border-strong); }
203
+ button:active { transform: translateY(0.5px); }
204
+ button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: none; box-shadow: var(--focus); }
205
+ button .icon { flex: none; }
206
+ button.primary { background: var(--primary-bg); border-color: var(--primary-bg); color: var(--primary-fg); font-weight: 600; box-shadow: var(--shadow-sm), inset 0 1px 0 rgb(255 255 255 / 0.12); }
207
+ button.primary:hover { background: var(--primary-bg-hover); border-color: var(--primary-bg-hover); }
208
+ button.danger { color: var(--err); border-color: var(--err-line); background: var(--surface); }
209
+ button.danger:hover { background: var(--err-soft); border-color: var(--err); }
210
+ dialog.is-danger button.danger, button.danger.solid { background: var(--err); border-color: var(--err); color: #ffffff; font-weight: 600; }
211
+ dialog.is-danger button.danger:hover, button.danger.solid:hover { filter: brightness(0.94); }
212
+ @media (prefers-color-scheme: dark) { dialog.is-danger button.danger, button.danger.solid { background: #d92d20; border-color: #d92d20; } }
213
+ button.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
214
+ button.ghost:hover { background: var(--surface-3); color: var(--text); }
215
+ button.ghost.danger { color: var(--err); }
216
+ button.ghost.danger:hover { background: var(--err-soft); }
217
+ button.sm { height: 28px; padding: 0 10px; font-size: var(--fs-md); }
218
+ button:disabled, button:disabled:hover { opacity: 0.5; cursor: not-allowed; filter: none; transform: none; }
219
+ .row { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
220
+ .actions-end { justify-content: flex-end; }
221
+
222
+ /* Cards */
223
+ .card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: 0; }
224
+ .card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: 48px; padding: var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--border); }
225
+ .card-head h3 { font-size: var(--fs-base); }
226
+ .card-actions { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
227
+ .card-body { padding: var(--sp-4); min-width: 0; }
228
+ .card-body > * + * { margin-top: var(--sp-3); }
229
+ .card-body.flush { padding: 0; }
230
+ .card-foot { display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: flex-end; align-items: center; padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
231
+ .card.accent { border-color: var(--accent-line, var(--border)); box-shadow: var(--shadow-sm), inset 3px 0 0 var(--molten); }
232
+ .grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
233
+ .lead { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
234
+ .lead .mono { font-size: 13px; color: var(--text); }
235
+
236
+ /* Key/value */
237
+ .kv { display: grid; gap: 0; }
238
+ dl { margin: 0; }
239
+ .kv-row { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: var(--sp-3); padding: 7px 0; border-top: 1px solid var(--border); align-items: baseline; }
240
+ .kv-row:first-child { border-top: 0; padding-top: 0; }
241
+ .kv-row:last-child { padding-bottom: 0; }
242
+ .kv dt { color: var(--muted); font-size: var(--fs-md); }
243
+ .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
244
+
245
+ /* Pills and badges */
246
+ .pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: var(--fs-sm); font-weight: 600; line-height: 1; white-space: nowrap; border: 1px solid; vertical-align: middle; }
247
+ .pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
248
+ .pill-ok { color: var(--ok); background: var(--ok-soft); border-color: var(--ok-line); }
249
+ .pill-warn { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-line); }
250
+ .pill-err { color: var(--err); background: var(--err-soft); border-color: var(--err-line); }
251
+ .pill-info { color: var(--info); background: var(--info-soft); border-color: var(--info-line); }
252
+ .pill-skip { color: var(--muted); background: var(--surface-3); border-color: var(--border); }
253
+ .pill-run { color: var(--accent-text); background: var(--accent-soft); border-color: rgb(255 90 31 / 0.35); }
254
+ .pill-run .dot { animation: pulse 1.4s ease-in-out infinite; }
255
+ .status-ok { color: var(--ok); }
256
+ .status-warn { color: var(--warn); }
257
+ .status-err { color: var(--err); }
258
+
259
+ /* Tables */
260
+ .table-wrap { overflow-x: auto; max-width: 100%; }
261
+ .card > .table-wrap { border-radius: 0 0 var(--radius) var(--radius); }
262
+ table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: var(--fs-base); }
263
+ th, td { text-align: left; padding: 10px var(--sp-4); border-bottom: 1px solid var(--border); vertical-align: middle; }
264
+ thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding-top: 8px; padding-bottom: 8px; white-space: nowrap; }
265
+ tbody tr:last-child > * { border-bottom: 0; }
266
+ tbody tr:hover > * { background: var(--surface-2); }
267
+ td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
268
+ td.nowrap, th.nowrap { white-space: nowrap; }
269
+ td.wrap { overflow-wrap: anywhere; min-width: 20ch; }
270
+ td.mono { color: var(--text-2); }
271
+ td .row { flex-wrap: nowrap; justify-content: flex-end; }
272
+ .plan-lines th { width: 1%; white-space: nowrap; font-weight: 500; }
273
+ .plan-lines tbody th { background: transparent; }
274
+ .step-chip { display: inline-block; padding: 1px 7px; border-radius: var(--radius-xs); background: var(--surface-3); border: 1px solid var(--border); font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--text-2); }
275
+ .plan-lines td { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere; }
276
+
277
+ /* Forms */
278
+ .field { display: grid; gap: 6px; }
279
+ .field + .field { margin-top: var(--sp-4); }
280
+ .field > label { font-size: var(--fs-md); font-weight: 600; color: var(--text); }
281
+ .field-key { font-family: var(--font-mono); font-size: var(--fs-sm); font-weight: 400; color: var(--muted); }
282
+ .field-help, .field > .muted { font-size: var(--fs-sm); color: var(--muted); }
283
+ .field-error { color: var(--err); font-size: var(--fs-sm); }
284
+ .field-error:empty { display: none; }
285
+ .required { color: var(--err); }
286
+ input[type="text"], input[type="password"], input[type="number"], select { font: var(--fs-base)/1 var(--font-sans); height: var(--control-h); padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); width: 100%; max-width: 32rem; box-shadow: var(--shadow-sm); transition: border-color 120ms ease, box-shadow 120ms ease; }
287
+ input[type="password"], input#confirm-name, .field input[spellcheck="false"][type="text"] { font-family: var(--font-mono); font-size: 13px; }
288
+ input:hover, select:hover { border-color: var(--faint); }
289
+ input:focus-visible, select:focus-visible { border-color: var(--molten); }
290
+ input[aria-invalid="true"] { border-color: var(--err); }
291
+ select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 14px, calc(100% - 10px) 14px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
292
+ input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--primary-bg); flex: none; }
293
+ .check > label, label.check { display: flex; align-items: flex-start; gap: var(--sp-2); font-weight: 500; font-size: var(--fs-base); line-height: 20px; cursor: pointer; }
294
+ .check input[type="checkbox"] { margin-top: 2px; }
295
+ .form-section + .form-section { margin-top: var(--sp-5); padding-top: var(--sp-5); border-top: 1px solid var(--border); }
296
+ .form-note { font-size: var(--fs-md); color: var(--muted); display: flex; gap: var(--sp-2); align-items: flex-start; }
297
+ .form-note .icon { margin-top: 2px; color: var(--faint); flex: none; }
298
+
299
+ .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4) var(--sp-5); }
300
+ .form-grid > .field + .field { margin-top: 0; }
301
+ .form-grid input[type="text"], .form-grid input[type="number"] { max-width: none; }
302
+ .span-2 { grid-column: 1 / -1; }
303
+ .target-name { font-weight: 600; }
304
+ .card-body > [aria-live]:empty { display: none; }
305
+
306
+ /* Disclosures */
307
+ details > summary { cursor: pointer; color: var(--muted); font-size: var(--fs-md); font-weight: 500; width: fit-content; border-radius: var(--radius-xs); list-style-position: inside; }
308
+ details > summary:hover { color: var(--text); }
309
+ details[open] > summary { margin-bottom: var(--sp-2); }
310
+ .advanced { margin-top: var(--sp-3); }
311
+ .form-section > .advanced:first-child { margin-top: 0; }
312
+ .form-section + .form-section:has(> .advanced:first-child) { padding-top: var(--sp-4); margin-top: var(--sp-4); }
313
+ .advanced[open] { padding: var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
314
+ .diagnostics { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font-mono); font-size: var(--fs-sm); line-height: 18px; margin: 0; padding: 10px var(--sp-3); background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-2); max-height: 40vh; overflow-y: auto; }
315
+
316
+ /* Banners */
317
+ .banner { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) var(--sp-4); border: 1px solid var(--info-line); border-left-width: 3px; border-radius: var(--radius); background: var(--info-soft); color: var(--text); }
318
+ .banner-icon { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--info); }
319
+ .banner-body { min-width: 0; flex: 1; overflow-wrap: anywhere; }
320
+ .banner-body > p { margin-top: 4px; color: var(--text-2); }
321
+ .banner-body > details { margin-top: var(--sp-2); }
322
+ .banner-title { font-weight: 600; }
323
+ .banner-code { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--muted); }
324
+ .banner.ok { border-color: var(--ok-line); border-left-color: var(--ok); background: var(--ok-soft); }
325
+ .banner.ok .banner-icon { color: var(--ok); }
326
+ .banner.warn { border-color: var(--warn-line); border-left-color: var(--warn); background: var(--warn-soft); }
327
+ .banner.warn .banner-icon { color: var(--warn); }
328
+ .banner.err { border-color: var(--err-line); border-left-color: var(--err); background: var(--err-soft); }
329
+ .banner.err .banner-icon { color: var(--err); }
330
+ .banner + .banner { margin-top: var(--sp-2); }
331
+
332
+ /* Findings */
333
+ .findings { list-style: none; margin: 0; padding: 0; }
334
+ .finding { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--sp-3); row-gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--border); align-items: baseline; }
335
+ .finding:first-child { border-top: 0; }
336
+ .finding-msg { min-width: 0; overflow-wrap: anywhere; }
337
+ .finding-id { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--muted); margin-right: 6px; }
338
+ .sev { display: inline-flex; align-items: center; justify-content: center; min-width: 84px; height: 20px; padding: 0 7px; border-radius: var(--radius-xs); font-size: var(--fs-xs); font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; border: 1px solid; }
339
+ .sev-error { color: var(--err); background: var(--err-soft); border-color: var(--err-line); }
340
+ .sev-warning { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-line); }
341
+ .fix { grid-column: 2; display: flex; align-items: baseline; gap: var(--sp-2); padding: 6px 10px; background: var(--surface-3); border: 1px solid var(--border); border-left: 2px solid var(--faint); border-radius: var(--radius-xs); min-width: 0; }
342
+ .fix-label { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); flex: none; }
343
+ .fix code { background: none; border: 0; padding: 0; user-select: all; }
344
+
345
+ /* Empty states */
346
+ .empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: var(--sp-7) var(--sp-4); border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface); }
347
+ .empty-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--border); color: var(--muted); margin-bottom: var(--sp-2); }
348
+ .empty-icon .icon { width: 20px; height: 20px; }
349
+ .empty-title { font-weight: 600; font-size: var(--fs-lg); line-height: 24px; }
350
+ .empty-text { color: var(--muted); max-width: 52ch; }
351
+ .empty .row { margin-top: var(--sp-3); justify-content: center; }
352
+ .stopped { max-width: 560px; margin: var(--sp-7) 0 0; }
353
+ .stopped .banner { margin-top: var(--sp-4); text-align: left; }
354
+
355
+ /* Dialogs */
356
+ dialog { padding: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); width: min(32rem, calc(100vw - 32px)); max-width: none; box-shadow: var(--shadow-lg); }
357
+ dialog::backdrop { background: rgb(11 14 19 / 0.55); backdrop-filter: blur(2px); }
358
+ dialog[open] { animation: rise 160ms ease-out; }
359
+ .dialog-head { display: flex; gap: var(--sp-3); align-items: flex-start; padding: 20px 20px 0; }
360
+ .dialog-head h2 { font-size: var(--fs-lg); line-height: 24px; overflow-wrap: anywhere; }
361
+ .dialog-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; flex: none; background: var(--accent-soft); color: var(--accent-text); }
362
+ .dialog-icon .icon { width: 18px; height: 18px; }
363
+ dialog.is-danger { border-top: 3px solid var(--err); }
364
+ dialog.is-danger .dialog-icon { background: var(--err-soft); color: var(--err); }
365
+ .dialog-body { padding: var(--sp-3) 20px 20px 64px; color: var(--text-2); overflow-wrap: anywhere; }
366
+ .dialog-body > p + p { margin-top: var(--sp-2); }
367
+ .dialog-context { font-family: var(--font-mono); font-size: 12.5px; color: var(--text); background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius-xs); padding: 6px 10px; }
368
+ .dialog-protected { display: flex; align-items: center; gap: var(--sp-2); color: var(--err); font-weight: 500; }
369
+ .dialog-body .field { margin-top: var(--sp-4); }
370
+ .dialog-body .field > label { font-weight: 500; color: var(--text-2); }
371
+ .dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--sp-2); padding: var(--sp-3) 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 12px 12px; }
372
+
373
+ /* Run: the step timeline */
374
+ .run-state { display: flex; align-items: center; gap: var(--sp-2); width: fit-content; max-width: 100%; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: var(--fs-md); box-shadow: var(--shadow-sm); overflow-wrap: anywhere; }
375
+ .run-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
376
+ .run-state.is-live::before { background: var(--molten); animation: pulse 1.4s ease-in-out infinite; }
377
+ .run-state.is-ok::before { background: var(--ok); }
378
+ .run-state.is-err::before { background: var(--err); }
379
+ .run-state:empty { display: none; }
380
+ .run-grid { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: var(--sp-4); align-items: start; }
381
+ .run-outcome:empty, .run-findings:empty { display: none; }
382
+ .steps { list-style: none; padding: 0; margin: 0; }
383
+ .steps:empty::before { content: "Waiting for the first step…"; display: block; color: var(--muted); font-size: var(--fs-md); }
384
+ .step { position: relative; display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; column-gap: 10px; align-items: center; min-height: 32px; padding: 6px 0; }
385
+ .step:not(:last-child)::after { content: ""; position: absolute; left: 9.5px; top: 28px; bottom: -6px; width: 1px; background: var(--border-strong); }
386
+ .step.is-ok:not(:last-child)::after { background: var(--ok); opacity: 0.45; }
387
+ .step-icon { position: relative; z-index: 1; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 11px; font-weight: 700; line-height: 1; border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--muted); }
388
+ .step.is-ok .step-icon { background: var(--ok); border-color: var(--ok); color: var(--surface); }
389
+ .step.is-failed .step-icon { background: var(--err); border-color: var(--err); color: var(--surface); }
390
+ .step.is-skipped .step-icon { background: var(--surface-3); border-color: var(--border-strong); color: var(--muted); }
391
+ .step.is-running .step-icon { color: transparent; border-color: var(--molten); border-right-color: transparent; animation: spin 0.9s linear infinite; }
392
+ .step.is-aborted .step-icon { color: transparent; border-style: dashed; border-color: var(--warn); }
393
+ .step.is-aborted .step-icon::after { content: ""; position: absolute; inset: 5px; border-radius: 2px; background: var(--warn); }
394
+ .step-title { font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
395
+ .step.is-running .step-title { font-weight: 600; }
396
+ .step.is-skipped .step-title { color: var(--muted); }
397
+ .step-meta { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; }
398
+ .step-status { text-transform: lowercase; }
399
+ .step.is-failed .step-status { color: var(--err); font-weight: 600; }
400
+ .step.is-running .step-status { color: var(--accent-text); font-weight: 600; }
401
+ .step.is-aborted .step-status { color: var(--warn); font-weight: 600; }
402
+ .step-dur { font-family: var(--font-mono); font-variant-numeric: tabular-nums; min-width: 6ch; text-align: right; color: var(--text-2); }
403
+
404
+ /* Run: the log console (a terminal in both themes) */
405
+ .console { background: var(--term-bg); border: 1px solid var(--term-border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); min-width: 0; }
406
+ .console-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); height: 40px; padding: 0 var(--sp-4); border-bottom: 1px solid rgb(255 255 255 / 0.08); color: var(--term-muted); }
407
+ .console-head h3 { color: #e6edf3; font-size: var(--fs-md); display: flex; align-items: center; gap: var(--sp-2); }
408
+ .console-head .icon { color: var(--term-muted); }
409
+ .console-meta { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--term-muted); }
410
+ .log { list-style: none; margin: 0; padding: 10px 0; max-height: 60vh; min-height: 120px; overflow-y: auto; color: var(--term-fg); font-family: var(--font-mono); font-size: 12.5px; line-height: 20px; white-space: pre-wrap; overflow-wrap: anywhere; scrollbar-color: #30363d transparent; }
411
+ .log li { position: relative; padding: 0 var(--sp-4) 0 calc(var(--sp-4) + 10ch); }
412
+ .log li::before { content: attr(data-ts); position: absolute; left: var(--sp-4); width: 9ch; color: var(--term-ts); font-variant-numeric: tabular-nums; }
413
+ .log li:hover { background: rgb(255 255 255 / 0.03); }
414
+ .log .src { color: var(--term-muted); }
415
+ .log li.src { font-style: italic; }
416
+ .log li.warn { color: var(--term-warn); background: var(--term-warn-bg); box-shadow: inset 2px 0 0 var(--term-warn); }
417
+ .log li.error { color: var(--term-err); background: var(--term-err-bg); box-shadow: inset 2px 0 0 var(--term-err); }
418
+ .log li.ok { color: var(--term-ok); }
419
+ .log:empty::after { content: "No output yet."; display: block; padding: 0 var(--sp-4); color: var(--term-muted); }
420
+
421
+ @keyframes spin { to { transform: rotate(360deg); } }
422
+ @keyframes pulse { 50% { opacity: 0.35; } }
423
+ @keyframes rise { from { opacity: 0; transform: translateY(6px) scale(0.99); } }
424
+
425
+ /* Responsive: below 900px the sidebar becomes a top bar */
426
+ @media (max-width: 900px) {
427
+ .shell { grid-template-columns: minmax(0, 1fr); background: none; }
428
+ .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-right: 0; border-bottom: 1px solid var(--border); overflow: visible; }
429
+ .brand { padding: 0; order: 1; }
430
+ .sidebar-foot { order: 2; margin: 0 0 0 auto; padding: 0; border: 0; display: flex; align-items: center; gap: var(--sp-3); }
431
+ .session button { width: auto; }
432
+ .nav { order: 3; width: 100%; flex-direction: row; align-items: center; gap: var(--sp-3); min-width: 0; }
433
+ .nav-target { padding: 0; display: flex; align-items: center; gap: var(--sp-2); flex: none; }
434
+ .nav-target select { width: 10.5rem; }
435
+ .nav-list { flex-direction: row; gap: 2px; overflow-x: auto; min-width: 0; scrollbar-width: none; }
436
+ .nav .nav-item { width: auto; flex: none; }
437
+ .nav .nav-item[aria-current="page"]::before { left: 10px; right: 10px; top: auto; bottom: -12px; width: auto; height: 2px; border-radius: 2px 2px 0 0; }
438
+ .target-bar { position: static; padding: 10px var(--sp-4); }
439
+ .app { padding: var(--sp-5) var(--sp-4) var(--sp-7); }
440
+ .run-grid { grid-template-columns: minmax(0, 1fr); }
441
+ }
442
+ @media (max-width: 640px) {
443
+ .form-grid { grid-template-columns: minmax(0, 1fr); }
444
+ .local-note > span { display: none; }
445
+ .nav { flex-wrap: wrap; }
446
+ .nav-target { width: 100%; }
447
+ .nav-target select { width: 100%; max-width: none; }
448
+ .nav-list { width: 100%; margin: 0 -4px; }
449
+ .nav .nav-item[aria-current="page"]::before { display: none; }
450
+ .nav-list { gap: 0; justify-content: space-between; }
451
+ .nav .nav-item { padding: 0 8px; font-size: var(--fs-md); height: 32px; }
452
+ .nav .nav-item .icon { display: none; }
453
+ .grid-2 { grid-template-columns: minmax(0, 1fr); }
454
+ .kv-row { grid-template-columns: 96px minmax(0, 1fr); }
455
+ .page-head { margin-bottom: var(--sp-4); }
456
+ h2 { font-size: 18px; line-height: 24px; }
457
+ th, td { padding: 8px var(--sp-3); }
458
+ .card-head, .card-body { padding-left: var(--sp-3); padding-right: var(--sp-3); }
459
+ .finding { grid-template-columns: minmax(0, 1fr); padding: var(--sp-3); }
460
+ .fix { grid-column: 1; }
461
+ .dialog-body { padding-left: 20px; }
462
+ .log li { padding-left: var(--sp-3); }
463
+ .log li::before { display: none; }
464
+ .target-bar .ctx-sep { display: none; }
465
+ }
466
+ @media (prefers-reduced-motion: reduce) {
467
+ *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
468
+ .step.is-running .step-icon { border-right-color: var(--molten); border-style: dotted; }
469
+ }
470
+ `;
@@ -0,0 +1,68 @@
1
+ import type { ChildProcess, SpawnOptions } from 'node:child_process';
2
+ import type { DeployEvent, DoneEvent, ErrorEvent, HelloEvent } from '@basaltkit/deploy/protocol';
3
+ import type { CommandReply, Failure, StreamMessage } from './client/messages.js';
4
+ import { type RemoteSpec } from './ssh.js';
5
+ import type { Target } from './targets.js';
6
+ /**
7
+ * One remote command over ssh, read through {@link ProtocolReader}: the
8
+ * events, the result, the error and how it ended. Answers go on stdin, up
9
+ * front, then stdin is closed and the buffer zero-filled.
10
+ */
11
+ export type Spawn = (command: string, args: readonly string[], options: SpawnOptions) => ChildProcess;
12
+ export interface SshRunner {
13
+ /** `ssh`, `ssh.exe` or `--ssh=<path>` (a test: node). */
14
+ program: string;
15
+ /** Arguments before ssh's own (a test: the fake ssh script). Empty in use. */
16
+ prefix: readonly string[];
17
+ spawn: Spawn;
18
+ /** The UI process's own environment, unchanged: nothing is added to it. */
19
+ env: NodeJS.ProcessEnv;
20
+ /** Where ssh starts: the operator's home, never the directory the UI was started from (a cloned app). */
21
+ cwd?: string;
22
+ }
23
+ export interface ExecOptions {
24
+ actor?: string;
25
+ /** The answer lines, sent on stdin and then zero-filled. */
26
+ stdin?: Buffer;
27
+ timeoutMs?: number;
28
+ signal?: AbortSignal;
29
+ onEvent?: (event: DeployEvent, known: boolean) => void;
30
+ onInner?: (event: DeployEvent, known: boolean) => void;
31
+ onDiagnostic?: (text: string) => void;
32
+ }
33
+ export interface RemoteOutcome {
34
+ hello?: HelloEvent;
35
+ error?: ErrorEvent;
36
+ result?: unknown;
37
+ done?: DoneEvent;
38
+ innerDone?: DoneEvent;
39
+ lastInnerSeq?: number;
40
+ failure?: Failure;
41
+ /** Foreign text before `hello`, then ssh's stderr. */
42
+ diagnostics: string[];
43
+ /** ssh's stderr alone, sanitised. */
44
+ stderr: string[];
45
+ sshExit: number | null;
46
+ }
47
+ export declare const isPermanent: (failure: Failure) => boolean;
48
+ export declare function execRemote(runner: SshRunner, target: Target, spec: RemoteSpec, options?: ExecOptions): Promise<RemoteOutcome>;
49
+ /** The reply of a collected command: it succeeded only with `done` exit 0 and no failure. */
50
+ export declare function toReply(outcome: RemoteOutcome): CommandReply;
51
+ export interface FollowOptions {
52
+ signal: AbortSignal;
53
+ actor?: string;
54
+ sleep?: (ms: number, signal: AbortSignal) => Promise<void>;
55
+ now?: () => number;
56
+ /** How long to keep reconnecting without progress (RFC 0009 §7: 10 minutes). */
57
+ windowMs?: number;
58
+ }
59
+ export declare const RECONNECT_FIRST_MS = 1000;
60
+ export declare const RECONNECT_MAX_MS = 30000;
61
+ export declare const RECONNECT_WINDOW_MS: number;
62
+ /**
63
+ * `attach --follow` that survives a dropped connection: when ssh ends without
64
+ * the run's `done`, it attaches again from the last run seq + 1 (1 s, 2 s, 4 s
65
+ * … 30 s, for up to 10 minutes without progress). The page never sees a
66
+ * duplicate or a gap: the reader checks the run's sequence on every attach.
67
+ */
68
+ export declare function follow(runner: SshRunner, target: Target, runId: string, fromSeq: number, emit: (message: StreamMessage) => void, options: FollowOptions): Promise<void>;