@easynet/agent-tool-buildin
v0.0.1
Published
Built-in tools for @easynet/agent-tool: FS, HTTP, util, security (sandbox, SSRF).
Downloads
76
Readme
@easynet/agent-tool-buildin
Built-in tools for @easynet/agent-tool: FS, HTTP, util, security (sandbox, SSRF).
Install
npm install @easynet/agent-tool @easynet/agent-tool-buildinPeer dependency: @easynet/agent-tool (>=1.0.0).
Usage
Register with a ToolRegistry and PTCRuntime:
import { ToolRegistry } from "@easynet/agent-tool";
import { PTCRuntime } from "@easynet/agent-tool";
import { registerCoreTools } from "@easynet/agent-tool-buildin";
const registry = new ToolRegistry();
registerCoreTools(registry, {
sandboxRoot: "/var/sandbox",
allowedHosts: ["api.github.com"],
});
const runtime = new PTCRuntime({ registry });
// Invoke: core/fs.readText, core/http.fetchText, etc.Tools
| Namespace | Tools | |-----------|-------| | core/fs | readText, writeText, listDir, searchText, sha256, deletePath | | core/http | fetchText, fetchJson, head, downloadFile, duckduckgoSearch, fetchPageMainContent | | core/util | jsonSelect, truncate, hashText, now, templateRender | | core/exec | runCommand | | security | sandbox, SSRF validation |
Agent YAML
Reference tools via npm descriptor:
tools:
- npm:@easynet/agent-tool-buildin#fs.readText
- npm:@easynet/agent-tool-buildin#http.fetchTextBuild
npm install
npm run buildRelease (npmjs.org)
Releases are published to npmjs.org via GitHub Actions on push to master. Add NPM_TOKEN (npm Automation or Publish token for @easynet) in repo Settings → Secrets and variables → Actions.
License
MIT
