zeitlich 0.2.5 → 0.2.7
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/index.cjs +142 -97
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -11
- package/dist/index.d.ts +4 -11
- package/dist/index.js +121 -75
- package/dist/index.js.map +1 -1
- package/dist/{workflow-Dg5JMeOC.d.cts → workflow-CyYHDbrr.d.cts} +86 -26
- package/dist/{workflow-Dg5JMeOC.d.ts → workflow-CyYHDbrr.d.ts} +86 -26
- package/dist/workflow.cjs +132 -82
- package/dist/workflow.cjs.map +1 -1
- package/dist/workflow.d.cts +1 -1
- package/dist/workflow.d.ts +1 -1
- package/dist/workflow.js +109 -60
- package/dist/workflow.js.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +0 -2
- package/src/lib/model-invoker.ts +2 -3
- package/src/lib/session.ts +42 -5
- package/src/lib/state-manager.ts +28 -7
- package/src/lib/thread-manager.ts +13 -0
- package/src/lib/types.ts +56 -3
- package/src/tools/ask-user-question/handler.ts +19 -20
- package/src/workflow.ts +5 -3
|
@@ -2,7 +2,7 @@ import { Workflow, proxyActivities } from '@temporalio/workflow';
|
|
|
2
2
|
import Redis from 'ioredis';
|
|
3
3
|
import { $InferMessageContent, MessageStructure, StoredMessage, MessageContent } from '@langchain/core/messages';
|
|
4
4
|
import z, { z as z$1 } from 'zod';
|
|
5
|
-
import
|
|
5
|
+
import { Duration } from '@temporalio/common';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Content for a tool message response.
|
|
@@ -509,16 +509,27 @@ interface ThreadOps {
|
|
|
509
509
|
appendSystemMessage(threadId: string, content: string): Promise<void>;
|
|
510
510
|
}
|
|
511
511
|
/**
|
|
512
|
-
* Configuration for a Zeitlich agent
|
|
512
|
+
* Configuration for a Zeitlich agent
|
|
513
513
|
*/
|
|
514
|
-
interface
|
|
515
|
-
|
|
514
|
+
interface AgentConfig {
|
|
515
|
+
/** The name of the agent, should be unique within the workflows, ideally Pascal Case */
|
|
516
516
|
agentName: string;
|
|
517
517
|
/** Description, used for sub agents */
|
|
518
518
|
description?: string;
|
|
519
|
+
/** The system prompt to append to the thread */
|
|
519
520
|
systemPrompt?: string;
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* Configuration for a Zeitlich agent session
|
|
524
|
+
*/
|
|
525
|
+
interface SessionConfig<T extends ToolMap, M = StoredMessage> {
|
|
526
|
+
/** The thread ID to use for the session */
|
|
527
|
+
threadId: string;
|
|
528
|
+
/** Metadata for the session */
|
|
520
529
|
metadata?: Record<string, unknown>;
|
|
530
|
+
/** Whether to append the system prompt as message to the thread */
|
|
521
531
|
appendSystemPrompt?: boolean;
|
|
532
|
+
/** How many turns to run the session for */
|
|
522
533
|
maxTurns?: number;
|
|
523
534
|
/** Workflow-specific runAgent activity (with tools pre-bound) */
|
|
524
535
|
runAgent: RunAgentActivity<M>;
|
|
@@ -537,6 +548,8 @@ interface ZeitlichAgentConfig<T extends ToolMap, M = StoredMessage> {
|
|
|
537
548
|
* Returns MessageContent array for the initial HumanMessage.
|
|
538
549
|
*/
|
|
539
550
|
buildContextMessage: () => MessageContent | Promise<MessageContent>;
|
|
551
|
+
/** How long to wait for input before cancelling the workflow */
|
|
552
|
+
waitForInputTimeout?: Duration;
|
|
540
553
|
}
|
|
541
554
|
/**
|
|
542
555
|
* A JSON-serializable tool definition for state storage.
|
|
@@ -745,6 +758,32 @@ interface SessionStartHookContext {
|
|
|
745
758
|
* SessionStart hook - called when session begins
|
|
746
759
|
*/
|
|
747
760
|
type SessionStartHook = (ctx: SessionStartHookContext) => void | Promise<void>;
|
|
761
|
+
/**
|
|
762
|
+
* Context for PreHumanMessageAppend hook - called before each human message is appended to the thread
|
|
763
|
+
*/
|
|
764
|
+
interface PreHumanMessageAppendHookContext {
|
|
765
|
+
/** The message about to be appended */
|
|
766
|
+
message: MessageContent;
|
|
767
|
+
/** Thread identifier */
|
|
768
|
+
threadId: string;
|
|
769
|
+
}
|
|
770
|
+
/**
|
|
771
|
+
* PreHumanMessageAppend hook - called before each human message is appended to the thread
|
|
772
|
+
*/
|
|
773
|
+
type PreHumanMessageAppendHook = (ctx: PreHumanMessageAppendHookContext) => void | Promise<void>;
|
|
774
|
+
/**
|
|
775
|
+
* PostHumanMessageAppend hook - called after each human message is appended to the thread
|
|
776
|
+
*/
|
|
777
|
+
type PostHumanMessageAppendHook = (ctx: PostHumanMessageAppendHookContext) => void | Promise<void>;
|
|
778
|
+
/**
|
|
779
|
+
* Context for PostHumanMessageAppend hook - called after each human message is appended to the thread
|
|
780
|
+
*/
|
|
781
|
+
interface PostHumanMessageAppendHookContext {
|
|
782
|
+
/** The message that was appended */
|
|
783
|
+
message: MessageContent;
|
|
784
|
+
/** Thread identifier */
|
|
785
|
+
threadId: string;
|
|
786
|
+
}
|
|
748
787
|
/**
|
|
749
788
|
* Context for SessionEnd hook - called when session ends
|
|
750
789
|
*/
|
|
@@ -795,6 +834,10 @@ interface ToolHooks<TArgs = unknown, TResult = unknown> {
|
|
|
795
834
|
* Combined hooks interface for session lifecycle
|
|
796
835
|
*/
|
|
797
836
|
interface Hooks<T extends ToolMap, TResult = unknown> {
|
|
837
|
+
/** Called before each human message is appended to the thread */
|
|
838
|
+
onPreHumanMessageAppend?: PreHumanMessageAppendHook;
|
|
839
|
+
/** Called after each human message is appended to the thread */
|
|
840
|
+
onPostHumanMessageAppend?: PostHumanMessageAppendHook;
|
|
798
841
|
/** Called before each tool execution - can block or modify */
|
|
799
842
|
onPreToolUse?: PreToolUseHook<T>;
|
|
800
843
|
/** Called after each successful tool execution */
|
|
@@ -885,7 +928,6 @@ interface AgentStateManager<TCustom extends JsonSerializable<TCustom>> {
|
|
|
885
928
|
/** Set the tools (converts Zod schemas to JSON Schema for serialization) */
|
|
886
929
|
setTools(newTools: ToolDefinition[]): void;
|
|
887
930
|
}
|
|
888
|
-
declare const getStateQuery: _temporalio_common.QueryDefinition<BaseAgentState, [], string>;
|
|
889
931
|
/**
|
|
890
932
|
* Creates an agent state manager for tracking workflow state.
|
|
891
933
|
*
|
|
@@ -896,7 +938,10 @@ declare const getStateQuery: _temporalio_common.QueryDefinition<BaseAgentState,
|
|
|
896
938
|
* in the workflow file using defineQuery/defineUpdate and setHandler.
|
|
897
939
|
* This manager provides the state and logic needed for those handlers.
|
|
898
940
|
*/
|
|
899
|
-
declare function createAgentStateManager<TCustom extends JsonSerializable<TCustom> = Record<string, never>>(initialState
|
|
941
|
+
declare function createAgentStateManager<TCustom extends JsonSerializable<TCustom> = Record<string, never>>({ initialState, agentConfig, }: {
|
|
942
|
+
initialState?: Partial<BaseAgentState> & TCustom;
|
|
943
|
+
agentConfig: AgentConfig;
|
|
944
|
+
}): AgentStateManager<TCustom>;
|
|
900
945
|
/**
|
|
901
946
|
* Handler names used across agents
|
|
902
947
|
*/
|
|
@@ -920,7 +965,7 @@ interface SessionLifecycleHooks {
|
|
|
920
965
|
/** Called when session ends */
|
|
921
966
|
onSessionEnd?: SessionEndHook;
|
|
922
967
|
}
|
|
923
|
-
declare const createSession: <T extends ToolMap, M = unknown>({ threadId, agentName, maxTurns, metadata, runAgent, threadOps, buildContextMessage, subagents, tools, processToolsInParallel, hooks, appendSystemPrompt, systemPrompt, }:
|
|
968
|
+
declare const createSession: <T extends ToolMap, M = unknown>({ threadId, agentName, maxTurns, metadata, runAgent, threadOps, buildContextMessage, subagents, tools, processToolsInParallel, hooks, appendSystemPrompt, systemPrompt, waitForInputTimeout, }: SessionConfig<T, M> & AgentConfig) => Promise<ZeitlichSession<M>>;
|
|
924
969
|
/**
|
|
925
970
|
* Proxy the default ZeitlichSharedActivities as ThreadOps<StoredMessage>.
|
|
926
971
|
* Call this in workflow code for the standard LangChain/StoredMessage setup.
|
|
@@ -971,24 +1016,6 @@ interface ZeitlichSharedActivities {
|
|
|
971
1016
|
*/
|
|
972
1017
|
declare function createSharedActivities(redis: Redis): ZeitlichSharedActivities;
|
|
973
1018
|
|
|
974
|
-
declare const askUserQuestionTool: {
|
|
975
|
-
name: "AskUserQuestion";
|
|
976
|
-
description: string;
|
|
977
|
-
schema: z.ZodObject<{
|
|
978
|
-
questions: z.ZodArray<z.ZodObject<{
|
|
979
|
-
question: z.ZodString;
|
|
980
|
-
header: z.ZodString;
|
|
981
|
-
options: z.ZodArray<z.ZodObject<{
|
|
982
|
-
label: z.ZodString;
|
|
983
|
-
description: z.ZodString;
|
|
984
|
-
}, z.core.$strip>>;
|
|
985
|
-
multiSelect: z.ZodBoolean;
|
|
986
|
-
}, z.core.$strip>>;
|
|
987
|
-
}, z.core.$strip>;
|
|
988
|
-
strict: true;
|
|
989
|
-
};
|
|
990
|
-
type AskUserQuestionArgs = z.infer<typeof askUserQuestionTool.schema>;
|
|
991
|
-
|
|
992
1019
|
declare const globTool: {
|
|
993
1020
|
name: "Glob";
|
|
994
1021
|
description: string;
|
|
@@ -1140,4 +1167,37 @@ declare const bashTool: {
|
|
|
1140
1167
|
};
|
|
1141
1168
|
type BashArgs = z.infer<typeof bashTool.schema>;
|
|
1142
1169
|
|
|
1143
|
-
|
|
1170
|
+
declare const askUserQuestionTool: {
|
|
1171
|
+
name: "AskUserQuestion";
|
|
1172
|
+
description: string;
|
|
1173
|
+
schema: z.ZodObject<{
|
|
1174
|
+
questions: z.ZodArray<z.ZodObject<{
|
|
1175
|
+
question: z.ZodString;
|
|
1176
|
+
header: z.ZodString;
|
|
1177
|
+
options: z.ZodArray<z.ZodObject<{
|
|
1178
|
+
label: z.ZodString;
|
|
1179
|
+
description: z.ZodString;
|
|
1180
|
+
}, z.core.$strip>>;
|
|
1181
|
+
multiSelect: z.ZodBoolean;
|
|
1182
|
+
}, z.core.$strip>>;
|
|
1183
|
+
}, z.core.$strip>;
|
|
1184
|
+
strict: true;
|
|
1185
|
+
};
|
|
1186
|
+
type AskUserQuestionArgs = z.infer<typeof askUserQuestionTool.schema>;
|
|
1187
|
+
|
|
1188
|
+
/**
|
|
1189
|
+
* Creates handler for user interaction tool - creates AI messages for display.
|
|
1190
|
+
*/
|
|
1191
|
+
declare const createAskUserQuestionHandler: () => ToolHandler<AskUserQuestionArgs, {
|
|
1192
|
+
questions: {
|
|
1193
|
+
question: string;
|
|
1194
|
+
header: string;
|
|
1195
|
+
options: {
|
|
1196
|
+
label: string;
|
|
1197
|
+
description: string;
|
|
1198
|
+
}[];
|
|
1199
|
+
multiSelect: boolean;
|
|
1200
|
+
}[];
|
|
1201
|
+
}>;
|
|
1202
|
+
|
|
1203
|
+
export { type ThreadOps as $, type AgentResponse as A, type BashArgs as B, type RunAgentActivity as C, type RunAgentConfig as D, type SessionEndHookContext as E, type FileEditArgs as F, type GlobArgs as G, type SessionExitReason as H, type InferToolResults as I, type JsonPrimitive as J, type SessionLifecycleHooks as K, type SessionStartHook as L, type SessionStartHookContext as M, type SubagentArgs as N, type SubagentConfig as O, type ParsedToolCall as P, type SubagentHooks as Q, type RawToolCall as R, type SessionEndHook as S, type SubagentInput as T, type TaskCreateArgs as U, type TaskGetArgs as V, type TaskListArgs as W, type TaskStatus as X, type TaskUpdateArgs as Y, type ThreadManager as Z, type ThreadManagerConfig as _, type ActivityToolHandler as a, type ToolArgs as a0, type ToolCallResult as a1, type ToolCallResultUnion as a2, type ToolDefinition as a3, type ToolHandler as a4, type ToolHandlerContext as a5, type ToolHandlerResponse as a6, type ToolHooks as a7, type ToolMap as a8, type ToolMessageContent as a9, grepTool as aA, hasNoOtherToolCalls as aB, isTerminalStatus as aC, proxyDefaultThreadOps as aD, readTool as aE, taskCreateTool as aF, taskGetTool as aG, taskListTool as aH, taskUpdateTool as aI, withAutoAppend as aJ, writeTool as aK, type ToolNames as aa, type ToolResult as ab, type ToolResultConfig as ac, type ToolRouter as ad, type ToolWithHandler as ae, type WorkflowTask as af, type ZeitlichSession as ag, type ZeitlichSharedActivities as ah, askUserQuestionTool as ai, bashTool as aj, createAgentStateManager as ak, createAskUserQuestionHandler as al, createBashToolDescription as am, createSession as an, createSharedActivities as ao, createSubagentTool as ap, createTaskCreateHandler as aq, createTaskGetHandler as ar, createTaskListHandler as as, createTaskUpdateHandler as at, createThreadManager as au, createToolRouter as av, defineSubagent as aw, defineTool as ax, editTool as ay, globTool as az, AGENT_HANDLER_NAMES as b, type AgentConfig as c, type AgentFile as d, type AgentState as e, type AgentStateManager as f, type AgentStatus as g, type AppendToolResultFn as h, type AskUserQuestionArgs as i, type BaseAgentState as j, type BaseThreadManager as k, type FileReadArgs as l, type FileWriteArgs as m, type GrepArgs as n, type JsonSerializable as o, type JsonValue as p, type ParsedToolCallUnion as q, type PostToolUseFailureHook as r, type PostToolUseFailureHookContext as s, type PostToolUseFailureHookResult as t, type PostToolUseHook as u, type PostToolUseHookContext as v, type PreToolUseHook as w, type PreToolUseHookContext as x, type PreToolUseHookResult as y, type ProcessToolCallsContext as z };
|
|
@@ -2,7 +2,7 @@ import { Workflow, proxyActivities } from '@temporalio/workflow';
|
|
|
2
2
|
import Redis from 'ioredis';
|
|
3
3
|
import { $InferMessageContent, MessageStructure, StoredMessage, MessageContent } from '@langchain/core/messages';
|
|
4
4
|
import z, { z as z$1 } from 'zod';
|
|
5
|
-
import
|
|
5
|
+
import { Duration } from '@temporalio/common';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Content for a tool message response.
|
|
@@ -509,16 +509,27 @@ interface ThreadOps {
|
|
|
509
509
|
appendSystemMessage(threadId: string, content: string): Promise<void>;
|
|
510
510
|
}
|
|
511
511
|
/**
|
|
512
|
-
* Configuration for a Zeitlich agent
|
|
512
|
+
* Configuration for a Zeitlich agent
|
|
513
513
|
*/
|
|
514
|
-
interface
|
|
515
|
-
|
|
514
|
+
interface AgentConfig {
|
|
515
|
+
/** The name of the agent, should be unique within the workflows, ideally Pascal Case */
|
|
516
516
|
agentName: string;
|
|
517
517
|
/** Description, used for sub agents */
|
|
518
518
|
description?: string;
|
|
519
|
+
/** The system prompt to append to the thread */
|
|
519
520
|
systemPrompt?: string;
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* Configuration for a Zeitlich agent session
|
|
524
|
+
*/
|
|
525
|
+
interface SessionConfig<T extends ToolMap, M = StoredMessage> {
|
|
526
|
+
/** The thread ID to use for the session */
|
|
527
|
+
threadId: string;
|
|
528
|
+
/** Metadata for the session */
|
|
520
529
|
metadata?: Record<string, unknown>;
|
|
530
|
+
/** Whether to append the system prompt as message to the thread */
|
|
521
531
|
appendSystemPrompt?: boolean;
|
|
532
|
+
/** How many turns to run the session for */
|
|
522
533
|
maxTurns?: number;
|
|
523
534
|
/** Workflow-specific runAgent activity (with tools pre-bound) */
|
|
524
535
|
runAgent: RunAgentActivity<M>;
|
|
@@ -537,6 +548,8 @@ interface ZeitlichAgentConfig<T extends ToolMap, M = StoredMessage> {
|
|
|
537
548
|
* Returns MessageContent array for the initial HumanMessage.
|
|
538
549
|
*/
|
|
539
550
|
buildContextMessage: () => MessageContent | Promise<MessageContent>;
|
|
551
|
+
/** How long to wait for input before cancelling the workflow */
|
|
552
|
+
waitForInputTimeout?: Duration;
|
|
540
553
|
}
|
|
541
554
|
/**
|
|
542
555
|
* A JSON-serializable tool definition for state storage.
|
|
@@ -745,6 +758,32 @@ interface SessionStartHookContext {
|
|
|
745
758
|
* SessionStart hook - called when session begins
|
|
746
759
|
*/
|
|
747
760
|
type SessionStartHook = (ctx: SessionStartHookContext) => void | Promise<void>;
|
|
761
|
+
/**
|
|
762
|
+
* Context for PreHumanMessageAppend hook - called before each human message is appended to the thread
|
|
763
|
+
*/
|
|
764
|
+
interface PreHumanMessageAppendHookContext {
|
|
765
|
+
/** The message about to be appended */
|
|
766
|
+
message: MessageContent;
|
|
767
|
+
/** Thread identifier */
|
|
768
|
+
threadId: string;
|
|
769
|
+
}
|
|
770
|
+
/**
|
|
771
|
+
* PreHumanMessageAppend hook - called before each human message is appended to the thread
|
|
772
|
+
*/
|
|
773
|
+
type PreHumanMessageAppendHook = (ctx: PreHumanMessageAppendHookContext) => void | Promise<void>;
|
|
774
|
+
/**
|
|
775
|
+
* PostHumanMessageAppend hook - called after each human message is appended to the thread
|
|
776
|
+
*/
|
|
777
|
+
type PostHumanMessageAppendHook = (ctx: PostHumanMessageAppendHookContext) => void | Promise<void>;
|
|
778
|
+
/**
|
|
779
|
+
* Context for PostHumanMessageAppend hook - called after each human message is appended to the thread
|
|
780
|
+
*/
|
|
781
|
+
interface PostHumanMessageAppendHookContext {
|
|
782
|
+
/** The message that was appended */
|
|
783
|
+
message: MessageContent;
|
|
784
|
+
/** Thread identifier */
|
|
785
|
+
threadId: string;
|
|
786
|
+
}
|
|
748
787
|
/**
|
|
749
788
|
* Context for SessionEnd hook - called when session ends
|
|
750
789
|
*/
|
|
@@ -795,6 +834,10 @@ interface ToolHooks<TArgs = unknown, TResult = unknown> {
|
|
|
795
834
|
* Combined hooks interface for session lifecycle
|
|
796
835
|
*/
|
|
797
836
|
interface Hooks<T extends ToolMap, TResult = unknown> {
|
|
837
|
+
/** Called before each human message is appended to the thread */
|
|
838
|
+
onPreHumanMessageAppend?: PreHumanMessageAppendHook;
|
|
839
|
+
/** Called after each human message is appended to the thread */
|
|
840
|
+
onPostHumanMessageAppend?: PostHumanMessageAppendHook;
|
|
798
841
|
/** Called before each tool execution - can block or modify */
|
|
799
842
|
onPreToolUse?: PreToolUseHook<T>;
|
|
800
843
|
/** Called after each successful tool execution */
|
|
@@ -885,7 +928,6 @@ interface AgentStateManager<TCustom extends JsonSerializable<TCustom>> {
|
|
|
885
928
|
/** Set the tools (converts Zod schemas to JSON Schema for serialization) */
|
|
886
929
|
setTools(newTools: ToolDefinition[]): void;
|
|
887
930
|
}
|
|
888
|
-
declare const getStateQuery: _temporalio_common.QueryDefinition<BaseAgentState, [], string>;
|
|
889
931
|
/**
|
|
890
932
|
* Creates an agent state manager for tracking workflow state.
|
|
891
933
|
*
|
|
@@ -896,7 +938,10 @@ declare const getStateQuery: _temporalio_common.QueryDefinition<BaseAgentState,
|
|
|
896
938
|
* in the workflow file using defineQuery/defineUpdate and setHandler.
|
|
897
939
|
* This manager provides the state and logic needed for those handlers.
|
|
898
940
|
*/
|
|
899
|
-
declare function createAgentStateManager<TCustom extends JsonSerializable<TCustom> = Record<string, never>>(initialState
|
|
941
|
+
declare function createAgentStateManager<TCustom extends JsonSerializable<TCustom> = Record<string, never>>({ initialState, agentConfig, }: {
|
|
942
|
+
initialState?: Partial<BaseAgentState> & TCustom;
|
|
943
|
+
agentConfig: AgentConfig;
|
|
944
|
+
}): AgentStateManager<TCustom>;
|
|
900
945
|
/**
|
|
901
946
|
* Handler names used across agents
|
|
902
947
|
*/
|
|
@@ -920,7 +965,7 @@ interface SessionLifecycleHooks {
|
|
|
920
965
|
/** Called when session ends */
|
|
921
966
|
onSessionEnd?: SessionEndHook;
|
|
922
967
|
}
|
|
923
|
-
declare const createSession: <T extends ToolMap, M = unknown>({ threadId, agentName, maxTurns, metadata, runAgent, threadOps, buildContextMessage, subagents, tools, processToolsInParallel, hooks, appendSystemPrompt, systemPrompt, }:
|
|
968
|
+
declare const createSession: <T extends ToolMap, M = unknown>({ threadId, agentName, maxTurns, metadata, runAgent, threadOps, buildContextMessage, subagents, tools, processToolsInParallel, hooks, appendSystemPrompt, systemPrompt, waitForInputTimeout, }: SessionConfig<T, M> & AgentConfig) => Promise<ZeitlichSession<M>>;
|
|
924
969
|
/**
|
|
925
970
|
* Proxy the default ZeitlichSharedActivities as ThreadOps<StoredMessage>.
|
|
926
971
|
* Call this in workflow code for the standard LangChain/StoredMessage setup.
|
|
@@ -971,24 +1016,6 @@ interface ZeitlichSharedActivities {
|
|
|
971
1016
|
*/
|
|
972
1017
|
declare function createSharedActivities(redis: Redis): ZeitlichSharedActivities;
|
|
973
1018
|
|
|
974
|
-
declare const askUserQuestionTool: {
|
|
975
|
-
name: "AskUserQuestion";
|
|
976
|
-
description: string;
|
|
977
|
-
schema: z.ZodObject<{
|
|
978
|
-
questions: z.ZodArray<z.ZodObject<{
|
|
979
|
-
question: z.ZodString;
|
|
980
|
-
header: z.ZodString;
|
|
981
|
-
options: z.ZodArray<z.ZodObject<{
|
|
982
|
-
label: z.ZodString;
|
|
983
|
-
description: z.ZodString;
|
|
984
|
-
}, z.core.$strip>>;
|
|
985
|
-
multiSelect: z.ZodBoolean;
|
|
986
|
-
}, z.core.$strip>>;
|
|
987
|
-
}, z.core.$strip>;
|
|
988
|
-
strict: true;
|
|
989
|
-
};
|
|
990
|
-
type AskUserQuestionArgs = z.infer<typeof askUserQuestionTool.schema>;
|
|
991
|
-
|
|
992
1019
|
declare const globTool: {
|
|
993
1020
|
name: "Glob";
|
|
994
1021
|
description: string;
|
|
@@ -1140,4 +1167,37 @@ declare const bashTool: {
|
|
|
1140
1167
|
};
|
|
1141
1168
|
type BashArgs = z.infer<typeof bashTool.schema>;
|
|
1142
1169
|
|
|
1143
|
-
|
|
1170
|
+
declare const askUserQuestionTool: {
|
|
1171
|
+
name: "AskUserQuestion";
|
|
1172
|
+
description: string;
|
|
1173
|
+
schema: z.ZodObject<{
|
|
1174
|
+
questions: z.ZodArray<z.ZodObject<{
|
|
1175
|
+
question: z.ZodString;
|
|
1176
|
+
header: z.ZodString;
|
|
1177
|
+
options: z.ZodArray<z.ZodObject<{
|
|
1178
|
+
label: z.ZodString;
|
|
1179
|
+
description: z.ZodString;
|
|
1180
|
+
}, z.core.$strip>>;
|
|
1181
|
+
multiSelect: z.ZodBoolean;
|
|
1182
|
+
}, z.core.$strip>>;
|
|
1183
|
+
}, z.core.$strip>;
|
|
1184
|
+
strict: true;
|
|
1185
|
+
};
|
|
1186
|
+
type AskUserQuestionArgs = z.infer<typeof askUserQuestionTool.schema>;
|
|
1187
|
+
|
|
1188
|
+
/**
|
|
1189
|
+
* Creates handler for user interaction tool - creates AI messages for display.
|
|
1190
|
+
*/
|
|
1191
|
+
declare const createAskUserQuestionHandler: () => ToolHandler<AskUserQuestionArgs, {
|
|
1192
|
+
questions: {
|
|
1193
|
+
question: string;
|
|
1194
|
+
header: string;
|
|
1195
|
+
options: {
|
|
1196
|
+
label: string;
|
|
1197
|
+
description: string;
|
|
1198
|
+
}[];
|
|
1199
|
+
multiSelect: boolean;
|
|
1200
|
+
}[];
|
|
1201
|
+
}>;
|
|
1202
|
+
|
|
1203
|
+
export { type ThreadOps as $, type AgentResponse as A, type BashArgs as B, type RunAgentActivity as C, type RunAgentConfig as D, type SessionEndHookContext as E, type FileEditArgs as F, type GlobArgs as G, type SessionExitReason as H, type InferToolResults as I, type JsonPrimitive as J, type SessionLifecycleHooks as K, type SessionStartHook as L, type SessionStartHookContext as M, type SubagentArgs as N, type SubagentConfig as O, type ParsedToolCall as P, type SubagentHooks as Q, type RawToolCall as R, type SessionEndHook as S, type SubagentInput as T, type TaskCreateArgs as U, type TaskGetArgs as V, type TaskListArgs as W, type TaskStatus as X, type TaskUpdateArgs as Y, type ThreadManager as Z, type ThreadManagerConfig as _, type ActivityToolHandler as a, type ToolArgs as a0, type ToolCallResult as a1, type ToolCallResultUnion as a2, type ToolDefinition as a3, type ToolHandler as a4, type ToolHandlerContext as a5, type ToolHandlerResponse as a6, type ToolHooks as a7, type ToolMap as a8, type ToolMessageContent as a9, grepTool as aA, hasNoOtherToolCalls as aB, isTerminalStatus as aC, proxyDefaultThreadOps as aD, readTool as aE, taskCreateTool as aF, taskGetTool as aG, taskListTool as aH, taskUpdateTool as aI, withAutoAppend as aJ, writeTool as aK, type ToolNames as aa, type ToolResult as ab, type ToolResultConfig as ac, type ToolRouter as ad, type ToolWithHandler as ae, type WorkflowTask as af, type ZeitlichSession as ag, type ZeitlichSharedActivities as ah, askUserQuestionTool as ai, bashTool as aj, createAgentStateManager as ak, createAskUserQuestionHandler as al, createBashToolDescription as am, createSession as an, createSharedActivities as ao, createSubagentTool as ap, createTaskCreateHandler as aq, createTaskGetHandler as ar, createTaskListHandler as as, createTaskUpdateHandler as at, createThreadManager as au, createToolRouter as av, defineSubagent as aw, defineTool as ax, editTool as ay, globTool as az, AGENT_HANDLER_NAMES as b, type AgentConfig as c, type AgentFile as d, type AgentState as e, type AgentStateManager as f, type AgentStatus as g, type AppendToolResultFn as h, type AskUserQuestionArgs as i, type BaseAgentState as j, type BaseThreadManager as k, type FileReadArgs as l, type FileWriteArgs as m, type GrepArgs as n, type JsonSerializable as o, type JsonValue as p, type ParsedToolCallUnion as q, type PostToolUseFailureHook as r, type PostToolUseFailureHookContext as s, type PostToolUseFailureHookResult as t, type PostToolUseHook as u, type PostToolUseHookContext as v, type PreToolUseHook as w, type PreToolUseHookContext as x, type PreToolUseHookResult as y, type ProcessToolCallsContext as z };
|