consensus-cli 0.1.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.
@@ -0,0 +1,56 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <meta name="theme-color" content="#0f1216" />
7
+ <title>Consensus</title>
8
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
9
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
10
+ <link
11
+ href="https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;600;700&family=IBM+Plex+Mono:wght@400;600&display=swap"
12
+ rel="stylesheet"
13
+ />
14
+ <link rel="stylesheet" href="style.css" />
15
+ </head>
16
+ <body>
17
+ <a class="skip-link" href="#main">Skip to main content</a>
18
+ <main id="main">
19
+ <canvas
20
+ id="scene"
21
+ role="img"
22
+ aria-label="Codex process map"
23
+ tabindex="0"
24
+ ></canvas>
25
+ <div id="hud">
26
+ <div class="brand">
27
+ <div class="title">consensus</div>
28
+ <div class="subtitle">codex process atlas</div>
29
+ </div>
30
+ <div class="meta" aria-live="polite">
31
+ <div id="status">connecting…</div>
32
+ <div id="count">0 agents</div>
33
+ </div>
34
+ </div>
35
+ <div id="active-lane" role="region" aria-label="Active agents">
36
+ <div class="lane-title">active agents</div>
37
+ <input
38
+ id="search"
39
+ type="search"
40
+ placeholder="Search metadata…"
41
+ aria-label="Search metadata"
42
+ />
43
+ <div id="active-list"></div>
44
+ </div>
45
+ <div id="tooltip" class="hidden"></div>
46
+ <aside id="panel" class="collapsed" aria-label="Agent details">
47
+ <div class="panel-header">
48
+ <div class="panel-title">agent</div>
49
+ <button id="panel-close" aria-label="Close">x</button>
50
+ </div>
51
+ <div id="panel-content"></div>
52
+ </aside>
53
+ </main>
54
+ <script type="module" src="app.js"></script>
55
+ </body>
56
+ </html>
package/public/iso.js ADDED
@@ -0,0 +1,68 @@
1
+ export function isoToScreen(x, y, tileW, tileH) {
2
+ return {
3
+ x: (x - y) * (tileW / 2),
4
+ y: (x + y) * (tileH / 2),
5
+ };
6
+ }
7
+
8
+ export function drawDiamond(ctx, x, y, tileW, tileH, fill, stroke) {
9
+ const halfW = tileW / 2;
10
+ const halfH = tileH / 2;
11
+ ctx.beginPath();
12
+ ctx.moveTo(x, y - halfH);
13
+ ctx.lineTo(x + halfW, y);
14
+ ctx.lineTo(x, y + halfH);
15
+ ctx.lineTo(x - halfW, y);
16
+ ctx.closePath();
17
+ ctx.fillStyle = fill;
18
+ ctx.fill();
19
+ if (stroke) {
20
+ ctx.strokeStyle = stroke;
21
+ ctx.lineWidth = 1;
22
+ ctx.stroke();
23
+ }
24
+ }
25
+
26
+ export function drawBuilding(ctx, x, y, tileW, tileH, height, colors) {
27
+ const halfW = tileW / 2;
28
+ const halfH = tileH / 2;
29
+ const topY = y - height;
30
+
31
+ ctx.beginPath();
32
+ ctx.moveTo(x, topY - halfH);
33
+ ctx.lineTo(x + halfW, topY);
34
+ ctx.lineTo(x, topY + halfH);
35
+ ctx.lineTo(x - halfW, topY);
36
+ ctx.closePath();
37
+ ctx.fillStyle = colors.top;
38
+ ctx.fill();
39
+ ctx.strokeStyle = colors.stroke;
40
+ ctx.stroke();
41
+
42
+ ctx.beginPath();
43
+ ctx.moveTo(x - halfW, topY);
44
+ ctx.lineTo(x, topY + halfH);
45
+ ctx.lineTo(x, y + halfH);
46
+ ctx.lineTo(x - halfW, y);
47
+ ctx.closePath();
48
+ ctx.fillStyle = colors.left;
49
+ ctx.fill();
50
+
51
+ ctx.beginPath();
52
+ ctx.moveTo(x + halfW, topY);
53
+ ctx.lineTo(x, topY + halfH);
54
+ ctx.lineTo(x, y + halfH);
55
+ ctx.lineTo(x + halfW, y);
56
+ ctx.closePath();
57
+ ctx.fillStyle = colors.right;
58
+ ctx.fill();
59
+ }
60
+
61
+ export function pointInDiamond(px, py, x, y, tileW, tileH) {
62
+ const dx = Math.abs(px - x);
63
+ const dy = Math.abs(py - y);
64
+ const halfW = tileW / 2;
65
+ const halfH = tileH / 2;
66
+ if (dx > halfW || dy > halfH) return false;
67
+ return dx / halfW + dy / halfH <= 1;
68
+ }
@@ -0,0 +1,364 @@
1
+ :root {
2
+ --bg: #0f1216;
3
+ --bg-accent: #1f2a33;
4
+ --panel: #13171c;
5
+ --panel-border: #2a3642;
6
+ --text: #e4e6eb;
7
+ --muted: #8a93a3;
8
+ --active: #51c3a5;
9
+ --idle: #4f6b7a;
10
+ --error: #d1584b;
11
+ --tile-top: #2c3c45;
12
+ --tile-side: #1b242b;
13
+ --tile-stroke: #3e4e59;
14
+ --accent: #57f2c6;
15
+ --accent-soft: rgba(87, 242, 198, 0.15);
16
+ --glass: rgba(14, 18, 23, 0.72);
17
+ }
18
+
19
+ * {
20
+ box-sizing: border-box;
21
+ }
22
+
23
+ html,
24
+ html {
25
+ color-scheme: dark;
26
+ }
27
+
28
+ body {
29
+ margin: 0;
30
+ padding: 0;
31
+ width: 100%;
32
+ height: 100%;
33
+ font-family: "IBM Plex Mono", "Menlo", "Courier New", monospace;
34
+ color: var(--text);
35
+ background: radial-gradient(1200px 800px at 15% 20%, #24303a, var(--bg));
36
+ overflow: hidden;
37
+ }
38
+
39
+ .skip-link {
40
+ position: absolute;
41
+ top: -40px;
42
+ left: 16px;
43
+ padding: 8px 12px;
44
+ background: #111821;
45
+ color: var(--text);
46
+ border: 1px solid rgba(87, 242, 198, 0.4);
47
+ border-radius: 10px;
48
+ z-index: 10;
49
+ }
50
+
51
+ .skip-link:focus {
52
+ top: 16px;
53
+ }
54
+
55
+ #main {
56
+ position: relative;
57
+ width: 100%;
58
+ height: 100%;
59
+ background-image:
60
+ linear-gradient(120deg, rgba(255, 255, 255, 0.02) 0%, rgba(0, 0, 0, 0.02) 100%),
61
+ repeating-linear-gradient(
62
+ 45deg,
63
+ rgba(255, 255, 255, 0.02) 0px,
64
+ rgba(255, 255, 255, 0.02) 1px,
65
+ transparent 1px,
66
+ transparent 6px
67
+ );
68
+ }
69
+
70
+ #scene {
71
+ width: 100%;
72
+ height: 100%;
73
+ display: block;
74
+ outline: none;
75
+ touch-action: manipulation;
76
+ }
77
+
78
+ #scene:focus-visible {
79
+ outline: 2px solid rgba(87, 242, 198, 0.6);
80
+ outline-offset: 4px;
81
+ }
82
+
83
+ #hud {
84
+ position: absolute;
85
+ top: 24px;
86
+ left: 24px;
87
+ display: flex;
88
+ gap: 24px;
89
+ align-items: flex-start;
90
+ padding: 14px 16px;
91
+ background: var(--glass);
92
+ border: 1px solid rgba(87, 242, 198, 0.2);
93
+ border-radius: 14px;
94
+ backdrop-filter: blur(10px);
95
+ box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
96
+ }
97
+
98
+ .brand .title {
99
+ font-size: 20px;
100
+ font-weight: 700;
101
+ letter-spacing: 0.02em;
102
+ font-family: "Chakra Petch", "IBM Plex Mono", sans-serif;
103
+ text-wrap: balance;
104
+ }
105
+
106
+ .brand .subtitle {
107
+ font-size: 12px;
108
+ color: var(--muted);
109
+ margin-top: 2px;
110
+ text-transform: uppercase;
111
+ letter-spacing: 0.18em;
112
+ }
113
+
114
+ .meta {
115
+ display: flex;
116
+ flex-direction: column;
117
+ gap: 4px;
118
+ font-size: 12px;
119
+ color: var(--muted);
120
+ font-variant-numeric: tabular-nums;
121
+ }
122
+
123
+ #tooltip {
124
+ position: absolute;
125
+ padding: 8px 10px;
126
+ font-size: 12px;
127
+ background: rgba(17, 21, 26, 0.85);
128
+ border: 1px solid rgba(62, 78, 89, 0.8);
129
+ border-radius: 10px;
130
+ pointer-events: none;
131
+ transform: translate(12px, 12px);
132
+ max-width: 280px;
133
+ }
134
+
135
+ #tooltip.hidden {
136
+ opacity: 0;
137
+ }
138
+
139
+ #panel {
140
+ position: absolute;
141
+ top: 0;
142
+ right: 0;
143
+ height: 100%;
144
+ width: 320px;
145
+ padding: 18px;
146
+ background: var(--panel);
147
+ border-left: 1px solid var(--panel-border);
148
+ transform: translateX(100%);
149
+ transition: transform 0.2s ease;
150
+ overflow-y: auto;
151
+ overscroll-behavior: contain;
152
+ }
153
+
154
+ #panel.open {
155
+ transform: translateX(0%);
156
+ }
157
+
158
+ .panel-header {
159
+ display: flex;
160
+ justify-content: space-between;
161
+ align-items: center;
162
+ margin-bottom: 16px;
163
+ }
164
+
165
+ .panel-title {
166
+ font-size: 16px;
167
+ font-weight: 600;
168
+ }
169
+
170
+ #panel-close {
171
+ background: transparent;
172
+ border: 1px solid rgba(87, 242, 198, 0.2);
173
+ color: var(--muted);
174
+ border-radius: 8px;
175
+ font-size: 18px;
176
+ width: 32px;
177
+ height: 32px;
178
+ cursor: pointer;
179
+ touch-action: manipulation;
180
+ }
181
+
182
+ #panel-close:hover {
183
+ border-color: rgba(87, 242, 198, 0.5);
184
+ color: var(--text);
185
+ }
186
+
187
+ #panel-close:focus-visible {
188
+ outline: 2px solid rgba(87, 242, 198, 0.6);
189
+ outline-offset: 2px;
190
+ }
191
+
192
+ #panel-content {
193
+ font-size: 13px;
194
+ color: var(--text);
195
+ display: flex;
196
+ flex-direction: column;
197
+ gap: 12px;
198
+ }
199
+
200
+ .panel-section {
201
+ border: 1px solid rgba(62, 78, 89, 0.5);
202
+ border-radius: 12px;
203
+ padding: 12px;
204
+ background: rgba(14, 18, 23, 0.8);
205
+ }
206
+
207
+ .panel-section h4 {
208
+ margin: 0 0 8px 0;
209
+ font-size: 12px;
210
+ color: var(--muted);
211
+ text-transform: uppercase;
212
+ letter-spacing: 0.12em;
213
+ }
214
+
215
+ .panel-list {
216
+ display: flex;
217
+ flex-direction: column;
218
+ gap: 6px;
219
+ }
220
+
221
+ .panel-list div {
222
+ word-break: break-word;
223
+ font-variant-numeric: tabular-nums;
224
+ }
225
+
226
+ .panel-key {
227
+ display: inline-block;
228
+ min-width: 90px;
229
+ color: var(--muted);
230
+ text-transform: uppercase;
231
+ letter-spacing: 0.12em;
232
+ font-size: 10px;
233
+ margin-right: 8px;
234
+ }
235
+
236
+ #active-lane {
237
+ position: absolute;
238
+ left: 24px;
239
+ bottom: 24px;
240
+ width: 340px;
241
+ max-height: 38vh;
242
+ overflow-y: auto;
243
+ padding: 12px;
244
+ background: var(--glass);
245
+ border: 1px solid rgba(87, 242, 198, 0.2);
246
+ border-radius: 14px;
247
+ backdrop-filter: blur(12px);
248
+ box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
249
+ }
250
+
251
+ .lane-title {
252
+ font-size: 11px;
253
+ letter-spacing: 0.24em;
254
+ text-transform: uppercase;
255
+ color: var(--muted);
256
+ margin-bottom: 10px;
257
+ }
258
+
259
+ #search {
260
+ width: 100%;
261
+ padding: 10px 12px;
262
+ border-radius: 10px;
263
+ border: 1px solid rgba(62, 78, 89, 0.6);
264
+ background: rgba(8, 11, 15, 0.85);
265
+ color: var(--text);
266
+ font-size: 12px;
267
+ margin-bottom: 10px;
268
+ }
269
+
270
+ #search::placeholder {
271
+ color: rgba(138, 147, 163, 0.7);
272
+ }
273
+
274
+ #search:focus-visible {
275
+ outline: 2px solid rgba(87, 242, 198, 0.6);
276
+ outline-offset: 2px;
277
+ }
278
+
279
+ #active-list {
280
+ display: flex;
281
+ flex-direction: column;
282
+ gap: 8px;
283
+ }
284
+
285
+ .lane-item {
286
+ display: flex;
287
+ align-items: flex-start;
288
+ gap: 10px;
289
+ padding: 10px;
290
+ border-radius: 10px;
291
+ border: 1px solid rgba(62, 78, 89, 0.5);
292
+ background: rgba(13, 17, 22, 0.85);
293
+ cursor: pointer;
294
+ text-align: left;
295
+ appearance: none;
296
+ width: 100%;
297
+ color: inherit;
298
+ font: inherit;
299
+ touch-action: manipulation;
300
+ }
301
+
302
+ .lane-item:hover {
303
+ border-color: rgba(87, 242, 198, 0.5);
304
+ }
305
+
306
+ .lane-item.is-selected {
307
+ border-color: rgba(87, 242, 198, 0.7);
308
+ box-shadow: 0 0 12px rgba(87, 242, 198, 0.25);
309
+ }
310
+
311
+ .lane-item:focus-visible {
312
+ outline: 2px solid rgba(87, 242, 198, 0.6);
313
+ outline-offset: 2px;
314
+ }
315
+
316
+ .lane-pill {
317
+ width: 8px;
318
+ height: 8px;
319
+ border-radius: 50%;
320
+ margin-top: 6px;
321
+ background: var(--idle);
322
+ box-shadow: 0 0 10px transparent;
323
+ }
324
+
325
+ .lane-pill.active {
326
+ background: var(--active);
327
+ box-shadow: 0 0 12px rgba(81, 195, 165, 0.5);
328
+ }
329
+
330
+ .lane-pill.error {
331
+ background: var(--error);
332
+ box-shadow: 0 0 12px rgba(209, 88, 75, 0.5);
333
+ }
334
+
335
+ .lane-copy {
336
+ display: flex;
337
+ flex-direction: column;
338
+ gap: 4px;
339
+ }
340
+
341
+ .lane-label {
342
+ font-size: 13px;
343
+ font-weight: 600;
344
+ font-family: "Chakra Petch", "IBM Plex Mono", sans-serif;
345
+ }
346
+
347
+ .lane-meta {
348
+ font-size: 11px;
349
+ color: var(--muted);
350
+ line-height: 1.3;
351
+ }
352
+
353
+ @media (max-width: 900px) {
354
+ #panel {
355
+ width: 100%;
356
+ }
357
+ #hud {
358
+ flex-direction: column;
359
+ gap: 10px;
360
+ }
361
+ #active-lane {
362
+ width: calc(100% - 48px);
363
+ }
364
+ }