@easynet/agent-tool-hub 1.0.10 → 1.0.11
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 +76 -49
- package/dist/{ToolRegistry-CcwUlxp9.d.cts → ToolRegistry-CN_IXOCr.d.cts} +1 -1
- package/dist/{ToolRegistry-CcwUlxp9.d.ts → ToolRegistry-CN_IXOCr.d.ts} +1 -1
- package/dist/{chunk-5P3BDADX.js → chunk-4GETODZZ.js} +320 -138
- package/dist/chunk-4GETODZZ.js.map +1 -0
- package/dist/{chunk-NBZR67ZQ.cjs → chunk-BQFPB7PS.cjs} +20 -5
- package/dist/chunk-BQFPB7PS.cjs.map +1 -0
- package/dist/{chunk-OTFLSZGA.js → chunk-BSDCF75M.js} +20 -5
- package/dist/chunk-BSDCF75M.js.map +1 -0
- package/dist/{chunk-GB56R2QA.cjs → chunk-FR75LUSN.cjs} +8 -8
- package/dist/{chunk-GB56R2QA.cjs.map → chunk-FR75LUSN.cjs.map} +1 -1
- package/dist/{chunk-UBDTTXT3.cjs → chunk-PS6OEVSD.cjs} +320 -138
- package/dist/chunk-PS6OEVSD.cjs.map +1 -0
- package/dist/{chunk-UBILAFGL.js → chunk-Q6EXJZUA.js} +3 -3
- package/dist/{chunk-UBILAFGL.js.map → chunk-Q6EXJZUA.js.map} +1 -1
- package/dist/cli.cjs +10 -8
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +6 -4
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +631 -65
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +156 -5
- package/dist/index.d.ts +156 -5
- package/dist/index.js +565 -5
- package/dist/index.js.map +1 -1
- package/dist/langchain-tools.cjs +65 -0
- package/dist/langchain-tools.cjs.map +1 -0
- package/dist/langchain-tools.d.cts +35 -0
- package/dist/langchain-tools.d.ts +35 -0
- package/dist/langchain-tools.js +62 -0
- package/dist/langchain-tools.js.map +1 -0
- package/dist/llm-export.cjs +4 -4
- package/dist/llm-export.d.cts +5 -1
- package/dist/llm-export.d.ts +5 -1
- package/dist/llm-export.js +1 -1
- package/dist/{toolhub-runtime-2mpNfBT2.d.ts → toolhub-runtime-BfcrjPFr.d.ts} +35 -11
- package/dist/{toolhub-runtime-DHWVBtvO.d.cts → toolhub-runtime-DEyMoDfB.d.cts} +35 -11
- package/dist/toolhub-runtime.cjs +9 -9
- package/dist/toolhub-runtime.d.cts +2 -2
- package/dist/toolhub-runtime.d.ts +2 -2
- package/dist/toolhub-runtime.js +2 -2
- package/examples/agent-toolhub-react-stock.mjs +68 -0
- package/examples/report-1.png +0 -0
- package/examples/report-2.png +0 -0
- package/examples/reports/AAPL-research-report.html +362 -0
- package/examples/toolhub.yaml +38 -0
- package/examples/tools/filesystem/langchain/filesystem.js +87 -0
- package/examples/tools/instruction-only/skill/SKILL.md +26 -0
- package/examples/tools/page-access/langchain/page-access.js +44 -0
- package/examples/tools/system-time/skill/SKILL.md +37 -0
- package/examples/tools/system-time/skill/handler.js +44 -0
- package/examples/tools/web-search/mcp/mcp.json +8 -0
- package/examples/tools/yahoo-finance/skill/SKILL.md +58 -0
- package/examples/tools/yahoo-finance/skill/chart.js +33 -0
- package/examples/tools/yahoo-finance/skill/index.js +35 -0
- package/examples/tools/yahoo-finance/skill/lib/yahoo-api.js +68 -0
- package/examples/tools/yahoo-finance/skill/quote.js +33 -0
- package/examples/tools/yahoo-finance/skill/references/REFERENCE.md +16 -0
- package/package.json +26 -5
- package/dist/chunk-5P3BDADX.js.map +0 -1
- package/dist/chunk-NBZR67ZQ.cjs.map +0 -1
- package/dist/chunk-OTFLSZGA.js.map +0 -1
- package/dist/chunk-UBDTTXT3.cjs.map +0 -1
package/README.md
CHANGED
|
@@ -6,9 +6,82 @@ Define tools with simple, familiar formats: drop a folder under a configured roo
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
+
## What we support
|
|
10
|
+
|
|
11
|
+
| Supported tools | How to write | Spec |
|
|
12
|
+
|-----------------|--------------|------|
|
|
13
|
+
| **SKILL** | We fully support the SKILL spec with any LLM.<br>[Examples](examples/tools/yahoo-finance/skill/)<br>[SKILL spec and our implementation support](docs/AGENT_SKILLS_SPEC.md) | [Agent Skills](https://agentskills.io/specification) |
|
|
14
|
+
| **LangChain** | Export a `StructuredTool` in `langchain/`; we auto-discover.<br>[Examples](examples/tools/filesystem/langchain/) | [LangChain Tools](https://js.langchain.com/docs/modules/agents/tools/) |
|
|
15
|
+
| **MCP** | Put `mcp.json` (Cursor-style) in `mcp/`; we connect as client.<br>We recommend [easy-mcp-server](https://www.npmjs.com/package/easy-mcp-server) for writing MCP servers.<br>[Example](examples/tools/web-search/mcp/) | [MCP Specification](https://modelcontextprotocol.io/specification/latest) |
|
|
16
|
+
| **n8n** | Put workflow JSON in `n8n/`; we run local n8n.<br>[@easynet/n8n-local](https://www.npmjs.com/package/@easynet/n8n-local) | [n8n Workflows](https://docs.n8n.io/workflows/) |
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Install
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install @easynet/agent-tool-hub
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Node 18+ required.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Run the stock research example
|
|
31
|
+
|
|
32
|
+
End-to-end demo: **ReAct agent** + **yahoo-finance SKILL tools** + **HTML report**. After [installing](#install), run (examples are bundled; no clone needed):
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npx agent-toolhub-react-stock GOOGL
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Pass the ticker symbol (e.g. `GOOGL`, `AAPL`, `MSFT`). **Configure your own LLM** — point the example to your OpenAI-compatible API (base URL and API key) in [examples/agent-toolhub-react-stock.mjs](examples/agent-toolhub-react-stock.mjs) or via env (e.g. `OPENAI_API_KEY`, `OPENAI_BASE_URL`). The bundled example uses placeholder values; replace them with your model endpoint.
|
|
39
|
+
|
|
40
|
+
Output: console step-by-step progress + an HTML report (e.g. `GOOGL-research-report.html`) in the current directory. See a sample report: [examples/reports/AAPL-research-report.html](examples/reports/AAPL-research-report.html).
|
|
41
|
+
|
|
42
|
+
**Agent Run Report** — The generated HTML report is a highlight: it shows system/user prompts, the rendered Markdown report, and a Debug tab with step-by-step execution and token usage.
|
|
43
|
+
|
|
44
|
+
| Report | Debug |
|
|
45
|
+
|--------|-------|
|
|
46
|
+
| [](examples/report-1.png) | [](examples/report-2.png) |
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Use
|
|
51
|
+
|
|
52
|
+
### Embed in LangChain (minimal)
|
|
53
|
+
|
|
54
|
+
Initialize the runtime, then pass the tools to your agent:
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
import { createAgentToolHub } from "@easynet/agent-tool-hub/langchain-tools";
|
|
58
|
+
|
|
59
|
+
// 1. Init runtime (loads tools from toolhub.yaml)
|
|
60
|
+
const toolHub = await createAgentToolHub("toolhub.yaml");
|
|
61
|
+
|
|
62
|
+
// 2. Create your LangChain agent, pass our tools, and run
|
|
63
|
+
const agent = createAgent({
|
|
64
|
+
model: new ChatOpenAI({ temperature: 0 }),
|
|
65
|
+
tools: toolHub.tools, // discovered tools from SKILL / LangChain / MCP / n8n
|
|
66
|
+
});
|
|
67
|
+
const stream = await agent.stream(/* your messages */);
|
|
68
|
+
// ...
|
|
69
|
+
|
|
70
|
+
// 3. Shutdown
|
|
71
|
+
await toolHub.shutdown();
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**Tracking & reports** — Optional: `formatStepProgress(step)` for console; `writeReportFromStream(stream, { htmlReportPath, onStep })` for an HTML report.
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Code reference
|
|
79
|
+
|
|
80
|
+
Full examples for each tool type: [SKILL](#skill) · [LangChain](#langchain) · [MCP](#mcp) · [n8n](#n8n).
|
|
81
|
+
|
|
9
82
|
### SKILL
|
|
10
83
|
|
|
11
|
-
Markdown spec + JS handler. Put under `skill
|
|
84
|
+
Markdown spec + JS handler. Put under `skill/`. Full spec compliance and implementation details: [docs/AGENT_SKILLS_SPEC.md](docs/AGENT_SKILLS_SPEC.md).
|
|
12
85
|
|
|
13
86
|
```yaml
|
|
14
87
|
# skill/SKILL.md
|
|
@@ -27,8 +100,6 @@ async function handler(args) {
|
|
|
27
100
|
export default handler;
|
|
28
101
|
```
|
|
29
102
|
|
|
30
|
-
---
|
|
31
|
-
|
|
32
103
|
### LangChain
|
|
33
104
|
|
|
34
105
|
Export a LangChain tool (e.g. `StructuredTool`). Put under `langchain/`:
|
|
@@ -49,11 +120,9 @@ class CalculatorTool extends StructuredTool {
|
|
|
49
120
|
export default new CalculatorTool();
|
|
50
121
|
```
|
|
51
122
|
|
|
52
|
-
---
|
|
53
|
-
|
|
54
123
|
### MCP
|
|
55
124
|
|
|
56
|
-
|
|
125
|
+
We do **not** provide MCP server implementation—we provide an **MCP client** that connects to existing MCP servers. Put a Cursor-style `mcp.json` under `mcp/`. To implement an MCP server, we recommend [**easy-mcp-server**](https://www.npmjs.com/package/easy-mcp-server).
|
|
57
126
|
|
|
58
127
|
```json
|
|
59
128
|
// mcp/mcp.json
|
|
@@ -67,11 +136,9 @@ Declare MCP server in JSON. Put under `mcp/`; the server process is started by t
|
|
|
67
136
|
}
|
|
68
137
|
```
|
|
69
138
|
|
|
70
|
-
---
|
|
71
|
-
|
|
72
139
|
### n8n
|
|
73
140
|
|
|
74
|
-
Drop an n8n workflow JSON
|
|
141
|
+
Drop an n8n workflow JSON under `n8n/`. We run a local n8n server ([**@easynet/n8n-local**](https://www.npmjs.com/package/@easynet/n8n-local)) and call the instance directly—no API.
|
|
75
142
|
|
|
76
143
|
```json
|
|
77
144
|
// n8n/workflow.json
|
|
@@ -87,43 +154,3 @@ Drop an n8n workflow JSON. Put under `n8n/`; the hub runs it (local or via API):
|
|
|
87
154
|
"connections": {}
|
|
88
155
|
}
|
|
89
156
|
```
|
|
90
|
-
|
|
91
|
-
---
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
## Install
|
|
95
|
-
|
|
96
|
-
```bash
|
|
97
|
-
npm install @easynet/agent-tool-hub
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
Node 18+ required.
|
|
101
|
-
|
|
102
|
-
---
|
|
103
|
-
|
|
104
|
-
## Use
|
|
105
|
-
|
|
106
|
-
### CLI
|
|
107
|
-
|
|
108
|
-
Copy `toolhub.example.yaml` to `toolhub.yaml` in your project (or use `-c path/to/config.yaml`), then:
|
|
109
|
-
|
|
110
|
-
```bash
|
|
111
|
-
npx agent-tool-hub scan # load tools from configured roots
|
|
112
|
-
npx agent-tool-hub verify # scan and exit 1 on errors
|
|
113
|
-
npx agent-tool-hub list # list discovered tools
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
### In code
|
|
117
|
-
|
|
118
|
-
Recommended — create and init in one call:
|
|
119
|
-
|
|
120
|
-
```ts
|
|
121
|
-
import { createAgentToolHub } from "@easynet/agent-tool-hub";
|
|
122
|
-
|
|
123
|
-
const toolHub = await createAgentToolHub("toolhub.yaml");
|
|
124
|
-
const result = await toolHub.invokeTool("utils.calculator", { expression: "1 + 2" });
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
---
|
|
128
|
-
|
|
129
|
-
See `toolhub.example.yaml` for config example and `examples/` for full tool layouts.
|
|
@@ -193,4 +193,4 @@ declare class ToolRegistry {
|
|
|
193
193
|
private deindexTool;
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
-
export { type BudgetConfig as B, type Capability as C, type Evidence as E, type
|
|
196
|
+
export { type BudgetConfig as B, type Capability as C, type Evidence as E, type ToolSpec as T, type ToolResult as a, type ToolError as b, type ExecContext as c, ToolRegistry as d, type ToolAdapter as e, type ToolIntent as f, type ToolKind as g, type CostHints as h, type ToolSearchQuery as i };
|
|
@@ -193,4 +193,4 @@ declare class ToolRegistry {
|
|
|
193
193
|
private deindexTool;
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
-
export { type BudgetConfig as B, type Capability as C, type Evidence as E, type
|
|
196
|
+
export { type BudgetConfig as B, type Capability as C, type Evidence as E, type ToolSpec as T, type ToolResult as a, type ToolError as b, type ExecContext as c, ToolRegistry as d, type ToolAdapter as e, type ToolIntent as f, type ToolKind as g, type CostHints as h, type ToolSearchQuery as i };
|