agent402-client 0.2.0 → 0.2.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 +18 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -47,12 +47,30 @@ const a = new Agent402({ fetch: payFetch });
|
|
|
47
47
|
const article = await a.call("extract", { url: "https://example.com/article" });
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
+
## Workflows (skill packs)
|
|
51
|
+
|
|
52
|
+
For jobs that no single tool covers — e.g. "audit a domain", "build a stock
|
|
53
|
+
brief" — Agent402 ships curated multi-tool **skill packs**: 5–7 catalog tools
|
|
54
|
+
composed into a Claude-ready task template. Discover them the same way you'd
|
|
55
|
+
discover a tool:
|
|
56
|
+
|
|
57
|
+
```js
|
|
58
|
+
const packs = await a.findWorkflows("security audit");
|
|
59
|
+
// → [{ slug: "security-audit", title, tagline, toolSlugs, score, url, promptName }]
|
|
60
|
+
|
|
61
|
+
// Render the full prompt with arguments substituted in (same output as MCP prompts/get).
|
|
62
|
+
const { messages } = await a.getWorkflowPrompt("security-audit", { domain: "stripe.com" });
|
|
63
|
+
// → feed messages straight to any LLM
|
|
64
|
+
```
|
|
65
|
+
|
|
50
66
|
## API
|
|
51
67
|
|
|
52
68
|
| Method | What |
|
|
53
69
|
|---|---|
|
|
54
70
|
| `new Agent402({ baseUrl?, fetch?, cache?, fetchImpl? })` | `fetch` is your x402-wrapped fetch for paid tools (optional); `cache` (default `true`) memoizes deterministic results |
|
|
55
71
|
| `await a.find(task, { k = 5 })` | Resolve a plain-language task to the best-matching tools (route, price, schema, example) |
|
|
72
|
+
| `await a.findWorkflows(task, { k = 2 })` | Resolve a task to matching multi-tool workflow templates (skill packs) |
|
|
73
|
+
| `await a.getWorkflowPrompt(slug, args)` | Fetch the rendered prompt messages for a skill pack with arguments substituted in |
|
|
56
74
|
| `await a.call(slug, params, { idempotencyKey?, cache? })` | Call a tool; auto-pays (PoW for free tools, x402 for wallet-only); returns the JSON result |
|
|
57
75
|
| `Agent402.solvePow(pow)` | Solve a proof-of-work challenge object → an `X-Pow-Solution` value |
|
|
58
76
|
| `a.clearCache()` | Drop the in-memory result cache |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent402-client",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Tiny buyer-side client for Agent402 (x402): resolve a task to a tool and call it with payment handled for you — free tools settle via built-in proof-of-work (no wallet), wallet-only tools via your x402 fetch. Caching + idempotent retries.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|