@mattstack/rt-client 0.12.0 → 0.13.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/dist/client.d.ts +5 -0
- package/dist/commands.d.ts +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +15 -0
- package/package.json +2 -2
- package/src/client.ts +24 -0
- package/src/commands.ts +2 -0
- package/src/index.ts +3 -0
package/dist/client.d.ts
CHANGED
|
@@ -159,6 +159,11 @@ export declare function chatDmOpen(a: {
|
|
|
159
159
|
export declare function eventsHead(o?: RtClientOptions): Promise<RtResponse<{
|
|
160
160
|
cursor: number;
|
|
161
161
|
}>>;
|
|
162
|
+
export declare function eventsEmit(topic: string, payload?: unknown, o?: RtClientOptions): Promise<RtResponse<{
|
|
163
|
+
id: number;
|
|
164
|
+
}>>;
|
|
165
|
+
export declare function eventsWait(payload: Commands["events:wait"]["payload"], o?: RtClientOptions): Promise<RtResponse<Commands["events:wait"]["data"]>>;
|
|
166
|
+
export declare function eventsList(payload: Commands["events:list"]["payload"], o?: RtClientOptions): Promise<RtResponse<Commands["events:list"]["data"]>>;
|
|
162
167
|
export declare function agentStart(a: Commands["agent:start"]["payload"], o?: RtClientOptions): Promise<RtResponse<AgentRecord>>;
|
|
163
168
|
export declare function agentResume(a: Commands["agent:resume"]["payload"], o?: RtClientOptions): Promise<RtResponse<AgentRecord>>;
|
|
164
169
|
export declare function agentGet(a: {
|
package/dist/commands.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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, chatAck, chatClaim, chatRelease, chatPost, chatRead, chatRooms, chatWho, chatMark, chatMessages, chatSignIn, chatSignOut, chatAway, chatBack, chatBuddies, chatDm, chatArchive, chatDmOpen, eventsHead, agentStart, agentResume, agentGet, agentList, paneList, panePeek, paneSpawn, paneAccounts, paneDirectories, chatInvite, paneSend, paneFocus, } from "./client.ts";
|
|
3
|
+
export { readProjectMRs, readDiscussions, readMrsByBranch, readBranchCache, resolveForgeToken, listRuns, getRun, abandonRun, chatJoin, chatLeave, chatAck, chatClaim, chatRelease, chatPost, chatRead, chatRooms, chatWho, chatMark, chatMessages, chatSignIn, chatSignOut, chatAway, chatBack, chatBuddies, chatDm, chatArchive, chatDmOpen, eventsHead, eventsEmit, eventsWait, eventsList, agentStart, agentResume, agentGet, agentList, paneList, panePeek, paneSpawn, paneAccounts, paneDirectories, chatInvite, paneSend, paneFocus, } from "./client.ts";
|
|
4
4
|
export { COMMAND_NAMES } from "./commands.ts";
|
|
5
5
|
export type { Discussion, DemandDecl, ProjectMRsScope, ProjectMRsData, DiscussionsData, MrByBranchEntry, MrByBranchData, BranchEnrichment, Commands, CommandName, ForgeSlug, ForgeTokenData, Attention, RunSummary, RunStageRow, RunFieldRow, RunDecisionRow, RunDetail, WakeMode, ChatMember, ChatMessage, ChatClaimOutcome, RoomSummary, BuddyStatus, PresenceRow, AgentRecord, AgentSurface, AgentStatus, ChatPane, PaneAccount, PaneDirectory, InviteResult, PaneDelivery, PaneSendResult, PaneFocusResult, } from "./commands.ts";
|
|
6
6
|
export { subscribe, createRelay, DEFAULT_WS_URL } from "./relay.ts";
|
package/dist/index.js
CHANGED
|
@@ -189,6 +189,18 @@ function chatDmOpen(a, o = {}) {
|
|
|
189
189
|
function eventsHead(o = {}) {
|
|
190
190
|
return rtCommand("events:head", {}, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 1e4 });
|
|
191
191
|
}
|
|
192
|
+
function eventsEmit(topic, payload, o = {}) {
|
|
193
|
+
const p = { topic };
|
|
194
|
+
if (payload !== undefined)
|
|
195
|
+
p.payload = payload;
|
|
196
|
+
return rtCommand("events:emit", p, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 1e4 });
|
|
197
|
+
}
|
|
198
|
+
function eventsWait(payload, o = {}) {
|
|
199
|
+
return rtCommand("events:wait", payload, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 250000 });
|
|
200
|
+
}
|
|
201
|
+
function eventsList(payload, o = {}) {
|
|
202
|
+
return rtCommand("events:list", payload, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 1e4 });
|
|
203
|
+
}
|
|
192
204
|
function agentStart(a, o = {}) {
|
|
193
205
|
const payload = { repo: a.repo, cwd: a.cwd };
|
|
194
206
|
for (const k of ["prompt", "surface", "model", "effort", "account", "label", "caller", "workspace", "tab", "extraArgs"]) {
|
|
@@ -1992,7 +2004,10 @@ export {
|
|
|
1992
2004
|
getDef,
|
|
1993
2005
|
explainSetting,
|
|
1994
2006
|
expandVariables,
|
|
2007
|
+
eventsWait,
|
|
2008
|
+
eventsList,
|
|
1995
2009
|
eventsHead,
|
|
2010
|
+
eventsEmit,
|
|
1996
2011
|
deriveRepoIdentity,
|
|
1997
2012
|
decidePlacement,
|
|
1998
2013
|
daemonHealth,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mattstack/rt-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"./test/fake-daemon.ts": "./test/fake-daemon.ts"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
|
-
"@mattstack/glance": ">=0.
|
|
21
|
+
"@mattstack/glance": ">=0.23.0"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"jsonc-parser": "^3.3.1"
|
package/src/client.ts
CHANGED
|
@@ -325,6 +325,30 @@ export function eventsHead(o: RtClientOptions = {}): Promise<RtResponse<{ cursor
|
|
|
325
325
|
return rtCommand<{ cursor: number }>("events:head", {}, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 10_000 });
|
|
326
326
|
}
|
|
327
327
|
|
|
328
|
+
export function eventsEmit(
|
|
329
|
+
topic: string,
|
|
330
|
+
payload?: unknown,
|
|
331
|
+
o: RtClientOptions = {},
|
|
332
|
+
): Promise<RtResponse<{ id: number }>> {
|
|
333
|
+
const p: Record<string, unknown> = { topic };
|
|
334
|
+
if (payload !== undefined) p.payload = payload;
|
|
335
|
+
return rtCommand<{ id: number }>("events:emit", p, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 10_000 });
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
export function eventsWait(
|
|
339
|
+
payload: Commands["events:wait"]["payload"],
|
|
340
|
+
o: RtClientOptions = {},
|
|
341
|
+
): Promise<RtResponse<Commands["events:wait"]["data"]>> {
|
|
342
|
+
return rtCommand<Commands["events:wait"]["data"]>("events:wait", payload, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 250_000 });
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
export function eventsList(
|
|
346
|
+
payload: Commands["events:list"]["payload"],
|
|
347
|
+
o: RtClientOptions = {},
|
|
348
|
+
): Promise<RtResponse<Commands["events:list"]["data"]>> {
|
|
349
|
+
return rtCommand<Commands["events:list"]["data"]>("events:list", payload, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 10_000 });
|
|
350
|
+
}
|
|
351
|
+
|
|
328
352
|
// ─── Agent handoff (rt agent) ─────────────────────────────────────────────
|
|
329
353
|
|
|
330
354
|
export function agentStart(
|
package/src/commands.ts
CHANGED
|
@@ -167,6 +167,8 @@ export interface ChatPane {
|
|
|
167
167
|
agentStatus: AgentStatus;
|
|
168
168
|
sessionId?: string;
|
|
169
169
|
presence?: { handle: string; status: BuddyStatus; rooms: string[] };
|
|
170
|
+
/** herdr's per-pane focus flag; false when herdr itself is backgrounded */
|
|
171
|
+
focused?: boolean;
|
|
170
172
|
}
|
|
171
173
|
|
|
172
174
|
export interface PaneAccount { slot: number; email: string; alias?: string; headroom?: string }
|