@nanocollective/roster 0.1.0-alpha.20 → 0.1.0-alpha.21

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/README.md CHANGED
@@ -33,6 +33,11 @@ first finished run, most of it writing what the business is and the staff member
33
33
  Everything the portal does is also a command, on the same files. Nothing changes anything
34
34
  without `--apply`.
35
35
 
36
+ **`roster` here means either of these.** With nothing installed, run commands through npx:
37
+ `npx @nanocollective/roster@latest upgrade`. Or install it once with
38
+ `npm install -g @nanocollective/roster` and type `roster upgrade`. When you run through npx,
39
+ the commands roster suggests are printed the npx way, so they can be pasted as they are.
40
+
36
41
  ```bash
37
42
  roster init --org acme # ops repo, org layer, merge base
38
43
  roster hire cto # scaffold a staff member: repo, workflows, labels, peers
package/dist/cli.js CHANGED
@@ -5401,6 +5401,30 @@ function short3(e) {
5401
5401
  return line.length > 200 ? `${line.slice(0, 199)}\u2026` : line;
5402
5402
  }
5403
5403
 
5404
+ // src/lib/bin.ts
5405
+ var NPX = "npx @nanocollective/roster@latest";
5406
+ function bin(env = process.env, argv1 = process.argv[1] ?? "") {
5407
+ if (env.ROSTER_BIN) return env.ROSTER_BIN;
5408
+ if (env.npm_command === "exec" || /[\\/]_npx[\\/]/.test(argv1)) return NPX;
5409
+ return "roster";
5410
+ }
5411
+ var COMMAND = /\broster(?= (?:init|hire|app|credential|run|doctor|fix|portal|prompt|upgrade|retire|lint|brief|export|help)\b)/g;
5412
+ function withBin(text, name = bin()) {
5413
+ return name === "roster" ? text : text.replace(COMMAND, name);
5414
+ }
5415
+ function rewriteOutput(name = bin()) {
5416
+ const raw = process.stdout.write.bind(process.stdout);
5417
+ if (name === "roster") return (text) => void raw(text);
5418
+ for (const stream of [process.stdout, process.stderr]) {
5419
+ const write = stream.write.bind(stream);
5420
+ stream.write = ((chunk, ...rest) => write(
5421
+ typeof chunk === "string" ? withBin(chunk, name) : chunk,
5422
+ ...rest
5423
+ ));
5424
+ }
5425
+ return (text) => void raw(text);
5426
+ }
5427
+
5404
5428
  // src/lib/browser.ts
5405
5429
  import { spawn } from "child_process";
5406
5430
  function shouldOpen(env, isTTY, noOpen) {
@@ -7496,7 +7520,7 @@ function json(res, data) {
7496
7520
  "content-type": "application/json; charset=utf-8",
7497
7521
  "cache-control": "no-store"
7498
7522
  });
7499
- res.end(JSON.stringify(data));
7523
+ res.end(withBin(JSON.stringify(data)));
7500
7524
  }
7501
7525
  function hireFlags(params) {
7502
7526
  const num = (k) => params.get(k) ? Number(params.get(k)) : void 0;
@@ -7900,11 +7924,24 @@ var HELPS = {
7900
7924
  export: exportHelp
7901
7925
  };
7902
7926
  async function main(argv) {
7927
+ const raw = rewriteOutput();
7903
7928
  const [command, ...rest] = argv;
7904
7929
  if (!command) return portalCommand([]);
7905
7930
  if (command === "help" || command === "--help" || command === "-h") {
7906
7931
  const topic = rest[0];
7907
- process.stdout.write(topic && HELPS[topic] ? HELPS[topic] : HELP);
7932
+ if (!topic || !HELPS[topic]) {
7933
+ const name = bin();
7934
+ if (name !== "roster") {
7935
+ raw(
7936
+ `
7937
+ Run these as ${name} <command>, or install it: npm install -g @nanocollective/roster
7938
+ `
7939
+ );
7940
+ }
7941
+ raw(HELP);
7942
+ return 0;
7943
+ }
7944
+ process.stdout.write(HELPS[topic]);
7908
7945
  return 0;
7909
7946
  }
7910
7947
  const run6 = COMMANDS[command];
package/docs/commands.md CHANGED
@@ -6,6 +6,11 @@ sidebar_order: 8
6
6
 
7
7
  # Commands
8
8
 
9
+ **`roster` here means either of these.** With nothing installed, run commands through npx:
10
+ `npx @nanocollective/roster@latest upgrade`. Or install it once with
11
+ `npm install -g @nanocollective/roster` and type `roster upgrade`. When you run through npx,
12
+ the commands roster suggests are printed the npx way, so they can be pasted as they are.
13
+
9
14
  Every command that changes anything prints a plan and changes nothing unless you pass
10
15
  `--apply`. `lint`, `prompt`, `export`, `brief`, `doctor` and `fix` never change anything.
11
16
  `portal` is the exception: it is interactive, and each change there is a button you press after
@@ -144,6 +144,9 @@ member on their next run.
144
144
 
145
145
  The same road, command by command. Each prints its plan and changes nothing without `--apply`.
146
146
 
147
+ `roster` below means `npx @nanocollective/roster@latest`, unless you have installed it with
148
+ `npm install -g @nanocollective/roster`.
149
+
147
150
  ```bash
148
151
  roster init --org acme --apply # the ops repo, and its Actions access
149
152
  roster brief discover # a brief for org/business.md; write priorities.md too
package/docs/upgrading.md CHANGED
@@ -10,9 +10,9 @@ The framework writes templates out. A tenant runs its own copies. So the two dri
10
10
  `roster upgrade` is what reconciles them without eating your edits.
11
11
 
12
12
  ```bash
13
- roster upgrade # what would change
14
- roster upgrade --apply # do it
15
- roster upgrade --check # exit non-zero if anything is pending (for CI)
13
+ npx @nanocollective/roster@latest upgrade # what would change
14
+ npx @nanocollective/roster@latest upgrade --apply # do it
15
+ npx @nanocollective/roster@latest upgrade --check # exit non-zero if anything is pending (for CI)
16
16
  ```
17
17
 
18
18
  ## How it decides
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nanocollective/roster",
3
- "version": "0.1.0-alpha.20",
3
+ "version": "0.1.0-alpha.21",
4
4
  "description": "An agent-run org, powered by GitHub. Scaffold AI staff members whose brain is a repo.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -219,13 +219,9 @@ export function viewStaff(m) {
219
219
 
220
220
  box.append(el("div", { className: "planhead", textContent: "Then, on the new card" }));
221
221
  box.append(
222
- line(
223
- "todo",
224
- "GitHub App, or roster app " + s.handle + " --apply: creates it, sets its secrets, and " +
225
- "opens the install page with the repos already ticked",
226
- ),
222
+ line("todo", "Create their GitHub App, then install it on the repos it opens with ticked"),
227
223
  line("todo", "Write the charter"),
228
- line("todo", "Run once now, or roster run " + s.handle + " --apply: the run that proves the wiring"),
224
+ line("todo", "Run once now, to check everything works"),
229
225
  );
230
226
  for (const w of plan.warnings ?? []) box.append(line("warn", S.data.staff.length ? w : portalWords(w)));
231
227