@agentic-eng/easa 0.1.0-beta.2 → 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.
Files changed (2) hide show
  1. package/README.md +95 -11
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,8 +1,13 @@
1
1
  # @agentic-eng/easa
2
2
 
3
- > EASA — Easy Agent System Architecture: A Minimal TypeScript Framework for Agent Systems.
3
+ > EASA — Easy Agent System Architecture: A minimal, type-safe TypeScript framework for building LLM-powered agent systems.
4
4
 
5
- This is the umbrella package that re-exports core primitives from all EASA packages. For granular, tree-shakeable imports, use the individual packages directly.
5
+ [![npm](https://img.shields.io/npm/v/@agentic-eng/easa)](https://www.npmjs.com/package/@agentic-eng/easa)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
7
+
8
+ > **Beta** — API may change before 1.0. Feedback welcome!
9
+
10
+ This is the **umbrella package** that re-exports everything from all EASA packages in a single import. For granular, tree-shakeable imports, use [`@agentic-eng/agent`](https://www.npmjs.com/package/@agentic-eng/agent) directly.
6
11
 
7
12
  ## Installation
8
13
 
@@ -12,26 +17,105 @@ npm install @agentic-eng/easa
12
17
  pnpm add @agentic-eng/easa
13
18
  ```
14
19
 
15
- ## Usage
20
+ ## Quick Start
16
21
 
17
22
  ```typescript
18
- import { Agent } from '@agentic-eng/easa';
23
+ import { Agent, ToolRegistry, FlatFileMemoryProvider, ConsoleEventEmitter } from '@agentic-eng/easa';
24
+ import type { LLMProvider, Tool } from '@agentic-eng/easa';
25
+
26
+ // 1. Bring your own LLM
27
+ const provider: LLMProvider = {
28
+ async chat(messages) {
29
+ const res = await callYourLLM(messages);
30
+ return { message: { role: 'assistant', content: res.text } };
31
+ },
32
+ async *chatStream(messages) {
33
+ for await (const chunk of streamYourLLM(messages)) {
34
+ yield { delta: chunk.text, done: chunk.finished };
35
+ }
36
+ },
37
+ };
38
+
39
+ // 2. Define tools
40
+ const calculator: Tool = {
41
+ definition: {
42
+ name: 'calculator',
43
+ description: 'Evaluates arithmetic expressions.',
44
+ inputSchema: {
45
+ type: 'object',
46
+ properties: {
47
+ expression: { type: 'string', description: 'Math expression' },
48
+ },
49
+ required: ['expression'],
50
+ },
51
+ },
52
+ async execute(input) {
53
+ const result = evaluate(input.expression as string);
54
+ return { toolName: 'calculator', success: true, output: String(result) };
55
+ },
56
+ };
19
57
 
58
+ const tools = new ToolRegistry();
59
+ tools.register(calculator);
60
+
61
+ // 3. Create an agent
20
62
  const agent = new Agent({
21
- name: 'my-agent',
22
- description: 'An example agent',
63
+ name: 'assistant',
64
+ provider,
65
+ systemPrompt: 'You are a helpful assistant.',
66
+ tools,
67
+ memory: new FlatFileMemoryProvider('./memory'),
68
+ emitter: new ConsoleEventEmitter(),
69
+ maxIterations: 10,
23
70
  });
71
+
72
+ // 4. Use it
73
+ const result = await agent.invoke('What is 42 × 17?');
74
+ console.log(result.content);
75
+ console.log(`Done in ${result.trace.totalIterations} iteration(s)`);
76
+
77
+ // Or stream
78
+ for await (const chunk of agent.invokeStream('Tell me a story.')) {
79
+ process.stdout.write(chunk.delta);
80
+ }
24
81
  ```
25
82
 
26
- ## Granular Packages
83
+ ## What's Included
27
84
 
28
- For finer control, import directly from individual packages:
85
+ Everything from `@agentic-eng/agent` is re-exported:
29
86
 
30
- | Package | Import |
87
+ | Export | Description |
31
88
  | --- | --- |
32
- | [`@agentic-eng/agent`](../agent) | `import { Agent } from "@agentic-eng/agent"` |
89
+ | `Agent` | Core agent class with reasoning loop |
90
+ | `ToolRegistry` | Tool management (custom + MCP) |
91
+ | `FlatFileMemoryProvider` | File-based memory using KNL format |
92
+ | `ConsoleEventEmitter` | Pretty-printed console event logger |
93
+ | `NoopEventEmitter` | Silent emitter (default) |
94
+ | `LLMProvider` | Interface — implement for your LLM backend |
95
+ | `Tool` | Interface — implement for custom tools |
96
+ | `MemoryProvider` | Interface — implement for custom storage |
97
+ | `AgentEventEmitter` | Interface — implement for custom observability |
98
+ | Error classes | `EasaError`, `ProviderError`, `AgentConfigError`, `MaxIterationsError`, `ReasoningParseError`, `ToolExecutionError` |
33
99
 
34
- More packages coming soon: `@agentic-eng/providers`, `@agentic-eng/tools`, `@agentic-eng/memory`, `@agentic-eng/mcp`, `@agentic-eng/telemetry`.
100
+ ## Key Features
101
+
102
+ - **Reasoning Loop** — JSON-controlled iteration: the LLM decides when it's done
103
+ - **Tool System** — Hybrid approach: compact index every call, full schema on demand
104
+ - **Memory** — Pluggable persistence (built-in KNL flat files or custom backends)
105
+ - **Event Emission** — OTEL-aligned lifecycle events at every execution point
106
+ - **Streaming** — Single-pass streaming via `invokeStream()`
107
+ - **Zero LLM Lock-in** — Bring any LLM backend via the `LLMProvider` interface
108
+ - **Dual Output** — ESM + CJS with full TypeScript declarations
109
+
110
+ ## Documentation
111
+
112
+ Full documentation with detailed examples for each feature is available in the [`@agentic-eng/agent` README](https://www.npmjs.com/package/@agentic-eng/agent).
113
+
114
+ ## Granular Packages
115
+
116
+ | Package | Description |
117
+ | --- | --- |
118
+ | [`@agentic-eng/agent`](https://www.npmjs.com/package/@agentic-eng/agent) | Core agent, reasoning loop, tools, memory, events |
35
119
 
36
120
  ## License
37
121
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentic-eng/easa",
3
- "version": "0.1.0-beta.2",
3
+ "version": "0.1.0",
4
4
  "description": "EASA — Easy Agent System Architecture: A Minimal TypeScript Framework for Agent Systems.",
5
5
  "keywords": [
6
6
  "agent",
@@ -43,7 +43,7 @@
43
43
  "node": ">=18.0.0"
44
44
  },
45
45
  "dependencies": {
46
- "@agentic-eng/agent": "0.1.0-beta.2"
46
+ "@agentic-eng/agent": "0.1.0"
47
47
  },
48
48
  "devDependencies": {
49
49
  "tsup": "^8.0.0",