zeitlich 0.2.31 → 0.2.32
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-qPkJDAiq.d.cts → activities-DA-bQM12.d.cts} +2 -2
- package/dist/{activities-DRSdt8Y3.d.ts → activities-FIXVz7DT.d.ts} +2 -2
- package/dist/adapters/thread/anthropic/index.cjs +4 -48
- package/dist/adapters/thread/anthropic/index.cjs.map +1 -1
- package/dist/adapters/thread/anthropic/index.d.cts +6 -6
- package/dist/adapters/thread/anthropic/index.d.ts +6 -6
- package/dist/adapters/thread/anthropic/index.js +4 -48
- package/dist/adapters/thread/anthropic/index.js.map +1 -1
- package/dist/adapters/thread/anthropic/workflow.cjs +1 -0
- package/dist/adapters/thread/anthropic/workflow.cjs.map +1 -1
- package/dist/adapters/thread/anthropic/workflow.d.cts +4 -4
- package/dist/adapters/thread/anthropic/workflow.d.ts +4 -4
- package/dist/adapters/thread/anthropic/workflow.js +1 -0
- package/dist/adapters/thread/anthropic/workflow.js.map +1 -1
- package/dist/adapters/thread/google-genai/index.cjs +8 -48
- package/dist/adapters/thread/google-genai/index.cjs.map +1 -1
- package/dist/adapters/thread/google-genai/index.d.cts +6 -6
- package/dist/adapters/thread/google-genai/index.d.ts +6 -6
- package/dist/adapters/thread/google-genai/index.js +8 -48
- package/dist/adapters/thread/google-genai/index.js.map +1 -1
- package/dist/adapters/thread/google-genai/workflow.cjs +1 -0
- package/dist/adapters/thread/google-genai/workflow.cjs.map +1 -1
- 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/google-genai/workflow.js +1 -0
- package/dist/adapters/thread/google-genai/workflow.js.map +1 -1
- package/dist/adapters/thread/langchain/index.cjs +5 -1
- package/dist/adapters/thread/langchain/index.cjs.map +1 -1
- package/dist/adapters/thread/langchain/index.d.cts +6 -5
- package/dist/adapters/thread/langchain/index.d.ts +6 -5
- package/dist/adapters/thread/langchain/index.js +5 -1
- package/dist/adapters/thread/langchain/index.js.map +1 -1
- package/dist/adapters/thread/langchain/workflow.cjs +1 -0
- package/dist/adapters/thread/langchain/workflow.cjs.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/adapters/thread/langchain/workflow.js +1 -0
- package/dist/adapters/thread/langchain/workflow.js.map +1 -1
- package/dist/index.cjs +8 -5
- 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 +8 -5
- package/dist/index.js.map +1 -1
- package/dist/{proxy-BkvkV2oU.d.ts → proxy-Br4unLTC.d.ts} +1 -1
- package/dist/{proxy-BDQ3Rj6R.d.cts → proxy-CTCYWjkr.d.cts} +1 -1
- package/dist/{thread-manager-BLgvv9Gf.d.cts → thread-manager-CUubPYPH.d.cts} +1 -1
- package/dist/{thread-manager-DowU4ntB.d.cts → thread-manager-Cv_BR28i.d.cts} +1 -1
- package/dist/{thread-manager-Cv82H1wi.d.ts → thread-manager-DKWxHUzD.d.ts} +1 -1
- package/dist/{thread-manager-HsAYkyAV.d.ts → thread-manager-YJLoc1vH.d.ts} +1 -1
- package/dist/{types-CjeGWQm1.d.cts → types-Bpq5fDI5.d.cts} +7 -4
- package/dist/{types-D6UKZZtj.d.ts → types-BxiT8w9d.d.ts} +1 -1
- package/dist/{types-BmS-Huc0.d.ts → types-CheCTLeV.d.ts} +7 -4
- package/dist/{types-e_38QaKo.d.cts → types-NJDyMyUx.d.cts} +1 -1
- package/dist/{workflow-CNshfqSO.d.cts → workflow-BWKQcz9d.d.cts} +1 -1
- package/dist/{workflow-CTcrPZAV.d.ts → workflow-D8wK7TJY.d.ts} +1 -1
- package/dist/workflow.cjs +4 -1
- 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 +4 -1
- package/dist/workflow.js.map +1 -1
- package/package.json +1 -1
- package/src/adapters/thread/anthropic/activities.ts +10 -0
- package/src/adapters/thread/anthropic/model-invoker.ts +2 -5
- package/src/adapters/thread/google-genai/activities.ts +14 -0
- package/src/adapters/thread/google-genai/model-invoker.ts +2 -5
- package/src/adapters/thread/langchain/activities.ts +11 -0
- package/src/adapters/thread/langchain/model-invoker.ts +2 -3
- package/src/lib/.env +1 -0
- package/src/lib/model/types.ts +3 -2
- package/src/lib/session/session-edge-cases.integration.test.ts +6 -0
- package/src/lib/session/session.integration.test.ts +3 -0
- package/src/lib/session/session.ts +4 -0
- package/src/lib/session/types.ts +7 -0
- package/src/lib/thread/proxy.ts +1 -0
- package/src/lib/types.ts +1 -0
- package/src/lib/virtual-fs/manager.ts +3 -3
- package/src/lib/virtual-fs/proxy.ts +3 -3
- package/src/lib/virtual-fs/types.ts +1 -2
- package/src/lib/virtual-fs/with-virtual-fs.ts +4 -4
- package/src/tools/bash/.env +1 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Redis from 'ioredis';
|
|
2
2
|
import Anthropic from '@anthropic-ai/sdk';
|
|
3
|
-
import { T as ThreadManagerHooks, P as ProviderThreadManager } from './types-
|
|
3
|
+
import { T as ThreadManagerHooks, P as ProviderThreadManager } from './types-NJDyMyUx.cjs';
|
|
4
4
|
|
|
5
5
|
/** SDK-native content type for Anthropic human messages */
|
|
6
6
|
type AnthropicContent = string | Anthropic.Messages.ContentBlockParam[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Redis from 'ioredis';
|
|
2
2
|
import { MessageContent, StoredMessage, BaseMessage } from '@langchain/core/messages';
|
|
3
|
-
import { T as ThreadManagerHooks, P as ProviderThreadManager } from './types-
|
|
3
|
+
import { T as ThreadManagerHooks, P as ProviderThreadManager } from './types-NJDyMyUx.cjs';
|
|
4
4
|
|
|
5
5
|
/** SDK-native content type for LangChain human messages */
|
|
6
6
|
type LangChainContent = string | MessageContent;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Redis from 'ioredis';
|
|
2
2
|
import { MessageContent, StoredMessage, BaseMessage } from '@langchain/core/messages';
|
|
3
|
-
import { T as ThreadManagerHooks, P as ProviderThreadManager } from './types-
|
|
3
|
+
import { T as ThreadManagerHooks, P as ProviderThreadManager } from './types-BxiT8w9d.js';
|
|
4
4
|
|
|
5
5
|
/** SDK-native content type for LangChain human messages */
|
|
6
6
|
type LangChainContent = string | MessageContent;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Redis from 'ioredis';
|
|
2
2
|
import Anthropic from '@anthropic-ai/sdk';
|
|
3
|
-
import { T as ThreadManagerHooks, P as ProviderThreadManager } from './types-
|
|
3
|
+
import { T as ThreadManagerHooks, P as ProviderThreadManager } from './types-BxiT8w9d.js';
|
|
4
4
|
|
|
5
5
|
/** SDK-native content type for Anthropic human messages */
|
|
6
6
|
type AnthropicContent = string | Anthropic.Messages.ContentBlockParam[];
|
|
@@ -578,8 +578,7 @@ type PrefixedVirtualFsOps<TPrefix extends string, TCtx = unknown, TMeta = FileEn
|
|
|
578
578
|
*/
|
|
579
579
|
interface VirtualFsState<TCtx = unknown, TMeta = FileEntryMetadata> {
|
|
580
580
|
fileTree: FileEntry<TMeta>[];
|
|
581
|
-
|
|
582
|
-
workspaceBase?: string;
|
|
581
|
+
virtualFsCtx: TCtx;
|
|
583
582
|
/** In-memory file contents keyed by path, bypassing the resolver (e.g. skill resources). */
|
|
584
583
|
inlineFiles?: Record<string, string>;
|
|
585
584
|
}
|
|
@@ -608,6 +607,7 @@ interface BaseAgentState {
|
|
|
608
607
|
fileTree: FileEntry[];
|
|
609
608
|
/** In-memory file contents keyed by path, bypassing the resolver (e.g. skill resources). */
|
|
610
609
|
inlineFiles?: Record<string, string>;
|
|
610
|
+
virtualFsCtx?: unknown;
|
|
611
611
|
systemPrompt?: string;
|
|
612
612
|
totalInputTokens: number;
|
|
613
613
|
totalOutputTokens: number;
|
|
@@ -1055,8 +1055,9 @@ interface ModelInvokerConfig {
|
|
|
1055
1055
|
}
|
|
1056
1056
|
/**
|
|
1057
1057
|
* Generic model invocation contract.
|
|
1058
|
-
* Implementations load the thread, call the LLM,
|
|
1059
|
-
*
|
|
1058
|
+
* Implementations load the thread, call the LLM, and return a normalised
|
|
1059
|
+
* AgentResponse. The caller (workflow) is responsible for appending the
|
|
1060
|
+
* response to the thread with a deterministic ID.
|
|
1060
1061
|
*
|
|
1061
1062
|
* Framework adapters (e.g. `zeitlich/langchain`) provide concrete
|
|
1062
1063
|
* implementations of this type.
|
|
@@ -1078,6 +1079,8 @@ interface ThreadOps<TContent = string> {
|
|
|
1078
1079
|
appendHumanMessage(threadId: string, id: string, content: TContent, threadKey?: string): Promise<void>;
|
|
1079
1080
|
/** Append a tool result to the thread */
|
|
1080
1081
|
appendToolResult(id: string, config: ToolResultConfig): Promise<void>;
|
|
1082
|
+
/** Append the model's response to the thread */
|
|
1083
|
+
appendAgentMessage(threadId: string, id: string, message: unknown, threadKey?: string): Promise<void>;
|
|
1081
1084
|
/** Append a system message to the thread */
|
|
1082
1085
|
appendSystemMessage(threadId: string, id: string, content: string, threadKey?: string): Promise<void>;
|
|
1083
1086
|
/** Copy all messages from sourceThreadId into a new thread at targetThreadId */
|
|
@@ -578,8 +578,7 @@ type PrefixedVirtualFsOps<TPrefix extends string, TCtx = unknown, TMeta = FileEn
|
|
|
578
578
|
*/
|
|
579
579
|
interface VirtualFsState<TCtx = unknown, TMeta = FileEntryMetadata> {
|
|
580
580
|
fileTree: FileEntry<TMeta>[];
|
|
581
|
-
|
|
582
|
-
workspaceBase?: string;
|
|
581
|
+
virtualFsCtx: TCtx;
|
|
583
582
|
/** In-memory file contents keyed by path, bypassing the resolver (e.g. skill resources). */
|
|
584
583
|
inlineFiles?: Record<string, string>;
|
|
585
584
|
}
|
|
@@ -608,6 +607,7 @@ interface BaseAgentState {
|
|
|
608
607
|
fileTree: FileEntry[];
|
|
609
608
|
/** In-memory file contents keyed by path, bypassing the resolver (e.g. skill resources). */
|
|
610
609
|
inlineFiles?: Record<string, string>;
|
|
610
|
+
virtualFsCtx?: unknown;
|
|
611
611
|
systemPrompt?: string;
|
|
612
612
|
totalInputTokens: number;
|
|
613
613
|
totalOutputTokens: number;
|
|
@@ -1055,8 +1055,9 @@ interface ModelInvokerConfig {
|
|
|
1055
1055
|
}
|
|
1056
1056
|
/**
|
|
1057
1057
|
* Generic model invocation contract.
|
|
1058
|
-
* Implementations load the thread, call the LLM,
|
|
1059
|
-
*
|
|
1058
|
+
* Implementations load the thread, call the LLM, and return a normalised
|
|
1059
|
+
* AgentResponse. The caller (workflow) is responsible for appending the
|
|
1060
|
+
* response to the thread with a deterministic ID.
|
|
1060
1061
|
*
|
|
1061
1062
|
* Framework adapters (e.g. `zeitlich/langchain`) provide concrete
|
|
1062
1063
|
* implementations of this type.
|
|
@@ -1078,6 +1079,8 @@ interface ThreadOps<TContent = string> {
|
|
|
1078
1079
|
appendHumanMessage(threadId: string, id: string, content: TContent, threadKey?: string): Promise<void>;
|
|
1079
1080
|
/** Append a tool result to the thread */
|
|
1080
1081
|
appendToolResult(id: string, config: ToolResultConfig): Promise<void>;
|
|
1082
|
+
/** Append the model's response to the thread */
|
|
1083
|
+
appendAgentMessage(threadId: string, id: string, message: unknown, threadKey?: string): Promise<void>;
|
|
1081
1084
|
/** Append a system message to the thread */
|
|
1082
1085
|
appendSystemMessage(threadId: string, id: string, content: string, threadKey?: string): Promise<void>;
|
|
1083
1086
|
/** Copy all messages from sourceThreadId into a new thread at targetThreadId */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ao as ToolMap, _ as SessionConfig, az as ZeitlichSession, Y as SandboxShutdown, ag as ThreadInit, X as SandboxInit, t as JsonSerializable, B as BaseAgentState, o as AgentStateManager, aB as ToolRouterOptions, ar as ToolRouter, R as RouterContext, J as JsonValue, at as ToolWithHandler, v as ParsedToolCallUnion, ap as ToolNames, a6 as SubagentDefinition, a9 as SubagentHooks, aa as SubagentSandboxConfig, a5 as SubagentConfig, ab as SubagentSandboxShutdown, ac as SubagentSessionInput, a7 as SubagentFnResult, a3 as SessionStartHook, $ as SessionEndHook, D as PostToolUseHook, y as PostToolUseFailureHook, a1 as SessionExitReason, ah as TokenUsage, F as FileEntryMetadata, av as VirtualFileTree, j as TreeMutation, r as FileEntry, aw as VirtualFsOps, g as SkillMetadata, h as Skill, b as ToolHandlerResponse, am as ToolHandler, ay as WorkflowTask, c as ActivityToolHandler } from './types-
|
|
1
|
+
import { ao as ToolMap, _ as SessionConfig, az as ZeitlichSession, Y as SandboxShutdown, ag as ThreadInit, X as SandboxInit, t as JsonSerializable, B as BaseAgentState, o as AgentStateManager, aB as ToolRouterOptions, ar as ToolRouter, R as RouterContext, J as JsonValue, at as ToolWithHandler, v as ParsedToolCallUnion, ap as ToolNames, a6 as SubagentDefinition, a9 as SubagentHooks, aa as SubagentSandboxConfig, a5 as SubagentConfig, ab as SubagentSandboxShutdown, ac as SubagentSessionInput, a7 as SubagentFnResult, a3 as SessionStartHook, $ as SessionEndHook, D as PostToolUseHook, y as PostToolUseFailureHook, a1 as SessionExitReason, ah as TokenUsage, F as FileEntryMetadata, av as VirtualFileTree, j as TreeMutation, r as FileEntry, aw as VirtualFsOps, g as SkillMetadata, h as Skill, b as ToolHandlerResponse, am as ToolHandler, ay as WorkflowTask, c as ActivityToolHandler } from './types-Bpq5fDI5.cjs';
|
|
2
2
|
import { g as SandboxOps } from './types-AujBIMMn.cjs';
|
|
3
3
|
import z$1, { z } from 'zod';
|
|
4
4
|
import { Sinks, proxyActivities } from '@temporalio/workflow';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ao as ToolMap, _ as SessionConfig, az as ZeitlichSession, Y as SandboxShutdown, ag as ThreadInit, X as SandboxInit, t as JsonSerializable, B as BaseAgentState, o as AgentStateManager, aB as ToolRouterOptions, ar as ToolRouter, R as RouterContext, J as JsonValue, at as ToolWithHandler, v as ParsedToolCallUnion, ap as ToolNames, a6 as SubagentDefinition, a9 as SubagentHooks, aa as SubagentSandboxConfig, a5 as SubagentConfig, ab as SubagentSandboxShutdown, ac as SubagentSessionInput, a7 as SubagentFnResult, a3 as SessionStartHook, $ as SessionEndHook, D as PostToolUseHook, y as PostToolUseFailureHook, a1 as SessionExitReason, ah as TokenUsage, F as FileEntryMetadata, av as VirtualFileTree, j as TreeMutation, r as FileEntry, aw as VirtualFsOps, g as SkillMetadata, h as Skill, b as ToolHandlerResponse, am as ToolHandler, ay as WorkflowTask, c as ActivityToolHandler } from './types-
|
|
1
|
+
import { ao as ToolMap, _ as SessionConfig, az as ZeitlichSession, Y as SandboxShutdown, ag as ThreadInit, X as SandboxInit, t as JsonSerializable, B as BaseAgentState, o as AgentStateManager, aB as ToolRouterOptions, ar as ToolRouter, R as RouterContext, J as JsonValue, at as ToolWithHandler, v as ParsedToolCallUnion, ap as ToolNames, a6 as SubagentDefinition, a9 as SubagentHooks, aa as SubagentSandboxConfig, a5 as SubagentConfig, ab as SubagentSandboxShutdown, ac as SubagentSessionInput, a7 as SubagentFnResult, a3 as SessionStartHook, $ as SessionEndHook, D as PostToolUseHook, y as PostToolUseFailureHook, a1 as SessionExitReason, ah as TokenUsage, F as FileEntryMetadata, av as VirtualFileTree, j as TreeMutation, r as FileEntry, aw as VirtualFsOps, g as SkillMetadata, h as Skill, b as ToolHandlerResponse, am as ToolHandler, ay as WorkflowTask, c as ActivityToolHandler } from './types-CheCTLeV.js';
|
|
2
2
|
import { g as SandboxOps } from './types-AujBIMMn.js';
|
|
3
3
|
import z$1, { z } from 'zod';
|
|
4
4
|
import { Sinks, proxyActivities } from '@temporalio/workflow';
|
package/dist/workflow.cjs
CHANGED
|
@@ -731,6 +731,7 @@ async function createSession({
|
|
|
731
731
|
appendHumanMessage,
|
|
732
732
|
initializeThread,
|
|
733
733
|
appendSystemMessage,
|
|
734
|
+
appendAgentMessage,
|
|
734
735
|
forkThread
|
|
735
736
|
} = threadOps;
|
|
736
737
|
const plugins = [];
|
|
@@ -852,6 +853,7 @@ async function createSession({
|
|
|
852
853
|
] : result.fileTree;
|
|
853
854
|
stateManager.mergeUpdate({
|
|
854
855
|
fileTree,
|
|
856
|
+
virtualFsCtx: virtualFsConfig.ctx,
|
|
855
857
|
...skillFiles && { inlineFiles: skillFiles }
|
|
856
858
|
});
|
|
857
859
|
}
|
|
@@ -905,6 +907,7 @@ async function createSession({
|
|
|
905
907
|
agentName,
|
|
906
908
|
metadata
|
|
907
909
|
});
|
|
910
|
+
await appendAgentMessage(threadId, workflow.uuid4(), message, threadKey);
|
|
908
911
|
if (usage) {
|
|
909
912
|
stateManager.updateUsage(usage);
|
|
910
913
|
}
|
|
@@ -1470,7 +1473,7 @@ function proxyVirtualFsOps(scope, options) {
|
|
|
1470
1473
|
}
|
|
1471
1474
|
}
|
|
1472
1475
|
);
|
|
1473
|
-
const prefix = resolvedScope
|
|
1476
|
+
const prefix = `virtualFs${resolvedScope.charAt(0).toUpperCase()}${resolvedScope.slice(1)}`;
|
|
1474
1477
|
const p = (key) => `${prefix}${key.charAt(0).toUpperCase()}${key.slice(1)}`;
|
|
1475
1478
|
return {
|
|
1476
1479
|
resolveFileTree: acts[p("resolveFileTree")]
|