zeitlich 0.2.42 → 0.2.44

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.
Files changed (58) hide show
  1. package/dist/{activities-CrN-ghLo.d.ts → activities-CPIB2v2C.d.ts} +4 -4
  2. package/dist/{activities-Coafq5zr.d.cts → activities-DnmNOnq4.d.cts} +4 -4
  3. package/dist/adapters/sandbox/daytona/index.d.cts +2 -2
  4. package/dist/adapters/sandbox/daytona/index.d.ts +2 -2
  5. package/dist/adapters/sandbox/daytona/workflow.d.cts +1 -1
  6. package/dist/adapters/sandbox/daytona/workflow.d.ts +1 -1
  7. package/dist/adapters/sandbox/e2b/index.d.cts +1 -1
  8. package/dist/adapters/sandbox/e2b/index.d.ts +1 -1
  9. package/dist/adapters/thread/anthropic/index.d.cts +4 -4
  10. package/dist/adapters/thread/anthropic/index.d.ts +4 -4
  11. package/dist/adapters/thread/anthropic/workflow.d.cts +4 -4
  12. package/dist/adapters/thread/anthropic/workflow.d.ts +4 -4
  13. package/dist/adapters/thread/google-genai/index.d.cts +4 -4
  14. package/dist/adapters/thread/google-genai/index.d.ts +4 -4
  15. package/dist/adapters/thread/google-genai/workflow.d.cts +4 -4
  16. package/dist/adapters/thread/google-genai/workflow.d.ts +4 -4
  17. package/dist/adapters/thread/langchain/index.cjs +11 -11
  18. package/dist/adapters/thread/langchain/index.cjs.map +1 -1
  19. package/dist/adapters/thread/langchain/index.d.cts +4 -4
  20. package/dist/adapters/thread/langchain/index.d.ts +4 -4
  21. package/dist/adapters/thread/langchain/index.js +8 -12
  22. package/dist/adapters/thread/langchain/index.js.map +1 -1
  23. package/dist/adapters/thread/langchain/workflow.d.cts +4 -4
  24. package/dist/adapters/thread/langchain/workflow.d.ts +4 -4
  25. package/dist/index.cjs +73 -50
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.d.cts +6 -6
  28. package/dist/index.d.ts +6 -6
  29. package/dist/index.js +73 -51
  30. package/dist/index.js.map +1 -1
  31. package/dist/{proxy-COqA95FW.d.ts → proxy-B7Xi1znZ.d.ts} +1 -1
  32. package/dist/{proxy-Bf7uI-Hw.d.cts → proxy-DTnc5rqT.d.cts} +1 -1
  33. package/dist/{thread-manager-Bi1XlbpJ.d.ts → thread-manager-BAv340mi.d.ts} +3 -3
  34. package/dist/{thread-manager-wRVVBFgj.d.cts → thread-manager-BWv6ZXI3.d.cts} +4 -4
  35. package/dist/{thread-manager-BsLO3Fgc.d.cts → thread-manager-BlX2TwRN.d.cts} +3 -3
  36. package/dist/{thread-manager-BhkOyQ1I.d.ts → thread-manager-D2xorI-J.d.ts} +4 -4
  37. package/dist/{types-CdALEF3z.d.cts → types-4Wmk-wRq.d.cts} +1 -1
  38. package/dist/{types-CjY93AWZ.d.cts → types-C90VoEpt.d.cts} +1 -1
  39. package/dist/{types-BkX4HLzi.d.ts → types-Clhqautb.d.ts} +1 -1
  40. package/dist/{types-ChAy_jSP.d.ts → types-DKsCdAtQ.d.ts} +1 -1
  41. package/dist/{types-C66-BVBr.d.cts → types-DRJt1TMi.d.cts} +1 -1
  42. package/dist/{types-gVa5XCWD.d.ts → types-DpFD8ofR.d.ts} +1 -1
  43. package/dist/{workflow-BwT5EybR.d.ts → workflow-D32TRMr-.d.ts} +2 -2
  44. package/dist/{workflow-DMmiaw6w.d.cts → workflow-XVt0ww8K.d.cts} +2 -2
  45. package/dist/workflow.cjs +65 -39
  46. package/dist/workflow.cjs.map +1 -1
  47. package/dist/workflow.d.cts +2 -2
  48. package/dist/workflow.d.ts +2 -2
  49. package/dist/workflow.js +65 -39
  50. package/dist/workflow.js.map +1 -1
  51. package/package.json +1 -1
  52. package/src/lib/.env +1 -0
  53. package/src/lib/session/session-edge-cases.integration.test.ts +16 -10
  54. package/src/lib/session/session.ts +54 -40
  55. package/src/lib/state/manager.integration.test.ts +27 -0
  56. package/src/lib/state/manager.ts +39 -1
  57. package/src/lib/subagent/workflow.ts +2 -2
  58. package/src/tools/bash/.env +1 -0
@@ -1,5 +1,5 @@
1
1
  import { proxyActivities, ActivityInterfaceFor } from '@temporalio/workflow';
2
- import { T as ThreadOps } from './types-ChAy_jSP.js';
2
+ import { T as ThreadOps } from './types-DKsCdAtQ.js';
3
3
 
4
4
  /**
5
5
  * Shared proxy helper for thread operations.
@@ -1,5 +1,5 @@
1
1
  import { proxyActivities, ActivityInterfaceFor } from '@temporalio/workflow';
2
- import { T as ThreadOps } from './types-CdALEF3z.cjs';
2
+ import { T as ThreadOps } from './types-4Wmk-wRq.cjs';
3
3
 
4
4
  /**
5
5
  * Shared proxy helper for thread operations.
@@ -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-ChAy_jSP.js';
4
- import { T as ThreadManagerHooks, P as ProviderThreadManager } from './types-BkX4HLzi.js';
3
+ import { J as JsonValue } from './types-DKsCdAtQ.js';
4
+ import { T as ThreadManagerHooks, P as ProviderThreadManager } from './types-Clhqautb.js';
5
5
 
6
6
  /** SDK-native content type for Anthropic human messages */
7
7
  type AnthropicContent = string | Anthropic.Messages.ContentBlockParam[];
@@ -39,4 +39,4 @@ interface AnthropicThreadManager extends ProviderThreadManager<StoredMessage, An
39
39
  */
40
40
  declare function createAnthropicThreadManager(config: AnthropicThreadManagerConfig): AnthropicThreadManager;
41
41
 
42
- 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 };
42
+ export { type AnthropicContent as A, type StoredMessage as S, type AnthropicThreadManagerHooks as a, type AnthropicThreadManager as b, createAnthropicThreadManager as c, type AnthropicThreadManagerConfig as d, type AnthropicInvocationPayload as e };
@@ -1,7 +1,7 @@
1
1
  import Redis from 'ioredis';
2
- import { J as JsonValue } from './types-CdALEF3z.cjs';
3
- import { MessageContent, StoredMessage, BaseMessage } from '@langchain/core/messages';
4
- import { T as ThreadManagerHooks, P as ProviderThreadManager } from './types-C66-BVBr.cjs';
2
+ import { J as JsonValue } from './types-4Wmk-wRq.cjs';
3
+ import { StoredMessage, BaseMessage, MessageContent } from '@langchain/core/messages';
4
+ import { T as ThreadManagerHooks, P as ProviderThreadManager } from './types-DRJt1TMi.cjs';
5
5
 
6
6
  /** SDK-native content type for LangChain human messages */
7
7
  type LangChainContent = string | MessageContent;
@@ -31,4 +31,4 @@ interface LangChainThreadManager extends ProviderThreadManager<StoredMessage, La
31
31
  */
32
32
  declare function createLangChainThreadManager(config: LangChainThreadManagerConfig): LangChainThreadManager;
33
33
 
34
- export { type LangChainContent as L, type LangChainThreadManagerHooks as a, type LangChainInvocationPayload as b, type LangChainThreadManager as c, type LangChainThreadManagerConfig as d, createLangChainThreadManager as e };
34
+ export { type LangChainContent as L, type LangChainThreadManagerHooks as a, type LangChainThreadManager as b, createLangChainThreadManager as c, type LangChainThreadManagerConfig as d, type LangChainInvocationPayload 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-CdALEF3z.cjs';
4
- import { T as ThreadManagerHooks, P as ProviderThreadManager } from './types-C66-BVBr.cjs';
3
+ import { J as JsonValue } from './types-4Wmk-wRq.cjs';
4
+ import { T as ThreadManagerHooks, P as ProviderThreadManager } from './types-DRJt1TMi.cjs';
5
5
 
6
6
  /** SDK-native content type for Anthropic human messages */
7
7
  type AnthropicContent = string | Anthropic.Messages.ContentBlockParam[];
@@ -39,4 +39,4 @@ interface AnthropicThreadManager extends ProviderThreadManager<StoredMessage, An
39
39
  */
40
40
  declare function createAnthropicThreadManager(config: AnthropicThreadManagerConfig): AnthropicThreadManager;
41
41
 
42
- 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 };
42
+ export { type AnthropicContent as A, type StoredMessage as S, type AnthropicThreadManagerHooks as a, type AnthropicThreadManager as b, createAnthropicThreadManager as c, type AnthropicThreadManagerConfig as d, type AnthropicInvocationPayload as e };
@@ -1,7 +1,7 @@
1
1
  import Redis from 'ioredis';
2
- import { J as JsonValue } from './types-ChAy_jSP.js';
3
- import { MessageContent, StoredMessage, BaseMessage } from '@langchain/core/messages';
4
- import { T as ThreadManagerHooks, P as ProviderThreadManager } from './types-BkX4HLzi.js';
2
+ import { J as JsonValue } from './types-DKsCdAtQ.js';
3
+ import { StoredMessage, BaseMessage, MessageContent } from '@langchain/core/messages';
4
+ import { T as ThreadManagerHooks, P as ProviderThreadManager } from './types-Clhqautb.js';
5
5
 
6
6
  /** SDK-native content type for LangChain human messages */
7
7
  type LangChainContent = string | MessageContent;
@@ -31,4 +31,4 @@ interface LangChainThreadManager extends ProviderThreadManager<StoredMessage, La
31
31
  */
32
32
  declare function createLangChainThreadManager(config: LangChainThreadManagerConfig): LangChainThreadManager;
33
33
 
34
- export { type LangChainContent as L, type LangChainThreadManagerHooks as a, type LangChainInvocationPayload as b, type LangChainThreadManager as c, type LangChainThreadManagerConfig as d, createLangChainThreadManager as e };
34
+ export { type LangChainContent as L, type LangChainThreadManagerHooks as a, type LangChainThreadManager as b, createLangChainThreadManager as c, type LangChainThreadManagerConfig as d, type LangChainInvocationPayload as e };
@@ -1774,4 +1774,4 @@ interface ZeitlichSession<M = unknown, HasSandbox extends boolean = boolean> {
1774
1774
  }): Promise<SessionResult<M, T, HasSandbox>>;
1775
1775
  }
1776
1776
 
1777
- 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 };
1777
+ export { type PostToolUseHook as $, type AgentResponse as A, type BaseAgentState as B, type ToolMap as C, type ToolNames as D, type RawToolCall as E, type FileEntryMetadata as F, type ParsedToolCall as G, type ParsedToolCallUnion as H, type ToolRouter as I, type JsonValue as J, type ToolRouterHooks as K, type ToolHandler as L, type ModelInvokerConfig as M, type ToolArgs as N, type ToolResult as O, type PersistedThreadState as P, type ToolCallResult as Q, type RouterContext as R, type ScopedPrefix as S, type ThreadOps as T, type ToolCallResultUnion as U, type VirtualFsContext as V, type InferToolResults as W, type PreToolUseHook as X, type PreToolUseHookContext as Y, type ZeitlichSession as Z, type PreToolUseHookResult as _, type ModelInvoker as a, type PostToolUseHookContext as a0, type PostToolUseFailureHook as a1, type PostToolUseFailureHookContext as a2, type PostToolUseFailureHookResult as a3, type ToolHooks as a4, type AppendToolResultFn as a5, type ProcessToolCallsContext as a6, type ProcessToolCallsResult as a7, type RewindSignal as a8, type Hooks as a9, type SubagentWorkflow as aA, type SubagentWorkflowInput as aB, type SubagentSessionInput as aC, type FileEntry as aD, type VirtualFileTree as aE, type VirtualFsOps as aF, type VirtualFsState as aG, type ToolRouterOptions as aH, type SessionStartHook as aa, type SessionStartHookContext as ab, type SessionEndHook as ac, type SessionEndHookContext as ad, type PreHumanMessageAppendHook as ae, type PreHumanMessageAppendHookContext as af, type PostHumanMessageAppendHook as ag, type PostHumanMessageAppendHookContext as ah, type TokenUsage as ai, type AgentStatus as aj, type AgentFile as ak, type AgentConfig as al, type SessionExitReason as am, type SerializableToolDefinition as an, type TaskStatus as ao, type WorkflowTask as ap, isTerminalStatus as aq, type RunAgentActivity as ar, type SubagentConfig as as, type SubagentChildWorkflowOptions as at, type SubagentDefinition as au, type SubagentFnResult as av, type SubagentHooks as aw, type SubagentHandlerResponse as ax, type SubagentSandboxConfig as ay, type SubagentContinuationCaps 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, VirtualFileSystem as m, type SessionResult as n, type SessionConfig as o, type SessionRequiredCaps as p, type ThreadInit as q, type SandboxInit as r, type SandboxShutdown as s, type SubagentSandboxShutdown as t, type AgentState as u, type AgentStateManager as v, type JsonSerializable as w, type JsonPrimitive as x, type ToolDefinition as y, type ToolWithHandler as z };
@@ -1,4 +1,4 @@
1
- import { c as SandboxFileSystem, F as FileStat, D as DirentEntry, b as Sandbox$1, a as SandboxCreateOptions } from './types-CJ7tCdl6.cjs';
1
+ import { c as SandboxFileSystem, F as FileStat, D as DirentEntry, a as SandboxCreateOptions, b as Sandbox$1 } from './types-CJ7tCdl6.cjs';
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-ChAy_jSP.js';
2
+ import { P as PersistedThreadState, J as JsonValue } from './types-DKsCdAtQ.js';
3
3
 
4
4
  interface ThreadManagerConfig<T> {
5
5
  redis: Redis;
@@ -1774,4 +1774,4 @@ interface ZeitlichSession<M = unknown, HasSandbox extends boolean = boolean> {
1774
1774
  }): Promise<SessionResult<M, T, HasSandbox>>;
1775
1775
  }
1776
1776
 
1777
- 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 };
1777
+ export { type PostToolUseHook as $, type AgentResponse as A, type BaseAgentState as B, type ToolMap as C, type ToolNames as D, type RawToolCall as E, type FileEntryMetadata as F, type ParsedToolCall as G, type ParsedToolCallUnion as H, type ToolRouter as I, type JsonValue as J, type ToolRouterHooks as K, type ToolHandler as L, type ModelInvokerConfig as M, type ToolArgs as N, type ToolResult as O, type PersistedThreadState as P, type ToolCallResult as Q, type RouterContext as R, type ScopedPrefix as S, type ThreadOps as T, type ToolCallResultUnion as U, type VirtualFsContext as V, type InferToolResults as W, type PreToolUseHook as X, type PreToolUseHookContext as Y, type ZeitlichSession as Z, type PreToolUseHookResult as _, type ModelInvoker as a, type PostToolUseHookContext as a0, type PostToolUseFailureHook as a1, type PostToolUseFailureHookContext as a2, type PostToolUseFailureHookResult as a3, type ToolHooks as a4, type AppendToolResultFn as a5, type ProcessToolCallsContext as a6, type ProcessToolCallsResult as a7, type RewindSignal as a8, type Hooks as a9, type SubagentWorkflow as aA, type SubagentWorkflowInput as aB, type SubagentSessionInput as aC, type FileEntry as aD, type VirtualFileTree as aE, type VirtualFsOps as aF, type VirtualFsState as aG, type ToolRouterOptions as aH, type SessionStartHook as aa, type SessionStartHookContext as ab, type SessionEndHook as ac, type SessionEndHookContext as ad, type PreHumanMessageAppendHook as ae, type PreHumanMessageAppendHookContext as af, type PostHumanMessageAppendHook as ag, type PostHumanMessageAppendHookContext as ah, type TokenUsage as ai, type AgentStatus as aj, type AgentFile as ak, type AgentConfig as al, type SessionExitReason as am, type SerializableToolDefinition as an, type TaskStatus as ao, type WorkflowTask as ap, isTerminalStatus as aq, type RunAgentActivity as ar, type SubagentConfig as as, type SubagentChildWorkflowOptions as at, type SubagentDefinition as au, type SubagentFnResult as av, type SubagentHooks as aw, type SubagentHandlerResponse as ax, type SubagentSandboxConfig as ay, type SubagentContinuationCaps 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, VirtualFileSystem as m, type SessionResult as n, type SessionConfig as o, type SessionRequiredCaps as p, type ThreadInit as q, type SandboxInit as r, type SandboxShutdown as s, type SubagentSandboxShutdown as t, type AgentState as u, type AgentStateManager as v, type JsonSerializable as w, type JsonPrimitive as x, type ToolDefinition as y, type ToolWithHandler as z };
@@ -1,5 +1,5 @@
1
1
  import Redis from 'ioredis';
2
- import { P as PersistedThreadState, J as JsonValue } from './types-CdALEF3z.cjs';
2
+ import { P as PersistedThreadState, J as JsonValue } from './types-4Wmk-wRq.cjs';
3
3
 
4
4
  interface ThreadManagerConfig<T> {
5
5
  redis: Redis;
@@ -1,4 +1,4 @@
1
- import { c as SandboxFileSystem, F as FileStat, D as DirentEntry, b as Sandbox$1, a as SandboxCreateOptions } from './types-CJ7tCdl6.js';
1
+ import { c as SandboxFileSystem, F as FileStat, D as DirentEntry, a as SandboxCreateOptions, b as Sandbox$1 } from './types-CJ7tCdl6.js';
2
2
  import { Sandbox } from '@daytonaio/sdk';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
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-ChAy_jSP.js';
1
+ import { C as ToolMap, r as SandboxInit, t as SubagentSandboxShutdown, o as SessionConfig, Z as ZeitlichSession, s as SandboxShutdown, q as ThreadInit, w as JsonSerializable, B as BaseAgentState, v as AgentStateManager, aH as ToolRouterOptions, I as ToolRouter, H as ParsedToolCallUnion, D as ToolNames, R as RouterContext, J as JsonValue, z as ToolWithHandler, au as SubagentDefinition, aw as SubagentHooks, ay as SubagentSandboxConfig, as as SubagentConfig, aC as SubagentSessionInput, av as SubagentFnResult, aa as SessionStartHook, ac as SessionEndHook, $ as PostToolUseHook, a1 as PostToolUseFailureHook, am as SessionExitReason, ai as TokenUsage, f as RunAgentConfig, A as AgentResponse, F as FileEntryMetadata, aE as VirtualFileTree, k as TreeMutation, aD as FileEntry, aF as VirtualFsOps, h as SkillMetadata, i as Skill, c as ToolHandlerResponse, L as ToolHandler, ap as WorkflowTask, d as ActivityToolHandler } from './types-DKsCdAtQ.js';
2
2
  import z$1, { z } from 'zod';
3
3
  import './types-CJ7tCdl6.js';
4
4
  import { Duration } from '@temporalio/common';
@@ -856,4 +856,4 @@ declare const createAskUserQuestionHandler: () => ActivityToolHandler<AskUserQue
856
856
  }[];
857
857
  }>;
858
858
 
859
- export { hasDirectory 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, getThreadListKey as V, type WorkflowConfig as W, getThreadMetaKey as X, globTool as Y, type ZeitlichObservabilitySinks as Z, grepTool as _, type FileReadArgs as a, hasFileWithMimeType as a0, hasNoOtherToolCalls as a1, parseSkillFile as a2, proxyRunAgent as a3, proxyVirtualFsOps as a4, readFileTool as a5, taskCreateTool as a6, taskGetTool as a7, taskListTool as a8, taskUpdateTool as a9, writeFileTool as aa, 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 };
859
+ export { createTaskGetHandler as $, hasDirectory as A, type BashArgs as B, proxyVirtualFsOps as C, DEFAULT_SUBAGENT_WORKFLOW_RUN_TIMEOUT as D, type SubagentArgs as E, type FileEditArgs as F, type GlobArgs as G, parseSkillFile as H, createReadSkillTool as I, createReadSkillHandler as J, globTool as K, grepTool as L, type GrepArgs as M, readFileTool as N, type ObservabilityHooks as O, writeFileTool as P, editTool as Q, type ReadSkillArgs as R, type SessionStartedEvent as S, THREAD_TTL_SECONDS as T, taskCreateTool as U, type TaskCreateArgs as V, type WorkflowConfig as W, createTaskCreateHandler as X, taskGetTool as Y, type ZeitlichObservabilitySinks as Z, type TaskGetArgs as _, type FileReadArgs as a, taskListTool as a0, type TaskListArgs as a1, createTaskListHandler as a2, taskUpdateTool as a3, type TaskUpdateArgs as a4, createTaskUpdateHandler as a5, bashTool as a6, createBashToolDescription as a7, askUserQuestionTool as a8, type AskUserQuestionArgs as a9, createAskUserQuestionHandler as aa, type FileWriteArgs as b, type FileTreeAccessor as c, createSession as d, defineWorkflow as e, type WorkflowInput as f, type WorkflowSessionInput as g, getShortId as h, getThreadListKey as i, getThreadMetaKey as j, createAgentStateManager as k, createToolRouter as l, hasNoOtherToolCalls as m, defineTool as n, defineSubagent as o, defineSubagentWorkflow as p, createObservabilityHooks as q, composeHooks as r, type SessionEndedEvent as s, type TurnCompletedEvent as t, type ToolExecutedEvent as u, proxyRunAgent as v, applyVirtualTreeMutations as w, formatVirtualFileTree as x, hasFileWithMimeType as y, filesWithMimeType as z };
@@ -1,4 +1,4 @@
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-CdALEF3z.cjs';
1
+ import { C as ToolMap, r as SandboxInit, t as SubagentSandboxShutdown, o as SessionConfig, Z as ZeitlichSession, s as SandboxShutdown, q as ThreadInit, w as JsonSerializable, B as BaseAgentState, v as AgentStateManager, aH as ToolRouterOptions, I as ToolRouter, H as ParsedToolCallUnion, D as ToolNames, R as RouterContext, J as JsonValue, z as ToolWithHandler, au as SubagentDefinition, aw as SubagentHooks, ay as SubagentSandboxConfig, as as SubagentConfig, aC as SubagentSessionInput, av as SubagentFnResult, aa as SessionStartHook, ac as SessionEndHook, $ as PostToolUseHook, a1 as PostToolUseFailureHook, am as SessionExitReason, ai as TokenUsage, f as RunAgentConfig, A as AgentResponse, F as FileEntryMetadata, aE as VirtualFileTree, k as TreeMutation, aD as FileEntry, aF as VirtualFsOps, h as SkillMetadata, i as Skill, c as ToolHandlerResponse, L as ToolHandler, ap as WorkflowTask, d as ActivityToolHandler } from './types-4Wmk-wRq.cjs';
2
2
  import z$1, { z } from 'zod';
3
3
  import './types-CJ7tCdl6.cjs';
4
4
  import { Duration } from '@temporalio/common';
@@ -856,4 +856,4 @@ declare const createAskUserQuestionHandler: () => ActivityToolHandler<AskUserQue
856
856
  }[];
857
857
  }>;
858
858
 
859
- export { hasDirectory 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, getThreadListKey as V, type WorkflowConfig as W, getThreadMetaKey as X, globTool as Y, type ZeitlichObservabilitySinks as Z, grepTool as _, type FileReadArgs as a, hasFileWithMimeType as a0, hasNoOtherToolCalls as a1, parseSkillFile as a2, proxyRunAgent as a3, proxyVirtualFsOps as a4, readFileTool as a5, taskCreateTool as a6, taskGetTool as a7, taskListTool as a8, taskUpdateTool as a9, writeFileTool as aa, 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 };
859
+ export { createTaskGetHandler as $, hasDirectory as A, type BashArgs as B, proxyVirtualFsOps as C, DEFAULT_SUBAGENT_WORKFLOW_RUN_TIMEOUT as D, type SubagentArgs as E, type FileEditArgs as F, type GlobArgs as G, parseSkillFile as H, createReadSkillTool as I, createReadSkillHandler as J, globTool as K, grepTool as L, type GrepArgs as M, readFileTool as N, type ObservabilityHooks as O, writeFileTool as P, editTool as Q, type ReadSkillArgs as R, type SessionStartedEvent as S, THREAD_TTL_SECONDS as T, taskCreateTool as U, type TaskCreateArgs as V, type WorkflowConfig as W, createTaskCreateHandler as X, taskGetTool as Y, type ZeitlichObservabilitySinks as Z, type TaskGetArgs as _, type FileReadArgs as a, taskListTool as a0, type TaskListArgs as a1, createTaskListHandler as a2, taskUpdateTool as a3, type TaskUpdateArgs as a4, createTaskUpdateHandler as a5, bashTool as a6, createBashToolDescription as a7, askUserQuestionTool as a8, type AskUserQuestionArgs as a9, createAskUserQuestionHandler as aa, type FileWriteArgs as b, type FileTreeAccessor as c, createSession as d, defineWorkflow as e, type WorkflowInput as f, type WorkflowSessionInput as g, getShortId as h, getThreadListKey as i, getThreadMetaKey as j, createAgentStateManager as k, createToolRouter as l, hasNoOtherToolCalls as m, defineTool as n, defineSubagent as o, defineSubagentWorkflow as p, createObservabilityHooks as q, composeHooks as r, type SessionEndedEvent as s, type TurnCompletedEvent as t, type ToolExecutedEvent as u, proxyRunAgent as v, applyVirtualTreeMutations as w, formatVirtualFileTree as x, hasFileWithMimeType as y, filesWithMimeType as z };
package/dist/workflow.cjs CHANGED
@@ -1172,42 +1172,6 @@ async function createSession(config) {
1172
1172
  ...baseSnapshot && { baseSnapshot }
1173
1173
  });
1174
1174
  }
1175
- if (virtualFsConfig) {
1176
- if (!virtualFsOps) {
1177
- throw workflow.ApplicationFailure.create({
1178
- message: "No virtualFsOps provided \u2014 cannot resolve file tree",
1179
- nonRetryable: true
1180
- });
1181
- }
1182
- const result = await virtualFsOps.resolveFileTree(virtualFsConfig.ctx);
1183
- const skillFiles = skills ? collectSkillFiles(skills) : void 0;
1184
- const fileTree = skillFiles ? [
1185
- ...result.fileTree,
1186
- ...Object.entries(skillFiles).map(([path, content]) => ({
1187
- id: `skill:${path}`,
1188
- path,
1189
- size: content.length,
1190
- mtime: (/* @__PURE__ */ new Date()).toISOString(),
1191
- metadata: {},
1192
- // Carry the content directly on the entry so any handler that
1193
- // constructs a VirtualFileSystem from `fileTree` can read it
1194
- // without needing to also wire up `inlineFiles` from state.
1195
- inlineContent: content
1196
- }))
1197
- ] : result.fileTree;
1198
- stateManager.mergeUpdate({
1199
- fileTree,
1200
- virtualFsCtx: virtualFsConfig.ctx,
1201
- // `inlineFiles` is still the source of truth at read time:
1202
- // VirtualFileSystem checks the inlineFiles map first and only
1203
- // falls through to entry.inlineContent. Embedding the content on
1204
- // the entry is the migration target so that handlers building a
1205
- // VirtualFileSystem from `fileTree` alone (without forwarding
1206
- // `inlineFiles` from state) can read skill resources. Until a
1207
- // follow-up drops `inlineFiles`, both fields are populated.
1208
- ...skillFiles && { inlineFiles: skillFiles }
1209
- });
1210
- }
1211
1175
  if (hooks.onSessionStart) {
1212
1176
  await hooks.onSessionStart({
1213
1177
  threadId,
@@ -1250,6 +1214,42 @@ async function createSession(config) {
1250
1214
  await initializeThread(threadId, threadKey);
1251
1215
  }
1252
1216
  }
1217
+ if (virtualFsConfig) {
1218
+ if (!virtualFsOps) {
1219
+ throw workflow.ApplicationFailure.create({
1220
+ message: "No virtualFsOps provided \u2014 cannot resolve file tree",
1221
+ nonRetryable: true
1222
+ });
1223
+ }
1224
+ const result = await virtualFsOps.resolveFileTree(virtualFsConfig.ctx);
1225
+ const skillFiles = skills ? collectSkillFiles(skills) : void 0;
1226
+ const fileTree = skillFiles ? [
1227
+ ...result.fileTree,
1228
+ ...Object.entries(skillFiles).map(([path, content]) => ({
1229
+ id: `skill:${path}`,
1230
+ path,
1231
+ size: content.length,
1232
+ mtime: (/* @__PURE__ */ new Date()).toISOString(),
1233
+ metadata: {},
1234
+ // Carry the content directly on the entry so any handler that
1235
+ // constructs a VirtualFileSystem from `fileTree` can read it
1236
+ // without needing to also wire up `inlineFiles` from state.
1237
+ inlineContent: content
1238
+ }))
1239
+ ] : result.fileTree;
1240
+ stateManager.mergeUpdate({
1241
+ fileTree,
1242
+ virtualFsCtx: virtualFsConfig.ctx,
1243
+ // `inlineFiles` is still the source of truth at read time:
1244
+ // VirtualFileSystem checks the inlineFiles map first and only
1245
+ // falls through to entry.inlineContent. Embedding the content on
1246
+ // the entry is the migration target so that handlers building a
1247
+ // VirtualFileSystem from `fileTree` alone (without forwarding
1248
+ // `inlineFiles` from state) can read skill resources. Until a
1249
+ // follow-up drops `inlineFiles`, both fields are populated.
1250
+ ...skillFiles && { inlineFiles: skillFiles }
1251
+ });
1252
+ }
1253
1253
  await appendHumanMessage(
1254
1254
  threadId,
1255
1255
  workflow.uuid4(),
@@ -1338,6 +1338,9 @@ async function createSession(config) {
1338
1338
  threadId,
1339
1339
  maxTurns
1340
1340
  });
1341
+ } else if (stateManager.getStatus() === "WAITING_FOR_INPUT") {
1342
+ exitReason = "waiting_for_input";
1343
+ workflow.log.info("session waiting for input", { agentName, threadId });
1341
1344
  }
1342
1345
  } catch (error) {
1343
1346
  exitReason = "failed";
@@ -1448,6 +1451,22 @@ function getThreadMetaKey(threadKey, threadId) {
1448
1451
  function isTerminalStatus(status) {
1449
1452
  return status === "COMPLETED" || status === "FAILED" || status === "CANCELLED";
1450
1453
  }
1454
+ var RESERVED_STATE_KEYS = [
1455
+ "status",
1456
+ "version",
1457
+ "turns",
1458
+ "tasks",
1459
+ "tools",
1460
+ "systemPrompt",
1461
+ "fileTree",
1462
+ "inlineFiles",
1463
+ "virtualFsCtx",
1464
+ "totalInputTokens",
1465
+ "totalOutputTokens",
1466
+ "totalReasonTokens",
1467
+ "cachedWriteTokens",
1468
+ "cachedReadTokens"
1469
+ ];
1451
1470
  function createAgentStateManager({
1452
1471
  initialState
1453
1472
  }) {
@@ -1601,9 +1620,16 @@ function createAgentStateManager({
1601
1620
  return deleted;
1602
1621
  },
1603
1622
  getPersistedSlice() {
1623
+ const source = customState;
1624
+ const custom2 = {};
1625
+ const reserved = new Set(RESERVED_STATE_KEYS);
1626
+ for (const [key, value] of Object.entries(source)) {
1627
+ if (reserved.has(key)) continue;
1628
+ custom2[key] = value;
1629
+ }
1604
1630
  return {
1605
1631
  tasks: Array.from(tasks.entries()),
1606
- custom: { ...customState }
1632
+ custom: custom2
1607
1633
  };
1608
1634
  },
1609
1635
  updateUsage(usage) {
@@ -1699,14 +1725,14 @@ function defineSubagentWorkflow(config, fn) {
1699
1725
  };
1700
1726
  const result = await fn(prompt, sessionInput, context ?? {});
1701
1727
  return {
1702
- ...result,
1703
1728
  ...capturedThreadId !== void 0 && { threadId: capturedThreadId },
1704
1729
  ...capturedSandboxId !== void 0 && { sandboxId: capturedSandboxId },
1705
1730
  ...capturedSnapshot !== void 0 && { snapshot: capturedSnapshot },
1706
1731
  ...capturedBaseSnapshot !== void 0 && {
1707
1732
  baseSnapshot: capturedBaseSnapshot
1708
1733
  },
1709
- ...capturedUsage !== void 0 && { usage: capturedUsage }
1734
+ ...capturedUsage !== void 0 && { usage: capturedUsage },
1735
+ ...result
1710
1736
  };
1711
1737
  };
1712
1738
  Object.defineProperty(workflow$1, "name", { value: config.name });