agents 0.12.2 → 0.12.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/dist/{agent-tool-types-DSteYkkS.d.ts → agent-tool-types-CM_50fcV.d.ts} +104 -87
- package/dist/agent-tool-types.d.ts +1 -1
- package/dist/agent-tools-BAdX1vdI.js.map +1 -1
- package/dist/{agent-tools-eGTCdVZX.d.ts → agent-tools-BylX6WXG.d.ts} +2 -2
- package/dist/agent-tools.d.ts +1 -1
- package/dist/agent-tools.js.map +1 -1
- package/dist/browser/ai.d.ts +2 -2
- package/dist/browser/ai.js +1 -1
- package/dist/browser/ai.js.map +1 -1
- package/dist/browser/index.d.ts +41 -10
- package/dist/browser/index.js +1 -1
- package/dist/browser/tanstack-ai.d.ts +2 -2
- package/dist/browser/tanstack-ai.js +1 -1
- package/dist/browser/tanstack-ai.js.map +1 -1
- package/dist/chat/index.d.ts +297 -148
- package/dist/chat/index.js +43 -14
- package/dist/chat/index.js.map +1 -1
- package/dist/{classPrivateFieldGet2-Bqby-AHD.js → classPrivateFieldGet2-CS51BNGR.js} +5 -5
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/client-D1kFXo80.js.map +1 -1
- package/dist/client.d.ts +11 -10
- package/dist/client.js.map +1 -1
- package/dist/codemode/ai.d.ts +1 -1
- package/dist/{compaction-helpers-CSaqCmdE.js → compaction-helpers-DvcZnvQ1.js} +1 -1
- package/dist/{compaction-helpers-CSaqCmdE.js.map → compaction-helpers-DvcZnvQ1.js.map} +1 -1
- package/dist/{compaction-helpers-D92Ipstp.d.ts → compaction-helpers-bYvP1o2S.d.ts} +10 -3
- package/dist/{do-oauth-client-provider-C38aWbFV.d.ts → do-oauth-client-provider-4OKQU9rT.d.ts} +1 -1
- package/dist/{email-X72-zjuq.d.ts → email-J0GGS3sa.d.ts} +1 -1
- package/dist/email.d.ts +2 -2
- package/dist/email.js.map +1 -1
- package/dist/experimental/memory/session/index.d.ts +126 -26
- package/dist/experimental/memory/session/index.js +13 -3
- package/dist/experimental/memory/session/index.js.map +1 -1
- package/dist/experimental/memory/utils/index.d.ts +41 -5
- package/dist/experimental/memory/utils/index.js +15 -5
- package/dist/experimental/memory/utils/index.js.map +1 -1
- package/dist/experimental/webmcp.d.ts +9 -3
- package/dist/experimental/webmcp.js.map +1 -1
- package/dist/{index-Biv6K70p.d.ts → index-DKey3P4s.d.ts} +26 -2
- package/dist/index.d.ts +48 -44
- package/dist/index.js +122 -85
- package/dist/index.js.map +1 -1
- package/dist/{internal_context-BvuGZieY.d.ts → internal_context-BZrMS0B5.d.ts} +1 -1
- package/dist/internal_context.d.ts +1 -1
- package/dist/mcp/client.d.ts +26 -2
- package/dist/mcp/do-oauth-client-provider.d.ts +10 -2
- package/dist/mcp/do-oauth-client-provider.js.map +1 -1
- package/dist/mcp/index.d.ts +54 -2
- package/dist/mcp/index.js +43 -19
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/x402.d.ts +74 -17
- package/dist/mcp/x402.js.map +1 -1
- package/dist/observability/index.d.ts +16 -2
- package/dist/observability/index.js +1 -1
- package/dist/observability/index.js.map +1 -1
- package/dist/react.d.ts +9 -7
- package/dist/react.js +18 -2
- package/dist/react.js.map +1 -1
- package/dist/{retries-fLD8cGNf.d.ts → retries-BVdRl5ZE.d.ts} +1 -1
- package/dist/retries.d.ts +1 -1
- package/dist/retries.js.map +1 -1
- package/dist/schedule.js.map +1 -1
- package/dist/serializable.d.ts +141 -7
- package/dist/{shared-Ch9slKdI.d.ts → shared-Cvj92byG.d.ts} +1 -1
- package/dist/{shared-C6l4ZKRN.js → shared-DzJYHisH.js} +3 -3
- package/dist/{shared-C6l4ZKRN.js.map → shared-DzJYHisH.js.map} +1 -1
- package/dist/sub-routing.d.ts +6 -6
- package/dist/sub-routing.js.map +1 -1
- package/dist/tool-output-truncation-CH-khbZ3.js +98 -0
- package/dist/tool-output-truncation-CH-khbZ3.js.map +1 -0
- package/dist/{types-DAHCZC_W.d.ts → types-_JjKmv-l.d.ts} +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils.js.map +1 -1
- package/dist/vite.js.map +1 -1
- package/dist/{workflow-types-DHs0L0KP.d.ts → workflow-types-Dkzg4hAx.d.ts} +1 -1
- package/dist/workflow-types.d.ts +1 -1
- package/dist/workflow-types.js.map +1 -1
- package/dist/workflows.d.ts +2 -2
- package/dist/workflows.js.map +1 -1
- package/package.json +9 -9
- package/dist/serializable-Brg7fRds.d.ts +0 -131
|
@@ -1,4 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
A as SessionOptions,
|
|
3
|
+
C as AgentSessionProvider,
|
|
4
|
+
D as StoredCompaction,
|
|
5
|
+
E as SessionProvider,
|
|
6
|
+
O as SessionMessage,
|
|
7
|
+
S as isSearchProvider,
|
|
8
|
+
T as SearchResult,
|
|
9
|
+
_ as R2SkillProvider,
|
|
10
|
+
b as AgentSearchProvider,
|
|
11
|
+
f as ContextBlock,
|
|
12
|
+
g as isWritableProvider,
|
|
13
|
+
h as WritableContextProvider,
|
|
14
|
+
k as SessionMessagePart,
|
|
15
|
+
m as ContextProvider,
|
|
16
|
+
p as ContextConfig,
|
|
17
|
+
r as CompactResult,
|
|
18
|
+
v as SkillProvider,
|
|
19
|
+
w as SqlProvider,
|
|
20
|
+
x as SearchProvider,
|
|
21
|
+
y as isSkillProvider
|
|
22
|
+
} from "../../../compaction-helpers-bYvP1o2S.js";
|
|
2
23
|
import { ToolSet } from "ai";
|
|
3
24
|
|
|
4
25
|
//#region src/experimental/memory/session/session.d.ts
|
|
@@ -42,7 +63,9 @@ declare class Session {
|
|
|
42
63
|
* Register a compaction function. Called by `compact()` to compress
|
|
43
64
|
* message history into a summary overlay.
|
|
44
65
|
*/
|
|
45
|
-
onCompaction(
|
|
66
|
+
onCompaction(
|
|
67
|
+
fn: (messages: SessionMessage[]) => Promise<CompactResult | null>
|
|
68
|
+
): this;
|
|
46
69
|
/**
|
|
47
70
|
* Auto-compact when estimated token count exceeds the threshold.
|
|
48
71
|
* Checked after each `appendMessage`. Requires `onCompaction()`.
|
|
@@ -68,11 +91,18 @@ declare class Session {
|
|
|
68
91
|
private _broadcast;
|
|
69
92
|
private _emitStatus;
|
|
70
93
|
private _emitError;
|
|
71
|
-
appendMessage(
|
|
94
|
+
appendMessage(
|
|
95
|
+
message: SessionMessage,
|
|
96
|
+
parentId?: string | null
|
|
97
|
+
): Promise<void>;
|
|
72
98
|
updateMessage(message: SessionMessage): void;
|
|
73
99
|
deleteMessages(messageIds: string[]): void;
|
|
74
100
|
clearMessages(): void;
|
|
75
|
-
addCompaction(
|
|
101
|
+
addCompaction(
|
|
102
|
+
summary: string,
|
|
103
|
+
fromMessageId: string,
|
|
104
|
+
toMessageId: string
|
|
105
|
+
): StoredCompaction;
|
|
76
106
|
getCompactions(): StoredCompaction[];
|
|
77
107
|
/**
|
|
78
108
|
* Run the registered compaction function and store the result as an overlay.
|
|
@@ -95,7 +125,10 @@ declare class Session {
|
|
|
95
125
|
* AgentContextProvider. Requires the session to have been created
|
|
96
126
|
* via `Session.create(agent)` (not the direct constructor).
|
|
97
127
|
*/
|
|
98
|
-
addContext(
|
|
128
|
+
addContext(
|
|
129
|
+
label: string,
|
|
130
|
+
options?: SessionContextOptions
|
|
131
|
+
): Promise<ContextBlock>;
|
|
99
132
|
/**
|
|
100
133
|
* Remove a dynamically registered context block.
|
|
101
134
|
* Used during extension unload cleanup.
|
|
@@ -116,9 +149,12 @@ declare class Session {
|
|
|
116
149
|
getLoadedSkillKeys(): Set<string>;
|
|
117
150
|
freezeSystemPrompt(): Promise<string>;
|
|
118
151
|
refreshSystemPrompt(): Promise<string>;
|
|
119
|
-
search(
|
|
120
|
-
|
|
121
|
-
|
|
152
|
+
search(
|
|
153
|
+
query: string,
|
|
154
|
+
options?: {
|
|
155
|
+
limit?: number;
|
|
156
|
+
}
|
|
157
|
+
): Array<{
|
|
122
158
|
id: string;
|
|
123
159
|
role: string;
|
|
124
160
|
content: string;
|
|
@@ -178,7 +214,9 @@ declare class SessionManager {
|
|
|
178
214
|
* Register a compaction function propagated to all sessions.
|
|
179
215
|
* Called by `Session.compact()` to compress message history.
|
|
180
216
|
*/
|
|
181
|
-
onCompaction(
|
|
217
|
+
onCompaction(
|
|
218
|
+
fn: (messages: SessionMessage[]) => Promise<CompactResult | null>
|
|
219
|
+
): this;
|
|
182
220
|
/**
|
|
183
221
|
* Auto-compact when estimated token count exceeds the threshold.
|
|
184
222
|
* Propagated to all sessions. Requires `onCompaction()`.
|
|
@@ -205,18 +243,33 @@ declare class SessionManager {
|
|
|
205
243
|
private _createHistoryProvider;
|
|
206
244
|
/** Get or create the Session instance for a session ID. */
|
|
207
245
|
getSession(sessionId: string): Session;
|
|
208
|
-
create(
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
246
|
+
create(
|
|
247
|
+
name: string,
|
|
248
|
+
opts?: {
|
|
249
|
+
parentSessionId?: string;
|
|
250
|
+
model?: string;
|
|
251
|
+
source?: string;
|
|
252
|
+
}
|
|
253
|
+
): SessionInfo;
|
|
213
254
|
get(sessionId: string): SessionInfo | null;
|
|
214
255
|
list(): SessionInfo[];
|
|
215
256
|
delete(sessionId: string): void;
|
|
216
257
|
rename(sessionId: string, name: string): void;
|
|
217
|
-
append(
|
|
218
|
-
|
|
219
|
-
|
|
258
|
+
append(
|
|
259
|
+
sessionId: string,
|
|
260
|
+
message: SessionMessage,
|
|
261
|
+
parentId?: string
|
|
262
|
+
): Promise<string>;
|
|
263
|
+
upsert(
|
|
264
|
+
sessionId: string,
|
|
265
|
+
message: SessionMessage,
|
|
266
|
+
parentId?: string
|
|
267
|
+
): Promise<string>;
|
|
268
|
+
appendAll(
|
|
269
|
+
sessionId: string,
|
|
270
|
+
messages: SessionMessage[],
|
|
271
|
+
parentId?: string
|
|
272
|
+
): Promise<string | null>;
|
|
220
273
|
getHistory(sessionId: string, leafId?: string): SessionMessage[];
|
|
221
274
|
getMessageCount(sessionId: string): number;
|
|
222
275
|
clearMessages(sessionId: string): void;
|
|
@@ -226,14 +279,35 @@ declare class SessionManager {
|
|
|
226
279
|
* Fork a session at a specific message, creating a new session
|
|
227
280
|
* with the history up to that point copied over.
|
|
228
281
|
*/
|
|
229
|
-
fork(
|
|
230
|
-
|
|
282
|
+
fork(
|
|
283
|
+
sessionId: string,
|
|
284
|
+
atMessageId: string,
|
|
285
|
+
newName: string
|
|
286
|
+
): Promise<SessionInfo>;
|
|
287
|
+
addCompaction(
|
|
288
|
+
sessionId: string,
|
|
289
|
+
summary: string,
|
|
290
|
+
fromId: string,
|
|
291
|
+
toId: string
|
|
292
|
+
): StoredCompaction;
|
|
231
293
|
getCompactions(sessionId: string): StoredCompaction[];
|
|
232
|
-
compactAndSplit(
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
294
|
+
compactAndSplit(
|
|
295
|
+
sessionId: string,
|
|
296
|
+
summary: string,
|
|
297
|
+
newName?: string
|
|
298
|
+
): Promise<SessionInfo>;
|
|
299
|
+
addUsage(
|
|
300
|
+
sessionId: string,
|
|
301
|
+
inputTokens: number,
|
|
302
|
+
outputTokens: number,
|
|
303
|
+
cost: number
|
|
304
|
+
): void;
|
|
305
|
+
search(
|
|
306
|
+
query: string,
|
|
307
|
+
options?: {
|
|
308
|
+
limit?: number;
|
|
309
|
+
}
|
|
310
|
+
): {
|
|
237
311
|
id: string;
|
|
238
312
|
role: string;
|
|
239
313
|
content: string;
|
|
@@ -255,5 +329,31 @@ declare class AgentContextProvider implements WritableContextProvider {
|
|
|
255
329
|
set(content: string): Promise<void>;
|
|
256
330
|
}
|
|
257
331
|
//#endregion
|
|
258
|
-
export {
|
|
259
|
-
|
|
332
|
+
export {
|
|
333
|
+
AgentContextProvider,
|
|
334
|
+
AgentSearchProvider,
|
|
335
|
+
AgentSessionProvider,
|
|
336
|
+
type ContextBlock,
|
|
337
|
+
type ContextConfig,
|
|
338
|
+
type ContextProvider,
|
|
339
|
+
R2SkillProvider,
|
|
340
|
+
type SearchProvider,
|
|
341
|
+
type SearchResult,
|
|
342
|
+
Session,
|
|
343
|
+
type SessionContextOptions,
|
|
344
|
+
type SessionInfo,
|
|
345
|
+
SessionManager,
|
|
346
|
+
type SessionManagerOptions,
|
|
347
|
+
type SessionMessage,
|
|
348
|
+
type SessionMessagePart,
|
|
349
|
+
type SessionOptions,
|
|
350
|
+
type SessionProvider,
|
|
351
|
+
type SkillProvider,
|
|
352
|
+
type SqlProvider,
|
|
353
|
+
type StoredCompaction,
|
|
354
|
+
type WritableContextProvider,
|
|
355
|
+
isSearchProvider,
|
|
356
|
+
isSkillProvider,
|
|
357
|
+
isWritableProvider
|
|
358
|
+
};
|
|
359
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../../types.js";
|
|
2
|
-
import { m as estimateStringTokens, p as estimateMessageTokens, t as COMPACTION_PREFIX } from "../../../compaction-helpers-
|
|
2
|
+
import { m as estimateStringTokens, p as estimateMessageTokens, t as COMPACTION_PREFIX } from "../../../compaction-helpers-DvcZnvQ1.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/experimental/memory/session/search.ts
|
|
5
5
|
/**
|
|
@@ -131,17 +131,22 @@ function isSkillProvider(provider) {
|
|
|
131
131
|
*
|
|
132
132
|
* Descriptions are pulled from R2 custom metadata (`description` key).
|
|
133
133
|
* If a prefix is provided, it is prepended on storage operations and
|
|
134
|
-
* stripped from keys in metadata.
|
|
134
|
+
* stripped from keys in metadata. `keys`, when provided, is matched against
|
|
135
|
+
* these prefix-relative keys.
|
|
135
136
|
*
|
|
136
137
|
* @example
|
|
137
138
|
* ```ts
|
|
138
|
-
* const skills = new R2SkillProvider(env.SKILLS_BUCKET, {
|
|
139
|
+
* const skills = new R2SkillProvider(env.SKILLS_BUCKET, {
|
|
140
|
+
* prefix: "skills/",
|
|
141
|
+
* keys: ["code-review", "debugging"]
|
|
142
|
+
* });
|
|
139
143
|
* ```
|
|
140
144
|
*/
|
|
141
145
|
var R2SkillProvider = class {
|
|
142
146
|
constructor(bucket, options) {
|
|
143
147
|
this.bucket = bucket;
|
|
144
148
|
this.prefix = options?.prefix ?? "";
|
|
149
|
+
this.keys = options?.keys?.length ? new Set(options.keys) : null;
|
|
145
150
|
}
|
|
146
151
|
async get() {
|
|
147
152
|
const entries = [];
|
|
@@ -155,6 +160,7 @@ var R2SkillProvider = class {
|
|
|
155
160
|
});
|
|
156
161
|
for (const obj of listed.objects) {
|
|
157
162
|
const key = obj.key.slice(this.prefix.length);
|
|
163
|
+
if (!this.allowsKey(key)) continue;
|
|
158
164
|
const desc = obj.customMetadata?.description;
|
|
159
165
|
entries.push(`- ${key}${desc ? `: ${desc}` : ""}`);
|
|
160
166
|
}
|
|
@@ -164,6 +170,7 @@ var R2SkillProvider = class {
|
|
|
164
170
|
return entries.length > 0 ? entries.join("\n") : null;
|
|
165
171
|
}
|
|
166
172
|
async load(key) {
|
|
173
|
+
if (!this.allowsKey(key)) return null;
|
|
167
174
|
const obj = await this.bucket.get(this.prefix + key);
|
|
168
175
|
if (!obj) return null;
|
|
169
176
|
return obj.text();
|
|
@@ -171,6 +178,9 @@ var R2SkillProvider = class {
|
|
|
171
178
|
async set(key, content, description) {
|
|
172
179
|
await this.bucket.put(this.prefix + key, content, { customMetadata: description ? { description } : void 0 });
|
|
173
180
|
}
|
|
181
|
+
allowsKey(key) {
|
|
182
|
+
return this.keys === null || this.keys.has(key);
|
|
183
|
+
}
|
|
174
184
|
};
|
|
175
185
|
//#endregion
|
|
176
186
|
//#region src/experimental/memory/session/context.ts
|