zeitlich 0.2.45 → 0.2.47

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 (109) hide show
  1. package/README.md +137 -11
  2. package/dist/{activities-Coafq5zr.d.cts → activities-CPwKoUlD.d.cts} +22 -2
  3. package/dist/{activities-CrN-ghLo.d.ts → activities-DlaBxNID.d.ts} +22 -2
  4. package/dist/adapters/thread/anthropic/index.cjs +276 -71
  5. package/dist/adapters/thread/anthropic/index.cjs.map +1 -1
  6. package/dist/adapters/thread/anthropic/index.d.cts +62 -8
  7. package/dist/adapters/thread/anthropic/index.d.ts +62 -8
  8. package/dist/adapters/thread/anthropic/index.js +275 -72
  9. package/dist/adapters/thread/anthropic/index.js.map +1 -1
  10. package/dist/adapters/thread/anthropic/workflow.cjs +38 -20
  11. package/dist/adapters/thread/anthropic/workflow.cjs.map +1 -1
  12. package/dist/adapters/thread/anthropic/workflow.d.cts +5 -4
  13. package/dist/adapters/thread/anthropic/workflow.d.ts +5 -4
  14. package/dist/adapters/thread/anthropic/workflow.js +38 -20
  15. package/dist/adapters/thread/anthropic/workflow.js.map +1 -1
  16. package/dist/adapters/thread/google-genai/index.cjs +171 -69
  17. package/dist/adapters/thread/google-genai/index.cjs.map +1 -1
  18. package/dist/adapters/thread/google-genai/index.d.cts +6 -4
  19. package/dist/adapters/thread/google-genai/index.d.ts +6 -4
  20. package/dist/adapters/thread/google-genai/index.js +171 -69
  21. package/dist/adapters/thread/google-genai/index.js.map +1 -1
  22. package/dist/adapters/thread/google-genai/workflow.cjs +38 -20
  23. package/dist/adapters/thread/google-genai/workflow.cjs.map +1 -1
  24. package/dist/adapters/thread/google-genai/workflow.d.cts +7 -4
  25. package/dist/adapters/thread/google-genai/workflow.d.ts +7 -4
  26. package/dist/adapters/thread/google-genai/workflow.js +38 -20
  27. package/dist/adapters/thread/google-genai/workflow.js.map +1 -1
  28. package/dist/adapters/thread/langchain/index.cjs +170 -66
  29. package/dist/adapters/thread/langchain/index.cjs.map +1 -1
  30. package/dist/adapters/thread/langchain/index.d.cts +19 -4
  31. package/dist/adapters/thread/langchain/index.d.ts +19 -4
  32. package/dist/adapters/thread/langchain/index.js +170 -66
  33. package/dist/adapters/thread/langchain/index.js.map +1 -1
  34. package/dist/adapters/thread/langchain/workflow.cjs +38 -20
  35. package/dist/adapters/thread/langchain/workflow.cjs.map +1 -1
  36. package/dist/adapters/thread/langchain/workflow.d.cts +5 -4
  37. package/dist/adapters/thread/langchain/workflow.d.ts +5 -4
  38. package/dist/adapters/thread/langchain/workflow.js +38 -20
  39. package/dist/adapters/thread/langchain/workflow.js.map +1 -1
  40. package/dist/cold-store-BDgJpwLI.d.ts +114 -0
  41. package/dist/cold-store-Z2wvK2cV.d.cts +114 -0
  42. package/dist/index.cjs +440 -67
  43. package/dist/index.cjs.map +1 -1
  44. package/dist/index.d.cts +150 -8
  45. package/dist/index.d.ts +150 -8
  46. package/dist/index.js +432 -68
  47. package/dist/index.js.map +1 -1
  48. package/dist/proxy-CDh3Rsa7.d.cts +40 -0
  49. package/dist/proxy-Du8ggERu.d.ts +40 -0
  50. package/dist/{thread-manager-wRVVBFgj.d.cts → thread-manager-BjoYYXgd.d.cts} +8 -2
  51. package/dist/{thread-manager-BsLO3Fgc.d.cts → thread-manager-D8zKNFZ9.d.cts} +8 -2
  52. package/dist/{thread-manager-Bi1XlbpJ.d.ts → thread-manager-DtHYws2F.d.ts} +8 -2
  53. package/dist/{thread-manager-BhkOyQ1I.d.ts → thread-manager-Dw96FKH1.d.ts} +8 -2
  54. package/dist/{types-C66-BVBr.d.cts → types-BMJrsHo0.d.cts} +17 -1
  55. package/dist/{types-BkX4HLzi.d.ts → types-CtdOquo3.d.ts} +17 -1
  56. package/dist/{types-CdALEF3z.d.cts → types-DNEl5uxQ.d.cts} +38 -0
  57. package/dist/{types-ChAy_jSP.d.ts → types-qQVZfhoT.d.ts} +38 -0
  58. package/dist/{workflow-DMmiaw6w.d.cts → workflow-BH9ImDGq.d.cts} +48 -2
  59. package/dist/{workflow-BwT5EybR.d.ts → workflow-Cdw3-RNB.d.ts} +48 -2
  60. package/dist/workflow.cjs +47 -4
  61. package/dist/workflow.cjs.map +1 -1
  62. package/dist/workflow.d.cts +2 -2
  63. package/dist/workflow.d.ts +2 -2
  64. package/dist/workflow.js +47 -5
  65. package/dist/workflow.js.map +1 -1
  66. package/package.json +14 -3
  67. package/src/adapters/thread/anthropic/activities.ts +82 -39
  68. package/src/adapters/thread/anthropic/index.ts +8 -0
  69. package/src/adapters/thread/anthropic/model-invoker.test.ts +110 -0
  70. package/src/adapters/thread/anthropic/model-invoker.ts +26 -5
  71. package/src/adapters/thread/anthropic/prompt-cache.test.ts +134 -0
  72. package/src/adapters/thread/anthropic/prompt-cache.ts +163 -0
  73. package/src/adapters/thread/anthropic/proxy.ts +1 -0
  74. package/src/adapters/thread/anthropic/thread-manager.ts +9 -1
  75. package/src/adapters/thread/google-genai/activities.ts +64 -40
  76. package/src/adapters/thread/google-genai/proxy.ts +1 -0
  77. package/src/adapters/thread/google-genai/thread-manager.ts +9 -1
  78. package/src/adapters/thread/langchain/activities.ts +63 -36
  79. package/src/adapters/thread/langchain/proxy.ts +1 -0
  80. package/src/adapters/thread/langchain/thread-manager.ts +9 -1
  81. package/src/index.ts +21 -2
  82. package/src/lib/session/session-edge-cases.integration.test.ts +12 -0
  83. package/src/lib/session/session.integration.test.ts +138 -0
  84. package/src/lib/session/session.ts +29 -0
  85. package/src/lib/session/types.ts +22 -0
  86. package/src/lib/subagent/define.ts +1 -0
  87. package/src/lib/subagent/handler.ts +11 -2
  88. package/src/lib/subagent/subagent.integration.test.ts +139 -0
  89. package/src/lib/subagent/types.ts +16 -0
  90. package/src/lib/thread/cold-store.test.ts +221 -0
  91. package/src/lib/thread/cold-store.ts +269 -0
  92. package/src/lib/thread/index.ts +32 -0
  93. package/src/lib/thread/keys.ts +20 -0
  94. package/src/lib/thread/manager.ts +16 -27
  95. package/src/lib/thread/proxy.ts +79 -27
  96. package/src/lib/thread/snapshot.test.ts +443 -0
  97. package/src/lib/thread/snapshot.ts +163 -0
  98. package/src/lib/thread/test-utils.ts +228 -0
  99. package/src/lib/thread/tiered.test.ts +281 -0
  100. package/src/lib/thread/tiered.ts +135 -0
  101. package/src/lib/thread/types.ts +16 -0
  102. package/src/tools/edit/handler.test.ts +177 -0
  103. package/src/tools/edit/handler.ts +249 -47
  104. package/src/tools/edit/tool.ts +40 -0
  105. package/src/tools/task-create/handler.ts +1 -1
  106. package/src/tools/task-update/handler.ts +1 -1
  107. package/src/workflow.ts +2 -2
  108. package/dist/proxy-Bf7uI-Hw.d.cts +0 -24
  109. package/dist/proxy-COqA95FW.d.ts +0 -24
package/dist/index.d.cts CHANGED
@@ -1,17 +1,20 @@
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, a as FileMultiEditArgs, G as GlobArgs, b as FileReadArgs, c as FileWriteArgs } from './workflow-BH9ImDGq.cjs';
2
+ export { A as AskUserQuestionArgs, D as DEFAULT_SUBAGENT_WORKFLOW_RUN_TIMEOUT, d as FileTreeAccessor, e as GrepArgs, O as ObservabilityHooks, R as ReadSkillArgs, S as SessionEndedEvent, f as SessionStartedEvent, g as SubagentArgs, T as THREAD_TTL_SECONDS, h as TaskCreateArgs, i as TaskGetArgs, j as TaskListArgs, k as TaskUpdateArgs, l as ToolExecutedEvent, m as TurnCompletedEvent, W as WorkflowConfig, n as WorkflowInput, o as WorkflowSessionInput, Z as ZeitlichObservabilitySinks, p as applyVirtualTreeMutations, q as askUserQuestionTool, r as bashTool, s as composeHooks, t as createAgentStateManager, u as createAskUserQuestionHandler, v as createBashToolDescription, w as createObservabilityHooks, x as createReadSkillHandler, y as createReadSkillTool, z as createSession, C as createTaskCreateHandler, E as createTaskGetHandler, H as createTaskListHandler, I as createTaskUpdateHandler, J as createToolRouter, K as defineSubagent, L as defineSubagentWorkflow, M as defineTool, N as defineWorkflow, P as editTool, Q as filesWithMimeType, U as formatVirtualFileTree, V as getShortId, X as getThreadDedupKey, Y as getThreadListKey, _ as getThreadMetaKey, $ as getThreadStateKey, a0 as globTool, a1 as grepTool, a2 as hasDirectory, a3 as hasFileWithMimeType, a4 as hasNoOtherToolCalls, a5 as multiEditTool, a6 as parseSkillFile, a7 as proxyRunAgent, a8 as proxyVirtualFsOps, a9 as readFileTool, aa as taskCreateTool, ab as taskGetTool, ac as taskListTool, ad as taskUpdateTool, ae as writeFileTool } from './workflow-BH9ImDGq.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-DNEl5uxQ.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-DNEl5uxQ.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-BMJrsHo0.cjs';
9
+ export { P as ProviderThreadManager } from './types-BMJrsHo0.cjs';
10
+ import { C as ColdThreadStore, T as ThreadSnapshot } from './cold-store-Z2wvK2cV.cjs';
11
+ export { S as S3ColdStoreConfig, a as S3LikeClient, c as createS3ColdStore } from './cold-store-Z2wvK2cV.cjs';
12
+ import Redis from 'ioredis';
10
13
  import 'zod';
11
14
  import '@temporalio/common';
12
15
  import '@temporalio/workflow';
13
16
  import '@temporalio/common/lib/interfaces';
14
- import 'ioredis';
17
+ import '@aws-sdk/client-s3';
15
18
 
16
19
  /**
17
20
  * Wraps a tool handler to automatically append its result directly to the
@@ -232,6 +235,134 @@ declare class FileSystemSkillProvider implements SkillProvider {
232
235
  */
233
236
  declare function createThreadManager<T>(config: ThreadManagerConfig<T>): BaseThreadManager<T>;
234
237
 
238
+ /**
239
+ * Tiered thread manager: Redis hot tier + pluggable cold tier.
240
+ *
241
+ * Wraps {@link createThreadManager} (Redis-only) and adds two
242
+ * session-boundary operations:
243
+ *
244
+ * - `hydrate()` — when the thread is cold (no meta key in Redis),
245
+ * restore the latest {@link ThreadSnapshot} from the cold store.
246
+ * Idempotent; no-op when the thread is already hot or when no
247
+ * snapshot exists.
248
+ * - `flush({ deleteHot })` — write the current Redis state out to the
249
+ * cold store as one snapshot, then (by default) `DEL` the hot-tier
250
+ * keys so idle threads don't sit in Redis memory.
251
+ *
252
+ * All other operations (`append`, `load`, `fork`, `replaceAll`,
253
+ * `truncateFromId`, state I/O) delegate unchanged to the underlying
254
+ * Redis manager, so adapters and tests that use the
255
+ * `BaseThreadManager<T>` interface keep working with zero changes.
256
+ */
257
+
258
+ /** Configuration for {@link createTieredThreadManager}. */
259
+ interface TieredThreadManagerConfig<T> extends ThreadManagerConfig<T> {
260
+ /**
261
+ * Cold-tier archive. When omitted, `hydrate()` and `flush()` are
262
+ * no-ops and the manager behaves identically to
263
+ * {@link createThreadManager}.
264
+ */
265
+ coldStore?: ColdThreadStore;
266
+ }
267
+ /** Options for {@link TieredThreadManager.flush}. */
268
+ interface FlushOptions {
269
+ /**
270
+ * Delete the hot-tier Redis keys after a successful cold-tier
271
+ * write. Defaults to `true` when a cold store is configured —
272
+ * Redis is just a cache and a future continue/fork will
273
+ * re-hydrate in a single round-trip.
274
+ *
275
+ * Set to `false` to keep the hot tier warm (useful for tests or
276
+ * for "hot-after-flush" use cases where another session is expected
277
+ * to pick the thread up immediately).
278
+ */
279
+ deleteHot?: boolean;
280
+ }
281
+ /**
282
+ * Extension of {@link BaseThreadManager} with the two cold-tier
283
+ * lifecycle methods.
284
+ */
285
+ interface TieredThreadManager<T> extends BaseThreadManager<T> {
286
+ /**
287
+ * Restore the latest cold-tier snapshot into Redis when the thread
288
+ * is cold. Idempotent — safe to call from a retried activity.
289
+ */
290
+ hydrate(): Promise<void>;
291
+ /**
292
+ * Write the current Redis state to the cold tier and (optionally)
293
+ * drop the hot-tier keys. Idempotent — last-writer-wins on the
294
+ * cold side.
295
+ */
296
+ flush(opts?: FlushOptions): Promise<void>;
297
+ }
298
+ /**
299
+ * Build a thread manager backed by Redis (hot) and an optional
300
+ * pluggable cold store. See module docstring for the lifecycle
301
+ * semantics.
302
+ */
303
+ declare function createTieredThreadManager<T>(config: TieredThreadManagerConfig<T>): TieredThreadManager<T>;
304
+
305
+ /**
306
+ * Pure Redis I/O helpers for moving a thread between the hot tier
307
+ * (Redis lists + meta + state + dedup markers) and the cold tier
308
+ * (a single {@link ThreadSnapshot} blob in a {@link ColdThreadStore}).
309
+ *
310
+ * These helpers know nothing about S3 or the adapter-specific message
311
+ * envelope — they operate on the raw Redis representation. The
312
+ * tiered thread manager in `tiered.ts` is the only consumer.
313
+ */
314
+
315
+ /** Inputs shared by every snapshot operation. */
316
+ interface SnapshotCommon {
317
+ redis: Redis;
318
+ threadKey: string;
319
+ threadId: string;
320
+ }
321
+ /** Configuration for {@link encodeSnapshot}. */
322
+ interface EncodeSnapshotConfig extends SnapshotCommon {
323
+ /**
324
+ * Extract a dedup id from each raw-serialized message currently in
325
+ * the thread's Redis list. When omitted, the resulting snapshot has
326
+ * an empty `dedupIds` array — idempotency guarantees are best-effort
327
+ * once a thread crosses the hot/cold boundary.
328
+ */
329
+ idOf?: (raw: string) => string;
330
+ }
331
+ /**
332
+ * Build a {@link ThreadSnapshot} from the current hot-tier state.
333
+ *
334
+ * Returns `null` when no thread exists in the hot tier (the meta key
335
+ * is absent) — callers should treat that as "nothing to flush".
336
+ */
337
+ declare function encodeSnapshot(config: EncodeSnapshotConfig): Promise<ThreadSnapshot | null>;
338
+ /** Configuration for {@link applySnapshot}. */
339
+ interface ApplySnapshotConfig extends SnapshotCommon {
340
+ snapshot: ThreadSnapshot;
341
+ /** TTL applied to every Redis key. Defaults to {@link THREAD_TTL_SECONDS}. */
342
+ ttlSeconds?: number;
343
+ }
344
+ /**
345
+ * Restore a {@link ThreadSnapshot} into the hot tier.
346
+ *
347
+ * Idempotent — if the meta key already exists the thread is already
348
+ * hot and this is a no-op. The meta key is written **last** so a
349
+ * crash mid-restore leaves the thread cold (`load` / `append` will
350
+ * see "thread does not exist") and the next session's hydrate retries
351
+ * cleanly.
352
+ */
353
+ declare function applySnapshot(config: ApplySnapshotConfig): Promise<void>;
354
+ /** Configuration for {@link clearHotTier}. */
355
+ interface ClearHotTierConfig extends SnapshotCommon {
356
+ /** Dedup ids to delete alongside the list / meta / state keys. */
357
+ dedupIds?: string[];
358
+ }
359
+ /**
360
+ * Delete every Redis key the thread manager wrote for `(threadKey,
361
+ * threadId)`. Used by the tiered manager's `flush({ deleteHot: true })`
362
+ * to drop hot-tier memory after a successful archive write.
363
+ */
364
+ declare function clearHotTier(config: ClearHotTierConfig): Promise<void>;
365
+
235
366
  /**
236
367
  * Result returned by {@link SandboxManagerHooks.onPreCreate}.
237
368
  *
@@ -516,6 +647,16 @@ interface EditResult {
516
647
  path: string;
517
648
  success: boolean;
518
649
  replacements: number;
650
+ hunks?: EditHunk[];
651
+ }
652
+ interface EditHunk {
653
+ editIndex: number;
654
+ oldStartLine: number;
655
+ oldEndLine: number;
656
+ newStartLine: number;
657
+ newEndLine: number;
658
+ oldLines: string[];
659
+ newLines: string[];
519
660
  }
520
661
  /**
521
662
  * Edit tool handler — performs string replacements in sandbox files.
@@ -524,6 +665,7 @@ interface EditResult {
524
665
  * sandbox automatically.
525
666
  */
526
667
  declare const editHandler: ActivityToolHandler<FileEditArgs, EditResult, SandboxContext>;
668
+ declare const multiEditHandler: ActivityToolHandler<FileMultiEditArgs, EditResult, SandboxContext>;
527
669
 
528
670
  interface GlobResult {
529
671
  files: string[];
@@ -594,4 +736,4 @@ declare const toTree: (fs: SandboxFileSystem, opts?: {
594
736
  sort?: boolean;
595
737
  }) => Promise<string>;
596
738
 
597
- export { ActivityToolHandler, type AgentStateContext, BaseAgentState, BaseThreadManager, BashArgs, ExecResult, FileEditArgs, FileEntryMetadata, FileReadArgs, FileResolver, FileSystemSkillProvider, FileWriteArgs, GlobArgs, JsonValue, NodeFsSandboxFileSystem, type PreCreateHookResult, PrefixedSandboxOps, PrefixedVirtualFsOps, RouterContext, RunAgentConfig, Sandbox, SandboxCapability, type SandboxContext, SandboxCreateOptions, DirentEntry as SandboxDirentEntry, FileStat as SandboxFileStat, SandboxFileSystem, SandboxManager, type SandboxManagerHooks, SandboxProvider, SandboxSnapshot, Skill, SkillMetadata, SkillProvider, ThreadManagerConfig, ToolHandlerResponse, ToolResultConfig, TreeMutation, VirtualFsContext, type WithSandboxOptions, bashHandler, createRunAgentActivity, createThreadManager, createVirtualFsActivities, editHandler, getActivityContext, globHandler, queryParentWorkflowState, readFileHandler, toTree, withAutoAppend, withParentWorkflowState, withSandbox, withVirtualFs, writeFileHandler };
739
+ export { ActivityToolHandler, type AgentStateContext, type ApplySnapshotConfig, BaseAgentState, BaseThreadManager, BashArgs, type ClearHotTierConfig, ColdThreadStore, type EncodeSnapshotConfig, ExecResult, FileEditArgs, FileEntryMetadata, FileMultiEditArgs, FileReadArgs, FileResolver, FileSystemSkillProvider, FileWriteArgs, type FlushOptions, GlobArgs, JsonValue, NodeFsSandboxFileSystem, type PreCreateHookResult, PrefixedSandboxOps, PrefixedVirtualFsOps, RouterContext, RunAgentConfig, Sandbox, SandboxCapability, type SandboxContext, SandboxCreateOptions, DirentEntry as SandboxDirentEntry, FileStat as SandboxFileStat, SandboxFileSystem, SandboxManager, type SandboxManagerHooks, SandboxProvider, SandboxSnapshot, Skill, SkillMetadata, SkillProvider, ThreadManagerConfig, ThreadSnapshot, type TieredThreadManager, type TieredThreadManagerConfig, ToolHandlerResponse, ToolResultConfig, TreeMutation, VirtualFsContext, type WithSandboxOptions, applySnapshot, bashHandler, clearHotTier, createRunAgentActivity, createThreadManager, createTieredThreadManager, createVirtualFsActivities, editHandler, encodeSnapshot, getActivityContext, globHandler, multiEditHandler, queryParentWorkflowState, readFileHandler, toTree, withAutoAppend, withParentWorkflowState, withSandbox, withVirtualFs, writeFileHandler };
package/dist/index.d.ts CHANGED
@@ -1,17 +1,20 @@
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, a as FileMultiEditArgs, G as GlobArgs, b as FileReadArgs, c as FileWriteArgs } from './workflow-Cdw3-RNB.js';
2
+ export { A as AskUserQuestionArgs, D as DEFAULT_SUBAGENT_WORKFLOW_RUN_TIMEOUT, d as FileTreeAccessor, e as GrepArgs, O as ObservabilityHooks, R as ReadSkillArgs, S as SessionEndedEvent, f as SessionStartedEvent, g as SubagentArgs, T as THREAD_TTL_SECONDS, h as TaskCreateArgs, i as TaskGetArgs, j as TaskListArgs, k as TaskUpdateArgs, l as ToolExecutedEvent, m as TurnCompletedEvent, W as WorkflowConfig, n as WorkflowInput, o as WorkflowSessionInput, Z as ZeitlichObservabilitySinks, p as applyVirtualTreeMutations, q as askUserQuestionTool, r as bashTool, s as composeHooks, t as createAgentStateManager, u as createAskUserQuestionHandler, v as createBashToolDescription, w as createObservabilityHooks, x as createReadSkillHandler, y as createReadSkillTool, z as createSession, C as createTaskCreateHandler, E as createTaskGetHandler, H as createTaskListHandler, I as createTaskUpdateHandler, J as createToolRouter, K as defineSubagent, L as defineSubagentWorkflow, M as defineTool, N as defineWorkflow, P as editTool, Q as filesWithMimeType, U as formatVirtualFileTree, V as getShortId, X as getThreadDedupKey, Y as getThreadListKey, _ as getThreadMetaKey, $ as getThreadStateKey, a0 as globTool, a1 as grepTool, a2 as hasDirectory, a3 as hasFileWithMimeType, a4 as hasNoOtherToolCalls, a5 as multiEditTool, a6 as parseSkillFile, a7 as proxyRunAgent, a8 as proxyVirtualFsOps, a9 as readFileTool, aa as taskCreateTool, ab as taskGetTool, ac as taskListTool, ad as taskUpdateTool, ae as writeFileTool } from './workflow-Cdw3-RNB.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-qQVZfhoT.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-qQVZfhoT.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-CtdOquo3.js';
9
+ export { P as ProviderThreadManager } from './types-CtdOquo3.js';
10
+ import { C as ColdThreadStore, T as ThreadSnapshot } from './cold-store-BDgJpwLI.js';
11
+ export { S as S3ColdStoreConfig, a as S3LikeClient, c as createS3ColdStore } from './cold-store-BDgJpwLI.js';
12
+ import Redis from 'ioredis';
10
13
  import 'zod';
11
14
  import '@temporalio/common';
12
15
  import '@temporalio/workflow';
13
16
  import '@temporalio/common/lib/interfaces';
14
- import 'ioredis';
17
+ import '@aws-sdk/client-s3';
15
18
 
16
19
  /**
17
20
  * Wraps a tool handler to automatically append its result directly to the
@@ -232,6 +235,134 @@ declare class FileSystemSkillProvider implements SkillProvider {
232
235
  */
233
236
  declare function createThreadManager<T>(config: ThreadManagerConfig<T>): BaseThreadManager<T>;
234
237
 
238
+ /**
239
+ * Tiered thread manager: Redis hot tier + pluggable cold tier.
240
+ *
241
+ * Wraps {@link createThreadManager} (Redis-only) and adds two
242
+ * session-boundary operations:
243
+ *
244
+ * - `hydrate()` — when the thread is cold (no meta key in Redis),
245
+ * restore the latest {@link ThreadSnapshot} from the cold store.
246
+ * Idempotent; no-op when the thread is already hot or when no
247
+ * snapshot exists.
248
+ * - `flush({ deleteHot })` — write the current Redis state out to the
249
+ * cold store as one snapshot, then (by default) `DEL` the hot-tier
250
+ * keys so idle threads don't sit in Redis memory.
251
+ *
252
+ * All other operations (`append`, `load`, `fork`, `replaceAll`,
253
+ * `truncateFromId`, state I/O) delegate unchanged to the underlying
254
+ * Redis manager, so adapters and tests that use the
255
+ * `BaseThreadManager<T>` interface keep working with zero changes.
256
+ */
257
+
258
+ /** Configuration for {@link createTieredThreadManager}. */
259
+ interface TieredThreadManagerConfig<T> extends ThreadManagerConfig<T> {
260
+ /**
261
+ * Cold-tier archive. When omitted, `hydrate()` and `flush()` are
262
+ * no-ops and the manager behaves identically to
263
+ * {@link createThreadManager}.
264
+ */
265
+ coldStore?: ColdThreadStore;
266
+ }
267
+ /** Options for {@link TieredThreadManager.flush}. */
268
+ interface FlushOptions {
269
+ /**
270
+ * Delete the hot-tier Redis keys after a successful cold-tier
271
+ * write. Defaults to `true` when a cold store is configured —
272
+ * Redis is just a cache and a future continue/fork will
273
+ * re-hydrate in a single round-trip.
274
+ *
275
+ * Set to `false` to keep the hot tier warm (useful for tests or
276
+ * for "hot-after-flush" use cases where another session is expected
277
+ * to pick the thread up immediately).
278
+ */
279
+ deleteHot?: boolean;
280
+ }
281
+ /**
282
+ * Extension of {@link BaseThreadManager} with the two cold-tier
283
+ * lifecycle methods.
284
+ */
285
+ interface TieredThreadManager<T> extends BaseThreadManager<T> {
286
+ /**
287
+ * Restore the latest cold-tier snapshot into Redis when the thread
288
+ * is cold. Idempotent — safe to call from a retried activity.
289
+ */
290
+ hydrate(): Promise<void>;
291
+ /**
292
+ * Write the current Redis state to the cold tier and (optionally)
293
+ * drop the hot-tier keys. Idempotent — last-writer-wins on the
294
+ * cold side.
295
+ */
296
+ flush(opts?: FlushOptions): Promise<void>;
297
+ }
298
+ /**
299
+ * Build a thread manager backed by Redis (hot) and an optional
300
+ * pluggable cold store. See module docstring for the lifecycle
301
+ * semantics.
302
+ */
303
+ declare function createTieredThreadManager<T>(config: TieredThreadManagerConfig<T>): TieredThreadManager<T>;
304
+
305
+ /**
306
+ * Pure Redis I/O helpers for moving a thread between the hot tier
307
+ * (Redis lists + meta + state + dedup markers) and the cold tier
308
+ * (a single {@link ThreadSnapshot} blob in a {@link ColdThreadStore}).
309
+ *
310
+ * These helpers know nothing about S3 or the adapter-specific message
311
+ * envelope — they operate on the raw Redis representation. The
312
+ * tiered thread manager in `tiered.ts` is the only consumer.
313
+ */
314
+
315
+ /** Inputs shared by every snapshot operation. */
316
+ interface SnapshotCommon {
317
+ redis: Redis;
318
+ threadKey: string;
319
+ threadId: string;
320
+ }
321
+ /** Configuration for {@link encodeSnapshot}. */
322
+ interface EncodeSnapshotConfig extends SnapshotCommon {
323
+ /**
324
+ * Extract a dedup id from each raw-serialized message currently in
325
+ * the thread's Redis list. When omitted, the resulting snapshot has
326
+ * an empty `dedupIds` array — idempotency guarantees are best-effort
327
+ * once a thread crosses the hot/cold boundary.
328
+ */
329
+ idOf?: (raw: string) => string;
330
+ }
331
+ /**
332
+ * Build a {@link ThreadSnapshot} from the current hot-tier state.
333
+ *
334
+ * Returns `null` when no thread exists in the hot tier (the meta key
335
+ * is absent) — callers should treat that as "nothing to flush".
336
+ */
337
+ declare function encodeSnapshot(config: EncodeSnapshotConfig): Promise<ThreadSnapshot | null>;
338
+ /** Configuration for {@link applySnapshot}. */
339
+ interface ApplySnapshotConfig extends SnapshotCommon {
340
+ snapshot: ThreadSnapshot;
341
+ /** TTL applied to every Redis key. Defaults to {@link THREAD_TTL_SECONDS}. */
342
+ ttlSeconds?: number;
343
+ }
344
+ /**
345
+ * Restore a {@link ThreadSnapshot} into the hot tier.
346
+ *
347
+ * Idempotent — if the meta key already exists the thread is already
348
+ * hot and this is a no-op. The meta key is written **last** so a
349
+ * crash mid-restore leaves the thread cold (`load` / `append` will
350
+ * see "thread does not exist") and the next session's hydrate retries
351
+ * cleanly.
352
+ */
353
+ declare function applySnapshot(config: ApplySnapshotConfig): Promise<void>;
354
+ /** Configuration for {@link clearHotTier}. */
355
+ interface ClearHotTierConfig extends SnapshotCommon {
356
+ /** Dedup ids to delete alongside the list / meta / state keys. */
357
+ dedupIds?: string[];
358
+ }
359
+ /**
360
+ * Delete every Redis key the thread manager wrote for `(threadKey,
361
+ * threadId)`. Used by the tiered manager's `flush({ deleteHot: true })`
362
+ * to drop hot-tier memory after a successful archive write.
363
+ */
364
+ declare function clearHotTier(config: ClearHotTierConfig): Promise<void>;
365
+
235
366
  /**
236
367
  * Result returned by {@link SandboxManagerHooks.onPreCreate}.
237
368
  *
@@ -516,6 +647,16 @@ interface EditResult {
516
647
  path: string;
517
648
  success: boolean;
518
649
  replacements: number;
650
+ hunks?: EditHunk[];
651
+ }
652
+ interface EditHunk {
653
+ editIndex: number;
654
+ oldStartLine: number;
655
+ oldEndLine: number;
656
+ newStartLine: number;
657
+ newEndLine: number;
658
+ oldLines: string[];
659
+ newLines: string[];
519
660
  }
520
661
  /**
521
662
  * Edit tool handler — performs string replacements in sandbox files.
@@ -524,6 +665,7 @@ interface EditResult {
524
665
  * sandbox automatically.
525
666
  */
526
667
  declare const editHandler: ActivityToolHandler<FileEditArgs, EditResult, SandboxContext>;
668
+ declare const multiEditHandler: ActivityToolHandler<FileMultiEditArgs, EditResult, SandboxContext>;
527
669
 
528
670
  interface GlobResult {
529
671
  files: string[];
@@ -594,4 +736,4 @@ declare const toTree: (fs: SandboxFileSystem, opts?: {
594
736
  sort?: boolean;
595
737
  }) => Promise<string>;
596
738
 
597
- export { ActivityToolHandler, type AgentStateContext, BaseAgentState, BaseThreadManager, BashArgs, ExecResult, FileEditArgs, FileEntryMetadata, FileReadArgs, FileResolver, FileSystemSkillProvider, FileWriteArgs, GlobArgs, JsonValue, NodeFsSandboxFileSystem, type PreCreateHookResult, PrefixedSandboxOps, PrefixedVirtualFsOps, RouterContext, RunAgentConfig, Sandbox, SandboxCapability, type SandboxContext, SandboxCreateOptions, DirentEntry as SandboxDirentEntry, FileStat as SandboxFileStat, SandboxFileSystem, SandboxManager, type SandboxManagerHooks, SandboxProvider, SandboxSnapshot, Skill, SkillMetadata, SkillProvider, ThreadManagerConfig, ToolHandlerResponse, ToolResultConfig, TreeMutation, VirtualFsContext, type WithSandboxOptions, bashHandler, createRunAgentActivity, createThreadManager, createVirtualFsActivities, editHandler, getActivityContext, globHandler, queryParentWorkflowState, readFileHandler, toTree, withAutoAppend, withParentWorkflowState, withSandbox, withVirtualFs, writeFileHandler };
739
+ export { ActivityToolHandler, type AgentStateContext, type ApplySnapshotConfig, BaseAgentState, BaseThreadManager, BashArgs, type ClearHotTierConfig, ColdThreadStore, type EncodeSnapshotConfig, ExecResult, FileEditArgs, FileEntryMetadata, FileMultiEditArgs, FileReadArgs, FileResolver, FileSystemSkillProvider, FileWriteArgs, type FlushOptions, GlobArgs, JsonValue, NodeFsSandboxFileSystem, type PreCreateHookResult, PrefixedSandboxOps, PrefixedVirtualFsOps, RouterContext, RunAgentConfig, Sandbox, SandboxCapability, type SandboxContext, SandboxCreateOptions, DirentEntry as SandboxDirentEntry, FileStat as SandboxFileStat, SandboxFileSystem, SandboxManager, type SandboxManagerHooks, SandboxProvider, SandboxSnapshot, Skill, SkillMetadata, SkillProvider, ThreadManagerConfig, ThreadSnapshot, type TieredThreadManager, type TieredThreadManagerConfig, ToolHandlerResponse, ToolResultConfig, TreeMutation, VirtualFsContext, type WithSandboxOptions, applySnapshot, bashHandler, clearHotTier, createRunAgentActivity, createThreadManager, createTieredThreadManager, createVirtualFsActivities, editHandler, encodeSnapshot, getActivityContext, globHandler, multiEditHandler, queryParentWorkflowState, readFileHandler, toTree, withAutoAppend, withParentWorkflowState, withSandbox, withVirtualFs, writeFileHandler };