@nanocollective/roster 0.1.0-alpha.6 → 0.1.0-alpha.7

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 (58) hide show
  1. package/README.md +65 -84
  2. package/dist/cli.js +4153 -2708
  3. package/docs/README.md +9 -6
  4. package/docs/agents.md +24 -20
  5. package/docs/architecture.md +13 -5
  6. package/docs/charters/cmo.md +69 -0
  7. package/docs/charters/cto.md +71 -0
  8. package/docs/charters/support.md +60 -0
  9. package/docs/commands.md +81 -5
  10. package/docs/concepts.md +48 -14
  11. package/docs/cost.md +36 -1
  12. package/docs/developing.md +16 -21
  13. package/docs/doctor-codes.md +8 -2
  14. package/docs/extending.md +2 -2
  15. package/docs/getting-started.md +100 -77
  16. package/docs/manual-steps.md +93 -123
  17. package/docs/memory.md +21 -3
  18. package/docs/org-yaml.md +37 -2
  19. package/docs/portal.md +59 -33
  20. package/docs/prompts.md +25 -4
  21. package/docs/security.md +29 -5
  22. package/docs/session-workflow.md +49 -17
  23. package/docs/staff-yaml.md +13 -2
  24. package/docs/troubleshooting.md +8 -8
  25. package/docs/upgrading.md +6 -0
  26. package/docs/writing-a-charter.md +15 -0
  27. package/package.json +1 -1
  28. package/templates/brain/.github/workflows/%%STAFF%%-daily.yaml +6 -0
  29. package/templates/brain/.github/workflows/%%STAFF%%-mention.yaml +6 -0
  30. package/templates/brain/CHARTER.md +3 -3
  31. package/templates/brain/README.md +1 -0
  32. package/templates/brain/log/decisions.md +3 -0
  33. package/templates/brain/strategy/ideas.md +7 -0
  34. package/templates/ops/.github/workflows/session.yaml +108 -14
  35. package/templates/ops/agents.mjs +7 -3
  36. package/templates/ops/compose.mjs +16 -3
  37. package/templates/ops/inflight.mjs +157 -0
  38. package/templates/ops/org/operating.md +21 -1
  39. package/templates/ops/org/voice.md +9 -0
  40. package/templates/ops/prompts/_inflight.md +14 -0
  41. package/templates/ops/prompts/_paths.md +2 -1
  42. package/templates/ops/prompts/daily.md +16 -7
  43. package/templates/ops/prompts/mention.md +2 -0
  44. package/templates/ops/run-record.mjs +144 -0
  45. package/templates/portal/css/runs.css +13 -0
  46. package/templates/portal/index.html +4 -0
  47. package/templates/portal/js/api.js +29 -3
  48. package/templates/portal/js/app.js +4 -1
  49. package/templates/portal/js/state.js +3 -1
  50. package/templates/portal/js/views/app.js +23 -5
  51. package/templates/portal/js/views/credential.js +93 -0
  52. package/templates/portal/js/views/health.js +15 -3
  53. package/templates/portal/js/views/org.js +2 -0
  54. package/templates/portal/js/views/paste.js +29 -0
  55. package/templates/portal/js/views/runonce.js +88 -0
  56. package/templates/portal/js/views/runs.js +165 -0
  57. package/templates/portal/js/views/setup.js +67 -26
  58. package/templates/portal/js/views/staff.js +47 -10
@@ -15,8 +15,10 @@ import { icon } from "../icons.js";
15
15
  import { refreshAll } from "../refresh.js";
16
16
  import { S } from "../state.js";
17
17
  import { appPanel } from "./app.js";
18
+ import { credentialPanel } from "./credential.js";
18
19
  import { cronText } from "./health.js";
19
20
  import { paste } from "./paste.js";
21
+ import { runOnce } from "./runonce.js";
20
22
 
21
23
  export function viewStaff(m) {
22
24
  m.append(el("h1", { textContent: "Staff" }));
@@ -88,7 +90,27 @@ export function viewStaff(m) {
88
90
  pane.scrollIntoView?.({ behavior: "smooth", block: "start" });
89
91
  };
90
92
 
91
- d.append(el("div", { className: "row", style: "margin-top:10px" }, [write, app, go, status]));
93
+ /* The credential is once for the org, but the moment somebody looks for it is while setting
94
+ up one staff member, so it is reachable from each card. */
95
+ const cred = el("button", { className: "ghbtn", textContent: "Agent credential" });
96
+ cred.onclick = () => {
97
+ pane.replaceChildren(el("div", { className: "card" }, [credentialPanel()]));
98
+ pane.scrollIntoView?.({ behavior: "smooth", block: "start" });
99
+ };
100
+
101
+ const run = el("button", { className: "ghbtn", textContent: "Run once now" });
102
+ run.onclick = () => {
103
+ pane.replaceChildren(
104
+ el("div", { className: "card" }, [
105
+ runOnce({ staff: s.handle, name: s.name, onDone: (ok) => ok && refreshAll(true) }),
106
+ ]),
107
+ );
108
+ pane.scrollIntoView?.({ behavior: "smooth", block: "start" });
109
+ };
110
+
111
+ d.append(
112
+ el("div", { className: "row", style: "margin-top:10px" }, [write, app, cred, run, go, status]),
113
+ );
92
114
  return d;
93
115
  }
94
116
 
@@ -163,17 +185,32 @@ export function viewStaff(m) {
163
185
  line("ok", "runs at " + s.schedule + ", on " + s.model),
164
186
  );
165
187
  for (const p of plan.peers) {
166
- box.append(line("ok", p.dir + "/staff.yaml gains a peer entry and a " + p.label + " label"));
188
+ box.append(line("ok", p.brain + " gains a " + p.label + " label"));
167
189
  }
168
- box.append(line("ok", "org.yaml gains a staff entry and a repo entry"));
190
+ /* Commits into repos that already exist, as you. Listed because they are writes to
191
+ somebody else's repo, and a plan that hid them would be the silent kind. */
192
+ box.append(el("div", { className: "planhead", textContent: "Commits and pushes, as you" }));
193
+ for (const c of plan.commits ?? []) box.append(line("ok", c.repo + ": " + c.file + ", " + c.why));
169
194
 
170
- if (plan.secrets?.length) {
171
- box.append(el("div", { className: "planhead", textContent: "You will still have to" }));
172
- box.append(
173
- line("todo", "create the GitHub App: roster app " + s.handle),
174
- line("todo", "put " + plan.secrets.join(", ") + " on the new repo"),
175
- );
176
- }
195
+ const cred = s.agentSecret ?? "the agent credential";
196
+ box.append(
197
+ plan.orgSecret?.visibility === "selected"
198
+ ? line("ok", s.brain + " is added to the repos that can read the org secret " + cred)
199
+ : plan.orgSecret
200
+ ? line("ok", "the org secret " + cred + " already reaches " + plan.orgSecret.visibility + " repos")
201
+ : line("warn", "no org secret " + cred + " yet: store it once with Agent credential, after this"),
202
+ );
203
+
204
+ box.append(el("div", { className: "planhead", textContent: "Then, on the new card" }));
205
+ box.append(
206
+ line(
207
+ "todo",
208
+ "GitHub App, or roster app " + s.handle + " --apply: creates it, sets its secrets, and " +
209
+ "opens the install page with the repos already ticked",
210
+ ),
211
+ line("todo", "Write the charter"),
212
+ line("todo", "Run once now, or roster run " + s.handle + " --apply: the run that proves the wiring"),
213
+ );
177
214
  for (const w of plan.warnings ?? []) box.append(line("warn", w));
178
215
 
179
216
  const status = el("span", { className: "meta" });