zeitlich 0.2.43 → 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 (56) 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 +68 -48
  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 +68 -49
  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 +60 -37
  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 +60 -37
  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.ts +46 -40
  54. package/src/lib/state/manager.integration.test.ts +27 -0
  55. package/src/lib/state/manager.ts +39 -1
  56. package/src/tools/bash/.env +1 -0
package/dist/index.d.cts CHANGED
@@ -1,12 +1,12 @@
1
- import { B as BashArgs, F as FileEditArgs, G as GlobArgs, a as FileReadArgs, b as FileWriteArgs } from './workflow-DMmiaw6w.cjs';
2
- export { A as AskUserQuestionArgs, D as DEFAULT_SUBAGENT_WORKFLOW_RUN_TIMEOUT, c as FileTreeAccessor, d as GrepArgs, O as ObservabilityHooks, R as ReadSkillArgs, S as SessionEndedEvent, e as SessionStartedEvent, f as SubagentArgs, T as THREAD_TTL_SECONDS, g as TaskCreateArgs, h as TaskGetArgs, i as TaskListArgs, j as TaskUpdateArgs, k as ToolExecutedEvent, l as TurnCompletedEvent, W as WorkflowConfig, m as WorkflowInput, n as WorkflowSessionInput, Z as ZeitlichObservabilitySinks, o as applyVirtualTreeMutations, p as askUserQuestionTool, q as bashTool, r as composeHooks, s as createAgentStateManager, t as createAskUserQuestionHandler, u as createBashToolDescription, v as createObservabilityHooks, w as createReadSkillHandler, x as createReadSkillTool, y as createSession, z as createTaskCreateHandler, C as createTaskGetHandler, E as createTaskListHandler, H as createTaskUpdateHandler, I as createToolRouter, J as defineSubagent, K as defineSubagentWorkflow, L as defineTool, M as defineWorkflow, N as editTool, P as filesWithMimeType, Q as formatVirtualFileTree, U as getShortId, V as getThreadListKey, X as getThreadMetaKey, Y as globTool, _ as grepTool, $ as hasDirectory, a0 as hasFileWithMimeType, a1 as hasNoOtherToolCalls, a2 as parseSkillFile, a3 as proxyRunAgent, a4 as proxyVirtualFsOps, a5 as readFileTool, a6 as taskCreateTool, a7 as taskGetTool, a8 as taskListTool, a9 as taskUpdateTool, aa as writeFileTool } from './workflow-DMmiaw6w.cjs';
3
- import { R as RouterContext, e as ToolResultConfig, d as ActivityToolHandler, J as JsonValue, c as ToolHandlerResponse, B as BaseAgentState, f as RunAgentConfig, g as SkillProvider, h as SkillMetadata, i as Skill, F as FileEntryMetadata, j as FileResolver, V as VirtualFsContext, k as TreeMutation, l as PrefixedVirtualFsOps } from './types-CdALEF3z.cjs';
4
- export { m as AgentConfig, n as AgentFile, A as AgentResponse, o as AgentState, p as AgentStateManager, q as AgentStatus, r as AppendToolResultFn, s as FileEntry, H as Hooks, I as InferToolResults, t as JsonPrimitive, u as JsonSerializable, a as ModelInvoker, M as ModelInvokerConfig, v as ParsedToolCall, w as ParsedToolCallUnion, P as PersistedThreadState, x as PostHumanMessageAppendHook, y as PostHumanMessageAppendHookContext, z as PostToolUseFailureHook, C as PostToolUseFailureHookContext, D as PostToolUseFailureHookResult, E as PostToolUseHook, G as PostToolUseHookContext, K as PreHumanMessageAppendHook, L as PreHumanMessageAppendHookContext, N as PreToolUseHook, O as PreToolUseHookContext, Q as PreToolUseHookResult, b as PrefixedThreadOps, U as ProcessToolCallsContext, W as ProcessToolCallsResult, X as RawToolCall, Y as RewindSignal, Z as RunAgentActivity, _ as SandboxInit, $ as SandboxShutdown, S as ScopedPrefix, a0 as SerializableToolDefinition, a1 as SessionConfig, a2 as SessionEndHook, a3 as SessionEndHookContext, a4 as SessionExitReason, a5 as SessionRequiredCaps, a6 as SessionResult, a7 as SessionStartHook, a8 as SessionStartHookContext, a9 as SubagentChildWorkflowOptions, aa as SubagentConfig, ab as SubagentContinuationCaps, ac as SubagentDefinition, ad as SubagentFnResult, ae as SubagentHandlerResponse, af as SubagentHooks, ag as SubagentSandboxConfig, ah as SubagentSandboxShutdown, ai as SubagentSessionInput, aj as SubagentWorkflow, ak as SubagentWorkflowInput, al as TaskStatus, am as ThreadInit, T as ThreadOps, an as TokenUsage, ao as ToolArgs, ap as ToolCallResult, aq as ToolCallResultUnion, ar as ToolDefinition, as as ToolHandler, at as ToolHooks, au as ToolMap, av as ToolNames, aw as ToolResult, ax as ToolRouter, ay as ToolRouterHooks, az as ToolWithHandler, aA as VirtualFileSystem, aB as VirtualFileTree, aC as VirtualFsOps, aD as VirtualFsState, aE as WorkflowTask, aF as ZeitlichSession, aG as isTerminalStatus } from './types-CdALEF3z.cjs';
1
+ import { B as BashArgs, F as FileEditArgs, G as GlobArgs, a as FileReadArgs, b as FileWriteArgs } from './workflow-XVt0ww8K.cjs';
2
+ export { a9 as AskUserQuestionArgs, D as DEFAULT_SUBAGENT_WORKFLOW_RUN_TIMEOUT, c as FileTreeAccessor, M as GrepArgs, O as ObservabilityHooks, R as ReadSkillArgs, s as SessionEndedEvent, S as SessionStartedEvent, E as SubagentArgs, T as THREAD_TTL_SECONDS, V as TaskCreateArgs, _ as TaskGetArgs, a1 as TaskListArgs, a4 as TaskUpdateArgs, u as ToolExecutedEvent, t as TurnCompletedEvent, W as WorkflowConfig, f as WorkflowInput, g as WorkflowSessionInput, Z as ZeitlichObservabilitySinks, w as applyVirtualTreeMutations, a8 as askUserQuestionTool, a6 as bashTool, r as composeHooks, k as createAgentStateManager, aa as createAskUserQuestionHandler, a7 as createBashToolDescription, q as createObservabilityHooks, J as createReadSkillHandler, I as createReadSkillTool, d as createSession, X as createTaskCreateHandler, $ as createTaskGetHandler, a2 as createTaskListHandler, a5 as createTaskUpdateHandler, l as createToolRouter, o as defineSubagent, p as defineSubagentWorkflow, n as defineTool, e as defineWorkflow, Q as editTool, z as filesWithMimeType, x as formatVirtualFileTree, h as getShortId, i as getThreadListKey, j as getThreadMetaKey, K as globTool, L as grepTool, A as hasDirectory, y as hasFileWithMimeType, m as hasNoOtherToolCalls, H as parseSkillFile, v as proxyRunAgent, C as proxyVirtualFsOps, N as readFileTool, U as taskCreateTool, Y as taskGetTool, a0 as taskListTool, a3 as taskUpdateTool, P as writeFileTool } from './workflow-XVt0ww8K.cjs';
3
+ import { R as RouterContext, e as ToolResultConfig, d as ActivityToolHandler, J as JsonValue, c as ToolHandlerResponse, B as BaseAgentState, f as RunAgentConfig, g as SkillProvider, h as SkillMetadata, i as Skill, F as FileEntryMetadata, j as FileResolver, V as VirtualFsContext, k as TreeMutation, l as PrefixedVirtualFsOps } from './types-4Wmk-wRq.cjs';
4
+ export { al as AgentConfig, ak as AgentFile, A as AgentResponse, u as AgentState, v as AgentStateManager, aj as AgentStatus, a5 as AppendToolResultFn, aD as FileEntry, a9 as Hooks, W as InferToolResults, x as JsonPrimitive, w as JsonSerializable, a as ModelInvoker, M as ModelInvokerConfig, G as ParsedToolCall, H as ParsedToolCallUnion, P as PersistedThreadState, ag as PostHumanMessageAppendHook, ah as PostHumanMessageAppendHookContext, a1 as PostToolUseFailureHook, a2 as PostToolUseFailureHookContext, a3 as PostToolUseFailureHookResult, $ as PostToolUseHook, a0 as PostToolUseHookContext, ae as PreHumanMessageAppendHook, af as PreHumanMessageAppendHookContext, X as PreToolUseHook, Y as PreToolUseHookContext, _ as PreToolUseHookResult, b as PrefixedThreadOps, a6 as ProcessToolCallsContext, a7 as ProcessToolCallsResult, E as RawToolCall, a8 as RewindSignal, ar as RunAgentActivity, r as SandboxInit, s as SandboxShutdown, S as ScopedPrefix, an as SerializableToolDefinition, o as SessionConfig, ac as SessionEndHook, ad as SessionEndHookContext, am as SessionExitReason, p as SessionRequiredCaps, n as SessionResult, aa as SessionStartHook, ab as SessionStartHookContext, at as SubagentChildWorkflowOptions, as as SubagentConfig, az as SubagentContinuationCaps, au as SubagentDefinition, av as SubagentFnResult, ax as SubagentHandlerResponse, aw as SubagentHooks, ay as SubagentSandboxConfig, t as SubagentSandboxShutdown, aC as SubagentSessionInput, aA as SubagentWorkflow, aB as SubagentWorkflowInput, ao as TaskStatus, q as ThreadInit, T as ThreadOps, ai as TokenUsage, N as ToolArgs, Q as ToolCallResult, U as ToolCallResultUnion, y as ToolDefinition, L as ToolHandler, a4 as ToolHooks, C as ToolMap, D as ToolNames, O as ToolResult, I as ToolRouter, K as ToolRouterHooks, z as ToolWithHandler, m as VirtualFileSystem, aE as VirtualFileTree, aF as VirtualFsOps, aG as VirtualFsState, ap as WorkflowTask, Z as ZeitlichSession, aq as isTerminalStatus } from './types-4Wmk-wRq.cjs';
5
5
  import { b as Sandbox, c as SandboxFileSystem, a as SandboxCreateOptions, h as SandboxCapability, d as SandboxProvider, g as SandboxSnapshot, P as PrefixedSandboxOps, F as FileStat, D as DirentEntry, E as ExecResult } from './types-CJ7tCdl6.cjs';
6
6
  export { i as ExecOptions, e as SandboxCapabilities, f as SandboxCreateResult, j as SandboxNotFoundError, k as SandboxNotSupportedError, S as SandboxOps } from './types-CJ7tCdl6.cjs';
7
7
  import { WorkflowClient } from '@temporalio/client';
8
- import { a as ThreadManagerConfig, B as BaseThreadManager } from './types-C66-BVBr.cjs';
9
- export { P as ProviderThreadManager } from './types-C66-BVBr.cjs';
8
+ import { a as ThreadManagerConfig, B as BaseThreadManager } from './types-DRJt1TMi.cjs';
9
+ export { P as ProviderThreadManager } from './types-DRJt1TMi.cjs';
10
10
  import 'zod';
11
11
  import '@temporalio/common';
12
12
  import '@temporalio/workflow';
package/dist/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
- import { B as BashArgs, F as FileEditArgs, G as GlobArgs, a as FileReadArgs, b as FileWriteArgs } from './workflow-BwT5EybR.js';
2
- export { A as AskUserQuestionArgs, D as DEFAULT_SUBAGENT_WORKFLOW_RUN_TIMEOUT, c as FileTreeAccessor, d as GrepArgs, O as ObservabilityHooks, R as ReadSkillArgs, S as SessionEndedEvent, e as SessionStartedEvent, f as SubagentArgs, T as THREAD_TTL_SECONDS, g as TaskCreateArgs, h as TaskGetArgs, i as TaskListArgs, j as TaskUpdateArgs, k as ToolExecutedEvent, l as TurnCompletedEvent, W as WorkflowConfig, m as WorkflowInput, n as WorkflowSessionInput, Z as ZeitlichObservabilitySinks, o as applyVirtualTreeMutations, p as askUserQuestionTool, q as bashTool, r as composeHooks, s as createAgentStateManager, t as createAskUserQuestionHandler, u as createBashToolDescription, v as createObservabilityHooks, w as createReadSkillHandler, x as createReadSkillTool, y as createSession, z as createTaskCreateHandler, C as createTaskGetHandler, E as createTaskListHandler, H as createTaskUpdateHandler, I as createToolRouter, J as defineSubagent, K as defineSubagentWorkflow, L as defineTool, M as defineWorkflow, N as editTool, P as filesWithMimeType, Q as formatVirtualFileTree, U as getShortId, V as getThreadListKey, X as getThreadMetaKey, Y as globTool, _ as grepTool, $ as hasDirectory, a0 as hasFileWithMimeType, a1 as hasNoOtherToolCalls, a2 as parseSkillFile, a3 as proxyRunAgent, a4 as proxyVirtualFsOps, a5 as readFileTool, a6 as taskCreateTool, a7 as taskGetTool, a8 as taskListTool, a9 as taskUpdateTool, aa as writeFileTool } from './workflow-BwT5EybR.js';
3
- import { R as RouterContext, e as ToolResultConfig, d as ActivityToolHandler, J as JsonValue, c as ToolHandlerResponse, B as BaseAgentState, f as RunAgentConfig, g as SkillProvider, h as SkillMetadata, i as Skill, F as FileEntryMetadata, j as FileResolver, V as VirtualFsContext, k as TreeMutation, l as PrefixedVirtualFsOps } from './types-ChAy_jSP.js';
4
- export { m as AgentConfig, n as AgentFile, A as AgentResponse, o as AgentState, p as AgentStateManager, q as AgentStatus, r as AppendToolResultFn, s as FileEntry, H as Hooks, I as InferToolResults, t as JsonPrimitive, u as JsonSerializable, a as ModelInvoker, M as ModelInvokerConfig, v as ParsedToolCall, w as ParsedToolCallUnion, P as PersistedThreadState, x as PostHumanMessageAppendHook, y as PostHumanMessageAppendHookContext, z as PostToolUseFailureHook, C as PostToolUseFailureHookContext, D as PostToolUseFailureHookResult, E as PostToolUseHook, G as PostToolUseHookContext, K as PreHumanMessageAppendHook, L as PreHumanMessageAppendHookContext, N as PreToolUseHook, O as PreToolUseHookContext, Q as PreToolUseHookResult, b as PrefixedThreadOps, U as ProcessToolCallsContext, W as ProcessToolCallsResult, X as RawToolCall, Y as RewindSignal, Z as RunAgentActivity, _ as SandboxInit, $ as SandboxShutdown, S as ScopedPrefix, a0 as SerializableToolDefinition, a1 as SessionConfig, a2 as SessionEndHook, a3 as SessionEndHookContext, a4 as SessionExitReason, a5 as SessionRequiredCaps, a6 as SessionResult, a7 as SessionStartHook, a8 as SessionStartHookContext, a9 as SubagentChildWorkflowOptions, aa as SubagentConfig, ab as SubagentContinuationCaps, ac as SubagentDefinition, ad as SubagentFnResult, ae as SubagentHandlerResponse, af as SubagentHooks, ag as SubagentSandboxConfig, ah as SubagentSandboxShutdown, ai as SubagentSessionInput, aj as SubagentWorkflow, ak as SubagentWorkflowInput, al as TaskStatus, am as ThreadInit, T as ThreadOps, an as TokenUsage, ao as ToolArgs, ap as ToolCallResult, aq as ToolCallResultUnion, ar as ToolDefinition, as as ToolHandler, at as ToolHooks, au as ToolMap, av as ToolNames, aw as ToolResult, ax as ToolRouter, ay as ToolRouterHooks, az as ToolWithHandler, aA as VirtualFileSystem, aB as VirtualFileTree, aC as VirtualFsOps, aD as VirtualFsState, aE as WorkflowTask, aF as ZeitlichSession, aG as isTerminalStatus } from './types-ChAy_jSP.js';
1
+ import { B as BashArgs, F as FileEditArgs, G as GlobArgs, a as FileReadArgs, b as FileWriteArgs } from './workflow-D32TRMr-.js';
2
+ export { a9 as AskUserQuestionArgs, D as DEFAULT_SUBAGENT_WORKFLOW_RUN_TIMEOUT, c as FileTreeAccessor, M as GrepArgs, O as ObservabilityHooks, R as ReadSkillArgs, s as SessionEndedEvent, S as SessionStartedEvent, E as SubagentArgs, T as THREAD_TTL_SECONDS, V as TaskCreateArgs, _ as TaskGetArgs, a1 as TaskListArgs, a4 as TaskUpdateArgs, u as ToolExecutedEvent, t as TurnCompletedEvent, W as WorkflowConfig, f as WorkflowInput, g as WorkflowSessionInput, Z as ZeitlichObservabilitySinks, w as applyVirtualTreeMutations, a8 as askUserQuestionTool, a6 as bashTool, r as composeHooks, k as createAgentStateManager, aa as createAskUserQuestionHandler, a7 as createBashToolDescription, q as createObservabilityHooks, J as createReadSkillHandler, I as createReadSkillTool, d as createSession, X as createTaskCreateHandler, $ as createTaskGetHandler, a2 as createTaskListHandler, a5 as createTaskUpdateHandler, l as createToolRouter, o as defineSubagent, p as defineSubagentWorkflow, n as defineTool, e as defineWorkflow, Q as editTool, z as filesWithMimeType, x as formatVirtualFileTree, h as getShortId, i as getThreadListKey, j as getThreadMetaKey, K as globTool, L as grepTool, A as hasDirectory, y as hasFileWithMimeType, m as hasNoOtherToolCalls, H as parseSkillFile, v as proxyRunAgent, C as proxyVirtualFsOps, N as readFileTool, U as taskCreateTool, Y as taskGetTool, a0 as taskListTool, a3 as taskUpdateTool, P as writeFileTool } from './workflow-D32TRMr-.js';
3
+ import { R as RouterContext, e as ToolResultConfig, d as ActivityToolHandler, J as JsonValue, c as ToolHandlerResponse, B as BaseAgentState, f as RunAgentConfig, g as SkillProvider, h as SkillMetadata, i as Skill, F as FileEntryMetadata, j as FileResolver, V as VirtualFsContext, k as TreeMutation, l as PrefixedVirtualFsOps } from './types-DKsCdAtQ.js';
4
+ export { al as AgentConfig, ak as AgentFile, A as AgentResponse, u as AgentState, v as AgentStateManager, aj as AgentStatus, a5 as AppendToolResultFn, aD as FileEntry, a9 as Hooks, W as InferToolResults, x as JsonPrimitive, w as JsonSerializable, a as ModelInvoker, M as ModelInvokerConfig, G as ParsedToolCall, H as ParsedToolCallUnion, P as PersistedThreadState, ag as PostHumanMessageAppendHook, ah as PostHumanMessageAppendHookContext, a1 as PostToolUseFailureHook, a2 as PostToolUseFailureHookContext, a3 as PostToolUseFailureHookResult, $ as PostToolUseHook, a0 as PostToolUseHookContext, ae as PreHumanMessageAppendHook, af as PreHumanMessageAppendHookContext, X as PreToolUseHook, Y as PreToolUseHookContext, _ as PreToolUseHookResult, b as PrefixedThreadOps, a6 as ProcessToolCallsContext, a7 as ProcessToolCallsResult, E as RawToolCall, a8 as RewindSignal, ar as RunAgentActivity, r as SandboxInit, s as SandboxShutdown, S as ScopedPrefix, an as SerializableToolDefinition, o as SessionConfig, ac as SessionEndHook, ad as SessionEndHookContext, am as SessionExitReason, p as SessionRequiredCaps, n as SessionResult, aa as SessionStartHook, ab as SessionStartHookContext, at as SubagentChildWorkflowOptions, as as SubagentConfig, az as SubagentContinuationCaps, au as SubagentDefinition, av as SubagentFnResult, ax as SubagentHandlerResponse, aw as SubagentHooks, ay as SubagentSandboxConfig, t as SubagentSandboxShutdown, aC as SubagentSessionInput, aA as SubagentWorkflow, aB as SubagentWorkflowInput, ao as TaskStatus, q as ThreadInit, T as ThreadOps, ai as TokenUsage, N as ToolArgs, Q as ToolCallResult, U as ToolCallResultUnion, y as ToolDefinition, L as ToolHandler, a4 as ToolHooks, C as ToolMap, D as ToolNames, O as ToolResult, I as ToolRouter, K as ToolRouterHooks, z as ToolWithHandler, m as VirtualFileSystem, aE as VirtualFileTree, aF as VirtualFsOps, aG as VirtualFsState, ap as WorkflowTask, Z as ZeitlichSession, aq as isTerminalStatus } from './types-DKsCdAtQ.js';
5
5
  import { b as Sandbox, c as SandboxFileSystem, a as SandboxCreateOptions, h as SandboxCapability, d as SandboxProvider, g as SandboxSnapshot, P as PrefixedSandboxOps, F as FileStat, D as DirentEntry, E as ExecResult } from './types-CJ7tCdl6.js';
6
6
  export { i as ExecOptions, e as SandboxCapabilities, f as SandboxCreateResult, j as SandboxNotFoundError, k as SandboxNotSupportedError, S as SandboxOps } from './types-CJ7tCdl6.js';
7
7
  import { WorkflowClient } from '@temporalio/client';
8
- import { a as ThreadManagerConfig, B as BaseThreadManager } from './types-BkX4HLzi.js';
9
- export { P as ProviderThreadManager } from './types-BkX4HLzi.js';
8
+ import { a as ThreadManagerConfig, B as BaseThreadManager } from './types-Clhqautb.js';
9
+ export { P as ProviderThreadManager } from './types-Clhqautb.js';
10
10
  import 'zod';
11
11
  import '@temporalio/common';
12
12
  import '@temporalio/workflow';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { defineSignal, CancellationScope, isCancellation, uuid4, setHandler, defineUpdate, ApplicationFailure, log, defineQuery, condition, proxySinks, workflowInfo, proxyActivities, getExternalWorkflowHandle, executeChild } from '@temporalio/workflow';
2
2
  import z14, { z } from 'zod';
3
- import { randomUUID, randomFillSync } from 'crypto';
3
+ import crypto from 'crypto';
4
4
  import { ApplicationFailure as ApplicationFailure$1 } from '@temporalio/common';
5
5
  import { join, resolve, posix } from 'path';
6
6
  import { Context } from '@temporalio/activity';
@@ -1170,42 +1170,6 @@ async function createSession(config) {
1170
1170
  ...baseSnapshot && { baseSnapshot }
1171
1171
  });
1172
1172
  }
1173
- if (virtualFsConfig) {
1174
- if (!virtualFsOps) {
1175
- throw ApplicationFailure.create({
1176
- message: "No virtualFsOps provided \u2014 cannot resolve file tree",
1177
- nonRetryable: true
1178
- });
1179
- }
1180
- const result = await virtualFsOps.resolveFileTree(virtualFsConfig.ctx);
1181
- const skillFiles = skills ? collectSkillFiles(skills) : void 0;
1182
- const fileTree = skillFiles ? [
1183
- ...result.fileTree,
1184
- ...Object.entries(skillFiles).map(([path, content]) => ({
1185
- id: `skill:${path}`,
1186
- path,
1187
- size: content.length,
1188
- mtime: (/* @__PURE__ */ new Date()).toISOString(),
1189
- metadata: {},
1190
- // Carry the content directly on the entry so any handler that
1191
- // constructs a VirtualFileSystem from `fileTree` can read it
1192
- // without needing to also wire up `inlineFiles` from state.
1193
- inlineContent: content
1194
- }))
1195
- ] : result.fileTree;
1196
- stateManager.mergeUpdate({
1197
- fileTree,
1198
- virtualFsCtx: virtualFsConfig.ctx,
1199
- // `inlineFiles` is still the source of truth at read time:
1200
- // VirtualFileSystem checks the inlineFiles map first and only
1201
- // falls through to entry.inlineContent. Embedding the content on
1202
- // the entry is the migration target so that handlers building a
1203
- // VirtualFileSystem from `fileTree` alone (without forwarding
1204
- // `inlineFiles` from state) can read skill resources. Until a
1205
- // follow-up drops `inlineFiles`, both fields are populated.
1206
- ...skillFiles && { inlineFiles: skillFiles }
1207
- });
1208
- }
1209
1173
  if (hooks.onSessionStart) {
1210
1174
  await hooks.onSessionStart({
1211
1175
  threadId,
@@ -1248,6 +1212,42 @@ async function createSession(config) {
1248
1212
  await initializeThread(threadId, threadKey);
1249
1213
  }
1250
1214
  }
1215
+ if (virtualFsConfig) {
1216
+ if (!virtualFsOps) {
1217
+ throw ApplicationFailure.create({
1218
+ message: "No virtualFsOps provided \u2014 cannot resolve file tree",
1219
+ nonRetryable: true
1220
+ });
1221
+ }
1222
+ const result = await virtualFsOps.resolveFileTree(virtualFsConfig.ctx);
1223
+ const skillFiles = skills ? collectSkillFiles(skills) : void 0;
1224
+ const fileTree = skillFiles ? [
1225
+ ...result.fileTree,
1226
+ ...Object.entries(skillFiles).map(([path, content]) => ({
1227
+ id: `skill:${path}`,
1228
+ path,
1229
+ size: content.length,
1230
+ mtime: (/* @__PURE__ */ new Date()).toISOString(),
1231
+ metadata: {},
1232
+ // Carry the content directly on the entry so any handler that
1233
+ // constructs a VirtualFileSystem from `fileTree` can read it
1234
+ // without needing to also wire up `inlineFiles` from state.
1235
+ inlineContent: content
1236
+ }))
1237
+ ] : result.fileTree;
1238
+ stateManager.mergeUpdate({
1239
+ fileTree,
1240
+ virtualFsCtx: virtualFsConfig.ctx,
1241
+ // `inlineFiles` is still the source of truth at read time:
1242
+ // VirtualFileSystem checks the inlineFiles map first and only
1243
+ // falls through to entry.inlineContent. Embedding the content on
1244
+ // the entry is the migration target so that handlers building a
1245
+ // VirtualFileSystem from `fileTree` alone (without forwarding
1246
+ // `inlineFiles` from state) can read skill resources. Until a
1247
+ // follow-up drops `inlineFiles`, both fields are populated.
1248
+ ...skillFiles && { inlineFiles: skillFiles }
1249
+ });
1250
+ }
1251
1251
  await appendHumanMessage(
1252
1252
  threadId,
1253
1253
  uuid4(),
@@ -1452,6 +1452,22 @@ function getThreadStateKey(threadKey, threadId) {
1452
1452
  function isTerminalStatus(status) {
1453
1453
  return status === "COMPLETED" || status === "FAILED" || status === "CANCELLED";
1454
1454
  }
1455
+ var RESERVED_STATE_KEYS = [
1456
+ "status",
1457
+ "version",
1458
+ "turns",
1459
+ "tasks",
1460
+ "tools",
1461
+ "systemPrompt",
1462
+ "fileTree",
1463
+ "inlineFiles",
1464
+ "virtualFsCtx",
1465
+ "totalInputTokens",
1466
+ "totalOutputTokens",
1467
+ "totalReasonTokens",
1468
+ "cachedWriteTokens",
1469
+ "cachedReadTokens"
1470
+ ];
1455
1471
  function createAgentStateManager({
1456
1472
  initialState
1457
1473
  }) {
@@ -1605,9 +1621,16 @@ function createAgentStateManager({
1605
1621
  return deleted;
1606
1622
  },
1607
1623
  getPersistedSlice() {
1624
+ const source = customState;
1625
+ const custom2 = {};
1626
+ const reserved = new Set(RESERVED_STATE_KEYS);
1627
+ for (const [key, value] of Object.entries(source)) {
1628
+ if (reserved.has(key)) continue;
1629
+ custom2[key] = value;
1630
+ }
1608
1631
  return {
1609
1632
  tasks: Array.from(tasks.entries()),
1610
- custom: { ...customState }
1633
+ custom: custom2
1611
1634
  };
1612
1635
  },
1613
1636
  updateUsage(usage) {
@@ -1630,7 +1653,7 @@ function createAgentStateManager({
1630
1653
  };
1631
1654
  }
1632
1655
 
1633
- // node_modules/uuid/dist/esm/stringify.js
1656
+ // ../2_monorepo/node_modules/.pnpm/uuid@10.0.0/node_modules/uuid/dist/esm-node/stringify.js
1634
1657
  var byteToHex = [];
1635
1658
  for (let i = 0; i < 256; ++i) {
1636
1659
  byteToHex.push((i + 256).toString(16).slice(1));
@@ -1642,30 +1665,26 @@ var rnds8Pool = new Uint8Array(256);
1642
1665
  var poolPtr = rnds8Pool.length;
1643
1666
  function rng() {
1644
1667
  if (poolPtr > rnds8Pool.length - 16) {
1645
- randomFillSync(rnds8Pool);
1668
+ crypto.randomFillSync(rnds8Pool);
1646
1669
  poolPtr = 0;
1647
1670
  }
1648
1671
  return rnds8Pool.slice(poolPtr, poolPtr += 16);
1649
1672
  }
1650
- var native_default = { randomUUID };
1673
+ var native_default = {
1674
+ randomUUID: crypto.randomUUID
1675
+ };
1651
1676
 
1652
- // node_modules/uuid/dist/esm/v4.js
1677
+ // ../2_monorepo/node_modules/.pnpm/uuid@10.0.0/node_modules/uuid/dist/esm-node/v4.js
1653
1678
  function v4(options, buf, offset) {
1654
1679
  if (native_default.randomUUID && !buf && !options) {
1655
1680
  return native_default.randomUUID();
1656
1681
  }
1657
1682
  options = options || {};
1658
- const rnds = options.random ?? options.rng?.() ?? rng();
1659
- if (rnds.length < 16) {
1660
- throw new Error("Random bytes length must be >= 16");
1661
- }
1683
+ const rnds = options.random || (options.rng || rng)();
1662
1684
  rnds[6] = rnds[6] & 15 | 64;
1663
1685
  rnds[8] = rnds[8] & 63 | 128;
1664
1686
  if (buf) {
1665
1687
  offset = offset || 0;
1666
- if (offset < 0 || offset + 16 > buf.length) {
1667
- throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
1668
- }
1669
1688
  for (let i = 0; i < 16; ++i) {
1670
1689
  buf[offset + i] = rnds[i];
1671
1690
  }