@eko-ai/eko 1.3.5 → 2.0.0
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/README.md +37 -19
- package/dist/agent/a2a.d.ts +7 -0
- package/dist/agent/a2a.d.ts.map +1 -0
- package/dist/agent/base.d.ts +47 -0
- package/dist/agent/base.d.ts.map +1 -0
- package/dist/agent/browser/browser_base.d.ts +30 -0
- package/dist/agent/browser/browser_base.d.ts.map +1 -0
- package/dist/agent/browser/browser_labels.d.ts +21 -0
- package/dist/agent/browser/browser_labels.d.ts.map +1 -0
- package/dist/agent/browser/browser_screen.d.ts +16 -0
- package/dist/agent/browser/browser_screen.d.ts.map +1 -0
- package/dist/agent/browser/build_dom_tree.d.ts +2 -0
- package/dist/agent/browser/build_dom_tree.d.ts.map +1 -0
- package/dist/agent/browser/index.d.ts +6 -0
- package/dist/agent/browser/index.d.ts.map +1 -0
- package/dist/agent/chat.d.ts +7 -0
- package/dist/agent/chat.d.ts.map +1 -0
- package/dist/agent/computer.d.ts +23 -0
- package/dist/agent/computer.d.ts.map +1 -0
- package/dist/agent/file.d.ts +14 -0
- package/dist/agent/file.d.ts.map +1 -0
- package/dist/agent/index.d.ts +9 -0
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/agent/shell.d.ts +14 -0
- package/dist/agent/shell.d.ts.map +1 -0
- package/dist/agent/timer.d.ts +5 -0
- package/dist/agent/timer.d.ts.map +1 -0
- package/dist/common/log.d.ts +43 -2
- package/dist/common/log.d.ts.map +1 -0
- package/dist/common/utils.d.ts +12 -0
- package/dist/common/utils.d.ts.map +1 -0
- package/dist/common/xml.d.ts +7 -0
- package/dist/common/xml.d.ts.map +1 -0
- package/dist/config/index.d.ts +8 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/core/chain.d.ts +45 -0
- package/dist/core/chain.d.ts.map +1 -0
- package/dist/core/context.d.ts +23 -0
- package/dist/core/context.d.ts.map +1 -0
- package/dist/core/index.d.ts +18 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/plan.d.ts +11 -0
- package/dist/core/plan.d.ts.map +1 -0
- package/dist/index.cjs.js +18163 -10856
- package/dist/index.d.ts +13 -10
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +18147 -10888
- package/dist/llm/index.d.ts +15 -0
- package/dist/llm/index.d.ts.map +1 -0
- package/dist/mcp/client.d.ts +28 -0
- package/dist/mcp/client.d.ts.map +1 -0
- package/dist/mcp/index.d.ts +28 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/prompt/agent.d.ts +6 -0
- package/dist/prompt/agent.d.ts.map +1 -0
- package/dist/prompt/plan.d.ts +4 -0
- package/dist/prompt/plan.d.ts.map +1 -0
- package/dist/tools/foreach_task.d.ts +12 -0
- package/dist/tools/foreach_task.d.ts.map +1 -0
- package/dist/tools/human_interact.d.ts +12 -0
- package/dist/tools/human_interact.d.ts.map +1 -0
- package/dist/tools/index.d.ts +19 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/task_node_status.d.ts +12 -0
- package/dist/tools/task_node_status.d.ts.map +1 -0
- package/dist/tools/variable_storage.d.ts +12 -0
- package/dist/tools/variable_storage.d.ts.map +1 -0
- package/dist/tools/watch_trigger.d.ts +12 -0
- package/dist/tools/watch_trigger.d.ts.map +1 -0
- package/dist/tools/wrapper.d.ts +12 -0
- package/dist/tools/wrapper.d.ts.map +1 -0
- package/dist/types/core.types.d.ts +114 -0
- package/dist/types/core.types.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -3
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/llm.types.d.ts +80 -51
- package/dist/types/llm.types.d.ts.map +1 -0
- package/dist/types/mcp.types.d.ts +35 -0
- package/dist/types/mcp.types.d.ts.map +1 -0
- package/dist/types/tools.types.d.ts +56 -152
- package/dist/types/tools.types.d.ts.map +1 -0
- package/package.json +18 -58
- package/dist/common/chrome/proxy.d.ts +0 -24
- package/dist/common/context-compressor.d.ts +0 -10
- package/dist/common/summarize-workflow.d.ts +0 -2
- package/dist/common/tools/cancel_workflow.d.ts +0 -9
- package/dist/common/tools/document_agent.d.ts +0 -8
- package/dist/common/tools/human.d.ts +0 -30
- package/dist/common/tools/index.d.ts +0 -4
- package/dist/common/tools/write_context.d.ts +0 -7
- package/dist/core/eko.d.ts +0 -30
- package/dist/core/tool-registry.d.ts +0 -13
- package/dist/extension/content/index.d.ts +0 -1
- package/dist/extension/core.d.ts +0 -11
- package/dist/extension/index.d.ts +0 -7
- package/dist/extension/script/bing.js +0 -25
- package/dist/extension/script/build_dom_tree.d.ts +0 -38
- package/dist/extension/script/build_dom_tree.js +0 -662
- package/dist/extension/script/common.js +0 -212
- package/dist/extension/script/duckduckgo.js +0 -25
- package/dist/extension/script/google.js +0 -26
- package/dist/extension/tools/browser.d.ts +0 -23
- package/dist/extension/tools/browser_action.d.ts +0 -20
- package/dist/extension/tools/export_file.d.ts +0 -18
- package/dist/extension/tools/extract_content.d.ts +0 -18
- package/dist/extension/tools/get_all_tabs.d.ts +0 -9
- package/dist/extension/tools/html_script.d.ts +0 -10
- package/dist/extension/tools/index.d.ts +0 -12
- package/dist/extension/tools/open_url.d.ts +0 -19
- package/dist/extension/tools/request_login.d.ts +0 -10
- package/dist/extension/tools/screenshot.d.ts +0 -18
- package/dist/extension/tools/switch_tab.d.ts +0 -8
- package/dist/extension/tools/tab_management.d.ts +0 -13
- package/dist/extension/tools/tool_returns_screenshot.d.ts +0 -8
- package/dist/extension/tools/web_search.d.ts +0 -18
- package/dist/extension/utils.d.ts +0 -31
- package/dist/extension.cjs.js +0 -2796
- package/dist/extension.esm.js +0 -2789
- package/dist/extension_content_script.js +0 -1078
- package/dist/fellou/computer.d.ts +0 -20
- package/dist/fellou/index.d.ts +0 -6
- package/dist/fellou/tools/computer_use.d.ts +0 -18
- package/dist/fellou.cjs.js +0 -238
- package/dist/fellou.esm.js +0 -235
- package/dist/models/action.d.ts +0 -33
- package/dist/models/workflow.d.ts +0 -25
- package/dist/nodejs/core.d.ts +0 -2
- package/dist/nodejs/index.d.ts +0 -3
- package/dist/nodejs/script/build_dom_tree.d.ts +0 -1
- package/dist/nodejs/tools/browser_use.d.ts +0 -28
- package/dist/nodejs/tools/command_execute.d.ts +0 -12
- package/dist/nodejs/tools/file_read.d.ts +0 -11
- package/dist/nodejs/tools/file_write.d.ts +0 -15
- package/dist/nodejs/tools/index.d.ts +0 -5
- package/dist/nodejs.cjs.js +0 -73507
- package/dist/nodejs.esm.js +0 -73504
- package/dist/schemas/workflow.schema.d.ts +0 -44
- package/dist/services/llm/claude-provider.d.ts +0 -12
- package/dist/services/llm/openai-provider.d.ts +0 -12
- package/dist/services/llm/provider-factory.d.ts +0 -4
- package/dist/services/parser/workflow-parser.d.ts +0 -23
- package/dist/services/workflow/generator.d.ts +0 -16
- package/dist/services/workflow/templates.d.ts +0 -8
- package/dist/types/action.types.d.ts +0 -53
- package/dist/types/eko.types.d.ts +0 -37
- package/dist/types/parser.types.d.ts +0 -9
- package/dist/types/workflow.types.d.ts +0 -57
- package/dist/utils/execution-logger.d.ts +0 -69
- package/dist/utils/sleep.d.ts +0 -1
- package/dist/web/core.d.ts +0 -2
- package/dist/web/index.d.ts +0 -5
- package/dist/web/script/build_dom_tree.d.ts +0 -10
- package/dist/web/tools/browser.d.ts +0 -21
- package/dist/web/tools/browser_use.d.ts +0 -19
- package/dist/web/tools/export_file.d.ts +0 -18
- package/dist/web/tools/extract_content.d.ts +0 -17
- package/dist/web/tools/html_script.d.ts +0 -10
- package/dist/web/tools/index.d.ts +0 -6
- package/dist/web/tools/screenshot.d.ts +0 -18
- package/dist/web.cjs.js +0 -9952
- package/dist/web.esm.js +0 -9948
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LanguageModelV1CallOptions } from "@ai-sdk/provider";
|
|
2
|
+
import { GenerateResult, LLMRequest, LLMs, StreamResult } from "../types/llm.types";
|
|
3
|
+
export declare class RetryLanguageModel {
|
|
4
|
+
private llms;
|
|
5
|
+
private names;
|
|
6
|
+
private stream_first_timeout;
|
|
7
|
+
constructor(llms: LLMs, names?: string[], stream_first_timeout?: number);
|
|
8
|
+
call(request: LLMRequest): Promise<GenerateResult>;
|
|
9
|
+
doGenerate(options: LanguageModelV1CallOptions): Promise<GenerateResult>;
|
|
10
|
+
callStream(request: LLMRequest): Promise<StreamResult>;
|
|
11
|
+
doStream(options: LanguageModelV1CallOptions): Promise<StreamResult>;
|
|
12
|
+
private getLLM;
|
|
13
|
+
private streamWrapper;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/llm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,0BAA0B,EAE3B,MAAM,kBAAkB,CAAC;AAO1B,OAAO,EACL,cAAc,EACd,UAAU,EACV,IAAI,EACJ,YAAY,EACb,MAAM,oBAAoB,CAAC;AAE5B,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,IAAI,CAAO;IACnB,OAAO,CAAC,KAAK,CAAW;IACxB,OAAO,CAAC,oBAAoB,CAAS;gBAEzB,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,EAAE,oBAAoB,CAAC,EAAE,MAAM;IASjE,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,cAAc,CAAC;IAkBlD,UAAU,CACd,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,cAAc,CAAC;IA6BpB,UAAU,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC;IAkBtD,QAAQ,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,YAAY,CAAC;IAmD1E,OAAO,CAAC,MAAM;IAoCd,OAAO,CAAC,aAAa;CA0BtB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { JSONSchema7 } from "json-schema";
|
|
2
|
+
import { ToolResult } from "../types/tools.types";
|
|
3
|
+
export type McpListToolParam = {
|
|
4
|
+
taskId: string;
|
|
5
|
+
nodeId: string;
|
|
6
|
+
environment: "browser" | "windows" | "mac" | "linux";
|
|
7
|
+
agent_name: string;
|
|
8
|
+
prompt: string;
|
|
9
|
+
browser_url?: string | null;
|
|
10
|
+
params?: Record<string, unknown> | undefined;
|
|
11
|
+
};
|
|
12
|
+
export type McpCallToolParam = {
|
|
13
|
+
name: string;
|
|
14
|
+
arguments?: Record<string, unknown> | undefined;
|
|
15
|
+
};
|
|
16
|
+
export type McpListToolResult = Array<{
|
|
17
|
+
name: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
inputSchema: JSONSchema7;
|
|
20
|
+
}>;
|
|
21
|
+
export interface IMcpClient {
|
|
22
|
+
connect(): Promise<void>;
|
|
23
|
+
listTools(param: McpListToolParam): Promise<McpListToolResult>;
|
|
24
|
+
callTool(param: McpCallToolParam): Promise<ToolResult>;
|
|
25
|
+
isConnected(): boolean;
|
|
26
|
+
close(): Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/mcp/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,SAAS,GAAG,SAAS,GAAG,KAAK,GAAG,OAAO,CAAC;IACrD,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;CACjD,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,WAAW,CAAC;CAC1B,CAAC,CAAC;AAEH,MAAM,WAAW,UAAU;IACzB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzB,SAAS,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAE/D,QAAQ,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAEvD,WAAW,IAAI,OAAO,CAAC;IAEvB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ToolResult, IMcpClient, McpCallToolParam, McpListToolParam, McpListToolResult } from "../types";
|
|
2
|
+
type SseEventData = {
|
|
3
|
+
id?: string;
|
|
4
|
+
event?: string;
|
|
5
|
+
data?: string;
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
};
|
|
8
|
+
export declare class SimpleSseMcpClient implements IMcpClient {
|
|
9
|
+
private sseUrl;
|
|
10
|
+
private clientName;
|
|
11
|
+
private sseHandler?;
|
|
12
|
+
private msgUrl?;
|
|
13
|
+
private pingTimer?;
|
|
14
|
+
private reconnectTimer?;
|
|
15
|
+
private requestMap;
|
|
16
|
+
constructor(sseServerUrl: string, clientName?: string);
|
|
17
|
+
connect(): Promise<void>;
|
|
18
|
+
onmessage(data: SseEventData): void;
|
|
19
|
+
private initialize;
|
|
20
|
+
private ping;
|
|
21
|
+
private request;
|
|
22
|
+
listTools(param: McpListToolParam): Promise<McpListToolResult>;
|
|
23
|
+
callTool(param: McpCallToolParam): Promise<ToolResult>;
|
|
24
|
+
isConnected(): boolean;
|
|
25
|
+
close(): Promise<void>;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,UAAU,CAAC;AAElB,KAAK,YAAY,GAAG;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAUF,qBAAa,kBAAmB,YAAW,UAAU;IACnD,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,UAAU,CAAC,CAAa;IAChC,OAAO,CAAC,MAAM,CAAC,CAAS;IACxB,OAAO,CAAC,SAAS,CAAC,CAAiB;IACnC,OAAO,CAAC,cAAc,CAAC,CAAiB;IACxC,OAAO,CAAC,UAAU,CAA0C;gBAEhD,YAAY,EAAE,MAAM,EAAE,UAAU,GAAE,MAAuB;IAM/D,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAkC9B,SAAS,CAAC,IAAI,EAAE,YAAY;YAoBd,UAAU;IAgBxB,OAAO,CAAC,IAAI;YAIE,OAAO;IAmCf,SAAS,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAW9D,QAAQ,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,UAAU,CAAC;IAW5D,WAAW,IAAI,OAAO;IAOhB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAQ7B"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Agent } from "../agent";
|
|
2
|
+
import Context from "../core/context";
|
|
3
|
+
import { WorkflowAgent } from "../types/core.types";
|
|
4
|
+
export declare function getAgentSystemPrompt(agent: Agent, agentNode: WorkflowAgent, context: Context, systemPrompt?: string): string;
|
|
5
|
+
export declare function getAgentUserPrompt(agent: Agent, agentNode: WorkflowAgent, context: Context): string;
|
|
6
|
+
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/prompt/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,OAAO,OAAO,MAAM,iBAAiB,CAAC;AAEtC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAkEpD,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,aAAa,EACxB,OAAO,EAAE,OAAO,EAChB,YAAY,CAAC,EAAE,MAAM,GACpB,MAAM,CA8BR;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,aAAa,EACxB,OAAO,EAAE,OAAO,GACf,MAAM,CAOR"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/prompt/plan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAwKjC,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CA0B3D;AAED,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAI5D"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { JSONSchema7 } from "json-schema";
|
|
2
|
+
import { AgentContext } from "../core/context";
|
|
3
|
+
import { Tool, ToolResult } from "../types/tools.types";
|
|
4
|
+
export declare const TOOL_NAME = "foreach_task";
|
|
5
|
+
export default class ForeachTaskTool implements Tool {
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly description: string;
|
|
8
|
+
readonly parameters: JSONSchema7;
|
|
9
|
+
constructor();
|
|
10
|
+
execute(args: Record<string, unknown>, agentContext: AgentContext): Promise<ToolResult>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=foreach_task.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"foreach_task.d.ts","sourceRoot":"","sources":["../../src/tools/foreach_task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGxD,eAAO,MAAM,SAAS,iBAAiB,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,eAAgB,YAAW,IAAI;IAClD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAa;IAClC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC;;IAgB3B,OAAO,CACX,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,YAAY,EAAE,YAAY,GACzB,OAAO,CAAC,UAAU,CAAC;CAyBvB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { JSONSchema7 } from "json-schema";
|
|
2
|
+
import { AgentContext } from "../core/context";
|
|
3
|
+
import { Tool, ToolResult } from "../types/tools.types";
|
|
4
|
+
export declare const TOOL_NAME = "human_interact";
|
|
5
|
+
export default class HumanInteractTool implements Tool {
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly description: string;
|
|
8
|
+
readonly parameters: JSONSchema7;
|
|
9
|
+
constructor();
|
|
10
|
+
execute(args: Record<string, unknown>, agentContext: AgentContext): Promise<ToolResult>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=human_interact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"human_interact.d.ts","sourceRoot":"","sources":["../../src/tools/human_interact.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAExD,eAAO,MAAM,SAAS,mBAAmB,CAAC;AAE1C,MAAM,CAAC,OAAO,OAAO,iBAAkB,YAAW,IAAI;IACpD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAa;IAClC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC;;IA4E3B,OAAO,CACX,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,YAAY,EAAE,YAAY,GACzB,OAAO,CAAC,UAAU,CAAC;CAuEvB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { JSONSchema7 } from "json-schema";
|
|
2
|
+
import { ToolWrapper } from "./wrapper";
|
|
3
|
+
import { AgentContext } from "../core/context";
|
|
4
|
+
import ForeachTaskTool from "./foreach_task";
|
|
5
|
+
import HumanInteractTool from "./human_interact";
|
|
6
|
+
import TaskNodeStatusTool from "./task_node_status";
|
|
7
|
+
import VariableStorageTool from "./variable_storage";
|
|
8
|
+
import WatchTriggerTool from "./watch_trigger";
|
|
9
|
+
import { Tool, ToolResult } from "../types/tools.types";
|
|
10
|
+
export declare class McpTool implements Tool {
|
|
11
|
+
readonly name: string;
|
|
12
|
+
readonly description?: string;
|
|
13
|
+
readonly parameters: JSONSchema7;
|
|
14
|
+
private toolWrapper;
|
|
15
|
+
constructor(toolWrapper: ToolWrapper);
|
|
16
|
+
execute(args: Record<string, unknown>, agentContext: AgentContext): Promise<ToolResult>;
|
|
17
|
+
}
|
|
18
|
+
export { ForeachTaskTool, HumanInteractTool, TaskNodeStatusTool, VariableStorageTool, WatchTriggerTool, };
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,eAAe,MAAM,gBAAgB,CAAC;AAC7C,OAAO,iBAAiB,MAAM,kBAAkB,CAAC;AACjD,OAAO,kBAAkB,MAAM,oBAAoB,CAAC;AACpD,OAAO,mBAAmB,MAAM,oBAAoB,CAAC;AACrD,OAAO,gBAAgB,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAExD,qBAAa,OAAQ,YAAW,IAAI;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC;IACjC,OAAO,CAAC,WAAW,CAAc;gBAErB,WAAW,EAAE,WAAW;IAO9B,OAAO,CACX,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,YAAY,EAAE,YAAY,GACzB,OAAO,CAAC,UAAU,CAAC;CAGvB;AAED,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,GACjB,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { JSONSchema7 } from "json-schema";
|
|
2
|
+
import { AgentContext } from "../core/context";
|
|
3
|
+
import { Tool, ToolResult } from "../types/tools.types";
|
|
4
|
+
export declare const TOOL_NAME = "task_node_status";
|
|
5
|
+
export default class TaskNodeStatusTool implements Tool {
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly description: string;
|
|
8
|
+
readonly parameters: JSONSchema7;
|
|
9
|
+
constructor();
|
|
10
|
+
execute(args: Record<string, unknown>, agentContext: AgentContext): Promise<ToolResult>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=task_node_status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task_node_status.d.ts","sourceRoot":"","sources":["../../src/tools/task_node_status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAExD,eAAO,MAAM,SAAS,qBAAqB,CAAC;AAE5C,MAAM,CAAC,OAAO,OAAO,kBAAmB,YAAW,IAAI;IACrD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAa;IAClC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC;;IA0B3B,OAAO,CACX,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,YAAY,EAAE,YAAY,GACzB,OAAO,CAAC,UAAU,CAAC;CA2BvB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { JSONSchema7 } from "json-schema";
|
|
2
|
+
import { AgentContext } from "../core/context";
|
|
3
|
+
import { Tool, ToolResult } from "../types/tools.types";
|
|
4
|
+
export declare const TOOL_NAME = "variable_storage";
|
|
5
|
+
export default class VariableStorageTool implements Tool {
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly description: string;
|
|
8
|
+
readonly parameters: JSONSchema7;
|
|
9
|
+
constructor();
|
|
10
|
+
execute(args: Record<string, unknown>, agentContext: AgentContext): Promise<ToolResult>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=variable_storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variable_storage.d.ts","sourceRoot":"","sources":["../../src/tools/variable_storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAExD,eAAO,MAAM,SAAS,qBAAqB,CAAC;AAE5C,MAAM,CAAC,OAAO,OAAO,mBAAoB,YAAW,IAAI;IACtD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAa;IAClC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC;;IA0B3B,OAAO,CACX,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,YAAY,EAAE,YAAY,GACzB,OAAO,CAAC,UAAU,CAAC;CAkDvB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { JSONSchema7 } from "json-schema";
|
|
2
|
+
import { AgentContext } from "../core/context";
|
|
3
|
+
import { Tool, ToolResult } from "../types/tools.types";
|
|
4
|
+
export declare const TOOL_NAME = "watch_trigger";
|
|
5
|
+
export default class WatchTriggerTool implements Tool {
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly description: string;
|
|
8
|
+
readonly parameters: JSONSchema7;
|
|
9
|
+
constructor();
|
|
10
|
+
execute(args: Record<string, unknown>, agentContext: AgentContext): Promise<ToolResult>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=watch_trigger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch_trigger.d.ts","sourceRoot":"","sources":["../../src/tools/watch_trigger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAExD,eAAO,MAAM,SAAS,kBAAkB,CAAC;AAEzC,MAAM,CAAC,OAAO,OAAO,gBAAiB,YAAW,IAAI;IACnD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAa;IAClC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC;;IAgB3B,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC;CAK9F"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LanguageModelV1FunctionTool } from "@ai-sdk/provider";
|
|
2
|
+
import { ToolResult, ToolExecuter, ToolSchema } from "../types/tools.types";
|
|
3
|
+
import { AgentContext } from "../core/context";
|
|
4
|
+
export declare class ToolWrapper {
|
|
5
|
+
private tool;
|
|
6
|
+
private execute;
|
|
7
|
+
constructor(toolSchema: ToolSchema, execute: ToolExecuter);
|
|
8
|
+
get name(): string;
|
|
9
|
+
getTool(): LanguageModelV1FunctionTool;
|
|
10
|
+
callTool(args: Record<string, unknown>, agentContext: AgentContext): Promise<ToolResult>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=wrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wrapper.d.ts","sourceRoot":"","sources":["../../src/tools/wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAE5E,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,qBAAa,WAAW;IACtB,OAAO,CAAC,IAAI,CAA8B;IAC1C,OAAO,CAAC,OAAO,CAAe;gBAElB,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY;IAKzD,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,OAAO,IAAI,2BAA2B;IAIhC,QAAQ,CACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,YAAY,EAAE,YAAY,GACzB,OAAO,CAAC,UAAU,CAAC;CAGvB"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { LanguageModelV1FinishReason } from "@ai-sdk/provider";
|
|
2
|
+
import { Agent } from "../agent";
|
|
3
|
+
import { LLMs } from "./llm.types";
|
|
4
|
+
import { IA2aClient } from "../agent/a2a";
|
|
5
|
+
import { IMcpClient } from "./mcp.types";
|
|
6
|
+
import { ToolResult } from "./tools.types";
|
|
7
|
+
import { AgentContext } from "../core/context";
|
|
8
|
+
export type EkoConfig = {
|
|
9
|
+
llms: LLMs;
|
|
10
|
+
agents?: Agent[];
|
|
11
|
+
planLlms?: string[];
|
|
12
|
+
callback?: StreamCallback & HumanCallback;
|
|
13
|
+
defaultMcpClient?: IMcpClient;
|
|
14
|
+
a2aClient?: IA2aClient;
|
|
15
|
+
};
|
|
16
|
+
export type StreamCallbackMessage = {
|
|
17
|
+
taskId: string;
|
|
18
|
+
agentName: string;
|
|
19
|
+
nodeId?: string | null;
|
|
20
|
+
} & ({
|
|
21
|
+
type: "workflow";
|
|
22
|
+
streamDone: boolean;
|
|
23
|
+
workflow: Workflow;
|
|
24
|
+
} | {
|
|
25
|
+
type: "text" | "thinking";
|
|
26
|
+
streamId: string;
|
|
27
|
+
streamDone: boolean;
|
|
28
|
+
text: string;
|
|
29
|
+
} | {
|
|
30
|
+
type: "file";
|
|
31
|
+
mimeType: string;
|
|
32
|
+
data: string;
|
|
33
|
+
} | {
|
|
34
|
+
type: "tool_streaming";
|
|
35
|
+
toolName: string;
|
|
36
|
+
toolId: string;
|
|
37
|
+
paramsText: string;
|
|
38
|
+
} | {
|
|
39
|
+
type: "tool_use";
|
|
40
|
+
toolName: string;
|
|
41
|
+
toolId: string;
|
|
42
|
+
params: Record<string, any>;
|
|
43
|
+
} | {
|
|
44
|
+
type: "tool_running";
|
|
45
|
+
toolName: string;
|
|
46
|
+
toolId: string;
|
|
47
|
+
text: string;
|
|
48
|
+
streamId: string;
|
|
49
|
+
streamDone: boolean;
|
|
50
|
+
} | {
|
|
51
|
+
type: "tool_result";
|
|
52
|
+
toolName: string;
|
|
53
|
+
toolId: string;
|
|
54
|
+
params: Record<string, any>;
|
|
55
|
+
toolResult: ToolResult;
|
|
56
|
+
} | {
|
|
57
|
+
type: "error";
|
|
58
|
+
error: unknown;
|
|
59
|
+
} | {
|
|
60
|
+
type: "finish";
|
|
61
|
+
finishReason: LanguageModelV1FinishReason;
|
|
62
|
+
usage: {
|
|
63
|
+
promptTokens: number;
|
|
64
|
+
completionTokens: number;
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
export interface StreamCallback {
|
|
68
|
+
onMessage: (message: StreamCallbackMessage) => void;
|
|
69
|
+
}
|
|
70
|
+
export type WorkflowTextNode = {
|
|
71
|
+
type: "normal";
|
|
72
|
+
text: string;
|
|
73
|
+
input?: string | null;
|
|
74
|
+
output?: string | null;
|
|
75
|
+
};
|
|
76
|
+
export type WorkflowForEachNode = {
|
|
77
|
+
type: "forEach";
|
|
78
|
+
items: string;
|
|
79
|
+
nodes: WorkflowNode[];
|
|
80
|
+
};
|
|
81
|
+
export type WorkflowWatchNode = {
|
|
82
|
+
type: "watch";
|
|
83
|
+
event: "dom" | "gui" | "file";
|
|
84
|
+
loop: boolean;
|
|
85
|
+
description: string;
|
|
86
|
+
triggerNodes: (WorkflowTextNode | WorkflowForEachNode)[];
|
|
87
|
+
};
|
|
88
|
+
export type WorkflowNode = WorkflowTextNode | WorkflowForEachNode | WorkflowWatchNode;
|
|
89
|
+
export type WorkflowAgent = {
|
|
90
|
+
id: string;
|
|
91
|
+
name: string;
|
|
92
|
+
task: string;
|
|
93
|
+
nodes: WorkflowNode[];
|
|
94
|
+
xml: string;
|
|
95
|
+
};
|
|
96
|
+
export type Workflow = {
|
|
97
|
+
taskId: string;
|
|
98
|
+
name: string;
|
|
99
|
+
thought: string;
|
|
100
|
+
agents: WorkflowAgent[];
|
|
101
|
+
xml: string;
|
|
102
|
+
};
|
|
103
|
+
export interface HumanCallback {
|
|
104
|
+
onHumanConfirm?: (agentContext: AgentContext, prompt: string) => Promise<boolean>;
|
|
105
|
+
onHumanInput?: (agentContext: AgentContext, prompt: string) => Promise<string>;
|
|
106
|
+
onHumanSelect?: (agentContext: AgentContext, prompt: string, options: string[], multiple?: boolean) => Promise<string[]>;
|
|
107
|
+
onHumanHelp?: (agentContext: AgentContext, helpType: "request_login" | "request_assistance", prompt: string) => Promise<boolean>;
|
|
108
|
+
}
|
|
109
|
+
export type EkoResult = {
|
|
110
|
+
success: boolean;
|
|
111
|
+
stopReason: "abort" | "error" | "done";
|
|
112
|
+
result?: any;
|
|
113
|
+
};
|
|
114
|
+
//# sourceMappingURL=core.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.types.d.ts","sourceRoot":"","sources":["../../src/types/core.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAA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
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC"}
|
|
@@ -1,54 +1,83 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
export
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
type:
|
|
1
|
+
import { ProviderV1, LanguageModelV1CallWarning, LanguageModelV1FinishReason, LanguageModelV1FunctionToolCall, LanguageModelV1ProviderMetadata, LanguageModelV1Source, LanguageModelV1StreamPart, LanguageModelV1FunctionTool, LanguageModelV1ToolChoice, LanguageModelV1Prompt } from "@ai-sdk/provider";
|
|
2
|
+
export type LLMprovider = "openai" | "anthropic" | "google" | "aws" | ProviderV1;
|
|
3
|
+
export type LLMConfig = {
|
|
4
|
+
provider: LLMprovider;
|
|
5
|
+
model: string;
|
|
6
|
+
apiKey: string;
|
|
7
|
+
config?: {
|
|
8
|
+
baseURL?: string;
|
|
9
|
+
temperature?: number;
|
|
10
|
+
topP?: number;
|
|
11
|
+
topK?: number;
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export type LLMs = {
|
|
16
|
+
default: LLMConfig;
|
|
17
|
+
[key: string]: LLMConfig;
|
|
18
|
+
};
|
|
19
|
+
export type GenerateResult = {
|
|
20
|
+
text?: string;
|
|
21
|
+
reasoning?: string | Array<{
|
|
22
|
+
type: "text";
|
|
23
23
|
text: string;
|
|
24
|
+
signature?: string;
|
|
25
|
+
} | {
|
|
26
|
+
type: "redacted";
|
|
27
|
+
data: string;
|
|
24
28
|
}>;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
files?: Array<{
|
|
30
|
+
data: string | Uint8Array;
|
|
31
|
+
mimeType: string;
|
|
32
|
+
}>;
|
|
33
|
+
toolCalls?: Array<LanguageModelV1FunctionToolCall>;
|
|
34
|
+
finishReason: LanguageModelV1FinishReason;
|
|
35
|
+
usage: {
|
|
36
|
+
promptTokens: number;
|
|
37
|
+
completionTokens: number;
|
|
38
|
+
};
|
|
39
|
+
rawCall: {
|
|
40
|
+
rawPrompt: unknown;
|
|
41
|
+
rawSettings: Record<string, unknown>;
|
|
42
|
+
};
|
|
43
|
+
rawResponse?: {
|
|
44
|
+
headers?: Record<string, string>;
|
|
45
|
+
body?: unknown;
|
|
46
|
+
};
|
|
47
|
+
request?: {
|
|
48
|
+
body?: string;
|
|
49
|
+
};
|
|
50
|
+
response?: {
|
|
51
|
+
id?: string;
|
|
52
|
+
timestamp?: Date;
|
|
53
|
+
modelId?: string;
|
|
54
|
+
};
|
|
55
|
+
warnings?: LanguageModelV1CallWarning[];
|
|
56
|
+
providerMetadata?: LanguageModelV1ProviderMetadata;
|
|
57
|
+
sources?: LanguageModelV1Source[];
|
|
58
|
+
};
|
|
59
|
+
export type StreamResult = {
|
|
60
|
+
stream: ReadableStream<LanguageModelV1StreamPart>;
|
|
61
|
+
rawCall: {
|
|
62
|
+
rawPrompt: unknown;
|
|
63
|
+
rawSettings: Record<string, unknown>;
|
|
64
|
+
};
|
|
65
|
+
rawResponse?: {
|
|
66
|
+
headers?: Record<string, string>;
|
|
67
|
+
};
|
|
68
|
+
request?: {
|
|
69
|
+
body?: string;
|
|
70
|
+
};
|
|
71
|
+
warnings?: Array<LanguageModelV1CallWarning>;
|
|
72
|
+
};
|
|
73
|
+
export type LLMRequest = {
|
|
29
74
|
maxTokens?: number;
|
|
30
|
-
|
|
31
|
-
toolChoice?:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
toolCalls: ToolCall[];
|
|
40
|
-
stop_reason: string | null;
|
|
41
|
-
}
|
|
42
|
-
export interface LLMStreamHandler {
|
|
43
|
-
onStart?: () => void;
|
|
44
|
-
onContent?: (content: string) => void;
|
|
45
|
-
onToolUse?: (toolCall: ToolCall) => void;
|
|
46
|
-
onComplete?: (response: LLMResponse) => void;
|
|
47
|
-
onError?: (error: Error) => void;
|
|
48
|
-
}
|
|
49
|
-
export interface LLMProvider {
|
|
50
|
-
client: any;
|
|
51
|
-
defaultModel: string;
|
|
52
|
-
generateText(messages: Message[], params: LLMParameters): Promise<LLMResponse>;
|
|
53
|
-
generateStream(messages: Message[], params: LLMParameters, handler: LLMStreamHandler): Promise<void>;
|
|
54
|
-
}
|
|
75
|
+
messages: LanguageModelV1Prompt;
|
|
76
|
+
toolChoice?: LanguageModelV1ToolChoice;
|
|
77
|
+
tools?: Array<LanguageModelV1FunctionTool>;
|
|
78
|
+
temperature?: number;
|
|
79
|
+
topP?: number;
|
|
80
|
+
topK?: number;
|
|
81
|
+
abortSignal?: AbortSignal;
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=llm.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"llm.types.d.ts","sourceRoot":"","sources":["../../src/types/llm.types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,0BAA0B,EAC1B,2BAA2B,EAC3B,+BAA+B,EAC/B,+BAA+B,EAC/B,qBAAqB,EACrB,yBAAyB,EACzB,2BAA2B,EAC3B,yBAAyB,EACzB,qBAAqB,EACtB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,MAAM,WAAW,GACnB,QAAQ,GACR,WAAW,GACX,QAAQ,GACR,KAAK,GACL,UAAU,CAAC;AAEf,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,EAAE,WAAW,CAAC;IACtB,KAAK,EA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
|
2
|
+
import { ToolResult } from "../types/tools.types";
|
|
3
|
+
export type McpListToolParam = {
|
|
4
|
+
taskId: string;
|
|
5
|
+
nodeId: string;
|
|
6
|
+
environment: "browser" | "windows" | "mac" | "linux";
|
|
7
|
+
agent_name: string;
|
|
8
|
+
prompt: string;
|
|
9
|
+
browser_url?: string | null;
|
|
10
|
+
params?: Record<string, unknown> | undefined;
|
|
11
|
+
};
|
|
12
|
+
export type McpCallToolParam = {
|
|
13
|
+
name: string;
|
|
14
|
+
arguments?: Record<string, unknown> | undefined;
|
|
15
|
+
extInfo?: {
|
|
16
|
+
taskId: string;
|
|
17
|
+
nodeId: string;
|
|
18
|
+
environment: "browser" | "windows" | "mac" | "linux";
|
|
19
|
+
agent_name: string;
|
|
20
|
+
browser_url?: string | null;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export type McpListToolResult = Array<{
|
|
24
|
+
name: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
inputSchema: JSONSchema7;
|
|
27
|
+
}>;
|
|
28
|
+
export interface IMcpClient {
|
|
29
|
+
connect(): Promise<void>;
|
|
30
|
+
listTools(param: McpListToolParam): Promise<McpListToolResult>;
|
|
31
|
+
callTool(param: McpCallToolParam): Promise<ToolResult>;
|
|
32
|
+
isConnected(): boolean;
|
|
33
|
+
close(): Promise<void>;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=mcp.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.types.d.ts","sourceRoot":"","sources":["../../src/types/mcp.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,SAAS,GAAG,SAAS,GAAG,KAAK,GA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