@zeroxyz/cli 1.22.0 → 1.23.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 +65 -21
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -78449,7 +78449,7 @@ init_esm_shims();
|
|
|
78449
78449
|
// ../sdk/dist/index.js
|
|
78450
78450
|
init_esm_shims();
|
|
78451
78451
|
|
|
78452
|
-
// ../sdk/dist/chunk-
|
|
78452
|
+
// ../sdk/dist/chunk-I3HO6Z42.js
|
|
78453
78453
|
init_esm_shims();
|
|
78454
78454
|
|
|
78455
78455
|
// ../../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
|
|
@@ -143768,7 +143768,7 @@ config(en_default2());
|
|
|
143768
143768
|
// ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/index.js
|
|
143769
143769
|
var zod_default = external_exports3;
|
|
143770
143770
|
|
|
143771
|
-
// ../sdk/dist/chunk-
|
|
143771
|
+
// ../sdk/dist/chunk-I3HO6Z42.js
|
|
143772
143772
|
var createManagedAccount = (client, address2, opts = {}) => {
|
|
143773
143773
|
const signOptions = {
|
|
143774
143774
|
// expectedAddress pins verification to this adapter's frozen address.
|
|
@@ -145404,15 +145404,19 @@ var resolveRecordingClient = (client, opts) => {
|
|
|
145404
145404
|
const canRecord = opts.account !== void 0 || credentials.kind === "account" || credentials.kind === "session";
|
|
145405
145405
|
return { recordingClient, canRecord };
|
|
145406
145406
|
};
|
|
145407
|
-
var recordErrorFetchRun = async (client, opts, result, capabilityIdOverride) => {
|
|
145407
|
+
var recordErrorFetchRun = async (client, opts, result, capabilityIdOverride, requestUrl, requestMethod) => {
|
|
145408
145408
|
const effectiveCapId = opts.capabilityId;
|
|
145409
|
-
|
|
145409
|
+
const runTarget = effectiveCapId !== void 0 ? { capabilityId: effectiveCapId } : requestUrl ? {
|
|
145410
|
+
requestUrl: redactUrl(requestUrl),
|
|
145411
|
+
...requestMethod && { requestMethod }
|
|
145412
|
+
} : null;
|
|
145413
|
+
if (runTarget === null) return;
|
|
145410
145414
|
const { recordingClient, canRecord } = resolveRecordingClient(client, opts);
|
|
145411
145415
|
if (!canRecord) return;
|
|
145412
|
-
const fetchOriginForRecord = opts.capabilityId === void 0 ? "direct_url" : isShortToken(effectiveCapId) ? "from_search" : opts.fetchOrigin;
|
|
145416
|
+
const fetchOriginForRecord = opts.capabilityId === void 0 ? "direct_url" : effectiveCapId !== void 0 && isShortToken(effectiveCapId) ? "from_search" : opts.fetchOrigin;
|
|
145413
145417
|
try {
|
|
145414
145418
|
const created = await recordingClient.runs.create({
|
|
145415
|
-
|
|
145419
|
+
...runTarget,
|
|
145416
145420
|
...opts.searchId && { searchId: opts.searchId },
|
|
145417
145421
|
...fetchOriginForRecord && { fetchOrigin: fetchOriginForRecord },
|
|
145418
145422
|
...result.status !== null && { status: result.status },
|
|
@@ -145425,7 +145429,7 @@ var recordErrorFetchRun = async (client, opts, result, capabilityIdOverride) =>
|
|
|
145425
145429
|
} catch {
|
|
145426
145430
|
}
|
|
145427
145431
|
};
|
|
145428
|
-
var recordTimeoutRun = async (client, opts, err, startedAt, capabilityIdRequested, capabilityIdOverride) => {
|
|
145432
|
+
var recordTimeoutRun = async (client, opts, err, startedAt, capabilityIdRequested, capabilityIdOverride, requestUrl, requestMethod) => {
|
|
145429
145433
|
const result = errorFetchResult(
|
|
145430
145434
|
startedAt,
|
|
145431
145435
|
err.message,
|
|
@@ -145433,7 +145437,14 @@ var recordTimeoutRun = async (client, opts, err, startedAt, capabilityIdRequeste
|
|
|
145433
145437
|
capabilityIdRequested,
|
|
145434
145438
|
"network_error"
|
|
145435
145439
|
);
|
|
145436
|
-
await recordErrorFetchRun(
|
|
145440
|
+
await recordErrorFetchRun(
|
|
145441
|
+
client,
|
|
145442
|
+
opts,
|
|
145443
|
+
result,
|
|
145444
|
+
capabilityIdOverride,
|
|
145445
|
+
requestUrl,
|
|
145446
|
+
requestMethod
|
|
145447
|
+
);
|
|
145437
145448
|
};
|
|
145438
145449
|
var sniffJsonShapeBytes = (buf) => {
|
|
145439
145450
|
let i = 0;
|
|
@@ -145496,7 +145507,10 @@ var clientFetch = async (client, url4, opts = {}) => {
|
|
|
145496
145507
|
opts,
|
|
145497
145508
|
err,
|
|
145498
145509
|
startedAt,
|
|
145499
|
-
capabilityIdRequested
|
|
145510
|
+
capabilityIdRequested,
|
|
145511
|
+
void 0,
|
|
145512
|
+
requestUrl,
|
|
145513
|
+
method
|
|
145500
145514
|
);
|
|
145501
145515
|
throw err;
|
|
145502
145516
|
}
|
|
@@ -145509,7 +145523,14 @@ var clientFetch = async (client, url4, opts = {}) => {
|
|
|
145509
145523
|
capabilityIdRequested,
|
|
145510
145524
|
"network_error"
|
|
145511
145525
|
);
|
|
145512
|
-
await recordErrorFetchRun(
|
|
145526
|
+
await recordErrorFetchRun(
|
|
145527
|
+
client,
|
|
145528
|
+
opts,
|
|
145529
|
+
result2,
|
|
145530
|
+
void 0,
|
|
145531
|
+
requestUrl,
|
|
145532
|
+
method
|
|
145533
|
+
);
|
|
145513
145534
|
return result2;
|
|
145514
145535
|
}
|
|
145515
145536
|
if (response.status === 402) {
|
|
@@ -145570,7 +145591,14 @@ var clientFetch = async (client, url4, opts = {}) => {
|
|
|
145570
145591
|
"payment_failed",
|
|
145571
145592
|
402
|
|
145572
145593
|
);
|
|
145573
|
-
await recordErrorFetchRun(
|
|
145594
|
+
await recordErrorFetchRun(
|
|
145595
|
+
client,
|
|
145596
|
+
opts,
|
|
145597
|
+
result2,
|
|
145598
|
+
void 0,
|
|
145599
|
+
requestUrl,
|
|
145600
|
+
method
|
|
145601
|
+
);
|
|
145574
145602
|
return result2;
|
|
145575
145603
|
} else if (err instanceof ZeroTimeoutError) {
|
|
145576
145604
|
await recordTimeoutRun(
|
|
@@ -145578,7 +145606,10 @@ var clientFetch = async (client, url4, opts = {}) => {
|
|
|
145578
145606
|
opts,
|
|
145579
145607
|
err,
|
|
145580
145608
|
startedAt,
|
|
145581
|
-
capabilityIdRequested
|
|
145609
|
+
capabilityIdRequested,
|
|
145610
|
+
void 0,
|
|
145611
|
+
requestUrl,
|
|
145612
|
+
method
|
|
145582
145613
|
);
|
|
145583
145614
|
throw err;
|
|
145584
145615
|
} else {
|
|
@@ -145594,7 +145625,14 @@ var clientFetch = async (client, url4, opts = {}) => {
|
|
|
145594
145625
|
"payment_failed",
|
|
145595
145626
|
402
|
|
145596
145627
|
);
|
|
145597
|
-
await recordErrorFetchRun(
|
|
145628
|
+
await recordErrorFetchRun(
|
|
145629
|
+
client,
|
|
145630
|
+
opts,
|
|
145631
|
+
result2,
|
|
145632
|
+
void 0,
|
|
145633
|
+
requestUrl,
|
|
145634
|
+
method
|
|
145635
|
+
);
|
|
145598
145636
|
return result2;
|
|
145599
145637
|
}
|
|
145600
145638
|
}
|
|
@@ -145676,7 +145714,8 @@ var clientFetch = async (client, url4, opts = {}) => {
|
|
|
145676
145714
|
capabilitySlug: resolvedCap.capabilitySlug,
|
|
145677
145715
|
matchedVia: resolvedCap.matchedVia
|
|
145678
145716
|
} : { resolved: false } : void 0;
|
|
145679
|
-
|
|
145717
|
+
const runTarget = effectiveCapabilityId !== void 0 ? { capabilityId: effectiveCapabilityId } : { requestUrl: redactUrl(requestUrl), requestMethod: method };
|
|
145718
|
+
if (!paidButStill402 && !closeFailed) {
|
|
145680
145719
|
const { recordingClient, canRecord } = resolveRecordingClient(client, opts);
|
|
145681
145720
|
if (!canRecord) {
|
|
145682
145721
|
skipReasons.push("no_credentials");
|
|
@@ -145696,7 +145735,7 @@ var clientFetch = async (client, url4, opts = {}) => {
|
|
|
145696
145735
|
}
|
|
145697
145736
|
}
|
|
145698
145737
|
const result2 = await recordingClient.runs.create({
|
|
145699
|
-
|
|
145738
|
+
...runTarget,
|
|
145700
145739
|
searchId: opts.searchId,
|
|
145701
145740
|
// Auto-resolved runs are always direct_url — they only fire when
|
|
145702
145741
|
// no capabilityId was supplied (the direct_url path by definition).
|
|
@@ -145770,7 +145809,7 @@ var clientFetch = async (client, url4, opts = {}) => {
|
|
|
145770
145809
|
return result;
|
|
145771
145810
|
};
|
|
145772
145811
|
var package_default = {
|
|
145773
|
-
version: "0.
|
|
145812
|
+
version: "0.16.0"
|
|
145774
145813
|
};
|
|
145775
145814
|
var SDK_VERSION2 = package_default.version;
|
|
145776
145815
|
var agentAuthMetadataSchema = external_exports3.object({
|
|
@@ -147912,7 +147951,7 @@ var placeholderFor = (fieldName, propSchema) => String(sampleValueFor(fieldName,
|
|
|
147912
147951
|
|
|
147913
147952
|
// package.json
|
|
147914
147953
|
var package_default2 = {
|
|
147915
|
-
version: "1.
|
|
147954
|
+
version: "1.23.0"};
|
|
147916
147955
|
|
|
147917
147956
|
// src/app.ts
|
|
147918
147957
|
init_esm_shims();
|
|
@@ -149648,6 +149687,7 @@ var fetchCommand = (appContext) => new Command("fetch").description(
|
|
|
149648
149687
|
let searchId;
|
|
149649
149688
|
let displayCostAmount;
|
|
149650
149689
|
let fetchOrigin;
|
|
149690
|
+
let runIsAttributed = true;
|
|
149651
149691
|
if (fromToken) {
|
|
149652
149692
|
capabilityUid = capFromNoUrl?.uid ?? null;
|
|
149653
149693
|
capabilityId = options.capability ?? "";
|
|
@@ -149661,9 +149701,6 @@ var fetchCommand = (appContext) => new Command("fetch").description(
|
|
|
149661
149701
|
displayCostAmount = capFromNoUrl?.displayCostAmount;
|
|
149662
149702
|
fetchOrigin = "direct_slug";
|
|
149663
149703
|
} else {
|
|
149664
|
-
const resolved = await client.capabilities.resolveByUrl(resolvedUrl, options.method ?? "GET").catch(() => null);
|
|
149665
|
-
capabilityUid = resolved?.capabilityId ?? null;
|
|
149666
|
-
capabilityId = capabilityUid;
|
|
149667
149704
|
fetchOrigin = "direct_url";
|
|
149668
149705
|
}
|
|
149669
149706
|
const resultRank = void 0;
|
|
@@ -149844,6 +149881,7 @@ var fetchCommand = (appContext) => new Command("fetch").description(
|
|
|
149844
149881
|
matchedVia: capabilityResolution.matchedVia
|
|
149845
149882
|
});
|
|
149846
149883
|
} else {
|
|
149884
|
+
runIsAttributed = false;
|
|
149847
149885
|
if (walletAddress && !runId) {
|
|
149848
149886
|
cliSkipReasons.push(
|
|
149849
149887
|
"no capability resolved \u2014 pass --capability <uid|slug|token> or run `zero search` first so the URL can be matched"
|
|
@@ -149978,7 +150016,7 @@ var fetchCommand = (appContext) => new Command("fetch").description(
|
|
|
149978
150016
|
...sdkWarnings?.length && { warnings: sdkWarnings }
|
|
149979
150017
|
})
|
|
149980
150018
|
);
|
|
149981
|
-
} else if (runId && outcomeInfo.reviewable) {
|
|
150019
|
+
} else if (runId && outcomeInfo.reviewable && runIsAttributed) {
|
|
149982
150020
|
const isTTY = process.stderr.isTTY;
|
|
149983
150021
|
const responded2xx = status !== null && status >= 200 && status < 300;
|
|
149984
150022
|
console.error(`
|
|
@@ -150018,6 +150056,12 @@ var fetchCommand = (appContext) => new Command("fetch").description(
|
|
|
150018
150056
|
} else {
|
|
150019
150057
|
console.error(` zero review ${runId} --no-success`);
|
|
150020
150058
|
}
|
|
150059
|
+
} else if (runId && !runIsAttributed) {
|
|
150060
|
+
console.error(`
|
|
150061
|
+
Run ID: ${runId}`);
|
|
150062
|
+
console.error(
|
|
150063
|
+
` This URL isn't an indexed capability, so the run can't be reviewed. Pass --capability <uid|slug> or run \`zero search\` first to bind it to one.`
|
|
150064
|
+
);
|
|
150021
150065
|
} else if (!runId && cliSkipReasons.length > 0) {
|
|
150022
150066
|
console.error(
|
|
150023
150067
|
`
|