@nanocollective/roster 0.1.0-alpha.8 → 0.1.0-beta.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.
Files changed (145) hide show
  1. package/README.md +5 -0
  2. package/dist/cli.js +4084 -1936
  3. package/dist/worker/assets/assets/css/base.css +312 -0
  4. package/dist/worker/assets/assets/css/brain.css +116 -0
  5. package/dist/worker/assets/assets/css/diff.css +33 -0
  6. package/dist/worker/assets/assets/css/graph.css +39 -0
  7. package/dist/worker/assets/assets/css/health.css +75 -0
  8. package/dist/worker/assets/assets/css/home.css +101 -0
  9. package/dist/worker/assets/assets/css/inbox.css +199 -0
  10. package/dist/worker/assets/assets/css/layout.css +175 -0
  11. package/dist/worker/assets/assets/css/markdown.css +96 -0
  12. package/dist/worker/assets/assets/css/runs.css +13 -0
  13. package/dist/worker/assets/assets/css/search.css +48 -0
  14. package/dist/worker/assets/assets/css/setup.css +194 -0
  15. package/dist/worker/assets/assets/js/api.js +161 -0
  16. package/dist/worker/assets/assets/js/app.js +465 -0
  17. package/dist/worker/assets/assets/js/dialog.js +196 -0
  18. package/dist/worker/assets/assets/js/dom.js +131 -0
  19. package/dist/worker/assets/assets/js/homesort.js +174 -0
  20. package/dist/worker/assets/assets/js/icons.js +142 -0
  21. package/dist/worker/assets/assets/js/inflight.js +18 -0
  22. package/dist/worker/assets/assets/js/lightbox.js +273 -0
  23. package/dist/worker/assets/assets/js/md.js +406 -0
  24. package/dist/worker/assets/assets/js/mdedit.js +84 -0
  25. package/dist/worker/assets/assets/js/mention.js +264 -0
  26. package/dist/worker/assets/assets/js/readiness.js +70 -0
  27. package/dist/worker/assets/assets/js/refresh.js +197 -0
  28. package/dist/worker/assets/assets/js/router.js +20 -0
  29. package/dist/worker/assets/assets/js/search.js +366 -0
  30. package/dist/worker/assets/assets/js/state.js +213 -0
  31. package/dist/worker/assets/assets/js/textdiff.js +96 -0
  32. package/dist/worker/assets/assets/js/views/app.js +145 -0
  33. package/dist/worker/assets/assets/js/views/brain.js +260 -0
  34. package/dist/worker/assets/assets/js/views/changed.js +157 -0
  35. package/dist/worker/assets/assets/js/views/checklist.js +115 -0
  36. package/dist/worker/assets/assets/js/views/credential.js +84 -0
  37. package/dist/worker/assets/assets/js/views/docs.js +174 -0
  38. package/dist/worker/assets/assets/js/views/files.js +139 -0
  39. package/dist/worker/assets/assets/js/views/graph.js +436 -0
  40. package/dist/worker/assets/assets/js/views/health.js +304 -0
  41. package/dist/worker/assets/assets/js/views/hire.js +593 -0
  42. package/dist/worker/assets/assets/js/views/home.js +585 -0
  43. package/dist/worker/assets/assets/js/views/inbox.js +1558 -0
  44. package/dist/worker/assets/assets/js/views/memory.js +150 -0
  45. package/dist/worker/assets/assets/js/views/org.js +195 -0
  46. package/dist/worker/assets/assets/js/views/orgedit.js +240 -0
  47. package/dist/worker/assets/assets/js/views/paste.js +216 -0
  48. package/dist/worker/assets/assets/js/views/prompt.js +457 -0
  49. package/dist/worker/assets/assets/js/views/repos.js +97 -0
  50. package/dist/worker/assets/assets/js/views/runonce.js +94 -0
  51. package/dist/worker/assets/assets/js/views/runs.js +182 -0
  52. package/dist/worker/assets/assets/js/views/setup.js +557 -0
  53. package/dist/worker/assets/assets/js/views/staff.js +291 -0
  54. package/dist/worker/assets/assets/js/views/todo.js +62 -0
  55. package/dist/worker/assets/assets/js/yaml.js +134 -0
  56. package/dist/worker/assets/docs-images/brain.jpg +0 -0
  57. package/dist/worker/assets/docs-images/home.jpg +0 -0
  58. package/dist/worker/assets/docs-images/org.jpg +0 -0
  59. package/dist/worker/assets/docs-images/prompt.jpg +0 -0
  60. package/dist/worker/assets/docs-images/setup-org.jpg +0 -0
  61. package/dist/worker/assets/docs-images/setup-plan.jpg +0 -0
  62. package/dist/worker/assets/docs-images/staff.jpg +0 -0
  63. package/dist/worker/assets/index.html +82 -0
  64. package/dist/worker/index.js +4430 -0
  65. package/docs/README.md +2 -2
  66. package/docs/architecture.md +1 -1
  67. package/docs/charters/analyst.md +65 -0
  68. package/docs/charters/community.md +63 -0
  69. package/docs/charters/designer.md +65 -0
  70. package/docs/charters/devops.md +65 -0
  71. package/docs/charters/pm.md +70 -0
  72. package/docs/charters/qa.md +65 -0
  73. package/docs/charters/writer.md +63 -0
  74. package/docs/commands.md +13 -3
  75. package/docs/concepts.md +33 -20
  76. package/docs/cost.md +3 -3
  77. package/docs/developing.md +27 -9
  78. package/docs/doctor-codes.md +3 -1
  79. package/docs/export.md +2 -0
  80. package/docs/getting-started.md +44 -27
  81. package/docs/hosting.md +89 -43
  82. package/docs/images/brain.jpg +0 -0
  83. package/docs/images/home.jpg +0 -0
  84. package/docs/images/org.jpg +0 -0
  85. package/docs/images/prompt.jpg +0 -0
  86. package/docs/images/staff.jpg +0 -0
  87. package/docs/manual-steps.md +3 -2
  88. package/docs/org-yaml.md +3 -0
  89. package/docs/portal.md +143 -45
  90. package/docs/prompts.md +6 -0
  91. package/docs/security.md +57 -11
  92. package/docs/session-workflow.md +14 -0
  93. package/docs/staff-yaml.md +17 -1
  94. package/docs/upgrading.md +3 -3
  95. package/docs/writing-a-charter.md +19 -6
  96. package/package.json +4 -3
  97. package/templates/brain/.github/workflows/%%STAFF%%-daily.yaml +20 -1
  98. package/templates/brain/.github/workflows/%%STAFF%%-mention.yaml +53 -13
  99. package/templates/brain/staff.yaml +4 -1
  100. package/templates/briefs/amend.md +4 -3
  101. package/templates/briefs/priorities.md +46 -0
  102. package/templates/ops/.github/workflows/session.yaml +137 -3
  103. package/templates/ops/compose.mjs +35 -8
  104. package/templates/ops/org/operating.md +29 -10
  105. package/templates/ops/prompts/daily.md +23 -4
  106. package/templates/ops/prompts/mention.md +19 -0
  107. package/templates/ops/run-record.mjs +5 -3
  108. package/templates/portal/css/base.css +34 -0
  109. package/templates/portal/css/health.css +14 -1
  110. package/templates/portal/css/home.css +101 -0
  111. package/templates/portal/css/inbox.css +21 -4
  112. package/templates/portal/css/layout.css +29 -3
  113. package/templates/portal/css/markdown.css +19 -0
  114. package/templates/portal/css/search.css +48 -0
  115. package/templates/portal/css/setup.css +79 -4
  116. package/templates/portal/index.html +15 -9
  117. package/templates/portal/js/api.js +30 -4
  118. package/templates/portal/js/app.js +90 -7
  119. package/templates/portal/js/dialog.js +36 -0
  120. package/templates/portal/js/homesort.js +174 -0
  121. package/templates/portal/js/icons.js +41 -0
  122. package/templates/portal/js/inflight.js +18 -0
  123. package/templates/portal/js/md.js +5 -2
  124. package/templates/portal/js/mdedit.js +84 -0
  125. package/templates/portal/js/readiness.js +70 -0
  126. package/templates/portal/js/refresh.js +10 -2
  127. package/templates/portal/js/search.js +366 -0
  128. package/templates/portal/js/state.js +11 -5
  129. package/templates/portal/js/views/app.js +1 -2
  130. package/templates/portal/js/views/brain.js +1 -1
  131. package/templates/portal/js/views/checklist.js +19 -4
  132. package/templates/portal/js/views/credential.js +42 -51
  133. package/templates/portal/js/views/health.js +11 -6
  134. package/templates/portal/js/views/hire.js +593 -0
  135. package/templates/portal/js/views/home.js +585 -0
  136. package/templates/portal/js/views/inbox.js +237 -68
  137. package/templates/portal/js/views/org.js +31 -111
  138. package/templates/portal/js/views/orgedit.js +240 -0
  139. package/templates/portal/js/views/paste.js +111 -66
  140. package/templates/portal/js/views/prompt.js +94 -40
  141. package/templates/portal/js/views/repos.js +10 -10
  142. package/templates/portal/js/views/runs.js +21 -4
  143. package/templates/portal/js/views/setup.js +130 -163
  144. package/templates/portal/js/views/staff.js +181 -301
  145. package/templates/portal/js/views/todo.js +62 -0
@@ -6,88 +6,79 @@
6
6
  import { getCredential, storeCredential } from "../api.js";
7
7
  import { el } from "../dom.js";
8
8
 
9
- export function credentialPanel() {
10
- const box = el("div", { className: "manual" });
11
- box.append(el("b", { textContent: "Your agent's credential, once" }));
9
+ /** @param opts.bare drawn inside a step that already has a title. `onStatus(done)` hears whether one is stored. */
10
+ export function credentialPanel(opts = {}) {
11
+ const box = el("div", { className: opts.bare ? "" : "manual" });
12
+ if (!opts.bare) box.append(el("b", { textContent: "Agent credential" }));
12
13
  const body = el("div");
13
14
  box.append(body);
14
- body.append(el("p", { className: "sub", textContent: "Looking at where it would go…" }));
15
+ body.append(el("p", { className: "sub", textContent: "Checking…" }));
15
16
 
16
17
  getCredential()
17
- .then((c) => draw(body, c))
18
+ .then((c) => {
19
+ opts.onStatus?.(Boolean(c.stored ?? c.orgSecret));
20
+ draw(body, c, opts);
21
+ })
18
22
  .catch((err) => body.replaceChildren(el("p", { className: "err", textContent: String(err.message || err) })));
19
23
  return box;
20
24
  }
21
25
 
22
- function draw(body, c) {
26
+ function draw(body, c, opts = {}) {
23
27
  body.replaceChildren();
24
- if (c.howTo) body.append(el("p", { textContent: "Where to get one: " + c.howTo }));
25
28
 
26
- if (!c.brains.length) {
27
- body.append(
28
- el("p", {
29
- className: "sub",
30
- textContent:
31
- "Nothing reads it until somebody is hired, so this box opens once there is a staff " +
32
- "member. It is asked for once, not once per hire.",
33
- }),
34
- );
29
+ if (!(c.brains ?? []).length) {
30
+ // Inside a step, the step's own hint already says when this opens.
31
+ if (!opts.bare) body.append(el("p", { className: "sub", textContent: "Available after your first hire. You only add it once." }));
35
32
  return;
36
33
  }
37
34
 
38
- if (c.orgSecret) {
39
- body.append(
40
- el("p", {
41
- className: "sub",
42
- textContent:
43
- c.name + " is already an org secret, shared with " + c.orgSecret.visibility + " repos. " +
44
- "Each hire adds its brain to it. Paste a new one only to replace it.",
45
- }),
46
- );
47
- }
48
-
49
- body.append(
50
- el("p", {
51
- className: "sub",
52
- textContent:
53
- (c.plan.mode === "org"
54
- ? "Stored as one org secret, " + c.name + ", shared with " + c.brains.join(", ") + ". "
55
- : "Stored as " + c.name + " on each of " + c.brains.join(", ") + ", because " + c.plan.reason + ". ") +
56
- "It goes to gh on standard input and is never written to disk.",
57
- }),
35
+ const form = el("div", { className: "credform" });
36
+ const input = el("input", { type: "password", placeholder: "Paste it here", autocomplete: "off", className: "textfield" });
37
+ const go = el("button", { className: "btn primary", textContent: "Save" });
38
+ const out = el("div");
39
+ form.append(
40
+ ...(c.howTo ? [el("p", { className: "sub", textContent: "To get one, " + c.howTo })] : []),
41
+ input,
42
+ el("div", { className: "row" }, [go]),
43
+ out,
58
44
  );
59
45
 
60
- const input = el("input", { type: "password", placeholder: c.name, autocomplete: "off" });
61
- input.style.width = "100%";
62
- const go = el("button", { className: "btn primary", textContent: "Store it" });
63
- const out = el("div", { style: "margin-top:9px" });
64
- body.append(input, el("div", { className: "row", style: "margin-top:9px" }, [go]), out);
46
+ // Stored already, on the org or on every brain repo: say so, and keep replacing it one click away.
47
+ if (c.stored ?? c.orgSecret) {
48
+ const replace = el("button", { className: "ghbtn", textContent: "Replace it" });
49
+ replace.onclick = () => {
50
+ replace.remove();
51
+ form.hidden = false;
52
+ input.focus?.();
53
+ };
54
+ form.hidden = true;
55
+ body.append(el("p", { className: "okline", textContent: "✓ Stored as " + c.name + "." }), replace, form);
56
+ } else {
57
+ body.append(form);
58
+ }
65
59
 
66
60
  go.onclick = async () => {
67
- const value = input.value.trim();
61
+ const value = String(input.value ?? "").trim();
68
62
  if (!value) {
69
- input.focus();
63
+ input.focus?.();
70
64
  return;
71
65
  }
72
66
  go.disabled = true;
73
- out.replaceChildren(el("p", { className: "sub", textContent: "Storing…" }));
67
+ go.textContent = "Saving…";
74
68
  try {
75
69
  const r = await storeCredential(value, false);
76
70
  input.value = "";
77
71
  if (!r.ok) throw new Error(r.error);
72
+ opts.onStatus?.(true);
78
73
  out.replaceChildren(
79
- ...(r.fellBack ? [el("p", { className: "err", textContent: "The org secret was refused: " + r.fellBack })] : []),
80
- el("p", {
81
- textContent:
82
- r.mode === "org"
83
- ? "Stored once for the org, shared with " + r.repos.length + " brains."
84
- : "Stored on " + r.repos.join(", ") + ".",
85
- }),
74
+ ...(r.fellBack ? [el("p", { className: "sub", textContent: "Saved on each repo instead: " + r.fellBack })] : []),
75
+ el("p", { className: "okline", textContent: "✓ Saved." }),
86
76
  );
87
77
  } catch (err) {
88
78
  out.replaceChildren(el("p", { className: "err", textContent: String(err.message || err) }));
89
79
  } finally {
90
80
  go.disabled = false;
81
+ go.textContent = "Save";
91
82
  }
92
83
  };
93
84
  }
@@ -7,7 +7,7 @@ import { inline } from "../md.js";
7
7
  import { render } from "../router.js";
8
8
  import { S, staff } from "../state.js";
9
9
  import { checklist } from "./checklist.js";
10
- import { copyAmendBrief } from "./prompt.js";
10
+ import { amendSheet } from "./prompt.js";
11
11
  import { runOnce } from "./runonce.js";
12
12
 
13
13
  const DAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
@@ -75,7 +75,7 @@ export function viewHealth(m) {
75
75
  }
76
76
  if ((rig.missingSurfaces ?? []).length) {
77
77
  g.append(kv("Surfaces", esc(rig.missingSurfaces.length + " missing"),
78
- rig.missingSurfaces.join(", ") + " — declared in staff.yaml, not on disk", true));
78
+ rig.missingSurfaces.join(", ") + " — declared in staff.yaml, not in the repo", true));
79
79
  }
80
80
  m.append(g);
81
81
 
@@ -141,6 +141,8 @@ function memoryProblems({ body, actions, say }, s) {
141
141
  );
142
142
  if (!s.problems.length) return;
143
143
 
144
+ const list = el("div", { className: "card hlist" });
145
+ body.append(list);
144
146
  for (const p of s.problems) {
145
147
  const { row, body: text } = finding(
146
148
  p.level === "error" ? "error" : "warning",
@@ -158,7 +160,7 @@ function memoryProblems({ body, actions, say }, s) {
158
160
  }
159
161
  acts.append(status);
160
162
  text.append(acts);
161
- body.append(row);
163
+ list.append(row);
162
164
  }
163
165
 
164
166
  /* The portal's one power over an agent is that it acts as the human, so "fix this" is an
@@ -235,13 +237,16 @@ async function promptProblems({ body, say }, s) {
235
237
  /* Worst first, and each one carrying the sentence that fixes it. Knowing there is a problem
236
238
  is the hard part; writing the paragraph that asks for the change is not. */
237
239
  const rank = { error: 0, warning: 1, note: 2 };
240
+ const list = el("div", { className: "card hlist" });
241
+ body.append(list);
238
242
  for (const p of [...problems].sort((a, b) => (rank[a.level] ?? 3) - (rank[b.level] ?? 3))) {
239
243
  const { row, body: text } = finding(p.level, { text: p.title }, [(p.kinds ?? []).join(", ")]);
240
244
  text.append(el("p", { textContent: p.detail }));
241
245
 
242
246
  const note = el("span", { className: "meta" });
243
- const fix = el("button", { className: "ghbtn", textContent: "Copy a prompt to fix this" });
244
- fix.onclick = () => copyAmendBrief(s.handle, p.kind, p.want, fix, note);
247
+ const fix = el("button", { className: "ghbtn", textContent: "Fix this with your AI" });
248
+ fix.onclick = () =>
249
+ amendSheet({ handle: s.handle, name: s.name, kind: p.kind, want: p.want, title: p.title, detail: p.detail });
245
250
  const actions = el("div", { className: "row facts" }, [fix]);
246
251
  if (p.path) {
247
252
  const go = el("button", { className: "ghbtn", textContent: "Open the file" });
@@ -256,7 +261,7 @@ async function promptProblems({ body, say }, s) {
256
261
  }
257
262
  actions.append(note);
258
263
  text.append(actions);
259
- body.append(row);
264
+ list.append(row);
260
265
  }
261
266
  }
262
267