agents 0.20.1 → 0.22.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 +51 -12
- package/dist/{agent-tool-types-BC-WFlsz.d.ts → agent-routing-CnkaHb-v.d.ts} +3305 -3138
- package/dist/agent-routing.d.ts +14 -0
- package/dist/agent-routing.js +187 -0
- package/dist/agent-routing.js.map +1 -0
- package/dist/agent-tool-types.d.ts +26 -26
- package/dist/{agent-tools-DeHe9Xov.d.ts → agent-tools-C0XJqWzB.d.ts} +7 -7
- package/dist/agent-tools.d.ts +44 -28
- package/dist/agent-tools.js +16 -7
- package/dist/agent-tools.js.map +1 -1
- package/dist/browser/ai.d.ts +5 -3
- package/dist/browser/ai.js +88 -8
- package/dist/browser/ai.js.map +1 -1
- package/dist/browser/index.d.ts +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/tanstack-ai.js +13 -1
- package/dist/browser/tanstack-ai.js.map +1 -1
- package/dist/capability-BjSKYpzg.js +42 -0
- package/dist/capability-BjSKYpzg.js.map +1 -0
- package/dist/capability-runner-CvHGZqUu.d.ts +150 -0
- package/dist/chat/index.d.ts +51 -15
- package/dist/chat/index.js +59 -4
- package/dist/chat/index.js.map +1 -1
- package/dist/chat/react.d.ts +19 -180
- package/dist/chat/react.js +93 -600
- package/dist/chat/react.js.map +1 -1
- package/dist/chat/transport.d.ts +10 -0
- package/dist/chat/transport.js +2 -0
- package/dist/chat-sdk/index.d.ts +4 -4
- package/dist/chat-sdk/index.js +1 -1
- package/dist/{client-zqKcsyFa.js → client-jagG8a9_.js} +129 -37
- package/dist/client-jagG8a9_.js.map +1 -0
- package/dist/client.d.ts +1 -1
- package/dist/client.js +1 -1
- package/dist/{cloudflare-BduZwmYK.js → cloudflare-Dzvc7V2N.js} +10 -3
- package/dist/{cloudflare-BduZwmYK.js.map → cloudflare-Dzvc7V2N.js.map} +1 -1
- package/dist/{connector-v2M1zlZp.d.ts → connector-CkQD4MK3.d.ts} +20 -3
- package/dist/{connector-KEJnl6e5.js → connector-CptFKzRh.js} +158 -40
- package/dist/connector-CptFKzRh.js.map +1 -0
- package/dist/current-agent-CuMErtly.d.ts +283 -0
- package/dist/current-agent-DhoDkSnH.js +51 -0
- package/dist/current-agent-DhoDkSnH.js.map +1 -0
- package/dist/diagnostics-CaBjfz4J.js +41 -0
- package/dist/diagnostics-CaBjfz4J.js.map +1 -0
- package/dist/{do-oauth-client-provider-VTZj2VtM.d.ts → do-oauth-client-provider-Tmf1vgKz.d.ts} +2 -2
- package/dist/durable-object-lifecycle-D6nNQJJd.js +862 -0
- package/dist/durable-object-lifecycle-D6nNQJJd.js.map +1 -0
- package/dist/{email-CL27preh.d.ts → email-7TatiTnl.d.ts} +38 -9
- package/dist/email-send.d.ts +15 -0
- package/dist/email-send.js +32 -0
- package/dist/email-send.js.map +1 -0
- package/dist/email.d.ts +14 -10
- package/dist/email.js.map +1 -1
- package/dist/experimental/memory/session/index.d.ts +3 -2
- package/dist/experimental/memory/session/index.js +15 -10
- package/dist/experimental/memory/session/index.js.map +1 -1
- package/dist/{handler-stateless-C_bo-Ytq.d.ts → handler-stateless-DxYpJ_XF.d.ts} +3 -3
- package/dist/{handler-stateless-CIkKPETH.js → handler-stateless-VvrWSAVA.js} +5 -5
- package/dist/handler-stateless-VvrWSAVA.js.map +1 -0
- package/dist/{index-BRnybD6X.d.ts → index-DcSAZKsB.d.ts} +19 -31
- package/dist/index.d.ts +102 -91
- package/dist/index.js +12 -7235
- package/dist/internal_context-BlxFEWfn.d.ts +19 -0
- package/dist/internal_context.d.ts +10 -4
- package/dist/internal_context.js +1 -10
- package/dist/{client-invoker-BNSZxAkv.d.ts → invoker-CG0_p_Wq.d.ts} +2 -2
- package/dist/{client-invoker-VNZ7X0nn.js → invoker-CHMnoxIA.js} +2 -2
- package/dist/invoker-CHMnoxIA.js.map +1 -0
- package/dist/lifecycle/index.d.ts +48 -0
- package/dist/lifecycle/index.js +4 -0
- package/dist/mcp/{do-oauth-client-provider.d.ts → client/do-oauth-client-provider.d.ts} +1 -1
- package/dist/mcp/{do-oauth-client-provider.js → client/do-oauth-client-provider.js} +1 -1
- package/dist/mcp/client/do-oauth-client-provider.js.map +1 -0
- package/dist/mcp/client/index.d.ts +42 -0
- package/dist/mcp/{client.js → client/index.js} +1 -1
- package/dist/mcp/{x402.d.ts → client/x402.d.ts} +2 -2
- package/dist/mcp/{x402.js → client/x402.js} +2 -2
- package/dist/mcp/client/x402.js.map +1 -0
- package/dist/mcp/index.d.ts +36 -36
- package/dist/mcp/index.js +14 -16
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/{server.d.ts → server/index.d.ts} +1 -1
- package/dist/mcp/{server.js → server/index.js} +1 -1
- package/dist/observability/ai/index.d.ts +1 -130
- package/dist/observability/ai/index.js +88 -433
- package/dist/observability/ai/index.js.map +1 -1
- package/dist/observability/index.d.ts +4 -4
- package/dist/observability/index.js +3 -50
- package/dist/observability/index.js.map +1 -1
- package/dist/{wire-types-CU9rLoeS.js → protocol-B0nh6KNf.js} +20 -66
- package/dist/protocol-B0nh6KNf.js.map +1 -0
- package/dist/react.d.ts +4 -4
- package/dist/react.js +6 -9
- package/dist/react.js.map +1 -1
- package/dist/schedule.d.ts +25 -94
- package/dist/schedule.js +1 -98
- package/dist/schedule.js.map +1 -1
- package/dist/scheduler-CR9RHGos.js +857 -0
- package/dist/scheduler-CR9RHGos.js.map +1 -0
- package/dist/scheduler-DQoTGoAW.d.ts +224 -0
- package/dist/schedules/index.d.ts +22 -0
- package/dist/schedules/index.js +2 -0
- package/dist/schedules/parser.d.ts +79 -0
- package/dist/schedules/parser.js +103 -0
- package/dist/schedules/parser.js.map +1 -0
- package/dist/serializable.d.ts +1 -1
- package/dist/sql-error-CPY-GXyI.d.ts +12 -0
- package/dist/sql-error.d.ts +2 -0
- package/dist/sql-error.js +16 -0
- package/dist/sql-error.js.map +1 -0
- package/dist/src-5W6JNKVb.js +6613 -0
- package/dist/src-5W6JNKVb.js.map +1 -0
- package/dist/sub-routing.d.ts +18 -6
- package/dist/sub-routing.js +92 -2
- package/dist/sub-routing.js.map +1 -1
- package/dist/wire-types-CnMt6_HR.js +47 -0
- package/dist/wire-types-CnMt6_HR.js.map +1 -0
- package/dist/workflow-types.d.ts +25 -25
- package/dist/workflow-types.js.map +1 -1
- package/dist/workflows.d.ts +22 -22
- package/dist/workflows.js +2 -1
- package/dist/workflows.js.map +1 -1
- package/dist/ws-chat-transport-UNRIS2xl.d.ts +184 -0
- package/dist/ws-chat-transport-rWwta645.js +698 -0
- package/dist/ws-chat-transport-rWwta645.js.map +1 -0
- package/docs/adding-to-existing-project.md +4 -2
- package/docs/agent-class.md +29 -87
- package/docs/agent-tools.md +29 -0
- package/docs/browse-the-web.md +16 -1
- package/docs/chat-agents.md +16 -13
- package/docs/client-sdk.md +12 -8
- package/docs/configuration.md +7 -1
- package/docs/cross-domain-authentication.md +7 -35
- package/docs/durable-execution.md +1 -1
- package/docs/email.md +2 -13
- package/docs/http-websockets.md +1 -11
- package/docs/human-in-the-loop.md +16 -13
- package/docs/index.md +1 -0
- package/docs/lifecycle.md +323 -0
- package/docs/long-running-agents.md +13 -15
- package/docs/mcp-client.md +55 -0
- package/docs/mcp-servers.md +6 -0
- package/docs/mcp-transports.md +18 -12
- package/docs/migration-to-ai-sdk-v5.md +2 -2
- package/docs/migration-to-ai-sdk-v6.md +5 -1
- package/docs/observability.md +33 -77
- package/docs/resumable-streaming.md +1 -1
- package/docs/routing.md +27 -0
- package/docs/scheduling.md +175 -15
- package/docs/server-driven-messages.md +1 -1
- package/docs/sub-agents.md +47 -2
- package/docs/webhooks.md +109 -136
- package/docs/workflows.md +9 -1
- package/package.json +41 -23
- package/dist/cli/index.d.ts +0 -1
- package/dist/cli/index.js +0 -26
- package/dist/cli/index.js.map +0 -1
- package/dist/client-invoker-VNZ7X0nn.js.map +0 -1
- package/dist/client-zqKcsyFa.js.map +0 -1
- package/dist/connector-KEJnl6e5.js.map +0 -1
- package/dist/handler-stateless-CIkKPETH.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/internal_context-Dg4Cgjcu.d.ts +0 -37
- package/dist/internal_context.js.map +0 -1
- package/dist/mcp/client.d.ts +0 -42
- package/dist/mcp/do-oauth-client-provider.js.map +0 -1
- package/dist/mcp/x402.js.map +0 -1
- package/dist/wire-types-CU9rLoeS.js.map +0 -1
- package/dist/workflow-types-Baz_PO5v.d.ts +0 -280
package/dist/chat/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} from "../agent-
|
|
2
|
+
H as AgentToolEvent,
|
|
3
|
+
U as AgentToolEventMessage,
|
|
4
|
+
W as AgentToolEventState,
|
|
5
|
+
et as AgentToolRunState,
|
|
6
|
+
v as FiberRecoveryContext
|
|
7
|
+
} from "../agent-routing-CnkaHb-v.js";
|
|
8
8
|
import {
|
|
9
9
|
n as ClientToolSchema,
|
|
10
10
|
r as createToolsFromClientSchemas,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
r as AgentToolProgressEmitResult,
|
|
19
19
|
s as interceptAgentToolBroadcast,
|
|
20
20
|
t as AgentToolBroadcastHooks
|
|
21
|
-
} from "../agent-tools-
|
|
21
|
+
} from "../agent-tools-C0XJqWzB.js";
|
|
22
22
|
import { JSONSchema7, UIMessage } from "ai";
|
|
23
23
|
import { Connection } from "agents";
|
|
24
24
|
|
|
@@ -192,7 +192,9 @@ declare function enforceRowSizeLimit(
|
|
|
192
192
|
//#region src/chat/stream-accumulator.d.ts
|
|
193
193
|
interface StreamAccumulatorOptions {
|
|
194
194
|
messageId: string;
|
|
195
|
+
/** Whether chunks continue the current assistant message when merged. */
|
|
195
196
|
continuation?: boolean;
|
|
197
|
+
/** Eager seed; omitted continuations seed from the messages passed to `mergeInto`. */
|
|
196
198
|
existingParts?: UIMessage["parts"];
|
|
197
199
|
existingMetadata?: Record<string, unknown>;
|
|
198
200
|
}
|
|
@@ -236,6 +238,7 @@ declare class StreamAccumulator {
|
|
|
236
238
|
readonly parts: UIMessage["parts"];
|
|
237
239
|
metadata?: Record<string, unknown>;
|
|
238
240
|
private _isContinuation;
|
|
241
|
+
private _pendingContinuationChunks;
|
|
239
242
|
constructor(options: StreamAccumulatorOptions);
|
|
240
243
|
applyChunk(chunk: StreamChunkData): ChunkResult;
|
|
241
244
|
/** Snapshot the current state as a UIMessage. */
|
|
@@ -243,7 +246,8 @@ declare class StreamAccumulator {
|
|
|
243
246
|
/**
|
|
244
247
|
* Merge this accumulator's message into an existing message array.
|
|
245
248
|
* Handles continuation (walk backward for last assistant), replacement
|
|
246
|
-
* (update existing by messageId), or append (new message).
|
|
249
|
+
* (update existing by messageId), or append (new message). An unseeded
|
|
250
|
+
* continuation adopts current parts here before applying its queued chunks.
|
|
247
251
|
*/
|
|
248
252
|
mergeInto(messages: UIMessage[]): UIMessage[];
|
|
249
253
|
}
|
|
@@ -307,6 +311,32 @@ declare class TurnQueue {
|
|
|
307
311
|
private _decrementCount;
|
|
308
312
|
}
|
|
309
313
|
//#endregion
|
|
314
|
+
//#region src/chat/text-segment-joiner.d.ts
|
|
315
|
+
/** @internal A parsed structured-stream chunk accepted by the joiner. */
|
|
316
|
+
interface TextSegmentChunk {
|
|
317
|
+
delta?: unknown;
|
|
318
|
+
text?: unknown;
|
|
319
|
+
type?: unknown;
|
|
320
|
+
}
|
|
321
|
+
/** @internal A text or semantic boundary emitted by the joiner. */
|
|
322
|
+
type TextSegmentEvent =
|
|
323
|
+
| {
|
|
324
|
+
type: "text";
|
|
325
|
+
text: string;
|
|
326
|
+
}
|
|
327
|
+
| {
|
|
328
|
+
type: "boundary";
|
|
329
|
+
};
|
|
330
|
+
/**
|
|
331
|
+
* @internal Converts structured stream chunks into text and boundary events
|
|
332
|
+
* without gluing words across non-text chunks. Sibling-package support for
|
|
333
|
+
* `@cloudflare/voice` and `@cloudflare/think`, not a public API.
|
|
334
|
+
*/
|
|
335
|
+
declare class TextSegmentJoiner {
|
|
336
|
+
#private;
|
|
337
|
+
pushChunk(chunk: TextSegmentChunk): TextSegmentEvent[];
|
|
338
|
+
}
|
|
339
|
+
//#endregion
|
|
310
340
|
//#region src/chat/lifecycle.d.ts
|
|
311
341
|
/**
|
|
312
342
|
* An advisory, open-ended hint that an action records during a turn to
|
|
@@ -495,9 +525,11 @@ type ChatRecoveryProgressContext = {
|
|
|
495
525
|
ageMs: number;
|
|
496
526
|
};
|
|
497
527
|
/**
|
|
498
|
-
* Configuration for durable chat recovery
|
|
499
|
-
* `
|
|
500
|
-
*
|
|
528
|
+
* Configuration for durable chat recovery, which is always enabled for chat
|
|
529
|
+
* turns. `true` uses these defaults: `maxAttempts: 10`,
|
|
530
|
+
* `stableTimeoutMs: 10_000`, `noProgressTimeoutMs: 300_000` (5 min),
|
|
531
|
+
* `maxRecoveryWork: 1000`, and a generic terminal message. Assign an object to
|
|
532
|
+
* tune recovery without disabling its durable bookkeeping.
|
|
501
533
|
*
|
|
502
534
|
* **Apply this as a class field or in the constructor — never assign it in
|
|
503
535
|
* `onStart()`.** On every wake the SDK evaluates recovery budgets (and may seal
|
|
@@ -509,7 +541,7 @@ type ChatRecoveryProgressContext = {
|
|
|
509
541
|
* `onStart()`.
|
|
510
542
|
*/
|
|
511
543
|
type ChatRecoveryConfig =
|
|
512
|
-
|
|
|
544
|
+
| true
|
|
513
545
|
| {
|
|
514
546
|
maxAttempts?: number;
|
|
515
547
|
stableTimeoutMs?: number;
|
|
@@ -570,8 +602,8 @@ type ChatRecoveryConfig =
|
|
|
570
602
|
): boolean | Promise<boolean>;
|
|
571
603
|
onExhausted?(ctx: ChatRecoveryExhaustedContext): void | Promise<void>;
|
|
572
604
|
};
|
|
605
|
+
/** Fully-defaulted configuration for always-on durable chat recovery. */
|
|
573
606
|
type ResolvedChatRecoveryConfig = {
|
|
574
|
-
enabled: boolean;
|
|
575
607
|
maxAttempts: number;
|
|
576
608
|
stableTimeoutMs: number;
|
|
577
609
|
terminalMessage: string;
|
|
@@ -682,7 +714,7 @@ type BroadcastStreamEvent =
|
|
|
682
714
|
error?: boolean;
|
|
683
715
|
replay?: boolean;
|
|
684
716
|
replayComplete?: boolean;
|
|
685
|
-
continuation?: boolean /**
|
|
717
|
+
continuation?: boolean /** @deprecated Continuations now seed from current messages in `messagesUpdate`. */;
|
|
686
718
|
currentMessages?: UIMessage[];
|
|
687
719
|
}
|
|
688
720
|
| {
|
|
@@ -2246,7 +2278,8 @@ declare const CHAT_RECOVERY_ALARM_DEBOUNCE_MS: number;
|
|
|
2246
2278
|
declare const CHAT_RECOVERING_FLAG_TTL_MS: number;
|
|
2247
2279
|
/**
|
|
2248
2280
|
* Resolve a raw `chatRecovery` config field into the fully-defaulted form the
|
|
2249
|
-
* engine reasons about.
|
|
2281
|
+
* engine reasons about. Durable recovery is always enabled; a legacy runtime
|
|
2282
|
+
* `false` value from previously compiled JavaScript safely receives defaults.
|
|
2250
2283
|
*/
|
|
2251
2284
|
declare function resolveChatRecoveryConfig(
|
|
2252
2285
|
raw: ChatRecoveryConfig | undefined
|
|
@@ -3355,6 +3388,9 @@ export {
|
|
|
3355
3388
|
SubmitConcurrencyController,
|
|
3356
3389
|
type SubmitConcurrencyDecision,
|
|
3357
3390
|
TIMED_OUT,
|
|
3391
|
+
type TextSegmentChunk,
|
|
3392
|
+
type TextSegmentEvent,
|
|
3393
|
+
TextSegmentJoiner,
|
|
3358
3394
|
type ToolPartUpdate,
|
|
3359
3395
|
TurnQueue,
|
|
3360
3396
|
type TurnResult,
|
package/dist/chat/index.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { i as _classPrivateFieldInitSpec, n as _classPrivateFieldSet2, r as _assertClassBrand, t as _classPrivateFieldGet2 } from "../classPrivateFieldGet2-DZBYAB34.js";
|
|
2
|
+
import { t as _classPrivateMethodInitSpec } from "../classPrivateMethodInitSpec-qMjJ6sHQ.js";
|
|
1
3
|
import { i as normalizeToolInput, n as getPartialStreamText, r as isReplayChunk, t as applyChunkToParts } from "../message-builder-BymO4N_D.js";
|
|
2
4
|
import { i as interceptAgentToolBroadcast, n as applyAgentToolEvent, r as createAgentToolEventState, t as AgentToolProgressEmitter } from "../agent-tools-y7zLfw4Q.js";
|
|
3
5
|
import { t as truncateToolOutput } from "../tool-output-truncation-CNnnGZQ3.js";
|
|
4
|
-
import {
|
|
6
|
+
import { i as StreamAccumulator, n as STREAM_RESUME_NONE_REASONS, r as transition, t as CHAT_MESSAGE_TYPES } from "../protocol-B0nh6KNf.js";
|
|
7
|
+
import { t as MessageType } from "../wire-types-CnMt6_HR.js";
|
|
5
8
|
import { jsonSchema, tool } from "ai";
|
|
6
9
|
import { nanoid } from "nanoid";
|
|
7
10
|
//#region src/chat/sanitize.ts
|
|
@@ -215,6 +218,58 @@ var TurnQueue = class {
|
|
|
215
218
|
}
|
|
216
219
|
};
|
|
217
220
|
//#endregion
|
|
221
|
+
//#region src/chat/text-segment-joiner.ts
|
|
222
|
+
var _hasText = /* @__PURE__ */ new WeakMap();
|
|
223
|
+
var _lastTextEndedWithWhitespace = /* @__PURE__ */ new WeakMap();
|
|
224
|
+
var _needsBoundarySpace = /* @__PURE__ */ new WeakMap();
|
|
225
|
+
var _TextSegmentJoiner_brand = /* @__PURE__ */ new WeakSet();
|
|
226
|
+
/**
|
|
227
|
+
* @internal Converts structured stream chunks into text and boundary events
|
|
228
|
+
* without gluing words across non-text chunks. Sibling-package support for
|
|
229
|
+
* `@cloudflare/voice` and `@cloudflare/think`, not a public API.
|
|
230
|
+
*/
|
|
231
|
+
var TextSegmentJoiner = class {
|
|
232
|
+
constructor() {
|
|
233
|
+
_classPrivateMethodInitSpec(this, _TextSegmentJoiner_brand);
|
|
234
|
+
_classPrivateFieldInitSpec(this, _hasText, false);
|
|
235
|
+
_classPrivateFieldInitSpec(this, _lastTextEndedWithWhitespace, false);
|
|
236
|
+
_classPrivateFieldInitSpec(this, _needsBoundarySpace, false);
|
|
237
|
+
}
|
|
238
|
+
pushChunk(chunk) {
|
|
239
|
+
if (chunk.type === "text-delta") {
|
|
240
|
+
const text = textFromChunk(chunk);
|
|
241
|
+
return text ? _assertClassBrand(_TextSegmentJoiner_brand, this, _pushText).call(this, text) : [];
|
|
242
|
+
}
|
|
243
|
+
if (typeof chunk.type !== "string" || !_assertClassBrand(_TextSegmentJoiner_brand, this, _markBoundary).call(this)) return [];
|
|
244
|
+
return [{ type: "boundary" }];
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
function _markBoundary() {
|
|
248
|
+
if (!_classPrivateFieldGet2(_hasText, this) || _classPrivateFieldGet2(_needsBoundarySpace, this)) return false;
|
|
249
|
+
_classPrivateFieldSet2(_needsBoundarySpace, this, true);
|
|
250
|
+
return true;
|
|
251
|
+
}
|
|
252
|
+
function _pushText(text) {
|
|
253
|
+
const events = [];
|
|
254
|
+
if (_classPrivateFieldGet2(_needsBoundarySpace, this) && !_classPrivateFieldGet2(_lastTextEndedWithWhitespace, this) && !/^\s/.test(text)) events.push({
|
|
255
|
+
type: "text",
|
|
256
|
+
text: " "
|
|
257
|
+
});
|
|
258
|
+
events.push({
|
|
259
|
+
type: "text",
|
|
260
|
+
text
|
|
261
|
+
});
|
|
262
|
+
_classPrivateFieldSet2(_hasText, this, true);
|
|
263
|
+
_classPrivateFieldSet2(_lastTextEndedWithWhitespace, this, /\s$/.test(text));
|
|
264
|
+
_classPrivateFieldSet2(_needsBoundarySpace, this, false);
|
|
265
|
+
return events;
|
|
266
|
+
}
|
|
267
|
+
function textFromChunk(chunk) {
|
|
268
|
+
if (typeof chunk.text === "string") return chunk.text;
|
|
269
|
+
if (typeof chunk.delta === "string") return chunk.delta;
|
|
270
|
+
return null;
|
|
271
|
+
}
|
|
272
|
+
//#endregion
|
|
218
273
|
//#region src/chat/submit-concurrency.ts
|
|
219
274
|
var SubmitConcurrencyController = class {
|
|
220
275
|
constructor(options) {
|
|
@@ -2506,12 +2561,12 @@ const CHAT_RECOVERY_ALARM_DEBOUNCE_MS = 30 * 1e3;
|
|
|
2506
2561
|
const CHAT_RECOVERING_FLAG_TTL_MS = 900 * 1e3;
|
|
2507
2562
|
/**
|
|
2508
2563
|
* Resolve a raw `chatRecovery` config field into the fully-defaulted form the
|
|
2509
|
-
* engine reasons about.
|
|
2564
|
+
* engine reasons about. Durable recovery is always enabled; a legacy runtime
|
|
2565
|
+
* `false` value from previously compiled JavaScript safely receives defaults.
|
|
2510
2566
|
*/
|
|
2511
2567
|
function resolveChatRecoveryConfig(raw) {
|
|
2512
2568
|
const custom = typeof raw === "object" && raw !== null ? raw : void 0;
|
|
2513
2569
|
return {
|
|
2514
|
-
enabled: raw !== false,
|
|
2515
2570
|
maxAttempts: Math.max(1, Math.floor(custom?.maxAttempts ?? 10)),
|
|
2516
2571
|
stableTimeoutMs: Math.max(0, Math.floor(custom?.stableTimeoutMs ?? 1e4)),
|
|
2517
2572
|
terminalMessage: custom?.terminalMessage ?? "The assistant was interrupted and could not recover. Please try again.",
|
|
@@ -3393,6 +3448,6 @@ async function* iterateWithStallWatchdog(source, timeoutMs, onStall) {
|
|
|
3393
3448
|
}
|
|
3394
3449
|
}
|
|
3395
3450
|
//#endregion
|
|
3396
|
-
export { AGENT_TOOL_STREAM_PROGRESS_BUMP_THROTTLE_MS, AbortRegistry, AgentToolProgressEmitter, AgentToolStreamProgressThrottle, AutoContinuationController, CHAT_LAST_TERMINAL_KEY, CHAT_MESSAGE_TYPES, CHAT_RECOVERING_FLAG_TTL_MS, CHAT_RECOVERING_KEY, CHAT_RECOVERY_ALARM_DEBOUNCE_MS, CHAT_RECOVERY_INCIDENT_KEY_PREFIX, CHAT_RECOVERY_INCIDENT_TTL_MS, CHAT_RECOVERY_PROGRESS_KEY, CHAT_RECOVERY_STABLE_RETRY_DELAY_SECONDS, CHAT_STREAM_PROGRESS_CREDIT_THROTTLE_MS, ChatRecoveryEngine, ChatStreamStalledError, ContinuationState, DEFAULT_CHAT_RECOVERY_MAX_ATTEMPTS, DEFAULT_CHAT_RECOVERY_MAX_OOM_RETRIES, DEFAULT_CHAT_RECOVERY_MAX_WORK, DEFAULT_CHAT_RECOVERY_NO_PROGRESS_TIMEOUT_MS, DEFAULT_CHAT_RECOVERY_STABLE_TIMEOUT_MS, DEFAULT_CHAT_RECOVERY_TERMINAL_MESSAGE, KV_DELETE_MAX_KEYS, MAX_BOUND_PARAMS, MessageType, PreStreamTurns, ROW_MAX_BYTES, ResumableStream, ResumeHandshake, STREAM_CLEANUP_DELAY_SECONDS, STREAM_RESUME_NONE_REASONS, StreamAccumulator, StreamProgressCreditThrottle, SubmitConcurrencyController, TIMED_OUT, TurnQueue, aiSdkRecoveryCodec, applyAgentToolEvent, applyChunkToParts, applyToolUpdate, awaitWithDeadline, transition as broadcastTransition, buildChatRecoveringFrame, buildInClauseStrings, bumpChatRecoveryProgress, byteLength, chatRecoverySchedulePolicy, classifyAgentToolChildRecovery, cleanupStreamBuffers, clearChatTerminal, clientResolvableToolNames, createAgentToolEventState, createChatFiberSnapshot, createToolsFromClientSchemas, crossMessageToolResultUpdate, drainInteractionApplies, enforceRowSizeLimit, hasIncompleteToolBatch, interceptAgentToolBroadcast, isReplayChunk, iterateWithStallWatchdog, listActiveChatRecoveryIncidents, normalizeToolInput, parseProtocolMessage, partAwaitsClientInteraction, pausedExecutionUpdate, pendingChatTerminal, persistReconstructedOrphan, readChatRecoveryProgress, reconcileMessages, reconcileOrphanPartial, recordChatTerminal, repairInterruptedToolParts, resolveChatRecoveryConfig, resolveToolMergeId, runChatRecoveryExhaustion, sanitizeMessage, sendIfOpen, setChatRecovering, shouldCreditStreamProgress, sweepStaleChatRecoveryIncidents, toolApprovalUpdate, toolPartHasSettledResult, toolResultUpdate, unwrapChatFiberSnapshot, wrapChatFiberSnapshot };
|
|
3451
|
+
export { AGENT_TOOL_STREAM_PROGRESS_BUMP_THROTTLE_MS, AbortRegistry, AgentToolProgressEmitter, AgentToolStreamProgressThrottle, AutoContinuationController, CHAT_LAST_TERMINAL_KEY, CHAT_MESSAGE_TYPES, CHAT_RECOVERING_FLAG_TTL_MS, CHAT_RECOVERING_KEY, CHAT_RECOVERY_ALARM_DEBOUNCE_MS, CHAT_RECOVERY_INCIDENT_KEY_PREFIX, CHAT_RECOVERY_INCIDENT_TTL_MS, CHAT_RECOVERY_PROGRESS_KEY, CHAT_RECOVERY_STABLE_RETRY_DELAY_SECONDS, CHAT_STREAM_PROGRESS_CREDIT_THROTTLE_MS, ChatRecoveryEngine, ChatStreamStalledError, ContinuationState, DEFAULT_CHAT_RECOVERY_MAX_ATTEMPTS, DEFAULT_CHAT_RECOVERY_MAX_OOM_RETRIES, DEFAULT_CHAT_RECOVERY_MAX_WORK, DEFAULT_CHAT_RECOVERY_NO_PROGRESS_TIMEOUT_MS, DEFAULT_CHAT_RECOVERY_STABLE_TIMEOUT_MS, DEFAULT_CHAT_RECOVERY_TERMINAL_MESSAGE, KV_DELETE_MAX_KEYS, MAX_BOUND_PARAMS, MessageType, PreStreamTurns, ROW_MAX_BYTES, ResumableStream, ResumeHandshake, STREAM_CLEANUP_DELAY_SECONDS, STREAM_RESUME_NONE_REASONS, StreamAccumulator, StreamProgressCreditThrottle, SubmitConcurrencyController, TIMED_OUT, TextSegmentJoiner, TurnQueue, aiSdkRecoveryCodec, applyAgentToolEvent, applyChunkToParts, applyToolUpdate, awaitWithDeadline, transition as broadcastTransition, buildChatRecoveringFrame, buildInClauseStrings, bumpChatRecoveryProgress, byteLength, chatRecoverySchedulePolicy, classifyAgentToolChildRecovery, cleanupStreamBuffers, clearChatTerminal, clientResolvableToolNames, createAgentToolEventState, createChatFiberSnapshot, createToolsFromClientSchemas, crossMessageToolResultUpdate, drainInteractionApplies, enforceRowSizeLimit, hasIncompleteToolBatch, interceptAgentToolBroadcast, isReplayChunk, iterateWithStallWatchdog, listActiveChatRecoveryIncidents, normalizeToolInput, parseProtocolMessage, partAwaitsClientInteraction, pausedExecutionUpdate, pendingChatTerminal, persistReconstructedOrphan, readChatRecoveryProgress, reconcileMessages, reconcileOrphanPartial, recordChatTerminal, repairInterruptedToolParts, resolveChatRecoveryConfig, resolveToolMergeId, runChatRecoveryExhaustion, sanitizeMessage, sendIfOpen, setChatRecovering, shouldCreditStreamProgress, sweepStaleChatRecoveryIncidents, toolApprovalUpdate, toolPartHasSettledResult, toolResultUpdate, unwrapChatFiberSnapshot, wrapChatFiberSnapshot };
|
|
3397
3452
|
|
|
3398
3453
|
//# sourceMappingURL=index.js.map
|