illuma-agents 1.0.66 → 1.0.67
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/cjs/common/enum.cjs +2 -0
- package/dist/cjs/common/enum.cjs.map +1 -1
- package/dist/cjs/main.cjs +19 -0
- package/dist/cjs/main.cjs.map +1 -1
- package/dist/cjs/prompts/collab.cjs +11 -0
- package/dist/cjs/prompts/collab.cjs.map +1 -0
- package/dist/cjs/prompts/taskmanager.cjs +66 -0
- package/dist/cjs/prompts/taskmanager.cjs.map +1 -0
- package/dist/cjs/prompts/taskplanning.cjs +99 -0
- package/dist/cjs/prompts/taskplanning.cjs.map +1 -0
- package/dist/cjs/tools/TaskProgress.cjs +172 -0
- package/dist/cjs/tools/TaskProgress.cjs.map +1 -0
- package/dist/esm/common/enum.mjs +2 -0
- package/dist/esm/common/enum.mjs.map +1 -1
- package/dist/esm/main.mjs +4 -0
- package/dist/esm/main.mjs.map +1 -1
- package/dist/esm/prompts/collab.mjs +9 -0
- package/dist/esm/prompts/collab.mjs.map +1 -0
- package/dist/esm/prompts/taskmanager.mjs +60 -0
- package/dist/esm/prompts/taskmanager.mjs.map +1 -0
- package/dist/esm/prompts/taskplanning.mjs +94 -0
- package/dist/esm/prompts/taskplanning.mjs.map +1 -0
- package/dist/esm/tools/TaskProgress.mjs +163 -0
- package/dist/esm/tools/TaskProgress.mjs.map +1 -0
- package/dist/types/common/enum.d.ts +2 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/prompts/index.d.ts +1 -0
- package/dist/types/prompts/taskplanning.d.ts +54 -0
- package/dist/types/tools/TaskProgress.d.ts +142 -0
- package/package.json +1 -1
- package/src/common/enum.ts +2 -0
- package/src/index.ts +4 -0
- package/src/prompts/index.ts +2 -1
- package/src/prompts/taskplanning.ts +96 -0
- package/src/specs/task-progress.test.ts +330 -0
- package/src/tools/TaskProgress.ts +247 -0
package/dist/cjs/common/enum.cjs
CHANGED
|
@@ -27,6 +27,8 @@ exports.GraphEvents = void 0;
|
|
|
27
27
|
GraphEvents["ON_STRUCTURED_OUTPUT"] = "on_structured_output";
|
|
28
28
|
/** [Custom] Request to execute tools - dispatched by ToolNode, handled by host */
|
|
29
29
|
GraphEvents["ON_TOOL_EXECUTE"] = "on_tool_execute";
|
|
30
|
+
/** [Custom] Task progress update - emitted when agent updates todo list */
|
|
31
|
+
GraphEvents["ON_TASK_PROGRESS"] = "on_task_progress";
|
|
30
32
|
/* Official Events */
|
|
31
33
|
/** Custom event, emitted by system */
|
|
32
34
|
GraphEvents["ON_CUSTOM_EVENT"] = "on_custom_event";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enum.cjs","sources":["../../../src/common/enum.ts"],"sourcesContent":["/**\n * Enum representing the various event types emitted during the execution of runnables.\n * These events provide real-time information about the progress and state of different components.\n *\n * @enum {string}\n */\nexport enum GraphEvents {\n /* Custom Events */\n\n /** [Custom] Agent update event in multi-agent graph/workflow */\n ON_AGENT_UPDATE = 'on_agent_update',\n /** [Custom] Delta event for run steps (message creation and tool calls) */\n ON_RUN_STEP = 'on_run_step',\n /** [Custom] Delta event for run steps (tool calls) */\n ON_RUN_STEP_DELTA = 'on_run_step_delta',\n /** [Custom] Completed event for run steps (tool calls) */\n ON_RUN_STEP_COMPLETED = 'on_run_step_completed',\n /** [Custom] Delta events for messages */\n ON_MESSAGE_DELTA = 'on_message_delta',\n /** [Custom] Reasoning Delta events for messages */\n ON_REASONING_DELTA = 'on_reasoning_delta',\n /** [Custom] Context analytics event for traces */\n ON_CONTEXT_ANALYTICS = 'on_context_analytics',\n /** [Custom] Structured output event - emitted when agent returns structured JSON */\n ON_STRUCTURED_OUTPUT = 'on_structured_output',\n /** [Custom] Request to execute tools - dispatched by ToolNode, handled by host */\n ON_TOOL_EXECUTE = 'on_tool_execute',\n\n /* Official Events */\n\n /** Custom event, emitted by system */\n ON_CUSTOM_EVENT = 'on_custom_event',\n /** Emitted when a chat model starts processing. */\n CHAT_MODEL_START = 'on_chat_model_start',\n\n /** Emitted when a chat model streams a chunk of its response. */\n CHAT_MODEL_STREAM = 'on_chat_model_stream',\n\n /** Emitted when a chat model completes its processing. */\n CHAT_MODEL_END = 'on_chat_model_end',\n\n /** Emitted when a language model starts processing. */\n LLM_START = 'on_llm_start',\n\n /** Emitted when a language model streams a chunk of its response. */\n LLM_STREAM = 'on_llm_stream',\n\n /** Emitted when a language model completes its processing. */\n LLM_END = 'on_llm_end',\n\n /** Emitted when a chain starts processing. */\n CHAIN_START = 'on_chain_start',\n\n /** Emitted when a chain streams a chunk of its output. */\n CHAIN_STREAM = 'on_chain_stream',\n\n /** Emitted when a chain completes its processing. */\n CHAIN_END = 'on_chain_end',\n\n /** Emitted when a tool starts its operation. */\n TOOL_START = 'on_tool_start',\n\n /** Emitted when a tool completes its operation. */\n TOOL_END = 'on_tool_end',\n\n /** Emitted when a retriever starts its operation. */\n RETRIEVER_START = 'on_retriever_start',\n\n /** Emitted when a retriever completes its operation. */\n RETRIEVER_END = 'on_retriever_end',\n\n /** Emitted when a prompt starts processing. */\n PROMPT_START = 'on_prompt_start',\n\n /** Emitted when a prompt completes its processing. */\n PROMPT_END = 'on_prompt_end',\n}\n\nexport enum Providers {\n OPENAI = 'openAI',\n VERTEXAI = 'vertexai',\n BEDROCK = 'bedrock',\n ANTHROPIC = 'anthropic',\n MISTRALAI = 'mistralai',\n MISTRAL = 'mistral',\n GOOGLE = 'google',\n AZURE = 'azureOpenAI',\n DEEPSEEK = 'deepseek',\n OPENROUTER = 'openrouter',\n XAI = 'xai',\n}\n\nexport enum GraphNodeKeys {\n TOOLS = 'tools=',\n AGENT = 'agent=',\n ROUTER = 'router',\n PRE_TOOLS = 'pre_tools',\n POST_TOOLS = 'post_tools',\n}\n\nexport enum GraphNodeActions {\n TOOL_NODE = 'tool_node',\n CALL_MODEL = 'call_model',\n ROUTE_MESSAGE = 'route_message',\n}\n\nexport enum CommonEvents {\n LANGGRAPH = 'LangGraph',\n}\n\nexport enum StepTypes {\n TOOL_CALLS = 'tool_calls',\n MESSAGE_CREATION = 'message_creation',\n}\n\nexport enum ContentTypes {\n TEXT = 'text',\n ERROR = 'error',\n THINK = 'think',\n TOOL_CALL = 'tool_call',\n IMAGE_URL = 'image_url',\n IMAGE_FILE = 'image_file',\n /** Anthropic */\n THINKING = 'thinking',\n /** Vertex AI / Google Common */\n REASONING = 'reasoning',\n /** Multi-Agent Switch */\n AGENT_UPDATE = 'agent_update',\n /** Bedrock */\n REASONING_CONTENT = 'reasoning_content',\n}\n\nexport enum ToolCallTypes {\n FUNCTION = 'function',\n RETRIEVAL = 'retrieval',\n FILE_SEARCH = 'file_search',\n CODE_INTERPRETER = 'code_interpreter',\n /* Agents Tool Call */\n TOOL_CALL = 'tool_call',\n}\n\nexport enum Callback {\n TOOL_ERROR = 'handleToolError',\n TOOL_START = 'handleToolStart',\n TOOL_END = 'handleToolEnd',\n CUSTOM_EVENT = 'handleCustomEvent',\n /*\n LLM_START = 'handleLLMStart',\n LLM_NEW_TOKEN = 'handleLLMNewToken',\n LLM_ERROR = 'handleLLMError',\n LLM_END = 'handleLLMEnd',\n CHAT_MODEL_START = 'handleChatModelStart',\n CHAIN_START = 'handleChainStart',\n CHAIN_ERROR = 'handleChainError',\n CHAIN_END = 'handleChainEnd',\n TEXT = 'handleText',\n AGENT_ACTION = 'handleAgentAction',\n AGENT_END = 'handleAgentEnd',\n RETRIEVER_START = 'handleRetrieverStart',\n RETRIEVER_END = 'handleRetrieverEnd',\n RETRIEVER_ERROR = 'handleRetrieverError',\n */\n}\n\nexport enum Constants {\n OFFICIAL_CODE_BASEURL = 'https://api.illuma.ai/v1',\n EXECUTE_CODE = 'execute_code',\n TOOL_SEARCH = 'tool_search',\n PROGRAMMATIC_TOOL_CALLING = 'run_tools_with_code',\n WEB_SEARCH = 'web_search',\n CONTENT_AND_ARTIFACT = 'content_and_artifact',\n LC_TRANSFER_TO_ = 'lc_transfer_to_',\n /** Delimiter for MCP tools: toolName_mcp_serverName */\n MCP_DELIMITER = '_mcp_',\n}\n\nexport enum TitleMethod {\n STRUCTURED = 'structured',\n FUNCTIONS = 'functions',\n COMPLETION = 'completion',\n}\n\nexport enum EnvVar {\n CODE_API_KEY = 'CODE_EXECUTOR_API_KEY',\n CODE_BASEURL = 'CODE_EXECUTOR_BASEURL',\n}\n\n/**\n * Message type identifiers used by LangChain's BaseMessage.getType().\n * Use these constants instead of instanceof checks to avoid module mismatch issues\n * when different copies of @langchain/core/messages are loaded.\n */\nexport enum MessageTypes {\n HUMAN = 'human',\n AI = 'ai',\n SYSTEM = 'system',\n TOOL = 'tool',\n FUNCTION = 'function',\n GENERIC = 'generic',\n DEVELOPER = 'developer',\n REMOVE = 'remove',\n}\n"],"names":["GraphEvents","Providers","GraphNodeKeys","GraphNodeActions","CommonEvents","StepTypes","ContentTypes","ToolCallTypes","Callback","Constants","TitleMethod","EnvVar","MessageTypes"],"mappings":";;AAAA;;;;;AAKG;AACSA;AAAZ,CAAA,UAAY,WAAW,EAAA;;;AAIrB,IAAA,WAAA,CAAA,iBAAA,CAAA,GAAA,iBAAmC;;AAEnC,IAAA,WAAA,CAAA,aAAA,CAAA,GAAA,aAA2B;;AAE3B,IAAA,WAAA,CAAA,mBAAA,CAAA,GAAA,mBAAuC;;AAEvC,IAAA,WAAA,CAAA,uBAAA,CAAA,GAAA,uBAA+C;;AAE/C,IAAA,WAAA,CAAA,kBAAA,CAAA,GAAA,kBAAqC;;AAErC,IAAA,WAAA,CAAA,oBAAA,CAAA,GAAA,oBAAyC;;AAEzC,IAAA,WAAA,CAAA,sBAAA,CAAA,GAAA,sBAA6C;;AAE7C,IAAA,WAAA,CAAA,sBAAA,CAAA,GAAA,sBAA6C;;AAE7C,IAAA,WAAA,CAAA,iBAAA,CAAA,GAAA,iBAAmC;;;AAKnC,IAAA,WAAA,CAAA,iBAAA,CAAA,GAAA,iBAAmC;;AAEnC,IAAA,WAAA,CAAA,kBAAA,CAAA,GAAA,qBAAwC;;AAG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AACb,IAAA,YAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,YAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,YAAA,CAAA,WAAA,CAAA,GAAA,WAAuB;AACvB,IAAA,YAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACnB,CAAC,EATWA,oBAAY,KAAZA,oBAAY,GASvB,EAAA,CAAA,CAAA;;"}
|
|
1
|
+
{"version":3,"file":"enum.cjs","sources":["../../../src/common/enum.ts"],"sourcesContent":["/**\n * Enum representing the various event types emitted during the execution of runnables.\n * These events provide real-time information about the progress and state of different components.\n *\n * @enum {string}\n */\nexport enum GraphEvents {\n /* Custom Events */\n\n /** [Custom] Agent update event in multi-agent graph/workflow */\n ON_AGENT_UPDATE = 'on_agent_update',\n /** [Custom] Delta event for run steps (message creation and tool calls) */\n ON_RUN_STEP = 'on_run_step',\n /** [Custom] Delta event for run steps (tool calls) */\n ON_RUN_STEP_DELTA = 'on_run_step_delta',\n /** [Custom] Completed event for run steps (tool calls) */\n ON_RUN_STEP_COMPLETED = 'on_run_step_completed',\n /** [Custom] Delta events for messages */\n ON_MESSAGE_DELTA = 'on_message_delta',\n /** [Custom] Reasoning Delta events for messages */\n ON_REASONING_DELTA = 'on_reasoning_delta',\n /** [Custom] Context analytics event for traces */\n ON_CONTEXT_ANALYTICS = 'on_context_analytics',\n /** [Custom] Structured output event - emitted when agent returns structured JSON */\n ON_STRUCTURED_OUTPUT = 'on_structured_output',\n /** [Custom] Request to execute tools - dispatched by ToolNode, handled by host */\n ON_TOOL_EXECUTE = 'on_tool_execute',\n /** [Custom] Task progress update - emitted when agent updates todo list */\n ON_TASK_PROGRESS = 'on_task_progress',\n\n /* Official Events */\n\n /** Custom event, emitted by system */\n ON_CUSTOM_EVENT = 'on_custom_event',\n /** Emitted when a chat model starts processing. */\n CHAT_MODEL_START = 'on_chat_model_start',\n\n /** Emitted when a chat model streams a chunk of its response. */\n CHAT_MODEL_STREAM = 'on_chat_model_stream',\n\n /** Emitted when a chat model completes its processing. */\n CHAT_MODEL_END = 'on_chat_model_end',\n\n /** Emitted when a language model starts processing. */\n LLM_START = 'on_llm_start',\n\n /** Emitted when a language model streams a chunk of its response. */\n LLM_STREAM = 'on_llm_stream',\n\n /** Emitted when a language model completes its processing. */\n LLM_END = 'on_llm_end',\n\n /** Emitted when a chain starts processing. */\n CHAIN_START = 'on_chain_start',\n\n /** Emitted when a chain streams a chunk of its output. */\n CHAIN_STREAM = 'on_chain_stream',\n\n /** Emitted when a chain completes its processing. */\n CHAIN_END = 'on_chain_end',\n\n /** Emitted when a tool starts its operation. */\n TOOL_START = 'on_tool_start',\n\n /** Emitted when a tool completes its operation. */\n TOOL_END = 'on_tool_end',\n\n /** Emitted when a retriever starts its operation. */\n RETRIEVER_START = 'on_retriever_start',\n\n /** Emitted when a retriever completes its operation. */\n RETRIEVER_END = 'on_retriever_end',\n\n /** Emitted when a prompt starts processing. */\n PROMPT_START = 'on_prompt_start',\n\n /** Emitted when a prompt completes its processing. */\n PROMPT_END = 'on_prompt_end',\n}\n\nexport enum Providers {\n OPENAI = 'openAI',\n VERTEXAI = 'vertexai',\n BEDROCK = 'bedrock',\n ANTHROPIC = 'anthropic',\n MISTRALAI = 'mistralai',\n MISTRAL = 'mistral',\n GOOGLE = 'google',\n AZURE = 'azureOpenAI',\n DEEPSEEK = 'deepseek',\n OPENROUTER = 'openrouter',\n XAI = 'xai',\n}\n\nexport enum GraphNodeKeys {\n TOOLS = 'tools=',\n AGENT = 'agent=',\n ROUTER = 'router',\n PRE_TOOLS = 'pre_tools',\n POST_TOOLS = 'post_tools',\n}\n\nexport enum GraphNodeActions {\n TOOL_NODE = 'tool_node',\n CALL_MODEL = 'call_model',\n ROUTE_MESSAGE = 'route_message',\n}\n\nexport enum CommonEvents {\n LANGGRAPH = 'LangGraph',\n}\n\nexport enum StepTypes {\n TOOL_CALLS = 'tool_calls',\n MESSAGE_CREATION = 'message_creation',\n}\n\nexport enum ContentTypes {\n TEXT = 'text',\n ERROR = 'error',\n THINK = 'think',\n TOOL_CALL = 'tool_call',\n IMAGE_URL = 'image_url',\n IMAGE_FILE = 'image_file',\n /** Anthropic */\n THINKING = 'thinking',\n /** Vertex AI / Google Common */\n REASONING = 'reasoning',\n /** Multi-Agent Switch */\n AGENT_UPDATE = 'agent_update',\n /** Bedrock */\n REASONING_CONTENT = 'reasoning_content',\n}\n\nexport enum ToolCallTypes {\n FUNCTION = 'function',\n RETRIEVAL = 'retrieval',\n FILE_SEARCH = 'file_search',\n CODE_INTERPRETER = 'code_interpreter',\n /* Agents Tool Call */\n TOOL_CALL = 'tool_call',\n}\n\nexport enum Callback {\n TOOL_ERROR = 'handleToolError',\n TOOL_START = 'handleToolStart',\n TOOL_END = 'handleToolEnd',\n CUSTOM_EVENT = 'handleCustomEvent',\n /*\n LLM_START = 'handleLLMStart',\n LLM_NEW_TOKEN = 'handleLLMNewToken',\n LLM_ERROR = 'handleLLMError',\n LLM_END = 'handleLLMEnd',\n CHAT_MODEL_START = 'handleChatModelStart',\n CHAIN_START = 'handleChainStart',\n CHAIN_ERROR = 'handleChainError',\n CHAIN_END = 'handleChainEnd',\n TEXT = 'handleText',\n AGENT_ACTION = 'handleAgentAction',\n AGENT_END = 'handleAgentEnd',\n RETRIEVER_START = 'handleRetrieverStart',\n RETRIEVER_END = 'handleRetrieverEnd',\n RETRIEVER_ERROR = 'handleRetrieverError',\n */\n}\n\nexport enum Constants {\n OFFICIAL_CODE_BASEURL = 'https://api.illuma.ai/v1',\n EXECUTE_CODE = 'execute_code',\n TOOL_SEARCH = 'tool_search',\n PROGRAMMATIC_TOOL_CALLING = 'run_tools_with_code',\n WEB_SEARCH = 'web_search',\n CONTENT_AND_ARTIFACT = 'content_and_artifact',\n LC_TRANSFER_TO_ = 'lc_transfer_to_',\n /** Delimiter for MCP tools: toolName_mcp_serverName */\n MCP_DELIMITER = '_mcp_',\n}\n\nexport enum TitleMethod {\n STRUCTURED = 'structured',\n FUNCTIONS = 'functions',\n COMPLETION = 'completion',\n}\n\nexport enum EnvVar {\n CODE_API_KEY = 'CODE_EXECUTOR_API_KEY',\n CODE_BASEURL = 'CODE_EXECUTOR_BASEURL',\n}\n\n/**\n * Message type identifiers used by LangChain's BaseMessage.getType().\n * Use these constants instead of instanceof checks to avoid module mismatch issues\n * when different copies of @langchain/core/messages are loaded.\n */\nexport enum MessageTypes {\n HUMAN = 'human',\n AI = 'ai',\n SYSTEM = 'system',\n TOOL = 'tool',\n FUNCTION = 'function',\n GENERIC = 'generic',\n DEVELOPER = 'developer',\n REMOVE = 'remove',\n}\n"],"names":["GraphEvents","Providers","GraphNodeKeys","GraphNodeActions","CommonEvents","StepTypes","ContentTypes","ToolCallTypes","Callback","Constants","TitleMethod","EnvVar","MessageTypes"],"mappings":";;AAAA;;;;;AAKG;AACSA;AAAZ,CAAA,UAAY,WAAW,EAAA;;;AAIrB,IAAA,WAAA,CAAA,iBAAA,CAAA,GAAA,iBAAmC;;AAEnC,IAAA,WAAA,CAAA,aAAA,CAAA,GAAA,aAA2B;;AAE3B,IAAA,WAAA,CAAA,mBAAA,CAAA,GAAA,mBAAuC;;AAEvC,IAAA,WAAA,CAAA,uBAAA,CAAA,GAAA,uBAA+C;;AAE/C,IAAA,WAAA,CAAA,kBAAA,CAAA,GAAA,kBAAqC;;AAErC,IAAA,WAAA,CAAA,oBAAA,CAAA,GAAA,oBAAyC;;AAEzC,IAAA,WAAA,CAAA,sBAAA,CAAA,GAAA,sBAA6C;;AAE7C,IAAA,WAAA,CAAA,sBAAA,CAAA,GAAA,sBAA6C;;AAE7C,IAAA,WAAA,CAAA,iBAAA,CAAA,GAAA,iBAAmC;;AAEnC,IAAA,WAAA,CAAA,kBAAA,CAAA,GAAA,kBAAqC;;;AAKrC,IAAA,WAAA,CAAA,iBAAA,CAAA,GAAA,iBAAmC;;AAEnC,IAAA,WAAA,CAAA,kBAAA,CAAA,GAAA,qBAAwC;;AAGxC,IAAA,WAAA,CAAA,mBA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AA,CAAA,GAAA,UAAqB;AACrB,IAAA,YAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,YAAA,CAAA,WAAA,CAAA,GAAA,WAAuB;AACvB,IAAA,YAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACnB,CAAC,EATWA,oBAAY,KAAZA,oBAAY,GASvB,EAAA,CAAA,CAAA;;"}
|
package/dist/cjs/main.cjs
CHANGED
|
@@ -18,11 +18,15 @@ var CodeExecutor = require('./tools/CodeExecutor.cjs');
|
|
|
18
18
|
var BrowserTools = require('./tools/BrowserTools.cjs');
|
|
19
19
|
var ProgrammaticToolCalling = require('./tools/ProgrammaticToolCalling.cjs');
|
|
20
20
|
var ToolSearch = require('./tools/ToolSearch.cjs');
|
|
21
|
+
var TaskProgress = require('./tools/TaskProgress.cjs');
|
|
21
22
|
var ToolNode = require('./tools/ToolNode.cjs');
|
|
22
23
|
var schema = require('./tools/schema.cjs');
|
|
23
24
|
var handlers = require('./tools/handlers.cjs');
|
|
24
25
|
var tool = require('./tools/search/tool.cjs');
|
|
25
26
|
var schema$1 = require('./tools/search/schema.cjs');
|
|
27
|
+
var collab = require('./prompts/collab.cjs');
|
|
28
|
+
var taskmanager = require('./prompts/taskmanager.cjs');
|
|
29
|
+
var taskplanning = require('./prompts/taskplanning.cjs');
|
|
26
30
|
var validate = require('./schemas/validate.cjs');
|
|
27
31
|
var _enum = require('./common/enum.cjs');
|
|
28
32
|
var graph = require('./utils/graph.cjs');
|
|
@@ -121,6 +125,11 @@ exports.isFromMcpServer = ToolSearch.isFromMcpServer;
|
|
|
121
125
|
exports.normalizeServerFilter = ToolSearch.normalizeServerFilter;
|
|
122
126
|
exports.performLocalSearch = ToolSearch.performLocalSearch;
|
|
123
127
|
exports.sanitizeRegex = ToolSearch.sanitizeRegex;
|
|
128
|
+
exports.TaskProgressToolDefinition = TaskProgress.TaskProgressToolDefinition;
|
|
129
|
+
exports.TaskProgressToolDescription = TaskProgress.TaskProgressToolDescription;
|
|
130
|
+
exports.TaskProgressToolName = TaskProgress.TaskProgressToolName;
|
|
131
|
+
exports.TaskProgressToolSchema = TaskProgress.TaskProgressToolSchema;
|
|
132
|
+
exports.createTaskProgressTool = TaskProgress.createTaskProgressTool;
|
|
124
133
|
exports.ToolNode = ToolNode.ToolNode;
|
|
125
134
|
exports.toolsCondition = ToolNode.toolsCondition;
|
|
126
135
|
exports.createSchemaOnlyTool = schema.createSchemaOnlyTool;
|
|
@@ -146,6 +155,16 @@ exports.imagesSchema = schema$1.imagesSchema;
|
|
|
146
155
|
exports.newsSchema = schema$1.newsSchema;
|
|
147
156
|
exports.querySchema = schema$1.querySchema;
|
|
148
157
|
exports.videosSchema = schema$1.videosSchema;
|
|
158
|
+
exports.supervisorPrompt = collab.supervisorPrompt;
|
|
159
|
+
exports.assignTasksFunctionDescription = taskmanager.assignTasksFunctionDescription;
|
|
160
|
+
exports.assignTasksFunctionParameters = taskmanager.assignTasksFunctionParameters;
|
|
161
|
+
exports.endProcessFunctionDescription = taskmanager.endProcessFunctionDescription;
|
|
162
|
+
exports.endProcessFunctionParameters = taskmanager.endProcessFunctionParameters;
|
|
163
|
+
exports.taskManagerPrompt = taskmanager.taskManagerPrompt;
|
|
164
|
+
exports.manageTodoListFunctionDescription = taskplanning.manageTodoListFunctionDescription;
|
|
165
|
+
exports.manageTodoListFunctionParameters = taskplanning.manageTodoListFunctionParameters;
|
|
166
|
+
exports.taskPlanningPrompt = taskplanning.taskPlanningPrompt;
|
|
167
|
+
exports.taskPlanningPromptShort = taskplanning.taskPlanningPromptShort;
|
|
149
168
|
exports.createValidationErrorMessage = validate.createValidationErrorMessage;
|
|
150
169
|
exports.isValidJsonSchema = validate.isValidJsonSchema;
|
|
151
170
|
exports.normalizeJsonSchema = validate.normalizeJsonSchema;
|
package/dist/cjs/main.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"main.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/prompts/collab.ts
|
|
4
|
+
const supervisorPrompt = `You are a supervisor tasked with managing a conversation between the
|
|
5
|
+
following workers: {members}. Given the following user request,
|
|
6
|
+
respond with the worker to act next. Each worker will perform a
|
|
7
|
+
task and respond with their results and status. Multiple workers can work at once, and they can use multiple tools at once. Each worker can run their tools multiple times per task. When finished,
|
|
8
|
+
respond with FINISH.`;
|
|
9
|
+
|
|
10
|
+
exports.supervisorPrompt = supervisorPrompt;
|
|
11
|
+
//# sourceMappingURL=collab.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collab.cjs","sources":["../../../src/prompts/collab.ts"],"sourcesContent":["// src/prompts/collab.ts\nexport const supervisorPrompt = `You are a supervisor tasked with managing a conversation between the\nfollowing workers: {members}. Given the following user request,\nrespond with the worker to act next. Each worker will perform a\ntask and respond with their results and status. Multiple workers can work at once, and they can use multiple tools at once. Each worker can run their tools multiple times per task. When finished,\nrespond with FINISH.`;"],"names":[],"mappings":";;AAAA;AACa,MAAA,gBAAgB,GAAG,CAAA;;;;;;;;"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const taskManagerPrompt = `You are a Task Manager responsible for efficiently coordinating a team of specialized workers: {members}. Your PRIMARY and SOLE OBJECTIVE is to fulfill the user's specific request as quickly and effectively as possible.
|
|
4
|
+
|
|
5
|
+
CRITICAL GUIDELINES:
|
|
6
|
+
1. The user's request is your CHIEF CONCERN. Every action must directly contribute to fulfilling this request.
|
|
7
|
+
2. Aim to complete the entire task in NO MORE THAN 2-3 TURNS, unless explicitly instructed otherwise.
|
|
8
|
+
3. Eliminate all superfluous activity. Each task must be essential to achieving the user's goal.
|
|
9
|
+
4. Assign no more than 5 tasks per turn, and only if absolutely necessary.
|
|
10
|
+
5. Be concise and direct in your task assignments.
|
|
11
|
+
6. End the process IMMEDIATELY once the user's request is fulfilled by setting 'end' to true and assigning no new tasks.
|
|
12
|
+
|
|
13
|
+
Your responsibilities:
|
|
14
|
+
1. Analyze the user's request and break it down into the minimum necessary subtasks.
|
|
15
|
+
2. Assign these essential tasks to the most appropriate team members based on their skills and tools.
|
|
16
|
+
3. Prioritize tasks to ensure the most efficient path to completion.
|
|
17
|
+
4. Continuously evaluate if the user's request has been fully addressed.
|
|
18
|
+
5. End the process IMMEDIATELY once the user's request is fulfilled.
|
|
19
|
+
|
|
20
|
+
Task Assignment Guidelines:
|
|
21
|
+
- Assign only the most crucial tasks required to meet the user's needs.
|
|
22
|
+
- Multiple tasks can be assigned to the same team member if it improves efficiency.
|
|
23
|
+
- Always specify the tool to use if applicable.
|
|
24
|
+
- Consider task dependencies to minimize the number of turns.
|
|
25
|
+
|
|
26
|
+
After each round:
|
|
27
|
+
- Critically assess if the user's request has been fully addressed.
|
|
28
|
+
- If more work is genuinely needed, assign only the most essential remaining tasks.
|
|
29
|
+
- If the user's request has been fulfilled or can be fulfilled with the results at hand, set 'end' to true and assign no new tasks.
|
|
30
|
+
|
|
31
|
+
REMEMBER: Your success is measured by how quickly and effectively you fulfill the user's request, not by the number of tasks assigned or turns taken. Excessive deliberation or unnecessary tasks are counterproductive. Focus solely on the user's needs and conclude the process as soon as those needs are met.`;
|
|
32
|
+
const assignTasksFunctionDescription = 'Assign the minimum necessary tasks to team members to fulfill the user\'s request as quickly as possible. Assign up to 5 tasks maximum per turn, only if absolutely necessary. Each task must specify the team member, a concise description, and the tool to use if applicable.';
|
|
33
|
+
const assignTasksFunctionParameters = {
|
|
34
|
+
type: 'object',
|
|
35
|
+
properties: {
|
|
36
|
+
tasks: {
|
|
37
|
+
type: 'array',
|
|
38
|
+
items: {
|
|
39
|
+
type: 'object',
|
|
40
|
+
properties: {
|
|
41
|
+
member: { type: 'string', description: 'Name of the team member assigned to the task' },
|
|
42
|
+
description: { type: 'string', description: 'Concise description of the essential task to be performed' },
|
|
43
|
+
tool: { type: 'string', description: 'Specific tool to be used for the task, if applicable' },
|
|
44
|
+
},
|
|
45
|
+
required: ['member', 'description'],
|
|
46
|
+
},
|
|
47
|
+
description: 'List of essential tasks to be assigned, maximum 5 tasks per turn.',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
required: ['tasks'],
|
|
51
|
+
};
|
|
52
|
+
const endProcessFunctionDescription = 'End the process when the user\'s request has been fulfilled.';
|
|
53
|
+
const endProcessFunctionParameters = {
|
|
54
|
+
type: 'object',
|
|
55
|
+
properties: {
|
|
56
|
+
reason: { type: 'string', description: 'Brief explanation of why the process is ending' },
|
|
57
|
+
},
|
|
58
|
+
required: ['reason'],
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
exports.assignTasksFunctionDescription = assignTasksFunctionDescription;
|
|
62
|
+
exports.assignTasksFunctionParameters = assignTasksFunctionParameters;
|
|
63
|
+
exports.endProcessFunctionDescription = endProcessFunctionDescription;
|
|
64
|
+
exports.endProcessFunctionParameters = endProcessFunctionParameters;
|
|
65
|
+
exports.taskManagerPrompt = taskManagerPrompt;
|
|
66
|
+
//# sourceMappingURL=taskmanager.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"taskmanager.cjs","sources":["../../../src/prompts/taskmanager.ts"],"sourcesContent":["export const taskManagerPrompt = `You are a Task Manager responsible for efficiently coordinating a team of specialized workers: {members}. Your PRIMARY and SOLE OBJECTIVE is to fulfill the user's specific request as quickly and effectively as possible.\n\nCRITICAL GUIDELINES:\n1. The user's request is your CHIEF CONCERN. Every action must directly contribute to fulfilling this request.\n2. Aim to complete the entire task in NO MORE THAN 2-3 TURNS, unless explicitly instructed otherwise.\n3. Eliminate all superfluous activity. Each task must be essential to achieving the user's goal.\n4. Assign no more than 5 tasks per turn, and only if absolutely necessary.\n5. Be concise and direct in your task assignments.\n6. End the process IMMEDIATELY once the user's request is fulfilled by setting 'end' to true and assigning no new tasks.\n\nYour responsibilities:\n1. Analyze the user's request and break it down into the minimum necessary subtasks.\n2. Assign these essential tasks to the most appropriate team members based on their skills and tools.\n3. Prioritize tasks to ensure the most efficient path to completion.\n4. Continuously evaluate if the user's request has been fully addressed.\n5. End the process IMMEDIATELY once the user's request is fulfilled.\n\nTask Assignment Guidelines:\n- Assign only the most crucial tasks required to meet the user's needs.\n- Multiple tasks can be assigned to the same team member if it improves efficiency.\n- Always specify the tool to use if applicable.\n- Consider task dependencies to minimize the number of turns.\n\nAfter each round:\n- Critically assess if the user's request has been fully addressed.\n- If more work is genuinely needed, assign only the most essential remaining tasks.\n- If the user's request has been fulfilled or can be fulfilled with the results at hand, set 'end' to true and assign no new tasks.\n\nREMEMBER: Your success is measured by how quickly and effectively you fulfill the user's request, not by the number of tasks assigned or turns taken. Excessive deliberation or unnecessary tasks are counterproductive. Focus solely on the user's needs and conclude the process as soon as those needs are met.`;\n\nexport const assignTasksFunctionDescription = 'Assign the minimum necessary tasks to team members to fulfill the user\\'s request as quickly as possible. Assign up to 5 tasks maximum per turn, only if absolutely necessary. Each task must specify the team member, a concise description, and the tool to use if applicable.';\n\nexport const assignTasksFunctionParameters = {\n type: 'object',\n properties: {\n tasks: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n member: { type: 'string', description: 'Name of the team member assigned to the task' },\n description: { type: 'string', description: 'Concise description of the essential task to be performed' },\n tool: { type: 'string', description: 'Specific tool to be used for the task, if applicable' },\n },\n required: ['member', 'description'],\n },\n description: 'List of essential tasks to be assigned, maximum 5 tasks per turn.',\n },\n },\n required: ['tasks'],\n};\n\nexport const endProcessFunctionDescription = 'End the process when the user\\'s request has been fulfilled.';\n\nexport const endProcessFunctionParameters = {\n type: 'object',\n properties: {\n reason: { type: 'string', description: 'Brief explanation of why the process is ending' },\n },\n required: ['reason'],\n};\n"],"names":[],"mappings":";;AAAa,MAAA,iBAAiB,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8B1B,MAAM,8BAA8B,GAAG;AAEjC,MAAA,6BAA6B,GAAG;AAC3C,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,UAAU,EAAE;AACV,QAAA,KAAK,EAAE;AACL,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,KAAK,EAAE;AACL,gBAAA,IAAI,EAAE,QAAQ;AACd,gBAAA,UAAU,EAAE;oBACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,8CAA8C,EAAE;oBACvF,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,2DAA2D,EAAE;oBACzG,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,sDAAsD,EAAE;AAC9F,iBAAA;AACD,gBAAA,QAAQ,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC;AACpC,aAAA;AACD,YAAA,WAAW,EAAE,mEAAmE;AACjF,SAAA;AACF,KAAA;IACD,QAAQ,EAAE,CAAC,OAAO,CAAC;;AAGd,MAAM,6BAA6B,GAAG;AAEhC,MAAA,4BAA4B,GAAG;AAC1C,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,UAAU,EAAE;QACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gDAAgD,EAAE;AAC1F,KAAA;IACD,QAAQ,EAAE,CAAC,QAAQ,CAAC;;;;;;;;;"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/prompts/taskplanning.ts
|
|
4
|
+
/**
|
|
5
|
+
* System prompt fragment for task planning capabilities.
|
|
6
|
+
*
|
|
7
|
+
* Include this in the agent's system prompt when:
|
|
8
|
+
* - Agent is ephemeral (not a persistent workflow)
|
|
9
|
+
* - Agent handles complex, multi-step research or coding tasks
|
|
10
|
+
* - You want visible progress tracking for the user
|
|
11
|
+
*
|
|
12
|
+
* Do NOT include for:
|
|
13
|
+
* - Simple tool-calling agents
|
|
14
|
+
* - Workflow/builder agents with predefined steps
|
|
15
|
+
* - Agents with fixed execution patterns
|
|
16
|
+
*/
|
|
17
|
+
const taskPlanningPrompt = `## Task Planning & Progress
|
|
18
|
+
|
|
19
|
+
You have access to a \`manage_todo_list\` tool for tracking complex tasks.
|
|
20
|
+
|
|
21
|
+
### When to Use Task Planning
|
|
22
|
+
- **USE** for complex work requiring 3+ steps (research, multi-file changes, analysis)
|
|
23
|
+
- **SKIP** for simple requests (single file edit, quick lookup, conversational responses)
|
|
24
|
+
|
|
25
|
+
### Task Workflow
|
|
26
|
+
1. **Plan First**: Before starting complex work, create a todo list with 3-6 clear, actionable items
|
|
27
|
+
2. **One at a Time**: Mark ONE task as "in-progress" before starting work on it
|
|
28
|
+
3. **Multiple Tool Calls OK**: A single task may require multiple tool calls (searches, reads, writes)
|
|
29
|
+
4. **Complete Immediately**: Mark task "completed" right after finishing, don't batch updates
|
|
30
|
+
5. **Iterate**: Move to next task, repeat until done
|
|
31
|
+
|
|
32
|
+
### Task Best Practices
|
|
33
|
+
- Keep titles short and action-oriented (3-7 words): "Research API options", "Implement auth flow"
|
|
34
|
+
- Group related work into single tasks rather than micro-tasks
|
|
35
|
+
- Update status promptly so user sees real-time progress
|
|
36
|
+
- For simple 1-2 step work, just do it directly without creating todos
|
|
37
|
+
|
|
38
|
+
### Example Task Breakdown
|
|
39
|
+
For "Add user authentication to the app":
|
|
40
|
+
1. Review existing auth code and dependencies
|
|
41
|
+
2. Implement login endpoint
|
|
42
|
+
3. Add session management
|
|
43
|
+
4. Create protected route middleware
|
|
44
|
+
5. Test authentication flow
|
|
45
|
+
|
|
46
|
+
Each task above might involve multiple file reads, code writes, and searches - that's expected.
|
|
47
|
+
`;
|
|
48
|
+
/**
|
|
49
|
+
* Short version of task planning prompt for constrained context
|
|
50
|
+
*/
|
|
51
|
+
const taskPlanningPromptShort = `## Task Tracking
|
|
52
|
+
Use \`manage_todo_list\` for complex multi-step work (3+ steps).
|
|
53
|
+
- Create 3-6 actionable todos before starting
|
|
54
|
+
- Mark one "in-progress" at a time
|
|
55
|
+
- Mark "completed" immediately after finishing
|
|
56
|
+
- Skip for simple 1-2 step tasks
|
|
57
|
+
`;
|
|
58
|
+
/**
|
|
59
|
+
* Function description for structured output agents
|
|
60
|
+
*/
|
|
61
|
+
const manageTodoListFunctionDescription = 'Manage a todo list for tracking progress on complex multi-step tasks. Create todos before starting work, mark in-progress while working, mark completed when done.';
|
|
62
|
+
/**
|
|
63
|
+
* Function parameters schema (for agents using function calling format)
|
|
64
|
+
*/
|
|
65
|
+
const manageTodoListFunctionParameters = {
|
|
66
|
+
type: 'object',
|
|
67
|
+
properties: {
|
|
68
|
+
todoList: {
|
|
69
|
+
type: 'array',
|
|
70
|
+
description: 'Complete array of all todo items (existing and new)',
|
|
71
|
+
items: {
|
|
72
|
+
type: 'object',
|
|
73
|
+
properties: {
|
|
74
|
+
id: {
|
|
75
|
+
type: 'number',
|
|
76
|
+
description: 'Sequential ID starting from 1',
|
|
77
|
+
},
|
|
78
|
+
title: {
|
|
79
|
+
type: 'string',
|
|
80
|
+
description: 'Short action-oriented title (3-7 words)',
|
|
81
|
+
},
|
|
82
|
+
status: {
|
|
83
|
+
type: 'string',
|
|
84
|
+
enum: ['not-started', 'in-progress', 'completed'],
|
|
85
|
+
description: 'Current task status',
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
required: ['id', 'title', 'status'],
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
required: ['todoList'],
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
exports.manageTodoListFunctionDescription = manageTodoListFunctionDescription;
|
|
96
|
+
exports.manageTodoListFunctionParameters = manageTodoListFunctionParameters;
|
|
97
|
+
exports.taskPlanningPrompt = taskPlanningPrompt;
|
|
98
|
+
exports.taskPlanningPromptShort = taskPlanningPromptShort;
|
|
99
|
+
//# sourceMappingURL=taskplanning.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"taskplanning.cjs","sources":["../../../src/prompts/taskplanning.ts"],"sourcesContent":["// src/prompts/taskplanning.ts\r\n\r\n/**\r\n * System prompt fragment for task planning capabilities.\r\n *\r\n * Include this in the agent's system prompt when:\r\n * - Agent is ephemeral (not a persistent workflow)\r\n * - Agent handles complex, multi-step research or coding tasks\r\n * - You want visible progress tracking for the user\r\n *\r\n * Do NOT include for:\r\n * - Simple tool-calling agents\r\n * - Workflow/builder agents with predefined steps\r\n * - Agents with fixed execution patterns\r\n */\r\nexport const taskPlanningPrompt = `## Task Planning & Progress\r\n\r\nYou have access to a \\`manage_todo_list\\` tool for tracking complex tasks.\r\n\r\n### When to Use Task Planning\r\n- **USE** for complex work requiring 3+ steps (research, multi-file changes, analysis)\r\n- **SKIP** for simple requests (single file edit, quick lookup, conversational responses)\r\n\r\n### Task Workflow\r\n1. **Plan First**: Before starting complex work, create a todo list with 3-6 clear, actionable items\r\n2. **One at a Time**: Mark ONE task as \"in-progress\" before starting work on it\r\n3. **Multiple Tool Calls OK**: A single task may require multiple tool calls (searches, reads, writes)\r\n4. **Complete Immediately**: Mark task \"completed\" right after finishing, don't batch updates\r\n5. **Iterate**: Move to next task, repeat until done\r\n\r\n### Task Best Practices\r\n- Keep titles short and action-oriented (3-7 words): \"Research API options\", \"Implement auth flow\"\r\n- Group related work into single tasks rather than micro-tasks\r\n- Update status promptly so user sees real-time progress\r\n- For simple 1-2 step work, just do it directly without creating todos\r\n\r\n### Example Task Breakdown\r\nFor \"Add user authentication to the app\":\r\n1. Review existing auth code and dependencies\r\n2. Implement login endpoint\r\n3. Add session management\r\n4. Create protected route middleware\r\n5. Test authentication flow\r\n\r\nEach task above might involve multiple file reads, code writes, and searches - that's expected.\r\n`;\r\n\r\n/**\r\n * Short version of task planning prompt for constrained context\r\n */\r\nexport const taskPlanningPromptShort = `## Task Tracking\r\nUse \\`manage_todo_list\\` for complex multi-step work (3+ steps).\r\n- Create 3-6 actionable todos before starting\r\n- Mark one \"in-progress\" at a time\r\n- Mark \"completed\" immediately after finishing\r\n- Skip for simple 1-2 step tasks\r\n`;\r\n\r\n/**\r\n * Function description for structured output agents\r\n */\r\nexport const manageTodoListFunctionDescription =\r\n 'Manage a todo list for tracking progress on complex multi-step tasks. Create todos before starting work, mark in-progress while working, mark completed when done.';\r\n\r\n/**\r\n * Function parameters schema (for agents using function calling format)\r\n */\r\nexport const manageTodoListFunctionParameters = {\r\n type: 'object',\r\n properties: {\r\n todoList: {\r\n type: 'array',\r\n description: 'Complete array of all todo items (existing and new)',\r\n items: {\r\n type: 'object',\r\n properties: {\r\n id: {\r\n type: 'number',\r\n description: 'Sequential ID starting from 1',\r\n },\r\n title: {\r\n type: 'string',\r\n description: 'Short action-oriented title (3-7 words)',\r\n },\r\n status: {\r\n type: 'string',\r\n enum: ['not-started', 'in-progress', 'completed'],\r\n description: 'Current task status',\r\n },\r\n },\r\n required: ['id', 'title', 'status'],\r\n },\r\n },\r\n },\r\n required: ['todoList'],\r\n};\r\n"],"names":[],"mappings":";;AAAA;AAEA;;;;;;;;;;;;AAYG;AACU,MAAA,kBAAkB,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgClC;;AAEG;AACU,MAAA,uBAAuB,GAAG,CAAA;;;;;;;AAQvC;;AAEG;AACI,MAAM,iCAAiC,GAC5C;AAEF;;AAEG;AACU,MAAA,gCAAgC,GAAG;AAC9C,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,UAAU,EAAE;AACV,QAAA,QAAQ,EAAE;AACR,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,WAAW,EAAE,qDAAqD;AAClE,YAAA,KAAK,EAAE;AACL,gBAAA,IAAI,EAAE,QAAQ;AACd,gBAAA,UAAU,EAAE;AACV,oBAAA,EAAE,EAAE;AACF,wBAAA,IAAI,EAAE,QAAQ;AACd,wBAAA,WAAW,EAAE,+BAA+B;AAC7C,qBAAA;AACD,oBAAA,KAAK,EAAE;AACL,wBAAA,IAAI,EAAE,QAAQ;AACd,wBAAA,WAAW,EAAE,yCAAyC;AACvD,qBAAA;AACD,oBAAA,MAAM,EAAE;AACN,wBAAA,IAAI,EAAE,QAAQ;AACd,wBAAA,IAAI,EAAE,CAAC,aAAa,EAAE,aAAa,EAAE,WAAW,CAAC;AACjD,wBAAA,WAAW,EAAE,qBAAqB;AACnC,qBAAA;AACF,iBAAA;AACD,gBAAA,QAAQ,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC;AACpC,aAAA;AACF,SAAA;AACF,KAAA;IACD,QAAQ,EAAE,CAAC,UAAU,CAAC;;;;;;;;"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tools = require('@langchain/core/tools');
|
|
6
|
+
var events = require('../utils/events.cjs');
|
|
7
|
+
var _enum = require('../common/enum.cjs');
|
|
8
|
+
|
|
9
|
+
// src/tools/TaskProgress.ts
|
|
10
|
+
/**
|
|
11
|
+
* Tool name constant - matches what AI calls
|
|
12
|
+
*/
|
|
13
|
+
const TaskProgressToolName = 'manage_todo_list';
|
|
14
|
+
/**
|
|
15
|
+
* Tool description for the AI
|
|
16
|
+
*/
|
|
17
|
+
const TaskProgressToolDescription = `Manage a structured todo list to track progress and plan tasks throughout your session.
|
|
18
|
+
|
|
19
|
+
**When to use this tool:**
|
|
20
|
+
- Complex multi-step work requiring planning and tracking (3+ steps)
|
|
21
|
+
- When breaking down larger tasks into smaller actionable steps
|
|
22
|
+
- Before starting work on any todo (mark as in-progress)
|
|
23
|
+
- Immediately after completing each todo (mark as completed)
|
|
24
|
+
- To give users visibility into your progress and planning
|
|
25
|
+
|
|
26
|
+
**When NOT to use:**
|
|
27
|
+
- Single, trivial tasks completed in one step
|
|
28
|
+
- Purely conversational/informational requests
|
|
29
|
+
- Simple file reads or searches
|
|
30
|
+
|
|
31
|
+
**Critical workflow:**
|
|
32
|
+
1. Plan tasks by creating todo list with specific, actionable items
|
|
33
|
+
2. Mark ONE todo as in-progress before starting work
|
|
34
|
+
3. Complete the work (may involve multiple tool calls)
|
|
35
|
+
4. Mark that todo as completed IMMEDIATELY
|
|
36
|
+
5. Move to next todo and repeat
|
|
37
|
+
|
|
38
|
+
**Todo states:**
|
|
39
|
+
- not-started: Todo not yet begun
|
|
40
|
+
- in-progress: Currently working (limit ONE at a time)
|
|
41
|
+
- completed: Finished successfully
|
|
42
|
+
- failed: Task could not be completed
|
|
43
|
+
|
|
44
|
+
**Important:** Mark todos completed as soon as they are done. Do not batch completions.`;
|
|
45
|
+
/**
|
|
46
|
+
* JSON Schema for the tool input
|
|
47
|
+
*/
|
|
48
|
+
const TaskProgressToolSchema = {
|
|
49
|
+
type: 'object',
|
|
50
|
+
properties: {
|
|
51
|
+
todoList: {
|
|
52
|
+
type: 'array',
|
|
53
|
+
description: 'Complete array of all todo items. Must include ALL items - both existing and new.',
|
|
54
|
+
items: {
|
|
55
|
+
type: 'object',
|
|
56
|
+
properties: {
|
|
57
|
+
id: {
|
|
58
|
+
type: 'number',
|
|
59
|
+
description: 'Unique identifier for the todo. Use sequential numbers starting from 1.',
|
|
60
|
+
},
|
|
61
|
+
title: {
|
|
62
|
+
type: 'string',
|
|
63
|
+
description: 'Concise action-oriented todo label (3-7 words). Displayed in UI.',
|
|
64
|
+
},
|
|
65
|
+
status: {
|
|
66
|
+
type: 'string',
|
|
67
|
+
enum: ['not-started', 'in-progress', 'completed', 'failed'],
|
|
68
|
+
description: 'not-started: Not begun | in-progress: Currently working (max 1) | completed: Fully finished | failed: Could not complete',
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
required: ['id', 'title', 'status'],
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
required: ['todoList'],
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Tool definition for registration/export
|
|
79
|
+
*/
|
|
80
|
+
const TaskProgressToolDefinition = {
|
|
81
|
+
name: TaskProgressToolName,
|
|
82
|
+
description: TaskProgressToolDescription,
|
|
83
|
+
schema: TaskProgressToolSchema,
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Creates a TaskProgress tool that allows the AI to manage a todo list
|
|
87
|
+
* and emits events for the UI to display progress.
|
|
88
|
+
*
|
|
89
|
+
* This tool is designed for ephemeral agents doing complex, multi-step work.
|
|
90
|
+
* It should NOT be included for:
|
|
91
|
+
* - Persistent workflow agents
|
|
92
|
+
* - Simple tool-calling agents
|
|
93
|
+
* - No-code/low-code builder workflows (unless explicitly enabled)
|
|
94
|
+
*
|
|
95
|
+
* @param params - Optional parameters including external callback
|
|
96
|
+
* @returns DynamicStructuredTool that can be added to agent tools
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```typescript
|
|
100
|
+
* // Add to agent tools for ephemeral research/planning agents
|
|
101
|
+
* const tools = [
|
|
102
|
+
* createTaskProgressTool(),
|
|
103
|
+
* // ... other tools
|
|
104
|
+
* ];
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
function createTaskProgressTool(params = {}) {
|
|
108
|
+
const { onTaskUpdate } = params;
|
|
109
|
+
return tools.tool(async (rawInput, config) => {
|
|
110
|
+
const { todoList } = rawInput;
|
|
111
|
+
// Validate input
|
|
112
|
+
if (!Array.isArray(todoList)) {
|
|
113
|
+
return 'Error: todoList must be an array of task items.';
|
|
114
|
+
}
|
|
115
|
+
// Validate each task
|
|
116
|
+
for (const task of todoList) {
|
|
117
|
+
if (typeof task.id !== 'number') {
|
|
118
|
+
return `Error: Task id must be a number. Got: ${typeof task.id}`;
|
|
119
|
+
}
|
|
120
|
+
if (typeof task.title !== 'string' || task.title.trim() === '') {
|
|
121
|
+
return `Error: Task title must be a non-empty string for task ${task.id}`;
|
|
122
|
+
}
|
|
123
|
+
if (!['not-started', 'in-progress', 'completed', 'failed'].includes(task.status)) {
|
|
124
|
+
return `Error: Invalid status "${task.status}" for task ${task.id}. Must be one of: not-started, in-progress, completed, failed`;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
// Check for multiple in-progress tasks (warning, not error)
|
|
128
|
+
const inProgressCount = todoList.filter((t) => t.status === 'in-progress').length;
|
|
129
|
+
const warning = inProgressCount > 1
|
|
130
|
+
? `\nWarning: ${inProgressCount} tasks marked as in-progress. Best practice is to work on one task at a time.`
|
|
131
|
+
: '';
|
|
132
|
+
// Check if all tasks are complete
|
|
133
|
+
const allComplete = todoList.length > 0 &&
|
|
134
|
+
todoList.every((t) => t.status === 'completed' || t.status === 'failed');
|
|
135
|
+
// Create the payload for SSE event
|
|
136
|
+
const payload = {
|
|
137
|
+
tasks: todoList,
|
|
138
|
+
timestamp: new Date().toISOString(),
|
|
139
|
+
isComplete: allComplete,
|
|
140
|
+
};
|
|
141
|
+
// Dispatch SSE event for UI to consume
|
|
142
|
+
await events.safeDispatchCustomEvent(_enum.GraphEvents.ON_TASK_PROGRESS, payload, config);
|
|
143
|
+
// Call external callback if provided
|
|
144
|
+
if (onTaskUpdate) {
|
|
145
|
+
try {
|
|
146
|
+
await onTaskUpdate(todoList);
|
|
147
|
+
}
|
|
148
|
+
catch (e) {
|
|
149
|
+
// Don't fail the tool call if callback fails
|
|
150
|
+
// eslint-disable-next-line no-console
|
|
151
|
+
console.warn('TaskProgress callback error:', e);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
// Build response message
|
|
155
|
+
const completed = todoList.filter((t) => t.status === 'completed').length;
|
|
156
|
+
const inProgress = todoList.filter((t) => t.status === 'in-progress').length;
|
|
157
|
+
const notStarted = todoList.filter((t) => t.status === 'not-started').length;
|
|
158
|
+
return `Todo list updated successfully. Status: ${completed}/${todoList.length} completed, ${inProgress} in progress, ${notStarted} remaining.${warning}`;
|
|
159
|
+
}, {
|
|
160
|
+
name: TaskProgressToolName,
|
|
161
|
+
description: TaskProgressToolDescription,
|
|
162
|
+
schema: TaskProgressToolSchema,
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
exports.TaskProgressToolDefinition = TaskProgressToolDefinition;
|
|
167
|
+
exports.TaskProgressToolDescription = TaskProgressToolDescription;
|
|
168
|
+
exports.TaskProgressToolName = TaskProgressToolName;
|
|
169
|
+
exports.TaskProgressToolSchema = TaskProgressToolSchema;
|
|
170
|
+
exports.createTaskProgressTool = createTaskProgressTool;
|
|
171
|
+
exports.default = createTaskProgressTool;
|
|
172
|
+
//# sourceMappingURL=TaskProgress.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TaskProgress.cjs","sources":["../../../src/tools/TaskProgress.ts"],"sourcesContent":["// src/tools/TaskProgress.ts\r\nimport { tool, DynamicStructuredTool } from '@langchain/core/tools';\r\nimport { safeDispatchCustomEvent } from '@/utils/events';\r\nimport { GraphEvents } from '@/common';\r\n\r\n/**\r\n * Task status enum matching the UI component expectations\r\n */\r\nexport type TaskStatus = 'not-started' | 'in-progress' | 'completed' | 'failed';\r\n\r\n/**\r\n * Individual task item in the todo list\r\n */\r\nexport interface TaskItem {\r\n /** Unique identifier for the task (sequential number starting from 1) */\r\n id: number;\r\n /** Short, action-oriented title (3-7 words) */\r\n title: string;\r\n /** Current status of the task */\r\n status: TaskStatus;\r\n /** Optional message for additional context */\r\n message?: string;\r\n}\r\n\r\n/**\r\n * Payload sent via SSE event for task progress updates\r\n * This matches the format expected by the Ranger UI\r\n */\r\nexport interface TaskProgressPayload {\r\n /** Complete list of all tasks */\r\n tasks: TaskItem[];\r\n /** Timestamp of the update */\r\n timestamp: string;\r\n /** Optional title for the task group */\r\n title?: string;\r\n /** Whether all tasks are complete */\r\n isComplete?: boolean;\r\n}\r\n\r\n/**\r\n * Tool name constant - matches what AI calls\r\n */\r\nexport const TaskProgressToolName = 'manage_todo_list';\r\n\r\n/**\r\n * Tool description for the AI\r\n */\r\nexport const TaskProgressToolDescription = `Manage a structured todo list to track progress and plan tasks throughout your session.\r\n\r\n**When to use this tool:**\r\n- Complex multi-step work requiring planning and tracking (3+ steps)\r\n- When breaking down larger tasks into smaller actionable steps\r\n- Before starting work on any todo (mark as in-progress)\r\n- Immediately after completing each todo (mark as completed)\r\n- To give users visibility into your progress and planning\r\n\r\n**When NOT to use:**\r\n- Single, trivial tasks completed in one step\r\n- Purely conversational/informational requests\r\n- Simple file reads or searches\r\n\r\n**Critical workflow:**\r\n1. Plan tasks by creating todo list with specific, actionable items\r\n2. Mark ONE todo as in-progress before starting work\r\n3. Complete the work (may involve multiple tool calls)\r\n4. Mark that todo as completed IMMEDIATELY\r\n5. Move to next todo and repeat\r\n\r\n**Todo states:**\r\n- not-started: Todo not yet begun\r\n- in-progress: Currently working (limit ONE at a time)\r\n- completed: Finished successfully\r\n- failed: Task could not be completed\r\n\r\n**Important:** Mark todos completed as soon as they are done. Do not batch completions.`;\r\n\r\n/**\r\n * JSON Schema for the tool input\r\n */\r\nexport const TaskProgressToolSchema = {\r\n type: 'object',\r\n properties: {\r\n todoList: {\r\n type: 'array',\r\n description:\r\n 'Complete array of all todo items. Must include ALL items - both existing and new.',\r\n items: {\r\n type: 'object',\r\n properties: {\r\n id: {\r\n type: 'number',\r\n description:\r\n 'Unique identifier for the todo. Use sequential numbers starting from 1.',\r\n },\r\n title: {\r\n type: 'string',\r\n description:\r\n 'Concise action-oriented todo label (3-7 words). Displayed in UI.',\r\n },\r\n status: {\r\n type: 'string',\r\n enum: ['not-started', 'in-progress', 'completed', 'failed'],\r\n description:\r\n 'not-started: Not begun | in-progress: Currently working (max 1) | completed: Fully finished | failed: Could not complete',\r\n },\r\n },\r\n required: ['id', 'title', 'status'],\r\n },\r\n },\r\n },\r\n required: ['todoList'],\r\n} as const;\r\n\r\n/**\r\n * Tool definition for registration/export\r\n */\r\nexport const TaskProgressToolDefinition = {\r\n name: TaskProgressToolName,\r\n description: TaskProgressToolDescription,\r\n schema: TaskProgressToolSchema,\r\n} as const;\r\n\r\n/**\r\n * Parameters for creating the TaskProgress tool\r\n */\r\nexport interface TaskProgressToolParams {\r\n /**\r\n * Optional callback to handle task updates externally\r\n * Called with the task list whenever it's updated\r\n */\r\n onTaskUpdate?: (tasks: TaskItem[]) => void | Promise<void>;\r\n}\r\n\r\n/**\r\n * Creates a TaskProgress tool that allows the AI to manage a todo list\r\n * and emits events for the UI to display progress.\r\n *\r\n * This tool is designed for ephemeral agents doing complex, multi-step work.\r\n * It should NOT be included for:\r\n * - Persistent workflow agents\r\n * - Simple tool-calling agents\r\n * - No-code/low-code builder workflows (unless explicitly enabled)\r\n *\r\n * @param params - Optional parameters including external callback\r\n * @returns DynamicStructuredTool that can be added to agent tools\r\n *\r\n * @example\r\n * ```typescript\r\n * // Add to agent tools for ephemeral research/planning agents\r\n * const tools = [\r\n * createTaskProgressTool(),\r\n * // ... other tools\r\n * ];\r\n * ```\r\n */\r\nexport function createTaskProgressTool(\r\n params: TaskProgressToolParams = {}\r\n): DynamicStructuredTool {\r\n const { onTaskUpdate } = params;\r\n\r\n return tool(\r\n async (rawInput, config) => {\r\n const { todoList } = rawInput as { todoList: TaskItem[] };\r\n\r\n // Validate input\r\n if (!Array.isArray(todoList)) {\r\n return 'Error: todoList must be an array of task items.';\r\n }\r\n\r\n // Validate each task\r\n for (const task of todoList) {\r\n if (typeof task.id !== 'number') {\r\n return `Error: Task id must be a number. Got: ${typeof task.id}`;\r\n }\r\n if (typeof task.title !== 'string' || task.title.trim() === '') {\r\n return `Error: Task title must be a non-empty string for task ${task.id}`;\r\n }\r\n if (\r\n !['not-started', 'in-progress', 'completed', 'failed'].includes(\r\n task.status\r\n )\r\n ) {\r\n return `Error: Invalid status \"${task.status}\" for task ${task.id}. Must be one of: not-started, in-progress, completed, failed`;\r\n }\r\n }\r\n\r\n // Check for multiple in-progress tasks (warning, not error)\r\n const inProgressCount = todoList.filter(\r\n (t) => t.status === 'in-progress'\r\n ).length;\r\n const warning =\r\n inProgressCount > 1\r\n ? `\\nWarning: ${inProgressCount} tasks marked as in-progress. Best practice is to work on one task at a time.`\r\n : '';\r\n\r\n // Check if all tasks are complete\r\n const allComplete =\r\n todoList.length > 0 &&\r\n todoList.every(\r\n (t) => t.status === 'completed' || t.status === 'failed'\r\n );\r\n\r\n // Create the payload for SSE event\r\n const payload: TaskProgressPayload = {\r\n tasks: todoList,\r\n timestamp: new Date().toISOString(),\r\n isComplete: allComplete,\r\n };\r\n\r\n // Dispatch SSE event for UI to consume\r\n await safeDispatchCustomEvent(\r\n GraphEvents.ON_TASK_PROGRESS,\r\n payload,\r\n config\r\n );\r\n\r\n // Call external callback if provided\r\n if (onTaskUpdate) {\r\n try {\r\n await onTaskUpdate(todoList);\r\n } catch (e) {\r\n // Don't fail the tool call if callback fails\r\n // eslint-disable-next-line no-console\r\n console.warn('TaskProgress callback error:', e);\r\n }\r\n }\r\n\r\n // Build response message\r\n const completed = todoList.filter((t) => t.status === 'completed').length;\r\n const inProgress = todoList.filter(\r\n (t) => t.status === 'in-progress'\r\n ).length;\r\n const notStarted = todoList.filter(\r\n (t) => t.status === 'not-started'\r\n ).length;\r\n\r\n return `Todo list updated successfully. Status: ${completed}/${todoList.length} completed, ${inProgress} in progress, ${notStarted} remaining.${warning}`;\r\n },\r\n {\r\n name: TaskProgressToolName,\r\n description: TaskProgressToolDescription,\r\n schema: TaskProgressToolSchema,\r\n }\r\n );\r\n}\r\n\r\nexport default createTaskProgressTool;\r\n"],"names":["tool","safeDispatchCustomEvent","GraphEvents"],"mapp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S,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;AACnC,YAAA,UAAU,EAAE,WAAW;SACxB;;QAGD,MAAMC,8BAAuB,CAC3BC,iBAAW,CAAC,gBAAgB,EAC5B,OAAO,EACP,MAAM,CACP;;QAGD,IAAI,YAAY,EAAE;AAChB,YAAA,IAAI;AACF,gBAAA,MAAM,YAAY,CAAC,QAAQ,CAAC;;YAC5B,OAAO,CAAC,EAAE;;;AAGV,gBAAA,OAAO,CAAC,IAAI,CAAC,8BAA8B,EAAE,CAAC,CAAC;;;;AAKnD,QAAA,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,WAAW,CAAC,CAAC,MAAM;AACzE,QAAA,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,CAChC,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,aAAa,CAClC,CAAC,MAAM;AACR,QAAA,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,CAChC,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,aAAa,CAClC,CAAC,MAAM;AAER,QAAA,OAAO,CAA2C,wCAAA,EAAA,SAAS,CAAI,CAAA,EAAA,QAAQ,CAAC,MAAM,CAAe,YAAA,EAAA,UAAU,CAAiB,cAAA,EAAA,UAAU,CAAc,WAAA,EAAA,OAAO,EAAE;AAC3J,KAAC,EACD;AACE,QAAA,IAAI,EAAE,oBAAoB;AAC1B,QAAA,WAAW,EAAE,2BAA2B;AACxC,QAAA,MAAM,EAAE,sBAAsB;AAC/B,KAAA,CACF;AACH;;;;;;;;;"}
|
package/dist/esm/common/enum.mjs
CHANGED
|
@@ -25,6 +25,8 @@ var GraphEvents;
|
|
|
25
25
|
GraphEvents["ON_STRUCTURED_OUTPUT"] = "on_structured_output";
|
|
26
26
|
/** [Custom] Request to execute tools - dispatched by ToolNode, handled by host */
|
|
27
27
|
GraphEvents["ON_TOOL_EXECUTE"] = "on_tool_execute";
|
|
28
|
+
/** [Custom] Task progress update - emitted when agent updates todo list */
|
|
29
|
+
GraphEvents["ON_TASK_PROGRESS"] = "on_task_progress";
|
|
28
30
|
/* Official Events */
|
|
29
31
|
/** Custom event, emitted by system */
|
|
30
32
|
GraphEvents["ON_CUSTOM_EVENT"] = "on_custom_event";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enum.mjs","sources":["../../../src/common/enum.ts"],"sourcesContent":["/**\n * Enum representing the various event types emitted during the execution of runnables.\n * These events provide real-time information about the progress and state of different components.\n *\n * @enum {string}\n */\nexport enum GraphEvents {\n /* Custom Events */\n\n /** [Custom] Agent update event in multi-agent graph/workflow */\n ON_AGENT_UPDATE = 'on_agent_update',\n /** [Custom] Delta event for run steps (message creation and tool calls) */\n ON_RUN_STEP = 'on_run_step',\n /** [Custom] Delta event for run steps (tool calls) */\n ON_RUN_STEP_DELTA = 'on_run_step_delta',\n /** [Custom] Completed event for run steps (tool calls) */\n ON_RUN_STEP_COMPLETED = 'on_run_step_completed',\n /** [Custom] Delta events for messages */\n ON_MESSAGE_DELTA = 'on_message_delta',\n /** [Custom] Reasoning Delta events for messages */\n ON_REASONING_DELTA = 'on_reasoning_delta',\n /** [Custom] Context analytics event for traces */\n ON_CONTEXT_ANALYTICS = 'on_context_analytics',\n /** [Custom] Structured output event - emitted when agent returns structured JSON */\n ON_STRUCTURED_OUTPUT = 'on_structured_output',\n /** [Custom] Request to execute tools - dispatched by ToolNode, handled by host */\n ON_TOOL_EXECUTE = 'on_tool_execute',\n\n /* Official Events */\n\n /** Custom event, emitted by system */\n ON_CUSTOM_EVENT = 'on_custom_event',\n /** Emitted when a chat model starts processing. */\n CHAT_MODEL_START = 'on_chat_model_start',\n\n /** Emitted when a chat model streams a chunk of its response. */\n CHAT_MODEL_STREAM = 'on_chat_model_stream',\n\n /** Emitted when a chat model completes its processing. */\n CHAT_MODEL_END = 'on_chat_model_end',\n\n /** Emitted when a language model starts processing. */\n LLM_START = 'on_llm_start',\n\n /** Emitted when a language model streams a chunk of its response. */\n LLM_STREAM = 'on_llm_stream',\n\n /** Emitted when a language model completes its processing. */\n LLM_END = 'on_llm_end',\n\n /** Emitted when a chain starts processing. */\n CHAIN_START = 'on_chain_start',\n\n /** Emitted when a chain streams a chunk of its output. */\n CHAIN_STREAM = 'on_chain_stream',\n\n /** Emitted when a chain completes its processing. */\n CHAIN_END = 'on_chain_end',\n\n /** Emitted when a tool starts its operation. */\n TOOL_START = 'on_tool_start',\n\n /** Emitted when a tool completes its operation. */\n TOOL_END = 'on_tool_end',\n\n /** Emitted when a retriever starts its operation. */\n RETRIEVER_START = 'on_retriever_start',\n\n /** Emitted when a retriever completes its operation. */\n RETRIEVER_END = 'on_retriever_end',\n\n /** Emitted when a prompt starts processing. */\n PROMPT_START = 'on_prompt_start',\n\n /** Emitted when a prompt completes its processing. */\n PROMPT_END = 'on_prompt_end',\n}\n\nexport enum Providers {\n OPENAI = 'openAI',\n VERTEXAI = 'vertexai',\n BEDROCK = 'bedrock',\n ANTHROPIC = 'anthropic',\n MISTRALAI = 'mistralai',\n MISTRAL = 'mistral',\n GOOGLE = 'google',\n AZURE = 'azureOpenAI',\n DEEPSEEK = 'deepseek',\n OPENROUTER = 'openrouter',\n XAI = 'xai',\n}\n\nexport enum GraphNodeKeys {\n TOOLS = 'tools=',\n AGENT = 'agent=',\n ROUTER = 'router',\n PRE_TOOLS = 'pre_tools',\n POST_TOOLS = 'post_tools',\n}\n\nexport enum GraphNodeActions {\n TOOL_NODE = 'tool_node',\n CALL_MODEL = 'call_model',\n ROUTE_MESSAGE = 'route_message',\n}\n\nexport enum CommonEvents {\n LANGGRAPH = 'LangGraph',\n}\n\nexport enum StepTypes {\n TOOL_CALLS = 'tool_calls',\n MESSAGE_CREATION = 'message_creation',\n}\n\nexport enum ContentTypes {\n TEXT = 'text',\n ERROR = 'error',\n THINK = 'think',\n TOOL_CALL = 'tool_call',\n IMAGE_URL = 'image_url',\n IMAGE_FILE = 'image_file',\n /** Anthropic */\n THINKING = 'thinking',\n /** Vertex AI / Google Common */\n REASONING = 'reasoning',\n /** Multi-Agent Switch */\n AGENT_UPDATE = 'agent_update',\n /** Bedrock */\n REASONING_CONTENT = 'reasoning_content',\n}\n\nexport enum ToolCallTypes {\n FUNCTION = 'function',\n RETRIEVAL = 'retrieval',\n FILE_SEARCH = 'file_search',\n CODE_INTERPRETER = 'code_interpreter',\n /* Agents Tool Call */\n TOOL_CALL = 'tool_call',\n}\n\nexport enum Callback {\n TOOL_ERROR = 'handleToolError',\n TOOL_START = 'handleToolStart',\n TOOL_END = 'handleToolEnd',\n CUSTOM_EVENT = 'handleCustomEvent',\n /*\n LLM_START = 'handleLLMStart',\n LLM_NEW_TOKEN = 'handleLLMNewToken',\n LLM_ERROR = 'handleLLMError',\n LLM_END = 'handleLLMEnd',\n CHAT_MODEL_START = 'handleChatModelStart',\n CHAIN_START = 'handleChainStart',\n CHAIN_ERROR = 'handleChainError',\n CHAIN_END = 'handleChainEnd',\n TEXT = 'handleText',\n AGENT_ACTION = 'handleAgentAction',\n AGENT_END = 'handleAgentEnd',\n RETRIEVER_START = 'handleRetrieverStart',\n RETRIEVER_END = 'handleRetrieverEnd',\n RETRIEVER_ERROR = 'handleRetrieverError',\n */\n}\n\nexport enum Constants {\n OFFICIAL_CODE_BASEURL = 'https://api.illuma.ai/v1',\n EXECUTE_CODE = 'execute_code',\n TOOL_SEARCH = 'tool_search',\n PROGRAMMATIC_TOOL_CALLING = 'run_tools_with_code',\n WEB_SEARCH = 'web_search',\n CONTENT_AND_ARTIFACT = 'content_and_artifact',\n LC_TRANSFER_TO_ = 'lc_transfer_to_',\n /** Delimiter for MCP tools: toolName_mcp_serverName */\n MCP_DELIMITER = '_mcp_',\n}\n\nexport enum TitleMethod {\n STRUCTURED = 'structured',\n FUNCTIONS = 'functions',\n COMPLETION = 'completion',\n}\n\nexport enum EnvVar {\n CODE_API_KEY = 'CODE_EXECUTOR_API_KEY',\n CODE_BASEURL = 'CODE_EXECUTOR_BASEURL',\n}\n\n/**\n * Message type identifiers used by LangChain's BaseMessage.getType().\n * Use these constants instead of instanceof checks to avoid module mismatch issues\n * when different copies of @langchain/core/messages are loaded.\n */\nexport enum MessageTypes {\n HUMAN = 'human',\n AI = 'ai',\n SYSTEM = 'system',\n TOOL = 'tool',\n FUNCTION = 'function',\n GENERIC = 'generic',\n DEVELOPER = 'developer',\n REMOVE = 'remove',\n}\n"],"names":[],"mappings":"AAAA;;;;;AAKG;IACS;AAAZ,CAAA,UAAY,WAAW,EAAA;;;AAIrB,IAAA,WAAA,CAAA,iBAAA,CAAA,GAAA,iBAAmC;;AAEnC,IAAA,WAAA,CAAA,aAAA,CAAA,GAAA,aAA2B;;AAE3B,IAAA,WAAA,CAAA,mBAAA,CAAA,GAAA,mBAAuC;;AAEvC,IAAA,WAAA,CAAA,uBAAA,CAAA,GAAA,uBAA+C;;AAE/C,IAAA,WAAA,CAAA,kBAAA,CAAA,GAAA,kBAAqC;;AAErC,IAAA,WAAA,CAAA,oBAAA,CAAA,GAAA,oBAAyC;;AAEzC,IAAA,WAAA,CAAA,sBAAA,CAAA,GAAA,sBAA6C;;AAE7C,IAAA,WAAA,CAAA,sBAAA,CAAA,GAAA,sBAA6C;;AAE7C,IAAA,WAAA,CAAA,iBAAA,CAAA,GAAA,iBAAmC;;;AAKnC,IAAA,WAAA,CAAA,iBAAA,CAAA,GAAA,iBAAmC;;AAEnC,IAAA,WAAA,CAAA,kBAAA,CAAA,GAAA,qBAAwC;;AAGxC,IAAA,WAAA,CAAA,mBAAA,CAAA,GAAA,sBAA0C;;AAG1C,IAAA,WAAA,CAAA,gBAAA,CAAA,GAAA,mBAAoC;;AAGpC,IAAA,WAAA,CAAA,WAAA,CAAA,GAAA,cAA0B;;AAG1B,IAAA,WAAA,CAAA,YAAA,CAAA,GAAA,eAA4B;;AAG5B,IAAA,WAAA,CAAA,SAAA,CAAA,GAAA,YAAsB;;AAGtB,IAAA,WAAA,CAA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various event types emitted during the execution of runnables.\n * These events provide real-time information about the progress and state of different components.\n *\n * @enum {string}\n */\nexport enum GraphEvents {\n /* Custom Events */\n\n /** [Custom] Agent update event in multi-agent graph/workflow */\n ON_AGENT_UPDATE = 'on_agent_update',\n /** [Custom] Delta event for run steps (message creation and tool calls) */\n ON_RUN_STEP = 'on_run_step',\n /** [Custom] Delta event for run steps (tool calls) */\n ON_RUN_STEP_DELTA = 'on_run_step_delta',\n /** [Custom] Completed event for run steps (tool calls) */\n ON_RUN_STEP_COMPLETED = 'on_run_step_completed',\n /** [Custom] Delta events for messages */\n ON_MESSAGE_DELTA = 'on_message_delta',\n /** [Custom] Reasoning Delta events for messages */\n ON_REASONING_DELTA = 'on_reasoning_delta',\n /** [Custom] Context analytics event for traces */\n ON_CONTEXT_ANALYTICS = 'on_context_analytics',\n /** [Custom] Structured output event - emitted when agent returns structured JSON */\n ON_STRUCTURED_OUTPUT = 'on_structured_output',\n /** [Custom] Request to execute tools - dispatched by ToolNode, handled by host */\n ON_TOOL_EXECUTE = 'on_tool_execute',\n /** [Custom] Task progress update - emitted when agent updates todo list */\n ON_TASK_PROGRESS = 'on_task_progress',\n\n /* Official Events */\n\n /** Custom event, emitted by system */\n ON_CUSTOM_EVENT = 'on_custom_event',\n /** Emitted when a chat model starts processing. */\n CHAT_MODEL_START = 'on_chat_model_start',\n\n /** Emitted when a chat model streams a chunk of its response. */\n CHAT_MODEL_STREAM = 'on_chat_model_stream',\n\n /** Emitted when a chat model completes its processing. */\n CHAT_MODEL_END = 'on_chat_model_end',\n\n /** Emitted when a language model starts processing. */\n LLM_START = 'on_llm_start',\n\n /** Emitted when a language model streams a chunk of its response. */\n LLM_STREAM = 'on_llm_stream',\n\n /** Emitted when a language model completes its processing. */\n LLM_END = 'on_llm_end',\n\n /** Emitted when a chain starts processing. */\n CHAIN_START = 'on_chain_start',\n\n /** Emitted when a chain streams a chunk of its output. */\n CHAIN_STREAM = 'on_chain_stream',\n\n /** Emitted when a chain completes its processing. */\n CHAIN_END = 'on_chain_end',\n\n /** Emitted when a tool starts its operation. */\n TOOL_START = 'on_tool_start',\n\n /** Emitted when a tool completes its operation. */\n TOOL_END = 'on_tool_end',\n\n /** Emitted when a retriever starts its operation. */\n RETRIEVER_START = 'on_retriever_start',\n\n /** Emitted when a retriever completes its operation. */\n RETRIEVER_END = 'on_retriever_end',\n\n /** Emitted when a prompt starts processing. */\n PROMPT_START = 'on_prompt_start',\n\n /** Emitted when a prompt completes its processing. */\n PROMPT_END = 'on_prompt_end',\n}\n\nexport enum Providers {\n OPENAI = 'openAI',\n VERTEXAI = 'vertexai',\n BEDROCK = 'bedrock',\n ANTHROPIC = 'anthropic',\n MISTRALAI = 'mistralai',\n MISTRAL = 'mistral',\n GOOGLE = 'google',\n AZURE = 'azureOpenAI',\n DEEPSEEK = 'deepseek',\n OPENROUTER = 'openrouter',\n XAI = 'xai',\n}\n\nexport enum GraphNodeKeys {\n TOOLS = 'tools=',\n AGENT = 'agent=',\n ROUTER = 'router',\n PRE_TOOLS = 'pre_tools',\n POST_TOOLS = 'post_tools',\n}\n\nexport enum GraphNodeActions {\n TOOL_NODE = 'tool_node',\n CALL_MODEL = 'call_model',\n ROUTE_MESSAGE = 'route_message',\n}\n\nexport enum CommonEvents {\n LANGGRAPH = 'LangGraph',\n}\n\nexport enum StepTypes {\n TOOL_CALLS = 'tool_calls',\n MESSAGE_CREATION = 'message_creation',\n}\n\nexport enum ContentTypes {\n TEXT = 'text',\n ERROR = 'error',\n THINK = 'think',\n TOOL_CALL = 'tool_call',\n IMAGE_URL = 'image_url',\n IMAGE_FILE = 'image_file',\n /** Anthropic */\n THINKING = 'thinking',\n /** Vertex AI / Google Common */\n REASONING = 'reasoning',\n /** Multi-Agent Switch */\n AGENT_UPDATE = 'agent_update',\n /** Bedrock */\n REASONING_CONTENT = 'reasoning_content',\n}\n\nexport enum ToolCallTypes {\n FUNCTION = 'function',\n RETRIEVAL = 'retrieval',\n FILE_SEARCH = 'file_search',\n CODE_INTERPRETER = 'code_interpreter',\n /* Agents Tool Call */\n TOOL_CALL = 'tool_call',\n}\n\nexport enum Callback {\n TOOL_ERROR = 'handleToolError',\n TOOL_START = 'handleToolStart',\n TOOL_END = 'handleToolEnd',\n CUSTOM_EVENT = 'handleCustomEvent',\n /*\n LLM_START = 'handleLLMStart',\n LLM_NEW_TOKEN = 'handleLLMNewToken',\n LLM_ERROR = 'handleLLMError',\n LLM_END = 'handleLLMEnd',\n CHAT_MODEL_START = 'handleChatModelStart',\n CHAIN_START = 'handleChainStart',\n CHAIN_ERROR = 'handleChainError',\n CHAIN_END = 'handleChainEnd',\n TEXT = 'handleText',\n AGENT_ACTION = 'handleAgentAction',\n AGENT_END = 'handleAgentEnd',\n RETRIEVER_START = 'handleRetrieverStart',\n RETRIEVER_END = 'handleRetrieverEnd',\n RETRIEVER_ERROR = 'handleRetrieverError',\n */\n}\n\nexport enum Constants {\n OFFICIAL_CODE_BASEURL = 'https://api.illuma.ai/v1',\n EXECUTE_CODE = 'execute_code',\n TOOL_SEARCH = 'tool_search',\n PROGRAMMATIC_TOOL_CALLING = 'run_tools_with_code',\n WEB_SEARCH = 'web_search',\n CONTENT_AND_ARTIFACT = 'content_and_artifact',\n LC_TRANSFER_TO_ = 'lc_transfer_to_',\n /** Delimiter for MCP tools: toolName_mcp_serverName */\n MCP_DELIMITER = '_mcp_',\n}\n\nexport enum TitleMethod {\n STRUCTURED = 'structured',\n FUNCTIONS = 'functions',\n COMPLETION = 'completion',\n}\n\nexport enum EnvVar {\n CODE_API_KEY = 'CODE_EXECUTOR_API_KEY',\n CODE_BASEURL = 'CODE_EXECUTOR_BASEURL',\n}\n\n/**\n * Message type identifiers used by LangChain's BaseMessage.getType().\n * Use these constants instead of instanceof checks to avoid module mismatch issues\n * when different copies of @langchain/core/messages are loaded.\n */\nexport enum MessageTypes {\n HUMAN = 'human',\n AI = 'ai',\n SYSTEM = 'system',\n TOOL = 'tool',\n FUNCTION = 'function',\n GENERIC = 'generic',\n DE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AA,CAAA;IAEW;AAAZ,CAAA,UAAY,WAAW,EAAA;AACrB,IAAA,WAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AACzB,IAAA,WAAA,CAAA,WAAA,CAAA,GAAA,WAAuB;AACvB,IAAA,WAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AAC3B,CAAC,EAJW,WAAW,KAAX,WAAW,GAItB,EAAA,CAAA,CAAA;IAEW;AAAZ,CAAA,UAAY,MAAM,EAAA;AAChB,IAAA,MAAA,CAAA,cAAA,CAAA,GAAA,uBAAsC;AACtC,IAAA,MAAA,CAAA,cAAA,CAAA,GAAA,uBAAsC;AACxC,CAAC,EAHW,MAAM,KAAN,MAAM,GAGjB,EAAA,CAAA,CAAA;AAED;;;;AAIG;IACS;AAAZ,CAAA,UAAY,YAAY,EAAA;AACtB,IAAA,YAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,YAAA,CAAA,IAAA,CAAA,GAAA,IAAS;AACT,IAAA,YAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,YAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,YAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,YAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,YAAA,CAAA,WAAA,CAAA,GAAA,WAAuB;AACvB,IAAA,YAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACnB,CAAC,EATW,YAAY,KAAZ,YAAY,GASvB,EAAA,CAAA,CAAA;;;;"}
|
package/dist/esm/main.mjs
CHANGED
|
@@ -16,11 +16,15 @@ export { CodeExecutionToolDefinition, CodeExecutionToolDescription, CodeExecutio
|
|
|
16
16
|
export { EBrowserTools, createBrowserTools, hasBrowserCapability } from './tools/BrowserTools.mjs';
|
|
17
17
|
export { createProgrammaticToolCallingTool, executeTools, extractUsedToolNames, fetchSessionFiles, filterToolsByUsage, formatCompletedResponse, makeRequest, normalizeToPythonIdentifier, unwrapToolResponse } from './tools/ProgrammaticToolCalling.mjs';
|
|
18
18
|
export { countNestedGroups, createToolSearch, escapeRegexSpecialChars, extractMcpServerName, formatServerListing, getAvailableMcpServers, getBaseToolName, getDeferredToolsListing, hasNestedQuantifiers, isDangerousPattern, isFromAnyMcpServer, isFromMcpServer, normalizeServerFilter, performLocalSearch, sanitizeRegex } from './tools/ToolSearch.mjs';
|
|
19
|
+
export { TaskProgressToolDefinition, TaskProgressToolDescription, TaskProgressToolName, TaskProgressToolSchema, createTaskProgressTool } from './tools/TaskProgress.mjs';
|
|
19
20
|
export { ToolNode, toolsCondition } from './tools/ToolNode.mjs';
|
|
20
21
|
export { createSchemaOnlyTool, createSchemaOnlyTools } from './tools/schema.mjs';
|
|
21
22
|
export { handleServerToolResult, handleToolCallChunks, handleToolCalls, toolResultTypes } from './tools/handlers.mjs';
|
|
22
23
|
export { createSearchTool } from './tools/search/tool.mjs';
|
|
23
24
|
export { DATE_RANGE, DEFAULT_COUNTRY_DESCRIPTION, DEFAULT_QUERY_DESCRIPTION, WebSearchToolDefinition, WebSearchToolDescription, WebSearchToolName, WebSearchToolSchema, countrySchema, dateSchema, imagesSchema, newsSchema, querySchema, videosSchema } from './tools/search/schema.mjs';
|
|
25
|
+
export { supervisorPrompt } from './prompts/collab.mjs';
|
|
26
|
+
export { assignTasksFunctionDescription, assignTasksFunctionParameters, endProcessFunctionDescription, endProcessFunctionParameters, taskManagerPrompt } from './prompts/taskmanager.mjs';
|
|
27
|
+
export { manageTodoListFunctionDescription, manageTodoListFunctionParameters, taskPlanningPrompt, taskPlanningPromptShort } from './prompts/taskplanning.mjs';
|
|
24
28
|
export { createValidationErrorMessage, isValidJsonSchema, normalizeJsonSchema, validateStructuredOutput, zodToJsonSchema } from './schemas/validate.mjs';
|
|
25
29
|
export { Callback, CommonEvents, Constants, ContentTypes, EnvVar, GraphEvents, GraphNodeActions, GraphNodeKeys, MessageTypes, Providers, StepTypes, TitleMethod, ToolCallTypes } from './common/enum.mjs';
|
|
26
30
|
export { joinKeys, resetIfNotEmpty } from './utils/graph.mjs';
|
package/dist/esm/main.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"main.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|