@zeroxyz/cli 1.12.1 → 1.13.0
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/index.js +109 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -78576,7 +78576,7 @@ init_esm_shims();
|
|
|
78576
78576
|
|
|
78577
78577
|
// package.json
|
|
78578
78578
|
var package_default = {
|
|
78579
|
-
version: "1.
|
|
78579
|
+
version: "1.13.0"};
|
|
78580
78580
|
|
|
78581
78581
|
// src/app.ts
|
|
78582
78582
|
init_esm_shims();
|
|
@@ -79584,7 +79584,7 @@ init_esm_shims();
|
|
|
79584
79584
|
// ../sdk/dist/index.js
|
|
79585
79585
|
init_esm_shims();
|
|
79586
79586
|
|
|
79587
|
-
// ../sdk/dist/chunk-
|
|
79587
|
+
// ../sdk/dist/chunk-T6JT5NV5.js
|
|
79588
79588
|
init_esm_shims();
|
|
79589
79589
|
|
|
79590
79590
|
// ../../node_modules/.pnpm/viem@2.52.2_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@6.0.6_zod@4.3.6/node_modules/viem/_esm/index.js
|
|
@@ -144966,7 +144966,7 @@ config(en_default2());
|
|
|
144966
144966
|
// ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/index.js
|
|
144967
144967
|
var zod_default = external_exports3;
|
|
144968
144968
|
|
|
144969
|
-
// ../sdk/dist/chunk-
|
|
144969
|
+
// ../sdk/dist/chunk-T6JT5NV5.js
|
|
144970
144970
|
var createManagedAccount = (client, address2) => toAccount({
|
|
144971
144971
|
address: address2,
|
|
144972
144972
|
async signMessage({ message: message2 }) {
|
|
@@ -146778,7 +146778,7 @@ var clientFetch = async (client, url4, opts = {}) => {
|
|
|
146778
146778
|
return result;
|
|
146779
146779
|
};
|
|
146780
146780
|
var package_default2 = {
|
|
146781
|
-
version: "0.
|
|
146781
|
+
version: "0.9.0"
|
|
146782
146782
|
};
|
|
146783
146783
|
var SDK_VERSION2 = package_default2.version;
|
|
146784
146784
|
var userWalletDtoSchema = external_exports3.object({
|
|
@@ -147371,6 +147371,15 @@ var ratingSchema = external_exports3.object({
|
|
|
147371
147371
|
stars: external_exports3.string().nullable().optional(),
|
|
147372
147372
|
state: external_exports3.enum(["unrated", "rated"]).optional()
|
|
147373
147373
|
});
|
|
147374
|
+
var pricingOptionSchema = external_exports3.object({
|
|
147375
|
+
kind: external_exports3.string(),
|
|
147376
|
+
protocol: external_exports3.string(),
|
|
147377
|
+
network: external_exports3.string().nullable(),
|
|
147378
|
+
amountUsd: external_exports3.string().nullable(),
|
|
147379
|
+
per: external_exports3.string(),
|
|
147380
|
+
confidence: external_exports3.string(),
|
|
147381
|
+
depositUsd: external_exports3.string().optional()
|
|
147382
|
+
});
|
|
147374
147383
|
var capabilityResponseSchema = external_exports3.object({
|
|
147375
147384
|
uid: external_exports3.string(),
|
|
147376
147385
|
slug: external_exports3.string(),
|
|
@@ -147395,6 +147404,23 @@ var capabilityResponseSchema = external_exports3.object({
|
|
|
147395
147404
|
instructions: external_exports3.string().nullable().optional(),
|
|
147396
147405
|
displayCostAmount: external_exports3.string(),
|
|
147397
147406
|
displayCostAsset: external_exports3.string(),
|
|
147407
|
+
// Whether the upstream advertises variable/usage-based pricing, and the raw
|
|
147408
|
+
// hint string (e.g. "$0.01/result"). The server emits both; without them an
|
|
147409
|
+
// agent sees a single scalar with no signal that the price scales with input
|
|
147410
|
+
// (ZERO-199). Optional so an older API deploy still parses.
|
|
147411
|
+
priceDynamic: external_exports3.boolean().optional(),
|
|
147412
|
+
priceHint: external_exports3.string().nullable().optional(),
|
|
147413
|
+
// ZERO-199: the authoritative price classification. Only `proven_free` may be
|
|
147414
|
+
// rendered "Free"; `unknown_unparsed` is a parse miss (never free); a parse
|
|
147415
|
+
// miss must not become "0"→Free. Optional so older deploys still parse.
|
|
147416
|
+
priceStatus: external_exports3.enum([
|
|
147417
|
+
"priced",
|
|
147418
|
+
"proven_free",
|
|
147419
|
+
"free_handshake",
|
|
147420
|
+
"unknown_unparsed",
|
|
147421
|
+
"unprobed"
|
|
147422
|
+
]).optional(),
|
|
147423
|
+
requiresHandshake: external_exports3.boolean().optional(),
|
|
147398
147424
|
reviewCount: external_exports3.number(),
|
|
147399
147425
|
rating: ratingSchema,
|
|
147400
147426
|
priceObserved: external_exports3.object({
|
|
@@ -147417,9 +147443,27 @@ var capabilityResponseSchema = external_exports3.object({
|
|
|
147417
147443
|
mode: external_exports3.string(),
|
|
147418
147444
|
costAmount: external_exports3.string(),
|
|
147419
147445
|
costPer: external_exports3.string(),
|
|
147420
|
-
priority: external_exports3.number()
|
|
147446
|
+
priority: external_exports3.number(),
|
|
147447
|
+
// ZERO-199 rail-union fields (optional; older deploys omit them).
|
|
147448
|
+
asset: external_exports3.string().nullable().optional(),
|
|
147449
|
+
unit: external_exports3.string().optional(),
|
|
147450
|
+
depositMicros: external_exports3.number().nullable().optional(),
|
|
147451
|
+
planRef: external_exports3.string().nullable().optional()
|
|
147421
147452
|
})
|
|
147422
147453
|
).nullable(),
|
|
147454
|
+
// Recommended channel deposit for a `mode='session'` cap (the seller's
|
|
147455
|
+
// advertised `suggestedDeposit`). Without it an agent can't size an MPP
|
|
147456
|
+
// session channel. The server emits it; optional for older-deploy parsing
|
|
147457
|
+
// (ZERO-199).
|
|
147458
|
+
sessionDeposit: external_exports3.object({ amountUsd: external_exports3.string(), asset: external_exports3.string() }).nullable().optional(),
|
|
147459
|
+
// ZERO-199 P-B — the single resolved price. Prefer `pricing.summary`/`kind`
|
|
147460
|
+
// over re-deriving from the legacy fields. Optional so older deploys parse.
|
|
147461
|
+
pricing: external_exports3.object({
|
|
147462
|
+
kind: external_exports3.string(),
|
|
147463
|
+
summary: external_exports3.string(),
|
|
147464
|
+
primary: pricingOptionSchema.nullable(),
|
|
147465
|
+
accepted: external_exports3.array(pricingOptionSchema)
|
|
147466
|
+
}).optional(),
|
|
147423
147467
|
availabilityStatus: external_exports3.enum(["healthy", "unknown", "down"]).nullable().optional(),
|
|
147424
147468
|
/**
|
|
147425
147469
|
* @deprecated The API no longer emits `displayStatus`; it has been replaced
|
|
@@ -147840,6 +147884,11 @@ var searchResultSchema = external_exports3.object({
|
|
|
147840
147884
|
url: external_exports3.string(),
|
|
147841
147885
|
urlTemplate: external_exports3.string().nullable().optional(),
|
|
147842
147886
|
cost: external_exports3.object({ amount: external_exports3.string(), asset: external_exports3.string() }),
|
|
147887
|
+
// Payment protocol (x402 | mpp) for this result. The server emits it; the SDK
|
|
147888
|
+
// previously stripped it, leaving an agent unable to tell which handshake to
|
|
147889
|
+
// engage from a search row. Optional/nullable so older deploys still parse
|
|
147890
|
+
// (ZERO-199).
|
|
147891
|
+
protocol: external_exports3.string().nullable().optional(),
|
|
147843
147892
|
reviewCount: external_exports3.number().optional(),
|
|
147844
147893
|
rating: ratingSchema,
|
|
147845
147894
|
// All-time activation count (non-deleted runs), mirroring capabilities.ts.
|
|
@@ -149162,24 +149211,73 @@ var formatRelativeTimestamp = (iso) => {
|
|
|
149162
149211
|
var formatCost = (capability) => {
|
|
149163
149212
|
const lines = [];
|
|
149164
149213
|
const observed = capability.priceObserved;
|
|
149165
|
-
if (
|
|
149214
|
+
if (capability.pricing?.summary) {
|
|
149215
|
+
lines.push(` Cost: ${capability.pricing.summary}`);
|
|
149216
|
+
if (capability.sessionDeposit) {
|
|
149217
|
+
lines.push(
|
|
149218
|
+
` Session deposit: $${capability.sessionDeposit.amountUsd} ${capability.sessionDeposit.asset} to open a channel`
|
|
149219
|
+
);
|
|
149220
|
+
}
|
|
149221
|
+
appendFailureChargeWarning(lines, observed);
|
|
149222
|
+
return lines;
|
|
149223
|
+
}
|
|
149224
|
+
if (capability.priceStatus === "free_handshake" || capability.requiresHandshake) {
|
|
149225
|
+
lines.push(` Cost: free \xB7 handshake required`);
|
|
149226
|
+
} else if (observed && observed.sampleCount > 0 && observed.varies && observed.minCents && observed.maxCents) {
|
|
149166
149227
|
const min = centsToDollars(observed.minCents);
|
|
149167
149228
|
const max = centsToDollars(observed.maxCents);
|
|
149168
149229
|
const median = observed.medianCents ? centsToDollars(observed.medianCents) : null;
|
|
149169
149230
|
const detail = median ? `median $${median}, n=${observed.sampleCount}` : `n=${observed.sampleCount}`;
|
|
149170
149231
|
lines.push(` Cost: $${min}\u2013$${max}/call (${detail})`);
|
|
149232
|
+
} else if (capability.priceDynamic && capability.priceHint) {
|
|
149233
|
+
const ceiling = observed?.maxCents ? centsToDollars(observed.maxCents) : null;
|
|
149234
|
+
lines.push(
|
|
149235
|
+
` Cost: ${capability.priceHint} (dynamic${ceiling ? `, up to ~$${ceiling}/call` : ""})`
|
|
149236
|
+
);
|
|
149237
|
+
} else if (capability.priceStatus === "unknown_unparsed") {
|
|
149238
|
+
lines.push(` Cost: price unknown`);
|
|
149239
|
+
} else if (capability.priceDynamic) {
|
|
149240
|
+
lines.push(
|
|
149241
|
+
` Cost: $${capability.displayCostAmount}/call (dynamic \u2014 varies by input)`
|
|
149242
|
+
);
|
|
149171
149243
|
} else if (capability.displayCostAmount === "0") {
|
|
149172
|
-
|
|
149244
|
+
const paid = paidRailAmount(capability);
|
|
149245
|
+
if (paid) lines.push(` Cost: $${paid}/call`);
|
|
149246
|
+
else if (observedMedianUsd(observed))
|
|
149247
|
+
lines.push(` Cost: ~$${observedMedianUsd(observed)}/call (observed)`);
|
|
149248
|
+
else lines.push(` Cost: Free`);
|
|
149173
149249
|
} else if (capability.displayCostAmount === "unknown") {
|
|
149174
|
-
|
|
149250
|
+
const paid = paidRailAmount(capability);
|
|
149251
|
+
if (paid) lines.push(` Cost: $${paid}/call`);
|
|
149252
|
+
else if (observedMedianUsd(observed))
|
|
149253
|
+
lines.push(` Cost: ~$${observedMedianUsd(observed)}/call (observed)`);
|
|
149254
|
+
else lines.push(` Cost: price unknown`);
|
|
149175
149255
|
} else {
|
|
149176
149256
|
lines.push(` Cost: $${capability.displayCostAmount}/call`);
|
|
149177
149257
|
}
|
|
149258
|
+
if (capability.sessionDeposit) {
|
|
149259
|
+
lines.push(
|
|
149260
|
+
` Session deposit: $${capability.sessionDeposit.amountUsd} ${capability.sessionDeposit.asset} to open a channel`
|
|
149261
|
+
);
|
|
149262
|
+
}
|
|
149263
|
+
appendFailureChargeWarning(lines, observed);
|
|
149264
|
+
return lines;
|
|
149265
|
+
};
|
|
149266
|
+
var appendFailureChargeWarning = (lines, observed) => {
|
|
149178
149267
|
if (observed?.failureChargeRate != null && observed.failureChargeRate > 0) {
|
|
149179
149268
|
const pct = Math.round(observed.failureChargeRate * 100);
|
|
149180
149269
|
lines.push(` \u26A0 ~${pct}% of failed runs still charged the wallet`);
|
|
149181
149270
|
}
|
|
149182
|
-
|
|
149271
|
+
};
|
|
149272
|
+
var paidRailAmount = (capability) => {
|
|
149273
|
+
const rail = capability.paymentMethods?.find(
|
|
149274
|
+
(pm) => pm.costAmount != null && !["0", "0.00", "unknown", ""].includes(pm.costAmount)
|
|
149275
|
+
);
|
|
149276
|
+
return rail?.costAmount ?? null;
|
|
149277
|
+
};
|
|
149278
|
+
var observedMedianUsd = (observed) => {
|
|
149279
|
+
if (!observed?.medianCents) return null;
|
|
149280
|
+
return Number(observed.medianCents) > 0 ? centsToDollars(observed.medianCents) : null;
|
|
149183
149281
|
};
|
|
149184
149282
|
var formatReviewCount = (count) => {
|
|
149185
149283
|
if (count >= 1e3) return `${(count / 1e3).toFixed(1)}k`;
|
|
@@ -150763,7 +150861,8 @@ var formatSearchResults = (results) => {
|
|
|
150763
150861
|
const displayDescription = r2.whatItDoes ?? r2.description;
|
|
150764
150862
|
const ratingBadge = formatRatingBadge(r2.rating);
|
|
150765
150863
|
const statusBadge = formatStatusBadge(r2.availabilityStatus);
|
|
150766
|
-
const
|
|
150864
|
+
const baseCost = r2.cost.amount === "0" ? "Free" : r2.cost.amount === "unknown" ? "variable pricing" : `$${r2.cost.amount}/call`;
|
|
150865
|
+
const costLabel = r2.protocol ? `${baseCost} \xB7 ${r2.protocol}` : baseCost;
|
|
150767
150866
|
const tokenHint = r2.token ? ` [${r2.token}]` : "";
|
|
150768
150867
|
return ` ${r2.position}.${tokenHint} ${displayName} \u2014 ${costLabel} \u2014 ${ratingBadge}${statusBadge}
|
|
150769
150868
|
"${displayDescription}"`;
|