@agent-score/commerce 2.1.1 → 2.2.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/challenge/index.d.mts +2 -2
- package/dist/challenge/index.d.ts +2 -2
- package/dist/challenge/index.js +7 -5
- package/dist/challenge/index.js.map +1 -1
- package/dist/challenge/index.mjs +7 -5
- package/dist/challenge/index.mjs.map +1 -1
- package/dist/{checkout-BRw_caGr.d.mts → checkout-CKQE2QpJ.d.mts} +37 -1
- package/dist/{checkout-CuSNUJFX.d.ts → checkout-CfgxgPZL.d.ts} +37 -1
- package/dist/core.js +4 -3
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +4 -3
- package/dist/core.mjs.map +1 -1
- package/dist/discovery/index.d.mts +3 -3
- package/dist/discovery/index.d.ts +3 -3
- package/dist/identity/express.d.mts +4 -3
- package/dist/identity/express.d.ts +4 -3
- package/dist/identity/express.js +4 -3
- package/dist/identity/express.js.map +1 -1
- package/dist/identity/express.mjs +4 -3
- package/dist/identity/express.mjs.map +1 -1
- package/dist/identity/fastify.d.mts +4 -3
- package/dist/identity/fastify.d.ts +4 -3
- package/dist/identity/fastify.js +4 -3
- package/dist/identity/fastify.js.map +1 -1
- package/dist/identity/fastify.mjs +4 -3
- package/dist/identity/fastify.mjs.map +1 -1
- package/dist/identity/hono.d.mts +4 -3
- package/dist/identity/hono.d.ts +4 -3
- package/dist/identity/hono.js +4 -3
- package/dist/identity/hono.js.map +1 -1
- package/dist/identity/hono.mjs +4 -3
- package/dist/identity/hono.mjs.map +1 -1
- package/dist/identity/nextjs.js +4 -3
- package/dist/identity/nextjs.js.map +1 -1
- package/dist/identity/nextjs.mjs +4 -3
- package/dist/identity/nextjs.mjs.map +1 -1
- package/dist/identity/web.js +4 -3
- package/dist/identity/web.js.map +1 -1
- package/dist/identity/web.mjs +4 -3
- package/dist/identity/web.mjs.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +137 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +137 -13
- package/dist/index.mjs.map +1 -1
- package/dist/{pricing-4n5Ota0D.d.mts → pricing-dSI3ePmE.d.mts} +4 -2
- package/dist/{pricing-DHfH3ogG.d.ts → pricing-uFGRNoGl.d.ts} +4 -2
- package/dist/stripe-multichain/index.js +2 -1
- package/dist/stripe-multichain/index.js.map +1 -1
- package/dist/stripe-multichain/index.mjs +2 -1
- package/dist/stripe-multichain/index.mjs.map +1 -1
- package/package.json +6 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { T as TempoRailSpec, X as X402BaseRailSpec, S as SolanaMppRailSpec, b as StripeRailSpec } from '../rail_spec-D6qzh3J0.mjs';
|
|
2
|
-
import { A as AgentInstructions, P as PricingBlock } from '../pricing-
|
|
3
|
-
export { C as CompatibleClients, H as HowToPayBlock, a as HowToPayRailEntry, b as HowToPayRails, c as HowToPayStripeEntry, R as RailKey, d as buildAgentInstructions, e as buildHowToPay, f as buildPricingBlock, g as compatibleClientsByRails } from '../pricing-
|
|
2
|
+
import { A as AgentInstructions, P as PricingBlock } from '../pricing-dSI3ePmE.mjs';
|
|
3
|
+
export { C as CompatibleClients, H as HowToPayBlock, a as HowToPayRailEntry, b as HowToPayRails, c as HowToPayStripeEntry, R as RailKey, d as buildAgentInstructions, e as buildHowToPay, f as buildPricingBlock, g as compatibleClientsByRails } from '../pricing-dSI3ePmE.mjs';
|
|
4
4
|
import { AgentMemoryHint } from '../core.mjs';
|
|
5
5
|
export { buildAgentMemoryHint } from '../core.mjs';
|
|
6
6
|
import { p as paymentRequiredHeader } from '../wwwauthenticate-D_FMnPgU.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { T as TempoRailSpec, X as X402BaseRailSpec, S as SolanaMppRailSpec, b as StripeRailSpec } from '../rail_spec-D6qzh3J0.js';
|
|
2
|
-
import { A as AgentInstructions, P as PricingBlock } from '../pricing-
|
|
3
|
-
export { C as CompatibleClients, H as HowToPayBlock, a as HowToPayRailEntry, b as HowToPayRails, c as HowToPayStripeEntry, R as RailKey, d as buildAgentInstructions, e as buildHowToPay, f as buildPricingBlock, g as compatibleClientsByRails } from '../pricing-
|
|
2
|
+
import { A as AgentInstructions, P as PricingBlock } from '../pricing-uFGRNoGl.js';
|
|
3
|
+
export { C as CompatibleClients, H as HowToPayBlock, a as HowToPayRailEntry, b as HowToPayRails, c as HowToPayStripeEntry, R as RailKey, d as buildAgentInstructions, e as buildHowToPay, f as buildPricingBlock, g as compatibleClientsByRails } from '../pricing-uFGRNoGl.js';
|
|
4
4
|
import { AgentMemoryHint } from '../core.js';
|
|
5
5
|
export { buildAgentMemoryHint } from '../core.js';
|
|
6
6
|
import { p as paymentRequiredHeader } from '../wwwauthenticate-D_FMnPgU.js';
|
package/dist/challenge/index.js
CHANGED
|
@@ -188,14 +188,16 @@ function buildHowToPay({
|
|
|
188
188
|
const d = decimals ?? 2;
|
|
189
189
|
const defaultMaxSpend = totalNum >= 1 ? (Math.ceil(totalNum) + 1).toFixed(d) : totalNum.toFixed(d);
|
|
190
190
|
const maxSpendStr = String(maxSpend ?? defaultMaxSpend);
|
|
191
|
+
const gateless = opTokenPlaceholder === null;
|
|
191
192
|
const opToken = opTokenPlaceholder ?? "<your_opc_token>";
|
|
193
|
+
const opTokenHeaderFlag = gateless ? "" : `-H 'X-Operator-Token: ${opToken}' `;
|
|
192
194
|
const block = {};
|
|
193
195
|
if (rails.tempo) {
|
|
194
196
|
const networkName = rails.tempo.testnet ? "tempo-testnet" : rails.tempo.network ?? RAIL_SPEC_DEFAULTS.tempo.network;
|
|
195
197
|
const chainId = rails.tempo.chainId ?? RAIL_SPEC_DEFAULTS.tempo.chainId;
|
|
196
198
|
const recommend = rails.tempo.recommend ?? RAIL_SPEC_DEFAULTS.tempo.recommend;
|
|
197
|
-
const tempoCommand = `tempo request -X POST
|
|
198
|
-
const payCommand = `agentscore-pay pay POST ${url} --chain tempo
|
|
199
|
+
const tempoCommand = `tempo request -X POST ${opTokenHeaderFlag}-H 'Content-Type: application/json' --json '${retryBodyJson}' --max-spend ${maxSpendStr} ${url}`;
|
|
200
|
+
const payCommand = `agentscore-pay pay POST ${url} --chain tempo ${opTokenHeaderFlag}-H 'Content-Type: application/json' -d '${retryBodyJson}' --max-spend ${maxSpendStr}`;
|
|
199
201
|
block.tempo = {
|
|
200
202
|
setup: TEMPO_SETUP,
|
|
201
203
|
prerequisite: `Run \`tempo wallet whoami\` and confirm USDC.e balance on ${networkName} (chain ${chainId}) is at least $${maxSpendStr}. If the tempo CLI is not installed, run the setup commands above first.`,
|
|
@@ -209,7 +211,7 @@ function buildHowToPay({
|
|
|
209
211
|
block.x402_base = {
|
|
210
212
|
setup: PAY_SETUP_BASE,
|
|
211
213
|
prerequisite: `Run \`agentscore-pay balance --chain base\` and confirm USDC balance on Base (${network}) is at least $${maxSpendStr}. If the CLI is not installed, run the setup commands above first.`,
|
|
212
|
-
command: `agentscore-pay pay POST ${url} --chain base
|
|
214
|
+
command: `agentscore-pay pay POST ${url} --chain base ${opTokenHeaderFlag}-H 'Content-Type: application/json' -d '${retryBodyJson}' --max-spend ${maxSpendStr}`,
|
|
213
215
|
what_it_does: "Pays via USDC on Base."
|
|
214
216
|
};
|
|
215
217
|
}
|
|
@@ -218,7 +220,7 @@ function buildHowToPay({
|
|
|
218
220
|
block.solana_mpp = {
|
|
219
221
|
setup: PAY_SETUP_SOLANA,
|
|
220
222
|
prerequisite: `Run \`agentscore-pay balance --chain solana\` and confirm USDC balance on Solana (${network}) is at least $${maxSpendStr}. If the CLI is not installed, run the setup commands above first.`,
|
|
221
|
-
command: `agentscore-pay pay POST ${url} --chain solana
|
|
223
|
+
command: `agentscore-pay pay POST ${url} --chain solana ${opTokenHeaderFlag}-H 'Content-Type: application/json' -d '${retryBodyJson}' --max-spend ${maxSpendStr}`,
|
|
222
224
|
what_it_does: "Pays via USDC on Solana."
|
|
223
225
|
};
|
|
224
226
|
}
|
|
@@ -240,7 +242,7 @@ function buildHowToPay({
|
|
|
240
242
|
];
|
|
241
243
|
stripe.command_link_cli = [
|
|
242
244
|
`SPEND_ID=$(link-cli spend-request create --payment-method-id <csmrpd_id_from_payment_methods_list> --credential-type shared_payment_token --network-id ${stripeCfg.profileId} --amount ${amountCents} --context "${sptContext}" --request-approval --output-json | jq -r .id)`,
|
|
243
|
-
`link-cli mpp pay ${url} --spend-request-id $SPEND_ID --method POST --data '${retryBodyJson}' --header 'X-Operator-Token: ${opToken}' --output-json`
|
|
245
|
+
gateless ? `link-cli mpp pay ${url} --spend-request-id $SPEND_ID --method POST --data '${retryBodyJson}' --output-json` : `link-cli mpp pay ${url} --spend-request-id $SPEND_ID --method POST --data '${retryBodyJson}' --header 'X-Operator-Token: ${opToken}' --output-json`
|
|
244
246
|
];
|
|
245
247
|
stripe.what_it_does_link_cli = "Mints a one-time-use SharedPaymentToken scoped to this purchase (user approves in Link wallet), then submits it as the payment credential.";
|
|
246
248
|
} else if (linkCliBlocked) {
|