zeitlich 0.2.31 → 0.2.33
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/README.md +11 -10
- package/dist/{activities-DRSdt8Y3.d.ts → activities-YBD5BaHh.d.ts} +6 -5
- package/dist/{activities-qPkJDAiq.d.cts → activities-fnX8-vhR.d.cts} +6 -5
- package/dist/adapters/thread/anthropic/index.cjs +19 -47
- package/dist/adapters/thread/anthropic/index.cjs.map +1 -1
- package/dist/adapters/thread/anthropic/index.d.cts +12 -11
- package/dist/adapters/thread/anthropic/index.d.ts +12 -11
- package/dist/adapters/thread/anthropic/index.js +19 -47
- 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 +34 -53
- package/dist/adapters/thread/google-genai/index.cjs.map +1 -1
- package/dist/adapters/thread/google-genai/index.d.cts +8 -8
- package/dist/adapters/thread/google-genai/index.d.ts +8 -8
- package/dist/adapters/thread/google-genai/index.js +34 -53
- 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 +47 -24
- package/dist/adapters/thread/langchain/index.cjs.map +1 -1
- package/dist/adapters/thread/langchain/index.d.cts +13 -10
- package/dist/adapters/thread/langchain/index.d.ts +13 -10
- package/dist/adapters/thread/langchain/index.js +47 -24
- 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 +42 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -13
- package/dist/index.d.ts +28 -13
- package/dist/index.js +41 -10
- 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-CTcrPZAV.d.ts → workflow-D9nNERvs.d.ts} +30 -2
- package/dist/{workflow-CNshfqSO.d.cts → workflow-Od9vx5Jk.d.cts} +30 -2
- package/dist/workflow.cjs +22 -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 +22 -2
- package/dist/workflow.js.map +1 -1
- package/package.json +1 -1
- package/src/adapters/thread/anthropic/activities.ts +14 -3
- package/src/adapters/thread/anthropic/model-invoker.ts +15 -8
- package/src/adapters/thread/google-genai/activities.ts +18 -3
- package/src/adapters/thread/google-genai/model-invoker.ts +24 -14
- package/src/adapters/thread/langchain/activities.ts +14 -3
- package/src/adapters/thread/langchain/model-invoker.ts +63 -35
- package/src/index.ts +1 -0
- package/src/lib/activity.ts +36 -9
- package/src/lib/model/helpers.ts +1 -0
- package/src/lib/model/index.ts +1 -0
- package/src/lib/model/proxy.ts +50 -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/workflow.ts +3 -0
package/src/lib/thread/proxy.ts
CHANGED
|
@@ -51,6 +51,7 @@ export function createThreadOpsProxy(
|
|
|
51
51
|
initializeThread: acts[p("initializeThread")],
|
|
52
52
|
appendHumanMessage: acts[p("appendHumanMessage")],
|
|
53
53
|
appendToolResult: acts[p("appendToolResult")],
|
|
54
|
+
appendAgentMessage: acts[p("appendAgentMessage")],
|
|
54
55
|
appendSystemMessage: acts[p("appendSystemMessage")],
|
|
55
56
|
forkThread: acts[p("forkThread")],
|
|
56
57
|
} as ActivityInterfaceFor<ThreadOps>;
|
package/src/lib/types.ts
CHANGED
|
@@ -27,6 +27,7 @@ export interface BaseAgentState {
|
|
|
27
27
|
fileTree: FileEntry[];
|
|
28
28
|
/** In-memory file contents keyed by path, bypassing the resolver (e.g. skill resources). */
|
|
29
29
|
inlineFiles?: Record<string, string>;
|
|
30
|
+
virtualFsCtx?: unknown;
|
|
30
31
|
systemPrompt?: string;
|
|
31
32
|
totalInputTokens: number;
|
|
32
33
|
totalOutputTokens: number;
|
|
@@ -30,7 +30,7 @@ export function createVirtualFsActivities<
|
|
|
30
30
|
TMeta = FileEntryMetadata,
|
|
31
31
|
>(
|
|
32
32
|
resolver: FileResolver<TCtx, TMeta>,
|
|
33
|
-
scope: S
|
|
33
|
+
scope: S
|
|
34
34
|
): PrefixedVirtualFsOps<S, TCtx, TMeta> {
|
|
35
35
|
const ops: VirtualFsOps<TCtx, TMeta> = {
|
|
36
36
|
resolveFileTree: async (ctx: TCtx) => {
|
|
@@ -39,10 +39,10 @@ export function createVirtualFsActivities<
|
|
|
39
39
|
},
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
const prefix = scope
|
|
42
|
+
const prefix = `virtualFs${scope.charAt(0).toUpperCase()}${scope.slice(1)}`;
|
|
43
43
|
const cap = (s: string): string => s.charAt(0).toUpperCase() + s.slice(1);
|
|
44
44
|
|
|
45
45
|
return Object.fromEntries(
|
|
46
|
-
Object.entries(ops).map(([k, v]) => [`${prefix}${cap(k)}`, v])
|
|
46
|
+
Object.entries(ops).map(([k, v]) => [`${prefix}${cap(k)}`, v])
|
|
47
47
|
) as PrefixedVirtualFsOps<S, TCtx, TMeta>;
|
|
48
48
|
}
|
|
@@ -18,7 +18,7 @@ import type { VirtualFsOps } from "./types";
|
|
|
18
18
|
|
|
19
19
|
export function proxyVirtualFsOps<TCtx = unknown>(
|
|
20
20
|
scope?: string,
|
|
21
|
-
options?: Parameters<typeof proxyActivities>[0]
|
|
21
|
+
options?: Parameters<typeof proxyActivities>[0]
|
|
22
22
|
): VirtualFsOps<TCtx> {
|
|
23
23
|
const resolvedScope = scope ?? workflowInfo().workflowType;
|
|
24
24
|
|
|
@@ -32,10 +32,10 @@ export function proxyVirtualFsOps<TCtx = unknown>(
|
|
|
32
32
|
maximumInterval: "30s",
|
|
33
33
|
backoffCoefficient: 2,
|
|
34
34
|
},
|
|
35
|
-
}
|
|
35
|
+
}
|
|
36
36
|
);
|
|
37
37
|
|
|
38
|
-
const prefix = resolvedScope
|
|
38
|
+
const prefix = `virtualFs${resolvedScope.charAt(0).toUpperCase()}${resolvedScope.slice(1)}`;
|
|
39
39
|
const p = (key: string): string =>
|
|
40
40
|
`${prefix}${key.charAt(0).toUpperCase()}${key.slice(1)}`;
|
|
41
41
|
|
|
@@ -118,8 +118,7 @@ export type PrefixedVirtualFsOps<
|
|
|
118
118
|
*/
|
|
119
119
|
export interface VirtualFsState<TCtx = unknown, TMeta = FileEntryMetadata> {
|
|
120
120
|
fileTree: FileEntry<TMeta>[];
|
|
121
|
-
|
|
122
|
-
workspaceBase?: string;
|
|
121
|
+
virtualFsCtx: TCtx;
|
|
123
122
|
/** In-memory file contents keyed by path, bypassing the resolver (e.g. skill resources). */
|
|
124
123
|
inlineFiles?: Record<string, string>;
|
|
125
124
|
}
|
|
@@ -66,7 +66,7 @@ export function withVirtualFs<
|
|
|
66
66
|
const state =
|
|
67
67
|
await queryParentWorkflowState<VirtualFsState<TCtx, TMeta>>(client);
|
|
68
68
|
|
|
69
|
-
const { fileTree,
|
|
69
|
+
const { fileTree, virtualFsCtx, inlineFiles } = state;
|
|
70
70
|
if (!fileTree) {
|
|
71
71
|
return {
|
|
72
72
|
toolResponse: `Error: No fileTree in agent state. The ${context.toolName} tool requires a virtual filesystem.`,
|
|
@@ -77,9 +77,9 @@ export function withVirtualFs<
|
|
|
77
77
|
const virtualFs = new VirtualFileSystem(
|
|
78
78
|
fileTree,
|
|
79
79
|
resolver,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
inlineFiles
|
|
80
|
+
virtualFsCtx,
|
|
81
|
+
"/",
|
|
82
|
+
inlineFiles
|
|
83
83
|
);
|
|
84
84
|
const response = await handler(args, { ...context, virtualFs });
|
|
85
85
|
const mutations = virtualFs.getMutations();
|
package/src/workflow.ts
CHANGED
|
@@ -133,6 +133,9 @@ export type {
|
|
|
133
133
|
ModelInvokerConfig,
|
|
134
134
|
} from "./lib/model";
|
|
135
135
|
|
|
136
|
+
// Model proxy (workflow-safe proxy with LLM-optimised defaults)
|
|
137
|
+
export { proxyRunAgent } from "./lib/model/proxy";
|
|
138
|
+
|
|
136
139
|
// Subagent types
|
|
137
140
|
export type {
|
|
138
141
|
SubagentConfig,
|