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 +7 -5
- package/README.md +26 -0
- package/dist/cloudflare/index.d.ts +20 -0
- package/dist/cloudflare/index.js +1251 -0
- package/dist/durable/durable-session.d.ts +220 -0
- package/dist/durable/index.d.ts +41 -0
- package/dist/durable/index.js +159 -0
- package/dist/durable/schema.d.ts +51 -0
- package/dist/durable/types.d.ts +208 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +656 -140
- package/dist/react/index.d.ts +42 -0
- package/dist/react/index.js +10 -0
- package/dist/react/types.d.ts +333 -0
- package/dist/react/use-agent.d.ts +33 -0
- package/dist/react/use-durable-chat.d.ts +39 -0
- package/dist/tools/ask-user.d.ts +12 -12
- package/dist/tools/bash.d.ts +3 -3
- package/dist/tools/edit.d.ts +1 -1
- package/dist/tools/glob.d.ts +1 -1
- package/dist/tools/grep.d.ts +12 -12
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/read.d.ts +2 -2
- package/dist/tools/task.d.ts +8 -6
- package/dist/tools/web-search.d.ts +2 -2
- package/dist/utils/debug.d.ts +83 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/workflow.js +827 -234
- package/package.json +7 -2
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
|
|
102
|
-
| `Read` | Read files or list directories | `file_path`, `offset
|
|
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
|
|
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";
|