@nexus-code/remote-protocol 0.1.0 → 0.3.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/README.md +5 -1
- package/dist/rpc.d.ts +5164 -229
- package/dist/rpc.d.ts.map +1 -1
- package/dist/rpc.js +723 -11
- package/dist/rpc.js.map +1 -1
- package/dist/sealed.d.ts +37 -5
- package/dist/sealed.d.ts.map +1 -1
- package/dist/sealed.js +37 -5
- package/dist/sealed.js.map +1 -1
- package/dist/view.d.ts +440 -0
- package/dist/view.d.ts.map +1 -1
- package/dist/view.js +73 -0
- package/dist/view.js.map +1 -1
- package/package.json +1 -1
- package/src/rpc.ts +766 -10
- package/src/sealed.ts +38 -5
- package/src/view.ts +83 -0
package/dist/view.d.ts
CHANGED
|
@@ -178,6 +178,25 @@ export declare const NoticeItemSchema: z.ZodObject<{
|
|
|
178
178
|
at?: number | undefined;
|
|
179
179
|
detail?: string | undefined;
|
|
180
180
|
}>;
|
|
181
|
+
/**
|
|
182
|
+
* Where an agent that sent a message can be answered: its tab, on the
|
|
183
|
+
* device `deviceId` (absent: the device this chat runs on). `nexus chat
|
|
184
|
+
* send` takes it as it is.
|
|
185
|
+
*/
|
|
186
|
+
export declare const ReplyAddressSchema: z.ZodObject<{
|
|
187
|
+
deviceId: z.ZodOptional<z.ZodString>;
|
|
188
|
+
workspaceId: z.ZodString;
|
|
189
|
+
tabId: z.ZodString;
|
|
190
|
+
}, "strip", z.ZodTypeAny, {
|
|
191
|
+
workspaceId: string;
|
|
192
|
+
tabId: string;
|
|
193
|
+
deviceId?: string | undefined;
|
|
194
|
+
}, {
|
|
195
|
+
workspaceId: string;
|
|
196
|
+
tabId: string;
|
|
197
|
+
deviceId?: string | undefined;
|
|
198
|
+
}>;
|
|
199
|
+
export type ReplyAddress = z.infer<typeof ReplyAddressSchema>;
|
|
181
200
|
/** A message the program took that the user did not write: another session's, a channel's. */
|
|
182
201
|
export declare const ReceivedItemSchema: z.ZodObject<{
|
|
183
202
|
kind: z.ZodLiteral<"received">;
|
|
@@ -186,14 +205,57 @@ export declare const ReceivedItemSchema: z.ZodObject<{
|
|
|
186
205
|
kind: z.ZodString;
|
|
187
206
|
name: z.ZodOptional<z.ZodString>;
|
|
188
207
|
agent: z.ZodOptional<z.ZodString>;
|
|
208
|
+
/** Sent from another device of the account: which one, as it names itself. */
|
|
209
|
+
device: z.ZodOptional<z.ZodObject<{
|
|
210
|
+
id: z.ZodString;
|
|
211
|
+
name: z.ZodString;
|
|
212
|
+
}, "strip", z.ZodTypeAny, {
|
|
213
|
+
id: string;
|
|
214
|
+
name: string;
|
|
215
|
+
}, {
|
|
216
|
+
id: string;
|
|
217
|
+
name: string;
|
|
218
|
+
}>>;
|
|
219
|
+
/** Where the sender takes an answer. */
|
|
220
|
+
replyTo: z.ZodOptional<z.ZodObject<{
|
|
221
|
+
deviceId: z.ZodOptional<z.ZodString>;
|
|
222
|
+
workspaceId: z.ZodString;
|
|
223
|
+
tabId: z.ZodString;
|
|
224
|
+
}, "strip", z.ZodTypeAny, {
|
|
225
|
+
workspaceId: string;
|
|
226
|
+
tabId: string;
|
|
227
|
+
deviceId?: string | undefined;
|
|
228
|
+
}, {
|
|
229
|
+
workspaceId: string;
|
|
230
|
+
tabId: string;
|
|
231
|
+
deviceId?: string | undefined;
|
|
232
|
+
}>>;
|
|
189
233
|
}, "strip", z.ZodTypeAny, {
|
|
190
234
|
kind: string;
|
|
191
235
|
name?: string | undefined;
|
|
192
236
|
agent?: string | undefined;
|
|
237
|
+
device?: {
|
|
238
|
+
id: string;
|
|
239
|
+
name: string;
|
|
240
|
+
} | undefined;
|
|
241
|
+
replyTo?: {
|
|
242
|
+
workspaceId: string;
|
|
243
|
+
tabId: string;
|
|
244
|
+
deviceId?: string | undefined;
|
|
245
|
+
} | undefined;
|
|
193
246
|
}, {
|
|
194
247
|
kind: string;
|
|
195
248
|
name?: string | undefined;
|
|
196
249
|
agent?: string | undefined;
|
|
250
|
+
device?: {
|
|
251
|
+
id: string;
|
|
252
|
+
name: string;
|
|
253
|
+
} | undefined;
|
|
254
|
+
replyTo?: {
|
|
255
|
+
workspaceId: string;
|
|
256
|
+
tabId: string;
|
|
257
|
+
deviceId?: string | undefined;
|
|
258
|
+
} | undefined;
|
|
197
259
|
}>;
|
|
198
260
|
text: z.ZodString;
|
|
199
261
|
at: z.ZodOptional<z.ZodNumber>;
|
|
@@ -202,6 +264,15 @@ export declare const ReceivedItemSchema: z.ZodObject<{
|
|
|
202
264
|
kind: string;
|
|
203
265
|
name?: string | undefined;
|
|
204
266
|
agent?: string | undefined;
|
|
267
|
+
device?: {
|
|
268
|
+
id: string;
|
|
269
|
+
name: string;
|
|
270
|
+
} | undefined;
|
|
271
|
+
replyTo?: {
|
|
272
|
+
workspaceId: string;
|
|
273
|
+
tabId: string;
|
|
274
|
+
deviceId?: string | undefined;
|
|
275
|
+
} | undefined;
|
|
205
276
|
};
|
|
206
277
|
kind: "received";
|
|
207
278
|
key: string;
|
|
@@ -212,6 +283,15 @@ export declare const ReceivedItemSchema: z.ZodObject<{
|
|
|
212
283
|
kind: string;
|
|
213
284
|
name?: string | undefined;
|
|
214
285
|
agent?: string | undefined;
|
|
286
|
+
device?: {
|
|
287
|
+
id: string;
|
|
288
|
+
name: string;
|
|
289
|
+
} | undefined;
|
|
290
|
+
replyTo?: {
|
|
291
|
+
workspaceId: string;
|
|
292
|
+
tabId: string;
|
|
293
|
+
deviceId?: string | undefined;
|
|
294
|
+
} | undefined;
|
|
215
295
|
};
|
|
216
296
|
kind: "received";
|
|
217
297
|
key: string;
|
|
@@ -421,14 +501,57 @@ export declare const ViewItemSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
421
501
|
kind: z.ZodString;
|
|
422
502
|
name: z.ZodOptional<z.ZodString>;
|
|
423
503
|
agent: z.ZodOptional<z.ZodString>;
|
|
504
|
+
/** Sent from another device of the account: which one, as it names itself. */
|
|
505
|
+
device: z.ZodOptional<z.ZodObject<{
|
|
506
|
+
id: z.ZodString;
|
|
507
|
+
name: z.ZodString;
|
|
508
|
+
}, "strip", z.ZodTypeAny, {
|
|
509
|
+
id: string;
|
|
510
|
+
name: string;
|
|
511
|
+
}, {
|
|
512
|
+
id: string;
|
|
513
|
+
name: string;
|
|
514
|
+
}>>;
|
|
515
|
+
/** Where the sender takes an answer. */
|
|
516
|
+
replyTo: z.ZodOptional<z.ZodObject<{
|
|
517
|
+
deviceId: z.ZodOptional<z.ZodString>;
|
|
518
|
+
workspaceId: z.ZodString;
|
|
519
|
+
tabId: z.ZodString;
|
|
520
|
+
}, "strip", z.ZodTypeAny, {
|
|
521
|
+
workspaceId: string;
|
|
522
|
+
tabId: string;
|
|
523
|
+
deviceId?: string | undefined;
|
|
524
|
+
}, {
|
|
525
|
+
workspaceId: string;
|
|
526
|
+
tabId: string;
|
|
527
|
+
deviceId?: string | undefined;
|
|
528
|
+
}>>;
|
|
424
529
|
}, "strip", z.ZodTypeAny, {
|
|
425
530
|
kind: string;
|
|
426
531
|
name?: string | undefined;
|
|
427
532
|
agent?: string | undefined;
|
|
533
|
+
device?: {
|
|
534
|
+
id: string;
|
|
535
|
+
name: string;
|
|
536
|
+
} | undefined;
|
|
537
|
+
replyTo?: {
|
|
538
|
+
workspaceId: string;
|
|
539
|
+
tabId: string;
|
|
540
|
+
deviceId?: string | undefined;
|
|
541
|
+
} | undefined;
|
|
428
542
|
}, {
|
|
429
543
|
kind: string;
|
|
430
544
|
name?: string | undefined;
|
|
431
545
|
agent?: string | undefined;
|
|
546
|
+
device?: {
|
|
547
|
+
id: string;
|
|
548
|
+
name: string;
|
|
549
|
+
} | undefined;
|
|
550
|
+
replyTo?: {
|
|
551
|
+
workspaceId: string;
|
|
552
|
+
tabId: string;
|
|
553
|
+
deviceId?: string | undefined;
|
|
554
|
+
} | undefined;
|
|
432
555
|
}>;
|
|
433
556
|
text: z.ZodString;
|
|
434
557
|
at: z.ZodOptional<z.ZodNumber>;
|
|
@@ -437,6 +560,15 @@ export declare const ViewItemSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
437
560
|
kind: string;
|
|
438
561
|
name?: string | undefined;
|
|
439
562
|
agent?: string | undefined;
|
|
563
|
+
device?: {
|
|
564
|
+
id: string;
|
|
565
|
+
name: string;
|
|
566
|
+
} | undefined;
|
|
567
|
+
replyTo?: {
|
|
568
|
+
workspaceId: string;
|
|
569
|
+
tabId: string;
|
|
570
|
+
deviceId?: string | undefined;
|
|
571
|
+
} | undefined;
|
|
440
572
|
};
|
|
441
573
|
kind: "received";
|
|
442
574
|
key: string;
|
|
@@ -447,6 +579,15 @@ export declare const ViewItemSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
447
579
|
kind: string;
|
|
448
580
|
name?: string | undefined;
|
|
449
581
|
agent?: string | undefined;
|
|
582
|
+
device?: {
|
|
583
|
+
id: string;
|
|
584
|
+
name: string;
|
|
585
|
+
} | undefined;
|
|
586
|
+
replyTo?: {
|
|
587
|
+
workspaceId: string;
|
|
588
|
+
tabId: string;
|
|
589
|
+
deviceId?: string | undefined;
|
|
590
|
+
} | undefined;
|
|
450
591
|
};
|
|
451
592
|
kind: "received";
|
|
452
593
|
key: string;
|
|
@@ -694,6 +835,18 @@ export declare const ViewPermissionSchema: z.ZodObject<{
|
|
|
694
835
|
truncated?: boolean | undefined;
|
|
695
836
|
} | undefined;
|
|
696
837
|
}>>;
|
|
838
|
+
/**
|
|
839
|
+
* What "always allow" would add, one choice each, in the serving
|
|
840
|
+
* device's words ("Allow Bash(npm test:*) in this folder"): chat.answer
|
|
841
|
+
* picks them by index.
|
|
842
|
+
*/
|
|
843
|
+
suggestions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
844
|
+
label: z.ZodString;
|
|
845
|
+
}, "strip", z.ZodTypeAny, {
|
|
846
|
+
label: string;
|
|
847
|
+
}, {
|
|
848
|
+
label: string;
|
|
849
|
+
}>, "many">>;
|
|
697
850
|
}, "strip", z.ZodTypeAny, {
|
|
698
851
|
input: Record<string, unknown>;
|
|
699
852
|
requestId: string;
|
|
@@ -721,6 +874,9 @@ export declare const ViewPermissionSchema: z.ZodObject<{
|
|
|
721
874
|
truncated?: boolean | undefined;
|
|
722
875
|
} | undefined;
|
|
723
876
|
} | undefined;
|
|
877
|
+
suggestions?: {
|
|
878
|
+
label: string;
|
|
879
|
+
}[] | undefined;
|
|
724
880
|
}, {
|
|
725
881
|
input: Record<string, unknown>;
|
|
726
882
|
requestId: string;
|
|
@@ -748,6 +904,9 @@ export declare const ViewPermissionSchema: z.ZodObject<{
|
|
|
748
904
|
truncated?: boolean | undefined;
|
|
749
905
|
} | undefined;
|
|
750
906
|
} | undefined;
|
|
907
|
+
suggestions?: {
|
|
908
|
+
label: string;
|
|
909
|
+
}[] | undefined;
|
|
751
910
|
}>;
|
|
752
911
|
export type ViewPermission = z.infer<typeof ViewPermissionSchema>;
|
|
753
912
|
/** A task the program runs beside the turn: a background run, a subagent. */
|
|
@@ -962,6 +1121,18 @@ export declare const ChatStatusSchema: z.ZodObject<{
|
|
|
962
1121
|
truncated?: boolean | undefined;
|
|
963
1122
|
} | undefined;
|
|
964
1123
|
}>>;
|
|
1124
|
+
/**
|
|
1125
|
+
* What "always allow" would add, one choice each, in the serving
|
|
1126
|
+
* device's words ("Allow Bash(npm test:*) in this folder"): chat.answer
|
|
1127
|
+
* picks them by index.
|
|
1128
|
+
*/
|
|
1129
|
+
suggestions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1130
|
+
label: z.ZodString;
|
|
1131
|
+
}, "strip", z.ZodTypeAny, {
|
|
1132
|
+
label: string;
|
|
1133
|
+
}, {
|
|
1134
|
+
label: string;
|
|
1135
|
+
}>, "many">>;
|
|
965
1136
|
}, "strip", z.ZodTypeAny, {
|
|
966
1137
|
input: Record<string, unknown>;
|
|
967
1138
|
requestId: string;
|
|
@@ -989,6 +1160,9 @@ export declare const ChatStatusSchema: z.ZodObject<{
|
|
|
989
1160
|
truncated?: boolean | undefined;
|
|
990
1161
|
} | undefined;
|
|
991
1162
|
} | undefined;
|
|
1163
|
+
suggestions?: {
|
|
1164
|
+
label: string;
|
|
1165
|
+
}[] | undefined;
|
|
992
1166
|
}, {
|
|
993
1167
|
input: Record<string, unknown>;
|
|
994
1168
|
requestId: string;
|
|
@@ -1016,6 +1190,9 @@ export declare const ChatStatusSchema: z.ZodObject<{
|
|
|
1016
1190
|
truncated?: boolean | undefined;
|
|
1017
1191
|
} | undefined;
|
|
1018
1192
|
} | undefined;
|
|
1193
|
+
suggestions?: {
|
|
1194
|
+
label: string;
|
|
1195
|
+
}[] | undefined;
|
|
1019
1196
|
}>, "many">;
|
|
1020
1197
|
}, "strip", z.ZodTypeAny, {
|
|
1021
1198
|
agent: "claude" | "codex";
|
|
@@ -1062,6 +1239,9 @@ export declare const ChatStatusSchema: z.ZodObject<{
|
|
|
1062
1239
|
truncated?: boolean | undefined;
|
|
1063
1240
|
} | undefined;
|
|
1064
1241
|
} | undefined;
|
|
1242
|
+
suggestions?: {
|
|
1243
|
+
label: string;
|
|
1244
|
+
}[] | undefined;
|
|
1065
1245
|
}[];
|
|
1066
1246
|
model?: string | undefined;
|
|
1067
1247
|
effort?: string | undefined;
|
|
@@ -1111,10 +1291,270 @@ export declare const ChatStatusSchema: z.ZodObject<{
|
|
|
1111
1291
|
truncated?: boolean | undefined;
|
|
1112
1292
|
} | undefined;
|
|
1113
1293
|
} | undefined;
|
|
1294
|
+
suggestions?: {
|
|
1295
|
+
label: string;
|
|
1296
|
+
}[] | undefined;
|
|
1114
1297
|
}[];
|
|
1115
1298
|
model?: string | undefined;
|
|
1116
1299
|
effort?: string | undefined;
|
|
1117
1300
|
permissionMode?: string | undefined;
|
|
1118
1301
|
}>;
|
|
1119
1302
|
export type ChatStatus = z.infer<typeof ChatStatusSchema>;
|
|
1303
|
+
/** One step of the agent's to-do list. */
|
|
1304
|
+
export declare const ViewTodoSchema: z.ZodObject<{
|
|
1305
|
+
content: z.ZodString;
|
|
1306
|
+
/** pending, in_progress or completed. */
|
|
1307
|
+
status: z.ZodString;
|
|
1308
|
+
}, "strip", z.ZodTypeAny, {
|
|
1309
|
+
status: string;
|
|
1310
|
+
content: string;
|
|
1311
|
+
}, {
|
|
1312
|
+
status: string;
|
|
1313
|
+
content: string;
|
|
1314
|
+
}>;
|
|
1315
|
+
/** A subagent the turn called (an Agent tool call). */
|
|
1316
|
+
export declare const ViewAgentRowSchema: z.ZodObject<{
|
|
1317
|
+
toolUseId: z.ZodString;
|
|
1318
|
+
description: z.ZodString;
|
|
1319
|
+
/** running, completed, failed or stopped. */
|
|
1320
|
+
status: z.ZodString;
|
|
1321
|
+
startedAt: z.ZodOptional<z.ZodNumber>;
|
|
1322
|
+
endedAt: z.ZodOptional<z.ZodNumber>;
|
|
1323
|
+
}, "strip", z.ZodTypeAny, {
|
|
1324
|
+
status: string;
|
|
1325
|
+
toolUseId: string;
|
|
1326
|
+
description: string;
|
|
1327
|
+
startedAt?: number | undefined;
|
|
1328
|
+
endedAt?: number | undefined;
|
|
1329
|
+
}, {
|
|
1330
|
+
status: string;
|
|
1331
|
+
toolUseId: string;
|
|
1332
|
+
description: string;
|
|
1333
|
+
startedAt?: number | undefined;
|
|
1334
|
+
endedAt?: number | undefined;
|
|
1335
|
+
}>;
|
|
1336
|
+
/** A goal the chat works toward (/goal), and where it stands. */
|
|
1337
|
+
export declare const ViewGoalSchema: z.ZodObject<{
|
|
1338
|
+
condition: z.ZodString;
|
|
1339
|
+
/** active, paused, met or failed. */
|
|
1340
|
+
status: z.ZodString;
|
|
1341
|
+
setAt: z.ZodOptional<z.ZodNumber>;
|
|
1342
|
+
/** How many checks found it unmet so far. */
|
|
1343
|
+
checks: z.ZodNumber;
|
|
1344
|
+
/** Once it ended: why. */
|
|
1345
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
1346
|
+
}, "strip", z.ZodTypeAny, {
|
|
1347
|
+
status: string;
|
|
1348
|
+
condition: string;
|
|
1349
|
+
checks: number;
|
|
1350
|
+
setAt?: number | undefined;
|
|
1351
|
+
reason?: string | undefined;
|
|
1352
|
+
}, {
|
|
1353
|
+
status: string;
|
|
1354
|
+
condition: string;
|
|
1355
|
+
checks: number;
|
|
1356
|
+
setAt?: number | undefined;
|
|
1357
|
+
reason?: string | undefined;
|
|
1358
|
+
}>;
|
|
1359
|
+
export type ViewGoal = z.infer<typeof ViewGoalSchema>;
|
|
1360
|
+
/**
|
|
1361
|
+
* What the chat's side panel shows beside the conversation: the to-do
|
|
1362
|
+
* list, the tasks and subagents, the files it changed, the context it
|
|
1363
|
+
* fills, what it cost, and its goal.
|
|
1364
|
+
*/
|
|
1365
|
+
export declare const ChatPanelSchema: z.ZodObject<{
|
|
1366
|
+
todos: z.ZodArray<z.ZodObject<{
|
|
1367
|
+
content: z.ZodString;
|
|
1368
|
+
/** pending, in_progress or completed. */
|
|
1369
|
+
status: z.ZodString;
|
|
1370
|
+
}, "strip", z.ZodTypeAny, {
|
|
1371
|
+
status: string;
|
|
1372
|
+
content: string;
|
|
1373
|
+
}, {
|
|
1374
|
+
status: string;
|
|
1375
|
+
content: string;
|
|
1376
|
+
}>, "many">;
|
|
1377
|
+
/** Background runs and the like, by the program's task ids (chat.stopTask stops one). */
|
|
1378
|
+
tasks: z.ZodArray<z.ZodObject<{
|
|
1379
|
+
taskId: z.ZodString;
|
|
1380
|
+
type: z.ZodString;
|
|
1381
|
+
description: z.ZodString;
|
|
1382
|
+
status: z.ZodString;
|
|
1383
|
+
toolUseId: z.ZodOptional<z.ZodString>;
|
|
1384
|
+
startedAt: z.ZodOptional<z.ZodNumber>;
|
|
1385
|
+
endedAt: z.ZodOptional<z.ZodNumber>;
|
|
1386
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
1387
|
+
activity: z.ZodOptional<z.ZodString>;
|
|
1388
|
+
}, "strip", z.ZodTypeAny, {
|
|
1389
|
+
type: string;
|
|
1390
|
+
status: string;
|
|
1391
|
+
taskId: string;
|
|
1392
|
+
description: string;
|
|
1393
|
+
toolUseId?: string | undefined;
|
|
1394
|
+
summary?: string | undefined;
|
|
1395
|
+
startedAt?: number | undefined;
|
|
1396
|
+
endedAt?: number | undefined;
|
|
1397
|
+
activity?: string | undefined;
|
|
1398
|
+
}, {
|
|
1399
|
+
type: string;
|
|
1400
|
+
status: string;
|
|
1401
|
+
taskId: string;
|
|
1402
|
+
description: string;
|
|
1403
|
+
toolUseId?: string | undefined;
|
|
1404
|
+
summary?: string | undefined;
|
|
1405
|
+
startedAt?: number | undefined;
|
|
1406
|
+
endedAt?: number | undefined;
|
|
1407
|
+
activity?: string | undefined;
|
|
1408
|
+
}>, "many">;
|
|
1409
|
+
agents: z.ZodArray<z.ZodObject<{
|
|
1410
|
+
toolUseId: z.ZodString;
|
|
1411
|
+
description: z.ZodString;
|
|
1412
|
+
/** running, completed, failed or stopped. */
|
|
1413
|
+
status: z.ZodString;
|
|
1414
|
+
startedAt: z.ZodOptional<z.ZodNumber>;
|
|
1415
|
+
endedAt: z.ZodOptional<z.ZodNumber>;
|
|
1416
|
+
}, "strip", z.ZodTypeAny, {
|
|
1417
|
+
status: string;
|
|
1418
|
+
toolUseId: string;
|
|
1419
|
+
description: string;
|
|
1420
|
+
startedAt?: number | undefined;
|
|
1421
|
+
endedAt?: number | undefined;
|
|
1422
|
+
}, {
|
|
1423
|
+
status: string;
|
|
1424
|
+
toolUseId: string;
|
|
1425
|
+
description: string;
|
|
1426
|
+
startedAt?: number | undefined;
|
|
1427
|
+
endedAt?: number | undefined;
|
|
1428
|
+
}>, "many">;
|
|
1429
|
+
changedFiles: z.ZodArray<z.ZodObject<{
|
|
1430
|
+
/** Absolute, on the serving device, as the chat's tool calls name it. */
|
|
1431
|
+
path: z.ZodString;
|
|
1432
|
+
added: z.ZodOptional<z.ZodNumber>;
|
|
1433
|
+
removed: z.ZodOptional<z.ZodNumber>;
|
|
1434
|
+
}, "strip", z.ZodTypeAny, {
|
|
1435
|
+
path: string;
|
|
1436
|
+
added?: number | undefined;
|
|
1437
|
+
removed?: number | undefined;
|
|
1438
|
+
}, {
|
|
1439
|
+
path: string;
|
|
1440
|
+
added?: number | undefined;
|
|
1441
|
+
removed?: number | undefined;
|
|
1442
|
+
}>, "many">;
|
|
1443
|
+
/** The context window: tokens in it, and how many it takes; null before the program said. */
|
|
1444
|
+
context: z.ZodNullable<z.ZodObject<{
|
|
1445
|
+
usedTokens: z.ZodNumber;
|
|
1446
|
+
maxTokens: z.ZodNumber;
|
|
1447
|
+
}, "strip", z.ZodTypeAny, {
|
|
1448
|
+
usedTokens: number;
|
|
1449
|
+
maxTokens: number;
|
|
1450
|
+
}, {
|
|
1451
|
+
usedTokens: number;
|
|
1452
|
+
maxTokens: number;
|
|
1453
|
+
}>>;
|
|
1454
|
+
/** What the conversation cost so far, in US dollars, when the program tells it. */
|
|
1455
|
+
costUsd: z.ZodOptional<z.ZodNumber>;
|
|
1456
|
+
goal: z.ZodNullable<z.ZodObject<{
|
|
1457
|
+
condition: z.ZodString;
|
|
1458
|
+
/** active, paused, met or failed. */
|
|
1459
|
+
status: z.ZodString;
|
|
1460
|
+
setAt: z.ZodOptional<z.ZodNumber>;
|
|
1461
|
+
/** How many checks found it unmet so far. */
|
|
1462
|
+
checks: z.ZodNumber;
|
|
1463
|
+
/** Once it ended: why. */
|
|
1464
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
1465
|
+
}, "strip", z.ZodTypeAny, {
|
|
1466
|
+
status: string;
|
|
1467
|
+
condition: string;
|
|
1468
|
+
checks: number;
|
|
1469
|
+
setAt?: number | undefined;
|
|
1470
|
+
reason?: string | undefined;
|
|
1471
|
+
}, {
|
|
1472
|
+
status: string;
|
|
1473
|
+
condition: string;
|
|
1474
|
+
checks: number;
|
|
1475
|
+
setAt?: number | undefined;
|
|
1476
|
+
reason?: string | undefined;
|
|
1477
|
+
}>>;
|
|
1478
|
+
}, "strip", z.ZodTypeAny, {
|
|
1479
|
+
todos: {
|
|
1480
|
+
status: string;
|
|
1481
|
+
content: string;
|
|
1482
|
+
}[];
|
|
1483
|
+
tasks: {
|
|
1484
|
+
type: string;
|
|
1485
|
+
status: string;
|
|
1486
|
+
taskId: string;
|
|
1487
|
+
description: string;
|
|
1488
|
+
toolUseId?: string | undefined;
|
|
1489
|
+
summary?: string | undefined;
|
|
1490
|
+
startedAt?: number | undefined;
|
|
1491
|
+
endedAt?: number | undefined;
|
|
1492
|
+
activity?: string | undefined;
|
|
1493
|
+
}[];
|
|
1494
|
+
agents: {
|
|
1495
|
+
status: string;
|
|
1496
|
+
toolUseId: string;
|
|
1497
|
+
description: string;
|
|
1498
|
+
startedAt?: number | undefined;
|
|
1499
|
+
endedAt?: number | undefined;
|
|
1500
|
+
}[];
|
|
1501
|
+
changedFiles: {
|
|
1502
|
+
path: string;
|
|
1503
|
+
added?: number | undefined;
|
|
1504
|
+
removed?: number | undefined;
|
|
1505
|
+
}[];
|
|
1506
|
+
context: {
|
|
1507
|
+
usedTokens: number;
|
|
1508
|
+
maxTokens: number;
|
|
1509
|
+
} | null;
|
|
1510
|
+
goal: {
|
|
1511
|
+
status: string;
|
|
1512
|
+
condition: string;
|
|
1513
|
+
checks: number;
|
|
1514
|
+
setAt?: number | undefined;
|
|
1515
|
+
reason?: string | undefined;
|
|
1516
|
+
} | null;
|
|
1517
|
+
costUsd?: number | undefined;
|
|
1518
|
+
}, {
|
|
1519
|
+
todos: {
|
|
1520
|
+
status: string;
|
|
1521
|
+
content: string;
|
|
1522
|
+
}[];
|
|
1523
|
+
tasks: {
|
|
1524
|
+
type: string;
|
|
1525
|
+
status: string;
|
|
1526
|
+
taskId: string;
|
|
1527
|
+
description: string;
|
|
1528
|
+
toolUseId?: string | undefined;
|
|
1529
|
+
summary?: string | undefined;
|
|
1530
|
+
startedAt?: number | undefined;
|
|
1531
|
+
endedAt?: number | undefined;
|
|
1532
|
+
activity?: string | undefined;
|
|
1533
|
+
}[];
|
|
1534
|
+
agents: {
|
|
1535
|
+
status: string;
|
|
1536
|
+
toolUseId: string;
|
|
1537
|
+
description: string;
|
|
1538
|
+
startedAt?: number | undefined;
|
|
1539
|
+
endedAt?: number | undefined;
|
|
1540
|
+
}[];
|
|
1541
|
+
changedFiles: {
|
|
1542
|
+
path: string;
|
|
1543
|
+
added?: number | undefined;
|
|
1544
|
+
removed?: number | undefined;
|
|
1545
|
+
}[];
|
|
1546
|
+
context: {
|
|
1547
|
+
usedTokens: number;
|
|
1548
|
+
maxTokens: number;
|
|
1549
|
+
} | null;
|
|
1550
|
+
goal: {
|
|
1551
|
+
status: string;
|
|
1552
|
+
condition: string;
|
|
1553
|
+
checks: number;
|
|
1554
|
+
setAt?: number | undefined;
|
|
1555
|
+
reason?: string | undefined;
|
|
1556
|
+
} | null;
|
|
1557
|
+
costUsd?: number | undefined;
|
|
1558
|
+
}>;
|
|
1559
|
+
export type ChatPanel = z.infer<typeof ChatPanelSchema>;
|
|
1120
1560
|
//# sourceMappingURL=view.d.ts.map
|
package/dist/view.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../src/view.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,6FAA6F;AAC7F,eAAO,MAAM,cAAc;;IAEzB,sCAAsC;;;;;;;;EAEtC,CAAC;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAItD,eAAO,MAAM,cAAc;;;;;;QAPzB,sCAAsC;;;;;;;;;IAYtC,gEAAgE;;IAEhE,2EAA2E;;;;;;;;;;;;;;;;;;;;;;;;;EAG3E,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;IAI/B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAM9B,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,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|
+
/**
|
|
51
|
+
* Where an agent that sent a message can be answered: its tab, on the
|
|
52
|
+
* device `deviceId` (absent: the device this chat runs on). `nexus chat
|
|
53
|
+
* send` takes it as it is.
|
|
54
|
+
*/
|
|
55
|
+
export const ReplyAddressSchema = z.object({
|
|
56
|
+
deviceId: z.string().optional(),
|
|
57
|
+
workspaceId: z.string(),
|
|
58
|
+
tabId: z.string(),
|
|
59
|
+
});
|
|
50
60
|
/** A message the program took that the user did not write: another session's, a channel's. */
|
|
51
61
|
export const ReceivedItemSchema = z.object({
|
|
52
62
|
kind: z.literal("received"),
|
|
@@ -55,6 +65,10 @@ export const ReceivedItemSchema = z.object({
|
|
|
55
65
|
kind: z.string(),
|
|
56
66
|
name: z.string().optional(),
|
|
57
67
|
agent: z.string().optional(),
|
|
68
|
+
/** Sent from another device of the account: which one, as it names itself. */
|
|
69
|
+
device: z.object({ id: z.string(), name: z.string() }).optional(),
|
|
70
|
+
/** Where the sender takes an answer. */
|
|
71
|
+
replyTo: ReplyAddressSchema.optional(),
|
|
58
72
|
}),
|
|
59
73
|
text: z.string(),
|
|
60
74
|
at,
|
|
@@ -140,6 +154,12 @@ export const ViewPermissionSchema = z.object({
|
|
|
140
154
|
agentId: z.string().optional(),
|
|
141
155
|
/** The call as the card previews it, when the input alone does not tell it. */
|
|
142
156
|
preview: ViewToolCallSchema.optional(),
|
|
157
|
+
/**
|
|
158
|
+
* What "always allow" would add, one choice each, in the serving
|
|
159
|
+
* device's words ("Allow Bash(npm test:*) in this folder"): chat.answer
|
|
160
|
+
* picks them by index.
|
|
161
|
+
*/
|
|
162
|
+
suggestions: z.array(z.object({ label: z.string() })).optional(),
|
|
143
163
|
});
|
|
144
164
|
/** A task the program runs beside the turn: a background run, a subagent. */
|
|
145
165
|
export const ViewTaskSchema = z.object({
|
|
@@ -184,4 +204,57 @@ export const ChatStatusSchema = z.object({
|
|
|
184
204
|
streaming: ViewStreamingSchema.nullable(),
|
|
185
205
|
permissions: z.array(ViewPermissionSchema),
|
|
186
206
|
});
|
|
207
|
+
/** One step of the agent's to-do list. */
|
|
208
|
+
export const ViewTodoSchema = z.object({
|
|
209
|
+
content: z.string(),
|
|
210
|
+
/** pending, in_progress or completed. */
|
|
211
|
+
status: z.string(),
|
|
212
|
+
});
|
|
213
|
+
/** A subagent the turn called (an Agent tool call). */
|
|
214
|
+
export const ViewAgentRowSchema = z.object({
|
|
215
|
+
toolUseId: z.string(),
|
|
216
|
+
description: z.string(),
|
|
217
|
+
/** running, completed, failed or stopped. */
|
|
218
|
+
status: z.string(),
|
|
219
|
+
startedAt: z.number().optional(),
|
|
220
|
+
endedAt: z.number().optional(),
|
|
221
|
+
});
|
|
222
|
+
/** A goal the chat works toward (/goal), and where it stands. */
|
|
223
|
+
export const ViewGoalSchema = z.object({
|
|
224
|
+
condition: z.string(),
|
|
225
|
+
/** active, paused, met or failed. */
|
|
226
|
+
status: z.string(),
|
|
227
|
+
setAt: z.number().optional(),
|
|
228
|
+
/** How many checks found it unmet so far. */
|
|
229
|
+
checks: z.number().int().nonnegative(),
|
|
230
|
+
/** Once it ended: why. */
|
|
231
|
+
reason: z.string().optional(),
|
|
232
|
+
});
|
|
233
|
+
/**
|
|
234
|
+
* What the chat's side panel shows beside the conversation: the to-do
|
|
235
|
+
* list, the tasks and subagents, the files it changed, the context it
|
|
236
|
+
* fills, what it cost, and its goal.
|
|
237
|
+
*/
|
|
238
|
+
export const ChatPanelSchema = z.object({
|
|
239
|
+
todos: z.array(ViewTodoSchema),
|
|
240
|
+
/** Background runs and the like, by the program's task ids (chat.stopTask stops one). */
|
|
241
|
+
tasks: z.array(ViewTaskSchema),
|
|
242
|
+
agents: z.array(ViewAgentRowSchema),
|
|
243
|
+
changedFiles: z.array(z.object({
|
|
244
|
+
/** Absolute, on the serving device, as the chat's tool calls name it. */
|
|
245
|
+
path: z.string(),
|
|
246
|
+
added: z.number().int().nonnegative().optional(),
|
|
247
|
+
removed: z.number().int().nonnegative().optional(),
|
|
248
|
+
})),
|
|
249
|
+
/** The context window: tokens in it, and how many it takes; null before the program said. */
|
|
250
|
+
context: z
|
|
251
|
+
.object({
|
|
252
|
+
usedTokens: z.number().int().nonnegative(),
|
|
253
|
+
maxTokens: z.number().int().positive(),
|
|
254
|
+
})
|
|
255
|
+
.nullable(),
|
|
256
|
+
/** What the conversation cost so far, in US dollars, when the program tells it. */
|
|
257
|
+
costUsd: z.number().nonnegative().optional(),
|
|
258
|
+
goal: ViewGoalSchema.nullable(),
|
|
259
|
+
});
|
|
187
260
|
//# sourceMappingURL=view.js.map
|