langsmith 0.10.11 → 0.10.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.
- package/CHANGELOG.md +28 -0
- package/README.md +198 -198
- package/lib/address.d.mts +35 -56
- package/lib/address.d.mts.map +1 -1
- package/lib/address.d.ts +35 -56
- package/lib/address.d.ts.map +1 -1
- package/lib/address.js +91 -156
- package/lib/address.js.map +1 -1
- package/lib/address.mjs +83 -151
- package/lib/address.mjs.map +1 -1
- package/lib/client.d.mts +1 -1
- package/lib/client.d.mts.map +1 -1
- package/lib/client.d.ts +1 -1
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +11 -10
- package/lib/client.js.map +1 -1
- package/lib/client.mjs +4 -3
- package/lib/client.mjs.map +1 -1
- package/lib/run_trees.d.mts +1 -1
- package/lib/run_trees.d.mts.map +1 -1
- package/lib/run_trees.d.ts +1 -1
- package/lib/run_trees.d.ts.map +1 -1
- package/lib/run_trees.js +11 -9
- package/lib/run_trees.js.map +1 -1
- package/lib/run_trees.mjs +7 -5
- package/lib/run_trees.mjs.map +1 -1
- package/lib/sandbox/index.d.mts +1 -1
- package/lib/sandbox/index.d.mts.map +1 -1
- package/lib/sandbox/index.d.ts +1 -1
- package/lib/sandbox/index.d.ts.map +1 -1
- package/lib/sandbox/index.js.map +1 -1
- package/lib/sandbox/index.mjs.map +1 -1
- package/lib/sandbox/mounts.d.mts +3 -2
- package/lib/sandbox/mounts.d.mts.map +1 -1
- package/lib/sandbox/mounts.d.ts +3 -2
- package/lib/sandbox/mounts.d.ts.map +1 -1
- package/lib/sandbox/mounts.js +6 -1
- package/lib/sandbox/mounts.js.map +1 -1
- package/lib/sandbox/mounts.mjs +6 -1
- package/lib/sandbox/mounts.mjs.map +1 -1
- package/lib/sandbox/types.d.mts +7 -0
- package/lib/sandbox/types.d.mts.map +1 -1
- package/lib/sandbox/types.d.ts +7 -0
- package/lib/sandbox/types.d.ts.map +1 -1
- package/lib/sandbox/verify.d.mts.map +1 -1
- package/lib/sandbox/verify.d.ts.map +1 -1
- package/lib/sandbox/verify.js +81 -19
- package/lib/sandbox/verify.js.map +1 -1
- package/lib/sandbox/verify.mjs +81 -19
- package/lib/sandbox/verify.mjs.map +1 -1
- package/lib/utils/addressing.d.mts +1 -1
- package/lib/utils/addressing.d.mts.map +1 -1
- package/lib/utils/addressing.d.ts +1 -1
- package/lib/utils/addressing.d.ts.map +1 -1
- package/lib/utils/addressing.js +4 -4
- package/lib/utils/addressing.js.map +1 -1
- package/lib/utils/addressing.mjs +5 -5
- package/lib/utils/addressing.mjs.map +1 -1
- package/package.json +22 -10
- package/resources/annotation-queues/annotation-queues.d.mts +33 -2
- package/resources/annotation-queues/annotation-queues.d.mts.map +1 -1
- package/resources/annotation-queues/annotation-queues.d.ts +33 -2
- package/resources/annotation-queues/annotation-queues.d.ts.map +1 -1
- package/resources/annotation-queues/annotation-queues.js.map +1 -1
- package/resources/annotation-queues/annotation-queues.mjs.map +1 -1
- package/resources/runs/runs.d.mts +14 -1
- package/resources/runs/runs.d.mts.map +1 -1
- package/resources/runs/runs.d.ts +14 -1
- package/resources/runs/runs.d.ts.map +1 -1
- package/resources/runs/runs.js +4 -0
- package/resources/runs/runs.js.map +1 -1
- package/resources/runs/runs.mjs +4 -0
- package/resources/runs/runs.mjs.map +1 -1
- package/resources/sandboxes/boxes.d.mts +32 -0
- package/resources/sandboxes/boxes.d.mts.map +1 -1
- package/resources/sandboxes/boxes.d.ts +32 -0
- package/resources/sandboxes/boxes.d.ts.map +1 -1
- package/resources/sandboxes/sandboxes.d.mts +32 -0
- package/resources/sandboxes/sandboxes.d.mts.map +1 -1
- package/resources/sandboxes/sandboxes.d.ts +32 -0
- package/resources/sandboxes/sandboxes.d.ts.map +1 -1
- package/resources/sandboxes/sandboxes.js.map +1 -1
- package/resources/sandboxes/sandboxes.mjs.map +1 -1
- package/resources/threads/threads.d.mts +13 -1
- package/resources/threads/threads.d.mts.map +1 -1
- package/resources/threads/threads.d.ts +13 -1
- package/resources/threads/threads.d.ts.map +1 -1
- package/resources/threads/threads.js +4 -0
- package/resources/threads/threads.js.map +1 -1
- package/resources/threads/threads.mjs +4 -0
- package/resources/threads/threads.mjs.map +1 -1
- package/resources/traces.d.mts +34 -16
- package/resources/traces.d.mts.map +1 -1
- package/resources/traces.d.ts +34 -16
- package/resources/traces.d.ts.map +1 -1
- package/resources/traces.js +7 -1
- package/resources/traces.js.map +1 -1
- package/resources/traces.mjs +7 -1
- package/resources/traces.mjs.map +1 -1
- package/src/lib/address.ts +138 -180
- package/src/lib/client.ts +4 -5
- package/src/lib/run_trees.ts +8 -5
- package/src/lib/sandbox/README.md +3 -2
- package/src/lib/sandbox/index.ts +1 -0
- package/src/lib/sandbox/mounts.ts +8 -0
- package/src/lib/sandbox/types.ts +8 -0
- package/src/lib/sandbox/verify.ts +107 -28
- package/src/lib/utils/addressing.ts +8 -5
- package/src/resources/annotation-queues/annotation-queues.ts +46 -2
- package/src/resources/runs/runs.ts +15 -1
- package/src/resources/sandboxes/boxes.ts +40 -0
- package/src/resources/sandboxes/sandboxes.ts +40 -0
- package/src/resources/threads/threads.ts +14 -1
- package/src/resources/traces.ts +38 -16
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.10.13](https://github.com/langchain-ai/langsmith-javascript/compare/v0.10.12...v0.10.13) (2026-10-13)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* cover all brace-expansion security patch lines ([#45](https://github.com/langchain-ai/langsmith-javascript/issues/45)) ([2c36f4e](https://github.com/langchain-ai/langsmith-javascript/commit/2c36f4e3ecbefc84632cb1a1fd7947a97cce36eb))
|
|
9
|
+
* **sdk:** merge AddressApi with Address to ensure easier serialization ([#47](https://github.com/langchain-ai/langsmith-javascript/issues/47)) ([7a46bea](https://github.com/langchain-ai/langsmith-javascript/commit/7a46bea0378aecbe01249a156e12477027897b9a))
|
|
10
|
+
|
|
11
|
+
## [0.10.12](https://github.com/langchain-ai/langsmith-javascript/compare/v0.10.11...v0.10.12) (2026-10-13)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **runs:** add ai_search field and SSE streaming to query endpoints ([da3a95b](https://github.com/langchain-ai/langsmith-javascript/commit/da3a95bae3be74e8fe7af80ec84bfb1f893391e8))
|
|
17
|
+
* **sandbox:** accept any JOSE asymmetric algorithm chosen by the JWKS key ([#46](https://github.com/langchain-ai/langsmith-javascript/issues/46)) ([988b7d1](https://github.com/langchain-ai/langsmith-javascript/commit/988b7d1366200930621092198919dad69e157bd9))
|
|
18
|
+
* **sandboxes:** add encryption spec and cache/encryption mount variants ([6047b3c](https://github.com/langchain-ai/langsmith-javascript/commit/6047b3c2500b0291a8bb6b8492a15a243198790c))
|
|
19
|
+
* **webhooks:** add test_webhook_destination endpoint ([a5c70fd](https://github.com/langchain-ai/langsmith-javascript/commit/a5c70fdb5fac90901a20b2a45a5dc1c43ec71ca9))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* bump vulnerable transitive dependencies ([#43](https://github.com/langchain-ai/langsmith-javascript/issues/43)) ([caa8c27](https://github.com/langchain-ai/langsmith-javascript/commit/caa8c2747356093843f8a57f5ea08fdaed92e9b9))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Chores
|
|
28
|
+
|
|
29
|
+
* move sandbox auth options to the bottom of README.md ([#44](https://github.com/langchain-ai/langsmith-javascript/issues/44)) ([d2d2a42](https://github.com/langchain-ai/langsmith-javascript/commit/d2d2a422166c5221df830f841e2ba6cedcc75b40))
|
|
30
|
+
|
|
3
31
|
## [0.10.11](https://github.com/langchain-ai/langsmith-javascript/compare/v0.10.10...v0.10.11) (2026-10-09)
|
|
4
32
|
|
|
5
33
|
|
package/README.md
CHANGED
|
@@ -25,204 +25,6 @@ A typical workflow looks like:
|
|
|
25
25
|
|
|
26
26
|
We'll walk through these steps in more detail below.
|
|
27
27
|
|
|
28
|
-
## Sandbox AWS Auth Proxy
|
|
29
|
-
|
|
30
|
-
When sandbox code needs to call AWS services, use the sandbox AWS auth proxy.
|
|
31
|
-
The proxy keeps the real AWS credentials outside the sandbox and signs supported
|
|
32
|
-
AWS HTTPS requests with SigV4, so code in the sandbox can use AWS SDKs normally
|
|
33
|
-
without storing long-lived AWS keys in files, environment variables, shell
|
|
34
|
-
history, or logs.
|
|
35
|
-
|
|
36
|
-
Store AWS credentials as LangSmith workspace secrets using names that make sense
|
|
37
|
-
for your workspace. Then create the sandbox with an AWS auth proxy config:
|
|
38
|
-
|
|
39
|
-
```ts
|
|
40
|
-
import { SandboxClient, awsAuth, proxyConfig, workspaceSecret } from 'langsmith/sandbox';
|
|
41
|
-
|
|
42
|
-
const client = new SandboxClient();
|
|
43
|
-
const authConfig = proxyConfig({
|
|
44
|
-
rules: [
|
|
45
|
-
awsAuth({
|
|
46
|
-
accessKeyId: workspaceSecret('SANDBOX_AWS_ACCESS_KEY_ID'),
|
|
47
|
-
secretAccessKey: workspaceSecret('SANDBOX_AWS_SECRET_ACCESS_KEY'),
|
|
48
|
-
}),
|
|
49
|
-
],
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
const sandbox = await client.createSandbox({
|
|
53
|
-
name: 'aws-sandbox',
|
|
54
|
-
proxyConfig: authConfig,
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
try {
|
|
58
|
-
const result = await sandbox.run('node your-aws-script.js');
|
|
59
|
-
console.log(result.stdout);
|
|
60
|
-
} finally {
|
|
61
|
-
await sandbox.delete();
|
|
62
|
-
}
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
Use `opaqueSecret("...")` instead of `workspaceSecret(...)` when your application
|
|
66
|
-
needs to pass short-lived write-only AWS credentials at sandbox creation time.
|
|
67
|
-
Plaintext AWS credential values are not accepted directly; wrap them as
|
|
68
|
-
`opaqueSecret(...)` values.
|
|
69
|
-
|
|
70
|
-
## Sandbox GCP Auth Proxy
|
|
71
|
-
|
|
72
|
-
When sandbox code needs to call Google APIs, use the sandbox GCP auth proxy.
|
|
73
|
-
The proxy keeps the service account JSON outside the sandbox and injects OAuth
|
|
74
|
-
bearer tokens for Google API hosts matched automatically by the sandbox proxy.
|
|
75
|
-
|
|
76
|
-
Store the service account JSON as a LangSmith workspace secret. Then create the
|
|
77
|
-
sandbox with a GCP auth proxy config:
|
|
78
|
-
|
|
79
|
-
```ts
|
|
80
|
-
import { SandboxClient, gcpAuth, proxyConfig, workspaceSecret } from 'langsmith/sandbox';
|
|
81
|
-
|
|
82
|
-
const client = new SandboxClient();
|
|
83
|
-
const authConfig = proxyConfig({
|
|
84
|
-
rules: [
|
|
85
|
-
gcpAuth({
|
|
86
|
-
serviceAccountJson: workspaceSecret('SANDBOX_GCP_SERVICE_ACCOUNT_JSON'),
|
|
87
|
-
scopes: ['https://www.googleapis.com/auth/devstorage.read_write'],
|
|
88
|
-
}),
|
|
89
|
-
],
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
const sandbox = await client.createSandbox({
|
|
93
|
-
name: 'gcp-sandbox',
|
|
94
|
-
proxyConfig: authConfig,
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
try {
|
|
98
|
-
const result = await sandbox.run('node your-gcp-script.js');
|
|
99
|
-
console.log(result.stdout);
|
|
100
|
-
} finally {
|
|
101
|
-
await sandbox.delete();
|
|
102
|
-
}
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
Use `opaqueSecret("...")` for short-lived write-only service account JSON.
|
|
106
|
-
Plaintext service account JSON is not accepted directly.
|
|
107
|
-
|
|
108
|
-
## Sandbox Mounts
|
|
109
|
-
|
|
110
|
-
When you create a LangSmith sandbox that needs filesystem access to external
|
|
111
|
-
data such as object storage buckets or public Git repositories, pass a
|
|
112
|
-
`mountConfig` on sandbox creation. Mount specs contain only the mount target.
|
|
113
|
-
Provider credentials stay in `mountConfig.auth`; the backend expands them into
|
|
114
|
-
runtime proxy auth rules. You can also pass `proxyConfig` for non-mount proxy
|
|
115
|
-
behavior such as custom headers, callbacks, access control, and generic egress
|
|
116
|
-
rules. Explicit AWS/GCP proxy auth rules conflict with `mountConfig` auth for
|
|
117
|
-
the same provider.
|
|
118
|
-
|
|
119
|
-
S3 mounts require AWS auth:
|
|
120
|
-
|
|
121
|
-
```ts
|
|
122
|
-
import { awsAuth, mountConfig, s3Mount, workspaceSecret } from 'langsmith/sandbox';
|
|
123
|
-
|
|
124
|
-
const mountCfg = mountConfig({
|
|
125
|
-
auth: [
|
|
126
|
-
awsAuth({
|
|
127
|
-
accessKeyId: workspaceSecret('SANDBOX_AWS_ACCESS_KEY_ID'),
|
|
128
|
-
secretAccessKey: workspaceSecret('SANDBOX_AWS_SECRET_ACCESS_KEY'),
|
|
129
|
-
}),
|
|
130
|
-
],
|
|
131
|
-
mounts: [
|
|
132
|
-
s3Mount({
|
|
133
|
-
id: 'customer_data',
|
|
134
|
-
mountPath: '/mnt/mounts/customer-data',
|
|
135
|
-
bucket: 'example-bucket',
|
|
136
|
-
prefix: 'datasets/customer-data',
|
|
137
|
-
region: 'us-east-1',
|
|
138
|
-
endpointUrl: 'https://s3.amazonaws.com',
|
|
139
|
-
pathStyle: false,
|
|
140
|
-
readOnly: false,
|
|
141
|
-
}),
|
|
142
|
-
],
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
const sandbox = await client.createSandbox({
|
|
146
|
-
name: 's3-mount-sandbox',
|
|
147
|
-
mountConfig: mountCfg,
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
try {
|
|
151
|
-
const result = await sandbox.run('ls /mnt/mounts/customer-data');
|
|
152
|
-
console.log(result.stdout);
|
|
153
|
-
} finally {
|
|
154
|
-
await sandbox.delete();
|
|
155
|
-
}
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
GCS mounts require GCP auth:
|
|
159
|
-
|
|
160
|
-
```ts
|
|
161
|
-
import { gcpAuth, gcsMount, mountConfig, workspaceSecret } from 'langsmith/sandbox';
|
|
162
|
-
|
|
163
|
-
const mountCfg = mountConfig({
|
|
164
|
-
auth: [
|
|
165
|
-
gcpAuth({
|
|
166
|
-
serviceAccountJson: workspaceSecret('SANDBOX_GCP_SERVICE_ACCOUNT_JSON'),
|
|
167
|
-
}),
|
|
168
|
-
],
|
|
169
|
-
mounts: [
|
|
170
|
-
gcsMount({
|
|
171
|
-
id: 'customer_data',
|
|
172
|
-
mountPath: '/mnt/mounts/customer-data',
|
|
173
|
-
bucket: 'example-bucket',
|
|
174
|
-
prefix: 'datasets/customer-data',
|
|
175
|
-
}),
|
|
176
|
-
],
|
|
177
|
-
});
|
|
178
|
-
|
|
179
|
-
const sandbox = await client.createSandbox({
|
|
180
|
-
name: 'gcs-mount-sandbox',
|
|
181
|
-
mountConfig: mountCfg,
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
try {
|
|
185
|
-
const result = await sandbox.run('ls /mnt/mounts/customer-data');
|
|
186
|
-
console.log(result.stdout);
|
|
187
|
-
} finally {
|
|
188
|
-
await sandbox.delete();
|
|
189
|
-
}
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
Public Git mounts do not require AWS or GCP auth:
|
|
193
|
-
|
|
194
|
-
```ts
|
|
195
|
-
import { gitMount, mountConfig } from 'langsmith/sandbox';
|
|
196
|
-
|
|
197
|
-
const mountCfg = mountConfig({
|
|
198
|
-
mounts: [
|
|
199
|
-
gitMount({
|
|
200
|
-
id: 'repo',
|
|
201
|
-
mountPath: '/mnt/repo',
|
|
202
|
-
remoteUrl: 'https://github.com/langchain-ai/langsmith-javascript.git',
|
|
203
|
-
ref: { type: 'branch', name: 'main' },
|
|
204
|
-
refreshIntervalSeconds: 60,
|
|
205
|
-
}),
|
|
206
|
-
],
|
|
207
|
-
});
|
|
208
|
-
|
|
209
|
-
const sandbox = await client.createSandbox({
|
|
210
|
-
name: 'git-mount-sandbox',
|
|
211
|
-
mountConfig: mountCfg,
|
|
212
|
-
});
|
|
213
|
-
|
|
214
|
-
try {
|
|
215
|
-
const result = await sandbox.run('ls /mnt/repo');
|
|
216
|
-
console.log(result.stdout);
|
|
217
|
-
} finally {
|
|
218
|
-
await sandbox.delete();
|
|
219
|
-
}
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
Private Git repositories can use low-level `proxyConfig` rules when the remote
|
|
223
|
-
requires proxy-managed auth. There is not yet a high-level private Git auth
|
|
224
|
-
helper.
|
|
225
|
-
|
|
226
28
|
## 1. Connect to LangSmith
|
|
227
29
|
|
|
228
30
|
Sign up for [LangSmith](https://smith.langchain.com/) using your GitHub, Discord accounts, or an email address and password. If you sign up with an email, make sure to verify your email address before logging in.
|
|
@@ -1030,6 +832,204 @@ const client = new Langsmith({
|
|
|
1030
832
|
});
|
|
1031
833
|
```
|
|
1032
834
|
|
|
835
|
+
### Sandbox AWS Auth Proxy
|
|
836
|
+
|
|
837
|
+
When sandbox code needs to call AWS services, use the sandbox AWS auth proxy.
|
|
838
|
+
The proxy keeps the real AWS credentials outside the sandbox and signs supported
|
|
839
|
+
AWS HTTPS requests with SigV4, so code in the sandbox can use AWS SDKs normally
|
|
840
|
+
without storing long-lived AWS keys in files, environment variables, shell
|
|
841
|
+
history, or logs.
|
|
842
|
+
|
|
843
|
+
Store AWS credentials as LangSmith workspace secrets using names that make sense
|
|
844
|
+
for your workspace. Then create the sandbox with an AWS auth proxy config:
|
|
845
|
+
|
|
846
|
+
```ts
|
|
847
|
+
import { SandboxClient, awsAuth, proxyConfig, workspaceSecret } from 'langsmith/sandbox';
|
|
848
|
+
|
|
849
|
+
const client = new SandboxClient();
|
|
850
|
+
const authConfig = proxyConfig({
|
|
851
|
+
rules: [
|
|
852
|
+
awsAuth({
|
|
853
|
+
accessKeyId: workspaceSecret('SANDBOX_AWS_ACCESS_KEY_ID'),
|
|
854
|
+
secretAccessKey: workspaceSecret('SANDBOX_AWS_SECRET_ACCESS_KEY'),
|
|
855
|
+
}),
|
|
856
|
+
],
|
|
857
|
+
});
|
|
858
|
+
|
|
859
|
+
const sandbox = await client.createSandbox({
|
|
860
|
+
name: 'aws-sandbox',
|
|
861
|
+
proxyConfig: authConfig,
|
|
862
|
+
});
|
|
863
|
+
|
|
864
|
+
try {
|
|
865
|
+
const result = await sandbox.run('node your-aws-script.js');
|
|
866
|
+
console.log(result.stdout);
|
|
867
|
+
} finally {
|
|
868
|
+
await sandbox.delete();
|
|
869
|
+
}
|
|
870
|
+
```
|
|
871
|
+
|
|
872
|
+
Use `opaqueSecret("...")` instead of `workspaceSecret(...)` when your application
|
|
873
|
+
needs to pass short-lived write-only AWS credentials at sandbox creation time.
|
|
874
|
+
Plaintext AWS credential values are not accepted directly; wrap them as
|
|
875
|
+
`opaqueSecret(...)` values.
|
|
876
|
+
|
|
877
|
+
### Sandbox GCP Auth Proxy
|
|
878
|
+
|
|
879
|
+
When sandbox code needs to call Google APIs, use the sandbox GCP auth proxy.
|
|
880
|
+
The proxy keeps the service account JSON outside the sandbox and injects OAuth
|
|
881
|
+
bearer tokens for Google API hosts matched automatically by the sandbox proxy.
|
|
882
|
+
|
|
883
|
+
Store the service account JSON as a LangSmith workspace secret. Then create the
|
|
884
|
+
sandbox with a GCP auth proxy config:
|
|
885
|
+
|
|
886
|
+
```ts
|
|
887
|
+
import { SandboxClient, gcpAuth, proxyConfig, workspaceSecret } from 'langsmith/sandbox';
|
|
888
|
+
|
|
889
|
+
const client = new SandboxClient();
|
|
890
|
+
const authConfig = proxyConfig({
|
|
891
|
+
rules: [
|
|
892
|
+
gcpAuth({
|
|
893
|
+
serviceAccountJson: workspaceSecret('SANDBOX_GCP_SERVICE_ACCOUNT_JSON'),
|
|
894
|
+
scopes: ['https://www.googleapis.com/auth/devstorage.read_write'],
|
|
895
|
+
}),
|
|
896
|
+
],
|
|
897
|
+
});
|
|
898
|
+
|
|
899
|
+
const sandbox = await client.createSandbox({
|
|
900
|
+
name: 'gcp-sandbox',
|
|
901
|
+
proxyConfig: authConfig,
|
|
902
|
+
});
|
|
903
|
+
|
|
904
|
+
try {
|
|
905
|
+
const result = await sandbox.run('node your-gcp-script.js');
|
|
906
|
+
console.log(result.stdout);
|
|
907
|
+
} finally {
|
|
908
|
+
await sandbox.delete();
|
|
909
|
+
}
|
|
910
|
+
```
|
|
911
|
+
|
|
912
|
+
Use `opaqueSecret("...")` for short-lived write-only service account JSON.
|
|
913
|
+
Plaintext service account JSON is not accepted directly.
|
|
914
|
+
|
|
915
|
+
### Sandbox Mounts
|
|
916
|
+
|
|
917
|
+
When you create a LangSmith sandbox that needs filesystem access to external
|
|
918
|
+
data such as object storage buckets or public Git repositories, pass a
|
|
919
|
+
`mountConfig` on sandbox creation. Mount specs contain only the mount target.
|
|
920
|
+
Provider credentials stay in `mountConfig.auth`; the backend expands them into
|
|
921
|
+
runtime proxy auth rules. You can also pass `proxyConfig` for non-mount proxy
|
|
922
|
+
behavior such as custom headers, callbacks, access control, and generic egress
|
|
923
|
+
rules. Explicit AWS/GCP proxy auth rules conflict with `mountConfig` auth for
|
|
924
|
+
the same provider.
|
|
925
|
+
|
|
926
|
+
S3 mounts require AWS auth:
|
|
927
|
+
|
|
928
|
+
```ts
|
|
929
|
+
import { awsAuth, mountConfig, s3Mount, workspaceSecret } from 'langsmith/sandbox';
|
|
930
|
+
|
|
931
|
+
const mountCfg = mountConfig({
|
|
932
|
+
auth: [
|
|
933
|
+
awsAuth({
|
|
934
|
+
accessKeyId: workspaceSecret('SANDBOX_AWS_ACCESS_KEY_ID'),
|
|
935
|
+
secretAccessKey: workspaceSecret('SANDBOX_AWS_SECRET_ACCESS_KEY'),
|
|
936
|
+
}),
|
|
937
|
+
],
|
|
938
|
+
mounts: [
|
|
939
|
+
s3Mount({
|
|
940
|
+
id: 'customer_data',
|
|
941
|
+
mountPath: '/mnt/mounts/customer-data',
|
|
942
|
+
bucket: 'example-bucket',
|
|
943
|
+
prefix: 'datasets/customer-data',
|
|
944
|
+
region: 'us-east-1',
|
|
945
|
+
endpointUrl: 'https://s3.amazonaws.com',
|
|
946
|
+
pathStyle: false,
|
|
947
|
+
readOnly: false,
|
|
948
|
+
}),
|
|
949
|
+
],
|
|
950
|
+
});
|
|
951
|
+
|
|
952
|
+
const sandbox = await client.createSandbox({
|
|
953
|
+
name: 's3-mount-sandbox',
|
|
954
|
+
mountConfig: mountCfg,
|
|
955
|
+
});
|
|
956
|
+
|
|
957
|
+
try {
|
|
958
|
+
const result = await sandbox.run('ls /mnt/mounts/customer-data');
|
|
959
|
+
console.log(result.stdout);
|
|
960
|
+
} finally {
|
|
961
|
+
await sandbox.delete();
|
|
962
|
+
}
|
|
963
|
+
```
|
|
964
|
+
|
|
965
|
+
GCS mounts require GCP auth:
|
|
966
|
+
|
|
967
|
+
```ts
|
|
968
|
+
import { gcpAuth, gcsMount, mountConfig, workspaceSecret } from 'langsmith/sandbox';
|
|
969
|
+
|
|
970
|
+
const mountCfg = mountConfig({
|
|
971
|
+
auth: [
|
|
972
|
+
gcpAuth({
|
|
973
|
+
serviceAccountJson: workspaceSecret('SANDBOX_GCP_SERVICE_ACCOUNT_JSON'),
|
|
974
|
+
}),
|
|
975
|
+
],
|
|
976
|
+
mounts: [
|
|
977
|
+
gcsMount({
|
|
978
|
+
id: 'customer_data',
|
|
979
|
+
mountPath: '/mnt/mounts/customer-data',
|
|
980
|
+
bucket: 'example-bucket',
|
|
981
|
+
prefix: 'datasets/customer-data',
|
|
982
|
+
}),
|
|
983
|
+
],
|
|
984
|
+
});
|
|
985
|
+
|
|
986
|
+
const sandbox = await client.createSandbox({
|
|
987
|
+
name: 'gcs-mount-sandbox',
|
|
988
|
+
mountConfig: mountCfg,
|
|
989
|
+
});
|
|
990
|
+
|
|
991
|
+
try {
|
|
992
|
+
const result = await sandbox.run('ls /mnt/mounts/customer-data');
|
|
993
|
+
console.log(result.stdout);
|
|
994
|
+
} finally {
|
|
995
|
+
await sandbox.delete();
|
|
996
|
+
}
|
|
997
|
+
```
|
|
998
|
+
|
|
999
|
+
Public Git mounts do not require AWS or GCP auth:
|
|
1000
|
+
|
|
1001
|
+
```ts
|
|
1002
|
+
import { gitMount, mountConfig } from 'langsmith/sandbox';
|
|
1003
|
+
|
|
1004
|
+
const mountCfg = mountConfig({
|
|
1005
|
+
mounts: [
|
|
1006
|
+
gitMount({
|
|
1007
|
+
id: 'repo',
|
|
1008
|
+
mountPath: '/mnt/repo',
|
|
1009
|
+
remoteUrl: 'https://github.com/langchain-ai/langsmith-javascript.git',
|
|
1010
|
+
ref: { type: 'branch', name: 'main' },
|
|
1011
|
+
refreshIntervalSeconds: 60,
|
|
1012
|
+
}),
|
|
1013
|
+
],
|
|
1014
|
+
});
|
|
1015
|
+
|
|
1016
|
+
const sandbox = await client.createSandbox({
|
|
1017
|
+
name: 'git-mount-sandbox',
|
|
1018
|
+
mountConfig: mountCfg,
|
|
1019
|
+
});
|
|
1020
|
+
|
|
1021
|
+
try {
|
|
1022
|
+
const result = await sandbox.run('ls /mnt/repo');
|
|
1023
|
+
console.log(result.stdout);
|
|
1024
|
+
} finally {
|
|
1025
|
+
await sandbox.delete();
|
|
1026
|
+
}
|
|
1027
|
+
```
|
|
1028
|
+
|
|
1029
|
+
Private Git repositories can use low-level `proxyConfig` rules when the remote
|
|
1030
|
+
requires proxy-managed auth. There is not yet a high-level private Git auth
|
|
1031
|
+
helper.
|
|
1032
|
+
|
|
1033
1033
|
## Frequently Asked Questions
|
|
1034
1034
|
|
|
1035
1035
|
## Semantic versioning
|
package/lib/address.d.mts
CHANGED
|
@@ -1,69 +1,48 @@
|
|
|
1
1
|
/** (beta) An agent environment. */
|
|
2
2
|
export type Environment = "local" | "development" | "staging" | "production";
|
|
3
|
-
/** (beta) The
|
|
4
|
-
export
|
|
5
|
-
kind: "AGENT"
|
|
6
|
-
id
|
|
7
|
-
environment
|
|
8
|
-
};
|
|
9
|
-
/** (beta) A feature that holds traces in a tracing project. */
|
|
10
|
-
export interface Address {
|
|
11
|
-
/** The address in the backend's form. */
|
|
12
|
-
toApiAddress(): ApiAddress;
|
|
13
|
-
}
|
|
14
|
-
/** (beta) The `LANGSMITH_AGENT_*` / project env vars name half an address, or both. */
|
|
15
|
-
export declare class EnvAddressError extends Error {
|
|
16
|
-
constructor(message: string);
|
|
3
|
+
/** (beta) The address of an agent's environment. */
|
|
4
|
+
export interface AgentAddress {
|
|
5
|
+
kind: "AGENT";
|
|
6
|
+
id: string;
|
|
7
|
+
environment: Uppercase<Environment>;
|
|
17
8
|
}
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* ```ts
|
|
23
|
-
* new AgentAddress("customer-support", "production");
|
|
24
|
-
* ```
|
|
25
|
-
*/
|
|
26
|
-
export declare class AgentAddress implements Address {
|
|
27
|
-
readonly id: string;
|
|
28
|
-
/** Always lowercase. */
|
|
29
|
-
readonly environment: Environment;
|
|
30
|
-
/**
|
|
31
|
-
* @param id 1 to 63 lowercase ASCII letters, digits or hyphens, starting
|
|
32
|
-
* with a letter and ending with a letter or digit. The server creates the
|
|
33
|
-
* agent on first use.
|
|
34
|
-
* @param environment One of `local`, `development`, `staging` or `production`, in
|
|
35
|
-
* any case.
|
|
36
|
-
* @throws If a value is invalid.
|
|
37
|
-
*/
|
|
9
|
+
/** (beta) Construct and validate an agent address; plain objects are also accepted. */
|
|
10
|
+
export declare class AgentAddress {
|
|
38
11
|
constructor(id: string, environment: Environment | (string & {}));
|
|
39
|
-
toApiAddress(): ApiAddress;
|
|
40
|
-
/**
|
|
41
|
-
* Read the agent named by `LANGSMITH_AGENT_ID` and
|
|
42
|
-
* `LANGSMITH_AGENT_ENVIRONMENT`; `undefined` if neither is set.
|
|
43
|
-
* @throws {EnvAddressError} If only one is set, or a value is invalid.
|
|
44
|
-
*/
|
|
45
|
-
static fromEnv(): AgentAddress | undefined;
|
|
46
12
|
}
|
|
47
13
|
/** (beta) The address of an experiment's tracing project. */
|
|
48
|
-
export
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
*/
|
|
14
|
+
export interface ExperimentAddress {
|
|
15
|
+
kind: "EXPERIMENT";
|
|
16
|
+
id: string;
|
|
17
|
+
}
|
|
18
|
+
/** (beta) Construct and validate an experiment address. */
|
|
19
|
+
export declare class ExperimentAddress {
|
|
55
20
|
constructor(id: string);
|
|
56
|
-
toApiAddress(): ApiAddress;
|
|
57
21
|
}
|
|
58
22
|
/** (beta) The address of the workspace's shared evaluators project. */
|
|
59
|
-
export
|
|
23
|
+
export interface EvaluatorAddress {
|
|
24
|
+
kind: "EVALUATOR";
|
|
25
|
+
}
|
|
26
|
+
/** (beta) Construct the workspace's evaluators address. */
|
|
27
|
+
export declare class EvaluatorAddress {
|
|
60
28
|
constructor();
|
|
61
|
-
toApiAddress(): ApiAddress;
|
|
62
29
|
}
|
|
63
|
-
/**
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
*/
|
|
30
|
+
/** (beta) A feature that holds traces in a tracing project. */
|
|
31
|
+
export type Address = AgentAddress | ExperimentAddress | EvaluatorAddress;
|
|
32
|
+
/** (beta) An address as the resolve endpoint takes it. */
|
|
33
|
+
export type ApiAddress = Address;
|
|
34
|
+
/** (beta) The `LANGSMITH_AGENT_*` / project env vars name half an address, or both. */
|
|
35
|
+
export declare class EnvAddressError extends Error {
|
|
36
|
+
constructor(message: string);
|
|
37
|
+
}
|
|
38
|
+
/** Validate an address at an SDK entrypoint and return a normalized copy. */
|
|
39
|
+
export declare function ensureAddress<K extends Address["kind"]>(value: {
|
|
40
|
+
kind: K;
|
|
41
|
+
id?: unknown;
|
|
42
|
+
environment?: unknown;
|
|
43
|
+
}): Extract<Address, {
|
|
44
|
+
kind: K;
|
|
45
|
+
}>;
|
|
68
46
|
export declare function ensureAddress(value: unknown): Address | undefined;
|
|
47
|
+
export declare function ensureAgent(value: unknown): AgentAddress | undefined;
|
|
69
48
|
//# sourceMappingURL=address.d.mts.map
|
package/lib/address.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address.d.mts","sourceRoot":"","sources":["../src/lib/address.ts"],"names":[],"mappings":"AAmBA,mCAAmC;AACnC,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,aAAa,GAAG,SAAS,GAAG,YAAY,CAAC;AAQ7E,
|
|
1
|
+
{"version":3,"file":"address.d.mts","sourceRoot":"","sources":["../src/lib/address.ts"],"names":[],"mappings":"AAmBA,mCAAmC;AACnC,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,aAAa,GAAG,SAAS,GAAG,YAAY,CAAC;AAQ7E,oDAAoD;AACpD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;CACrC;AAED,uFAAuF;AACvF,qBAAa,YAAY;gBACX,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;CAOjE;AAED,6DAA6D;AAC7D,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,YAAY,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,2DAA2D;AAC3D,qBAAa,iBAAiB;gBAChB,EAAE,EAAE,MAAM;CAMvB;AAED,uEAAuE;AACvE,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,2DAA2D;AAC3D,qBAAa,gBAAgB;;CAK5B;AAED,+DAA+D;AAC/D,MAAM,MAAM,OAAO,GAAG,YAAY,GAAG,iBAAiB,GAAG,gBAAgB,CAAC;AAE1E,0DAA0D;AAC1D,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC;AAcjC,uFAAuF;AACvF,qBAAa,eAAgB,SAAQ,KAAK;gBAC5B,OAAO,EAAE,MAAM;CAI5B;AAED,6EAA6E;AAC7E,wBAAgB,aAAa,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE;IAC9D,IAAI,EAAE,CAAC,CAAC;IACR,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,GAAG,OAAO,CAAC,OAAO,EAAE;IAAE,IAAI,EAAE,CAAC,CAAA;CAAE,CAAC,CAAC;AAClC,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;AAoDnE,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,GAAG,SAAS,CAAC"}
|
package/lib/address.d.ts
CHANGED
|
@@ -1,69 +1,48 @@
|
|
|
1
1
|
/** (beta) An agent environment. */
|
|
2
2
|
export type Environment = "local" | "development" | "staging" | "production";
|
|
3
|
-
/** (beta) The
|
|
4
|
-
export
|
|
5
|
-
kind: "AGENT"
|
|
6
|
-
id
|
|
7
|
-
environment
|
|
8
|
-
};
|
|
9
|
-
/** (beta) A feature that holds traces in a tracing project. */
|
|
10
|
-
export interface Address {
|
|
11
|
-
/** The address in the backend's form. */
|
|
12
|
-
toApiAddress(): ApiAddress;
|
|
13
|
-
}
|
|
14
|
-
/** (beta) The `LANGSMITH_AGENT_*` / project env vars name half an address, or both. */
|
|
15
|
-
export declare class EnvAddressError extends Error {
|
|
16
|
-
constructor(message: string);
|
|
3
|
+
/** (beta) The address of an agent's environment. */
|
|
4
|
+
export interface AgentAddress {
|
|
5
|
+
kind: "AGENT";
|
|
6
|
+
id: string;
|
|
7
|
+
environment: Uppercase<Environment>;
|
|
17
8
|
}
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* ```ts
|
|
23
|
-
* new AgentAddress("customer-support", "production");
|
|
24
|
-
* ```
|
|
25
|
-
*/
|
|
26
|
-
export declare class AgentAddress implements Address {
|
|
27
|
-
readonly id: string;
|
|
28
|
-
/** Always lowercase. */
|
|
29
|
-
readonly environment: Environment;
|
|
30
|
-
/**
|
|
31
|
-
* @param id 1 to 63 lowercase ASCII letters, digits or hyphens, starting
|
|
32
|
-
* with a letter and ending with a letter or digit. The server creates the
|
|
33
|
-
* agent on first use.
|
|
34
|
-
* @param environment One of `local`, `development`, `staging` or `production`, in
|
|
35
|
-
* any case.
|
|
36
|
-
* @throws If a value is invalid.
|
|
37
|
-
*/
|
|
9
|
+
/** (beta) Construct and validate an agent address; plain objects are also accepted. */
|
|
10
|
+
export declare class AgentAddress {
|
|
38
11
|
constructor(id: string, environment: Environment | (string & {}));
|
|
39
|
-
toApiAddress(): ApiAddress;
|
|
40
|
-
/**
|
|
41
|
-
* Read the agent named by `LANGSMITH_AGENT_ID` and
|
|
42
|
-
* `LANGSMITH_AGENT_ENVIRONMENT`; `undefined` if neither is set.
|
|
43
|
-
* @throws {EnvAddressError} If only one is set, or a value is invalid.
|
|
44
|
-
*/
|
|
45
|
-
static fromEnv(): AgentAddress | undefined;
|
|
46
12
|
}
|
|
47
13
|
/** (beta) The address of an experiment's tracing project. */
|
|
48
|
-
export
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
*/
|
|
14
|
+
export interface ExperimentAddress {
|
|
15
|
+
kind: "EXPERIMENT";
|
|
16
|
+
id: string;
|
|
17
|
+
}
|
|
18
|
+
/** (beta) Construct and validate an experiment address. */
|
|
19
|
+
export declare class ExperimentAddress {
|
|
55
20
|
constructor(id: string);
|
|
56
|
-
toApiAddress(): ApiAddress;
|
|
57
21
|
}
|
|
58
22
|
/** (beta) The address of the workspace's shared evaluators project. */
|
|
59
|
-
export
|
|
23
|
+
export interface EvaluatorAddress {
|
|
24
|
+
kind: "EVALUATOR";
|
|
25
|
+
}
|
|
26
|
+
/** (beta) Construct the workspace's evaluators address. */
|
|
27
|
+
export declare class EvaluatorAddress {
|
|
60
28
|
constructor();
|
|
61
|
-
toApiAddress(): ApiAddress;
|
|
62
29
|
}
|
|
63
|
-
/**
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
*/
|
|
30
|
+
/** (beta) A feature that holds traces in a tracing project. */
|
|
31
|
+
export type Address = AgentAddress | ExperimentAddress | EvaluatorAddress;
|
|
32
|
+
/** (beta) An address as the resolve endpoint takes it. */
|
|
33
|
+
export type ApiAddress = Address;
|
|
34
|
+
/** (beta) The `LANGSMITH_AGENT_*` / project env vars name half an address, or both. */
|
|
35
|
+
export declare class EnvAddressError extends Error {
|
|
36
|
+
constructor(message: string);
|
|
37
|
+
}
|
|
38
|
+
/** Validate an address at an SDK entrypoint and return a normalized copy. */
|
|
39
|
+
export declare function ensureAddress<K extends Address["kind"]>(value: {
|
|
40
|
+
kind: K;
|
|
41
|
+
id?: unknown;
|
|
42
|
+
environment?: unknown;
|
|
43
|
+
}): Extract<Address, {
|
|
44
|
+
kind: K;
|
|
45
|
+
}>;
|
|
68
46
|
export declare function ensureAddress(value: unknown): Address | undefined;
|
|
47
|
+
export declare function ensureAgent(value: unknown): AgentAddress | undefined;
|
|
69
48
|
//# sourceMappingURL=address.d.ts.map
|
package/lib/address.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../src/lib/address.ts"],"names":[],"mappings":"AAmBA,mCAAmC;AACnC,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,aAAa,GAAG,SAAS,GAAG,YAAY,CAAC;AAQ7E,
|
|
1
|
+
{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../src/lib/address.ts"],"names":[],"mappings":"AAmBA,mCAAmC;AACnC,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,aAAa,GAAG,SAAS,GAAG,YAAY,CAAC;AAQ7E,oDAAoD;AACpD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;CACrC;AAED,uFAAuF;AACvF,qBAAa,YAAY;gBACX,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;CAOjE;AAED,6DAA6D;AAC7D,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,YAAY,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,2DAA2D;AAC3D,qBAAa,iBAAiB;gBAChB,EAAE,EAAE,MAAM;CAMvB;AAED,uEAAuE;AACvE,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,2DAA2D;AAC3D,qBAAa,gBAAgB;;CAK5B;AAED,+DAA+D;AAC/D,MAAM,MAAM,OAAO,GAAG,YAAY,GAAG,iBAAiB,GAAG,gBAAgB,CAAC;AAE1E,0DAA0D;AAC1D,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC;AAcjC,uFAAuF;AACvF,qBAAa,eAAgB,SAAQ,KAAK;gBAC5B,OAAO,EAAE,MAAM;CAI5B;AAED,6EAA6E;AAC7E,wBAAgB,aAAa,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE;IAC9D,IAAI,EAAE,CAAC,CAAC;IACR,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,GAAG,OAAO,CAAC,OAAO,EAAE;IAAE,IAAI,EAAE,CAAC,CAAA;CAAE,CAAC,CAAC;AAClC,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;AAoDnE,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,GAAG,SAAS,CAAC"}
|