@vercel/board 0.36.0 → 0.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{access-BsP0hvcC.mjs → access-CVkjSfxj.mjs} +12 -12
- package/dist/access.d.mts +3 -3
- package/dist/access.mjs +6 -5
- package/dist/{actors-DFOpTw89.mjs → actors-kfMejhaw.mjs} +6 -4
- package/dist/{auth-CrjXLgOb.mjs → auth-B3bBYOqf.mjs} +2 -2
- package/dist/{auth-C21V0EK1.d.mts → auth-BXLCkeB0.d.mts} +3 -3
- package/dist/{backend-D21q8mdm.d.mts → backend-BkQlF1LQ.d.mts} +3 -9
- package/dist/backend-local.d.mts +1 -1
- package/dist/backend-local.mjs +1 -1
- package/dist/{chat-provider-Bb-jeJLY.mjs → chat-provider-1WKsLEnM.mjs} +2 -2
- package/dist/{chat-provider-DmZCmBkb.d.mts → chat-provider-DyNy5xdC.d.mts} +2 -2
- package/dist/cli-commands.d.mts +1 -1
- package/dist/cli-commands.mjs +1 -1
- package/dist/cli-embedded.d.mts +18 -2
- package/dist/cli-embedded.mjs +22 -4
- package/dist/cli.mjs +50 -676
- package/dist/{commands-DGID-4Z2.d.mts → commands-B5d-lmNN.d.mts} +1 -1
- package/dist/{commands-BLtqSwha.mjs → commands-BLS7erNu.mjs} +12 -1
- package/dist/{conformance-CKrwglzA.mjs → conformance-qJF96jZI.mjs} +164 -23
- package/dist/conformance.d.mts +10 -2
- package/dist/conformance.mjs +1 -1
- package/dist/digest-DAxy9Ula.mjs +4 -0
- package/dist/{engine-B_prP0b8.mjs → engine-eUgO5jTM.mjs} +18 -14
- package/dist/{events-AEKh9tJm.mjs → events-C6HwB046.mjs} +23 -9
- package/dist/exports-BJ3wmEMY.d.mts +4 -0
- package/dist/{exports-Ck4Xu3OV.mjs → exports-BsfcChdp.mjs} +805 -193
- package/dist/{external-BA2aCC_3.mjs → external-CHDxWIVf.mjs} +1 -1
- package/dist/{index-LREsSZb2.d.mts → index-DpVyZa9b.d.mts} +2 -2
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +3 -3
- package/dist/index.node.d.mts +5 -5
- package/dist/index.node.mjs +2 -2
- package/dist/inspect/app.js +44 -44
- package/dist/inspect/engine.js +5 -5
- package/dist/inspect-5mkjJYMS.mjs +2 -0
- package/dist/inspect-DtCbBtOW.mjs +643 -0
- package/dist/{local-DJ_qI9q7.mjs → local-Bo3XzEKB.mjs} +29 -84
- package/dist/{main-Jz4nbNJi.mjs → main-0nvLgajF.mjs} +45 -37
- package/dist/{memory-DqwXlyK4.mjs → memory-DkoqhxIH.mjs} +2 -2
- package/dist/{middleware-BxgizazV.mjs → middleware-CPqAuRtp.mjs} +10 -2
- package/dist/page-R0RoE_gM.mjs +2 -0
- package/dist/page-UsfvSIWc.mjs +30 -0
- package/dist/{provider-DEOfc4Ls.d.mts → provider-D5yVFisj.d.mts} +5 -3
- package/dist/{routes-BpKdMvgX.d.mts → routes-BffuaoTX.d.mts} +11 -18
- package/dist/{schemas-BG205xds.mjs → schemas-AZkxk06N.mjs} +3 -3
- package/dist/{serve-Puf3I-oI.mjs → serve-D7I3KisQ.mjs} +3 -3
- package/dist/{server-CS-1aeTl.mjs → server-Cc3nYq3H.mjs} +23 -13
- package/dist/{serving-6_bhBNAW.mjs → serving-DJMcG0dT.mjs} +1 -1
- package/dist/{sql-aetuEBZC.mjs → sql-l3ysn4O5.mjs} +2 -2
- package/dist/{sqlite-DvsB8ENQ.mjs → sqlite-CAwNHbQD.mjs} +2 -2
- package/dist/{sqlite-db-BPwRoDI7.mjs → sqlite-db-cm5yhrD-.mjs} +1 -1
- package/dist/sync-chat-sdk.d.mts +2 -2
- package/dist/sync-chat-sdk.mjs +2 -2
- package/dist/sync-github.d.mts +2 -2
- package/dist/sync-github.mjs +2 -2
- package/dist/sync-linear.d.mts +3 -3
- package/dist/sync-linear.mjs +2 -2
- package/dist/sync-slack.d.mts +3 -3
- package/dist/sync-slack.mjs +4 -4
- package/dist/sync.d.mts +2 -2
- package/dist/sync.mjs +2 -2
- package/dist/{targets-Dk_xgS9q.mjs → targets-B4Uikw0J.mjs} +66 -21
- package/dist/{tokens-Dn4cPZIr.mjs → tokens-DA9ipsZ-.mjs} +1 -1
- package/docs/01-board/01-mounting.md +12 -9
- package/docs/01-board/03-identity.md +2 -1
- package/docs/01-board/06-watchers.md +71 -40
- package/docs/01-board/09-access.md +10 -5
- package/docs/01-quickstart.md +1 -1
- package/docs/02-sync/01-overview.md +7 -7
- package/docs/02-sync/02-functions.md +5 -8
- package/docs/02-sync/03-slack.md +0 -8
- package/docs/02-sync/04-github.md +0 -8
- package/docs/02-sync/07-linear.md +0 -6
- package/docs/03-guides/01-coding-agents.md +1 -0
- package/docs/03-guides/02-inspector.md +3 -2
- package/docs/03-guides/03-ci.md +10 -4
- package/docs/03-guides/04-triage.md +8 -13
- package/docs/04-reference/01-cli.md +51 -13
- package/docs/04-reference/02-board.md +2 -1
- package/docs/04-reference/03-http.md +4 -4
- package/docs/04-reference/05-conformance.md +10 -3
- package/docs/index.md +3 -10
- package/package.json +2 -1
- package/dist/attempts-HXcskN1w.mjs +0 -10
- package/dist/exports-BxljH73E.d.mts +0 -4
package/dist/cli.mjs
CHANGED
|
@@ -1,634 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import "./
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { r as main, u as who } from "./main-Jz4nbNJi.mjs";
|
|
7
|
-
import { randomBytes, timingSafeEqual } from "node:crypto";
|
|
2
|
+
import { a as option } from "./commands-BLS7erNu.mjs";
|
|
3
|
+
import { f as projectDir } from "./server-Cc3nYq3H.mjs";
|
|
4
|
+
import { r as main } from "./main-0nvLgajF.mjs";
|
|
5
|
+
import { n as stopped, r as startInspector } from "./inspect-DtCbBtOW.mjs";
|
|
8
6
|
import { appendFile, readFile } from "node:fs/promises";
|
|
9
7
|
import { join } from "node:path";
|
|
10
|
-
import { createServer } from "node:http";
|
|
11
|
-
//#region src/inspect/style.ts
|
|
12
|
-
/**
|
|
13
|
-
* Just Chat's look: mono, quiet, one accent, hairlines only under headers.
|
|
14
|
-
* The default cursor everywhere but text; buttons never get a pointer; nothing
|
|
15
|
-
* scrolls smoothly; hovers are instant.
|
|
16
|
-
*/
|
|
17
|
-
const CSS = `
|
|
18
|
-
:root {
|
|
19
|
-
--bg: #fafafa;
|
|
20
|
-
--bright: #040404;
|
|
21
|
-
--dim: #303030;
|
|
22
|
-
--muted: #646464;
|
|
23
|
-
--faint: #909090;
|
|
24
|
-
--hairline: #d9d9d9;
|
|
25
|
-
--shade: #f0f0f0;
|
|
26
|
-
--shade-hover: #e3e3e3;
|
|
27
|
-
--accent: rgb(255, 108, 2);
|
|
28
|
-
--accent-transparent: rgba(255, 108, 2, 0.2);
|
|
29
|
-
--label: #fafafa;
|
|
30
|
-
--red: #c70000;
|
|
31
|
-
--mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
32
|
-
color-scheme: light dark;
|
|
33
|
-
}
|
|
34
|
-
@media (prefers-color-scheme: dark) {
|
|
35
|
-
:root {
|
|
36
|
-
--bg: #040404;
|
|
37
|
-
--bright: #fafafa;
|
|
38
|
-
--dim: #dedede;
|
|
39
|
-
--muted: #909090;
|
|
40
|
-
--faint: #646464;
|
|
41
|
-
--hairline: #252525;
|
|
42
|
-
--shade: #161616;
|
|
43
|
-
--shade-hover: #1b1b1b;
|
|
44
|
-
--red: #ff7b72;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
* { box-sizing: border-box; }
|
|
48
|
-
html { scroll-behavior: auto; -webkit-tap-highlight-color: var(--accent-transparent); }
|
|
49
|
-
body {
|
|
50
|
-
margin: 0;
|
|
51
|
-
overflow: hidden;
|
|
52
|
-
background: var(--bg);
|
|
53
|
-
color: var(--dim);
|
|
54
|
-
font-family: var(--mono);
|
|
55
|
-
font-size: 13px;
|
|
56
|
-
letter-spacing: -0.02em;
|
|
57
|
-
line-height: 1.5;
|
|
58
|
-
cursor: default;
|
|
59
|
-
}
|
|
60
|
-
a { color: inherit; text-decoration: none; cursor: pointer; }
|
|
61
|
-
button { cursor: default; font: inherit; color: inherit; background: none; border: 0; padding: 0; letter-spacing: inherit; }
|
|
62
|
-
input, textarea { font: inherit; color: var(--bright); letter-spacing: inherit; cursor: text; }
|
|
63
|
-
::selection { background: var(--accent-transparent); }
|
|
64
|
-
a:focus-visible, button:focus-visible, [role='separator']:focus-visible { outline: 2px dashed var(--accent); outline-offset: 2px; }
|
|
65
|
-
|
|
66
|
-
.boot { display: grid; place-items: center; height: 100dvh; color: var(--faint); }
|
|
67
|
-
.boot.error, .error { color: var(--accent); }
|
|
68
|
-
.empty, .error { padding: 20px; margin: 0; color: var(--faint); }
|
|
69
|
-
.faint { color: var(--faint); }
|
|
70
|
-
.grow { flex: 1; min-width: 0; }
|
|
71
|
-
.hint { color: var(--faint); font-size: 11px; }
|
|
72
|
-
|
|
73
|
-
.shell { display: flex; height: 100dvh; overflow: hidden; }
|
|
74
|
-
|
|
75
|
-
/* --- sidebar: same background as the page; its edge is the resize line --- */
|
|
76
|
-
.sidebar { position: relative; flex-shrink: 0; display: flex; }
|
|
77
|
-
.sidebar-scroll { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-y: auto; padding: 0 8px 12px; }
|
|
78
|
-
.brand {
|
|
79
|
-
height: 46px;
|
|
80
|
-
flex-shrink: 0;
|
|
81
|
-
display: flex;
|
|
82
|
-
align-items: center;
|
|
83
|
-
justify-content: space-between;
|
|
84
|
-
margin: 0 -8px 8px;
|
|
85
|
-
padding: 0 8px 0 16px;
|
|
86
|
-
border-bottom: 1px solid var(--hairline);
|
|
87
|
-
color: var(--bright);
|
|
88
|
-
font-weight: 600;
|
|
89
|
-
}
|
|
90
|
-
.sidebar h2 { margin: 16px 8px 4px; font-size: 11px; font-weight: 500; color: var(--faint); }
|
|
91
|
-
.sidebar .item {
|
|
92
|
-
display: flex;
|
|
93
|
-
align-items: center;
|
|
94
|
-
gap: 6px;
|
|
95
|
-
padding: 5px 8px;
|
|
96
|
-
color: var(--muted);
|
|
97
|
-
font-size: 13px;
|
|
98
|
-
cursor: default;
|
|
99
|
-
}
|
|
100
|
-
.sidebar .item:hover, .sidebar .item[aria-current='page'] { background: var(--shade); color: var(--bright); }
|
|
101
|
-
.sidebar .item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
102
|
-
.sidebar .item.unread { color: var(--bright); font-weight: 600; }
|
|
103
|
-
.sidebar .count { color: var(--faint); font-size: 11px; font-weight: 400; }
|
|
104
|
-
.sidebar .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
|
|
105
|
-
.whoami-wrap { margin-top: auto; padding-top: 16px; }
|
|
106
|
-
.whoami { width: 100%; display: flex; align-items: center; gap: 6px; padding: 6px 8px; color: var(--muted); font-size: 11px; text-align: left; }
|
|
107
|
-
.whoami:hover, .whoami[data-popup-open] { background: var(--shade); color: var(--bright); }
|
|
108
|
-
.whoami .grow { display: grid; }
|
|
109
|
-
.whoami .as, .whoami .url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
110
|
-
.whoami.naming { margin-top: auto; }
|
|
111
|
-
.whoami.naming input { width: 100%; height: 28px; padding: 0 8px; border: 0; outline: 1px solid var(--muted); background: var(--shade); font-size: 12px; }
|
|
112
|
-
.choice { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
|
|
113
|
-
.choice svg { color: var(--accent); }
|
|
114
|
-
|
|
115
|
-
/* --- resize handles: a hairline that lights up --- */
|
|
116
|
-
.resize { position: absolute; top: 0; bottom: 0; width: 7px; z-index: 5; cursor: col-resize; display: flex; justify-content: center; outline: none; }
|
|
117
|
-
.resize.right { right: -3px; }
|
|
118
|
-
.resize.left { left: -3px; }
|
|
119
|
-
.resize i { width: 1px; height: 100%; background: var(--hairline); transition: background-color 0.12s; }
|
|
120
|
-
.resize:hover i { background: var(--muted); }
|
|
121
|
-
.resize.dragging i, .resize:focus-visible i { background: var(--accent); }
|
|
122
|
-
|
|
123
|
-
/* --- main and the thread pane --- */
|
|
124
|
-
.main, .pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
|
|
125
|
-
.main { flex: 1; }
|
|
126
|
-
.pane { position: relative; flex-shrink: 0; }
|
|
127
|
-
@media (max-width: 900px) {
|
|
128
|
-
.sidebar { display: none; }
|
|
129
|
-
.pane { position: fixed; inset: 0; width: auto !important; background: var(--bg); z-index: 30; }
|
|
130
|
-
.resize { display: none; }
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.header {
|
|
134
|
-
height: 46px;
|
|
135
|
-
flex-shrink: 0;
|
|
136
|
-
display: flex;
|
|
137
|
-
align-items: center;
|
|
138
|
-
gap: 10px;
|
|
139
|
-
padding: 0 12px 0 20px;
|
|
140
|
-
border-bottom: 1px solid var(--hairline);
|
|
141
|
-
white-space: nowrap;
|
|
142
|
-
}
|
|
143
|
-
.header .title { color: var(--bright); font-weight: 600; }
|
|
144
|
-
.header .meta { color: var(--faint); font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
|
|
145
|
-
.header .spacer { flex: 1; }
|
|
146
|
-
.header > .tool:first-child { margin-left: -8px; }
|
|
147
|
-
|
|
148
|
-
.live { display: flex; align-items: center; gap: 6px; color: var(--faint); font-size: 11px; }
|
|
149
|
-
.live i { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
|
|
150
|
-
.live.live i { background: var(--accent); }
|
|
151
|
-
|
|
152
|
-
/* --- the feed: no row borders; a short conversation sits on the composer --- */
|
|
153
|
-
.feed-wrap { position: relative; flex: 1; min-height: 0; display: flex; }
|
|
154
|
-
.feed { flex: 1; overflow-y: auto; padding: 8px 0 12px; display: flex; flex-direction: column; overflow-anchor: none; }
|
|
155
|
-
.feed > div { margin-top: auto; }
|
|
156
|
-
.jump {
|
|
157
|
-
position: absolute;
|
|
158
|
-
bottom: 12px;
|
|
159
|
-
left: 50%;
|
|
160
|
-
transform: translateX(-50%);
|
|
161
|
-
padding: 3px 10px;
|
|
162
|
-
border: 1px solid var(--accent);
|
|
163
|
-
background: var(--bg);
|
|
164
|
-
color: var(--accent);
|
|
165
|
-
font-size: 11px;
|
|
166
|
-
}
|
|
167
|
-
.divider { display: flex; align-items: center; gap: 8px; margin: 14px 20px 4px; color: var(--faint); font-size: 11px; }
|
|
168
|
-
.divider::after { content: ''; flex: 1; height: 1px; background: var(--hairline); }
|
|
169
|
-
|
|
170
|
-
.message { position: relative; display: grid; grid-template-columns: 40px 1fr; gap: 8px; padding: 6px 20px 4px 8px; }
|
|
171
|
-
.message.continued { padding-top: 1px; padding-bottom: 1px; }
|
|
172
|
-
.message.active { background: var(--shade); }
|
|
173
|
-
.message.pending { opacity: 0.5; }
|
|
174
|
-
.message.failed { opacity: 1; }
|
|
175
|
-
.gutter { display: flex; justify-content: center; align-items: flex-start; }
|
|
176
|
-
.gutter-time { visibility: hidden; color: var(--faint); font-size: 10px; line-height: 21px; }
|
|
177
|
-
.message.active .gutter-time, .gutter-time.shown { visibility: visible; }
|
|
178
|
-
.avatar {
|
|
179
|
-
flex-shrink: 0;
|
|
180
|
-
display: inline-grid;
|
|
181
|
-
place-items: center;
|
|
182
|
-
border-radius: 4px;
|
|
183
|
-
background: var(--shade-hover);
|
|
184
|
-
color: var(--muted);
|
|
185
|
-
font-weight: 600;
|
|
186
|
-
overflow: hidden;
|
|
187
|
-
}
|
|
188
|
-
.avatar img { width: 100%; height: 100%; object-fit: cover; }
|
|
189
|
-
.body { min-width: 0; }
|
|
190
|
-
.meta-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
|
|
191
|
-
.author { color: var(--bright); font-weight: 600; }
|
|
192
|
-
.where { color: var(--faint); font-size: 12px; }
|
|
193
|
-
.where a { color: var(--accent); cursor: default; }
|
|
194
|
-
.where a:hover { text-decoration: underline; }
|
|
195
|
-
.time, .id { color: var(--faint); font-size: 11px; }
|
|
196
|
-
/* Message text is markdown. Blocks stay compact; a short message reads as one line. */
|
|
197
|
-
.text { overflow-wrap: anywhere; color: var(--dim); font-size: 14px; cursor: text; }
|
|
198
|
-
.text > :first-child { margin-top: 0; }
|
|
199
|
-
.text > :last-child { margin-bottom: 0; }
|
|
200
|
-
.text > p:last-child, .text > p:has(+ .edited) { display: inline; }
|
|
201
|
-
.text p { margin: 0 0 6px; }
|
|
202
|
-
.text a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; overflow-wrap: anywhere; }
|
|
203
|
-
.text a:hover { text-decoration: underline; }
|
|
204
|
-
.text strong { color: var(--bright); font-weight: 600; }
|
|
205
|
-
.text h1, .text h2, .text h3, .text h4 { margin: 8px 0 4px; color: var(--bright); font-size: 14px; font-weight: 600; }
|
|
206
|
-
.text ul, .text ol { margin: 2px 0 6px; padding-left: 20px; }
|
|
207
|
-
.text li + li { margin-top: 1px; }
|
|
208
|
-
.text blockquote { margin: 4px 0; padding-left: 10px; border-left: 2px solid var(--hairline); color: var(--muted); }
|
|
209
|
-
.text code { padding: 1px 4px; border-radius: 3px; background: var(--shade); color: var(--bright); font-size: 0.92em; }
|
|
210
|
-
.message.active .text code { background: var(--shade-hover); }
|
|
211
|
-
.text pre { margin: 4px 0 6px; padding: 10px; overflow-x: auto; border: 1px solid var(--hairline); border-radius: 4px; background: var(--shade); line-height: 1.5; }
|
|
212
|
-
.text pre code, .message.active .text pre code { padding: 0; border-radius: 0; background: none; font-size: 13px; }
|
|
213
|
-
.text table { margin: 4px 0 6px; border-collapse: collapse; font-size: 12px; display: block; overflow-x: auto; max-width: 100%; }
|
|
214
|
-
.text th, .text td { padding: 3px 10px; border: 1px solid var(--hairline); text-align: left; white-space: nowrap; }
|
|
215
|
-
.text th { color: var(--bright); font-weight: 600; background: var(--shade); }
|
|
216
|
-
.text img { max-width: 100%; max-height: 260px; vertical-align: middle; }
|
|
217
|
-
.text hr { border: 0; height: 1px; margin: 8px 0; background: var(--hairline); }
|
|
218
|
-
.text input[type='checkbox'] { margin: 0 6px 0 0; vertical-align: middle; }
|
|
219
|
-
.text ul.contains-task-list { list-style: none; padding-left: 2px; }
|
|
220
|
-
.avatar-wrap { position: relative; display: inline-flex; }
|
|
221
|
-
.source {
|
|
222
|
-
position: absolute;
|
|
223
|
-
right: -5px;
|
|
224
|
-
bottom: -5px;
|
|
225
|
-
width: 16px;
|
|
226
|
-
height: 16px;
|
|
227
|
-
padding: 2px;
|
|
228
|
-
border-radius: 4px;
|
|
229
|
-
background: var(--bg);
|
|
230
|
-
color: var(--bright);
|
|
231
|
-
}
|
|
232
|
-
.source svg { display: block; width: 100%; height: 100%; }
|
|
233
|
-
.source.text { display: grid; place-items: center; font-size: 9px; font-weight: 600; }
|
|
234
|
-
.mention { color: var(--accent); font-weight: 600; }
|
|
235
|
-
.removed { color: var(--faint); font-style: italic; }
|
|
236
|
-
.edited { color: var(--faint); font-size: 11px; }
|
|
237
|
-
.undelivered { margin-top: 4px; font-size: 11px; color: var(--accent); }
|
|
238
|
-
.undelivered button { text-decoration: underline; }
|
|
239
|
-
|
|
240
|
-
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
|
|
241
|
-
.badge, .label, .chip {
|
|
242
|
-
display: inline-flex;
|
|
243
|
-
align-items: center;
|
|
244
|
-
gap: 4px;
|
|
245
|
-
padding: 1px 7px;
|
|
246
|
-
border: 1px solid var(--hairline);
|
|
247
|
-
background: var(--shade);
|
|
248
|
-
color: var(--muted);
|
|
249
|
-
font-size: 11px;
|
|
250
|
-
line-height: 16px;
|
|
251
|
-
}
|
|
252
|
-
.badge.slack, .badge.github { border-color: var(--accent-transparent); background: none; color: var(--accent); }
|
|
253
|
-
.label:hover, .chip:hover { color: var(--bright); background: var(--shade-hover); }
|
|
254
|
-
.label button { color: var(--faint); display: inline-flex; }
|
|
255
|
-
.label button:hover { color: var(--bright); }
|
|
256
|
-
/* Your own reaction: a little brighter, not louder. */
|
|
257
|
-
.chip.mine { border-color: var(--muted); background: var(--shade-hover); color: var(--bright); }
|
|
258
|
-
/* Attachments: media in a fixed frame, so loading never moves the page; files as chips. */
|
|
259
|
-
.links { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
|
|
260
|
-
.link-embed { padding: 2px 0 2px 10px; border-left: 2px solid var(--hairline); }
|
|
261
|
-
.link-meta { display: flex; gap: 8px; align-items: baseline; font-size: 12px; color: var(--muted); }
|
|
262
|
-
.link-meta .author { font-size: 13px; }
|
|
263
|
-
.link-meta a, .link-file a { color: var(--accent); text-decoration: none; overflow-wrap: anywhere; }
|
|
264
|
-
.link-meta a:hover, .link-file a:hover { text-decoration: underline; }
|
|
265
|
-
.link-file { display: flex; gap: 4px; align-items: center; margin-top: 2px; font-size: 12px; color: var(--muted); }
|
|
266
|
-
.attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
|
|
267
|
-
.attachment-media { display: block; width: 320px; max-width: 100%; height: 200px; border: 1px solid var(--hairline); background: var(--shade); overflow: hidden; }
|
|
268
|
-
.attachment-media img, .attachment-media video { display: block; width: 100%; height: 100%; object-fit: contain; }
|
|
269
|
-
.file { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 8px; border: 1px solid var(--hairline); background: var(--shade); color: var(--dim); font-size: 12px; }
|
|
270
|
-
button.file:hover { background: var(--shade-hover); color: var(--bright); }
|
|
271
|
-
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
272
|
-
.file button { color: var(--faint); display: inline-flex; }
|
|
273
|
-
.file button:hover { color: var(--bright); }
|
|
274
|
-
.composer-files { margin: 0 12px 4px; }
|
|
275
|
-
.replies { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 0 -4px; padding: 2px 6px 2px 4px; color: var(--dim); font-size: 12px; font-weight: 600; }
|
|
276
|
-
.replies:hover { background: var(--shade-hover); color: var(--bright); }
|
|
277
|
-
.replies .time { font-weight: 400; }
|
|
278
|
-
.replies .faces { display: inline-flex; }
|
|
279
|
-
.replies .faces .avatar + .avatar { margin-left: -4px; }
|
|
280
|
-
|
|
281
|
-
.editor { display: grid; gap: 2px; margin: 2px 0; }
|
|
282
|
-
.editor textarea {
|
|
283
|
-
width: 100%;
|
|
284
|
-
padding: 8px 10px;
|
|
285
|
-
border: 1px solid var(--hairline);
|
|
286
|
-
background: var(--bg);
|
|
287
|
-
resize: none;
|
|
288
|
-
outline: none;
|
|
289
|
-
font-size: 14px;
|
|
290
|
-
}
|
|
291
|
-
.editor textarea:focus { border-color: var(--muted); }
|
|
292
|
-
|
|
293
|
-
/* --- hover actions: one hairline box at the row's corner --- */
|
|
294
|
-
.actions { position: absolute; top: -12px; right: 20px; z-index: 5; display: flex; border: 1px solid var(--hairline); background: var(--bg); }
|
|
295
|
-
.tool {
|
|
296
|
-
display: inline-flex;
|
|
297
|
-
align-items: center;
|
|
298
|
-
justify-content: center;
|
|
299
|
-
gap: 4px;
|
|
300
|
-
min-width: 28px;
|
|
301
|
-
height: 26px;
|
|
302
|
-
padding: 0 6px;
|
|
303
|
-
color: var(--muted);
|
|
304
|
-
font-size: 13px;
|
|
305
|
-
}
|
|
306
|
-
.tool:hover, .tool[data-popup-open] { background: var(--shade); color: var(--bright); }
|
|
307
|
-
.tool.on { color: var(--accent); }
|
|
308
|
-
.tool .count, .tool .tool-label { font-size: 11px; }
|
|
309
|
-
|
|
310
|
-
/* --- menus and popovers: square, a dim edge, an offset dot shadow --- */
|
|
311
|
-
.positioner { z-index: 50; outline: none; }
|
|
312
|
-
.frame { position: relative; isolation: isolate; }
|
|
313
|
-
.dots {
|
|
314
|
-
position: absolute;
|
|
315
|
-
left: 6px;
|
|
316
|
-
top: 6px;
|
|
317
|
-
width: 100%;
|
|
318
|
-
height: 100%;
|
|
319
|
-
z-index: -1;
|
|
320
|
-
background-image: radial-gradient(var(--faint) 0.8px, transparent 0.8px);
|
|
321
|
-
background-size: 4px 4px;
|
|
322
|
-
pointer-events: none;
|
|
323
|
-
}
|
|
324
|
-
.menu { min-width: 172px; padding: 6px; border: 1px solid var(--dim); background: var(--bg); outline: none; }
|
|
325
|
-
.menu.list { max-height: 260px; overflow-y: auto; }
|
|
326
|
-
.item {
|
|
327
|
-
display: flex;
|
|
328
|
-
align-items: center;
|
|
329
|
-
gap: 8px;
|
|
330
|
-
padding: 6px 8px;
|
|
331
|
-
color: var(--muted);
|
|
332
|
-
outline: none;
|
|
333
|
-
cursor: default;
|
|
334
|
-
white-space: nowrap;
|
|
335
|
-
}
|
|
336
|
-
.item[data-highlighted] { background: var(--shade); color: var(--bright); }
|
|
337
|
-
.item.danger, .item.danger[data-highlighted] { color: var(--red); }
|
|
338
|
-
.item .hint { margin-left: 12px; }
|
|
339
|
-
.separator { height: 1px; margin: 4px 0; background: var(--hairline); }
|
|
340
|
-
.empty-item { padding: 6px 8px; color: var(--faint); }
|
|
341
|
-
.emoji-row { display: grid; grid-template-columns: repeat(6, 1fr); }
|
|
342
|
-
.item.emoji { justify-content: center; padding: 6px 0; font-size: 15px; }
|
|
343
|
-
.emoji-grid { display: grid; grid-template-columns: repeat(12, 30px); padding: 6px; }
|
|
344
|
-
.emoji-grid .emoji { height: 30px; font-size: 16px; }
|
|
345
|
-
.emoji-grid .emoji:hover { background: var(--shade); }
|
|
346
|
-
.popover { width: min(380px, calc(100vw - 32px)); padding: 12px; }
|
|
347
|
-
.popover-title { margin: 0 0 8px; color: var(--bright); font-size: 12px; font-weight: 600; }
|
|
348
|
-
|
|
349
|
-
.labels-editor { display: grid; gap: 10px; }
|
|
350
|
-
.labels-editor > .hint { margin: 0; }
|
|
351
|
-
.label-rows { display: grid; }
|
|
352
|
-
.label-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; align-items: center; gap: 8px; padding: 2px 0 2px 8px; }
|
|
353
|
-
.label-row:hover { background: var(--shade); }
|
|
354
|
-
.label-key { color: var(--bright); overflow: hidden; text-overflow: ellipsis; }
|
|
355
|
-
.label-value { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
|
|
356
|
-
.label-add { display: flex; align-items: center; gap: 6px; }
|
|
357
|
-
.suggest { display: flex; align-items: center; min-width: 0; padding: 0 8px; background: var(--shade); }
|
|
358
|
-
.suggest input { width: 100%; min-width: 0; height: 28px; border: 0; outline: none; background: none; }
|
|
359
|
-
.suggest:focus-within { outline: 1px solid var(--muted); }
|
|
360
|
-
.suggest .prefix { color: var(--faint); }
|
|
361
|
-
.label-add > .suggest { width: 38%; }
|
|
362
|
-
|
|
363
|
-
/* --- filters --- */
|
|
364
|
-
.filter-bar { flex-shrink: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 20px 0; }
|
|
365
|
-
.clear { color: var(--faint); font-size: 11px; }
|
|
366
|
-
.clear:hover { color: var(--bright); }
|
|
367
|
-
.filter-form { display: grid; gap: 12px; }
|
|
368
|
-
.filter-form > .clear { justify-self: start; }
|
|
369
|
-
.filter-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: start; gap: 10px; }
|
|
370
|
-
.filter-name { color: var(--faint); font-size: 11px; line-height: 28px; }
|
|
371
|
-
.filter-row .grow { display: grid; gap: 6px; }
|
|
372
|
-
.segments { display: flex; flex-wrap: wrap; gap: 2px; }
|
|
373
|
-
.segment { height: 28px; padding: 0 10px; background: var(--shade); color: var(--muted); }
|
|
374
|
-
.segment:hover { color: var(--bright); }
|
|
375
|
-
.segment.on { background: var(--bright); color: var(--bg); }
|
|
376
|
-
|
|
377
|
-
/* --- the composer: an outline, not a border --- */
|
|
378
|
-
.composer { flex-shrink: 0; padding: 0 20px 20px; }
|
|
379
|
-
.composer-box {
|
|
380
|
-
display: flex;
|
|
381
|
-
flex-direction: column;
|
|
382
|
-
background: var(--bg);
|
|
383
|
-
outline: 2px dotted var(--hairline);
|
|
384
|
-
outline-offset: -1px;
|
|
385
|
-
cursor: text;
|
|
386
|
-
}
|
|
387
|
-
.composer-box:focus-within { background: var(--shade); outline-style: dashed; }
|
|
388
|
-
.composer-box textarea {
|
|
389
|
-
width: 100%;
|
|
390
|
-
min-height: 58px;
|
|
391
|
-
max-height: 160px;
|
|
392
|
-
padding: 10px 12px 2px;
|
|
393
|
-
border: 0;
|
|
394
|
-
outline: none;
|
|
395
|
-
background: none;
|
|
396
|
-
color: var(--dim);
|
|
397
|
-
font-size: 14px;
|
|
398
|
-
line-height: 1.5;
|
|
399
|
-
resize: none;
|
|
400
|
-
overflow-y: auto;
|
|
401
|
-
}
|
|
402
|
-
.composer-box textarea::placeholder { color: var(--faint); }
|
|
403
|
-
.composer-channel { margin: 8px 8px 0; align-self: flex-start; width: min(320px, calc(100% - 16px)); }
|
|
404
|
-
.composer-labels { margin: 8px 12px 0; }
|
|
405
|
-
.composer-footer { display: flex; align-items: center; gap: 2px; min-height: 40px; padding: 2px 8px 8px; }
|
|
406
|
-
.composer-footer .hint { margin-left: auto; margin-right: 8px; }
|
|
407
|
-
.pane .composer-footer .hint { display: none; }
|
|
408
|
-
.pane .composer-footer .send { margin-left: auto; }
|
|
409
|
-
.send { height: 32px; padding: 0 12px; background: var(--accent); color: var(--label); font-weight: 500; }
|
|
410
|
-
.send.small { height: 28px; padding: 0 10px; }
|
|
411
|
-
.send:disabled { opacity: 0.5; }
|
|
412
|
-
|
|
413
|
-
.inbox-row { display: grid; grid-template-columns: 70px 90px 1fr; gap: 12px; padding: 6px 20px; }
|
|
414
|
-
.inbox-row:hover { background: var(--shade); }
|
|
415
|
-
.inbox-row pre { margin: 4px 0 0; color: var(--faint); font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
416
|
-
|
|
417
|
-
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 60; }
|
|
418
|
-
.toast { max-width: 420px; padding: 8px 12px; border: 1px solid var(--dim); background: var(--bg); color: var(--bright); }
|
|
419
|
-
`;
|
|
420
|
-
/** The prebuilt UI: next to the CLI in `dist`, or in `dist` when running from source. */
|
|
421
|
-
const BUNDLES = [new URL("./inspect/app.js", import.meta.url), new URL("../../dist/inspect/app.js", import.meta.url)];
|
|
422
|
-
async function bundle() {
|
|
423
|
-
for (const candidate of BUNDLES) try {
|
|
424
|
-
return await readFile(candidate, "utf8");
|
|
425
|
-
} catch {}
|
|
426
|
-
return null;
|
|
427
|
-
}
|
|
428
|
-
const shell = (token) => `<!doctype html>
|
|
429
|
-
<html lang="en">
|
|
430
|
-
<head>
|
|
431
|
-
<meta charset="utf-8">
|
|
432
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
433
|
-
<meta name="inspect-token" content="${token}">
|
|
434
|
-
<title>board</title>
|
|
435
|
-
<style>${CSS}</style>
|
|
436
|
-
</head>
|
|
437
|
-
<body>
|
|
438
|
-
<div id="root"></div>
|
|
439
|
-
<script type="module" src="/app.js"><\/script>
|
|
440
|
-
</body>
|
|
441
|
-
</html>`;
|
|
442
|
-
const CSP = [
|
|
443
|
-
"default-src 'none'",
|
|
444
|
-
"img-src https: http://localhost:* http://127.0.0.1:* data: blob:",
|
|
445
|
-
"media-src blob:",
|
|
446
|
-
"style-src 'unsafe-inline'",
|
|
447
|
-
"script-src 'self'",
|
|
448
|
-
"connect-src 'self'",
|
|
449
|
-
"form-action 'none'",
|
|
450
|
-
"base-uri 'none'",
|
|
451
|
-
"frame-ancestors 'none'"
|
|
452
|
-
].join("; ");
|
|
453
|
-
/**
|
|
454
|
-
* Serves the UI, and a proxy for the board's API that adds your credentials, on
|
|
455
|
-
* 127.0.0.1. Because the proxy acts as you, it answers only its own page: every
|
|
456
|
-
* request must name this server's host (no DNS rebinding) and carry the per-run
|
|
457
|
-
* token that only the page has, and writes must also come from its origin. Your
|
|
458
|
-
* board token never leaves this process.
|
|
459
|
-
*/
|
|
460
|
-
async function startInspector(options) {
|
|
461
|
-
const { client } = options;
|
|
462
|
-
const me = await client.me();
|
|
463
|
-
const board = (await client.discovery().catch(() => null))?.url ?? client.url;
|
|
464
|
-
const app = await bundle();
|
|
465
|
-
const token = randomBytes(24).toString("base64url");
|
|
466
|
-
let origins = /* @__PURE__ */ new Set();
|
|
467
|
-
const streams = /* @__PURE__ */ new Set();
|
|
468
|
-
async function proxy(request, response, url) {
|
|
469
|
-
const reading = request.method === "GET" || request.method === "HEAD";
|
|
470
|
-
if (!sameSecret(String(request.headers["x-inspect-token"] ?? ""), token) || !reading && !origins.has(String(request.headers.origin))) return json(response, 403, { error: {
|
|
471
|
-
code: "forbidden",
|
|
472
|
-
message: "the board is reachable only from the inspector's own page"
|
|
473
|
-
} });
|
|
474
|
-
const path = url.pathname.slice(6) || "/";
|
|
475
|
-
let decoded;
|
|
476
|
-
try {
|
|
477
|
-
decoded = decodeURIComponent(path);
|
|
478
|
-
} catch {
|
|
479
|
-
decoded = "..";
|
|
480
|
-
}
|
|
481
|
-
if (/(^|\/)\.\.?(\/|$)|\\/.test(decoded)) return json(response, 400, { error: {
|
|
482
|
-
code: "bad_path",
|
|
483
|
-
message: "no relative paths"
|
|
484
|
-
} });
|
|
485
|
-
const controller = new AbortController();
|
|
486
|
-
streams.add(controller);
|
|
487
|
-
response.on("close", () => controller.abort());
|
|
488
|
-
try {
|
|
489
|
-
const body = reading ? void 0 : await read(request, path === "/attachments" ? ATTACHMENT_BYTES_MAX : void 0);
|
|
490
|
-
const chosen = request.headers["x-inspect-profile"];
|
|
491
|
-
const as = typeof chosen === "string" ? chosen === "" ? null : chosen : void 0;
|
|
492
|
-
const upstream = await client.request(`${path}${url.search}`, {
|
|
493
|
-
...as !== void 0 ? { as } : {},
|
|
494
|
-
method: request.method ?? "GET",
|
|
495
|
-
headers: {
|
|
496
|
-
...request.headers["content-type"] ? { "content-type": String(request.headers["content-type"]) } : {},
|
|
497
|
-
...request.headers.accept ? { accept: String(request.headers.accept) } : {},
|
|
498
|
-
...request.headers["x-board-filename"] ? { "x-board-filename": String(request.headers["x-board-filename"]) } : {}
|
|
499
|
-
},
|
|
500
|
-
...body ? { body } : {},
|
|
501
|
-
signal: controller.signal
|
|
502
|
-
});
|
|
503
|
-
response.writeHead(upstream.status, {
|
|
504
|
-
"content-type": upstream.headers.get("content-type") ?? "application/json",
|
|
505
|
-
"cache-control": "no-store",
|
|
506
|
-
"x-content-type-options": "nosniff"
|
|
507
|
-
});
|
|
508
|
-
if (upstream.body) for await (const chunk of upstream.body) response.write(chunk);
|
|
509
|
-
response.end();
|
|
510
|
-
} catch (error) {
|
|
511
|
-
if (controller.signal.aborted || response.headersSent) return void response.end();
|
|
512
|
-
json(response, 502, { error: {
|
|
513
|
-
code: "unreachable",
|
|
514
|
-
message: `the board didn't answer: ${error.message}`
|
|
515
|
-
} });
|
|
516
|
-
} finally {
|
|
517
|
-
streams.delete(controller);
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
const server = createServer((request, response) => {
|
|
521
|
-
const url = new URL(request.url ?? "/", "http://inspector");
|
|
522
|
-
if (!origins.has(`http://${request.headers.host}`)) return send(response, 421, "text/plain; charset=utf-8", "wrong host");
|
|
523
|
-
if (url.pathname === "/board" || url.pathname.startsWith("/board/")) return void proxy(request, response, url).catch(() => response.headersSent ? response.end() : send(response, 500, "text/plain; charset=utf-8", "error"));
|
|
524
|
-
if (request.method !== "GET") return send(response, 405, "text/plain; charset=utf-8", "method not allowed");
|
|
525
|
-
if (url.pathname === "/app.js") return app ? send(response, 200, "text/javascript; charset=utf-8", app) : send(response, 503, "text/plain; charset=utf-8", "the inspector's UI isn't built: run `pnpm --filter @vercel/board build`");
|
|
526
|
-
send(response, 200, "text/html; charset=utf-8", shell(token), { "content-security-policy": CSP });
|
|
527
|
-
});
|
|
528
|
-
const port = await listen(server, options.port ?? 4747, options.port === void 0);
|
|
529
|
-
origins = /* @__PURE__ */ new Set([`http://127.0.0.1:${port}`, `http://localhost:${port}`]);
|
|
530
|
-
return {
|
|
531
|
-
url: `http://127.0.0.1:${port}`,
|
|
532
|
-
board,
|
|
533
|
-
me,
|
|
534
|
-
close: () => new Promise((resolve) => {
|
|
535
|
-
for (const stream of streams) stream.abort();
|
|
536
|
-
server.close(() => resolve());
|
|
537
|
-
server.closeAllConnections();
|
|
538
|
-
})
|
|
539
|
-
};
|
|
540
|
-
}
|
|
541
|
-
function sameSecret(given, expected) {
|
|
542
|
-
const a = Buffer.from(given);
|
|
543
|
-
const b = Buffer.from(expected);
|
|
544
|
-
return a.length === b.length && timingSafeEqual(a, b);
|
|
545
|
-
}
|
|
546
|
-
function read(request, limit = 1048576) {
|
|
547
|
-
return new Promise((resolve, reject) => {
|
|
548
|
-
let size = 0;
|
|
549
|
-
const chunks = [];
|
|
550
|
-
request.on("data", (chunk) => {
|
|
551
|
-
size += chunk.length;
|
|
552
|
-
if (size > limit) {
|
|
553
|
-
reject(/* @__PURE__ */ new Error("request too large"));
|
|
554
|
-
request.destroy();
|
|
555
|
-
} else chunks.push(chunk);
|
|
556
|
-
});
|
|
557
|
-
request.on("end", () => resolve(new Uint8Array(Buffer.concat(chunks))));
|
|
558
|
-
request.on("error", reject);
|
|
559
|
-
});
|
|
560
|
-
}
|
|
561
|
-
function send(response, status, type, body, headers = {}) {
|
|
562
|
-
response.writeHead(status, {
|
|
563
|
-
"content-type": type,
|
|
564
|
-
"cache-control": "no-store",
|
|
565
|
-
"x-content-type-options": "nosniff",
|
|
566
|
-
"referrer-policy": "no-referrer",
|
|
567
|
-
...headers
|
|
568
|
-
});
|
|
569
|
-
response.end(body);
|
|
570
|
-
}
|
|
571
|
-
const json = (response, status, body) => send(response, status, "application/json", JSON.stringify(body));
|
|
572
|
-
/** Listens on the port, or any free one when the default port is taken. */
|
|
573
|
-
async function listen(server, port, fallback) {
|
|
574
|
-
try {
|
|
575
|
-
return await listenOn(server, port);
|
|
576
|
-
} catch (error) {
|
|
577
|
-
if (fallback && error.code === "EADDRINUSE") return listenOn(server, 0);
|
|
578
|
-
throw error;
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
function listenOn(server, port) {
|
|
582
|
-
return new Promise((resolve, reject) => {
|
|
583
|
-
const onError = (error) => {
|
|
584
|
-
server.off("listening", onListening);
|
|
585
|
-
reject(error);
|
|
586
|
-
};
|
|
587
|
-
const onListening = () => {
|
|
588
|
-
server.off("error", onError);
|
|
589
|
-
resolve(server.address().port);
|
|
590
|
-
};
|
|
591
|
-
server.once("error", onError);
|
|
592
|
-
server.once("listening", onListening);
|
|
593
|
-
server.listen(port, "127.0.0.1");
|
|
594
|
-
});
|
|
595
|
-
}
|
|
596
|
-
//#endregion
|
|
597
8
|
//#region src/cli/local.ts
|
|
598
|
-
/** Until Ctrl-C or a SIGTERM, whichever comes first: then neither is listened for. */
|
|
599
|
-
const stopped = () => new Promise((resolve) => {
|
|
600
|
-
const done = () => {
|
|
601
|
-
process.off("SIGINT", done);
|
|
602
|
-
process.off("SIGTERM", done);
|
|
603
|
-
resolve();
|
|
604
|
-
};
|
|
605
|
-
process.once("SIGINT", done);
|
|
606
|
-
process.once("SIGTERM", done);
|
|
607
|
-
});
|
|
608
|
-
const inspect = {
|
|
609
|
-
spec: {
|
|
610
|
-
name: "inspect",
|
|
611
|
-
description: "the board in your browser, as you: read, post, react (local only)",
|
|
612
|
-
arguments: [],
|
|
613
|
-
options: [option("port", "the port to listen on (default: a free one)"), option("no-open")],
|
|
614
|
-
examples: [{
|
|
615
|
-
name: "open the board in your browser",
|
|
616
|
-
value: "inspect"
|
|
617
|
-
}]
|
|
618
|
-
},
|
|
619
|
-
async run(_args, { flags, out, portFlag, client, openBrowser }) {
|
|
620
|
-
const port = portFlag();
|
|
621
|
-
const inspector = await startInspector({
|
|
622
|
-
client: client(),
|
|
623
|
-
...port !== void 0 ? { port } : {}
|
|
624
|
-
});
|
|
625
|
-
out(`inspecting ${inspector.board} as ${who(inspector.me)} at ${inspector.url} (Ctrl-C to stop)`);
|
|
626
|
-
if (!flags["no-open"]) openBrowser(inspector.url);
|
|
627
|
-
await stopped();
|
|
628
|
-
await inspector.close();
|
|
629
|
-
return 0;
|
|
630
|
-
}
|
|
631
|
-
};
|
|
632
9
|
/** Keeps the local board's log (`.board/`) out of the project's Git. */
|
|
633
10
|
async function ignoreLog(root) {
|
|
634
11
|
const path = join(root, ".gitignore");
|
|
@@ -639,58 +16,55 @@ async function ignoreLog(root) {
|
|
|
639
16
|
if (!ignore.split(/\r?\n/).some((line) => /^\/?\.board\/?$/.test(line))) await appendFile(path, `${ignore && !ignore.endsWith("\n") ? "\n" : ""}.board/\n`);
|
|
640
17
|
}
|
|
641
18
|
/** The commands only the standalone `board` has, in the order its help lists them. */
|
|
642
|
-
const local = {
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
out(`inspector at ${inspector.url}`);
|
|
683
|
-
if (!flags["no-open"]) openBrowser(inspector.url);
|
|
684
|
-
}
|
|
685
|
-
await stopped();
|
|
686
|
-
} finally {
|
|
687
|
-
await inspector?.close();
|
|
688
|
-
await local.close();
|
|
19
|
+
const local = { serve: {
|
|
20
|
+
spec: {
|
|
21
|
+
name: "serve",
|
|
22
|
+
description: "run a board on this machine (127.0.0.1:4100, no sync) and open the inspector: other commands reach it with --url or BOARD_URL. Its log lives in .board/, and you're local:user:<your OS user> (or --handle)",
|
|
23
|
+
arguments: [],
|
|
24
|
+
options: [
|
|
25
|
+
option("port", "the port to listen on (default: 4100)"),
|
|
26
|
+
option("dir"),
|
|
27
|
+
option("no-inspect"),
|
|
28
|
+
option("no-open")
|
|
29
|
+
],
|
|
30
|
+
examples: [{
|
|
31
|
+
name: "run a board here, and open it",
|
|
32
|
+
value: "serve"
|
|
33
|
+
}]
|
|
34
|
+
},
|
|
35
|
+
async run(args, { flags, out, usage, portFlag, connection, openBrowser }) {
|
|
36
|
+
if (args.length > 0) throw usage("serve takes no arguments: pass its port with --port, and its directory with --dir.");
|
|
37
|
+
const port = portFlag();
|
|
38
|
+
const root = projectDir();
|
|
39
|
+
const { localHandle, serveLocal } = await import("./serve-D7I3KisQ.mjs");
|
|
40
|
+
const handle = flags.handle ?? process.env.BOARD_HANDLE;
|
|
41
|
+
const local = await serveLocal({
|
|
42
|
+
dir: flags.dir ?? join(root, ".board"),
|
|
43
|
+
...port !== void 0 ? { port } : {},
|
|
44
|
+
...handle ? { handle: localHandle(handle) } : {}
|
|
45
|
+
});
|
|
46
|
+
let inspector = null;
|
|
47
|
+
try {
|
|
48
|
+
if (!flags.dir) await ignoreLog(root);
|
|
49
|
+
out(`serving a local board at ${local.url} as ${local.principal}, its log in ${local.dir} (Ctrl-C to stop)`);
|
|
50
|
+
out(`reach it with --url ${local.url}, or BOARD_URL=${local.url}`);
|
|
51
|
+
if (!flags["no-inspect"]) {
|
|
52
|
+
const { board } = connection(local.url, {
|
|
53
|
+
token: local.token,
|
|
54
|
+
handle: local.handle
|
|
55
|
+
});
|
|
56
|
+
inspector = await startInspector({ client: board.as(null) });
|
|
57
|
+
out(`inspector at ${inspector.url}`);
|
|
58
|
+
if (!flags["no-open"]) openBrowser(inspector.url);
|
|
689
59
|
}
|
|
690
|
-
|
|
60
|
+
await stopped();
|
|
61
|
+
} finally {
|
|
62
|
+
await inspector?.close();
|
|
63
|
+
await local.close();
|
|
691
64
|
}
|
|
65
|
+
return 0;
|
|
692
66
|
}
|
|
693
|
-
};
|
|
67
|
+
} };
|
|
694
68
|
//#endregion
|
|
695
69
|
//#region src/cli/bin.ts
|
|
696
70
|
main(process.argv.slice(2), {
|