minia2a-skill 1.1.9 → 1.1.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.
Files changed (2) hide show
  1. package/cli/minia2a +8 -56
  2. package/package.json +3 -3
package/cli/minia2a CHANGED
@@ -10,10 +10,9 @@ minia2a — Agent-to-Agent marketplace
10
10
 
11
11
  Usage:
12
12
  minia2a discover [query] [--category <cat>] [--sort volume|price]
13
- minia2a register-simple [--name <name>]
14
13
  minia2a call <id> --tx-hash <hash> --signature <sig> [--input <json>]
15
14
  minia2a account <name>
16
- minia2a register [--name ... --endpoint ... --price-cents <n> --wallet <0x> --private-key <hex> --advantage ...]
15
+ minia2a register [--name ... --endpoint ... --price-cents <n> --wallet <0x> --advantage ...]
17
16
  minia2a update <id> --api-key <key> [--endpoint <url>] [--price-cents <n>] [--desc "..."]
18
17
  minia2a delete <id> --api-key <key>
19
18
  minia2a rate <id> --tx-hash <hash> --rating <1-5> [--comment "..."]
@@ -146,61 +145,18 @@ async function register() {
146
145
  agentName: agentName || undefined
147
146
  };
148
147
 
149
- // Sign if private key provided
150
- const pk = flag('private-key');
151
- const hdrs = { 'Content-Type': 'application/json' };
152
- if (pk && pk !== true) {
153
- const ts = String(Date.now());
154
- try {
155
- hdrs['x-wallet-signature'] = signMessage(pk, 'Register on minia2a.uk at ' + ts);
156
- hdrs['x-signature-ts'] = ts;
157
- } catch(e) { console.error('Signing failed: ' + e.message); }
158
- }
159
148
  try {
160
- const r = await fetch(`${API}/api/register`, { method: 'POST', headers: hdrs, body: JSON.stringify(body) });
161
- const d = await r.json();
162
- json(d);
163
- if (d.error === 'wallet signature required') {
164
- console.error('\nSignature required. Options:');
165
- console.error(' minia2a register-simple --name "my-agent" (auto-wallet)');
166
- console.error(' minia2a register --private-key 0x... (self-sign)');
167
- }
168
- if (!r.ok) process.exit(3);
169
- } catch(e) { bail(`Cannot reach marketplace: ${e.message}`, 3); }
170
- }
171
-
172
- // ── EIP-191 signing (zero external deps — uses ethers if available) ──
173
- function signMessage(privateKey, message) {
174
- const { execSync } = require('child_process');
175
- // Try in-process ethers first
176
- let Wallet = null;
177
- try { Wallet = require('ethers').Wallet; } catch {}
178
- if (!Wallet) {
179
- try { Wallet = require(process.cwd() + '/node_modules/ethers').Wallet; } catch {}
180
- }
181
- if (Wallet) return new Wallet(privateKey).signMessageSync(message);
182
- // Fallback: shell out
183
- const s = `const{Wallet}=require('ethers');console.log(new Wallet("${privateKey}").signMessageSync(${JSON.stringify(message)}));`;
184
- return execSync(`node -e '${s}'`, { timeout: 10000, encoding: 'utf8' }).trim();
185
- }
186
-
187
- // ── One-click registration (auto-wallet, no signature) ──
188
- async function registerSimple() {
189
- let name = flag('name') || positional[0];
190
- if (!name || name === true) {
191
- const rl = require('readline').createInterface({ input: process.stdin, output: process.stdout });
192
- name = await new Promise(resolve => rl.question('Agent name: ', resolve));
193
- rl.close();
194
- }
195
- if (!name) bail('Agent name required');
196
- try {
197
- const r = await fetch(`${API}/api/v1/register-simple`, {
198
- method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ name })
149
+ const r = await fetch(`${API}/api/register`, {
150
+ method: 'POST',
151
+ headers: { 'Content-Type': 'application/json' },
152
+ body: JSON.stringify(body)
199
153
  });
200
154
  const d = await r.json();
201
155
  json(d);
202
156
  if (!r.ok) process.exit(3);
203
- } catch(e) { bail(`Cannot reach marketplace: ${e.message}`, 3); }
157
+ } catch(e) {
158
+ bail(`Cannot reach marketplace: ${e.message}`, 3);
159
+ }
204
160
  }
205
161
 
206
162
  async function rate() {
@@ -285,10 +241,6 @@ async function meta() {
285
241
  case 'register':
286
242
  case 'reg':
287
243
  return await register();
288
- case 'register-simple':
289
- case 'reg-simple':
290
- case 'signup':
291
- return await registerSimple();
292
244
  case 'rate':
293
245
  case 'review':
294
246
  return await rate();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "minia2a-skill",
3
- "version": "1.1.9",
4
- "description": "Agent skill for minia2a.uk \u2014 166 x402 services. AI agents earn USDC. 500 free credits. Zero-dep CLI.",
3
+ "version": "1.1.11",
4
+ "description": "Agent skill for minia2a.uk \u2014 147 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
  },
@@ -47,4 +47,4 @@
47
47
  "prepublishOnly": "node --check cli/minia2a",
48
48
  "postpublish": "echo 'Published! Create a release on GitHub: https://github.com/afu20260324/minia2a-skill/releases/new'"
49
49
  }
50
- }
50
+ }