@mrciphersmith/roomyx 0.8.2 → 0.9.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/CHANGELOG.md
CHANGED
|
@@ -13,6 +13,42 @@ 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.9.0] — 2026-09-10
|
|
17
|
+
|
|
18
|
+
A minor, because it is breaking: `room.get_transcript` returns an object where it
|
|
19
|
+
returned a bare array. In `0.x` the minor position is the breaking position
|
|
20
|
+
(D-13).
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- **`room.get_transcript` pages, and says whether it paged.** The response is now
|
|
25
|
+
`{ messages, has_more, next_seq }`. A cold attach at `since_seq: 0` used to ship
|
|
26
|
+
the entire transcript as one text block — 3.8 MB in the room the backlog
|
|
27
|
+
measured — and the consumer on the management path is a language model, so that
|
|
28
|
+
is not slow CPU, it is a context window. Pass `next_seq` back as `since_seq` to
|
|
29
|
+
continue.
|
|
30
|
+
- **The default is bounded (200).** An opt-in limit would have left every
|
|
31
|
+
existing caller shipping the whole room, which is the caller the problem was
|
|
32
|
+
measured on. A bare array could not express "there is more", and a truncated
|
|
33
|
+
list that looks complete is the defect this project keeps re-filing — hence the
|
|
34
|
+
object rather than a silent cap.
|
|
35
|
+
- **`roomyx-client` reads the page and its cursor.** The polling loop takes
|
|
36
|
+
`next_seq` from the response instead of computing `max` over what arrived: the
|
|
37
|
+
server knows which messages it actually sent, and a bounded page means "the
|
|
38
|
+
last seq I received" and "the cursor" are the same number only by luck.
|
|
39
|
+
|
|
40
|
+
### Fixed
|
|
41
|
+
|
|
42
|
+
- **The status bar shows the goal's threshold.** The room is goal-driven and its
|
|
43
|
+
goal is a number to cross; the line carried the goal statement and not the
|
|
44
|
+
number, so a reader could not tell how close the room was. A goal that states
|
|
45
|
+
no threshold gets no invented one.
|
|
46
|
+
- **Over-long status lines are clipped with a marker instead of cut by the pane
|
|
47
|
+
edge.** With `wrapMode: "none"` on a `height: 1` row, a truncated goal read as
|
|
48
|
+
a short goal — and an owner command's answer stopped mid-word: a real veto
|
|
49
|
+
against a dispatcher-less room ended at "…the command. A". Both the goal line
|
|
50
|
+
and a notice now end with the client's own `…` marker.
|
|
51
|
+
|
|
16
52
|
## [0.8.2] — 2026-09-10
|
|
17
53
|
|
|
18
54
|
A patch. Closes the backlog's S3 and corrects two documents that described a
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrciphersmith/roomyx",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.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"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TextRenderable } from "@opentui/core";
|
|
2
2
|
import type { RenderContext } from "@opentui/core";
|
|
3
|
+
import { clip } from "../clip";
|
|
3
4
|
import type { ConnectionStatus } from "../mcp-client";
|
|
4
5
|
import type { GoalContract } from "../../log/types";
|
|
5
6
|
|
|
@@ -15,11 +16,15 @@ export type DisplayStatus = ConnectionStatus | "closed";
|
|
|
15
16
|
export class StatusBar {
|
|
16
17
|
readonly node: TextRenderable;
|
|
17
18
|
private goalStatement = "";
|
|
19
|
+
/** The number the room exists to cross. Empty when the goal states none. */
|
|
20
|
+
private threshold = "";
|
|
18
21
|
private status: DisplayStatus = "connecting";
|
|
22
|
+
private readonly width: number;
|
|
19
23
|
/** Takes over the line while an owner command is being composed or answered. */
|
|
20
24
|
private notice: string | null = null;
|
|
21
25
|
|
|
22
|
-
constructor(ctx: RenderContext) {
|
|
26
|
+
constructor(ctx: RenderContext, options: { width: number }) {
|
|
27
|
+
this.width = options.width;
|
|
23
28
|
// Same reason as the roster rows: with the default word wrapping, an
|
|
24
29
|
// over-long line went to a second row that `height: 1` clipped, taking the
|
|
25
30
|
// whole trailing word with it. This line carries the goal statement and
|
|
@@ -30,6 +35,12 @@ export class StatusBar {
|
|
|
30
35
|
|
|
31
36
|
setGoalContract(goal: GoalContract): void {
|
|
32
37
|
this.goalStatement = goal.goal_statement;
|
|
38
|
+
// R12: the room is goal-driven, and the goal is a number to cross. Showing
|
|
39
|
+
// the statement without the number left the reader unable to tell how close
|
|
40
|
+
// the room was, in the one line that has room to say it. A goal that states
|
|
41
|
+
// no threshold gets no invented one.
|
|
42
|
+
this.threshold =
|
|
43
|
+
goal.threshold.pass_at_or_above > 0 ? ` · pass ≥${goal.threshold.pass_at_or_above}` : "";
|
|
33
44
|
this.render();
|
|
34
45
|
}
|
|
35
46
|
|
|
@@ -45,8 +56,13 @@ export class StatusBar {
|
|
|
45
56
|
}
|
|
46
57
|
|
|
47
58
|
private render(): void {
|
|
59
|
+
// Clipped rather than cut by the pane edge. `wrapMode: "none"` on a
|
|
60
|
+
// `height: 1` row means anything longer vanished mid-word with nothing to
|
|
61
|
+
// say it had been cut — a truncated goal read as a short goal, and a real
|
|
62
|
+
// vet o's refusal stopped at "…the command. A" (R12, widened 2026-09-09).
|
|
63
|
+
// The client's own cutter is used rather than a second one written here.
|
|
48
64
|
if (this.notice !== null) {
|
|
49
|
-
this.node.content = this.notice;
|
|
65
|
+
this.node.content = clip(this.notice, this.width);
|
|
50
66
|
return;
|
|
51
67
|
}
|
|
52
68
|
const statusLabel = {
|
|
@@ -55,6 +71,6 @@ export class StatusBar {
|
|
|
55
71
|
disconnected: "disconnected — retrying",
|
|
56
72
|
closed: "closed",
|
|
57
73
|
}[this.status];
|
|
58
|
-
this.node.content = `[${statusLabel}] ${this.goalStatement}
|
|
74
|
+
this.node.content = clip(`[${statusLabel}] ${this.goalStatement}${this.threshold}`, this.width);
|
|
59
75
|
}
|
|
60
76
|
}
|
package/src/client/mcp-client.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
2
2
|
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
3
3
|
import type { MessageEnvelope, RoomState } from "../log/types";
|
|
4
|
+
import type { TranscriptPage } from "../server/tools/get-transcript";
|
|
4
5
|
|
|
5
6
|
export type ConnectionStatus = "connecting" | "connected" | "disconnected";
|
|
6
7
|
|
|
@@ -244,12 +245,19 @@ export class RoomClient {
|
|
|
244
245
|
const again = () => {
|
|
245
246
|
this.transcriptTimer = setTimeout(() => this.pollTranscript(generation), this.transcriptIntervalMs);
|
|
246
247
|
};
|
|
247
|
-
|
|
248
|
-
|
|
248
|
+
// No `limit`: the poll asks for what has arrived since the last one, which is
|
|
249
|
+
// normally nothing to a couple of messages. The server's default only
|
|
250
|
+
// matters to a caller doing a cold attach, and it pages there.
|
|
251
|
+
this.callTool<TranscriptPage>("room.get_transcript", { since_seq: this.sinceSeq })
|
|
252
|
+
.then((page) => {
|
|
249
253
|
if (this.isStale(generation)) return;
|
|
250
|
-
if (messages.length > 0) {
|
|
251
|
-
|
|
252
|
-
|
|
254
|
+
if (page.messages.length > 0) {
|
|
255
|
+
// The cursor comes from the page rather than from `max` of what arrived:
|
|
256
|
+
// the server knows which messages it actually sent, and a page is
|
|
257
|
+
// bounded, so "the last seq I received" and "the cursor" are the same
|
|
258
|
+
// number only by luck.
|
|
259
|
+
this.sinceSeq = Math.max(this.sinceSeq, page.next_seq);
|
|
260
|
+
this.events.onNewMessages?.(page.messages);
|
|
253
261
|
}
|
|
254
262
|
again();
|
|
255
263
|
})
|
|
@@ -58,7 +58,7 @@ export class ChatView {
|
|
|
58
58
|
) {
|
|
59
59
|
this.ctx = ctx;
|
|
60
60
|
this.node = new BoxRenderable(ctx, { width: options.width, height: options.height, flexDirection: "column" });
|
|
61
|
-
this.statusBar = new StatusBar(ctx);
|
|
61
|
+
this.statusBar = new StatusBar(ctx, { width: options.width });
|
|
62
62
|
this.node.add(this.statusBar.node);
|
|
63
63
|
|
|
64
64
|
const body = new BoxRenderable(ctx, { flexDirection: "row", flexGrow: 1 });
|
package/src/server/index.ts
CHANGED
|
@@ -67,11 +67,26 @@ export function createRoomMcpServer(logPath: string, options: RoomMcpServerOptio
|
|
|
67
67
|
"room.get_transcript",
|
|
68
68
|
{
|
|
69
69
|
title: "Room transcript delta",
|
|
70
|
-
description:
|
|
71
|
-
|
|
70
|
+
description:
|
|
71
|
+
"Messages with seq greater than since_seq, in order — at most `limit` of them. " +
|
|
72
|
+
"The result carries has_more and next_seq so a page can be told from a complete answer: " +
|
|
73
|
+
"pass next_seq back as since_seq to continue.",
|
|
74
|
+
inputSchema: {
|
|
75
|
+
since_seq: z.number().int().min(0),
|
|
76
|
+
limit: z.number().int().min(0).optional(),
|
|
77
|
+
},
|
|
72
78
|
},
|
|
73
|
-
async ({ since_seq }) => ({
|
|
74
|
-
content: [
|
|
79
|
+
async ({ since_seq, limit }) => ({
|
|
80
|
+
content: [
|
|
81
|
+
{
|
|
82
|
+
type: "text",
|
|
83
|
+
text: JSON.stringify(
|
|
84
|
+
limit === undefined
|
|
85
|
+
? getTranscriptTool(logPath, since_seq)
|
|
86
|
+
: getTranscriptTool(logPath, since_seq, limit),
|
|
87
|
+
),
|
|
88
|
+
},
|
|
89
|
+
],
|
|
75
90
|
}),
|
|
76
91
|
);
|
|
77
92
|
|
|
@@ -1,8 +1,53 @@
|
|
|
1
1
|
import { getTranscript, loadRoomLog } from "../../log/store";
|
|
2
2
|
import type { MessageEnvelope } from "../../log/types";
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* How many messages `room.get_transcript` returns when the caller does not say.
|
|
6
|
+
*
|
|
7
|
+
* There has to be a default, and this is the reason: the caller that existed
|
|
8
|
+
* before this parameter did was passing only `since_seq`, and a cold attach at
|
|
9
|
+
* `since_seq: 0` shipped the entire transcript as one text block — 3.8 MB in the
|
|
10
|
+
* room the backlog measured. The consumer on the management path is a language
|
|
11
|
+
* model, so that is not slow CPU, it is a context window. An opt-in limit would
|
|
12
|
+
* leave every existing caller shipping the whole room.
|
|
13
|
+
*
|
|
14
|
+
* 200 is a page a model can read in one go and a page the TUI never notices: it
|
|
15
|
+
* polls once a second with a cursor, so it is only ever asking for what has
|
|
16
|
+
* arrived since the last poll.
|
|
17
|
+
*/
|
|
18
|
+
export const DEFAULT_TRANSCRIPT_LIMIT = 200;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* A page of the transcript, with the two facts a caller needs to know whether
|
|
22
|
+
* it has the whole answer.
|
|
23
|
+
*
|
|
24
|
+
* It used to be a bare array, which cannot express "there is more" — and a
|
|
25
|
+
* truncated list that looks complete is exactly the defect this project keeps
|
|
26
|
+
* re-filing. `has_more` says whether another call will return anything, and
|
|
27
|
+
* `next_seq` is the cursor to pass as `since_seq` for it, so the caller does not
|
|
28
|
+
* re-derive the cursor from whichever message happened to arrive last.
|
|
29
|
+
*/
|
|
30
|
+
export interface TranscriptPage {
|
|
31
|
+
messages: MessageEnvelope[];
|
|
32
|
+
has_more: boolean;
|
|
33
|
+
next_seq: number;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** MCP tool `room.get_transcript`: messages with seq > sinceSeq, at most `limit`. Read-only. */
|
|
37
|
+
export function getTranscriptTool(
|
|
38
|
+
logPath: string,
|
|
39
|
+
sinceSeq: number,
|
|
40
|
+
limit: number = DEFAULT_TRANSCRIPT_LIMIT,
|
|
41
|
+
): TranscriptPage {
|
|
6
42
|
const { messages } = loadRoomLog(logPath);
|
|
7
|
-
|
|
43
|
+
const after = getTranscript(messages, sinceSeq);
|
|
44
|
+
const page = after.slice(0, Math.max(0, limit));
|
|
45
|
+
return {
|
|
46
|
+
messages: page,
|
|
47
|
+
has_more: after.length > page.length,
|
|
48
|
+
// The cursor advances only over messages actually returned. Advancing it to
|
|
49
|
+
// the last message in the *log* would skip everything the page did not
|
|
50
|
+
// carry, and the log is append-only: nothing would ever fetch it again.
|
|
51
|
+
next_seq: page.length > 0 ? (page[page.length - 1] as MessageEnvelope).seq : sinceSeq,
|
|
52
|
+
};
|
|
8
53
|
}
|