zeitlich 0.2.18 → 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.
- package/dist/adapters/sandbox/virtual/index.d.cts +3 -3
- package/dist/adapters/sandbox/virtual/index.d.ts +3 -3
- package/dist/adapters/thread/google-genai/index.d.cts +2 -2
- package/dist/adapters/thread/google-genai/index.d.ts +2 -2
- package/dist/adapters/thread/langchain/index.d.cts +2 -2
- package/dist/adapters/thread/langchain/index.d.ts +2 -2
- package/dist/index.cjs +8 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +8 -13
- package/dist/index.js.map +1 -1
- package/dist/{queries-DnX72m_Y.d.cts → queries-D22uWTOb.d.cts} +1 -1
- package/dist/{queries-TwukRZ8b.d.ts → queries-D8T4pEeu.d.ts} +1 -1
- package/dist/{types-DRvq2miV.d.cts → types-CCfJb5Jl.d.cts} +1 -1
- package/dist/{types-CdB2D5Sq.d.ts → types-CxWLeJTB.d.ts} +1 -1
- package/dist/{types-CmOSypVk.d.ts → types-DjT78Sdp.d.cts} +2 -2
- package/dist/{types-CmOSypVk.d.cts → types-DjT78Sdp.d.ts} +2 -2
- package/dist/workflow.cjs +8 -13
- package/dist/workflow.cjs.map +1 -1
- package/dist/workflow.d.cts +6 -6
- package/dist/workflow.d.ts +6 -6
- package/dist/workflow.js +8 -13
- package/dist/workflow.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/subagent/register.ts +3 -9
- package/src/lib/subagent/subagent.integration.test.ts +5 -5
- package/src/lib/tool-router/router.ts +7 -5
- package/src/lib/tool-router/types.ts +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as SandboxFileSystem, F as FileStat, D as DirentEntry, S as Sandbox, d as SandboxCreateOptions } from './types-BMRzfELQ.cjs';
|
|
2
|
-
import { R as RouterContext } from './types-
|
|
2
|
+
import { R as RouterContext } from './types-DjT78Sdp.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Ephemeral {@link SandboxFileSystem} backed by a {@link FileResolver}.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as SandboxFileSystem, F as FileStat, D as DirentEntry, S as Sandbox, d as SandboxCreateOptions } from './types-BMRzfELQ.js';
|
|
2
|
-
import { R as RouterContext } from './types-
|
|
2
|
+
import { R as RouterContext } from './types-DjT78Sdp.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Ephemeral {@link SandboxFileSystem} backed by a {@link FileResolver}.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Duration } from '@temporalio/common';
|
|
2
|
-
import { a as ToolMap, b as ToolRouterHooks, M as MessageContent, S as SessionExitReason, c as ToolHandlerResponse, P as PreToolUseHookResult, d as PostToolUseFailureHookResult, e as RawToolCall, f as TokenUsage, B as BaseAgentState, g as RunAgentConfig, h as AgentStatus, W as WorkflowTask, i as ToolDefinition, j as ToolResultConfig, k as ToolCallResultUnion, I as InferToolResults } from './types-
|
|
2
|
+
import { a as ToolMap, b as ToolRouterHooks, M as MessageContent, S as SessionExitReason, c as ToolHandlerResponse, P as PreToolUseHookResult, d as PostToolUseFailureHookResult, e as RawToolCall, f as TokenUsage, B as BaseAgentState, g as RunAgentConfig, h as AgentStatus, W as WorkflowTask, i as ToolDefinition, j as ToolResultConfig, k as ToolCallResultUnion, I as InferToolResults } from './types-DjT78Sdp.cjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { g as SandboxOps } from './types-BMRzfELQ.cjs';
|
|
5
5
|
import { QueryDefinition } from '@temporalio/workflow';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Duration } from '@temporalio/common';
|
|
2
|
-
import { a as ToolMap, b as ToolRouterHooks, M as MessageContent, S as SessionExitReason, c as ToolHandlerResponse, P as PreToolUseHookResult, d as PostToolUseFailureHookResult, e as RawToolCall, f as TokenUsage, B as BaseAgentState, g as RunAgentConfig, h as AgentStatus, W as WorkflowTask, i as ToolDefinition, j as ToolResultConfig, k as ToolCallResultUnion, I as InferToolResults } from './types-
|
|
2
|
+
import { a as ToolMap, b as ToolRouterHooks, M as MessageContent, S as SessionExitReason, c as ToolHandlerResponse, P as PreToolUseHookResult, d as PostToolUseFailureHookResult, e as RawToolCall, f as TokenUsage, B as BaseAgentState, g as RunAgentConfig, h as AgentStatus, W as WorkflowTask, i as ToolDefinition, j as ToolResultConfig, k as ToolCallResultUnion, I as InferToolResults } from './types-DjT78Sdp.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { g as SandboxOps } from './types-BMRzfELQ.js';
|
|
5
5
|
import { QueryDefinition } from '@temporalio/workflow';
|
|
@@ -162,8 +162,8 @@ interface ToolWithHandler<TName extends string = string, TSchema extends z.ZodTy
|
|
|
162
162
|
*/
|
|
163
163
|
type ToolMap = Record<string, {
|
|
164
164
|
name: string;
|
|
165
|
-
description: string;
|
|
166
|
-
schema: z.ZodType;
|
|
165
|
+
description: string | (() => string);
|
|
166
|
+
schema: z.ZodType | (() => z.ZodType);
|
|
167
167
|
handler: ToolHandler<any, any, any>;
|
|
168
168
|
strict?: boolean;
|
|
169
169
|
max_uses?: number;
|
|
@@ -162,8 +162,8 @@ interface ToolWithHandler<TName extends string = string, TSchema extends z.ZodTy
|
|
|
162
162
|
*/
|
|
163
163
|
type ToolMap = Record<string, {
|
|
164
164
|
name: string;
|
|
165
|
-
description: string;
|
|
166
|
-
schema: z.ZodType;
|
|
165
|
+
description: string | (() => string);
|
|
166
|
+
schema: z.ZodType | (() => z.ZodType);
|
|
167
167
|
handler: ToolHandler<any, any, any>;
|
|
168
168
|
strict?: boolean;
|
|
169
169
|
max_uses?: number;
|
package/dist/workflow.cjs
CHANGED
|
@@ -15,7 +15,8 @@ function createToolRouter(options) {
|
|
|
15
15
|
for (const [_key, tool] of Object.entries(options.tools)) {
|
|
16
16
|
toolMap.set(tool.name, tool);
|
|
17
17
|
}
|
|
18
|
-
const
|
|
18
|
+
const resolve = (v) => typeof v === "function" ? v() : v;
|
|
19
|
+
const isEnabled = (tool) => resolve(tool.enabled) ?? true;
|
|
19
20
|
if (options.plugins) {
|
|
20
21
|
for (const plugin of options.plugins) {
|
|
21
22
|
toolMap.set(plugin.name, plugin);
|
|
@@ -166,7 +167,7 @@ function createToolRouter(options) {
|
|
|
166
167
|
if (!tool || !isEnabled(tool)) {
|
|
167
168
|
throw new Error(`Tool ${toolCall.name} not found`);
|
|
168
169
|
}
|
|
169
|
-
const parsedArgs = tool.schema.parse(toolCall.args);
|
|
170
|
+
const parsedArgs = resolve(tool.schema).parse(toolCall.args);
|
|
170
171
|
return {
|
|
171
172
|
id: toolCall.id ?? "",
|
|
172
173
|
name: toolCall.name,
|
|
@@ -183,8 +184,8 @@ function createToolRouter(options) {
|
|
|
183
184
|
getToolDefinitions() {
|
|
184
185
|
return Array.from(toolMap).filter(([, tool]) => isEnabled(tool)).map(([name, tool]) => ({
|
|
185
186
|
name,
|
|
186
|
-
description: tool.description,
|
|
187
|
-
schema: tool.schema,
|
|
187
|
+
description: resolve(tool.description),
|
|
188
|
+
schema: resolve(tool.schema),
|
|
188
189
|
strict: tool.strict,
|
|
189
190
|
max_uses: tool.max_uses
|
|
190
191
|
}));
|
|
@@ -395,15 +396,9 @@ function buildSubagentRegistration(subagents) {
|
|
|
395
396
|
const resolveSubagentName = (args) => args.subagent;
|
|
396
397
|
return {
|
|
397
398
|
name: SUBAGENT_TOOL_NAME,
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
get description() {
|
|
402
|
-
return createSubagentTool(getEnabled()).description;
|
|
403
|
-
},
|
|
404
|
-
get schema() {
|
|
405
|
-
return createSubagentTool(getEnabled()).schema;
|
|
406
|
-
},
|
|
399
|
+
enabled: () => getEnabled().length > 0,
|
|
400
|
+
description: () => createSubagentTool(getEnabled()).description,
|
|
401
|
+
schema: () => createSubagentTool(getEnabled()).schema,
|
|
407
402
|
handler: createSubagentHandler(subagents),
|
|
408
403
|
...subagentHooksMap.size > 0 && {
|
|
409
404
|
hooks: {
|