@mattstack/rt-client 0.12.0 → 0.14.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 +47 -3
- package/package.json +2 -2
- package/src/client.ts +24 -0
- package/src/commands.ts +2 -0
- package/src/index.ts +3 -0
- package/src/settings/registry-defs.ts +32 -3
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"]) {
|
|
@@ -618,6 +630,14 @@ var REGISTRY = [
|
|
|
618
630
|
migrated: true,
|
|
619
631
|
description: "Desktop notification preferences (which events notify, sound on/off)."
|
|
620
632
|
},
|
|
633
|
+
{
|
|
634
|
+
key: "rt.notify.eventBridges",
|
|
635
|
+
type: "array",
|
|
636
|
+
scopes: ["user"],
|
|
637
|
+
default: [],
|
|
638
|
+
merge: "replace",
|
|
639
|
+
description: "Event-bus glob rules that raise a desktop notification: [{pattern, category, title, message}]. pattern is matched against the events-bus topic (Bun.Glob semantics); title/message may interpolate `{field}` from the event payload. A fresh key, not an ownership-latch port, so a default is fine here."
|
|
640
|
+
},
|
|
621
641
|
{
|
|
622
642
|
key: "rt.cron",
|
|
623
643
|
type: "object",
|
|
@@ -935,6 +955,13 @@ var REGISTRY = [
|
|
|
935
955
|
merge: "replace",
|
|
936
956
|
description: "Days of MR inactivity before the board flags it stale, for this developer."
|
|
937
957
|
},
|
|
958
|
+
{
|
|
959
|
+
key: "board.gateGraceMinutes",
|
|
960
|
+
type: "number",
|
|
961
|
+
scopes: ["user"],
|
|
962
|
+
merge: "replace",
|
|
963
|
+
description: "Minutes an unanswered review gate stays open before the board parks the review (closes the pane, keeps the gate open). Default 90."
|
|
964
|
+
},
|
|
938
965
|
{
|
|
939
966
|
key: "board.workspaces",
|
|
940
967
|
type: "object",
|
|
@@ -964,11 +991,25 @@ var REGISTRY = [
|
|
|
964
991
|
description: "This developer's triage user-intent flags (which triage sweeps run automatically); a sibling flat key of board.triage.doctorSkill, not its container — the board reader assembles the two independently."
|
|
965
992
|
},
|
|
966
993
|
{
|
|
967
|
-
key: "board.
|
|
994
|
+
key: "board.agent.account",
|
|
968
995
|
type: "string",
|
|
969
|
-
scopes: ["machine"],
|
|
996
|
+
scopes: ["user", "machine"],
|
|
997
|
+
merge: "replace",
|
|
998
|
+
description: "cswap account the board's review/respond/doctor panes launch under; unset uses the default claude profile. Replaces the retired board.claudeCommand."
|
|
999
|
+
},
|
|
1000
|
+
{
|
|
1001
|
+
key: "board.agent.model",
|
|
1002
|
+
type: "string",
|
|
1003
|
+
scopes: ["user", "machine"],
|
|
1004
|
+
merge: "replace",
|
|
1005
|
+
description: "Default --model for the board's review/respond/doctor panes; unset omits the flag."
|
|
1006
|
+
},
|
|
1007
|
+
{
|
|
1008
|
+
key: "board.agent.effort",
|
|
1009
|
+
type: "string",
|
|
1010
|
+
scopes: ["user", "machine"],
|
|
970
1011
|
merge: "replace",
|
|
971
|
-
description: "
|
|
1012
|
+
description: "Default --effort for the board's review/respond/doctor panes; unset omits the flag."
|
|
972
1013
|
},
|
|
973
1014
|
{
|
|
974
1015
|
key: "board.cwds",
|
|
@@ -1992,7 +2033,10 @@ export {
|
|
|
1992
2033
|
getDef,
|
|
1993
2034
|
explainSetting,
|
|
1994
2035
|
expandVariables,
|
|
2036
|
+
eventsWait,
|
|
2037
|
+
eventsList,
|
|
1995
2038
|
eventsHead,
|
|
2039
|
+
eventsEmit,
|
|
1996
2040
|
deriveRepoIdentity,
|
|
1997
2041
|
decidePlacement,
|
|
1998
2042
|
daemonHealth,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mattstack/rt-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.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 }
|
package/src/index.ts
CHANGED
|
@@ -79,6 +79,14 @@ export const REGISTRY: readonly SettingDef[] = [
|
|
|
79
79
|
migrated: true,
|
|
80
80
|
description: "Desktop notification preferences (which events notify, sound on/off).",
|
|
81
81
|
},
|
|
82
|
+
{
|
|
83
|
+
key: "rt.notify.eventBridges",
|
|
84
|
+
type: "array",
|
|
85
|
+
scopes: ["user"],
|
|
86
|
+
default: [],
|
|
87
|
+
merge: "replace",
|
|
88
|
+
description: "Event-bus glob rules that raise a desktop notification: [{pattern, category, title, message}]. pattern is matched against the events-bus topic (Bun.Glob semantics); title/message may interpolate `{field}` from the event payload. A fresh key, not an ownership-latch port, so a default is fine here.",
|
|
89
|
+
},
|
|
82
90
|
{
|
|
83
91
|
key: "rt.cron",
|
|
84
92
|
type: "object",
|
|
@@ -421,6 +429,13 @@ export const REGISTRY: readonly SettingDef[] = [
|
|
|
421
429
|
merge: "replace",
|
|
422
430
|
description: "Days of MR inactivity before the board flags it stale, for this developer.",
|
|
423
431
|
},
|
|
432
|
+
{
|
|
433
|
+
key: "board.gateGraceMinutes",
|
|
434
|
+
type: "number",
|
|
435
|
+
scopes: ["user"],
|
|
436
|
+
merge: "replace",
|
|
437
|
+
description: "Minutes an unanswered review gate stays open before the board parks the review (closes the pane, keeps the gate open). Default 90.",
|
|
438
|
+
},
|
|
424
439
|
{
|
|
425
440
|
key: "board.workspaces",
|
|
426
441
|
type: "object",
|
|
@@ -452,11 +467,25 @@ export const REGISTRY: readonly SettingDef[] = [
|
|
|
452
467
|
|
|
453
468
|
// --- board (machine) ---------------------------------------------------
|
|
454
469
|
{
|
|
455
|
-
key: "board.
|
|
470
|
+
key: "board.agent.account",
|
|
456
471
|
type: "string",
|
|
457
|
-
scopes: ["machine"],
|
|
472
|
+
scopes: ["user", "machine"],
|
|
473
|
+
merge: "replace",
|
|
474
|
+
description: "cswap account the board's review/respond/doctor panes launch under; unset uses the default claude profile. Replaces the retired board.claudeCommand.",
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
key: "board.agent.model",
|
|
478
|
+
type: "string",
|
|
479
|
+
scopes: ["user", "machine"],
|
|
480
|
+
merge: "replace",
|
|
481
|
+
description: "Default --model for the board's review/respond/doctor panes; unset omits the flag.",
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
key: "board.agent.effort",
|
|
485
|
+
type: "string",
|
|
486
|
+
scopes: ["user", "machine"],
|
|
458
487
|
merge: "replace",
|
|
459
|
-
description: "
|
|
488
|
+
description: "Default --effort for the board's review/respond/doctor panes; unset omits the flag.",
|
|
460
489
|
},
|
|
461
490
|
{
|
|
462
491
|
key: "board.cwds",
|