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.
Files changed (87) hide show
  1. package/README.md +11 -10
  2. package/dist/{activities-DRSdt8Y3.d.ts → activities-YBD5BaHh.d.ts} +6 -5
  3. package/dist/{activities-qPkJDAiq.d.cts → activities-fnX8-vhR.d.cts} +6 -5
  4. package/dist/adapters/thread/anthropic/index.cjs +19 -47
  5. package/dist/adapters/thread/anthropic/index.cjs.map +1 -1
  6. package/dist/adapters/thread/anthropic/index.d.cts +12 -11
  7. package/dist/adapters/thread/anthropic/index.d.ts +12 -11
  8. package/dist/adapters/thread/anthropic/index.js +19 -47
  9. package/dist/adapters/thread/anthropic/index.js.map +1 -1
  10. package/dist/adapters/thread/anthropic/workflow.cjs +1 -0
  11. package/dist/adapters/thread/anthropic/workflow.cjs.map +1 -1
  12. package/dist/adapters/thread/anthropic/workflow.d.cts +4 -4
  13. package/dist/adapters/thread/anthropic/workflow.d.ts +4 -4
  14. package/dist/adapters/thread/anthropic/workflow.js +1 -0
  15. package/dist/adapters/thread/anthropic/workflow.js.map +1 -1
  16. package/dist/adapters/thread/google-genai/index.cjs +34 -53
  17. package/dist/adapters/thread/google-genai/index.cjs.map +1 -1
  18. package/dist/adapters/thread/google-genai/index.d.cts +8 -8
  19. package/dist/adapters/thread/google-genai/index.d.ts +8 -8
  20. package/dist/adapters/thread/google-genai/index.js +34 -53
  21. package/dist/adapters/thread/google-genai/index.js.map +1 -1
  22. package/dist/adapters/thread/google-genai/workflow.cjs +1 -0
  23. package/dist/adapters/thread/google-genai/workflow.cjs.map +1 -1
  24. package/dist/adapters/thread/google-genai/workflow.d.cts +4 -4
  25. package/dist/adapters/thread/google-genai/workflow.d.ts +4 -4
  26. package/dist/adapters/thread/google-genai/workflow.js +1 -0
  27. package/dist/adapters/thread/google-genai/workflow.js.map +1 -1
  28. package/dist/adapters/thread/langchain/index.cjs +47 -24
  29. package/dist/adapters/thread/langchain/index.cjs.map +1 -1
  30. package/dist/adapters/thread/langchain/index.d.cts +13 -10
  31. package/dist/adapters/thread/langchain/index.d.ts +13 -10
  32. package/dist/adapters/thread/langchain/index.js +47 -24
  33. package/dist/adapters/thread/langchain/index.js.map +1 -1
  34. package/dist/adapters/thread/langchain/workflow.cjs +1 -0
  35. package/dist/adapters/thread/langchain/workflow.cjs.map +1 -1
  36. package/dist/adapters/thread/langchain/workflow.d.cts +4 -4
  37. package/dist/adapters/thread/langchain/workflow.d.ts +4 -4
  38. package/dist/adapters/thread/langchain/workflow.js +1 -0
  39. package/dist/adapters/thread/langchain/workflow.js.map +1 -1
  40. package/dist/index.cjs +42 -9
  41. package/dist/index.cjs.map +1 -1
  42. package/dist/index.d.cts +28 -13
  43. package/dist/index.d.ts +28 -13
  44. package/dist/index.js +41 -10
  45. package/dist/index.js.map +1 -1
  46. package/dist/{proxy-BkvkV2oU.d.ts → proxy-Br4unLTC.d.ts} +1 -1
  47. package/dist/{proxy-BDQ3Rj6R.d.cts → proxy-CTCYWjkr.d.cts} +1 -1
  48. package/dist/{thread-manager-BLgvv9Gf.d.cts → thread-manager-CUubPYPH.d.cts} +1 -1
  49. package/dist/{thread-manager-DowU4ntB.d.cts → thread-manager-Cv_BR28i.d.cts} +1 -1
  50. package/dist/{thread-manager-Cv82H1wi.d.ts → thread-manager-DKWxHUzD.d.ts} +1 -1
  51. package/dist/{thread-manager-HsAYkyAV.d.ts → thread-manager-YJLoc1vH.d.ts} +1 -1
  52. package/dist/{types-CjeGWQm1.d.cts → types-Bpq5fDI5.d.cts} +7 -4
  53. package/dist/{types-D6UKZZtj.d.ts → types-BxiT8w9d.d.ts} +1 -1
  54. package/dist/{types-BmS-Huc0.d.ts → types-CheCTLeV.d.ts} +7 -4
  55. package/dist/{types-e_38QaKo.d.cts → types-NJDyMyUx.d.cts} +1 -1
  56. package/dist/{workflow-CTcrPZAV.d.ts → workflow-D9nNERvs.d.ts} +30 -2
  57. package/dist/{workflow-CNshfqSO.d.cts → workflow-Od9vx5Jk.d.cts} +30 -2
  58. package/dist/workflow.cjs +22 -1
  59. package/dist/workflow.cjs.map +1 -1
  60. package/dist/workflow.d.cts +2 -2
  61. package/dist/workflow.d.ts +2 -2
  62. package/dist/workflow.js +22 -2
  63. package/dist/workflow.js.map +1 -1
  64. package/package.json +1 -1
  65. package/src/adapters/thread/anthropic/activities.ts +14 -3
  66. package/src/adapters/thread/anthropic/model-invoker.ts +15 -8
  67. package/src/adapters/thread/google-genai/activities.ts +18 -3
  68. package/src/adapters/thread/google-genai/model-invoker.ts +24 -14
  69. package/src/adapters/thread/langchain/activities.ts +14 -3
  70. package/src/adapters/thread/langchain/model-invoker.ts +63 -35
  71. package/src/index.ts +1 -0
  72. package/src/lib/activity.ts +36 -9
  73. package/src/lib/model/helpers.ts +1 -0
  74. package/src/lib/model/index.ts +1 -0
  75. package/src/lib/model/proxy.ts +50 -0
  76. package/src/lib/model/types.ts +3 -2
  77. package/src/lib/session/session-edge-cases.integration.test.ts +6 -0
  78. package/src/lib/session/session.integration.test.ts +3 -0
  79. package/src/lib/session/session.ts +4 -0
  80. package/src/lib/session/types.ts +7 -0
  81. package/src/lib/thread/proxy.ts +1 -0
  82. package/src/lib/types.ts +1 -0
  83. package/src/lib/virtual-fs/manager.ts +3 -3
  84. package/src/lib/virtual-fs/proxy.ts +3 -3
  85. package/src/lib/virtual-fs/types.ts +1 -2
  86. package/src/lib/virtual-fs/with-virtual-fs.ts +4 -4
  87. package/src/workflow.ts +3 -0
@@ -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
- ctx: TCtx;
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, ctx, workspaceBase, inlineFiles } = state;
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
- ctx,
81
- workspaceBase ?? "/",
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,