@openkaiden/opnshll-sdk 0.0.116 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.d.ts CHANGED
@@ -1,15 +1,17 @@
1
1
  import type { MessageInitShape } from '@bufbuild/protobuf';
2
2
  import { type CallOptions, type Client, type Transport } from '@connectrpc/connect';
3
3
  import { errorCode, SdkError } from './errors.js';
4
- import { type ExecSandboxInputSchema, OpenShell, SandboxPhase, type SandboxSpecSchema, ServiceStatus, type TcpForwardFrameSchema } from './gen/openshell_pb.js';
4
+ import type { SandboxWorkloadTemplate } from './gen/openshell_pb.js';
5
+ import { type ExecSandboxInputSchema, OpenShell, SandboxPhase, type SandboxSpecSchema, type SandboxWorkloadTemplateSchema, ServiceStatus, type TcpForwardFrameSchema } from './gen/openshell_pb.js';
5
6
  import type { SandboxPolicy, SettingValue } from './gen/sandbox_pb.js';
6
7
  import { PolicySource, type SandboxPolicySchema, SettingScope, type SettingValueSchema } from './gen/sandbox_pb.js';
7
8
  import { type ConnectOptions } from './transport.js';
9
+ export type { SandboxResources, SandboxServiceLevel, SandboxStartup, SandboxWorkloadConfig, SandboxWorkloadTemplate, SandboxWorkloadTemplateSpec, } from './gen/openshell_pb.js';
8
10
  export type { SandboxPolicy, SettingValue } from './gen/sandbox_pb.js';
9
11
  export type { ConnectOptions };
10
12
  export { errorCode };
11
13
  /** Lowercase mirror of the generated `SandboxPhase` enum. Hand-maintained. */
12
- export type SandboxPhaseName = 'unspecified' | 'provisioning' | 'ready' | 'error' | 'deleting' | 'unknown' | 'stopping' | 'stopped' | 'starting';
14
+ export type SandboxPhaseName = 'unspecified' | 'provisioning' | 'ready' | 'error' | 'deleting' | 'unknown' | 'stopping' | 'stopped' | 'starting' | 'completed';
13
15
  /** Lowercase mirror of the generated `ServiceStatus` enum. Hand-maintained. */
14
16
  export type HealthStatus = 'unspecified' | 'healthy' | 'degraded' | 'unhealthy';
15
17
  /** Lowercase mirror of the generated `SettingScope` enum. Hand-maintained. */
@@ -20,8 +22,21 @@ export interface Health {
20
22
  status: HealthStatus;
21
23
  version: string;
22
24
  }
25
+ export type DeletionOutcome = 'unspecified' | 'completed' | 'accepted' | 'already_absent' | 'unknown';
26
+ export interface DeletionResult {
27
+ outcome: DeletionOutcome;
28
+ /** Original enum number, including values introduced by a newer gateway. */
29
+ rawOutcome: number;
30
+ /** Original sandbox UUID; absent if no target existed or this is not a sandbox deletion. */
31
+ sandboxId?: string;
32
+ }
33
+ export interface DeleteOptions extends SandboxWorkspaceOptions {
34
+ allowMissing?: boolean;
35
+ }
23
36
  export interface SandboxSpec {
24
37
  name?: string;
38
+ /** Workspace name. Omit for `default`; empty strings are invalid. */
39
+ workspace?: string;
25
40
  image?: string;
26
41
  labels?: Record<string, string>;
27
42
  environment?: Record<string, string>;
@@ -31,6 +46,8 @@ export interface SandboxSpec {
31
46
  command?: string[];
32
47
  /** Allocate a retained pseudo-terminal for the canonical command. */
33
48
  tty?: boolean;
49
+ /** Loopback HTTP services to expose when the sandbox is created. */
50
+ serviceExposures?: ServiceExposure[];
34
51
  /**
35
52
  * Create-time sandbox policy (the safety boundary). Sandbox-scoped
36
53
  * `setPolicy` cannot introduce static fields later, so express filesystem,
@@ -46,26 +63,100 @@ export interface SandboxSpec {
46
63
  */
47
64
  rawSpec?: MessageInitShape<typeof SandboxSpecSchema>;
48
65
  }
66
+ export interface ServiceExposure {
67
+ /** Service name. Empty or omitted selects the unnamed endpoint. */
68
+ service?: string;
69
+ /** Loopback TCP port inside the sandbox. */
70
+ targetPort: number;
71
+ }
72
+ export interface SandboxFromTemplateSpec {
73
+ name?: string;
74
+ /** Workspace name. Omit for `default`; empty strings are invalid. */
75
+ workspace?: string;
76
+ workloadTemplate: string;
77
+ labels?: Record<string, string>;
78
+ providers?: string[];
79
+ /** Exact canonical command. Empty selects the gateway scratch shell. */
80
+ command?: string[];
81
+ /** Allocate a retained pseudo-terminal for the canonical command. */
82
+ tty?: boolean;
83
+ /** Loopback HTTP services to expose when the sandbox is created. */
84
+ serviceExposures?: ServiceExposure[];
85
+ /**
86
+ * Create-time sandbox policy (the safety boundary). The named workload
87
+ * template supplies runtime workload fields.
88
+ */
89
+ policy?: MessageInitShape<typeof SandboxPolicySchema>;
90
+ }
49
91
  export interface SandboxRef {
50
92
  id: string;
51
93
  name: string;
94
+ workspace: string;
52
95
  phase: SandboxPhaseName;
53
96
  labels: Record<string, string>;
54
97
  /** u64 rendered as a string — JS numbers can't hold it safely. */
55
98
  resourceVersion: string;
56
99
  mainProcessInstanceId?: string;
57
100
  exitCode?: number;
101
+ createdFromWorkloadTemplate?: SandboxWorkloadTemplateProvenance;
102
+ /** Service URLs returned by creation, keyed by service name. */
103
+ serviceUrls: Record<string, string>;
104
+ }
105
+ export interface SandboxWorkloadTemplateProvenance {
106
+ name: string;
107
+ resourceVersion: string;
58
108
  }
59
- export interface ListOptions {
60
- limit?: number;
61
- offset?: number;
109
+ interface PaginationOptions {
110
+ /** Maximum resources requested per page. */
111
+ pageSize?: number;
112
+ /** Opaque token from a previous page. Omit to start at the beginning. */
113
+ pageToken?: string;
62
114
  labelSelector?: string;
63
115
  }
64
- export interface ExecOptions {
116
+ /** Mutually exclusive named/default or all-workspaces list scope. */
117
+ export type WorkspaceListScope = {
118
+ workspace?: string;
119
+ allWorkspaces?: false | undefined;
120
+ } | {
121
+ workspace?: never;
122
+ allWorkspaces: true;
123
+ };
124
+ export type ListOptions = PaginationOptions & WorkspaceListScope;
125
+ export interface SandboxWorkspaceOptions {
126
+ /** Workspace name. Omit for `default`; empty strings are invalid. */
127
+ workspace?: string;
128
+ }
129
+ /** Pagination and workspace scope for providers attached to one sandbox. */
130
+ export type SandboxProviderListOptions = SandboxWorkspaceOptions & {
131
+ /** Maximum providers requested per page. */
132
+ pageSize?: number;
133
+ /** Opaque token from a previous page. Omit to start at the beginning. */
134
+ pageToken?: string;
135
+ };
136
+ export type SandboxCallOptions = CallOptions & SandboxWorkspaceOptions;
137
+ export interface SandboxTemplateWorkspaceOptions {
138
+ /** Workspace name. Omit for `default`; empty strings are invalid. */
139
+ workspace?: string;
140
+ }
141
+ export type SandboxTemplateListOptions = WorkspaceListScope & {
142
+ /** Maximum templates requested per page. */
143
+ pageSize?: number;
144
+ /** Opaque token from a previous page. Omit to start at the beginning. */
145
+ pageToken?: string;
146
+ /** Optional label selector in key=value comma-separated form. */
147
+ labelSelector?: string;
148
+ };
149
+ export interface ExecOptions extends SandboxWorkspaceOptions {
65
150
  workdir?: string;
66
151
  environment?: Record<string, string>;
67
152
  timeoutSecs?: number;
68
153
  stdin?: Buffer;
154
+ /**
155
+ * Skip sourcing shell login/profile startup files before the command.
156
+ * Defaults to `false`, which preserves login-shell behavior. Set `true` for
157
+ * automation and managed checks that need predictable startup behavior.
158
+ */
159
+ noLoginShell?: boolean;
69
160
  /** Abort the exec (and the in-flight stream RPC) early. */
70
161
  signal?: AbortSignal;
71
162
  }
@@ -85,7 +176,7 @@ export interface ExecExitEvent {
85
176
  }
86
177
  /** An exec stream item: a stdout/stderr chunk or the terminal exit event. */
87
178
  export type ExecStreamEvent = ExecStreamChunk | ExecExitEvent;
88
- export interface ExecInteractiveOptions {
179
+ export interface ExecInteractiveOptions extends SandboxWorkspaceOptions {
89
180
  workdir?: string;
90
181
  environment?: Record<string, string>;
91
182
  timeoutSecs?: number;
@@ -95,6 +186,11 @@ export interface ExecInteractiveOptions {
95
186
  cols?: number;
96
187
  /** Initial terminal rows (0 = server default). */
97
188
  rows?: number;
189
+ /**
190
+ * Skip sourcing shell login/profile startup files before the command.
191
+ * Defaults to `false`, which preserves login-shell behavior.
192
+ */
193
+ noLoginShell?: boolean;
98
194
  /** Abort the interactive exec (and the in-flight stream RPC) early. */
99
195
  signal?: AbortSignal;
100
196
  }
@@ -102,15 +198,30 @@ export interface ExecInteractiveSession {
102
198
  output: AsyncIterable<ExecStreamEvent>;
103
199
  write(data: Buffer): void;
104
200
  resize(cols: number, rows: number): void;
201
+ /** Close stdin and resize input while preserving output. */
105
202
  close(): void;
106
203
  done: Promise<number>;
107
204
  }
205
+ /** Lifecycle controls available on SDK-created sessions. The base interface
206
+ * retains its original members for existing custom sessions and wrappers. */
207
+ export interface ExecInteractiveSessionControl extends ExecInteractiveSession {
208
+ /** Close stdin and resize input, preserving output until completion. */
209
+ closeInput(): void;
210
+ /** Cancel the RPC and stop receiving output. */
211
+ cancel(): void;
212
+ /** Observed process exit, retained even if final RPC completion fails. */
213
+ readonly exitCode: number | undefined;
214
+ }
108
215
  /** Cancellation for the poll-based wait helpers. */
109
- export interface WaitOptions {
216
+ export interface WaitOptions extends SandboxWorkspaceOptions {
110
217
  /** Abort the wait (and the in-flight poll RPC) early. */
111
218
  signal?: AbortSignal;
112
219
  }
113
- export interface ForwardOptions {
220
+ export interface WaitDeletedOptions extends WaitOptions {
221
+ /** Original ID from delete(). Complete on absence or a different ID; omit to wait for name absence. */
222
+ expectedSandboxId?: string;
223
+ }
224
+ export interface ForwardOptions extends SandboxWorkspaceOptions {
114
225
  /** Loopback TCP port inside the sandbox to dial. */
115
226
  targetPort: number;
116
227
  /** Target host inside the sandbox (loopback only). Default 127.0.0.1. */
@@ -155,7 +266,7 @@ export interface ProviderChange {
155
266
  /** True when the attach/detach actually changed the attachment set. */
156
267
  changed: boolean;
157
268
  }
158
- export interface ProviderChangeOptions {
269
+ export interface ProviderChangeOptions extends SandboxWorkspaceOptions {
159
270
  /** Pin the sandbox resource version for optimistic concurrency (u64 as string). */
160
271
  expectedResourceVersion?: string;
161
272
  }
@@ -178,7 +289,7 @@ export interface SandboxConfig {
178
289
  /** u64 rendered as a string. */
179
290
  providerEnvRevision: string;
180
291
  }
181
- export interface SetPolicyOptions {
292
+ export interface SetPolicyOptions extends SandboxWorkspaceOptions {
182
293
  /** Pin the sandbox resource version for optimistic concurrency (u64 as string). */
183
294
  expectedResourceVersion?: string;
184
295
  /** Poll getConfig until the applied policy hash is observed. */
@@ -208,6 +319,451 @@ export declare class Pushable<T> implements AsyncIterable<T> {
208
319
  end(error?: unknown): void;
209
320
  [Symbol.asyncIterator](): AsyncIterator<T>;
210
321
  }
322
+ /** One response page from a list operation. */
323
+ export interface Page<T> {
324
+ readonly items: T[];
325
+ readonly nextPageToken: string;
326
+ }
327
+ /** Lazy, single-pass iterator that fetches one RPC page per advance. */
328
+ export declare class Pager<T> implements AsyncIterable<Page<T>> {
329
+ private readonly fetch;
330
+ private readonly maxConsumedTokens;
331
+ private readonly maxConsumedTokenBytes;
332
+ private nextToken;
333
+ private readonly consumedTokens;
334
+ private consumedTokenBytes;
335
+ constructor(fetch: (pageToken: string) => Promise<Page<T>>, pageToken?: string, maxConsumedTokens?: number, maxConsumedTokenBytes?: number);
336
+ private validateCurrentTokenBudget;
337
+ /** Fetch the next page, or return undefined after the final page. */
338
+ nextPage(): Promise<Page<T> | undefined>;
339
+ /** Consume the pager and collect every remaining item. */
340
+ all(): Promise<T[]>;
341
+ [Symbol.asyncIterator](): AsyncIterator<Page<T>>;
342
+ }
343
+ export declare class SandboxTemplateClient {
344
+ private readonly grpc;
345
+ readonly raw: Client<typeof OpenShell>;
346
+ readonly transport: Transport;
347
+ constructor(transport: Transport, grpc?: Client<import("@bufbuild/protobuf/codegenv2").GenService<{
348
+ health: {
349
+ methodKind: "unary";
350
+ input: typeof import("./gen/openshell_pb.js").HealthRequestSchema;
351
+ output: typeof import("./gen/openshell_pb.js").HealthResponseSchema;
352
+ };
353
+ getCurrentUser: {
354
+ methodKind: "unary";
355
+ input: typeof import("./gen/openshell_pb.js").GetCurrentUserRequestSchema;
356
+ output: typeof import("./gen/openshell_pb.js").GetCurrentUserResponseSchema;
357
+ };
358
+ getGatewayInfo: {
359
+ methodKind: "unary";
360
+ input: typeof import("./gen/openshell_pb.js").GetGatewayInfoRequestSchema;
361
+ output: typeof import("./gen/openshell_pb.js").GetGatewayInfoResponseSchema;
362
+ };
363
+ createSandbox: {
364
+ methodKind: "unary";
365
+ input: typeof import("./gen/openshell_pb.js").CreateSandboxRequestSchema;
366
+ output: typeof import("./gen/openshell_pb.js").SandboxResponseSchema;
367
+ };
368
+ beginRootfsTarStaging: {
369
+ methodKind: "unary";
370
+ input: typeof import("./gen/openshell_pb.js").BeginRootfsTarStagingRequestSchema;
371
+ output: typeof import("./gen/openshell_pb.js").BeginRootfsTarStagingResponseSchema;
372
+ };
373
+ getSandbox: {
374
+ methodKind: "unary";
375
+ input: typeof import("./gen/openshell_pb.js").GetSandboxRequestSchema;
376
+ output: typeof import("./gen/openshell_pb.js").SandboxResponseSchema;
377
+ };
378
+ listSandboxes: {
379
+ methodKind: "unary";
380
+ input: typeof import("./gen/openshell_pb.js").ListSandboxesRequestSchema;
381
+ output: typeof import("./gen/openshell_pb.js").ListSandboxesResponseSchema;
382
+ };
383
+ createSandboxTemplate: {
384
+ methodKind: "unary";
385
+ input: typeof import("./gen/openshell_pb.js").CreateSandboxTemplateRequestSchema;
386
+ output: typeof import("./gen/openshell_pb.js").SandboxTemplateResponseSchema;
387
+ };
388
+ getSandboxTemplate: {
389
+ methodKind: "unary";
390
+ input: typeof import("./gen/openshell_pb.js").GetSandboxTemplateRequestSchema;
391
+ output: typeof import("./gen/openshell_pb.js").SandboxTemplateResponseSchema;
392
+ };
393
+ listSandboxTemplates: {
394
+ methodKind: "unary";
395
+ input: typeof import("./gen/openshell_pb.js").ListSandboxTemplatesRequestSchema;
396
+ output: typeof import("./gen/openshell_pb.js").ListSandboxTemplatesResponseSchema;
397
+ };
398
+ deleteSandboxTemplate: {
399
+ methodKind: "unary";
400
+ input: typeof import("./gen/openshell_pb.js").DeleteSandboxTemplateRequestSchema;
401
+ output: typeof import("./gen/openshell_pb.js").DeleteSandboxTemplateResponseSchema;
402
+ };
403
+ listSandboxProviders: {
404
+ methodKind: "unary";
405
+ input: typeof import("./gen/openshell_pb.js").ListSandboxProvidersRequestSchema;
406
+ output: typeof import("./gen/openshell_pb.js").ListSandboxProvidersResponseSchema;
407
+ };
408
+ attachSandboxProvider: {
409
+ methodKind: "unary";
410
+ input: typeof import("./gen/openshell_pb.js").AttachSandboxProviderRequestSchema;
411
+ output: typeof import("./gen/openshell_pb.js").AttachSandboxProviderResponseSchema;
412
+ };
413
+ detachSandboxProvider: {
414
+ methodKind: "unary";
415
+ input: typeof import("./gen/openshell_pb.js").DetachSandboxProviderRequestSchema;
416
+ output: typeof import("./gen/openshell_pb.js").DetachSandboxProviderResponseSchema;
417
+ };
418
+ getSandboxProviderStatus: {
419
+ methodKind: "unary";
420
+ input: typeof import("./gen/openshell_pb.js").GetSandboxProviderStatusRequestSchema;
421
+ output: typeof import("./gen/openshell_pb.js").GetSandboxProviderStatusResponseSchema;
422
+ };
423
+ deleteSandbox: {
424
+ methodKind: "unary";
425
+ input: typeof import("./gen/openshell_pb.js").DeleteSandboxRequestSchema;
426
+ output: typeof import("./gen/openshell_pb.js").DeleteSandboxResponseSchema;
427
+ };
428
+ stopSandbox: {
429
+ methodKind: "unary";
430
+ input: typeof import("./gen/openshell_pb.js").StopSandboxRequestSchema;
431
+ output: typeof import("./gen/openshell_pb.js").SandboxResponseSchema;
432
+ };
433
+ startSandbox: {
434
+ methodKind: "unary";
435
+ input: typeof import("./gen/openshell_pb.js").StartSandboxRequestSchema;
436
+ output: typeof import("./gen/openshell_pb.js").SandboxResponseSchema;
437
+ };
438
+ createSshSession: {
439
+ methodKind: "unary";
440
+ input: typeof import("./gen/openshell_pb.js").CreateSshSessionRequestSchema;
441
+ output: typeof import("./gen/openshell_pb.js").CreateSshSessionResponseSchema;
442
+ };
443
+ exposeService: {
444
+ methodKind: "unary";
445
+ input: typeof import("./gen/openshell_pb.js").ExposeServiceRequestSchema;
446
+ output: typeof import("./gen/openshell_pb.js").ServiceEndpointResponseSchema;
447
+ };
448
+ getService: {
449
+ methodKind: "unary";
450
+ input: typeof import("./gen/openshell_pb.js").GetServiceRequestSchema;
451
+ output: typeof import("./gen/openshell_pb.js").ServiceEndpointResponseSchema;
452
+ };
453
+ listServices: {
454
+ methodKind: "unary";
455
+ input: typeof import("./gen/openshell_pb.js").ListServicesRequestSchema;
456
+ output: typeof import("./gen/openshell_pb.js").ListServicesResponseSchema;
457
+ };
458
+ deleteService: {
459
+ methodKind: "unary";
460
+ input: typeof import("./gen/openshell_pb.js").DeleteServiceRequestSchema;
461
+ output: typeof import("./gen/openshell_pb.js").DeleteServiceResponseSchema;
462
+ };
463
+ revokeSshSession: {
464
+ methodKind: "unary";
465
+ input: typeof import("./gen/openshell_pb.js").RevokeSshSessionRequestSchema;
466
+ output: typeof import("./gen/openshell_pb.js").RevokeSshSessionResponseSchema;
467
+ };
468
+ execSandbox: {
469
+ methodKind: "server_streaming";
470
+ input: typeof import("./gen/openshell_pb.js").ExecSandboxRequestSchema;
471
+ output: typeof import("./gen/openshell_pb.js").ExecSandboxEventSchema;
472
+ };
473
+ forwardTcp: {
474
+ methodKind: "bidi_streaming";
475
+ input: typeof TcpForwardFrameSchema;
476
+ output: typeof TcpForwardFrameSchema;
477
+ };
478
+ execSandboxInteractive: {
479
+ methodKind: "bidi_streaming";
480
+ input: typeof ExecSandboxInputSchema;
481
+ output: typeof import("./gen/openshell_pb.js").ExecSandboxEventSchema;
482
+ };
483
+ createProvider: {
484
+ methodKind: "unary";
485
+ input: typeof import("./gen/openshell_pb.js").CreateProviderRequestSchema;
486
+ output: typeof import("./gen/openshell_pb.js").ProviderResponseSchema;
487
+ };
488
+ getProvider: {
489
+ methodKind: "unary";
490
+ input: typeof import("./gen/openshell_pb.js").GetProviderRequestSchema;
491
+ output: typeof import("./gen/openshell_pb.js").ProviderResponseSchema;
492
+ };
493
+ listProviders: {
494
+ methodKind: "unary";
495
+ input: typeof import("./gen/openshell_pb.js").ListProvidersRequestSchema;
496
+ output: typeof import("./gen/openshell_pb.js").ListProvidersResponseSchema;
497
+ };
498
+ listProviderProfiles: {
499
+ methodKind: "unary";
500
+ input: typeof import("./gen/openshell_pb.js").ListProviderProfilesRequestSchema;
501
+ output: typeof import("./gen/openshell_pb.js").ListProviderProfilesResponseSchema;
502
+ };
503
+ getProviderProfile: {
504
+ methodKind: "unary";
505
+ input: typeof import("./gen/openshell_pb.js").GetProviderProfileRequestSchema;
506
+ output: typeof import("./gen/openshell_pb.js").ProviderProfileResponseSchema;
507
+ };
508
+ importProviderProfiles: {
509
+ methodKind: "unary";
510
+ input: typeof import("./gen/openshell_pb.js").ImportProviderProfilesRequestSchema;
511
+ output: typeof import("./gen/openshell_pb.js").ImportProviderProfilesResponseSchema;
512
+ };
513
+ updateProviderProfiles: {
514
+ methodKind: "unary";
515
+ input: typeof import("./gen/openshell_pb.js").UpdateProviderProfilesRequestSchema;
516
+ output: typeof import("./gen/openshell_pb.js").UpdateProviderProfilesResponseSchema;
517
+ };
518
+ lintProviderProfiles: {
519
+ methodKind: "unary";
520
+ input: typeof import("./gen/openshell_pb.js").LintProviderProfilesRequestSchema;
521
+ output: typeof import("./gen/openshell_pb.js").LintProviderProfilesResponseSchema;
522
+ };
523
+ updateProvider: {
524
+ methodKind: "unary";
525
+ input: typeof import("./gen/openshell_pb.js").UpdateProviderRequestSchema;
526
+ output: typeof import("./gen/openshell_pb.js").ProviderResponseSchema;
527
+ };
528
+ getProviderRefreshStatus: {
529
+ methodKind: "unary";
530
+ input: typeof import("./gen/openshell_pb.js").GetProviderRefreshStatusRequestSchema;
531
+ output: typeof import("./gen/openshell_pb.js").GetProviderRefreshStatusResponseSchema;
532
+ };
533
+ configureProviderRefresh: {
534
+ methodKind: "unary";
535
+ input: typeof import("./gen/openshell_pb.js").ConfigureProviderRefreshRequestSchema;
536
+ output: typeof import("./gen/openshell_pb.js").ConfigureProviderRefreshResponseSchema;
537
+ };
538
+ rotateProviderCredential: {
539
+ methodKind: "unary";
540
+ input: typeof import("./gen/openshell_pb.js").RotateProviderCredentialRequestSchema;
541
+ output: typeof import("./gen/openshell_pb.js").RotateProviderCredentialResponseSchema;
542
+ };
543
+ deleteProviderRefresh: {
544
+ methodKind: "unary";
545
+ input: typeof import("./gen/openshell_pb.js").DeleteProviderRefreshRequestSchema;
546
+ output: typeof import("./gen/openshell_pb.js").DeleteProviderRefreshResponseSchema;
547
+ };
548
+ deleteProvider: {
549
+ methodKind: "unary";
550
+ input: typeof import("./gen/openshell_pb.js").DeleteProviderRequestSchema;
551
+ output: typeof import("./gen/openshell_pb.js").DeleteProviderResponseSchema;
552
+ };
553
+ deleteProviderProfile: {
554
+ methodKind: "unary";
555
+ input: typeof import("./gen/openshell_pb.js").DeleteProviderProfileRequestSchema;
556
+ output: typeof import("./gen/openshell_pb.js").DeleteProviderProfileResponseSchema;
557
+ };
558
+ getSandboxConfig: {
559
+ methodKind: "unary";
560
+ input: typeof import("./gen/sandbox_pb.js").GetSandboxConfigRequestSchema;
561
+ output: typeof import("./gen/sandbox_pb.js").GetSandboxConfigResponseSchema;
562
+ };
563
+ getGatewayConfig: {
564
+ methodKind: "unary";
565
+ input: typeof import("./gen/sandbox_pb.js").GetGatewayConfigRequestSchema;
566
+ output: typeof import("./gen/sandbox_pb.js").GetGatewayConfigResponseSchema;
567
+ };
568
+ updateConfig: {
569
+ methodKind: "unary";
570
+ input: typeof import("./gen/openshell_pb.js").UpdateConfigRequestSchema;
571
+ output: typeof import("./gen/openshell_pb.js").UpdateConfigResponseSchema;
572
+ };
573
+ getSandboxPolicyStatus: {
574
+ methodKind: "unary";
575
+ input: typeof import("./gen/openshell_pb.js").GetSandboxPolicyStatusRequestSchema;
576
+ output: typeof import("./gen/openshell_pb.js").GetSandboxPolicyStatusResponseSchema;
577
+ };
578
+ listSandboxPolicies: {
579
+ methodKind: "unary";
580
+ input: typeof import("./gen/openshell_pb.js").ListSandboxPoliciesRequestSchema;
581
+ output: typeof import("./gen/openshell_pb.js").ListSandboxPoliciesResponseSchema;
582
+ };
583
+ reportPolicyStatus: {
584
+ methodKind: "unary";
585
+ input: typeof import("./gen/openshell_pb.js").ReportPolicyStatusRequestSchema;
586
+ output: typeof import("./gen/openshell_pb.js").ReportPolicyStatusResponseSchema;
587
+ };
588
+ reportEndpointStatus: {
589
+ methodKind: "unary";
590
+ input: typeof import("./gen/openshell_pb.js").ReportEndpointStatusRequestSchema;
591
+ output: typeof import("./gen/openshell_pb.js").ReportEndpointStatusResponseSchema;
592
+ };
593
+ reportProviderReadiness: {
594
+ methodKind: "unary";
595
+ input: typeof import("./gen/openshell_pb.js").ReportProviderReadinessRequestSchema;
596
+ output: typeof import("./gen/openshell_pb.js").ReportProviderReadinessResponseSchema;
597
+ };
598
+ reportSandboxConfiguration: {
599
+ methodKind: "unary";
600
+ input: typeof import("./gen/openshell_pb.js").ReportSandboxConfigurationRequestSchema;
601
+ output: typeof import("./gen/openshell_pb.js").ReportSandboxConfigurationResponseSchema;
602
+ };
603
+ getSandboxProviderEnvironment: {
604
+ methodKind: "unary";
605
+ input: typeof import("./gen/openshell_pb.js").GetSandboxProviderEnvironmentRequestSchema;
606
+ output: typeof import("./gen/openshell_pb.js").GetSandboxProviderEnvironmentResponseSchema;
607
+ };
608
+ exchangeProviderSubjectToken: {
609
+ methodKind: "unary";
610
+ input: typeof import("./gen/openshell_pb.js").ExchangeProviderSubjectTokenRequestSchema;
611
+ output: typeof import("./gen/openshell_pb.js").ExchangeProviderSubjectTokenResponseSchema;
612
+ };
613
+ getSandboxLogs: {
614
+ methodKind: "unary";
615
+ input: typeof import("./gen/openshell_pb.js").GetSandboxLogsRequestSchema;
616
+ output: typeof import("./gen/openshell_pb.js").GetSandboxLogsResponseSchema;
617
+ };
618
+ pushSandboxLogs: {
619
+ methodKind: "client_streaming";
620
+ input: typeof import("./gen/openshell_pb.js").PushSandboxLogsRequestSchema;
621
+ output: typeof import("./gen/openshell_pb.js").PushSandboxLogsResponseSchema;
622
+ };
623
+ connectSupervisor: {
624
+ methodKind: "bidi_streaming";
625
+ input: typeof import("./gen/openshell_pb.js").SupervisorMessageSchema;
626
+ output: typeof import("./gen/openshell_pb.js").GatewayMessageSchema;
627
+ };
628
+ reportMainProcessExit: {
629
+ methodKind: "unary";
630
+ input: typeof import("./gen/openshell_pb.js").ReportMainProcessExitRequestSchema;
631
+ output: typeof import("./gen/openshell_pb.js").ReportMainProcessExitResponseSchema;
632
+ };
633
+ finalizeMainProcessExit: {
634
+ methodKind: "unary";
635
+ input: typeof import("./gen/openshell_pb.js").FinalizeMainProcessExitRequestSchema;
636
+ output: typeof import("./gen/openshell_pb.js").FinalizeMainProcessExitResponseSchema;
637
+ };
638
+ relayStream: {
639
+ methodKind: "bidi_streaming";
640
+ input: typeof import("./gen/openshell_pb.js").RelayFrameSchema;
641
+ output: typeof import("./gen/openshell_pb.js").RelayFrameSchema;
642
+ };
643
+ peerRelay: {
644
+ methodKind: "bidi_streaming";
645
+ input: typeof import("./gen/openshell_pb.js").PeerRelayFrameSchema;
646
+ output: typeof import("./gen/openshell_pb.js").PeerRelayFrameSchema;
647
+ };
648
+ peerReportProviderReadiness: {
649
+ methodKind: "unary";
650
+ input: typeof import("./gen/openshell_pb.js").ReportProviderReadinessRequestSchema;
651
+ output: typeof import("./gen/openshell_pb.js").ReportProviderReadinessResponseSchema;
652
+ };
653
+ peerReportEndpointStatus: {
654
+ methodKind: "unary";
655
+ input: typeof import("./gen/openshell_pb.js").ReportEndpointStatusRequestSchema;
656
+ output: typeof import("./gen/openshell_pb.js").ReportEndpointStatusResponseSchema;
657
+ };
658
+ peerGetSandboxProviderStatus: {
659
+ methodKind: "unary";
660
+ input: typeof import("./gen/openshell_pb.js").GetSandboxProviderStatusRequestSchema;
661
+ output: typeof import("./gen/openshell_pb.js").GetSandboxProviderStatusResponseSchema;
662
+ };
663
+ watchSandbox: {
664
+ methodKind: "server_streaming";
665
+ input: typeof import("./gen/openshell_pb.js").WatchSandboxRequestSchema;
666
+ output: typeof import("./gen/openshell_pb.js").SandboxStreamEventSchema;
667
+ };
668
+ submitPolicyAnalysis: {
669
+ methodKind: "unary";
670
+ input: typeof import("./gen/openshell_pb.js").SubmitPolicyAnalysisRequestSchema;
671
+ output: typeof import("./gen/openshell_pb.js").SubmitPolicyAnalysisResponseSchema;
672
+ };
673
+ getDraftPolicy: {
674
+ methodKind: "unary";
675
+ input: typeof import("./gen/openshell_pb.js").GetDraftPolicyRequestSchema;
676
+ output: typeof import("./gen/openshell_pb.js").GetDraftPolicyResponseSchema;
677
+ };
678
+ approveDraftChunk: {
679
+ methodKind: "unary";
680
+ input: typeof import("./gen/openshell_pb.js").ApproveDraftChunkRequestSchema;
681
+ output: typeof import("./gen/openshell_pb.js").ApproveDraftChunkResponseSchema;
682
+ };
683
+ rejectDraftChunk: {
684
+ methodKind: "unary";
685
+ input: typeof import("./gen/openshell_pb.js").RejectDraftChunkRequestSchema;
686
+ output: typeof import("./gen/openshell_pb.js").RejectDraftChunkResponseSchema;
687
+ };
688
+ approveAllDraftChunks: {
689
+ methodKind: "unary";
690
+ input: typeof import("./gen/openshell_pb.js").ApproveAllDraftChunksRequestSchema;
691
+ output: typeof import("./gen/openshell_pb.js").ApproveAllDraftChunksResponseSchema;
692
+ };
693
+ editDraftChunk: {
694
+ methodKind: "unary";
695
+ input: typeof import("./gen/openshell_pb.js").EditDraftChunkRequestSchema;
696
+ output: typeof import("./gen/openshell_pb.js").EditDraftChunkResponseSchema;
697
+ };
698
+ undoDraftChunk: {
699
+ methodKind: "unary";
700
+ input: typeof import("./gen/openshell_pb.js").UndoDraftChunkRequestSchema;
701
+ output: typeof import("./gen/openshell_pb.js").UndoDraftChunkResponseSchema;
702
+ };
703
+ clearDraftChunks: {
704
+ methodKind: "unary";
705
+ input: typeof import("./gen/openshell_pb.js").ClearDraftChunksRequestSchema;
706
+ output: typeof import("./gen/openshell_pb.js").ClearDraftChunksResponseSchema;
707
+ };
708
+ getDraftHistory: {
709
+ methodKind: "unary";
710
+ input: typeof import("./gen/openshell_pb.js").GetDraftHistoryRequestSchema;
711
+ output: typeof import("./gen/openshell_pb.js").GetDraftHistoryResponseSchema;
712
+ };
713
+ issueSandboxToken: {
714
+ methodKind: "unary";
715
+ input: typeof import("./gen/openshell_pb.js").IssueSandboxTokenRequestSchema;
716
+ output: typeof import("./gen/openshell_pb.js").IssueSandboxTokenResponseSchema;
717
+ };
718
+ refreshSandboxToken: {
719
+ methodKind: "unary";
720
+ input: typeof import("./gen/openshell_pb.js").RefreshSandboxTokenRequestSchema;
721
+ output: typeof import("./gen/openshell_pb.js").RefreshSandboxTokenResponseSchema;
722
+ };
723
+ createWorkspace: {
724
+ methodKind: "unary";
725
+ input: typeof import("./gen/openshell_pb.js").CreateWorkspaceRequestSchema;
726
+ output: typeof import("./gen/openshell_pb.js").CreateWorkspaceResponseSchema;
727
+ };
728
+ getWorkspace: {
729
+ methodKind: "unary";
730
+ input: typeof import("./gen/openshell_pb.js").GetWorkspaceRequestSchema;
731
+ output: typeof import("./gen/openshell_pb.js").GetWorkspaceResponseSchema;
732
+ };
733
+ listWorkspaces: {
734
+ methodKind: "unary";
735
+ input: typeof import("./gen/openshell_pb.js").ListWorkspacesRequestSchema;
736
+ output: typeof import("./gen/openshell_pb.js").ListWorkspacesResponseSchema;
737
+ };
738
+ deleteWorkspace: {
739
+ methodKind: "unary";
740
+ input: typeof import("./gen/openshell_pb.js").DeleteWorkspaceRequestSchema;
741
+ output: typeof import("./gen/openshell_pb.js").DeleteWorkspaceResponseSchema;
742
+ };
743
+ addWorkspaceMember: {
744
+ methodKind: "unary";
745
+ input: typeof import("./gen/openshell_pb.js").AddWorkspaceMemberRequestSchema;
746
+ output: typeof import("./gen/openshell_pb.js").AddWorkspaceMemberResponseSchema;
747
+ };
748
+ removeWorkspaceMember: {
749
+ methodKind: "unary";
750
+ input: typeof import("./gen/openshell_pb.js").RemoveWorkspaceMemberRequestSchema;
751
+ output: typeof import("./gen/openshell_pb.js").RemoveWorkspaceMemberResponseSchema;
752
+ };
753
+ listWorkspaceMembers: {
754
+ methodKind: "unary";
755
+ input: typeof import("./gen/openshell_pb.js").ListWorkspaceMembersRequestSchema;
756
+ output: typeof import("./gen/openshell_pb.js").ListWorkspaceMembersResponseSchema;
757
+ };
758
+ }>>);
759
+ static connect(options: ConnectOptions): Promise<SandboxTemplateClient>;
760
+ create(template: MessageInitShape<typeof SandboxWorkloadTemplateSchema>, options?: SandboxTemplateWorkspaceOptions | null): Promise<SandboxWorkloadTemplate>;
761
+ get(name: string, options?: SandboxTemplateWorkspaceOptions | null): Promise<SandboxWorkloadTemplate>;
762
+ list(options?: SandboxTemplateListOptions | null): Pager<SandboxWorkloadTemplate>;
763
+ /** List and collect every sandbox template in this scope. */
764
+ listAll(options?: SandboxTemplateListOptions | null): Promise<SandboxWorkloadTemplate[]>;
765
+ delete(name: string, options?: DeleteOptions | null): Promise<DeletionResult>;
766
+ }
211
767
  export declare class SandboxClient {
212
768
  private readonly grpc;
213
769
  /**
@@ -239,6 +795,11 @@ export declare class SandboxClient {
239
795
  input: typeof import("./gen/openshell_pb.js").CreateSandboxRequestSchema;
240
796
  output: typeof import("./gen/openshell_pb.js").SandboxResponseSchema;
241
797
  };
798
+ beginRootfsTarStaging: {
799
+ methodKind: "unary";
800
+ input: typeof import("./gen/openshell_pb.js").BeginRootfsTarStagingRequestSchema;
801
+ output: typeof import("./gen/openshell_pb.js").BeginRootfsTarStagingResponseSchema;
802
+ };
242
803
  getSandbox: {
243
804
  methodKind: "unary";
244
805
  input: typeof import("./gen/openshell_pb.js").GetSandboxRequestSchema;
@@ -249,6 +810,26 @@ export declare class SandboxClient {
249
810
  input: typeof import("./gen/openshell_pb.js").ListSandboxesRequestSchema;
250
811
  output: typeof import("./gen/openshell_pb.js").ListSandboxesResponseSchema;
251
812
  };
813
+ createSandboxTemplate: {
814
+ methodKind: "unary";
815
+ input: typeof import("./gen/openshell_pb.js").CreateSandboxTemplateRequestSchema;
816
+ output: typeof import("./gen/openshell_pb.js").SandboxTemplateResponseSchema;
817
+ };
818
+ getSandboxTemplate: {
819
+ methodKind: "unary";
820
+ input: typeof import("./gen/openshell_pb.js").GetSandboxTemplateRequestSchema;
821
+ output: typeof import("./gen/openshell_pb.js").SandboxTemplateResponseSchema;
822
+ };
823
+ listSandboxTemplates: {
824
+ methodKind: "unary";
825
+ input: typeof import("./gen/openshell_pb.js").ListSandboxTemplatesRequestSchema;
826
+ output: typeof import("./gen/openshell_pb.js").ListSandboxTemplatesResponseSchema;
827
+ };
828
+ deleteSandboxTemplate: {
829
+ methodKind: "unary";
830
+ input: typeof import("./gen/openshell_pb.js").DeleteSandboxTemplateRequestSchema;
831
+ output: typeof import("./gen/openshell_pb.js").DeleteSandboxTemplateResponseSchema;
832
+ };
252
833
  listSandboxProviders: {
253
834
  methodKind: "unary";
254
835
  input: typeof import("./gen/openshell_pb.js").ListSandboxProvidersRequestSchema;
@@ -264,6 +845,11 @@ export declare class SandboxClient {
264
845
  input: typeof import("./gen/openshell_pb.js").DetachSandboxProviderRequestSchema;
265
846
  output: typeof import("./gen/openshell_pb.js").DetachSandboxProviderResponseSchema;
266
847
  };
848
+ getSandboxProviderStatus: {
849
+ methodKind: "unary";
850
+ input: typeof import("./gen/openshell_pb.js").GetSandboxProviderStatusRequestSchema;
851
+ output: typeof import("./gen/openshell_pb.js").GetSandboxProviderStatusResponseSchema;
852
+ };
267
853
  deleteSandbox: {
268
854
  methodKind: "unary";
269
855
  input: typeof import("./gen/openshell_pb.js").DeleteSandboxRequestSchema;
@@ -429,6 +1015,21 @@ export declare class SandboxClient {
429
1015
  input: typeof import("./gen/openshell_pb.js").ReportPolicyStatusRequestSchema;
430
1016
  output: typeof import("./gen/openshell_pb.js").ReportPolicyStatusResponseSchema;
431
1017
  };
1018
+ reportEndpointStatus: {
1019
+ methodKind: "unary";
1020
+ input: typeof import("./gen/openshell_pb.js").ReportEndpointStatusRequestSchema;
1021
+ output: typeof import("./gen/openshell_pb.js").ReportEndpointStatusResponseSchema;
1022
+ };
1023
+ reportProviderReadiness: {
1024
+ methodKind: "unary";
1025
+ input: typeof import("./gen/openshell_pb.js").ReportProviderReadinessRequestSchema;
1026
+ output: typeof import("./gen/openshell_pb.js").ReportProviderReadinessResponseSchema;
1027
+ };
1028
+ reportSandboxConfiguration: {
1029
+ methodKind: "unary";
1030
+ input: typeof import("./gen/openshell_pb.js").ReportSandboxConfigurationRequestSchema;
1031
+ output: typeof import("./gen/openshell_pb.js").ReportSandboxConfigurationResponseSchema;
1032
+ };
432
1033
  getSandboxProviderEnvironment: {
433
1034
  methodKind: "unary";
434
1035
  input: typeof import("./gen/openshell_pb.js").GetSandboxProviderEnvironmentRequestSchema;
@@ -459,11 +1060,36 @@ export declare class SandboxClient {
459
1060
  input: typeof import("./gen/openshell_pb.js").ReportMainProcessExitRequestSchema;
460
1061
  output: typeof import("./gen/openshell_pb.js").ReportMainProcessExitResponseSchema;
461
1062
  };
1063
+ finalizeMainProcessExit: {
1064
+ methodKind: "unary";
1065
+ input: typeof import("./gen/openshell_pb.js").FinalizeMainProcessExitRequestSchema;
1066
+ output: typeof import("./gen/openshell_pb.js").FinalizeMainProcessExitResponseSchema;
1067
+ };
462
1068
  relayStream: {
463
1069
  methodKind: "bidi_streaming";
464
1070
  input: typeof import("./gen/openshell_pb.js").RelayFrameSchema;
465
1071
  output: typeof import("./gen/openshell_pb.js").RelayFrameSchema;
466
1072
  };
1073
+ peerRelay: {
1074
+ methodKind: "bidi_streaming";
1075
+ input: typeof import("./gen/openshell_pb.js").PeerRelayFrameSchema;
1076
+ output: typeof import("./gen/openshell_pb.js").PeerRelayFrameSchema;
1077
+ };
1078
+ peerReportProviderReadiness: {
1079
+ methodKind: "unary";
1080
+ input: typeof import("./gen/openshell_pb.js").ReportProviderReadinessRequestSchema;
1081
+ output: typeof import("./gen/openshell_pb.js").ReportProviderReadinessResponseSchema;
1082
+ };
1083
+ peerReportEndpointStatus: {
1084
+ methodKind: "unary";
1085
+ input: typeof import("./gen/openshell_pb.js").ReportEndpointStatusRequestSchema;
1086
+ output: typeof import("./gen/openshell_pb.js").ReportEndpointStatusResponseSchema;
1087
+ };
1088
+ peerGetSandboxProviderStatus: {
1089
+ methodKind: "unary";
1090
+ input: typeof import("./gen/openshell_pb.js").GetSandboxProviderStatusRequestSchema;
1091
+ output: typeof import("./gen/openshell_pb.js").GetSandboxProviderStatusResponseSchema;
1092
+ };
467
1093
  watchSandbox: {
468
1094
  methodKind: "server_streaming";
469
1095
  input: typeof import("./gen/openshell_pb.js").WatchSandboxRequestSchema;
@@ -566,29 +1192,36 @@ export declare class SandboxClient {
566
1192
  */
567
1193
  static connect(options: ConnectOptions): Promise<SandboxClient>;
568
1194
  create(spec: SandboxSpec): Promise<SandboxRef>;
569
- get(name: string, callOptions?: CallOptions): Promise<SandboxRef>;
570
- list(options?: ListOptions | null): Promise<SandboxRef[]>;
571
- delete(name: string): Promise<boolean>;
1195
+ createFromTemplate(spec: SandboxFromTemplateSpec): Promise<SandboxRef>;
1196
+ get(name: string, options?: SandboxCallOptions | null): Promise<SandboxRef>;
1197
+ list(options?: ListOptions | null): Pager<SandboxRef>;
1198
+ /** List and collect every sandbox in this scope. */
1199
+ listAll(options?: ListOptions | null): Promise<SandboxRef[]>;
1200
+ delete(name: string, options?: DeleteOptions | null): Promise<DeletionResult>;
572
1201
  waitReady(name: string, timeoutSecs: number, options?: WaitOptions | null): Promise<SandboxRef>;
573
- waitDeleted(name: string, timeoutSecs: number, options?: WaitOptions | null): Promise<void>;
1202
+ waitDeleted(name: string, timeoutSecs: number, options?: WaitDeletedOptions | null): Promise<void>;
574
1203
  execStream(name: string, command: string[], options?: ExecOptions | null): AsyncGenerator<ExecStreamEvent, void, void>;
575
1204
  exec(name: string, command: string[], options?: ExecOptions | null): Promise<ExecResult>;
576
- execInteractive(name: string, command: string[], options?: ExecInteractiveOptions | null): Promise<ExecInteractiveSession>;
1205
+ execInteractive(name: string, command: string[], options?: ExecInteractiveOptions | null): Promise<ExecInteractiveSessionControl>;
577
1206
  forward(name: string, opts: ForwardOptions): Promise<ForwardHandle>;
578
1207
  private forwardConnection;
579
- createSshSession(name: string): Promise<SshSession>;
580
- revokeSshSession(token: string): Promise<boolean>;
1208
+ createSshSession(name: string, options?: SandboxWorkspaceOptions | null): Promise<SshSession>;
1209
+ revokeSshSession(token: string, options?: Pick<DeleteOptions, 'allowMissing'>): Promise<DeletionResult>;
581
1210
  attachProvider(name: string, provider: string, options?: ProviderChangeOptions | null): Promise<ProviderChange>;
582
1211
  detachProvider(name: string, provider: string, options?: ProviderChangeOptions | null): Promise<ProviderChange>;
583
- listProviders(name: string): Promise<ProviderRef[]>;
584
- getConfig(name: string, callOptions?: CallOptions): Promise<SandboxConfig>;
1212
+ listProviders(name: string, options?: SandboxProviderListOptions | null): Pager<ProviderRef>;
1213
+ /** List and collect every provider attached to this sandbox. */
1214
+ listAllProviders(name: string, options?: SandboxProviderListOptions | null): Promise<ProviderRef[]>;
1215
+ getConfig(name: string, options?: SandboxCallOptions | null): Promise<SandboxConfig>;
585
1216
  setPolicy(name: string, policy: MessageInitShape<typeof SandboxPolicySchema>, options?: SetPolicyOptions | null): Promise<UpdateConfigResult>;
586
- setSetting(name: string, key: string, value: MessageInitShape<typeof SettingValueSchema>): Promise<UpdateConfigResult>;
1217
+ setSetting(name: string, key: string, value: MessageInitShape<typeof SettingValueSchema>, options?: SandboxWorkspaceOptions | null): Promise<UpdateConfigResult>;
587
1218
  private waitForPolicyHash;
588
1219
  }
589
1220
  export declare class OpenShellClient {
590
1221
  /** Sandbox lifecycle + exec: create/get/list/delete, waitReady/waitDeleted, exec. */
591
1222
  readonly sandbox: SandboxClient;
1223
+ /** Reusable sandbox workload template lifecycle. */
1224
+ readonly sandboxTemplates: SandboxTemplateClient;
592
1225
  /**
593
1226
  * Advanced escape hatch: a generated client for every gateway RPC, including
594
1227
  * surface the curated sub-clients do not wrap yet (gateway config, provider