@cloudflare/ai-chat 0.1.2 → 0.1.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.
@@ -10,15 +10,16 @@ export default defineConfig({
10
10
  testDir: e2eDir,
11
11
  testMatch: "*.spec.ts",
12
12
  timeout: 30_000,
13
- retries: 0,
13
+ retries: 3,
14
14
  workers: 1, // Sequential — single wrangler dev instance
15
- // Kill stale processes on the test port before starting
16
- globalSetup: [join(e2eDir, "global-setup.ts")],
17
15
  use: {
18
16
  baseURL: `http://localhost:${PORT}`
19
17
  },
20
18
  webServer: {
21
- command: `npx wrangler dev --config ${configPath} --port ${PORT}`,
19
+ // Kill stale processes on the port before starting wrangler.
20
+ // This must be part of the command (not globalSetup) because
21
+ // Playwright starts the webServer before running globalSetup.
22
+ command: `lsof -ti tcp:${PORT} | xargs kill -9 2>/dev/null; npx wrangler dev --config ${configPath} --port ${PORT}`,
22
23
  port: PORT,
23
24
  reuseExistingServer: !process.env.CI,
24
25
  timeout: 20_000
package/e2e/worker.ts CHANGED
@@ -68,7 +68,6 @@ export class LlmChatAgent extends AIChatAgent<Env> {
68
68
  };
69
69
 
70
70
  const result = streamText({
71
- // @ts-expect-error — model not yet in workers-ai-provider types
72
71
  model: workersai("@cf/zai-org/glm-4.7-flash"),
73
72
  system:
74
73
  "You are a helpful test assistant. Keep responses very short (1-2 sentences max). " +
@@ -95,7 +94,6 @@ export class ClientToolAgent extends AIChatAgent<Env> {
95
94
  const workersai = createWorkersAI({ binding: this.env.AI });
96
95
 
97
96
  const result = streamText({
98
- // @ts-expect-error — model not yet in workers-ai-provider types
99
97
  model: workersai("@cf/zai-org/glm-4.7-flash"),
100
98
  system:
101
99
  "You are a test assistant. Always use the getUserLocation tool when asked about location.",
@@ -1,5 +1,5 @@
1
1
  {
2
- "ai": { "binding": "AI" },
2
+ "ai": { "binding": "AI", "remote": true },
3
3
  "compatibility_date": "2026-01-28",
4
4
  "compatibility_flags": ["nodejs_compat"],
5
5
  "durable_objects": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudflare/ai-chat",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Cloudflare Agents (x) AI SDK Chat",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -21,14 +21,14 @@
21
21
  "devDependencies": {
22
22
  "@playwright/test": "^1.58.2",
23
23
  "@types/react": "^19.2.14",
24
- "ai": "^6.0.88",
24
+ "ai": "^6.0.97",
25
25
  "react": "^19.2.4",
26
26
  "vitest-browser-react": "^1.0.1",
27
27
  "zod": "^4.3.6"
28
28
  },
29
29
  "peerDependencies": {
30
30
  "@ai-sdk/react": "^3.0.0",
31
- "agents": "^0.5.0",
31
+ "agents": "^0.6.0",
32
32
  "ai": "^6.0.0",
33
33
  "react": "^19.0.0",
34
34
  "zod": "^3.25.0 || ^4.0.0"