@jarvis-agent/core 0.1.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 +211 -0
- package/dist/agent/a2a.d.ts +7 -0
- package/dist/agent/a2a.d.ts.map +1 -0
- package/dist/agent/base.d.ts +53 -0
- package/dist/agent/base.d.ts.map +1 -0
- package/dist/agent/browser/browser_base.d.ts +52 -0
- package/dist/agent/browser/browser_base.d.ts.map +1 -0
- package/dist/agent/browser/browser_labels.d.ts +28 -0
- package/dist/agent/browser/browser_labels.d.ts.map +1 -0
- package/dist/agent/browser/browser_screen.d.ts +17 -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 +5 -0
- package/dist/agent/browser/index.d.ts.map +1 -0
- package/dist/agent/browser/utils.d.ts +2 -0
- package/dist/agent/browser/utils.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 +32 -0
- package/dist/agent/file.d.ts.map +1 -0
- package/dist/agent/index.d.ts +7 -0
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/agent/llm.d.ts +13 -0
- package/dist/agent/llm.d.ts.map +1 -0
- package/dist/agent/shell.d.ts +15 -0
- package/dist/agent/shell.d.ts.map +1 -0
- package/dist/common/log.d.ts +43 -0
- package/dist/common/log.d.ts.map +1 -0
- package/dist/common/tree.d.ts +3 -0
- package/dist/common/tree.d.ts.map +1 -0
- package/dist/common/utils.d.ts +16 -0
- package/dist/common/utils.d.ts.map +1 -0
- package/dist/common/xml.d.ts +15 -0
- package/dist/common/xml.d.ts.map +1 -0
- package/dist/config/index.d.ts +20 -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 +31 -0
- package/dist/core/context.d.ts.map +1 -0
- package/dist/core/dialogue/execute_task.d.ts +15 -0
- package/dist/core/dialogue/execute_task.d.ts.map +1 -0
- package/dist/core/dialogue/llm.d.ts +8 -0
- package/dist/core/dialogue/llm.d.ts.map +1 -0
- package/dist/core/dialogue/task_planner.d.ts +15 -0
- package/dist/core/dialogue/task_planner.d.ts.map +1 -0
- package/dist/core/dialogue/variable_storage.d.ts +14 -0
- package/dist/core/dialogue/variable_storage.d.ts.map +1 -0
- package/dist/core/dialogue.d.ts +22 -0
- package/dist/core/dialogue.d.ts.map +1 -0
- package/dist/core/eko.d.ts +25 -0
- package/dist/core/eko.d.ts.map +1 -0
- package/dist/core/index.d.ts +5 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/plan.d.ts +13 -0
- package/dist/core/plan.d.ts.map +1 -0
- package/dist/core/replan.d.ts +4 -0
- package/dist/core/replan.d.ts.map +1 -0
- package/dist/index.cjs.js +37004 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +36933 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/llm/index.d.ts +22 -0
- package/dist/llm/index.d.ts.map +1 -0
- package/dist/mcp/http.d.ts +26 -0
- package/dist/mcp/http.d.ts.map +1 -0
- package/dist/mcp/index.d.ts +4 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/sse.d.ts +30 -0
- package/dist/mcp/sse.d.ts.map +1 -0
- package/dist/memory/index.d.ts +8 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/memory.d.ts +40 -0
- package/dist/memory/memory.d.ts.map +1 -0
- package/dist/memory/snapshot.d.ts +13 -0
- package/dist/memory/snapshot.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/dialogue.d.ts +2 -0
- package/dist/prompt/dialogue.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 +13 -0
- package/dist/tools/foreach_task.d.ts.map +1 -0
- package/dist/tools/human_interact.d.ts +15 -0
- package/dist/tools/human_interact.d.ts.map +1 -0
- package/dist/tools/index.d.ts +20 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/task_node_status.d.ts +13 -0
- package/dist/tools/task_node_status.d.ts.map +1 -0
- package/dist/tools/task_result_check.d.ts +18 -0
- package/dist/tools/task_result_check.d.ts.map +1 -0
- package/dist/tools/todo_list_manager.d.ts +16 -0
- package/dist/tools/todo_list_manager.d.ts.map +1 -0
- package/dist/tools/variable_storage.d.ts +13 -0
- package/dist/tools/variable_storage.d.ts.map +1 -0
- package/dist/tools/watch_trigger.d.ts +17 -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 +144 -0
- package/dist/types/core.types.d.ts.map +1 -0
- package/dist/types/dialogue.types.d.ts +108 -0
- package/dist/types/dialogue.types.d.ts.map +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/llm.types.d.ts +63 -0
- 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 +61 -0
- package/dist/types/tools.types.d.ts.map +1 -0
- package/package.json +77 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { JSONSchema7, LanguageModelV2FinishReason, LanguageModelV2ToolCallPart } from "@ai-sdk/provider";
|
|
2
|
+
import { ToolResult } from "./tools.types";
|
|
3
|
+
import { EkoConfig, HumanCallback, StreamCallback } from "./core.types";
|
|
4
|
+
export type EkoMessage = {
|
|
5
|
+
id: string;
|
|
6
|
+
role: "user";
|
|
7
|
+
timestamp: number;
|
|
8
|
+
content: string | EkoMessageUserPart[];
|
|
9
|
+
} | {
|
|
10
|
+
id: string;
|
|
11
|
+
role: "assistant";
|
|
12
|
+
timestamp: number;
|
|
13
|
+
content: EkoMessageAssistantPart[];
|
|
14
|
+
} | {
|
|
15
|
+
id: string;
|
|
16
|
+
role: "tool";
|
|
17
|
+
timestamp: number;
|
|
18
|
+
content: EkoMessageToolPart[];
|
|
19
|
+
};
|
|
20
|
+
export type EkoMessageUserPart = {
|
|
21
|
+
type: "text";
|
|
22
|
+
text: string;
|
|
23
|
+
} | {
|
|
24
|
+
type: "file";
|
|
25
|
+
mimeType: string;
|
|
26
|
+
data: string;
|
|
27
|
+
};
|
|
28
|
+
export type EkoMessageAssistantPart = {
|
|
29
|
+
type: "text";
|
|
30
|
+
text: string;
|
|
31
|
+
} | {
|
|
32
|
+
type: "reasoning";
|
|
33
|
+
text: string;
|
|
34
|
+
} | {
|
|
35
|
+
type: "tool-call";
|
|
36
|
+
toolCallId: string;
|
|
37
|
+
toolName: string;
|
|
38
|
+
args: Record<string, unknown>;
|
|
39
|
+
};
|
|
40
|
+
export type EkoMessageToolPart = {
|
|
41
|
+
type: "tool-result";
|
|
42
|
+
toolCallId: string;
|
|
43
|
+
toolName: string;
|
|
44
|
+
result: string | Record<string, unknown>;
|
|
45
|
+
};
|
|
46
|
+
export interface DialogueTool {
|
|
47
|
+
readonly name: string;
|
|
48
|
+
readonly description?: string;
|
|
49
|
+
readonly parameters: JSONSchema7;
|
|
50
|
+
execute: (args: Record<string, unknown>, toolCall: LanguageModelV2ToolCallPart) => Promise<ToolResult>;
|
|
51
|
+
}
|
|
52
|
+
export type EkoDialogueConfig = Omit<EkoConfig, "callback"> & {
|
|
53
|
+
chatLlms?: string[];
|
|
54
|
+
segmentedExecution?: boolean;
|
|
55
|
+
};
|
|
56
|
+
export type DialogueParams = {
|
|
57
|
+
user: string | EkoMessageUserPart[];
|
|
58
|
+
callback?: DialogueCallback;
|
|
59
|
+
messageId?: string;
|
|
60
|
+
signal?: AbortSignal;
|
|
61
|
+
};
|
|
62
|
+
export type DialogueCallback = {
|
|
63
|
+
chatCallback?: {
|
|
64
|
+
onMessage: (message: ChatStreamCallbackMessage) => Promise<void>;
|
|
65
|
+
};
|
|
66
|
+
taskCallback?: StreamCallback & HumanCallback;
|
|
67
|
+
};
|
|
68
|
+
export type ChatStreamCallbackMessage = {
|
|
69
|
+
type: "text" | "thinking";
|
|
70
|
+
streamId: string;
|
|
71
|
+
streamDone: boolean;
|
|
72
|
+
text: string;
|
|
73
|
+
} | {
|
|
74
|
+
type: "tool_streaming";
|
|
75
|
+
toolName: string;
|
|
76
|
+
toolId: string;
|
|
77
|
+
paramsText: string;
|
|
78
|
+
} | {
|
|
79
|
+
type: "tool_use";
|
|
80
|
+
toolName: string;
|
|
81
|
+
toolId: string;
|
|
82
|
+
params: Record<string, any>;
|
|
83
|
+
} | {
|
|
84
|
+
type: "tool_running";
|
|
85
|
+
toolName: string;
|
|
86
|
+
toolId: string;
|
|
87
|
+
text: string;
|
|
88
|
+
streamId: string;
|
|
89
|
+
streamDone: boolean;
|
|
90
|
+
} | {
|
|
91
|
+
type: "tool_result";
|
|
92
|
+
toolName: string;
|
|
93
|
+
toolId: string;
|
|
94
|
+
params: Record<string, any>;
|
|
95
|
+
toolResult: ToolResult;
|
|
96
|
+
} | {
|
|
97
|
+
type: "error";
|
|
98
|
+
error: unknown;
|
|
99
|
+
} | {
|
|
100
|
+
type: "finish";
|
|
101
|
+
finishReason: LanguageModelV2FinishReason;
|
|
102
|
+
usage: {
|
|
103
|
+
promptTokens: number;
|
|
104
|
+
completionTokens: number;
|
|
105
|
+
totalTokens: number;
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
//# sourceMappingURL=dialogue.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialogue.types.d.ts","sourceRoot":"","sources":["../../src/types/dialogue.types.ts"],"names":[],"mappings":"AAAA,OAAO,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,EAAE,gBAAgB,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB,GACD;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC7B,GACD;IACE,IAAI,EAAE,cAAc,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;CACrB,GACD;IACE,IAAI,EAAE,aAAa,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,UAAU,EAAE,UAAU,CAAC;CACxB,GACD;IACE,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;CAChB,GACD;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,YAAY,EAAE,2BAA2B,CAAC;IAC1C,KAAK,EAAE;QACL,YAAY,EAAE,MAAM,CAAC;QACrB,gBAAgB,EAAE,MAAM,CAAC;QACzB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "./core.types";
|
|
2
|
+
export * from "./dialogue.types";
|
|
3
|
+
export * from "./llm.types";
|
|
4
|
+
export * from "./tools.types";
|
|
5
|
+
export * from "./mcp.types";
|
|
6
|
+
export type { JSONSchema7, LanguageModelV2Prompt, LanguageModelV2TextPart, LanguageModelV2FilePart, LanguageModelV2StreamPart, LanguageModelV2ToolCallPart, LanguageModelV2ToolChoice, LanguageModelV2FunctionTool, LanguageModelV2ToolResultPart, LanguageModelV2ToolResultOutput, } from "@ai-sdk/provider";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAE5B,YAAY,EACV,WAAW,EACX,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACvB,yBAAyB,EACzB,2BAA2B,EAC3B,yBAAyB,EACzB,2BAA2B,EAC3B,6BAA6B,EAC7B,+BAA+B,GAChC,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { ProviderV2, LanguageModelV2CallWarning, LanguageModelV2FinishReason, LanguageModelV2StreamPart, LanguageModelV2FunctionTool, LanguageModelV2ToolChoice, LanguageModelV2Prompt, LanguageModelV2CallOptions, LanguageModelV2Content, SharedV2Headers, SharedV2ProviderMetadata, LanguageModelV2Usage, LanguageModelV2ResponseMetadata } from "@ai-sdk/provider";
|
|
2
|
+
import Context, { AgentContext } from "../core/context";
|
|
3
|
+
export type LLMprovider = "openai" | "anthropic" | "google" | "aws" | "openrouter" | "openai-compatible" | ProviderV2;
|
|
4
|
+
export type LLMConfig = {
|
|
5
|
+
provider: LLMprovider;
|
|
6
|
+
model: string;
|
|
7
|
+
apiKey: string | (() => Promise<string>);
|
|
8
|
+
config?: {
|
|
9
|
+
baseURL?: string | (() => Promise<string>);
|
|
10
|
+
temperature?: number;
|
|
11
|
+
topP?: number;
|
|
12
|
+
topK?: number;
|
|
13
|
+
maxTokens?: number;
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
};
|
|
16
|
+
options?: Record<string, any>;
|
|
17
|
+
fetch?: typeof globalThis.fetch;
|
|
18
|
+
handler?: (options: LanguageModelV2CallOptions, context?: Context, agentContext?: AgentContext) => Promise<LanguageModelV2CallOptions>;
|
|
19
|
+
};
|
|
20
|
+
export type LLMs = {
|
|
21
|
+
default: LLMConfig;
|
|
22
|
+
[key: string]: LLMConfig;
|
|
23
|
+
};
|
|
24
|
+
export type GenerateResult = {
|
|
25
|
+
llm: string;
|
|
26
|
+
llmConfig: LLMConfig;
|
|
27
|
+
text?: string;
|
|
28
|
+
content: Array<LanguageModelV2Content>;
|
|
29
|
+
finishReason: LanguageModelV2FinishReason;
|
|
30
|
+
usage: LanguageModelV2Usage;
|
|
31
|
+
providerMetadata?: SharedV2ProviderMetadata;
|
|
32
|
+
request?: {
|
|
33
|
+
body?: unknown;
|
|
34
|
+
};
|
|
35
|
+
response?: LanguageModelV2ResponseMetadata & {
|
|
36
|
+
headers?: SharedV2Headers;
|
|
37
|
+
body?: unknown;
|
|
38
|
+
};
|
|
39
|
+
warnings: Array<LanguageModelV2CallWarning>;
|
|
40
|
+
};
|
|
41
|
+
export type StreamResult = {
|
|
42
|
+
llm: string;
|
|
43
|
+
llmConfig: LLMConfig;
|
|
44
|
+
stream: ReadableStream<LanguageModelV2StreamPart>;
|
|
45
|
+
request?: {
|
|
46
|
+
body?: unknown;
|
|
47
|
+
};
|
|
48
|
+
response?: {
|
|
49
|
+
headers?: SharedV2Headers;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
export type LLMRequest = {
|
|
53
|
+
maxTokens?: number;
|
|
54
|
+
messages: LanguageModelV2Prompt;
|
|
55
|
+
toolChoice?: LanguageModelV2ToolChoice;
|
|
56
|
+
tools?: Array<LanguageModelV2FunctionTool>;
|
|
57
|
+
temperature?: number;
|
|
58
|
+
topP?: number;
|
|
59
|
+
topK?: number;
|
|
60
|
+
stopSequences?: string[];
|
|
61
|
+
abortSignal?: AbortSignal;
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=llm.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
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;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { JSONSchema7 } from "json-schema";
|
|
2
|
+
import { ToolResult } from "../types/tools.types";
|
|
3
|
+
export type McpListToolParam = {
|
|
4
|
+
environment: "browser" | "windows" | "mac" | "linux";
|
|
5
|
+
agent_name: string;
|
|
6
|
+
prompt: string;
|
|
7
|
+
taskId?: string;
|
|
8
|
+
nodeId?: 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(signal?: AbortSignal): Promise<void>;
|
|
30
|
+
listTools(param: McpListToolParam, signal?: AbortSignal): Promise<McpListToolResult>;
|
|
31
|
+
callTool(param: McpCallToolParam, signal?: AbortSignal): 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,OAA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,CAAC,KAAK,EAAE,gBAAgB,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAE7E,WAAW,IAAI,OAAO,CAAC;IAEvB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { JSONSchema7 } from "json-schema";
|
|
2
|
+
import { AgentContext } from "../core/context";
|
|
3
|
+
import { LanguageModelV2ToolCallPart } from "@ai-sdk/provider";
|
|
4
|
+
export type ToolSchema = {
|
|
5
|
+
name: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
parameters: JSONSchema7;
|
|
8
|
+
} | {
|
|
9
|
+
name: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
input_schema: JSONSchema7;
|
|
12
|
+
} | {
|
|
13
|
+
name: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
inputSchema: JSONSchema7;
|
|
16
|
+
} | {
|
|
17
|
+
type: "function";
|
|
18
|
+
function: {
|
|
19
|
+
name: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
parameters: JSONSchema7;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export type ToolResult = {
|
|
25
|
+
content: [
|
|
26
|
+
{
|
|
27
|
+
type: "text";
|
|
28
|
+
text: string;
|
|
29
|
+
}
|
|
30
|
+
] | [
|
|
31
|
+
{
|
|
32
|
+
type: "image";
|
|
33
|
+
data: string;
|
|
34
|
+
mimeType?: string;
|
|
35
|
+
}
|
|
36
|
+
] | [
|
|
37
|
+
{
|
|
38
|
+
type: "text";
|
|
39
|
+
text: string;
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
type: "image";
|
|
43
|
+
data: string;
|
|
44
|
+
mimeType?: string;
|
|
45
|
+
}
|
|
46
|
+
];
|
|
47
|
+
isError?: boolean;
|
|
48
|
+
extInfo?: Record<string, unknown>;
|
|
49
|
+
};
|
|
50
|
+
export interface ToolExecuter {
|
|
51
|
+
execute: (args: Record<string, unknown>, agentContext: AgentContext, toolCall: LanguageModelV2ToolCallPart) => Promise<ToolResult>;
|
|
52
|
+
}
|
|
53
|
+
export interface Tool extends ToolExecuter {
|
|
54
|
+
readonly name: string;
|
|
55
|
+
readonly description?: string;
|
|
56
|
+
readonly parameters: JSONSchema7;
|
|
57
|
+
readonly noPlan?: boolean;
|
|
58
|
+
readonly planDescription?: string;
|
|
59
|
+
readonly supportParallelCalls?: boolean;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=tools.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.types.d.ts","sourceRoot":"","sources":["../../src/types/tools.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAE/D,MAAM,MAAM,UAAU,GAClB;IACE,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,WAAW,CAAC;CACzB,GACD;IACE,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,WAAW,CAAC;CAC3B,GACD;IACE,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,WAAW,CAAC;CAC1B,GACD;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,WAAW,CAAC;KACzB,CAAC;CACH,CAAC;AAEN,MAAM,MAAM,UAAU,GAAG;IACvB,OAAO,EACH;QACE;YACE,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;SACd;KACF,GACD;QACE;YACE,IAAI,EAAE,OAAO,CAAC;YACd,IAAI,EAAE,MAAM,CAAC;YACb,QAAQ,CAAC,EAAE,MAAM,CAAC;SACnB;KACF,GACD;QACE;YACE,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;SACd;QACD;YACE,IAAI,EAAE,OAAO,CAAC;YACd,IAAI,EAAE,MAAM,CAAC;YACb,QAAQ,CAAC,EAAE,MAAM,CAAC;SACnB;KACF,CAAC;IACN,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,CACP,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,2BAA2B,KAClC,OAAO,CAAC,UAAU,CAAC,CAAC;CAC1B;AAED,MAAM,WAAW,IAAK,SAAQ,YAAY;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC;IACjC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC;CACzC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@jarvis-agent/core",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A production-ready JavaScript AI Agent framework for creating reliable agents across browser and Node.js environments.",
|
|
5
|
+
"main": "dist/index.cjs.js",
|
|
6
|
+
"module": "dist/index.esm.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist/",
|
|
11
|
+
"LICENSE",
|
|
12
|
+
"README.md",
|
|
13
|
+
"package.json"
|
|
14
|
+
],
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"require": "./dist/index.cjs.js",
|
|
18
|
+
"import": "./dist/index.esm.js",
|
|
19
|
+
"types": "./dist/index.d.ts"
|
|
20
|
+
},
|
|
21
|
+
"./types": {
|
|
22
|
+
"types": "./dist/types/index.d.ts"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "rollup -c",
|
|
27
|
+
"docs": "typedoc",
|
|
28
|
+
"test": "npx jest test/core/eko.test.ts"
|
|
29
|
+
},
|
|
30
|
+
"author": "FellouAI",
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"keywords": [
|
|
33
|
+
"jarvis",
|
|
34
|
+
"jarvis-agent",
|
|
35
|
+
"ai-agent",
|
|
36
|
+
"automation",
|
|
37
|
+
"browser-automation",
|
|
38
|
+
"workflow",
|
|
39
|
+
"llm",
|
|
40
|
+
"agent-framework"
|
|
41
|
+
],
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public",
|
|
44
|
+
"registry": "https://registry.npmjs.org/"
|
|
45
|
+
},
|
|
46
|
+
"repository": {
|
|
47
|
+
"type": "git",
|
|
48
|
+
"url": "git+https://github.com/yourusername/jarvis-agent.git"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@ai-sdk/provider": "^2.0.0",
|
|
52
|
+
"@ai-sdk/amazon-bedrock": "^3.0.43",
|
|
53
|
+
"@ai-sdk/anthropic": "^2.0.33",
|
|
54
|
+
"@ai-sdk/google": "^2.0.23",
|
|
55
|
+
"@ai-sdk/openai": "^2.0.52",
|
|
56
|
+
"@ai-sdk/openai-compatible": "^1.0.22",
|
|
57
|
+
"@openrouter/ai-sdk-provider": "^1.2.0",
|
|
58
|
+
"secure-json-parse": "^4.0.0",
|
|
59
|
+
"@xmldom/xmldom": "^0.8.11",
|
|
60
|
+
"zod": "^4.1.12"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@rollup/plugin-commonjs": "^28.0.3",
|
|
64
|
+
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
65
|
+
"@rollup/plugin-typescript": "^12.1.2",
|
|
66
|
+
"@types/jest": "^29.5.14",
|
|
67
|
+
"@types/json-schema": "^7.0.15",
|
|
68
|
+
"dotenv": "^16.5.0",
|
|
69
|
+
"jest": "^29.7.0",
|
|
70
|
+
"rollup": "^4.40.0",
|
|
71
|
+
"rollup-plugin-copy": "^3.5.0",
|
|
72
|
+
"ts-jest": "^29.3.2",
|
|
73
|
+
"tslib": "^2.8.1",
|
|
74
|
+
"typedoc": "^0.27.6",
|
|
75
|
+
"typescript": "^5.8.3"
|
|
76
|
+
}
|
|
77
|
+
}
|