@fungi.computer/computer-contract 0.0.0-stage → 0.0.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.
@@ -0,0 +1,2055 @@
1
+ <!-- Generated by Botanical API docs (TypeDoc + typedoc-plugin-markdown). Do not edit. -->
2
+
3
+ **@fungi.computer/computer-contract**
4
+
5
+ ---
6
+
7
+ # @fungi.computer/computer-contract
8
+
9
+ ## Classes
10
+
11
+ ### ComputerPortReservedError
12
+
13
+ The port belongs to a Computer daemon and cannot be admitted for preview.
14
+
15
+ #### Extends
16
+
17
+ - `Error`
18
+
19
+ #### Constructors
20
+
21
+ ##### Constructor
22
+
23
+ ```ts
24
+ new ComputerPortReservedError(port): ComputerPortReservedError;
25
+ ```
26
+
27
+ ###### Parameters
28
+
29
+ | Parameter | Type |
30
+ | --------- | -------- |
31
+ | `port` | `number` |
32
+
33
+ ###### Returns
34
+
35
+ [`ComputerPortReservedError`](#computerportreservederror)
36
+
37
+ ###### Overrides
38
+
39
+ ```ts
40
+ Error.constructor;
41
+ ```
42
+
43
+ ---
44
+
45
+ ### ComputerPortConflictError
46
+
47
+ A requested port cannot be reserved; no other process identity is disclosed.
48
+
49
+ #### Extends
50
+
51
+ - `Error`
52
+
53
+ #### Constructors
54
+
55
+ ##### Constructor
56
+
57
+ ```ts
58
+ new ComputerPortConflictError(): ComputerPortConflictError;
59
+ ```
60
+
61
+ ###### Returns
62
+
63
+ [`ComputerPortConflictError`](#computerportconflicterror)
64
+
65
+ ###### Overrides
66
+
67
+ ```ts
68
+ Error.constructor;
69
+ ```
70
+
71
+ ---
72
+
73
+ ### ComputerPortLimitError
74
+
75
+ This Computer already admits the maximum number of preview ports.
76
+
77
+ #### Extends
78
+
79
+ - `Error`
80
+
81
+ #### Constructors
82
+
83
+ ##### Constructor
84
+
85
+ ```ts
86
+ new ComputerPortLimitError(): ComputerPortLimitError;
87
+ ```
88
+
89
+ ###### Returns
90
+
91
+ [`ComputerPortLimitError`](#computerportlimiterror)
92
+
93
+ ###### Overrides
94
+
95
+ ```ts
96
+ Error.constructor;
97
+ ```
98
+
99
+ ---
100
+
101
+ ### ComputerProcessNotFoundError
102
+
103
+ No process with this id was started on this Computer.
104
+
105
+ #### Extends
106
+
107
+ - `Error`
108
+
109
+ #### Constructors
110
+
111
+ ##### Constructor
112
+
113
+ ```ts
114
+ new ComputerProcessNotFoundError(id): ComputerProcessNotFoundError;
115
+ ```
116
+
117
+ ###### Parameters
118
+
119
+ | Parameter | Type |
120
+ | --------- | -------- |
121
+ | `id` | `string` |
122
+
123
+ ###### Returns
124
+
125
+ [`ComputerProcessNotFoundError`](#computerprocessnotfounderror)
126
+
127
+ ###### Overrides
128
+
129
+ ```ts
130
+ Error.constructor;
131
+ ```
132
+
133
+ ---
134
+
135
+ ### ComputerProcessLimitError
136
+
137
+ Every process slot is occupied by a running process.
138
+
139
+ #### Extends
140
+
141
+ - `Error`
142
+
143
+ #### Constructors
144
+
145
+ ##### Constructor
146
+
147
+ ```ts
148
+ new ComputerProcessLimitError(): ComputerProcessLimitError;
149
+ ```
150
+
151
+ ###### Returns
152
+
153
+ [`ComputerProcessLimitError`](#computerprocesslimiterror)
154
+
155
+ ###### Overrides
156
+
157
+ ```ts
158
+ Error.constructor;
159
+ ```
160
+
161
+ ---
162
+
163
+ ### ComputerFileConflict
164
+
165
+ The expected file contents no longer match at atomic replacement.
166
+
167
+ #### Extends
168
+
169
+ - `Error`
170
+
171
+ #### Constructors
172
+
173
+ ##### Constructor
174
+
175
+ ```ts
176
+ new ComputerFileConflict(): ComputerFileConflict;
177
+ ```
178
+
179
+ ###### Returns
180
+
181
+ [`ComputerFileConflict`](#computerfileconflict)
182
+
183
+ ###### Overrides
184
+
185
+ ```ts
186
+ Error.constructor;
187
+ ```
188
+
189
+ ---
190
+
191
+ ### ComputerFileRangeError
192
+
193
+ A byte window starts beyond the current file extent.
194
+
195
+ #### Extends
196
+
197
+ - `Error`
198
+
199
+ #### Constructors
200
+
201
+ ##### Constructor
202
+
203
+ ```ts
204
+ new ComputerFileRangeError(size): ComputerFileRangeError;
205
+ ```
206
+
207
+ ###### Parameters
208
+
209
+ | Parameter | Type | Description |
210
+ | --------- | -------- | --------------------------------- |
211
+ | `size` | `number` | The file's current size in bytes. |
212
+
213
+ ###### Returns
214
+
215
+ [`ComputerFileRangeError`](#computerfilerangeerror)
216
+
217
+ ###### Overrides
218
+
219
+ ```ts
220
+ Error.constructor;
221
+ ```
222
+
223
+ #### Properties
224
+
225
+ ##### size
226
+
227
+ ```ts
228
+ readonly size: number;
229
+ ```
230
+
231
+ The file's current size in bytes.
232
+
233
+ ---
234
+
235
+ ### ComputerFileTooLargeError
236
+
237
+ The requested file bytes exceed the admitted read bound.
238
+
239
+ #### Extends
240
+
241
+ - `Error`
242
+
243
+ #### Constructors
244
+
245
+ ##### Constructor
246
+
247
+ ```ts
248
+ new ComputerFileTooLargeError(): ComputerFileTooLargeError;
249
+ ```
250
+
251
+ ###### Returns
252
+
253
+ [`ComputerFileTooLargeError`](#computerfiletoolargeerror)
254
+
255
+ ###### Overrides
256
+
257
+ ```ts
258
+ Error.constructor;
259
+ ```
260
+
261
+ ## Type Aliases
262
+
263
+ ### ComputerExecutionBudget
264
+
265
+ ```ts
266
+ type ComputerExecutionBudget = Readonly<{
267
+ maximumTimeMs: number;
268
+ }>;
269
+ ```
270
+
271
+ Host-owned policy, never supplied in a Computer request body.
272
+
273
+ ---
274
+
275
+ ### ComputerValue
276
+
277
+ ```ts
278
+ type ComputerValue = z.output<typeof computerValueSchema>;
279
+ ```
280
+
281
+ A JSON value accepted by `computerValueSchema`.
282
+
283
+ ---
284
+
285
+ ### ComputerFileReadInput
286
+
287
+ ```ts
288
+ type ComputerFileReadInput = z.output<typeof readInputSchema>;
289
+ ```
290
+
291
+ A request to read one whole file as text.
292
+
293
+ ---
294
+
295
+ ### ComputerFileReadOutput
296
+
297
+ ```ts
298
+ type ComputerFileReadOutput = z.output<typeof readOutputSchema>;
299
+ ```
300
+
301
+ The reply to reading one whole file as text.
302
+
303
+ ---
304
+
305
+ ### ComputerFileByteReadInput
306
+
307
+ ```ts
308
+ type ComputerFileByteReadInput = z.output<typeof readBytesInputSchema>;
309
+ ```
310
+
311
+ A request to read a window of bytes from one file.
312
+
313
+ ---
314
+
315
+ ### ComputerFileListInput
316
+
317
+ ```ts
318
+ type ComputerFileListInput = z.output<typeof listInputSchema>;
319
+ ```
320
+
321
+ A request for one page of a directory's entries.
322
+
323
+ ---
324
+
325
+ ### ComputerFileListOutput
326
+
327
+ ```ts
328
+ type ComputerFileListOutput = z.output<typeof listOutputSchema>;
329
+ ```
330
+
331
+ The reply to a directory listing.
332
+
333
+ ---
334
+
335
+ ### ComputerFileWriteInput
336
+
337
+ ```ts
338
+ type ComputerFileWriteInput = z.output<typeof writeInputSchema>;
339
+ ```
340
+
341
+ A request to write one file.
342
+
343
+ ---
344
+
345
+ ### ComputerFileWriteOutput
346
+
347
+ ```ts
348
+ type ComputerFileWriteOutput = z.output<typeof writeOutputSchema>;
349
+ ```
350
+
351
+ The reply to a committed file write.
352
+
353
+ ---
354
+
355
+ ### ComputerFileGlobInput
356
+
357
+ ```ts
358
+ type ComputerFileGlobInput = z.output<typeof globInputSchema>;
359
+ ```
360
+
361
+ A request to find paths that match a glob.
362
+
363
+ ---
364
+
365
+ ### ComputerFileGrepInput
366
+
367
+ ```ts
368
+ type ComputerFileGrepInput = z.output<typeof grepInputSchema>;
369
+ ```
370
+
371
+ A request to search file contents.
372
+
373
+ ---
374
+
375
+ ### ComputerRequestId
376
+
377
+ ```ts
378
+ type ComputerRequestId = z.output<typeof computerRequestIdSchema>;
379
+ ```
380
+
381
+ A request id that passed `computerRequestIdSchema`.
382
+
383
+ ---
384
+
385
+ ### ComputerExecTruncation
386
+
387
+ ```ts
388
+ type ComputerExecTruncation = z.output<typeof execTruncationSchema>;
389
+ ```
390
+
391
+ A record that one command stream was cut.
392
+
393
+ ---
394
+
395
+ ### ComputerProcessId
396
+
397
+ ```ts
398
+ type ComputerProcessId = z.output<typeof computerProcessIdSchema>;
399
+ ```
400
+
401
+ A process id that passed `computerProcessIdSchema`.
402
+
403
+ ---
404
+
405
+ ### ComputerProcessSync
406
+
407
+ ```ts
408
+ type ComputerProcessSync = z.output<typeof computerProcessSyncSchema>;
409
+ ```
410
+
411
+ A value of `computerProcessSyncSchema`.
412
+
413
+ ---
414
+
415
+ ### ComputerProcess
416
+
417
+ ```ts
418
+ type ComputerProcess = z.output<typeof computerProcessSchema>;
419
+ ```
420
+
421
+ One started process, as the Computer reports it.
422
+
423
+ ---
424
+
425
+ ### ComputerExecInput
426
+
427
+ ```ts
428
+ type ComputerExecInput = z.output<typeof execInputSchema>;
429
+ ```
430
+
431
+ The model's command input.
432
+
433
+ ---
434
+
435
+ ### ComputerExecRequest
436
+
437
+ ```ts
438
+ type ComputerExecRequest = z.output<typeof execRequestSchema>;
439
+ ```
440
+
441
+ The host's command request: the model's input plus the host's request id.
442
+
443
+ ---
444
+
445
+ ### ComputerExecOutput
446
+
447
+ ```ts
448
+ type ComputerExecOutput = z.output<typeof execOutputSchema>;
449
+ ```
450
+
451
+ What a finished command left behind.
452
+
453
+ ---
454
+
455
+ ### ComputerExecutionCarriage
456
+
457
+ ```ts
458
+ type ComputerExecutionCarriage = Readonly<{
459
+ env?: Readonly<Record<string, string>>;
460
+ stdin?: string | Uint8Array;
461
+ }>;
462
+ ```
463
+
464
+ Host-memory-only native inputs. Never part of a tool, replay row or log.
465
+
466
+ ---
467
+
468
+ ### ComputerExecutionInvocation
469
+
470
+ ```ts
471
+ type ComputerExecutionInvocation = Readonly<{
472
+ id: string;
473
+ kind: "exec" | "process";
474
+ }>;
475
+ ```
476
+
477
+ Non-secret identity of the actual native invocation, not its credential.
478
+
479
+ ---
480
+
481
+ ### ComputerExecutionCloseReason
482
+
483
+ ```ts
484
+ type ComputerExecutionCloseReason =
485
+ "refused_start" | "native_exit" | "unknown" | "reconstructed";
486
+ ```
487
+
488
+ Authority closure is distinct from asserting a native exit code.
489
+
490
+ ---
491
+
492
+ ### ComputerExecutionHostHooks
493
+
494
+ ```ts
495
+ type ComputerExecutionHostHooks = Readonly<{
496
+ open: Promise<
497
+ Readonly<{
498
+ env?: Readonly<Record<string, string>>;
499
+ stdin?: string | Uint8Array;
500
+ }>
501
+ >;
502
+ renew: Promise<void>;
503
+ close: Promise<void>;
504
+ }>;
505
+ ```
506
+
507
+ The resource host owns cargo meaning and issuance. Computer owns NEW/replay,
508
+ dispatch and actual native liveness. Only non-secret context is durable; hooks
509
+ and carriage stay in host memory.
510
+
511
+ ---
512
+
513
+ ### ComputerExecutionHostPort
514
+
515
+ ```ts
516
+ type ComputerExecutionHostPort = Readonly<{
517
+ executionHooks:
518
+ | Readonly<{
519
+ open: Promise<
520
+ Readonly<{
521
+ env?: Readonly<Record<string, string>>;
522
+ stdin?: string | Uint8Array;
523
+ }>
524
+ >;
525
+ renew: Promise<void>;
526
+ close: Promise<void>;
527
+ }>
528
+ | undefined;
529
+ executionIsLive: Promise<boolean>;
530
+ executeOperationAfterAcceptance: Promise<{
531
+ requestId: string;
532
+ status:
533
+ "unknown" | "failed" | "running" | "accepted" | "succeeded" | "expired";
534
+ output: {
535
+ status: "completed" | "failed" | "cancelled";
536
+ exitCode: number;
537
+ stdout: string;
538
+ stderr: string;
539
+ truncated: false | object[];
540
+ } | null;
541
+ }>;
542
+ startProcessAfterAcceptance: Promise<{
543
+ id: string & object;
544
+ port: number | null;
545
+ command: string;
546
+ cwd: string | null;
547
+ state: "running" | "exited" | "uncertain";
548
+ exitCode: number | null;
549
+ sync: "unknown" | "synced" | "pending";
550
+ startedAt: number;
551
+ endedAt: number | null;
552
+ }>;
553
+ callAfterAcceptance: Promise<JSONType>;
554
+ }>;
555
+ ```
556
+
557
+ Protected host seam only. Public command/process parsers do not accept cargo.
558
+
559
+ ---
560
+
561
+ ### ComputerOperationResult
562
+
563
+ ```ts
564
+ type ComputerOperationResult = z.output<typeof computerOperationResultSchema>;
565
+ ```
566
+
567
+ The durable status of one command invocation, for the host that owns its request
568
+ id.
569
+
570
+ ---
571
+
572
+ ### ComputerToolResult
573
+
574
+ ```ts
575
+ type ComputerToolResult = z.output<typeof computerToolResultSchema>;
576
+ ```
577
+
578
+ The status of one command invocation without the host's request id.
579
+
580
+ ---
581
+
582
+ ### ComputerOperation
583
+
584
+ ```ts
585
+ type ComputerOperation = z.output<typeof computerOperationSchema>;
586
+ ```
587
+
588
+ One public operation name.
589
+
590
+ ---
591
+
592
+ ### ComputerFileReplacement
593
+
594
+ ```ts
595
+ type ComputerFileReplacement = z.output<typeof replaceInputSchema>;
596
+ ```
597
+
598
+ A request to replace a file's contents if they still match.
599
+
600
+ ---
601
+
602
+ ### ComputerFileReplacementResult
603
+
604
+ ```ts
605
+ type ComputerFileReplacementResult = z.output<typeof replaceOutputSchema>;
606
+ ```
607
+
608
+ The reply to a committed replacement.
609
+
610
+ ## Variables
611
+
612
+ ### attachedBackendIdSchema
613
+
614
+ ```ts
615
+ const attachedBackendIdSchema: ZodLazy<ZodString>;
616
+ ```
617
+
618
+ The stable Workspace id of one attached execution backend: `container`, `vm-`
619
+ followed by a lowercase letter-or-digit name that may contain hyphens, or
620
+ `local-` followed by 16 lowercase base32 characters. A command request names one
621
+ to run there; omitted, the Computer routes by its default order.
622
+
623
+ ---
624
+
625
+ ### maximumFileBytes
626
+
627
+ ```ts
628
+ const maximumFileBytes: number;
629
+ ```
630
+
631
+ Most bytes of file content one Computer read or write carries, counted as UTF-8.
632
+
633
+ ---
634
+
635
+ ### maximumListEntries
636
+
637
+ ```ts
638
+ const maximumListEntries: 256 = 256;
639
+ ```
640
+
641
+ Most entries one list, glob or grep reply returns in a single page.
642
+
643
+ ---
644
+
645
+ ### maximumPatternCharacters
646
+
647
+ ```ts
648
+ const maximumPatternCharacters: 512 = 512;
649
+ ```
650
+
651
+ Longest glob or search pattern a request may send.
652
+
653
+ ---
654
+
655
+ ### maximumCommandCharacters
656
+
657
+ ```ts
658
+ const maximumCommandCharacters: number;
659
+ ```
660
+
661
+ Longest command string a request may send.
662
+
663
+ ---
664
+
665
+ ### maximumStreamBytes
666
+
667
+ ```ts
668
+ const maximumStreamBytes: number;
669
+ ```
670
+
671
+ Most bytes of stdout or stderr kept from one command. A longer stream is cut and
672
+ marked.
673
+
674
+ ---
675
+
676
+ ### truncationMarkerReserveBytes
677
+
678
+ ```ts
679
+ const truncationMarkerReserveBytes: 256 = 256;
680
+ ```
681
+
682
+ Room inside the stream cap for the visible truncation marker.
683
+
684
+ ---
685
+
686
+ ### maximumExecutionTimeMs
687
+
688
+ ```ts
689
+ const maximumExecutionTimeMs: 120000 = 120_000;
690
+ ```
691
+
692
+ The bound for ordinary Computer commands; hosts own any admitted job budget.
693
+
694
+ ---
695
+
696
+ ### genericComputerExecutionBudget
697
+
698
+ ```ts
699
+ const genericComputerExecutionBudget: ComputerExecutionBudget;
700
+ ```
701
+
702
+ The budget for ordinary Computer commands. Hosts that admit a job principal
703
+ choose their own.
704
+
705
+ ---
706
+
707
+ ### computerValueSchema
708
+
709
+ ```ts
710
+ const computerValueSchema: ZodJSONSchema;
711
+ ```
712
+
713
+ Accepts any JSON value. Capability descriptions and other transport data are
714
+ checked against it.
715
+
716
+ ---
717
+
718
+ ### capabilityNameSchema
719
+
720
+ ```ts
721
+ const capabilityNameSchema: ZodLazy<ZodString>;
722
+ ```
723
+
724
+ Accepts the name of one Computer operation: a letter, then letters, digits or
725
+ underscores.
726
+
727
+ ---
728
+
729
+ ### computerPortSchema
730
+
731
+ ```ts
732
+ const computerPortSchema: ZodLazy<ZodNumber>;
733
+ ```
734
+
735
+ One valid TCP port number, used only with this Computer's container.
736
+
737
+ ---
738
+
739
+ ### maximumExposedPorts
740
+
741
+ ```ts
742
+ const maximumExposedPorts: 64 = 64;
743
+ ```
744
+
745
+ Most preview ports one Computer admits at once.
746
+
747
+ ---
748
+
749
+ ### computerDaemonPort
750
+
751
+ ```ts
752
+ const computerDaemonPort: 8080 = 8080;
753
+ ```
754
+
755
+ computerd's Workspace RPC port, pinned by the Cloudflare container backend.
756
+
757
+ ---
758
+
759
+ ### computerTerminalPort
760
+
761
+ ```ts
762
+ const computerTerminalPort: 7681 = 7681;
763
+ ```
764
+
765
+ The Computer-owned terminal server inside the container image.
766
+
767
+ ---
768
+
769
+ ### computerReservedPorts
770
+
771
+ ```ts
772
+ const computerReservedPorts: ReadonlySet<number>;
773
+ ```
774
+
775
+ Ports served by the Computer's own in-container daemons. An admitted preview
776
+ must never reach a control plane.
777
+
778
+ ---
779
+
780
+ ### computerPortInputSchema
781
+
782
+ ```ts
783
+ const computerPortInputSchema: ZodObject<
784
+ {
785
+ port: ZodLazy<ZodNumber>;
786
+ },
787
+ $strict
788
+ >;
789
+ ```
790
+
791
+ Names one container port to expose or remove.
792
+
793
+ ---
794
+
795
+ ### computerPortOutputSchema
796
+
797
+ ```ts
798
+ const computerPortOutputSchema: ZodLazy<
799
+ ZodObject<
800
+ {
801
+ port: ZodLazy<ZodNumber>;
802
+ exposed: ZodBoolean;
803
+ },
804
+ $strict
805
+ >
806
+ >;
807
+ ```
808
+
809
+ Reply to a request to expose a port.
810
+
811
+ ---
812
+
813
+ ### computerPortRemovalOutputSchema
814
+
815
+ ```ts
816
+ const computerPortRemovalOutputSchema: ZodLazy<
817
+ ZodObject<
818
+ {
819
+ port: ZodLazy<ZodNumber>;
820
+ removed: ZodBoolean;
821
+ },
822
+ $strict
823
+ >
824
+ >;
825
+ ```
826
+
827
+ Reply to a request to stop exposing a port.
828
+
829
+ ---
830
+
831
+ ### computerPortsOutputSchema
832
+
833
+ ```ts
834
+ const computerPortsOutputSchema: ZodLazy<
835
+ ZodObject<
836
+ {
837
+ ports: ZodArray<ZodLazy<ZodNumber>>;
838
+ },
839
+ $strict
840
+ >
841
+ >;
842
+ ```
843
+
844
+ The ports this Computer currently admits for preview.
845
+
846
+ ---
847
+
848
+ ### computerCapabilitiesSchema
849
+
850
+ ```ts
851
+ const computerCapabilitiesSchema: ZodLazy<
852
+ ZodArray<
853
+ ZodObject<
854
+ {
855
+ id: ZodLazy<ZodString>;
856
+ name: ZodLazy<ZodString>;
857
+ kind: ZodString;
858
+ description: ZodString;
859
+ parameters: ZodLazy<ZodRecord<ZodString, ZodUnknown>>;
860
+ output: ZodLazy<ZodRecord<ZodString, ZodUnknown>>;
861
+ },
862
+ $strict
863
+ >
864
+ >
865
+ >;
866
+ ```
867
+
868
+ Native operation descriptions shared by discovery and its OpenAPI document.
869
+
870
+ ---
871
+
872
+ ### pathSchema
873
+
874
+ ```ts
875
+ const pathSchema: ZodString;
876
+ ```
877
+
878
+ Accepts an absolute path inside the Computer: it starts with a slash and holds
879
+ no null byte.
880
+
881
+ ---
882
+
883
+ ### readInputSchema
884
+
885
+ ```ts
886
+ const readInputSchema: ZodObject<
887
+ {
888
+ path: ZodString;
889
+ },
890
+ $strict
891
+ >;
892
+ ```
893
+
894
+ Complete bounded UTF-8 text reads. Binary reads use the same path input.
895
+
896
+ ---
897
+
898
+ ### readOutputSchema
899
+
900
+ ```ts
901
+ const readOutputSchema: ZodLazy<
902
+ ZodObject<
903
+ {
904
+ path: ZodString;
905
+ content: ZodString;
906
+ },
907
+ $strict
908
+ >
909
+ >;
910
+ ```
911
+
912
+ The whole contents of one file, as text.
913
+
914
+ ---
915
+
916
+ ### readBytesInputSchema
917
+
918
+ ```ts
919
+ const readBytesInputSchema: ZodObject<
920
+ {
921
+ path: ZodString;
922
+ byteOffset: ZodOptional<ZodNumber>;
923
+ byteLength: ZodOptional<ZodNumber>;
924
+ },
925
+ $strict
926
+ >;
927
+ ```
928
+
929
+ Optional byte window; text reads remain complete and independently bounded.
930
+
931
+ ---
932
+
933
+ ### computerByteReadReplySchema
934
+
935
+ ```ts
936
+ const computerByteReadReplySchema: ZodLazy<
937
+ ZodObject<
938
+ {
939
+ path: ZodString;
940
+ byteOffset: ZodNumber;
941
+ content: ZodString;
942
+ encoding: ZodLiteral<"base64">;
943
+ truncated: ZodBoolean;
944
+ },
945
+ $strict
946
+ >
947
+ >;
948
+ ```
949
+
950
+ Finite byte-read reply used by admitted App frame bindings.
951
+
952
+ ---
953
+
954
+ ### appMethodPreviewResultSchema
955
+
956
+ ```ts
957
+ const appMethodPreviewResultSchema: ZodLazy<
958
+ ZodObject<
959
+ {
960
+ previewUrl: ZodURL;
961
+ expiresAt: ZodNumber;
962
+ },
963
+ $strict
964
+ >
965
+ >;
966
+ ```
967
+
968
+ Host-admitted App method preview; parsing does not grant port access.
969
+
970
+ ---
971
+
972
+ ### listLimitSchema
973
+
974
+ ```ts
975
+ const listLimitSchema: ZodDefault<ZodNumber>;
976
+ ```
977
+
978
+ Accepts how many entries a list returns: 1 up to `maximumListEntries`, 100 when
979
+ omitted.
980
+
981
+ ---
982
+
983
+ ### listOffsetSchema
984
+
985
+ ```ts
986
+ const listOffsetSchema: ZodDefault<ZodNumber>;
987
+ ```
988
+
989
+ Accepts how many entries a list skips. Zero when omitted.
990
+
991
+ ---
992
+
993
+ ### listInputSchema
994
+
995
+ ```ts
996
+ const listInputSchema: ZodObject<
997
+ {
998
+ path: ZodDefault<ZodString>;
999
+ limit: ZodDefault<ZodNumber>;
1000
+ offset: ZodDefault<ZodNumber>;
1001
+ },
1002
+ $strict
1003
+ >;
1004
+ ```
1005
+
1006
+ A request for one page of a directory's entries.
1007
+
1008
+ ---
1009
+
1010
+ ### listOutputSchema
1011
+
1012
+ ```ts
1013
+ const listOutputSchema: ZodLazy<
1014
+ ZodObject<
1015
+ {
1016
+ path: ZodString;
1017
+ entries: ZodArray<
1018
+ ZodLazy<
1019
+ ZodObject<
1020
+ {
1021
+ name: ZodString;
1022
+ size: ZodNumber;
1023
+ modifiedAt: ZodNumber;
1024
+ type: ZodEnum<{
1025
+ file: "file";
1026
+ directory: "directory";
1027
+ symlink: "symlink";
1028
+ }>;
1029
+ },
1030
+ $strict
1031
+ >
1032
+ >
1033
+ >;
1034
+ nextOffset: ZodNullable<ZodNumber>;
1035
+ },
1036
+ $strict
1037
+ >
1038
+ >;
1039
+ ```
1040
+
1041
+ One page of a directory's entries.
1042
+
1043
+ ---
1044
+
1045
+ ### fileContentSchema
1046
+
1047
+ ```ts
1048
+ const fileContentSchema: ZodLazy<ZodString>;
1049
+ ```
1050
+
1051
+ Accepts text to store in a file, within `maximumFileBytes`.
1052
+
1053
+ ---
1054
+
1055
+ ### writeInputSchema
1056
+
1057
+ ```ts
1058
+ const writeInputSchema: ZodObject<
1059
+ {
1060
+ path: ZodString;
1061
+ content: ZodLazy<ZodString>;
1062
+ },
1063
+ $strict
1064
+ >;
1065
+ ```
1066
+
1067
+ A request to write one file, creating or replacing its contents.
1068
+
1069
+ ---
1070
+
1071
+ ### writeOutputSchema
1072
+
1073
+ ```ts
1074
+ const writeOutputSchema: ZodLazy<
1075
+ ZodObject<
1076
+ {
1077
+ path: ZodString;
1078
+ bytes: ZodNumber;
1079
+ },
1080
+ $strict
1081
+ >
1082
+ >;
1083
+ ```
1084
+
1085
+ The reply to a committed file write.
1086
+
1087
+ ---
1088
+
1089
+ ### writeBytesInputSchema
1090
+
1091
+ ```ts
1092
+ const writeBytesInputSchema: ZodObject<
1093
+ {
1094
+ path: ZodString;
1095
+ },
1096
+ $strict
1097
+ > = readInputSchema;
1098
+ ```
1099
+
1100
+ Names the file for a binary write. The bytes travel as the request body.
1101
+
1102
+ ---
1103
+
1104
+ ### replaceInputSchema
1105
+
1106
+ ```ts
1107
+ const replaceInputSchema: ZodObject<
1108
+ {
1109
+ path: ZodString;
1110
+ expectedContent: ZodLazy<ZodString>;
1111
+ content: ZodLazy<ZodString>;
1112
+ },
1113
+ $strict
1114
+ >;
1115
+ ```
1116
+
1117
+ A request to replace a file's contents only if they still equal what the caller
1118
+ last saw.
1119
+
1120
+ ---
1121
+
1122
+ ### replaceOutputSchema
1123
+
1124
+ ```ts
1125
+ const replaceOutputSchema: ZodLazy<
1126
+ ZodObject<
1127
+ {
1128
+ path: ZodString;
1129
+ bytes: ZodNumber;
1130
+ },
1131
+ $strict
1132
+ >
1133
+ > = writeOutputSchema;
1134
+ ```
1135
+
1136
+ The reply to a committed replacement. It has the shape of a write reply.
1137
+
1138
+ ---
1139
+
1140
+ ### globInputSchema
1141
+
1142
+ ```ts
1143
+ const globInputSchema: ZodLazy<
1144
+ ZodObject<
1145
+ {
1146
+ path: ZodString;
1147
+ pattern: ZodString;
1148
+ limit: ZodDefault<ZodNumber>;
1149
+ },
1150
+ $strict
1151
+ >
1152
+ >;
1153
+ ```
1154
+
1155
+ A request to find paths under a directory that match a glob.
1156
+
1157
+ ---
1158
+
1159
+ ### globOutputSchema
1160
+
1161
+ ```ts
1162
+ const globOutputSchema: ZodLazy<
1163
+ ZodObject<
1164
+ {
1165
+ path: ZodString;
1166
+ matches: ZodArray<ZodString>;
1167
+ truncated: ZodBoolean;
1168
+ },
1169
+ $strict
1170
+ >
1171
+ >;
1172
+ ```
1173
+
1174
+ The paths a glob found.
1175
+
1176
+ ---
1177
+
1178
+ ### grepInputSchema
1179
+
1180
+ ```ts
1181
+ const grepInputSchema: ZodLazy<
1182
+ ZodObject<
1183
+ {
1184
+ path: ZodString;
1185
+ pattern: ZodString;
1186
+ regex: ZodDefault<ZodBoolean>;
1187
+ ignoreCase: ZodDefault<ZodBoolean>;
1188
+ include: ZodOptional<ZodString>;
1189
+ limit: ZodDefault<ZodNumber>;
1190
+ },
1191
+ $strict
1192
+ >
1193
+ >;
1194
+ ```
1195
+
1196
+ A request to search file contents under a directory.
1197
+
1198
+ ---
1199
+
1200
+ ### grepOutputSchema
1201
+
1202
+ ```ts
1203
+ const grepOutputSchema: ZodLazy<
1204
+ ZodObject<
1205
+ {
1206
+ path: ZodString;
1207
+ matches: ZodArray<
1208
+ ZodObject<
1209
+ {
1210
+ path: ZodString;
1211
+ line: ZodNumber;
1212
+ text: ZodString;
1213
+ },
1214
+ $strict
1215
+ >
1216
+ >;
1217
+ truncated: ZodBoolean;
1218
+ },
1219
+ $strict
1220
+ >
1221
+ >;
1222
+ ```
1223
+
1224
+ The lines a search found.
1225
+
1226
+ ---
1227
+
1228
+ ### editInputSchema
1229
+
1230
+ ```ts
1231
+ const editInputSchema: ZodLazy<
1232
+ ZodObject<
1233
+ {
1234
+ path: ZodString;
1235
+ oldText: ZodString;
1236
+ newText: ZodString;
1237
+ },
1238
+ $strict
1239
+ >
1240
+ >;
1241
+ ```
1242
+
1243
+ A request to replace one piece of text in a file.
1244
+
1245
+ ---
1246
+
1247
+ ### editOutputSchema
1248
+
1249
+ ```ts
1250
+ const editOutputSchema: ZodLazy<
1251
+ ZodObject<
1252
+ {
1253
+ path: ZodString;
1254
+ bytes: ZodNumber;
1255
+ diff: ZodString;
1256
+ firstChangedLine: ZodNullable<ZodNumber>;
1257
+ },
1258
+ $strict
1259
+ >
1260
+ >;
1261
+ ```
1262
+
1263
+ The reply to a committed edit.
1264
+
1265
+ ---
1266
+
1267
+ ### mkdirInputSchema
1268
+
1269
+ ```ts
1270
+ const mkdirInputSchema: ZodLazy<
1271
+ ZodObject<
1272
+ {
1273
+ path: ZodString;
1274
+ recursive: ZodDefault<ZodBoolean>;
1275
+ },
1276
+ $strict
1277
+ >
1278
+ >;
1279
+ ```
1280
+
1281
+ A request to create a directory.
1282
+
1283
+ ---
1284
+
1285
+ ### mkdirOutputSchema
1286
+
1287
+ ```ts
1288
+ const mkdirOutputSchema: ZodObject<
1289
+ {
1290
+ path: ZodString;
1291
+ },
1292
+ $strict
1293
+ >;
1294
+ ```
1295
+
1296
+ The reply to a directory creation.
1297
+
1298
+ ---
1299
+
1300
+ ### computerRequestIdSchema
1301
+
1302
+ ```ts
1303
+ const computerRequestIdSchema: ZodUUID;
1304
+ ```
1305
+
1306
+ Host-owned idempotency key for one `exec` or `bash` tool invocation. The host
1307
+ mints it once per invocation and keeps it across its own retries of that
1308
+ invocation; the model never sees or supplies it.
1309
+
1310
+ ---
1311
+
1312
+ ### execInputSchema
1313
+
1314
+ ```ts
1315
+ const execInputSchema: ZodObject<
1316
+ {
1317
+ command: ZodString;
1318
+ cwd: ZodOptional<ZodString>;
1319
+ backend: ZodOptional<ZodLazy<ZodString>>;
1320
+ timeoutMs: ZodDefault<ZodNumber>;
1321
+ },
1322
+ $strict
1323
+ >;
1324
+ ```
1325
+
1326
+ The model's command input: command, directory, backend and timeout. It carries
1327
+ no request id.
1328
+
1329
+ ---
1330
+
1331
+ ### execRequestSchema
1332
+
1333
+ ```ts
1334
+ const execRequestSchema: ZodObject<
1335
+ {
1336
+ command: ZodString;
1337
+ cwd: ZodOptional<ZodString>;
1338
+ backend: ZodOptional<ZodLazy<ZodString>>;
1339
+ timeoutMs: ZodDefault<ZodNumber>;
1340
+ requestId: ZodUUID;
1341
+ },
1342
+ $strict
1343
+ >;
1344
+ ```
1345
+
1346
+ Host-to-Computer command request: the model input plus the host's ID.
1347
+
1348
+ ---
1349
+
1350
+ ### execTruncationSchema
1351
+
1352
+ ```ts
1353
+ const execTruncationSchema: ZodObject<
1354
+ {
1355
+ stream: ZodEnum<{
1356
+ stdout: "stdout";
1357
+ stderr: "stderr";
1358
+ }>;
1359
+ keptBytes: ZodNumber;
1360
+ totalBytes: ZodNumber;
1361
+ },
1362
+ $strict
1363
+ >;
1364
+ ```
1365
+
1366
+ One command stream cut at `maximumStreamBytes`; absent streams were whole.
1367
+
1368
+ ---
1369
+
1370
+ ### execTruncationMarkerPattern
1371
+
1372
+ ```ts
1373
+ const execTruncationMarkerPattern: RegExp;
1374
+ ```
1375
+
1376
+ Matches the marker line `execTruncationMarker` appends at the end of a stream.
1377
+
1378
+ ---
1379
+
1380
+ ### execOutputSchema
1381
+
1382
+ ```ts
1383
+ const execOutputSchema: ZodObject<
1384
+ {
1385
+ status: ZodEnum<{
1386
+ completed: "completed";
1387
+ failed: "failed";
1388
+ cancelled: "cancelled";
1389
+ }>;
1390
+ exitCode: ZodNumber;
1391
+ stdout: ZodString;
1392
+ stderr: ZodString;
1393
+ truncated: ZodUnion<
1394
+ readonly [
1395
+ ZodLiteral<false>,
1396
+ ZodArray<
1397
+ ZodObject<
1398
+ {
1399
+ stream: ZodEnum<{
1400
+ stdout: "stdout";
1401
+ stderr: "stderr";
1402
+ }>;
1403
+ keptBytes: ZodNumber;
1404
+ totalBytes: ZodNumber;
1405
+ },
1406
+ $strict
1407
+ >
1408
+ >,
1409
+ ]
1410
+ >;
1411
+ },
1412
+ $strict
1413
+ >;
1414
+ ```
1415
+
1416
+ What a finished command left behind.
1417
+
1418
+ ---
1419
+
1420
+ ### computerProcessIdSchema
1421
+
1422
+ ```ts
1423
+ const computerProcessIdSchema: ZodLazy<
1424
+ ZodString &
1425
+ ZodType<
1426
+ CairnId<"computer-process", "process", 1>,
1427
+ string,
1428
+ $ZodTypeInternals<CairnId<"computer-process", "process", 1>, string>
1429
+ >
1430
+ >;
1431
+ ```
1432
+
1433
+ Accepts the durable id of one started process.
1434
+
1435
+ ---
1436
+
1437
+ ### maximumRunningProcesses
1438
+
1439
+ ```ts
1440
+ const maximumRunningProcesses: 16 = 16;
1441
+ ```
1442
+
1443
+ At most this many processes may be running in one host scope at once.
1444
+
1445
+ ---
1446
+
1447
+ ### maximumProcessRecords
1448
+
1449
+ ```ts
1450
+ const maximumProcessRecords: 64 = 64;
1451
+ ```
1452
+
1453
+ At most this many process records, running or exited, are kept per host scope.
1454
+
1455
+ ---
1456
+
1457
+ ### processStartInputSchema
1458
+
1459
+ ```ts
1460
+ const processStartInputSchema: ZodObject<
1461
+ {
1462
+ requestId: ZodString;
1463
+ requestScope: ZodString;
1464
+ port: ZodOptional<ZodLazy<ZodNumber>>;
1465
+ command: ZodString;
1466
+ cwd: ZodOptional<ZodString>;
1467
+ },
1468
+ $strict
1469
+ >;
1470
+ ```
1471
+
1472
+ The host's request to start one long-running process.
1473
+
1474
+ ---
1475
+
1476
+ ### processStartToolInputSchema
1477
+
1478
+ ```ts
1479
+ const processStartToolInputSchema: ZodObject<
1480
+ {
1481
+ port: ZodOptional<ZodLazy<ZodNumber>>;
1482
+ command: ZodString;
1483
+ cwd: ZodOptional<ZodString>;
1484
+ },
1485
+ $strict
1486
+ >;
1487
+ ```
1488
+
1489
+ Model input excludes the host's replay identity and authority scope.
1490
+
1491
+ ---
1492
+
1493
+ ### processIdInputSchema
1494
+
1495
+ ```ts
1496
+ const processIdInputSchema: ZodObject<
1497
+ {
1498
+ id: ZodLazy<
1499
+ ZodString &
1500
+ ZodType<
1501
+ CairnId<"computer-process", "process", 1>,
1502
+ string,
1503
+ $ZodTypeInternals<CairnId<"computer-process", "process", 1>, string>
1504
+ >
1505
+ >;
1506
+ },
1507
+ $strict
1508
+ >;
1509
+ ```
1510
+
1511
+ Names one started process.
1512
+
1513
+ ---
1514
+
1515
+ ### computerProcessStateSchema
1516
+
1517
+ ```ts
1518
+ const computerProcessStateSchema: ZodEnum<{
1519
+ running: "running";
1520
+ exited: "exited";
1521
+ uncertain: "uncertain";
1522
+ }>;
1523
+ ```
1524
+
1525
+ `running`: computerd still reports the execution live. `exited`: it ended;
1526
+ `exitCode` is null when the runtime that ran it was replaced or its record
1527
+ expired before the exit code was observed. `uncertain`: the Computer could not
1528
+ reach its container to check, so neither is claimed.
1529
+
1530
+ ---
1531
+
1532
+ ### computerProcessSyncSchema
1533
+
1534
+ ```ts
1535
+ const computerProcessSyncSchema: ZodEnum<{
1536
+ synced: "synced";
1537
+ pending: "pending";
1538
+ unknown: "unknown";
1539
+ }>;
1540
+ ```
1541
+
1542
+ `synced`: the drain that recorded this exit read all the way to EOF, which is
1543
+ also the read that runs computerd's post-command pull. `pending`: that drain
1544
+ gave up waiting at its own deadline (a backgrounded child, for example
1545
+ `node server.js &`, can hold the transport open long after its parent exits) --
1546
+ a background continuation keeps watching and upgrades this row to `synced` once
1547
+ it reaches that real EOF, so `pending` rows stay updatable. `unknown`: this exit
1548
+ was recorded with no pull evidence at all (a replaced runtime, an expired
1549
+ record, or any other exit path that never drained for one). Never claim `synced`
1550
+ without the specific evidence for this exit; default to `unknown`, not `synced`.
1551
+
1552
+ ---
1553
+
1554
+ ### computerProcessSchema
1555
+
1556
+ ```ts
1557
+ const computerProcessSchema: ZodObject<
1558
+ {
1559
+ id: ZodLazy<
1560
+ ZodString &
1561
+ ZodType<
1562
+ CairnId<"computer-process", "process", 1>,
1563
+ string,
1564
+ $ZodTypeInternals<CairnId<"computer-process", "process", 1>, string>
1565
+ >
1566
+ >;
1567
+ port: ZodNullable<ZodLazy<ZodNumber>>;
1568
+ command: ZodString;
1569
+ cwd: ZodNullable<ZodString>;
1570
+ state: ZodEnum<{
1571
+ running: "running";
1572
+ exited: "exited";
1573
+ uncertain: "uncertain";
1574
+ }>;
1575
+ exitCode: ZodNullable<ZodNumber>;
1576
+ sync: ZodEnum<{
1577
+ synced: "synced";
1578
+ pending: "pending";
1579
+ unknown: "unknown";
1580
+ }>;
1581
+ startedAt: ZodNumber;
1582
+ endedAt: ZodNullable<ZodNumber>;
1583
+ },
1584
+ $strict
1585
+ >;
1586
+ ```
1587
+
1588
+ One started process, as the Computer reports it.
1589
+
1590
+ ---
1591
+
1592
+ ### processListOutputSchema
1593
+
1594
+ ```ts
1595
+ const processListOutputSchema: ZodObject<
1596
+ {
1597
+ processes: ZodArray<
1598
+ ZodObject<
1599
+ {
1600
+ id: ZodLazy<
1601
+ ZodString &
1602
+ ZodType<
1603
+ CairnId<"computer-process", "process", 1>,
1604
+ string,
1605
+ $ZodTypeInternals<
1606
+ CairnId<"computer-process", "process", 1>,
1607
+ string
1608
+ >
1609
+ >
1610
+ >;
1611
+ port: ZodNullable<ZodLazy<ZodNumber>>;
1612
+ command: ZodString;
1613
+ cwd: ZodNullable<ZodString>;
1614
+ state: ZodEnum<{
1615
+ running: "running";
1616
+ exited: "exited";
1617
+ uncertain: "uncertain";
1618
+ }>;
1619
+ exitCode: ZodNullable<ZodNumber>;
1620
+ sync: ZodEnum<{
1621
+ synced: "synced";
1622
+ pending: "pending";
1623
+ unknown: "unknown";
1624
+ }>;
1625
+ startedAt: ZodNumber;
1626
+ endedAt: ZodNullable<ZodNumber>;
1627
+ },
1628
+ $strict
1629
+ >
1630
+ >;
1631
+ },
1632
+ $strict
1633
+ >;
1634
+ ```
1635
+
1636
+ The processes started on this Computer.
1637
+
1638
+ ---
1639
+
1640
+ ### processKillOutputSchema
1641
+
1642
+ ```ts
1643
+ const processKillOutputSchema: ZodLazy<
1644
+ ZodObject<
1645
+ {
1646
+ process: ZodObject<
1647
+ {
1648
+ id: ZodLazy<
1649
+ ZodString &
1650
+ ZodType<
1651
+ CairnId<"computer-process", "process", 1>,
1652
+ string,
1653
+ $ZodTypeInternals<
1654
+ CairnId<"computer-process", "process", 1>,
1655
+ string
1656
+ >
1657
+ >
1658
+ >;
1659
+ port: ZodNullable<ZodLazy<ZodNumber>>;
1660
+ command: ZodString;
1661
+ cwd: ZodNullable<ZodString>;
1662
+ state: ZodEnum<{
1663
+ running: "running";
1664
+ exited: "exited";
1665
+ uncertain: "uncertain";
1666
+ }>;
1667
+ exitCode: ZodNullable<ZodNumber>;
1668
+ sync: ZodEnum<{
1669
+ synced: "synced";
1670
+ pending: "pending";
1671
+ unknown: "unknown";
1672
+ }>;
1673
+ startedAt: ZodNumber;
1674
+ endedAt: ZodNullable<ZodNumber>;
1675
+ },
1676
+ $strict
1677
+ >;
1678
+ signalled: ZodBoolean;
1679
+ },
1680
+ $strict
1681
+ >
1682
+ >;
1683
+ ```
1684
+
1685
+ The reply to a request to stop a process.
1686
+
1687
+ ---
1688
+
1689
+ ### computerOperationStatusSchema
1690
+
1691
+ ```ts
1692
+ const computerOperationStatusSchema: ZodEnum<{
1693
+ accepted: "accepted";
1694
+ running: "running";
1695
+ succeeded: "succeeded";
1696
+ failed: "failed";
1697
+ unknown: "unknown";
1698
+ expired: "expired";
1699
+ }>;
1700
+ ```
1701
+
1702
+ Where one command invocation stands: accepted, running, succeeded, failed,
1703
+ unknown (the outcome cannot be established, because the Computer restarted
1704
+ mid-command or the id has no record yet is still inside the admission window) or
1705
+ expired (no record, and older than the admission window).
1706
+
1707
+ ---
1708
+
1709
+ ### computerOperationResultSchema
1710
+
1711
+ ```ts
1712
+ const computerOperationResultSchema: ZodObject<{
1713
+ requestId: ZodUUID;
1714
+ status: ZodEnum<{
1715
+ accepted: "accepted";
1716
+ running: "running";
1717
+ succeeded: "succeeded";
1718
+ failed: "failed";
1719
+ unknown: "unknown";
1720
+ expired: "expired";
1721
+ }>;
1722
+ output: ZodNullable<ZodObject<{
1723
+ status: ZodEnum<{
1724
+ completed: "completed";
1725
+ failed: "failed";
1726
+ cancelled: "cancelled";
1727
+ }>;
1728
+ exitCode: ZodNumber;
1729
+ stdout: ZodString;
1730
+ stderr: ZodString;
1731
+ truncated: ZodUnion<readonly [ZodLiteral<false>, ZodArray<ZodObject<{
1732
+ stream: ZodEnum<...>;
1733
+ keptBytes: ZodNumber;
1734
+ totalBytes: ZodNumber;
1735
+ }, $strict>>]>;
1736
+ }, $strict>>;
1737
+ }, $strict>;
1738
+ ```
1739
+
1740
+ Durable operation status returned to the host that owns the request ID.
1741
+
1742
+ ---
1743
+
1744
+ ### computerToolResultSchema
1745
+
1746
+ ```ts
1747
+ const computerToolResultSchema: ZodObject<{
1748
+ status: ZodEnum<{
1749
+ accepted: "accepted";
1750
+ running: "running";
1751
+ succeeded: "succeeded";
1752
+ failed: "failed";
1753
+ unknown: "unknown";
1754
+ expired: "expired";
1755
+ }>;
1756
+ output: ZodNullable<ZodObject<{
1757
+ status: ZodEnum<{
1758
+ completed: "completed";
1759
+ failed: "failed";
1760
+ cancelled: "cancelled";
1761
+ }>;
1762
+ exitCode: ZodNumber;
1763
+ stdout: ZodString;
1764
+ stderr: ZodString;
1765
+ truncated: ZodUnion<readonly [ZodLiteral<false>, ZodArray<ZodObject<{
1766
+ stream: ZodEnum<...>;
1767
+ keptBytes: ZodNumber;
1768
+ totalBytes: ZodNumber;
1769
+ }, $strict>>]>;
1770
+ }, $strict>>;
1771
+ }, $strict>;
1772
+ ```
1773
+
1774
+ Model-facing command result: the durable status without the host's ID.
1775
+
1776
+ ---
1777
+
1778
+ ### computerOperationSchema
1779
+
1780
+ ```ts
1781
+ const computerOperationSchema: ZodEnum<{
1782
+ files.read: "files.read";
1783
+ files.readBytes: "files.readBytes";
1784
+ files.write: "files.write";
1785
+ files.writeBytes: "files.writeBytes";
1786
+ files.list: "files.list";
1787
+ files.glob: "files.glob";
1788
+ files.grep: "files.grep";
1789
+ files.edit: "files.edit";
1790
+ files.patch: "files.patch";
1791
+ mkdir: "mkdir";
1792
+ bash: "bash";
1793
+ exec: "exec";
1794
+ }>;
1795
+ ```
1796
+
1797
+ Public operation vocabulary; transport adapters map these to routes.
1798
+
1799
+ ---
1800
+
1801
+ ### patchInputSchema
1802
+
1803
+ ```ts
1804
+ const patchInputSchema: z.ZodLazy<
1805
+ z.ZodObject<
1806
+ {
1807
+ patch: z.ZodString;
1808
+ },
1809
+ z.core.$strict
1810
+ >
1811
+ >;
1812
+ ```
1813
+
1814
+ Browser-safe patch contracts shared by native Files tools and Computer HTTP.
1815
+
1816
+ ---
1817
+
1818
+ ### patchOutputSchema
1819
+
1820
+ ```ts
1821
+ const patchOutputSchema: z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
1822
+ status: z.ZodEnum<{
1823
+ completed: "completed";
1824
+ failed: "failed";
1825
+ cancelled: "cancelled";
1826
+ }>;
1827
+ exitCode: z.ZodNumber;
1828
+ stdout: z.ZodString;
1829
+ stderr: z.ZodString;
1830
+ truncated: z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodArray<z.ZodObject<..., ...>>]>;
1831
+ }, z.core.$strict>, z.ZodObject<{
1832
+ status: z.ZodEnum<{
1833
+ completed: "completed";
1834
+ failed: "failed";
1835
+ cancelled: "cancelled";
1836
+ }>;
1837
+ exitCode: z.ZodNumber;
1838
+ stdout: z.ZodString;
1839
+ stderr: z.ZodString;
1840
+ truncated: z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodArray<z.ZodObject<..., ...>>]>;
1841
+ error: z.ZodObject<{
1842
+ kind: z.ZodLiteral<"mismatch">;
1843
+ }, z.core.$strict>;
1844
+ }, z.core.$strict>]>>;
1845
+ ```
1846
+
1847
+ Native patch completion, cancellation or failure, including an optional
1848
+ mismatch.
1849
+
1850
+ ## Functions
1851
+
1852
+ ### isComputerReservedPort()
1853
+
1854
+ ```ts
1855
+ function isComputerReservedPort(port): boolean;
1856
+ ```
1857
+
1858
+ Whether a Computer daemon owns this port, so it can never be admitted for
1859
+ preview.
1860
+
1861
+ #### Parameters
1862
+
1863
+ | Parameter | Type |
1864
+ | --------- | -------- |
1865
+ | `port` | `number` |
1866
+
1867
+ #### Returns
1868
+
1869
+ `boolean`
1870
+
1871
+ ---
1872
+
1873
+ ### boundedTextSchema()
1874
+
1875
+ ```ts
1876
+ function boundedTextSchema(minimumLength?): ZodString;
1877
+ ```
1878
+
1879
+ Builds a schema for text of at least the given length whose UTF-8 size stays
1880
+ within `maximumFileBytes`.
1881
+
1882
+ #### Parameters
1883
+
1884
+ | Parameter | Type | Default value |
1885
+ | --------------- | -------- | ------------- |
1886
+ | `minimumLength` | `number` | `0` |
1887
+
1888
+ #### Returns
1889
+
1890
+ `ZodString`
1891
+
1892
+ ---
1893
+
1894
+ ### mintComputerRequestId()
1895
+
1896
+ ```ts
1897
+ function mintComputerRequestId(): string;
1898
+ ```
1899
+
1900
+ Mint the request ID for one host tool invocation.
1901
+
1902
+ #### Returns
1903
+
1904
+ `string`
1905
+
1906
+ ---
1907
+
1908
+ ### computerExecutionRequestSchema()
1909
+
1910
+ ```ts
1911
+ function computerExecutionRequestSchema(budget): ZodObject<
1912
+ {
1913
+ command: ZodString;
1914
+ cwd: ZodOptional<ZodString>;
1915
+ backend: ZodOptional<ZodLazy<ZodString>>;
1916
+ timeoutMs: ZodDefault<ZodNumber>;
1917
+ requestId: ZodUUID;
1918
+ },
1919
+ $strict
1920
+ >;
1921
+ ```
1922
+
1923
+ Resource hosts select a budget only after admitting their job principal.
1924
+
1925
+ #### Parameters
1926
+
1927
+ | Parameter | Type |
1928
+ | --------- | ----------------------------------------------------- |
1929
+ | `budget` | [`ComputerExecutionBudget`](#computerexecutionbudget) |
1930
+
1931
+ #### Returns
1932
+
1933
+ `ZodObject`\<\{ `command`: `ZodString`; `cwd`: `ZodOptional`\<`ZodString`\>;
1934
+ `backend`: `ZodOptional`\<`ZodLazy`\<`ZodString`\>\>; `timeoutMs`:
1935
+ `ZodDefault`\<`ZodNumber`\>; `requestId`: `ZodUUID`; \}, `$strict`\>
1936
+
1937
+ ---
1938
+
1939
+ ### execTruncationMarker()
1940
+
1941
+ ```ts
1942
+ function execTruncationMarker(entry): string;
1943
+ ```
1944
+
1945
+ The visible line appended to a cut stream; sizes exclude the line itself.
1946
+
1947
+ #### Parameters
1948
+
1949
+ | Parameter | Type | Description |
1950
+ | ------------------ | ---------------------------------------------------------------------------------------- | ---------------------------------------- |
1951
+ | `entry` | \{ `stream`: `"stdout"` \| `"stderr"`; `keptBytes`: `number`; `totalBytes`: `number`; \} | - |
1952
+ | `entry.stream` | `"stdout"` \| `"stderr"` | Which stream was cut. |
1953
+ | `entry.keptBytes` | `number` | Bytes of the stream that were kept. |
1954
+ | `entry.totalBytes` | `number` | Bytes the stream held before it was cut. |
1955
+
1956
+ #### Returns
1957
+
1958
+ `string`
1959
+
1960
+ ---
1961
+
1962
+ ### utf8Prefix()
1963
+
1964
+ ```ts
1965
+ function utf8Prefix(bytes, limit): Uint8Array<ArrayBuffer>;
1966
+ ```
1967
+
1968
+ Longest prefix of `bytes` within `limit` that ends on a UTF-8 character
1969
+ boundary.
1970
+
1971
+ #### Parameters
1972
+
1973
+ | Parameter | Type |
1974
+ | --------- | ------------ |
1975
+ | `bytes` | `Uint8Array` |
1976
+ | `limit` | `number` |
1977
+
1978
+ #### Returns
1979
+
1980
+ `Uint8Array`\<`ArrayBuffer`\>
1981
+
1982
+ ---
1983
+
1984
+ ### mintComputerProcessId()
1985
+
1986
+ ```ts
1987
+ function mintComputerProcessId(): string & object;
1988
+ ```
1989
+
1990
+ Mint the durable identity of one started process.
1991
+
1992
+ #### Returns
1993
+
1994
+ ---
1995
+
1996
+ ### installationProcessScope()
1997
+
1998
+ ```ts
1999
+ function installationProcessScope(installation, method, actor): string;
2000
+ ```
2001
+
2002
+ A trusted App host binds replay identity to its admitted installation and
2003
+ caller.
2004
+
2005
+ #### Parameters
2006
+
2007
+ | Parameter | Type |
2008
+ | -------------- | ------------------------------------------------------------------------------------ |
2009
+ | `installation` | `string` |
2010
+ | `method` | `string` |
2011
+ | `actor` | `Readonly`\<\{ `kind`: `"member"` \| `"agent"` \| `"team-key"`; `id`: `string`; \}\> |
2012
+
2013
+ #### Returns
2014
+
2015
+ `string`
2016
+
2017
+ ---
2018
+
2019
+ ### computerToolResult()
2020
+
2021
+ ```ts
2022
+ function computerToolResult(result): object;
2023
+ ```
2024
+
2025
+ Project one host operation result onto the model-facing tool result.
2026
+
2027
+ #### Parameters
2028
+
2029
+ | Parameter | Type | Description |
2030
+ | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------- |
2031
+ | `result` | \{ `requestId`: `string`; `status`: `"unknown"` \| `"failed"` \| `"running"` \| `"accepted"` \| `"succeeded"` \| `"expired"`; `output`: \| \{ `status`: `"completed"` \| `"failed"` \| `"cancelled"`; `exitCode`: `number`; `stdout`: `string`; `stderr`: `string`; `truncated`: `false` \| `object`[]; \} \| `null`; \} | - |
2032
+ | `result.requestId` | `string` | The host's id for this invocation. |
2033
+ | `result.status` | `"unknown"` \| `"failed"` \| `"running"` \| `"accepted"` \| `"succeeded"` \| `"expired"` | Where the invocation stands. |
2034
+ | `result.output` | \| \{ `status`: `"completed"` \| `"failed"` \| `"cancelled"`; `exitCode`: `number`; `stdout`: `string`; `stderr`: `string`; `truncated`: `false` \| `object`[]; \} \| `null` | The command's output once known and still retained, otherwise null. |
2035
+
2036
+ #### Returns
2037
+
2038
+ | Name | Type | Default value | Description |
2039
+ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- | ------------------------------------------------------------------- |
2040
+ | `status` | `"unknown"` \| `"failed"` \| `"running"` \| `"accepted"` \| `"succeeded"` \| `"expired"` | `computerOperationStatusSchema` | Where the invocation stands. |
2041
+ | `output` | \| \{ `status`: `"completed"` \| `"failed"` \| `"cancelled"`; `exitCode`: `number`; `stdout`: `string`; `stderr`: `string`; `truncated`: `false` \| `object`[]; \} \| `null` | - | The command's output once known and still retained, otherwise null. |
2042
+
2043
+ ---
2044
+
2045
+ ### computerCapabilities()
2046
+
2047
+ ```ts
2048
+ function computerCapabilities(): object[];
2049
+ ```
2050
+
2051
+ The operations every Computer advertises; static, so hosts can describe them
2052
+ without a call. Built on first read: deriving JSON Schema for every operation is
2053
+ real work that a Worker should not pay at startup.
2054
+
2055
+ #### Returns