@lawrenceliang-btc/atel-sdk 1.1.13 → 1.1.14
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/bin/atel.mjs +2 -1
- package/package.json +1 -1
package/bin/atel.mjs
CHANGED
|
@@ -5689,7 +5689,8 @@ async function cmdTradeTask(capability, description) {
|
|
|
5689
5689
|
if (!executorDid) {
|
|
5690
5690
|
console.error(`[trade-task] Searching for executor with capability: ${capability}...`);
|
|
5691
5691
|
const regClient = new RegistryClient({ registryUrl: REGISTRY_URL });
|
|
5692
|
-
const
|
|
5692
|
+
const searchResp = await regClient.search({ type: capability, limit: 5 });
|
|
5693
|
+
const results = searchResp.agents || searchResp || [];
|
|
5693
5694
|
if (results.length === 0) { console.error('[trade-task] No executor found for capability: ' + capability); process.exit(1); }
|
|
5694
5695
|
// Pick best by trust score (if available), exclude self
|
|
5695
5696
|
const candidates = results.filter(r => r.did !== id.did);
|