@mattstack/rt-client 0.10.0 → 0.10.1

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
@@ -158,3 +158,6 @@ export declare function paneDirectories(a: Commands["pane:directories"]["payload
158
158
  export declare function chatInvite(a: Commands["chat:invite"]["payload"], o?: RtClientOptions): Promise<RtResponse<Commands["chat:invite"]["data"]>>;
159
159
  /** A working target holds the connection through its prompt wait, so the budget matches chatInvite's 30s. */
160
160
  export declare function paneSend(a: Commands["pane:send"]["payload"], o?: RtClientOptions): Promise<RtResponse<Commands["pane:send"]["data"]>>;
161
+ /** Brings a herdr pane to the front. The daemon routes this to the tray, which
162
+ owns the herdr focus and the native terminal-window raise. */
163
+ export declare function paneFocus(a: Commands["pane:focus"]["payload"], o?: RtClientOptions): Promise<RtResponse<Commands["pane:focus"]["data"]>>;
@@ -189,6 +189,10 @@ export interface PaneSendResult {
189
189
  delivered: PaneDelivery;
190
190
  reason?: string;
191
191
  }
192
+ export interface PaneFocusResult {
193
+ paneId: string;
194
+ focused: boolean;
195
+ }
192
196
  export type Attention = {
193
197
  needs: boolean;
194
198
  reason: "failed" | "stale" | "stranded" | "blocked" | null;
@@ -718,6 +722,12 @@ export interface Commands {
718
722
  };
719
723
  data: PaneSendResult;
720
724
  };
725
+ "pane:focus": {
726
+ payload: {
727
+ paneId: string;
728
+ };
729
+ data: PaneFocusResult;
730
+ };
721
731
  }
722
732
  export type CommandName = keyof Commands;
723
733
  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, chatSignIn, chatSignOut, chatAway, chatBack, chatBuddies, chatDm, chatArchive, chatDmOpen, eventsHead, agentStart, agentResume, agentGet, agentList, paneList, panePeek, paneSpawn, paneAccounts, paneDirectories, chatInvite, paneSend, } from "./client.ts";
3
+ export { readProjectMRs, readDiscussions, readMrsByBranch, readBranchCache, resolveForgeToken, listRuns, getRun, abandonRun, chatJoin, chatLeave, 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";
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, PaneDelivery, PaneSendResult, } 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, PaneFocusResult, } 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
@@ -242,6 +242,9 @@ function paneSend(a, o = {}) {
242
242
  payload.callerPane = a.callerPane;
243
243
  return rtCommand("pane:send", payload, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 30000 });
244
244
  }
245
+ function paneFocus(a, o = {}) {
246
+ return rtCommand("pane:focus", { paneId: a.paneId }, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 1e4 });
247
+ }
245
248
  // src/commands.ts
246
249
  var COMMAND_NAMES = [
247
250
  "project-mrs:read",
@@ -282,7 +285,8 @@ var COMMAND_NAMES = [
282
285
  "pane:accounts",
283
286
  "pane:directories",
284
287
  "pane:spawn",
285
- "pane:send"
288
+ "pane:send",
289
+ "pane:focus"
286
290
  ];
287
291
  // src/relay.ts
288
292
  var DEFAULT_WS_URL = "ws://127.0.0.1:9401/ws";
@@ -1734,6 +1738,7 @@ export {
1734
1738
  paneSend,
1735
1739
  panePeek,
1736
1740
  paneList,
1741
+ paneFocus,
1737
1742
  paneDirectories,
1738
1743
  paneAccounts,
1739
1744
  normalizeRemote,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mattstack/rt-client",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
package/src/client.ts CHANGED
@@ -388,3 +388,12 @@ export function paneSend(
388
388
  if (a.callerPane !== undefined) payload.callerPane = a.callerPane;
389
389
  return rtCommand<Commands["pane:send"]["data"]>("pane:send", payload, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 30_000 });
390
390
  }
391
+
392
+ /** Brings a herdr pane to the front. The daemon routes this to the tray, which
393
+ owns the herdr focus and the native terminal-window raise. */
394
+ export function paneFocus(
395
+ a: Commands["pane:focus"]["payload"],
396
+ o: RtClientOptions = {},
397
+ ): Promise<RtResponse<Commands["pane:focus"]["data"]>> {
398
+ return rtCommand<Commands["pane:focus"]["data"]>("pane:focus", { paneId: a.paneId }, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 10_000 });
399
+ }
package/src/commands.ts CHANGED
@@ -166,6 +166,7 @@ export interface InviteResult { paneId: string; delivered: "accepted" | "queued"
166
166
  /** Duplicated shape on purpose: mirrors lib/daemon/inject.ts's InjectResult. */
167
167
  export type PaneDelivery = "accepted" | "queued" | "refused";
168
168
  export interface PaneSendResult { paneId: string; delivered: PaneDelivery; reason?: string }
169
+ export interface PaneFocusResult { paneId: string; focused: boolean }
169
170
 
170
171
  // SKILLS-53: one judgment, computed once in rt, so the console and the tray
171
172
  // never derive two verdicts that can disagree.
@@ -353,6 +354,7 @@ export interface Commands {
353
354
  data: { pane: ChatPane; ready: boolean };
354
355
  };
355
356
  "pane:send": { payload: { paneId: string; text: string; callerPane?: string }; data: PaneSendResult };
357
+ "pane:focus": { payload: { paneId: string }; data: PaneFocusResult };
356
358
  }
357
359
 
358
360
  export type CommandName = keyof Commands;
@@ -397,4 +399,5 @@ export const COMMAND_NAMES: readonly CommandName[] = [
397
399
  "pane:directories",
398
400
  "pane:spawn",
399
401
  "pane:send",
402
+ "pane:focus",
400
403
  ];
package/src/index.ts CHANGED
@@ -38,6 +38,7 @@ export {
38
38
  paneDirectories,
39
39
  chatInvite,
40
40
  paneSend,
41
+ paneFocus,
41
42
  } from "./client.ts";
42
43
 
43
44
  export { COMMAND_NAMES } from "./commands.ts";
@@ -75,6 +76,7 @@ export type {
75
76
  InviteResult,
76
77
  PaneDelivery,
77
78
  PaneSendResult,
79
+ PaneFocusResult,
78
80
  } from "./commands.ts";
79
81
 
80
82
  export { subscribe, createRelay, DEFAULT_WS_URL } from "./relay.ts";