linkshell-cli 0.6.1 → 0.6.3

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.
Files changed (108) hide show
  1. package/README.md +47 -132
  2. package/dist/cli/src/auth.js +1 -1
  3. package/dist/cli/src/auth.js.map +1 -1
  4. package/dist/cli/src/commands/doctor.d.ts +1 -1
  5. package/dist/cli/src/commands/doctor.js +76 -36
  6. package/dist/cli/src/commands/doctor.js.map +1 -1
  7. package/dist/cli/src/commands/host.d.ts +15 -0
  8. package/dist/cli/src/commands/host.js +101 -20
  9. package/dist/cli/src/commands/host.js.map +1 -1
  10. package/dist/cli/src/commands/logout.d.ts +1 -1
  11. package/dist/cli/src/commands/logout.js +10 -2
  12. package/dist/cli/src/commands/logout.js.map +1 -1
  13. package/dist/cli/src/commands/upgrade.js +11 -0
  14. package/dist/cli/src/commands/upgrade.js.map +1 -1
  15. package/dist/cli/src/config.js +1 -1
  16. package/dist/cli/src/config.js.map +1 -1
  17. package/dist/cli/src/index.js +105 -120
  18. package/dist/cli/src/index.js.map +1 -1
  19. package/dist/cli/src/utils/daemon.d.ts +2 -0
  20. package/dist/cli/src/utils/daemon.js +4 -0
  21. package/dist/cli/src/utils/daemon.js.map +1 -1
  22. package/dist/cli/tsconfig.tsbuildinfo +1 -1
  23. package/dist/host/src/carry.d.ts +15 -0
  24. package/dist/host/src/carry.js +83 -0
  25. package/dist/host/src/carry.js.map +1 -0
  26. package/dist/host/src/drivers/acp/driver.d.ts +21 -3
  27. package/dist/host/src/drivers/acp/driver.js +99 -13
  28. package/dist/host/src/drivers/acp/driver.js.map +1 -1
  29. package/dist/host/src/drivers/acp/mapper.d.ts +5 -1
  30. package/dist/host/src/drivers/acp/mapper.js +58 -6
  31. package/dist/host/src/drivers/acp/mapper.js.map +1 -1
  32. package/dist/host/src/drivers/claude/driver.d.ts +76 -8
  33. package/dist/host/src/drivers/claude/driver.js +510 -29
  34. package/dist/host/src/drivers/claude/driver.js.map +1 -1
  35. package/dist/host/src/drivers/claude/holders.d.ts +9 -0
  36. package/dist/host/src/drivers/claude/holders.js +61 -0
  37. package/dist/host/src/drivers/claude/holders.js.map +1 -0
  38. package/dist/host/src/drivers/claude/transcript.d.ts +105 -61
  39. package/dist/host/src/drivers/claude/transcript.js +260 -22
  40. package/dist/host/src/drivers/claude/transcript.js.map +1 -1
  41. package/dist/host/src/drivers/codex/commands.d.ts +27 -0
  42. package/dist/host/src/drivers/codex/commands.js +23 -0
  43. package/dist/host/src/drivers/codex/commands.js.map +1 -0
  44. package/dist/host/src/drivers/codex/driver.d.ts +21 -1
  45. package/dist/host/src/drivers/codex/driver.js +140 -1
  46. package/dist/host/src/drivers/codex/driver.js.map +1 -1
  47. package/dist/host/src/drivers/codex/mapper.d.ts +4 -0
  48. package/dist/host/src/drivers/codex/mapper.js +29 -5
  49. package/dist/host/src/drivers/codex/mapper.js.map +1 -1
  50. package/dist/host/src/drivers/types.d.ts +45 -4
  51. package/dist/host/src/fs.d.ts +26 -4
  52. package/dist/host/src/fs.js +71 -17
  53. package/dist/host/src/fs.js.map +1 -1
  54. package/dist/host/src/gateway.d.ts +3 -0
  55. package/dist/host/src/gateway.js +10 -1
  56. package/dist/host/src/gateway.js.map +1 -1
  57. package/dist/host/src/host.d.ts +7 -3
  58. package/dist/host/src/host.js +53 -21
  59. package/dist/host/src/host.js.map +1 -1
  60. package/dist/host/src/hub.d.ts +98 -14
  61. package/dist/host/src/hub.js +639 -27
  62. package/dist/host/src/hub.js.map +1 -1
  63. package/dist/host/src/index.d.ts +1 -1
  64. package/dist/host/src/index.js +1 -1
  65. package/dist/host/src/index.js.map +1 -1
  66. package/dist/host/src/legacy.d.ts +7 -0
  67. package/dist/host/src/legacy.js +36 -0
  68. package/dist/host/src/legacy.js.map +1 -0
  69. package/dist/host/src/rpc/server.d.ts +4 -2
  70. package/dist/host/src/rpc/server.js +62 -5
  71. package/dist/host/src/rpc/server.js.map +1 -1
  72. package/dist/host/src/screen.d.ts +11 -0
  73. package/dist/host/src/screen.js +54 -2
  74. package/dist/host/src/screen.js.map +1 -1
  75. package/dist/host/src/shell-env.d.ts +6 -0
  76. package/dist/host/src/shell-env.js +48 -0
  77. package/dist/host/src/shell-env.js.map +1 -1
  78. package/dist/host/src/slim.d.ts +17 -0
  79. package/dist/host/src/slim.js +66 -0
  80. package/dist/host/src/slim.js.map +1 -0
  81. package/dist/host/src/store.d.ts +81 -3
  82. package/dist/host/src/store.js +249 -16
  83. package/dist/host/src/store.js.map +1 -1
  84. package/dist/host/src/terminals.d.ts +4 -4
  85. package/dist/host/src/terminals.js +19 -4
  86. package/dist/host/src/terminals.js.map +1 -1
  87. package/dist/host/src/worktrees.d.ts +36 -0
  88. package/dist/host/src/worktrees.js +96 -0
  89. package/dist/host/src/worktrees.js.map +1 -0
  90. package/dist/wire/src/model.d.ts +334 -139
  91. package/dist/wire/src/model.js +68 -0
  92. package/dist/wire/src/model.js.map +1 -1
  93. package/dist/wire/src/relay-client.d.ts +2 -0
  94. package/dist/wire/src/relay-client.js +12 -0
  95. package/dist/wire/src/relay-client.js.map +1 -1
  96. package/dist/wire/src/rpc.d.ts +7273 -890
  97. package/dist/wire/src/rpc.js +154 -6
  98. package/dist/wire/src/rpc.js.map +1 -1
  99. package/dist/wire/src/updates.d.ts +498 -498
  100. package/package.json +5 -5
  101. package/src/auth.ts +1 -1
  102. package/src/commands/doctor.ts +76 -34
  103. package/src/commands/host.ts +109 -19
  104. package/src/commands/logout.ts +10 -2
  105. package/src/commands/upgrade.ts +11 -0
  106. package/src/config.ts +1 -1
  107. package/src/index.ts +104 -137
  108. package/src/utils/daemon.ts +5 -0
@@ -17,25 +17,31 @@ export declare const agentCapabilitiesSchema: z.ZodObject<{
17
17
  steer: z.ZodBoolean;
18
18
  permissions: z.ZodBoolean;
19
19
  images: z.ZodBoolean;
20
+ /**
21
+ * The agent forks sessions itself, keeping everything it knew. Every agent's
22
+ * sessions can be forked: without this (or from a single reply, where the
23
+ * agent only forks whole sessions) LinkShell makes the fork — the new session
24
+ * shows the conversation and its agent is told it as text.
25
+ */
20
26
  fork: z.ZodBoolean;
21
27
  models: z.ZodBoolean;
22
28
  modes: z.ZodBoolean;
23
29
  }, "strip", z.ZodTypeAny, {
24
- models: boolean;
25
- modes: boolean;
30
+ interrupt: boolean;
26
31
  steer: boolean;
32
+ permissions: boolean;
27
33
  images: boolean;
28
34
  fork: boolean;
29
- permissions: boolean;
30
- interrupt: boolean;
31
- }, {
32
35
  models: boolean;
33
36
  modes: boolean;
37
+ }, {
38
+ interrupt: boolean;
34
39
  steer: boolean;
40
+ permissions: boolean;
35
41
  images: boolean;
36
42
  fork: boolean;
37
- permissions: boolean;
38
- interrupt: boolean;
43
+ models: boolean;
44
+ modes: boolean;
39
45
  }>;
40
46
  export type AgentCapabilities = z.infer<typeof agentCapabilitiesSchema>;
41
47
  /**
@@ -88,68 +94,74 @@ export declare const agentInfoSchema: z.ZodObject<{
88
94
  steer: z.ZodBoolean;
89
95
  permissions: z.ZodBoolean;
90
96
  images: z.ZodBoolean;
97
+ /**
98
+ * The agent forks sessions itself, keeping everything it knew. Every agent's
99
+ * sessions can be forked: without this (or from a single reply, where the
100
+ * agent only forks whole sessions) LinkShell makes the fork — the new session
101
+ * shows the conversation and its agent is told it as text.
102
+ */
91
103
  fork: z.ZodBoolean;
92
104
  models: z.ZodBoolean;
93
105
  modes: z.ZodBoolean;
94
106
  }, "strip", z.ZodTypeAny, {
95
- models: boolean;
96
- modes: boolean;
107
+ interrupt: boolean;
97
108
  steer: boolean;
109
+ permissions: boolean;
98
110
  images: boolean;
99
111
  fork: boolean;
100
- permissions: boolean;
101
- interrupt: boolean;
102
- }, {
103
112
  models: boolean;
104
113
  modes: boolean;
114
+ }, {
115
+ interrupt: boolean;
105
116
  steer: boolean;
117
+ permissions: boolean;
106
118
  images: boolean;
107
119
  fork: boolean;
108
- permissions: boolean;
109
- interrupt: boolean;
120
+ models: boolean;
121
+ modes: boolean;
110
122
  }>;
111
123
  }, "strip", z.ZodTypeAny, {
112
124
  id: string;
113
125
  label: string;
126
+ tier: "multi_client" | "handoff" | "remote" | "terminal";
127
+ installed: boolean;
114
128
  capabilities: {
115
- models: boolean;
116
- modes: boolean;
129
+ interrupt: boolean;
117
130
  steer: boolean;
131
+ permissions: boolean;
118
132
  images: boolean;
119
133
  fork: boolean;
120
- permissions: boolean;
121
- interrupt: boolean;
134
+ models: boolean;
135
+ modes: boolean;
122
136
  };
123
- tier: "multi_client" | "handoff" | "remote" | "terminal";
124
- installed: boolean;
137
+ version?: string | undefined;
138
+ problem?: string | undefined;
125
139
  auth?: {
126
140
  state: "unknown" | "ok" | "missing";
127
141
  method?: string | undefined;
128
142
  hint?: string | undefined;
129
143
  } | undefined;
130
- version?: string | undefined;
131
- problem?: string | undefined;
132
144
  }, {
133
145
  id: string;
134
146
  label: string;
147
+ tier: "multi_client" | "handoff" | "remote" | "terminal";
148
+ installed: boolean;
135
149
  capabilities: {
136
- models: boolean;
137
- modes: boolean;
150
+ interrupt: boolean;
138
151
  steer: boolean;
152
+ permissions: boolean;
139
153
  images: boolean;
140
154
  fork: boolean;
141
- permissions: boolean;
142
- interrupt: boolean;
155
+ models: boolean;
156
+ modes: boolean;
143
157
  };
144
- tier: "multi_client" | "handoff" | "remote" | "terminal";
145
- installed: boolean;
158
+ version?: string | undefined;
159
+ problem?: string | undefined;
146
160
  auth?: {
147
161
  state: "unknown" | "ok" | "missing";
148
162
  method?: string | undefined;
149
163
  hint?: string | undefined;
150
164
  } | undefined;
151
- version?: string | undefined;
152
- problem?: string | undefined;
153
165
  }>;
154
166
  export type AgentInfo = z.infer<typeof agentInfoSchema>;
155
167
  /**
@@ -167,13 +179,13 @@ export declare const permissionOptionSchema: z.ZodObject<{
167
179
  name: z.ZodString;
168
180
  kind: z.ZodEnum<["allow_once", "allow_always", "reject_once", "reject_always"]>;
169
181
  }, "strip", z.ZodTypeAny, {
182
+ optionId: string;
170
183
  name: string;
171
184
  kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
172
- optionId: string;
173
185
  }, {
186
+ optionId: string;
174
187
  name: string;
175
188
  kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
176
- optionId: string;
177
189
  }>;
178
190
  export type PermissionOption = z.infer<typeof permissionOptionSchema>;
179
191
  /** What a running session is doing right now, for list rows. Live only. */
@@ -182,13 +194,13 @@ export declare const sessionActivitySchema: z.ZodObject<{
182
194
  title: z.ZodOptional<z.ZodString>;
183
195
  toolKind: z.ZodOptional<z.ZodEnum<["read", "edit", "delete", "move", "search", "execute", "think", "fetch", "other"]>>;
184
196
  }, "strip", z.ZodTypeAny, {
185
- kind: "thinking" | "tool" | "responding";
197
+ kind: "thinking" | "responding" | "tool";
186
198
  title?: string | undefined;
187
- toolKind?: "search" | "other" | "read" | "edit" | "delete" | "move" | "execute" | "think" | "fetch" | undefined;
199
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
188
200
  }, {
189
- kind: "thinking" | "tool" | "responding";
201
+ kind: "thinking" | "responding" | "tool";
190
202
  title?: string | undefined;
191
- toolKind?: "search" | "other" | "read" | "edit" | "delete" | "move" | "execute" | "think" | "fetch" | undefined;
203
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
192
204
  }>;
193
205
  export type SessionActivity = z.infer<typeof sessionActivitySchema>;
194
206
  /** The oldest unanswered permission request, so lists can offer approval inline. Live only. */
@@ -202,36 +214,80 @@ export declare const pendingPermissionSchema: z.ZodObject<{
202
214
  name: z.ZodString;
203
215
  kind: z.ZodEnum<["allow_once", "allow_always", "reject_once", "reject_always"]>;
204
216
  }, "strip", z.ZodTypeAny, {
217
+ optionId: string;
205
218
  name: string;
206
219
  kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
207
- optionId: string;
208
220
  }, {
221
+ optionId: string;
209
222
  name: string;
210
223
  kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
211
- optionId: string;
212
224
  }>, "many">;
213
225
  }, "strip", z.ZodTypeAny, {
214
226
  options: {
227
+ optionId: string;
215
228
  name: string;
216
229
  kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
217
- optionId: string;
218
230
  }[];
219
- requestId: string;
220
231
  title: string;
221
- detail?: string | undefined;
232
+ requestId: string;
222
233
  toolCallId?: string | undefined;
234
+ detail?: string | undefined;
223
235
  }, {
224
236
  options: {
237
+ optionId: string;
225
238
  name: string;
226
239
  kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
227
- optionId: string;
228
240
  }[];
229
- requestId: string;
230
241
  title: string;
231
- detail?: string | undefined;
242
+ requestId: string;
232
243
  toolCallId?: string | undefined;
244
+ detail?: string | undefined;
233
245
  }>;
234
246
  export type PendingPermissionSummary = z.infer<typeof pendingPermissionSchema>;
247
+ export declare const queuedMessageSchema: z.ZodObject<{
248
+ clientMessageId: z.ZodString;
249
+ /** The message's text (images are counted, not sent). */
250
+ text: z.ZodString;
251
+ images: z.ZodNumber;
252
+ }, "strip", z.ZodTypeAny, {
253
+ images: number;
254
+ clientMessageId: string;
255
+ text: string;
256
+ }, {
257
+ images: number;
258
+ clientMessageId: string;
259
+ text: string;
260
+ }>;
261
+ export type QueuedMessage = z.infer<typeof queuedMessageSchema>;
262
+ /** A sub-agent a session started: the tool call it runs under, and how it is doing. */
263
+ export declare const subagentInfoSchema: z.ZodObject<{
264
+ toolCallId: z.ZodString;
265
+ /** What it was asked to do. */
266
+ task: z.ZodString;
267
+ /** Its role or type, e.g. "Explore". */
268
+ agentType: z.ZodOptional<z.ZodString>;
269
+ running: z.ZodBoolean;
270
+ failed: z.ZodOptional<z.ZodBoolean>;
271
+ startedAt: z.ZodNumber;
272
+ endedAt: z.ZodOptional<z.ZodNumber>;
273
+ }, "strip", z.ZodTypeAny, {
274
+ running: boolean;
275
+ toolCallId: string;
276
+ task: string;
277
+ startedAt: number;
278
+ agentType?: string | undefined;
279
+ failed?: boolean | undefined;
280
+ endedAt?: number | undefined;
281
+ }, {
282
+ running: boolean;
283
+ toolCallId: string;
284
+ task: string;
285
+ startedAt: number;
286
+ agentType?: string | undefined;
287
+ failed?: boolean | undefined;
288
+ endedAt?: number | undefined;
289
+ }>;
290
+ export type SubagentInfo = z.infer<typeof subagentInfoSchema>;
235
291
  export declare const sessionSummarySchema: z.ZodObject<{
236
292
  /** `${agent}:${nativeId}` — stable across daemon restarts and rediscovery. */
237
293
  id: z.ZodString;
@@ -253,13 +309,13 @@ export declare const sessionSummarySchema: z.ZodObject<{
253
309
  title: z.ZodOptional<z.ZodString>;
254
310
  toolKind: z.ZodOptional<z.ZodEnum<["read", "edit", "delete", "move", "search", "execute", "think", "fetch", "other"]>>;
255
311
  }, "strip", z.ZodTypeAny, {
256
- kind: "thinking" | "tool" | "responding";
312
+ kind: "thinking" | "responding" | "tool";
257
313
  title?: string | undefined;
258
- toolKind?: "search" | "other" | "read" | "edit" | "delete" | "move" | "execute" | "think" | "fetch" | undefined;
314
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
259
315
  }, {
260
- kind: "thinking" | "tool" | "responding";
316
+ kind: "thinking" | "responding" | "tool";
261
317
  title?: string | undefined;
262
- toolKind?: "search" | "other" | "read" | "edit" | "delete" | "move" | "execute" | "think" | "fetch" | undefined;
318
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
263
319
  }>>;
264
320
  permission: z.ZodOptional<z.ZodObject<{
265
321
  requestId: z.ZodString;
@@ -271,96 +327,167 @@ export declare const sessionSummarySchema: z.ZodObject<{
271
327
  name: z.ZodString;
272
328
  kind: z.ZodEnum<["allow_once", "allow_always", "reject_once", "reject_always"]>;
273
329
  }, "strip", z.ZodTypeAny, {
330
+ optionId: string;
274
331
  name: string;
275
332
  kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
276
- optionId: string;
277
333
  }, {
334
+ optionId: string;
278
335
  name: string;
279
336
  kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
280
- optionId: string;
281
337
  }>, "many">;
282
338
  }, "strip", z.ZodTypeAny, {
283
339
  options: {
340
+ optionId: string;
284
341
  name: string;
285
342
  kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
286
- optionId: string;
287
343
  }[];
288
- requestId: string;
289
344
  title: string;
290
- detail?: string | undefined;
345
+ requestId: string;
291
346
  toolCallId?: string | undefined;
347
+ detail?: string | undefined;
292
348
  }, {
293
349
  options: {
350
+ optionId: string;
294
351
  name: string;
295
352
  kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
296
- optionId: string;
297
353
  }[];
298
- requestId: string;
299
354
  title: string;
300
- detail?: string | undefined;
355
+ requestId: string;
301
356
  toolCallId?: string | undefined;
357
+ detail?: string | undefined;
358
+ }>>;
359
+ /**
360
+ * Live only: messages waiting for the current turn to end, when the host
361
+ * holds them (agents that can't take input mid-turn). Oldest first.
362
+ */
363
+ queue: z.ZodOptional<z.ZodArray<z.ZodObject<{
364
+ clientMessageId: z.ZodString;
365
+ /** The message's text (images are counted, not sent). */
366
+ text: z.ZodString;
367
+ images: z.ZodNumber;
368
+ }, "strip", z.ZodTypeAny, {
369
+ images: number;
370
+ clientMessageId: string;
371
+ text: string;
372
+ }, {
373
+ images: number;
374
+ clientMessageId: string;
375
+ text: string;
376
+ }>, "many">>;
377
+ /**
378
+ * The session works in a git worktree LinkShell made for it: its own
379
+ * checkout and branch, so it can't disturb the project's working directory.
380
+ * `cwd` is inside the worktree; `source` is the directory it was made from
381
+ * (the project the session belongs to).
382
+ */
383
+ worktree: z.ZodOptional<z.ZodObject<{
384
+ branch: z.ZodString;
385
+ source: z.ZodString;
386
+ }, "strip", z.ZodTypeAny, {
387
+ branch: string;
388
+ source: string;
389
+ }, {
390
+ branch: string;
391
+ source: string;
392
+ }>>;
393
+ /** Live only, for sessions that started sub-agents: how many, and how many are working now (`sessions.subagents` lists them). */
394
+ subagents: z.ZodOptional<z.ZodObject<{
395
+ total: z.ZodNumber;
396
+ running: z.ZodNumber;
397
+ }, "strip", z.ZodTypeAny, {
398
+ running: number;
399
+ total: number;
400
+ }, {
401
+ running: number;
402
+ total: number;
302
403
  }>>;
303
404
  }, "strip", z.ZodTypeAny, {
405
+ state: "idle" | "running" | "waiting" | "error" | "offline";
304
406
  id: string;
407
+ agent: string;
408
+ nativeId: string;
305
409
  cwd: string;
306
- createdAt: number;
307
410
  pendingPermissions: number;
411
+ createdAt: number;
308
412
  updatedAt: number;
309
- archived: boolean;
310
- state: "idle" | "error" | "running" | "waiting" | "offline";
311
- agent: string;
312
- nativeId: string;
313
413
  lastSeq: number;
414
+ archived: boolean;
314
415
  title?: string | undefined;
416
+ preview?: string | undefined;
417
+ driver?: "remote" | "desktop" | "none" | undefined;
315
418
  model?: string | undefined;
419
+ activity?: {
420
+ kind: "thinking" | "responding" | "tool";
421
+ title?: string | undefined;
422
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
423
+ } | undefined;
316
424
  permission?: {
317
425
  options: {
426
+ optionId: string;
318
427
  name: string;
319
428
  kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
320
- optionId: string;
321
429
  }[];
322
- requestId: string;
323
430
  title: string;
324
- detail?: string | undefined;
431
+ requestId: string;
325
432
  toolCallId?: string | undefined;
433
+ detail?: string | undefined;
326
434
  } | undefined;
327
- preview?: string | undefined;
328
- driver?: "none" | "desktop" | "remote" | undefined;
329
- activity?: {
330
- kind: "thinking" | "tool" | "responding";
331
- title?: string | undefined;
332
- toolKind?: "search" | "other" | "read" | "edit" | "delete" | "move" | "execute" | "think" | "fetch" | undefined;
435
+ queue?: {
436
+ images: number;
437
+ clientMessageId: string;
438
+ text: string;
439
+ }[] | undefined;
440
+ worktree?: {
441
+ branch: string;
442
+ source: string;
443
+ } | undefined;
444
+ subagents?: {
445
+ running: number;
446
+ total: number;
333
447
  } | undefined;
334
448
  }, {
449
+ state: "idle" | "running" | "waiting" | "error" | "offline";
335
450
  id: string;
451
+ agent: string;
452
+ nativeId: string;
336
453
  cwd: string;
337
- createdAt: number;
338
454
  pendingPermissions: number;
455
+ createdAt: number;
339
456
  updatedAt: number;
340
- archived: boolean;
341
- state: "idle" | "error" | "running" | "waiting" | "offline";
342
- agent: string;
343
- nativeId: string;
344
457
  lastSeq: number;
458
+ archived: boolean;
345
459
  title?: string | undefined;
460
+ preview?: string | undefined;
461
+ driver?: "remote" | "desktop" | "none" | undefined;
346
462
  model?: string | undefined;
463
+ activity?: {
464
+ kind: "thinking" | "responding" | "tool";
465
+ title?: string | undefined;
466
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
467
+ } | undefined;
347
468
  permission?: {
348
469
  options: {
470
+ optionId: string;
349
471
  name: string;
350
472
  kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
351
- optionId: string;
352
473
  }[];
353
- requestId: string;
354
474
  title: string;
355
- detail?: string | undefined;
475
+ requestId: string;
356
476
  toolCallId?: string | undefined;
477
+ detail?: string | undefined;
357
478
  } | undefined;
358
- preview?: string | undefined;
359
- driver?: "none" | "desktop" | "remote" | undefined;
360
- activity?: {
361
- kind: "thinking" | "tool" | "responding";
362
- title?: string | undefined;
363
- toolKind?: "search" | "other" | "read" | "edit" | "delete" | "move" | "execute" | "think" | "fetch" | undefined;
479
+ queue?: {
480
+ images: number;
481
+ clientMessageId: string;
482
+ text: string;
483
+ }[] | undefined;
484
+ worktree?: {
485
+ branch: string;
486
+ source: string;
487
+ } | undefined;
488
+ subagents?: {
489
+ running: number;
490
+ total: number;
364
491
  } | undefined;
365
492
  }>;
366
493
  export type SessionSummary = z.infer<typeof sessionSummarySchema>;
@@ -369,21 +496,79 @@ export declare function parseSessionId(id: string): {
369
496
  agent: string;
370
497
  nativeId: string;
371
498
  } | null;
499
+ /** What git says about a directory, to offer starting a session in a worktree of it. */
500
+ export declare const gitInfoSchema: z.ZodObject<{
501
+ /** The repository's top directory. */
502
+ root: z.ZodString;
503
+ /** The branch checked out; absent on a detached HEAD. */
504
+ branch: z.ZodOptional<z.ZodString>;
505
+ /** The commit checked out, abbreviated; absent before the first commit. */
506
+ head: z.ZodOptional<z.ZodString>;
507
+ /** Uncommitted changes in the working directory (a new worktree starts from the last commit, without them). */
508
+ dirty: z.ZodBoolean;
509
+ }, "strip", z.ZodTypeAny, {
510
+ dirty: boolean;
511
+ root: string;
512
+ branch?: string | undefined;
513
+ head?: string | undefined;
514
+ }, {
515
+ dirty: boolean;
516
+ root: string;
517
+ branch?: string | undefined;
518
+ head?: string | undefined;
519
+ }>;
520
+ export type GitInfo = z.infer<typeof gitInfoSchema>;
521
+ /** A worktree LinkShell made for sessions. */
522
+ export declare const worktreeEntrySchema: z.ZodObject<{
523
+ /** The worktree's top directory. */
524
+ path: z.ZodString;
525
+ branch: z.ZodString;
526
+ /** The repository it belongs to. */
527
+ source: z.ZodString;
528
+ createdAt: z.ZodNumber;
529
+ /** Sessions working in it. */
530
+ sessions: z.ZodArray<z.ZodString, "many">;
531
+ /** Uncommitted changes in it. */
532
+ dirty: z.ZodBoolean;
533
+ /** Commits made in it since it was created. */
534
+ ahead: z.ZodNumber;
535
+ }, "strip", z.ZodTypeAny, {
536
+ dirty: boolean;
537
+ path: string;
538
+ createdAt: number;
539
+ branch: string;
540
+ source: string;
541
+ sessions: string[];
542
+ ahead: number;
543
+ }, {
544
+ dirty: boolean;
545
+ path: string;
546
+ createdAt: number;
547
+ branch: string;
548
+ source: string;
549
+ sessions: string[];
550
+ ahead: number;
551
+ }>;
552
+ export type WorktreeEntry = z.infer<typeof worktreeEntrySchema>;
372
553
  export declare const projectSummarySchema: z.ZodObject<{
373
554
  cwd: z.ZodString;
374
555
  name: z.ZodString;
375
556
  lastActiveAt: z.ZodNumber;
376
557
  sessionCount: z.ZodNumber;
558
+ /** For a git repository: the branch checked out there now (or the abbreviated commit, on a detached HEAD). */
559
+ branch: z.ZodOptional<z.ZodString>;
377
560
  }, "strip", z.ZodTypeAny, {
378
- cwd: string;
379
561
  name: string;
562
+ cwd: string;
380
563
  lastActiveAt: number;
381
564
  sessionCount: number;
565
+ branch?: string | undefined;
382
566
  }, {
383
- cwd: string;
384
567
  name: string;
568
+ cwd: string;
385
569
  lastActiveAt: number;
386
570
  sessionCount: number;
571
+ branch?: string | undefined;
387
572
  }>;
388
573
  export type ProjectSummary = z.infer<typeof projectSummarySchema>;
389
574
  export declare const machineInfoSchema: z.ZodObject<{
@@ -391,6 +576,8 @@ export declare const machineInfoSchema: z.ZodObject<{
391
576
  hostname: z.ZodString;
392
577
  platform: z.ZodString;
393
578
  hostVersion: z.ZodString;
579
+ /** The host user's home directory, so apps can show paths as `~/…`. */
580
+ home: z.ZodOptional<z.ZodString>;
394
581
  agents: z.ZodArray<z.ZodObject<{
395
582
  id: z.ZodString;
396
583
  label: z.ZodString;
@@ -420,123 +607,131 @@ export declare const machineInfoSchema: z.ZodObject<{
420
607
  steer: z.ZodBoolean;
421
608
  permissions: z.ZodBoolean;
422
609
  images: z.ZodBoolean;
610
+ /**
611
+ * The agent forks sessions itself, keeping everything it knew. Every agent's
612
+ * sessions can be forked: without this (or from a single reply, where the
613
+ * agent only forks whole sessions) LinkShell makes the fork — the new session
614
+ * shows the conversation and its agent is told it as text.
615
+ */
423
616
  fork: z.ZodBoolean;
424
617
  models: z.ZodBoolean;
425
618
  modes: z.ZodBoolean;
426
619
  }, "strip", z.ZodTypeAny, {
427
- models: boolean;
428
- modes: boolean;
620
+ interrupt: boolean;
429
621
  steer: boolean;
622
+ permissions: boolean;
430
623
  images: boolean;
431
624
  fork: boolean;
432
- permissions: boolean;
433
- interrupt: boolean;
434
- }, {
435
625
  models: boolean;
436
626
  modes: boolean;
627
+ }, {
628
+ interrupt: boolean;
437
629
  steer: boolean;
630
+ permissions: boolean;
438
631
  images: boolean;
439
632
  fork: boolean;
440
- permissions: boolean;
441
- interrupt: boolean;
633
+ models: boolean;
634
+ modes: boolean;
442
635
  }>;
443
636
  }, "strip", z.ZodTypeAny, {
444
637
  id: string;
445
638
  label: string;
639
+ tier: "multi_client" | "handoff" | "remote" | "terminal";
640
+ installed: boolean;
446
641
  capabilities: {
447
- models: boolean;
448
- modes: boolean;
642
+ interrupt: boolean;
449
643
  steer: boolean;
644
+ permissions: boolean;
450
645
  images: boolean;
451
646
  fork: boolean;
452
- permissions: boolean;
453
- interrupt: boolean;
647
+ models: boolean;
648
+ modes: boolean;
454
649
  };
455
- tier: "multi_client" | "handoff" | "remote" | "terminal";
456
- installed: boolean;
650
+ version?: string | undefined;
651
+ problem?: string | undefined;
457
652
  auth?: {
458
653
  state: "unknown" | "ok" | "missing";
459
654
  method?: string | undefined;
460
655
  hint?: string | undefined;
461
656
  } | undefined;
462
- version?: string | undefined;
463
- problem?: string | undefined;
464
657
  }, {
465
658
  id: string;
466
659
  label: string;
660
+ tier: "multi_client" | "handoff" | "remote" | "terminal";
661
+ installed: boolean;
467
662
  capabilities: {
468
- models: boolean;
469
- modes: boolean;
663
+ interrupt: boolean;
470
664
  steer: boolean;
665
+ permissions: boolean;
471
666
  images: boolean;
472
667
  fork: boolean;
473
- permissions: boolean;
474
- interrupt: boolean;
668
+ models: boolean;
669
+ modes: boolean;
475
670
  };
476
- tier: "multi_client" | "handoff" | "remote" | "terminal";
477
- installed: boolean;
671
+ version?: string | undefined;
672
+ problem?: string | undefined;
478
673
  auth?: {
479
674
  state: "unknown" | "ok" | "missing";
480
675
  method?: string | undefined;
481
676
  hint?: string | undefined;
482
677
  } | undefined;
483
- version?: string | undefined;
484
- problem?: string | undefined;
485
678
  }>, "many">;
486
679
  }, "strip", z.ZodTypeAny, {
487
680
  machineId: string;
488
681
  hostname: string;
489
682
  platform: string;
683
+ hostVersion: string;
490
684
  agents: {
491
685
  id: string;
492
686
  label: string;
687
+ tier: "multi_client" | "handoff" | "remote" | "terminal";
688
+ installed: boolean;
493
689
  capabilities: {
494
- models: boolean;
495
- modes: boolean;
690
+ interrupt: boolean;
496
691
  steer: boolean;
692
+ permissions: boolean;
497
693
  images: boolean;
498
694
  fork: boolean;
499
- permissions: boolean;
500
- interrupt: boolean;
695
+ models: boolean;
696
+ modes: boolean;
501
697
  };
502
- tier: "multi_client" | "handoff" | "remote" | "terminal";
503
- installed: boolean;
698
+ version?: string | undefined;
699
+ problem?: string | undefined;
504
700
  auth?: {
505
701
  state: "unknown" | "ok" | "missing";
506
702
  method?: string | undefined;
507
703
  hint?: string | undefined;
508
704
  } | undefined;
509
- version?: string | undefined;
510
- problem?: string | undefined;
511
705
  }[];
512
- hostVersion: string;
706
+ home?: string | undefined;
513
707
  }, {
514
708
  machineId: string;
515
709
  hostname: string;
516
710
  platform: string;
711
+ hostVersion: string;
517
712
  agents: {
518
713
  id: string;
519
714
  label: string;
715
+ tier: "multi_client" | "handoff" | "remote" | "terminal";
716
+ installed: boolean;
520
717
  capabilities: {
521
- models: boolean;
522
- modes: boolean;
718
+ interrupt: boolean;
523
719
  steer: boolean;
720
+ permissions: boolean;
524
721
  images: boolean;
525
722
  fork: boolean;
526
- permissions: boolean;
527
- interrupt: boolean;
723
+ models: boolean;
724
+ modes: boolean;
528
725
  };
529
- tier: "multi_client" | "handoff" | "remote" | "terminal";
530
- installed: boolean;
726
+ version?: string | undefined;
727
+ problem?: string | undefined;
531
728
  auth?: {
532
729
  state: "unknown" | "ok" | "missing";
533
730
  method?: string | undefined;
534
731
  hint?: string | undefined;
535
732
  } | undefined;
536
- version?: string | undefined;
537
- problem?: string | undefined;
538
733
  }[];
539
- hostVersion: string;
734
+ home?: string | undefined;
540
735
  }>;
541
736
  export type MachineInfo = z.infer<typeof machineInfoSchema>;
542
737
  /** A server listening on the host, which a device can preview through the encrypted channel. */
@@ -555,15 +750,15 @@ export declare const portInfoSchema: z.ZodObject<{
555
750
  port: number;
556
751
  process: string;
557
752
  http: boolean;
558
- cwd?: string | undefined;
559
753
  title?: string | undefined;
754
+ cwd?: string | undefined;
560
755
  pid?: number | undefined;
561
756
  }, {
562
757
  port: number;
563
758
  process: string;
564
759
  http: boolean;
565
- cwd?: string | undefined;
566
760
  title?: string | undefined;
761
+ cwd?: string | undefined;
567
762
  pid?: number | undefined;
568
763
  }>;
569
764
  export type PortInfo = z.infer<typeof portInfoSchema>;
@@ -586,25 +781,25 @@ export declare const terminalInfoSchema: z.ZodObject<{
586
781
  interrupted: z.ZodOptional<z.ZodBoolean>;
587
782
  }, "strip", z.ZodTypeAny, {
588
783
  id: string;
589
- cols: number;
590
- rows: number;
784
+ title: string;
591
785
  cwd: string;
592
786
  createdAt: number;
593
- title: string;
787
+ cols: number;
788
+ rows: number;
594
789
  activeAt: number;
595
- exitCode?: number | null | undefined;
596
790
  command?: string | undefined;
791
+ exitCode?: number | null | undefined;
597
792
  interrupted?: boolean | undefined;
598
793
  }, {
599
794
  id: string;
600
- cols: number;
601
- rows: number;
795
+ title: string;
602
796
  cwd: string;
603
797
  createdAt: number;
604
- title: string;
798
+ cols: number;
799
+ rows: number;
605
800
  activeAt: number;
606
- exitCode?: number | null | undefined;
607
801
  command?: string | undefined;
802
+ exitCode?: number | null | undefined;
608
803
  interrupted?: boolean | undefined;
609
804
  }>;
610
805
  export type TerminalInfo = z.infer<typeof terminalInfoSchema>;
@@ -659,7 +854,7 @@ export declare const gatewayStatusSchema: z.ZodObject<{
659
854
  pairedAt: number;
660
855
  }>, "many">;
661
856
  }, "strip", z.ZodTypeAny, {
662
- status: "connecting" | "off" | "offline" | "online";
857
+ status: "offline" | "off" | "connecting" | "online";
663
858
  devices: {
664
859
  id: string;
665
860
  name: string;
@@ -680,7 +875,7 @@ export declare const gatewayStatusSchema: z.ZodObject<{
680
875
  email?: string | undefined;
681
876
  } | undefined;
682
877
  }, {
683
- status: "connecting" | "off" | "offline" | "online";
878
+ status: "offline" | "off" | "connecting" | "online";
684
879
  devices: {
685
880
  id: string;
686
881
  name: string;