@mrciphersmith/roomyx 0.11.0 → 0.11.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.
package/CHANGELOG.md CHANGED
@@ -13,6 +13,34 @@ patch and never a minor. The rule, the reason, and an audit of the four of seven
13
13
  releases that followed it are in
14
14
  [`docs/roomyx/versioning.md`](docs/roomyx/versioning.md) and decision D-13.
15
15
 
16
+ ## [0.11.1] — 2026-09-10
17
+
18
+ ### Added
19
+
20
+ - **`roomyx setup`** — the machine-wide half of `roomyx init`, for when there is
21
+ no project yet. Same picker, narrowed to the rows that land on the machine
22
+ (the skill for each runtime, and the persona library under `~/.roomyx`), and
23
+ it writes nothing into the working directory. This is what to run straight
24
+ after installing from npm: an npm lifecycle script cannot ask, because npm
25
+ runs one with no terminal in CI, `npm ci` and Docker, and skips it entirely
26
+ under `--ignore-scripts`.
27
+ - The persona library is ticked in `setup` and unticked in `init`, and the
28
+ difference is the point: in a project the machine-wide copy duplicates one the
29
+ project already gets and the skill prefers, but `setup` has no project copy to
30
+ fall back on.
31
+
32
+ ### Fixed
33
+
34
+ - **`done` on a plan item meant two things at once.** It meant "already
35
+ installed", and also carried the persona file count — so a caller asking "is
36
+ this already there?" read `87 files` as yes. `roomyx setup` was that caller,
37
+ and it silently stopped ticking the persona library. The count moved to
38
+ `detail`, where a description belongs.
39
+ - **`buildPlan({ home })` was honoured by the persona rows and ignored by the
40
+ skill rows**, which read `homedir()` inside the runtime table. A test
41
+ asserting "nothing here lands outside this directory" was passing against the
42
+ real `~`. The home is a parameter now, and the test means what it says.
43
+
16
44
  ## [0.11.0] — 2026-09-10
17
45
 
18
46
  A minor, for the reason D-13 gives: `room.get_state` now returns a **changed
package/README.md CHANGED
@@ -195,6 +195,24 @@ are pruned from the registry file as a side effect. A pruned room is also
195
195
  recorded in the history index at that moment — for a room that crashed, this is
196
196
  the only point at which anything notices it ended.
197
197
 
198
+ ### `roomyx setup [flags]`
199
+
200
+ Sets the **machine** up, without touching the current project: the same picker
201
+ `roomyx init` shows, narrowed to the rows that land under your home directory —
202
+ the skill for each agent runtime you use, and the persona library in
203
+ `~/.roomyx/personas`. Nothing is created in the working directory.
204
+
205
+ This is what to run right after `npm install -g @mrciphersmith/roomyx`. An npm
206
+ lifecycle script cannot ask instead: npm runs one with no terminal (CI,
207
+ `npm ci`, Docker builds), skips it entirely under `--ignore-scripts`, re-runs it
208
+ on every `npm update`, and under `npm i -g` may run it as a different user. A
209
+ prompt there either hangs the install or never happens — and a postinstall
210
+ writing into `~/.claude` is exactly what supply-chain hardening exists to stop.
211
+
212
+ | Flag | Meaning |
213
+ | --- | --- |
214
+ | `--yes` | Apply the default selection without asking. |
215
+
198
216
  ### `roomyx personas [flags]`
199
217
 
200
218
  Installs the bundled persona library into `.roomyx/personas/`. `roomyx init`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrciphersmith/roomyx",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "description": "MCP server + terminal UI for startup-room: live room status, chat, per-agent modal, an installable room registry, and skill-sync.",
5
5
  "publishConfig": {
6
6
  "access": "public"
package/src/cli.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env bun
2
- import { existsSync, readFileSync } from "node:fs";
2
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
3
3
  import { homedir } from "node:os";
4
4
  import { join, resolve } from "node:path";
5
5
  import { serve } from "./server/serve";
@@ -535,6 +535,77 @@ const COMMANDS: Record<string, Command> = {
535
535
  },
536
536
  },
537
537
 
538
+ setup: {
539
+ usage: "roomyx setup [flags]",
540
+ summary: "set this machine up, without touching the current project",
541
+ notes:
542
+ "The same picker `roomyx init` shows, narrowed to the rows that land on\n the machine: the skill for each agent runtime you use, and the persona\n library under ~/.roomyx. Nothing is created in the current directory, so\n this is what to run right after installing from npm — an npm lifecycle\n script cannot ask, because npm runs one with no terminal (CI, `npm ci`,\n Docker) and skips it entirely under --ignore-scripts.",
543
+ flags: {
544
+ yes: { type: "boolean", describe: "Apply the default selection without asking" },
545
+ },
546
+ run: async ({ flags }) => {
547
+ const home = homedir();
548
+ const cwd = process.cwd();
549
+ // Its own config, under the home directory: `syncSkill` records the hash
550
+ // of what it wrote so a later sync can tell "unchanged since we wrote it"
551
+ // from "edited by someone", and a machine-wide install has no project
552
+ // config to record into. Created here rather than demanded, because the
553
+ // whole point of this command is that there is no project yet.
554
+ const configPath = join(home, ".roomyx", "config.json");
555
+ if (!existsSync(configPath)) {
556
+ mkdirSync(join(home, ".roomyx"), { recursive: true });
557
+ writeFileSync(configPath, JSON.stringify({ schemaVersion: 1 }, null, 2));
558
+ }
559
+
560
+ const { buildPlan, machineItems, selectedItems } = await import("./installer/init-plan");
561
+ const { applyPlan } = await import("./installer/init-apply");
562
+ const plan = machineItems(buildPlan({ cwd, personaFiles: personaCount(bundledPersonasPath()) }));
563
+ // Ticked here, unticked in `init`, and the difference is the point. In a
564
+ // project the machine-wide library is a second copy of one the project
565
+ // already gets and the skill prefers. Here there is no project copy — so
566
+ // leaving it off would set a machine up with a skill that casts its room
567
+ // from personas that are nowhere on disk, which is the unfinished
568
+ // installer this whole command exists to avoid.
569
+ for (const item of plan) {
570
+ if (item.id === "personas:user" && item.done === undefined) item.selected = true;
571
+ }
572
+
573
+ const interactive = process.stdout.isTTY === true && process.stdin.isTTY === true;
574
+ if (!interactive && flags.yes !== true) {
575
+ console.log("Not a terminal, so nothing was asked and nothing was written.");
576
+ console.log(" roomyx setup --yes # the default selection, no prompt");
577
+ return;
578
+ }
579
+
580
+ let chosen = plan;
581
+ if (flags.yes !== true) {
582
+ const { runInitPicker } = await import("./client/init-screen");
583
+ const picked = await runInitPicker(plan);
584
+ if (picked === null) {
585
+ console.log("Cancelled — nothing was written.");
586
+ return;
587
+ }
588
+ chosen = picked;
589
+ }
590
+
591
+ const results = applyPlan(selectedItems(chosen), {
592
+ cwd,
593
+ bundledSkillPath: bundledSkillPath(),
594
+ bundledPersonasPath: bundledPersonasPath(),
595
+ configPath,
596
+ });
597
+
598
+ for (const line of results) {
599
+ console.log(`${line.ok ? " ok " : " !! "} ${line.label}`);
600
+ console.log(` ${line.path} — ${line.message}`);
601
+ }
602
+ if (results.some((line) => line.ok)) {
603
+ console.log("\nRestart your agent — skills are discovered at startup.");
604
+ }
605
+ console.log("\nNext, in a project: roomyx init");
606
+ },
607
+ },
608
+
538
609
  personas: {
539
610
  usage: "roomyx personas [flags]",
540
611
  summary: "install the bundled persona library into this project",
@@ -25,6 +25,14 @@ export interface PlanItem {
25
25
  readonly kind: PlanItemKind;
26
26
  /** Heading this item is listed under. */
27
27
  readonly group: string;
28
+ /**
29
+ * Whether this lands on the machine or in the project.
30
+ *
31
+ * Carried as data rather than inferred from the group, because `roomyx setup`
32
+ * selects on it: the group is what the row is printed under, and inferring a
33
+ * behavioural rule from a display string is how the two drift apart.
34
+ */
35
+ readonly scope: "user" | "project";
28
36
  readonly label: string;
29
37
  /** Where it actually lands on disk. What `init-apply` acts on. */
30
38
  readonly path: string;
@@ -66,18 +74,20 @@ export interface PlanContext {
66
74
  export function buildPlan(context: PlanContext): PlanItem[] {
67
75
  const { cwd } = context;
68
76
  const exists = context.exists ?? existsSync;
77
+ const home = context.home ?? homedir();
69
78
  const items: PlanItem[] = [];
70
79
 
71
80
  for (const runtime of SKILL_RUNTIMES) {
72
- const path = runtime.path(cwd);
81
+ const path = runtime.path(cwd, home);
73
82
  // Presence of the runtime's own directory, not of our skill: this decides
74
83
  // whether to *offer it ticked*, never whether to offer it at all. A runtime
75
84
  // installed after roomyx would otherwise be unreachable.
76
- const present = exists(runtime.marker(cwd));
85
+ const present = exists(runtime.marker(cwd, home));
77
86
  items.push({
78
87
  id: `skill:${runtime.name}`,
79
88
  kind: "skill",
80
89
  group: runtime.scope === "user" ? GROUP_USER : GROUP_PROJECT,
90
+ scope: runtime.scope,
81
91
  label: runtime.label,
82
92
  path,
83
93
  detail: path,
@@ -93,8 +103,8 @@ export function buildPlan(context: PlanContext): PlanItem[] {
93
103
  // the machine, including throwaway ones. The skill prefers the project copy
94
104
  // and falls back to the home one, which is the order every runtime already
95
105
  // uses for skills.
96
- const homeDir = context.home ?? homedir();
97
- const personaScopes: [string, string, string, boolean][] = [
106
+ const homeDir = home;
107
+ const personaScopes: [string, string, string, boolean, "user" | "project"][] = [
98
108
  [
99
109
  "personas:user",
100
110
  "For every project",
@@ -104,24 +114,28 @@ export function buildPlan(context: PlanContext): PlanItem[] {
104
114
  // directory is convenience, and 87 files appearing in a directory the
105
115
  // operator did not know existed is the surprise the tick rule forbids.
106
116
  false,
117
+ "user",
107
118
  ],
108
- ["personas:project", "In this project", join(cwd, ".roomyx", "personas"), true],
119
+ ["personas:project", "In this project", join(cwd, ".roomyx", "personas"), true, "project"],
109
120
  ];
110
121
 
111
- for (const [id, label, path, ticked] of personaScopes) {
122
+ for (const [id, label, path, ticked, scope] of personaScopes) {
112
123
  items.push({
113
124
  id,
114
125
  kind: "personas",
115
126
  group: GROUP_PERSONAS,
127
+ scope,
116
128
  label,
117
129
  path,
118
- detail: path,
130
+ // The file count belongs to the description of the target, not to
131
+ // `done`. It lived in `done` for one release and made that field mean
132
+ // two things — "already satisfied" and "here is how big this is" — so a
133
+ // caller asking "is this already installed?" got "87 files" and read it
134
+ // as yes. `roomyx setup` was that caller, and it silently stopped
135
+ // ticking the library.
136
+ detail: context.personaFiles === undefined ? path : `${path} (${context.personaFiles} files)`,
119
137
  selected: ticked && !exists(path),
120
- done: exists(path)
121
- ? "already there — existing files are kept"
122
- : context.personaFiles === undefined
123
- ? undefined
124
- : `${context.personaFiles} files`,
138
+ done: exists(path) ? "already there — existing files are kept" : undefined,
125
139
  });
126
140
  }
127
141
 
@@ -130,6 +144,7 @@ export function buildPlan(context: PlanContext): PlanItem[] {
130
144
  id: "logs",
131
145
  kind: "logs",
132
146
  group: GROUP_EXTRAS,
147
+ scope: "project",
133
148
  label: "Room-log directory",
134
149
  path: logsDir,
135
150
  detail: logsDir,
@@ -145,6 +160,7 @@ export function buildPlan(context: PlanContext): PlanItem[] {
145
160
  id: "gitignore",
146
161
  kind: "gitignore",
147
162
  group: GROUP_EXTRAS,
163
+ scope: "project",
148
164
  label: "Ignore registry, lockfiles",
149
165
  path: join(cwd, ".gitignore"),
150
166
  // The registry holds pids and ports of processes on *this* machine, and the
@@ -163,6 +179,7 @@ export function buildPlan(context: PlanContext): PlanItem[] {
163
179
  id,
164
180
  kind: "mcp",
165
181
  group: GROUP_EXTRAS,
182
+ scope: "project",
166
183
  label,
167
184
  path,
168
185
  detail: path,
@@ -188,3 +205,11 @@ function mcpTargets(cwd: string): [string, string, string][] {
188
205
  export function selectedItems(items: readonly PlanItem[]): PlanItem[] {
189
206
  return items.filter((item) => item.selected);
190
207
  }
208
+
209
+ /**
210
+ * The rows that land on the machine rather than in a project — what
211
+ * `roomyx setup` offers when there is no project to set up.
212
+ */
213
+ export function machineItems(items: readonly PlanItem[]): PlanItem[] {
214
+ return items.filter((item) => item.scope === "user");
215
+ }
@@ -24,14 +24,22 @@ export interface SkillRuntime {
24
24
  /** How to say it to a person. */
25
25
  readonly label: string;
26
26
  readonly scope: "user" | "project";
27
- /** Where the SKILL.md goes. */
28
- readonly path: (cwd: string) => string;
27
+ /**
28
+ * Where the SKILL.md goes.
29
+ *
30
+ * `home` is a parameter rather than a call to `homedir()` inside, so a test
31
+ * can build a plan against a temporary home. It was read from the process
32
+ * before, which meant `buildPlan({ home })` honoured the persona rows and
33
+ * silently ignored the skill ones — a test asserting "nothing lands outside
34
+ * this directory" was passing against the real `~`.
35
+ */
36
+ readonly path: (cwd: string, home?: string) => string;
29
37
  /**
30
38
  * The directory whose existence means this runtime is in use here. Used only
31
39
  * to pre-tick sensible boxes in `roomyx init` — never to refuse a target,
32
40
  * because a runtime installed after roomyx would then be unreachable.
33
41
  */
34
- readonly marker: (cwd: string) => string;
42
+ readonly marker: (cwd: string, home?: string) => string;
35
43
  }
36
44
 
37
45
  const SKILL_FILE = ["skills", "startup-room", "SKILL.md"] as const;
@@ -41,8 +49,8 @@ function userRuntime(name: string, label: string, dir: string): SkillRuntime {
41
49
  name,
42
50
  label,
43
51
  scope: "user",
44
- path: () => join(homedir(), dir, ...SKILL_FILE),
45
- marker: () => join(homedir(), dir),
52
+ path: (_cwd, home) => join(home ?? homedir(), dir, ...SKILL_FILE),
53
+ marker: (_cwd, home) => join(home ?? homedir(), dir),
46
54
  };
47
55
  }
48
56