@mattstack/rt-client 0.7.0 → 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/dist/client.d.ts CHANGED
@@ -208,3 +208,5 @@ export declare function paneSpawn(a: Commands["pane:spawn"]["payload"], o?: RtCl
208
208
  export declare function paneAccounts(o?: RtClientOptions): Promise<RtResponse<Commands["pane:accounts"]["data"]>>;
209
209
  export declare function paneDirectories(a: Commands["pane:directories"]["payload"], o?: RtClientOptions): Promise<RtResponse<Commands["pane:directories"]["data"]>>;
210
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"]>>;
@@ -186,6 +186,13 @@ export interface InviteResult {
186
186
  delivered: "accepted" | "queued" | "refused";
187
187
  reason?: string;
188
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
+ }
189
196
  export type Attention = {
190
197
  needs: boolean;
191
198
  reason: "failed" | "stale" | "stranded" | "blocked" | null;
@@ -658,6 +665,8 @@ export interface Commands {
658
665
  id: string;
659
666
  prompt?: string;
660
667
  surface?: AgentSurface;
668
+ workspace?: string;
669
+ tab?: string;
661
670
  };
662
671
  data: AgentRecord;
663
672
  };
@@ -729,6 +738,14 @@ export interface Commands {
729
738
  ready: boolean;
730
739
  };
731
740
  };
741
+ "pane:send": {
742
+ payload: {
743
+ paneId: string;
744
+ text: string;
745
+ callerPane?: string;
746
+ };
747
+ data: PaneSendResult;
748
+ };
732
749
  }
733
750
  export type CommandName = keyof Commands;
734
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, chatArchive, chatDmOpen, 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
@@ -211,10 +211,10 @@ function agentStart(a, o = {}) {
211
211
  }
212
212
  function agentResume(a, o = {}) {
213
213
  const payload = { id: a.id };
214
- if (a.prompt !== undefined)
215
- payload.prompt = a.prompt;
216
- if (a.surface !== undefined)
217
- payload.surface = a.surface;
214
+ for (const k of ["prompt", "surface", "workspace", "tab"]) {
215
+ if (a[k] !== undefined)
216
+ payload[k] = a[k];
217
+ }
218
218
  return rtCommand("agent:resume", payload, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 30000 });
219
219
  }
220
220
  function agentGet(a, o = {}) {
@@ -259,6 +259,12 @@ function chatInvite(a, o = {}) {
259
259
  payload.callerPane = a.callerPane;
260
260
  return rtCommand("chat:invite", payload, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 30000 });
261
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
+ }
262
268
  // src/commands.ts
263
269
  var COMMAND_NAMES = [
264
270
  "project-mrs:read",
@@ -303,7 +309,8 @@ var COMMAND_NAMES = [
303
309
  "pane:peek",
304
310
  "pane:accounts",
305
311
  "pane:directories",
306
- "pane:spawn"
312
+ "pane:spawn",
313
+ "pane:send"
307
314
  ];
308
315
  // src/relay.ts
309
316
  var DEFAULT_WS_URL = "ws://127.0.0.1:9401/ws";
@@ -1752,6 +1759,7 @@ export {
1752
1759
  readBranchCache,
1753
1760
  parseIdentity,
1754
1761
  paneSpawn,
1762
+ paneSend,
1755
1763
  panePeek,
1756
1764
  paneList,
1757
1765
  paneDirectories,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mattstack/rt-client",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
package/src/client.ts CHANGED
@@ -365,8 +365,9 @@ export function agentResume(
365
365
  a: Commands["agent:resume"]["payload"], o: RtClientOptions = {},
366
366
  ): Promise<RtResponse<AgentRecord>> {
367
367
  const payload: Record<string, unknown> = { id: a.id };
368
- if (a.prompt !== undefined) payload.prompt = a.prompt;
369
- if (a.surface !== undefined) payload.surface = a.surface;
368
+ for (const k of ["prompt", "surface", "workspace", "tab"] as const) {
369
+ if (a[k] !== undefined) payload[k] = a[k];
370
+ }
370
371
  return rtCommand<AgentRecord>("agent:resume", payload, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 30_000 });
371
372
  }
372
373
 
@@ -422,3 +423,13 @@ export function chatInvite(
422
423
  if (a.callerPane !== undefined) payload.callerPane = a.callerPane;
423
424
  return rtCommand<Commands["chat:invite"]["data"]>("chat:invite", payload, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 30_000 });
424
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
@@ -167,6 +167,10 @@ export interface PaneAccount { slot: number; email: string; alias?: string; head
167
167
  export interface PaneDirectory { path: string; repo: string; branch?: string }
168
168
  export interface InviteResult { paneId: string; delivered: "accepted" | "queued" | "refused"; reason?: string }
169
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
+
170
174
  // SKILLS-53: one judgment, computed once in rt, so the console and the tray
171
175
  // never derive two verdicts that can disagree.
172
176
  export type Attention = {
@@ -315,7 +319,7 @@ export interface Commands {
315
319
 
316
320
  // ─── Agent handoff (rt agent) ────────────────────────────────────────────
317
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 };
318
- "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 };
319
323
  "agent:get": { payload: { id: string }; data: AgentRecord };
320
324
  "agent:list": { payload: { repo?: string }; data: { agents: AgentRecord[] } };
321
325
  "chat:invite": { payload: { paneId: string; room: string; note?: string; from: string; callerPane?: string }; data: InviteResult };
@@ -327,6 +331,7 @@ export interface Commands {
327
331
  payload: { cwd: string; account?: string; model?: string; effort?: string; prompt?: string; workspace?: string };
328
332
  data: { pane: ChatPane; ready: boolean };
329
333
  };
334
+ "pane:send": { payload: { paneId: string; text: string; callerPane?: string }; data: PaneSendResult };
330
335
  }
331
336
 
332
337
  export type CommandName = keyof Commands;
@@ -375,4 +380,5 @@ export const COMMAND_NAMES: readonly CommandName[] = [
375
380
  "pane:accounts",
376
381
  "pane:directories",
377
382
  "pane:spawn",
383
+ "pane:send",
378
384
  ];
package/src/index.ts CHANGED
@@ -42,6 +42,7 @@ export {
42
42
  paneAccounts,
43
43
  paneDirectories,
44
44
  chatInvite,
45
+ paneSend,
45
46
  } from "./client.ts";
46
47
 
47
48
  export { COMMAND_NAMES } from "./commands.ts";
@@ -77,6 +78,8 @@ export type {
77
78
  PaneAccount,
78
79
  PaneDirectory,
79
80
  InviteResult,
81
+ PaneDelivery,
82
+ PaneSendResult,
80
83
  } from "./commands.ts";
81
84
 
82
85
  export { subscribe, createRelay, DEFAULT_WS_URL } from "./relay.ts";