@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.
- package/LICENSE +21 -0
- package/README.md +427 -0
- package/dist/agent.d.ts +58 -0
- package/dist/agent.d.ts.map +1 -0
- package/dist/agent.js +306 -0
- package/dist/agent.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +273 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/memory.d.ts +36 -0
- package/dist/memory.d.ts.map +1 -0
- package/dist/memory.js +166 -0
- package/dist/memory.js.map +1 -0
- package/dist/provider.d.ts +24 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +124 -0
- package/dist/provider.js.map +1 -0
- package/dist/skills.d.ts +53 -0
- package/dist/skills.d.ts.map +1 -0
- package/dist/skills.js +139 -0
- package/dist/skills.js.map +1 -0
- package/dist/types.d.ts +166 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/icon.png +0 -0
- package/package.json +58 -0
- package/skills/code-exec/SKILL.md +34 -0
- package/skills/file-ops/SKILL.md +50 -0
- package/skills/web-search/SKILL.md +31 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 agents.eco
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="icon.png" alt="Open Agentic Framework" width="160" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">Open Agentic Framework</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<strong>Skills-as-markdown. Pluggable LLM providers. File-based memory.</strong><br/>
|
|
9
|
+
Built by <a href="https://agents.eco">agents.eco</a> — the decentralized AI agent economy.
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
<p align="center">
|
|
13
|
+
<a href="https://www.npmjs.com/package/@agents-eco/open-agentic-framework"><img src="https://img.shields.io/npm/v/@agents-eco/open-agentic-framework?style=flat-square" alt="npm" /></a>
|
|
14
|
+
<a href="https://github.com/agents-eco/open-agentic-framework/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" alt="MIT License" /></a>
|
|
15
|
+
<a href="https://github.com/agents-eco/open-agentic-framework"><img src="https://img.shields.io/github/stars/agents-eco/open-agentic-framework?style=flat-square" alt="GitHub stars" /></a>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
npm install @agents-eco/open-agentic-framework
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Why This Framework
|
|
25
|
+
|
|
26
|
+
Most agent frameworks are either too complex or too locked-in. We built this because we needed something that was simple to extend, transparent to debug, and free from vendor dependency.
|
|
27
|
+
|
|
28
|
+
- **Skills as Markdown** — Extend your agent by writing a `.md` file. No code required. Hot-reloadable, human-readable, agent-authorable.
|
|
29
|
+
- **Pluggable Providers** — OpenAI, Venice, Groq, Ollama, or any OpenAI-compatible API. Swap providers in a single line.
|
|
30
|
+
- **File-Based Memory** — JSONL and Markdown files you can inspect, edit, and version control. No opaque vector databases.
|
|
31
|
+
- **Tool Calling** — Register handlers, define tools in skill frontmatter, full lifecycle hooks at every stage.
|
|
32
|
+
- **Zero Lock-In** — MIT licensed. No vendor dependencies. Works fully offline with Ollama.
|
|
33
|
+
|
|
34
|
+
## Why agents.eco
|
|
35
|
+
|
|
36
|
+
[agents.eco](https://agents.eco) is building the decentralized AI agent economy — infrastructure where autonomous agents transact, pay for inference, and operate independently on-chain.
|
|
37
|
+
|
|
38
|
+
This framework is the open-source foundation of that vision. We believe the tools agents are built with should be:
|
|
39
|
+
|
|
40
|
+
- **Open** — Fully readable, forkable, and auditable. MIT licensed.
|
|
41
|
+
- **Composable** — Small, focused primitives that work together. Skills, providers, memory, and tools are all independent and swappable.
|
|
42
|
+
- **Portable** — No dependency on any single provider, cloud service, or platform. Your agent runs wherever you want it to.
|
|
43
|
+
- **Transparent** — Memory stored as files you can read. Billing on-chain. No black boxes.
|
|
44
|
+
|
|
45
|
+
Whether you use the agents.eco platform or run entirely on your own infrastructure, this framework works the same way.
|
|
46
|
+
|
|
47
|
+
## Quick Start
|
|
48
|
+
|
|
49
|
+
### Programmatic
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
import { Agent } from "@agents-eco/open-agentic-framework";
|
|
53
|
+
|
|
54
|
+
const agent = new Agent({
|
|
55
|
+
name: "my-agent",
|
|
56
|
+
systemPrompt: "You are a helpful assistant.",
|
|
57
|
+
provider: {
|
|
58
|
+
name: "venice",
|
|
59
|
+
apiKey: process.env.VENICE_API_KEY!,
|
|
60
|
+
baseUrl: "https://api.venice.ai/api/v1",
|
|
61
|
+
defaultModel: "qwen3-4b",
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const result = await agent.chat("What is agents.eco?");
|
|
66
|
+
console.log(result.response);
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### CLI
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
# Initialize a new agent project
|
|
73
|
+
npx @agents-eco/open-agentic-framework init
|
|
74
|
+
|
|
75
|
+
# Start interactive chat
|
|
76
|
+
npx @agents-eco/open-agentic-framework chat
|
|
77
|
+
|
|
78
|
+
# One-shot prompt
|
|
79
|
+
npx @agents-eco/open-agentic-framework run "Explain quantum computing in 3 sentences"
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Providers
|
|
83
|
+
|
|
84
|
+
Works with any OpenAI-compatible API out of the box:
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
import {
|
|
88
|
+
veniceProvider,
|
|
89
|
+
openaiProvider,
|
|
90
|
+
groqProvider,
|
|
91
|
+
ollamaProvider,
|
|
92
|
+
agentsEcoProvider,
|
|
93
|
+
OpenAIProvider,
|
|
94
|
+
} from "@agents-eco/open-agentic-framework";
|
|
95
|
+
|
|
96
|
+
// Pre-configured providers
|
|
97
|
+
const venice = veniceProvider("your-api-key");
|
|
98
|
+
const openai = openaiProvider("sk-...");
|
|
99
|
+
const groq = groqProvider("gsk_...");
|
|
100
|
+
const ollama = ollamaProvider("llama3.2"); // local, no API key needed
|
|
101
|
+
const eco = agentsEcoProvider("ak_...");
|
|
102
|
+
|
|
103
|
+
// Custom provider
|
|
104
|
+
const custom = new OpenAIProvider({
|
|
105
|
+
name: "my-provider",
|
|
106
|
+
apiKey: "...",
|
|
107
|
+
baseUrl: "https://my-api.com/v1",
|
|
108
|
+
defaultModel: "my-model",
|
|
109
|
+
});
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Use with an agent:
|
|
113
|
+
|
|
114
|
+
```typescript
|
|
115
|
+
const agent = new Agent({
|
|
116
|
+
name: "my-agent",
|
|
117
|
+
systemPrompt: "You are helpful.",
|
|
118
|
+
provider: { name: "ollama", baseUrl: "http://localhost:11434/v1", defaultModel: "llama3.2" },
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
// Or swap providers at runtime
|
|
122
|
+
agent.useProvider(veniceProvider("your-key"));
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Skills (Markdown-Driven)
|
|
126
|
+
|
|
127
|
+
Skills are `.md` files with YAML frontmatter. Drop them in a `skills/` directory and the agent loads them automatically.
|
|
128
|
+
|
|
129
|
+
### Example Skill
|
|
130
|
+
|
|
131
|
+
Create `skills/weather.md`:
|
|
132
|
+
|
|
133
|
+
```markdown
|
|
134
|
+
---
|
|
135
|
+
name: weather
|
|
136
|
+
description: Get current weather for a location
|
|
137
|
+
tools:
|
|
138
|
+
- name: get_weather
|
|
139
|
+
description: Fetch current weather data
|
|
140
|
+
parameters:
|
|
141
|
+
type: object
|
|
142
|
+
properties:
|
|
143
|
+
location:
|
|
144
|
+
type: string
|
|
145
|
+
description: City name or coordinates
|
|
146
|
+
required:
|
|
147
|
+
- location
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
# Weather Skill
|
|
151
|
+
|
|
152
|
+
When the user asks about weather, use the `get_weather` tool.
|
|
153
|
+
Present the results in a friendly, conversational format.
|
|
154
|
+
Include temperature, conditions, and any relevant alerts.
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Register the tool handler:
|
|
158
|
+
|
|
159
|
+
```typescript
|
|
160
|
+
const agent = new Agent({
|
|
161
|
+
name: "weather-bot",
|
|
162
|
+
systemPrompt: "You help people check the weather.",
|
|
163
|
+
provider: { ... },
|
|
164
|
+
skillsDir: "./skills",
|
|
165
|
+
toolHandlers: {
|
|
166
|
+
get_weather: async ({ location }) => {
|
|
167
|
+
const res = await fetch(`https://wttr.in/${location}?format=j1`);
|
|
168
|
+
const data = await res.json();
|
|
169
|
+
return JSON.stringify(data.current_condition[0]);
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
});
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### Skill Discovery
|
|
176
|
+
|
|
177
|
+
Skills are loaded from:
|
|
178
|
+
1. **`skillsDir`** — auto-discovers all `.md` files with YAML frontmatter
|
|
179
|
+
2. **`skills` array** — explicit file paths or `Skill` objects
|
|
180
|
+
3. **Subdirectories** — looks for `SKILL.md` inside each subdirectory
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
skills/
|
|
184
|
+
├── greeting.md # Simple skill (single file)
|
|
185
|
+
├── weather.md # Another simple skill
|
|
186
|
+
├── web-search/
|
|
187
|
+
│ └── SKILL.md # Skill in a directory (can include extra files)
|
|
188
|
+
└── code-exec/
|
|
189
|
+
└── SKILL.md
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## Memory
|
|
193
|
+
|
|
194
|
+
File-based memory that's human-readable and inspectable:
|
|
195
|
+
|
|
196
|
+
```typescript
|
|
197
|
+
const agent = new Agent({
|
|
198
|
+
name: "my-agent",
|
|
199
|
+
systemPrompt: "You remember previous conversations.",
|
|
200
|
+
provider: { ... },
|
|
201
|
+
memoryDir: "./.agent/memory", // default
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
// Memory is automatic — conversations are stored after each chat
|
|
205
|
+
await agent.chat("My name is Alice");
|
|
206
|
+
await agent.chat("What's my name?"); // "Your name is Alice"
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
Memory files:
|
|
210
|
+
- **`memory.jsonl`** — append-only log (one JSON per line)
|
|
211
|
+
- **`context.md`** — auto-generated markdown summary
|
|
212
|
+
|
|
213
|
+
### Custom Memory Store
|
|
214
|
+
|
|
215
|
+
```typescript
|
|
216
|
+
import { MemoryStore, MemoryEntry } from "@agents-eco/open-agentic-framework";
|
|
217
|
+
|
|
218
|
+
class MyVectorMemory implements MemoryStore {
|
|
219
|
+
async add(entry) { /* store in your vector DB */ }
|
|
220
|
+
async search(query, limit) { /* semantic search */ }
|
|
221
|
+
async list(limit) { /* return recent entries */ }
|
|
222
|
+
async clear() { /* wipe */ }
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
const agent = new Agent({
|
|
226
|
+
...config,
|
|
227
|
+
memory: new MyVectorMemory(),
|
|
228
|
+
});
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### Disable Memory
|
|
232
|
+
|
|
233
|
+
```typescript
|
|
234
|
+
const agent = new Agent({ ...config, memory: false });
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
## Tool Calling
|
|
238
|
+
|
|
239
|
+
Register tool handlers that the agent can invoke:
|
|
240
|
+
|
|
241
|
+
```typescript
|
|
242
|
+
const agent = new Agent({
|
|
243
|
+
name: "tool-agent",
|
|
244
|
+
systemPrompt: "You can use tools to help users.",
|
|
245
|
+
provider: { ... },
|
|
246
|
+
toolHandlers: {
|
|
247
|
+
calculate: async ({ expression }) => {
|
|
248
|
+
return String(eval(expression));
|
|
249
|
+
},
|
|
250
|
+
fetch_url: async ({ url }) => {
|
|
251
|
+
const res = await fetch(url);
|
|
252
|
+
return await res.text();
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
// Or add tools after creation
|
|
258
|
+
agent.tool("greet", async ({ name }) => `Hello, ${name}!`);
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
## Hooks
|
|
262
|
+
|
|
263
|
+
Intercept and modify behavior at every stage:
|
|
264
|
+
|
|
265
|
+
```typescript
|
|
266
|
+
const agent = new Agent({
|
|
267
|
+
...config,
|
|
268
|
+
hooks: {
|
|
269
|
+
beforeRequest: async (messages, tools) => {
|
|
270
|
+
console.log(`Sending ${messages.length} messages`);
|
|
271
|
+
return messages; // can modify
|
|
272
|
+
},
|
|
273
|
+
afterResponse: async (response) => {
|
|
274
|
+
console.log(`Got response: ${response.content.slice(0, 50)}...`);
|
|
275
|
+
return response; // can modify
|
|
276
|
+
},
|
|
277
|
+
beforeToolCall: async (name, args) => {
|
|
278
|
+
console.log(`Calling tool: ${name}`, args);
|
|
279
|
+
return args; // can modify
|
|
280
|
+
},
|
|
281
|
+
afterToolCall: async (name, result) => {
|
|
282
|
+
console.log(`Tool result: ${result.content.slice(0, 50)}...`);
|
|
283
|
+
return result; // can modify
|
|
284
|
+
},
|
|
285
|
+
onError: (error) => {
|
|
286
|
+
console.error("Agent error:", error);
|
|
287
|
+
},
|
|
288
|
+
},
|
|
289
|
+
});
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
## Configuration (agent.yaml)
|
|
293
|
+
|
|
294
|
+
The CLI uses `agent.yaml` for configuration:
|
|
295
|
+
|
|
296
|
+
```yaml
|
|
297
|
+
name: my-agent
|
|
298
|
+
systemPrompt: |
|
|
299
|
+
You are a helpful AI assistant.
|
|
300
|
+
|
|
301
|
+
provider:
|
|
302
|
+
name: venice
|
|
303
|
+
apiKey: ${VENICE_API_KEY}
|
|
304
|
+
baseUrl: https://api.venice.ai/api/v1
|
|
305
|
+
defaultModel: qwen3-4b
|
|
306
|
+
|
|
307
|
+
skillsDir: ./skills
|
|
308
|
+
memoryDir: ./.agent/memory
|
|
309
|
+
temperature: 0.7
|
|
310
|
+
maxTokens: 4096
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
Environment variables are resolved with `${VAR_NAME}` syntax.
|
|
314
|
+
|
|
315
|
+
## Integration with agents.eco SDK
|
|
316
|
+
|
|
317
|
+
Use alongside the [agents-eco-sdk](https://www.npmjs.com/package/agents-eco-sdk) for billing, wallet management, and the full agents.eco platform:
|
|
318
|
+
|
|
319
|
+
```typescript
|
|
320
|
+
import { Agent, agentsEcoProvider } from "@agents-eco/open-agentic-framework";
|
|
321
|
+
import { AgentsEco } from "agents-eco-sdk";
|
|
322
|
+
|
|
323
|
+
// Use agents.eco as the LLM provider (pay-per-token with USDC)
|
|
324
|
+
const agent = new Agent({
|
|
325
|
+
name: "eco-agent",
|
|
326
|
+
systemPrompt: "You are powered by agents.eco.",
|
|
327
|
+
provider: {
|
|
328
|
+
name: "agents.eco",
|
|
329
|
+
apiKey: process.env.AGENTS_ECO_API_KEY!,
|
|
330
|
+
baseUrl: "https://agents-eco-dfc6baa9f955.herokuapp.com/v1",
|
|
331
|
+
defaultModel: "qwen3-4b",
|
|
332
|
+
},
|
|
333
|
+
skillsDir: "./skills",
|
|
334
|
+
});
|
|
335
|
+
|
|
336
|
+
const result = await agent.chat("Hello!");
|
|
337
|
+
console.log(result.response);
|
|
338
|
+
console.log(`Tokens used: ${result.usage.totalTokens}`);
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
## Architecture
|
|
342
|
+
|
|
343
|
+
```
|
|
344
|
+
┌─────────────────────────────────────────────┐
|
|
345
|
+
│ Agent │
|
|
346
|
+
│ │
|
|
347
|
+
│ ┌──────────┐ ┌──────────┐ ┌───────────┐ │
|
|
348
|
+
│ │ Skills │ │ Memory │ │ Hooks │ │
|
|
349
|
+
│ │ (SKILL.md)│ │ (JSONL) │ │ │ │
|
|
350
|
+
│ └─────┬─────┘ └─────┬────┘ └─────┬─────┘ │
|
|
351
|
+
│ │ │ │ │
|
|
352
|
+
│ ┌─────▼──────────────▼──────────────▼─────┐ │
|
|
353
|
+
│ │ Message Builder │ │
|
|
354
|
+
│ │ system prompt + skills + memory + user │ │
|
|
355
|
+
│ └─────────────────┬───────────────────────┘ │
|
|
356
|
+
│ │ │
|
|
357
|
+
│ ┌─────────────────▼───────────────────────┐ │
|
|
358
|
+
│ │ Provider (OpenAI-compat) │ │
|
|
359
|
+
│ │ Venice │ OpenAI │ Groq │ Ollama │ ... │ │
|
|
360
|
+
│ └─────────────────┬───────────────────────┘ │
|
|
361
|
+
│ │ │
|
|
362
|
+
│ ┌─────────────────▼───────────────────────┐ │
|
|
363
|
+
│ │ Tool Call Loop │ │
|
|
364
|
+
│ │ LLM → tool calls → execute → repeat │ │
|
|
365
|
+
│ └─────────────────────────────────────────┘ │
|
|
366
|
+
└─────────────────────────────────────────────┘
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
## Built-in Skills
|
|
370
|
+
|
|
371
|
+
The package includes starter skills in the `skills/` directory:
|
|
372
|
+
|
|
373
|
+
| Skill | Description |
|
|
374
|
+
|-------|-------------|
|
|
375
|
+
| `web-search` | Search the web for current information |
|
|
376
|
+
| `code-exec` | Execute JavaScript code snippets |
|
|
377
|
+
| `file-ops` | Read, write, and list files |
|
|
378
|
+
|
|
379
|
+
Copy them to your project's `skills/` directory and register the corresponding tool handlers.
|
|
380
|
+
|
|
381
|
+
## API Reference
|
|
382
|
+
|
|
383
|
+
### `Agent`
|
|
384
|
+
|
|
385
|
+
| Method | Description |
|
|
386
|
+
|--------|-------------|
|
|
387
|
+
| `chat(message)` | Send a message, get a response (with history + memory) |
|
|
388
|
+
| `run(prompt, systemPrompt?)` | One-shot completion (no history/memory) |
|
|
389
|
+
| `useProvider(provider)` | Swap the LLM provider |
|
|
390
|
+
| `tool(name, handler)` | Register a tool handler |
|
|
391
|
+
| `addSkill(skill)` | Add a skill at runtime |
|
|
392
|
+
| `loadSkillFile(path)` | Load a skill from a file |
|
|
393
|
+
| `getHistory()` | Get conversation history |
|
|
394
|
+
| `clearHistory()` | Clear conversation history |
|
|
395
|
+
| `getMemory()` | Get the memory store |
|
|
396
|
+
|
|
397
|
+
### `RunResult`
|
|
398
|
+
|
|
399
|
+
| Field | Type | Description |
|
|
400
|
+
|-------|------|-------------|
|
|
401
|
+
| `response` | `string` | The agent's response |
|
|
402
|
+
| `messages` | `ChatMessage[]` | Full message chain |
|
|
403
|
+
| `toolCalls` | `Array<{name, args, result}>` | Tool calls made |
|
|
404
|
+
| `usage` | `{promptTokens, completionTokens, totalTokens, llmCalls}` | Token usage |
|
|
405
|
+
| `duration` | `number` | Time in milliseconds |
|
|
406
|
+
|
|
407
|
+
## Contributing
|
|
408
|
+
|
|
409
|
+
We welcome contributions of all kinds. This project is early and there is significant room to shape its direction.
|
|
410
|
+
|
|
411
|
+
- **Write a skill** — It is a markdown file. No build step, no boilerplate.
|
|
412
|
+
- **Add a provider** — Implement the `Provider` interface for a new LLM backend.
|
|
413
|
+
- **Improve memory** — Add semantic search, SQLite storage, or vector database adapters.
|
|
414
|
+
- **Report issues** — Bug reports and feature requests help us prioritize.
|
|
415
|
+
- **Submit a pull request** — Code contributions are reviewed promptly.
|
|
416
|
+
|
|
417
|
+
Please open an issue before starting large changes so we can align on direction.
|
|
418
|
+
|
|
419
|
+
## License
|
|
420
|
+
|
|
421
|
+
MIT — [agents.eco](https://agents.eco)
|
|
422
|
+
|
|
423
|
+
---
|
|
424
|
+
|
|
425
|
+
<p align="center">
|
|
426
|
+
Built by <a href="https://agents.eco">agents.eco</a> — the decentralized AI agent economy.
|
|
427
|
+
</p>
|
package/dist/agent.d.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { AgentConfig, ChatMessage, Provider, RunResult, Skill, ToolHandler, MemoryStore } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* The core agent runtime.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { Agent } from "@agents-eco/framework";
|
|
8
|
+
*
|
|
9
|
+
* const agent = new Agent({
|
|
10
|
+
* name: "my-agent",
|
|
11
|
+
* systemPrompt: "You are a helpful assistant.",
|
|
12
|
+
* provider: { name: "venice", apiKey: "...", baseUrl: "https://api.venice.ai/api/v1", defaultModel: "qwen3-4b" },
|
|
13
|
+
* skillsDir: "./skills",
|
|
14
|
+
* });
|
|
15
|
+
*
|
|
16
|
+
* const result = await agent.chat("Hello!");
|
|
17
|
+
* console.log(result.response);
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare class Agent {
|
|
21
|
+
readonly name: string;
|
|
22
|
+
private provider;
|
|
23
|
+
private model;
|
|
24
|
+
private systemPrompt;
|
|
25
|
+
private skills;
|
|
26
|
+
private toolHandlers;
|
|
27
|
+
private memory;
|
|
28
|
+
private history;
|
|
29
|
+
private config;
|
|
30
|
+
private maxReasoningSteps;
|
|
31
|
+
constructor(config: AgentConfig);
|
|
32
|
+
/** Use a custom provider instance */
|
|
33
|
+
useProvider(provider: Provider): this;
|
|
34
|
+
/** Register a tool handler */
|
|
35
|
+
tool(name: string, handler: ToolHandler): this;
|
|
36
|
+
/** Add a skill at runtime */
|
|
37
|
+
addSkill(skill: Skill): this;
|
|
38
|
+
/** Load a skill from a file path */
|
|
39
|
+
loadSkillFile(path: string): this;
|
|
40
|
+
/** Get conversation history */
|
|
41
|
+
getHistory(): ChatMessage[];
|
|
42
|
+
/** Clear conversation history */
|
|
43
|
+
clearHistory(): void;
|
|
44
|
+
/** Get the memory store */
|
|
45
|
+
getMemory(): MemoryStore | null;
|
|
46
|
+
/**
|
|
47
|
+
* Send a message to the agent and get a response.
|
|
48
|
+
* Handles tool calling loops, memory retrieval, and skill injection.
|
|
49
|
+
*/
|
|
50
|
+
chat(message: string): Promise<RunResult>;
|
|
51
|
+
/**
|
|
52
|
+
* Run a one-shot completion (no history, no memory).
|
|
53
|
+
*/
|
|
54
|
+
run(prompt: string, systemPrompt?: string): Promise<string>;
|
|
55
|
+
private loadSkills;
|
|
56
|
+
private getAllTools;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,WAAW,EAGX,QAAQ,EACR,SAAS,EACT,KAAK,EAEL,WAAW,EAEX,WAAW,EACZ,MAAM,YAAY,CAAC;AAOpB;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,KAAK;IAChB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,YAAY,CAAuC;IAC3D,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,OAAO,CAAqB;IACpC,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,iBAAiB,CAAS;gBAEtB,MAAM,EAAE,WAAW;IA8B/B,qCAAqC;IACrC,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAKrC,8BAA8B;IAC9B,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,IAAI;IAK9C,6BAA6B;IAC7B,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAK5B,oCAAoC;IACpC,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAKjC,+BAA+B;IAC/B,UAAU,IAAI,WAAW,EAAE;IAI3B,iCAAiC;IACjC,YAAY,IAAI,IAAI;IAIpB,2BAA2B;IAC3B,SAAS,IAAI,WAAW,GAAG,IAAI;IAI/B;;;OAGG;IACG,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAqK/C;;OAEG;IACG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAkBjE,OAAO,CAAC,UAAU;IAuBlB,OAAO,CAAC,WAAW;CAwBpB"}
|