@agnt-id/frameworks 0.1.0 → 0.1.1
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 +126 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# @agnt-id/frameworks
|
|
2
|
+
|
|
3
|
+
Agent framework plugins for `.agnt` name resolution — LangChain, CrewAI, and ElizaOS.
|
|
4
|
+
|
|
5
|
+
Drop-in tools that let your agents resolve `.agnt` names, reverse-lookup addresses, and discover other agents — in whichever framework you use.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm i @agnt-id/frameworks @agnt-id/resolve
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Or install everything at once:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm i @agnt-id/sdk
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## LangChain
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import {
|
|
23
|
+
AgntResolveTool,
|
|
24
|
+
AgntReverseTool,
|
|
25
|
+
AgntDiscoverTool,
|
|
26
|
+
} from "@agnt-id/frameworks/langchain";
|
|
27
|
+
|
|
28
|
+
const tools = [
|
|
29
|
+
new AgntResolveTool(),
|
|
30
|
+
new AgntReverseTool(),
|
|
31
|
+
new AgntDiscoverTool(),
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
// Use with any LangChain agent
|
|
35
|
+
const agent = createToolCallingAgent({ llm, tools, prompt });
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Each tool follows the LangChain `StructuredTool` pattern with `name`, `description`, `schema`, and `_call()`.
|
|
39
|
+
|
|
40
|
+
| Tool | Input | Description |
|
|
41
|
+
|------|-------|-------------|
|
|
42
|
+
| `AgntResolveTool` | `{ name: string }` | Resolve a `.agnt` name |
|
|
43
|
+
| `AgntReverseTool` | `{ address: string }` | Address to name lookup |
|
|
44
|
+
| `AgntDiscoverTool` | `{ query?: string, skill?: string, domain?: string }` | Discover agents |
|
|
45
|
+
|
|
46
|
+
### Custom Gateway
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
new AgntResolveTool({ gateway: "https://api.agnt.id", chainId: "eip155:8453" });
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## CrewAI
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
import {
|
|
56
|
+
AgntResolveTool,
|
|
57
|
+
AgntReverseTool,
|
|
58
|
+
AgntDiscoverTool,
|
|
59
|
+
} from "@agnt-id/frameworks/crewai";
|
|
60
|
+
|
|
61
|
+
const tools = [
|
|
62
|
+
new AgntResolveTool(),
|
|
63
|
+
new AgntReverseTool(),
|
|
64
|
+
new AgntDiscoverTool(),
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
// Use with CrewAI agents
|
|
68
|
+
const agent = new Agent({ role: "resolver", tools });
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Each tool follows the CrewAI `BaseTool` pattern with `name`, `description`, and `_run()`.
|
|
72
|
+
|
|
73
|
+
## ElizaOS
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
import { agntPlugin } from "@agnt-id/frameworks/eliza";
|
|
77
|
+
|
|
78
|
+
const plugin = agntPlugin();
|
|
79
|
+
|
|
80
|
+
// Register with ElizaOS runtime
|
|
81
|
+
runtime.registerPlugin(plugin);
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
The plugin exposes 3 actions:
|
|
85
|
+
|
|
86
|
+
| Action | Description |
|
|
87
|
+
|--------|-------------|
|
|
88
|
+
| `resolve_agnt` | Resolve a `.agnt` name |
|
|
89
|
+
| `reverse_agnt` | Address to name lookup |
|
|
90
|
+
| `discover_agnt` | Discover agents by query |
|
|
91
|
+
|
|
92
|
+
### Custom Options
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
agntPlugin({ gateway: "https://api.agnt.id", chainId: "eip155:8453" });
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Sub-path Imports
|
|
99
|
+
|
|
100
|
+
Each framework has its own entry point to keep your bundle lean:
|
|
101
|
+
|
|
102
|
+
```typescript
|
|
103
|
+
import { ... } from "@agnt-id/frameworks/langchain";
|
|
104
|
+
import { ... } from "@agnt-id/frameworks/crewai";
|
|
105
|
+
import { ... } from "@agnt-id/frameworks/eliza";
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Or import everything from the root:
|
|
109
|
+
|
|
110
|
+
```typescript
|
|
111
|
+
import {
|
|
112
|
+
LangChainResolveTool,
|
|
113
|
+
CrewAIResolveTool,
|
|
114
|
+
agntPlugin,
|
|
115
|
+
} from "@agnt-id/frameworks";
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Links
|
|
119
|
+
|
|
120
|
+
- [Website](https://www.agnt.id)
|
|
121
|
+
- [API Docs](https://www.agnt.id/docs)
|
|
122
|
+
- [GitHub](https://github.com/txc0ld/agnt.id)
|
|
123
|
+
|
|
124
|
+
## License
|
|
125
|
+
|
|
126
|
+
MIT
|