@nanocollective/roster 0.1.0-alpha.2 → 0.1.0-alpha.3
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/package.json
CHANGED
|
@@ -28,6 +28,12 @@
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
*{box-sizing:border-box}
|
|
31
|
+
/* `hidden` loses to any author rule that sets `display`, which is most of them: a hidden
|
|
32
|
+
`.field` is still `display:grid` and a hidden `.btn` is still `display:block`. Every element
|
|
33
|
+
the page hides would otherwise need its own `[hidden]` rule, and the ones nobody remembered
|
|
34
|
+
just stayed on screen. Said once, here. */
|
|
35
|
+
[hidden]{display:none!important}
|
|
36
|
+
|
|
31
37
|
body{margin:0;background:var(--bg);color:var(--ink);font:14px/1.55 var(--sans);
|
|
32
38
|
-webkit-font-smoothing:antialiased}
|
|
33
39
|
a{color:inherit}
|
|
@@ -51,6 +51,12 @@ export async function boot() {
|
|
|
51
51
|
if (first && first.mode === "setup") {
|
|
52
52
|
document.body.dataset.setup = "1";
|
|
53
53
|
$("#orgname").textContent = "no org yet";
|
|
54
|
+
/* Every one of these reads a tenant, so during setup they answer 409 and the sidebar is a
|
|
55
|
+
row of four dead ends beside an empty Staff heading. There is one thing to do on this
|
|
56
|
+
screen; the navigation comes back with the org. */
|
|
57
|
+
for (const el of document.querySelectorAll("#inboxnav, #orgnav, #staffnav, #docsnav, #refreshall, .sect, #stafflist")) {
|
|
58
|
+
el.hidden = true;
|
|
59
|
+
}
|
|
54
60
|
for (const slot of document.querySelectorAll("[data-icon]")) {
|
|
55
61
|
slot.innerHTML = iconHTML(slot.dataset.icon);
|
|
56
62
|
}
|
|
@@ -19,6 +19,11 @@ export async function viewSetup(main) {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
function render(main) {
|
|
22
|
+
/* The sidebar is written by boot() before any of this is known. Once a tenant has been
|
|
23
|
+
adopted, leaving it on "no org yet" contradicts the card directly below it. */
|
|
24
|
+
const brand = $("#orgname");
|
|
25
|
+
if (brand) brand.textContent = S.tenant.found ? (S.tenant.org ?? "set up") : "no org yet";
|
|
26
|
+
|
|
22
27
|
main.replaceChildren();
|
|
23
28
|
main.append(el("h1", { textContent: "Set up your org" }));
|
|
24
29
|
main.append(
|
|
@@ -156,10 +161,11 @@ function stepOrg(main) {
|
|
|
156
161
|
const human = field("human", "Your GitHub login", S.gh.login ?? "", "The person the agents answer to.");
|
|
157
162
|
|
|
158
163
|
card.append(form);
|
|
164
|
+
const agentHead = el("h3", { textContent: "Which coding agent runs a session" });
|
|
159
165
|
|
|
160
166
|
/* The agent. Its id decides the secret name later, so setup can name it exactly rather than
|
|
161
167
|
saying "it depends on the runner". */
|
|
162
|
-
card.append(
|
|
168
|
+
card.append(agentHead);
|
|
163
169
|
const agents = el("div", { className: "choices" });
|
|
164
170
|
S.agents.forEach((a, i) => {
|
|
165
171
|
const opt = el("label", { className: "choice" });
|
|
@@ -170,14 +176,13 @@ function stepOrg(main) {
|
|
|
170
176
|
agents.append(opt);
|
|
171
177
|
});
|
|
172
178
|
card.append(agents);
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
);
|
|
179
|
+
const agentNote = el("p", {
|
|
180
|
+
className: "sub",
|
|
181
|
+
textContent:
|
|
182
|
+
"Anything else works too: a runner is an install command, a run command and the name of " +
|
|
183
|
+
"the secret holding its credential. Write those three into org.yaml afterwards.",
|
|
184
|
+
});
|
|
185
|
+
card.append(agentNote);
|
|
181
186
|
|
|
182
187
|
const params = () => ({
|
|
183
188
|
org: org.value === "__other" ? other.input.value.trim() : org.value,
|
|
@@ -200,11 +205,29 @@ function stepOrg(main) {
|
|
|
200
205
|
join.hidden = !joining;
|
|
201
206
|
plan.hidden = joining;
|
|
202
207
|
if (joining) go.hidden = true;
|
|
208
|
+
|
|
209
|
+
/* An org that already runs roster has answered all of these: its own org.yaml names the
|
|
210
|
+
business, the human and the agent. Leaving them on screen asks for values that will be
|
|
211
|
+
thrown away, and implies the checkout is going to use them. */
|
|
212
|
+
for (const bit of [name.wrap, human.wrap, agentHead, agents, agentNote]) bit.hidden = joining;
|
|
203
213
|
}
|
|
204
214
|
|
|
205
215
|
join.onclick = async () => {
|
|
206
216
|
join.disabled = true;
|
|
207
|
-
|
|
217
|
+
/* Cloning an ops repo and every brain took 38 seconds against a real org, behind a word
|
|
218
|
+
that never changed. A static "Cloning…" for that long reads as hung, so this says what
|
|
219
|
+
it is doing and keeps a clock running to show it is alive. */
|
|
220
|
+
const clock = el("p", { className: "sub" });
|
|
221
|
+
out.replaceChildren(clock);
|
|
222
|
+
const started = Date.now();
|
|
223
|
+
const tick = () => {
|
|
224
|
+
const s = Math.round((Date.now() - started) / 1000);
|
|
225
|
+
clock.textContent =
|
|
226
|
+
`Cloning ${existing}: the ops repo and one for each staff member. ${s}s. ` +
|
|
227
|
+
"A first checkout usually takes under a minute.";
|
|
228
|
+
};
|
|
229
|
+
tick();
|
|
230
|
+
const ticking = setInterval(tick, 1000);
|
|
208
231
|
try {
|
|
209
232
|
const result = await joinOrg(existing);
|
|
210
233
|
if (!result.ok) throw new Error(result.error);
|
|
@@ -219,6 +242,7 @@ function stepOrg(main) {
|
|
|
219
242
|
} catch (err) {
|
|
220
243
|
out.replaceChildren(el("p", { className: "err", textContent: String(err.message || err) }));
|
|
221
244
|
} finally {
|
|
245
|
+
clearInterval(ticking);
|
|
222
246
|
join.disabled = false;
|
|
223
247
|
}
|
|
224
248
|
};
|
|
@@ -279,12 +303,12 @@ function stepOrg(main) {
|
|
|
279
303
|
/* ------------------------- 5 · the two GitHub insists on ------------------------- */
|
|
280
304
|
|
|
281
305
|
function afterCreate() {
|
|
282
|
-
const card = step(3, "
|
|
306
|
+
const card = step(3, "What is left", false);
|
|
283
307
|
card.append(
|
|
284
308
|
el("p", {
|
|
285
309
|
textContent:
|
|
286
|
-
"
|
|
287
|
-
"you skip it.",
|
|
310
|
+
"None of these can be done for you, and the first fails in a way that wastes an " +
|
|
311
|
+
"afternoon if you skip it.",
|
|
288
312
|
}),
|
|
289
313
|
);
|
|
290
314
|
|