bashkit 0.3.1 → 0.4.0

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/AGENTS.md CHANGED
@@ -98,12 +98,14 @@ This is useful for:
98
98
 
99
99
  | Tool | Purpose | Key Inputs |
100
100
  |------|---------|------------|
101
- | `Bash` | Execute shell commands | `command`, `timeout?`, `description?` |
102
- | `Read` | Read files or list directories | `file_path`, `offset?`, `limit?` |
101
+ | `Bash` | Execute shell commands | `command`, `timeout`, `description` |
102
+ | `Read` | Read files or list directories | `file_path`, `offset`, `limit` |
103
103
  | `Write` | Create/overwrite files | `file_path`, `content` |
104
- | `Edit` | Replace strings in files | `file_path`, `old_string`, `new_string`, `replace_all?` |
105
- | `Glob` | Find files by pattern | `pattern`, `path?` |
106
- | `Grep` | Search file contents | `pattern`, `path?`, `output_mode?`, `-i?`, `-C?` |
104
+ | `Edit` | Replace strings in files | `file_path`, `old_string`, `new_string`, `replace_all` |
105
+ | `Glob` | Find files by pattern | `pattern`, `path` |
106
+ | `Grep` | Search file contents | `pattern`, `path`, `output_mode`, `-i`, `-C` |
107
+
108
+ > **Note on nullable types:** Optional parameters use `T | null` (not `T | undefined`) for OpenAI structured outputs compatibility. AI models should send explicit `null` for parameters they don't want to set. This works with both OpenAI and Anthropic models.
107
109
 
108
110
  ### Optional Tools (via config)
109
111
 
package/README.md CHANGED
@@ -19,6 +19,32 @@ Agentic coding tools for Vercel AI SDK. Give AI agents the ability to execute co
19
19
  - Search the web and fetch URLs
20
20
  - Load skills on-demand via the [Agent Skills](https://agentskills.io) standard
21
21
 
22
+ ## Breaking Changes in v0.4.0
23
+
24
+ ### Nullable Types for OpenAI Compatibility
25
+
26
+ All optional tool parameters now use `.nullable()` instead of `.optional()` in Zod schemas. This change enables compatibility with OpenAI's structured outputs, which require all properties to be in the `required` array.
27
+
28
+ **What changed:**
29
+ - Tool input types changed from `T | undefined` to `T | null`
30
+ - Exported interfaces (`QuestionOption`, `StructuredQuestion`) use `T | null`
31
+ - AI models will send explicit `null` values instead of omitting properties
32
+
33
+ **Migration:**
34
+ ```typescript
35
+ // Before v0.4.0
36
+ const option: QuestionOption = { label: "test", description: undefined };
37
+
38
+ // v0.4.0+
39
+ const option: QuestionOption = { label: "test", description: null };
40
+ ```
41
+
42
+ **Why this matters:**
43
+ - Works with both OpenAI and Anthropic models
44
+ - OpenAI structured outputs require nullable (not optional) fields
45
+ - Anthropic/Claude handles nullable fields correctly
46
+ - The `??` operator handles both `null` and `undefined`, so runtime behavior is unchanged
47
+
22
48
  ## Installation
23
49
 
24
50
  ```bash
@@ -0,0 +1,20 @@
1
+ /**
2
+ * bashkit/cloudflare - Cloudflare Workers compatible exports
3
+ *
4
+ * This module exports only the parts of bashkit that work in Cloudflare Workers.
5
+ * It excludes local sandbox (uses Bun/Node APIs) and bundled ripgrep.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * import { createE2BSandbox, createBashTool } from 'bashkit/cloudflare';
10
+ * ```
11
+ */
12
+ export { createE2BSandbox, type E2BSandboxConfig } from "../sandbox/e2b";
13
+ export type { ExecOptions, ExecResult, Sandbox } from "../sandbox/interface";
14
+ export { createBashTool } from "../tools/bash";
15
+ export { createReadTool } from "../tools/read";
16
+ export { createWriteTool } from "../tools/write";
17
+ export { createEditTool } from "../tools/edit";
18
+ export { createGlobTool } from "../tools/glob";
19
+ export { createGrepTool } from "../tools/grep";
20
+ export type { BashOutput, BashError, ReadOutput, ReadError, WriteOutput, WriteError, EditOutput, EditError, GlobOutput, GlobError, GrepOutput, GrepError, } from "../tools";