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