@mattstack/rt-client 0.8.0 → 0.9.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
@@ -121,18 +121,7 @@ export declare function chatUnreadWaking(a: {
121
121
  maxId: number;
122
122
  }[];
123
123
  }>>;
124
- export declare function chatSignIn(a: {
125
- sessionId: string;
126
- baseHandle: string;
127
- cwd?: string;
128
- repo?: string;
129
- branch?: string;
130
- pane?: string;
131
- statusText?: string;
132
- }, o?: RtClientOptions): Promise<RtResponse<{
133
- handle: string;
134
- reclaimed: boolean;
135
- }>>;
124
+ export declare function chatSignIn(a: Commands["chat:sign-in"]["payload"], o?: RtClientOptions): Promise<RtResponse<Commands["chat:sign-in"]["data"]>>;
136
125
  export declare function chatSignOut(a: {
137
126
  sessionId: string;
138
127
  }, o?: RtClientOptions): Promise<RtResponse<Record<string, never>>>;
@@ -548,10 +548,11 @@ export interface Commands {
548
548
  }[];
549
549
  };
550
550
  };
551
+ /** No `baseHandle` means "draw me a first name": the daemon picks the least recently used pool name no live session holds. */
551
552
  "chat:sign-in": {
552
553
  payload: {
553
554
  sessionId: string;
554
- baseHandle: string;
555
+ baseHandle?: string;
555
556
  cwd?: string;
556
557
  repo?: string;
557
558
  branch?: string;
@@ -560,6 +561,7 @@ export interface Commands {
560
561
  };
561
562
  data: {
562
563
  handle: string;
564
+ baseHandle: string;
563
565
  reclaimed: boolean;
564
566
  };
565
567
  };
package/dist/index.js CHANGED
@@ -146,7 +146,9 @@ function chatUnreadWaking(a, o = {}) {
146
146
  return rtCommand("chat:unread-waking", payload, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 1e4 });
147
147
  }
148
148
  function chatSignIn(a, o = {}) {
149
- const payload = { sessionId: a.sessionId, baseHandle: a.baseHandle };
149
+ const payload = { sessionId: a.sessionId };
150
+ if (a.baseHandle !== undefined)
151
+ payload.baseHandle = a.baseHandle;
150
152
  if (a.cwd !== undefined)
151
153
  payload.cwd = a.cwd;
152
154
  if (a.repo !== undefined)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mattstack/rt-client",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
package/src/client.ts CHANGED
@@ -261,16 +261,17 @@ export function chatUnreadWaking(
261
261
  // ─── Presence ──────────────────────────────────────────────────────────
262
262
 
263
263
  export function chatSignIn(
264
- a: { sessionId: string; baseHandle: string; cwd?: string; repo?: string; branch?: string; pane?: string; statusText?: string },
264
+ a: Commands["chat:sign-in"]["payload"],
265
265
  o: RtClientOptions = {},
266
- ): Promise<RtResponse<{ handle: string; reclaimed: boolean }>> {
267
- const payload: Record<string, unknown> = { sessionId: a.sessionId, baseHandle: a.baseHandle };
266
+ ): Promise<RtResponse<Commands["chat:sign-in"]["data"]>> {
267
+ const payload: Record<string, unknown> = { sessionId: a.sessionId };
268
+ if (a.baseHandle !== undefined) payload.baseHandle = a.baseHandle;
268
269
  if (a.cwd !== undefined) payload.cwd = a.cwd;
269
270
  if (a.repo !== undefined) payload.repo = a.repo;
270
271
  if (a.branch !== undefined) payload.branch = a.branch;
271
272
  if (a.pane !== undefined) payload.pane = a.pane;
272
273
  if (a.statusText !== undefined) payload.statusText = a.statusText;
273
- return rtCommand<{ handle: string; reclaimed: boolean }>("chat:sign-in", payload, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 10_000 });
274
+ return rtCommand<Commands["chat:sign-in"]["data"]>("chat:sign-in", payload, { sockPath: o.sockPath, timeoutMs: o.timeoutMs ?? 10_000 });
274
275
  }
275
276
 
276
277
  export function chatSignOut(
package/src/commands.ts CHANGED
@@ -300,9 +300,10 @@ export interface Commands {
300
300
 
301
301
  // A session id keys these to one signed-in handle, not a room-membership
302
302
  // handle string.
303
+ /** No `baseHandle` means "draw me a first name": the daemon picks the least recently used pool name no live session holds. */
303
304
  "chat:sign-in": {
304
- payload: { sessionId: string; baseHandle: string; cwd?: string; repo?: string; branch?: string; pane?: string; statusText?: string };
305
- data: { handle: string; reclaimed: boolean };
305
+ payload: { sessionId: string; baseHandle?: string; cwd?: string; repo?: string; branch?: string; pane?: string; statusText?: string };
306
+ data: { handle: string; baseHandle: string; reclaimed: boolean };
306
307
  };
307
308
  "chat:sign-out": { payload: { sessionId: string }; data: Record<string, never> };
308
309
  "chat:away": { payload: { sessionId: string; text: string }; data: Record<string, never> };