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
package/dist/workflow.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { d as ActivityToolHandler,
|
|
1
|
+
export { a9 as AskUserQuestionArgs, B as BashArgs, D as DEFAULT_SUBAGENT_WORKFLOW_RUN_TIMEOUT, F as FileEditArgs, a as FileReadArgs, b as FileWriteArgs, G as GlobArgs, M as GrepArgs, O as ObservabilityHooks, R as ReadSkillArgs, s as SessionEndedEvent, S as SessionStartedEvent, E as SubagentArgs, T as THREAD_TTL_SECONDS, V as TaskCreateArgs, _ as TaskGetArgs, a1 as TaskListArgs, a4 as TaskUpdateArgs, u as ToolExecutedEvent, t as TurnCompletedEvent, W as WorkflowConfig, f as WorkflowInput, g as WorkflowSessionInput, Z as ZeitlichObservabilitySinks, w as applyVirtualTreeMutations, a8 as askUserQuestionTool, a6 as bashTool, r as composeHooks, k as createAgentStateManager, aa as createAskUserQuestionHandler, a7 as createBashToolDescription, q as createObservabilityHooks, J as createReadSkillHandler, I as createReadSkillTool, d as createSession, X as createTaskCreateHandler, $ as createTaskGetHandler, a2 as createTaskListHandler, a5 as createTaskUpdateHandler, l as createToolRouter, o as defineSubagent, p as defineSubagentWorkflow, n as defineTool, e as defineWorkflow, Q as editTool, z as filesWithMimeType, x as formatVirtualFileTree, h as getShortId, i as getThreadListKey, j as getThreadMetaKey, K as globTool, L as grepTool, A as hasDirectory, y as hasFileWithMimeType, m as hasNoOtherToolCalls, H as parseSkillFile, v as proxyRunAgent, C as proxyVirtualFsOps, N as readFileTool, U as taskCreateTool, Y as taskGetTool, a0 as taskListTool, a3 as taskUpdateTool, P as writeFileTool } from './workflow-XVt0ww8K.cjs';
|
|
2
|
+
export { d as ActivityToolHandler, al as AgentConfig, ak as AgentFile, A as AgentResponse, u as AgentState, v as AgentStateManager, aj as AgentStatus, a5 as AppendToolResultFn, B as BaseAgentState, aD as FileEntry, F as FileEntryMetadata, j as FileResolver, a9 as Hooks, W as InferToolResults, x as JsonPrimitive, w as JsonSerializable, J as JsonValue, a as ModelInvoker, M as ModelInvokerConfig, G as ParsedToolCall, H as ParsedToolCallUnion, P as PersistedThreadState, ag as PostHumanMessageAppendHook, ah as PostHumanMessageAppendHookContext, a1 as PostToolUseFailureHook, a2 as PostToolUseFailureHookContext, a3 as PostToolUseFailureHookResult, $ as PostToolUseHook, a0 as PostToolUseHookContext, ae as PreHumanMessageAppendHook, af as PreHumanMessageAppendHookContext, X as PreToolUseHook, Y as PreToolUseHookContext, _ as PreToolUseHookResult, b as PrefixedThreadOps, l as PrefixedVirtualFsOps, a6 as ProcessToolCallsContext, a7 as ProcessToolCallsResult, E as RawToolCall, a8 as RewindSignal, R as RouterContext, ar as RunAgentActivity, f as RunAgentConfig, r as SandboxInit, s as SandboxShutdown, S as ScopedPrefix, an as SerializableToolDefinition, o as SessionConfig, ac as SessionEndHook, ad as SessionEndHookContext, am as SessionExitReason, p as SessionRequiredCaps, n as SessionResult, aa as SessionStartHook, ab as SessionStartHookContext, i as Skill, h as SkillMetadata, g as SkillProvider, at as SubagentChildWorkflowOptions, as as SubagentConfig, az as SubagentContinuationCaps, au as SubagentDefinition, av as SubagentFnResult, ax as SubagentHandlerResponse, aw as SubagentHooks, ay as SubagentSandboxConfig, t as SubagentSandboxShutdown, aC as SubagentSessionInput, aA as SubagentWorkflow, aB as SubagentWorkflowInput, ao as TaskStatus, q as ThreadInit, T as ThreadOps, ai as TokenUsage, N as ToolArgs, Q as ToolCallResult, U as ToolCallResultUnion, y as ToolDefinition, L as ToolHandler, c as ToolHandlerResponse, a4 as ToolHooks, C as ToolMap, D as ToolNames, O as ToolResult, e as ToolResultConfig, I as ToolRouter, K as ToolRouterHooks, z as ToolWithHandler, k as TreeMutation, aE as VirtualFileTree, aF as VirtualFsOps, aG as VirtualFsState, ap as WorkflowTask, Z as ZeitlichSession, aq as isTerminalStatus } from './types-4Wmk-wRq.cjs';
|
|
3
3
|
export { i as ExecOptions, E as ExecResult, P as PrefixedSandboxOps, b as Sandbox, e as SandboxCapabilities, h as SandboxCapability, a as SandboxCreateOptions, f as SandboxCreateResult, D as SandboxDirentEntry, F as SandboxFileStat, c as SandboxFileSystem, j as SandboxNotFoundError, k as SandboxNotSupportedError, S as SandboxOps, d as SandboxProvider, g as SandboxSnapshot } from './types-CJ7tCdl6.cjs';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import '@temporalio/common';
|
package/dist/workflow.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { d as ActivityToolHandler,
|
|
1
|
+
export { a9 as AskUserQuestionArgs, B as BashArgs, D as DEFAULT_SUBAGENT_WORKFLOW_RUN_TIMEOUT, F as FileEditArgs, a as FileReadArgs, b as FileWriteArgs, G as GlobArgs, M as GrepArgs, O as ObservabilityHooks, R as ReadSkillArgs, s as SessionEndedEvent, S as SessionStartedEvent, E as SubagentArgs, T as THREAD_TTL_SECONDS, V as TaskCreateArgs, _ as TaskGetArgs, a1 as TaskListArgs, a4 as TaskUpdateArgs, u as ToolExecutedEvent, t as TurnCompletedEvent, W as WorkflowConfig, f as WorkflowInput, g as WorkflowSessionInput, Z as ZeitlichObservabilitySinks, w as applyVirtualTreeMutations, a8 as askUserQuestionTool, a6 as bashTool, r as composeHooks, k as createAgentStateManager, aa as createAskUserQuestionHandler, a7 as createBashToolDescription, q as createObservabilityHooks, J as createReadSkillHandler, I as createReadSkillTool, d as createSession, X as createTaskCreateHandler, $ as createTaskGetHandler, a2 as createTaskListHandler, a5 as createTaskUpdateHandler, l as createToolRouter, o as defineSubagent, p as defineSubagentWorkflow, n as defineTool, e as defineWorkflow, Q as editTool, z as filesWithMimeType, x as formatVirtualFileTree, h as getShortId, i as getThreadListKey, j as getThreadMetaKey, K as globTool, L as grepTool, A as hasDirectory, y as hasFileWithMimeType, m as hasNoOtherToolCalls, H as parseSkillFile, v as proxyRunAgent, C as proxyVirtualFsOps, N as readFileTool, U as taskCreateTool, Y as taskGetTool, a0 as taskListTool, a3 as taskUpdateTool, P as writeFileTool } from './workflow-D32TRMr-.js';
|
|
2
|
+
export { d as ActivityToolHandler, al as AgentConfig, ak as AgentFile, A as AgentResponse, u as AgentState, v as AgentStateManager, aj as AgentStatus, a5 as AppendToolResultFn, B as BaseAgentState, aD as FileEntry, F as FileEntryMetadata, j as FileResolver, a9 as Hooks, W as InferToolResults, x as JsonPrimitive, w as JsonSerializable, J as JsonValue, a as ModelInvoker, M as ModelInvokerConfig, G as ParsedToolCall, H as ParsedToolCallUnion, P as PersistedThreadState, ag as PostHumanMessageAppendHook, ah as PostHumanMessageAppendHookContext, a1 as PostToolUseFailureHook, a2 as PostToolUseFailureHookContext, a3 as PostToolUseFailureHookResult, $ as PostToolUseHook, a0 as PostToolUseHookContext, ae as PreHumanMessageAppendHook, af as PreHumanMessageAppendHookContext, X as PreToolUseHook, Y as PreToolUseHookContext, _ as PreToolUseHookResult, b as PrefixedThreadOps, l as PrefixedVirtualFsOps, a6 as ProcessToolCallsContext, a7 as ProcessToolCallsResult, E as RawToolCall, a8 as RewindSignal, R as RouterContext, ar as RunAgentActivity, f as RunAgentConfig, r as SandboxInit, s as SandboxShutdown, S as ScopedPrefix, an as SerializableToolDefinition, o as SessionConfig, ac as SessionEndHook, ad as SessionEndHookContext, am as SessionExitReason, p as SessionRequiredCaps, n as SessionResult, aa as SessionStartHook, ab as SessionStartHookContext, i as Skill, h as SkillMetadata, g as SkillProvider, at as SubagentChildWorkflowOptions, as as SubagentConfig, az as SubagentContinuationCaps, au as SubagentDefinition, av as SubagentFnResult, ax as SubagentHandlerResponse, aw as SubagentHooks, ay as SubagentSandboxConfig, t as SubagentSandboxShutdown, aC as SubagentSessionInput, aA as SubagentWorkflow, aB as SubagentWorkflowInput, ao as TaskStatus, q as ThreadInit, T as ThreadOps, ai as TokenUsage, N as ToolArgs, Q as ToolCallResult, U as ToolCallResultUnion, y as ToolDefinition, L as ToolHandler, c as ToolHandlerResponse, a4 as ToolHooks, C as ToolMap, D as ToolNames, O as ToolResult, e as ToolResultConfig, I as ToolRouter, K as ToolRouterHooks, z as ToolWithHandler, k as TreeMutation, aE as VirtualFileTree, aF as VirtualFsOps, aG as VirtualFsState, ap as WorkflowTask, Z as ZeitlichSession, aq as isTerminalStatus } from './types-DKsCdAtQ.js';
|
|
3
3
|
export { i as ExecOptions, E as ExecResult, P as PrefixedSandboxOps, b as Sandbox, e as SandboxCapabilities, h as SandboxCapability, a as SandboxCreateOptions, f as SandboxCreateResult, D as SandboxDirentEntry, F as SandboxFileStat, c as SandboxFileSystem, j as SandboxNotFoundError, k as SandboxNotSupportedError, S as SandboxOps, d as SandboxProvider, g as SandboxSnapshot } from './types-CJ7tCdl6.js';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import '@temporalio/common';
|
package/dist/workflow.js
CHANGED
|
@@ -1166,42 +1166,6 @@ async function createSession(config) {
|
|
|
1166
1166
|
...baseSnapshot && { baseSnapshot }
|
|
1167
1167
|
});
|
|
1168
1168
|
}
|
|
1169
|
-
if (virtualFsConfig) {
|
|
1170
|
-
if (!virtualFsOps) {
|
|
1171
|
-
throw ApplicationFailure.create({
|
|
1172
|
-
message: "No virtualFsOps provided \u2014 cannot resolve file tree",
|
|
1173
|
-
nonRetryable: true
|
|
1174
|
-
});
|
|
1175
|
-
}
|
|
1176
|
-
const result = await virtualFsOps.resolveFileTree(virtualFsConfig.ctx);
|
|
1177
|
-
const skillFiles = skills ? collectSkillFiles(skills) : void 0;
|
|
1178
|
-
const fileTree = skillFiles ? [
|
|
1179
|
-
...result.fileTree,
|
|
1180
|
-
...Object.entries(skillFiles).map(([path, content]) => ({
|
|
1181
|
-
id: `skill:${path}`,
|
|
1182
|
-
path,
|
|
1183
|
-
size: content.length,
|
|
1184
|
-
mtime: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1185
|
-
metadata: {},
|
|
1186
|
-
// Carry the content directly on the entry so any handler that
|
|
1187
|
-
// constructs a VirtualFileSystem from `fileTree` can read it
|
|
1188
|
-
// without needing to also wire up `inlineFiles` from state.
|
|
1189
|
-
inlineContent: content
|
|
1190
|
-
}))
|
|
1191
|
-
] : result.fileTree;
|
|
1192
|
-
stateManager.mergeUpdate({
|
|
1193
|
-
fileTree,
|
|
1194
|
-
virtualFsCtx: virtualFsConfig.ctx,
|
|
1195
|
-
// `inlineFiles` is still the source of truth at read time:
|
|
1196
|
-
// VirtualFileSystem checks the inlineFiles map first and only
|
|
1197
|
-
// falls through to entry.inlineContent. Embedding the content on
|
|
1198
|
-
// the entry is the migration target so that handlers building a
|
|
1199
|
-
// VirtualFileSystem from `fileTree` alone (without forwarding
|
|
1200
|
-
// `inlineFiles` from state) can read skill resources. Until a
|
|
1201
|
-
// follow-up drops `inlineFiles`, both fields are populated.
|
|
1202
|
-
...skillFiles && { inlineFiles: skillFiles }
|
|
1203
|
-
});
|
|
1204
|
-
}
|
|
1205
1169
|
if (hooks.onSessionStart) {
|
|
1206
1170
|
await hooks.onSessionStart({
|
|
1207
1171
|
threadId,
|
|
@@ -1244,6 +1208,42 @@ async function createSession(config) {
|
|
|
1244
1208
|
await initializeThread(threadId, threadKey);
|
|
1245
1209
|
}
|
|
1246
1210
|
}
|
|
1211
|
+
if (virtualFsConfig) {
|
|
1212
|
+
if (!virtualFsOps) {
|
|
1213
|
+
throw ApplicationFailure.create({
|
|
1214
|
+
message: "No virtualFsOps provided \u2014 cannot resolve file tree",
|
|
1215
|
+
nonRetryable: true
|
|
1216
|
+
});
|
|
1217
|
+
}
|
|
1218
|
+
const result = await virtualFsOps.resolveFileTree(virtualFsConfig.ctx);
|
|
1219
|
+
const skillFiles = skills ? collectSkillFiles(skills) : void 0;
|
|
1220
|
+
const fileTree = skillFiles ? [
|
|
1221
|
+
...result.fileTree,
|
|
1222
|
+
...Object.entries(skillFiles).map(([path, content]) => ({
|
|
1223
|
+
id: `skill:${path}`,
|
|
1224
|
+
path,
|
|
1225
|
+
size: content.length,
|
|
1226
|
+
mtime: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1227
|
+
metadata: {},
|
|
1228
|
+
// Carry the content directly on the entry so any handler that
|
|
1229
|
+
// constructs a VirtualFileSystem from `fileTree` can read it
|
|
1230
|
+
// without needing to also wire up `inlineFiles` from state.
|
|
1231
|
+
inlineContent: content
|
|
1232
|
+
}))
|
|
1233
|
+
] : result.fileTree;
|
|
1234
|
+
stateManager.mergeUpdate({
|
|
1235
|
+
fileTree,
|
|
1236
|
+
virtualFsCtx: virtualFsConfig.ctx,
|
|
1237
|
+
// `inlineFiles` is still the source of truth at read time:
|
|
1238
|
+
// VirtualFileSystem checks the inlineFiles map first and only
|
|
1239
|
+
// falls through to entry.inlineContent. Embedding the content on
|
|
1240
|
+
// the entry is the migration target so that handlers building a
|
|
1241
|
+
// VirtualFileSystem from `fileTree` alone (without forwarding
|
|
1242
|
+
// `inlineFiles` from state) can read skill resources. Until a
|
|
1243
|
+
// follow-up drops `inlineFiles`, both fields are populated.
|
|
1244
|
+
...skillFiles && { inlineFiles: skillFiles }
|
|
1245
|
+
});
|
|
1246
|
+
}
|
|
1247
1247
|
await appendHumanMessage(
|
|
1248
1248
|
threadId,
|
|
1249
1249
|
uuid4(),
|
|
@@ -1445,6 +1445,22 @@ function getThreadMetaKey(threadKey, threadId) {
|
|
|
1445
1445
|
function isTerminalStatus(status) {
|
|
1446
1446
|
return status === "COMPLETED" || status === "FAILED" || status === "CANCELLED";
|
|
1447
1447
|
}
|
|
1448
|
+
var RESERVED_STATE_KEYS = [
|
|
1449
|
+
"status",
|
|
1450
|
+
"version",
|
|
1451
|
+
"turns",
|
|
1452
|
+
"tasks",
|
|
1453
|
+
"tools",
|
|
1454
|
+
"systemPrompt",
|
|
1455
|
+
"fileTree",
|
|
1456
|
+
"inlineFiles",
|
|
1457
|
+
"virtualFsCtx",
|
|
1458
|
+
"totalInputTokens",
|
|
1459
|
+
"totalOutputTokens",
|
|
1460
|
+
"totalReasonTokens",
|
|
1461
|
+
"cachedWriteTokens",
|
|
1462
|
+
"cachedReadTokens"
|
|
1463
|
+
];
|
|
1448
1464
|
function createAgentStateManager({
|
|
1449
1465
|
initialState
|
|
1450
1466
|
}) {
|
|
@@ -1598,9 +1614,16 @@ function createAgentStateManager({
|
|
|
1598
1614
|
return deleted;
|
|
1599
1615
|
},
|
|
1600
1616
|
getPersistedSlice() {
|
|
1617
|
+
const source = customState;
|
|
1618
|
+
const custom2 = {};
|
|
1619
|
+
const reserved = new Set(RESERVED_STATE_KEYS);
|
|
1620
|
+
for (const [key, value] of Object.entries(source)) {
|
|
1621
|
+
if (reserved.has(key)) continue;
|
|
1622
|
+
custom2[key] = value;
|
|
1623
|
+
}
|
|
1601
1624
|
return {
|
|
1602
1625
|
tasks: Array.from(tasks.entries()),
|
|
1603
|
-
custom:
|
|
1626
|
+
custom: custom2
|
|
1604
1627
|
};
|
|
1605
1628
|
},
|
|
1606
1629
|
updateUsage(usage) {
|