@mrciphersmith/roomyx 0.11.0 → 0.11.2

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,87 @@ 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.2] — 2026-09-11
17
+
18
+ A patch. The bundled skill had drifted behind the server it drives, and the
19
+ symptom was visible from the outside: a room that gets created, then waits for a
20
+ second command to be populated, then retells itself into the chat.
21
+
22
+ ### Fixed
23
+
24
+ - **The skill no longer narrates the room into the conversation.** Step 5 of the
25
+ turn loop ordered a report after essentially every substantive exchange, with
26
+ quotes. That was right when a chat message was the only way to see a room.
27
+ roomyx exists now: the owner watches the transcript live, with scrolling,
28
+ search and per-participant filtering, so the retelling is the same text twice
29
+ on top of whatever else that conversation was for. Appending the turn to the
30
+ log *is* the report. Three things still reach the chat, one line each — goal
31
+ met, stuck and needs an owner decision, participant lost — plus a full answer
32
+ whenever the owner asks for status.
33
+ - **Setup is one uninterrupted sequence.** It used to create the log and then
34
+ wait to be told to populate it, turning one instruction into three and leaving
35
+ a room that exists but is empty. It now casts the room and hands back the room
36
+ ID and the attach command as its whole reply.
37
+ - **The skill names the tools this project built for it.** It mentioned
38
+ `room.post_owner_command` once and `room.get_delta_for`,
39
+ `room.get_pending_owner_commands` and `room.ack_owner_command` not at all, so
40
+ the delta was re-derived by hand on every turn and an owner command posted
41
+ from the TUI went into a queue nobody was told to read. Nothing failed — a
42
+ stale skill still produces a working room, just a worse one, which is why it
43
+ went unnoticed.
44
+ - **`roomyx serve` no longer passes an argument that was always discarded.**
45
+ `writerLeasePath` was computed on every start, and `serve()` takes the lease
46
+ only when an `onOwnerCommand` callback is present — which the CLI never
47
+ supplies. It read like a lease was being taken and none ever was.
48
+
49
+ ### Added
50
+
51
+ - **The dispatcher may be a background subagent**, so a room stops occupying the
52
+ chat for as long as it runs. Verified rather than assumed: a subagent has the
53
+ `Agent` tool loaded, can reach `SendMessage`, and a nested spawn was confirmed
54
+ to work.
55
+ - **A test pins the skill against the server**: the four dispatcher-facing tools
56
+ must be named, and the hand-composed delta and the per-exchange chat report
57
+ must stay gone.
58
+
59
+ ### Known, recorded rather than fixed
60
+
61
+ There are two dispatcher models and only one is expressible. An embedder
62
+ dispatches in-process and can hold the writer lease; an *agent* dispatches by
63
+ running `roomyx serve` and writing with `roomyx room append`, a different
64
+ process each time. Making the CLI declare a dispatcher was tried and reverted:
65
+ the lease would sit with the server while the writer is elsewhere, so the
66
+ dispatcher would be refused from its own room. Until that is decided, the D-18
67
+ writer guard does not engage for the agent workflow.
68
+
69
+ ## [0.11.1] — 2026-09-10
70
+
71
+ ### Added
72
+
73
+ - **`roomyx setup`** — the machine-wide half of `roomyx init`, for when there is
74
+ no project yet. Same picker, narrowed to the rows that land on the machine
75
+ (the skill for each runtime, and the persona library under `~/.roomyx`), and
76
+ it writes nothing into the working directory. This is what to run straight
77
+ after installing from npm: an npm lifecycle script cannot ask, because npm
78
+ runs one with no terminal in CI, `npm ci` and Docker, and skips it entirely
79
+ under `--ignore-scripts`.
80
+ - The persona library is ticked in `setup` and unticked in `init`, and the
81
+ difference is the point: in a project the machine-wide copy duplicates one the
82
+ project already gets and the skill prefers, but `setup` has no project copy to
83
+ fall back on.
84
+
85
+ ### Fixed
86
+
87
+ - **`done` on a plan item meant two things at once.** It meant "already
88
+ installed", and also carried the persona file count — so a caller asking "is
89
+ this already there?" read `87 files` as yes. `roomyx setup` was that caller,
90
+ and it silently stopped ticking the persona library. The count moved to
91
+ `detail`, where a description belongs.
92
+ - **`buildPlan({ home })` was honoured by the persona rows and ignored by the
93
+ skill rows**, which read `homedir()` inside the runtime table. A test
94
+ asserting "nothing here lands outside this directory" was passing against the
95
+ real `~`. The home is a parameter now, and the test means what it says.
96
+
16
97
  ## [0.11.0] — 2026-09-10
17
98
 
18
99
  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.2",
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"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: startup-room
3
- description: Runs a persistent multi-persona discussion/brainstorm room cheaply — each persona is spawned once as a named subagent and kept alive across turns via SendMessage (so it remembers its own history instead of re-reading the whole transcript every time), every message is broadcast to every participant (not just @-addressed ones), participants self-moderate against tunneling too deep into one narrow thread, and the full dialogue is logged verbatim to a shared markdown file the participants never write to directly. The room is goal-driven, not round-driven: it runs until an explicit, measurable goal is met (by default, for startup-idea rooms: find an idea, score it against a 50-criteria rubric, and reach participant convergence) or the owner stops it — not until some fixed number of turns has elapsed. Use whenever the user wants several persona/character subagents (founders, experts, interview personas, judges) to discuss, debate, brainstorm, or interview each other over multiple rounds toward a concrete goal, especially when they've asked for this to be done without burning tokens by re-pasting the whole conversation into a fresh agent each round.
3
+ description: Runs a persistent multi-persona discussion/brainstorm room cheaply — each persona is spawned once as a named subagent and kept alive across turns via SendMessage (so it remembers its own history instead of re-reading the whole transcript every time), every message is broadcast to every participant (not just @-addressed ones), participants self-moderate against tunneling too deep into one narrow thread, and the full dialogue is logged verbatim to a shared append-only log the participants never write to directly. The room is goal-driven, not round-driven: it runs until an explicit, measurable goal is met (by default, for startup-idea rooms: find an idea, score it against a 50-criteria rubric, and reach participant convergence) or the owner stops it — not until some fixed number of turns has elapsed. Use whenever the user wants several persona/character subagents (founders, experts, interview personas, judges) to discuss, debate, brainstorm, or interview each other over multiple rounds toward a concrete goal, especially when they've asked for this to be done without burning tokens by re-pasting the whole conversation into a fresh agent each round.
4
4
  ---
5
5
 
6
6
  # Startup Room
@@ -24,6 +24,16 @@ The room is **goal-driven, not round-driven**: there is no fixed number of round
24
24
  ## Roles in this pattern
25
25
 
26
26
  - **The dispatcher** — you (the orchestrating Claude instance). Your job is transport, not judgment: relay deltas, append to the log, spawn new participants when told to. You never let participants write to the shared log file themselves; you are the only writer. This is a deliberate safety choice: it guarantees nothing gets deleted or corrupted by a subagent, and it lets you enforce formatting and catch a participant going off the rails before it's committed to the record. See **Dispatcher discipline** below — this role is narrower than it sounds, and it is easy to accidentally overstep it.
27
+ **The dispatcher can be a background subagent rather than the main
28
+ conversation, and usually should be.** A room run by the main agent occupies
29
+ the chat for as long as it lasts; run as a subagent it occupies nothing, and
30
+ the owner watches the room in the TUI while the conversation stays theirs.
31
+ This was verified rather than assumed: a subagent has the `Agent` tool loaded
32
+ and can reach `SendMessage`, so it can cast participants and drive them
33
+ exactly as the main agent would, and a nested spawn was confirmed to work.
34
+ The main agent then does only three things — spawn the dispatcher, relay the
35
+ attach command, and pass on any instruction the owner types in chat.
36
+
27
37
  - **The participants** — one persistent named subagent per persona. They decide everything substantive: what to research, whether an idea is good, when to pivot, who should speak next, when to converge. This is the actual point of the room — if you (the dispatcher) are making these calls instead of them, the room has stopped being a room.
28
38
  - **The session owner** — the human running the session. They can inject an instruction at any point (a veto, a new constraint, a topic to explore, a request to add participants, a reminder like "we're a small startup"). See **The owner-injection channel** below for how this differs from a participant's suggestion.
29
39
  - **The log file** — a single markdown file (e.g. `<project>/brainstorm/<topic>-room.md`) that is the append-only source of truth for the whole session.
@@ -50,7 +60,7 @@ The session owner is not a participant, and their messages are not "just another
50
60
  - **Requests to add participants** are handled via the mid-session spawn pattern below.
51
61
  - **The owner can edit the goal contract itself** (tighten/loosen the threshold, add a "must also" criterion, change the goal entirely) — this is a goal-injection, distinct from a veto on content. Relay it to the room as an authoritative update to what "done" means, and re-run the scoring/convergence check under the new terms if a candidate was already mid-evaluation.
52
62
  - **Status requests ("what's happening in the room?") get a real status, not a decision.** Report what's been found, who's arguing what, what's still open — do not use the opportunity to steer. If the owner explicitly asks "which should we pursue," that's their call to make (possibly by asking the room, via you), not yours to answer.
53
- - **Owner instructions may also arrive over roomyx.** If you started a room server and attached a dispatcher handler to it, a veto / constraint / add-participant / goal-edit posted through `room.post_owner_command` is an owner injection exactly like one typed in chat — same standing authority, same handling as above. It reaches you as a command to act on; roomyx itself never writes to the log.
63
+ - **Owner instructions also arrive over roomyx, and you have to look.** The owner presses `o` in the TUI and posts a veto / constraint / add-participant / goal-edit; it goes into the room's queue and `room.post_owner_command` answers `queued`. Nothing pushes it to you. **Poll `room.get_pending_owner_commands` between turns** — every turn is cheap and right — and call `room.ack_owner_command` with the id once you have acted, so `pending` keeps meaning "not yet dealt with" instead of growing forever. A queued command carries exactly the standing authority of one typed in chat. roomyx itself never writes to the log; you do.
54
64
  - **Do not ask the owner "what should we do next" as your default move.** Once the room's goal is set, keep it running and report status; only surface a genuine fork to the owner if it's a decision only they can make (scope, budget, willingness to accept a risk) — not a decision participants should be making themselves.
55
65
 
56
66
  ## Mid-session participant addition
@@ -101,6 +111,21 @@ When the owner says "save this idea" (or a candidate clearly survives enough rou
101
111
 
102
112
  ## Setup
103
113
 
114
+ **Do the whole of this in one go, and do not stop to ask.** Casting the room is
115
+ not a decision the owner needs to confirm a second time — "start a room about X"
116
+ already said it. A setup that creates the log, then waits to be told to populate
117
+ it, then waits again to be told to start, turns one instruction into three and
118
+ leaves a room that exists but is empty. Pick the participants yourself from the
119
+ goal, spawn them, and hand back the attach command.
120
+
121
+ Ask only if the goal itself is missing or contradictory — a room with nothing to
122
+ converge on is the one thing worth a question.
123
+
124
+ **What to hand back, as the whole of your reply:** the room ID and
125
+ `roomyx-client --room <id>`, plus one line naming who is in the room. Not the
126
+ opening contributions — those are in the room, which is what the attach command
127
+ is for.
128
+
104
129
  1. Identify the persona profile files to use. **roomyx ships a library — install it with `roomyx personas`.** Look in `.roomyx/personas/` first and fall back to `~/.roomyx/personas/`; a project copy overrides the machine-wide one, the same order every runtime uses for skills. Either directory holds: fifty numbered interview personas (ordinary people in ordinary jobs, one per file), plus `founders/`, `tech/` and `panel/` for founder, engineering and judging roles, plus `questionnaire-50.md`, a fifty-question interview script for use with any of them. Pick a subset that fits the room's goal — a room does not need fifty voices, it needs the right three to six. If the project keeps its own profiles instead, use those; each profile should be a neutral biography/expertise sheet with no pre-baked opinions or conclusions.
105
130
  2. Write the **goal contract** (see above): goal statement, success criteria (default to the 50-criteria rubric for a startup-idea room), and the convergence requirement.
106
131
  3. Create the log. **If roomyx is available, create it with `roomyx room new` (JSONL) — see below.** Otherwise create a markdown file with a header: the goal contract in full (not just a one-line goal — include the criteria/threshold so anyone reading the log later can check whether it was actually met), list of participants (name + one-line role), and the ground rule that only the moderator writes to it.
@@ -209,10 +234,16 @@ Capture the `agentId` (or assigned name) returned by each spawn — this is what
209
234
  For each subsequent turn:
210
235
 
211
236
  1. Decide whose turn it is. Options: round-robin, or reactive (whoever was just @-mentioned or most directly challenged goes next), or "whoever has something to add" if you asked participants to signal that. Mix these — a real room isn't strictly round-robin.
212
- 2. Compose the delta: only the messages posted since that participant's last turn (typically: everything since you last messaged them). Do not re-paste anything they already said or already received — they remember it.
237
+ 2. Get the delta from the room, do not compose it: `room.get_delta_for` with the participant's id returns exactly the messages they have not seen, and reports `since_seq` and `cursor_from` so an empty delta is distinguishable from a wrong cursor. This arithmetic used to be re-derived in the dispatcher's own context on every turn; it was moved into the server precisely so the dispatcher stops carrying it. Without roomyx, compose it by hand: everything since that participant last spoke, minus their own words — they remember those.
213
238
  3. Send it via `SendMessage` to their `agentId`/name, with a short prompt: "Here's what's happened since your last turn: [delta]. Your turn — react, build, refute, research, or pass."
214
239
  4. Append their reply verbatim to the log file, prefixed with their name.
215
- 5. Report to the session owner after essentially every substantive exchange, not just every few turns — in practice, "frequent" means after each participant's reply that adds something new, not on a fixed cadence. Use real quotes from the transcript, not paraphrases, so the owner can judge the room's reasoning quality directly. If the owner has explicitly asked for frequent updates, treat that as the floor, not a suggestion to pace yourself against.
240
+ 5. **Do not narrate the room into the chat.** Appending the turn to the log *is* the report: the owner is watching the room in `roomyx-client`, where they get the transcript live, with scrolling, search and per-participant filtering — everything a chat retelling would flatten. Duplicating it into the chat is not extra service, it is the same text twice, and it buries whatever else the owner was using that conversation for.
241
+
242
+ This instruction used to say the opposite — report after essentially every substantive exchange, with quotes. That was right when a chat message was the only way the owner could see anything. It is wrong now, and re-reading the room into the chat is the single most common complaint about how this skill runs.
243
+
244
+ Without roomyx there is no live view, so fall back to the old behaviour: summarise into the chat, with real quotes rather than paraphrase.
245
+
246
+ What still goes to the chat, in one line each and nowhere near every turn: the room reached its goal, the room is stuck and needs a decision only the owner can make, or a participant died and could not be replaced. Status on request is always fine — if the owner asks what is happening, answer fully.
216
247
 
217
248
  **Mechanical note:** `SendMessage` to a previously-spawned agent runs it in the background and returns immediately; the agent's reply arrives later as a separate task-notification event, not as this tool call's return value. Don't block waiting for it — end your turn, and act on the reply when the notification arrives. Multiple participants can be messaged in parallel this way; their replies will arrive as separate notifications, in whatever order they finish.
218
249
 
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";
@@ -475,7 +475,22 @@ const COMMANDS: Record<string, Command> = {
475
475
  port: typeof flags.port === "number" ? flags.port : undefined,
476
476
  host: typeof flags.host === "string" ? flags.host : undefined,
477
477
  acknowledgeNonLoopback: flags["acknowledge-non-loopback"] === true,
478
- writerLeasePath: writerLeasePathFor(resolve(registryPath), absoluteLogPath),
478
+ // No `writerLeasePath`, deliberately, and this is worth stating because
479
+ // it was passed here and silently discarded on every serve.
480
+ //
481
+ // `serve()` takes the lease only when a dispatcher is attached, and
482
+ // "attached" means an *embedder* supplied an `onOwnerCommand` callback.
483
+ // `roomyx serve` never supplies one — an agent dispatcher has no
484
+ // callback to give; it reads `room.get_pending_owner_commands` instead.
485
+ // So the argument could never be used, while reading like a lease was
486
+ // being taken.
487
+ //
488
+ // Making the CLI declare a dispatcher was tried and is WRONG: the lease
489
+ // would be held by the server process, while the writer is the agent
490
+ // running `roomyx room append` in a different process each time — so
491
+ // the dispatcher would be locked out of its own room. Two dispatcher
492
+ // models exist (embedder writes in-process; agent writes by CLI) and
493
+ // only the first is expressible today. Recorded rather than patched.
479
494
  });
480
495
 
481
496
  const entry = registerRoom(registryPath, {
@@ -535,6 +550,77 @@ const COMMANDS: Record<string, Command> = {
535
550
  },
536
551
  },
537
552
 
553
+ setup: {
554
+ usage: "roomyx setup [flags]",
555
+ summary: "set this machine up, without touching the current project",
556
+ notes:
557
+ "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.",
558
+ flags: {
559
+ yes: { type: "boolean", describe: "Apply the default selection without asking" },
560
+ },
561
+ run: async ({ flags }) => {
562
+ const home = homedir();
563
+ const cwd = process.cwd();
564
+ // Its own config, under the home directory: `syncSkill` records the hash
565
+ // of what it wrote so a later sync can tell "unchanged since we wrote it"
566
+ // from "edited by someone", and a machine-wide install has no project
567
+ // config to record into. Created here rather than demanded, because the
568
+ // whole point of this command is that there is no project yet.
569
+ const configPath = join(home, ".roomyx", "config.json");
570
+ if (!existsSync(configPath)) {
571
+ mkdirSync(join(home, ".roomyx"), { recursive: true });
572
+ writeFileSync(configPath, JSON.stringify({ schemaVersion: 1 }, null, 2));
573
+ }
574
+
575
+ const { buildPlan, machineItems, selectedItems } = await import("./installer/init-plan");
576
+ const { applyPlan } = await import("./installer/init-apply");
577
+ const plan = machineItems(buildPlan({ cwd, personaFiles: personaCount(bundledPersonasPath()) }));
578
+ // Ticked here, unticked in `init`, and the difference is the point. In a
579
+ // project the machine-wide library is a second copy of one the project
580
+ // already gets and the skill prefers. Here there is no project copy — so
581
+ // leaving it off would set a machine up with a skill that casts its room
582
+ // from personas that are nowhere on disk, which is the unfinished
583
+ // installer this whole command exists to avoid.
584
+ for (const item of plan) {
585
+ if (item.id === "personas:user" && item.done === undefined) item.selected = true;
586
+ }
587
+
588
+ const interactive = process.stdout.isTTY === true && process.stdin.isTTY === true;
589
+ if (!interactive && flags.yes !== true) {
590
+ console.log("Not a terminal, so nothing was asked and nothing was written.");
591
+ console.log(" roomyx setup --yes # the default selection, no prompt");
592
+ return;
593
+ }
594
+
595
+ let chosen = plan;
596
+ if (flags.yes !== true) {
597
+ const { runInitPicker } = await import("./client/init-screen");
598
+ const picked = await runInitPicker(plan);
599
+ if (picked === null) {
600
+ console.log("Cancelled — nothing was written.");
601
+ return;
602
+ }
603
+ chosen = picked;
604
+ }
605
+
606
+ const results = applyPlan(selectedItems(chosen), {
607
+ cwd,
608
+ bundledSkillPath: bundledSkillPath(),
609
+ bundledPersonasPath: bundledPersonasPath(),
610
+ configPath,
611
+ });
612
+
613
+ for (const line of results) {
614
+ console.log(`${line.ok ? " ok " : " !! "} ${line.label}`);
615
+ console.log(` ${line.path} — ${line.message}`);
616
+ }
617
+ if (results.some((line) => line.ok)) {
618
+ console.log("\nRestart your agent — skills are discovered at startup.");
619
+ }
620
+ console.log("\nNext, in a project: roomyx init");
621
+ },
622
+ },
623
+
538
624
  personas: {
539
625
  usage: "roomyx personas [flags]",
540
626
  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