agents 0.33.0 → 0.34.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/README.md +1 -1
- package/dist/{agent-routing-vVMA7m8Y.d.ts → agent-routing-BSoZzNiP.d.ts} +537 -373
- package/dist/agent-routing.d.ts +1 -1
- package/dist/agent-tool-types.d.ts +1 -1
- package/dist/{agent-tools-gGXXkf1z.d.ts → agent-tools-Be-hpRpH.d.ts} +2 -2
- package/dist/agent-tools.d.ts +1 -1
- package/dist/{ai-sdk-Kon40i0q.js → ai-sdk-CRMlEBX7.js} +75 -44
- package/dist/ai-sdk-CRMlEBX7.js.map +1 -0
- package/dist/browser/ai.js +1 -1
- package/dist/browser/index.d.ts +7 -3
- package/dist/browser/index.js +2 -2
- package/dist/browser/tools/ai-sdk.d.ts +68 -3
- package/dist/browser/tools/pi.d.ts +2 -2
- package/dist/browser/tools/tanstack-ai.d.ts +2 -2
- package/dist/{browser-CI97khiJ.d.ts → browser-C9T74n4c.d.ts} +84 -5
- package/dist/{browser-tool-Cxtiwfua.d.ts → browser-tool-DxAYQY9T.d.ts} +2 -2
- package/dist/capability-DBAKc6UZ.js.map +1 -1
- package/dist/{capability-runner-BiVUtjqC.d.ts → capability-runner-uFOdSANC.d.ts} +3 -2
- package/dist/chat/index.d.ts +37 -6
- package/dist/chat/index.js +39 -3
- package/dist/chat/index.js.map +1 -1
- package/dist/chat-sdk/index.d.ts +3 -3
- package/dist/chat-sdk/index.js +1 -1
- package/dist/cli.js +64 -63
- package/dist/client-CkT8voRY.js +3740 -0
- package/dist/client-CkT8voRY.js.map +1 -0
- package/dist/{client-eSfgYvd3.d.ts → client-DqS6oequ.d.ts} +2 -2
- package/dist/client.d.ts +1 -1
- package/dist/{connector-Dl098To-.js → connector-Bphz6wIw.js} +16 -4
- package/dist/connector-Bphz6wIw.js.map +1 -0
- package/dist/{conversations-FjHDRZyD.d.ts → conversations-CoAYNW_q.d.ts} +4 -4
- package/dist/{current-agent-CKgT5d1O.d.ts → current-agent-DShbQHDO.d.ts} +24 -3
- package/dist/current-agent-DhoDkSnH.js.map +1 -1
- package/dist/{do-oauth-client-provider-DtNqv7oj.d.ts → do-oauth-client-provider-BsT8-vtd.d.ts} +22 -2
- package/dist/{durable-object-lifecycle-DOI_bzCH.d.ts → durable-object-lifecycle-CRCA6O0W.d.ts} +2 -2
- package/dist/experimental/channels/index.d.ts +2 -2
- package/dist/experimental/channels/web/index.d.ts +2 -2
- package/dist/experimental/channels/web/index.js +1 -1
- package/dist/experimental/webmcp.js +1 -1
- package/dist/{gateway-BFO6vRDn.d.ts → gateway-Dz8zyZBJ.d.ts} +2 -2
- package/dist/harness/ai-sdk/index.d.ts +2 -2
- package/dist/harness/container/index.d.ts +2 -2
- package/dist/harness/container/index.js +1 -1
- package/dist/harness/container/index.js.map +1 -1
- package/dist/harness/opencode/index.d.ts +1 -1
- package/dist/harness/pi/index.d.ts +128 -12
- package/dist/harness/pi/index.js +128 -20
- package/dist/harness/pi/index.js.map +1 -1
- package/dist/harness/think/index.d.ts +2 -2
- package/dist/{images-CfuRCjwq.js → images-D4gtE06D.js} +119 -27
- package/dist/images-D4gtE06D.js.map +1 -0
- package/dist/{index-8k4qsX1T.d.ts → index-BXVgv6tp.d.ts} +4 -4
- package/dist/{index-BEL3ZV-s.d.ts → index-Cs7Ed9la.d.ts} +2 -2
- package/dist/{index-CBt8oRJt.d.ts → index-XiZxauMU.d.ts} +3 -3
- package/dist/index.d.ts +21 -21
- package/dist/index.js +2 -2
- package/dist/{input-schema-0uUu392-.js → input-schema-D6GilRXI.js} +2 -2
- package/dist/{input-schema-0uUu392-.js.map → input-schema-D6GilRXI.js.map} +1 -1
- package/dist/{input-schema-waggtYrH.js → input-schema-y8W5bOdM.js} +2 -2
- package/dist/{input-schema-waggtYrH.js.map → input-schema-y8W5bOdM.js.map} +1 -1
- package/dist/internal_context.d.ts +1 -1
- package/dist/lifecycle/index.d.ts +3 -3
- package/dist/lifecycle/index.js +1 -1
- package/dist/{lifecycle-v1rKHV2C.js → lifecycle-CB5Dmtrt.js} +126 -38
- package/dist/lifecycle-CB5Dmtrt.js.map +1 -0
- package/dist/mcp/client/do-oauth-client-provider.d.ts +1 -1
- package/dist/mcp/client/do-oauth-client-provider.js +45 -2
- package/dist/mcp/client/do-oauth-client-provider.js.map +1 -1
- package/dist/mcp/client/index.d.ts +42 -36
- package/dist/mcp/client/index.js +2 -2
- package/dist/mcp/client/x402.d.ts +8 -8
- package/dist/mcp/index.d.ts +17 -17
- package/dist/mcp/index.js +5 -5
- package/dist/mcp/index.js.map +1 -1
- package/dist/models/ai-sdk/index.d.ts +9 -5
- package/dist/models/ai-sdk/index.js +1 -1
- package/dist/models/opencode/index.d.ts +3 -3
- package/dist/models/opencode/index.js +2 -2
- package/dist/models/opencode/index.js.map +1 -1
- package/dist/models/pi-ai/index.d.ts +4 -4
- package/dist/models/pi-ai/index.js +53 -29
- package/dist/models/pi-ai/index.js.map +1 -1
- package/dist/{options-CiIsJHXR.d.ts → options-CiXaymmZ.d.ts} +2 -2
- package/dist/queue/index.d.ts +1 -1
- package/dist/queue/index.js +1 -1
- package/dist/{queue-CcIjVYTE.js → queue-B_wl6K0Z.js} +24 -5
- package/dist/queue-B_wl6K0Z.js.map +1 -0
- package/dist/react.d.ts +2 -2
- package/dist/routing/index.d.ts +2 -2
- package/dist/{scheduler-BCLESHSC.d.ts → scheduler-CTpR0Ct0.d.ts} +2 -2
- package/dist/{scheduler-FIHv2-kJ.js → scheduler-DGNEmxQR.js} +2 -1
- package/dist/scheduler-DGNEmxQR.js.map +1 -0
- package/dist/schedules/index.d.ts +1 -1
- package/dist/schedules/index.js +1 -1
- package/dist/serializable.d.ts +1 -1
- package/dist/session-CRY0bGiI.js.map +1 -1
- package/dist/sessions/index.d.ts +1 -1
- package/dist/{settings-Dk2il2Hf.js → settings-D2F_qONv.js} +11 -2
- package/dist/settings-D2F_qONv.js.map +1 -0
- package/dist/{src-DoGNJ4Ud.js → src-BO1FdLK1.js} +145 -86
- package/dist/src-BO1FdLK1.js.map +1 -0
- package/dist/state/index.d.ts +1 -1
- package/dist/streams/index.d.ts +1 -1
- package/dist/{streams-vrCtbUIn.d.ts → streams-CAZxZBDg.d.ts} +2 -2
- package/dist/sub-routing.d.ts +12 -12
- package/dist/tasks/index.d.ts +1 -1
- package/dist/tasks/index.js +1 -1
- package/dist/{tasks-BN_5AWqI.js → tasks-Cf_UfEO4.js} +2 -1
- package/dist/{tasks-BN_5AWqI.js.map → tasks-Cf_UfEO4.js.map} +1 -1
- package/dist/{tasks-E89KdwkS.d.ts → tasks-Cs8ilctE.d.ts} +2 -2
- package/dist/{tool-DkT_DJBm.js → tool-CmAGY6Fo.js} +24 -3
- package/dist/tool-CmAGY6Fo.js.map +1 -0
- package/dist/{tool-CxKsvxjm.js → tool-Kxcj8_22.js} +24 -4
- package/dist/tool-Kxcj8_22.js.map +1 -0
- package/dist/{transport-5moD2pW5.d.ts → transport-hV8AW4Bv.d.ts} +45 -12
- package/dist/voice/index.d.ts +2 -2
- package/dist/web/fetch/index.js +1 -1
- package/dist/web/fetch/tools/ai-sdk.js +2 -2
- package/dist/web/fetch/tools/pi.d.ts +5 -0
- package/dist/web/fetch/tools/pi.js +25 -2
- package/dist/web/fetch/tools/pi.js.map +1 -1
- package/dist/web/fetch/tools/tanstack-ai.js +2 -2
- package/dist/web/search/index.js +1 -1
- package/dist/web/search/tools/ai-sdk.js +2 -2
- package/dist/web/search/tools/pi.d.ts +4 -0
- package/dist/web/search/tools/pi.js +23 -2
- package/dist/web/search/tools/pi.js.map +1 -1
- package/dist/web/search/tools/tanstack-ai.js +2 -2
- package/dist/websockets/index.d.ts +2 -2
- package/dist/websockets/index.js +1 -1
- package/dist/{websockets-C6SJtWCJ.js → websockets-W4uhRg4-.js} +68 -5
- package/dist/websockets-W4uhRg4-.js.map +1 -0
- package/dist/workflow-types.d.ts +1 -1
- package/dist/workflows.d.ts +1 -1
- package/docs/agent-class.md +30 -4
- package/docs/browse-the-web.md +14 -0
- package/docs/chat-agents.md +13 -10
- package/docs/client-tools-continuation.md +1 -1
- package/docs/codemode.md +1 -1
- package/docs/configuration.md +6 -3
- package/docs/cross-domain-authentication.md +1 -1
- package/docs/fetch-the-web.md +20 -0
- package/docs/harnesses/pi.md +211 -22
- package/docs/harnesses/think.md +1 -1
- package/docs/http-websockets.md +40 -32
- package/docs/human-in-the-loop.md +2 -2
- package/docs/lifecycle.md +56 -0
- package/docs/mcp-client.md +104 -7
- package/docs/models-pi-ai.md +24 -10
- package/docs/models.md +42 -17
- package/docs/resumable-streaming.md +1 -1
- package/docs/retries.md +3 -6
- package/docs/search-the-web.md +10 -0
- package/docs/voice.md +1 -1
- package/package.json +13 -12
- package/dist/ai-sdk-CpuRsjP5.d.ts +0 -72
- package/dist/ai-sdk-Kon40i0q.js.map +0 -1
- package/dist/client-DMWujQJ1.js +0 -2325
- package/dist/client-DMWujQJ1.js.map +0 -1
- package/dist/connector-Dl098To-.js.map +0 -1
- package/dist/images-CfuRCjwq.js.map +0 -1
- package/dist/lifecycle-v1rKHV2C.js.map +0 -1
- package/dist/queue-CcIjVYTE.js.map +0 -1
- package/dist/scheduler-FIHv2-kJ.js.map +0 -1
- package/dist/settings-Dk2il2Hf.js.map +0 -1
- package/dist/src-DoGNJ4Ud.js.map +0 -1
- package/dist/tool-CxKsvxjm.js.map +0 -1
- package/dist/tool-DkT_DJBm.js.map +0 -1
- package/dist/websockets-C6SJtWCJ.js.map +0 -1
package/docs/search-the-web.md
CHANGED
|
@@ -90,6 +90,16 @@ The API has no pagination. The tool description tells the model to search again
|
|
|
90
90
|
|
|
91
91
|
Results are for discovery. To let the model read the pages it finds, add the [`web_fetch` tool](./fetch-the-web.md) beside `web_search`; the `web_search` description tells the model to fetch result URLs with `web_fetch` when it is available.
|
|
92
92
|
|
|
93
|
+
## In pi's code mode
|
|
94
|
+
|
|
95
|
+
With pi-durable's code mode installed beside the tool (setup in [Browse the Web](./browse-the-web.md#in-pis-code-mode)), a script calls `tools.web_search({ query, limit })` and gets the results as an object, not the model's text:
|
|
96
|
+
|
|
97
|
+
```ts
|
|
98
|
+
{ query, items: [{ title, url, description?, lastModifiedDate? }] }
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Descriptions are trimmed as they are for the model. A failed search rejects with the model's text. The model's own result is the same text as before. [Fetch the Web](./fetch-the-web.md#in-pis-code-mode) shows a script that searches, then reads the results.
|
|
102
|
+
|
|
93
103
|
## Failures
|
|
94
104
|
|
|
95
105
|
A failed search becomes a `WebSearchError` with `status`, `code`, `retryable`, and `requestId` (AI Gateway's id for the request, for the gateway log). Every error has a `code`: the API's own when it sends one, for example `web_search_payment_required`, otherwise one derived from the HTTP status, such as `web_search_rate_limited` or `web_search_unavailable`. On a runtime older than the one above, the binding has no `websearch()` and the search fails with code `web_search_unsupported_runtime`.
|
package/docs/voice.md
CHANGED
|
@@ -199,7 +199,7 @@ async onTurn(transcript: string, context: VoiceTurnContext) {
|
|
|
199
199
|
const workersai = createWorkersAI({ binding: this.env.AI });
|
|
200
200
|
|
|
201
201
|
const result = streamText({
|
|
202
|
-
model: workersai("@cf/
|
|
202
|
+
model: workersai("@cf/deepseek-ai/deepseek-v4.1-flash-1017"),
|
|
203
203
|
system: "You are a helpful voice assistant. Keep responses concise.",
|
|
204
204
|
messages: [
|
|
205
205
|
...context.messages.map(m => ({
|
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"bin": {
|
|
13
13
|
"agents": "./dist/cli.js"
|
|
14
14
|
},
|
|
15
|
-
"version": "0.
|
|
15
|
+
"version": "0.34.0",
|
|
16
16
|
"sideEffects": [
|
|
17
17
|
"./dist/cli.js"
|
|
18
18
|
],
|
|
@@ -46,12 +46,12 @@
|
|
|
46
46
|
"@ai-sdk/react": "^4.0.0",
|
|
47
47
|
"@ai-sdk/valibot": "3.0.6",
|
|
48
48
|
"@cloudflare/codemode": "^0.5.6",
|
|
49
|
-
"@earendil-works/chord": "~1.
|
|
50
|
-
"@earendil-works/pi-ai": "~1.
|
|
51
|
-
"@earendil-works/pi-codemode": "~1.
|
|
52
|
-
"@earendil-works/pi-durable": "~1.
|
|
53
|
-
"@earendil-works/pi-schema": "~1.
|
|
54
|
-
"@earendil-works/pi-tui": "1.
|
|
49
|
+
"@earendil-works/chord": "~1.6.0",
|
|
50
|
+
"@earendil-works/pi-ai": "~1.6.0",
|
|
51
|
+
"@earendil-works/pi-codemode": "~1.6.0",
|
|
52
|
+
"@earendil-works/pi-durable": "~1.6.0",
|
|
53
|
+
"@earendil-works/pi-schema": "~1.6.0",
|
|
54
|
+
"@earendil-works/pi-tui": "1.6.0",
|
|
55
55
|
"@modelcontextprotocol/client": "2.4.0",
|
|
56
56
|
"@modelcontextprotocol/conformance-v2": "npm:@modelcontextprotocol/conformance@0.2.0-alpha.12",
|
|
57
57
|
"@modelcontextprotocol/sdk": "1.32.2",
|
|
@@ -66,9 +66,10 @@
|
|
|
66
66
|
"ai": "^7.0.0",
|
|
67
67
|
"chat": "^4.31.0",
|
|
68
68
|
"esbuild": "^0.28.1",
|
|
69
|
-
"glob": "^
|
|
69
|
+
"glob": "^14.0.2",
|
|
70
70
|
"highlight.js": "11.12.0",
|
|
71
71
|
"just-bash": "^3.0.2",
|
|
72
|
+
"msw": "^2.7.0",
|
|
72
73
|
"react": "^19.2.7",
|
|
73
74
|
"valibot": "1.4.2",
|
|
74
75
|
"zod": "^4.6.7"
|
|
@@ -77,10 +78,10 @@
|
|
|
77
78
|
"@ai-sdk/provider": "^4.0.0",
|
|
78
79
|
"@ai-sdk/react": "^3.0.0 || ^4.0.0",
|
|
79
80
|
"@cloudflare/codemode": ">=0.5.0",
|
|
80
|
-
"@earendil-works/chord": "~1.
|
|
81
|
-
"@earendil-works/pi-ai": "~1.
|
|
82
|
-
"@earendil-works/pi-durable": "~1.
|
|
83
|
-
"@earendil-works/pi-schema": "~1.
|
|
81
|
+
"@earendil-works/chord": "~1.6.0",
|
|
82
|
+
"@earendil-works/pi-ai": "~1.6.0",
|
|
83
|
+
"@earendil-works/pi-durable": "~1.6.0",
|
|
84
|
+
"@earendil-works/pi-schema": "~1.6.0",
|
|
84
85
|
"@modelcontextprotocol/client": "2.4.0",
|
|
85
86
|
"@modelcontextprotocol/sdk": "1.32.2",
|
|
86
87
|
"@modelcontextprotocol/server": "2.4.0",
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
n as BrowserToolOptions,
|
|
3
|
-
r as BrowserToolOutput,
|
|
4
|
-
t as BrowserToolInput
|
|
5
|
-
} from "./browser-tool-Cxtiwfua.js";
|
|
6
|
-
import { FlexibleSchema, JSONValue } from "ai";
|
|
7
|
-
|
|
8
|
-
//#region src/browser/tool-helpers.d.ts
|
|
9
|
-
/** What the model sees in place of a browser tool's output. */
|
|
10
|
-
type BrowserModelOutput =
|
|
11
|
-
| {
|
|
12
|
-
type: "text";
|
|
13
|
-
value: string;
|
|
14
|
-
}
|
|
15
|
-
| {
|
|
16
|
-
type: "json";
|
|
17
|
-
value: JSONValue;
|
|
18
|
-
};
|
|
19
|
-
//#endregion
|
|
20
|
-
//#region src/browser/tools/ai-sdk.d.ts
|
|
21
|
-
/**
|
|
22
|
-
* The AI SDK tool {@link browserTool} returns. Assignable to the AI SDK's
|
|
23
|
-
* `Tool`, and `execute` / `toModelOutput` are always present.
|
|
24
|
-
*/
|
|
25
|
-
interface BrowserTool {
|
|
26
|
-
description: string;
|
|
27
|
-
inputSchema: FlexibleSchema<BrowserToolInput>;
|
|
28
|
-
execute(
|
|
29
|
-
input: BrowserToolInput,
|
|
30
|
-
options: unknown
|
|
31
|
-
): Promise<BrowserToolOutput>;
|
|
32
|
-
toModelOutput(options: { output: BrowserToolOutput }): BrowserModelOutput;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Create an AI SDK tool that lets the model drive a persistent browser with
|
|
36
|
-
* JavaScript and the Chrome DevTools Protocol.
|
|
37
|
-
*
|
|
38
|
-
* The browser outlives each run: tabs, cookies, and logins carry over. The
|
|
39
|
-
* model never starts, closes, or resets it, and `sessionId: "active"`
|
|
40
|
-
* addresses the tab it last worked in. If the browser had to be replaced
|
|
41
|
-
* (it expired or was closed), the code still runs in the new browser and the
|
|
42
|
-
* result's `notice` says so.
|
|
43
|
-
*
|
|
44
|
-
* Browser Run only (Chromium). Guardrails, `keepAliveMs`, and recording are
|
|
45
|
-
* set on the `Browser`'s provider.
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* ```ts
|
|
49
|
-
* import { Browser, browserRun } from "agents/browser";
|
|
50
|
-
* import { browserTool } from "agents/browser/ai-sdk";
|
|
51
|
-
*
|
|
52
|
-
* export class MyAgent extends Agent<Env> {
|
|
53
|
-
* browser = new Browser({ provider: browserRun(this.env.BROWSER) });
|
|
54
|
-
*
|
|
55
|
-
* constructor(ctx: AgentContext, env: Env) {
|
|
56
|
-
* super(ctx, env);
|
|
57
|
-
* this.lifecycle.use(this.browser);
|
|
58
|
-
* }
|
|
59
|
-
*
|
|
60
|
-
* async onChatMessage() {
|
|
61
|
-
* const tools = {
|
|
62
|
-
* browser: browserTool({ browser: this.browser, loader: this.env.LOADER })
|
|
63
|
-
* };
|
|
64
|
-
* // …pass `tools` to streamText / generateText
|
|
65
|
-
* }
|
|
66
|
-
* }
|
|
67
|
-
* ```
|
|
68
|
-
*/
|
|
69
|
-
declare function browserTool(options: BrowserToolOptions): BrowserTool;
|
|
70
|
-
//#endregion
|
|
71
|
-
export { browserTool as n, BrowserTool as t };
|
|
72
|
-
//# sourceMappingURL=ai-sdk-CpuRsjP5.d.ts.map
|