@mattstack/rt-client 0.6.2 → 0.8.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 +2 -2
- package/dist/client.d.ts +19 -0
- package/dist/commands.d.ts +42 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +30 -6
- package/package.json +1 -1
- package/src/client.ts +37 -4
- package/src/commands.ts +14 -2
- package/src/index.ts +5 -0
package/README.md
CHANGED
|
@@ -100,8 +100,8 @@ const stop = createRelay({ // one daemon sub
|
|
|
100
100
|
| --- | --- |
|
|
101
101
|
| `chatSignIn` / `chatSignOut` / `chatAway` / `chatBack` / `chatPulse` | presence: the buddy-list row and its heartbeats |
|
|
102
102
|
| `chatBuddies` / `chatWho` / `chatRooms` | the roster, one room's members, a handle's rooms |
|
|
103
|
-
| `chatJoin` / `chatLeave` | membership (`wakeOn: mention \| all \| none`) |
|
|
104
|
-
| `chatPost` / `chatDm` / `chatRead` / `chatMessages` / `chatMark` | messages: post, DM, read-and-advance, page, advance the cursor |
|
|
103
|
+
| `chatJoin` / `chatLeave` / `chatArchive` | membership (`wakeOn: mention \| all \| none`); archive parks a room for everyone until a post revives it |
|
|
104
|
+
| `chatPost` / `chatDm` / `chatDmOpen` / `chatRead` / `chatMessages` / `chatMark` | messages: post, DM, open a DM room without posting, read-and-advance, page, advance the cursor |
|
|
105
105
|
| `chatArm` / `chatTouch` / `chatDisarm` / `chatUnreadWaking` | the tail's wake protocol; the CLI's `rt chat tail` uses these |
|
|
106
106
|
| `paneList` / `panePeek` / `paneSpawn` / `paneAccounts` / `paneDirectories` | herdr panes: list with presence joined, peek a screen, start claude in a tab, cswap accounts, directory suggestions |
|
|
107
107
|
| `chatInvite` | type `/chat:join <room>` into a pane; `accepted`, `queued` or `refused` |
|
package/dist/client.d.ts
CHANGED
|
@@ -76,6 +76,7 @@ export declare function chatRead(a: {
|
|
|
76
76
|
}>>;
|
|
77
77
|
export declare function chatRooms(a: {
|
|
78
78
|
handle: string;
|
|
79
|
+
includeArchived?: boolean;
|
|
79
80
|
}, o?: RtClientOptions): Promise<RtResponse<{
|
|
80
81
|
rooms: RoomSummary[];
|
|
81
82
|
}>>;
|
|
@@ -171,6 +172,22 @@ export declare function chatDm(a: {
|
|
|
171
172
|
id: number;
|
|
172
173
|
recipients: string[];
|
|
173
174
|
}>>;
|
|
175
|
+
export declare function chatArchive(a: {
|
|
176
|
+
room: string;
|
|
177
|
+
handle: string;
|
|
178
|
+
archived: boolean;
|
|
179
|
+
}, o?: RtClientOptions): Promise<RtResponse<{
|
|
180
|
+
room: string;
|
|
181
|
+
archivedAt: number | null;
|
|
182
|
+
}>>;
|
|
183
|
+
export declare function chatDmOpen(a: {
|
|
184
|
+
from: string;
|
|
185
|
+
to: string;
|
|
186
|
+
sessionId?: string;
|
|
187
|
+
}, o?: RtClientOptions): Promise<RtResponse<{
|
|
188
|
+
room: string;
|
|
189
|
+
created: boolean;
|
|
190
|
+
}>>;
|
|
174
191
|
export declare function eventsHead(o?: RtClientOptions): Promise<RtResponse<{
|
|
175
192
|
cursor: number;
|
|
176
193
|
}>>;
|
|
@@ -191,3 +208,5 @@ export declare function paneSpawn(a: Commands["pane:spawn"]["payload"], o?: RtCl
|
|
|
191
208
|
export declare function paneAccounts(o?: RtClientOptions): Promise<RtResponse<Commands["pane:accounts"]["data"]>>;
|
|
192
209
|
export declare function paneDirectories(a: Commands["pane:directories"]["payload"], o?: RtClientOptions): Promise<RtResponse<Commands["pane:directories"]["data"]>>;
|
|
193
210
|
export declare function chatInvite(a: Commands["chat:invite"]["payload"], o?: RtClientOptions): Promise<RtResponse<Commands["chat:invite"]["data"]>>;
|
|
211
|
+
/** A working target holds the connection through its prompt wait, so the budget matches chatInvite's 30s. */
|
|
212
|
+
export declare function paneSend(a: Commands["pane:send"]["payload"], o?: RtClientOptions): Promise<RtResponse<Commands["pane:send"]["data"]>>;
|
package/dist/commands.d.ts
CHANGED
|
@@ -129,6 +129,8 @@ export interface RoomSummary {
|
|
|
129
129
|
};
|
|
130
130
|
/** Set only by chat:rooms's left join against chat_room_defaults; undefined for a room never stamped a default (every DM room included). */
|
|
131
131
|
defaultWake?: WakeMode;
|
|
132
|
+
/** Set only when chat:rooms was asked for archived rooms; absent on an open room. */
|
|
133
|
+
archivedAt?: number;
|
|
132
134
|
}
|
|
133
135
|
/**
|
|
134
136
|
* Duplicated shape on purpose, same reasoning as ChatMember/ChatMessage
|
|
@@ -184,6 +186,13 @@ export interface InviteResult {
|
|
|
184
186
|
delivered: "accepted" | "queued" | "refused";
|
|
185
187
|
reason?: string;
|
|
186
188
|
}
|
|
189
|
+
/** Duplicated shape on purpose: mirrors lib/daemon/inject.ts's InjectResult. */
|
|
190
|
+
export type PaneDelivery = "accepted" | "queued" | "refused";
|
|
191
|
+
export interface PaneSendResult {
|
|
192
|
+
paneId: string;
|
|
193
|
+
delivered: PaneDelivery;
|
|
194
|
+
reason?: string;
|
|
195
|
+
}
|
|
187
196
|
export type Attention = {
|
|
188
197
|
needs: boolean;
|
|
189
198
|
reason: "failed" | "stale" | "stranded" | "blocked" | null;
|
|
@@ -471,6 +480,7 @@ export interface Commands {
|
|
|
471
480
|
"chat:rooms": {
|
|
472
481
|
payload: {
|
|
473
482
|
handle: string;
|
|
483
|
+
includeArchived?: boolean;
|
|
474
484
|
};
|
|
475
485
|
data: {
|
|
476
486
|
rooms: RoomSummary[];
|
|
@@ -611,6 +621,28 @@ export interface Commands {
|
|
|
611
621
|
recipients: string[];
|
|
612
622
|
};
|
|
613
623
|
};
|
|
624
|
+
"chat:archive": {
|
|
625
|
+
payload: {
|
|
626
|
+
room: string;
|
|
627
|
+
handle: string;
|
|
628
|
+
archived: boolean;
|
|
629
|
+
};
|
|
630
|
+
data: {
|
|
631
|
+
room: string;
|
|
632
|
+
archivedAt: number | null;
|
|
633
|
+
};
|
|
634
|
+
};
|
|
635
|
+
"chat:dm-open": {
|
|
636
|
+
payload: {
|
|
637
|
+
from: string;
|
|
638
|
+
to: string;
|
|
639
|
+
sessionId?: string;
|
|
640
|
+
};
|
|
641
|
+
data: {
|
|
642
|
+
room: string;
|
|
643
|
+
created: boolean;
|
|
644
|
+
};
|
|
645
|
+
};
|
|
614
646
|
"agent:start": {
|
|
615
647
|
payload: {
|
|
616
648
|
repo: string;
|
|
@@ -633,6 +665,8 @@ export interface Commands {
|
|
|
633
665
|
id: string;
|
|
634
666
|
prompt?: string;
|
|
635
667
|
surface?: AgentSurface;
|
|
668
|
+
workspace?: string;
|
|
669
|
+
tab?: string;
|
|
636
670
|
};
|
|
637
671
|
data: AgentRecord;
|
|
638
672
|
};
|
|
@@ -704,6 +738,14 @@ export interface Commands {
|
|
|
704
738
|
ready: boolean;
|
|
705
739
|
};
|
|
706
740
|
};
|
|
741
|
+
"pane:send": {
|
|
742
|
+
payload: {
|
|
743
|
+
paneId: string;
|
|
744
|
+
text: string;
|
|
745
|
+
callerPane?: string;
|
|
746
|
+
};
|
|
747
|
+
data: PaneSendResult;
|
|
748
|
+
};
|
|
707
749
|
}
|
|
708
750
|
export type CommandName = keyof Commands;
|
|
709
751
|
export declare const COMMAND_NAMES: readonly CommandName[];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { rtCommand, DEFAULT_SOCK } from "./transport.ts";
|
|
2
2
|
export type { RtResponse, RtClientOptions } from "./transport.ts";
|
|
3
|
-
export { readProjectMRs, readDiscussions, readMrsByBranch, readBranchCache, resolveForgeToken, listRuns, getRun, abandonRun, chatJoin, chatLeave, chatPost, chatRead, chatRooms, chatWho, chatMark, chatMessages, chatArm, chatTouch, chatDisarm, chatUnreadWaking, chatSignIn, chatSignOut, chatAway, chatBack, chatBuddies, chatPulse, chatDm, eventsHead, agentStart, agentResume, agentGet, agentList, paneList, panePeek, paneSpawn, paneAccounts, paneDirectories, chatInvite, } from "./client.ts";
|
|
3
|
+
export { readProjectMRs, readDiscussions, readMrsByBranch, readBranchCache, resolveForgeToken, listRuns, getRun, abandonRun, chatJoin, chatLeave, chatPost, chatRead, chatRooms, chatWho, chatMark, chatMessages, chatArm, chatTouch, chatDisarm, chatUnreadWaking, chatSignIn, chatSignOut, chatAway, chatBack, chatBuddies, chatPulse, chatDm, chatArchive, chatDmOpen, eventsHead, agentStart, agentResume, agentGet, agentList, paneList, panePeek, paneSpawn, paneAccounts, paneDirectories, chatInvite, paneSend, } from "./client.ts";
|
|
4
4
|
export { COMMAND_NAMES } from "./commands.ts";
|
|
5
|
-
export type { Discussion, DemandDecl, ProjectMRsScope, ProjectMRsData, DiscussionsData, MrByBranchEntry, MrByBranchData, BranchEnrichment, Commands, CommandName, ForgeSlug, ForgeTokenData, Attention, RunSummary, RunStageRow, RunFieldRow, RunDecisionRow, RunDetail, WakeMode, ChatMember, ChatMessage, RoomSummary, BuddyStatus, PresenceRow, AgentRecord, AgentSurface, AgentStatus, ChatPane, PaneAccount, PaneDirectory, InviteResult, } from "./commands.ts";
|
|
5
|
+
export type { Discussion, DemandDecl, ProjectMRsScope, ProjectMRsData, DiscussionsData, MrByBranchEntry, MrByBranchData, BranchEnrichment, Commands, CommandName, ForgeSlug, ForgeTokenData, Attention, RunSummary, RunStageRow, RunFieldRow, RunDecisionRow, RunDetail, WakeMode, ChatMember, ChatMessage, RoomSummary, BuddyStatus, PresenceRow, AgentRecord, AgentSurface, AgentStatus, ChatPane, PaneAccount, PaneDirectory, InviteResult, PaneDelivery, PaneSendResult, } from "./commands.ts";
|
|
6
6
|
export { subscribe, createRelay, DEFAULT_WS_URL } from "./relay.ts";
|
|
7
7
|
export type { RelayEventType } from "./relay.ts";
|
|
8
8
|
export { daemonHealth } from "./health.ts";
|
package/dist/index.js
CHANGED
|
@@ -95,7 +95,10 @@ function chatRead(a, o = {}) {
|
|
|
95
95
|
return rtCommand("chat:read", payload, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 1e4 });
|
|
96
96
|
}
|
|
97
97
|
function chatRooms(a, o = {}) {
|
|
98
|
-
|
|
98
|
+
const payload = { handle: a.handle };
|
|
99
|
+
if (a.includeArchived === true)
|
|
100
|
+
payload.includeArchived = true;
|
|
101
|
+
return rtCommand("chat:rooms", payload, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 1e4 });
|
|
99
102
|
}
|
|
100
103
|
function chatWho(a, o = {}) {
|
|
101
104
|
return rtCommand("chat:who", { room: a.room }, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 1e4 });
|
|
@@ -186,6 +189,15 @@ function chatDm(a, o = {}) {
|
|
|
186
189
|
payload.sessionId = a.sessionId;
|
|
187
190
|
return rtCommand("chat:dm", payload, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 1e4 });
|
|
188
191
|
}
|
|
192
|
+
function chatArchive(a, o = {}) {
|
|
193
|
+
return rtCommand("chat:archive", { room: a.room, handle: a.handle, archived: a.archived }, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 1e4 });
|
|
194
|
+
}
|
|
195
|
+
function chatDmOpen(a, o = {}) {
|
|
196
|
+
const payload = { from: a.from, to: a.to };
|
|
197
|
+
if (a.sessionId !== undefined)
|
|
198
|
+
payload.sessionId = a.sessionId;
|
|
199
|
+
return rtCommand("chat:dm-open", payload, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 1e4 });
|
|
200
|
+
}
|
|
189
201
|
function eventsHead(o = {}) {
|
|
190
202
|
return rtCommand("events:head", {}, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 1e4 });
|
|
191
203
|
}
|
|
@@ -199,10 +211,10 @@ function agentStart(a, o = {}) {
|
|
|
199
211
|
}
|
|
200
212
|
function agentResume(a, o = {}) {
|
|
201
213
|
const payload = { id: a.id };
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
214
|
+
for (const k of ["prompt", "surface", "workspace", "tab"]) {
|
|
215
|
+
if (a[k] !== undefined)
|
|
216
|
+
payload[k] = a[k];
|
|
217
|
+
}
|
|
206
218
|
return rtCommand("agent:resume", payload, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 30000 });
|
|
207
219
|
}
|
|
208
220
|
function agentGet(a, o = {}) {
|
|
@@ -247,6 +259,12 @@ function chatInvite(a, o = {}) {
|
|
|
247
259
|
payload.callerPane = a.callerPane;
|
|
248
260
|
return rtCommand("chat:invite", payload, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 30000 });
|
|
249
261
|
}
|
|
262
|
+
function paneSend(a, o = {}) {
|
|
263
|
+
const payload = { paneId: a.paneId, text: a.text };
|
|
264
|
+
if (a.callerPane !== undefined)
|
|
265
|
+
payload.callerPane = a.callerPane;
|
|
266
|
+
return rtCommand("pane:send", payload, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 30000 });
|
|
267
|
+
}
|
|
250
268
|
// src/commands.ts
|
|
251
269
|
var COMMAND_NAMES = [
|
|
252
270
|
"project-mrs:read",
|
|
@@ -280,6 +298,8 @@ var COMMAND_NAMES = [
|
|
|
280
298
|
"chat:buddies",
|
|
281
299
|
"chat:pulse",
|
|
282
300
|
"chat:dm",
|
|
301
|
+
"chat:archive",
|
|
302
|
+
"chat:dm-open",
|
|
283
303
|
"agent:start",
|
|
284
304
|
"agent:resume",
|
|
285
305
|
"agent:get",
|
|
@@ -289,7 +309,8 @@ var COMMAND_NAMES = [
|
|
|
289
309
|
"pane:peek",
|
|
290
310
|
"pane:accounts",
|
|
291
311
|
"pane:directories",
|
|
292
|
-
"pane:spawn"
|
|
312
|
+
"pane:spawn",
|
|
313
|
+
"pane:send"
|
|
293
314
|
];
|
|
294
315
|
// src/relay.ts
|
|
295
316
|
var DEFAULT_WS_URL = "ws://127.0.0.1:9401/ws";
|
|
@@ -1738,6 +1759,7 @@ export {
|
|
|
1738
1759
|
readBranchCache,
|
|
1739
1760
|
parseIdentity,
|
|
1740
1761
|
paneSpawn,
|
|
1762
|
+
paneSend,
|
|
1741
1763
|
panePeek,
|
|
1742
1764
|
paneList,
|
|
1743
1765
|
paneDirectories,
|
|
@@ -1772,12 +1794,14 @@ export {
|
|
|
1772
1794
|
chatLeave,
|
|
1773
1795
|
chatJoin,
|
|
1774
1796
|
chatInvite,
|
|
1797
|
+
chatDmOpen,
|
|
1775
1798
|
chatDm,
|
|
1776
1799
|
chatDisarm,
|
|
1777
1800
|
chatBuddies,
|
|
1778
1801
|
chatBack,
|
|
1779
1802
|
chatAway,
|
|
1780
1803
|
chatArm,
|
|
1804
|
+
chatArchive,
|
|
1781
1805
|
allDefs,
|
|
1782
1806
|
agentStart,
|
|
1783
1807
|
agentResume,
|
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -186,10 +186,12 @@ export function chatRead(
|
|
|
186
186
|
}
|
|
187
187
|
|
|
188
188
|
export function chatRooms(
|
|
189
|
-
a: { handle: string },
|
|
189
|
+
a: { handle: string; includeArchived?: boolean },
|
|
190
190
|
o: RtClientOptions = {},
|
|
191
191
|
): Promise<RtResponse<{ rooms: RoomSummary[] }>> {
|
|
192
|
-
|
|
192
|
+
const payload: Record<string, unknown> = { handle: a.handle };
|
|
193
|
+
if (a.includeArchived === true) payload.includeArchived = true;
|
|
194
|
+
return rtCommand<{ rooms: RoomSummary[] }>("chat:rooms", payload, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 10_000 });
|
|
193
195
|
}
|
|
194
196
|
|
|
195
197
|
export function chatWho(
|
|
@@ -323,6 +325,26 @@ export function chatDm(
|
|
|
323
325
|
return rtCommand<{ room: string; id: number; recipients: string[] }>("chat:dm", payload, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 10_000 });
|
|
324
326
|
}
|
|
325
327
|
|
|
328
|
+
export function chatArchive(
|
|
329
|
+
a: { room: string; handle: string; archived: boolean },
|
|
330
|
+
o: RtClientOptions = {},
|
|
331
|
+
): Promise<RtResponse<{ room: string; archivedAt: number | null }>> {
|
|
332
|
+
return rtCommand<{ room: string; archivedAt: number | null }>(
|
|
333
|
+
"chat:archive",
|
|
334
|
+
{ room: a.room, handle: a.handle, archived: a.archived },
|
|
335
|
+
{ sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 10_000 },
|
|
336
|
+
);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
export function chatDmOpen(
|
|
340
|
+
a: { from: string; to: string; sessionId?: string },
|
|
341
|
+
o: RtClientOptions = {},
|
|
342
|
+
): Promise<RtResponse<{ room: string; created: boolean }>> {
|
|
343
|
+
const payload: Record<string, unknown> = { from: a.from, to: a.to };
|
|
344
|
+
if (a.sessionId !== undefined) payload.sessionId = a.sessionId;
|
|
345
|
+
return rtCommand<{ room: string; created: boolean }>("chat:dm-open", payload, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 10_000 });
|
|
346
|
+
}
|
|
347
|
+
|
|
326
348
|
export function eventsHead(o: RtClientOptions = {}): Promise<RtResponse<{ cursor: number }>> {
|
|
327
349
|
return rtCommand<{ cursor: number }>("events:head", {}, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 10_000 });
|
|
328
350
|
}
|
|
@@ -343,8 +365,9 @@ export function agentResume(
|
|
|
343
365
|
a: Commands["agent:resume"]["payload"], o: RtClientOptions = {},
|
|
344
366
|
): Promise<RtResponse<AgentRecord>> {
|
|
345
367
|
const payload: Record<string, unknown> = { id: a.id };
|
|
346
|
-
|
|
347
|
-
|
|
368
|
+
for (const k of ["prompt", "surface", "workspace", "tab"] as const) {
|
|
369
|
+
if (a[k] !== undefined) payload[k] = a[k];
|
|
370
|
+
}
|
|
348
371
|
return rtCommand<AgentRecord>("agent:resume", payload, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 30_000 });
|
|
349
372
|
}
|
|
350
373
|
|
|
@@ -400,3 +423,13 @@ export function chatInvite(
|
|
|
400
423
|
if (a.callerPane !== undefined) payload.callerPane = a.callerPane;
|
|
401
424
|
return rtCommand<Commands["chat:invite"]["data"]>("chat:invite", payload, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 30_000 });
|
|
402
425
|
}
|
|
426
|
+
|
|
427
|
+
/** A working target holds the connection through its prompt wait, so the budget matches chatInvite's 30s. */
|
|
428
|
+
export function paneSend(
|
|
429
|
+
a: Commands["pane:send"]["payload"],
|
|
430
|
+
o: RtClientOptions = {},
|
|
431
|
+
): Promise<RtResponse<Commands["pane:send"]["data"]>> {
|
|
432
|
+
const payload: Record<string, unknown> = { paneId: a.paneId, text: a.text };
|
|
433
|
+
if (a.callerPane !== undefined) payload.callerPane = a.callerPane;
|
|
434
|
+
return rtCommand<Commands["pane:send"]["data"]>("pane:send", payload, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 30_000 });
|
|
435
|
+
}
|
package/src/commands.ts
CHANGED
|
@@ -121,6 +121,8 @@ export interface RoomSummary {
|
|
|
121
121
|
participants?: { a: string; b: string };
|
|
122
122
|
/** Set only by chat:rooms's left join against chat_room_defaults; undefined for a room never stamped a default (every DM room included). */
|
|
123
123
|
defaultWake?: WakeMode;
|
|
124
|
+
/** Set only when chat:rooms was asked for archived rooms; absent on an open room. */
|
|
125
|
+
archivedAt?: number;
|
|
124
126
|
}
|
|
125
127
|
|
|
126
128
|
/**
|
|
@@ -165,6 +167,10 @@ export interface PaneAccount { slot: number; email: string; alias?: string; head
|
|
|
165
167
|
export interface PaneDirectory { path: string; repo: string; branch?: string }
|
|
166
168
|
export interface InviteResult { paneId: string; delivered: "accepted" | "queued" | "refused"; reason?: string }
|
|
167
169
|
|
|
170
|
+
/** Duplicated shape on purpose: mirrors lib/daemon/inject.ts's InjectResult. */
|
|
171
|
+
export type PaneDelivery = "accepted" | "queued" | "refused";
|
|
172
|
+
export interface PaneSendResult { paneId: string; delivered: PaneDelivery; reason?: string }
|
|
173
|
+
|
|
168
174
|
// SKILLS-53: one judgment, computed once in rt, so the console and the tray
|
|
169
175
|
// never derive two verdicts that can disagree.
|
|
170
176
|
export type Attention = {
|
|
@@ -283,7 +289,7 @@ export interface Commands {
|
|
|
283
289
|
"chat:leave": { payload: { room: string; handle: string }; data: Record<string, never> };
|
|
284
290
|
"chat:post": { payload: { room: string; handle: string; body: string; mentions?: string[] }; data: { id: number; recipients: string[] } };
|
|
285
291
|
"chat:read": { payload: { handle: string; room?: string; limit?: number; sinceMs?: number }; data: { rooms: { room: string; messages: ChatMessage[] }[] } };
|
|
286
|
-
"chat:rooms": { payload: { handle: string }; data: { rooms: RoomSummary[] } };
|
|
292
|
+
"chat:rooms": { payload: { handle: string; includeArchived?: boolean }; data: { rooms: RoomSummary[] } };
|
|
287
293
|
"chat:who": { payload: { room: string }; data: { members: ChatMember[] } };
|
|
288
294
|
"chat:mark": { payload: { handle: string; room?: string }; data: Record<string, never> };
|
|
289
295
|
"chat:messages": { payload: { room: string; before?: number; limit?: number }; data: { messages: ChatMessage[] } };
|
|
@@ -308,10 +314,12 @@ export interface Commands {
|
|
|
308
314
|
data: { unread: { dms: number; mentions: number; rooms: number }; status: BuddyStatus };
|
|
309
315
|
};
|
|
310
316
|
"chat:dm": { payload: { from: string; to: string; body: string; sessionId?: string }; data: { room: string; id: number; recipients: string[] } };
|
|
317
|
+
"chat:archive": { payload: { room: string; handle: string; archived: boolean }; data: { room: string; archivedAt: number | null } };
|
|
318
|
+
"chat:dm-open": { payload: { from: string; to: string; sessionId?: string }; data: { room: string; created: boolean } };
|
|
311
319
|
|
|
312
320
|
// ─── Agent handoff (rt agent) ────────────────────────────────────────────
|
|
313
321
|
"agent:start": { payload: { repo: string; cwd: string; prompt?: string; surface?: AgentSurface; model?: string; effort?: string; account?: string; label?: string; caller?: string; workspace?: string; tab?: string; extraArgs?: string }; data: AgentRecord };
|
|
314
|
-
"agent:resume": { payload: { id: string; prompt?: string; surface?: AgentSurface }; data: AgentRecord };
|
|
322
|
+
"agent:resume": { payload: { id: string; prompt?: string; surface?: AgentSurface; workspace?: string; tab?: string }; data: AgentRecord };
|
|
315
323
|
"agent:get": { payload: { id: string }; data: AgentRecord };
|
|
316
324
|
"agent:list": { payload: { repo?: string }; data: { agents: AgentRecord[] } };
|
|
317
325
|
"chat:invite": { payload: { paneId: string; room: string; note?: string; from: string; callerPane?: string }; data: InviteResult };
|
|
@@ -323,6 +331,7 @@ export interface Commands {
|
|
|
323
331
|
payload: { cwd: string; account?: string; model?: string; effort?: string; prompt?: string; workspace?: string };
|
|
324
332
|
data: { pane: ChatPane; ready: boolean };
|
|
325
333
|
};
|
|
334
|
+
"pane:send": { payload: { paneId: string; text: string; callerPane?: string }; data: PaneSendResult };
|
|
326
335
|
}
|
|
327
336
|
|
|
328
337
|
export type CommandName = keyof Commands;
|
|
@@ -359,6 +368,8 @@ export const COMMAND_NAMES: readonly CommandName[] = [
|
|
|
359
368
|
"chat:buddies",
|
|
360
369
|
"chat:pulse",
|
|
361
370
|
"chat:dm",
|
|
371
|
+
"chat:archive",
|
|
372
|
+
"chat:dm-open",
|
|
362
373
|
"agent:start",
|
|
363
374
|
"agent:resume",
|
|
364
375
|
"agent:get",
|
|
@@ -369,4 +380,5 @@ export const COMMAND_NAMES: readonly CommandName[] = [
|
|
|
369
380
|
"pane:accounts",
|
|
370
381
|
"pane:directories",
|
|
371
382
|
"pane:spawn",
|
|
383
|
+
"pane:send",
|
|
372
384
|
];
|
package/src/index.ts
CHANGED
|
@@ -29,6 +29,8 @@ export {
|
|
|
29
29
|
chatBuddies,
|
|
30
30
|
chatPulse,
|
|
31
31
|
chatDm,
|
|
32
|
+
chatArchive,
|
|
33
|
+
chatDmOpen,
|
|
32
34
|
eventsHead,
|
|
33
35
|
agentStart,
|
|
34
36
|
agentResume,
|
|
@@ -40,6 +42,7 @@ export {
|
|
|
40
42
|
paneAccounts,
|
|
41
43
|
paneDirectories,
|
|
42
44
|
chatInvite,
|
|
45
|
+
paneSend,
|
|
43
46
|
} from "./client.ts";
|
|
44
47
|
|
|
45
48
|
export { COMMAND_NAMES } from "./commands.ts";
|
|
@@ -75,6 +78,8 @@ export type {
|
|
|
75
78
|
PaneAccount,
|
|
76
79
|
PaneDirectory,
|
|
77
80
|
InviteResult,
|
|
81
|
+
PaneDelivery,
|
|
82
|
+
PaneSendResult,
|
|
78
83
|
} from "./commands.ts";
|
|
79
84
|
|
|
80
85
|
export { subscribe, createRelay, DEFAULT_WS_URL } from "./relay.ts";
|