zeitlich 0.2.17 → 0.2.19

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.
@@ -1,8 +1,8 @@
1
- import { F as FileEntryMetadata, V as VirtualSandboxCreateOptions, a as FileResolver, b as VirtualSandboxContext, T as TreeMutation, c as FileEntry, d as VirtualSandbox } from '../../../queries-DlJ3jE48.cjs';
2
- export { e as FileTreeAccessor, f as VirtualFileTree, g as VirtualSandboxFileSystem, h as VirtualSandboxState, i as filesWithMimeType, j as hasDirectory, k as hasFileWithMimeType } from '../../../queries-DlJ3jE48.cjs';
1
+ import { F as FileEntryMetadata, V as VirtualSandboxCreateOptions, a as FileResolver, b as VirtualSandboxContext, T as TreeMutation, c as FileEntry, d as VirtualSandbox } from '../../../queries-D22uWTOb.cjs';
2
+ export { e as FileTreeAccessor, f as VirtualFileTree, g as VirtualSandboxFileSystem, h as VirtualSandboxState, i as filesWithMimeType, j as hasDirectory, k as hasFileWithMimeType } from '../../../queries-D22uWTOb.cjs';
3
3
  import { b as SandboxProvider, c as SandboxCapabilities, e as SandboxCreateResult } from '../../../types-BMRzfELQ.cjs';
4
4
  import { WorkflowClient } from '@temporalio/client';
5
- import { A as ActivityToolHandler } from '../../../types-BMXzv7TN.cjs';
5
+ import { A as ActivityToolHandler } from '../../../types-DjT78Sdp.cjs';
6
6
  import '@temporalio/common';
7
7
  import 'zod';
8
8
 
@@ -1,8 +1,8 @@
1
- import { F as FileEntryMetadata, V as VirtualSandboxCreateOptions, a as FileResolver, b as VirtualSandboxContext, T as TreeMutation, c as FileEntry, d as VirtualSandbox } from '../../../queries-BlC1I3DK.js';
2
- export { e as FileTreeAccessor, f as VirtualFileTree, g as VirtualSandboxFileSystem, h as VirtualSandboxState, i as filesWithMimeType, j as hasDirectory, k as hasFileWithMimeType } from '../../../queries-BlC1I3DK.js';
1
+ import { F as FileEntryMetadata, V as VirtualSandboxCreateOptions, a as FileResolver, b as VirtualSandboxContext, T as TreeMutation, c as FileEntry, d as VirtualSandbox } from '../../../queries-D8T4pEeu.js';
2
+ export { e as FileTreeAccessor, f as VirtualFileTree, g as VirtualSandboxFileSystem, h as VirtualSandboxState, i as filesWithMimeType, j as hasDirectory, k as hasFileWithMimeType } from '../../../queries-D8T4pEeu.js';
3
3
  import { b as SandboxProvider, c as SandboxCapabilities, e as SandboxCreateResult } from '../../../types-BMRzfELQ.js';
4
4
  import { WorkflowClient } from '@temporalio/client';
5
- import { A as ActivityToolHandler } from '../../../types-BMXzv7TN.js';
5
+ import { A as ActivityToolHandler } from '../../../types-DjT78Sdp.js';
6
6
  import '@temporalio/common';
7
7
  import 'zod';
8
8
 
@@ -1,8 +1,8 @@
1
1
  import Redis from 'ioredis';
2
2
  import { Content, GoogleGenAI, Part } from '@google/genai';
3
- import { T as ThreadOps, M as ModelInvoker, a as ModelInvokerConfig, A as AgentResponse } from '../../../types-Bh-BbfCp.cjs';
3
+ import { T as ThreadOps, M as ModelInvoker, a as ModelInvokerConfig, A as AgentResponse } from '../../../types-CCfJb5Jl.cjs';
4
4
  import { B as BaseThreadManager } from '../../../types-35POpVfa.cjs';
5
- import { M as MessageContent, T as ToolMessageContent } from '../../../types-BMXzv7TN.cjs';
5
+ import { M as MessageContent, T as ToolMessageContent } from '../../../types-DjT78Sdp.cjs';
6
6
  import '@temporalio/common';
7
7
  import 'zod';
8
8
  import '../../../types-BMRzfELQ.cjs';
@@ -1,8 +1,8 @@
1
1
  import Redis from 'ioredis';
2
2
  import { Content, GoogleGenAI, Part } from '@google/genai';
3
- import { T as ThreadOps, M as ModelInvoker, a as ModelInvokerConfig, A as AgentResponse } from '../../../types-NkiAxU4t.js';
3
+ import { T as ThreadOps, M as ModelInvoker, a as ModelInvokerConfig, A as AgentResponse } from '../../../types-CxWLeJTB.js';
4
4
  import { B as BaseThreadManager } from '../../../types-35POpVfa.js';
5
- import { M as MessageContent, T as ToolMessageContent } from '../../../types-BMXzv7TN.js';
5
+ import { M as MessageContent, T as ToolMessageContent } from '../../../types-DjT78Sdp.js';
6
6
  import '@temporalio/common';
7
7
  import 'zod';
8
8
  import '../../../types-BMRzfELQ.js';
@@ -1,10 +1,10 @@
1
1
  import Redis from 'ioredis';
2
- import { T as ThreadOps, M as ModelInvoker, a as ModelInvokerConfig, A as AgentResponse } from '../../../types-Bh-BbfCp.cjs';
2
+ import { T as ThreadOps, M as ModelInvoker, a as ModelInvokerConfig, A as AgentResponse } from '../../../types-CCfJb5Jl.cjs';
3
3
  import { StoredMessage, MessageContent, $InferMessageContent, MessageStructure } from '@langchain/core/messages';
4
4
  import { BaseChatModel } from '@langchain/core/language_models/chat_models';
5
5
  import { B as BaseThreadManager } from '../../../types-35POpVfa.cjs';
6
6
  import '@temporalio/common';
7
- import '../../../types-BMXzv7TN.cjs';
7
+ import '../../../types-DjT78Sdp.cjs';
8
8
  import 'zod';
9
9
  import '../../../types-BMRzfELQ.cjs';
10
10
  import '@temporalio/workflow';
@@ -1,10 +1,10 @@
1
1
  import Redis from 'ioredis';
2
- import { T as ThreadOps, M as ModelInvoker, a as ModelInvokerConfig, A as AgentResponse } from '../../../types-NkiAxU4t.js';
2
+ import { T as ThreadOps, M as ModelInvoker, a as ModelInvokerConfig, A as AgentResponse } from '../../../types-CxWLeJTB.js';
3
3
  import { StoredMessage, MessageContent, $InferMessageContent, MessageStructure } from '@langchain/core/messages';
4
4
  import { BaseChatModel } from '@langchain/core/language_models/chat_models';
5
5
  import { B as BaseThreadManager } from '../../../types-35POpVfa.js';
6
6
  import '@temporalio/common';
7
- import '../../../types-BMXzv7TN.js';
7
+ import '../../../types-DjT78Sdp.js';
8
8
  import 'zod';
9
9
  import '../../../types-BMRzfELQ.js';
10
10
  import '@temporalio/workflow';
package/dist/index.cjs CHANGED
@@ -17,7 +17,8 @@ function createToolRouter(options) {
17
17
  for (const [_key, tool] of Object.entries(options.tools)) {
18
18
  toolMap.set(tool.name, tool);
19
19
  }
20
- const isEnabled = (tool) => tool.enabled ?? true;
20
+ const resolve = (v) => typeof v === "function" ? v() : v;
21
+ const isEnabled = (tool) => resolve(tool.enabled) ?? true;
21
22
  if (options.plugins) {
22
23
  for (const plugin of options.plugins) {
23
24
  toolMap.set(plugin.name, plugin);
@@ -168,7 +169,7 @@ function createToolRouter(options) {
168
169
  if (!tool || !isEnabled(tool)) {
169
170
  throw new Error(`Tool ${toolCall.name} not found`);
170
171
  }
171
- const parsedArgs = tool.schema.parse(toolCall.args);
172
+ const parsedArgs = resolve(tool.schema).parse(toolCall.args);
172
173
  return {
173
174
  id: toolCall.id ?? "",
174
175
  name: toolCall.name,
@@ -185,8 +186,8 @@ function createToolRouter(options) {
185
186
  getToolDefinitions() {
186
187
  return Array.from(toolMap).filter(([, tool]) => isEnabled(tool)).map(([name, tool]) => ({
187
188
  name,
188
- description: tool.description,
189
- schema: tool.schema,
189
+ description: resolve(tool.description),
190
+ schema: resolve(tool.schema),
190
191
  strict: tool.strict,
191
192
  max_uses: tool.max_uses
192
193
  }));
@@ -387,7 +388,9 @@ function createSubagentHandler(subagents) {
387
388
  // src/lib/subagent/register.ts
388
389
  function buildSubagentRegistration(subagents) {
389
390
  if (subagents.length === 0) return null;
390
- const getEnabled = () => subagents.filter((s) => s.enabled ?? true);
391
+ const getEnabled = () => subagents.filter(
392
+ (s) => typeof s.enabled === "function" ? s.enabled() : s.enabled ?? true
393
+ );
391
394
  const subagentHooksMap = /* @__PURE__ */ new Map();
392
395
  for (const s of subagents) {
393
396
  if (s.hooks) subagentHooksMap.set(s.agentName, s.hooks);
@@ -395,15 +398,9 @@ function buildSubagentRegistration(subagents) {
395
398
  const resolveSubagentName = (args) => args.subagent;
396
399
  return {
397
400
  name: SUBAGENT_TOOL_NAME,
398
- get enabled() {
399
- return getEnabled().length > 0;
400
- },
401
- get description() {
402
- return createSubagentTool(getEnabled()).description;
403
- },
404
- get schema() {
405
- return createSubagentTool(getEnabled()).schema;
406
- },
401
+ enabled: () => getEnabled().length > 0,
402
+ description: () => createSubagentTool(getEnabled()).description,
403
+ schema: () => createSubagentTool(getEnabled()).schema,
407
404
  handler: createSubagentHandler(subagents),
408
405
  ...subagentHooksMap.size > 0 && {
409
406
  hooks: {