zeitlich 0.2.48 → 0.2.49

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 (46) hide show
  1. package/dist/{activities-BlQR5gX4.d.cts → activities-7OcT_vdR.d.cts} +3 -3
  2. package/dist/{activities-DCaIPQBT.d.ts → activities-zG_FBoY2.d.ts} +3 -3
  3. package/dist/adapters/thread/anthropic/index.d.cts +5 -5
  4. package/dist/adapters/thread/anthropic/index.d.ts +5 -5
  5. package/dist/adapters/thread/anthropic/workflow.d.cts +5 -5
  6. package/dist/adapters/thread/anthropic/workflow.d.ts +5 -5
  7. package/dist/adapters/thread/google-genai/index.d.cts +5 -5
  8. package/dist/adapters/thread/google-genai/index.d.ts +5 -5
  9. package/dist/adapters/thread/google-genai/workflow.d.cts +6 -6
  10. package/dist/adapters/thread/google-genai/workflow.d.ts +6 -6
  11. package/dist/adapters/thread/langchain/index.d.cts +5 -5
  12. package/dist/adapters/thread/langchain/index.d.ts +5 -5
  13. package/dist/adapters/thread/langchain/workflow.d.cts +5 -5
  14. package/dist/adapters/thread/langchain/workflow.d.ts +5 -5
  15. package/dist/{cold-store-UL13Sstw.d.cts → cold-store-CkWoNtMh.d.cts} +1 -1
  16. package/dist/{cold-store-aD4TSKlU.d.ts → cold-store-DKMAO1Dd.d.ts} +1 -1
  17. package/dist/index.cjs +33 -5
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.cts +8 -8
  20. package/dist/index.d.ts +8 -8
  21. package/dist/index.js +33 -5
  22. package/dist/index.js.map +1 -1
  23. package/dist/{proxy-BAty3CWM.d.cts → proxy-B7CWEV-T.d.cts} +1 -1
  24. package/dist/{proxy-mbnwBhHw.d.ts → proxy-ByFHMVRX.d.ts} +1 -1
  25. package/dist/{thread-manager-DtEtbUkp.d.ts → thread-manager-7AW4rhfu.d.ts} +2 -2
  26. package/dist/{thread-manager-R6c3lnJy.d.cts → thread-manager-B9rtMEVn.d.cts} +2 -2
  27. package/dist/{thread-manager-DsXvJ5cJ.d.cts → thread-manager-Cibe0X5m.d.cts} +2 -2
  28. package/dist/{thread-manager-CICj68PI.d.ts → thread-manager-nK-WcFzM.d.ts} +2 -2
  29. package/dist/{types-DDLPnxBh.d.cts → types-BR-k7h0e.d.cts} +1 -1
  30. package/dist/{types-DF4wzWQG.d.ts → types-DO4Tkwxo.d.ts} +1 -1
  31. package/dist/{types-DwBYd0ij.d.ts → types-DeVNWqlb.d.ts} +23 -0
  32. package/dist/{types-DWeyCTYK.d.cts → types-XUUFvrJ9.d.cts} +23 -0
  33. package/dist/{workflow-DVNPR7eX.d.cts → workflow-KbGsxpfh.d.cts} +1 -1
  34. package/dist/{workflow-DdaU7_j4.d.ts → workflow-uhOIj9D-.d.ts} +1 -1
  35. package/dist/workflow.cjs +33 -5
  36. package/dist/workflow.cjs.map +1 -1
  37. package/dist/workflow.d.cts +2 -2
  38. package/dist/workflow.d.ts +2 -2
  39. package/dist/workflow.js +33 -5
  40. package/dist/workflow.js.map +1 -1
  41. package/package.json +1 -1
  42. package/src/lib/session/session.ts +11 -0
  43. package/src/lib/subagent/handler.ts +23 -0
  44. package/src/lib/subagent/subagent.integration.test.ts +198 -0
  45. package/src/lib/tool-router/router.ts +11 -3
  46. package/src/lib/tool-router/types.ts +23 -0
@@ -1,8 +1,8 @@
1
1
  import Redis from 'ioredis';
2
2
  import { Part, Content, GoogleGenAI } from '@google/genai';
3
- import { a as ModelInvoker, b as PrefixedThreadOps, S as ScopedPrefix, R as RouterContext, c as ToolHandlerResponse, d as ActivityToolHandler } from './types-DWeyCTYK.cjs';
4
- import { C as ColdThreadStore } from './cold-store-UL13Sstw.cjs';
5
- import { T as ThreadManagerHooks, P as ProviderThreadManager } from './types-DDLPnxBh.cjs';
3
+ import { a as ModelInvoker, b as PrefixedThreadOps, S as ScopedPrefix, R as RouterContext, c as ToolHandlerResponse, d as ActivityToolHandler } from './types-XUUFvrJ9.cjs';
4
+ import { C as ColdThreadStore } from './cold-store-CkWoNtMh.cjs';
5
+ import { T as ThreadManagerHooks, P as ProviderThreadManager } from './types-BR-k7h0e.cjs';
6
6
  import { A as ADAPTER_ID } from './adapter-id-BB-mmrts.cjs';
7
7
 
8
8
  /** SDK-native content type for Google GenAI human messages */
@@ -1,8 +1,8 @@
1
1
  import Redis from 'ioredis';
2
2
  import { Part, Content, GoogleGenAI } from '@google/genai';
3
- import { a as ModelInvoker, b as PrefixedThreadOps, S as ScopedPrefix, R as RouterContext, c as ToolHandlerResponse, d as ActivityToolHandler } from './types-DwBYd0ij.js';
4
- import { C as ColdThreadStore } from './cold-store-aD4TSKlU.js';
5
- import { T as ThreadManagerHooks, P as ProviderThreadManager } from './types-DF4wzWQG.js';
3
+ import { a as ModelInvoker, b as PrefixedThreadOps, S as ScopedPrefix, R as RouterContext, c as ToolHandlerResponse, d as ActivityToolHandler } from './types-DeVNWqlb.js';
4
+ import { C as ColdThreadStore } from './cold-store-DKMAO1Dd.js';
5
+ import { T as ThreadManagerHooks, P as ProviderThreadManager } from './types-DO4Tkwxo.js';
6
6
  import { A as ADAPTER_ID } from './adapter-id-BB-mmrts.js';
7
7
 
8
8
  /** SDK-native content type for Google GenAI human messages */
@@ -2,17 +2,17 @@ import { A as ADAPTER_ID } from '../../../adapter-id-CMwVrVqv.cjs';
2
2
  export { a as AdapterId } from '../../../adapter-id-CMwVrVqv.cjs';
3
3
  import Redis from 'ioredis';
4
4
  import Anthropic from '@anthropic-ai/sdk';
5
- import { a as ModelInvoker, b as PrefixedThreadOps, S as ScopedPrefix, R as RouterContext, c as ToolHandlerResponse, d as ActivityToolHandler, M as ModelInvokerConfig, A as AgentResponse } from '../../../types-DWeyCTYK.cjs';
6
- import { C as ColdThreadStore } from '../../../cold-store-UL13Sstw.cjs';
7
- import { A as AnthropicContent, a as AnthropicThreadManagerHooks } from '../../../thread-manager-R6c3lnJy.cjs';
8
- export { b as AnthropicInvocationPayload, c as AnthropicThreadManager, d as AnthropicThreadManagerConfig, S as StoredMessage, e as createAnthropicThreadManager } from '../../../thread-manager-R6c3lnJy.cjs';
5
+ import { a as ModelInvoker, b as PrefixedThreadOps, S as ScopedPrefix, R as RouterContext, c as ToolHandlerResponse, d as ActivityToolHandler, M as ModelInvokerConfig, A as AgentResponse } from '../../../types-XUUFvrJ9.cjs';
6
+ import { C as ColdThreadStore } from '../../../cold-store-CkWoNtMh.cjs';
7
+ import { A as AnthropicContent, a as AnthropicThreadManagerHooks } from '../../../thread-manager-B9rtMEVn.cjs';
8
+ export { b as AnthropicInvocationPayload, c as AnthropicThreadManager, d as AnthropicThreadManagerConfig, S as StoredMessage, e as createAnthropicThreadManager } from '../../../thread-manager-B9rtMEVn.cjs';
9
9
  import '@temporalio/workflow';
10
10
  import '@temporalio/common/lib/interfaces';
11
11
  import 'zod';
12
12
  import '../../../types-CJ7tCdl6.cjs';
13
13
  import '@temporalio/common';
14
14
  import '@aws-sdk/client-s3';
15
- import '../../../types-DDLPnxBh.cjs';
15
+ import '../../../types-BR-k7h0e.cjs';
16
16
 
17
17
  interface AnthropicPromptCacheOptions {
18
18
  /** TTL for the cache checkpoint. Defaults to 5m. */
@@ -2,17 +2,17 @@ import { A as ADAPTER_ID } from '../../../adapter-id-CMwVrVqv.js';
2
2
  export { a as AdapterId } from '../../../adapter-id-CMwVrVqv.js';
3
3
  import Redis from 'ioredis';
4
4
  import Anthropic from '@anthropic-ai/sdk';
5
- import { a as ModelInvoker, b as PrefixedThreadOps, S as ScopedPrefix, R as RouterContext, c as ToolHandlerResponse, d as ActivityToolHandler, M as ModelInvokerConfig, A as AgentResponse } from '../../../types-DwBYd0ij.js';
6
- import { C as ColdThreadStore } from '../../../cold-store-aD4TSKlU.js';
7
- import { A as AnthropicContent, a as AnthropicThreadManagerHooks } from '../../../thread-manager-DtEtbUkp.js';
8
- export { b as AnthropicInvocationPayload, c as AnthropicThreadManager, d as AnthropicThreadManagerConfig, S as StoredMessage, e as createAnthropicThreadManager } from '../../../thread-manager-DtEtbUkp.js';
5
+ import { a as ModelInvoker, b as PrefixedThreadOps, S as ScopedPrefix, R as RouterContext, c as ToolHandlerResponse, d as ActivityToolHandler, M as ModelInvokerConfig, A as AgentResponse } from '../../../types-DeVNWqlb.js';
6
+ import { C as ColdThreadStore } from '../../../cold-store-DKMAO1Dd.js';
7
+ import { A as AnthropicContent, a as AnthropicThreadManagerHooks } from '../../../thread-manager-7AW4rhfu.js';
8
+ export { b as AnthropicInvocationPayload, c as AnthropicThreadManager, d as AnthropicThreadManagerConfig, S as StoredMessage, e as createAnthropicThreadManager } from '../../../thread-manager-7AW4rhfu.js';
9
9
  import '@temporalio/workflow';
10
10
  import '@temporalio/common/lib/interfaces';
11
11
  import 'zod';
12
12
  import '../../../types-CJ7tCdl6.js';
13
13
  import '@temporalio/common';
14
14
  import '@aws-sdk/client-s3';
15
- import '../../../types-DF4wzWQG.js';
15
+ import '../../../types-DO4Tkwxo.js';
16
16
 
17
17
  interface AnthropicPromptCacheOptions {
18
18
  /** TTL for the cache checkpoint. Defaults to 5m. */
@@ -1,8 +1,8 @@
1
1
  import { ActivityInterfaceFor } from '@temporalio/workflow';
2
- import { T as ThreadOps } from '../../../types-DWeyCTYK.cjs';
3
- import { A as AnthropicContent } from '../../../thread-manager-R6c3lnJy.cjs';
4
- import { c as createThreadOpsProxy } from '../../../proxy-BAty3CWM.cjs';
5
- export { T as ThreadOpsProxyOptions } from '../../../proxy-BAty3CWM.cjs';
2
+ import { T as ThreadOps } from '../../../types-XUUFvrJ9.cjs';
3
+ import { A as AnthropicContent } from '../../../thread-manager-B9rtMEVn.cjs';
4
+ import { c as createThreadOpsProxy } from '../../../proxy-B7CWEV-T.cjs';
5
+ export { T as ThreadOpsProxyOptions } from '../../../proxy-B7CWEV-T.cjs';
6
6
  export { A as ADAPTER_ID, a as AdapterId } from '../../../adapter-id-CMwVrVqv.cjs';
7
7
  import '@temporalio/common/lib/interfaces';
8
8
  import 'zod';
@@ -10,7 +10,7 @@ import '../../../types-CJ7tCdl6.cjs';
10
10
  import '@temporalio/common';
11
11
  import 'ioredis';
12
12
  import '@anthropic-ai/sdk';
13
- import '../../../types-DDLPnxBh.cjs';
13
+ import '../../../types-BR-k7h0e.cjs';
14
14
 
15
15
  /**
16
16
  * Workflow-safe proxy for Anthropic thread operations.
@@ -1,8 +1,8 @@
1
1
  import { ActivityInterfaceFor } from '@temporalio/workflow';
2
- import { T as ThreadOps } from '../../../types-DwBYd0ij.js';
3
- import { A as AnthropicContent } from '../../../thread-manager-DtEtbUkp.js';
4
- import { c as createThreadOpsProxy } from '../../../proxy-mbnwBhHw.js';
5
- export { T as ThreadOpsProxyOptions } from '../../../proxy-mbnwBhHw.js';
2
+ import { T as ThreadOps } from '../../../types-DeVNWqlb.js';
3
+ import { A as AnthropicContent } from '../../../thread-manager-7AW4rhfu.js';
4
+ import { c as createThreadOpsProxy } from '../../../proxy-ByFHMVRX.js';
5
+ export { T as ThreadOpsProxyOptions } from '../../../proxy-ByFHMVRX.js';
6
6
  export { A as ADAPTER_ID, a as AdapterId } from '../../../adapter-id-CMwVrVqv.js';
7
7
  import '@temporalio/common/lib/interfaces';
8
8
  import 'zod';
@@ -10,7 +10,7 @@ import '../../../types-CJ7tCdl6.js';
10
10
  import '@temporalio/common';
11
11
  import 'ioredis';
12
12
  import '@anthropic-ai/sdk';
13
- import '../../../types-DF4wzWQG.js';
13
+ import '../../../types-DO4Tkwxo.js';
14
14
 
15
15
  /**
16
16
  * Workflow-safe proxy for Anthropic thread operations.
@@ -1,12 +1,12 @@
1
1
  export { A as ADAPTER_ID, a as AdapterId } from '../../../adapter-id-BB-mmrts.cjs';
2
- import { G as GoogleGenAIThreadManagerHooks } from '../../../activities-BlQR5gX4.cjs';
3
- export { a as GoogleGenAIAdapter, b as GoogleGenAIAdapterConfig, c as GoogleGenAIContent, d as GoogleGenAIInvocationPayload, e as GoogleGenAIThreadManager, f as GoogleGenAIThreadManagerConfig, g as GoogleGenAIThreadOps, h as GoogleGenAIToolResponse, S as StoredContent, i as createGoogleGenAIAdapter, j as createGoogleGenAIThreadManager } from '../../../activities-BlQR5gX4.cjs';
2
+ import { G as GoogleGenAIThreadManagerHooks } from '../../../activities-7OcT_vdR.cjs';
3
+ export { a as GoogleGenAIAdapter, b as GoogleGenAIAdapterConfig, c as GoogleGenAIContent, d as GoogleGenAIInvocationPayload, e as GoogleGenAIThreadManager, f as GoogleGenAIThreadManagerConfig, g as GoogleGenAIThreadOps, h as GoogleGenAIToolResponse, S as StoredContent, i as createGoogleGenAIAdapter, j as createGoogleGenAIThreadManager } from '../../../activities-7OcT_vdR.cjs';
4
4
  import Redis from 'ioredis';
5
5
  import { GoogleGenAI, Content } from '@google/genai';
6
- import { M as ModelInvokerConfig, A as AgentResponse } from '../../../types-DWeyCTYK.cjs';
7
- import '../../../cold-store-UL13Sstw.cjs';
6
+ import { M as ModelInvokerConfig, A as AgentResponse } from '../../../types-XUUFvrJ9.cjs';
7
+ import '../../../cold-store-CkWoNtMh.cjs';
8
8
  import '@aws-sdk/client-s3';
9
- import '../../../types-DDLPnxBh.cjs';
9
+ import '../../../types-BR-k7h0e.cjs';
10
10
  import '@temporalio/workflow';
11
11
  import '@temporalio/common/lib/interfaces';
12
12
  import 'zod';
@@ -1,12 +1,12 @@
1
1
  export { A as ADAPTER_ID, a as AdapterId } from '../../../adapter-id-BB-mmrts.js';
2
- import { G as GoogleGenAIThreadManagerHooks } from '../../../activities-DCaIPQBT.js';
3
- export { a as GoogleGenAIAdapter, b as GoogleGenAIAdapterConfig, c as GoogleGenAIContent, d as GoogleGenAIInvocationPayload, e as GoogleGenAIThreadManager, f as GoogleGenAIThreadManagerConfig, g as GoogleGenAIThreadOps, h as GoogleGenAIToolResponse, S as StoredContent, i as createGoogleGenAIAdapter, j as createGoogleGenAIThreadManager } from '../../../activities-DCaIPQBT.js';
2
+ import { G as GoogleGenAIThreadManagerHooks } from '../../../activities-zG_FBoY2.js';
3
+ export { a as GoogleGenAIAdapter, b as GoogleGenAIAdapterConfig, c as GoogleGenAIContent, d as GoogleGenAIInvocationPayload, e as GoogleGenAIThreadManager, f as GoogleGenAIThreadManagerConfig, g as GoogleGenAIThreadOps, h as GoogleGenAIToolResponse, S as StoredContent, i as createGoogleGenAIAdapter, j as createGoogleGenAIThreadManager } from '../../../activities-zG_FBoY2.js';
4
4
  import Redis from 'ioredis';
5
5
  import { GoogleGenAI, Content } from '@google/genai';
6
- import { M as ModelInvokerConfig, A as AgentResponse } from '../../../types-DwBYd0ij.js';
7
- import '../../../cold-store-aD4TSKlU.js';
6
+ import { M as ModelInvokerConfig, A as AgentResponse } from '../../../types-DeVNWqlb.js';
7
+ import '../../../cold-store-DKMAO1Dd.js';
8
8
  import '@aws-sdk/client-s3';
9
- import '../../../types-DF4wzWQG.js';
9
+ import '../../../types-DO4Tkwxo.js';
10
10
  import '@temporalio/workflow';
11
11
  import '@temporalio/common/lib/interfaces';
12
12
  import 'zod';
@@ -1,8 +1,8 @@
1
1
  import { ActivityInterfaceFor } from '@temporalio/workflow';
2
- import { T as ThreadOps } from '../../../types-DWeyCTYK.cjs';
3
- import { c as GoogleGenAIContent } from '../../../activities-BlQR5gX4.cjs';
4
- import { c as createThreadOpsProxy } from '../../../proxy-BAty3CWM.cjs';
5
- export { T as ThreadOpsProxyOptions } from '../../../proxy-BAty3CWM.cjs';
2
+ import { T as ThreadOps } from '../../../types-XUUFvrJ9.cjs';
3
+ import { c as GoogleGenAIContent } from '../../../activities-7OcT_vdR.cjs';
4
+ import { c as createThreadOpsProxy } from '../../../proxy-B7CWEV-T.cjs';
5
+ export { T as ThreadOpsProxyOptions } from '../../../proxy-B7CWEV-T.cjs';
6
6
  export { A as ADAPTER_ID, a as AdapterId } from '../../../adapter-id-BB-mmrts.cjs';
7
7
  import '@temporalio/common/lib/interfaces';
8
8
  import 'zod';
@@ -10,9 +10,9 @@ import '../../../types-CJ7tCdl6.cjs';
10
10
  import '@temporalio/common';
11
11
  import 'ioredis';
12
12
  import '@google/genai';
13
- import '../../../cold-store-UL13Sstw.cjs';
13
+ import '../../../cold-store-CkWoNtMh.cjs';
14
14
  import '@aws-sdk/client-s3';
15
- import '../../../types-DDLPnxBh.cjs';
15
+ import '../../../types-BR-k7h0e.cjs';
16
16
 
17
17
  /**
18
18
  * Workflow-safe proxy for Google GenAI thread operations.
@@ -1,8 +1,8 @@
1
1
  import { ActivityInterfaceFor } from '@temporalio/workflow';
2
- import { T as ThreadOps } from '../../../types-DwBYd0ij.js';
3
- import { c as GoogleGenAIContent } from '../../../activities-DCaIPQBT.js';
4
- import { c as createThreadOpsProxy } from '../../../proxy-mbnwBhHw.js';
5
- export { T as ThreadOpsProxyOptions } from '../../../proxy-mbnwBhHw.js';
2
+ import { T as ThreadOps } from '../../../types-DeVNWqlb.js';
3
+ import { c as GoogleGenAIContent } from '../../../activities-zG_FBoY2.js';
4
+ import { c as createThreadOpsProxy } from '../../../proxy-ByFHMVRX.js';
5
+ export { T as ThreadOpsProxyOptions } from '../../../proxy-ByFHMVRX.js';
6
6
  export { A as ADAPTER_ID, a as AdapterId } from '../../../adapter-id-BB-mmrts.js';
7
7
  import '@temporalio/common/lib/interfaces';
8
8
  import 'zod';
@@ -10,9 +10,9 @@ import '../../../types-CJ7tCdl6.js';
10
10
  import '@temporalio/common';
11
11
  import 'ioredis';
12
12
  import '@google/genai';
13
- import '../../../cold-store-aD4TSKlU.js';
13
+ import '../../../cold-store-DKMAO1Dd.js';
14
14
  import '@aws-sdk/client-s3';
15
- import '../../../types-DF4wzWQG.js';
15
+ import '../../../types-DO4Tkwxo.js';
16
16
 
17
17
  /**
18
18
  * Workflow-safe proxy for Google GenAI thread operations.
@@ -2,18 +2,18 @@ import { A as ADAPTER_ID } from '../../../adapter-id-CbY2zeSt.cjs';
2
2
  export { a as AdapterId } from '../../../adapter-id-CbY2zeSt.cjs';
3
3
  import Redis from 'ioredis';
4
4
  import { StoredMessage, MessageContent, BaseMessage } from '@langchain/core/messages';
5
- import { a as ModelInvoker, b as PrefixedThreadOps, S as ScopedPrefix, R as RouterContext, c as ToolHandlerResponse, d as ActivityToolHandler, M as ModelInvokerConfig, A as AgentResponse } from '../../../types-DWeyCTYK.cjs';
6
- import { C as ColdThreadStore } from '../../../cold-store-UL13Sstw.cjs';
5
+ import { a as ModelInvoker, b as PrefixedThreadOps, S as ScopedPrefix, R as RouterContext, c as ToolHandlerResponse, d as ActivityToolHandler, M as ModelInvokerConfig, A as AgentResponse } from '../../../types-XUUFvrJ9.cjs';
6
+ import { C as ColdThreadStore } from '../../../cold-store-CkWoNtMh.cjs';
7
7
  import { BaseChatModel } from '@langchain/core/language_models/chat_models';
8
- import { L as LangChainContent, a as LangChainThreadManagerHooks } from '../../../thread-manager-DsXvJ5cJ.cjs';
9
- export { b as LangChainInvocationPayload, c as LangChainThreadManager, d as LangChainThreadManagerConfig, e as createLangChainThreadManager } from '../../../thread-manager-DsXvJ5cJ.cjs';
8
+ import { L as LangChainContent, a as LangChainThreadManagerHooks } from '../../../thread-manager-Cibe0X5m.cjs';
9
+ export { b as LangChainInvocationPayload, c as LangChainThreadManager, d as LangChainThreadManagerConfig, e as createLangChainThreadManager } from '../../../thread-manager-Cibe0X5m.cjs';
10
10
  import '@temporalio/workflow';
11
11
  import '@temporalio/common/lib/interfaces';
12
12
  import 'zod';
13
13
  import '../../../types-CJ7tCdl6.cjs';
14
14
  import '@temporalio/common';
15
15
  import '@aws-sdk/client-s3';
16
- import '../../../types-DDLPnxBh.cjs';
16
+ import '../../../types-BR-k7h0e.cjs';
17
17
 
18
18
  type LangChainThreadOps<TScope extends string = ""> = PrefixedThreadOps<ScopedPrefix<TScope, typeof ADAPTER_ID>, LangChainContent>;
19
19
  interface LangChainAdapterConfig {
@@ -2,18 +2,18 @@ import { A as ADAPTER_ID } from '../../../adapter-id-CbY2zeSt.js';
2
2
  export { a as AdapterId } from '../../../adapter-id-CbY2zeSt.js';
3
3
  import Redis from 'ioredis';
4
4
  import { StoredMessage, MessageContent, BaseMessage } from '@langchain/core/messages';
5
- import { a as ModelInvoker, b as PrefixedThreadOps, S as ScopedPrefix, R as RouterContext, c as ToolHandlerResponse, d as ActivityToolHandler, M as ModelInvokerConfig, A as AgentResponse } from '../../../types-DwBYd0ij.js';
6
- import { C as ColdThreadStore } from '../../../cold-store-aD4TSKlU.js';
5
+ import { a as ModelInvoker, b as PrefixedThreadOps, S as ScopedPrefix, R as RouterContext, c as ToolHandlerResponse, d as ActivityToolHandler, M as ModelInvokerConfig, A as AgentResponse } from '../../../types-DeVNWqlb.js';
6
+ import { C as ColdThreadStore } from '../../../cold-store-DKMAO1Dd.js';
7
7
  import { BaseChatModel } from '@langchain/core/language_models/chat_models';
8
- import { L as LangChainContent, a as LangChainThreadManagerHooks } from '../../../thread-manager-CICj68PI.js';
9
- export { b as LangChainInvocationPayload, c as LangChainThreadManager, d as LangChainThreadManagerConfig, e as createLangChainThreadManager } from '../../../thread-manager-CICj68PI.js';
8
+ import { L as LangChainContent, a as LangChainThreadManagerHooks } from '../../../thread-manager-nK-WcFzM.js';
9
+ export { b as LangChainInvocationPayload, c as LangChainThreadManager, d as LangChainThreadManagerConfig, e as createLangChainThreadManager } from '../../../thread-manager-nK-WcFzM.js';
10
10
  import '@temporalio/workflow';
11
11
  import '@temporalio/common/lib/interfaces';
12
12
  import 'zod';
13
13
  import '../../../types-CJ7tCdl6.js';
14
14
  import '@temporalio/common';
15
15
  import '@aws-sdk/client-s3';
16
- import '../../../types-DF4wzWQG.js';
16
+ import '../../../types-DO4Tkwxo.js';
17
17
 
18
18
  type LangChainThreadOps<TScope extends string = ""> = PrefixedThreadOps<ScopedPrefix<TScope, typeof ADAPTER_ID>, LangChainContent>;
19
19
  interface LangChainAdapterConfig {
@@ -1,8 +1,8 @@
1
1
  import { ActivityInterfaceFor } from '@temporalio/workflow';
2
- import { T as ThreadOps } from '../../../types-DWeyCTYK.cjs';
3
- import { L as LangChainContent } from '../../../thread-manager-DsXvJ5cJ.cjs';
4
- import { c as createThreadOpsProxy } from '../../../proxy-BAty3CWM.cjs';
5
- export { T as ThreadOpsProxyOptions } from '../../../proxy-BAty3CWM.cjs';
2
+ import { T as ThreadOps } from '../../../types-XUUFvrJ9.cjs';
3
+ import { L as LangChainContent } from '../../../thread-manager-Cibe0X5m.cjs';
4
+ import { c as createThreadOpsProxy } from '../../../proxy-B7CWEV-T.cjs';
5
+ export { T as ThreadOpsProxyOptions } from '../../../proxy-B7CWEV-T.cjs';
6
6
  export { A as ADAPTER_ID, a as AdapterId } from '../../../adapter-id-CbY2zeSt.cjs';
7
7
  import '@temporalio/common/lib/interfaces';
8
8
  import 'zod';
@@ -10,7 +10,7 @@ import '../../../types-CJ7tCdl6.cjs';
10
10
  import '@temporalio/common';
11
11
  import 'ioredis';
12
12
  import '@langchain/core/messages';
13
- import '../../../types-DDLPnxBh.cjs';
13
+ import '../../../types-BR-k7h0e.cjs';
14
14
 
15
15
  /**
16
16
  * Workflow-safe proxy for LangChain thread operations.
@@ -1,8 +1,8 @@
1
1
  import { ActivityInterfaceFor } from '@temporalio/workflow';
2
- import { T as ThreadOps } from '../../../types-DwBYd0ij.js';
3
- import { L as LangChainContent } from '../../../thread-manager-CICj68PI.js';
4
- import { c as createThreadOpsProxy } from '../../../proxy-mbnwBhHw.js';
5
- export { T as ThreadOpsProxyOptions } from '../../../proxy-mbnwBhHw.js';
2
+ import { T as ThreadOps } from '../../../types-DeVNWqlb.js';
3
+ import { L as LangChainContent } from '../../../thread-manager-nK-WcFzM.js';
4
+ import { c as createThreadOpsProxy } from '../../../proxy-ByFHMVRX.js';
5
+ export { T as ThreadOpsProxyOptions } from '../../../proxy-ByFHMVRX.js';
6
6
  export { A as ADAPTER_ID, a as AdapterId } from '../../../adapter-id-CbY2zeSt.js';
7
7
  import '@temporalio/common/lib/interfaces';
8
8
  import 'zod';
@@ -10,7 +10,7 @@ import '../../../types-CJ7tCdl6.js';
10
10
  import '@temporalio/common';
11
11
  import 'ioredis';
12
12
  import '@langchain/core/messages';
13
- import '../../../types-DF4wzWQG.js';
13
+ import '../../../types-DO4Tkwxo.js';
14
14
 
15
15
  /**
16
16
  * Workflow-safe proxy for LangChain thread operations.
@@ -1,4 +1,4 @@
1
- import { P as PersistedThreadState } from './types-DWeyCTYK.cjs';
1
+ import { P as PersistedThreadState } from './types-XUUFvrJ9.cjs';
2
2
  import { S3Client } from '@aws-sdk/client-s3';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { P as PersistedThreadState } from './types-DwBYd0ij.js';
1
+ import { P as PersistedThreadState } from './types-DeVNWqlb.js';
2
2
  import { S3Client } from '@aws-sdk/client-s3';
3
3
 
4
4
  /**
package/dist/index.cjs CHANGED
@@ -131,7 +131,7 @@ function createToolRouter(options) {
131
131
  });
132
132
  }
133
133
  }
134
- async function processToolCall(toolCall, turn, sandboxId, onRewindRequested, assistantMessageId) {
134
+ async function processToolCall(toolCall, turn, sandboxId, onRewindRequested, assistantMessageId, persistThreadState) {
135
135
  const startTime = Date.now();
136
136
  const tool = toolMap.get(toolCall.name);
137
137
  const preResult = await runPreHooks(toolCall, tool, turn);
@@ -167,7 +167,8 @@ function createToolRouter(options) {
167
167
  toolCallId: toolCall.id,
168
168
  toolName: toolCall.name,
169
169
  ...sandboxId !== void 0 && { sandboxId },
170
- ...assistantMessageId !== void 0 && { assistantMessageId }
170
+ ...assistantMessageId !== void 0 && { assistantMessageId },
171
+ ...persistThreadState !== void 0 && { persistThreadState }
171
172
  };
172
173
  const response = await tool.handler(
173
174
  effectiveArgs,
@@ -295,6 +296,7 @@ function createToolRouter(options) {
295
296
  const turn = context?.turn ?? 0;
296
297
  const sandboxId = context?.sandboxId;
297
298
  const assistantMessageId = context?.assistantMessageId;
299
+ const persistThreadState = context?.persistThreadState;
298
300
  let rewindSignal;
299
301
  if (options.parallel) {
300
302
  const scope = new workflow.CancellationScope({ cancellable: true });
@@ -312,7 +314,8 @@ function createToolRouter(options) {
312
314
  turn,
313
315
  sandboxId,
314
316
  onRewindRequested,
315
- assistantMessageId
317
+ assistantMessageId,
318
+ persistThreadState
316
319
  )
317
320
  )
318
321
  )
@@ -338,7 +341,8 @@ function createToolRouter(options) {
338
341
  turn,
339
342
  sandboxId,
340
343
  void 0,
341
- assistantMessageId
344
+ assistantMessageId,
345
+ persistThreadState
342
346
  );
343
347
  if (outcome.kind === "rewind") {
344
348
  rewindSignal = outcome.signal;
@@ -366,6 +370,9 @@ function createToolRouter(options) {
366
370
  },
367
371
  ...context?.assistantMessageId !== void 0 && {
368
372
  assistantMessageId: context.assistantMessageId
373
+ },
374
+ ...context?.persistThreadState !== void 0 && {
375
+ persistThreadState: context.persistThreadState
369
376
  }
370
377
  };
371
378
  const response = await handler(
@@ -723,6 +730,17 @@ function createSubagentHandler(subagents) {
723
730
  if (isSnapshotBaseCreator) {
724
731
  snapshotBaseCreatorAgent.set(childWorkflowId, config.agentName);
725
732
  }
733
+ if (continuationThreadId && continuationThreadId === context.threadId && context.persistThreadState) {
734
+ try {
735
+ await context.persistThreadState();
736
+ } catch (err) {
737
+ workflow.log.warn("failed to persist parent thread state for subagent", {
738
+ subagent: config.agentName,
739
+ childWorkflowId,
740
+ error: err instanceof Error ? err.message : String(err)
741
+ });
742
+ }
743
+ }
726
744
  workflow.log.info("subagent spawned", {
727
745
  subagent: config.agentName,
728
746
  childWorkflowId,
@@ -1358,7 +1376,17 @@ async function createSession(config) {
1358
1376
  ...sandboxId !== void 0 && { sandboxId },
1359
1377
  ...assistantId !== void 0 && {
1360
1378
  assistantMessageId: assistantId
1361
- }
1379
+ },
1380
+ // Hand handlers a way to persist the parent's slice
1381
+ // mid-loop (subagents that fork or continue the parent's
1382
+ // thread need this — otherwise the child loads a stale
1383
+ // snapshot from the prior session, since `saveThreadState`
1384
+ // would otherwise only run in the `finally` below).
1385
+ persistThreadState: () => saveThreadState(
1386
+ threadId,
1387
+ stateManager.getPersistedSlice(),
1388
+ threadKey
1389
+ )
1362
1390
  }
1363
1391
  );
1364
1392
  for (const result of toolCallResults) {