@mrciphersmith/roomyx 0.10.1 → 0.10.3

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,52 @@ 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.10.3] — 2026-09-10
17
+
18
+ A patch. A new read tool, and no existing response changes.
19
+
20
+ ### Added
21
+
22
+ - **`room.get_delta_for(agent_id, since_seq?)`** — what a participant has not
23
+ seen, by the convention the dispatcher used to apply by hand on every turn:
24
+ everything after that participant's own last message, excluding its own. The
25
+ rule is not new — `get_agent_detail` has always reported `lastSeenSeq` as the
26
+ maximum of an agent's own `seq` — but the cursor map and the filter were being
27
+ re-derived in a language model's context once per iteration. The answer also
28
+ reports `since_seq` and `cursor_from` (`agent-last-message` or `caller`), so an
29
+ empty delta means "nothing new" rather than "I passed the wrong cursor".
30
+
31
+ ### Notes
32
+
33
+ - **It is a candidate delta, not a delivery record.** The server cannot see a
34
+ `SendMessage`: it knows a convention about the log and nothing else. The tool's
35
+ description says so, and a test asserts that wording **as a client receives
36
+ it** over the wire, because a string assertion in the tool's own unit test
37
+ cannot see what the wire says. A dispatcher may have failed to send a delta or
38
+ sent one twice, and no field here can tell.
39
+ - Its own messages are excluded at any cursor, including an explicit `0` — an
40
+ agent does not need to be told what it said.
41
+ - Stateless: the default cursor is derived from the log on every call. A cursor
42
+ the server *stored* would belong to one server instance, and the factory behind
43
+ `serve` runs once per session (the lesson `0.10.0` paid for).
44
+
45
+ ## [0.10.2] — 2026-09-10
46
+
47
+ ### Added
48
+
49
+ - **The persona library is offered at both scopes in `roomyx init`**, under its
50
+ own heading — "For every project" (`~/.roomyx/personas`) and "In this project"
51
+ (`.roomyx/personas`) — the same machine-wide/project question the skill rows
52
+ already ask. `roomyx personas --global` is the command-line equivalent.
53
+ - **The skill now states a lookup order**: `.roomyx/personas/` first, falling
54
+ back to `~/.roomyx/personas/`. A project copy overrides the machine-wide one,
55
+ which is the order every runtime already uses for skills.
56
+
57
+ The project row is ticked by default and the machine-wide one is not: the
58
+ project copy is the one the skill prefers and the one that travels with the
59
+ repository, and eighty-seven files appearing under a home directory nobody asked
60
+ about is the surprise the default-tick rule exists to prevent.
61
+
16
62
  ## [0.10.1] — 2026-09-10
17
63
 
18
64
  A patch. The skill pointed at a persona directory that only existed in the
package/README.md CHANGED
@@ -209,12 +209,15 @@ offers the same thing as a ticked box.
209
209
  | a 50-question interview script | `questionnaire-50.md` |
210
210
 
211
211
  A room is built out of these — the `startup-room` skill casts its participants
212
- from this directory. The 50-criteria scoring rubric travels inside the skill
212
+ from this directory. It looks in `.roomyx/personas/` first and falls back to
213
+ `~/.roomyx/personas/`, so a project copy overrides the machine-wide one — the
214
+ same order every runtime uses for skills. The 50-criteria scoring rubric travels inside the skill
213
215
  itself.
214
216
 
215
217
  | Flag | Default | Meaning |
216
218
  | --- | --- | --- |
217
219
  | `--target <dir>` | `.roomyx/personas` | Where the library goes. |
220
+ | `--global` | off | Install for every project, into `~/.roomyx/personas`. |
218
221
  | `--force` | off | Replace the library, moving the existing directory aside as `.bak-<timestamp>`. |
219
222
 
220
223
  **Files that already exist are skipped, never overwritten.** They ship as
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrciphersmith/roomyx",
3
- "version": "0.10.1",
3
+ "version": "0.10.3",
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"
@@ -101,7 +101,7 @@ When the owner says "save this idea" (or a candidate clearly survives enough rou
101
101
 
102
102
  ## Setup
103
103
 
104
- 1. Identify the persona profile files to use. **roomyx ships a library — install it with `roomyx personas` and it lands in `.roomyx/personas/`:** 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.
104
+ 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
105
  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
106
  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.
107
107
  4. Decide the opening framing. If the task is "find something from scratch," say so explicitly and do NOT hand participants a pre-built brief that narrows their options — that biases the room before it starts. The criteria are the bar the eventual candidate must clear, not a hint about what kind of idea to look for.
package/src/cli.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env bun
2
2
  import { existsSync, readFileSync } from "node:fs";
3
+ import { homedir } from "node:os";
3
4
  import { join, resolve } from "node:path";
4
5
  import { serve } from "./server/serve";
5
6
  import { createServerShutdown } from "./server/shutdown";
@@ -529,13 +530,22 @@ const COMMANDS: Record<string, Command> = {
529
530
  usage: "roomyx personas [flags]",
530
531
  summary: "install the bundled persona library into this project",
531
532
  notes:
532
- "Fifty interview personas, plus founder, technical and panel roles, plus\n a fifty-question interview questionnaire. A room is built out of these —\n the startup-room skill reads them from the directory below.\n\n Files that already exist are skipped, never overwritten: a persona is a\n file you are meant to edit.",
533
+ "Fifty interview personas, plus founder, technical and panel roles, plus\n a fifty-question interview questionnaire. A room is built out of these.\n\n The skill looks in .roomyx/personas first and falls back to\n ~/.roomyx/personas, so a project copy overrides the machine-wide one.\n\n Files that already exist are skipped, never overwritten: a persona is a\n file you are meant to edit.",
533
534
  flags: {
534
535
  target: { type: "string", describe: "Directory (default .roomyx/personas)" },
536
+ global: { type: "boolean", describe: "Install for every project, into ~/.roomyx/personas" },
535
537
  force: { type: "boolean", describe: "Replace the library, moving the existing directory aside first" },
536
538
  },
537
539
  run: async ({ flags }) => {
538
- const target = typeof flags.target === "string" ? resolve(flags.target) : defaultPersonasPath();
540
+ if (typeof flags.target === "string" && flags.global === true) {
541
+ throw new ArgError("Pass either --target or --global, not both — they name different directories.");
542
+ }
543
+ const target =
544
+ typeof flags.target === "string"
545
+ ? resolve(flags.target)
546
+ : flags.global === true
547
+ ? join(homedir(), ".roomyx", "personas")
548
+ : defaultPersonasPath();
539
549
  const result = installPersonas(bundledPersonasPath(), target, { force: flags.force === true });
540
550
 
541
551
  if (result.movedAside) console.log(`Moved the previous library to ${result.movedAside}`);
@@ -1,4 +1,5 @@
1
1
  import { existsSync } from "node:fs";
2
+ import { homedir } from "node:os";
2
3
  import { join } from "node:path";
3
4
  import { SKILL_RUNTIMES } from "./skill-targets";
4
5
  import type { SkillRuntime } from "./skill-targets";
@@ -39,6 +40,7 @@ export interface PlanItem {
39
40
 
40
41
  export const GROUP_USER = "Skill — every project on this machine";
41
42
  export const GROUP_PROJECT = "Skill — this project only (travels with the repo)";
43
+ export const GROUP_PERSONAS = "Persona library — a room is cast from these";
42
44
  export const GROUP_EXTRAS = "Also";
43
45
 
44
46
  export interface PlanContext {
@@ -47,7 +49,7 @@ export interface PlanContext {
47
49
  personaFiles?: number;
48
50
  /** Injectable so the tests never look at the operator's real home directory. */
49
51
  exists?: (path: string) => boolean;
50
- /** Injectable for the same reason. */
52
+ /** Injectable so a test never writes into the operator's real home directory. */
51
53
  home?: string;
52
54
  }
53
55
 
@@ -85,24 +87,43 @@ export function buildPlan(context: PlanContext): PlanItem[] {
85
87
  });
86
88
  }
87
89
 
88
- const personasDir = join(cwd, ".roomyx", "personas");
89
- items.push({
90
- id: "personas",
91
- kind: "personas",
92
- group: GROUP_EXTRAS,
93
- label: "Persona library",
94
- path: personasDir,
95
- detail: personasDir,
96
- // A room is built out of these, and without them the skill has nothing to
97
- // cast. It lands in roomyx's own directory, so nobody is surprised to find
98
- // it, and existing files are never overwritten.
99
- selected: true,
100
- done: exists(personasDir)
101
- ? "already there — existing files are kept"
102
- : context.personaFiles === undefined
103
- ? undefined
104
- : `${context.personaFiles} files`,
105
- });
90
+ // Two scopes, the same shape as the skill rows above — and for the same
91
+ // reason. A copy in the project travels with the repository and is what a
92
+ // team shares; a copy under the home directory is there for every project on
93
+ // the machine, including throwaway ones. The skill prefers the project copy
94
+ // and falls back to the home one, which is the order every runtime already
95
+ // uses for skills.
96
+ const homeDir = context.home ?? homedir();
97
+ const personaScopes: [string, string, string, boolean][] = [
98
+ [
99
+ "personas:user",
100
+ "For every project",
101
+ join(homeDir, ".roomyx", "personas"),
102
+ // Not ticked by default. The project copy is the one the skill prefers and
103
+ // the one that travels with the repo; a second copy under the home
104
+ // directory is convenience, and 87 files appearing in a directory the
105
+ // operator did not know existed is the surprise the tick rule forbids.
106
+ false,
107
+ ],
108
+ ["personas:project", "In this project", join(cwd, ".roomyx", "personas"), true],
109
+ ];
110
+
111
+ for (const [id, label, path, ticked] of personaScopes) {
112
+ items.push({
113
+ id,
114
+ kind: "personas",
115
+ group: GROUP_PERSONAS,
116
+ label,
117
+ path,
118
+ detail: path,
119
+ 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`,
125
+ });
126
+ }
106
127
 
107
128
  const logsDir = join(cwd, ".roomyx", "rooms", "logs");
108
129
  items.push({
package/src/log/store.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { readFileSync } from "node:fs";
2
2
  import { messageLineSchema, stateLineSchema } from "./schema";
3
- import type { AgentDetail, MessageEnvelope, RoomState, RosterEntry } from "./types";
3
+ import type { AgentDelta, AgentDetail, MessageEnvelope, RoomState, RosterEntry } from "./types";
4
4
 
5
5
  /**
6
6
  * `JSON.parse`, with the one thing it never says: where.
@@ -83,6 +83,22 @@ export function getTranscript(messages: MessageEnvelope[], sinceSeq: number): Me
83
83
  return messages.filter((m) => m.seq > sinceSeq);
84
84
  }
85
85
 
86
+
87
+ /**
88
+ * The agent's own last `seq`, or 0 when it has never spoken.
89
+ *
90
+ * Extracted because two functions now need this rule and it is a *rule*, not an
91
+ * expression: "what counts as the agent's own last message" is the convention
92
+ * both `get_agent_detail` and `getAgentDelta` publish, and computing it twice
93
+ * means a change to it has to be made twice — which is how the two would come to
94
+ * disagree about what a participant has seen, silently, since both answers look
95
+ * plausible on their own.
96
+ */
97
+ function lastOwnSeq(messages: MessageEnvelope[], agentId: string): number {
98
+ const own = messages.filter((m) => m.from === agentId);
99
+ return own.length > 0 ? Math.max(...own.map((m) => m.seq)) : 0;
100
+ }
101
+
86
102
  /** A single participant's messages and last-seen seq, or an explicit not-found result. */
87
103
  export function getAgentDetail(
88
104
  messages: MessageEnvelope[],
@@ -95,6 +111,49 @@ export function getAgentDetail(
95
111
  }
96
112
 
97
113
  const own = messages.filter((m) => m.from === agentId);
98
- const lastSeenSeq = own.length > 0 ? Math.max(...own.map((m) => m.seq)) : 0;
99
- return { found: true, agent, messages: own, lastSeenSeq };
114
+ return { found: true, agent, messages: own, lastSeenSeq: lastOwnSeq(messages, agentId) };
115
+ }
116
+
117
+ /**
118
+ * The messages a participant has not seen, and the cursor that says so.
119
+ *
120
+ * This is the arithmetic the dispatcher re-derived in its own context on every
121
+ * turn — the phrase in the bundled skill is "everything since your last turn" —
122
+ * moved into the server that already knows how to compute it: `getAgentDetail`
123
+ * has always reported `lastSeenSeq` as the maximum of an agent's own `seq`.
124
+ *
125
+ * Two rules, and the second is the one that survives an explicit cursor:
126
+ *
127
+ * 1. The default cursor is that maximum, and the delta is `seq > cursor`.
128
+ * 2. Its own messages are excluded **at any cursor** — an agent does not need to
129
+ * be told what it said. With `sinceSeq: 0` this is the only rule doing work.
130
+ *
131
+ * Stateless on purpose. A cursor the server stored would belong to one server
132
+ * instance, and `serveMcpOverHttp` builds one per session (the lesson flow 005
133
+ * paid for); deriving it from the log on every call is what makes the answer
134
+ * shareable without any state at all.
135
+ *
136
+ * **What this is not:** a record of what was delivered. The convention is a
137
+ * good guess at what a participant has not seen, and a dispatcher may have
138
+ * failed to send a delta or sent one twice. `cursor_from` names which cursor was
139
+ * used so the guess is visible rather than implied.
140
+ */
141
+ export function getAgentDelta(
142
+ messages: MessageEnvelope[],
143
+ roster: RosterEntry[],
144
+ agentId: string,
145
+ sinceSeq?: number,
146
+ ): AgentDelta {
147
+ const agent = roster.find((r) => r.id === agentId);
148
+ if (!agent) return { found: false };
149
+
150
+ const since = sinceSeq ?? lastOwnSeq(messages, agentId);
151
+
152
+ return {
153
+ found: true,
154
+ agent,
155
+ messages: messages.filter((m) => m.seq > since && m.from !== agentId),
156
+ since_seq: since,
157
+ cursor_from: sinceSeq === undefined ? "agent-last-message" : "caller",
158
+ };
100
159
  }
package/src/log/types.ts CHANGED
@@ -60,6 +60,27 @@ export interface RoomState {
60
60
  dispatcherAttached?: boolean;
61
61
  }
62
62
 
63
+ /**
64
+ * What a participant has not seen, according to the convention the dispatcher
65
+ * used to apply by hand: everything after that participant's own last message,
66
+ * excluding its own.
67
+ *
68
+ * `cursor_from` is not decoration. The server knows the convention; it does
69
+ * **not** know what was delivered to anyone — a dispatcher may have failed to
70
+ * send, or sent twice — and a caller must not have to guess which of the two
71
+ * produced the cursor it is looking at.
72
+ */
73
+ export type AgentDelta =
74
+ | {
75
+ found: true;
76
+ agent: RosterEntry;
77
+ messages: MessageEnvelope[];
78
+ /** The cursor this delta was computed from. */
79
+ since_seq: number;
80
+ cursor_from: "agent-last-message" | "caller";
81
+ }
82
+ | { found: false };
83
+
63
84
  export type AgentDetail =
64
85
  | { found: true; agent: RosterEntry; messages: MessageEnvelope[]; lastSeenSeq: number }
65
86
  | { found: false };
@@ -4,6 +4,7 @@ import { getStateTool } from "./tools/get-state";
4
4
  import { OWNER_COMMAND_KINDS, OwnerCommandQueue } from "./owner-queue";
5
5
  import type { OwnerCommand, OwnerCommandEnvelope, OwnerCommandKind } from "./owner-queue";
6
6
  import { getTranscriptTool } from "./tools/get-transcript";
7
+ import { getAgentDeltaTool } from "./tools/get-agent-delta";
7
8
  import { getAgentDetailTool } from "./tools/get-agent-detail";
8
9
 
9
10
  /**
@@ -138,6 +139,36 @@ export function createRoomMcpServer(logPath: string, options: RoomMcpServerOptio
138
139
  }),
139
140
  );
140
141
 
142
+ server.registerTool(
143
+ "room.get_delta_for",
144
+ {
145
+ title: "What one participant has not seen",
146
+ description:
147
+ "Everything after that participant's own last message, excluding its own — the convention " +
148
+ "\"everything since your last turn\", computed here instead of by hand. `since_seq` overrides " +
149
+ "the convention's cursor; the answer reports the cursor used and whether it came from the " +
150
+ "participant's last message or from the caller. " +
151
+ "This is what the participant has probably not seen: the server cannot see what was actually " +
152
+ "sent to it, so treat the result as a candidate delta, not as a delivery record.",
153
+ inputSchema: {
154
+ agent_id: z.string().min(1),
155
+ since_seq: z.number().int().min(0).optional(),
156
+ },
157
+ },
158
+ async ({ agent_id, since_seq }) => ({
159
+ content: [
160
+ {
161
+ type: "text",
162
+ text: JSON.stringify(
163
+ since_seq === undefined
164
+ ? getAgentDeltaTool(logPath, agent_id)
165
+ : getAgentDeltaTool(logPath, agent_id, since_seq),
166
+ ),
167
+ },
168
+ ],
169
+ }),
170
+ );
171
+
141
172
  server.registerTool(
142
173
  "room.post_owner_command",
143
174
  {
@@ -0,0 +1,16 @@
1
+ import { getAgentDelta, loadRoomLog } from "../../log/store";
2
+ import type { AgentDelta } from "../../log/types";
3
+
4
+ /**
5
+ * MCP tool `room.get_delta_for`: what a participant has not seen, by the
6
+ * convention of "everything after its own last message". Read-only.
7
+ *
8
+ * It returns the cursor it used and where that cursor came from, so an empty
9
+ * delta means "nothing new" and not "the caller passed the wrong cursor".
10
+ */
11
+ export function getAgentDeltaTool(logPath: string, agentId: string, sinceSeq?: number): AgentDelta {
12
+ const { state, messages } = loadRoomLog(logPath);
13
+ return sinceSeq === undefined
14
+ ? getAgentDelta(messages, state.roster, agentId)
15
+ : getAgentDelta(messages, state.roster, agentId, sinceSeq);
16
+ }