@opencode-cockpit/protocol 0.1.4 → 0.1.5

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.
@@ -0,0 +1,633 @@
1
+ import { z } from "zod";
2
+ export declare const ShellId: z.ZodString;
3
+ export declare const Owner: z.ZodObject<{
4
+ project: z.ZodString;
5
+ session: z.ZodOptional<z.ZodString>;
6
+ instance: z.ZodOptional<z.ZodString>;
7
+ }, z.core.$strip>;
8
+ export declare const ShellStatus: z.ZodEnum<{
9
+ exited: "exited";
10
+ failed: "failed";
11
+ killed: "killed";
12
+ running: "running";
13
+ }>;
14
+ export declare const ShellInfo: z.ZodObject<{
15
+ id: z.ZodString;
16
+ title: z.ZodString;
17
+ command: z.ZodString;
18
+ args: z.ZodArray<z.ZodString>;
19
+ cwd: z.ZodString;
20
+ owner: z.ZodObject<{
21
+ project: z.ZodString;
22
+ session: z.ZodOptional<z.ZodString>;
23
+ instance: z.ZodOptional<z.ZodString>;
24
+ }, z.core.$strip>;
25
+ status: z.ZodEnum<{
26
+ exited: "exited";
27
+ failed: "failed";
28
+ killed: "killed";
29
+ running: "running";
30
+ }>;
31
+ run: z.ZodNumber;
32
+ pid: z.ZodOptional<z.ZodNumber>;
33
+ exitCode: z.ZodOptional<z.ZodNumber>;
34
+ signal: z.ZodOptional<z.ZodString>;
35
+ error: z.ZodOptional<z.ZodString>;
36
+ summary: z.ZodOptional<z.ZodString>;
37
+ startedAt: z.ZodNumber;
38
+ endedAt: z.ZodOptional<z.ZodNumber>;
39
+ cols: z.ZodNumber;
40
+ rows: z.ZodNumber;
41
+ lines: z.ZodObject<{
42
+ first: z.ZodNumber;
43
+ last: z.ZodNumber;
44
+ }, z.core.$strip>;
45
+ bytes: z.ZodNumber;
46
+ }, z.core.$strip>;
47
+ export declare const StartParams: z.ZodObject<{
48
+ command: z.ZodString;
49
+ args: z.ZodDefault<z.ZodArray<z.ZodString>>;
50
+ cwd: z.ZodString;
51
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
52
+ title: z.ZodOptional<z.ZodString>;
53
+ cols: z.ZodDefault<z.ZodNumber>;
54
+ rows: z.ZodDefault<z.ZodNumber>;
55
+ owner: z.ZodObject<{
56
+ project: z.ZodString;
57
+ session: z.ZodOptional<z.ZodString>;
58
+ instance: z.ZodOptional<z.ZodString>;
59
+ }, z.core.$strip>;
60
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
61
+ reuse: z.ZodDefault<z.ZodBoolean>;
62
+ }, z.core.$strip>;
63
+ export declare const ClearParams: z.ZodDefault<z.ZodObject<{
64
+ owner: z.ZodOptional<z.ZodObject<{
65
+ project: z.ZodOptional<z.ZodString>;
66
+ session: z.ZodOptional<z.ZodOptional<z.ZodString>>;
67
+ instance: z.ZodOptional<z.ZodOptional<z.ZodString>>;
68
+ }, z.core.$strip>>;
69
+ finishedBeforeMs: z.ZodOptional<z.ZodNumber>;
70
+ }, z.core.$strip>>;
71
+ export declare const ListParams: z.ZodDefault<z.ZodObject<{
72
+ owner: z.ZodOptional<z.ZodObject<{
73
+ project: z.ZodOptional<z.ZodString>;
74
+ session: z.ZodOptional<z.ZodOptional<z.ZodString>>;
75
+ instance: z.ZodOptional<z.ZodOptional<z.ZodString>>;
76
+ }, z.core.$strip>>;
77
+ includeExited: z.ZodDefault<z.ZodBoolean>;
78
+ }, z.core.$strip>>;
79
+ export declare const IdParams: z.ZodObject<{
80
+ id: z.ZodString;
81
+ }, z.core.$strip>;
82
+ export declare const LogLine: z.ZodObject<{
83
+ n: z.ZodNumber;
84
+ text: z.ZodString;
85
+ }, z.core.$strip>;
86
+ export declare const ReadParams: z.ZodObject<{
87
+ id: z.ZodString;
88
+ after: z.ZodOptional<z.ZodNumber>;
89
+ tail: z.ZodDefault<z.ZodNumber>;
90
+ limit: z.ZodDefault<z.ZodNumber>;
91
+ grep: z.ZodOptional<z.ZodString>;
92
+ ignoreCase: z.ZodDefault<z.ZodBoolean>;
93
+ }, z.core.$strip>;
94
+ export declare const ReadResult: z.ZodObject<{
95
+ lines: z.ZodArray<z.ZodObject<{
96
+ n: z.ZodNumber;
97
+ text: z.ZodString;
98
+ }, z.core.$strip>>;
99
+ firstLine: z.ZodNumber;
100
+ lastLine: z.ZodNumber;
101
+ nextCursor: z.ZodNumber;
102
+ truncated: z.ZodBoolean;
103
+ hasMore: z.ZodBoolean;
104
+ status: z.ZodEnum<{
105
+ exited: "exited";
106
+ failed: "failed";
107
+ killed: "killed";
108
+ running: "running";
109
+ }>;
110
+ }, z.core.$strip>;
111
+ export declare const ScreenResult: z.ZodObject<{
112
+ text: z.ZodString;
113
+ cols: z.ZodNumber;
114
+ rows: z.ZodNumber;
115
+ cursor: z.ZodObject<{
116
+ x: z.ZodNumber;
117
+ y: z.ZodNumber;
118
+ }, z.core.$strip>;
119
+ }, z.core.$strip>;
120
+ export declare const WriteParams: z.ZodObject<{
121
+ id: z.ZodString;
122
+ data: z.ZodString;
123
+ }, z.core.$strip>;
124
+ export declare const ResizeParams: z.ZodObject<{
125
+ id: z.ZodString;
126
+ cols: z.ZodNumber;
127
+ rows: z.ZodNumber;
128
+ }, z.core.$strip>;
129
+ export declare const WaitUntil: z.ZodObject<{
130
+ pattern: z.ZodOptional<z.ZodString>;
131
+ ignoreCase: z.ZodOptional<z.ZodBoolean>;
132
+ exit: z.ZodOptional<z.ZodBoolean>;
133
+ idleMs: z.ZodOptional<z.ZodNumber>;
134
+ port: z.ZodOptional<z.ZodNumber>;
135
+ host: z.ZodOptional<z.ZodString>;
136
+ }, z.core.$strip>;
137
+ export declare const WaitParams: z.ZodObject<{
138
+ id: z.ZodString;
139
+ until: z.ZodObject<{
140
+ pattern: z.ZodOptional<z.ZodString>;
141
+ ignoreCase: z.ZodOptional<z.ZodBoolean>;
142
+ exit: z.ZodOptional<z.ZodBoolean>;
143
+ idleMs: z.ZodOptional<z.ZodNumber>;
144
+ port: z.ZodOptional<z.ZodNumber>;
145
+ host: z.ZodOptional<z.ZodString>;
146
+ }, z.core.$strip>;
147
+ timeoutMs: z.ZodNumber;
148
+ after: z.ZodOptional<z.ZodNumber>;
149
+ }, z.core.$strip>;
150
+ export declare const WaitReason: z.ZodEnum<{
151
+ exit: "exit";
152
+ idle: "idle";
153
+ pattern: "pattern";
154
+ port: "port";
155
+ timeout: "timeout";
156
+ }>;
157
+ export declare const WaitResult: z.ZodObject<{
158
+ reason: z.ZodEnum<{
159
+ exit: "exit";
160
+ idle: "idle";
161
+ pattern: "pattern";
162
+ port: "port";
163
+ timeout: "timeout";
164
+ }>;
165
+ match: z.ZodOptional<z.ZodObject<{
166
+ n: z.ZodNumber;
167
+ text: z.ZodString;
168
+ }, z.core.$strip>>;
169
+ info: z.ZodObject<{
170
+ id: z.ZodString;
171
+ title: z.ZodString;
172
+ command: z.ZodString;
173
+ args: z.ZodArray<z.ZodString>;
174
+ cwd: z.ZodString;
175
+ owner: z.ZodObject<{
176
+ project: z.ZodString;
177
+ session: z.ZodOptional<z.ZodString>;
178
+ instance: z.ZodOptional<z.ZodString>;
179
+ }, z.core.$strip>;
180
+ status: z.ZodEnum<{
181
+ exited: "exited";
182
+ failed: "failed";
183
+ killed: "killed";
184
+ running: "running";
185
+ }>;
186
+ run: z.ZodNumber;
187
+ pid: z.ZodOptional<z.ZodNumber>;
188
+ exitCode: z.ZodOptional<z.ZodNumber>;
189
+ signal: z.ZodOptional<z.ZodString>;
190
+ error: z.ZodOptional<z.ZodString>;
191
+ summary: z.ZodOptional<z.ZodString>;
192
+ startedAt: z.ZodNumber;
193
+ endedAt: z.ZodOptional<z.ZodNumber>;
194
+ cols: z.ZodNumber;
195
+ rows: z.ZodNumber;
196
+ lines: z.ZodObject<{
197
+ first: z.ZodNumber;
198
+ last: z.ZodNumber;
199
+ }, z.core.$strip>;
200
+ bytes: z.ZodNumber;
201
+ }, z.core.$strip>;
202
+ }, z.core.$strip>;
203
+ export declare const StopParams: z.ZodObject<{
204
+ id: z.ZodString;
205
+ signal: z.ZodDefault<z.ZodEnum<{
206
+ SIGHUP: "SIGHUP";
207
+ SIGINT: "SIGINT";
208
+ SIGKILL: "SIGKILL";
209
+ SIGTERM: "SIGTERM";
210
+ }>>;
211
+ graceMs: z.ZodDefault<z.ZodNumber>;
212
+ }, z.core.$strip>;
213
+ export declare const AttachParams: z.ZodObject<{
214
+ id: z.ZodString;
215
+ fromOffset: z.ZodOptional<z.ZodNumber>;
216
+ }, z.core.$strip>;
217
+ export declare const shellContract: {
218
+ "shell.start": import("./contract.ts").MethodSpec<z.ZodObject<{
219
+ command: z.ZodString;
220
+ args: z.ZodDefault<z.ZodArray<z.ZodString>>;
221
+ cwd: z.ZodString;
222
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
223
+ title: z.ZodOptional<z.ZodString>;
224
+ cols: z.ZodDefault<z.ZodNumber>;
225
+ rows: z.ZodDefault<z.ZodNumber>;
226
+ owner: z.ZodObject<{
227
+ project: z.ZodString;
228
+ session: z.ZodOptional<z.ZodString>;
229
+ instance: z.ZodOptional<z.ZodString>;
230
+ }, z.core.$strip>;
231
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
232
+ reuse: z.ZodDefault<z.ZodBoolean>;
233
+ }, z.core.$strip>, z.ZodObject<{
234
+ id: z.ZodString;
235
+ title: z.ZodString;
236
+ command: z.ZodString;
237
+ args: z.ZodArray<z.ZodString>;
238
+ cwd: z.ZodString;
239
+ owner: z.ZodObject<{
240
+ project: z.ZodString;
241
+ session: z.ZodOptional<z.ZodString>;
242
+ instance: z.ZodOptional<z.ZodString>;
243
+ }, z.core.$strip>;
244
+ status: z.ZodEnum<{
245
+ exited: "exited";
246
+ failed: "failed";
247
+ killed: "killed";
248
+ running: "running";
249
+ }>;
250
+ run: z.ZodNumber;
251
+ pid: z.ZodOptional<z.ZodNumber>;
252
+ exitCode: z.ZodOptional<z.ZodNumber>;
253
+ signal: z.ZodOptional<z.ZodString>;
254
+ error: z.ZodOptional<z.ZodString>;
255
+ summary: z.ZodOptional<z.ZodString>;
256
+ startedAt: z.ZodNumber;
257
+ endedAt: z.ZodOptional<z.ZodNumber>;
258
+ cols: z.ZodNumber;
259
+ rows: z.ZodNumber;
260
+ lines: z.ZodObject<{
261
+ first: z.ZodNumber;
262
+ last: z.ZodNumber;
263
+ }, z.core.$strip>;
264
+ bytes: z.ZodNumber;
265
+ }, z.core.$strip>>;
266
+ "shell.list": import("./contract.ts").MethodSpec<z.ZodDefault<z.ZodObject<{
267
+ owner: z.ZodOptional<z.ZodObject<{
268
+ project: z.ZodOptional<z.ZodString>;
269
+ session: z.ZodOptional<z.ZodOptional<z.ZodString>>;
270
+ instance: z.ZodOptional<z.ZodOptional<z.ZodString>>;
271
+ }, z.core.$strip>>;
272
+ includeExited: z.ZodDefault<z.ZodBoolean>;
273
+ }, z.core.$strip>>, z.ZodArray<z.ZodObject<{
274
+ id: z.ZodString;
275
+ title: z.ZodString;
276
+ command: z.ZodString;
277
+ args: z.ZodArray<z.ZodString>;
278
+ cwd: z.ZodString;
279
+ owner: z.ZodObject<{
280
+ project: z.ZodString;
281
+ session: z.ZodOptional<z.ZodString>;
282
+ instance: z.ZodOptional<z.ZodString>;
283
+ }, z.core.$strip>;
284
+ status: z.ZodEnum<{
285
+ exited: "exited";
286
+ failed: "failed";
287
+ killed: "killed";
288
+ running: "running";
289
+ }>;
290
+ run: z.ZodNumber;
291
+ pid: z.ZodOptional<z.ZodNumber>;
292
+ exitCode: z.ZodOptional<z.ZodNumber>;
293
+ signal: z.ZodOptional<z.ZodString>;
294
+ error: z.ZodOptional<z.ZodString>;
295
+ summary: z.ZodOptional<z.ZodString>;
296
+ startedAt: z.ZodNumber;
297
+ endedAt: z.ZodOptional<z.ZodNumber>;
298
+ cols: z.ZodNumber;
299
+ rows: z.ZodNumber;
300
+ lines: z.ZodObject<{
301
+ first: z.ZodNumber;
302
+ last: z.ZodNumber;
303
+ }, z.core.$strip>;
304
+ bytes: z.ZodNumber;
305
+ }, z.core.$strip>>>;
306
+ "shell.get": import("./contract.ts").MethodSpec<z.ZodObject<{
307
+ id: z.ZodString;
308
+ }, z.core.$strip>, z.ZodObject<{
309
+ id: z.ZodString;
310
+ title: z.ZodString;
311
+ command: z.ZodString;
312
+ args: z.ZodArray<z.ZodString>;
313
+ cwd: z.ZodString;
314
+ owner: z.ZodObject<{
315
+ project: z.ZodString;
316
+ session: z.ZodOptional<z.ZodString>;
317
+ instance: z.ZodOptional<z.ZodString>;
318
+ }, z.core.$strip>;
319
+ status: z.ZodEnum<{
320
+ exited: "exited";
321
+ failed: "failed";
322
+ killed: "killed";
323
+ running: "running";
324
+ }>;
325
+ run: z.ZodNumber;
326
+ pid: z.ZodOptional<z.ZodNumber>;
327
+ exitCode: z.ZodOptional<z.ZodNumber>;
328
+ signal: z.ZodOptional<z.ZodString>;
329
+ error: z.ZodOptional<z.ZodString>;
330
+ summary: z.ZodOptional<z.ZodString>;
331
+ startedAt: z.ZodNumber;
332
+ endedAt: z.ZodOptional<z.ZodNumber>;
333
+ cols: z.ZodNumber;
334
+ rows: z.ZodNumber;
335
+ lines: z.ZodObject<{
336
+ first: z.ZodNumber;
337
+ last: z.ZodNumber;
338
+ }, z.core.$strip>;
339
+ bytes: z.ZodNumber;
340
+ }, z.core.$strip>>;
341
+ "shell.read": import("./contract.ts").MethodSpec<z.ZodObject<{
342
+ id: z.ZodString;
343
+ after: z.ZodOptional<z.ZodNumber>;
344
+ tail: z.ZodDefault<z.ZodNumber>;
345
+ limit: z.ZodDefault<z.ZodNumber>;
346
+ grep: z.ZodOptional<z.ZodString>;
347
+ ignoreCase: z.ZodDefault<z.ZodBoolean>;
348
+ }, z.core.$strip>, z.ZodObject<{
349
+ lines: z.ZodArray<z.ZodObject<{
350
+ n: z.ZodNumber;
351
+ text: z.ZodString;
352
+ }, z.core.$strip>>;
353
+ firstLine: z.ZodNumber;
354
+ lastLine: z.ZodNumber;
355
+ nextCursor: z.ZodNumber;
356
+ truncated: z.ZodBoolean;
357
+ hasMore: z.ZodBoolean;
358
+ status: z.ZodEnum<{
359
+ exited: "exited";
360
+ failed: "failed";
361
+ killed: "killed";
362
+ running: "running";
363
+ }>;
364
+ }, z.core.$strip>>;
365
+ "shell.screen": import("./contract.ts").MethodSpec<z.ZodObject<{
366
+ id: z.ZodString;
367
+ }, z.core.$strip>, z.ZodObject<{
368
+ text: z.ZodString;
369
+ cols: z.ZodNumber;
370
+ rows: z.ZodNumber;
371
+ cursor: z.ZodObject<{
372
+ x: z.ZodNumber;
373
+ y: z.ZodNumber;
374
+ }, z.core.$strip>;
375
+ }, z.core.$strip>>;
376
+ "shell.write": import("./contract.ts").MethodSpec<z.ZodObject<{
377
+ id: z.ZodString;
378
+ data: z.ZodString;
379
+ }, z.core.$strip>, z.ZodObject<{
380
+ bytes: z.ZodNumber;
381
+ }, z.core.$strip>>;
382
+ "shell.resize": import("./contract.ts").MethodSpec<z.ZodObject<{
383
+ id: z.ZodString;
384
+ cols: z.ZodNumber;
385
+ rows: z.ZodNumber;
386
+ }, z.core.$strip>, z.ZodObject<{}, z.core.$strip>>;
387
+ "shell.wait": import("./contract.ts").MethodSpec<z.ZodObject<{
388
+ id: z.ZodString;
389
+ until: z.ZodObject<{
390
+ pattern: z.ZodOptional<z.ZodString>;
391
+ ignoreCase: z.ZodOptional<z.ZodBoolean>;
392
+ exit: z.ZodOptional<z.ZodBoolean>;
393
+ idleMs: z.ZodOptional<z.ZodNumber>;
394
+ port: z.ZodOptional<z.ZodNumber>;
395
+ host: z.ZodOptional<z.ZodString>;
396
+ }, z.core.$strip>;
397
+ timeoutMs: z.ZodNumber;
398
+ after: z.ZodOptional<z.ZodNumber>;
399
+ }, z.core.$strip>, z.ZodObject<{
400
+ reason: z.ZodEnum<{
401
+ exit: "exit";
402
+ idle: "idle";
403
+ pattern: "pattern";
404
+ port: "port";
405
+ timeout: "timeout";
406
+ }>;
407
+ match: z.ZodOptional<z.ZodObject<{
408
+ n: z.ZodNumber;
409
+ text: z.ZodString;
410
+ }, z.core.$strip>>;
411
+ info: z.ZodObject<{
412
+ id: z.ZodString;
413
+ title: z.ZodString;
414
+ command: z.ZodString;
415
+ args: z.ZodArray<z.ZodString>;
416
+ cwd: z.ZodString;
417
+ owner: z.ZodObject<{
418
+ project: z.ZodString;
419
+ session: z.ZodOptional<z.ZodString>;
420
+ instance: z.ZodOptional<z.ZodString>;
421
+ }, z.core.$strip>;
422
+ status: z.ZodEnum<{
423
+ exited: "exited";
424
+ failed: "failed";
425
+ killed: "killed";
426
+ running: "running";
427
+ }>;
428
+ run: z.ZodNumber;
429
+ pid: z.ZodOptional<z.ZodNumber>;
430
+ exitCode: z.ZodOptional<z.ZodNumber>;
431
+ signal: z.ZodOptional<z.ZodString>;
432
+ error: z.ZodOptional<z.ZodString>;
433
+ summary: z.ZodOptional<z.ZodString>;
434
+ startedAt: z.ZodNumber;
435
+ endedAt: z.ZodOptional<z.ZodNumber>;
436
+ cols: z.ZodNumber;
437
+ rows: z.ZodNumber;
438
+ lines: z.ZodObject<{
439
+ first: z.ZodNumber;
440
+ last: z.ZodNumber;
441
+ }, z.core.$strip>;
442
+ bytes: z.ZodNumber;
443
+ }, z.core.$strip>;
444
+ }, z.core.$strip>>;
445
+ "shell.stop": import("./contract.ts").MethodSpec<z.ZodObject<{
446
+ id: z.ZodString;
447
+ signal: z.ZodDefault<z.ZodEnum<{
448
+ SIGHUP: "SIGHUP";
449
+ SIGINT: "SIGINT";
450
+ SIGKILL: "SIGKILL";
451
+ SIGTERM: "SIGTERM";
452
+ }>>;
453
+ graceMs: z.ZodDefault<z.ZodNumber>;
454
+ }, z.core.$strip>, z.ZodObject<{
455
+ id: z.ZodString;
456
+ title: z.ZodString;
457
+ command: z.ZodString;
458
+ args: z.ZodArray<z.ZodString>;
459
+ cwd: z.ZodString;
460
+ owner: z.ZodObject<{
461
+ project: z.ZodString;
462
+ session: z.ZodOptional<z.ZodString>;
463
+ instance: z.ZodOptional<z.ZodString>;
464
+ }, z.core.$strip>;
465
+ status: z.ZodEnum<{
466
+ exited: "exited";
467
+ failed: "failed";
468
+ killed: "killed";
469
+ running: "running";
470
+ }>;
471
+ run: z.ZodNumber;
472
+ pid: z.ZodOptional<z.ZodNumber>;
473
+ exitCode: z.ZodOptional<z.ZodNumber>;
474
+ signal: z.ZodOptional<z.ZodString>;
475
+ error: z.ZodOptional<z.ZodString>;
476
+ summary: z.ZodOptional<z.ZodString>;
477
+ startedAt: z.ZodNumber;
478
+ endedAt: z.ZodOptional<z.ZodNumber>;
479
+ cols: z.ZodNumber;
480
+ rows: z.ZodNumber;
481
+ lines: z.ZodObject<{
482
+ first: z.ZodNumber;
483
+ last: z.ZodNumber;
484
+ }, z.core.$strip>;
485
+ bytes: z.ZodNumber;
486
+ }, z.core.$strip>>;
487
+ "shell.restart": import("./contract.ts").MethodSpec<z.ZodObject<{
488
+ id: z.ZodString;
489
+ }, z.core.$strip>, z.ZodObject<{
490
+ id: z.ZodString;
491
+ title: z.ZodString;
492
+ command: z.ZodString;
493
+ args: z.ZodArray<z.ZodString>;
494
+ cwd: z.ZodString;
495
+ owner: z.ZodObject<{
496
+ project: z.ZodString;
497
+ session: z.ZodOptional<z.ZodString>;
498
+ instance: z.ZodOptional<z.ZodString>;
499
+ }, z.core.$strip>;
500
+ status: z.ZodEnum<{
501
+ exited: "exited";
502
+ failed: "failed";
503
+ killed: "killed";
504
+ running: "running";
505
+ }>;
506
+ run: z.ZodNumber;
507
+ pid: z.ZodOptional<z.ZodNumber>;
508
+ exitCode: z.ZodOptional<z.ZodNumber>;
509
+ signal: z.ZodOptional<z.ZodString>;
510
+ error: z.ZodOptional<z.ZodString>;
511
+ summary: z.ZodOptional<z.ZodString>;
512
+ startedAt: z.ZodNumber;
513
+ endedAt: z.ZodOptional<z.ZodNumber>;
514
+ cols: z.ZodNumber;
515
+ rows: z.ZodNumber;
516
+ lines: z.ZodObject<{
517
+ first: z.ZodNumber;
518
+ last: z.ZodNumber;
519
+ }, z.core.$strip>;
520
+ bytes: z.ZodNumber;
521
+ }, z.core.$strip>>;
522
+ "shell.remove": import("./contract.ts").MethodSpec<z.ZodObject<{
523
+ id: z.ZodString;
524
+ }, z.core.$strip>, z.ZodObject<{}, z.core.$strip>>;
525
+ "shell.clear": import("./contract.ts").MethodSpec<z.ZodDefault<z.ZodObject<{
526
+ owner: z.ZodOptional<z.ZodObject<{
527
+ project: z.ZodOptional<z.ZodString>;
528
+ session: z.ZodOptional<z.ZodOptional<z.ZodString>>;
529
+ instance: z.ZodOptional<z.ZodOptional<z.ZodString>>;
530
+ }, z.core.$strip>>;
531
+ finishedBeforeMs: z.ZodOptional<z.ZodNumber>;
532
+ }, z.core.$strip>>, z.ZodObject<{
533
+ removed: z.ZodArray<z.ZodString>;
534
+ }, z.core.$strip>>;
535
+ "shell.attach": import("./contract.ts").MethodSpec<z.ZodObject<{
536
+ id: z.ZodString;
537
+ fromOffset: z.ZodOptional<z.ZodNumber>;
538
+ }, z.core.$strip>, z.ZodObject<{
539
+ offset: z.ZodNumber;
540
+ replay: z.ZodString;
541
+ }, z.core.$strip>>;
542
+ "shell.detach": import("./contract.ts").MethodSpec<z.ZodObject<{
543
+ id: z.ZodString;
544
+ }, z.core.$strip>, z.ZodObject<{}, z.core.$strip>>;
545
+ };
546
+ export declare const shellEvents: {
547
+ "shell.started": z.ZodObject<{
548
+ id: z.ZodString;
549
+ title: z.ZodString;
550
+ command: z.ZodString;
551
+ args: z.ZodArray<z.ZodString>;
552
+ cwd: z.ZodString;
553
+ owner: z.ZodObject<{
554
+ project: z.ZodString;
555
+ session: z.ZodOptional<z.ZodString>;
556
+ instance: z.ZodOptional<z.ZodString>;
557
+ }, z.core.$strip>;
558
+ status: z.ZodEnum<{
559
+ exited: "exited";
560
+ failed: "failed";
561
+ killed: "killed";
562
+ running: "running";
563
+ }>;
564
+ run: z.ZodNumber;
565
+ pid: z.ZodOptional<z.ZodNumber>;
566
+ exitCode: z.ZodOptional<z.ZodNumber>;
567
+ signal: z.ZodOptional<z.ZodString>;
568
+ error: z.ZodOptional<z.ZodString>;
569
+ summary: z.ZodOptional<z.ZodString>;
570
+ startedAt: z.ZodNumber;
571
+ endedAt: z.ZodOptional<z.ZodNumber>;
572
+ cols: z.ZodNumber;
573
+ rows: z.ZodNumber;
574
+ lines: z.ZodObject<{
575
+ first: z.ZodNumber;
576
+ last: z.ZodNumber;
577
+ }, z.core.$strip>;
578
+ bytes: z.ZodNumber;
579
+ }, z.core.$strip>;
580
+ "shell.exited": z.ZodObject<{
581
+ id: z.ZodString;
582
+ title: z.ZodString;
583
+ command: z.ZodString;
584
+ args: z.ZodArray<z.ZodString>;
585
+ cwd: z.ZodString;
586
+ owner: z.ZodObject<{
587
+ project: z.ZodString;
588
+ session: z.ZodOptional<z.ZodString>;
589
+ instance: z.ZodOptional<z.ZodString>;
590
+ }, z.core.$strip>;
591
+ status: z.ZodEnum<{
592
+ exited: "exited";
593
+ failed: "failed";
594
+ killed: "killed";
595
+ running: "running";
596
+ }>;
597
+ run: z.ZodNumber;
598
+ pid: z.ZodOptional<z.ZodNumber>;
599
+ exitCode: z.ZodOptional<z.ZodNumber>;
600
+ signal: z.ZodOptional<z.ZodString>;
601
+ error: z.ZodOptional<z.ZodString>;
602
+ summary: z.ZodOptional<z.ZodString>;
603
+ startedAt: z.ZodNumber;
604
+ endedAt: z.ZodOptional<z.ZodNumber>;
605
+ cols: z.ZodNumber;
606
+ rows: z.ZodNumber;
607
+ lines: z.ZodObject<{
608
+ first: z.ZodNumber;
609
+ last: z.ZodNumber;
610
+ }, z.core.$strip>;
611
+ bytes: z.ZodNumber;
612
+ }, z.core.$strip>;
613
+ "shell.removed": z.ZodObject<{
614
+ id: z.ZodString;
615
+ }, z.core.$strip>;
616
+ "shell.output": z.ZodObject<{
617
+ id: z.ZodString;
618
+ offset: z.ZodNumber;
619
+ data: z.ZodString;
620
+ }, z.core.$strip>;
621
+ };
622
+ export type Owner = z.output<typeof Owner>;
623
+ export type ShellStatus = z.output<typeof ShellStatus>;
624
+ export type ShellInfo = z.output<typeof ShellInfo>;
625
+ export type StartParams = z.output<typeof StartParams>;
626
+ export type ReadParams = z.output<typeof ReadParams>;
627
+ export type ReadResult = z.output<typeof ReadResult>;
628
+ export type ScreenResult = z.output<typeof ScreenResult>;
629
+ export type WaitParams = z.output<typeof WaitParams>;
630
+ export type WaitResult = z.output<typeof WaitResult>;
631
+ export type WaitReason = z.output<typeof WaitReason>;
632
+ export type StopParams = z.output<typeof StopParams>;
633
+ export type LogLine = z.output<typeof LogLine>;
package/src/build.ts DELETED
@@ -1,32 +0,0 @@
1
- import { createHash } from "node:crypto"
2
- import { readdirSync, readFileSync, statSync } from "node:fs"
3
- import { dirname, join, relative } from "node:path"
4
-
5
- const SOURCE = /\.(ts|tsx|js|mjs|json)$/
6
- const SKIP = new Set(["node_modules", "test", "dist"])
7
-
8
- /**
9
- * Identity of the daemon code that `entry` would run: a hash of every source file in the entry's
10
- * package (its `src` directory, or the entry file itself when bundled). Daemon and client compute
11
- * it the same way, so a client can tell when a running daemon was started from different code.
12
- */
13
- export function daemonBuildId(entry: string, version: string): string {
14
- const hash = createHash("sha256").update(version)
15
- const root = dirname(entry)
16
- const files = /[\\/]src$/.test(root) ? walk(root) : [entry]
17
- for (const file of files.sort()) {
18
- hash.update(relative(root, file)).update("\0").update(readFileSync(file)).update("\0")
19
- }
20
- return `${version}+${hash.digest("hex").slice(0, 12)}`
21
- }
22
-
23
- function walk(dir: string): string[] {
24
- const out: string[] = []
25
- for (const name of readdirSync(dir)) {
26
- if (SKIP.has(name)) continue
27
- const path = join(dir, name)
28
- if (statSync(path).isDirectory()) out.push(...walk(path))
29
- else if (SOURCE.test(name)) out.push(path)
30
- }
31
- return out
32
- }