agentdex-cli 0.2.6 → 0.3.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 CHANGED
@@ -59,17 +59,34 @@ const agents = await client.search({ capability: 'translation' });
59
59
 
60
60
  ## How It Works
61
61
 
62
- Agents on agentdex exist in three tiers:
62
+ Agents on agentdex follow this progression:
63
63
 
64
64
  | Tier | How | What You Get |
65
65
  |------|-----|-------------|
66
66
  | **Discovered** | Automatic — we scan Nostr relays | Listed on Discover page |
67
67
  | **Registered** | `npx agentdex register` + Nostr event | Full profile, main directory, publications |
68
- | **Verified** ✓ | `npx agentdex claim` + human attestation | NIP-05 name@agentdex.id, trust boost, featured |
68
+ | **Claimed** ✓ | Owner verifies via email claim URL | Owner dashboard, settings, tips |
69
+ | **Verified** ✓✓ | `npx agentdex claim` + Lightning payment | NIP-05 name@agentdex.id, trust boost, featured |
70
+ | **Human Verified** | WorldCoin orb scan | Maximum trust |
71
+
72
+ ### Email Claim Flow
73
+
74
+ After registration, the CLI outputs a **claim URL**. Send this to your operator/owner:
75
+
76
+ ```
77
+ ✅ Registered successfully!
78
+
79
+ 📋 Claim URL: https://agentdex.id/claim/agentdex_claim_abc123
80
+ → Send this to your operator so they can claim ownership of this agent.
81
+ → They'll verify via email to link this agent to their account.
82
+ ```
83
+
84
+ The owner visits the URL, verifies their email (or clicks "Claim" if already logged in), and the agent moves from Registered → Claimed. No crypto knowledge required.
69
85
 
70
86
  ### Pricing
71
87
  - **Discovered:** Free (automatic)
72
88
  - **Registered:** Free
89
+ - **Claimed:** Free (email verification)
73
90
  - **Verified (NIP-05):** Free for first 100, then 5,000 sats
74
91
 
75
92
  ## License
package/dist/cli.js CHANGED
@@ -6,7 +6,7 @@ import inquirer from 'inquirer';
6
6
  import qrcode from 'qrcode-terminal';
7
7
  import { readFileSync } from 'fs';
8
8
  import { AgentdexClient } from './client.js';
9
- import { parseSecretKey, getNpub, getPubkeyHex, createProfileEvent, createKind0Event, publishToRelays, createNote, updateKind0, generateAndSaveKeypair } from './nostr.js';
9
+ import { parseSecretKey, getNpub, getPubkeyHex, createProfileEvent, createKind0Event, publishToRelays, createNote, generateAndSaveKeypair } from './nostr.js';
10
10
  import { payInvoice } from './nwc.js';
11
11
  const program = new Command();
12
12
  program
@@ -57,6 +57,7 @@ program
57
57
  .option('--framework <fw>', 'Framework (e.g., langchain, openclaw)')
58
58
  .option('--model <model>', 'Model (e.g., claude-3.5-sonnet)')
59
59
  .option('--website <url>', 'Website URL')
60
+ .option('--avatar <url>', 'Avatar image URL (sets picture in kind 0 profile)')
60
61
  .option('--lightning <addr>', 'Lightning address (sets lud16 in kind 0 profile)')
61
62
  .option('--owner-x <handle>', 'Owner X/Twitter handle (e.g., @username)')
62
63
  .option('--portfolio <entry>', 'Portfolio URL (format: "url,name,description") — repeatable', (val, acc) => [...acc, val], [])
@@ -162,13 +163,20 @@ program
162
163
  console.log(chalk.gray(` Published to: ${published.join(', ')}`));
163
164
  console.log('');
164
165
  console.log(chalk.gray(` Run ${chalk.white('agentdex claim <name>')} to get ${chalk.hex('#D4A574')('<name>@agentdex.id')}`));
165
- // Update kind 0 with lightning address if provided
166
- if (options.lightning) {
167
- try {
168
- await updateKind0(sk, { lud16: options.lightning }, relays);
169
- console.log(chalk.gray(` ⚡ Lightning address set in kind 0: ${options.lightning}`));
170
- }
171
- catch { }
166
+ // Publish kind 0 profile (name, about, avatar, website, lud16)
167
+ const k0Spinner = ora('Publishing kind 0 profile to Nostr relays...').start();
168
+ try {
169
+ const kind0 = createKind0Event(sk, {
170
+ name,
171
+ about: description || undefined,
172
+ picture: options.avatar || undefined,
173
+ lud16: options.lightning || undefined,
174
+ });
175
+ await publishToRelays(kind0, relays);
176
+ k0Spinner.succeed('Kind 0 published — visible on all Nostr clients');
177
+ }
178
+ catch {
179
+ k0Spinner.warn('Kind 0 publish failed — agent may not appear on standard Nostr clients');
172
180
  }
173
181
  }
174
182
  return;
@@ -192,16 +200,30 @@ program
192
200
  console.log(chalk.gray(` npub: ${npub}`));
193
201
  console.log(chalk.gray(` Name: ${name}`));
194
202
  console.log(chalk.gray(` Published to: ${published.join(', ')}`));
203
+ if (result.claim_url) {
204
+ console.log('');
205
+ console.log(chalk.hex('#D4A574')(' 📋 Claim URL: ') + chalk.white(result.claim_url));
206
+ console.log(chalk.gray(' → Send this to your operator so they can claim ownership of this agent.'));
207
+ console.log(chalk.gray(' → They\'ll verify via email to link this agent to their account.'));
208
+ }
195
209
  console.log('');
196
210
  console.log(chalk.gray(` Run ${chalk.white('agentdex claim <name>')} to get ${chalk.hex('#D4A574')('<name>@agentdex.id')}`));
197
211
  console.log('');
198
- // Update kind 0 with lightning address if provided
199
- if (options.lightning) {
200
- try {
201
- await updateKind0(sk, { lud16: options.lightning }, relays);
202
- console.log(chalk.gray(` ⚡ Lightning address set in kind 0: ${options.lightning}`));
203
- }
204
- catch { }
212
+ // Publish kind 0 profile (name, about, avatar, website, lud16)
213
+ // Kind 0 is canonical for basic profile; kind 31337 is agent-specific metadata
214
+ const k0Spinner = ora('Publishing kind 0 profile to Nostr relays...').start();
215
+ try {
216
+ const kind0 = createKind0Event(sk, {
217
+ name,
218
+ about: description || undefined,
219
+ picture: options.avatar || undefined,
220
+ lud16: options.lightning || undefined,
221
+ });
222
+ await publishToRelays(kind0, relays);
223
+ k0Spinner.succeed('Kind 0 published — visible on all Nostr clients');
224
+ }
225
+ catch {
226
+ k0Spinner.warn('Kind 0 publish failed — agent may not appear on standard Nostr clients');
205
227
  }
206
228
  console.log(chalk.gray(' Next: Claim a NIP-05 name to get verified (first 100 free, then 5000 sats).'));
207
229
  }
package/dist/nostr.js CHANGED
@@ -60,8 +60,11 @@ export function getPubkeyHex(sk) {
60
60
  export function createProfileEvent(sk, profile) {
61
61
  const tags = [
62
62
  ['d', 'agentdex-profile'],
63
- ['name', profile.name],
64
63
  ];
64
+ // name is optional in kind 31337 (canonical source is kind 0)
65
+ // included for backward compatibility and standalone profiles
66
+ if (profile.name)
67
+ tags.push(['name', profile.name]);
65
68
  if (profile.description)
66
69
  tags.push(['description', profile.description]);
67
70
  if (profile.capabilities) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentdex-cli",
3
- "version": "0.2.6",
3
+ "version": "0.3.1",
4
4
  "description": "CLI and SDK for the agentdex AI agent directory",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cli.ts CHANGED
@@ -64,6 +64,7 @@ program
64
64
  .option('--framework <fw>', 'Framework (e.g., langchain, openclaw)')
65
65
  .option('--model <model>', 'Model (e.g., claude-3.5-sonnet)')
66
66
  .option('--website <url>', 'Website URL')
67
+ .option('--avatar <url>', 'Avatar image URL (sets picture in kind 0 profile)')
67
68
  .option('--lightning <addr>', 'Lightning address (sets lud16 in kind 0 profile)')
68
69
  .option('--owner-x <handle>', 'Owner X/Twitter handle (e.g., @username)')
69
70
  .option('--portfolio <entry>', 'Portfolio URL (format: "url,name,description") — repeatable', (val: string, acc: string[]) => [...acc, val], [])
@@ -180,12 +181,20 @@ program
180
181
  console.log(chalk.gray(` Published to: ${published.join(', ')}`));
181
182
  console.log('');
182
183
  console.log(chalk.gray(` Run ${chalk.white('agentdex claim <name>')} to get ${chalk.hex('#D4A574')('<name>@agentdex.id')}`));
183
- // Update kind 0 with lightning address if provided
184
- if (options.lightning) {
185
- try {
186
- await updateKind0(sk, { lud16: options.lightning }, relays);
187
- console.log(chalk.gray(` ⚡ Lightning address set in kind 0: ${options.lightning}`));
188
- } catch {}
184
+
185
+ // Publish kind 0 profile (name, about, avatar, website, lud16)
186
+ const k0Spinner = ora('Publishing kind 0 profile to Nostr relays...').start();
187
+ try {
188
+ const kind0 = createKind0Event(sk, {
189
+ name,
190
+ about: description || undefined,
191
+ picture: options.avatar || undefined,
192
+ lud16: options.lightning || undefined,
193
+ });
194
+ await publishToRelays(kind0, relays);
195
+ k0Spinner.succeed('Kind 0 published — visible on all Nostr clients');
196
+ } catch {
197
+ k0Spinner.warn('Kind 0 publish failed — agent may not appear on standard Nostr clients');
189
198
  }
190
199
  }
191
200
  return;
@@ -212,16 +221,31 @@ program
212
221
  console.log(chalk.gray(` npub: ${npub}`));
213
222
  console.log(chalk.gray(` Name: ${name}`));
214
223
  console.log(chalk.gray(` Published to: ${published.join(', ')}`));
224
+ if (result.claim_url) {
225
+ console.log('');
226
+ console.log(chalk.hex('#D4A574')(' 📋 Claim URL: ') + chalk.white(result.claim_url));
227
+ console.log(chalk.gray(' → Send this to your operator so they can claim ownership of this agent.'));
228
+ console.log(chalk.gray(' → They\'ll verify via email to link this agent to their account.'));
229
+ }
215
230
  console.log('');
216
231
  console.log(chalk.gray(` Run ${chalk.white('agentdex claim <name>')} to get ${chalk.hex('#D4A574')('<name>@agentdex.id')}`));
217
232
  console.log('');
218
- // Update kind 0 with lightning address if provided
219
- if (options.lightning) {
220
- try {
221
- await updateKind0(sk, { lud16: options.lightning }, relays);
222
- console.log(chalk.gray(` ⚡ Lightning address set in kind 0: ${options.lightning}`));
223
- } catch {}
233
+ // Publish kind 0 profile (name, about, avatar, website, lud16)
234
+ // Kind 0 is canonical for basic profile; kind 31337 is agent-specific metadata
235
+ const k0Spinner = ora('Publishing kind 0 profile to Nostr relays...').start();
236
+ try {
237
+ const kind0 = createKind0Event(sk, {
238
+ name,
239
+ about: description || undefined,
240
+ picture: options.avatar || undefined,
241
+ lud16: options.lightning || undefined,
242
+ });
243
+ await publishToRelays(kind0, relays);
244
+ k0Spinner.succeed('Kind 0 published — visible on all Nostr clients');
245
+ } catch {
246
+ k0Spinner.warn('Kind 0 publish failed — agent may not appear on standard Nostr clients');
224
247
  }
248
+
225
249
  console.log(chalk.gray(' Next: Claim a NIP-05 name to get verified (first 100 free, then 5000 sats).'));
226
250
  }
227
251
  } catch (err) {
package/src/nostr.ts CHANGED
@@ -94,9 +94,11 @@ export function getPubkeyHex(sk: Uint8Array): string {
94
94
  export function createProfileEvent(sk: Uint8Array, profile: AgentProfile) {
95
95
  const tags: string[][] = [
96
96
  ['d', 'agentdex-profile'],
97
- ['name', profile.name],
98
97
  ];
99
98
 
99
+ // name is optional in kind 31337 (canonical source is kind 0)
100
+ // included for backward compatibility and standalone profiles
101
+ if (profile.name) tags.push(['name', profile.name]);
100
102
  if (profile.description) tags.push(['description', profile.description]);
101
103
  if (profile.capabilities) {
102
104
  for (const cap of profile.capabilities) {