@agents-eco/open-agentic-framework 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.
@@ -0,0 +1,166 @@
1
+ export interface ProviderConfig {
2
+ name: string;
3
+ apiKey?: string;
4
+ baseUrl: string;
5
+ defaultModel: string;
6
+ headers?: Record<string, string>;
7
+ }
8
+ export interface ChatMessage {
9
+ role: "system" | "user" | "assistant" | "tool";
10
+ content: string;
11
+ name?: string;
12
+ toolCallId?: string;
13
+ }
14
+ export interface LLMRequest {
15
+ model: string;
16
+ messages: ChatMessage[];
17
+ temperature?: number;
18
+ maxTokens?: number;
19
+ tools?: ToolDef[];
20
+ toolChoice?: "auto" | "none" | "required" | {
21
+ type: "function";
22
+ function: {
23
+ name: string;
24
+ };
25
+ };
26
+ }
27
+ export interface LLMResponse {
28
+ content: string;
29
+ toolCalls?: ToolCall[];
30
+ usage: {
31
+ promptTokens: number;
32
+ completionTokens: number;
33
+ totalTokens: number;
34
+ };
35
+ model: string;
36
+ finishReason: string;
37
+ }
38
+ export interface ToolDef {
39
+ type: "function";
40
+ function: {
41
+ name: string;
42
+ description: string;
43
+ parameters: Record<string, unknown>;
44
+ };
45
+ }
46
+ export interface ToolCall {
47
+ id: string;
48
+ type: "function";
49
+ function: {
50
+ name: string;
51
+ arguments: string;
52
+ };
53
+ }
54
+ export interface ToolResult {
55
+ toolCallId: string;
56
+ content: string;
57
+ isError?: boolean;
58
+ }
59
+ export interface SkillFrontmatter {
60
+ name: string;
61
+ description: string;
62
+ version?: string;
63
+ author?: string;
64
+ tools?: SkillToolDef[];
65
+ config?: Record<string, SkillConfigField>;
66
+ }
67
+ export interface SkillToolDef {
68
+ name: string;
69
+ description: string;
70
+ parameters: Record<string, unknown>;
71
+ }
72
+ export interface SkillConfigField {
73
+ type: "string" | "number" | "boolean";
74
+ description: string;
75
+ required?: boolean;
76
+ default?: unknown;
77
+ }
78
+ export interface Skill {
79
+ /** Parsed frontmatter */
80
+ meta: SkillFrontmatter;
81
+ /** Full markdown body (instructions for the LLM) */
82
+ content: string;
83
+ /** File path the skill was loaded from */
84
+ source: string;
85
+ /** Tool definitions derived from the skill */
86
+ tools: ToolDef[];
87
+ }
88
+ export interface MemoryEntry {
89
+ id: string;
90
+ content: string;
91
+ type: "conversation" | "observation" | "reflection" | "goal" | "skill";
92
+ timestamp: string;
93
+ metadata?: Record<string, unknown>;
94
+ }
95
+ export interface MemoryStore {
96
+ /** Add a memory entry */
97
+ add(entry: Omit<MemoryEntry, "id" | "timestamp">): Promise<MemoryEntry>;
98
+ /** Search memories by query (semantic or keyword) */
99
+ search(query: string, limit?: number): Promise<MemoryEntry[]>;
100
+ /** Get all memories */
101
+ list(limit?: number): Promise<MemoryEntry[]>;
102
+ /** Clear all memories */
103
+ clear(): Promise<void>;
104
+ }
105
+ export interface AgentConfig {
106
+ /** Agent name */
107
+ name: string;
108
+ /** System prompt — the agent's personality and instructions */
109
+ systemPrompt: string;
110
+ /** LLM provider config */
111
+ provider: ProviderConfig;
112
+ /** Model override (defaults to provider.defaultModel) */
113
+ model?: string;
114
+ /** Skills to load (file paths or Skill objects) */
115
+ skills?: (string | Skill)[];
116
+ /** Skills directory to auto-discover */
117
+ skillsDir?: string;
118
+ /** Memory store (defaults to MarkdownMemory) */
119
+ memory?: MemoryStore | false;
120
+ /** Memory directory for file-based memory */
121
+ memoryDir?: string;
122
+ /** Max reasoning steps for multi-step thinking */
123
+ maxReasoningSteps?: number;
124
+ /** Temperature (0-2) */
125
+ temperature?: number;
126
+ /** Max tokens per response */
127
+ maxTokens?: number;
128
+ /** Tool executor functions keyed by tool name */
129
+ toolHandlers?: Record<string, ToolHandler>;
130
+ /** Middleware hooks */
131
+ hooks?: AgentHooks;
132
+ }
133
+ export type ToolHandler = (args: Record<string, unknown>) => Promise<string> | string;
134
+ export interface AgentHooks {
135
+ /** Called before sending messages to the LLM */
136
+ beforeRequest?: (messages: ChatMessage[], tools: ToolDef[]) => ChatMessage[] | Promise<ChatMessage[]>;
137
+ /** Called after receiving LLM response */
138
+ afterResponse?: (response: LLMResponse) => LLMResponse | Promise<LLMResponse>;
139
+ /** Called when a tool is about to be executed */
140
+ beforeToolCall?: (name: string, args: Record<string, unknown>) => Record<string, unknown> | Promise<Record<string, unknown>>;
141
+ /** Called after tool execution */
142
+ afterToolCall?: (name: string, result: ToolResult) => ToolResult | Promise<ToolResult>;
143
+ /** Called on error */
144
+ onError?: (error: Error) => void;
145
+ }
146
+ export interface RunResult {
147
+ response: string;
148
+ messages: ChatMessage[];
149
+ toolCalls: Array<{
150
+ name: string;
151
+ args: Record<string, unknown>;
152
+ result: string;
153
+ }>;
154
+ usage: {
155
+ promptTokens: number;
156
+ completionTokens: number;
157
+ totalTokens: number;
158
+ llmCalls: number;
159
+ };
160
+ duration: number;
161
+ }
162
+ export interface Provider {
163
+ name: string;
164
+ chat(request: LLMRequest): Promise<LLMResponse>;
165
+ }
166
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM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AE,CAAC,QAAQ,EAAE,WAAW,KAAK,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAC9E,iDAAiD;IACjD,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC7H,kCAAkC;IAClC,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,KAAK,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACvF,sBAAsB;IACtB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC;AAID,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,SAAS,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAClF,KAAK,EAAE;QACL,YAAY,EAAE,MAAM,CAAC;QACrB,gBAAgB,EAAE,MAAM,CAAC;QACzB,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,QAAQ,EAAE,MAAM,CAAC;CAClB;AAID,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;CACjD"}
package/dist/types.js ADDED
@@ -0,0 +1,3 @@
1
+ // ── Provider (LLM backend) ──────────────────────────────
2
+ export {};
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,2DAA2D"}
package/icon.png ADDED
Binary file
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@agents-eco/open-agentic-framework",
3
+ "version": "0.1.0",
4
+ "description": "Open agentic framework — skills-as-markdown, pluggable LLM providers, file-based memory. Built for agents.eco.",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.js",
12
+ "types": "./dist/index.d.ts"
13
+ }
14
+ },
15
+ "bin": {
16
+ "agents-eco": "./dist/cli.js"
17
+ },
18
+ "files": [
19
+ "dist",
20
+ "skills",
21
+ "icon.png",
22
+ "README.md",
23
+ "LICENSE"
24
+ ],
25
+ "scripts": {
26
+ "build": "tsc",
27
+ "clean": "rm -rf dist",
28
+ "dev": "tsc --watch"
29
+ },
30
+ "keywords": [
31
+ "agents",
32
+ "ai",
33
+ "llm",
34
+ "agentic",
35
+ "framework",
36
+ "skills",
37
+ "markdown",
38
+ "agents-eco",
39
+ "open-source"
40
+ ],
41
+ "license": "MIT",
42
+ "author": "agents.eco",
43
+ "homepage": "https://agents.eco",
44
+ "repository": {
45
+ "type": "git",
46
+ "url": "https://github.com/agents-eco/open-agentic-framework"
47
+ },
48
+ "publishConfig": {
49
+ "access": "public"
50
+ },
51
+ "dependencies": {
52
+ "yaml": "^2.3.4"
53
+ },
54
+ "devDependencies": {
55
+ "@types/node": "^20.11.0",
56
+ "typescript": "^5.3.3"
57
+ }
58
+ }
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: code-exec
3
+ description: Execute JavaScript/TypeScript code snippets and return the output
4
+ version: "1.0"
5
+ tools:
6
+ - name: execute_code
7
+ description: Execute a JavaScript code snippet and return stdout/stderr output
8
+ parameters:
9
+ type: object
10
+ properties:
11
+ code:
12
+ type: string
13
+ description: JavaScript code to execute
14
+ language:
15
+ type: string
16
+ description: "Language: 'javascript' or 'typescript' (default: javascript)"
17
+ enum: [javascript, typescript]
18
+ required:
19
+ - code
20
+ ---
21
+
22
+ # Code Execution Skill
23
+
24
+ When the user asks you to run code, calculate something, or needs a programmatic solution, use the `execute_code` tool.
25
+
26
+ ## Guidelines
27
+
28
+ - Write clean, self-contained code snippets
29
+ - Use `console.log()` to output results — the tool captures stdout
30
+ - Handle errors gracefully with try/catch
31
+ - For math calculations, use JavaScript's built-in Math library
32
+ - For data processing, write the logic inline (no external imports)
33
+ - Always explain what the code does before running it
34
+ - If the code fails, analyze the error and try a corrected version
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: file-ops
3
+ description: Read, write, and list files in the workspace
4
+ version: "1.0"
5
+ tools:
6
+ - name: read_file
7
+ description: Read the contents of a file
8
+ parameters:
9
+ type: object
10
+ properties:
11
+ path:
12
+ type: string
13
+ description: Path to the file to read
14
+ required:
15
+ - path
16
+ - name: write_file
17
+ description: Write content to a file (creates or overwrites)
18
+ parameters:
19
+ type: object
20
+ properties:
21
+ path:
22
+ type: string
23
+ description: Path to the file to write
24
+ content:
25
+ type: string
26
+ description: Content to write to the file
27
+ required:
28
+ - path
29
+ - content
30
+ - name: list_files
31
+ description: List files and directories at a given path
32
+ parameters:
33
+ type: object
34
+ properties:
35
+ path:
36
+ type: string
37
+ description: Directory path to list (default ".")
38
+ ---
39
+
40
+ # File Operations Skill
41
+
42
+ When the user asks you to read, write, or manage files, use the file operation tools.
43
+
44
+ ## Guidelines
45
+
46
+ - Always confirm before overwriting existing files
47
+ - Use relative paths from the workspace root
48
+ - When listing files, present them in a clean, organized format
49
+ - For large files, mention the file size and offer to show specific sections
50
+ - Never read or write files outside the workspace without explicit permission
@@ -0,0 +1,31 @@
1
+ ---
2
+ name: web-search
3
+ description: Search the web for current information using a search query
4
+ version: "1.0"
5
+ tools:
6
+ - name: web_search
7
+ description: Search the web for current information. Returns relevant results.
8
+ parameters:
9
+ type: object
10
+ properties:
11
+ query:
12
+ type: string
13
+ description: The search query
14
+ limit:
15
+ type: number
16
+ description: Max number of results (default 5)
17
+ required:
18
+ - query
19
+ ---
20
+
21
+ # Web Search Skill
22
+
23
+ When the user asks about current events, recent information, or anything that requires up-to-date knowledge, use the `web_search` tool.
24
+
25
+ ## Guidelines
26
+
27
+ - Formulate clear, specific search queries
28
+ - Summarize results concisely — don't just dump raw search results
29
+ - If the first search doesn't find what you need, try rephrasing the query
30
+ - Always cite your sources when presenting information from search results
31
+ - If results are ambiguous, let the user know and offer to refine the search