agentdex-cli 0.4.3 → 0.4.4

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/dist/cli.js CHANGED
@@ -70,7 +70,7 @@ program
70
70
  .option('--owner-type <type>', 'Owner type: human, agent, org (sets owner_type tag on kind 31339)')
71
71
  .option('--parent <npub-or-hex>', 'Parent/orchestrator agent pubkey (npub or hex)')
72
72
  .option('--bot', 'Add ["bot"] tag to kind 0 profile (declares this pubkey as automated)')
73
- .option('--portfolio <entry>', 'Portfolio URL (format: "url,name,description") — repeatable', (val, acc) => [...acc, val], [])
73
+ .option('--portfolio <entry>', 'Portfolio entry (format: "id,url,label,description") — repeatable', (val, acc) => [...acc, val], [])
74
74
  .option('--skill <skill>', 'Skill tag (repeatable)', (val, acc) => [...acc, val], [])
75
75
  .option('--experience <exp>', 'Experience tag (repeatable)', (val, acc) => [...acc, val], [])
76
76
  .option('--nwc <uri>', 'Nostr Wallet Connect URI for auto-pay')
@@ -100,10 +100,16 @@ program
100
100
  framework = answers.framework || framework;
101
101
  }
102
102
  const spinner = ora('Signing event...').start();
103
- // Parse portfolio entries ("url,name,description")
103
+ // Parse portfolio entries ("id,url,label,description")
104
104
  const portfolio = (options.portfolio || []).map((entry) => {
105
105
  const parts = entry.split(',').map((s) => s.trim());
106
- return { url: parts[0], name: parts[1], description: parts[2] };
106
+ // Support both: "id,url,label,desc" (new) and "url,label,desc" (old)
107
+ if (parts.length >= 2 && parts[1]?.startsWith('http')) {
108
+ return { id: parts[0], url: parts[1], name: parts[2], description: parts[3] };
109
+ }
110
+ // Old format fallback
111
+ const id = (parts[1] || parts[0]).toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/(^-|-$)/g, '');
112
+ return { id, url: parts[0], name: parts[1], description: parts[2] };
107
113
  });
108
114
  // Resolve owner pubkey hex from --owner flag (npub or hex)
109
115
  let ownerNpub = options.owner;
package/dist/nostr.d.ts CHANGED
@@ -2,6 +2,7 @@
2
2
  * Nostr utilities — event creation, signing, publishing
3
3
  */
4
4
  export interface PortfolioItem {
5
+ id: string;
5
6
  url: string;
6
7
  name?: string;
7
8
  description?: string;
package/dist/nostr.js CHANGED
@@ -93,7 +93,8 @@ export function createProfileEvent(sk, profile) {
93
93
  tags.push(['messaging_fee', String(profile.messagingFee)]);
94
94
  if (profile.portfolio) {
95
95
  for (const item of profile.portfolio) {
96
- const tag = ['portfolio', item.url];
96
+ // New format: ["portfolio", id, url, label, description]
97
+ const tag = ['portfolio', item.id, item.url];
97
98
  if (item.name)
98
99
  tag.push(item.name);
99
100
  if (item.description)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentdex-cli",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "description": "CLI and SDK for the agentdex AI agent directory",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cli.ts CHANGED
@@ -78,7 +78,7 @@ program
78
78
  .option('--owner-type <type>', 'Owner type: human, agent, org (sets owner_type tag on kind 31339)')
79
79
  .option('--parent <npub-or-hex>', 'Parent/orchestrator agent pubkey (npub or hex)')
80
80
  .option('--bot', 'Add ["bot"] tag to kind 0 profile (declares this pubkey as automated)')
81
- .option('--portfolio <entry>', 'Portfolio URL (format: "url,name,description") — repeatable', (val: string, acc: string[]) => [...acc, val], [])
81
+ .option('--portfolio <entry>', 'Portfolio entry (format: "id,url,label,description") — repeatable', (val: string, acc: string[]) => [...acc, val], [])
82
82
  .option('--skill <skill>', 'Skill tag (repeatable)', (val: string, acc: string[]) => [...acc, val], [])
83
83
  .option('--experience <exp>', 'Experience tag (repeatable)', (val: string, acc: string[]) => [...acc, val], [])
84
84
  .option('--nwc <uri>', 'Nostr Wallet Connect URI for auto-pay')
@@ -112,10 +112,16 @@ program
112
112
 
113
113
  const spinner = ora('Signing event...').start();
114
114
 
115
- // Parse portfolio entries ("url,name,description")
115
+ // Parse portfolio entries ("id,url,label,description")
116
116
  const portfolio = (options.portfolio || []).map((entry: string) => {
117
117
  const parts = entry.split(',').map((s: string) => s.trim());
118
- return { url: parts[0], name: parts[1], description: parts[2] };
118
+ // Support both: "id,url,label,desc" (new) and "url,label,desc" (old)
119
+ if (parts.length >= 2 && parts[1]?.startsWith('http')) {
120
+ return { id: parts[0], url: parts[1], name: parts[2], description: parts[3] };
121
+ }
122
+ // Old format fallback
123
+ const id = (parts[1] || parts[0]).toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/(^-|-$)/g, '');
124
+ return { id, url: parts[0], name: parts[1], description: parts[2] };
119
125
  });
120
126
 
121
127
  // Resolve owner pubkey hex from --owner flag (npub or hex)
package/src/nostr.ts CHANGED
@@ -10,6 +10,7 @@ import { mkdirSync, writeFileSync } from 'fs';
10
10
  const DEFAULT_RELAYS = ['wss://nos.lol', 'wss://relay.damus.io'];
11
11
 
12
12
  export interface PortfolioItem {
13
+ id: string;
13
14
  url: string;
14
15
  name?: string;
15
16
  description?: string;
@@ -115,7 +116,8 @@ export function createProfileEvent(sk: Uint8Array, profile: AgentProfile) {
115
116
  if (profile.messagingFee) tags.push(['messaging_fee', String(profile.messagingFee)]);
116
117
  if (profile.portfolio) {
117
118
  for (const item of profile.portfolio) {
118
- const tag = ['portfolio', item.url];
119
+ // New format: ["portfolio", id, url, label, description]
120
+ const tag = ['portfolio', item.id, item.url];
119
121
  if (item.name) tag.push(item.name);
120
122
  if (item.description) tag.push(item.description);
121
123
  tags.push(tag);