langsmith 0.10.7 → 0.10.9
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/_openapi_client/client.cjs +26 -2
- package/dist/_openapi_client/client.d.ts +15 -6
- package/dist/_openapi_client/client.js +27 -3
- package/dist/_openapi_client/internal/detect-platform.cjs +1 -1
- package/dist/_openapi_client/internal/detect-platform.js +1 -1
- package/dist/_openapi_client/resources/annotation-queues/items.cjs +13 -6
- package/dist/_openapi_client/resources/annotation-queues/items.d.ts +33 -8
- package/dist/_openapi_client/resources/annotation-queues/items.js +13 -6
- package/dist/_openapi_client/resources/datasets/datasets.cjs +9 -0
- package/dist/_openapi_client/resources/datasets/datasets.d.ts +4 -0
- package/dist/_openapi_client/resources/datasets/datasets.js +9 -0
- package/dist/_openapi_client/resources/datasets/examples.cjs +26 -0
- package/dist/_openapi_client/resources/datasets/examples.d.ts +23 -0
- package/dist/_openapi_client/resources/datasets/examples.js +22 -0
- package/dist/_openapi_client/resources/fleet/fleet.cjs +54 -0
- package/dist/_openapi_client/resources/fleet/fleet.d.ts +9 -0
- package/dist/_openapi_client/resources/fleet/fleet.js +17 -0
- package/dist/_openapi_client/resources/fleet/threads.cjs +18 -0
- package/dist/_openapi_client/resources/fleet/threads.d.ts +19 -0
- package/dist/_openapi_client/resources/fleet/threads.js +14 -0
- package/dist/_openapi_client/resources/index.cjs +8 -2
- package/dist/_openapi_client/resources/index.d.ts +6 -3
- package/dist/_openapi_client/resources/index.js +5 -2
- package/dist/_openapi_client/resources/info.d.ts +6 -0
- package/dist/_openapi_client/resources/issues.cjs +2 -2
- package/dist/_openapi_client/resources/issues.d.ts +188 -4
- package/dist/_openapi_client/resources/issues.js +2 -2
- package/dist/_openapi_client/resources/online-evaluators.cjs +7 -4
- package/dist/_openapi_client/resources/online-evaluators.d.ts +63 -4
- package/dist/_openapi_client/resources/online-evaluators.js +7 -4
- package/dist/_openapi_client/resources/product-feedback.cjs +33 -0
- package/dist/_openapi_client/resources/product-feedback.d.ts +77 -0
- package/dist/_openapi_client/resources/product-feedback.js +29 -0
- package/dist/_openapi_client/resources/runs/runs.d.ts +26 -16
- package/dist/_openapi_client/resources/sandboxes/boxes.cjs +44 -4
- package/dist/_openapi_client/resources/sandboxes/boxes.d.ts +256 -21
- package/dist/_openapi_client/resources/sandboxes/boxes.js +44 -4
- package/dist/_openapi_client/resources/sandboxes/registries.d.ts +10 -2
- package/dist/_openapi_client/resources/sandboxes/sandboxes.cjs +13 -0
- package/dist/_openapi_client/resources/sandboxes/sandboxes.d.ts +169 -14
- package/dist/_openapi_client/resources/sandboxes/sandboxes.js +13 -0
- package/dist/_openapi_client/resources/sandboxes/snapshots.cjs +10 -6
- package/dist/_openapi_client/resources/sandboxes/snapshots.d.ts +37 -6
- package/dist/_openapi_client/resources/sandboxes/snapshots.js +10 -6
- package/dist/_openapi_client/resources/sessions.cjs +23 -0
- package/dist/_openapi_client/resources/sessions.d.ts +732 -0
- package/dist/_openapi_client/resources/sessions.js +19 -0
- package/dist/_openapi_client/resources/threads/index.cjs +9 -0
- package/dist/_openapi_client/resources/threads/index.d.ts +2 -0
- package/dist/_openapi_client/resources/threads/index.js +4 -0
- package/dist/_openapi_client/resources/threads/share.cjs +61 -0
- package/dist/_openapi_client/resources/threads/share.d.ts +71 -0
- package/dist/_openapi_client/resources/threads/share.js +57 -0
- package/dist/_openapi_client/resources/threads/threads.cjs +143 -0
- package/dist/_openapi_client/resources/threads/threads.d.ts +973 -0
- package/dist/_openapi_client/resources/threads/threads.js +106 -0
- package/dist/_openapi_client/resources/threads.cjs +15 -67
- package/dist/_openapi_client/resources/threads.d.ts +1 -709
- package/dist/_openapi_client/resources/threads.js +1 -65
- package/dist/_openapi_client/resources/traces.d.ts +7 -1
- package/dist/_openapi_client/version.cjs +1 -1
- package/dist/_openapi_client/version.js +1 -1
- package/dist/address.cjs +176 -99
- package/dist/address.d.ts +63 -8
- package/dist/address.js +170 -90
- package/dist/anonymizer/index.cjs +1 -1
- package/dist/anonymizer/index.js +1 -1
- package/dist/client.cjs +39 -19
- package/dist/client.d.ts +20 -4
- package/dist/client.js +34 -14
- package/dist/experimental/otel/exporter.cjs +21 -4
- package/dist/experimental/otel/exporter.d.ts +4 -2
- package/dist/experimental/otel/exporter.js +21 -4
- package/dist/index.cjs +5 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/run_trees.cjs +26 -43
- package/dist/run_trees.d.ts +4 -4
- package/dist/run_trees.js +23 -40
- package/dist/sandbox/client.cjs +33 -4
- package/dist/sandbox/client.d.ts +4 -0
- package/dist/sandbox/client.js +34 -5
- package/dist/sandbox/command_handle.cjs +8 -0
- package/dist/sandbox/command_handle.js +8 -0
- package/dist/sandbox/sandbox.cjs +7 -0
- package/dist/sandbox/sandbox.js +7 -0
- package/dist/sandbox/service_url.cjs +9 -1
- package/dist/sandbox/service_url.d.ts +2 -1
- package/dist/sandbox/service_url.js +9 -1
- package/dist/sandbox/tracing.cjs +13 -0
- package/dist/sandbox/tracing.d.ts +1 -0
- package/dist/sandbox/tracing.js +10 -0
- package/dist/schemas.d.ts +3 -3
- package/dist/traceable.cjs +5 -4
- package/dist/traceable.js +4 -3
- package/dist/utils/{agent_addressing.cjs → addressing.cjs} +22 -23
- package/dist/utils/{agent_addressing.d.ts → addressing.d.ts} +5 -8
- package/dist/utils/{agent_addressing.js → addressing.js} +23 -23
- package/dist/utils/env.cjs +6 -4
- package/dist/utils/env.js +6 -4
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { APIResource } from '../../core/resource.js';
|
|
|
2
2
|
import * as SandboxesAPI from './sandboxes.js';
|
|
3
3
|
import { SandboxResponsesItemsCursorGetPagination } from './sandboxes.js';
|
|
4
4
|
import { APIPromise } from '../../core/api-promise.js';
|
|
5
|
-
import { type ItemsCursorGetPaginationParams, PagePromise } from '../../core/pagination.js';
|
|
5
|
+
import { ItemsCursorGetPagination, type ItemsCursorGetPaginationParams, PagePromise } from '../../core/pagination.js';
|
|
6
6
|
import { RequestOptions } from '../../internal/request-options.js';
|
|
7
7
|
export declare class Boxes extends APIResource {
|
|
8
8
|
/**
|
|
@@ -40,26 +40,57 @@ export declare class Boxes extends APIResource {
|
|
|
40
40
|
* existing checkpoint.
|
|
41
41
|
*/
|
|
42
42
|
createSnapshot(name: string, body: BoxCreateSnapshotParams, options?: RequestOptions): APIPromise<SandboxesAPI.SnapshotResponse>;
|
|
43
|
+
/**
|
|
44
|
+
* Removes the sharing grant for one port, or for every port when port is omitted.
|
|
45
|
+
* A LangSmith login URL stops working immediately. A previously minted service
|
|
46
|
+
* token is not revoked and stays valid until it expires, but no new one can be
|
|
47
|
+
* issued from the removed grant.
|
|
48
|
+
*/
|
|
49
|
+
deleteServiceURL(name: string, params?: BoxDeleteServiceURLParams | null | undefined, options?: RequestOptions): APIPromise<void>;
|
|
43
50
|
/**
|
|
44
51
|
* Generate a tokenized link that downloads a single file from a sandbox with no
|
|
45
52
|
* further authentication. This mints a token rather than creating an addressable
|
|
46
53
|
* resource, so it returns 200 with no Location header. The token pins the sandbox,
|
|
47
|
-
* the file path,
|
|
48
|
-
* be repointed at another file
|
|
49
|
-
*
|
|
54
|
+
* the file path, the response content type and disposition, and the sandbox flags,
|
|
55
|
+
* so a link cannot be repointed at another file or served under a weaker policy.
|
|
56
|
+
* The file is always served with a Content-Security-Policy: a sandbox directive,
|
|
57
|
+
* plus a default-src holding every fetch to the file's own download host and a set
|
|
58
|
+
* of pre-approved third-party origins. csp_sandbox_flags may loosen the sandbox
|
|
59
|
+
* with allow-downloads, allow-forms, allow-modals, allow-orientation-lock,
|
|
60
|
+
* allow-pointer-lock, allow-popups, allow-presentation, allow-same-origin,
|
|
61
|
+
* allow-scripts, or allow-top-navigation-by-user-activation. Every file is served
|
|
62
|
+
* from its own host, derived from the sandbox and the path, so allow-same-origin
|
|
63
|
+
* gives a page localStorage and IndexedDB that no other file can read, and
|
|
64
|
+
* re-minting a link for the same file keeps them. csp_sandbox set to false drops
|
|
65
|
+
* the sandbox directive altogether, and csp_sandbox_flags must then be omitted.
|
|
66
|
+
* csp_source_bundles selects the third-party origins: cdnjs, google-fonts,
|
|
67
|
+
* jsdelivr, and unpkg are all allowed when the field is omitted, 'none' holds the
|
|
68
|
+
* file to its own host, and 'any' sends no default-src at all. Links never expire
|
|
69
|
+
* unless expires_in_seconds is set. The link is served from the sandbox service
|
|
70
|
+
* domain, not the API host.
|
|
50
71
|
*/
|
|
51
72
|
generateDownloadURL(name: string, body: BoxGenerateDownloadURLParams, options?: RequestOptions): APIPromise<SandboxesAPI.DownloadURLResponse>;
|
|
52
73
|
/**
|
|
53
74
|
* Create a short-lived JWT for accessing an HTTP service running on a specific
|
|
54
75
|
* port inside a sandbox. Returns a browser_url (sets auth cookie via redirect), a
|
|
55
76
|
* service_url (for use with the X-Langsmith-Sandbox-Service-Token header), the raw
|
|
56
|
-
* token, and its expiry.
|
|
77
|
+
* token, and its expiry. Set access=restricted|workspace to instead enable durable
|
|
78
|
+
* LangSmith login (no token; users authenticate with their normal LangSmith
|
|
79
|
+
* session), or access=off to disable it. LangSmith login and token access are
|
|
80
|
+
* mutually exclusive per service URL.
|
|
57
81
|
*/
|
|
58
82
|
generateServiceURL(name: string, body: BoxGenerateServiceURLParams, options?: RequestOptions): APIPromise<SandboxesAPI.ServiceURLResponse>;
|
|
59
83
|
/**
|
|
60
84
|
* Retrieve the lightweight status of a sandbox for polling.
|
|
61
85
|
*/
|
|
62
86
|
getStatus(name: string, options?: RequestOptions): APIPromise<SandboxesAPI.SandboxStatusResponse>;
|
|
87
|
+
/**
|
|
88
|
+
* Returns one entry per port the sandbox is currently reachable on, so a caller
|
|
89
|
+
* can see what is shared before turning it off. Expired token grants are omitted.
|
|
90
|
+
* Cursors are opaque and only valid on this endpoint; do not parse or construct
|
|
91
|
+
* one.
|
|
92
|
+
*/
|
|
93
|
+
listServiceURLs(name: string, query?: BoxListServiceURLsParams | null | undefined, options?: RequestOptions): PagePromise<BoxListServiceURLsResponsesItemsCursorGetPagination, BoxListServiceURLsResponse>;
|
|
63
94
|
/**
|
|
64
95
|
* Start a stopped or failed sandbox. This endpoint is not idempotent.
|
|
65
96
|
*/
|
|
@@ -70,7 +101,30 @@ export declare class Boxes extends APIResource {
|
|
|
70
101
|
*/
|
|
71
102
|
stop(name: string, options?: RequestOptions): APIPromise<void>;
|
|
72
103
|
}
|
|
104
|
+
export type BoxListServiceURLsResponsesItemsCursorGetPagination = ItemsCursorGetPagination<BoxListServiceURLsResponse>;
|
|
105
|
+
export interface BoxListServiceURLsResponse {
|
|
106
|
+
/**
|
|
107
|
+
* How the port is shared: "token" for a minted service token, or
|
|
108
|
+
* "restricted"/"workspace" for LangSmith login.
|
|
109
|
+
*/
|
|
110
|
+
access: 'token' | 'restricted' | 'workspace';
|
|
111
|
+
created_at: string;
|
|
112
|
+
port: number;
|
|
113
|
+
/**
|
|
114
|
+
* The LangSmith user who first shared this port, when known.
|
|
115
|
+
*/
|
|
116
|
+
created_by?: string;
|
|
117
|
+
/**
|
|
118
|
+
* When the share expires. Set only for "token"; a login grant does not expire.
|
|
119
|
+
*/
|
|
120
|
+
expires_at?: string;
|
|
121
|
+
}
|
|
73
122
|
export interface BoxCreateParams {
|
|
123
|
+
/**
|
|
124
|
+
* AccessDelegation lets code inside the sandbox call the LangSmith API as you,
|
|
125
|
+
* with at most the permissions granted here. Omit for no access.
|
|
126
|
+
*/
|
|
127
|
+
access_delegation?: BoxCreateParams.AccessDelegation;
|
|
74
128
|
/**
|
|
75
129
|
* CPUMillicores optionally requests CPU at millicore granularity (e.g. 500 = 0.5
|
|
76
130
|
* vCPU); takes precedence over VCPUs. Fractional (sub-vCPU) values are not
|
|
@@ -118,6 +172,12 @@ export interface BoxCreateParams {
|
|
|
118
172
|
* Applies to this request only.
|
|
119
173
|
*/
|
|
120
174
|
restore_memory?: boolean;
|
|
175
|
+
/**
|
|
176
|
+
* RunConfig overrides the snapshot's run config for this sandbox: user and
|
|
177
|
+
* work_dir replace the snapshot's, env_vars merge over it. The result is what the
|
|
178
|
+
* sandbox boots with, and what a snapshot captured from it carries.
|
|
179
|
+
*/
|
|
180
|
+
run_config?: BoxCreateParams.RunConfig;
|
|
121
181
|
/**
|
|
122
182
|
* Snapshot is a Docker-style name or name:tag reference to boot from. A bare name
|
|
123
183
|
* resolves to name:latest.
|
|
@@ -133,21 +193,41 @@ export interface BoxCreateParams {
|
|
|
133
193
|
vcpus?: number;
|
|
134
194
|
}
|
|
135
195
|
export declare namespace BoxCreateParams {
|
|
196
|
+
/**
|
|
197
|
+
* AccessDelegation lets code inside the sandbox call the LangSmith API as you,
|
|
198
|
+
* with at most the permissions granted here. Omit for no access.
|
|
199
|
+
*/
|
|
200
|
+
interface AccessDelegation {
|
|
201
|
+
mode: 'INHERIT' | 'EXPLICIT';
|
|
202
|
+
permissions?: Array<string>;
|
|
203
|
+
}
|
|
136
204
|
interface MountConfig {
|
|
137
205
|
auth?: MountConfig.Auth;
|
|
138
206
|
mounts?: Array<MountConfig.SandboxapiS3BucketMountSpec | MountConfig.SandboxapiGcsBucketMountSpec | MountConfig.SandboxapiGitRepoMountSpec | MountConfig.SandboxapiContextHubRepoMountSpec>;
|
|
139
207
|
}
|
|
140
208
|
namespace MountConfig {
|
|
141
209
|
interface Auth {
|
|
142
|
-
aws?: Auth.
|
|
210
|
+
aws?: Auth.SandboxesSandboxAwsMountRoleAuthConfig | Auth.SandboxesSandboxAwsMountStaticAuthConfig;
|
|
143
211
|
gcp?: Auth.Gcp;
|
|
144
212
|
}
|
|
145
213
|
namespace Auth {
|
|
146
|
-
interface
|
|
147
|
-
|
|
148
|
-
|
|
214
|
+
interface SandboxesSandboxAwsMountRoleAuthConfig {
|
|
215
|
+
/**
|
|
216
|
+
* IAM role to assume with permissions scoped to the configured S3 mounts. Mutually
|
|
217
|
+
* exclusive with static credentials. Configure only at creation.
|
|
218
|
+
*/
|
|
219
|
+
role_arn: string;
|
|
149
220
|
}
|
|
150
|
-
|
|
221
|
+
interface SandboxesSandboxAwsMountStaticAuthConfig {
|
|
222
|
+
access_key_id: SandboxesSandboxAwsMountStaticAuthConfig.AccessKeyID;
|
|
223
|
+
secret_access_key: SandboxesSandboxAwsMountStaticAuthConfig.SecretAccessKey;
|
|
224
|
+
/**
|
|
225
|
+
* IAM role to assume with permissions scoped to the configured S3 mounts. Mutually
|
|
226
|
+
* exclusive with static credentials. Configure only at creation.
|
|
227
|
+
*/
|
|
228
|
+
role_arn?: '';
|
|
229
|
+
}
|
|
230
|
+
namespace SandboxesSandboxAwsMountStaticAuthConfig {
|
|
151
231
|
interface AccessKeyID {
|
|
152
232
|
type: 'plaintext' | 'opaque' | 'workspace_secret';
|
|
153
233
|
is_set?: boolean;
|
|
@@ -382,6 +462,11 @@ export declare namespace BoxCreateParams {
|
|
|
382
462
|
interface ProxyConfig {
|
|
383
463
|
access_control?: ProxyConfig.AccessControl;
|
|
384
464
|
callbacks?: Array<ProxyConfig.Callback>;
|
|
465
|
+
/**
|
|
466
|
+
* Description says what this configuration as a whole lets the sandbox reach,
|
|
467
|
+
* complementing the per-rule descriptions. At most 1024 characters.
|
|
468
|
+
*/
|
|
469
|
+
description?: string;
|
|
385
470
|
no_proxy?: Array<string>;
|
|
386
471
|
rules?: Array<ProxyConfig.Rule>;
|
|
387
472
|
}
|
|
@@ -407,7 +492,12 @@ export declare namespace BoxCreateParams {
|
|
|
407
492
|
}
|
|
408
493
|
interface Rule {
|
|
409
494
|
name: string;
|
|
410
|
-
aws?: Rule.
|
|
495
|
+
aws?: Rule.SandboxesProxyAwsRoleConfig | Rule.SandboxesProxyAwsStaticConfig;
|
|
496
|
+
/**
|
|
497
|
+
* Description says what this rule lets the sandbox reach, so an agent driving the
|
|
498
|
+
* sandbox can be told its capabilities. At most 1024 characters.
|
|
499
|
+
*/
|
|
500
|
+
description?: string;
|
|
411
501
|
enabled?: boolean;
|
|
412
502
|
/**
|
|
413
503
|
* EnvVars are plaintext env vars set for every command in the sandbox while this
|
|
@@ -422,6 +512,14 @@ export declare namespace BoxCreateParams {
|
|
|
422
512
|
};
|
|
423
513
|
gcp?: Rule.Gcp;
|
|
424
514
|
headers?: Array<Rule.Header>;
|
|
515
|
+
/**
|
|
516
|
+
* MatchHeaders restricts a header injection rule to requests carrying every listed
|
|
517
|
+
* header, each written "name: value" with a lowercase name and an exact value.
|
|
518
|
+
* Pair with headers of the same name to swap a placeholder the sandbox sends (e.g.
|
|
519
|
+
* "authorization: Bearer account-b") for a real credential, so one host can serve
|
|
520
|
+
* several accounts. Rules are evaluated in order and the first match wins.
|
|
521
|
+
*/
|
|
522
|
+
match_headers?: Array<string>;
|
|
425
523
|
/**
|
|
426
524
|
* MatchHosts is only accepted for header injection rules. Provider auth rules use
|
|
427
525
|
* built-in host matching.
|
|
@@ -431,11 +529,25 @@ export declare namespace BoxCreateParams {
|
|
|
431
529
|
type?: string;
|
|
432
530
|
}
|
|
433
531
|
namespace Rule {
|
|
434
|
-
interface
|
|
435
|
-
|
|
436
|
-
|
|
532
|
+
interface SandboxesProxyAwsRoleConfig {
|
|
533
|
+
/**
|
|
534
|
+
* RoleARN selects automatically renewed IAM-role credentials instead of static
|
|
535
|
+
* keys. Access follows the role's effective AWS permissions, not the sandbox's
|
|
536
|
+
* mount scope. Configure at creation; the role cannot be changed afterward.
|
|
537
|
+
*/
|
|
538
|
+
role_arn: string;
|
|
437
539
|
}
|
|
438
|
-
|
|
540
|
+
interface SandboxesProxyAwsStaticConfig {
|
|
541
|
+
access_key_id: SandboxesProxyAwsStaticConfig.AccessKeyID;
|
|
542
|
+
secret_access_key: SandboxesProxyAwsStaticConfig.SecretAccessKey;
|
|
543
|
+
/**
|
|
544
|
+
* RoleARN selects automatically renewed IAM-role credentials instead of static
|
|
545
|
+
* keys. Access follows the role's effective AWS permissions, not the sandbox's
|
|
546
|
+
* mount scope. Configure at creation; the role cannot be changed afterward.
|
|
547
|
+
*/
|
|
548
|
+
role_arn?: '';
|
|
549
|
+
}
|
|
550
|
+
namespace SandboxesProxyAwsStaticConfig {
|
|
439
551
|
interface AccessKeyID {
|
|
440
552
|
type: 'plaintext' | 'opaque' | 'workspace_secret';
|
|
441
553
|
is_set?: boolean;
|
|
@@ -466,6 +578,18 @@ export declare namespace BoxCreateParams {
|
|
|
466
578
|
}
|
|
467
579
|
}
|
|
468
580
|
}
|
|
581
|
+
/**
|
|
582
|
+
* RunConfig overrides the snapshot's run config for this sandbox: user and
|
|
583
|
+
* work_dir replace the snapshot's, env_vars merge over it. The result is what the
|
|
584
|
+
* sandbox boots with, and what a snapshot captured from it carries.
|
|
585
|
+
*/
|
|
586
|
+
interface RunConfig {
|
|
587
|
+
env_vars?: {
|
|
588
|
+
[key: string]: string;
|
|
589
|
+
};
|
|
590
|
+
user?: string;
|
|
591
|
+
work_dir?: string;
|
|
592
|
+
}
|
|
469
593
|
}
|
|
470
594
|
export interface BoxUpdateParams {
|
|
471
595
|
cpu_millicores?: number;
|
|
@@ -479,6 +603,12 @@ export interface BoxUpdateParams {
|
|
|
479
603
|
mem_bytes?: number;
|
|
480
604
|
name?: string;
|
|
481
605
|
proxy_config?: BoxUpdateParams.ProxyConfig;
|
|
606
|
+
/**
|
|
607
|
+
* RunConfig changes what subsequent commands run with: user and work_dir replace
|
|
608
|
+
* the current values, env_vars merge over them. Commands already running are
|
|
609
|
+
* unaffected.
|
|
610
|
+
*/
|
|
611
|
+
run_config?: BoxUpdateParams.RunConfig;
|
|
482
612
|
tag_value_ids?: Array<string>;
|
|
483
613
|
vcpus?: number;
|
|
484
614
|
}
|
|
@@ -486,6 +616,11 @@ export declare namespace BoxUpdateParams {
|
|
|
486
616
|
interface ProxyConfig {
|
|
487
617
|
access_control?: ProxyConfig.AccessControl;
|
|
488
618
|
callbacks?: Array<ProxyConfig.Callback>;
|
|
619
|
+
/**
|
|
620
|
+
* Description says what this configuration as a whole lets the sandbox reach,
|
|
621
|
+
* complementing the per-rule descriptions. At most 1024 characters.
|
|
622
|
+
*/
|
|
623
|
+
description?: string;
|
|
489
624
|
no_proxy?: Array<string>;
|
|
490
625
|
rules?: Array<ProxyConfig.Rule>;
|
|
491
626
|
}
|
|
@@ -511,7 +646,12 @@ export declare namespace BoxUpdateParams {
|
|
|
511
646
|
}
|
|
512
647
|
interface Rule {
|
|
513
648
|
name: string;
|
|
514
|
-
aws?: Rule.
|
|
649
|
+
aws?: Rule.SandboxesProxyAwsRoleConfig | Rule.SandboxesProxyAwsStaticConfig;
|
|
650
|
+
/**
|
|
651
|
+
* Description says what this rule lets the sandbox reach, so an agent driving the
|
|
652
|
+
* sandbox can be told its capabilities. At most 1024 characters.
|
|
653
|
+
*/
|
|
654
|
+
description?: string;
|
|
515
655
|
enabled?: boolean;
|
|
516
656
|
/**
|
|
517
657
|
* EnvVars are plaintext env vars set for every command in the sandbox while this
|
|
@@ -526,6 +666,14 @@ export declare namespace BoxUpdateParams {
|
|
|
526
666
|
};
|
|
527
667
|
gcp?: Rule.Gcp;
|
|
528
668
|
headers?: Array<Rule.Header>;
|
|
669
|
+
/**
|
|
670
|
+
* MatchHeaders restricts a header injection rule to requests carrying every listed
|
|
671
|
+
* header, each written "name: value" with a lowercase name and an exact value.
|
|
672
|
+
* Pair with headers of the same name to swap a placeholder the sandbox sends (e.g.
|
|
673
|
+
* "authorization: Bearer account-b") for a real credential, so one host can serve
|
|
674
|
+
* several accounts. Rules are evaluated in order and the first match wins.
|
|
675
|
+
*/
|
|
676
|
+
match_headers?: Array<string>;
|
|
529
677
|
/**
|
|
530
678
|
* MatchHosts is only accepted for header injection rules. Provider auth rules use
|
|
531
679
|
* built-in host matching.
|
|
@@ -535,11 +683,25 @@ export declare namespace BoxUpdateParams {
|
|
|
535
683
|
type?: string;
|
|
536
684
|
}
|
|
537
685
|
namespace Rule {
|
|
538
|
-
interface
|
|
539
|
-
|
|
540
|
-
|
|
686
|
+
interface SandboxesProxyAwsRoleConfig {
|
|
687
|
+
/**
|
|
688
|
+
* RoleARN selects automatically renewed IAM-role credentials instead of static
|
|
689
|
+
* keys. Access follows the role's effective AWS permissions, not the sandbox's
|
|
690
|
+
* mount scope. Configure at creation; the role cannot be changed afterward.
|
|
691
|
+
*/
|
|
692
|
+
role_arn: string;
|
|
693
|
+
}
|
|
694
|
+
interface SandboxesProxyAwsStaticConfig {
|
|
695
|
+
access_key_id: SandboxesProxyAwsStaticConfig.AccessKeyID;
|
|
696
|
+
secret_access_key: SandboxesProxyAwsStaticConfig.SecretAccessKey;
|
|
697
|
+
/**
|
|
698
|
+
* RoleARN selects automatically renewed IAM-role credentials instead of static
|
|
699
|
+
* keys. Access follows the role's effective AWS permissions, not the sandbox's
|
|
700
|
+
* mount scope. Configure at creation; the role cannot be changed afterward.
|
|
701
|
+
*/
|
|
702
|
+
role_arn?: '';
|
|
541
703
|
}
|
|
542
|
-
namespace
|
|
704
|
+
namespace SandboxesProxyAwsStaticConfig {
|
|
543
705
|
interface AccessKeyID {
|
|
544
706
|
type: 'plaintext' | 'opaque' | 'workspace_secret';
|
|
545
707
|
is_set?: boolean;
|
|
@@ -570,6 +732,18 @@ export declare namespace BoxUpdateParams {
|
|
|
570
732
|
}
|
|
571
733
|
}
|
|
572
734
|
}
|
|
735
|
+
/**
|
|
736
|
+
* RunConfig changes what subsequent commands run with: user and work_dir replace
|
|
737
|
+
* the current values, env_vars merge over them. Commands already running are
|
|
738
|
+
* unaffected.
|
|
739
|
+
*/
|
|
740
|
+
interface RunConfig {
|
|
741
|
+
env_vars?: {
|
|
742
|
+
[key: string]: string;
|
|
743
|
+
};
|
|
744
|
+
user?: string;
|
|
745
|
+
work_dir?: string;
|
|
746
|
+
}
|
|
573
747
|
}
|
|
574
748
|
export interface BoxListParams extends ItemsCursorGetPaginationParams {
|
|
575
749
|
/**
|
|
@@ -610,6 +784,10 @@ export interface BoxListParams extends ItemsCursorGetPaginationParams {
|
|
|
610
784
|
* Filter by status (provisioning, ready, failed, stopped, deleting)
|
|
611
785
|
*/
|
|
612
786
|
status?: string;
|
|
787
|
+
/**
|
|
788
|
+
* Filter by workspace resource tag value IDs; all must match
|
|
789
|
+
*/
|
|
790
|
+
tag_value_id?: Array<string>;
|
|
613
791
|
}
|
|
614
792
|
export interface BoxCreateSnapshotParams {
|
|
615
793
|
name: string;
|
|
@@ -617,6 +795,11 @@ export interface BoxCreateSnapshotParams {
|
|
|
617
795
|
* if omitted, creates a fresh checkpoint from the running VM
|
|
618
796
|
*/
|
|
619
797
|
checkpoint?: string;
|
|
798
|
+
/**
|
|
799
|
+
* Description says what this snapshot's image can do, so a caller can hand it to
|
|
800
|
+
* an agent as a capability summary. At most 1024 characters.
|
|
801
|
+
*/
|
|
802
|
+
description?: string;
|
|
620
803
|
/**
|
|
621
804
|
* sandbox-local Docker image to export
|
|
622
805
|
*/
|
|
@@ -638,25 +821,77 @@ export interface BoxCreateSnapshotParams {
|
|
|
638
821
|
labels?: {
|
|
639
822
|
[key: string]: string;
|
|
640
823
|
};
|
|
824
|
+
/**
|
|
825
|
+
* RunConfig overrides the runtime configuration the snapshot carries: for a
|
|
826
|
+
* docker_image export, the image's USER, WORKDIR and ENV; for a capture of the
|
|
827
|
+
* running VM, the sandbox's own. user and work_dir replace, env_vars merge.
|
|
828
|
+
*/
|
|
829
|
+
run_config?: BoxCreateSnapshotParams.RunConfig;
|
|
641
830
|
/**
|
|
642
831
|
* mutable Docker-style tag; defaults to "latest"
|
|
643
832
|
*/
|
|
644
833
|
tag?: string;
|
|
645
834
|
}
|
|
835
|
+
export declare namespace BoxCreateSnapshotParams {
|
|
836
|
+
/**
|
|
837
|
+
* RunConfig overrides the runtime configuration the snapshot carries: for a
|
|
838
|
+
* docker_image export, the image's USER, WORKDIR and ENV; for a capture of the
|
|
839
|
+
* running VM, the sandbox's own. user and work_dir replace, env_vars merge.
|
|
840
|
+
*/
|
|
841
|
+
interface RunConfig {
|
|
842
|
+
env_vars?: {
|
|
843
|
+
[key: string]: string;
|
|
844
|
+
};
|
|
845
|
+
user?: string;
|
|
846
|
+
work_dir?: string;
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
export interface BoxDeleteServiceURLParams {
|
|
850
|
+
/**
|
|
851
|
+
* Port to stop sharing. Omit to stop sharing every port.
|
|
852
|
+
*/
|
|
853
|
+
port?: number;
|
|
854
|
+
}
|
|
646
855
|
export interface BoxGenerateDownloadURLParams {
|
|
647
856
|
path: string;
|
|
648
857
|
content_disposition?: string;
|
|
649
858
|
content_type?: string;
|
|
859
|
+
/**
|
|
860
|
+
* CSPSandbox false serves the file with no CSP sandbox directive; omit to keep it.
|
|
861
|
+
*/
|
|
862
|
+
csp_sandbox?: boolean;
|
|
863
|
+
/**
|
|
864
|
+
* CSPSandboxFlags loosen the CSP sandbox the file is served under; omit for the
|
|
865
|
+
* most restrictive policy.
|
|
866
|
+
*/
|
|
867
|
+
csp_sandbox_flags?: Array<'allow-downloads' | 'allow-forms' | 'allow-modals' | 'allow-orientation-lock' | 'allow-pointer-lock' | 'allow-popups' | 'allow-presentation' | 'allow-scripts' | 'allow-top-navigation-by-user-activation' | 'allow-same-origin'>;
|
|
868
|
+
/**
|
|
869
|
+
* CSPSourceBundles allow the served file to fetch from named third-party origins;
|
|
870
|
+
* omit to send no fetch directive.
|
|
871
|
+
*/
|
|
872
|
+
csp_source_bundles?: Array<'cdnjs' | 'google-fonts' | 'jsdelivr' | 'unpkg' | 'none' | 'any'>;
|
|
650
873
|
/**
|
|
651
874
|
* ExpiresInSeconds is optional; a link with no expiry never expires.
|
|
652
875
|
*/
|
|
653
876
|
expires_in_seconds?: number;
|
|
654
877
|
}
|
|
655
878
|
export interface BoxGenerateServiceURLParams {
|
|
879
|
+
/**
|
|
880
|
+
* Access selects the login mode, mutually exclusive with the minted token. Omit
|
|
881
|
+
* the field for token mode: mint a short-lived service token (default).
|
|
882
|
+
* "restricted" — LangSmith login: the sandbox's creator, or any user with
|
|
883
|
+
* SandboxesExec on it (admins by default). "workspace" — LangSmith login: any
|
|
884
|
+
* member of the owning workspace. "off" — remove an existing LangSmith login grant
|
|
885
|
+
* and mint a token. A LangSmith login grant is durable; token mode is refused
|
|
886
|
+
* (409) while one exists.
|
|
887
|
+
*/
|
|
888
|
+
access?: 'restricted' | 'workspace' | 'off';
|
|
656
889
|
expires_in_seconds?: number;
|
|
657
890
|
port?: number;
|
|
658
891
|
}
|
|
892
|
+
export interface BoxListServiceURLsParams extends ItemsCursorGetPaginationParams {
|
|
893
|
+
}
|
|
659
894
|
export declare namespace Boxes {
|
|
660
|
-
export { type BoxCreateParams as BoxCreateParams, type BoxUpdateParams as BoxUpdateParams, type BoxListParams as BoxListParams, type BoxCreateSnapshotParams as BoxCreateSnapshotParams, type BoxGenerateDownloadURLParams as BoxGenerateDownloadURLParams, type BoxGenerateServiceURLParams as BoxGenerateServiceURLParams, };
|
|
895
|
+
export { type BoxListServiceURLsResponse as BoxListServiceURLsResponse, type BoxListServiceURLsResponsesItemsCursorGetPagination as BoxListServiceURLsResponsesItemsCursorGetPagination, type BoxCreateParams as BoxCreateParams, type BoxUpdateParams as BoxUpdateParams, type BoxListParams as BoxListParams, type BoxCreateSnapshotParams as BoxCreateSnapshotParams, type BoxDeleteServiceURLParams as BoxDeleteServiceURLParams, type BoxGenerateDownloadURLParams as BoxGenerateDownloadURLParams, type BoxGenerateServiceURLParams as BoxGenerateServiceURLParams, type BoxListServiceURLsParams as BoxListServiceURLsParams, };
|
|
661
896
|
}
|
|
662
897
|
export { type SandboxResponsesItemsCursorGetPagination };
|
|
@@ -55,13 +55,41 @@ export class Boxes extends APIResource {
|
|
|
55
55
|
createSnapshot(name, body, options) {
|
|
56
56
|
return this._client.post(path `/api/v2/sandboxes/boxes/${name}/snapshot`, { body, ...options });
|
|
57
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Removes the sharing grant for one port, or for every port when port is omitted.
|
|
60
|
+
* A LangSmith login URL stops working immediately. A previously minted service
|
|
61
|
+
* token is not revoked and stays valid until it expires, but no new one can be
|
|
62
|
+
* issued from the removed grant.
|
|
63
|
+
*/
|
|
64
|
+
deleteServiceURL(name, params = {}, options) {
|
|
65
|
+
const { port } = params ?? {};
|
|
66
|
+
return this._client.delete(path `/api/v2/sandboxes/boxes/${name}/service-urls`, {
|
|
67
|
+
query: { port },
|
|
68
|
+
...options,
|
|
69
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
70
|
+
});
|
|
71
|
+
}
|
|
58
72
|
/**
|
|
59
73
|
* Generate a tokenized link that downloads a single file from a sandbox with no
|
|
60
74
|
* further authentication. This mints a token rather than creating an addressable
|
|
61
75
|
* resource, so it returns 200 with no Location header. The token pins the sandbox,
|
|
62
|
-
* the file path,
|
|
63
|
-
* be repointed at another file
|
|
64
|
-
*
|
|
76
|
+
* the file path, the response content type and disposition, and the sandbox flags,
|
|
77
|
+
* so a link cannot be repointed at another file or served under a weaker policy.
|
|
78
|
+
* The file is always served with a Content-Security-Policy: a sandbox directive,
|
|
79
|
+
* plus a default-src holding every fetch to the file's own download host and a set
|
|
80
|
+
* of pre-approved third-party origins. csp_sandbox_flags may loosen the sandbox
|
|
81
|
+
* with allow-downloads, allow-forms, allow-modals, allow-orientation-lock,
|
|
82
|
+
* allow-pointer-lock, allow-popups, allow-presentation, allow-same-origin,
|
|
83
|
+
* allow-scripts, or allow-top-navigation-by-user-activation. Every file is served
|
|
84
|
+
* from its own host, derived from the sandbox and the path, so allow-same-origin
|
|
85
|
+
* gives a page localStorage and IndexedDB that no other file can read, and
|
|
86
|
+
* re-minting a link for the same file keeps them. csp_sandbox set to false drops
|
|
87
|
+
* the sandbox directive altogether, and csp_sandbox_flags must then be omitted.
|
|
88
|
+
* csp_source_bundles selects the third-party origins: cdnjs, google-fonts,
|
|
89
|
+
* jsdelivr, and unpkg are all allowed when the field is omitted, 'none' holds the
|
|
90
|
+
* file to its own host, and 'any' sends no default-src at all. Links never expire
|
|
91
|
+
* unless expires_in_seconds is set. The link is served from the sandbox service
|
|
92
|
+
* domain, not the API host.
|
|
65
93
|
*/
|
|
66
94
|
generateDownloadURL(name, body, options) {
|
|
67
95
|
return this._client.post(path `/api/v2/sandboxes/boxes/${name}/download-url`, { body, ...options });
|
|
@@ -70,7 +98,10 @@ export class Boxes extends APIResource {
|
|
|
70
98
|
* Create a short-lived JWT for accessing an HTTP service running on a specific
|
|
71
99
|
* port inside a sandbox. Returns a browser_url (sets auth cookie via redirect), a
|
|
72
100
|
* service_url (for use with the X-Langsmith-Sandbox-Service-Token header), the raw
|
|
73
|
-
* token, and its expiry.
|
|
101
|
+
* token, and its expiry. Set access=restricted|workspace to instead enable durable
|
|
102
|
+
* LangSmith login (no token; users authenticate with their normal LangSmith
|
|
103
|
+
* session), or access=off to disable it. LangSmith login and token access are
|
|
104
|
+
* mutually exclusive per service URL.
|
|
74
105
|
*/
|
|
75
106
|
generateServiceURL(name, body, options) {
|
|
76
107
|
return this._client.post(path `/api/v2/sandboxes/boxes/${name}/service-url`, { body, ...options });
|
|
@@ -81,6 +112,15 @@ export class Boxes extends APIResource {
|
|
|
81
112
|
getStatus(name, options) {
|
|
82
113
|
return this._client.get(path `/api/v2/sandboxes/boxes/${name}/status`, options);
|
|
83
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* Returns one entry per port the sandbox is currently reachable on, so a caller
|
|
117
|
+
* can see what is shared before turning it off. Expired token grants are omitted.
|
|
118
|
+
* Cursors are opaque and only valid on this endpoint; do not parse or construct
|
|
119
|
+
* one.
|
|
120
|
+
*/
|
|
121
|
+
listServiceURLs(name, query = {}, options) {
|
|
122
|
+
return this._client.getAPIList(path `/api/v2/sandboxes/boxes/${name}/service-urls`, (ItemsCursorGetPagination), { query, ...options });
|
|
123
|
+
}
|
|
84
124
|
/**
|
|
85
125
|
* Start a stopped or failed sandbox. This endpoint is not idempotent.
|
|
86
126
|
*/
|
|
@@ -29,20 +29,28 @@ export interface RegistryListResponse {
|
|
|
29
29
|
}
|
|
30
30
|
export interface RegistryResponse {
|
|
31
31
|
id?: string;
|
|
32
|
+
auth_type?: 'DOCKER_CONFIG' | 'AWS_ROLE';
|
|
33
|
+
aws_role_arn?: string;
|
|
32
34
|
created_at?: string;
|
|
33
35
|
created_by?: string;
|
|
34
36
|
name?: string;
|
|
37
|
+
provider?: 'DOCKER_REGISTRY' | 'HARBOR' | 'GHCR' | 'ECR' | 'GAR' | 'DOCKER_HUB';
|
|
38
|
+
repository_search_mode?: 'GLOBAL' | 'SCOPED' | 'NONE';
|
|
35
39
|
updated_at?: string;
|
|
36
40
|
updated_by?: string;
|
|
37
41
|
url?: string;
|
|
38
42
|
}
|
|
39
43
|
export interface RegistryCreateParams {
|
|
40
44
|
name: string;
|
|
41
|
-
password: string;
|
|
42
45
|
url: string;
|
|
43
|
-
|
|
46
|
+
auth_type?: 'DOCKER_CONFIG' | 'AWS_ROLE';
|
|
47
|
+
aws_role_arn?: string;
|
|
48
|
+
password?: string;
|
|
49
|
+
username?: string;
|
|
44
50
|
}
|
|
45
51
|
export interface RegistryUpdateParams {
|
|
52
|
+
auth_type?: 'DOCKER_CONFIG' | 'AWS_ROLE';
|
|
53
|
+
aws_role_arn?: string;
|
|
46
54
|
name?: string;
|
|
47
55
|
password?: string;
|
|
48
56
|
url?: string;
|
|
@@ -43,6 +43,7 @@ const RegistriesAPI = __importStar(require("./registries.cjs"));
|
|
|
43
43
|
const registries_js_1 = require("./registries.cjs");
|
|
44
44
|
const SnapshotsAPI = __importStar(require("./snapshots.cjs"));
|
|
45
45
|
const snapshots_js_1 = require("./snapshots.cjs");
|
|
46
|
+
const pagination_js_1 = require("../../core/pagination.cjs");
|
|
46
47
|
class Sandboxes extends resource_js_1.APIResource {
|
|
47
48
|
constructor() {
|
|
48
49
|
super(...arguments);
|
|
@@ -65,6 +66,18 @@ class Sandboxes extends resource_js_1.APIResource {
|
|
|
65
66
|
value: new SnapshotsAPI.Snapshots(this._client)
|
|
66
67
|
});
|
|
67
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Returns priced usage per sandbox or snapshot and UTC hour in the half-open
|
|
71
|
+
* requested interval. LCU uses the recorded compute amount for sandboxes;
|
|
72
|
+
* snapshots have zero LCU. LSU allocates the recorded workspace storage amount
|
|
73
|
+
* proportionally to attributed bytes, including checkpoints on their sandbox and
|
|
74
|
+
* snapshots as separate resources. Resource filters preserve each resource's
|
|
75
|
+
* share. Rate changes do not reprice recorded amounts. An access-filtered page can
|
|
76
|
+
* have no items and a non-null next_cursor; continue until next_cursor is null.
|
|
77
|
+
*/
|
|
78
|
+
listUsageCosts(query, options) {
|
|
79
|
+
return this._client.getAPIList('/api/v2/sandboxes/usage/costs', (pagination_js_1.ItemsCursorGetPagination), { query, ...options });
|
|
80
|
+
}
|
|
68
81
|
}
|
|
69
82
|
exports.Sandboxes = Sandboxes;
|
|
70
83
|
Sandboxes.Boxes = boxes_js_1.Boxes;
|