@strands-agents/shell 0.1.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -21,7 +21,7 @@
21
21
  </div>
22
22
 
23
23
  <p>
24
- <a href="https://strandsagents.com/">Documentation</a>
24
+ <a href="https://strandsagents.com/docs/user-guide/shell/">Documentation</a>
25
25
  ◆ <a href="#mcp-server">MCP Server</a>
26
26
  ◆ <a href="#python">Python</a>
27
27
  ◆ <a href="#nodejs">Node.js</a>
@@ -141,6 +141,47 @@ shell = strands_shell.Shell(
141
141
 
142
142
  > ⚠️ **`mode: "direct"` mounts are live.** The agent can read and modify host files in real time. Use only for designated output directories. Never direct-bind directories containing secrets, credentials, or configuration you don't want the agent to modify.
143
143
 
144
+ ### Inspecting configuration
145
+
146
+ A constructed shell exposes a read-only snapshot of how it was configured. This
147
+ is useful when you embed Strands Shell as a sandbox in a larger framework and
148
+ need to build tool descriptions, surface the network allowlist, or report the
149
+ active resource caps from a shell object you were handed.
150
+
151
+ ```python
152
+ shell = strands_shell.Shell(
153
+ allowed_urls=["https://api.example.com/"],
154
+ credentials=[strands_shell.Cred("https://api.example.com/", env_var="API_TOKEN")],
155
+ timeout=30.0,
156
+ )
157
+
158
+ cfg = shell.config # a frozen ShellConfig snapshot
159
+ cfg.allowed_urls # ('https://api.example.com/',)
160
+ cfg.timeout # 30.0
161
+ cfg.credentials[0].url # 'https://api.example.com/'
162
+ cfg.credentials[0].env_var # 'API_TOKEN' (the secret value is never exposed)
163
+ ```
164
+
165
+ ```javascript
166
+ const shell = await Shell.create({
167
+ allowedUrls: ['https://api.example.com/'],
168
+ credentials: [{ url: 'https://api.example.com/', envVar: 'API_TOKEN' }],
169
+ timeout: 30,
170
+ })
171
+
172
+ const cfg = await shell.config() // a deep-frozen snapshot object
173
+ cfg.allowedUrls // ['https://api.example.com/']
174
+ cfg.timeout // 30
175
+ cfg.credentials[0].envVar // 'API_TOKEN' (the secret value is never exposed)
176
+ ```
177
+
178
+ The snapshot reports binds, credentials, the network allowlist, environment
179
+ variables, umask, timeout, and resource limits. Credential **secrets are never
180
+ included** — each entry reports its URL pattern, kind, and source (a literal
181
+ token was supplied, or the name of the environment variable it is read from),
182
+ so you can reason about credentials without the agent or your tooling ever
183
+ seeing the secret itself.
184
+
144
185
  ### TOML
145
186
 
146
187
  You can load all of this from a config file instead:
@@ -209,7 +250,7 @@ Out of the box, the shell is an empty sandbox — no files, no network, no crede
209
250
 
210
251
  The commands agents use constantly: `grep`, `find`, `cat`, `head`, `tail`, `jq` for reading and searching. `sed`, `sort`, `tr`, `cut` for transforming output. `cp`, `mv`, `rm`, `mkdir` for managing files. `curl` for HTTP (SSRF-guarded, credentials auto-injected). `lua` for scripting when shell gets awkward.
211
252
 
212
- [COMMANDS.md](COMMANDS.md) has the full inventory with implementation status, supported flags, and known gaps vs GNU coreutils.
253
+ The [full command reference](https://strandsagents.com/docs/user-guide/shell/commands/) has the inventory with implementation status, supported flags, and known gaps vs GNU coreutils.
213
254
 
214
255
  ## File Operations API
215
256
 
package/index.d.ts CHANGED
@@ -63,6 +63,61 @@ export interface ShellConfig {
63
63
  configFile?: string
64
64
  }
65
65
 
66
+ /** A bind mount in a {@link ShellConfigSnapshot}. */
67
+ export interface BindInfo {
68
+ readonly source: string
69
+ readonly destination: string
70
+ /** `'copy'` (build-time snapshot) or `'direct'` (host passthrough). */
71
+ readonly mode: 'copy' | 'direct'
72
+ readonly readonly: boolean
73
+ }
74
+
75
+ /**
76
+ * A credential rule in a {@link ShellConfigSnapshot}.
77
+ *
78
+ * The secret value is never exposed. `envVar` holds the environment-variable
79
+ * name when the credential was configured from the environment; `fromLiteral`
80
+ * is `true` when a literal token was supplied directly (its value is withheld).
81
+ */
82
+ export interface CredInfo {
83
+ readonly url: string
84
+ readonly kind: 'bearer' | 'query'
85
+ readonly methods: readonly string[]
86
+ readonly param: string | null
87
+ readonly envVar: string | null
88
+ readonly fromLiteral: boolean
89
+ }
90
+
91
+ /** Resource caps in a {@link ShellConfigSnapshot}. Every cap is present. */
92
+ export interface LimitsInfo {
93
+ readonly maxDepth: number
94
+ readonly maxOutput: number
95
+ readonly maxFds: number
96
+ readonly maxBgJobs: number
97
+ readonly maxPipeline: number
98
+ readonly maxInput: number
99
+ readonly maxFileSize: number
100
+ readonly maxInodes: number
101
+ }
102
+
103
+ /**
104
+ * A read-only snapshot of how a {@link Shell} was configured, returned by
105
+ * {@link Shell.config}. Lets an embedder introspect a constructed shell — to
106
+ * build tool descriptions, surface the network allowlist, or report active
107
+ * limits — without having held onto the {@link ShellConfig} it was built from.
108
+ * Secret values are never included.
109
+ */
110
+ export interface ShellConfigSnapshot {
111
+ readonly binds: readonly BindInfo[]
112
+ readonly credentials: readonly CredInfo[]
113
+ readonly allowedUrls: readonly string[]
114
+ readonly env: Readonly<Record<string, string>>
115
+ readonly umask: number
116
+ /** Per-command timeout in seconds, or `null` for no timeout. */
117
+ readonly timeout: number | null
118
+ readonly limits: LimitsInfo
119
+ }
120
+
66
121
  /** errno-style discriminator carried on every {@link ShellError}. */
67
122
  export type ShellErrorCode = 'ENOENT' | 'EACCES' | 'EFBIG' | 'EOTHER'
68
123
 
@@ -89,6 +144,11 @@ export declare class Shell {
89
144
  setEnv(key: string, value: string): Promise<void>
90
145
  /** Get an environment variable. */
91
146
  getEnv(key: string): Promise<string | null>
147
+ /**
148
+ * A read-only snapshot of how this shell was configured. Secret values are
149
+ * never included — see {@link CredInfo}. The returned object is deep-frozen.
150
+ */
151
+ config(): Promise<ShellConfigSnapshot>
92
152
  /** Read a file as raw bytes. Rejects with {@link NotFoundError} if missing. */
93
153
  readFile(path: string): Promise<Uint8Array>
94
154
  /** Write raw bytes; creates parent dirs (mkdir -p) and truncates. */
package/index.js CHANGED
@@ -190,6 +190,52 @@ class Shell {
190
190
  return this._inner.getEnv(key)
191
191
  }
192
192
 
193
+ // ---- Configuration introspection ----
194
+
195
+ /**
196
+ * A read-only snapshot of how this shell was configured. Resolves to an
197
+ * object reporting binds, credentials, allowedUrls, env, umask, timeout,
198
+ * and limits.
199
+ *
200
+ * Secret values are never included: each credential reports its `url`
201
+ * pattern, `kind`, and source (`envVar` name, or `fromLiteral: true`), but
202
+ * never the token itself. The returned object and its nested objects/arrays
203
+ * are deep-frozen so the snapshot cannot be mutated.
204
+ */
205
+ async config() {
206
+ const c = await this._inner.config()
207
+ const snapshot = {
208
+ binds: c.binds.map((b) =>
209
+ Object.freeze({
210
+ source: b.source,
211
+ destination: b.destination,
212
+ mode: b.mode,
213
+ readonly: b.readonly,
214
+ }),
215
+ ),
216
+ credentials: c.credentials.map((cr) =>
217
+ Object.freeze({
218
+ url: cr.url,
219
+ kind: cr.kind,
220
+ methods: Object.freeze([...cr.methods]),
221
+ param: cr.param ?? null,
222
+ envVar: cr.envVar ?? null,
223
+ fromLiteral: cr.fromLiteral,
224
+ }),
225
+ ),
226
+ allowedUrls: c.allowedUrls,
227
+ env: c.env,
228
+ umask: c.umask,
229
+ timeout: c.timeout ?? null,
230
+ limits: Object.freeze({ ...c.limits }),
231
+ }
232
+ Object.freeze(snapshot.binds)
233
+ Object.freeze(snapshot.credentials)
234
+ Object.freeze(snapshot.allowedUrls)
235
+ Object.freeze(snapshot.env)
236
+ return Object.freeze(snapshot)
237
+ }
238
+
193
239
  // ---- VFS file operations ----
194
240
 
195
241
  readFile(path) {
package/native.d.ts CHANGED
@@ -10,6 +10,13 @@ export declare class Shell {
10
10
  setEnv(key: string, value: string): Promise<void>
11
11
  /** Get an environment variable. */
12
12
  getEnv(key: string): Promise<string | null>
13
+ /**
14
+ * Read-only snapshot of the configuration this shell was built with.
15
+ *
16
+ * Mirrors `Shell::config()` in the core. Never carries secret values —
17
+ * each credential reports its source (literal vs env-var name) only.
18
+ */
19
+ config(): Promise<ShellConfig>
13
20
  /** Read a file from the virtual filesystem as raw bytes. */
14
21
  readFile(path: string): Promise<Uint8Array>
15
22
  /**
@@ -86,6 +93,28 @@ export declare class ShellBuilder {
86
93
  build(): Promise<Shell>
87
94
  }
88
95
 
96
+ /** A single bind mount in a config snapshot. */
97
+ export interface BindInfo {
98
+ source: string
99
+ destination: string
100
+ /** `"copy"` or `"direct"`. */
101
+ mode: string
102
+ readonly: boolean
103
+ }
104
+
105
+ /** A single credential rule in a config snapshot. Never carries the secret. */
106
+ export interface CredInfo {
107
+ url: string
108
+ /** `"bearer"` or `"query"`. */
109
+ kind: string
110
+ methods: Array<string>
111
+ param?: string
112
+ /** Name of the env var the secret is read from, or `null` for a literal. */
113
+ envVar?: string
114
+ /** True when a literal token was supplied (value itself never exposed). */
115
+ fromLiteral: boolean
116
+ }
117
+
89
118
  /**
90
119
  * Metadata about a file or directory in the VFS.
91
120
  *
@@ -98,6 +127,18 @@ export interface FileInfo {
98
127
  size?: number
99
128
  }
100
129
 
130
+ /** Resource caps in a config snapshot. */
131
+ export interface LimitsInfo {
132
+ maxDepth: number
133
+ maxOutput: number
134
+ maxFds: number
135
+ maxBgJobs: number
136
+ maxPipeline: number
137
+ maxInput: number
138
+ maxFileSize: number
139
+ maxInodes: number
140
+ }
141
+
101
142
  /**
102
143
  * Output from a shell command execution.
103
144
  *
@@ -109,3 +150,16 @@ export interface Output {
109
150
  stdout: string
110
151
  stderr: string
111
152
  }
153
+
154
+ /** A read-only snapshot of how a `Shell` was configured. */
155
+ export interface ShellConfig {
156
+ binds: Array<BindInfo>
157
+ credentials: Array<CredInfo>
158
+ allowedUrls: Array<string>
159
+ /** Seeded environment variables as a plain object. */
160
+ env: Record<string, string>
161
+ umask: number
162
+ /** Per-command timeout in seconds, or `null` for no timeout. */
163
+ timeout?: number
164
+ limits: LimitsInfo
165
+ }
package/native.js CHANGED
@@ -77,8 +77,8 @@ function requireNative() {
77
77
  try {
78
78
  const binding = require('@strands-agents/shell-android-arm64')
79
79
  const bindingPackageVersion = require('@strands-agents/shell-android-arm64/package.json').version
80
- if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
81
- throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
80
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
81
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
82
82
  }
83
83
  return binding
84
84
  } catch (e) {
@@ -93,8 +93,8 @@ function requireNative() {
93
93
  try {
94
94
  const binding = require('@strands-agents/shell-android-arm-eabi')
95
95
  const bindingPackageVersion = require('@strands-agents/shell-android-arm-eabi/package.json').version
96
- if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
97
- throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
96
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
97
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
98
98
  }
99
99
  return binding
100
100
  } catch (e) {
@@ -114,8 +114,8 @@ function requireNative() {
114
114
  try {
115
115
  const binding = require('@strands-agents/shell-win32-x64-gnu')
116
116
  const bindingPackageVersion = require('@strands-agents/shell-win32-x64-gnu/package.json').version
117
- if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
118
- throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
117
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
118
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
119
119
  }
120
120
  return binding
121
121
  } catch (e) {
@@ -130,8 +130,8 @@ function requireNative() {
130
130
  try {
131
131
  const binding = require('@strands-agents/shell-win32-x64-msvc')
132
132
  const bindingPackageVersion = require('@strands-agents/shell-win32-x64-msvc/package.json').version
133
- if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
134
- throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
133
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
134
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
135
135
  }
136
136
  return binding
137
137
  } catch (e) {
@@ -147,8 +147,8 @@ function requireNative() {
147
147
  try {
148
148
  const binding = require('@strands-agents/shell-win32-ia32-msvc')
149
149
  const bindingPackageVersion = require('@strands-agents/shell-win32-ia32-msvc/package.json').version
150
- if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
151
- throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
150
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
151
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
152
152
  }
153
153
  return binding
154
154
  } catch (e) {
@@ -163,8 +163,8 @@ function requireNative() {
163
163
  try {
164
164
  const binding = require('@strands-agents/shell-win32-arm64-msvc')
165
165
  const bindingPackageVersion = require('@strands-agents/shell-win32-arm64-msvc/package.json').version
166
- if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
167
- throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
166
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
167
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
168
168
  }
169
169
  return binding
170
170
  } catch (e) {
@@ -182,8 +182,8 @@ function requireNative() {
182
182
  try {
183
183
  const binding = require('@strands-agents/shell-darwin-universal')
184
184
  const bindingPackageVersion = require('@strands-agents/shell-darwin-universal/package.json').version
185
- if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
186
- throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
185
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
186
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
187
187
  }
188
188
  return binding
189
189
  } catch (e) {
@@ -198,8 +198,8 @@ function requireNative() {
198
198
  try {
199
199
  const binding = require('@strands-agents/shell-darwin-x64')
200
200
  const bindingPackageVersion = require('@strands-agents/shell-darwin-x64/package.json').version
201
- if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
202
- throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
201
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
202
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
203
203
  }
204
204
  return binding
205
205
  } catch (e) {
@@ -214,8 +214,8 @@ function requireNative() {
214
214
  try {
215
215
  const binding = require('@strands-agents/shell-darwin-arm64')
216
216
  const bindingPackageVersion = require('@strands-agents/shell-darwin-arm64/package.json').version
217
- if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
218
- throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
217
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
218
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
219
219
  }
220
220
  return binding
221
221
  } catch (e) {
@@ -234,8 +234,8 @@ function requireNative() {
234
234
  try {
235
235
  const binding = require('@strands-agents/shell-freebsd-x64')
236
236
  const bindingPackageVersion = require('@strands-agents/shell-freebsd-x64/package.json').version
237
- if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
238
- throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
237
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
238
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
239
239
  }
240
240
  return binding
241
241
  } catch (e) {
@@ -250,8 +250,8 @@ function requireNative() {
250
250
  try {
251
251
  const binding = require('@strands-agents/shell-freebsd-arm64')
252
252
  const bindingPackageVersion = require('@strands-agents/shell-freebsd-arm64/package.json').version
253
- if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
254
- throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
253
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
254
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
255
255
  }
256
256
  return binding
257
257
  } catch (e) {
@@ -271,8 +271,8 @@ function requireNative() {
271
271
  try {
272
272
  const binding = require('@strands-agents/shell-linux-x64-musl')
273
273
  const bindingPackageVersion = require('@strands-agents/shell-linux-x64-musl/package.json').version
274
- if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
275
- throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
274
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
275
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
276
276
  }
277
277
  return binding
278
278
  } catch (e) {
@@ -287,8 +287,8 @@ function requireNative() {
287
287
  try {
288
288
  const binding = require('@strands-agents/shell-linux-x64-gnu')
289
289
  const bindingPackageVersion = require('@strands-agents/shell-linux-x64-gnu/package.json').version
290
- if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
291
- throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
290
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
291
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
292
292
  }
293
293
  return binding
294
294
  } catch (e) {
@@ -305,8 +305,8 @@ function requireNative() {
305
305
  try {
306
306
  const binding = require('@strands-agents/shell-linux-arm64-musl')
307
307
  const bindingPackageVersion = require('@strands-agents/shell-linux-arm64-musl/package.json').version
308
- if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
309
- throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
308
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
309
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
310
310
  }
311
311
  return binding
312
312
  } catch (e) {
@@ -321,8 +321,8 @@ function requireNative() {
321
321
  try {
322
322
  const binding = require('@strands-agents/shell-linux-arm64-gnu')
323
323
  const bindingPackageVersion = require('@strands-agents/shell-linux-arm64-gnu/package.json').version
324
- if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
325
- throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
324
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
325
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
326
326
  }
327
327
  return binding
328
328
  } catch (e) {
@@ -339,8 +339,8 @@ function requireNative() {
339
339
  try {
340
340
  const binding = require('@strands-agents/shell-linux-arm-musleabihf')
341
341
  const bindingPackageVersion = require('@strands-agents/shell-linux-arm-musleabihf/package.json').version
342
- if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
343
- throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
342
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
343
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
344
344
  }
345
345
  return binding
346
346
  } catch (e) {
@@ -355,8 +355,8 @@ function requireNative() {
355
355
  try {
356
356
  const binding = require('@strands-agents/shell-linux-arm-gnueabihf')
357
357
  const bindingPackageVersion = require('@strands-agents/shell-linux-arm-gnueabihf/package.json').version
358
- if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
359
- throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
358
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
359
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
360
360
  }
361
361
  return binding
362
362
  } catch (e) {
@@ -373,8 +373,8 @@ function requireNative() {
373
373
  try {
374
374
  const binding = require('@strands-agents/shell-linux-loong64-musl')
375
375
  const bindingPackageVersion = require('@strands-agents/shell-linux-loong64-musl/package.json').version
376
- if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
377
- throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
376
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
377
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
378
378
  }
379
379
  return binding
380
380
  } catch (e) {
@@ -389,8 +389,8 @@ function requireNative() {
389
389
  try {
390
390
  const binding = require('@strands-agents/shell-linux-loong64-gnu')
391
391
  const bindingPackageVersion = require('@strands-agents/shell-linux-loong64-gnu/package.json').version
392
- if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
393
- throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
392
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
393
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
394
394
  }
395
395
  return binding
396
396
  } catch (e) {
@@ -407,8 +407,8 @@ function requireNative() {
407
407
  try {
408
408
  const binding = require('@strands-agents/shell-linux-riscv64-musl')
409
409
  const bindingPackageVersion = require('@strands-agents/shell-linux-riscv64-musl/package.json').version
410
- if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
411
- throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
410
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
411
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
412
412
  }
413
413
  return binding
414
414
  } catch (e) {
@@ -423,8 +423,8 @@ function requireNative() {
423
423
  try {
424
424
  const binding = require('@strands-agents/shell-linux-riscv64-gnu')
425
425
  const bindingPackageVersion = require('@strands-agents/shell-linux-riscv64-gnu/package.json').version
426
- if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
427
- throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
426
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
427
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
428
428
  }
429
429
  return binding
430
430
  } catch (e) {
@@ -440,8 +440,8 @@ function requireNative() {
440
440
  try {
441
441
  const binding = require('@strands-agents/shell-linux-ppc64-gnu')
442
442
  const bindingPackageVersion = require('@strands-agents/shell-linux-ppc64-gnu/package.json').version
443
- if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
444
- throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
443
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
444
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
445
445
  }
446
446
  return binding
447
447
  } catch (e) {
@@ -456,8 +456,8 @@ function requireNative() {
456
456
  try {
457
457
  const binding = require('@strands-agents/shell-linux-s390x-gnu')
458
458
  const bindingPackageVersion = require('@strands-agents/shell-linux-s390x-gnu/package.json').version
459
- if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
460
- throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
459
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
460
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
461
461
  }
462
462
  return binding
463
463
  } catch (e) {
@@ -476,8 +476,8 @@ function requireNative() {
476
476
  try {
477
477
  const binding = require('@strands-agents/shell-openharmony-arm64')
478
478
  const bindingPackageVersion = require('@strands-agents/shell-openharmony-arm64/package.json').version
479
- if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
480
- throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
479
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
480
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
481
481
  }
482
482
  return binding
483
483
  } catch (e) {
@@ -492,8 +492,8 @@ function requireNative() {
492
492
  try {
493
493
  const binding = require('@strands-agents/shell-openharmony-x64')
494
494
  const bindingPackageVersion = require('@strands-agents/shell-openharmony-x64/package.json').version
495
- if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
496
- throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
495
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
496
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
497
497
  }
498
498
  return binding
499
499
  } catch (e) {
@@ -508,8 +508,8 @@ function requireNative() {
508
508
  try {
509
509
  const binding = require('@strands-agents/shell-openharmony-arm')
510
510
  const bindingPackageVersion = require('@strands-agents/shell-openharmony-arm/package.json').version
511
- if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
512
- throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
511
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
512
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
513
513
  }
514
514
  return binding
515
515
  } catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strands-agents/shell",
3
- "version": "0.1.0",
3
+ "version": "0.3.1",
4
4
  "description": "Strands Shell — a virtual shell sandbox for AI agents (Node.js bindings)",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -24,7 +24,8 @@
24
24
  "x86_64-apple-darwin",
25
25
  "aarch64-apple-darwin",
26
26
  "x86_64-unknown-linux-gnu",
27
- "aarch64-unknown-linux-gnu"
27
+ "aarch64-unknown-linux-gnu",
28
+ "x86_64-pc-windows-msvc"
28
29
  ]
29
30
  },
30
31
  "engines": {
@@ -42,9 +43,10 @@
42
43
  "typescript": "^6.0.3"
43
44
  },
44
45
  "optionalDependencies": {
45
- "@strands-agents/shell-darwin-x64": "0.1.0",
46
- "@strands-agents/shell-darwin-arm64": "0.1.0",
47
- "@strands-agents/shell-linux-x64-gnu": "0.1.0",
48
- "@strands-agents/shell-linux-arm64-gnu": "0.1.0"
46
+ "@strands-agents/shell-darwin-x64": "0.3.1",
47
+ "@strands-agents/shell-darwin-arm64": "0.3.1",
48
+ "@strands-agents/shell-linux-x64-gnu": "0.3.1",
49
+ "@strands-agents/shell-linux-arm64-gnu": "0.3.1",
50
+ "@strands-agents/shell-win32-x64-msvc": "0.3.1"
49
51
  }
50
52
  }