@mrciphersmith/roomyx 0.1.0 → 0.2.0

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
@@ -1,12 +1,163 @@
1
1
  # roomyx
2
2
 
3
- MCP server + terminal UI for `startup-room`: live room status, chat, per-agent
4
- modal, an installable room registry, and skill-sync. See
5
- `docs/roomyx/specification.md` and `docs/roomyx-installer/specification.md`
6
- for the full architecture; this README documents only the concrete on-disk
7
- log format the tests in this package assume, since it isn't fully pinned down
8
- by the JSON Schemas alone (those describe one message and one goal contract
9
- shape, not the log file as a whole).
3
+ An MCP server and terminal UI for `startup-room`: it reads a room's append-only log and exposes what's happening in it — roster,
4
+ goal contract, transcript, per-agent detail — both to MCP clients as tools and
5
+ to a human as a live TUI. It also ships a room registry, so several rooms can
6
+ run at once and be found by id, and a skill-sync path that installs the bundled
7
+ `startup-room` skill into a project without ever silently overwriting local
8
+ edits.
9
+
10
+ roomyx is **read-only** with respect to a room log. Nothing here writes messages
11
+ into a room; the write path (`room.post_owner_command`) lives in the
12
+ `startup-room` framework, not in this package.
13
+
14
+ ## Requirements
15
+
16
+ **[Bun](https://bun.sh) 1.1 or newer must be on your `PATH`.** Both binaries are
17
+ shipped as TypeScript with a `#!/usr/bin/env bun` shebang and are executed by
18
+ Bun directly — there is no compiled or transpiled build step. Installing with
19
+ npm works fine, but the commands will not run on a machine that has only Node.
20
+
21
+ ## Install
22
+
23
+ ```bash
24
+ npm install -g @mrciphersmith/roomyx
25
+ # or
26
+ bun install -g @mrciphersmith/roomyx
27
+ ```
28
+
29
+ ## Quick start
30
+
31
+ ```bash
32
+ cd your-project
33
+ roomyx init # scaffold .roomyx/
34
+ roomyx serve path/to/room.jsonl # serve one room log over MCP
35
+ ```
36
+
37
+ `serve` prints the room's URL and its generated id:
38
+
39
+ ```
40
+ roomyx serving path/to/room.jsonl at http://127.0.0.1:4319/mcp
41
+ room ID: r-a1b2c3 — attach with `roomyx-client --room r-a1b2c3`
42
+ ```
43
+
44
+ Then, in a second terminal, attach the TUI:
45
+
46
+ ```bash
47
+ roomyx-client # auto-attaches when exactly one room is live
48
+ roomyx-client --room r-a1b2c3
49
+ ```
50
+
51
+ In the TUI: `↑`/`↓` move through the roster, `Enter` opens the selected agent's
52
+ modal, `Esc` closes it, `q` or `Ctrl-C` quits.
53
+
54
+ ## Commands
55
+
56
+ The orchestrator and the TUI are **separate binaries on purpose** — they are
57
+ independent processes, and making the TUI a subcommand of `roomyx` would tie
58
+ their lifetimes together. That is why it is `roomyx-client`, with a hyphen, and
59
+ not `roomyx client`.
60
+
61
+ ### `roomyx init`
62
+
63
+ Creates `.roomyx/` in the current directory: `config.json`, an empty room
64
+ registry, and a staged copy of the bundled `startup-room` skill. It never
65
+ clobbers a registry that already has rooms in it, and never overwrites an
66
+ existing `config.json`.
67
+
68
+ ### `roomyx serve <logPath> [flags]`
69
+
70
+ Serves one room log as an MCP server over StreamableHTTP, and registers the room
71
+ in the local registry for the duration of the process. On `SIGINT`/`SIGTERM` it
72
+ deregisters itself and shuts down cleanly.
73
+
74
+ | Flag | Default | Meaning |
75
+ | --- | --- | --- |
76
+ | `--port <n>` | `4319` | Listen port. `0` picks an ephemeral one. |
77
+ | `--host <addr>` | `127.0.0.1` | Bind address. |
78
+ | `--acknowledge-non-loopback` | off | Required to bind anything other than loopback. Without it, a non-loopback `--host` is refused. |
79
+ | `--registry <path>` | `.roomyx/rooms/registry.json` | Registry file to register into. |
80
+
81
+ Multiple independent MCP client sessions against one `serve` process are
82
+ supported: each new session gets its own transport and server instance, keyed by
83
+ `mcp-session-id`.
84
+
85
+ ### `roomyx rooms list`
86
+
87
+ Lists rooms that are **confirmed live**, not merely present in the registry —
88
+ each entry is verified with a real MCP round-trip, and entries that don't answer
89
+ are pruned from the registry file as a side effect.
90
+
91
+ ### `roomyx-client [flags]`
92
+
93
+ The terminal UI.
94
+
95
+ | Flag | Meaning |
96
+ | --- | --- |
97
+ | `--room <id>` | Attach to a specific live room by id. |
98
+ | `--connect <url>` | Attach to an explicit MCP URL. Wins outright; the registry is not consulted. |
99
+ | `--registry <path>` | Registry file to resolve rooms from. |
100
+
101
+ With no flags it auto-attaches when exactly one room is live, and refuses with a
102
+ list of candidate ids when more than one is.
103
+
104
+ ## MCP tools
105
+
106
+ ### Per-room server — `roomyx serve`
107
+
108
+ | Tool | Input | Returns |
109
+ | --- | --- | --- |
110
+ | `room.get_state` | — | Roster and current goal contract. |
111
+ | `room.get_transcript` | `since_seq: number` | Messages with `seq` greater than `since_seq`, in order. |
112
+ | `room.get_agent_detail` | `agent_id: string` | One participant's own messages and last-seen status. |
113
+
114
+ ### Management server
115
+
116
+ A second, standalone MCP server exposing the installer surface — room listing
117
+ and skill-sync — to any MCP client.
118
+
119
+ | Tool | Input | Returns |
120
+ | --- | --- | --- |
121
+ | `roomyx.rooms.list` | — | Live, liveness-checked rooms. |
122
+ | `roomyx.skills.sync` | `targetPath: string`, `dryRun?: boolean`, `yes?: boolean` | Sync outcome: whether it would write, whether it did, and where the backup went. |
123
+
124
+ This server currently has **no CLI command** — it is exposed as a library entry
125
+ point (`serveManagement` in `src/mcp-management/server.ts`) for embedding hosts
126
+ to bind.
127
+
128
+ ## Skill sync safety
129
+
130
+ `roomyx.skills.sync` will not silently discard local work. It refuses to write,
131
+ and returns a warning instead, in two cases — unless `yes: true` is passed:
132
+
133
+ - the target has changed since roomyx last synced it (hand-edited), or
134
+ - the target already exists but roomyx has **no record of ever having written
135
+ it**, so its content is not roomyx's to overwrite.
136
+
137
+ When it does write, it first copies the previous content to a timestamped
138
+ `.bak-<iso>` file alongside the target, and records the new content's hash in
139
+ `.roomyx/config.json` under `lastSyncedHashes`.
140
+
141
+ ## On-disk layout
142
+
143
+ ```
144
+ .roomyx/
145
+ ├── config.json # schemaVersion, defaultPort, roomLogDir, lastSyncedHashes
146
+ ├── rooms/
147
+ │ └── registry.json # live room registry
148
+ └── skills/
149
+ └── startup-room/SKILL.md # staged copy of the bundled skill
150
+ ```
151
+
152
+ `config.json`'s `roomLogDir` (default `.roomyx/rooms/logs`) is a convention for
153
+ where room logs are expected to live; `init` records it but does not create the
154
+ directory, and `serve` takes whatever path you hand it.
155
+
156
+ The registry is written under an exclusive lockfile and replaced by
157
+ write-to-temp-then-rename, so concurrent `serve` processes can't lose each
158
+ other's registrations or be read mid-write. A lock whose holder crashed is
159
+ reclaimed after 30 seconds, and a release only unlinks the lockfile when it
160
+ still holds the token that call wrote.
10
161
 
11
162
  ## Room log format (JSONL)
12
163
 
@@ -27,21 +178,31 @@ record; every subsequent line is a `message` record.
27
178
  - `roster` entries are `{ id, name }` — `id` is what `room.get_agent_detail`
28
179
  takes as `agent_id`; `name` is the display name used in `from`.
29
180
 
30
- This format is this package's own design choice (not dictated by either JSON
31
- Schema) — see `docs/roomyx/specification.md`'s Manifest/Config Shape section,
32
- which defers the on-disk representation to implementation.
181
+ This format is this package's own design choice, not dictated by either JSON
182
+ Schema: the specification defers the on-disk representation to implementation,
183
+ and the schemas describe one message and one goal contract, not the log file as
184
+ a whole. It is documented here because the tests in this package assume it.
33
185
 
34
- ## Install
186
+ ## Development
35
187
 
36
188
  ```bash
37
- npm install -g @mrciphersmith/roomyx
189
+ bun install
190
+ bun run check # lint + typecheck + test
38
191
  ```
39
192
 
40
- ## CLI
193
+ Releases are cut by pushing a `v*` tag whose version matches `package.json`; the
194
+ release workflow verifies, packs, smoke-tests, and publishes to npm with
195
+ provenance via trusted publishing.
41
196
 
42
- ```bash
43
- roomyx init # scaffold .roomyx/ in the current project
44
- roomyx serve <logPath> [--port N] # start an MCP server for one room log
45
- roomyx rooms list # list live rooms from the local registry
46
- roomyx client [--room <id>] # attach the terminal UI (auto-attaches if exactly one room is live)
47
- ```
197
+ ## Further reading
198
+
199
+ Full architecture and the reasoning behind each decision:
200
+
201
+ - [`docs/roomyx/specification.md`](https://github.com/MrCipherSmith/roomyx/blob/main/docs/roomyx/specification.md)
202
+ and [`docs/roomyx/decisions.md`](https://github.com/MrCipherSmith/roomyx/blob/main/docs/roomyx/decisions.md)
203
+ - [`docs/roomyx-installer/specification.md`](https://github.com/MrCipherSmith/roomyx/blob/main/docs/roomyx-installer/specification.md)
204
+ and [`docs/roomyx-installer/decisions.md`](https://github.com/MrCipherSmith/roomyx/blob/main/docs/roomyx-installer/decisions.md)
205
+
206
+ ## License
207
+
208
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrciphersmith/roomyx",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
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"
@@ -23,7 +23,8 @@
23
23
  "cli"
24
24
  ],
25
25
  "bin": {
26
- "roomyx": "./src/cli.ts"
26
+ "roomyx": "./src/cli.ts",
27
+ "roomyx-client": "./src/client/index.ts"
27
28
  },
28
29
  "files": [
29
30
  "src",
package/src/cli.ts CHANGED
@@ -6,10 +6,12 @@ import { registerRoom, deregisterRoom, listLiveRooms } from "./installer/registr
6
6
 
7
7
  /**
8
8
  * `roomyx init` / `roomyx serve <logPath> [...]` / `roomyx rooms list`.
9
- * `roomyx client [...]` is a separate entry point (src/client/index.ts) —
10
- * the orchestrator and the TUI are independent processes by design
11
- * (decisions.md D-06), so they are separate binaries, not subcommands of
12
- * one process that would tie their lifetimes together.
9
+ * The TUI is `roomyx-client`, its own binary over src/client/index.ts — the
10
+ * orchestrator and the TUI are independent processes by design (decisions.md
11
+ * D-06), so they are separate binaries, not subcommands of one process that
12
+ * would tie their lifetimes together. Hence the hyphen: `roomyx client`
13
+ * would have to be dispatched from here, which is exactly the coupling D-06
14
+ * rules out.
13
15
  */
14
16
 
15
17
  function parseFlags(args: string[]): Record<string, string | boolean> {
@@ -56,7 +58,7 @@ async function runServe(logPath: string | undefined, rest: string[]): Promise<vo
56
58
  const entry = registerRoom(registryPath, { port: handle.port, logPath, pid: process.pid });
57
59
 
58
60
  console.log(`roomyx serving ${logPath} at ${handle.url}`);
59
- console.log(`room ID: ${entry.id} — attach with \`roomyx client --room ${entry.id}\``);
61
+ console.log(`room ID: ${entry.id} — attach with \`roomyx-client --room ${entry.id}\``);
60
62
 
61
63
  const shutdown = () => {
62
64
  deregisterRoom(registryPath, entry.id);
@@ -88,6 +90,7 @@ async function main(): Promise<void> {
88
90
  await runRoomsList();
89
91
  } else {
90
92
  console.error("Usage: roomyx <init|serve <logPath>|rooms list>");
93
+ console.error("The terminal UI is a separate binary: roomyx-client [--room <id>]");
91
94
  process.exit(1);
92
95
  }
93
96
  }
@@ -15,7 +15,7 @@ function urlFor(room: RoomRegistryEntry): string {
15
15
  }
16
16
 
17
17
  /**
18
- * Decides which roomyx server `roomyx client` should connect to.
18
+ * Decides which roomyx server `roomyx-client` should connect to.
19
19
  * `--connect` always wins outright (explicit URL, registry not consulted).
20
20
  * `--room <id>` looks up that specific room among the LIVE ones (a
21
21
  * registered-but-dead id is treated the same as unknown, not a stale