@elisym/sdk 0.12.1 → 0.12.2

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
@@ -76,7 +76,7 @@ Customer Agent Provider Agent
76
76
  |<-- job result ----------------| (NIP-90)
77
77
  ```
78
78
 
79
- Protocol fee: 3% (300 bps). All communication over Nostr relays, payments settle on Solana.
79
+ All communication over Nostr relays, payments settle on Solana.
80
80
 
81
81
  ### Payment assets
82
82
 
package/dist/index.cjs CHANGED
@@ -1286,6 +1286,29 @@ var DiscoveryService = class {
1286
1286
  const agents = Array.from(agentMap.values());
1287
1287
  return this.runEnrichment(agents, agentMap, NEVER_ABORTED_SIGNAL);
1288
1288
  }
1289
+ /**
1290
+ * Fetch a single agent by pubkey, fully enriched (kind:0 metadata,
1291
+ * cross-checked `lastPaidJobAt`, rating counters). Returns `null` if the
1292
+ * pubkey has no surviving capability cards on the requested network.
1293
+ *
1294
+ * Use this when navigating directly to an agent's page; running
1295
+ * `fetchAgents`/`streamAgents` for that case streams the entire marketplace
1296
+ * just to find one author.
1297
+ */
1298
+ async fetchAgent(network, pubkey) {
1299
+ const events = await this.pool.querySync({
1300
+ kinds: [KIND_APP_HANDLER],
1301
+ "#t": ["elisym"],
1302
+ authors: [pubkey]
1303
+ });
1304
+ const agentMap = buildAgentsFromEvents(events, network);
1305
+ if (agentMap.size === 0) {
1306
+ return null;
1307
+ }
1308
+ const agents = Array.from(agentMap.values());
1309
+ await this.runEnrichment(agents, agentMap, NEVER_ABORTED_SIGNAL);
1310
+ return agentMap.get(pubkey) ?? null;
1311
+ }
1289
1312
  /**
1290
1313
  * Enrich an agent map with paid-job stats, feedback counters, and kind:0
1291
1314
  * metadata, then return them sorted by `compareAgentsByRank`. Mutates the