@keska/sandbox 0.43.0 → 0.46.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.
Files changed (3) hide show
  1. package/dist/index.d.ts +994 -287
  2. package/dist/index.js +1823 -519
  3. package/package.json +4 -3
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { Interceptor } from '@connectrpc/connect';
2
1
  import WebSocket from 'ws';
2
+ import { Interceptor } from '@connectrpc/connect';
3
3
 
4
4
  type CredentialsDict = {
5
5
  type?: string;
@@ -38,7 +38,7 @@ type ResourceUsage = {
38
38
  cpuUsageUsec: number;
39
39
  cpuMillicores: number;
40
40
  };
41
- /** Live sandbox record from create, open, get, or park. */
41
+ /** Live sandbox record from create, wake, get, or sleep. */
42
42
  type SandboxInfo = {
43
43
  id: string;
44
44
  name: string;
@@ -49,7 +49,7 @@ type SandboxInfo = {
49
49
  secretEnv: Record<string, string>;
50
50
  workdir: string;
51
51
  labels: Record<string, string>;
52
- tags: string[];
52
+ profileId: string;
53
53
  /** How the sandbox reaches the network. */
54
54
  net: string;
55
55
  volumeId: string;
@@ -77,7 +77,7 @@ type SandboxSummary = {
77
77
  image: string;
78
78
  name: string;
79
79
  labels: Record<string, string>;
80
- tags: string[];
80
+ profileId: string;
81
81
  createdAt: string;
82
82
  usage: ResourceUsage | null;
83
83
  /** The worker holding this sandbox cannot be reached. The status stays the last recorded value. */
@@ -151,7 +151,7 @@ type VolumeList = {
151
151
  nextPageToken: string;
152
152
  };
153
153
  /** Visitor credential for one guest HTTP port. token is set only on create. */
154
- declare class HTTPGrant {
154
+ declare class HTTPGrant$1 {
155
155
  readonly id: string;
156
156
  readonly sandboxId: string;
157
157
  readonly port: number;
@@ -171,41 +171,72 @@ type SecretList = {
171
171
  secrets: Secret[];
172
172
  nextPageToken: string;
173
173
  };
174
- /** One Matrix agent. `matrixUserId` is who you invite. `secretEnv` maps an env name to a secret name. Values are not included. */
174
+ /** One agent on the wire. `secretEnv` maps an env name to a secret name. Values are not included. */
175
175
  type Agent$1 = {
176
176
  id: string;
177
177
  name: string;
178
178
  matrixUserId: string;
179
179
  secretEnv: Record<string, string>;
180
180
  createdAt: string;
181
+ /** Sandbox this agent is attached to now. Empty when it has none. */
182
+ activeSandboxId: string;
183
+ messaging: boolean;
184
+ matrixRoomId: string;
185
+ templateId: string;
186
+ image: string;
187
+ profileId: string;
181
188
  };
182
189
  type AgentList = {
183
190
  agents: Agent$1[];
184
191
  nextPageToken: string;
185
192
  };
186
- /** Returned only by the call that mints the project token. */
187
- type Token = {
193
+ /** Short-lived Matrix device for an SDK process (CreateMatrixSession). */
194
+ type MatrixSession = {
188
195
  homeserver: string;
189
196
  userId: string;
190
197
  accessToken: string;
198
+ sessionId: string;
191
199
  };
192
- /** Whether a project token is issued. The access token is not here. */
193
- type TokenStatus = {
194
- homeserver: string;
195
- userId: string;
196
- issued: boolean;
200
+ type ScanCheck = "vulnerabilities" | "secrets";
201
+ type RuntimeEvent = "exec" | "filesystem" | "network";
202
+ type Severity = "low" | "medium" | "high" | "critical" | "";
203
+ type ScanPolicy = {
204
+ checks: ScanCheck[];
205
+ every?: string;
206
+ minSeverity?: Severity;
207
+ };
208
+ type RuntimePolicy = {
209
+ events: RuntimeEvent[];
197
210
  };
198
- /** A tag. Create it before passing its name to `create`. */
199
- type Tag = {
211
+ type Profile$1 = {
200
212
  id: string;
201
213
  name: string;
202
- policyId: string;
203
- attachmentCount: number;
214
+ resourcePolicyId: string;
215
+ securityPolicyId: string;
216
+ resourcePolicy: ResourcePolicy$1 | null;
217
+ securityPolicy: SecurityPolicy$1 | null;
218
+ sandboxCount: number;
219
+ templateCount: number;
220
+ agentCount: number;
204
221
  createdAt: string;
205
222
  updatedAt: string;
206
223
  };
207
- type TagList = {
208
- tags: Tag[];
224
+ type ProfileList = {
225
+ profiles: Profile$1[];
226
+ nextPageToken: string;
227
+ };
228
+ type Template$1 = {
229
+ id: string;
230
+ name: string;
231
+ image: string;
232
+ secretEnv: Record<string, string>;
233
+ profileId: string;
234
+ agentCount: number;
235
+ createdAt: string;
236
+ updatedAt: string;
237
+ };
238
+ type TemplateList = {
239
+ templates: Template$1[];
209
240
  nextPageToken: string;
210
241
  };
211
242
  type ImageKind = "platform" | "project" | "";
@@ -220,86 +251,34 @@ type ImageList = {
220
251
  images: Image[];
221
252
  nextPageToken: string;
222
253
  };
223
- /** Falco/IDS source class. Public SDK names; wire is SECURITY_SOURCE_CLASS_*. */
224
- declare const SecuritySourceClass: {
225
- readonly unspecified: "unspecified";
226
- readonly exec: "exec";
227
- readonly filesystem: "filesystem";
228
- readonly network: "network";
229
- };
230
- type SecuritySourceClassName = (typeof SecuritySourceClass)[keyof typeof SecuritySourceClass];
231
- type AVPolicy = {
232
- enabled: boolean;
233
- scanners: string[];
234
- skipDbUpdate: boolean;
235
- workScanIntervalMs: number;
236
- minSeverity: string[];
237
- ignoreUnfixed: boolean;
238
- };
239
- /** IDS policy. allowedSources are alert groups. allowedRules filters Falco's own rule names and does not select a rules file. */
240
- type IDSPolicy = {
241
- enabled: boolean;
242
- allowedSources: SecuritySourceClassName[];
243
- allowedRules: string[];
244
- blockedRules: string[];
245
- minPriority: string;
246
- };
247
- type PolicyNodeAck = {
248
- nodeId: string;
249
- ackedAtUnix: number;
250
- error: string;
251
- };
252
- type PolicyRollout = {
253
- revision: number;
254
- expectedNodes: string[];
255
- missingNodes: string[];
256
- acks: PolicyNodeAck[];
257
- complete: boolean;
258
- hubUnavailable: boolean;
259
- };
260
- /** Named AV+IDS document. Bind with Tag.securityPolicy. */
261
- type SecurityPolicy = {
262
- id: string;
263
- name: string;
264
- av: AVPolicy;
265
- ids: IDSPolicy;
266
- preset: string;
267
- attachmentCount: number;
268
- createdAt: string;
269
- updatedAt: string;
270
- };
271
- type ResourcePolicy = {
254
+ /** Named AV+IDS document. Bind with Profile.securityPolicyId. */
255
+ type SecurityPolicy$1 = {
272
256
  id: string;
273
257
  name: string;
274
- cpuMillicores: number;
275
- memoryBytes: number;
276
- diskBytes: number;
258
+ scanning: ScanPolicy | null;
259
+ runtime: RuntimePolicy | null;
260
+ profileCount: number;
277
261
  createdAt: string;
278
262
  updatedAt: string;
279
263
  };
280
- type PolicySection = {
281
- kind: "security" | "resource" | "";
282
- ref: string;
264
+ type SecurityPolicyList = {
265
+ policies: SecurityPolicy$1[];
266
+ nextPageToken: string;
283
267
  };
284
- type Policy = {
268
+ type ResourcePolicy$1 = {
285
269
  id: string;
286
270
  name: string;
287
- sections: PolicySection[];
288
- attachmentCount: number;
289
- security: SecurityPolicy | null;
290
- resources: ResourcePolicy | null;
271
+ cpuMillicores: number | null;
272
+ memoryBytes: number | null;
273
+ diskBytes: number | null;
274
+ profileCount: number;
291
275
  createdAt: string;
292
276
  updatedAt: string;
293
277
  };
294
- type PolicyList = {
295
- policies: Policy[];
278
+ type ResourcePolicyList = {
279
+ policies: ResourcePolicy$1[];
296
280
  nextPageToken: string;
297
281
  };
298
- type PolicyMutation = {
299
- policy: Policy;
300
- avRollout: PolicyRollout;
301
- idsRollout: PolicyRollout;
302
- };
303
282
  /** One file or directory from `ls` or `stat`. */
304
283
  type FileInfo = {
305
284
  name: string;
@@ -379,71 +358,103 @@ declare class SandboxError extends Error {
379
358
  /** One line with the server fields callers otherwise reassemble. */
380
359
  format(): string;
381
360
  }
361
+ /** A sandbox, path, or other named object does not exist. */
382
362
  declare class NotFoundError extends SandboxError {
383
363
  }
364
+ /** The object already exists or is in use. */
384
365
  declare class ConflictError extends SandboxError {
385
366
  }
367
+ /** The caller is not allowed to perform this call. */
386
368
  declare class PermissionDeniedError extends SandboxError {
387
369
  }
388
- declare class SandboxTimeoutError extends SandboxError {
370
+ /** The call exceeded its deadline. Pass a larger `timeout` on that call. */
371
+ declare class TimeoutError extends SandboxError {
372
+ }
373
+ /** An image build or register exceeded its deadline. Pass a larger `timeout` or `waitSec`. */
374
+ declare class ImageTimeoutError extends TimeoutError {
375
+ }
376
+ /** A sandbox call exceeded its deadline. Pass a larger `timeout` on that call. */
377
+ declare class SandboxTimeoutError extends TimeoutError {
389
378
  }
390
379
  declare class PageExhaustedError extends SandboxError {
391
380
  constructor(message?: string);
392
381
  }
382
+ /** The service could not be reached. */
393
383
  declare class UnavailableError extends SandboxError {
394
384
  }
385
+ /** `run` or `sh` exited non-zero and `check` was true. */
395
386
  declare class CommandFailedError extends SandboxError {
396
387
  result?: ExecResult | ExecBytesResult;
397
388
  }
389
+ /** The guest path does not exist. */
398
390
  declare class PathNotFoundError extends NotFoundError {
399
391
  }
400
- declare class FileNotFoundError extends PathNotFoundError {
401
- }
392
+ /** A directory remove needs `recursive` because the directory is not empty. */
402
393
  declare class DirectoryNotEmptyError extends ConflictError {
403
394
  }
395
+ /** The guest path already exists. */
404
396
  declare class FileExistsError extends SandboxError {
405
397
  }
398
+ /** The file or export is over the size limit. */
406
399
  declare class FileTooLargeError extends SandboxError {
407
400
  }
401
+ /** The path is not allowed. A symlink upload is refused. */
408
402
  declare class InvalidPathError extends SandboxError {
409
403
  }
410
- /** No sandbox, secret, snapshot, volume, image, or tag has that id or name. */
404
+ /** No sandbox has that id or name. */
411
405
  declare class SandboxNotFoundError extends NotFoundError {
412
406
  }
407
+ /** The sandbox is not in the state this call requires. */
413
408
  declare class SandboxNotReadyError extends SandboxError {
414
409
  }
410
+ /** The sandbox is already in use for this operation. */
415
411
  declare class SandboxConflictError extends ConflictError {
416
412
  }
417
413
  /** That name is already in use. `existingId` is the id that has it. */
418
414
  declare class NameTakenError extends ConflictError {
419
415
  get existingId(): string;
420
416
  }
417
+ /** The sandbox status does not allow this call. */
421
418
  declare class SandboxStateError extends SandboxError {
422
419
  }
420
+ /** No process has that id on the sandbox. */
423
421
  declare class ProcessNotFoundError extends NotFoundError {
424
422
  }
423
+ /** The command executable is not on the guest. */
425
424
  declare class ExecutableNotFoundError extends NotFoundError {
426
425
  }
426
+ /** The guest runtime is not accepting calls. */
427
427
  declare class GuestRuntimeDeadError extends SandboxError {
428
428
  }
429
+ /** The project has no room for another sandbox of this size. */
429
430
  declare class CapacityError extends SandboxError {
430
431
  }
432
+ /** The credentials were rejected. */
431
433
  declare class AuthenticationError extends SandboxError {
432
434
  }
435
+ /** A call argument is missing or not allowed. */
433
436
  declare class InvalidArgumentError extends SandboxError {
434
437
  }
438
+ /** Delete is blocked because another object still references this one. */
439
+ declare class ResourceInUseError extends SandboxError {
440
+ get count(): number;
441
+ }
442
+ /** argv, env, and cwd together exceed the command limit. */
435
443
  declare class CommandTooLargeError extends InvalidArgumentError {
436
444
  }
445
+ /** The command was killed because `timeout` elapsed. Pass a larger `timeout`. */
437
446
  declare class CommandTimeoutError extends SandboxTimeoutError {
438
447
  }
439
448
  /** Nothing is listening on the forwarded port. */
440
449
  declare class PortNotOpenError extends SandboxError {
441
450
  }
442
- /** The sandbox is sleeping. Open it before an HTTP request. */
451
+ /** The sandbox is sleeping. Wake it before an HTTP request. */
443
452
  declare class SandboxSleepingError extends SandboxError {
444
453
  }
454
+ /** `wait` ended before the process exited. Pass a larger `timeout`. */
445
455
  declare class ProcessWaitTimeoutError extends SandboxTimeoutError {
446
456
  }
457
+ /** `wait` ended before the sandbox reached the requested state. Pass a larger `timeout`. */
447
458
  declare class SandboxWaitTimeoutError extends SandboxTimeoutError {
448
459
  }
449
460
 
@@ -463,8 +474,8 @@ type CreateSandboxParams = {
463
474
  workdir?: string;
464
475
  lifetimeSec?: number;
465
476
  idleTimeoutSec?: number;
466
- /** Project tag names that must already exist. */
467
- tags?: string[];
477
+ /** Existing profile id. Empty means no profile. */
478
+ profileId?: string;
468
479
  fromSnapshotId?: string;
469
480
  volumeId?: string;
470
481
  labels?: Record<string, string>;
@@ -544,7 +555,7 @@ declare class Session {
544
555
  close(): void;
545
556
  get forwardBaseUrl(): string;
546
557
  /** Byte stream to a guest port. The call is gRPC on `sbx`.
547
- * Park drops the VMM, so an open forward ends; close it and open a new one after `open()`. */
558
+ * Sleep drops the VMM, so an open forward ends; close it and open a new one after `wake()`. */
548
559
  forward(sandboxId: string, port: number, opts?: CallOpts & {
549
560
  baseUrl?: string;
550
561
  }): Promise<ForwardSession>;
@@ -565,9 +576,9 @@ declare class Session {
565
576
  /** Mint a visitor credential for one guest HTTP port. The token is returned once. */
566
577
  createHttpGrant(sandboxId: string, port: number, opts?: CallOpts & {
567
578
  ttlSec?: number;
568
- }): Promise<HTTPGrant>;
579
+ }): Promise<HTTPGrant$1>;
569
580
  /** List grants for one sandbox. The secret is not included. */
570
- listHttpGrants(sandboxId: string, opts?: CallOpts): Promise<HTTPGrant[]>;
581
+ listHttpGrants(sandboxId: string, opts?: CallOpts): Promise<HTTPGrant$1[]>;
571
582
  /** Delete one grant in the caller's project. */
572
583
  deleteHttpGrant(id: string, opts?: CallOpts): Promise<void>;
573
584
  /** Control-plane `Authorization` bearer. Guest URL callers use `getGuestHeaders`. */
@@ -576,8 +587,8 @@ declare class Session {
576
587
  getGuestHeaders(): Promise<Record<string, string>>;
577
588
  /** CreateSandbox. The server mints the id. `name` is an optional lookup. */
578
589
  createSandbox(params: CreateSandboxParams): Promise<SandboxInfo>;
579
- /** OpenSandbox: wake by id or name. Does not create. */
580
- openSandbox(sandboxId?: string, opts?: CallOpts & {
590
+ /** WakeSandbox: wake by id or name. Does not create. */
591
+ wakeSandbox(sandboxId?: string, opts?: CallOpts & {
581
592
  name?: string;
582
593
  }): Promise<SandboxInfo>;
583
594
  listLogArchives(opts?: CallOpts & {
@@ -591,7 +602,7 @@ declare class Session {
591
602
  name: string;
592
603
  image: string;
593
604
  labels: Record<string, string>;
594
- tags: string[];
605
+ profileId: string;
595
606
  createdAt: string;
596
607
  }[];
597
608
  nextPageToken: string;
@@ -625,22 +636,33 @@ declare class Session {
625
636
  }): Promise<SandboxInfo>;
626
637
  listSandboxes(opts?: CallOpts & {
627
638
  labels?: Record<string, string>;
628
- tags?: string[];
639
+ profileId?: string;
629
640
  statuses?: Array<string | number>;
630
641
  pageSize?: number;
631
642
  pageToken?: string;
632
643
  }): Promise<SandboxList>;
644
+ updateSandbox(sandboxId: string, opts?: CallOpts & {
645
+ labels?: Record<string, string>;
646
+ profileId?: string | null;
647
+ }): Promise<SandboxInfo>;
633
648
  setSandboxLabels(sandboxId: string, labels: Record<string, string> | undefined, opts?: CallOpts): Promise<SandboxInfo>;
649
+ resizeSandbox(sandboxId: string, packing: {
650
+ cpuMillicores?: number;
651
+ memoryBytes?: number;
652
+ diskBytes?: number;
653
+ }, opts?: CallOpts): Promise<SandboxInfo>;
634
654
  setSandboxSize(sandboxId: string, packing: {
635
655
  cpuMillicores?: number;
636
656
  memoryBytes?: number;
637
657
  diskBytes?: number;
638
658
  }, opts?: CallOpts): Promise<SandboxInfo>;
639
- setSandboxTags(sandboxId: string, tags: string[] | undefined, opts?: CallOpts): Promise<SandboxInfo>;
659
+ setSandboxProfile(sandboxId: string, profileId: string | undefined | null, opts?: CallOpts): Promise<SandboxInfo>;
640
660
  /** DeleteSandbox. Idempotent if gone. Named volumes stay. */
641
661
  deleteSandbox(sandboxId: string, opts?: CallOpts): Promise<void>;
642
- /** ParkSandbox: reboot. Commit the writable layer, drop the VM, keep the id. */
643
- parkSandbox(sandboxId: string, opts?: CallOpts): Promise<SandboxInfo>;
662
+ /** SleepSandbox: stop the VM and keep the id. */
663
+ sleepSandbox(sandboxId?: string, opts?: CallOpts & {
664
+ name?: string;
665
+ }): Promise<SandboxInfo>;
644
666
  execStream(sandboxId: string, argv: string[], opts?: ExecStreamOpts): AsyncGenerator<StreamChunk, number | undefined>;
645
667
  startProcess(sandboxId: string, argv: string[], opts?: CallOpts & {
646
668
  env?: Record<string, string>;
@@ -700,7 +722,7 @@ declare class Session {
700
722
  pageSize?: number;
701
723
  pageToken?: string;
702
724
  }): Promise<SnapshotList>;
703
- setSnapshotLabels(snapshotId: string, labels: Record<string, string> | undefined, opts?: CallOpts): Promise<Snapshot>;
725
+ updateSnapshot(snapshotId: string, labels: Record<string, string> | undefined, opts?: CallOpts): Promise<Snapshot>;
704
726
  deleteSnapshot(snapshotId: string, opts?: CallOpts): Promise<void>;
705
727
  /** Named workdir disk that survives sandbox delete. Attach at Create. */
706
728
  createVolume(opts?: CallOpts & {
@@ -724,53 +746,105 @@ declare class Session {
724
746
  pageToken?: string;
725
747
  }): Promise<SecretList>;
726
748
  deleteSecret(name: string, opts?: CallOpts): Promise<void>;
727
- createAgent(name: string, opts?: CallOpts): Promise<Agent$1>;
728
- getAgent(id: string, opts?: CallOpts): Promise<Agent$1>;
749
+ createAgent(name: string, opts?: CallOpts & {
750
+ templateId?: string;
751
+ messaging?: boolean;
752
+ }): Promise<Agent$1>;
753
+ getAgent(id?: string, opts?: CallOpts & {
754
+ name?: string;
755
+ }): Promise<Agent$1>;
729
756
  listAgents(opts?: CallOpts & {
730
757
  pageSize?: number;
731
758
  pageToken?: string;
759
+ messaging?: boolean;
732
760
  }): Promise<AgentList>;
733
761
  deleteAgent(id: string, opts?: CallOpts): Promise<void>;
734
- setAgentSecret(agentId: string, envName: string, value: string, opts?: CallOpts): Promise<Agent$1>;
735
- deleteAgentSecret(agentId: string, envName: string, opts?: CallOpts): Promise<Agent$1>;
736
- createToken(opts?: CallOpts): Promise<Token>;
737
- tokenStatus(opts?: CallOpts): Promise<TokenStatus>;
738
- revokeToken(opts?: CallOpts): Promise<void>;
739
- createTag(name: string, opts?: CallOpts & {
740
- policyId?: string;
741
- }): Promise<Tag>;
742
- getTag(tagId: string, opts?: CallOpts): Promise<Tag>;
743
- listTags(opts?: CallOpts & {
744
- pageSize?: number;
745
- pageToken?: string;
746
- }): Promise<TagList>;
747
- updateTag(tagId: string, opts?: CallOpts & {
748
- policyId?: string;
749
- }): Promise<Tag>;
750
- createPolicy(name: string, opts?: CallOpts & {
751
- av?: AVPolicy;
752
- ids?: IDSPolicy;
753
- preset?: string;
762
+ bindAgentSecret(agentId: string, envName: string, secretName: string, opts?: CallOpts): Promise<Agent$1>;
763
+ unbindAgentSecret(agentId: string, envName: string, opts?: CallOpts): Promise<Agent$1>;
764
+ createMatrixSession(opts?: CallOpts): Promise<MatrixSession>;
765
+ deleteMatrixSession(sessionId: string, opts?: CallOpts): Promise<void>;
766
+ createResourcePolicy(name: string, opts?: CallOpts & {
754
767
  cpuMillicores?: number;
755
768
  memoryBytes?: number;
756
769
  diskBytes?: number;
757
- }): Promise<PolicyMutation>;
758
- getPolicy(policyId: string, opts?: CallOpts): Promise<Policy>;
759
- listPolicies(opts?: CallOpts & {
770
+ }): Promise<ResourcePolicy$1>;
771
+ getResourcePolicy(id?: string, opts?: CallOpts & {
772
+ name?: string;
773
+ }): Promise<ResourcePolicy$1>;
774
+ getResourcePolicyByName(name: string, opts?: CallOpts): Promise<ResourcePolicy$1>;
775
+ listResourcePolicies(opts?: CallOpts & {
760
776
  pageSize?: number;
761
777
  pageToken?: string;
762
- }): Promise<PolicyList>;
763
- updatePolicy(policyId: string, opts?: CallOpts & {
778
+ }): Promise<ResourcePolicyList>;
779
+ updateResourcePolicy(id: string, opts?: CallOpts & {
764
780
  name?: string;
765
- av?: AVPolicy;
766
- ids?: IDSPolicy;
767
- preset?: string;
768
- cpuMillicores?: number;
769
- memoryBytes?: number;
770
- diskBytes?: number;
771
- }): Promise<PolicyMutation>;
772
- deletePolicy(policyId: string, opts?: CallOpts): Promise<void>;
773
- deleteTag(tagId: string, opts?: CallOpts): Promise<void>;
781
+ cpuMillicores?: number | null;
782
+ memoryBytes?: number | null;
783
+ diskBytes?: number | null;
784
+ clearCpu?: boolean;
785
+ clearMemory?: boolean;
786
+ clearDisk?: boolean;
787
+ }): Promise<ResourcePolicy$1>;
788
+ deleteResourcePolicy(id: string, opts?: CallOpts): Promise<void>;
789
+ createSecurityPolicy(name: string, opts?: CallOpts & {
790
+ scanning?: ScanPolicy;
791
+ runtime?: RuntimePolicy;
792
+ }): Promise<SecurityPolicy$1>;
793
+ getSecurityPolicy(id?: string, opts?: CallOpts & {
794
+ name?: string;
795
+ }): Promise<SecurityPolicy$1>;
796
+ getSecurityPolicyByName(name: string, opts?: CallOpts): Promise<SecurityPolicy$1>;
797
+ listSecurityPolicies(opts?: CallOpts & {
798
+ pageSize?: number;
799
+ pageToken?: string;
800
+ }): Promise<SecurityPolicyList>;
801
+ updateSecurityPolicy(id: string, opts?: CallOpts & {
802
+ name?: string;
803
+ scanning?: ScanPolicy | null;
804
+ runtime?: RuntimePolicy | null;
805
+ clearScanning?: boolean;
806
+ clearRuntime?: boolean;
807
+ }): Promise<SecurityPolicy$1>;
808
+ deleteSecurityPolicy(id: string, opts?: CallOpts): Promise<void>;
809
+ createProfile(name: string, opts?: CallOpts & {
810
+ resourcePolicyId?: string;
811
+ securityPolicyId?: string;
812
+ }): Promise<Profile$1>;
813
+ getProfile(id?: string, opts?: CallOpts & {
814
+ name?: string;
815
+ }): Promise<Profile$1>;
816
+ getProfileByName(name: string, opts?: CallOpts): Promise<Profile$1>;
817
+ listProfiles(opts?: CallOpts & {
818
+ pageSize?: number;
819
+ pageToken?: string;
820
+ }): Promise<ProfileList>;
821
+ updateProfile(id: string, opts?: CallOpts & {
822
+ name?: string;
823
+ resourcePolicyId?: string | null;
824
+ securityPolicyId?: string | null;
825
+ clearResources?: boolean;
826
+ clearSecurity?: boolean;
827
+ }): Promise<Profile$1>;
828
+ deleteProfile(id: string, opts?: CallOpts): Promise<void>;
829
+ createTemplate(name: string, image: string, opts?: CallOpts & {
830
+ profileId?: string;
831
+ secretEnv?: Record<string, string>;
832
+ }): Promise<Template$1>;
833
+ getTemplate(id?: string, opts?: CallOpts & {
834
+ name?: string;
835
+ }): Promise<Template$1>;
836
+ listTemplates(opts?: CallOpts & {
837
+ pageSize?: number;
838
+ pageToken?: string;
839
+ }): Promise<TemplateList>;
840
+ updateTemplate(id: string, opts?: CallOpts & {
841
+ name?: string;
842
+ image?: string;
843
+ profileId?: string | null;
844
+ secretEnv?: Record<string, string>;
845
+ clearProfile?: boolean;
846
+ }): Promise<Template$1>;
847
+ deleteTemplate(id: string, opts?: CallOpts): Promise<void>;
774
848
  registerImage(name: string, opts: CallOpts & {
775
849
  from: string;
776
850
  waitUntilReady?: boolean;
@@ -788,11 +862,139 @@ declare class Session {
788
862
  pageToken?: string;
789
863
  }): Promise<ImageList>;
790
864
  deleteImage(name: string, opts?: CallOpts): Promise<void>;
791
- setVolumeLabels(volumeId: string, labels: Record<string, string> | undefined, opts?: CallOpts): Promise<Volume>;
865
+ updateVolume(volumeId: string, labels: Record<string, string> | undefined, opts?: CallOpts): Promise<Volume>;
792
866
  deleteVolume(volumeId: string, opts?: CallOpts): Promise<void>;
793
867
  }
794
868
 
795
- /** Public catalog client. Guest calls live on `Sandbox`, not here. */
869
+ /** Guest HTTP and WebSocket over the public URL. No request is sent until get, post, or websocket. */
870
+
871
+ /** Buffered guest body. `text`, `json`, and `bytes` are synchronous. */
872
+ declare class GuestResponse$1 {
873
+ readonly statusCode: number;
874
+ readonly headers: Headers;
875
+ private readonly body;
876
+ constructor(statusCode: number, headers: Headers, body: Uint8Array);
877
+ text(): string;
878
+ json(): unknown;
879
+ bytes(): Uint8Array;
880
+ }
881
+ /** One guest port. `get` and `post` buffer the body before they return. */
882
+ declare class GuestHttp$1 {
883
+ readonly baseUrl: string;
884
+ private readonly auth;
885
+ constructor(baseUrl: string, auth: Record<string, string>);
886
+ /** One GET. `path` is the guest route. */
887
+ get(path: string, init?: RequestInit): Promise<GuestResponse$1>;
888
+ /** One POST. `json` is sent as `application/json`. */
889
+ post(path: string, body?: {
890
+ json?: unknown;
891
+ headers?: HeadersInit;
892
+ }): Promise<GuestResponse$1>;
893
+ /** Dial one WebSocket. The promise resolves on open. The caller calls `close`. */
894
+ websocket(path?: string): Promise<WebSocket>;
895
+ }
896
+
897
+ type RawEvent = {
898
+ type?: string;
899
+ event_id?: string;
900
+ sender?: string;
901
+ origin_server_ts?: number;
902
+ content?: Record<string, unknown>;
903
+ };
904
+ type SyncBody = {
905
+ next_batch?: string;
906
+ rooms?: {
907
+ join?: Record<string, {
908
+ timeline?: {
909
+ events?: RawEvent[];
910
+ prev_batch?: string;
911
+ };
912
+ }>;
913
+ };
914
+ };
915
+ interface RoomIO {
916
+ send(roomId: string, content: Record<string, unknown>): Promise<string>;
917
+ messages(roomId: string, fromToken: string, limit: number): Promise<{
918
+ chunk: RawEvent[];
919
+ end: string;
920
+ }>;
921
+ sync(since: string | null, timeoutMs: number): Promise<SyncBody>;
922
+ /**
923
+ * Optional first window for history: this room's recent message timeline
924
+ * only. A plain `sync(null, 0)` on a fresh device is an initial sync over
925
+ * every joined room, which takes seconds; implementations that can scope
926
+ * the request to one room should.
927
+ */
928
+ historyWindow?(roomId: string, limit: number): Promise<SyncBody>;
929
+ close(): void;
930
+ }
931
+
932
+ /** Agent DM timeline and live-stream event shapes. */
933
+
934
+ type SenderKind = "agent" | "user" | "unknown";
935
+ /** One text message in the agent DM. */
936
+ type MessageEvent = {
937
+ /** Discriminator; always `"message"`. */
938
+ type: "message";
939
+ /** Message body. */
940
+ content: string;
941
+ /** Matrix user id of the sender. */
942
+ sender: string;
943
+ /** Matrix event id. */
944
+ eventId: string;
945
+ /** Server timestamp in milliseconds. */
946
+ ts: number;
947
+ /** Whether the sender is the agent, the portal user, or unknown. */
948
+ senderKind?: SenderKind;
949
+ /** Human-readable sender label when known. */
950
+ senderLabel?: string;
951
+ /** Set when an agent posted a protocol final. */
952
+ isFinal?: boolean;
953
+ /** Agent final tied to a human trigger, when present on the Matrix event. */
954
+ triggerEventId?: string;
955
+ };
956
+
957
+ /** Display labels for Matrix senders on agent message events. */
958
+
959
+ type SenderLabelContext = {
960
+ agentMatrixUserId?: string;
961
+ agentName?: string;
962
+ projectUserId?: string;
963
+ };
964
+
965
+ /** One sync pump per Client; room subscriptions receive live messaging events. */
966
+
967
+ declare class RoomSyncPump {
968
+ private readonly io;
969
+ private since;
970
+ private primed;
971
+ private running;
972
+ private stopped;
973
+ private readonly rooms;
974
+ private readonly seenByRoom;
975
+ constructor(io: RoomIO);
976
+ subscribe(roomId: string, labels: SenderLabelContext): MessageSubscription;
977
+ unsubscribe(sub: MessageSubscription, roomId: string): void;
978
+ stop(): void;
979
+ private hasSubscribers;
980
+ private ensurePrimed;
981
+ private seen;
982
+ private deliver;
983
+ private loop;
984
+ take(sub: MessageSubscription, roomId: string): MessageEvent | undefined;
985
+ waitFor(sub: MessageSubscription, roomId: string): Promise<void>;
986
+ isOpen(sub: MessageSubscription, roomId: string): boolean;
987
+ }
988
+ /** Live messaging events for one room. Start before `post()` so fast replies are not missed. */
989
+ declare class MessageSubscription {
990
+ private readonly pump;
991
+ private readonly roomId;
992
+ constructor(pump: RoomSyncPump, roomId: string);
993
+ /** Stop receiving events. */
994
+ close(): void;
995
+ /** Iterate live agent messages until {@link MessageSubscription.close}. */
996
+ [Symbol.asyncIterator](): AsyncIterator<MessageEvent>;
997
+ }
796
998
 
797
999
  type TimeoutOpts = {
798
1000
  timeout?: number;
@@ -818,6 +1020,8 @@ declare class Volumes$1 {
818
1020
  pageSize?: number;
819
1021
  pageToken?: string;
820
1022
  } & TimeoutOpts): Promise<VolumeList>;
1023
+ /** Update labels. */
1024
+ update(id: string, labels?: Record<string, string>, opts?: TimeoutOpts): Promise<Volume>;
821
1025
  /** Set Labels. */
822
1026
  setLabels(id: string, labels?: Record<string, string>, opts?: TimeoutOpts): Promise<Volume>;
823
1027
  /** Delete. */
@@ -846,7 +1050,12 @@ declare class Agents$1 {
846
1050
  /** Create the handle. */
847
1051
  constructor(wire: Session);
848
1052
  /** Create. */
849
- create(name: string, opts?: TimeoutOpts): Promise<Agent$1>;
1053
+ create(name: string, opts?: {
1054
+ template?: string;
1055
+ messaging?: boolean;
1056
+ } & TimeoutOpts): Promise<Agent$1>;
1057
+ /** Get by name. */
1058
+ getByName(name: string, opts?: TimeoutOpts): Promise<Agent$1>;
850
1059
  /** Get. */
851
1060
  get(id: string, opts?: TimeoutOpts): Promise<Agent$1>;
852
1061
  /** List. */
@@ -854,18 +1063,12 @@ declare class Agents$1 {
854
1063
  pageSize?: number;
855
1064
  pageToken?: string;
856
1065
  } & TimeoutOpts): Promise<AgentList>;
857
- /** Delete. */
1066
+ /** Delete an agent that has no live sandbox. */
858
1067
  delete(id: string, opts?: TimeoutOpts): Promise<void>;
859
- /** Bind an env name. A name starting with `MATRIX_` is rejected. */
860
- setSecret(id: string, envName: string, value: string, opts?: TimeoutOpts): Promise<Agent$1>;
1068
+ /** Bind an env name to a project secret. */
1069
+ bindSecret(id: string, envName: string, secretName: string, opts?: TimeoutOpts): Promise<Agent$1>;
861
1070
  /** Remove one binding. Fails with reason `AGENT_BUSY` while a sandbox is live. */
862
- deleteSecret(id: string, envName: string, opts?: TimeoutOpts): Promise<Agent$1>;
863
- /** Return `homeserver`, `userId`, and `accessToken` once. A second call fails with reason `TOKEN_EXISTS`. */
864
- createToken(opts?: TimeoutOpts): Promise<Token>;
865
- /** Return `homeserver`, `userId`, and `issued`. The access token is not included. */
866
- tokenStatus(opts?: TimeoutOpts): Promise<TokenStatus>;
867
- /** Log out the user from `createToken`. Succeeds when nothing is issued. Do not call this on startup. */
868
- revokeToken(opts?: TimeoutOpts): Promise<void>;
1071
+ unbindSecret(id: string, envName: string, opts?: TimeoutOpts): Promise<Agent$1>;
869
1072
  }
870
1073
  /** Platform names and project images. */
871
1074
  declare class Images$1 {
@@ -911,37 +1114,139 @@ declare class Snapshots$1 {
911
1114
  pageSize?: number;
912
1115
  pageToken?: string;
913
1116
  } & TimeoutOpts): Promise<SnapshotList>;
1117
+ /** Update labels. */
1118
+ update(id: string, labels?: Record<string, string>, opts?: TimeoutOpts): Promise<Snapshot>;
914
1119
  /** Set Labels. */
915
1120
  setLabels(id: string, labels?: Record<string, string>, opts?: TimeoutOpts): Promise<Snapshot>;
916
1121
  /** Delete. */
917
1122
  delete(id: string, opts?: TimeoutOpts): Promise<void>;
918
1123
  }
919
- /** Configurations. Each one points at a policy set created in the portal. */
920
- declare class Tags$1 {
1124
+ /** Named CPU/memory/disk documents. */
1125
+ declare class ResourcePolicies$1 {
1126
+ private readonly wire;
1127
+ /** Create the handle. */
1128
+ constructor(wire: Session);
1129
+ /** Create. */
1130
+ create(name: string, opts?: {
1131
+ cpuMillicores?: number;
1132
+ memoryBytes?: number;
1133
+ diskBytes?: number;
1134
+ } & TimeoutOpts): Promise<ResourcePolicy$1>;
1135
+ /** Get. */
1136
+ get(id: string, opts?: TimeoutOpts): Promise<ResourcePolicy$1>;
1137
+ /** Get by name. */
1138
+ getByName(name: string, opts?: TimeoutOpts): Promise<ResourcePolicy$1>;
1139
+ /** List. */
1140
+ list(opts?: {
1141
+ pageSize?: number;
1142
+ pageToken?: string;
1143
+ } & TimeoutOpts): Promise<ResourcePolicyList>;
1144
+ /** Update. */
1145
+ update(id: string, opts?: {
1146
+ name?: string;
1147
+ cpuMillicores?: number | null;
1148
+ memoryBytes?: number | null;
1149
+ diskBytes?: number | null;
1150
+ clearCpu?: boolean;
1151
+ clearMemory?: boolean;
1152
+ clearDisk?: boolean;
1153
+ } & TimeoutOpts): Promise<ResourcePolicy$1>;
1154
+ /** Delete. */
1155
+ delete(id: string, opts?: TimeoutOpts): Promise<void>;
1156
+ }
1157
+ /** Named scanning/runtime documents. */
1158
+ declare class SecurityPolicies$1 {
921
1159
  private readonly wire;
922
1160
  /** Create the handle. */
923
1161
  constructor(wire: Session);
924
1162
  /** Create. */
925
1163
  create(name: string, opts?: {
926
- policyId?: string;
927
- } & TimeoutOpts): Promise<Tag>;
1164
+ scanning?: ScanPolicy;
1165
+ runtime?: RuntimePolicy;
1166
+ } & TimeoutOpts): Promise<SecurityPolicy$1>;
928
1167
  /** Get. */
929
- get(id: string, opts?: TimeoutOpts): Promise<Tag>;
1168
+ get(id: string, opts?: TimeoutOpts): Promise<SecurityPolicy$1>;
1169
+ /** Get by name. */
1170
+ getByName(name: string, opts?: TimeoutOpts): Promise<SecurityPolicy$1>;
930
1171
  /** List. */
931
1172
  list(opts?: {
932
1173
  pageSize?: number;
933
1174
  pageToken?: string;
934
- } & TimeoutOpts): Promise<TagList>;
1175
+ } & TimeoutOpts): Promise<SecurityPolicyList>;
935
1176
  /** Update. */
936
1177
  update(id: string, opts?: {
937
- policyId?: string;
938
- } & TimeoutOpts): Promise<Tag>;
1178
+ name?: string;
1179
+ scanning?: ScanPolicy | null;
1180
+ runtime?: RuntimePolicy | null;
1181
+ clearScanning?: boolean;
1182
+ clearRuntime?: boolean;
1183
+ } & TimeoutOpts): Promise<SecurityPolicy$1>;
939
1184
  /** Delete. */
940
1185
  delete(id: string, opts?: TimeoutOpts): Promise<void>;
941
1186
  }
942
- /** Images, volumes, secrets, tags, and snapshot inventory.
1187
+ /** Named profile that points at resource and/or security policies. */
1188
+ declare class Profiles$1 {
1189
+ private readonly wire;
1190
+ /** Create the handle. */
1191
+ constructor(wire: Session);
1192
+ /** Create. */
1193
+ create(name: string, opts?: {
1194
+ resourcePolicyId?: string;
1195
+ securityPolicyId?: string;
1196
+ } & TimeoutOpts): Promise<Profile$1>;
1197
+ /** Get. */
1198
+ get(id: string, opts?: TimeoutOpts): Promise<Profile$1>;
1199
+ /** Get by name. */
1200
+ getByName(name: string, opts?: TimeoutOpts): Promise<Profile$1>;
1201
+ /** List. */
1202
+ list(opts?: {
1203
+ pageSize?: number;
1204
+ pageToken?: string;
1205
+ } & TimeoutOpts): Promise<ProfileList>;
1206
+ /** Update. */
1207
+ update(id: string, opts?: {
1208
+ name?: string;
1209
+ resourcePolicyId?: string | null;
1210
+ securityPolicyId?: string | null;
1211
+ clearResources?: boolean;
1212
+ clearSecurity?: boolean;
1213
+ } & TimeoutOpts): Promise<Profile$1>;
1214
+ /** Delete. */
1215
+ delete(id: string, opts?: TimeoutOpts): Promise<void>;
1216
+ }
1217
+ /** Agent create templates. */
1218
+ declare class Templates$1 {
1219
+ private readonly wire;
1220
+ /** Create the handle. */
1221
+ constructor(wire: Session);
1222
+ /** Create. */
1223
+ create(name: string, image: string, opts?: {
1224
+ profileId?: string;
1225
+ secretEnv?: Record<string, string>;
1226
+ } & TimeoutOpts): Promise<Template$1>;
1227
+ /** Get. */
1228
+ get(id: string, opts?: TimeoutOpts): Promise<Template$1>;
1229
+ /** Get by name. */
1230
+ getByName(name: string, opts?: TimeoutOpts): Promise<Template$1>;
1231
+ /** List. */
1232
+ list(opts?: {
1233
+ pageSize?: number;
1234
+ pageToken?: string;
1235
+ } & TimeoutOpts): Promise<TemplateList>;
1236
+ /** Update. */
1237
+ update(id: string, opts?: {
1238
+ name?: string;
1239
+ image?: string;
1240
+ profileId?: string | null;
1241
+ secretEnv?: Record<string, string>;
1242
+ clearProfile?: boolean;
1243
+ } & TimeoutOpts): Promise<Template$1>;
1244
+ /** Delete. */
1245
+ delete(id: string, opts?: TimeoutOpts): Promise<void>;
1246
+ }
1247
+ /** Images, volumes, secrets, profiles, and snapshot inventory.
943
1248
  *
944
- * Sandboxes are created with Sandbox.create. Policies are created in the portal.
1249
+ * Sandboxes are created with Sandbox.create.
945
1250
  */
946
1251
  declare class Client$1 {
947
1252
  /** Base Url. */
@@ -958,10 +1263,20 @@ declare class Client$1 {
958
1263
  readonly images: Images$1;
959
1264
  /** Snapshots. */
960
1265
  readonly snapshots: Snapshots$1;
961
- /** Tags. */
962
- readonly tags: Tags$1;
1266
+ /** Profiles. */
1267
+ readonly profiles: Profiles$1;
1268
+ /** Resource policies. */
1269
+ readonly resourcePolicies: ResourcePolicies$1;
1270
+ /** Security policies. */
1271
+ readonly securityPolicies: SecurityPolicies$1;
1272
+ /** Agent templates. */
1273
+ readonly templates: Templates$1;
963
1274
  /** Create the handle. */
964
1275
  constructor(baseUrl?: string | Session, opts?: ClientOpts);
1276
+ /** Mint a Matrix device for this SDK process. */
1277
+ createMatrixSession(opts?: TimeoutOpts): Promise<MatrixSession>;
1278
+ /** Log out one SDK device. */
1279
+ deleteMatrixSession(sessionId: string, opts?: TimeoutOpts): Promise<void>;
965
1280
  /** Close. */
966
1281
  close(): void;
967
1282
  /** Header for the guest URL using this project's access token.
@@ -973,7 +1288,7 @@ declare class Client$1 {
973
1288
  /** List Sandboxes. */
974
1289
  listSandboxes(opts?: {
975
1290
  labels?: Record<string, string>;
976
- tags?: string[];
1291
+ profileId?: string;
977
1292
  statuses?: SandboxStatus$1[];
978
1293
  pageSize?: number;
979
1294
  pageToken?: string;
@@ -984,33 +1299,19 @@ declare class Client$1 {
984
1299
  listImagesIter(opts?: Omit<NonNullable<Parameters<Images$1["list"]>[0]>, "pageToken">): AsyncGenerator<Image>;
985
1300
  }
986
1301
 
987
- /** Guest HTTP and WebSocket over the public URL. No request is sent until get, post, or websocket. */
1302
+ /** Bounded message history snapshots from Matrix. */
988
1303
 
989
- /** Buffered guest body. `text`, `json`, and `bytes` are synchronous. */
990
- declare class GuestResponse {
991
- readonly statusCode: number;
992
- readonly headers: Headers;
993
- private readonly body;
994
- constructor(statusCode: number, headers: Headers, body: Uint8Array);
995
- text(): string;
996
- json(): unknown;
997
- bytes(): Uint8Array;
998
- }
999
- /** One guest port. `get` and `post` buffer the body before they return. */
1000
- declare class GuestHttp {
1001
- readonly baseUrl: string;
1002
- private readonly auth;
1003
- constructor(baseUrl: string, auth: Record<string, string>);
1004
- /** One GET. `path` is the guest route. */
1005
- get(path: string, init?: RequestInit): Promise<GuestResponse>;
1006
- /** One POST. `json` is sent as `application/json`. */
1007
- post(path: string, body?: {
1008
- json?: unknown;
1009
- headers?: HeadersInit;
1010
- }): Promise<GuestResponse>;
1011
- /** Dial one WebSocket. The promise resolves on open. The caller calls `close`. */
1012
- websocket(path?: string): Promise<WebSocket>;
1013
- }
1304
+ declare const UNLIMITED$1: number;
1305
+ type HistoryOptions = {
1306
+ /** Maximum eligible text messages. Default 50. */
1307
+ limit?: number;
1308
+ /** Present newest messages first. Default oldest first. */
1309
+ newestFirst?: boolean;
1310
+ /** Overall fetch deadline in seconds. Default 180. */
1311
+ timeout?: number | typeof UNLIMITED$1;
1312
+ /** @internal Resolved by `Agent.history`. */
1313
+ labels?: SenderLabelContext;
1314
+ };
1014
1315
 
1015
1316
  /** Arguments for `Sandbox.create`. Fields say what omit means. */
1016
1317
  type SandboxCreateParams$1 = {
@@ -1028,10 +1329,10 @@ type SandboxCreateParams$1 = {
1028
1329
  workdir?: string;
1029
1330
  /** Lifetime from create, seconds. 0/omit = none. Expiry deletes the box. */
1030
1331
  lifetimeSec?: number;
1031
- /** Seconds of inactivity before park. Omit and the sandbox stays up. */
1332
+ /** Seconds of inactivity before the sandbox sleeps. Omit and the sandbox stays up. */
1032
1333
  idleTimeoutSec?: number;
1033
- /** Project tag names that must already exist. */
1034
- tags?: string[];
1334
+ /** Existing profile id. Empty means no profile. */
1335
+ profileId?: string;
1035
1336
  /** Start from this snapshot. Omit to start from the image. */
1036
1337
  fromSnapshotId?: string;
1037
1338
  /** Named disk to attach. Omit for no volume. */
@@ -1044,6 +1345,8 @@ type SandboxCreateParams$1 = {
1044
1345
  memoryBytes?: number;
1045
1346
  /** Writable state on top of the image, in bytes. The image is not counted. Omit = 1 GiB. */
1046
1347
  diskBytes?: number;
1348
+ /** RPC deadline in milliseconds. Omit for 10s. 0 means no deadline. */
1349
+ timeoutMs?: number;
1047
1350
  };
1048
1351
  /** A sandbox id string, `{ id }`, or `{ name }`. A string is always an id. */
1049
1352
  type SandboxRef = string | {
@@ -1053,9 +1356,9 @@ type SandboxRef = string | {
1053
1356
  /** Sandbox name. */
1054
1357
  name: string;
1055
1358
  };
1056
- /** Disconnect-safe guest process (`StartProcess`). Park / Close / idle-park
1359
+ /** Disconnect-safe guest process (`StartProcess`). Sleep / Close / idle sleep
1057
1360
  * reboot the guest: `poll` / `follow` then `not_found`. Harvested output:
1058
- * `Sandbox.logs()`. Start again after `open()`. */
1361
+ * `Sandbox.logs()`. Start again after `wake()`. */
1059
1362
  declare class ProcessHandle$1 {
1060
1363
  private readonly wire;
1061
1364
  private readonly sandbox;
@@ -1110,27 +1413,27 @@ declare class ProcessHandle$1 {
1110
1413
  type RunSink = {
1111
1414
  write(chunk: string | Uint8Array): void;
1112
1415
  };
1113
- /** One sandbox: run commands, read and write the workdir, park/open, delete.
1416
+ /** One sandbox: run commands, read and write the workdir, sleep/wake, delete.
1114
1417
  *
1115
1418
  * `await using` / `delete()` delete the box. Omit them for a persistent
1116
- * agent and reconnect with `Sandbox.open(client, id)`. */
1419
+ * agent and reconnect with `Sandbox.wake(client, id)`. */
1117
1420
  declare class Sandbox$1 {
1118
1421
  /** Catalog client that shares this box's connection. */
1119
1422
  readonly client: Client$1;
1120
1423
  private readonly wire;
1121
- /** Last record returned by create, get, open, or park. */
1424
+ /** Last record returned by create, get, wake, or sleep. */
1122
1425
  info: SandboxInfo;
1123
1426
  private deleted;
1124
1427
  /** Create the handle. */
1125
1428
  constructor(wire: Session, info: SandboxInfo, catalog?: Client$1);
1126
1429
  /** CreateSandbox. The server mints the id. `name` is an optional lookup. */
1127
1430
  static create(client: Client$1 | Session, params: SandboxCreateParams$1): Promise<Sandbox$1>;
1128
- /** OpenSandbox: wake by id or name. Does not create. */
1129
- static open(client: Client$1 | Session, ref: SandboxRef): Promise<Sandbox$1>;
1431
+ /** WakeSandbox: wake by id or name. Does not create. */
1432
+ static wake(client: Client$1 | Session, ref: SandboxRef): Promise<Sandbox$1>;
1130
1433
  /** GetSandbox by id or name. Does not wake. */
1131
1434
  static get(client: Client$1 | Session, ref: SandboxRef): Promise<Sandbox$1>;
1132
1435
  /** Wake this box if Sleeping. Ready + alive is a no-op. */
1133
- open(opts?: {
1436
+ wake(opts?: {
1134
1437
  signal?: AbortSignal;
1135
1438
  }): Promise<SandboxInfo>;
1136
1439
  /** GetSandbox: live report. Does not wake Sleeping. */
@@ -1153,8 +1456,8 @@ declare class Sandbox$1 {
1153
1456
  get workdir(): string;
1154
1457
  /** Labels. */
1155
1458
  get labels(): Record<string, string>;
1156
- /** Tags. */
1157
- get tags(): string[];
1459
+ /** Profile id. */
1460
+ get profileId(): string;
1158
1461
  /** Net. */
1159
1462
  get net(): string;
1160
1463
  /** Volume Id. */
@@ -1193,7 +1496,7 @@ declare class Sandbox$1 {
1193
1496
  pageToken?: string;
1194
1497
  signal?: AbortSignal;
1195
1498
  }): Promise<LogPage>;
1196
- /** Stdout and stderr the sandbox has already written. The lines remain after park. */
1499
+ /** Stdout and stderr the sandbox has already written. The lines remain after sleep. */
1197
1500
  logs(opts?: {
1198
1501
  processId?: string;
1199
1502
  pageSize?: number;
@@ -1212,8 +1515,14 @@ declare class Sandbox$1 {
1212
1515
  setLabels(labels: Record<string, string> | undefined, opts?: {
1213
1516
  signal?: AbortSignal;
1214
1517
  }): Promise<SandboxInfo>;
1215
- /** Replace sandbox tags. Names must already exist. Part of the Ensure profile. */
1216
- setTags(tags: string[] | undefined, opts?: {
1518
+ /** Set or clear the sandbox profile. */
1519
+ setProfile(profileId: string | null | undefined, opts?: {
1520
+ signal?: AbortSignal;
1521
+ }): Promise<SandboxInfo>;
1522
+ /** Replace labels, profile id, or both. Pass `profileId: null` to clear. */
1523
+ update(opts: {
1524
+ labels?: Record<string, string>;
1525
+ profileId?: string | null;
1217
1526
  signal?: AbortSignal;
1218
1527
  }): Promise<SandboxInfo>;
1219
1528
  /** Run a command. Hang-up kills it. Output is text unless `text` is false. */
@@ -1278,7 +1587,7 @@ declare class Sandbox$1 {
1278
1587
  stat(path: string, opts?: {
1279
1588
  signal?: AbortSignal;
1280
1589
  }): Promise<FileInfo>;
1281
- /** mkdir and rm, plus file bodies as one stream each, in the order given. Never parks. */
1590
+ /** mkdir and rm, plus file bodies as one stream each, in the order given. Never sleeps. */
1282
1591
  write(ops: Array<FileOp$1 | FileSpec | Record<string, unknown>>, opts?: {
1283
1592
  timeout?: number;
1284
1593
  signal?: AbortSignal;
@@ -1314,7 +1623,7 @@ declare class Sandbox$1 {
1314
1623
  */
1315
1624
  http(port: number, opts?: {
1316
1625
  baseUrl?: string;
1317
- }): Promise<GuestHttp>;
1626
+ }): Promise<GuestHttp$1>;
1318
1627
  /** HTTPS base for this guest port. No request is sent and the port is not published.
1319
1628
  *
1320
1629
  * Append the guest path and pass `getHeaders`. Closing an HTTP client does not hide the port.
@@ -1334,11 +1643,11 @@ declare class Sandbox$1 {
1334
1643
  createHttpGrant(port: number, opts?: {
1335
1644
  ttlSec?: number;
1336
1645
  signal?: AbortSignal;
1337
- }): Promise<HTTPGrant>;
1646
+ }): Promise<HTTPGrant$1>;
1338
1647
  /** List HTTP grants for this sandbox. The secret is not included. */
1339
1648
  listHttpGrants(opts?: {
1340
1649
  signal?: AbortSignal;
1341
- }): Promise<HTTPGrant[]>;
1650
+ }): Promise<HTTPGrant$1[]>;
1342
1651
  /** Delete one HTTP grant in this project.
1343
1652
  *
1344
1653
  * The next request with that token fails immediately. An open WebSocket closes on the next check.
@@ -1346,15 +1655,15 @@ declare class Sandbox$1 {
1346
1655
  deleteHttpGrant(id: string, opts?: {
1347
1656
  signal?: AbortSignal;
1348
1657
  }): Promise<void>;
1349
- /** Admin ParkSandbox: reboot. Commit the writable layer, drop the VM, keep the id.
1658
+ /** SleepSandbox: reboot. Commit the writable layer, drop the VM, keep the id.
1350
1659
  * Overlay upper stays on this worker.
1351
1660
  * An open guest HTTP connection ends with the VMM; dial again after `open()`. */
1352
- park(opts?: {
1661
+ sleep(opts?: {
1353
1662
  signal?: AbortSignal;
1354
1663
  }): Promise<SandboxInfo>;
1355
1664
  /** Set CPU, guest memory, and the writable-state allocation while the sandbox is sleeping.
1356
1665
  *
1357
- * Pass 0 to keep the current value. A Ready sandbox must park first. */
1666
+ * Pass 0 to keep the current value. A Ready sandbox must sleep first. */
1358
1667
  setSize(packing: {
1359
1668
  cpuMillicores?: number;
1360
1669
  memoryBytes?: number;
@@ -1390,7 +1699,7 @@ declare class Sandbox$1 {
1390
1699
  missingOk?: boolean;
1391
1700
  signal?: AbortSignal;
1392
1701
  }): Promise<void>;
1393
- /** Named pin of the writable layer. Parks if Ready/Finished, pins, then opens. */
1702
+ /** Named pin of the writable layer. Sleeps if Ready/Finished, pins, then wakes. */
1394
1703
  snapshot(opts?: {
1395
1704
  name?: string;
1396
1705
  labels?: Record<string, string>;
@@ -1409,136 +1718,291 @@ declare class Sandbox$1 {
1409
1718
 
1410
1719
  /** No deadline, no expiry, or the full file tree. */
1411
1720
  declare const UNLIMITED: number;
1721
+ /** Which log stream a line came from. */
1412
1722
  declare const LogStream: {
1723
+ /** Guest stdout. */
1413
1724
  readonly STDOUT: "stdout";
1725
+ /** Guest stderr. */
1414
1726
  readonly STDERR: "stderr";
1727
+ /** A platform event, not guest output. */
1415
1728
  readonly EVENT: "event";
1416
1729
  };
1730
+ /** A value of {@link LogStream}. */
1417
1731
  type LogStream = (typeof LogStream)[keyof typeof LogStream];
1732
+ /** Sandbox lifecycle states returned by the API. */
1418
1733
  declare const SandboxStatus: {
1734
+ /** The sandbox is being created. */
1419
1735
  readonly PENDING: "Pending";
1736
+ /** The guest is up and accepts calls. */
1420
1737
  readonly READY: "Ready";
1738
+ /** The VM is stopped and the disk is kept. */
1421
1739
  readonly SLEEPING: "Sleeping";
1740
+ /** The sandbox has exited and will be deleted. */
1422
1741
  readonly FINISHED: "Finished";
1742
+ /** A delete is in progress. */
1423
1743
  readonly DELETING: "Deleting";
1424
1744
  };
1745
+ /** A value of {@link SandboxStatus}. */
1425
1746
  type SandboxStatus = (typeof SandboxStatus)[keyof typeof SandboxStatus];
1747
+ /** CPU, memory, and disk for create or resize. Strings accept units such as `1Gi`. */
1426
1748
  type Resources = {
1749
+ /** Cores. `1` is one core. `"500m"` is half a core. */
1427
1750
  cpu?: number | string;
1751
+ /** Guest memory. A number is bytes. `"1Gi"` is accepted. */
1428
1752
  memory?: number | string;
1753
+ /** Writable state on top of the image. A number is bytes. */
1429
1754
  disk?: number | string;
1430
1755
  };
1756
+ /**
1757
+ * RPC deadline in seconds.
1758
+ * `UNLIMITED` means no deadline. Each call has its own default when this is omitted.
1759
+ */
1431
1760
  type Timeout = number;
1432
1761
  /** One sandbox from `list`. `name` is `null` when the sandbox is unnamed. */
1433
1762
  type SandboxRow = Omit<SandboxSummary, "name"> & {
1763
+ /** `null` when the sandbox was created without a name. */
1434
1764
  name: string | null;
1435
1765
  };
1436
1766
  type PageFetch<T> = (token: string) => Promise<Page<T>>;
1437
1767
  /** One page. Iterating yields `items`. */
1438
1768
  declare class Page<T> {
1769
+ /** Rows on this page. */
1439
1770
  readonly items: readonly T[];
1771
+ /** Pass this to the next `list` call. Absent on the last page. */
1440
1772
  readonly nextPageToken: string | undefined;
1441
1773
  private readonly fetchPage;
1442
- constructor(items: readonly T[], nextPageToken: string | undefined, fetchPage: PageFetch<T>);
1774
+ constructor(
1775
+ /** Rows on this page. */
1776
+ items: readonly T[],
1777
+ /** Pass this to the next `list` call. Absent on the last page. */
1778
+ nextPageToken: string | undefined, fetchPage: PageFetch<T>);
1779
+ /** True when `next` will fetch another page. */
1443
1780
  get hasMore(): boolean;
1781
+ /** Fetch the following page. Throws `PageExhaustedError` on the last page. */
1444
1782
  next(): Promise<Page<T>>;
1783
+ /** Iterate the rows on this page. */
1445
1784
  [Symbol.iterator](): Iterator<T>;
1446
1785
  }
1786
+ /** A file write passed to `fs.write`. */
1447
1787
  declare class Write {
1788
+ /** Guest path. */
1448
1789
  readonly path: string;
1790
+ /** File contents. */
1449
1791
  readonly data: Buffer | string;
1792
+ /** Unix mode. Omit to keep the default. */
1450
1793
  readonly mode?: number | undefined;
1451
- constructor(path: string, data: Buffer | string, mode?: number | undefined);
1452
- }
1794
+ constructor(
1795
+ /** Guest path. */
1796
+ path: string,
1797
+ /** File contents. */
1798
+ data: Buffer | string,
1799
+ /** Unix mode. Omit to keep the default. */
1800
+ mode?: number | undefined);
1801
+ }
1802
+ /** A directory create passed to `fs.write`. */
1453
1803
  declare class Mkdir {
1804
+ /** Guest path. */
1454
1805
  readonly path: string;
1455
- constructor(path: string);
1806
+ constructor(
1807
+ /** Guest path. */
1808
+ path: string);
1456
1809
  }
1810
+ /** A path delete passed to `fs.write`. */
1457
1811
  declare class Remove {
1812
+ /** Guest path. */
1458
1813
  readonly path: string;
1814
+ /** Delete a non-empty directory. */
1459
1815
  readonly recursive: boolean;
1460
- constructor(path: string, recursive?: boolean);
1816
+ constructor(
1817
+ /** Guest path. */
1818
+ path: string,
1819
+ /** Delete a non-empty directory. */
1820
+ recursive?: boolean);
1461
1821
  }
1822
+ /** Build a `Write` op for `fs.write`. */
1462
1823
  declare function write(path: string, data: Buffer | string, mode?: number): Write;
1824
+ /** Build a `Mkdir` op for `fs.write`. */
1463
1825
  declare function mkdir(path: string): Mkdir;
1826
+ /** Build a `Remove` op for `fs.write`. `recursive` is required for a non-empty directory. */
1464
1827
  declare function remove(path: string, recursive?: boolean): Remove;
1465
1828
  type FileOp = Write | Mkdir | Remove;
1466
- /** One agent. `matrixUserId` is who you invite. One sandbox. Sleep stops the process you started. */
1829
+ /** One agent. One sandbox. Sleep stops the process you started. */
1467
1830
  declare class Agent {
1831
+ #private;
1468
1832
  private readonly client;
1833
+ /** Agent id. */
1469
1834
  readonly id: string;
1835
+ /** Agent name. */
1470
1836
  name: string;
1471
- /** Matrix user id to invite from your Matrix client. */
1472
- matrixUserId: string;
1473
1837
  /** Env name to secret name. Values are not included. */
1474
1838
  secretEnv: Record<string, string>;
1839
+ /** When the agent was created. */
1475
1840
  createdAt: string;
1841
+ /** Sandbox this agent is attached to now. Empty when it has none. */
1842
+ activeSandboxId: string;
1843
+ /** False when this agent has no Matrix identity. */
1844
+ messaging: boolean;
1845
+ /** Template this agent was copied from. */
1846
+ templateId: string;
1847
+ /** Image copied from the template. */
1848
+ image: string;
1849
+ /** Profile copied from the template. */
1850
+ profileId: string;
1476
1851
  constructor(client: Client, info: Agent$1);
1477
1852
  private take;
1478
- /** Bind an env name. The same name replaces the value. A name starting with `MATRIX_` is rejected. Do not set `MATRIX_ACCESS_TOKEN`. */
1479
- addSecret(envName: string, value: string, opts?: {
1853
+ /** Bind an env name to a project secret. */
1854
+ bindSecret(envName: string, secretName: string, opts?: {
1480
1855
  timeout?: Timeout;
1481
1856
  }): Promise<this>;
1482
1857
  /** Remove one binding. Refused while this agent has a live sandbox. */
1483
- removeSecret(envName: string, opts?: {
1858
+ unbindSecret(envName: string, opts?: {
1484
1859
  timeout?: Timeout;
1485
1860
  }): Promise<this>;
1486
- /** Create this agent's sandbox. A second one fails with reason `AGENT_BUSY`. */
1487
- newSandbox(opts: Omit<SandboxCreateParams, "agentId">): Promise<Sandbox>;
1861
+ /** Create this agent's sandbox. Omit `image` to use the template's. A second one fails with reason `AGENT_BUSY`. */
1862
+ newSandbox(opts?: Omit<SandboxCreateParams, "agentId" | "image"> & {
1863
+ image?: string;
1864
+ }): Promise<Sandbox>;
1865
+ private requireMessaging;
1866
+ /** Post plain text to this agent's DM. */
1867
+ sendMessage(body: string): Promise<string>;
1868
+ /** Live DM events. Call before `sendMessage` when you need to catch a fast reply. */
1869
+ subscribe(): Promise<MessageSubscription>;
1870
+ /** Bounded snapshot of DM text messages. */
1871
+ history(opts?: HistoryOptions): AsyncGenerator<MessageEvent>;
1872
+ }
1873
+ /** Copied onto an agent at create. Later edits do not change existing agents. */
1874
+ declare class Template {
1875
+ private readonly client;
1876
+ /** Template id. */
1877
+ readonly id: string;
1878
+ /** Template name. */
1879
+ name: string;
1880
+ /** Image copied onto new agents. */
1881
+ image: string;
1882
+ /** Env name to secret name. */
1883
+ secretEnv: Record<string, string>;
1884
+ /** Optional profile copied onto new agents. */
1885
+ profileId: string;
1886
+ /** Agents created from this template. */
1887
+ agentCount: number;
1888
+ /** When the template was created. */
1889
+ createdAt: string;
1890
+ /** When the template was last updated. */
1891
+ updatedAt: string;
1892
+ constructor(client: Client, info: Template$1);
1893
+ private take;
1894
+ /** Change name, image, profile, or secret refs. Pass `profile: null` to clear. */
1895
+ update(opts: {
1896
+ name?: string;
1897
+ image?: string;
1898
+ profile?: string | null;
1899
+ secretEnv?: Record<string, string>;
1900
+ timeout?: Timeout;
1901
+ }): Promise<this>;
1902
+ /** Delete this template. Blocked while agents still use it. */
1903
+ delete(opts?: {
1904
+ missingOk?: boolean;
1905
+ timeout?: Timeout;
1906
+ }): Promise<void>;
1907
+ }
1908
+ declare class Templates {
1909
+ private readonly client;
1910
+ constructor(client: Client);
1911
+ create(name: string, opts: {
1912
+ image: string;
1913
+ profileId?: string;
1914
+ secretEnv?: Record<string, string>;
1915
+ timeout?: Timeout;
1916
+ }): Promise<Template>;
1917
+ get(id: string, opts?: {
1918
+ timeout?: Timeout;
1919
+ }): Promise<Template>;
1920
+ getByName(name: string, opts?: {
1921
+ timeout?: Timeout;
1922
+ }): Promise<Template>;
1923
+ list(opts?: ListOpts): Promise<Page<Template>>;
1924
+ iter(opts?: Omit<ListOpts, "pageToken"> & {
1925
+ limit?: number;
1926
+ }): AsyncGenerator<Template>;
1927
+ delete(id: string, opts?: {
1928
+ missingOk?: boolean;
1929
+ timeout?: Timeout;
1930
+ }): Promise<void>;
1488
1931
  }
1489
1932
  declare class Agents {
1490
1933
  private readonly client;
1934
+ readonly templates: Templates;
1491
1935
  constructor(client: Client);
1492
- /** Create an agent. Invite `matrixUserId` from your Matrix client. */
1493
1936
  create(name: string, opts?: {
1937
+ template?: string;
1938
+ messaging?: boolean;
1939
+ timeout?: Timeout;
1940
+ }): Promise<Agent>;
1941
+ getByName(name: string, opts?: {
1494
1942
  timeout?: Timeout;
1495
1943
  }): Promise<Agent>;
1496
1944
  get(id: string, opts?: {
1497
1945
  timeout?: Timeout;
1498
1946
  }): Promise<Agent>;
1947
+ iter(opts?: Omit<ListOpts, "pageToken"> & {
1948
+ limit?: number;
1949
+ }): AsyncGenerator<Agent>;
1499
1950
  list(opts?: ListOpts): Promise<Page<Agent>>;
1500
1951
  delete(id: string, opts?: {
1501
1952
  missingOk?: boolean;
1502
1953
  timeout?: Timeout;
1503
1954
  }): Promise<void>;
1504
- /** Return `homeserver`, `userId`, and `accessToken` once. A second call fails with reason `TOKEN_EXISTS`. The stored token still works. */
1505
- createToken(opts?: {
1506
- timeout?: Timeout;
1507
- }): Promise<Token>;
1508
- /** Return `homeserver`, `userId`, and `issued`. The access token is not included. */
1509
- tokenStatus(opts?: {
1510
- timeout?: Timeout;
1511
- }): Promise<TokenStatus>;
1512
- /** Log out the user from `createToken`. The old access token stops working. Succeeds when nothing is issued. Do not call this on startup. */
1513
- revokeToken(opts?: {
1514
- timeout?: Timeout;
1515
- }): Promise<void>;
1516
1955
  }
1956
+ /** Where to connect. */
1517
1957
  type ClientOptions = {
1958
+ /** Control plane URL. Omit to use credentials, then the default cloud URL. */
1518
1959
  baseUrl?: string;
1960
+ /** Path to `credentials.json`. `~` is expanded. */
1519
1961
  credentialsFile?: string;
1962
+ /** OAuth client id. With `clientSecret`, this wins over the credentials file. */
1520
1963
  clientId?: string;
1964
+ /** OAuth client secret. */
1521
1965
  clientSecret?: string;
1966
+ /** Static bearer token. */
1522
1967
  token?: string;
1968
+ /** Token endpoint. Omit to use the one in the credentials file. */
1523
1969
  tokenUrl?: string;
1970
+ /** Retries for get, list, label replace, and delete. Default 3. `0` turns retries off. */
1524
1971
  maxRetries?: number;
1525
- timeout?: Timeout;
1526
1972
  };
1527
- /** Catalog client. `await using` closes the connection. */
1973
+ /** Client for one project. `await using` closes the connection. */
1528
1974
  declare class Client {
1975
+ /** Retries after the first try. Default 3. `0` is one attempt. */
1529
1976
  readonly maxRetries: number;
1530
1977
  /** @internal */
1531
1978
  readonly wire: Client$1;
1979
+ /** Named disks. */
1532
1980
  readonly volumes: Volumes;
1981
+ /** Project secrets. Values cannot be read back. */
1533
1982
  readonly secrets: Secrets;
1983
+ /** Matrix agents. */
1534
1984
  readonly agents: Agents;
1985
+ /** Platform and project images. */
1535
1986
  readonly images: Images;
1987
+ /** Filesystem snapshots. */
1536
1988
  readonly snapshots: Snapshots;
1537
- readonly tags: Tags;
1989
+ /** Named compute/security profiles. */
1990
+ readonly profiles: Profiles;
1991
+ /** Resource and security policies. */
1992
+ readonly policies: Policies;
1993
+ /** Create, list, and open sandboxes. */
1538
1994
  readonly sandboxes: Sandboxes;
1539
1995
  constructor(opts?: ClientOptions);
1996
+ private matrix;
1997
+ /** The Matrix client for send and receive. One device for this process. */
1998
+ room(): Promise<RoomIO>;
1999
+ /** @internal Matrix user id for the live SDK session. */
2000
+ matrixUserId(): Promise<string>;
2001
+ /** Close the connection and log out this process's Matrix device. */
1540
2002
  close(): void;
2003
+ /** `using` calls this. */
1541
2004
  [Symbol.dispose](): void;
2005
+ /** `await using` calls this. */
1542
2006
  [Symbol.asyncDispose](): Promise<void>;
1543
2007
  }
1544
2008
  declare class Volumes {
@@ -1551,10 +2015,10 @@ declare class Volumes {
1551
2015
  }): Promise<Volume>;
1552
2016
  get(id: string, opts?: {
1553
2017
  timeout?: Timeout;
1554
- }): ReturnType<Client$1["volumes"]["get"]>;
2018
+ }): Promise<Volume>;
1555
2019
  getByName(name: string, opts?: {
1556
2020
  timeout?: Timeout;
1557
- }): ReturnType<Client$1["volumes"]["get"]>;
2021
+ }): Promise<Volume>;
1558
2022
  list(opts?: ListOpts & {
1559
2023
  labels?: Record<string, string>;
1560
2024
  }): Promise<Page<Volume>>;
@@ -1592,12 +2056,14 @@ declare class Secrets {
1592
2056
  declare class Images {
1593
2057
  private readonly client;
1594
2058
  constructor(client: Client);
2059
+ /** Copy a public image into the project. Omit `timeout` to wait up to 600 seconds. */
1595
2060
  register(name: string, opts: {
1596
2061
  source: string;
1597
2062
  timeout?: Timeout;
1598
2063
  waitUntilReady?: boolean;
1599
2064
  waitSec?: number;
1600
2065
  }): Promise<Image>;
2066
+ /** Build a Dockerfile. Omit `timeout` to wait up to 600 seconds. Pass `timeout` or `waitSec` to replace that. */
1601
2067
  build(name: string, opts?: {
1602
2068
  dockerfile?: string;
1603
2069
  context?: string;
@@ -1642,72 +2108,242 @@ declare class Snapshots {
1642
2108
  timeout?: Timeout;
1643
2109
  }): Promise<void>;
1644
2110
  }
1645
- /** A project name bound to one policy set. */
1646
- declare class Tags {
2111
+ declare class Policies {
2112
+ readonly resources: ResourcePolicies;
2113
+ readonly security: SecurityPolicies;
2114
+ constructor(client: Client);
2115
+ }
2116
+ declare class ResourcePolicies {
1647
2117
  private readonly client;
1648
2118
  constructor(client: Client);
1649
2119
  create(name: string, opts?: {
1650
- policyId?: string;
2120
+ cpuMillicores?: number;
2121
+ memoryBytes?: number;
2122
+ diskBytes?: number;
1651
2123
  timeout?: Timeout;
1652
- }): Promise<Tag>;
2124
+ }): Promise<ResourcePolicy>;
1653
2125
  get(id: string, opts?: {
1654
2126
  timeout?: Timeout;
1655
- }): Promise<Tag>;
1656
- /** Walks every page of `list`. */
2127
+ }): Promise<ResourcePolicy>;
1657
2128
  getByName(name: string, opts?: {
1658
2129
  timeout?: Timeout;
1659
- }): Promise<Tag>;
1660
- list(opts?: ListOpts): Promise<Page<Tag>>;
2130
+ }): Promise<ResourcePolicy>;
2131
+ list(opts?: ListOpts): Promise<Page<ResourcePolicy>>;
1661
2132
  iter(opts?: Omit<ListOpts, "pageToken"> & {
1662
2133
  limit?: number;
1663
- }): AsyncGenerator<Tag>;
1664
- update(id: string, opts: {
1665
- policyId: string;
2134
+ }): AsyncGenerator<ResourcePolicy>;
2135
+ delete(id: string, opts?: {
2136
+ missingOk?: boolean;
2137
+ timeout?: Timeout;
2138
+ }): Promise<void>;
2139
+ }
2140
+ declare class SecurityPolicies {
2141
+ private readonly client;
2142
+ constructor(client: Client);
2143
+ create(name: string, opts?: {
2144
+ scanning?: ScanPolicy;
2145
+ runtime?: RuntimePolicy;
2146
+ timeout?: Timeout;
2147
+ }): Promise<SecurityPolicy>;
2148
+ get(id: string, opts?: {
1666
2149
  timeout?: Timeout;
1667
- }): Promise<Tag>;
2150
+ }): Promise<SecurityPolicy>;
2151
+ getByName(name: string, opts?: {
2152
+ timeout?: Timeout;
2153
+ }): Promise<SecurityPolicy>;
2154
+ list(opts?: ListOpts): Promise<Page<SecurityPolicy>>;
2155
+ iter(opts?: Omit<ListOpts, "pageToken"> & {
2156
+ limit?: number;
2157
+ }): AsyncGenerator<SecurityPolicy>;
1668
2158
  delete(id: string, opts?: {
1669
2159
  missingOk?: boolean;
1670
2160
  timeout?: Timeout;
1671
2161
  }): Promise<void>;
1672
2162
  }
2163
+ declare class Profiles {
2164
+ private readonly client;
2165
+ constructor(client: Client);
2166
+ create(name: string, opts?: {
2167
+ resourcePolicyId?: string;
2168
+ securityPolicyId?: string;
2169
+ timeout?: Timeout;
2170
+ }): Promise<Profile>;
2171
+ get(id: string, opts?: {
2172
+ timeout?: Timeout;
2173
+ }): Promise<Profile>;
2174
+ getByName(name: string, opts?: {
2175
+ timeout?: Timeout;
2176
+ }): Promise<Profile>;
2177
+ list(opts?: ListOpts): Promise<Page<Profile>>;
2178
+ iter(opts?: Omit<ListOpts, "pageToken"> & {
2179
+ limit?: number;
2180
+ }): AsyncGenerator<Profile>;
2181
+ delete(id: string, opts?: {
2182
+ missingOk?: boolean;
2183
+ timeout?: Timeout;
2184
+ }): Promise<void>;
2185
+ }
2186
+ /** Named CPU, memory, and disk document. */
2187
+ declare class ResourcePolicy {
2188
+ private readonly client;
2189
+ /** Resource policy id. */
2190
+ readonly id: string;
2191
+ /** Resource policy name. */
2192
+ name: string;
2193
+ /** Packing millicores. Null means the platform default. */
2194
+ cpuMillicores: number | null;
2195
+ /** Guest memory in bytes. Null means the platform default. */
2196
+ memoryBytes: number | null;
2197
+ /** Overlay disk in bytes. Null means the platform default. */
2198
+ diskBytes: number | null;
2199
+ /** Profiles that reference this policy. */
2200
+ profileCount: number;
2201
+ /** When the policy was created. */
2202
+ createdAt: string;
2203
+ /** When the policy was last updated. */
2204
+ updatedAt: string;
2205
+ constructor(client: Client, info: ResourcePolicy$1);
2206
+ private take;
2207
+ /** Change name or dimensions. Pass `null` to clear a dimension. */
2208
+ update(opts: {
2209
+ name?: string;
2210
+ cpuMillicores?: number | null;
2211
+ memoryBytes?: number | null;
2212
+ diskBytes?: number | null;
2213
+ timeout?: Timeout;
2214
+ }): Promise<this>;
2215
+ /** Delete this policy. Blocked while a profile still uses it. */
2216
+ delete(opts?: {
2217
+ missingOk?: boolean;
2218
+ timeout?: Timeout;
2219
+ }): Promise<void>;
2220
+ }
2221
+ /** Named scanning and runtime document. */
2222
+ declare class SecurityPolicy {
2223
+ private readonly client;
2224
+ /** Security policy id. */
2225
+ readonly id: string;
2226
+ /** Security policy name. */
2227
+ name: string;
2228
+ /** Scanning facet, if set. */
2229
+ scanning: ScanPolicy | null;
2230
+ /** Runtime facet, if set. */
2231
+ runtime: RuntimePolicy | null;
2232
+ /** Profiles that reference this policy. */
2233
+ profileCount: number;
2234
+ /** When the policy was created. */
2235
+ createdAt: string;
2236
+ /** When the policy was last updated. */
2237
+ updatedAt: string;
2238
+ constructor(client: Client, info: SecurityPolicy$1);
2239
+ private take;
2240
+ /** Change name, scanning, or runtime. Pass `null` to clear a facet. */
2241
+ update(opts: {
2242
+ name?: string;
2243
+ scanning?: ScanPolicy | null;
2244
+ runtime?: RuntimePolicy | null;
2245
+ timeout?: Timeout;
2246
+ }): Promise<this>;
2247
+ /** Delete this policy. Blocked while a profile still uses it. */
2248
+ delete(opts?: {
2249
+ missingOk?: boolean;
2250
+ timeout?: Timeout;
2251
+ }): Promise<void>;
2252
+ }
2253
+ /** Named pair of optional resource and security policies. */
2254
+ declare class Profile {
2255
+ private readonly client;
2256
+ /** Profile id. */
2257
+ readonly id: string;
2258
+ /** Profile name. */
2259
+ name: string;
2260
+ /** Linked resource policy id, or empty. */
2261
+ resourcePolicyId: string;
2262
+ /** Linked security policy id, or empty. */
2263
+ securityPolicyId: string;
2264
+ /** Embedded resource policy, when linked. */
2265
+ resourcePolicy: ResourcePolicy$1 | null;
2266
+ /** Embedded security policy, when linked. */
2267
+ securityPolicy: SecurityPolicy$1 | null;
2268
+ /** Non-terminal sandboxes using this profile. */
2269
+ sandboxCount: number;
2270
+ /** Templates using this profile. */
2271
+ templateCount: number;
2272
+ /** Agents using this profile. */
2273
+ agentCount: number;
2274
+ /** When the profile was created. */
2275
+ createdAt: string;
2276
+ /** When the profile was last updated. */
2277
+ updatedAt: string;
2278
+ constructor(client: Client, info: Profile$1);
2279
+ private take;
2280
+ /** Change name or linked policies. Pass `null` to detach a policy. */
2281
+ update(opts: {
2282
+ name?: string;
2283
+ resourcePolicyId?: string | null;
2284
+ securityPolicyId?: string | null;
2285
+ timeout?: Timeout;
2286
+ }): Promise<this>;
2287
+ /** Delete this profile. Blocked while sandboxes, templates, or agents still use it. */
2288
+ delete(opts?: {
2289
+ missingOk?: boolean;
2290
+ timeout?: Timeout;
2291
+ }): Promise<void>;
2292
+ }
1673
2293
  type ListOpts = {
1674
2294
  pageSize?: number;
1675
2295
  pageToken?: string;
1676
2296
  timeout?: Timeout;
1677
2297
  };
2298
+ /** Arguments for `sandboxes.create`. Omit `timeout` for a 10 second deadline. */
1678
2299
  type SandboxCreateParams = {
2300
+ /** Platform name or a project image. Required. */
1679
2301
  image: string;
2302
+ /** Optional lookup. A second create with the same name fails with `NameTakenError`. */
1680
2303
  name?: string;
2304
+ /** Environment variables. Omit for an empty map. */
1681
2305
  env?: Record<string, string>;
1682
2306
  /** Env name to secret name. The value is not returned. */
1683
2307
  secretEnv?: Record<string, string>;
1684
2308
  /** Set by `Agent.newSandbox`. Pass an agent id only when creating through `sandboxes.create`. */
1685
2309
  agentId?: string;
2310
+ /** Guest working directory. Omit and commands start in the image `WORKDIR`, or `/work`. */
1686
2311
  workdir?: string;
2312
+ /** Seconds until the sandbox is deleted. Omit for no expiry. */
1687
2313
  lifetime?: number;
2314
+ /** Seconds of inactivity before sleep. Omit and the sandbox stays up. */
1688
2315
  idleTimeout?: number;
2316
+ /** Start from this snapshot instead of the image. */
1689
2317
  fromSnapshotId?: string;
2318
+ /** Named disk to attach at the working directory. */
1690
2319
  volumeId?: string;
2320
+ /** Your metadata. Labels do not change how the sandbox runs. */
1691
2321
  labels?: Record<string, string>;
1692
- tags?: string[];
2322
+ /** Existing profile id. Empty means no profile. */
2323
+ profile?: string;
2324
+ /** Size. Omit for 1 core, 1 GiB of memory, and 1 GiB of writable disk. */
1693
2325
  resources?: Resources;
2326
+ /** `await using` deletes the sandbox when this is true, the default. */
1694
2327
  deleteOnExit?: boolean;
2328
+ /** RPC deadline in seconds. Omit for 10 seconds. `UNLIMITED` means no deadline. */
2329
+ timeout?: Timeout;
1695
2330
  };
1696
2331
  declare class Sandboxes {
1697
2332
  private readonly client;
1698
2333
  constructor(client: Client);
2334
+ /** Create a sandbox. Omit `timeout` for a 10 second deadline. */
1699
2335
  create(opts: SandboxCreateParams): Promise<Sandbox>;
1700
2336
  get(id: string): Promise<Sandbox>;
1701
2337
  getByName(name: string): Promise<Sandbox>;
1702
- resume(id: string): Promise<Sandbox>;
2338
+ wake(id: string): Promise<Sandbox>;
1703
2339
  list(opts?: ListOpts & {
1704
2340
  labels?: Record<string, string>;
1705
- tags?: string[];
2341
+ profileId?: string;
1706
2342
  status?: SandboxStatus | readonly SandboxStatus[];
1707
2343
  }): Promise<Page<SandboxRow>>;
1708
2344
  iter(opts?: Omit<ListOpts, "pageToken"> & {
1709
2345
  labels?: Record<string, string>;
1710
- tags?: string[];
2346
+ profileId?: string;
1711
2347
  status?: SandboxStatus | readonly SandboxStatus[];
1712
2348
  limit?: number;
1713
2349
  }): AsyncGenerator<SandboxRow>;
@@ -1716,46 +2352,64 @@ declare class Sandboxes {
1716
2352
  timeout?: Timeout;
1717
2353
  }): Promise<void>;
1718
2354
  }
1719
- /** One sandbox. `info` is the last snapshot. `get` refreshes it and does not wake. */
2355
+ /** One sandbox. `info` is the last record for this sandbox. `get` refreshes it and does not wake. */
1720
2356
  declare class Sandbox {
2357
+ /** Client that created or opened this sandbox. */
1721
2358
  readonly client: Client;
1722
2359
  /** @internal */
1723
2360
  readonly inner: Sandbox$1;
2361
+ /** Files on the guest. */
1724
2362
  readonly fs: Files;
2363
+ /** Logs from this sandbox. */
1725
2364
  readonly logs: Logs;
2365
+ /** Processes started with `start`. */
1726
2366
  readonly processes: Processes;
2367
+ /** Credentials that let a caller reach one guest port. */
1727
2368
  readonly httpGrants: HTTPGrants;
2369
+ /** When true, disposing the sandbox deletes it. */
1728
2370
  deleteOnExit: boolean;
1729
- constructor(client: Client,
2371
+ constructor(
2372
+ /** Client that created or opened this sandbox. */
2373
+ client: Client,
1730
2374
  /** @internal */
1731
2375
  inner: Sandbox$1, deleteOnExit: boolean);
1732
- get info(): ReturnType<Sandbox$1["get"]> extends Promise<infer T> ? T : never;
2376
+ /** Last record from create, get, wake, or sleep. */
2377
+ get info(): SandboxInfo;
2378
+ /** Sandbox id. */
1733
2379
  get id(): string;
1734
- get(): ReturnType<Sandbox$1["get"]>;
2380
+ /** Refresh `info`. Does not wake a sleeping sandbox. */
2381
+ get(): Promise<SandboxInfo>;
2382
+ /** Wake a sleeping sandbox. Omit `timeout` for no RPC deadline. */
1735
2383
  wake(opts?: {
1736
2384
  wait?: boolean;
1737
2385
  timeout?: Timeout;
1738
- }): ReturnType<Sandbox$1["open"]>;
2386
+ }): Promise<SandboxInfo>;
2387
+ /** Stop the VM and keep the disk. Omit `timeout` for no RPC deadline. */
1739
2388
  sleep(opts?: {
1740
2389
  wait?: boolean;
1741
2390
  timeout?: Timeout;
1742
- }): ReturnType<Sandbox$1["park"]>;
2391
+ }): Promise<SandboxInfo>;
2392
+ /** Block until the sandbox is in one of `until`. Omit `timeout` for no RPC deadline. */
1743
2393
  wait(opts: {
1744
2394
  until: SandboxStatus | readonly SandboxStatus[];
1745
2395
  timeout?: Timeout;
1746
- }): ReturnType<Sandbox$1["wait"]>;
2396
+ }): Promise<SandboxInfo>;
2397
+ /** Block until the sandbox is gone. Omit `timeout` for no RPC deadline. */
1747
2398
  waitDeleted(opts?: {
1748
2399
  timeout?: Timeout;
1749
2400
  }): Promise<null>;
2401
+ /** Change size. The sandbox must be sleeping. */
1750
2402
  resize(opts: {
1751
2403
  cpu?: number | string;
1752
2404
  memory?: number | string;
1753
2405
  disk?: number | string;
1754
- }): ReturnType<Sandbox$1["setSize"]>;
2406
+ }): Promise<SandboxInfo>;
2407
+ /** Replace labels, profile, or both. Pass `profile: null` to clear. */
1755
2408
  update(opts: {
1756
2409
  labels?: Record<string, string>;
1757
- tags?: string[];
1758
- }): Promise<unknown>;
2410
+ profile?: string | null;
2411
+ }): Promise<SandboxInfo>;
2412
+ /** Run a command and wait for it. Omit `timeout` for no RPC deadline. */
1759
2413
  run(argv: string[], opts?: {
1760
2414
  env?: Record<string, string>;
1761
2415
  cwd?: string;
@@ -1766,6 +2420,7 @@ declare class Sandbox {
1766
2420
  onStderr?: (chunk: string | Uint8Array) => void;
1767
2421
  signal?: AbortSignal;
1768
2422
  }): Promise<ExecResult>;
2423
+ /** `run` with binary stdout and stderr. */
1769
2424
  runBytes(argv: string[], opts?: {
1770
2425
  env?: Record<string, string>;
1771
2426
  cwd?: string;
@@ -1777,7 +2432,9 @@ declare class Sandbox {
1777
2432
  signal?: AbortSignal;
1778
2433
  }): Promise<ExecBytesResult>;
1779
2434
  private exec;
2435
+ /** Run one shell string with `/bin/sh -c`. */
1780
2436
  sh(command: string, opts?: Parameters<Sandbox["run"]>[1]): Promise<ExecResult>;
2437
+ /** Start a command and return its handle. Omit `timeout` for no RPC deadline. */
1781
2438
  start(argv: string[], opts?: {
1782
2439
  env?: Record<string, string>;
1783
2440
  cwd?: string;
@@ -1786,55 +2443,77 @@ declare class Sandbox {
1786
2443
  keepAlive?: boolean;
1787
2444
  endsSandbox?: boolean;
1788
2445
  }): Promise<ProcessHandle>;
2446
+ /** Copy this sandbox's writable layer into new sandboxes. */
1789
2447
  clone(opts?: {
1790
2448
  count?: number;
1791
2449
  concurrency?: number;
1792
2450
  }): Promise<Sandbox[]>;
2451
+ /** Freeze the writable layer. Start later sandboxes from the snapshot. */
1793
2452
  snapshot(opts?: {
1794
2453
  name?: string;
1795
2454
  labels?: Record<string, string>;
1796
- }): ReturnType<Sandbox$1["snapshot"]>;
2455
+ }): Promise<Snapshot>;
2456
+ /** Client for a server listening inside the sandbox. */
1797
2457
  http(port: number, opts?: {
1798
2458
  baseUrl?: string;
1799
- }): Promise<GuestHttp>;
2459
+ }): Promise<GuestHttp$1>;
2460
+ /** Delete the sandbox. */
1800
2461
  delete(): Promise<void>;
2462
+ /** Delete when `deleteOnExit` is true. */
1801
2463
  [Symbol.asyncDispose](): Promise<void>;
1802
2464
  }
1803
2465
  declare class Files {
1804
2466
  private readonly sandbox;
1805
2467
  constructor(sandbox: Sandbox);
2468
+ /** Read a guest file as bytes. Omit `timeout` for 60 seconds. */
1806
2469
  read(path: string, opts?: {
1807
2470
  timeout?: Timeout;
1808
2471
  }): Promise<Buffer>;
2472
+ /** Read a guest file as a UTF-8 string. Omit `timeout` for 60 seconds. */
1809
2473
  readText(path: string, opts?: {
1810
2474
  timeout?: Timeout;
1811
2475
  }): Promise<string>;
2476
+ /**
2477
+ * Write one file from memory. Replaces it if it exists.
2478
+ * @param timeout Omit for 60 seconds.
2479
+ */
1812
2480
  write(path: string, data: Buffer | string, opts?: {
1813
2481
  mode?: number;
1814
2482
  timeout?: Timeout;
1815
2483
  }): Promise<void>;
2484
+ /**
2485
+ * Upload a local file or directory. An existing target raises unless `overwrite` is set.
2486
+ * @param timeout Omit for 60 seconds.
2487
+ */
1816
2488
  upload(local: string, remote: string, opts?: {
1817
2489
  overwrite?: boolean;
1818
2490
  mode?: number;
1819
2491
  timeout?: Timeout;
1820
2492
  }): Promise<void>;
2493
+ /** Download a guest path to a local path. Omit `timeout` for 60 seconds. */
1821
2494
  download(remote: string, local: string, opts?: {
1822
2495
  timeout?: Timeout;
1823
2496
  }): Promise<void>;
2497
+ /** List a guest directory. Depth defaults to 1. Omit `timeout` for 60 seconds. */
1824
2498
  list(path: string, opts?: {
1825
2499
  depth?: number;
1826
2500
  timeout?: Timeout;
1827
- }): ReturnType<Sandbox$1["ls"]>;
1828
- stat(path: string): ReturnType<Sandbox$1["stat"]>;
2501
+ }): Promise<FileList>;
2502
+ /** One guest path's type and size. */
2503
+ stat(path: string): Promise<FileInfo>;
2504
+ /** Create a guest directory, including missing parents. */
1829
2505
  mkdir(path: string): Promise<void>;
2506
+ /** Remove a guest path. A missing path succeeds unless `missingOk` is false. A non-empty directory needs `recursive`. */
1830
2507
  remove(path: string, opts?: {
1831
2508
  recursive?: boolean;
1832
2509
  missingOk?: boolean;
1833
2510
  }): Promise<void>;
2511
+ /** Download a guest directory as a tar file. Omit `timeout` for 60 seconds. */
1834
2512
  export(path: string, dest: string, opts?: {
1835
2513
  gzip?: boolean;
1836
2514
  timeout?: Timeout;
1837
2515
  }): Promise<void>;
2516
+ /** Apply several file changes in one call. Omit `timeout` for 60 seconds. */
1838
2517
  batch(ops: FileOp[], opts?: {
1839
2518
  timeout?: Timeout;
1840
2519
  }): Promise<void>;
@@ -1843,6 +2522,7 @@ declare class Logs {
1843
2522
  private readonly sandbox;
1844
2523
  private readonly processId?;
1845
2524
  constructor(sandbox: Sandbox, processId?: string | undefined);
2525
+ /** One page of logs. Pass `pageToken` from the previous page to continue. */
1846
2526
  list(opts?: {
1847
2527
  processId?: string;
1848
2528
  stream?: "stdout" | "stderr" | "event";
@@ -1852,6 +2532,7 @@ declare class Logs {
1852
2532
  pageSize?: number;
1853
2533
  pageToken?: string;
1854
2534
  }): Promise<Page<LogEntry>>;
2535
+ /** Yield log entries, following pages until `limit`. */
1855
2536
  iter(opts?: Parameters<Logs["list"]>[0] & {
1856
2537
  limit?: number;
1857
2538
  }): AsyncGenerator<LogEntry>;
@@ -1859,50 +2540,76 @@ declare class Logs {
1859
2540
  declare class Processes {
1860
2541
  private readonly sandbox;
1861
2542
  constructor(sandbox: Sandbox);
2543
+ /** Look up one guest process by id. */
1862
2544
  get(id: string): Promise<ProcessHandle>;
2545
+ /** Guest processes for this sandbox. */
1863
2546
  list(): Promise<ProcessHandle[]>;
1864
2547
  }
1865
2548
  declare class HTTPGrants {
1866
2549
  private readonly sandbox;
1867
2550
  constructor(sandbox: Sandbox);
2551
+ /** Mint a grant for a guest port. The token is set only on this call. */
1868
2552
  create(port: number, opts?: {
1869
2553
  ttl?: number;
1870
- }): ReturnType<Sandbox$1["createHttpGrant"]>;
1871
- list(): Promise<HTTPGrant[]>;
1872
- delete(id: string): Promise<void>;
2554
+ }): Promise<HTTPGrant$1>;
2555
+ /** Grants for this sandbox. Tokens are not included. */
2556
+ list(): Promise<HTTPGrant$1[]>;
2557
+ /** Delete a grant. A missing grant raises unless `missingOk` is set. */
2558
+ delete(id: string, opts?: {
2559
+ missingOk?: boolean;
2560
+ }): Promise<void>;
1873
2561
  }
1874
2562
  /** One guest process. */
1875
2563
  declare class ProcessHandle {
1876
2564
  private readonly inner;
2565
+ /** Logs for this process. */
1877
2566
  readonly logs: Logs;
1878
2567
  constructor(sandbox: Sandbox, inner: ProcessHandle$1);
2568
+ /** Process id. */
1879
2569
  get id(): string;
2570
+ /** Last known status. */
1880
2571
  get status(): string;
2572
+ /** Name passed to `start`, or empty. */
1881
2573
  get name(): string;
2574
+ /** Exit code once the process has finished. */
1882
2575
  get exitCode(): number | null;
1883
- poll(): ReturnType<ProcessHandle$1["poll"]>;
2576
+ /** Refresh status without waiting. */
2577
+ poll(): Promise<Process>;
2578
+ /** Block until the process exits. Omit `timeout` for no RPC deadline. */
1884
2579
  wait(opts?: {
1885
2580
  timeout?: Timeout;
1886
- }): ReturnType<ProcessHandle$1["wait"]>;
1887
- kill(signal?: number | string): ReturnType<ProcessHandle$1["kill"]>;
2581
+ }): Promise<Process>;
2582
+ /** Send a signal. The default is `SIGTERM`. */
2583
+ kill(signal?: number | string): Promise<Process>;
2584
+ /** Write to the process stdin. */
1888
2585
  writeStdin(data?: Buffer | string, opts?: {
1889
2586
  eof?: boolean;
1890
2587
  }): Promise<void>;
2588
+ /** Close stdin. */
1891
2589
  closeStdin(): Promise<void>;
2590
+ /** Stream stdout and stderr as text. Omit `timeout` for no RPC deadline. */
1892
2591
  follow(opts?: {
1893
2592
  timeout?: Timeout;
1894
2593
  fromStart?: boolean;
1895
2594
  signal?: AbortSignal;
1896
- }): ReturnType<ProcessHandle$1["follow"]>;
2595
+ }): AsyncGenerator<LogEntry>;
2596
+ /** Stream stdout and stderr as bytes. */
1897
2597
  followBytes(opts?: {
1898
2598
  timeout?: Timeout;
1899
2599
  fromStart?: boolean;
1900
2600
  signal?: AbortSignal;
1901
- }): AsyncGenerator<unknown>;
2601
+ }): AsyncGenerator<StreamChunk>;
1902
2602
  }
1903
2603
 
1904
2604
  /** TypeScript SDK for numen.sandbox.v1. */
1905
2605
 
1906
- declare const publicExports: readonly ["Agent", "AuthenticationError", "CapacityError", "Client", "CommandFailedError", "CommandTimeoutError", "CommandTooLargeError", "ConflictError", "DirectoryNotEmptyError", "ExecutableNotFoundError", "FileExistsError", "FileNotFoundError", "FileTooLargeError", "GuestRuntimeDeadError", "InvalidArgumentError", "InvalidPathError", "Mkdir", "UNLIMITED", "NameTakenError", "NotFoundError", "Page", "PathNotFoundError", "PageExhaustedError", "PermissionDeniedError", "PortNotOpenError", "ProcessHandle", "ProcessNotFoundError", "ProcessWaitTimeoutError", "Remove", "Sandbox", "SandboxConflictError", "SandboxError", "SandboxNotFoundError", "SandboxNotReadyError", "SandboxSleepingError", "SandboxStateError", "LogStream", "SandboxStatus", "SandboxWaitTimeoutError", "SandboxTimeoutError", "UnavailableError", "Write", "mkdir", "publicExports", "remove", "write"];
2606
+ /** Grant returned by `httpGrants.create`. The token is set only on create. */
2607
+ type HTTPGrant = HTTPGrant$1;
2608
+ /** Client returned by `sandbox.http`. */
2609
+ type GuestHttp = GuestHttp$1;
2610
+ /** Body returned by `GuestHttp.get` and `GuestHttp.post`. */
2611
+ type GuestResponse = GuestResponse$1;
2612
+
2613
+ declare const publicExports: readonly ["Agent", "Template", "MessageSubscription", "AuthenticationError", "CapacityError", "Client", "CommandFailedError", "CommandTimeoutError", "CommandTooLargeError", "ConflictError", "DirectoryNotEmptyError", "ExecutableNotFoundError", "FileExistsError", "FileTooLargeError", "GuestRuntimeDeadError", "ImageTimeoutError", "InvalidArgumentError", "InvalidPathError", "Mkdir", "UNLIMITED", "NameTakenError", "NotFoundError", "Page", "PathNotFoundError", "PageExhaustedError", "PermissionDeniedError", "PortNotOpenError", "ProcessHandle", "Profile", "ResourceInUseError", "ResourcePolicy", "SecurityPolicy", "ProcessNotFoundError", "ProcessWaitTimeoutError", "Remove", "Sandbox", "SandboxConflictError", "SandboxError", "SandboxNotFoundError", "SandboxNotReadyError", "SandboxSleepingError", "SandboxStateError", "LogStream", "SandboxStatus", "SandboxWaitTimeoutError", "SandboxTimeoutError", "TimeoutError", "UnavailableError", "Write", "mkdir", "publicExports", "remove", "write"];
1907
2614
 
1908
- export { Agent, AuthenticationError, CapacityError, Client, type ClientOptions, CommandFailedError, CommandTimeoutError, CommandTooLargeError, ConflictError, DirectoryNotEmptyError, type ExecBytesResult, type ExecResult, ExecutableNotFoundError, FileExistsError, FileNotFoundError, FileTooLargeError, GuestRuntimeDeadError, InvalidArgumentError, InvalidPathError, LogStream, Mkdir, NameTakenError, NotFoundError, Page, PageExhaustedError, PathNotFoundError, PermissionDeniedError, PortNotOpenError, ProcessHandle, ProcessNotFoundError, ProcessWaitTimeoutError, Remove, type Resources, Sandbox, SandboxConflictError, type SandboxCreateParams, SandboxError, SandboxNotFoundError, SandboxNotReadyError, SandboxSleepingError, SandboxStateError, SandboxStatus, SandboxTimeoutError, SandboxWaitTimeoutError, type StreamChunk, type Token, type TokenStatus, UNLIMITED, UnavailableError, Write, mkdir, publicExports, remove, write };
2615
+ export { Agent, AuthenticationError, CapacityError, Client, type ClientOptions, CommandFailedError, CommandTimeoutError, CommandTooLargeError, ConflictError, DirectoryNotEmptyError, type ExecBytesResult, type ExecResult, ExecutableNotFoundError, FileExistsError, type FileInfo, type FileList, FileTooLargeError, type GuestHttp, type GuestResponse, GuestRuntimeDeadError, type HTTPGrant, type Image, type ImageKind, ImageTimeoutError, InvalidArgumentError, InvalidPathError, type LogEntry, LogStream, type MessageEvent, MessageSubscription, Mkdir, NameTakenError, NotFoundError, Page, PageExhaustedError, PathNotFoundError, PermissionDeniedError, PortNotOpenError, type Process, ProcessHandle, ProcessNotFoundError, ProcessWaitTimeoutError, Profile, Remove, ResourceInUseError, ResourcePolicy, type Resources, Sandbox, SandboxConflictError, type SandboxCreateParams, SandboxError, type SandboxInfo, SandboxNotFoundError, SandboxNotReadyError, type SandboxRow, SandboxSleepingError, SandboxStateError, SandboxStatus, SandboxTimeoutError, SandboxWaitTimeoutError, type Secret, SecurityPolicy, type Snapshot, type StreamChunk, Template, TimeoutError, UNLIMITED, UnavailableError, type Volume, Write, mkdir, publicExports, remove, write };