tenjin-cli 0.1.0-alpha.14 → 0.1.0-alpha.15
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 +18 -3
- package/dist/{buy-2JBYPHAI.js → buy-VIRNSYGN.js} +24 -23
- package/dist/{chunk-QWBUKIP2.js → chunk-2MYQN7HM.js} +66 -27
- package/dist/chunk-2MYQN7HM.js.map +1 -0
- package/dist/{chunk-DAZAXFSF.js → chunk-2RF2GIJQ.js} +57 -226
- package/dist/chunk-2RF2GIJQ.js.map +1 -0
- package/dist/{chunk-VEAERJVJ.js → chunk-3GL2Z5QK.js} +23 -9
- package/dist/chunk-3GL2Z5QK.js.map +1 -0
- package/dist/{chunk-IUQZ4Z7M.js → chunk-4CQIDQOT.js} +6 -1
- package/dist/chunk-4CQIDQOT.js.map +1 -0
- package/dist/{chunk-IXZJ3JOO.js → chunk-4KG27W2S.js} +10 -10
- package/dist/chunk-4KG27W2S.js.map +1 -0
- package/dist/{chunk-54AJIO3E.js → chunk-5QQTYWEU.js} +4 -3
- package/dist/chunk-5QQTYWEU.js.map +1 -0
- package/dist/chunk-65DTCCJ7.js +21 -0
- package/dist/chunk-65DTCCJ7.js.map +1 -0
- package/dist/{chunk-7NADDA2V.js → chunk-A5DKHMUN.js} +20 -8
- package/dist/chunk-A5DKHMUN.js.map +1 -0
- package/dist/{chunk-WYLMJQVH.js → chunk-B63XPWQ4.js} +24 -18
- package/dist/chunk-B63XPWQ4.js.map +1 -0
- package/dist/{chunk-L6G35FU5.js → chunk-CAR6FHK6.js} +5 -5
- package/dist/{chunk-7GJQ5RGA.js → chunk-CPCX67TI.js} +20 -22
- package/dist/{chunk-7GJQ5RGA.js.map → chunk-CPCX67TI.js.map} +1 -1
- package/dist/{chunk-XVPQGCH4.js → chunk-CQBVCYI2.js} +36 -50
- package/dist/chunk-CQBVCYI2.js.map +1 -0
- package/dist/chunk-DBU5CXBV.js +4731 -0
- package/dist/chunk-DBU5CXBV.js.map +1 -0
- package/dist/chunk-DHJD77OW.js +81 -0
- package/dist/chunk-DHJD77OW.js.map +1 -0
- package/dist/{chunk-XGZ5EVMB.js → chunk-EDZSNPE5.js} +2 -2
- package/dist/{chunk-736DW4V3.js → chunk-EFWZPUTC.js} +2 -2
- package/dist/chunk-EPFL6CTE.js +448 -0
- package/dist/chunk-EPFL6CTE.js.map +1 -0
- package/dist/{chunk-3P3ES4XU.js → chunk-GHLVXVZD.js} +3 -5
- package/dist/{chunk-3P3ES4XU.js.map → chunk-GHLVXVZD.js.map} +1 -1
- package/dist/{chunk-4UHNXY6B.js → chunk-H3SOOJ2I.js} +88 -294
- package/dist/chunk-H3SOOJ2I.js.map +1 -0
- package/dist/{chunk-MJSXP4LW.js → chunk-HPJGOLTN.js} +6 -8
- package/dist/{chunk-MJSXP4LW.js.map → chunk-HPJGOLTN.js.map} +1 -1
- package/dist/{chunk-J6FUAIRR.js → chunk-HRGBS2PA.js} +4 -6
- package/dist/{chunk-J6FUAIRR.js.map → chunk-HRGBS2PA.js.map} +1 -1
- package/dist/{chunk-FDUD3W5V.js → chunk-ITUXPJIS.js} +55 -58
- package/dist/chunk-ITUXPJIS.js.map +1 -0
- package/dist/{chunk-ETKZWJ4B.js → chunk-JBIKAAT3.js} +2 -2
- package/dist/{chunk-ETKZWJ4B.js.map → chunk-JBIKAAT3.js.map} +1 -1
- package/dist/{chunk-3ZW7HPY5.js → chunk-KAJZHIQ4.js} +13 -10
- package/dist/chunk-KAJZHIQ4.js.map +1 -0
- package/dist/{chunk-OWVVI4VQ.js → chunk-KINZ23CV.js} +107 -4535
- package/dist/chunk-KINZ23CV.js.map +1 -0
- package/dist/{chunk-PCX2JQ2J.js → chunk-LRYV3SK7.js} +9 -7
- package/dist/{chunk-PCX2JQ2J.js.map → chunk-LRYV3SK7.js.map} +1 -1
- package/dist/{chunk-ACBEHJAH.js → chunk-NIKXHWOL.js} +11 -13
- package/dist/{chunk-ACBEHJAH.js.map → chunk-NIKXHWOL.js.map} +1 -1
- package/dist/chunk-OKDRDT74.js +209 -0
- package/dist/chunk-OKDRDT74.js.map +1 -0
- package/dist/chunk-OKYSNAS3.js +2144 -0
- package/dist/chunk-OKYSNAS3.js.map +1 -0
- package/dist/{chunk-B676GPS2.js → chunk-OLWTRUTS.js} +7 -3
- package/dist/{chunk-B676GPS2.js.map → chunk-OLWTRUTS.js.map} +1 -1
- package/dist/{chunk-WU5CZPLD.js → chunk-QQ6ELLSA.js} +6 -8
- package/dist/{chunk-WU5CZPLD.js.map → chunk-QQ6ELLSA.js.map} +1 -1
- package/dist/{chunk-NAAMHWSI.js → chunk-QZ6ROAJU.js} +5 -4
- package/dist/chunk-QZ6ROAJU.js.map +1 -0
- package/dist/{chunk-GEHL43VE.js → chunk-R7RSCBI7.js} +130 -47
- package/dist/chunk-R7RSCBI7.js.map +1 -0
- package/dist/{chunk-LSWP7MU2.js → chunk-U6VPKMGC.js} +127 -27
- package/dist/chunk-U6VPKMGC.js.map +1 -0
- package/dist/{chunk-W4VW5XYB.js → chunk-US456VUI.js} +6 -6
- package/dist/{chunk-O75FOHXS.js → chunk-V44J2MXV.js} +64 -36
- package/dist/chunk-V44J2MXV.js.map +1 -0
- package/dist/{chunk-4Y53PDH6.js → chunk-VJQKL3YH.js} +10 -7
- package/dist/{chunk-4Y53PDH6.js.map → chunk-VJQKL3YH.js.map} +1 -1
- package/dist/{chunk-VRPLZERE.js → chunk-VJSQSLBM.js} +47 -26
- package/dist/chunk-VJSQSLBM.js.map +1 -0
- package/dist/{chunk-PKW3H26Z.js → chunk-VYOJOX4Z.js} +9 -7
- package/dist/chunk-VYOJOX4Z.js.map +1 -0
- package/dist/chunk-WY2K35OL.js +269 -0
- package/dist/chunk-WY2K35OL.js.map +1 -0
- package/dist/{chunk-PAOVPSP6.js → chunk-ZFJJ3EXC.js} +53 -5
- package/dist/chunk-ZFJJ3EXC.js.map +1 -0
- package/dist/{cli-U2BEUA55.js → cli-KKRKBU5T.js} +71 -40
- package/dist/{cli-U2BEUA55.js.map → cli-KKRKBU5T.js.map} +1 -1
- package/dist/config-JMRUNYE6.js +37 -0
- package/dist/discover-B5HF6SHM.js +102 -0
- package/dist/discover-B5HF6SHM.js.map +1 -0
- package/dist/doctor-ZBG7X66D.js +32 -0
- package/dist/edit-PZJIILQE.js +40 -0
- package/dist/{fund-Y5IAHZ5D.js → fund-EUDH5KPA.js} +19 -19
- package/dist/index.js +1 -1
- package/dist/{inspect-NFQ6SQQQ.js → inspect-QC6WEQPN.js} +20 -20
- package/dist/{install-DXX7PVUP.js → install-GNK2W3PI.js} +196 -78
- package/dist/install-GNK2W3PI.js.map +1 -0
- package/dist/outcome-KSGWZHUS.js +24 -0
- package/dist/pay-BC4UICPA.js +361 -0
- package/dist/pay-BC4UICPA.js.map +1 -0
- package/dist/publish-LXWFDIKF.js +42 -0
- package/dist/{read-W7QVRBVD.js → read-JMNUQ56P.js} +21 -21
- package/dist/{run-CJWPGMIQ.js → run-XYTQ5TWQ.js} +52 -45
- package/dist/{run-CJWPGMIQ.js.map → run-XYTQ5TWQ.js.map} +1 -1
- package/dist/search-TSQAB45E.js +25 -0
- package/dist/{send-C5EOKXOU.js → send-G746D7PQ.js} +14 -15
- package/dist/{send-C5EOKXOU.js.map → send-G746D7PQ.js.map} +1 -1
- package/dist/{session-OBCUUIFX.js → session-JBKWMJ24.js} +17 -17
- package/dist/{skill-heal-D6EPLPS6.js → skill-heal-WKD67SLJ.js} +17 -9
- package/dist/skill-heal-WKD67SLJ.js.map +1 -0
- package/dist/skill-placement-RIU4AMC2.js +20 -0
- package/dist/{uninstall-OWJNJ5LI.js → uninstall-5E263VTS.js} +12 -12
- package/dist/uninstall-5E263VTS.js.map +1 -0
- package/dist/{update-24Y2CQTT.js → update-R76LHOZW.js} +7 -8
- package/dist/{update-24Y2CQTT.js.map → update-R76LHOZW.js.map} +1 -1
- package/dist/{wallet-SLRIYJ2U.js → wallet-TQ7D5EQ7.js} +7 -8
- package/dist/{wallet-OFXDIIGP.js → wallet-ZAVXWLWP.js} +11 -12
- package/dist/wallet-ZAVXWLWP.js.map +1 -0
- package/docs/agent-permissions.md +17 -2
- package/docs/command-reference.md +84 -42
- package/docs/safety-model.md +9 -0
- package/package.json +1 -1
- package/skills/tenjin/SKILL.md +38 -29
- package/skills/tenjin-pay/SKILL.md +76 -0
- package/skills/tenjin-publish/SKILL.md +10 -7
- package/skills/tenjin-search/SKILL.md +18 -13
- package/skills/tenjin-search/references/permissions.md +9 -3
- package/dist/chunk-3ZW7HPY5.js.map +0 -1
- package/dist/chunk-4UHNXY6B.js.map +0 -1
- package/dist/chunk-54AJIO3E.js.map +0 -1
- package/dist/chunk-7NADDA2V.js.map +0 -1
- package/dist/chunk-DAZAXFSF.js.map +0 -1
- package/dist/chunk-DTCXO7HS.js +0 -791
- package/dist/chunk-DTCXO7HS.js.map +0 -1
- package/dist/chunk-FDUD3W5V.js.map +0 -1
- package/dist/chunk-GEHL43VE.js.map +0 -1
- package/dist/chunk-IU2HVT3Y.js +0 -313
- package/dist/chunk-IU2HVT3Y.js.map +0 -1
- package/dist/chunk-IUQZ4Z7M.js.map +0 -1
- package/dist/chunk-IXZJ3JOO.js.map +0 -1
- package/dist/chunk-LSWP7MU2.js.map +0 -1
- package/dist/chunk-NAAMHWSI.js.map +0 -1
- package/dist/chunk-O75FOHXS.js.map +0 -1
- package/dist/chunk-OWVVI4VQ.js.map +0 -1
- package/dist/chunk-PAOVPSP6.js.map +0 -1
- package/dist/chunk-PKW3H26Z.js.map +0 -1
- package/dist/chunk-PQZVDCCA.js +0 -125
- package/dist/chunk-PQZVDCCA.js.map +0 -1
- package/dist/chunk-QWBUKIP2.js.map +0 -1
- package/dist/chunk-VEAERJVJ.js.map +0 -1
- package/dist/chunk-VRPLZERE.js.map +0 -1
- package/dist/chunk-WYLMJQVH.js.map +0 -1
- package/dist/chunk-XVPQGCH4.js.map +0 -1
- package/dist/chunk-ZQIQ55KK.js +0 -51
- package/dist/chunk-ZQIQ55KK.js.map +0 -1
- package/dist/config-CNUIX23Q.js +0 -32
- package/dist/doctor-QJJXRWTO.js +0 -31
- package/dist/edit-HJ44P44P.js +0 -40
- package/dist/install-DXX7PVUP.js.map +0 -1
- package/dist/outcome-ANV4QIED.js +0 -24
- package/dist/publish-PCBTCXCZ.js +0 -42
- package/dist/search-JGAVKTYJ.js +0 -25
- package/dist/skill-heal-D6EPLPS6.js.map +0 -1
- package/dist/uninstall-OWJNJ5LI.js.map +0 -1
- /package/dist/{buy-2JBYPHAI.js.map → buy-VIRNSYGN.js.map} +0 -0
- /package/dist/{chunk-L6G35FU5.js.map → chunk-CAR6FHK6.js.map} +0 -0
- /package/dist/{chunk-XGZ5EVMB.js.map → chunk-EDZSNPE5.js.map} +0 -0
- /package/dist/{chunk-736DW4V3.js.map → chunk-EFWZPUTC.js.map} +0 -0
- /package/dist/{chunk-W4VW5XYB.js.map → chunk-US456VUI.js.map} +0 -0
- /package/dist/{config-CNUIX23Q.js.map → config-JMRUNYE6.js.map} +0 -0
- /package/dist/{doctor-QJJXRWTO.js.map → doctor-ZBG7X66D.js.map} +0 -0
- /package/dist/{edit-HJ44P44P.js.map → edit-PZJIILQE.js.map} +0 -0
- /package/dist/{fund-Y5IAHZ5D.js.map → fund-EUDH5KPA.js.map} +0 -0
- /package/dist/{inspect-NFQ6SQQQ.js.map → inspect-QC6WEQPN.js.map} +0 -0
- /package/dist/{outcome-ANV4QIED.js.map → outcome-KSGWZHUS.js.map} +0 -0
- /package/dist/{publish-PCBTCXCZ.js.map → publish-LXWFDIKF.js.map} +0 -0
- /package/dist/{read-W7QVRBVD.js.map → read-JMNUQ56P.js.map} +0 -0
- /package/dist/{search-JGAVKTYJ.js.map → search-TSQAB45E.js.map} +0 -0
- /package/dist/{session-OBCUUIFX.js.map → session-JBKWMJ24.js.map} +0 -0
- /package/dist/{wallet-OFXDIIGP.js.map → skill-placement-RIU4AMC2.js.map} +0 -0
- /package/dist/{wallet-SLRIYJ2U.js.map → wallet-TQ7D5EQ7.js.map} +0 -0
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
verifyAgainstRegistries
|
|
4
|
+
} from "./chunk-EPFL6CTE.js";
|
|
5
|
+
import {
|
|
6
|
+
buildExactPayment,
|
|
7
|
+
gateSpend
|
|
8
|
+
} from "./chunk-2RF2GIJQ.js";
|
|
9
|
+
import "./chunk-QW2Q2KAH.js";
|
|
10
|
+
import {
|
|
11
|
+
SIGN_IN_WITH_X,
|
|
12
|
+
SIWX_HEADER,
|
|
13
|
+
buildSiwxHeader
|
|
14
|
+
} from "./chunk-KINZ23CV.js";
|
|
15
|
+
import {
|
|
16
|
+
decodePaymentRequiredHeader,
|
|
17
|
+
decodePaymentResponseHeader
|
|
18
|
+
} from "./chunk-DBU5CXBV.js";
|
|
19
|
+
import "./chunk-KZAAWQNP.js";
|
|
20
|
+
import "./chunk-S5RYMCV6.js";
|
|
21
|
+
import "./chunk-POJRB2AE.js";
|
|
22
|
+
import "./chunk-YLYINX2H.js";
|
|
23
|
+
import "./chunk-MJZZTKCC.js";
|
|
24
|
+
import "./chunk-7FK2UN2T.js";
|
|
25
|
+
import {
|
|
26
|
+
describeWallet,
|
|
27
|
+
resolveSpendAuthorizer,
|
|
28
|
+
resolveWalletProvider
|
|
29
|
+
} from "./chunk-CPCX67TI.js";
|
|
30
|
+
import "./chunk-M2O56UK7.js";
|
|
31
|
+
import "./chunk-UHTVXQ2O.js";
|
|
32
|
+
import {
|
|
33
|
+
fetchFailureToCliError,
|
|
34
|
+
httpRequest
|
|
35
|
+
} from "./chunk-5QQTYWEU.js";
|
|
36
|
+
import "./chunk-GHLVXVZD.js";
|
|
37
|
+
import {
|
|
38
|
+
sanitizeForTerminal
|
|
39
|
+
} from "./chunk-OLWTRUTS.js";
|
|
40
|
+
import {
|
|
41
|
+
resolveContextSettings
|
|
42
|
+
} from "./chunk-VYOJOX4Z.js";
|
|
43
|
+
import {
|
|
44
|
+
parseUsdToAtomic,
|
|
45
|
+
toMoney
|
|
46
|
+
} from "./chunk-EFWZPUTC.js";
|
|
47
|
+
import "./chunk-U6VPKMGC.js";
|
|
48
|
+
import "./chunk-UO22YNY4.js";
|
|
49
|
+
import "./chunk-3GL2Z5QK.js";
|
|
50
|
+
import "./chunk-JBIKAAT3.js";
|
|
51
|
+
import {
|
|
52
|
+
isSameDeployment
|
|
53
|
+
} from "./chunk-2MYQN7HM.js";
|
|
54
|
+
import "./chunk-ZOBNS7CX.js";
|
|
55
|
+
import {
|
|
56
|
+
CliError
|
|
57
|
+
} from "./chunk-ZFJJ3EXC.js";
|
|
58
|
+
import "./chunk-W6R3HAAG.js";
|
|
59
|
+
import "./chunk-U5S527PP.js";
|
|
60
|
+
import "./chunk-47PP7TAG.js";
|
|
61
|
+
import "./chunk-XJN5WUKL.js";
|
|
62
|
+
import "./chunk-RBJPAZFI.js";
|
|
63
|
+
import "./chunk-KYQVEKP5.js";
|
|
64
|
+
import "./chunk-ZXTAQYNA.js";
|
|
65
|
+
|
|
66
|
+
// src/commands/pay.ts
|
|
67
|
+
var PAYMENT_REQUIRED_HEADER = "PAYMENT-REQUIRED";
|
|
68
|
+
var PAYMENT_RESPONSE_HEADER = "PAYMENT-RESPONSE";
|
|
69
|
+
var BODY_PREVIEW_CHARS = 1200;
|
|
70
|
+
async function runPay(args, ctx, deps = {}) {
|
|
71
|
+
const settings = await resolveContextSettings(ctx);
|
|
72
|
+
const maxPriceAtomic = args.maxPrice !== void 0 ? BigInt(parseUsdToAtomic(args.maxPrice)) : void 0;
|
|
73
|
+
const url = args.url.trim();
|
|
74
|
+
const lane = resolveLane(url, settings);
|
|
75
|
+
const method = resolveMethod(args);
|
|
76
|
+
const jsonBody = parseBody(args.data);
|
|
77
|
+
const fetchOpts = {
|
|
78
|
+
timeoutMs: ctx.flags.timeout,
|
|
79
|
+
// Both legs: the probe's 402 is money-path input, and the paid retry
|
|
80
|
+
// carries a signed header (which pins redirects on its own; this pins the
|
|
81
|
+
// probe too, so the challenge always comes from the URL that was gated).
|
|
82
|
+
blockRedirects: true,
|
|
83
|
+
...deps.fetchImpl !== void 0 ? { fetchImpl: deps.fetchImpl } : {},
|
|
84
|
+
...jsonBody !== void 0 ? { jsonBody } : {},
|
|
85
|
+
method
|
|
86
|
+
};
|
|
87
|
+
const probe = await httpRequest(url, fetchOpts);
|
|
88
|
+
if (!probe.ok) throw fetchFailureToCliError(probe);
|
|
89
|
+
if (probe.status >= 200 && probe.status < 300) {
|
|
90
|
+
return deliver(url, lane, probe, { paid: false, printBody: args.printBody === true });
|
|
91
|
+
}
|
|
92
|
+
if (probe.status !== 402) {
|
|
93
|
+
throw new CliError("API_UNREACHABLE", `${url} answered ${probe.status}.`, {
|
|
94
|
+
fix: "Check the URL and the endpoint status, then retry.",
|
|
95
|
+
details: { status: probe.status, body: probe.json }
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
const paymentRequired = decodeChallenge(probe, url);
|
|
99
|
+
const requirement = paymentRequired.accepts[0];
|
|
100
|
+
if (requirement === void 0) {
|
|
101
|
+
throw new CliError("PAYMENT_FAILED", "The 402 advertised no payment requirements.", {
|
|
102
|
+
fix: "The endpoint looks misconfigured."
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
const firstSeenAmount = BigInt(requirement.amount);
|
|
106
|
+
const host = new URL(url).host;
|
|
107
|
+
let registry;
|
|
108
|
+
if (lane === "bazaar") {
|
|
109
|
+
registry = await assertRegistryVerified(settings, url, requirement, ctx.flags.timeout, ctx);
|
|
110
|
+
}
|
|
111
|
+
const provider = resolveWalletProvider(
|
|
112
|
+
ctx,
|
|
113
|
+
deps.provider !== void 0 ? { provider: deps.provider } : {}
|
|
114
|
+
);
|
|
115
|
+
await describeWallet(provider);
|
|
116
|
+
const signer = await provider.getSigner();
|
|
117
|
+
let effectiveChallenge = paymentRequired;
|
|
118
|
+
let effectiveRequirement = requirement;
|
|
119
|
+
if (paymentRequired.extensions?.[SIGN_IN_WITH_X] !== void 0) {
|
|
120
|
+
const siwxHeader = await buildSiwxHeader(signer, {
|
|
121
|
+
baseUrl: new URL(url).origin,
|
|
122
|
+
chainId: requirement.network
|
|
123
|
+
});
|
|
124
|
+
const recheck = await httpRequest(url, {
|
|
125
|
+
...fetchOpts,
|
|
126
|
+
headers: { [SIWX_HEADER]: siwxHeader }
|
|
127
|
+
});
|
|
128
|
+
if (!recheck.ok) throw fetchFailureToCliError(recheck);
|
|
129
|
+
if (recheck.status >= 200 && recheck.status < 300) {
|
|
130
|
+
return deliver(url, lane, recheck, {
|
|
131
|
+
paid: false,
|
|
132
|
+
entitled: true,
|
|
133
|
+
printBody: args.printBody === true
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
if (recheck.status !== 402) {
|
|
137
|
+
throw new CliError(
|
|
138
|
+
"API_UNREACHABLE",
|
|
139
|
+
`${url} answered ${recheck.status} on the entitlement re-check.`,
|
|
140
|
+
{
|
|
141
|
+
fix: "Retry; if it persists the endpoint looks misconfigured.",
|
|
142
|
+
details: { status: recheck.status, body: recheck.json }
|
|
143
|
+
}
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
effectiveChallenge = decodeChallenge(recheck, url);
|
|
147
|
+
const fresh = effectiveChallenge.accepts[0];
|
|
148
|
+
if (fresh === void 0) {
|
|
149
|
+
throw new CliError("PAYMENT_FAILED", "The fresh 402 advertised no payment requirements.", {
|
|
150
|
+
fix: "The endpoint looks misconfigured."
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
if (BigInt(fresh.amount) > firstSeenAmount) {
|
|
154
|
+
throw new CliError("PAYMENT_FAILED", "The price increased before signing; refusing to pay.", {
|
|
155
|
+
fix: "Re-run `tenjin pay` to review the new price, and set --max-price to cap it.",
|
|
156
|
+
details: {
|
|
157
|
+
firstSeenAtomic: firstSeenAmount.toString(),
|
|
158
|
+
currentAtomic: fresh.amount
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
effectiveRequirement = fresh;
|
|
163
|
+
if (lane === "bazaar") {
|
|
164
|
+
registry = await assertRegistryVerified(settings, url, fresh, ctx.flags.timeout, ctx);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
const amountAtomic = BigInt(effectiveRequirement.amount);
|
|
168
|
+
const authorizer = resolveSpendAuthorizer(
|
|
169
|
+
ctx,
|
|
170
|
+
settings.policy,
|
|
171
|
+
deps.authorizer !== void 0 ? { authorizer: deps.authorizer } : {}
|
|
172
|
+
);
|
|
173
|
+
const via = registry !== void 0 ? ` (listed on ${sanitizeForTerminal(registry)})` : "";
|
|
174
|
+
const reservationId = await gateSpend({
|
|
175
|
+
ctx,
|
|
176
|
+
authorizer,
|
|
177
|
+
amountAtomic,
|
|
178
|
+
creator: host,
|
|
179
|
+
...maxPriceAtomic !== void 0 ? { maxPriceAtomic } : {},
|
|
180
|
+
yes: args.yes === true,
|
|
181
|
+
...deps.confirm !== void 0 ? { confirm: deps.confirm } : {},
|
|
182
|
+
payeeLabel: `${sanitizeForTerminal(host)}${via}`,
|
|
183
|
+
allowlistSubject: "this host",
|
|
184
|
+
notConfirmedMessage: "Payment not confirmed."
|
|
185
|
+
});
|
|
186
|
+
let payment;
|
|
187
|
+
try {
|
|
188
|
+
payment = await buildExactPayment(effectiveChallenge, signer);
|
|
189
|
+
} catch (err) {
|
|
190
|
+
await authorizer.release(reservationId);
|
|
191
|
+
throw err;
|
|
192
|
+
}
|
|
193
|
+
const paid = await httpRequest(url, { ...fetchOpts, headers: payment.headers });
|
|
194
|
+
await authorizer.commit(reservationId, payment.amountAtomic);
|
|
195
|
+
if (!paid.ok) throw fetchFailureToCliError(paid);
|
|
196
|
+
if (paid.status >= 200 && paid.status < 300) {
|
|
197
|
+
return deliver(url, lane, paid, {
|
|
198
|
+
paid: true,
|
|
199
|
+
amountAtomic: payment.amountAtomic,
|
|
200
|
+
requirement: effectiveRequirement,
|
|
201
|
+
...registry !== void 0 ? { registry } : {},
|
|
202
|
+
printBody: args.printBody === true
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
throw new CliError(
|
|
206
|
+
"PAYMENT_FAILED",
|
|
207
|
+
paid.status === 402 ? "Payment was not accepted by the endpoint." : `The endpoint answered ${paid.status} on the paid request; whether it settled is unknown.`,
|
|
208
|
+
{
|
|
209
|
+
fix: "The signed payment already left and is counted against the session budget; the endpoint may still settle it. Do not simply retry: each attempt signs a fresh authorization. Verify the endpoint (and this listing, if Bazaar) before paying again.",
|
|
210
|
+
details: { status: paid.status, body: paid.json }
|
|
211
|
+
}
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
function resolveLane(url, settings) {
|
|
215
|
+
let target;
|
|
216
|
+
try {
|
|
217
|
+
target = new URL(url);
|
|
218
|
+
} catch {
|
|
219
|
+
throw new CliError("USAGE", `Invalid URL: ${JSON.stringify(url)}`, {
|
|
220
|
+
fix: "Pass an absolute http(s) URL."
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
if (target.protocol !== "http:" && target.protocol !== "https:") {
|
|
224
|
+
throw new CliError("USAGE", `URL must be http or https: ${JSON.stringify(url)}`, {
|
|
225
|
+
fix: "Pass an absolute http(s) URL."
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
if (isSameDeployment(target.origin, new URL(settings.baseUrl).origin)) return "tenjin";
|
|
229
|
+
if (settings.bazaarPay !== true) {
|
|
230
|
+
throw new CliError(
|
|
231
|
+
"USAGE",
|
|
232
|
+
`${target.origin} is not the configured base URL, and the Bazaar pay lane is off.`,
|
|
233
|
+
{
|
|
234
|
+
fix: "An operator enables paying registry-listed non-Tenjin endpoints with `tenjin config set bazaarPay on`."
|
|
235
|
+
}
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
if (target.protocol !== "https:") {
|
|
239
|
+
throw new CliError("USAGE", "The Bazaar lane pays https endpoints only.", {
|
|
240
|
+
fix: "Use the https URL the registry lists."
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
return "bazaar";
|
|
244
|
+
}
|
|
245
|
+
function resolveMethod(args) {
|
|
246
|
+
const method = args.method?.toUpperCase() ?? (args.data !== void 0 ? "POST" : "GET");
|
|
247
|
+
if (method !== "GET" && method !== "POST") {
|
|
248
|
+
throw new CliError("USAGE", `Unsupported method ${JSON.stringify(args.method)}`, {
|
|
249
|
+
fix: "Use -X GET or -X POST."
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
if (method === "GET" && args.data !== void 0) {
|
|
253
|
+
throw new CliError("USAGE", "A request body needs -X POST.", {
|
|
254
|
+
fix: "Drop --data, or pass -X POST."
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
return method;
|
|
258
|
+
}
|
|
259
|
+
function parseBody(data) {
|
|
260
|
+
if (data === void 0) return void 0;
|
|
261
|
+
try {
|
|
262
|
+
return JSON.parse(data);
|
|
263
|
+
} catch {
|
|
264
|
+
throw new CliError("USAGE", "The --data value is not valid JSON.", {
|
|
265
|
+
fix: `Pass a JSON object/array/string, e.g. --data '{"question":"..."}'.`
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
function decodeChallenge(res, url) {
|
|
270
|
+
const encoded = res.header(PAYMENT_REQUIRED_HEADER);
|
|
271
|
+
if (encoded === void 0) {
|
|
272
|
+
throw new CliError(
|
|
273
|
+
"CONTRACT_MISMATCH",
|
|
274
|
+
`The 402 from ${url} carried no PAYMENT-REQUIRED header.`,
|
|
275
|
+
{
|
|
276
|
+
fix: "The endpoint does not speak x402 v2; nothing was paid."
|
|
277
|
+
}
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
try {
|
|
281
|
+
return decodePaymentRequiredHeader(encoded);
|
|
282
|
+
} catch (err) {
|
|
283
|
+
throw new CliError("CONTRACT_MISMATCH", "Could not decode the PAYMENT-REQUIRED header.", {
|
|
284
|
+
cause: err
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
async function assertRegistryVerified(settings, url, requirement, timeoutMs, ctx) {
|
|
289
|
+
const verification = await verifyAgainstRegistries(
|
|
290
|
+
settings.bazaarRegistries,
|
|
291
|
+
url,
|
|
292
|
+
requirement,
|
|
293
|
+
timeoutMs,
|
|
294
|
+
{ dataDir: ctx.dataDir }
|
|
295
|
+
);
|
|
296
|
+
switch (verification.outcome) {
|
|
297
|
+
case "verified":
|
|
298
|
+
return verification.registry;
|
|
299
|
+
case "mismatch":
|
|
300
|
+
throw new CliError(
|
|
301
|
+
"REGISTRY_MISMATCH",
|
|
302
|
+
`The live 402 does not match what ${verification.registry} advertises for this resource (${verification.detail}).`,
|
|
303
|
+
{
|
|
304
|
+
fix: "Nothing was signed. Re-run `tenjin discover` to see the advertised terms; if the seller changed them, the registry will catch up.",
|
|
305
|
+
details: { registry: verification.registry, detail: verification.detail }
|
|
306
|
+
}
|
|
307
|
+
);
|
|
308
|
+
case "unlisted":
|
|
309
|
+
throw new CliError("USAGE", "No configured registry is known to list this resource.", {
|
|
310
|
+
fix: "The Bazaar lane pays publicly listed deals only, and pay-time lookup leans on the local `discover` cache: run `tenjin discover [query]` so a sweep can surface this endpoint, then re-run pay."
|
|
311
|
+
});
|
|
312
|
+
case "unavailable":
|
|
313
|
+
throw new CliError(
|
|
314
|
+
"NETWORK_ERROR",
|
|
315
|
+
"No configured registry answered; the Bazaar lane fails closed.",
|
|
316
|
+
{
|
|
317
|
+
fix: "Retry when the registries are reachable.",
|
|
318
|
+
details: { errors: verification.errors }
|
|
319
|
+
}
|
|
320
|
+
);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
function deliver(url, lane, res, opts) {
|
|
324
|
+
const settlementTxHash = opts.paid ? settlementTx(res) : void 0;
|
|
325
|
+
const data = {
|
|
326
|
+
url,
|
|
327
|
+
lane,
|
|
328
|
+
status: res.status,
|
|
329
|
+
paid: opts.paid,
|
|
330
|
+
...opts.paid ? {
|
|
331
|
+
amountPaid: toMoney(opts.amountAtomic.toString()),
|
|
332
|
+
payTo: opts.requirement.payTo,
|
|
333
|
+
network: opts.requirement.network,
|
|
334
|
+
...opts.registry !== void 0 ? { registry: opts.registry } : {}
|
|
335
|
+
} : opts.entitled === true ? { entitled: true } : {},
|
|
336
|
+
...settlementTxHash !== void 0 ? { settlementTxHash } : {},
|
|
337
|
+
// The body is the product: JSON when the endpoint spoke it, raw text always.
|
|
338
|
+
...res.json !== void 0 ? { body: res.json } : {},
|
|
339
|
+
bodyText: res.text
|
|
340
|
+
};
|
|
341
|
+
const headline = opts.paid ? `paid ${toMoney(opts.amountAtomic.toString()).usd} USD to ${sanitizeForTerminal(new URL(url).host)}` + (settlementTxHash !== void 0 ? ` (tx ${settlementTxHash})` : "") : opts.entitled === true ? `free (entitled, no charge)` : `free (${res.status}, no charge)`;
|
|
342
|
+
const body = sanitizeForTerminal(res.text);
|
|
343
|
+
const preview = opts.printBody || body.length <= BODY_PREVIEW_CHARS ? body : `${body.slice(0, BODY_PREVIEW_CHARS)}
|
|
344
|
+
\u2026 truncated; run with --print-body or --json for the full body`;
|
|
345
|
+
return { data, humanLines: [headline, ...preview.length > 0 ? [preview] : []] };
|
|
346
|
+
}
|
|
347
|
+
function settlementTx(res) {
|
|
348
|
+
const header = res.header(PAYMENT_RESPONSE_HEADER);
|
|
349
|
+
if (header === void 0) return void 0;
|
|
350
|
+
try {
|
|
351
|
+
const settle = decodePaymentResponseHeader(header);
|
|
352
|
+
const tx = settle.transaction;
|
|
353
|
+
return typeof tx === "string" ? tx : void 0;
|
|
354
|
+
} catch {
|
|
355
|
+
return void 0;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
export {
|
|
359
|
+
runPay
|
|
360
|
+
};
|
|
361
|
+
//# sourceMappingURL=pay-BC4UICPA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/pay.ts"],"sourcesContent":["import { decodePaymentRequiredHeader, decodePaymentResponseHeader } from '@x402/core/http';\nimport { SIGN_IN_WITH_X } from '@x402/extensions/sign-in-with-x';\nimport type { PaymentRequired, PaymentRequirements } from '@x402/core/types';\nimport { verifyAgainstRegistries } from '../lib/bazaar';\nimport { CliError } from '../lib/errors';\nimport { fetchFailureToCliError, httpRequest } from '../lib/http';\nimport type { HttpResponse } from '../lib/http';\nimport { parseUsdToAtomic, toMoney } from '../lib/money';\nimport { sanitizeForTerminal } from '../lib/output';\nimport { isSameDeployment } from '../lib/production-origin';\nimport { resolveContextSettings } from '../lib/settings';\nimport { SIWX_HEADER, buildSiwxHeader } from '../lib/siwx';\nimport { gateSpend } from '../lib/spend-gate';\nimport type { ResolvedSettings } from '../lib/settings';\nimport {\n describeWallet,\n resolveSpendAuthorizer,\n resolveWalletProvider,\n type SpendAuthorizer,\n type WalletProvider,\n} from '../lib/wallet';\nimport { buildExactPayment } from '../lib/x402-pay';\nimport type { CommandContext, CommandResult } from '../context';\n\n/**\n * `tenjin pay <url>`: the standard x402 client verb, for ANY paid endpoint\n * rather than marketplace pieces. One probe; a 2xx delivers free; a 402 runs\n * the same money gates as `buy` (spend policy, price cap, session budget,\n * confirm; `--yes` clears only the confirm) and retries once with the\n * `PAYMENT-SIGNATURE`. Deliberately NOT `buy`: no library idempotence (every\n * paid call pays; the session budget and `--max-price` are the brakes) and no\n * search attribution. SIWX rides ONLY when the 402 advertises the standard\n * sign-in-with-x extension, and the signature is bound to the TARGET origin\n * (never the configured deployment's), so an entitled wallet re-reads free at\n * any seller that supports it while nothing origin-bound can leak elsewhere.\n *\n * The origin gate has two lanes. The configured base URL is always payable.\n * Any other https origin is payable only when the operator turned `bazaarPay`\n * on AND a configured registry publicly lists this exact resource with terms\n * the live 402 does not exceed (lib/bazaar); a mismatch is REGISTRY_MISMATCH\n * and nothing is signed. The response body is delivered raw in the machine\n * envelope and sanitized for the terminal: paid or not, it is other people's\n * content, never instructions.\n */\n\nconst PAYMENT_REQUIRED_HEADER = 'PAYMENT-REQUIRED';\nconst PAYMENT_RESPONSE_HEADER = 'PAYMENT-RESPONSE';\n\n/** Terminal preview cap; `--print-body` lifts it. The machine body is never cut. */\nconst BODY_PREVIEW_CHARS = 1200;\n\nexport interface PayArgs {\n url: string;\n /** GET (default) or POST; POST is implied when --data is given. */\n method?: string;\n /** A JSON request body; content-type is always application/json. */\n data?: string;\n /** Decimal USD; the hard price cap, never bypassed by --yes. */\n maxPrice?: string;\n /** Bypass the interactive confirm only (never the price cap or a hard deny). */\n yes?: boolean;\n /** Print the full body to the terminal instead of the capped preview. */\n printBody?: boolean;\n}\n\nexport interface PayDeps {\n fetchImpl?: typeof fetch;\n provider?: WalletProvider;\n authorizer?: SpendAuthorizer;\n confirm?: (prompt: string) => Promise<boolean>;\n}\n\ntype Lane = 'tenjin' | 'bazaar';\n\nexport async function runPay(\n args: PayArgs,\n ctx: CommandContext,\n deps: PayDeps = {},\n): Promise<CommandResult> {\n const settings = await resolveContextSettings(ctx);\n const maxPriceAtomic =\n args.maxPrice !== undefined ? BigInt(parseUsdToAtomic(args.maxPrice)) : undefined;\n const url = args.url.trim();\n const lane = resolveLane(url, settings);\n const method = resolveMethod(args);\n const jsonBody = parseBody(args.data);\n\n const fetchOpts = {\n timeoutMs: ctx.flags.timeout,\n // Both legs: the probe's 402 is money-path input, and the paid retry\n // carries a signed header (which pins redirects on its own; this pins the\n // probe too, so the challenge always comes from the URL that was gated).\n blockRedirects: true as const,\n ...(deps.fetchImpl !== undefined ? { fetchImpl: deps.fetchImpl } : {}),\n ...(jsonBody !== undefined ? { jsonBody } : {}),\n method,\n };\n\n const probe = await httpRequest(url, fetchOpts);\n if (!probe.ok) throw fetchFailureToCliError(probe);\n if (probe.status >= 200 && probe.status < 300) {\n return deliver(url, lane, probe, { paid: false, printBody: args.printBody === true });\n }\n if (probe.status !== 402) {\n throw new CliError('API_UNREACHABLE', `${url} answered ${probe.status}.`, {\n fix: 'Check the URL and the endpoint status, then retry.',\n details: { status: probe.status, body: probe.json },\n });\n }\n\n const paymentRequired = decodeChallenge(probe, url);\n const requirement = paymentRequired.accepts[0];\n if (requirement === undefined) {\n throw new CliError('PAYMENT_FAILED', 'The 402 advertised no payment requirements.', {\n fix: 'The endpoint looks misconfigured.',\n });\n }\n // The FIRST-SEEN amount: a later challenge may never cost more than this.\n const firstSeenAmount = BigInt(requirement.amount);\n const host = new URL(url).host;\n\n // The Bazaar lane's registry check runs BEFORE the wallet is even opened:\n // an unverifiable deal must not reach a signer.\n let registry: string | undefined;\n if (lane === 'bazaar') {\n registry = await assertRegistryVerified(settings, url, requirement, ctx.flags.timeout, ctx);\n }\n\n const provider = resolveWalletProvider(\n ctx,\n deps.provider !== undefined ? { provider: deps.provider } : {},\n );\n await describeWallet(provider); // WALLET_MISSING with its own fix if none exists\n const signer = await provider.getSigner();\n\n // The standard sign-in-with-x extension, same sequence as `buy`: when the 402\n // advertises it, an entitled wallet re-reads FREE before any payment exists,\n // and the re-check doubles as the fresh-challenge refetch the payment is\n // built against. The signature binds to the TARGET origin (host-with-port),\n // so a foreign seller gets a credential worth nothing anywhere else.\n let effectiveChallenge = paymentRequired;\n let effectiveRequirement = requirement;\n if (paymentRequired.extensions?.[SIGN_IN_WITH_X] !== undefined) {\n const siwxHeader = await buildSiwxHeader(signer, {\n baseUrl: new URL(url).origin,\n chainId: requirement.network,\n });\n const recheck = await httpRequest(url, {\n ...fetchOpts,\n headers: { [SIWX_HEADER]: siwxHeader },\n });\n if (!recheck.ok) throw fetchFailureToCliError(recheck);\n if (recheck.status >= 200 && recheck.status < 300) {\n return deliver(url, lane, recheck, {\n paid: false,\n entitled: true,\n printBody: args.printBody === true,\n });\n }\n if (recheck.status !== 402) {\n throw new CliError(\n 'API_UNREACHABLE',\n `${url} answered ${recheck.status} on the entitlement re-check.`,\n {\n fix: 'Retry; if it persists the endpoint looks misconfigured.',\n details: { status: recheck.status, body: recheck.json },\n },\n );\n }\n effectiveChallenge = decodeChallenge(recheck, url);\n const fresh = effectiveChallenge.accepts[0];\n if (fresh === undefined) {\n throw new CliError('PAYMENT_FAILED', 'The fresh 402 advertised no payment requirements.', {\n fix: 'The endpoint looks misconfigured.',\n });\n }\n // Refuse a price bump between the first look and signing, exactly as `buy`.\n if (BigInt(fresh.amount) > firstSeenAmount) {\n throw new CliError('PAYMENT_FAILED', 'The price increased before signing; refusing to pay.', {\n fix: 'Re-run `tenjin pay` to review the new price, and set --max-price to cap it.',\n details: {\n firstSeenAtomic: firstSeenAmount.toString(),\n currentAtomic: fresh.amount,\n },\n });\n }\n effectiveRequirement = fresh;\n // The Bazaar lane verifies the challenge it will actually SIGN: the store\n // answers this without a network round trip in the common case.\n if (lane === 'bazaar') {\n registry = await assertRegistryVerified(settings, url, fresh, ctx.flags.timeout, ctx);\n }\n }\n const amountAtomic = BigInt(effectiveRequirement.amount);\n\n const authorizer = resolveSpendAuthorizer(\n ctx,\n settings.policy,\n deps.authorizer !== undefined ? { authorizer: deps.authorizer } : {},\n );\n // The host is the creator identity here (`allowlistCreators` users pin\n // hosts); the gate itself is shared with `buy` so the two verbs cannot drift.\n const via = registry !== undefined ? ` (listed on ${sanitizeForTerminal(registry)})` : '';\n const reservationId = await gateSpend({\n ctx,\n authorizer,\n amountAtomic,\n creator: host,\n ...(maxPriceAtomic !== undefined ? { maxPriceAtomic } : {}),\n yes: args.yes === true,\n ...(deps.confirm !== undefined ? { confirm: deps.confirm } : {}),\n payeeLabel: `${sanitizeForTerminal(host)}${via}`,\n allowlistSubject: 'this host',\n notConfirmedMessage: 'Payment not confirmed.',\n });\n\n // A failure BEFORE transmission (the build) releases: no signature exists,\n // nothing can move. That is the last point where releasing is honest.\n let payment: Awaited<ReturnType<typeof buildExactPayment>>;\n try {\n payment = await buildExactPayment(effectiveChallenge, signer);\n } catch (err) {\n await authorizer.release(reservationId);\n throw err;\n }\n\n // From here the signed EIP-3009 authorization leaves the process, and it is a\n // bearer instrument: the counterparty can settle it whatever it answers, or\n // if it answers nothing. So EVERY post-transmission outcome commits the\n // reservation; money that may move is money accounted. Releasing here let a\n // hostile registry-listed seller answer 402 after each signature while\n // sessionBudget counted zero of the authorizations it was stacking up.\n // (httpRequest never throws on transport failure; it returns ok:false.)\n const paid = await httpRequest(url, { ...fetchOpts, headers: payment.headers });\n await authorizer.commit(reservationId, payment.amountAtomic);\n if (!paid.ok) throw fetchFailureToCliError(paid);\n if (paid.status >= 200 && paid.status < 300) {\n return deliver(url, lane, paid, {\n paid: true,\n amountAtomic: payment.amountAtomic,\n requirement: effectiveRequirement,\n ...(registry !== undefined ? { registry } : {}),\n printBody: args.printBody === true,\n });\n }\n // Still 402 (payment rejected) or anything else: nothing was delivered, but\n // the seller holds a live authorization, so the amount stays counted and the\n // fix must NOT coach a retry loop, since each retry signs a fresh authorization.\n throw new CliError(\n 'PAYMENT_FAILED',\n paid.status === 402\n ? 'Payment was not accepted by the endpoint.'\n : `The endpoint answered ${paid.status} on the paid request; whether it settled is unknown.`,\n {\n fix: 'The signed payment already left and is counted against the session budget; the endpoint may still settle it. Do not simply retry: each attempt signs a fresh authorization. Verify the endpoint (and this listing, if Bazaar) before paying again.',\n details: { status: paid.status, body: paid.json },\n },\n );\n}\n\n/** Which lane may pay this URL, or the exact refusal. */\nfunction resolveLane(url: string, settings: ResolvedSettings): Lane {\n let target: URL;\n try {\n target = new URL(url);\n } catch {\n throw new CliError('USAGE', `Invalid URL: ${JSON.stringify(url)}`, {\n fix: 'Pass an absolute http(s) URL.',\n });\n }\n if (target.protocol !== 'http:' && target.protocol !== 'https:') {\n throw new CliError('USAGE', `URL must be http or https: ${JSON.stringify(url)}`, {\n fix: 'Pass an absolute http(s) URL.',\n });\n }\n // Same deployment, not merely the same spelling: without this a URL on the\n // deployment's other origin falls through to the Bazaar lane, which then\n // refuses it as a third-party endpoint or pays it under registry rules meant\n // for one. The SIWX signature below binds to the TARGET origin either way.\n if (isSameDeployment(target.origin, new URL(settings.baseUrl).origin)) return 'tenjin';\n if (settings.bazaarPay !== true) {\n // The fix names the operator act without coaching around the gate that just\n // fired: this URL may have arrived in a task, a page, or purchased content.\n throw new CliError(\n 'USAGE',\n `${target.origin} is not the configured base URL, and the Bazaar pay lane is off.`,\n {\n fix: 'An operator enables paying registry-listed non-Tenjin endpoints with `tenjin config set bazaarPay on`.',\n },\n );\n }\n if (target.protocol !== 'https:') {\n throw new CliError('USAGE', 'The Bazaar lane pays https endpoints only.', {\n fix: 'Use the https URL the registry lists.',\n });\n }\n return 'bazaar';\n}\n\nfunction resolveMethod(args: PayArgs): 'GET' | 'POST' {\n const method = args.method?.toUpperCase() ?? (args.data !== undefined ? 'POST' : 'GET');\n if (method !== 'GET' && method !== 'POST') {\n throw new CliError('USAGE', `Unsupported method ${JSON.stringify(args.method)}`, {\n fix: 'Use -X GET or -X POST.',\n });\n }\n if (method === 'GET' && args.data !== undefined) {\n throw new CliError('USAGE', 'A request body needs -X POST.', {\n fix: 'Drop --data, or pass -X POST.',\n });\n }\n return method;\n}\n\nfunction parseBody(data: string | undefined): unknown {\n if (data === undefined) return undefined;\n try {\n return JSON.parse(data);\n } catch {\n throw new CliError('USAGE', 'The --data value is not valid JSON.', {\n fix: 'Pass a JSON object/array/string, e.g. --data \\'{\"question\":\"...\"}\\'.',\n });\n }\n}\n\nfunction decodeChallenge(res: HttpResponse, url: string): PaymentRequired {\n const encoded = res.header(PAYMENT_REQUIRED_HEADER);\n if (encoded === undefined) {\n throw new CliError(\n 'CONTRACT_MISMATCH',\n `The 402 from ${url} carried no PAYMENT-REQUIRED header.`,\n {\n fix: 'The endpoint does not speak x402 v2; nothing was paid.',\n },\n );\n }\n try {\n return decodePaymentRequiredHeader(encoded);\n } catch (err) {\n throw new CliError('CONTRACT_MISMATCH', 'Could not decode the PAYMENT-REQUIRED header.', {\n cause: err,\n });\n }\n}\n\n/** The registry gate: only a `verified` outcome returns; everything else throws. */\nasync function assertRegistryVerified(\n settings: ResolvedSettings,\n url: string,\n requirement: PaymentRequirements,\n timeoutMs: number,\n ctx: CommandContext,\n): Promise<string> {\n const verification = await verifyAgainstRegistries(\n settings.bazaarRegistries,\n url,\n requirement,\n timeoutMs,\n { dataDir: ctx.dataDir },\n );\n switch (verification.outcome) {\n case 'verified':\n return verification.registry;\n case 'mismatch':\n throw new CliError(\n 'REGISTRY_MISMATCH',\n `The live 402 does not match what ${verification.registry} advertises for this resource (${verification.detail}).`,\n {\n fix: 'Nothing was signed. Re-run `tenjin discover` to see the advertised terms; if the seller changed them, the registry will catch up.',\n details: { registry: verification.registry, detail: verification.detail },\n },\n );\n case 'unlisted':\n throw new CliError('USAGE', 'No configured registry is known to list this resource.', {\n fix: 'The Bazaar lane pays publicly listed deals only, and pay-time lookup leans on the local `discover` cache: run `tenjin discover [query]` so a sweep can surface this endpoint, then re-run pay.',\n });\n case 'unavailable':\n throw new CliError(\n 'NETWORK_ERROR',\n 'No configured registry answered; the Bazaar lane fails closed.',\n {\n fix: 'Retry when the registries are reachable.',\n details: { errors: verification.errors },\n },\n );\n }\n}\n\n/** Discriminated on `paid`: a paid delivery always carries what it paid and to\n * whom, so no branch ever reaches for an amount that might not be there. */\ntype DeliverOpts =\n | {\n paid: false;\n /** Free because the wallet was already entitled (SIWX), not free-of-price. */\n entitled?: boolean;\n printBody: boolean;\n }\n | {\n paid: true;\n amountAtomic: bigint;\n requirement: PaymentRequirements;\n registry?: string;\n printBody: boolean;\n };\n\nfunction deliver(url: string, lane: Lane, res: HttpResponse, opts: DeliverOpts): CommandResult {\n const settlementTxHash = opts.paid ? settlementTx(res) : undefined;\n const data = {\n url,\n lane,\n status: res.status,\n paid: opts.paid,\n ...(opts.paid\n ? {\n amountPaid: toMoney(opts.amountAtomic.toString()),\n payTo: opts.requirement.payTo,\n network: opts.requirement.network,\n ...(opts.registry !== undefined ? { registry: opts.registry } : {}),\n }\n : opts.entitled === true\n ? { entitled: true }\n : {}),\n ...(settlementTxHash !== undefined ? { settlementTxHash } : {}),\n // The body is the product: JSON when the endpoint spoke it, raw text always.\n ...(res.json !== undefined ? { body: res.json } : {}),\n bodyText: res.text,\n };\n const headline = opts.paid\n ? `paid ${toMoney(opts.amountAtomic.toString()).usd} USD to ${sanitizeForTerminal(new URL(url).host)}` +\n (settlementTxHash !== undefined ? ` (tx ${settlementTxHash})` : '')\n : opts.entitled === true\n ? `free (entitled, no charge)`\n : `free (${res.status}, no charge)`;\n const body = sanitizeForTerminal(res.text);\n const preview =\n opts.printBody || body.length <= BODY_PREVIEW_CHARS\n ? body\n : `${body.slice(0, BODY_PREVIEW_CHARS)}\\n… truncated; run with --print-body or --json for the full body`;\n return { data, humanLines: [headline, ...(preview.length > 0 ? [preview] : [])] };\n}\n\nfunction settlementTx(res: HttpResponse): string | undefined {\n const header = res.header(PAYMENT_RESPONSE_HEADER);\n if (header === undefined) return undefined;\n try {\n const settle = decodePaymentResponseHeader(header);\n const tx = (settle as { transaction?: unknown }).transaction;\n return typeof tx === 'string' ? tx : undefined;\n } catch {\n return undefined;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,IAAM,0BAA0B;AAChC,IAAM,0BAA0B;AAGhC,IAAM,qBAAqB;AAyB3B,eAAsB,OACpB,MACA,KACA,OAAgB,CAAC,GACO;AACxB,QAAM,WAAW,MAAM,uBAAuB,GAAG;AACjD,QAAM,iBACJ,KAAK,aAAa,SAAY,OAAO,iBAAiB,KAAK,QAAQ,CAAC,IAAI;AAC1E,QAAM,MAAM,KAAK,IAAI,KAAK;AAC1B,QAAM,OAAO,YAAY,KAAK,QAAQ;AACtC,QAAM,SAAS,cAAc,IAAI;AACjC,QAAM,WAAW,UAAU,KAAK,IAAI;AAEpC,QAAM,YAAY;AAAA,IAChB,WAAW,IAAI,MAAM;AAAA;AAAA;AAAA;AAAA,IAIrB,gBAAgB;AAAA,IAChB,GAAI,KAAK,cAAc,SAAY,EAAE,WAAW,KAAK,UAAU,IAAI,CAAC;AAAA,IACpE,GAAI,aAAa,SAAY,EAAE,SAAS,IAAI,CAA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KAAM,OAAqC;AACjD,WAAO,OAAO,OAAO,WAAW,KAAK;AAAA,EACvC,QAAQ;AACN,WAAO;AAAA,EACT;AACF;","names":[]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
runPublish
|
|
4
|
+
} from "./chunk-V44J2MXV.js";
|
|
5
|
+
import "./chunk-VJSQSLBM.js";
|
|
6
|
+
import "./chunk-QQ6ELLSA.js";
|
|
7
|
+
import "./chunk-SGK2B724.js";
|
|
8
|
+
import "./chunk-KINZ23CV.js";
|
|
9
|
+
import "./chunk-DBU5CXBV.js";
|
|
10
|
+
import "./chunk-KZAAWQNP.js";
|
|
11
|
+
import "./chunk-S5RYMCV6.js";
|
|
12
|
+
import "./chunk-POJRB2AE.js";
|
|
13
|
+
import "./chunk-YLYINX2H.js";
|
|
14
|
+
import "./chunk-ITUXPJIS.js";
|
|
15
|
+
import "./chunk-CPCX67TI.js";
|
|
16
|
+
import "./chunk-M2O56UK7.js";
|
|
17
|
+
import "./chunk-UHTVXQ2O.js";
|
|
18
|
+
import "./chunk-HRGBS2PA.js";
|
|
19
|
+
import "./chunk-EDZSNPE5.js";
|
|
20
|
+
import "./chunk-5QQTYWEU.js";
|
|
21
|
+
import "./chunk-GHLVXVZD.js";
|
|
22
|
+
import "./chunk-OLWTRUTS.js";
|
|
23
|
+
import "./chunk-VYOJOX4Z.js";
|
|
24
|
+
import "./chunk-EFWZPUTC.js";
|
|
25
|
+
import "./chunk-U6VPKMGC.js";
|
|
26
|
+
import "./chunk-UO22YNY4.js";
|
|
27
|
+
import "./chunk-A5DKHMUN.js";
|
|
28
|
+
import "./chunk-3GL2Z5QK.js";
|
|
29
|
+
import "./chunk-JBIKAAT3.js";
|
|
30
|
+
import "./chunk-2MYQN7HM.js";
|
|
31
|
+
import "./chunk-ZOBNS7CX.js";
|
|
32
|
+
import "./chunk-ZFJJ3EXC.js";
|
|
33
|
+
import "./chunk-W6R3HAAG.js";
|
|
34
|
+
import "./chunk-47PP7TAG.js";
|
|
35
|
+
import "./chunk-XJN5WUKL.js";
|
|
36
|
+
import "./chunk-RBJPAZFI.js";
|
|
37
|
+
import "./chunk-KYQVEKP5.js";
|
|
38
|
+
import "./chunk-ZXTAQYNA.js";
|
|
39
|
+
export {
|
|
40
|
+
runPublish
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=publish-LXWFDIKF.js.map
|
|
@@ -3,12 +3,13 @@ import {
|
|
|
3
3
|
deliverExisting,
|
|
4
4
|
deliverFresh,
|
|
5
5
|
parseSectionsBudget
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CAR6FHK6.js";
|
|
7
7
|
import {
|
|
8
8
|
fetchRead
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-LRYV3SK7.js";
|
|
10
10
|
import "./chunk-SGK2B724.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-KINZ23CV.js";
|
|
12
|
+
import "./chunk-DBU5CXBV.js";
|
|
12
13
|
import "./chunk-KZAAWQNP.js";
|
|
13
14
|
import "./chunk-S5RYMCV6.js";
|
|
14
15
|
import "./chunk-POJRB2AE.js";
|
|
@@ -17,39 +18,38 @@ import {
|
|
|
17
18
|
findDelivered,
|
|
18
19
|
findDeliveredByUrl,
|
|
19
20
|
resolveResourceRef
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
21
|
+
} from "./chunk-VJQKL3YH.js";
|
|
22
|
+
import "./chunk-ITUXPJIS.js";
|
|
23
|
+
import "./chunk-UHTVXQ2O.js";
|
|
23
24
|
import {
|
|
24
25
|
isSessionPresentable,
|
|
25
26
|
loadSessionFile,
|
|
26
27
|
signWithSession
|
|
27
|
-
} from "./chunk-
|
|
28
|
-
import "./chunk-54AJIO3E.js";
|
|
28
|
+
} from "./chunk-HRGBS2PA.js";
|
|
29
29
|
import {
|
|
30
30
|
originOf
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-EDZSNPE5.js";
|
|
32
|
+
import "./chunk-5QQTYWEU.js";
|
|
32
33
|
import {
|
|
33
34
|
sanitizeForTerminal
|
|
34
|
-
} from "./chunk-
|
|
35
|
-
import "./chunk-ZOBNS7CX.js";
|
|
35
|
+
} from "./chunk-OLWTRUTS.js";
|
|
36
36
|
import {
|
|
37
37
|
resolveContextSettings
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-VYOJOX4Z.js";
|
|
39
39
|
import {
|
|
40
40
|
formatUsdDisplay,
|
|
41
41
|
toMoney
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-EFWZPUTC.js";
|
|
43
|
+
import "./chunk-U6VPKMGC.js";
|
|
43
44
|
import "./chunk-UO22YNY4.js";
|
|
44
|
-
import "./chunk-
|
|
45
|
-
import "./chunk-
|
|
46
|
-
import "./chunk-
|
|
47
|
-
import "./chunk-
|
|
48
|
-
import "./chunk-
|
|
45
|
+
import "./chunk-A5DKHMUN.js";
|
|
46
|
+
import "./chunk-3GL2Z5QK.js";
|
|
47
|
+
import "./chunk-JBIKAAT3.js";
|
|
48
|
+
import "./chunk-2MYQN7HM.js";
|
|
49
|
+
import "./chunk-ZOBNS7CX.js";
|
|
49
50
|
import {
|
|
50
51
|
CliError
|
|
51
|
-
} from "./chunk-
|
|
52
|
-
import "./chunk-UHTVXQ2O.js";
|
|
52
|
+
} from "./chunk-ZFJJ3EXC.js";
|
|
53
53
|
import "./chunk-W6R3HAAG.js";
|
|
54
54
|
import "./chunk-XJN5WUKL.js";
|
|
55
55
|
import "./chunk-RBJPAZFI.js";
|
|
@@ -157,4 +157,4 @@ function refusal(ref, requirement, check) {
|
|
|
157
157
|
export {
|
|
158
158
|
runRead
|
|
159
159
|
};
|
|
160
|
-
//# sourceMappingURL=read-
|
|
160
|
+
//# sourceMappingURL=read-JMNUQ56P.js.map
|