@cloudflare/think 0.1.0 → 0.1.2
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 +51 -107
- package/dist/{classPrivateFieldSet2-COLddhya.js → classPrivateFieldSet2-D-GfNNJe.js} +5 -5
- package/dist/extensions/index.d.ts +1 -1
- package/dist/extensions/index.js +2 -3
- package/dist/extensions/index.js.map +1 -1
- package/dist/{index-BlcvIdWK.d.ts → index-CAMRySsy.d.ts} +1 -1
- package/dist/{manager-DIV0gQf3.js → manager-UjPxAz2E.js} +8 -4
- package/dist/{manager-DIV0gQf3.js.map → manager-UjPxAz2E.js.map} +1 -1
- package/dist/think.d.ts +50 -152
- package/dist/think.js +441 -424
- package/dist/think.js.map +1 -1
- package/dist/tools/execute.d.ts +5 -5
- package/dist/tools/extensions.d.ts +4 -4
- package/dist/tools/extensions.js +1 -1
- package/dist/tools/workspace.d.ts +16 -16
- package/dist/tools/workspace.js +1 -1
- package/dist/tools/workspace.js.map +1 -1
- package/package.json +10 -19
- package/dist/classPrivateMethodInitSpec-CdQXQy1O.js +0 -7
- package/dist/index-C4OTSwUW.d.ts +0 -193
- package/dist/message-builder.d.ts +0 -51
- package/dist/message-builder.js +0 -217
- package/dist/message-builder.js.map +0 -1
- package/dist/session/index.d.ts +0 -22
- package/dist/session/index.js +0 -2
- package/dist/session-C6ZU_1zM.js +0 -507
- package/dist/session-C6ZU_1zM.js.map +0 -1
- package/dist/transport.d.ts +0 -69
- package/dist/transport.js +0 -166
- package/dist/transport.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudflare/think",
|
|
3
|
-
"description": "Opinionated
|
|
3
|
+
"description": "Opinionated chat agent with agentic loop, stream resumption, client tools, and extensions",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"cloudflare",
|
|
6
6
|
"agents",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"tools"
|
|
10
10
|
],
|
|
11
11
|
"type": "module",
|
|
12
|
-
"version": "0.1.
|
|
12
|
+
"version": "0.1.2",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"repository": {
|
|
15
15
|
"directory": "packages/think",
|
|
@@ -21,20 +21,23 @@
|
|
|
21
21
|
"url": "https://github.com/cloudflare/agents/issues"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@cloudflare/shell": "^0.
|
|
25
|
-
"ai": "^6.0.
|
|
24
|
+
"@cloudflare/shell": "^0.3.1",
|
|
25
|
+
"ai": "^6.0.142",
|
|
26
26
|
"zod": "^4.3.6"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@cloudflare/codemode": "^0.3.
|
|
30
|
-
"@cloudflare/shell": "^0.
|
|
31
|
-
"agents": "^0.
|
|
29
|
+
"@cloudflare/codemode": "^0.3.3",
|
|
30
|
+
"@cloudflare/shell": "^0.3.1",
|
|
31
|
+
"agents": "^0.9.0",
|
|
32
32
|
"ai": "^6.0.0",
|
|
33
33
|
"zod": "^4.0.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependenciesMeta": {
|
|
36
36
|
"@cloudflare/codemode": {
|
|
37
37
|
"optional": true
|
|
38
|
+
},
|
|
39
|
+
"@cloudflare/shell": {
|
|
40
|
+
"optional": true
|
|
38
41
|
}
|
|
39
42
|
},
|
|
40
43
|
"exports": {
|
|
@@ -42,10 +45,6 @@
|
|
|
42
45
|
"types": "./dist/think.d.ts",
|
|
43
46
|
"import": "./dist/think.js"
|
|
44
47
|
},
|
|
45
|
-
"./session": {
|
|
46
|
-
"types": "./dist/session/index.d.ts",
|
|
47
|
-
"import": "./dist/session/index.js"
|
|
48
|
-
},
|
|
49
48
|
"./extensions": {
|
|
50
49
|
"types": "./dist/extensions/index.d.ts",
|
|
51
50
|
"import": "./dist/extensions/index.js"
|
|
@@ -54,14 +53,6 @@
|
|
|
54
53
|
"types": "./dist/tools/workspace.d.ts",
|
|
55
54
|
"import": "./dist/tools/workspace.js"
|
|
56
55
|
},
|
|
57
|
-
"./message-builder": {
|
|
58
|
-
"types": "./dist/message-builder.d.ts",
|
|
59
|
-
"import": "./dist/message-builder.js"
|
|
60
|
-
},
|
|
61
|
-
"./transport": {
|
|
62
|
-
"types": "./dist/transport.d.ts",
|
|
63
|
-
"import": "./dist/transport.js"
|
|
64
|
-
},
|
|
65
56
|
"./tools/execute": {
|
|
66
57
|
"types": "./dist/tools/execute.d.ts",
|
|
67
58
|
"import": "./dist/tools/execute.js"
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { a as _checkPrivateRedeclaration } from "./classPrivateFieldSet2-COLddhya.js";
|
|
2
|
-
//#region \0@oxc-project+runtime@0.115.0/helpers/classPrivateMethodInitSpec.js
|
|
3
|
-
function _classPrivateMethodInitSpec(e, a) {
|
|
4
|
-
_checkPrivateRedeclaration(e, a), a.add(e);
|
|
5
|
-
}
|
|
6
|
-
//#endregion
|
|
7
|
-
export { _classPrivateMethodInitSpec as t };
|
package/dist/index-C4OTSwUW.d.ts
DELETED
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
import { UIMessage } from "ai";
|
|
2
|
-
|
|
3
|
-
//#region src/session/storage.d.ts
|
|
4
|
-
interface Session {
|
|
5
|
-
id: string;
|
|
6
|
-
name: string;
|
|
7
|
-
created_at: string;
|
|
8
|
-
updated_at: string;
|
|
9
|
-
}
|
|
10
|
-
interface Compaction {
|
|
11
|
-
id: string;
|
|
12
|
-
session_id: string;
|
|
13
|
-
summary: string;
|
|
14
|
-
from_message_id: string;
|
|
15
|
-
to_message_id: string;
|
|
16
|
-
created_at: string;
|
|
17
|
-
}
|
|
18
|
-
//#endregion
|
|
19
|
-
//#region src/session/index.d.ts
|
|
20
|
-
/**
|
|
21
|
-
* Truncate from the head (keep the end of the content).
|
|
22
|
-
*/
|
|
23
|
-
declare function truncateHead(text: string, maxChars?: number): string;
|
|
24
|
-
/**
|
|
25
|
-
* Truncate from the tail (keep the start of the content).
|
|
26
|
-
*/
|
|
27
|
-
declare function truncateTail(text: string, maxChars?: number): string;
|
|
28
|
-
/**
|
|
29
|
-
* Truncate by line count (keep the first N lines).
|
|
30
|
-
*/
|
|
31
|
-
declare function truncateLines(text: string, maxLines?: number): string;
|
|
32
|
-
/**
|
|
33
|
-
* Truncate from both ends, keeping the start and end.
|
|
34
|
-
*/
|
|
35
|
-
declare function truncateMiddle(text: string, maxChars?: number): string;
|
|
36
|
-
/**
|
|
37
|
-
* Smart truncation for tool output.
|
|
38
|
-
*/
|
|
39
|
-
declare function truncateToolOutput(
|
|
40
|
-
output: string,
|
|
41
|
-
options?: {
|
|
42
|
-
maxChars?: number;
|
|
43
|
-
maxLines?: number;
|
|
44
|
-
strategy?: "head" | "tail" | "middle";
|
|
45
|
-
}
|
|
46
|
-
): string;
|
|
47
|
-
interface AgentLike {
|
|
48
|
-
sql: (
|
|
49
|
-
strings: TemplateStringsArray,
|
|
50
|
-
...values: (string | number | boolean | null)[]
|
|
51
|
-
) => Array<Record<string, unknown>>;
|
|
52
|
-
}
|
|
53
|
-
interface SessionManagerOptions {
|
|
54
|
-
/**
|
|
55
|
-
* Maximum number of messages on the current branch before
|
|
56
|
-
* needsCompaction() returns true. Default: 100.
|
|
57
|
-
*/
|
|
58
|
-
maxContextMessages?: number;
|
|
59
|
-
/**
|
|
60
|
-
* Raw SQL exec function for batch operations (e.g. DELETE ... WHERE id IN (...)).
|
|
61
|
-
* When provided, batch deletes use a single query instead of N individual ones.
|
|
62
|
-
*
|
|
63
|
-
* Typically: `(query, ...values) => { agent.ctx.storage.sql.exec(query, ...values); }`
|
|
64
|
-
*/
|
|
65
|
-
exec?: (
|
|
66
|
-
query: string,
|
|
67
|
-
...values: (string | number | boolean | null)[]
|
|
68
|
-
) => void;
|
|
69
|
-
}
|
|
70
|
-
declare class SessionManager {
|
|
71
|
-
private _storage;
|
|
72
|
-
private _options;
|
|
73
|
-
constructor(agent: AgentLike, options?: SessionManagerOptions);
|
|
74
|
-
/**
|
|
75
|
-
* Create a new session with a name.
|
|
76
|
-
*/
|
|
77
|
-
create(name: string): Session;
|
|
78
|
-
/**
|
|
79
|
-
* Get a session by ID.
|
|
80
|
-
*/
|
|
81
|
-
get(sessionId: string): Session | null;
|
|
82
|
-
/**
|
|
83
|
-
* List all sessions, most recently updated first.
|
|
84
|
-
*/
|
|
85
|
-
list(): Session[];
|
|
86
|
-
/**
|
|
87
|
-
* Delete a session and all its messages and compactions.
|
|
88
|
-
*/
|
|
89
|
-
delete(sessionId: string): void;
|
|
90
|
-
/**
|
|
91
|
-
* Clear all messages and compactions for a session without
|
|
92
|
-
* deleting the session itself.
|
|
93
|
-
*/
|
|
94
|
-
clearMessages(sessionId: string): void;
|
|
95
|
-
/**
|
|
96
|
-
* Rename a session.
|
|
97
|
-
*/
|
|
98
|
-
rename(sessionId: string, name: string): void;
|
|
99
|
-
/**
|
|
100
|
-
* Append a message to a session. If parentId is not provided,
|
|
101
|
-
* the message is appended after the latest leaf.
|
|
102
|
-
*
|
|
103
|
-
* Idempotent — appending the same message.id twice is a no-op.
|
|
104
|
-
*
|
|
105
|
-
* Returns the stored message ID.
|
|
106
|
-
*/
|
|
107
|
-
append(sessionId: string, message: UIMessage, parentId?: string): string;
|
|
108
|
-
/**
|
|
109
|
-
* Insert or update a message. First call inserts, subsequent calls
|
|
110
|
-
* update the content. Enables incremental persistence.
|
|
111
|
-
*
|
|
112
|
-
* Idempotent on insert, content-updating on subsequent calls.
|
|
113
|
-
*/
|
|
114
|
-
upsert(sessionId: string, message: UIMessage, parentId?: string): string;
|
|
115
|
-
/**
|
|
116
|
-
* Delete a single message by ID.
|
|
117
|
-
* Children of the deleted message naturally become path roots
|
|
118
|
-
* (their parent_id points to a missing row, truncating the CTE walk).
|
|
119
|
-
*/
|
|
120
|
-
deleteMessage(messageId: string): void;
|
|
121
|
-
/**
|
|
122
|
-
* Delete multiple messages by ID.
|
|
123
|
-
*/
|
|
124
|
-
deleteMessages(messageIds: string[]): void;
|
|
125
|
-
/**
|
|
126
|
-
* Append multiple messages in sequence (each parented to the previous).
|
|
127
|
-
* Returns the ID of the last appended message.
|
|
128
|
-
*/
|
|
129
|
-
appendAll(
|
|
130
|
-
sessionId: string,
|
|
131
|
-
messages: UIMessage[],
|
|
132
|
-
parentId?: string
|
|
133
|
-
): string | null;
|
|
134
|
-
/**
|
|
135
|
-
* Get the conversation history for a session as UIMessage[].
|
|
136
|
-
*
|
|
137
|
-
* If leafId is provided, returns the path from root to that leaf
|
|
138
|
-
* (a specific branch). Otherwise returns the path to the most
|
|
139
|
-
* recent leaf (the "current" branch).
|
|
140
|
-
*
|
|
141
|
-
* If compactions exist, older messages covered by a compaction
|
|
142
|
-
* are replaced with a system message containing the summary.
|
|
143
|
-
*/
|
|
144
|
-
getHistory(sessionId: string, leafId?: string): UIMessage[];
|
|
145
|
-
/**
|
|
146
|
-
* Get the total message count for a session (across all branches).
|
|
147
|
-
*/
|
|
148
|
-
getMessageCount(sessionId: string): number;
|
|
149
|
-
/**
|
|
150
|
-
* Check if the session's current branch needs compaction.
|
|
151
|
-
* Uses a count-only query — does not load message content.
|
|
152
|
-
*/
|
|
153
|
-
needsCompaction(sessionId: string): boolean;
|
|
154
|
-
/**
|
|
155
|
-
* Get the children of a message (branches from that point).
|
|
156
|
-
*/
|
|
157
|
-
getBranches(messageId: string): UIMessage[];
|
|
158
|
-
/**
|
|
159
|
-
* Fork a session at a specific message, creating a new session
|
|
160
|
-
* with the history up to that point copied over.
|
|
161
|
-
*/
|
|
162
|
-
fork(atMessageId: string, newName: string): Session;
|
|
163
|
-
/**
|
|
164
|
-
* Add a compaction record. The summary replaces messages from
|
|
165
|
-
* fromMessageId to toMessageId in context assembly.
|
|
166
|
-
*
|
|
167
|
-
* Typically called after using an LLM to summarize older messages.
|
|
168
|
-
*/
|
|
169
|
-
addCompaction(
|
|
170
|
-
sessionId: string,
|
|
171
|
-
summary: string,
|
|
172
|
-
fromMessageId: string,
|
|
173
|
-
toMessageId: string
|
|
174
|
-
): Compaction;
|
|
175
|
-
/**
|
|
176
|
-
* Get all compaction records for a session.
|
|
177
|
-
*/
|
|
178
|
-
getCompactions(sessionId: string): Compaction[];
|
|
179
|
-
private _applyCompactions;
|
|
180
|
-
}
|
|
181
|
-
//#endregion
|
|
182
|
-
export {
|
|
183
|
-
truncateMiddle as a,
|
|
184
|
-
Compaction as c,
|
|
185
|
-
truncateLines as i,
|
|
186
|
-
Session as l,
|
|
187
|
-
SessionManagerOptions as n,
|
|
188
|
-
truncateTail as o,
|
|
189
|
-
truncateHead as r,
|
|
190
|
-
truncateToolOutput as s,
|
|
191
|
-
SessionManager as t
|
|
192
|
-
};
|
|
193
|
-
//# sourceMappingURL=index-C4OTSwUW.d.ts.map
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { UIMessage } from "ai";
|
|
2
|
-
|
|
3
|
-
//#region src/message-builder.d.ts
|
|
4
|
-
/** The parts array type from UIMessage */
|
|
5
|
-
type MessageParts = UIMessage["parts"];
|
|
6
|
-
/** A single part from the UIMessage parts array */
|
|
7
|
-
type MessagePart = MessageParts[number];
|
|
8
|
-
/**
|
|
9
|
-
* Parsed chunk data from an AI SDK stream event.
|
|
10
|
-
* This is the JSON-parsed body of a CF_AGENT_USE_CHAT_RESPONSE message,
|
|
11
|
-
* or the `data:` payload of an SSE line.
|
|
12
|
-
*/
|
|
13
|
-
type StreamChunkData = {
|
|
14
|
-
type: string;
|
|
15
|
-
id?: string;
|
|
16
|
-
delta?: string;
|
|
17
|
-
text?: string;
|
|
18
|
-
mediaType?: string;
|
|
19
|
-
url?: string;
|
|
20
|
-
sourceId?: string;
|
|
21
|
-
title?: string;
|
|
22
|
-
filename?: string;
|
|
23
|
-
toolCallId?: string;
|
|
24
|
-
toolName?: string;
|
|
25
|
-
input?: unknown;
|
|
26
|
-
inputTextDelta?: string;
|
|
27
|
-
output?: unknown;
|
|
28
|
-
state?: string;
|
|
29
|
-
errorText?: string;
|
|
30
|
-
preliminary?: boolean;
|
|
31
|
-
approvalId?: string;
|
|
32
|
-
providerMetadata?: Record<string, unknown>;
|
|
33
|
-
providerExecuted?: boolean;
|
|
34
|
-
data?: unknown;
|
|
35
|
-
transient?: boolean;
|
|
36
|
-
messageId?: string;
|
|
37
|
-
messageMetadata?: Record<string, unknown>;
|
|
38
|
-
[key: string]: unknown;
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* Applies a stream chunk to a mutable parts array, building up the message
|
|
42
|
-
* incrementally. Returns true if the chunk was handled, false if it was
|
|
43
|
-
* an unrecognized type (caller may handle it with additional logic).
|
|
44
|
-
*/
|
|
45
|
-
declare function applyChunkToParts(
|
|
46
|
-
parts: MessagePart[],
|
|
47
|
-
chunk: StreamChunkData
|
|
48
|
-
): boolean;
|
|
49
|
-
//#endregion
|
|
50
|
-
export { MessagePart, MessageParts, StreamChunkData, applyChunkToParts };
|
|
51
|
-
//# sourceMappingURL=message-builder.d.ts.map
|
package/dist/message-builder.js
DELETED
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
//#region src/message-builder.ts
|
|
2
|
-
/**
|
|
3
|
-
* Applies a stream chunk to a mutable parts array, building up the message
|
|
4
|
-
* incrementally. Returns true if the chunk was handled, false if it was
|
|
5
|
-
* an unrecognized type (caller may handle it with additional logic).
|
|
6
|
-
*/
|
|
7
|
-
function applyChunkToParts(parts, chunk) {
|
|
8
|
-
switch (chunk.type) {
|
|
9
|
-
case "text-start":
|
|
10
|
-
parts.push({
|
|
11
|
-
type: "text",
|
|
12
|
-
text: "",
|
|
13
|
-
state: "streaming"
|
|
14
|
-
});
|
|
15
|
-
return true;
|
|
16
|
-
case "text-delta": {
|
|
17
|
-
const lastTextPart = findLastPartByType(parts, "text");
|
|
18
|
-
if (lastTextPart && lastTextPart.type === "text") lastTextPart.text += chunk.delta ?? "";
|
|
19
|
-
else parts.push({
|
|
20
|
-
type: "text",
|
|
21
|
-
text: chunk.delta ?? "",
|
|
22
|
-
state: "streaming"
|
|
23
|
-
});
|
|
24
|
-
return true;
|
|
25
|
-
}
|
|
26
|
-
case "text-end": {
|
|
27
|
-
const lastTextPart = findLastPartByType(parts, "text");
|
|
28
|
-
if (lastTextPart && "state" in lastTextPart) lastTextPart.state = "done";
|
|
29
|
-
return true;
|
|
30
|
-
}
|
|
31
|
-
case "reasoning-start":
|
|
32
|
-
parts.push({
|
|
33
|
-
type: "reasoning",
|
|
34
|
-
text: "",
|
|
35
|
-
state: "streaming"
|
|
36
|
-
});
|
|
37
|
-
return true;
|
|
38
|
-
case "reasoning-delta": {
|
|
39
|
-
const lastReasoningPart = findLastPartByType(parts, "reasoning");
|
|
40
|
-
if (lastReasoningPart && lastReasoningPart.type === "reasoning") lastReasoningPart.text += chunk.delta ?? "";
|
|
41
|
-
else parts.push({
|
|
42
|
-
type: "reasoning",
|
|
43
|
-
text: chunk.delta ?? "",
|
|
44
|
-
state: "streaming"
|
|
45
|
-
});
|
|
46
|
-
return true;
|
|
47
|
-
}
|
|
48
|
-
case "reasoning-end": {
|
|
49
|
-
const lastReasoningPart = findLastPartByType(parts, "reasoning");
|
|
50
|
-
if (lastReasoningPart && "state" in lastReasoningPart) lastReasoningPart.state = "done";
|
|
51
|
-
return true;
|
|
52
|
-
}
|
|
53
|
-
case "file":
|
|
54
|
-
parts.push({
|
|
55
|
-
type: "file",
|
|
56
|
-
mediaType: chunk.mediaType,
|
|
57
|
-
url: chunk.url
|
|
58
|
-
});
|
|
59
|
-
return true;
|
|
60
|
-
case "source-url":
|
|
61
|
-
parts.push({
|
|
62
|
-
type: "source-url",
|
|
63
|
-
sourceId: chunk.sourceId,
|
|
64
|
-
url: chunk.url,
|
|
65
|
-
title: chunk.title,
|
|
66
|
-
providerMetadata: chunk.providerMetadata
|
|
67
|
-
});
|
|
68
|
-
return true;
|
|
69
|
-
case "source-document":
|
|
70
|
-
parts.push({
|
|
71
|
-
type: "source-document",
|
|
72
|
-
sourceId: chunk.sourceId,
|
|
73
|
-
mediaType: chunk.mediaType,
|
|
74
|
-
title: chunk.title,
|
|
75
|
-
filename: chunk.filename,
|
|
76
|
-
providerMetadata: chunk.providerMetadata
|
|
77
|
-
});
|
|
78
|
-
return true;
|
|
79
|
-
case "tool-input-start":
|
|
80
|
-
parts.push({
|
|
81
|
-
type: `tool-${chunk.toolName}`,
|
|
82
|
-
toolCallId: chunk.toolCallId,
|
|
83
|
-
toolName: chunk.toolName,
|
|
84
|
-
state: "input-streaming",
|
|
85
|
-
input: void 0,
|
|
86
|
-
...chunk.providerExecuted != null ? { providerExecuted: chunk.providerExecuted } : {},
|
|
87
|
-
...chunk.providerMetadata != null ? { callProviderMetadata: chunk.providerMetadata } : {},
|
|
88
|
-
...chunk.title != null ? { title: chunk.title } : {}
|
|
89
|
-
});
|
|
90
|
-
return true;
|
|
91
|
-
case "tool-input-delta": {
|
|
92
|
-
const toolPart = findToolPartByCallId(parts, chunk.toolCallId);
|
|
93
|
-
if (toolPart) toolPart.input = chunk.input;
|
|
94
|
-
return true;
|
|
95
|
-
}
|
|
96
|
-
case "tool-input-available": {
|
|
97
|
-
const existing = findToolPartByCallId(parts, chunk.toolCallId);
|
|
98
|
-
if (existing) {
|
|
99
|
-
const p = existing;
|
|
100
|
-
p.state = "input-available";
|
|
101
|
-
p.input = chunk.input;
|
|
102
|
-
if (chunk.providerExecuted != null) p.providerExecuted = chunk.providerExecuted;
|
|
103
|
-
if (chunk.providerMetadata != null) p.callProviderMetadata = chunk.providerMetadata;
|
|
104
|
-
if (chunk.title != null) p.title = chunk.title;
|
|
105
|
-
} else parts.push({
|
|
106
|
-
type: `tool-${chunk.toolName}`,
|
|
107
|
-
toolCallId: chunk.toolCallId,
|
|
108
|
-
toolName: chunk.toolName,
|
|
109
|
-
state: "input-available",
|
|
110
|
-
input: chunk.input,
|
|
111
|
-
...chunk.providerExecuted != null ? { providerExecuted: chunk.providerExecuted } : {},
|
|
112
|
-
...chunk.providerMetadata != null ? { callProviderMetadata: chunk.providerMetadata } : {},
|
|
113
|
-
...chunk.title != null ? { title: chunk.title } : {}
|
|
114
|
-
});
|
|
115
|
-
return true;
|
|
116
|
-
}
|
|
117
|
-
case "tool-input-error": {
|
|
118
|
-
const existing = findToolPartByCallId(parts, chunk.toolCallId);
|
|
119
|
-
if (existing) {
|
|
120
|
-
const p = existing;
|
|
121
|
-
p.state = "output-error";
|
|
122
|
-
p.errorText = chunk.errorText;
|
|
123
|
-
p.input = chunk.input;
|
|
124
|
-
if (chunk.providerExecuted != null) p.providerExecuted = chunk.providerExecuted;
|
|
125
|
-
if (chunk.providerMetadata != null) p.callProviderMetadata = chunk.providerMetadata;
|
|
126
|
-
} else parts.push({
|
|
127
|
-
type: `tool-${chunk.toolName}`,
|
|
128
|
-
toolCallId: chunk.toolCallId,
|
|
129
|
-
toolName: chunk.toolName,
|
|
130
|
-
state: "output-error",
|
|
131
|
-
input: chunk.input,
|
|
132
|
-
errorText: chunk.errorText,
|
|
133
|
-
...chunk.providerExecuted != null ? { providerExecuted: chunk.providerExecuted } : {},
|
|
134
|
-
...chunk.providerMetadata != null ? { callProviderMetadata: chunk.providerMetadata } : {}
|
|
135
|
-
});
|
|
136
|
-
return true;
|
|
137
|
-
}
|
|
138
|
-
case "tool-approval-request": {
|
|
139
|
-
const toolPart = findToolPartByCallId(parts, chunk.toolCallId);
|
|
140
|
-
if (toolPart) {
|
|
141
|
-
const p = toolPart;
|
|
142
|
-
p.state = "approval-requested";
|
|
143
|
-
p.approval = { id: chunk.approvalId };
|
|
144
|
-
}
|
|
145
|
-
return true;
|
|
146
|
-
}
|
|
147
|
-
case "tool-output-denied": {
|
|
148
|
-
const toolPart = findToolPartByCallId(parts, chunk.toolCallId);
|
|
149
|
-
if (toolPart) {
|
|
150
|
-
const p = toolPart;
|
|
151
|
-
p.state = "output-denied";
|
|
152
|
-
}
|
|
153
|
-
return true;
|
|
154
|
-
}
|
|
155
|
-
case "tool-output-available": {
|
|
156
|
-
const toolPart = findToolPartByCallId(parts, chunk.toolCallId);
|
|
157
|
-
if (toolPart) {
|
|
158
|
-
const p = toolPart;
|
|
159
|
-
p.state = "output-available";
|
|
160
|
-
p.output = chunk.output;
|
|
161
|
-
if (chunk.preliminary !== void 0) p.preliminary = chunk.preliminary;
|
|
162
|
-
}
|
|
163
|
-
return true;
|
|
164
|
-
}
|
|
165
|
-
case "tool-output-error": {
|
|
166
|
-
const toolPart = findToolPartByCallId(parts, chunk.toolCallId);
|
|
167
|
-
if (toolPart) {
|
|
168
|
-
const p = toolPart;
|
|
169
|
-
p.state = "output-error";
|
|
170
|
-
p.errorText = chunk.errorText;
|
|
171
|
-
}
|
|
172
|
-
return true;
|
|
173
|
-
}
|
|
174
|
-
case "step-start":
|
|
175
|
-
case "start-step":
|
|
176
|
-
parts.push({ type: "step-start" });
|
|
177
|
-
return true;
|
|
178
|
-
default:
|
|
179
|
-
if (chunk.type.startsWith("data-")) {
|
|
180
|
-
if (chunk.transient) return true;
|
|
181
|
-
if (chunk.id != null) {
|
|
182
|
-
const existing = findDataPartByTypeAndId(parts, chunk.type, chunk.id);
|
|
183
|
-
if (existing) {
|
|
184
|
-
existing.data = chunk.data;
|
|
185
|
-
return true;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
parts.push({
|
|
189
|
-
type: chunk.type,
|
|
190
|
-
...chunk.id != null && { id: chunk.id },
|
|
191
|
-
data: chunk.data
|
|
192
|
-
});
|
|
193
|
-
return true;
|
|
194
|
-
}
|
|
195
|
-
return false;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
function findLastPartByType(parts, type) {
|
|
199
|
-
for (let i = parts.length - 1; i >= 0; i--) if (parts[i].type === type) return parts[i];
|
|
200
|
-
}
|
|
201
|
-
function findToolPartByCallId(parts, toolCallId) {
|
|
202
|
-
if (!toolCallId) return void 0;
|
|
203
|
-
for (let i = parts.length - 1; i >= 0; i--) {
|
|
204
|
-
const p = parts[i];
|
|
205
|
-
if ("toolCallId" in p && p.toolCallId === toolCallId) return p;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
function findDataPartByTypeAndId(parts, type, id) {
|
|
209
|
-
for (let i = parts.length - 1; i >= 0; i--) {
|
|
210
|
-
const p = parts[i];
|
|
211
|
-
if (p.type === type && "id" in p && p.id === id) return p;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
//#endregion
|
|
215
|
-
export { applyChunkToParts };
|
|
216
|
-
|
|
217
|
-
//# sourceMappingURL=message-builder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"message-builder.js","names":[],"sources":["../src/message-builder.ts"],"sourcesContent":["/**\n * Shared message builder for reconstructing UIMessage parts from stream chunks.\n *\n * Derived from @cloudflare/ai-chat's message-builder.ts. Copied here to avoid\n * a circular dependency (agents cannot import from @cloudflare/ai-chat).\n *\n * ⚠️ DRIFT RISK: If @cloudflare/ai-chat updates its message builder (e.g. new\n * chunk types), this copy must be updated manually. Consider adding a test that\n * verifies parity between the two implementations.\n *\n * Operates on a mutable parts array for performance (avoids allocating new\n * arrays on every chunk during streaming).\n */\n\nimport type { UIMessage } from \"ai\";\n\n/** The parts array type from UIMessage */\nexport type MessageParts = UIMessage[\"parts\"];\n\n/** A single part from the UIMessage parts array */\nexport type MessagePart = MessageParts[number];\n\n/**\n * Parsed chunk data from an AI SDK stream event.\n * This is the JSON-parsed body of a CF_AGENT_USE_CHAT_RESPONSE message,\n * or the `data:` payload of an SSE line.\n */\nexport type StreamChunkData = {\n type: string;\n id?: string;\n delta?: string;\n text?: string;\n mediaType?: string;\n url?: string;\n sourceId?: string;\n title?: string;\n filename?: string;\n toolCallId?: string;\n toolName?: string;\n input?: unknown;\n inputTextDelta?: string;\n output?: unknown;\n state?: string;\n errorText?: string;\n preliminary?: boolean;\n approvalId?: string;\n providerMetadata?: Record<string, unknown>;\n providerExecuted?: boolean;\n data?: unknown;\n transient?: boolean;\n messageId?: string;\n messageMetadata?: Record<string, unknown>;\n [key: string]: unknown;\n};\n\n/**\n * Applies a stream chunk to a mutable parts array, building up the message\n * incrementally. Returns true if the chunk was handled, false if it was\n * an unrecognized type (caller may handle it with additional logic).\n */\nexport function applyChunkToParts(\n parts: MessagePart[],\n chunk: StreamChunkData\n): boolean {\n switch (chunk.type) {\n case \"text-start\": {\n parts.push({\n type: \"text\",\n text: \"\",\n state: \"streaming\"\n } as MessagePart);\n return true;\n }\n\n case \"text-delta\": {\n const lastTextPart = findLastPartByType(parts, \"text\");\n if (lastTextPart && lastTextPart.type === \"text\") {\n (lastTextPart as { text: string }).text += chunk.delta ?? \"\";\n } else {\n parts.push({\n type: \"text\",\n text: chunk.delta ?? \"\",\n state: \"streaming\"\n } as MessagePart);\n }\n return true;\n }\n\n case \"text-end\": {\n const lastTextPart = findLastPartByType(parts, \"text\");\n if (lastTextPart && \"state\" in lastTextPart) {\n (lastTextPart as { state: string }).state = \"done\";\n }\n return true;\n }\n\n case \"reasoning-start\": {\n parts.push({\n type: \"reasoning\",\n text: \"\",\n state: \"streaming\"\n } as MessagePart);\n return true;\n }\n\n case \"reasoning-delta\": {\n const lastReasoningPart = findLastPartByType(parts, \"reasoning\");\n if (lastReasoningPart && lastReasoningPart.type === \"reasoning\") {\n (lastReasoningPart as { text: string }).text += chunk.delta ?? \"\";\n } else {\n parts.push({\n type: \"reasoning\",\n text: chunk.delta ?? \"\",\n state: \"streaming\"\n } as MessagePart);\n }\n return true;\n }\n\n case \"reasoning-end\": {\n const lastReasoningPart = findLastPartByType(parts, \"reasoning\");\n if (lastReasoningPart && \"state\" in lastReasoningPart) {\n (lastReasoningPart as { state: string }).state = \"done\";\n }\n return true;\n }\n\n case \"file\": {\n parts.push({\n type: \"file\",\n mediaType: chunk.mediaType,\n url: chunk.url\n } as MessagePart);\n return true;\n }\n\n case \"source-url\": {\n parts.push({\n type: \"source-url\",\n sourceId: chunk.sourceId,\n url: chunk.url,\n title: chunk.title,\n providerMetadata: chunk.providerMetadata\n } as MessagePart);\n return true;\n }\n\n case \"source-document\": {\n parts.push({\n type: \"source-document\",\n sourceId: chunk.sourceId,\n mediaType: chunk.mediaType,\n title: chunk.title,\n filename: chunk.filename,\n providerMetadata: chunk.providerMetadata\n } as MessagePart);\n return true;\n }\n\n case \"tool-input-start\": {\n parts.push({\n type: `tool-${chunk.toolName}`,\n toolCallId: chunk.toolCallId,\n toolName: chunk.toolName,\n state: \"input-streaming\",\n input: undefined,\n ...(chunk.providerExecuted != null\n ? { providerExecuted: chunk.providerExecuted }\n : {}),\n ...(chunk.providerMetadata != null\n ? { callProviderMetadata: chunk.providerMetadata }\n : {}),\n ...(chunk.title != null ? { title: chunk.title } : {})\n } as MessagePart);\n return true;\n }\n\n case \"tool-input-delta\": {\n const toolPart = findToolPartByCallId(parts, chunk.toolCallId);\n if (toolPart) {\n (toolPart as Record<string, unknown>).input = chunk.input;\n }\n return true;\n }\n\n case \"tool-input-available\": {\n const existing = findToolPartByCallId(parts, chunk.toolCallId);\n if (existing) {\n const p = existing as Record<string, unknown>;\n p.state = \"input-available\";\n p.input = chunk.input;\n if (chunk.providerExecuted != null) {\n p.providerExecuted = chunk.providerExecuted;\n }\n if (chunk.providerMetadata != null) {\n p.callProviderMetadata = chunk.providerMetadata;\n }\n if (chunk.title != null) {\n p.title = chunk.title;\n }\n } else {\n parts.push({\n type: `tool-${chunk.toolName}`,\n toolCallId: chunk.toolCallId,\n toolName: chunk.toolName,\n state: \"input-available\",\n input: chunk.input,\n ...(chunk.providerExecuted != null\n ? { providerExecuted: chunk.providerExecuted }\n : {}),\n ...(chunk.providerMetadata != null\n ? { callProviderMetadata: chunk.providerMetadata }\n : {}),\n ...(chunk.title != null ? { title: chunk.title } : {})\n } as MessagePart);\n }\n return true;\n }\n\n case \"tool-input-error\": {\n const existing = findToolPartByCallId(parts, chunk.toolCallId);\n if (existing) {\n const p = existing as Record<string, unknown>;\n p.state = \"output-error\";\n p.errorText = chunk.errorText;\n p.input = chunk.input;\n if (chunk.providerExecuted != null) {\n p.providerExecuted = chunk.providerExecuted;\n }\n if (chunk.providerMetadata != null) {\n p.callProviderMetadata = chunk.providerMetadata;\n }\n } else {\n parts.push({\n type: `tool-${chunk.toolName}`,\n toolCallId: chunk.toolCallId,\n toolName: chunk.toolName,\n state: \"output-error\",\n input: chunk.input,\n errorText: chunk.errorText,\n ...(chunk.providerExecuted != null\n ? { providerExecuted: chunk.providerExecuted }\n : {}),\n ...(chunk.providerMetadata != null\n ? { callProviderMetadata: chunk.providerMetadata }\n : {})\n } as MessagePart);\n }\n return true;\n }\n\n case \"tool-approval-request\": {\n const toolPart = findToolPartByCallId(parts, chunk.toolCallId);\n if (toolPart) {\n const p = toolPart as Record<string, unknown>;\n p.state = \"approval-requested\";\n p.approval = { id: chunk.approvalId };\n }\n return true;\n }\n\n case \"tool-output-denied\": {\n const toolPart = findToolPartByCallId(parts, chunk.toolCallId);\n if (toolPart) {\n const p = toolPart as Record<string, unknown>;\n p.state = \"output-denied\";\n }\n return true;\n }\n\n case \"tool-output-available\": {\n const toolPart = findToolPartByCallId(parts, chunk.toolCallId);\n if (toolPart) {\n const p = toolPart as Record<string, unknown>;\n p.state = \"output-available\";\n p.output = chunk.output;\n if (chunk.preliminary !== undefined) {\n p.preliminary = chunk.preliminary;\n }\n }\n return true;\n }\n\n case \"tool-output-error\": {\n const toolPart = findToolPartByCallId(parts, chunk.toolCallId);\n if (toolPart) {\n const p = toolPart as Record<string, unknown>;\n p.state = \"output-error\";\n p.errorText = chunk.errorText;\n }\n return true;\n }\n\n case \"step-start\":\n case \"start-step\": {\n parts.push({ type: \"step-start\" } as MessagePart);\n return true;\n }\n\n default: {\n if (chunk.type.startsWith(\"data-\")) {\n if (chunk.transient) {\n return true;\n }\n\n if (chunk.id != null) {\n const existing = findDataPartByTypeAndId(parts, chunk.type, chunk.id);\n if (existing) {\n (existing as Record<string, unknown>).data = chunk.data;\n return true;\n }\n }\n\n parts.push({\n type: chunk.type,\n ...(chunk.id != null && { id: chunk.id }),\n data: chunk.data\n } as MessagePart);\n return true;\n }\n\n return false;\n }\n }\n}\n\nfunction findLastPartByType(\n parts: MessagePart[],\n type: string\n): MessagePart | undefined {\n for (let i = parts.length - 1; i >= 0; i--) {\n if (parts[i].type === type) {\n return parts[i];\n }\n }\n return undefined;\n}\n\nfunction findToolPartByCallId(\n parts: MessagePart[],\n toolCallId: string | undefined\n): MessagePart | undefined {\n if (!toolCallId) return undefined;\n for (let i = parts.length - 1; i >= 0; i--) {\n const p = parts[i];\n if (\"toolCallId\" in p && p.toolCallId === toolCallId) {\n return p;\n }\n }\n return undefined;\n}\n\nfunction findDataPartByTypeAndId(\n parts: MessagePart[],\n type: string,\n id: string\n): MessagePart | undefined {\n for (let i = parts.length - 1; i >= 0; i--) {\n const p = parts[i];\n if (p.type === type && \"id\" in p && (p as { id: string }).id === id) {\n return p;\n }\n }\n return undefined;\n}\n"],"mappings":";;;;;;AA4DA,SAAgB,kBACd,OACA,OACS;AACT,SAAQ,MAAM,MAAd;EACE,KAAK;AACH,SAAM,KAAK;IACT,MAAM;IACN,MAAM;IACN,OAAO;IACR,CAAgB;AACjB,UAAO;EAGT,KAAK,cAAc;GACjB,MAAM,eAAe,mBAAmB,OAAO,OAAO;AACtD,OAAI,gBAAgB,aAAa,SAAS,OACvC,cAAkC,QAAQ,MAAM,SAAS;OAE1D,OAAM,KAAK;IACT,MAAM;IACN,MAAM,MAAM,SAAS;IACrB,OAAO;IACR,CAAgB;AAEnB,UAAO;;EAGT,KAAK,YAAY;GACf,MAAM,eAAe,mBAAmB,OAAO,OAAO;AACtD,OAAI,gBAAgB,WAAW,aAC5B,cAAmC,QAAQ;AAE9C,UAAO;;EAGT,KAAK;AACH,SAAM,KAAK;IACT,MAAM;IACN,MAAM;IACN,OAAO;IACR,CAAgB;AACjB,UAAO;EAGT,KAAK,mBAAmB;GACtB,MAAM,oBAAoB,mBAAmB,OAAO,YAAY;AAChE,OAAI,qBAAqB,kBAAkB,SAAS,YACjD,mBAAuC,QAAQ,MAAM,SAAS;OAE/D,OAAM,KAAK;IACT,MA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AAI,MAAM;AAChB,MAAI,gBAAgB,KAAK,EAAE,eAAe,WACxC,QAAO;;;AAMb,SAAS,wBACP,OACA,MACA,IACyB;AACzB,MAAK,IAAI,IAAI,MAAM,SAAS,GAAG,KAAK,GAAG,KAAK;EAC1C,MAAM,IAAI,MAAM;AAChB,MAAI,EAAE,SAAS,QAAQ,QAAQ,KAAM,EAAqB,OAAO,GAC/D,QAAO"}
|
package/dist/session/index.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
a as truncateMiddle,
|
|
3
|
-
c as Compaction,
|
|
4
|
-
i as truncateLines,
|
|
5
|
-
l as Session,
|
|
6
|
-
n as SessionManagerOptions,
|
|
7
|
-
o as truncateTail,
|
|
8
|
-
r as truncateHead,
|
|
9
|
-
s as truncateToolOutput,
|
|
10
|
-
t as SessionManager
|
|
11
|
-
} from "../index-C4OTSwUW.js";
|
|
12
|
-
export {
|
|
13
|
-
Compaction,
|
|
14
|
-
Session,
|
|
15
|
-
SessionManager,
|
|
16
|
-
SessionManagerOptions,
|
|
17
|
-
truncateHead,
|
|
18
|
-
truncateLines,
|
|
19
|
-
truncateMiddle,
|
|
20
|
-
truncateTail,
|
|
21
|
-
truncateToolOutput
|
|
22
|
-
};
|
package/dist/session/index.js
DELETED