zeitlich 0.2.44 → 0.2.46
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 +78 -10
- package/dist/{activities-CPIB2v2C.d.ts → activities-Bm4TLTid.d.ts} +24 -4
- package/dist/{activities-DnmNOnq4.d.cts → activities-CyeiqK_f.d.cts} +24 -4
- package/dist/adapters/sandbox/daytona/index.d.cts +2 -2
- package/dist/adapters/sandbox/daytona/index.d.ts +2 -2
- package/dist/adapters/sandbox/daytona/workflow.d.cts +1 -1
- package/dist/adapters/sandbox/daytona/workflow.d.ts +1 -1
- package/dist/adapters/sandbox/e2b/index.d.cts +1 -1
- package/dist/adapters/sandbox/e2b/index.d.ts +1 -1
- package/dist/adapters/thread/anthropic/index.cjs +171 -65
- package/dist/adapters/thread/anthropic/index.cjs.map +1 -1
- package/dist/adapters/thread/anthropic/index.d.cts +19 -4
- package/dist/adapters/thread/anthropic/index.d.ts +19 -4
- package/dist/adapters/thread/anthropic/index.js +171 -65
- package/dist/adapters/thread/anthropic/index.js.map +1 -1
- package/dist/adapters/thread/anthropic/workflow.cjs +3 -1
- package/dist/adapters/thread/anthropic/workflow.cjs.map +1 -1
- package/dist/adapters/thread/anthropic/workflow.d.cts +4 -4
- package/dist/adapters/thread/anthropic/workflow.d.ts +4 -4
- package/dist/adapters/thread/anthropic/workflow.js +3 -1
- package/dist/adapters/thread/anthropic/workflow.js.map +1 -1
- package/dist/adapters/thread/google-genai/index.cjs +171 -69
- package/dist/adapters/thread/google-genai/index.cjs.map +1 -1
- package/dist/adapters/thread/google-genai/index.d.cts +5 -4
- package/dist/adapters/thread/google-genai/index.d.ts +5 -4
- package/dist/adapters/thread/google-genai/index.js +171 -69
- package/dist/adapters/thread/google-genai/index.js.map +1 -1
- package/dist/adapters/thread/google-genai/workflow.cjs +3 -1
- package/dist/adapters/thread/google-genai/workflow.cjs.map +1 -1
- package/dist/adapters/thread/google-genai/workflow.d.cts +5 -4
- package/dist/adapters/thread/google-genai/workflow.d.ts +5 -4
- package/dist/adapters/thread/google-genai/workflow.js +3 -1
- package/dist/adapters/thread/google-genai/workflow.js.map +1 -1
- package/dist/adapters/thread/langchain/index.cjs +181 -77
- package/dist/adapters/thread/langchain/index.cjs.map +1 -1
- package/dist/adapters/thread/langchain/index.d.cts +18 -4
- package/dist/adapters/thread/langchain/index.d.ts +18 -4
- package/dist/adapters/thread/langchain/index.js +182 -74
- package/dist/adapters/thread/langchain/index.js.map +1 -1
- package/dist/adapters/thread/langchain/workflow.cjs +3 -1
- package/dist/adapters/thread/langchain/workflow.cjs.map +1 -1
- package/dist/adapters/thread/langchain/workflow.d.cts +4 -4
- package/dist/adapters/thread/langchain/workflow.d.ts +4 -4
- package/dist/adapters/thread/langchain/workflow.js +3 -1
- package/dist/adapters/thread/langchain/workflow.js.map +1 -1
- package/dist/cold-store-BC5L5Z8A.d.cts +117 -0
- package/dist/cold-store-CFHwemBJ.d.ts +117 -0
- package/dist/index.cjs +252 -53
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +138 -8
- package/dist/index.d.ts +138 -8
- package/dist/index.js +247 -54
- package/dist/index.js.map +1 -1
- package/dist/{proxy-DTnc5rqT.d.cts → proxy-BxFyd6cg.d.cts} +1 -1
- package/dist/{proxy-B7Xi1znZ.d.ts → proxy-Cskmj4Yx.d.ts} +1 -1
- package/dist/{thread-manager-BlX2TwRN.d.cts → thread-manager-9tezUcLW.d.cts} +9 -3
- package/dist/{thread-manager-BAv340mi.d.ts → thread-manager-B-zy3xrs.d.ts} +9 -3
- package/dist/{thread-manager-D2xorI-J.d.ts → thread-manager-D33SUmZa.d.cts} +10 -4
- package/dist/{thread-manager-BWv6ZXI3.d.cts → thread-manager-DduoSkvJ.d.ts} +10 -4
- package/dist/{types-C90VoEpt.d.cts → types-CjY93AWZ.d.cts} +1 -1
- package/dist/{types-4Wmk-wRq.d.cts → types-CnuN9T6t.d.cts} +23 -1
- package/dist/{types-DKsCdAtQ.d.ts → types-CwN6_tAL.d.ts} +23 -1
- package/dist/{types-Clhqautb.d.ts → types-L5bvbF-n.d.ts} +17 -1
- package/dist/{types-DpFD8ofR.d.ts → types-gVa5XCWD.d.ts} +1 -1
- package/dist/{types-DRJt1TMi.d.cts → types-oxt8GN97.d.cts} +17 -1
- package/dist/{workflow-D32TRMr-.d.ts → workflow-B1TOcHbt.d.ts} +33 -2
- package/dist/{workflow-XVt0ww8K.d.cts → workflow-DIaIV7L2.d.cts} +33 -2
- package/dist/workflow.cjs +29 -19
- package/dist/workflow.cjs.map +1 -1
- package/dist/workflow.d.cts +2 -2
- package/dist/workflow.d.ts +2 -2
- package/dist/workflow.js +29 -19
- package/dist/workflow.js.map +1 -1
- package/package.json +6 -1
- package/src/adapters/thread/anthropic/activities.ts +72 -36
- package/src/adapters/thread/anthropic/thread-manager.ts +9 -1
- package/src/adapters/thread/google-genai/activities.ts +64 -40
- package/src/adapters/thread/google-genai/thread-manager.ts +9 -1
- package/src/adapters/thread/langchain/activities.ts +63 -36
- package/src/adapters/thread/langchain/thread-manager.ts +9 -1
- package/src/index.ts +20 -1
- package/src/lib/session/session-edge-cases.integration.test.ts +12 -0
- package/src/lib/session/session.integration.test.ts +138 -0
- package/src/lib/session/session.ts +47 -22
- package/src/lib/session/types.ts +22 -0
- package/src/lib/thread/cold-store.test.ts +193 -0
- package/src/lib/thread/cold-store.ts +250 -0
- package/src/lib/thread/index.ts +32 -0
- package/src/lib/thread/keys.ts +20 -0
- package/src/lib/thread/manager.ts +16 -27
- package/src/lib/thread/proxy.ts +2 -0
- package/src/lib/thread/snapshot.test.ts +443 -0
- package/src/lib/thread/snapshot.ts +163 -0
- package/src/lib/thread/test-utils.ts +228 -0
- package/src/lib/thread/tiered.test.ts +281 -0
- package/src/lib/thread/tiered.ts +135 -0
- package/src/lib/thread/types.ts +16 -0
- package/src/lib/.env +0 -1
- package/src/tools/bash/.env +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Redis from 'ioredis';
|
|
2
2
|
import Anthropic from '@anthropic-ai/sdk';
|
|
3
|
-
import { J as JsonValue } from './types-
|
|
4
|
-
import { T as ThreadManagerHooks, P as ProviderThreadManager } from './types-
|
|
3
|
+
import { J as JsonValue } from './types-CnuN9T6t.cjs';
|
|
4
|
+
import { T as ThreadManagerHooks, P as ProviderThreadManager } from './types-oxt8GN97.cjs';
|
|
5
5
|
|
|
6
6
|
/** SDK-native content type for Anthropic human messages */
|
|
7
7
|
type AnthropicContent = string | Anthropic.Messages.ContentBlockParam[];
|
|
@@ -21,6 +21,12 @@ interface AnthropicThreadManagerConfig {
|
|
|
21
21
|
/** Thread key, defaults to 'messages' */
|
|
22
22
|
key?: string;
|
|
23
23
|
hooks?: AnthropicThreadManagerHooks;
|
|
24
|
+
/**
|
|
25
|
+
* Override the default thread TTL (90 days). When pairing the
|
|
26
|
+
* adapter with a durable cold tier, a shorter TTL (hours) is
|
|
27
|
+
* typically more appropriate.
|
|
28
|
+
*/
|
|
29
|
+
ttlSeconds?: number;
|
|
24
30
|
}
|
|
25
31
|
/** Prepared payload ready to send to the Anthropic API */
|
|
26
32
|
interface AnthropicInvocationPayload {
|
|
@@ -39,4 +45,4 @@ interface AnthropicThreadManager extends ProviderThreadManager<StoredMessage, An
|
|
|
39
45
|
*/
|
|
40
46
|
declare function createAnthropicThreadManager(config: AnthropicThreadManagerConfig): AnthropicThreadManager;
|
|
41
47
|
|
|
42
|
-
export { type AnthropicContent as A, type StoredMessage as S, type AnthropicThreadManagerHooks as a, type
|
|
48
|
+
export { type AnthropicContent as A, type StoredMessage as S, type AnthropicThreadManagerHooks as a, type AnthropicInvocationPayload as b, type AnthropicThreadManager as c, type AnthropicThreadManagerConfig as d, createAnthropicThreadManager as e };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Redis from 'ioredis';
|
|
2
2
|
import Anthropic from '@anthropic-ai/sdk';
|
|
3
|
-
import { J as JsonValue } from './types-
|
|
4
|
-
import { T as ThreadManagerHooks, P as ProviderThreadManager } from './types-
|
|
3
|
+
import { J as JsonValue } from './types-CwN6_tAL.js';
|
|
4
|
+
import { T as ThreadManagerHooks, P as ProviderThreadManager } from './types-L5bvbF-n.js';
|
|
5
5
|
|
|
6
6
|
/** SDK-native content type for Anthropic human messages */
|
|
7
7
|
type AnthropicContent = string | Anthropic.Messages.ContentBlockParam[];
|
|
@@ -21,6 +21,12 @@ interface AnthropicThreadManagerConfig {
|
|
|
21
21
|
/** Thread key, defaults to 'messages' */
|
|
22
22
|
key?: string;
|
|
23
23
|
hooks?: AnthropicThreadManagerHooks;
|
|
24
|
+
/**
|
|
25
|
+
* Override the default thread TTL (90 days). When pairing the
|
|
26
|
+
* adapter with a durable cold tier, a shorter TTL (hours) is
|
|
27
|
+
* typically more appropriate.
|
|
28
|
+
*/
|
|
29
|
+
ttlSeconds?: number;
|
|
24
30
|
}
|
|
25
31
|
/** Prepared payload ready to send to the Anthropic API */
|
|
26
32
|
interface AnthropicInvocationPayload {
|
|
@@ -39,4 +45,4 @@ interface AnthropicThreadManager extends ProviderThreadManager<StoredMessage, An
|
|
|
39
45
|
*/
|
|
40
46
|
declare function createAnthropicThreadManager(config: AnthropicThreadManagerConfig): AnthropicThreadManager;
|
|
41
47
|
|
|
42
|
-
export { type AnthropicContent as A, type StoredMessage as S, type AnthropicThreadManagerHooks as a, type
|
|
48
|
+
export { type AnthropicContent as A, type StoredMessage as S, type AnthropicThreadManagerHooks as a, type AnthropicInvocationPayload as b, type AnthropicThreadManager as c, type AnthropicThreadManagerConfig as d, createAnthropicThreadManager as e };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Redis from 'ioredis';
|
|
2
|
-
import { J as JsonValue } from './types-
|
|
3
|
-
import { StoredMessage, BaseMessage
|
|
4
|
-
import { T as ThreadManagerHooks, P as ProviderThreadManager } from './types-
|
|
2
|
+
import { J as JsonValue } from './types-CnuN9T6t.cjs';
|
|
3
|
+
import { MessageContent, StoredMessage, BaseMessage } from '@langchain/core/messages';
|
|
4
|
+
import { T as ThreadManagerHooks, P as ProviderThreadManager } from './types-oxt8GN97.cjs';
|
|
5
5
|
|
|
6
6
|
/** SDK-native content type for LangChain human messages */
|
|
7
7
|
type LangChainContent = string | MessageContent;
|
|
@@ -14,6 +14,12 @@ interface LangChainThreadManagerConfig {
|
|
|
14
14
|
/** Thread key, defaults to 'messages' */
|
|
15
15
|
key?: string;
|
|
16
16
|
hooks?: LangChainThreadManagerHooks;
|
|
17
|
+
/**
|
|
18
|
+
* Override the default thread TTL (90 days). When pairing the
|
|
19
|
+
* adapter with a durable cold tier, a shorter TTL (hours) is
|
|
20
|
+
* typically more appropriate.
|
|
21
|
+
*/
|
|
22
|
+
ttlSeconds?: number;
|
|
17
23
|
}
|
|
18
24
|
/** Prepared payload ready to send to a LangChain chat model */
|
|
19
25
|
interface LangChainInvocationPayload {
|
|
@@ -31,4 +37,4 @@ interface LangChainThreadManager extends ProviderThreadManager<StoredMessage, La
|
|
|
31
37
|
*/
|
|
32
38
|
declare function createLangChainThreadManager(config: LangChainThreadManagerConfig): LangChainThreadManager;
|
|
33
39
|
|
|
34
|
-
export { type LangChainContent as L, type LangChainThreadManagerHooks as a, type
|
|
40
|
+
export { type LangChainContent as L, type LangChainThreadManagerHooks as a, type LangChainInvocationPayload as b, type LangChainThreadManager as c, type LangChainThreadManagerConfig as d, createLangChainThreadManager as e };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Redis from 'ioredis';
|
|
2
|
-
import { J as JsonValue } from './types-
|
|
3
|
-
import { StoredMessage, BaseMessage
|
|
4
|
-
import { T as ThreadManagerHooks, P as ProviderThreadManager } from './types-
|
|
2
|
+
import { J as JsonValue } from './types-CwN6_tAL.js';
|
|
3
|
+
import { MessageContent, StoredMessage, BaseMessage } from '@langchain/core/messages';
|
|
4
|
+
import { T as ThreadManagerHooks, P as ProviderThreadManager } from './types-L5bvbF-n.js';
|
|
5
5
|
|
|
6
6
|
/** SDK-native content type for LangChain human messages */
|
|
7
7
|
type LangChainContent = string | MessageContent;
|
|
@@ -14,6 +14,12 @@ interface LangChainThreadManagerConfig {
|
|
|
14
14
|
/** Thread key, defaults to 'messages' */
|
|
15
15
|
key?: string;
|
|
16
16
|
hooks?: LangChainThreadManagerHooks;
|
|
17
|
+
/**
|
|
18
|
+
* Override the default thread TTL (90 days). When pairing the
|
|
19
|
+
* adapter with a durable cold tier, a shorter TTL (hours) is
|
|
20
|
+
* typically more appropriate.
|
|
21
|
+
*/
|
|
22
|
+
ttlSeconds?: number;
|
|
17
23
|
}
|
|
18
24
|
/** Prepared payload ready to send to a LangChain chat model */
|
|
19
25
|
interface LangChainInvocationPayload {
|
|
@@ -31,4 +37,4 @@ interface LangChainThreadManager extends ProviderThreadManager<StoredMessage, La
|
|
|
31
37
|
*/
|
|
32
38
|
declare function createLangChainThreadManager(config: LangChainThreadManagerConfig): LangChainThreadManager;
|
|
33
39
|
|
|
34
|
-
export { type LangChainContent as L, type LangChainThreadManagerHooks as a, type
|
|
40
|
+
export { type LangChainContent as L, type LangChainThreadManagerHooks as a, type LangChainInvocationPayload as b, type LangChainThreadManager as c, type LangChainThreadManagerConfig as d, createLangChainThreadManager as e };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as SandboxFileSystem, F as FileStat, D as DirentEntry,
|
|
1
|
+
import { c as SandboxFileSystem, F as FileStat, D as DirentEntry, b as Sandbox$1, a as SandboxCreateOptions } from './types-CJ7tCdl6.cjs';
|
|
2
2
|
import { Sandbox } from '@daytonaio/sdk';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -1529,6 +1529,28 @@ interface ThreadOps<TContent = string> {
|
|
|
1529
1529
|
* store, continue later" works regardless of exit reason.
|
|
1530
1530
|
*/
|
|
1531
1531
|
saveThreadState(threadId: string, state: PersistedThreadState, threadKey?: string): Promise<void>;
|
|
1532
|
+
/**
|
|
1533
|
+
* Restore the thread's contents from the durable cold tier (if any)
|
|
1534
|
+
* into Redis. Called once on session entry for `mode: "continue"`
|
|
1535
|
+
* and `mode: "fork"` so the rest of the loop reads the freshest data.
|
|
1536
|
+
*
|
|
1537
|
+
* Adapters configured without a cold-store implementation treat this
|
|
1538
|
+
* as a no-op. Implementations must be **idempotent** — Temporal
|
|
1539
|
+
* retries the activity on transient failures, and a thread that is
|
|
1540
|
+
* already hot must not be wiped.
|
|
1541
|
+
*/
|
|
1542
|
+
hydrateThread(threadId: string, threadKey?: string): Promise<void>;
|
|
1543
|
+
/**
|
|
1544
|
+
* Archive the thread's contents to the durable cold tier and
|
|
1545
|
+
* (optionally) drop the hot-tier Redis keys. Called once in the
|
|
1546
|
+
* session's `finally` block on every exit path, after
|
|
1547
|
+
* `saveThreadState`.
|
|
1548
|
+
*
|
|
1549
|
+
* Adapters configured without a cold-store implementation treat this
|
|
1550
|
+
* as a no-op. Implementations must be **idempotent** — the cold
|
|
1551
|
+
* tier is last-writer-wins and a retried flush must converge.
|
|
1552
|
+
*/
|
|
1553
|
+
flushThread(threadId: string, threadKey?: string): Promise<void>;
|
|
1532
1554
|
}
|
|
1533
1555
|
/**
|
|
1534
1556
|
* Composes an adapter prefix + workflow scope for activity naming.
|
|
@@ -1774,4 +1796,4 @@ interface ZeitlichSession<M = unknown, HasSandbox extends boolean = boolean> {
|
|
|
1774
1796
|
}): Promise<SessionResult<M, T, HasSandbox>>;
|
|
1775
1797
|
}
|
|
1776
1798
|
|
|
1777
|
-
export { type
|
|
1799
|
+
export { type SandboxShutdown as $, type AgentResponse as A, type BaseAgentState as B, type PostToolUseFailureHookContext as C, type PostToolUseFailureHookResult as D, type PostToolUseHook as E, type FileEntryMetadata as F, type PostToolUseHookContext as G, type Hooks as H, type InferToolResults as I, type JsonValue as J, type PreHumanMessageAppendHook as K, type PreHumanMessageAppendHookContext as L, type ModelInvokerConfig as M, type PreToolUseHook as N, type PreToolUseHookContext as O, type PersistedThreadState as P, type PreToolUseHookResult as Q, type RouterContext as R, type ScopedPrefix as S, type ThreadOps as T, type ProcessToolCallsContext as U, type VirtualFsContext as V, type ProcessToolCallsResult as W, type RawToolCall as X, type RewindSignal as Y, type RunAgentActivity as Z, type SandboxInit as _, type ModelInvoker as a, type SerializableToolDefinition as a0, type SessionConfig as a1, type SessionEndHook as a2, type SessionEndHookContext as a3, type SessionExitReason as a4, type SessionRequiredCaps as a5, type SessionResult as a6, type SessionStartHook as a7, type SessionStartHookContext as a8, type SubagentChildWorkflowOptions as a9, VirtualFileSystem as aA, type VirtualFileTree as aB, type VirtualFsOps as aC, type VirtualFsState as aD, type WorkflowTask as aE, type ZeitlichSession as aF, isTerminalStatus as aG, type ToolRouterOptions as aH, type SubagentConfig as aa, type SubagentContinuationCaps as ab, type SubagentDefinition as ac, type SubagentFnResult as ad, type SubagentHandlerResponse as ae, type SubagentHooks as af, type SubagentSandboxConfig as ag, type SubagentSandboxShutdown as ah, type SubagentSessionInput as ai, type SubagentWorkflow as aj, type SubagentWorkflowInput as ak, type TaskStatus as al, type ThreadInit as am, type TokenUsage as an, type ToolArgs as ao, type ToolCallResult as ap, type ToolCallResultUnion as aq, type ToolDefinition as ar, type ToolHandler as as, type ToolHooks as at, type ToolMap as au, type ToolNames as av, type ToolResult as aw, type ToolRouter as ax, type ToolRouterHooks as ay, type ToolWithHandler as az, type PrefixedThreadOps as b, type ToolHandlerResponse as c, type ActivityToolHandler as d, type ToolResultConfig as e, type RunAgentConfig as f, type SkillProvider as g, type SkillMetadata as h, type Skill as i, type FileResolver as j, type TreeMutation as k, type PrefixedVirtualFsOps as l, type AgentConfig as m, type AgentFile as n, type AgentState as o, type AgentStateManager as p, type AgentStatus as q, type AppendToolResultFn as r, type FileEntry as s, type JsonPrimitive as t, type JsonSerializable as u, type ParsedToolCall as v, type ParsedToolCallUnion as w, type PostHumanMessageAppendHook as x, type PostHumanMessageAppendHookContext as y, type PostToolUseFailureHook as z };
|
|
@@ -1529,6 +1529,28 @@ interface ThreadOps<TContent = string> {
|
|
|
1529
1529
|
* store, continue later" works regardless of exit reason.
|
|
1530
1530
|
*/
|
|
1531
1531
|
saveThreadState(threadId: string, state: PersistedThreadState, threadKey?: string): Promise<void>;
|
|
1532
|
+
/**
|
|
1533
|
+
* Restore the thread's contents from the durable cold tier (if any)
|
|
1534
|
+
* into Redis. Called once on session entry for `mode: "continue"`
|
|
1535
|
+
* and `mode: "fork"` so the rest of the loop reads the freshest data.
|
|
1536
|
+
*
|
|
1537
|
+
* Adapters configured without a cold-store implementation treat this
|
|
1538
|
+
* as a no-op. Implementations must be **idempotent** — Temporal
|
|
1539
|
+
* retries the activity on transient failures, and a thread that is
|
|
1540
|
+
* already hot must not be wiped.
|
|
1541
|
+
*/
|
|
1542
|
+
hydrateThread(threadId: string, threadKey?: string): Promise<void>;
|
|
1543
|
+
/**
|
|
1544
|
+
* Archive the thread's contents to the durable cold tier and
|
|
1545
|
+
* (optionally) drop the hot-tier Redis keys. Called once in the
|
|
1546
|
+
* session's `finally` block on every exit path, after
|
|
1547
|
+
* `saveThreadState`.
|
|
1548
|
+
*
|
|
1549
|
+
* Adapters configured without a cold-store implementation treat this
|
|
1550
|
+
* as a no-op. Implementations must be **idempotent** — the cold
|
|
1551
|
+
* tier is last-writer-wins and a retried flush must converge.
|
|
1552
|
+
*/
|
|
1553
|
+
flushThread(threadId: string, threadKey?: string): Promise<void>;
|
|
1532
1554
|
}
|
|
1533
1555
|
/**
|
|
1534
1556
|
* Composes an adapter prefix + workflow scope for activity naming.
|
|
@@ -1774,4 +1796,4 @@ interface ZeitlichSession<M = unknown, HasSandbox extends boolean = boolean> {
|
|
|
1774
1796
|
}): Promise<SessionResult<M, T, HasSandbox>>;
|
|
1775
1797
|
}
|
|
1776
1798
|
|
|
1777
|
-
export { type
|
|
1799
|
+
export { type SandboxShutdown as $, type AgentResponse as A, type BaseAgentState as B, type PostToolUseFailureHookContext as C, type PostToolUseFailureHookResult as D, type PostToolUseHook as E, type FileEntryMetadata as F, type PostToolUseHookContext as G, type Hooks as H, type InferToolResults as I, type JsonValue as J, type PreHumanMessageAppendHook as K, type PreHumanMessageAppendHookContext as L, type ModelInvokerConfig as M, type PreToolUseHook as N, type PreToolUseHookContext as O, type PersistedThreadState as P, type PreToolUseHookResult as Q, type RouterContext as R, type ScopedPrefix as S, type ThreadOps as T, type ProcessToolCallsContext as U, type VirtualFsContext as V, type ProcessToolCallsResult as W, type RawToolCall as X, type RewindSignal as Y, type RunAgentActivity as Z, type SandboxInit as _, type ModelInvoker as a, type SerializableToolDefinition as a0, type SessionConfig as a1, type SessionEndHook as a2, type SessionEndHookContext as a3, type SessionExitReason as a4, type SessionRequiredCaps as a5, type SessionResult as a6, type SessionStartHook as a7, type SessionStartHookContext as a8, type SubagentChildWorkflowOptions as a9, VirtualFileSystem as aA, type VirtualFileTree as aB, type VirtualFsOps as aC, type VirtualFsState as aD, type WorkflowTask as aE, type ZeitlichSession as aF, isTerminalStatus as aG, type ToolRouterOptions as aH, type SubagentConfig as aa, type SubagentContinuationCaps as ab, type SubagentDefinition as ac, type SubagentFnResult as ad, type SubagentHandlerResponse as ae, type SubagentHooks as af, type SubagentSandboxConfig as ag, type SubagentSandboxShutdown as ah, type SubagentSessionInput as ai, type SubagentWorkflow as aj, type SubagentWorkflowInput as ak, type TaskStatus as al, type ThreadInit as am, type TokenUsage as an, type ToolArgs as ao, type ToolCallResult as ap, type ToolCallResultUnion as aq, type ToolDefinition as ar, type ToolHandler as as, type ToolHooks as at, type ToolMap as au, type ToolNames as av, type ToolResult as aw, type ToolRouter as ax, type ToolRouterHooks as ay, type ToolWithHandler as az, type PrefixedThreadOps as b, type ToolHandlerResponse as c, type ActivityToolHandler as d, type ToolResultConfig as e, type RunAgentConfig as f, type SkillProvider as g, type SkillMetadata as h, type Skill as i, type FileResolver as j, type TreeMutation as k, type PrefixedVirtualFsOps as l, type AgentConfig as m, type AgentFile as n, type AgentState as o, type AgentStateManager as p, type AgentStatus as q, type AppendToolResultFn as r, type FileEntry as s, type JsonPrimitive as t, type JsonSerializable as u, type ParsedToolCall as v, type ParsedToolCallUnion as w, type PostHumanMessageAppendHook as x, type PostHumanMessageAppendHookContext as y, type PostToolUseFailureHook as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Redis from 'ioredis';
|
|
2
|
-
import { P as PersistedThreadState, J as JsonValue } from './types-
|
|
2
|
+
import { P as PersistedThreadState, J as JsonValue } from './types-CwN6_tAL.js';
|
|
3
3
|
|
|
4
4
|
interface ThreadManagerConfig<T> {
|
|
5
5
|
redis: Redis;
|
|
@@ -15,6 +15,17 @@ interface ThreadManagerConfig<T> {
|
|
|
15
15
|
* When provided, `append` uses an atomic Lua script to skip duplicate writes.
|
|
16
16
|
*/
|
|
17
17
|
idOf?: (message: T) => string;
|
|
18
|
+
/**
|
|
19
|
+
* TTL (in seconds) applied to every Redis key the manager writes
|
|
20
|
+
* (the list, the meta marker, the state slice, and dedup markers).
|
|
21
|
+
*
|
|
22
|
+
* Defaults to {@link THREAD_TTL_SECONDS} (90 days) for back-compat.
|
|
23
|
+
* When the consumer pairs the thread manager with a durable cold
|
|
24
|
+
* tier (see `createTieredThreadManager`), a much shorter TTL — e.g.
|
|
25
|
+
* a few hours — is usually more appropriate since the cold tier is
|
|
26
|
+
* the source of truth and Redis is just a hot cache.
|
|
27
|
+
*/
|
|
28
|
+
ttlSeconds?: number;
|
|
18
29
|
}
|
|
19
30
|
/** Generic thread manager for any message type */
|
|
20
31
|
interface BaseThreadManager<T> {
|
|
@@ -26,6 +37,11 @@ interface BaseThreadManager<T> {
|
|
|
26
37
|
* Append messages to the thread.
|
|
27
38
|
* When `idOf` is configured, appends are idempotent — retries with the
|
|
28
39
|
* same message ids are atomically skipped via a Redis Lua script.
|
|
40
|
+
*
|
|
41
|
+
* Caveat with tiered storage: multi-message batches write one composite
|
|
42
|
+
* dedup key (`"m1:m2"`); snapshots only persist per-message keys, so a
|
|
43
|
+
* batch retried after `flush` → `hydrate` will not be deduped. Adapter
|
|
44
|
+
* helpers all single-append and are unaffected.
|
|
29
45
|
*/
|
|
30
46
|
append(messages: T[]): Promise<void>;
|
|
31
47
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as SandboxFileSystem, F as FileStat, D as DirentEntry,
|
|
1
|
+
import { c as SandboxFileSystem, F as FileStat, D as DirentEntry, b as Sandbox$1, a as SandboxCreateOptions } from './types-CJ7tCdl6.js';
|
|
2
2
|
import { Sandbox } from '@daytonaio/sdk';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Redis from 'ioredis';
|
|
2
|
-
import { P as PersistedThreadState, J as JsonValue } from './types-
|
|
2
|
+
import { P as PersistedThreadState, J as JsonValue } from './types-CnuN9T6t.cjs';
|
|
3
3
|
|
|
4
4
|
interface ThreadManagerConfig<T> {
|
|
5
5
|
redis: Redis;
|
|
@@ -15,6 +15,17 @@ interface ThreadManagerConfig<T> {
|
|
|
15
15
|
* When provided, `append` uses an atomic Lua script to skip duplicate writes.
|
|
16
16
|
*/
|
|
17
17
|
idOf?: (message: T) => string;
|
|
18
|
+
/**
|
|
19
|
+
* TTL (in seconds) applied to every Redis key the manager writes
|
|
20
|
+
* (the list, the meta marker, the state slice, and dedup markers).
|
|
21
|
+
*
|
|
22
|
+
* Defaults to {@link THREAD_TTL_SECONDS} (90 days) for back-compat.
|
|
23
|
+
* When the consumer pairs the thread manager with a durable cold
|
|
24
|
+
* tier (see `createTieredThreadManager`), a much shorter TTL — e.g.
|
|
25
|
+
* a few hours — is usually more appropriate since the cold tier is
|
|
26
|
+
* the source of truth and Redis is just a hot cache.
|
|
27
|
+
*/
|
|
28
|
+
ttlSeconds?: number;
|
|
18
29
|
}
|
|
19
30
|
/** Generic thread manager for any message type */
|
|
20
31
|
interface BaseThreadManager<T> {
|
|
@@ -26,6 +37,11 @@ interface BaseThreadManager<T> {
|
|
|
26
37
|
* Append messages to the thread.
|
|
27
38
|
* When `idOf` is configured, appends are idempotent — retries with the
|
|
28
39
|
* same message ids are atomically skipped via a Redis Lua script.
|
|
40
|
+
*
|
|
41
|
+
* Caveat with tiered storage: multi-message batches write one composite
|
|
42
|
+
* dedup key (`"m1:m2"`); snapshots only persist per-message keys, so a
|
|
43
|
+
* batch retried after `flush` → `hydrate` will not be deduped. Adapter
|
|
44
|
+
* helpers all single-append and are unaffected.
|
|
29
45
|
*/
|
|
30
46
|
append(messages: T[]): Promise<void>;
|
|
31
47
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { au as ToolMap, _ as SandboxInit, ah as SubagentSandboxShutdown, a1 as SessionConfig, aF as ZeitlichSession, $ as SandboxShutdown, am as ThreadInit, u as JsonSerializable, B as BaseAgentState, p as AgentStateManager, aH as ToolRouterOptions, ax as ToolRouter, R as RouterContext, J as JsonValue, az as ToolWithHandler, w as ParsedToolCallUnion, av as ToolNames, ac as SubagentDefinition, af as SubagentHooks, ag as SubagentSandboxConfig, aa as SubagentConfig, ai as SubagentSessionInput, ad as SubagentFnResult, a7 as SessionStartHook, a2 as SessionEndHook, E as PostToolUseHook, z as PostToolUseFailureHook, a4 as SessionExitReason, an as TokenUsage, f as RunAgentConfig, A as AgentResponse, F as FileEntryMetadata, aB as VirtualFileTree, k as TreeMutation, s as FileEntry, aC as VirtualFsOps, h as SkillMetadata, i as Skill, c as ToolHandlerResponse, as as ToolHandler, aE as WorkflowTask, d as ActivityToolHandler } from './types-CwN6_tAL.js';
|
|
2
2
|
import z$1, { z } from 'zod';
|
|
3
3
|
import './types-CJ7tCdl6.js';
|
|
4
4
|
import { Duration } from '@temporalio/common';
|
|
@@ -159,6 +159,37 @@ declare function getThreadListKey(threadKey: string, threadId: string): string;
|
|
|
159
159
|
* @param threadId - Thread id as provided to the thread manager.
|
|
160
160
|
*/
|
|
161
161
|
declare function getThreadMetaKey(threadKey: string, threadId: string): string;
|
|
162
|
+
/**
|
|
163
|
+
* Build the Redis key that stores a thread's persisted state slice
|
|
164
|
+
* (tasks + custom state) written by zeitlich's session loop on every
|
|
165
|
+
* exit path.
|
|
166
|
+
*
|
|
167
|
+
* Consumers can read this key with `redis.get(getThreadStateKey(key, id))`
|
|
168
|
+
* and `JSON.parse` the result into a {@link PersistedThreadState}.
|
|
169
|
+
*
|
|
170
|
+
* @param threadKey - Thread key (defaults to `"messages"` inside the
|
|
171
|
+
* thread manager, but downstream adapters may pass
|
|
172
|
+
* their own value).
|
|
173
|
+
* @param threadId - Thread id as provided to the thread manager.
|
|
174
|
+
*/
|
|
175
|
+
declare function getThreadStateKey(threadKey: string, threadId: string): string;
|
|
176
|
+
/**
|
|
177
|
+
* Build the Redis key that guards an idempotent append against a
|
|
178
|
+
* duplicate write of the message (or message batch) identified by
|
|
179
|
+
* `dedupId`. Zeitlich's thread manager writes one of these per
|
|
180
|
+
* single-message append (and one per batch for multi-message appends),
|
|
181
|
+
* keyed by the message id returned by the configured `idOf`.
|
|
182
|
+
*
|
|
183
|
+
* Note: the key layout intentionally does **not** include the
|
|
184
|
+
* `threadKey` prefix — the dedup namespace is shared across thread
|
|
185
|
+
* keys for a given `threadId`, mirroring the original internal
|
|
186
|
+
* implementation.
|
|
187
|
+
*
|
|
188
|
+
* @param threadId - Thread id as provided to the thread manager.
|
|
189
|
+
* @param dedupId - Joined message ids (single message id for the
|
|
190
|
+
* common single-append case).
|
|
191
|
+
*/
|
|
192
|
+
declare function getThreadDedupKey(threadId: string, dedupId: string): string;
|
|
162
193
|
|
|
163
194
|
/**
|
|
164
195
|
* Creates an agent state manager for tracking workflow state.
|
|
@@ -856,4 +887,4 @@ declare const createAskUserQuestionHandler: () => ActivityToolHandler<AskUserQue
|
|
|
856
887
|
}[];
|
|
857
888
|
}>;
|
|
858
889
|
|
|
859
|
-
export {
|
|
890
|
+
export { globTool as $, type AskUserQuestionArgs as A, type BashArgs as B, createTaskGetHandler as C, DEFAULT_SUBAGENT_WORKFLOW_RUN_TIMEOUT as D, createTaskListHandler as E, type FileEditArgs as F, type GlobArgs as G, createTaskUpdateHandler as H, createToolRouter as I, defineSubagent as J, defineSubagentWorkflow as K, defineTool as L, defineWorkflow as M, editTool as N, type ObservabilityHooks as O, filesWithMimeType as P, formatVirtualFileTree as Q, type ReadSkillArgs as R, type SessionEndedEvent as S, THREAD_TTL_SECONDS as T, getShortId as U, getThreadDedupKey as V, type WorkflowConfig as W, getThreadListKey as X, getThreadMetaKey as Y, type ZeitlichObservabilitySinks as Z, getThreadStateKey as _, type FileReadArgs as a, grepTool as a0, hasDirectory as a1, hasFileWithMimeType as a2, hasNoOtherToolCalls as a3, parseSkillFile as a4, proxyRunAgent as a5, proxyVirtualFsOps as a6, readFileTool as a7, taskCreateTool as a8, taskGetTool as a9, taskListTool as aa, taskUpdateTool as ab, writeFileTool as ac, type FileWriteArgs as b, type FileTreeAccessor as c, type GrepArgs as d, type SessionStartedEvent as e, type SubagentArgs as f, type TaskCreateArgs as g, type TaskGetArgs as h, type TaskListArgs as i, type TaskUpdateArgs as j, type ToolExecutedEvent as k, type TurnCompletedEvent as l, type WorkflowInput as m, type WorkflowSessionInput as n, applyVirtualTreeMutations as o, askUserQuestionTool as p, bashTool as q, composeHooks as r, createAgentStateManager as s, createAskUserQuestionHandler as t, createBashToolDescription as u, createObservabilityHooks as v, createReadSkillHandler as w, createReadSkillTool as x, createSession as y, createTaskCreateHandler as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { au as ToolMap, _ as SandboxInit, ah as SubagentSandboxShutdown, a1 as SessionConfig, aF as ZeitlichSession, $ as SandboxShutdown, am as ThreadInit, u as JsonSerializable, B as BaseAgentState, p as AgentStateManager, aH as ToolRouterOptions, ax as ToolRouter, R as RouterContext, J as JsonValue, az as ToolWithHandler, w as ParsedToolCallUnion, av as ToolNames, ac as SubagentDefinition, af as SubagentHooks, ag as SubagentSandboxConfig, aa as SubagentConfig, ai as SubagentSessionInput, ad as SubagentFnResult, a7 as SessionStartHook, a2 as SessionEndHook, E as PostToolUseHook, z as PostToolUseFailureHook, a4 as SessionExitReason, an as TokenUsage, f as RunAgentConfig, A as AgentResponse, F as FileEntryMetadata, aB as VirtualFileTree, k as TreeMutation, s as FileEntry, aC as VirtualFsOps, h as SkillMetadata, i as Skill, c as ToolHandlerResponse, as as ToolHandler, aE as WorkflowTask, d as ActivityToolHandler } from './types-CnuN9T6t.cjs';
|
|
2
2
|
import z$1, { z } from 'zod';
|
|
3
3
|
import './types-CJ7tCdl6.cjs';
|
|
4
4
|
import { Duration } from '@temporalio/common';
|
|
@@ -159,6 +159,37 @@ declare function getThreadListKey(threadKey: string, threadId: string): string;
|
|
|
159
159
|
* @param threadId - Thread id as provided to the thread manager.
|
|
160
160
|
*/
|
|
161
161
|
declare function getThreadMetaKey(threadKey: string, threadId: string): string;
|
|
162
|
+
/**
|
|
163
|
+
* Build the Redis key that stores a thread's persisted state slice
|
|
164
|
+
* (tasks + custom state) written by zeitlich's session loop on every
|
|
165
|
+
* exit path.
|
|
166
|
+
*
|
|
167
|
+
* Consumers can read this key with `redis.get(getThreadStateKey(key, id))`
|
|
168
|
+
* and `JSON.parse` the result into a {@link PersistedThreadState}.
|
|
169
|
+
*
|
|
170
|
+
* @param threadKey - Thread key (defaults to `"messages"` inside the
|
|
171
|
+
* thread manager, but downstream adapters may pass
|
|
172
|
+
* their own value).
|
|
173
|
+
* @param threadId - Thread id as provided to the thread manager.
|
|
174
|
+
*/
|
|
175
|
+
declare function getThreadStateKey(threadKey: string, threadId: string): string;
|
|
176
|
+
/**
|
|
177
|
+
* Build the Redis key that guards an idempotent append against a
|
|
178
|
+
* duplicate write of the message (or message batch) identified by
|
|
179
|
+
* `dedupId`. Zeitlich's thread manager writes one of these per
|
|
180
|
+
* single-message append (and one per batch for multi-message appends),
|
|
181
|
+
* keyed by the message id returned by the configured `idOf`.
|
|
182
|
+
*
|
|
183
|
+
* Note: the key layout intentionally does **not** include the
|
|
184
|
+
* `threadKey` prefix — the dedup namespace is shared across thread
|
|
185
|
+
* keys for a given `threadId`, mirroring the original internal
|
|
186
|
+
* implementation.
|
|
187
|
+
*
|
|
188
|
+
* @param threadId - Thread id as provided to the thread manager.
|
|
189
|
+
* @param dedupId - Joined message ids (single message id for the
|
|
190
|
+
* common single-append case).
|
|
191
|
+
*/
|
|
192
|
+
declare function getThreadDedupKey(threadId: string, dedupId: string): string;
|
|
162
193
|
|
|
163
194
|
/**
|
|
164
195
|
* Creates an agent state manager for tracking workflow state.
|
|
@@ -856,4 +887,4 @@ declare const createAskUserQuestionHandler: () => ActivityToolHandler<AskUserQue
|
|
|
856
887
|
}[];
|
|
857
888
|
}>;
|
|
858
889
|
|
|
859
|
-
export {
|
|
890
|
+
export { globTool as $, type AskUserQuestionArgs as A, type BashArgs as B, createTaskGetHandler as C, DEFAULT_SUBAGENT_WORKFLOW_RUN_TIMEOUT as D, createTaskListHandler as E, type FileEditArgs as F, type GlobArgs as G, createTaskUpdateHandler as H, createToolRouter as I, defineSubagent as J, defineSubagentWorkflow as K, defineTool as L, defineWorkflow as M, editTool as N, type ObservabilityHooks as O, filesWithMimeType as P, formatVirtualFileTree as Q, type ReadSkillArgs as R, type SessionEndedEvent as S, THREAD_TTL_SECONDS as T, getShortId as U, getThreadDedupKey as V, type WorkflowConfig as W, getThreadListKey as X, getThreadMetaKey as Y, type ZeitlichObservabilitySinks as Z, getThreadStateKey as _, type FileReadArgs as a, grepTool as a0, hasDirectory as a1, hasFileWithMimeType as a2, hasNoOtherToolCalls as a3, parseSkillFile as a4, proxyRunAgent as a5, proxyVirtualFsOps as a6, readFileTool as a7, taskCreateTool as a8, taskGetTool as a9, taskListTool as aa, taskUpdateTool as ab, writeFileTool as ac, type FileWriteArgs as b, type FileTreeAccessor as c, type GrepArgs as d, type SessionStartedEvent as e, type SubagentArgs as f, type TaskCreateArgs as g, type TaskGetArgs as h, type TaskListArgs as i, type TaskUpdateArgs as j, type ToolExecutedEvent as k, type TurnCompletedEvent as l, type WorkflowInput as m, type WorkflowSessionInput as n, applyVirtualTreeMutations as o, askUserQuestionTool as p, bashTool as q, composeHooks as r, createAgentStateManager as s, createAskUserQuestionHandler as t, createBashToolDescription as u, createObservabilityHooks as v, createReadSkillHandler as w, createReadSkillTool as x, createSession as y, createTaskCreateHandler as z };
|
package/dist/workflow.cjs
CHANGED
|
@@ -1034,7 +1034,9 @@ async function createSession(config) {
|
|
|
1034
1034
|
appendAgentMessage,
|
|
1035
1035
|
forkThread,
|
|
1036
1036
|
loadThreadState,
|
|
1037
|
-
saveThreadState
|
|
1037
|
+
saveThreadState,
|
|
1038
|
+
hydrateThread,
|
|
1039
|
+
flushThread
|
|
1038
1040
|
} = threadOps;
|
|
1039
1041
|
const plugins = [];
|
|
1040
1042
|
let destroySubagentSandboxes;
|
|
@@ -1094,10 +1096,7 @@ async function createSession(config) {
|
|
|
1094
1096
|
stateManager.run();
|
|
1095
1097
|
}
|
|
1096
1098
|
);
|
|
1097
|
-
const lifecycle = resolveSessionLifecycle(
|
|
1098
|
-
sandboxInit,
|
|
1099
|
-
sandboxShutdown
|
|
1100
|
-
);
|
|
1099
|
+
const lifecycle = resolveSessionLifecycle(sandboxInit, sandboxShutdown);
|
|
1101
1100
|
const sandboxMode = lifecycle.mode;
|
|
1102
1101
|
const resolvedShutdown = lifecycle.shutdown;
|
|
1103
1102
|
let sandboxId;
|
|
@@ -1172,20 +1171,6 @@ async function createSession(config) {
|
|
|
1172
1171
|
...baseSnapshot && { baseSnapshot }
|
|
1173
1172
|
});
|
|
1174
1173
|
}
|
|
1175
|
-
if (hooks.onSessionStart) {
|
|
1176
|
-
await hooks.onSessionStart({
|
|
1177
|
-
threadId,
|
|
1178
|
-
agentName,
|
|
1179
|
-
metadata
|
|
1180
|
-
});
|
|
1181
|
-
}
|
|
1182
|
-
workflow.log.info("session started", {
|
|
1183
|
-
agentName,
|
|
1184
|
-
threadId,
|
|
1185
|
-
threadMode,
|
|
1186
|
-
maxTurns,
|
|
1187
|
-
...sandboxId && { sandboxId }
|
|
1188
|
-
});
|
|
1189
1174
|
const sessionStartMs = Date.now();
|
|
1190
1175
|
const systemPrompt = stateManager.getSystemPrompt();
|
|
1191
1176
|
const rehydrateFromSlice = (slice) => {
|
|
@@ -1195,10 +1180,12 @@ async function createSession(config) {
|
|
|
1195
1180
|
});
|
|
1196
1181
|
};
|
|
1197
1182
|
if (threadMode === "fork" && sourceThreadId) {
|
|
1183
|
+
await hydrateThread(sourceThreadId, threadKey);
|
|
1198
1184
|
await forkThread(sourceThreadId, threadId, threadKey);
|
|
1199
1185
|
const forkedSlice = await loadThreadState(threadId, threadKey);
|
|
1200
1186
|
if (forkedSlice) rehydrateFromSlice(forkedSlice);
|
|
1201
1187
|
} else if (threadMode === "continue") {
|
|
1188
|
+
await hydrateThread(threadId, threadKey);
|
|
1202
1189
|
const continuedSlice = await loadThreadState(threadId, threadKey);
|
|
1203
1190
|
if (continuedSlice) rehydrateFromSlice(continuedSlice);
|
|
1204
1191
|
} else {
|
|
@@ -1258,6 +1245,20 @@ async function createSession(config) {
|
|
|
1258
1245
|
);
|
|
1259
1246
|
let exitReason = "completed";
|
|
1260
1247
|
let finalMessage = null;
|
|
1248
|
+
if (hooks.onSessionStart) {
|
|
1249
|
+
await hooks.onSessionStart({
|
|
1250
|
+
threadId,
|
|
1251
|
+
agentName,
|
|
1252
|
+
metadata
|
|
1253
|
+
});
|
|
1254
|
+
}
|
|
1255
|
+
workflow.log.info("session started", {
|
|
1256
|
+
agentName,
|
|
1257
|
+
threadId,
|
|
1258
|
+
threadMode,
|
|
1259
|
+
maxTurns,
|
|
1260
|
+
...sandboxId && { sandboxId }
|
|
1261
|
+
});
|
|
1261
1262
|
try {
|
|
1262
1263
|
let assistantId;
|
|
1263
1264
|
while (stateManager.isRunning() && !stateManager.isTerminal() && stateManager.getTurns() < maxTurns) {
|
|
@@ -1366,6 +1367,15 @@ async function createSession(config) {
|
|
|
1366
1367
|
error: persistError instanceof Error ? persistError.message : String(persistError)
|
|
1367
1368
|
});
|
|
1368
1369
|
}
|
|
1370
|
+
try {
|
|
1371
|
+
await flushThread(threadId, threadKey);
|
|
1372
|
+
} catch (flushError) {
|
|
1373
|
+
workflow.log.warn("failed to flush thread to cold tier", {
|
|
1374
|
+
agentName,
|
|
1375
|
+
threadId,
|
|
1376
|
+
error: flushError instanceof Error ? flushError.message : String(flushError)
|
|
1377
|
+
});
|
|
1378
|
+
}
|
|
1369
1379
|
await callSessionEnd(exitReason, stateManager.getTurns());
|
|
1370
1380
|
if (sandboxOwned && sandboxId && sandboxOps) {
|
|
1371
1381
|
switch (resolvedShutdown) {
|