langsmith 0.7.11 → 0.7.13

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 (52) hide show
  1. package/dist/_openapi_client/client.cjs +16 -0
  2. package/dist/_openapi_client/client.d.ts +6 -0
  3. package/dist/_openapi_client/client.js +16 -0
  4. package/dist/_openapi_client/core/pagination.cjs +2 -2
  5. package/dist/_openapi_client/core/pagination.js +2 -2
  6. package/dist/_openapi_client/internal/utils/query.cjs +1 -1
  7. package/dist/_openapi_client/internal/utils/query.js +1 -1
  8. package/dist/_openapi_client/resources/datasets/runs.d.ts +2 -1
  9. package/dist/_openapi_client/resources/index.cjs +5 -1
  10. package/dist/_openapi_client/resources/index.d.ts +2 -0
  11. package/dist/_openapi_client/resources/index.js +2 -0
  12. package/dist/_openapi_client/resources/runs/index.cjs +9 -0
  13. package/dist/_openapi_client/resources/runs/index.d.ts +2 -0
  14. package/dist/_openapi_client/resources/runs/index.js +4 -0
  15. package/dist/_openapi_client/resources/runs/rules.cjs +9 -0
  16. package/dist/_openapi_client/resources/runs/rules.d.ts +3 -0
  17. package/dist/_openapi_client/resources/runs/rules.js +5 -0
  18. package/dist/_openapi_client/resources/runs/runs.cjs +115 -0
  19. package/dist/_openapi_client/resources/runs/runs.d.ts +800 -0
  20. package/dist/_openapi_client/resources/runs/runs.js +78 -0
  21. package/dist/_openapi_client/resources/runs.cjs +19 -0
  22. package/dist/_openapi_client/resources/runs.d.ts +1 -0
  23. package/dist/_openapi_client/resources/runs.js +3 -0
  24. package/dist/_openapi_client/resources/sandboxes/boxes.cjs +86 -0
  25. package/dist/_openapi_client/resources/sandboxes/boxes.d.ts +458 -0
  26. package/dist/_openapi_client/resources/sandboxes/boxes.js +82 -0
  27. package/dist/_openapi_client/resources/sandboxes/registries.cjs +44 -0
  28. package/dist/_openapi_client/resources/sandboxes/registries.d.ts +67 -0
  29. package/dist/_openapi_client/resources/sandboxes/registries.js +40 -0
  30. package/dist/_openapi_client/resources/sandboxes/sandboxes.cjs +72 -0
  31. package/dist/_openapi_client/resources/sandboxes/sandboxes.d.ts +308 -0
  32. package/dist/_openapi_client/resources/sandboxes/sandboxes.js +35 -0
  33. package/dist/_openapi_client/resources/sandboxes/snapshots.cjs +39 -0
  34. package/dist/_openapi_client/resources/sandboxes/snapshots.d.ts +62 -0
  35. package/dist/_openapi_client/resources/sandboxes/snapshots.js +35 -0
  36. package/dist/client.cjs +7 -0
  37. package/dist/client.d.ts +5 -0
  38. package/dist/client.js +7 -0
  39. package/dist/index.cjs +1 -1
  40. package/dist/index.d.ts +1 -1
  41. package/dist/index.js +1 -1
  42. package/dist/sandbox/client.cjs +58 -15
  43. package/dist/sandbox/client.d.ts +27 -1
  44. package/dist/sandbox/client.js +54 -11
  45. package/dist/sandbox/sandbox.cjs +7 -6
  46. package/dist/sandbox/sandbox.d.ts +7 -2
  47. package/dist/sandbox/sandbox.js +8 -7
  48. package/dist/sandbox/types.d.ts +1 -7
  49. package/dist/utils/constants.cjs +1 -1
  50. package/dist/utils/constants.d.ts +1 -1
  51. package/dist/utils/constants.js +1 -1
  52. package/package.json +5 -5
@@ -0,0 +1,82 @@
1
+ // @ts-nocheck
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ import { APIResource } from '../../core/resource.js';
4
+ import { buildHeaders } from '../../internal/headers.js';
5
+ import { path } from '../../internal/utils/path.js';
6
+ export class Boxes extends APIResource {
7
+ /**
8
+ * Create a new sandbox from a snapshot. Provide at most one of `snapshot_id` or
9
+ * `snapshot_name`; if neither is provided, the server uses the default static
10
+ * blueprint.
11
+ */
12
+ create(body, options) {
13
+ return this._client.post('/v2/sandboxes/boxes', { body, ...options });
14
+ }
15
+ /**
16
+ * Retrieve a sandbox by name. Stale provisioning sandboxes are auto-failed.
17
+ */
18
+ retrieve(name, options) {
19
+ return this._client.get(path `/v2/sandboxes/boxes/${name}`, options);
20
+ }
21
+ /**
22
+ * Update a sandbox's display name. The name must be unique within the tenant.
23
+ */
24
+ update(name, body, options) {
25
+ return this._client.patch(path `/v2/sandboxes/boxes/${name}`, { body, ...options });
26
+ }
27
+ /**
28
+ * List sandboxes for the authenticated tenant, with optional filtering, sorting,
29
+ * and pagination.
30
+ */
31
+ list(query = {}, options) {
32
+ return this._client.get('/v2/sandboxes/boxes', { query, ...options });
33
+ }
34
+ /**
35
+ * Delete a sandbox by name or UUID. Tears down the sandbox runtime and removes the
36
+ * DB record.
37
+ */
38
+ delete(name, options) {
39
+ return this._client.delete(path `/v2/sandboxes/boxes/${name}`, {
40
+ ...options,
41
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
42
+ });
43
+ }
44
+ /**
45
+ * Create a snapshot by capturing the current state of a sandbox or promoting an
46
+ * existing checkpoint.
47
+ */
48
+ createSnapshot(name, body, options) {
49
+ return this._client.post(path `/v2/sandboxes/boxes/${name}/snapshot`, { body, ...options });
50
+ }
51
+ /**
52
+ * Create a short-lived JWT for accessing an HTTP service running on a specific
53
+ * port inside a sandbox. Returns a browser_url (sets auth cookie via redirect), a
54
+ * service_url (for use with the X-Langsmith-Sandbox-Service-Token header), the raw
55
+ * token, and its expiry.
56
+ */
57
+ generateServiceURL(name, body, options) {
58
+ return this._client.post(path `/v2/sandboxes/boxes/${name}/service-url`, { body, ...options });
59
+ }
60
+ /**
61
+ * Retrieve the lightweight status of a sandbox for polling.
62
+ */
63
+ getStatus(name, options) {
64
+ return this._client.get(path `/v2/sandboxes/boxes/${name}/status`, options);
65
+ }
66
+ /**
67
+ * Start a stopped or failed sandbox. This endpoint is not idempotent.
68
+ */
69
+ start(name, options) {
70
+ return this._client.post(path `/v2/sandboxes/boxes/${name}/start`, options);
71
+ }
72
+ /**
73
+ * Stop a ready sandbox. This endpoint is not idempotent; the filesystem is
74
+ * preserved for later restart.
75
+ */
76
+ stop(name, options) {
77
+ return this._client.post(path `/v2/sandboxes/boxes/${name}/stop`, {
78
+ ...options,
79
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
80
+ });
81
+ }
82
+ }
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ // @ts-nocheck
3
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.Registries = void 0;
6
+ const resource_js_1 = require("../../core/resource.cjs");
7
+ const headers_js_1 = require("../../internal/headers.cjs");
8
+ const path_js_1 = require("../../internal/utils/path.cjs");
9
+ class Registries extends resource_js_1.APIResource {
10
+ /**
11
+ * Create a sandbox registry for pulling private images.
12
+ */
13
+ create(body, options) {
14
+ return this._client.post('/v2/sandboxes/registries', { body, ...options });
15
+ }
16
+ /**
17
+ * Get a sandbox registry by name.
18
+ */
19
+ retrieve(name, options) {
20
+ return this._client.get((0, path_js_1.path) `/v2/sandboxes/registries/${name}`, options);
21
+ }
22
+ /**
23
+ * Update a sandbox registry's name and/or credentials.
24
+ */
25
+ update(name, body, options) {
26
+ return this._client.patch((0, path_js_1.path) `/v2/sandboxes/registries/${name}`, { body, ...options });
27
+ }
28
+ /**
29
+ * List sandbox registries for pulling private images.
30
+ */
31
+ list(query = {}, options) {
32
+ return this._client.get('/v2/sandboxes/registries', { query, ...options });
33
+ }
34
+ /**
35
+ * Delete a sandbox registry by name.
36
+ */
37
+ delete(name, options) {
38
+ return this._client.delete((0, path_js_1.path) `/v2/sandboxes/registries/${name}`, {
39
+ ...options,
40
+ headers: (0, headers_js_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
41
+ });
42
+ }
43
+ }
44
+ exports.Registries = Registries;
@@ -0,0 +1,67 @@
1
+ import { APIResource } from '../../core/resource.js';
2
+ import { APIPromise } from '../../core/api-promise.js';
3
+ import { RequestOptions } from '../../internal/request-options.js';
4
+ export declare class Registries extends APIResource {
5
+ /**
6
+ * Create a sandbox registry for pulling private images.
7
+ */
8
+ create(body: RegistryCreateParams, options?: RequestOptions): APIPromise<RegistryResponse>;
9
+ /**
10
+ * Get a sandbox registry by name.
11
+ */
12
+ retrieve(name: string, options?: RequestOptions): APIPromise<RegistryResponse>;
13
+ /**
14
+ * Update a sandbox registry's name and/or credentials.
15
+ */
16
+ update(name: string, body: RegistryUpdateParams, options?: RequestOptions): APIPromise<RegistryResponse>;
17
+ /**
18
+ * List sandbox registries for pulling private images.
19
+ */
20
+ list(query?: RegistryListParams | null | undefined, options?: RequestOptions): APIPromise<RegistryListResponse>;
21
+ /**
22
+ * Delete a sandbox registry by name.
23
+ */
24
+ delete(name: string, options?: RequestOptions): APIPromise<void>;
25
+ }
26
+ export interface RegistryListResponse {
27
+ offset?: number;
28
+ registries?: Array<RegistryResponse>;
29
+ }
30
+ export interface RegistryResponse {
31
+ id?: string;
32
+ created_at?: string;
33
+ created_by?: string;
34
+ name?: string;
35
+ updated_at?: string;
36
+ updated_by?: string;
37
+ url?: string;
38
+ }
39
+ export interface RegistryCreateParams {
40
+ name: string;
41
+ password: string;
42
+ url: string;
43
+ username: string;
44
+ }
45
+ export interface RegistryUpdateParams {
46
+ name?: string;
47
+ password?: string;
48
+ url?: string;
49
+ username?: string;
50
+ }
51
+ export interface RegistryListParams {
52
+ /**
53
+ * Maximum number of registries to return
54
+ */
55
+ limit?: number;
56
+ /**
57
+ * Filter to registries whose name contains this substring
58
+ */
59
+ name_contains?: string;
60
+ /**
61
+ * Number of registries to skip
62
+ */
63
+ offset?: number;
64
+ }
65
+ export declare namespace Registries {
66
+ export { type RegistryListResponse as RegistryListResponse, type RegistryResponse as RegistryResponse, type RegistryCreateParams as RegistryCreateParams, type RegistryUpdateParams as RegistryUpdateParams, type RegistryListParams as RegistryListParams, };
67
+ }
@@ -0,0 +1,40 @@
1
+ // @ts-nocheck
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ import { APIResource } from '../../core/resource.js';
4
+ import { buildHeaders } from '../../internal/headers.js';
5
+ import { path } from '../../internal/utils/path.js';
6
+ export class Registries extends APIResource {
7
+ /**
8
+ * Create a sandbox registry for pulling private images.
9
+ */
10
+ create(body, options) {
11
+ return this._client.post('/v2/sandboxes/registries', { body, ...options });
12
+ }
13
+ /**
14
+ * Get a sandbox registry by name.
15
+ */
16
+ retrieve(name, options) {
17
+ return this._client.get(path `/v2/sandboxes/registries/${name}`, options);
18
+ }
19
+ /**
20
+ * Update a sandbox registry's name and/or credentials.
21
+ */
22
+ update(name, body, options) {
23
+ return this._client.patch(path `/v2/sandboxes/registries/${name}`, { body, ...options });
24
+ }
25
+ /**
26
+ * List sandbox registries for pulling private images.
27
+ */
28
+ list(query = {}, options) {
29
+ return this._client.get('/v2/sandboxes/registries', { query, ...options });
30
+ }
31
+ /**
32
+ * Delete a sandbox registry by name.
33
+ */
34
+ delete(name, options) {
35
+ return this._client.delete(path `/v2/sandboxes/registries/${name}`, {
36
+ ...options,
37
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
38
+ });
39
+ }
40
+ }
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ // @ts-nocheck
3
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
4
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
+ if (k2 === undefined) k2 = k;
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: function() { return m[k]; } };
9
+ }
10
+ Object.defineProperty(o, k2, desc);
11
+ }) : (function(o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ o[k2] = m[k];
14
+ }));
15
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
16
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
17
+ }) : function(o, v) {
18
+ o["default"] = v;
19
+ });
20
+ var __importStar = (this && this.__importStar) || (function () {
21
+ var ownKeys = function(o) {
22
+ ownKeys = Object.getOwnPropertyNames || function (o) {
23
+ var ar = [];
24
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
25
+ return ar;
26
+ };
27
+ return ownKeys(o);
28
+ };
29
+ return function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
36
+ })();
37
+ Object.defineProperty(exports, "__esModule", { value: true });
38
+ exports.Sandboxes = void 0;
39
+ const resource_js_1 = require("../../core/resource.cjs");
40
+ const BoxesAPI = __importStar(require("./boxes.cjs"));
41
+ const boxes_js_1 = require("./boxes.cjs");
42
+ const RegistriesAPI = __importStar(require("./registries.cjs"));
43
+ const registries_js_1 = require("./registries.cjs");
44
+ const SnapshotsAPI = __importStar(require("./snapshots.cjs"));
45
+ const snapshots_js_1 = require("./snapshots.cjs");
46
+ class Sandboxes extends resource_js_1.APIResource {
47
+ constructor() {
48
+ super(...arguments);
49
+ Object.defineProperty(this, "boxes", {
50
+ enumerable: true,
51
+ configurable: true,
52
+ writable: true,
53
+ value: new BoxesAPI.Boxes(this._client)
54
+ });
55
+ Object.defineProperty(this, "registries", {
56
+ enumerable: true,
57
+ configurable: true,
58
+ writable: true,
59
+ value: new RegistriesAPI.Registries(this._client)
60
+ });
61
+ Object.defineProperty(this, "snapshots", {
62
+ enumerable: true,
63
+ configurable: true,
64
+ writable: true,
65
+ value: new SnapshotsAPI.Snapshots(this._client)
66
+ });
67
+ }
68
+ }
69
+ exports.Sandboxes = Sandboxes;
70
+ Sandboxes.Boxes = boxes_js_1.Boxes;
71
+ Sandboxes.Registries = registries_js_1.Registries;
72
+ Sandboxes.Snapshots = snapshots_js_1.Snapshots;
@@ -0,0 +1,308 @@
1
+ import { APIResource } from '../../core/resource.js';
2
+ import * as BoxesAPI from './boxes.js';
3
+ import { BoxCreateParams, BoxCreateSnapshotParams, BoxGenerateServiceURLParams, BoxListParams, BoxUpdateParams, Boxes } from './boxes.js';
4
+ import * as RegistriesAPI from './registries.js';
5
+ import { Registries, RegistryCreateParams, RegistryListParams, RegistryListResponse, RegistryResponse, RegistryUpdateParams } from './registries.js';
6
+ import * as SnapshotsAPI from './snapshots.js';
7
+ import { SnapshotCreateParams, SnapshotListParams, Snapshots } from './snapshots.js';
8
+ export declare class Sandboxes extends APIResource {
9
+ boxes: BoxesAPI.Boxes;
10
+ registries: RegistriesAPI.Registries;
11
+ snapshots: SnapshotsAPI.Snapshots;
12
+ }
13
+ export interface SandboxListResponse {
14
+ offset?: number;
15
+ sandboxes?: Array<SandboxResponse>;
16
+ }
17
+ export interface SandboxResponse {
18
+ id?: string;
19
+ created_at?: string;
20
+ created_by?: string;
21
+ dataplane_url?: string;
22
+ delete_after_stop_seconds?: number;
23
+ fs_capacity_bytes?: number;
24
+ idle_ttl_seconds?: number;
25
+ mem_bytes?: number;
26
+ mount_config?: SandboxResponse.MountConfig;
27
+ name?: string;
28
+ proxy_config?: SandboxResponse.ProxyConfig;
29
+ size_class?: string;
30
+ snapshot_id?: string;
31
+ status?: string;
32
+ status_message?: string;
33
+ stopped_at?: string;
34
+ updated_at?: string;
35
+ updated_by?: string;
36
+ vcpus?: number;
37
+ }
38
+ export declare namespace SandboxResponse {
39
+ interface MountConfig {
40
+ auth?: MountConfig.Auth;
41
+ mounts?: Array<MountConfig.SandboxapiS3BucketMountSpec | MountConfig.SandboxapiGcsBucketMountSpec | MountConfig.SandboxapiGitRepoMountSpec>;
42
+ }
43
+ namespace MountConfig {
44
+ interface Auth {
45
+ aws?: Auth.Aws;
46
+ gcp?: Auth.Gcp;
47
+ }
48
+ namespace Auth {
49
+ interface Aws {
50
+ access_key_id: Aws.AccessKeyID;
51
+ secret_access_key: Aws.SecretAccessKey;
52
+ }
53
+ namespace Aws {
54
+ interface AccessKeyID {
55
+ type: 'plaintext' | 'opaque' | 'workspace_secret';
56
+ is_set?: boolean;
57
+ value?: string;
58
+ }
59
+ interface SecretAccessKey {
60
+ type: 'plaintext' | 'opaque' | 'workspace_secret';
61
+ is_set?: boolean;
62
+ value?: string;
63
+ }
64
+ }
65
+ interface Gcp {
66
+ service_account_json: Gcp.ServiceAccountJson;
67
+ }
68
+ namespace Gcp {
69
+ interface ServiceAccountJson {
70
+ type: 'plaintext' | 'opaque' | 'workspace_secret';
71
+ is_set?: boolean;
72
+ value?: string;
73
+ }
74
+ }
75
+ }
76
+ interface SandboxapiS3BucketMountSpec {
77
+ id: string;
78
+ mount_path: string;
79
+ s3: SandboxapiS3BucketMountSpec.S3;
80
+ type: 's3' | 'gcs' | 'git';
81
+ cache?: SandboxapiS3BucketMountSpec.Cache;
82
+ gcs?: SandboxapiS3BucketMountSpec.Gcs;
83
+ git?: SandboxapiS3BucketMountSpec.Git;
84
+ read_only?: boolean;
85
+ }
86
+ namespace SandboxapiS3BucketMountSpec {
87
+ interface S3 {
88
+ bucket: string;
89
+ region: string;
90
+ endpoint_url?: string;
91
+ path_style?: boolean;
92
+ prefix?: string;
93
+ }
94
+ interface Cache {
95
+ max_size_bytes?: number;
96
+ writeback_seconds?: number;
97
+ }
98
+ interface Gcs {
99
+ bucket: string;
100
+ prefix?: string;
101
+ }
102
+ interface Git {
103
+ remote_url: string;
104
+ ref?: Git.Ref;
105
+ refresh_interval_seconds?: number;
106
+ }
107
+ namespace Git {
108
+ interface Ref {
109
+ name: string;
110
+ type: 'branch' | 'tag';
111
+ }
112
+ }
113
+ }
114
+ interface SandboxapiGcsBucketMountSpec {
115
+ id: string;
116
+ gcs: SandboxapiGcsBucketMountSpec.Gcs;
117
+ mount_path: string;
118
+ type: 's3' | 'gcs' | 'git';
119
+ cache?: SandboxapiGcsBucketMountSpec.Cache;
120
+ git?: SandboxapiGcsBucketMountSpec.Git;
121
+ read_only?: boolean;
122
+ s3?: SandboxapiGcsBucketMountSpec.S3;
123
+ }
124
+ namespace SandboxapiGcsBucketMountSpec {
125
+ interface Gcs {
126
+ bucket: string;
127
+ prefix?: string;
128
+ }
129
+ interface Cache {
130
+ max_size_bytes?: number;
131
+ writeback_seconds?: number;
132
+ }
133
+ interface Git {
134
+ remote_url: string;
135
+ ref?: Git.Ref;
136
+ refresh_interval_seconds?: number;
137
+ }
138
+ namespace Git {
139
+ interface Ref {
140
+ name: string;
141
+ type: 'branch' | 'tag';
142
+ }
143
+ }
144
+ interface S3 {
145
+ bucket: string;
146
+ region: string;
147
+ endpoint_url?: string;
148
+ path_style?: boolean;
149
+ prefix?: string;
150
+ }
151
+ }
152
+ interface SandboxapiGitRepoMountSpec {
153
+ id: string;
154
+ git: SandboxapiGitRepoMountSpec.Git;
155
+ mount_path: string;
156
+ type: 's3' | 'gcs' | 'git';
157
+ cache?: SandboxapiGitRepoMountSpec.Cache;
158
+ gcs?: SandboxapiGitRepoMountSpec.Gcs;
159
+ read_only?: boolean;
160
+ s3?: SandboxapiGitRepoMountSpec.S3;
161
+ }
162
+ namespace SandboxapiGitRepoMountSpec {
163
+ interface Git {
164
+ remote_url: string;
165
+ ref?: Git.Ref;
166
+ refresh_interval_seconds?: number;
167
+ }
168
+ namespace Git {
169
+ interface Ref {
170
+ name: string;
171
+ type: 'branch' | 'tag';
172
+ }
173
+ }
174
+ interface Cache {
175
+ max_size_bytes?: number;
176
+ writeback_seconds?: number;
177
+ }
178
+ interface Gcs {
179
+ bucket: string;
180
+ prefix?: string;
181
+ }
182
+ interface S3 {
183
+ bucket: string;
184
+ region: string;
185
+ endpoint_url?: string;
186
+ path_style?: boolean;
187
+ prefix?: string;
188
+ }
189
+ }
190
+ }
191
+ interface ProxyConfig {
192
+ access_control?: ProxyConfig.AccessControl;
193
+ callbacks?: Array<ProxyConfig.Callback>;
194
+ no_proxy?: Array<string>;
195
+ rules?: Array<ProxyConfig.Rule>;
196
+ }
197
+ namespace ProxyConfig {
198
+ interface AccessControl {
199
+ allow_list?: Array<string>;
200
+ deny_list?: Array<string>;
201
+ }
202
+ interface Callback {
203
+ match_hosts: Array<string>;
204
+ ttl_seconds: number;
205
+ url: string;
206
+ full_request?: boolean;
207
+ request_headers?: Array<Callback.RequestHeader>;
208
+ }
209
+ namespace Callback {
210
+ interface RequestHeader {
211
+ name: string;
212
+ type: 'plaintext' | 'opaque' | 'workspace_secret';
213
+ is_set?: boolean;
214
+ value?: string;
215
+ }
216
+ }
217
+ interface Rule {
218
+ name: string;
219
+ aws?: Rule.Aws;
220
+ enabled?: boolean;
221
+ gcp?: Rule.Gcp;
222
+ headers?: Array<Rule.Header>;
223
+ /**
224
+ * MatchHosts is only accepted for header injection rules. Provider auth rules use
225
+ * built-in host matching.
226
+ */
227
+ match_hosts?: Array<string>;
228
+ match_paths?: Array<string>;
229
+ type?: string;
230
+ }
231
+ namespace Rule {
232
+ interface Aws {
233
+ access_key_id: Aws.AccessKeyID;
234
+ secret_access_key: Aws.SecretAccessKey;
235
+ }
236
+ namespace Aws {
237
+ interface AccessKeyID {
238
+ type: 'plaintext' | 'opaque' | 'workspace_secret';
239
+ is_set?: boolean;
240
+ value?: string;
241
+ }
242
+ interface SecretAccessKey {
243
+ type: 'plaintext' | 'opaque' | 'workspace_secret';
244
+ is_set?: boolean;
245
+ value?: string;
246
+ }
247
+ }
248
+ interface Gcp {
249
+ scopes: Array<string>;
250
+ service_account_json: Gcp.ServiceAccountJson;
251
+ }
252
+ namespace Gcp {
253
+ interface ServiceAccountJson {
254
+ type: 'plaintext' | 'opaque' | 'workspace_secret';
255
+ is_set?: boolean;
256
+ value?: string;
257
+ }
258
+ }
259
+ interface Header {
260
+ name: string;
261
+ type: 'plaintext' | 'opaque' | 'workspace_secret';
262
+ is_set?: boolean;
263
+ value?: string;
264
+ }
265
+ }
266
+ }
267
+ }
268
+ export interface SandboxStatusResponse {
269
+ status?: string;
270
+ status_message?: string;
271
+ }
272
+ export interface ServiceURLResponse {
273
+ token?: string;
274
+ browser_url?: string;
275
+ expires_at?: string;
276
+ service_url?: string;
277
+ }
278
+ export interface SnapshotListResponse {
279
+ offset?: number;
280
+ snapshots?: Array<SnapshotResponse>;
281
+ }
282
+ export interface SnapshotResponse {
283
+ id?: string;
284
+ created_at?: string;
285
+ created_by?: string;
286
+ docker_image?: string;
287
+ fs_capacity_bytes?: number;
288
+ fs_used_bytes?: number;
289
+ image_digest?: string;
290
+ /**
291
+ * MemorySnapshotSizeBytes is non-nil iff the snapshot was captured with VM memory
292
+ * state. A non-nil value is the canonical signal that this snapshot can
293
+ * warm-restore from memory; nil means rootfs only.
294
+ */
295
+ memory_snapshot_size_bytes?: number;
296
+ name?: string;
297
+ registry_id?: string;
298
+ source_sandbox_id?: string;
299
+ status?: string;
300
+ status_message?: string;
301
+ updated_at?: string;
302
+ }
303
+ export declare namespace Sandboxes {
304
+ export { type SandboxListResponse as SandboxListResponse, type SandboxResponse as SandboxResponse, type SandboxStatusResponse as SandboxStatusResponse, type ServiceURLResponse as ServiceURLResponse, type SnapshotListResponse as SnapshotListResponse, type SnapshotResponse as SnapshotResponse, };
305
+ export { Boxes as Boxes, type BoxCreateParams as BoxCreateParams, type BoxUpdateParams as BoxUpdateParams, type BoxListParams as BoxListParams, type BoxCreateSnapshotParams as BoxCreateSnapshotParams, type BoxGenerateServiceURLParams as BoxGenerateServiceURLParams, };
306
+ export { Registries as Registries, type RegistryListResponse as RegistryListResponse, type RegistryResponse as RegistryResponse, type RegistryCreateParams as RegistryCreateParams, type RegistryUpdateParams as RegistryUpdateParams, type RegistryListParams as RegistryListParams, };
307
+ export { Snapshots as Snapshots, type SnapshotCreateParams as SnapshotCreateParams, type SnapshotListParams as SnapshotListParams, };
308
+ }
@@ -0,0 +1,35 @@
1
+ // @ts-nocheck
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ import { APIResource } from '../../core/resource.js';
4
+ import * as BoxesAPI from './boxes.js';
5
+ import { Boxes, } from './boxes.js';
6
+ import * as RegistriesAPI from './registries.js';
7
+ import { Registries, } from './registries.js';
8
+ import * as SnapshotsAPI from './snapshots.js';
9
+ import { Snapshots } from './snapshots.js';
10
+ export class Sandboxes extends APIResource {
11
+ constructor() {
12
+ super(...arguments);
13
+ Object.defineProperty(this, "boxes", {
14
+ enumerable: true,
15
+ configurable: true,
16
+ writable: true,
17
+ value: new BoxesAPI.Boxes(this._client)
18
+ });
19
+ Object.defineProperty(this, "registries", {
20
+ enumerable: true,
21
+ configurable: true,
22
+ writable: true,
23
+ value: new RegistriesAPI.Registries(this._client)
24
+ });
25
+ Object.defineProperty(this, "snapshots", {
26
+ enumerable: true,
27
+ configurable: true,
28
+ writable: true,
29
+ value: new SnapshotsAPI.Snapshots(this._client)
30
+ });
31
+ }
32
+ }
33
+ Sandboxes.Boxes = Boxes;
34
+ Sandboxes.Registries = Registries;
35
+ Sandboxes.Snapshots = Snapshots;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ // @ts-nocheck
3
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.Snapshots = void 0;
6
+ const resource_js_1 = require("../../core/resource.cjs");
7
+ const headers_js_1 = require("../../internal/headers.cjs");
8
+ const path_js_1 = require("../../internal/utils/path.cjs");
9
+ class Snapshots extends resource_js_1.APIResource {
10
+ /**
11
+ * Create a snapshot from a Docker image (async build).
12
+ */
13
+ create(body, options) {
14
+ return this._client.post('/v2/sandboxes/snapshots', { body, ...options });
15
+ }
16
+ /**
17
+ * Get a sandbox snapshot by ID.
18
+ */
19
+ retrieve(snapshotID, options) {
20
+ return this._client.get((0, path_js_1.path) `/v2/sandboxes/snapshots/${snapshotID}`, options);
21
+ }
22
+ /**
23
+ * List sandbox snapshots for the authenticated tenant, with optional filtering,
24
+ * sorting, and pagination.
25
+ */
26
+ list(query = {}, options) {
27
+ return this._client.get('/v2/sandboxes/snapshots', { query, ...options });
28
+ }
29
+ /**
30
+ * Delete a snapshot by ID. The underlying storage is reclaimed asynchronously.
31
+ */
32
+ delete(snapshotID, options) {
33
+ return this._client.delete((0, path_js_1.path) `/v2/sandboxes/snapshots/${snapshotID}`, {
34
+ ...options,
35
+ headers: (0, headers_js_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
36
+ });
37
+ }
38
+ }
39
+ exports.Snapshots = Snapshots;