agents 0.13.3 → 0.14.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 +6 -4
- package/dist/{agent-tool-types-l98LCbBl.d.ts → agent-tool-types-LInzZfLo.d.ts} +463 -116
- package/dist/agent-tool-types.d.ts +13 -11
- package/dist/{agent-tools-Bg5ilERh.d.ts → agent-tools-BE9xosUG.d.ts} +2 -2
- package/dist/agent-tools.d.ts +14 -20
- package/dist/agent-tools.js +10 -6
- package/dist/agent-tools.js.map +1 -1
- package/dist/browser/ai.d.ts +1 -1
- package/dist/browser/ai.js +1 -1
- package/dist/browser/index.d.ts +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/tanstack-ai.d.ts +1 -1
- package/dist/browser/tanstack-ai.js +1 -1
- package/dist/chat/index.d.ts +138 -19
- package/dist/chat/index.js +96 -12
- package/dist/chat/index.js.map +1 -1
- package/dist/chat-sdk/index.d.ts +4 -4
- package/dist/classPrivateMethodInitSpec-bG0tD96O.js +7 -0
- package/dist/{client-D1kFXo80.js → client-NradHZZz.js} +206 -75
- package/dist/client-NradHZZz.js.map +1 -0
- package/dist/client.d.ts +1 -1
- package/dist/{compaction-helpers-fJyf8j4m.js → compaction-helpers-BjT2NKRZ.js} +22 -3
- package/dist/compaction-helpers-BjT2NKRZ.js.map +1 -0
- package/dist/{compaction-helpers-B-pG5J22.d.ts → compaction-helpers-DpP_XP9J.d.ts} +59 -33
- package/dist/{do-oauth-client-provider-4OKQU9rT.d.ts → do-oauth-client-provider-CPm9rK5I.d.ts} +1 -1
- package/dist/{email-J0GGS3sa.d.ts → email-1fTSJwPm.d.ts} +1 -1
- package/dist/email.d.ts +2 -2
- package/dist/experimental/memory/session/index.d.ts +30 -25
- package/dist/experimental/memory/session/index.js +7 -2
- package/dist/experimental/memory/session/index.js.map +1 -1
- package/dist/experimental/memory/utils/index.d.ts +12 -10
- package/dist/experimental/memory/utils/index.js +2 -2
- package/dist/{index-DKey3P4s.d.ts → index-Brdu5nMI.d.ts} +270 -1
- package/dist/index.d.ts +74 -67
- package/dist/index.js +467 -63
- package/dist/index.js.map +1 -1
- package/dist/{internal_context-BZrMS0B5.d.ts → internal_context-CcZy2Em7.d.ts} +1 -1
- package/dist/internal_context.d.ts +1 -1
- package/dist/mcp/client.d.ts +17 -13
- package/dist/mcp/client.js +2 -2
- package/dist/mcp/do-oauth-client-provider.d.ts +1 -1
- package/dist/mcp/index.d.ts +35 -27
- package/dist/mcp/index.js +402 -69
- package/dist/mcp/index.js.map +1 -1
- package/dist/observability/index.d.ts +1 -1
- package/dist/observability/index.js +15 -1
- package/dist/observability/index.js.map +1 -1
- package/dist/react.d.ts +3 -3
- package/dist/{retries-BVdRl5ZE.d.ts → retries-ClWwxADl.d.ts} +1 -1
- package/dist/retries.d.ts +1 -1
- package/dist/serializable.d.ts +1 -1
- package/dist/{shared-Cvj92byG.d.ts → shared-CpY1FLvm.d.ts} +1 -1
- package/dist/{shared-CiKaIK4h.js → shared-DdOn6sp4.js} +3 -7
- package/dist/{shared-CiKaIK4h.js.map → shared-DdOn6sp4.js.map} +1 -1
- package/dist/skills/index.d.ts +236 -0
- package/dist/skills/index.js +1326 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/sub-routing.d.ts +6 -6
- package/dist/{tool-output-truncation-CH-khbZ3.js → tool-output-truncation-BF4AZQlw.js} +1 -1
- package/dist/{tool-output-truncation-CH-khbZ3.js.map → tool-output-truncation-BF4AZQlw.js.map} +1 -1
- package/dist/{types-_JjKmv-l.d.ts → types-B0GymtN_.d.ts} +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +248 -2
- package/dist/vite.js.map +1 -1
- package/dist/{workflow-types-Dkzg4hAx.d.ts → workflow-types-DPkuBi--.d.ts} +1 -1
- package/dist/workflow-types.d.ts +1 -1
- package/dist/workflows.d.ts +13 -3
- package/dist/workflows.js +10 -1
- package/dist/workflows.js.map +1 -1
- package/package.json +21 -3
- package/skills-module.d.ts +22 -0
- package/dist/client-D1kFXo80.js.map +0 -1
- package/dist/compaction-helpers-fJyf8j4m.js.map +0 -1
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import {
|
|
2
|
-
A as
|
|
3
|
-
C as
|
|
4
|
-
D as
|
|
5
|
-
E as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
2
|
+
A as CompactContext,
|
|
3
|
+
C as isSearchProvider,
|
|
4
|
+
D as SessionProvider,
|
|
5
|
+
E as SearchResult,
|
|
6
|
+
F as SessionTokenCounter,
|
|
7
|
+
I as SessionTokenCounterInput,
|
|
8
|
+
M as SessionMessage,
|
|
9
|
+
N as SessionMessagePart,
|
|
10
|
+
O as StoredCompaction,
|
|
11
|
+
P as SessionOptions,
|
|
12
|
+
S as SearchProvider,
|
|
13
|
+
T as SqlProvider,
|
|
14
|
+
_ as isWritableProvider,
|
|
15
|
+
b as isSkillProvider,
|
|
16
|
+
g as WritableContextProvider,
|
|
17
|
+
h as ContextProvider,
|
|
18
|
+
j as CompactionErrorHandler,
|
|
19
|
+
k as CompactAfterOptions,
|
|
20
|
+
m as ContextConfig,
|
|
21
|
+
p as ContextBlock,
|
|
21
22
|
r as CompactResult,
|
|
22
|
-
v as
|
|
23
|
-
w as
|
|
24
|
-
x as
|
|
25
|
-
y as
|
|
26
|
-
} from "../../../compaction-helpers-
|
|
23
|
+
v as R2SkillProvider,
|
|
24
|
+
w as AgentSessionProvider,
|
|
25
|
+
x as AgentSearchProvider,
|
|
26
|
+
y as SkillProvider
|
|
27
|
+
} from "../../../compaction-helpers-DpP_XP9J.js";
|
|
27
28
|
import { ToolSet } from "ai";
|
|
28
29
|
|
|
29
30
|
//#region src/experimental/memory/session/session.d.ts
|
|
@@ -59,6 +60,7 @@ declare class Session {
|
|
|
59
60
|
private _pending?;
|
|
60
61
|
private _cachedPrompt?;
|
|
61
62
|
private _compactionFn?;
|
|
63
|
+
private _warnedCompactionNoOp;
|
|
62
64
|
private _tokenThreshold?;
|
|
63
65
|
private _tokenCounter?;
|
|
64
66
|
private _compactionErrorHandler?;
|
|
@@ -105,7 +107,10 @@ declare class Session {
|
|
|
105
107
|
* message history into a summary overlay.
|
|
106
108
|
*/
|
|
107
109
|
onCompaction(
|
|
108
|
-
fn: (
|
|
110
|
+
fn: (
|
|
111
|
+
messages: SessionMessage[],
|
|
112
|
+
context?: CompactContext
|
|
113
|
+
) => Promise<CompactResult | null>
|
|
109
114
|
): this;
|
|
110
115
|
/**
|
|
111
116
|
* Auto-compact when estimated token count exceeds the threshold.
|
|
@@ -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-BjT2NKRZ.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/experimental/memory/session/search.ts
|
|
5
5
|
/**
|
|
@@ -1021,6 +1021,7 @@ function isSqlProvider(arg) {
|
|
|
1021
1021
|
}
|
|
1022
1022
|
var Session = class Session {
|
|
1023
1023
|
constructor(storage, options) {
|
|
1024
|
+
this._warnedCompactionNoOp = false;
|
|
1024
1025
|
this._ready = false;
|
|
1025
1026
|
this.storage = storage;
|
|
1026
1027
|
this.context = new ContextBlocks(options?.context ?? [], options?.promptStore);
|
|
@@ -1327,6 +1328,10 @@ var Session = class Session {
|
|
|
1327
1328
|
let compacted = false;
|
|
1328
1329
|
if (this._tokenThreshold != null && this._compactionFn && tokenEstimate > this._tokenThreshold) try {
|
|
1329
1330
|
compacted = Boolean(await this.compact());
|
|
1331
|
+
if (!compacted && !this._warnedCompactionNoOp) {
|
|
1332
|
+
this._warnedCompactionNoOp = true;
|
|
1333
|
+
console.warn(`[Session] Auto-compaction fired (~${tokenEstimate} tokens > ${this._tokenThreshold}) but the compaction function returned null, so history was not shortened. ` + (this._tokenCounter ? `A tokenCounter is configured and now flows to the boundary logic, but it is invoked per-message there — a whole-prompt/usage counter (e.g. returning a fixed usage.inputTokens regardless of which messages are passed) degrades the tail budget to minTailMessages and can still no-op. Pass a per-message CompactOptions.tokenCounter for precise tail budgeting.` : `If your history is tool-heavy, configure a tokenCounter on compactAfter() — it flows to createCompactFunction's boundary logic automatically.`));
|
|
1334
|
+
} else if (compacted) this._warnedCompactionNoOp = false;
|
|
1330
1335
|
} catch (err) {
|
|
1331
1336
|
await this._handleAutoCompactionError(err);
|
|
1332
1337
|
}
|
|
@@ -1381,7 +1386,7 @@ var Session = class Session {
|
|
|
1381
1386
|
const tokensBefore = await this._emitStatus("compacting");
|
|
1382
1387
|
let result;
|
|
1383
1388
|
try {
|
|
1384
|
-
result = await this._compactionFn(await this.getHistory());
|
|
1389
|
+
result = await this._compactionFn(await this.getHistory(), { tokenCounter: this._tokenCounter });
|
|
1385
1390
|
} catch (err) {
|
|
1386
1391
|
this._emitError(err instanceof Error ? err.message : String(err));
|
|
1387
1392
|
return null;
|