@zeroxyz/cli 0.0.10 → 0.0.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/dist/index.js +11 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { Command as Command8 } from "commander";
6
6
  // package.json
7
7
  var package_default = {
8
8
  name: "@zeroxyz/cli",
9
- version: "0.0.10",
9
+ version: "0.0.11",
10
10
  type: "module",
11
11
  bin: {
12
12
  zero: "dist/index.js",
@@ -216,11 +216,13 @@ var fetchCommand = (appContext2) => new Command2("fetch").description("Fetch a c
216
216
  } catch {
217
217
  }
218
218
  const lastSearch = stateService.loadLastSearch();
219
- if (lastSearch && apiService.walletAddress) {
219
+ const matchedCapability = lastSearch?.capabilities.find(
220
+ (c) => url.startsWith(c.url)
221
+ );
222
+ if (matchedCapability && lastSearch && apiService.walletAddress) {
220
223
  try {
221
224
  const runResult = await apiService.createRun({
222
- capabilityId: lastSearch.capabilities[0]?.id ?? "",
223
- paymentMethodId: "",
225
+ capabilityId: matchedCapability.id,
224
226
  searchId: lastSearch.searchId,
225
227
  status: finalResponse.status,
226
228
  latencyMs,
@@ -590,7 +592,8 @@ var formatSearchResults = (results) => {
590
592
  return results.map((r) => {
591
593
  const successPct = `${Math.round(Number.parseFloat(r.rating.successRate) * 100)}%`;
592
594
  const reviews = formatReviewCount(r.rating.reviews);
593
- return ` ${r.position}. ${r.name} \u2014 $${r.cost.amount}/call \u2014 \u2605 ${Number.parseFloat(r.rating.score).toFixed(1)} (${successPct} success, ${reviews} reviews)
595
+ const displayName = r.canonicalName ?? r.name;
596
+ return ` ${r.position}. ${displayName} \u2014 $${r.cost.amount}/call \u2014 \u2605 ${Number.parseFloat(r.rating.score).toFixed(1)} (${successPct} success, ${reviews} reviews)
594
597
  "${r.description}"`;
595
598
  }).join("\n");
596
599
  };
@@ -602,7 +605,8 @@ var searchCommand = (appContext2) => new Command6("search").description("Search
602
605
  searchId: result.searchId,
603
606
  capabilities: result.capabilities.map((c) => ({
604
607
  position: c.position,
605
- id: c.id
608
+ id: c.id,
609
+ url: c.url
606
610
  }))
607
611
  });
608
612
  analyticsService.capture("search_executed", {
@@ -829,6 +833,7 @@ var searchResultSchema = z2.object({
829
833
  slug: z2.string(),
830
834
  name: z2.string(),
831
835
  description: z2.string(),
836
+ url: z2.string(),
832
837
  cost: z2.object({ amount: z2.string(), asset: z2.string() }),
833
838
  rating: z2.object({
834
839
  score: z2.string(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeroxyz/cli",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "zero": "dist/index.js",