@coder/ai-sdk-sandbox 0.4.0 → 0.4.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.
Files changed (2) hide show
  1. package/README.md +22 -20
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -11,12 +11,13 @@ you pass it as the `sandbox` to a `HarnessAgent` exactly like
11
11
  `@ai-sdk/sandbox-vercel`.
12
12
 
13
13
  > **Status:** experimental. This provider tracks the stable AI SDK v7 harness
14
- > packages (`@ai-sdk/harness@^1.0.23`).
14
+ > packages (see the `@ai-sdk/harness` peer range in
15
+ > [`package.json`](./package.json)).
15
16
 
16
17
  ## Install
17
18
 
18
19
  ```bash
19
- npm add @coder/ai-sdk-sandbox @ai-sdk/harness @ai-sdk/harness-claude-code @ai-sdk/provider-utils
20
+ pnpm add @coder/ai-sdk-sandbox @ai-sdk/harness @ai-sdk/harness-claude-code @ai-sdk/provider-utils
20
21
  ```
21
22
 
22
23
  Choose one host transport:
@@ -38,7 +39,7 @@ import { createClaudeCode } from "@ai-sdk/harness-claude-code";
38
39
  import { createCoderWorkspace } from "@coder/ai-sdk-sandbox";
39
40
 
40
41
  const agent = new HarnessAgent({
41
- harness: createClaudeCode({ thinking: "adaptive" }),
42
+ harness: createClaudeCode({ thinking: { type: "adaptive" } }),
42
43
  sandbox: createCoderWorkspace({ workspace: "my-dev-workspace" }),
43
44
  instructions: "You are a careful coding assistant.",
44
45
  });
@@ -92,7 +93,7 @@ the session ends. Add a `create` block:
92
93
 
93
94
  ```ts
94
95
  const agent = new HarnessAgent({
95
- harness: createClaudeCode({ thinking: "adaptive" }),
96
+ harness: createClaudeCode({ thinking: { type: "adaptive" } }),
96
97
  sandbox: createCoderWorkspace({
97
98
  create: {
98
99
  template: "docker", // required: the template to create from
@@ -201,7 +202,7 @@ For an interactive chat in your terminal instead of one-shot `generate()` calls,
201
202
  wrap the same agent with the AI SDK terminal UI ([`@ai-sdk/tui`](https://ai-sdk.dev/v7/docs/ai-sdk-harnesses/terminal-ui)):
202
203
 
203
204
  ```bash
204
- npm add @ai-sdk/tui
205
+ pnpm add @ai-sdk/tui
205
206
  ```
206
207
 
207
208
  The TUI drives a session-less agent, so adapt the `HarnessAgent` (whose
@@ -215,7 +216,7 @@ import { runAgentTUI, type AgentTUIAgent } from "@ai-sdk/tui";
215
216
  import { createCoderWorkspace } from "@coder/ai-sdk-sandbox";
216
217
 
217
218
  const agent = new HarnessAgent({
218
- harness: createClaudeCode({ thinking: "adaptive" }),
219
+ harness: createClaudeCode({ thinking: { type: "adaptive" } }),
219
220
  sandbox: createCoderWorkspace({ workspace: "my-dev-ws" }),
220
221
  // or, to create a fresh workspace per session from a template:
221
222
  // sandbox: createCoderWorkspace({ create: { template: 'claude-code-test' } }),
@@ -389,27 +390,28 @@ and a full Claude Code turn with tool use (`scripts/e2e-claude.ts`).
389
390
  ## Development
390
391
 
391
392
  ```bash
392
- npm install
393
- npm run typecheck # tsc against the real harness types
394
- npm test # vitest: unit + local integration (fake `coder` + `ssh`)
395
- npm run build # tsup dist/ (ESM + d.ts)
393
+ # From this package's directory (packages/sandbox):
394
+ pnpm install
395
+ pnpm typecheck # tsc against the real harness types
396
+ pnpm test # vitest: unit + local integration (fake `coder` + `ssh`)
397
+ pnpm build # tsup → dist/ (ESM + d.ts)
396
398
 
397
- # Formatting & linting (Biome):
398
- npm run format # biome format --write . (apply formatting)
399
- npm run lint # biome lint . (report lint issues)
400
- npm run check # biome check . (format + lint, read-only; for CI)
399
+ # Formatting & linting are root-level scripts (`-w` runs them from anywhere in the repo):
400
+ pnpm -w format # oxfmt (apply formatting)
401
+ pnpm -w lint # oxlint (report lint issues)
402
+ pnpm -w check # format check + lint + typecheck (CI gate)
401
403
 
402
404
  # End-to-end against a real workspace (needs the coder CLI + a running workspace):
403
- npm run verify:real -- my-ws
405
+ pnpm verify:real my-ws
404
406
 
405
- # The same contract through Coderd directly. The CLI is used only to retrieve
406
- # the already-authenticated token for this shell; CoderNativeTransport never invokes it:
407
+ # The same contract through Coderd directly. The CLI is used only to mint a
408
+ # token for this shell; CoderNativeTransport never invokes it:
407
409
  CODER_URL=https://coder.example.com \
408
- CODER_SESSION_TOKEN="$(coder login token)" \
409
- npm run verify:native -- my-ws
410
+ CODER_SESSION_TOKEN="$(coder tokens create --name ai-sdk-sandbox)" \
411
+ pnpm verify:native my-ws
410
412
 
411
413
  # End-to-end of create mode (creates a throwaway workspace, then deletes it):
412
- npm run verify:create -- docker
414
+ pnpm verify:create docker
413
415
  ```
414
416
 
415
417
  The local integration tests exercise the real transport (argument building,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coder/ai-sdk-sandbox",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Coder workspace sandbox provider for the Vercel AI SDK v7 HarnessAgent",
5
5
  "keywords": [
6
6
  "ai-sdk",