minia2a-skill 1.1.18 → 1.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 +34 -45
- package/cli/minia2a +95 -165
- package/package.json +6 -6
- package/wrappers/claude-code/SKILL.md +23 -106
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<p align="center">
|
|
7
7
|
<img src="https://img.shields.io/badge/license-MIT-blue" alt="MIT">
|
|
8
8
|
<img src="https://img.shields.io/badge/node-%3E%3D18-brightgreen" alt="Node >=18">
|
|
9
|
-
<img src="https://img.shields.io/github/stars/minia2a-org/minia2a
|
|
9
|
+
<img src="https://img.shields.io/github/stars/minia2a-org/minia2a-skill?style=flat&logo=github" alt="GitHub stars">
|
|
10
10
|
<img src="https://img.shields.io/badge/USDC-Base-0052FF?logo=usdc" alt="USDC on Base">
|
|
11
11
|
<a href="https://www.npmjs.com/package/minia2a-skill"><img src="https://img.shields.io/npm/v/minia2a-skill?color=blue" alt="npm"></a>
|
|
12
12
|
<img src="https://img.shields.io/npm/dt/minia2a-skill" alt="downloads">
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
|
|
19
19
|
**Agents can't open bank accounts. We fixed that.**
|
|
20
20
|
|
|
21
|
-
minia2a is
|
|
21
|
+
minia2a is an agent-only marketplace for x402 microservices — AI agents discover, call, and pay per call in USDC. No human signup, no KYC. Register with your own self-custody wallet for 500 free credits, then call any of 1,600+ endpoints. Sellers list an endpoint and earn USDC per call.
|
|
22
22
|
|
|
23
|
-
Built on [
|
|
23
|
+
Built on [x402](https://x402.org/) (HTTP 402, Linux Foundation standard). [minia2a.uk](https://minia2a.uk) is the reference marketplace — this repo is the agent SDK.
|
|
24
24
|
|
|
25
|
-
**🆕 MCP Server:** Listed on the [official MCP Registry](https://registry.modelcontextprotocol.io) as `uk.minia2a/minia2a` —
|
|
25
|
+
**🆕 MCP Server:** Listed on the [official MCP Registry](https://registry.modelcontextprotocol.io) as `uk.minia2a/minia2a` — discover and call 1,600+ endpoints via streamable-http (5 tools: `service_discovery`, `service_call`, `register_agent`, `get_receipt`, `get_stats`). Add to Claude Desktop, Cursor, or any MCP client.
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
28
|
# One-line install
|
|
@@ -31,26 +31,21 @@ curl -sSL https://minia2a.uk/install | bash
|
|
|
31
31
|
# Discover services
|
|
32
32
|
minia2a discover
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
On-Chain Executor 12¢ · access · 156 calls
|
|
34
|
+
# Register your wallet → 500 free credits
|
|
35
|
+
minia2a register --name "My Agent" --wallet 0x... --signature 0x...
|
|
37
36
|
|
|
38
|
-
#
|
|
39
|
-
minia2a
|
|
40
|
-
Service name: My Agent
|
|
41
|
-
Endpoint: https://my-agent.com/api
|
|
42
|
-
Price in cents (min 5¢): 10
|
|
43
|
-
→ Listed. Your agent is now earning.
|
|
37
|
+
# Call a service (credits decrement per call)
|
|
38
|
+
minia2a call x402-time --wallet 0x...
|
|
44
39
|
```
|
|
45
40
|
|
|
46
41
|
## Why
|
|
47
42
|
|
|
48
43
|
| Problem | Solution |
|
|
49
44
|
|---------|----------|
|
|
50
|
-
| AI agents can't receive payments | USDC on Base — no bank, no KYC, no human |
|
|
51
|
-
| Builders can't monetize agents |
|
|
52
|
-
| No standard way to discover agents | `/api/services` +
|
|
53
|
-
|
|
|
45
|
+
| AI agents can't receive payments | USDC on Base + Algorand — no bank, no KYC, no human |
|
|
46
|
+
| Builders can't monetize agents | List an endpoint → get paid per call via x402 |
|
|
47
|
+
| No standard way to discover agents | `/api/services` + `/api/agent-ready` |
|
|
48
|
+
| Agents need to pay automatically | x402 V2 `accepts[]` — machine-readable price + payTo |
|
|
54
49
|
|
|
55
50
|
## How it works
|
|
56
51
|
|
|
@@ -59,32 +54,28 @@ sequenceDiagram
|
|
|
59
54
|
participant Buyer as Buyer Agent
|
|
60
55
|
participant Platform as minia2a.uk
|
|
61
56
|
participant Seller as Seller Agent
|
|
62
|
-
|
|
63
|
-
Buyer->>Platform: 1.
|
|
64
|
-
Buyer
|
|
65
|
-
|
|
57
|
+
|
|
58
|
+
Buyer->>Platform: 1. GET /x402/:service?probe=1
|
|
59
|
+
Platform->>Buyer: 2. HTTP 402 {accepts[]: amount, asset, network, payTo}
|
|
60
|
+
Buyer->>Platform: 3. Call with ?wallet=0x... (credits) or pay USDC
|
|
66
61
|
Platform->>Seller: 4. Forward request
|
|
67
62
|
Seller->>Platform: 5. Response
|
|
68
|
-
Platform->>Buyer: 6.
|
|
69
|
-
Platform->>Seller: 7. Credit 95%. Auto-settle at $1
|
|
63
|
+
Platform->>Buyer: 6. Result
|
|
70
64
|
```
|
|
71
65
|
|
|
72
|
-
Every call is
|
|
66
|
+
Every call is priced in the 402 response. The buyer pays USDC (or spends free credits); the seller earns per call. **5% platform fee.**
|
|
73
67
|
|
|
74
68
|
## CLI Reference
|
|
75
69
|
|
|
76
70
|
```bash
|
|
77
|
-
minia2a discover [query] [--category cat] [--sort volume|price
|
|
78
|
-
minia2a
|
|
79
|
-
minia2a
|
|
80
|
-
minia2a
|
|
81
|
-
minia2a
|
|
82
|
-
minia2a delete <id> --api-key <key>
|
|
83
|
-
minia2a rate <id> --tx-hash <hash> --rating <1-5> [--comment "..."]
|
|
84
|
-
minia2a meta # platform info
|
|
71
|
+
minia2a discover [query] [--category cat] [--sort volume|price]
|
|
72
|
+
minia2a meta
|
|
73
|
+
minia2a register --name <n> --wallet <0x...> --signature <0x...>
|
|
74
|
+
minia2a call <id> --wallet <0x...> [--input '{}'] [--probe]
|
|
75
|
+
minia2a help
|
|
85
76
|
```
|
|
86
77
|
|
|
87
|
-
All commands output JSON. Exit code 0 = success.
|
|
78
|
+
All commands output JSON. Exit code 0 = success. `--probe` returns the 402 payment JSON without consuming credits.
|
|
88
79
|
|
|
89
80
|
## Agent Wrappers
|
|
90
81
|
|
|
@@ -107,37 +98,35 @@ curl -sSL https://minia2a.uk/install | bash
|
|
|
107
98
|
# 2. Browse available services
|
|
108
99
|
minia2a discover
|
|
109
100
|
|
|
110
|
-
# 3.
|
|
111
|
-
|
|
112
|
-
minia2a call <service-id> --tx-hash 0x... --signature 0x...
|
|
101
|
+
# 3. Register (self-custody wallet + EIP-191 signature) → 500 free credits
|
|
102
|
+
minia2a register --name "My Agent" --wallet 0x... --signature 0x...
|
|
113
103
|
|
|
114
|
-
# 4.
|
|
115
|
-
minia2a
|
|
104
|
+
# 4. Call a service — credits decrement, no payment needed while you have credits
|
|
105
|
+
minia2a call x402-time --wallet 0x...
|
|
116
106
|
```
|
|
117
107
|
|
|
118
108
|
## Pricing
|
|
119
109
|
|
|
120
110
|
| Item | Amount |
|
|
121
111
|
|------|--------|
|
|
122
|
-
|
|
|
112
|
+
| Free credits | 500 on registration (through Sep 1, 2026) |
|
|
123
113
|
| Platform fee | 5% |
|
|
124
|
-
|
|
|
125
|
-
|
|
|
126
|
-
| Settlement | Auto on-chain at $1 (batched to save gas) |
|
|
114
|
+
| Currency | USDC on Base (`eip155:8453`) + Algorand (ASA 31566704) |
|
|
115
|
+
| Price signal | HTTP 402 `accepts[].amount` (micro-units, e.g. `"100000"` = $0.10) |
|
|
127
116
|
|
|
128
117
|
## Protocols
|
|
129
118
|
|
|
130
119
|
minia2a implements:
|
|
131
120
|
|
|
132
|
-
- **[
|
|
133
|
-
- **[x402](https://x402.org/)** — HTTP 402 payment; receiver via `/.well-known/x402`
|
|
121
|
+
- **[x402](https://x402.org/)** — HTTP 402 payment; discovery via `/.well-known/x402`
|
|
134
122
|
- **USDC on Base** — `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`
|
|
123
|
+
- **USDC on Algorand** — ASA `31566704`
|
|
135
124
|
|
|
136
125
|
## Links
|
|
137
126
|
|
|
138
127
|
- Marketplace: [minia2a.uk](https://minia2a.uk)
|
|
139
|
-
- Agent card: [/.well-known/agent-card.json](https://minia2a.uk/.well-known/agent-card.json)
|
|
140
128
|
- x402 endpoint: [/.well-known/x402](https://minia2a.uk/.well-known/x402)
|
|
129
|
+
- Auto-mode guide: [AGENTS.md](https://minia2a.uk/AGENTS.md)
|
|
141
130
|
- Install: `curl -sSL https://minia2a.uk/install | bash`
|
|
142
131
|
- Claude Code skill: `curl -sSL https://minia2a.uk/skill`
|
|
143
132
|
- npm: `npx minia2a-skill`
|
package/cli/minia2a
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// minia2a CLI —
|
|
2
|
+
// minia2a CLI — x402 agent marketplace client (V5)
|
|
3
3
|
// Usage: minia2a <command> [options]
|
|
4
4
|
// API base: MINIA2A_API env var (default https://minia2a.uk)
|
|
5
5
|
// Zero dependencies — runs on any Node 18+ installation.
|
|
6
6
|
|
|
7
7
|
const API = process.env.MINIA2A_API || 'https://minia2a.uk';
|
|
8
8
|
const USAGE = `
|
|
9
|
-
minia2a —
|
|
9
|
+
minia2a — x402 agent marketplace (V5)
|
|
10
10
|
|
|
11
11
|
Usage:
|
|
12
12
|
minia2a discover [query] [--category <cat>] [--sort volume|price]
|
|
13
|
-
minia2a
|
|
14
|
-
minia2a
|
|
15
|
-
minia2a
|
|
16
|
-
minia2a
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
minia2a meta
|
|
14
|
+
minia2a register --name <n> --wallet <0x...> --signature <0x...>
|
|
15
|
+
minia2a call <service-id> --wallet <0x...> [--input <json>] [--probe]
|
|
16
|
+
minia2a help [topic]
|
|
17
|
+
|
|
18
|
+
No human signup. Register with a self-custody wallet + EIP-191 signature
|
|
19
|
+
for 500 free credits (through Sep 1, 2026). Pay per call in USDC via x402
|
|
20
|
+
(HTTP 402) once credits run out. Full guide: https://minia2a.uk/AGENTS.md
|
|
19
21
|
`;
|
|
20
22
|
|
|
21
23
|
function bail(msg, code = 1) {
|
|
@@ -36,12 +38,9 @@ function flag(name) {
|
|
|
36
38
|
const i = args.indexOf('--' + name);
|
|
37
39
|
if (i === -1) return null;
|
|
38
40
|
const v = args[i + 1];
|
|
39
|
-
|
|
40
|
-
if (!v || v.startsWith('--')) return true; // boolean flag
|
|
41
|
-
return v;
|
|
41
|
+
return (!v || v.startsWith('--')) ? true : v;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
// Parse positional args (before first --flag)
|
|
45
44
|
const positional = [];
|
|
46
45
|
for (let i = 0; i < args.length; i++) {
|
|
47
46
|
if (args[i].startsWith('--')) { i++; continue; }
|
|
@@ -59,94 +58,46 @@ async function discover() {
|
|
|
59
58
|
if (sort) params.set('sort', sort);
|
|
60
59
|
try {
|
|
61
60
|
const r = await fetch(`${API}/api/services?${params}`);
|
|
62
|
-
if (!r.ok) bail(`Error: ${r.status}`, 3);
|
|
63
|
-
json(await r.json());
|
|
64
|
-
} catch(e) {
|
|
65
|
-
bail(`Cannot reach marketplace: ${e.message}`, 3);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
async function call(id) {
|
|
70
|
-
if (!id) bail('Usage: minia2a call <id> --tx-hash <hash> --signature <sig> [--input <json>]');
|
|
71
|
-
const txHash = flag('tx-hash');
|
|
72
|
-
if (!txHash || txHash === true) bail('--tx-hash required');
|
|
73
|
-
const signature = flag('signature');
|
|
74
|
-
if (!signature || signature === true) bail('--signature required (sign txHash:serviceId with your wallet)');
|
|
75
|
-
let input = undefined;
|
|
76
|
-
const inputStr = flag('input');
|
|
77
|
-
if (inputStr) {
|
|
78
|
-
try { input = JSON.parse(inputStr); } catch { bail('--input must be valid JSON'); }
|
|
79
|
-
}
|
|
80
|
-
try {
|
|
81
|
-
const r = await fetch(`${API}/api/call/${encodeURIComponent(id)}`, {
|
|
82
|
-
method: 'POST',
|
|
83
|
-
headers: { 'Content-Type': 'application/json' },
|
|
84
|
-
body: JSON.stringify({ txHash, signature, input })
|
|
85
|
-
});
|
|
86
61
|
const d = await r.json();
|
|
87
62
|
json(d);
|
|
88
63
|
if (!r.ok) process.exit(3);
|
|
89
|
-
} catch(e) {
|
|
64
|
+
} catch (e) {
|
|
90
65
|
bail(`Cannot reach marketplace: ${e.message}`, 3);
|
|
91
66
|
}
|
|
92
67
|
}
|
|
93
68
|
|
|
94
|
-
async function
|
|
95
|
-
if (!name) bail('Usage: minia2a account <name>');
|
|
69
|
+
async function meta() {
|
|
96
70
|
try {
|
|
97
|
-
const r = await fetch(`${API}/
|
|
71
|
+
const r = await fetch(`${API}/.well-known/x402`);
|
|
98
72
|
const d = await r.json();
|
|
99
73
|
json(d);
|
|
100
74
|
if (!r.ok) process.exit(3);
|
|
101
|
-
} catch(e) {
|
|
75
|
+
} catch (e) {
|
|
102
76
|
bail(`Cannot reach marketplace: ${e.message}`, 3);
|
|
103
77
|
}
|
|
104
78
|
}
|
|
105
79
|
|
|
106
80
|
async function register() {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
let wallet = flag('wallet');
|
|
111
|
-
let advantage = flag('advantage');
|
|
112
|
-
let category = flag('category') || 'other';
|
|
113
|
-
let model = flag('model') || '';
|
|
114
|
-
let desc = flag('desc') || '';
|
|
115
|
-
let agentName = flag('agent-name') || '';
|
|
116
|
-
|
|
117
|
-
// Validate: boolean flags (true) mean the flag was present without a value → invalid
|
|
118
|
-
if (name === true || endpoint === true || priceCents === true || wallet === true || advantage === true) {
|
|
119
|
-
bail('Missing value for a required flag. Use --name "value" not --name without value.');
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
if (!name || !endpoint || !priceCents || !wallet || !advantage) {
|
|
123
|
-
const rl = require('readline').createInterface({ input: process.stdin, output: process.stdout });
|
|
124
|
-
const ask = (q) => new Promise(resolve => rl.question(q, resolve));
|
|
125
|
-
|
|
126
|
-
console.error('─ Register an agent service on minia2a.uk ─');
|
|
127
|
-
name = name || await ask('Service name: ');
|
|
128
|
-
desc = desc || await ask('Short description: ');
|
|
129
|
-
endpoint = endpoint || await ask('Your agent endpoint URL: ');
|
|
130
|
-
priceCents = priceCents || await ask('Price in cents (min 5¢): ');
|
|
131
|
-
agentName = agentName || await ask('Your agent name (or press ENTER): ');
|
|
132
|
-
model = model || await ask('Model (e.g. DeepSeek V4): ');
|
|
133
|
-
category = category !== 'other' ? category : ((await ask('Category [other]: ')) || 'other');
|
|
134
|
-
wallet = wallet || await ask('Your wallet (0x...) for settlement: ');
|
|
135
|
-
advantage = advantage || await ask('Why buy instead of DIY (min 10 chars): ');
|
|
81
|
+
const name = flag('name');
|
|
82
|
+
const wallet = flag('wallet');
|
|
83
|
+
const signature = flag('signature');
|
|
136
84
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
85
|
+
if (!name || name === true) bail('--name <name> required');
|
|
86
|
+
if (!wallet || wallet === true) bail('--wallet <0x...> required (your own self-custody wallet)');
|
|
87
|
+
|
|
88
|
+
if (!signature || signature === true) {
|
|
89
|
+
// The CLI never holds your key — you sign the message yourself (EIP-191 personal_sign).
|
|
90
|
+
console.error('A signature is required. Sign this exact message with your wallet (EIP-191 personal_sign):\n');
|
|
91
|
+
console.error(` minia2a register: ${wallet}\n`);
|
|
92
|
+
console.error('Then re-run with --signature <0x...>:\n');
|
|
93
|
+
console.error(` minia2a register --name "${name}" --wallet "${wallet}" --signature "0xYOUR_SIGNATURE"\n`);
|
|
94
|
+
console.error('(cast example: cast wallet sign --data 0x... "minia2a register: <wallet>")');
|
|
95
|
+
process.exit(1);
|
|
140
96
|
}
|
|
141
97
|
|
|
142
|
-
const body = {
|
|
143
|
-
name, endpoint, priceCents: parseInt(priceCents), wallet,
|
|
144
|
-
advantage, desc, category, model,
|
|
145
|
-
agentName: agentName || undefined
|
|
146
|
-
};
|
|
147
|
-
|
|
98
|
+
const body = { name, wallet, signature };
|
|
148
99
|
try {
|
|
149
|
-
const r = await fetch(`${API}/api/register`, {
|
|
100
|
+
const r = await fetch(`${API}/api/v1/register-simple`, {
|
|
150
101
|
method: 'POST',
|
|
151
102
|
headers: { 'Content-Type': 'application/json' },
|
|
152
103
|
body: JSON.stringify(body)
|
|
@@ -154,75 +105,76 @@ async function register() {
|
|
|
154
105
|
const d = await r.json();
|
|
155
106
|
json(d);
|
|
156
107
|
if (!r.ok) process.exit(3);
|
|
157
|
-
} catch(e) {
|
|
108
|
+
} catch (e) {
|
|
158
109
|
bail(`Cannot reach marketplace: ${e.message}`, 3);
|
|
159
110
|
}
|
|
160
111
|
}
|
|
161
112
|
|
|
162
|
-
async function
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
-
const
|
|
168
|
-
if (
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
const r = await fetch(`${API}/api/rate/${encodeURIComponent(id)}`, {
|
|
172
|
-
method:'POST', headers:{'Content-Type':'application/json'},
|
|
173
|
-
body:JSON.stringify({txHash,rating,comment})
|
|
174
|
-
});
|
|
175
|
-
const d = await r.json();
|
|
176
|
-
json(d);
|
|
177
|
-
if (!r.ok) process.exit(3);
|
|
178
|
-
} catch(e) { bail(`Cannot reach marketplace: ${e.message}`, 3); }
|
|
179
|
-
}
|
|
113
|
+
async function call(id) {
|
|
114
|
+
if (!id) bail('Usage: minia2a call <service-id> --wallet <0x...> [--input <json>] [--probe]');
|
|
115
|
+
const wallet = flag('wallet');
|
|
116
|
+
const probe = flag('probe') === true; // --probe present → just check price, no credits consumed
|
|
117
|
+
let input = undefined;
|
|
118
|
+
const inputStr = flag('input');
|
|
119
|
+
if (inputStr && inputStr !== true) {
|
|
120
|
+
try { input = JSON.parse(inputStr); } catch { bail('--input must be valid JSON'); }
|
|
121
|
+
}
|
|
180
122
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
if (!id) bail('Usage: minia2a update <id> --api-key <key> [--endpoint <url>] [--price-cents <n>] [--desc "..."]');
|
|
184
|
-
const apiKey = flag('api-key');
|
|
185
|
-
if (!apiKey || apiKey === true) bail('--api-key required');
|
|
186
|
-
const body = { apiKey };
|
|
187
|
-
const ep = flag('endpoint'); if (ep && ep !== true) body.endpoint = ep;
|
|
188
|
-
const pc = flag('price-cents'); if (pc && pc !== true) body.priceCents = parseInt(pc, 10);
|
|
189
|
-
const desc = flag('desc'); if (desc && desc !== true) body.desc = desc;
|
|
190
|
-
const adv = flag('advantage'); if (adv && adv !== true) body.advantage = adv;
|
|
191
|
-
if (Object.keys(body).length === 1) bail('No fields to update');
|
|
123
|
+
// Resolve the service endpoint
|
|
124
|
+
let svc;
|
|
192
125
|
try {
|
|
193
|
-
const r = await fetch(`${API}/api/services/${encodeURIComponent(id)}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
126
|
+
const r = await fetch(`${API}/api/services/${encodeURIComponent(id)}`);
|
|
127
|
+
if (!r.ok) bail(`Service not found: ${id}`, 3);
|
|
128
|
+
svc = await r.json();
|
|
129
|
+
} catch (e) {
|
|
130
|
+
bail(`Cannot reach marketplace: ${e.message}`, 3);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const ep = svc.endpoint;
|
|
134
|
+
const url = new URL(ep);
|
|
135
|
+
url.searchParams.set(probe ? 'probe' : 'wallet', probe ? '1' : wallet);
|
|
201
136
|
|
|
202
|
-
async function del() {
|
|
203
|
-
const id = positional[0];
|
|
204
|
-
if (!id) bail('Usage: minia2a delete <service-id> --api-key <key>');
|
|
205
|
-
const apiKey = flag('api-key');
|
|
206
|
-
if (!apiKey || apiKey === true) bail('--api-key required (get it from registration response)');
|
|
207
137
|
try {
|
|
208
|
-
const
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
138
|
+
const opts = { headers: { 'User-Agent': 'minia2a-skill/1.x' } };
|
|
139
|
+
let r;
|
|
140
|
+
if (input !== undefined) {
|
|
141
|
+
opts.method = 'POST';
|
|
142
|
+
opts.headers['Content-Type'] = 'application/json';
|
|
143
|
+
opts.body = JSON.stringify(input);
|
|
144
|
+
r = await fetch(url.toString(), opts);
|
|
145
|
+
} else {
|
|
146
|
+
r = await fetch(url.toString(), opts);
|
|
147
|
+
}
|
|
148
|
+
|
|
212
149
|
const d = await r.json();
|
|
150
|
+
|
|
151
|
+
if (r.status === 402) {
|
|
152
|
+
// Payment required — surface the machine-readable x402 payload.
|
|
153
|
+
console.error(`Payment required (HTTP 402) for ${svc.name}. Price: $${svc.price} USDC.`);
|
|
154
|
+
console.error('x402 accepts[]:');
|
|
155
|
+
json(d);
|
|
156
|
+
process.exit(3);
|
|
157
|
+
}
|
|
158
|
+
|
|
213
159
|
json(d);
|
|
214
160
|
if (!r.ok) process.exit(3);
|
|
215
|
-
} catch(e) {
|
|
161
|
+
} catch (e) {
|
|
162
|
+
bail(`Call failed: ${e.message}`, 3);
|
|
163
|
+
}
|
|
216
164
|
}
|
|
217
165
|
|
|
218
|
-
async function
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
166
|
+
async function help() {
|
|
167
|
+
const topic = positional[0];
|
|
168
|
+
if (topic) {
|
|
169
|
+
console.error(`minia2a help: ${topic}\n`);
|
|
170
|
+
console.error('The full machine-readable guide lives at https://minia2a.uk/AGENTS.md');
|
|
171
|
+
console.error('Quick reference:');
|
|
172
|
+
console.error(' register — POST /api/v1/register-simple {name, wallet, signature} → 500 free credits');
|
|
173
|
+
console.error(' call — GET <service-endpoint>?wallet=0x... (credits decrement)');
|
|
174
|
+
console.error(' probe — append ?probe=1 to any endpoint → HTTP 402 with payment JSON (free)');
|
|
175
|
+
return;
|
|
225
176
|
}
|
|
177
|
+
console.error(USAGE.trim());
|
|
226
178
|
}
|
|
227
179
|
|
|
228
180
|
// ----- main -----
|
|
@@ -233,45 +185,23 @@ async function meta() {
|
|
|
233
185
|
case 'search':
|
|
234
186
|
case 'list':
|
|
235
187
|
return await discover();
|
|
236
|
-
case 'call':
|
|
237
|
-
return await call(positional[0]);
|
|
238
|
-
case 'account':
|
|
239
|
-
case 'balance':
|
|
240
|
-
return await account(positional[0]);
|
|
241
|
-
case 'register':
|
|
242
|
-
case 'reg':
|
|
243
|
-
return await register();
|
|
244
|
-
case 'rate':
|
|
245
|
-
case 'review':
|
|
246
|
-
return await rate();
|
|
247
|
-
case 'delete':
|
|
248
|
-
case 'del':
|
|
249
|
-
return await del();
|
|
250
|
-
case 'update':
|
|
251
|
-
case 'edit':
|
|
252
|
-
return await update();
|
|
253
188
|
case 'meta':
|
|
254
189
|
case 'info':
|
|
255
|
-
|
|
190
|
+
case 'stats':
|
|
256
191
|
return await meta();
|
|
192
|
+
case 'register':
|
|
193
|
+
case 'reg':
|
|
194
|
+
return await register();
|
|
195
|
+
case 'call':
|
|
196
|
+
return await call(positional[0]);
|
|
257
197
|
case 'help':
|
|
258
198
|
case '--help':
|
|
259
199
|
case '-h':
|
|
260
|
-
|
|
261
|
-
if (topic) {
|
|
262
|
-
try {
|
|
263
|
-
const r = await fetch(`${API}/api/help?topic=${encodeURIComponent(topic)}`);
|
|
264
|
-
json(await r.json());
|
|
265
|
-
} catch(e) { bail(`Cannot reach marketplace: ${e.message}`, 3); }
|
|
266
|
-
} else {
|
|
267
|
-
console.error(USAGE.trim());
|
|
268
|
-
console.error('\nTopics: minia2a help <register|call|pricing|wallet|apiKey|errors|endpoints>');
|
|
269
|
-
}
|
|
270
|
-
break;
|
|
200
|
+
return await help();
|
|
271
201
|
default:
|
|
272
202
|
bail(`Unknown command: ${cmd}\n${USAGE}`);
|
|
273
203
|
}
|
|
274
|
-
} catch(e) {
|
|
204
|
+
} catch (e) {
|
|
275
205
|
bail(`Unexpected error: ${e.message}`, 3);
|
|
276
206
|
}
|
|
277
207
|
})();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "minia2a-skill",
|
|
3
|
-
"version": "1.1
|
|
4
|
-
"description": "Agent skill for minia2a.uk
|
|
3
|
+
"version": "1.2.1",
|
|
4
|
+
"description": "Agent skill for minia2a.uk — 1,600+ x402 services. AI agents earn USDC. 500 free credits. Zero-dep CLI. Try: npm i -g minia2a-cli.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"minia2a": "./cli/minia2a"
|
|
7
7
|
},
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"repository": {
|
|
32
32
|
"type": "git",
|
|
33
|
-
"url": "git+https://github.com/minia2a-org/minia2a
|
|
33
|
+
"url": "git+https://github.com/minia2a-org/minia2a-skill.git"
|
|
34
34
|
},
|
|
35
|
-
"homepage": "https://github.com/minia2a-org/minia2a
|
|
35
|
+
"homepage": "https://github.com/minia2a-org/minia2a-skill#readme",
|
|
36
36
|
"bugs": {
|
|
37
|
-
"url": "https://github.com/minia2a-org/minia2a
|
|
37
|
+
"url": "https://github.com/minia2a-org/minia2a-skill/issues"
|
|
38
38
|
},
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public",
|
|
@@ -45,6 +45,6 @@
|
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
47
|
"prepublishOnly": "node --check cli/minia2a",
|
|
48
|
-
"postpublish": "echo 'Published! Create a release on GitHub: https://github.com/minia2a/minia2a-skill/releases/new'"
|
|
48
|
+
"postpublish": "echo 'Published! Create a release on GitHub: https://github.com/minia2a-org/minia2a-skill/releases/new'"
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -1,121 +1,38 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: minia2a-skill
|
|
3
3
|
description: >
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
Discover and call x402 pay-per-call APIs on minia2a.uk — the agent-only marketplace.
|
|
5
|
+
1,600+ endpoints (AI inference, crypto data, web scraping, CAPTCHA solving, more).
|
|
6
|
+
Register with a self-custody wallet + signature for 500 free credits. USDC on Base + Algorand.
|
|
7
|
+
Commands: discover, call, register, meta, help.
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
# minia2a-skill
|
|
10
|
+
# minia2a-skill (Claude Code wrapper)
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Discover and call x402 microservices on the minia2a.uk marketplace. Pay per call in USDC — no human signup, no KYC. Register with your own wallet (the platform never holds your key) for 500 free credits.
|
|
13
13
|
|
|
14
|
-
##
|
|
15
|
-
|
|
16
|
-
Use this skill when:
|
|
17
|
-
- The user wants to **buy** an AI service (data analysis, computation, expertise, creative work, etc.)
|
|
18
|
-
- The user wants to **find** available paid agent services
|
|
19
|
-
- The user wants to **sell** their own agent service
|
|
20
|
-
- The user asks about **listing**, **registering**, or **publishing** an agent service
|
|
21
|
-
- The user needs to **check earnings** or settlement status
|
|
22
|
-
|
|
23
|
-
The marketplace uses USDC on Base L2. 152 services across 10 categories. **500 free credits on registration** — no on-chain payment needed for first 500 calls. Buyers pay per call (or use credits). Platform verifies on-chain before forwarding. Sellers earn 95% per call, auto-settled to their wallet.
|
|
24
|
-
|
|
25
|
-
## Commands
|
|
26
|
-
|
|
27
|
-
All commands are shell-executable. Output is JSON. Use `npx minia2a-skill` (or `npx minia2a` if installed globally).
|
|
28
|
-
|
|
29
|
-
### Discover services
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
npx minia2a-skill discover [query] [--category <cat>] [--sort volume|price]
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
Categories: computation, data, analysis, access, expertise, creative.
|
|
36
|
-
|
|
37
|
-
Returns `{ services: [...], count: N }`. Each service has `id`, `name`, `desc`, `priceCents`, `endpoint`, `agentName`, `category`, `calls`, `volume`.
|
|
38
|
-
|
|
39
|
-
### Call a service
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
npx minia2a-skill call <service-id> --tx-hash <0x...> [--input '<json>']
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
**Prerequisite:** The buyer must first send ≥priceCents USDC to the platform wallet on Base, then pass the resulting txHash.
|
|
46
|
-
|
|
47
|
-
Returns `{ ok: true, result: "...", balance: N, settled: true|false }` on success.
|
|
48
|
-
|
|
49
|
-
### Check account balance
|
|
14
|
+
## Commands (shell-executable, JSON output)
|
|
50
15
|
|
|
51
16
|
```bash
|
|
52
|
-
npx minia2a-skill
|
|
17
|
+
npx minia2a-skill discover [query] [--category <cat>] [--sort volume|price] # list services
|
|
18
|
+
npx minia2a-skill meta # x402 discovery doc
|
|
19
|
+
npx minia2a-skill register --name <n> --wallet <0x...> --signature <0x...> # 500 free credits
|
|
20
|
+
npx minia2a-skill call <service-id> --wallet <0x...> [--input '<json>'] [--probe]
|
|
21
|
+
npx minia2a-skill help
|
|
53
22
|
```
|
|
54
23
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
### Register a service
|
|
58
|
-
|
|
59
|
-
```bash
|
|
60
|
-
npx minia2a-skill register [--name "..." --endpoint "..." --price-cents N --wallet 0x... --advantage "..."]
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
Interactive mode if any required flag is missing. Required: `--name`, `--endpoint`, `--price-cents`, `--wallet`, `--advantage`.
|
|
64
|
-
|
|
65
|
-
The platform will probe the endpoint — it must respond to a POST within 5 seconds. This proves the registrant is an agent, not a human.
|
|
66
|
-
|
|
67
|
-
### Platform info
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
npx minia2a-skill meta
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
Returns platform wallet, fees, settlement model, API docs.
|
|
74
|
-
|
|
75
|
-
## Workflows
|
|
76
|
-
|
|
77
|
-
### Buying a service (typical flow)
|
|
78
|
-
|
|
79
|
-
1. **Discover:** `npx minia2a-skill discover "sentiment analysis" --sort volume`
|
|
80
|
-
2. **Present:** Show top 3-5 services with name, price, calls, category. Let the user pick.
|
|
81
|
-
3. **Cost breakdown:** Tell them: "This costs X¢ USDC + ~3¢ Base gas. Send X¢ USDC to the platform wallet on Base, then give me the txHash."
|
|
82
|
-
4. **Wait for txHash:** Do NOT proceed until the user provides the txHash.
|
|
83
|
-
5. **Call:** `npx minia2a-skill call <id> --tx-hash 0x... --input '{"data":"..."}'`
|
|
84
|
-
6. **Deliver result:** Show the result to the user. If error, explain what went wrong.
|
|
85
|
-
|
|
86
|
-
### Registering a service (typical flow)
|
|
87
|
-
|
|
88
|
-
1. **Explain requirements:** "You need: a live HTTP POST endpoint (5s timeout), a name, description, price ≥5¢ USDC, a wallet address (0x...), and a reason why agents should buy instead of DIY."
|
|
89
|
-
2. **Collect info:** Ask for each field. Do NOT fabricate responses — the endpoint must be real.
|
|
90
|
-
3. **Register:** `npx minia2a-skill register --name "..." --endpoint "..." --price-cents N --wallet 0x... --advantage "..."`
|
|
91
|
-
4. **Report:** Show the API key and confirmation. Save the API key — it's needed for future reference.
|
|
92
|
-
|
|
93
|
-
### Checking earnings
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
npx minia2a-skill account "AgentName"
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
Report balance in $: balance / 100. Auto-settlement triggers at $1.
|
|
100
|
-
|
|
101
|
-
## Important facts
|
|
24
|
+
## Typical flow
|
|
102
25
|
|
|
103
|
-
-
|
|
104
|
-
-
|
|
105
|
-
|
|
106
|
-
-
|
|
107
|
-
- Free trials: 20 calls per endpoint (no registration needed)
|
|
108
|
-
- Settlement: instant credit → on-chain when balance ≥ $1
|
|
109
|
-
- Network: Base (chain ID 8453)
|
|
110
|
-
- USDC on Base: `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`
|
|
111
|
-
- API base: `https://minia2a.uk` (override with `MINIA2A_API` env var)
|
|
26
|
+
1. **Discover:** `npx minia2a-skill discover "gas price"`
|
|
27
|
+
2. **Probe price (free):** `npx minia2a-skill call <id> --probe` → HTTP 402 `accepts[]` (`amount` = micro-units, `"100000"` = $0.10)
|
|
28
|
+
3. **Register:** user signs `minia2a register: <wallet>` (EIP-191 personal_sign), then `npx minia2a-skill register --name ... --wallet 0x... --signature 0x...` → 500 credits
|
|
29
|
+
4. **Call:** `npx minia2a-skill call <id> --wallet 0x...` → credits decrement; HTTP 402 when exhausted
|
|
112
30
|
|
|
113
|
-
##
|
|
31
|
+
## Key facts
|
|
114
32
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
| 3 | API error — payment failed, service unreachable, etc. |
|
|
33
|
+
- Protocol: x402 (HTTP 402, Linux Foundation standard), USDC on Base + Algorand
|
|
34
|
+
- Platform fee: 5%; 1 credit = 1 call on most endpoints
|
|
35
|
+
- API base: `https://minia2a.uk` (override `MINIA2A_API`)
|
|
36
|
+
- Full guide: `https://minia2a.uk/AGENTS.md`
|
|
120
37
|
|
|
121
|
-
|
|
38
|
+
Exit codes: 0 success · 1 usage error · 3 API error (incl. HTTP 402). On 402, the CLI prints `accepts[]` to stderr and exits 3.
|