@agent-score/commerce 1.2.0 → 1.3.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/README.md +26 -11
- package/dist/{_response-RpEB7-vl.d.ts → _response-C2yFQoIA.d.ts} +1 -1
- package/dist/{_response-DS-LR590.d.mts → _response-DpB-cm2c.d.mts} +1 -1
- package/dist/{agent_instructions-d3UWTdam.d.mts → agent_instructions-DiMSGkdm.d.mts} +10 -6
- package/dist/{agent_instructions-d3UWTdam.d.ts → agent_instructions-DiMSGkdm.d.ts} +10 -6
- package/dist/challenge/index.d.mts +18 -9
- package/dist/challenge/index.d.ts +18 -9
- package/dist/challenge/index.js +25 -24
- package/dist/challenge/index.js.map +1 -1
- package/dist/challenge/index.mjs +25 -24
- package/dist/challenge/index.mjs.map +1 -1
- package/dist/core.js +1 -1
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +1 -1
- package/dist/core.mjs.map +1 -1
- package/dist/discovery/index.d.mts +130 -6
- package/dist/discovery/index.d.ts +130 -6
- package/dist/discovery/index.js +75 -59
- package/dist/discovery/index.js.map +1 -1
- package/dist/discovery/index.mjs +70 -58
- package/dist/discovery/index.mjs.map +1 -1
- package/dist/identity/express.d.mts +2 -2
- package/dist/identity/express.d.ts +2 -2
- package/dist/identity/express.js +48 -25
- package/dist/identity/express.js.map +1 -1
- package/dist/identity/express.mjs +48 -25
- package/dist/identity/express.mjs.map +1 -1
- package/dist/identity/fastify.d.mts +2 -2
- package/dist/identity/fastify.d.ts +2 -2
- package/dist/identity/fastify.js +48 -25
- package/dist/identity/fastify.js.map +1 -1
- package/dist/identity/fastify.mjs +48 -25
- package/dist/identity/fastify.mjs.map +1 -1
- package/dist/identity/hono.d.mts +2 -2
- package/dist/identity/hono.d.ts +2 -2
- package/dist/identity/hono.js +48 -25
- package/dist/identity/hono.js.map +1 -1
- package/dist/identity/hono.mjs +48 -25
- package/dist/identity/hono.mjs.map +1 -1
- package/dist/identity/nextjs.d.mts +2 -2
- package/dist/identity/nextjs.d.ts +2 -2
- package/dist/identity/nextjs.js +48 -25
- package/dist/identity/nextjs.js.map +1 -1
- package/dist/identity/nextjs.mjs +48 -25
- package/dist/identity/nextjs.mjs.map +1 -1
- package/dist/identity/web.d.mts +2 -2
- package/dist/identity/web.d.ts +2 -2
- package/dist/identity/web.js +48 -25
- package/dist/identity/web.js.map +1 -1
- package/dist/identity/web.mjs +48 -25
- package/dist/identity/web.mjs.map +1 -1
- package/dist/index.d.mts +12 -12
- package/dist/index.d.ts +12 -12
- package/dist/index.js +47 -24
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +47 -24
- package/dist/index.mjs.map +1 -1
- package/dist/payment/index.d.mts +136 -49
- package/dist/payment/index.d.ts +136 -49
- package/dist/payment/index.js +161 -73
- package/dist/payment/index.js.map +1 -1
- package/dist/payment/index.mjs +160 -72
- package/dist/payment/index.mjs.map +1 -1
- package/dist/{signer-Cvdwn6Cs.d.mts → signer-kCAJUZwp.d.mts} +10 -12
- package/dist/{signer-Cvdwn6Cs.d.ts → signer-kCAJUZwp.d.ts} +10 -12
- package/dist/stripe-multichain/index.d.mts +2 -2
- package/dist/stripe-multichain/index.d.ts +2 -2
- package/dist/stripe-multichain/index.js.map +1 -1
- package/dist/stripe-multichain/index.mjs.map +1 -1
- package/package.json +13 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RailKey, C as CompatibleClients } from '../agent_instructions-
|
|
2
|
-
export {
|
|
1
|
+
import { R as RailKey, C as CompatibleClients } from '../agent_instructions-DiMSGkdm.mjs';
|
|
2
|
+
export { f as compatibleClientsByRails } from '../agent_instructions-DiMSGkdm.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Build a sample x402 accepts entry for a CAIP-2 network. Looks up the USDC asset
|
|
@@ -180,6 +180,40 @@ interface WellKnownMppInput {
|
|
|
180
180
|
*/
|
|
181
181
|
declare function buildWellKnownMpp(input: WellKnownMppInput): Record<string, unknown>;
|
|
182
182
|
|
|
183
|
+
/**
|
|
184
|
+
* `buildWellKnownX402`: emits the x402scan v1 `/.well-known/x402` discovery shape.
|
|
185
|
+
*
|
|
186
|
+
* x402scan accepts three discovery strategies (OpenAPI > `/.well-known/x402` > endpoint
|
|
187
|
+
* probe). Most AgentScore merchants already publish a richer `/.well-known/mpp.json`,
|
|
188
|
+
* but x402scan's strict parser only reads the v1 shape, so we emit both. The two
|
|
189
|
+
* coexist on different paths.
|
|
190
|
+
*
|
|
191
|
+
* Spec (verbatim, x402scan):
|
|
192
|
+
*
|
|
193
|
+
* {
|
|
194
|
+
* "version": 1,
|
|
195
|
+
* "resources": ["POST /api/route", ...]
|
|
196
|
+
* }
|
|
197
|
+
*
|
|
198
|
+
* Resource entries are `"METHOD /path"` strings, not objects. Runtime 402 behavior
|
|
199
|
+
* is authoritative over this static metadata.
|
|
200
|
+
*/
|
|
201
|
+
interface WellKnownX402Resource {
|
|
202
|
+
/** HTTP method, uppercase: `'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'`. */
|
|
203
|
+
method: string;
|
|
204
|
+
/** Path, leading slash: `'/purchase'`. */
|
|
205
|
+
path: string;
|
|
206
|
+
}
|
|
207
|
+
interface BuildWellKnownX402Input {
|
|
208
|
+
/** Invocable, payment-required routes. Each entry becomes `"METHOD /path"`. */
|
|
209
|
+
resources: WellKnownX402Resource[];
|
|
210
|
+
}
|
|
211
|
+
interface WellKnownX402Document {
|
|
212
|
+
version: 1;
|
|
213
|
+
resources: string[];
|
|
214
|
+
}
|
|
215
|
+
declare function buildWellKnownX402(input: BuildWellKnownX402Input): WellKnownX402Document;
|
|
216
|
+
|
|
183
217
|
interface LlmsTxtIdentitySectionInput {
|
|
184
218
|
/** When true, include the AgentScore identity-paths explanation (wallet vs operator-token). */
|
|
185
219
|
agentscore?: boolean;
|
|
@@ -199,7 +233,7 @@ interface LlmsTxtIdentitySectionInput {
|
|
|
199
233
|
declare function llmsTxtIdentitySection(input?: LlmsTxtIdentitySectionInput): string;
|
|
200
234
|
interface LlmsTxtPaymentSectionInput {
|
|
201
235
|
/** Symbolic rail names supported. */
|
|
202
|
-
rails: ('tempo-mainnet' | 'tempo-testnet' | 'x402-base-mainnet' | 'x402-base-sepolia' | '
|
|
236
|
+
rails: ('tempo-mainnet' | 'tempo-testnet' | 'x402-base-mainnet' | 'x402-base-sepolia' | 'mpp-solana-mainnet' | 'mpp-solana-devnet' | 'stripe-spt' | string)[];
|
|
203
237
|
/** Merchant URL — used in the example commands. */
|
|
204
238
|
appUrl: string;
|
|
205
239
|
/**
|
|
@@ -253,8 +287,20 @@ declare function buildLlmsTxt(input: BuildLlmsTxtInput): string;
|
|
|
253
287
|
*/
|
|
254
288
|
/**
|
|
255
289
|
* Standard AgentScore identity security schemes. Plug into `components.securitySchemes`.
|
|
290
|
+
*
|
|
291
|
+
* Includes `siwx` (Sign-In With X) per the x402scan discovery spec so identity-gated
|
|
292
|
+
* operations can declare `security: [{ siwx: [] }]` and stay classified as identity-only,
|
|
293
|
+
* not paid.
|
|
256
294
|
*/
|
|
257
295
|
declare function agentscoreSecuritySchemes(): Record<string, unknown>;
|
|
296
|
+
/**
|
|
297
|
+
* Sign-In With X security scheme entry, per the x402scan discovery spec.
|
|
298
|
+
*
|
|
299
|
+
* Reference it on identity-gated (but free) operations as
|
|
300
|
+
* `security: [{ siwx: [] }]`. Do NOT also attach `x-payment-info` to those routes,
|
|
301
|
+
* x402scan will misclassify them as paid.
|
|
302
|
+
*/
|
|
303
|
+
declare function siwxSecurityScheme(): Record<string, unknown>;
|
|
258
304
|
/**
|
|
259
305
|
* Standard AgentScore denial response schemas. Plug into `components.schemas` so OpenAPI
|
|
260
306
|
* validators understand the 403 body shape across denial codes.
|
|
@@ -266,6 +312,84 @@ declare function agentscoreDenialSchemas(): Record<string, unknown>;
|
|
|
266
312
|
* fields a typical merchant emits via build402Body.
|
|
267
313
|
*/
|
|
268
314
|
declare function agentscorePaymentRequiredSchema(): Record<string, unknown>;
|
|
315
|
+
/**
|
|
316
|
+
* Per-operation `x-payment-info` extension, per the x402scan discovery spec.
|
|
317
|
+
*
|
|
318
|
+
* Every payment-required OpenAPI operation should carry this block alongside a
|
|
319
|
+
* 402 response. Tells discovery crawlers (x402scan, agent CLIs) the static price
|
|
320
|
+
* and which protocols the route accepts. Runtime 402 behavior is authoritative
|
|
321
|
+
* over this static metadata; the static side is for indexability.
|
|
322
|
+
*
|
|
323
|
+
* @example fixed price across x402 + MPP Tempo
|
|
324
|
+
* ```ts
|
|
325
|
+
* Object.assign(operation, {
|
|
326
|
+
* ...xPaymentInfoExtension({
|
|
327
|
+
* price: { mode: 'fixed', currency: 'USD', amount: '0.10' },
|
|
328
|
+
* protocols: [
|
|
329
|
+
* { x402: {} },
|
|
330
|
+
* { mpp: { method: 'tempo/charge', intent: 'pay', currency: 'USD' } },
|
|
331
|
+
* ],
|
|
332
|
+
* }),
|
|
333
|
+
* responses: {
|
|
334
|
+
* '200': {...},
|
|
335
|
+
* '402': { description: 'Payment Required' },
|
|
336
|
+
* },
|
|
337
|
+
* });
|
|
338
|
+
* ```
|
|
339
|
+
*/
|
|
340
|
+
interface XPaymentInfoFixedPrice {
|
|
341
|
+
mode: 'fixed';
|
|
342
|
+
currency: string;
|
|
343
|
+
amount: string;
|
|
344
|
+
}
|
|
345
|
+
interface XPaymentInfoDynamicPrice {
|
|
346
|
+
mode: 'dynamic';
|
|
347
|
+
currency: string;
|
|
348
|
+
min: string;
|
|
349
|
+
max: string;
|
|
350
|
+
}
|
|
351
|
+
type XPaymentInfoPrice = XPaymentInfoFixedPrice | XPaymentInfoDynamicPrice;
|
|
352
|
+
interface XPaymentInfoX402Protocol {
|
|
353
|
+
x402: Record<string, unknown>;
|
|
354
|
+
}
|
|
355
|
+
interface XPaymentInfoMppProtocol {
|
|
356
|
+
mpp: {
|
|
357
|
+
method: string;
|
|
358
|
+
intent: string;
|
|
359
|
+
currency: string;
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
type XPaymentInfoProtocol = XPaymentInfoX402Protocol | XPaymentInfoMppProtocol;
|
|
363
|
+
interface XPaymentInfoInput {
|
|
364
|
+
price: XPaymentInfoPrice;
|
|
365
|
+
protocols: XPaymentInfoProtocol[];
|
|
366
|
+
}
|
|
367
|
+
declare function xPaymentInfoExtension(input: XPaymentInfoInput): {
|
|
368
|
+
'x-payment-info': {
|
|
369
|
+
price: XPaymentInfoPrice;
|
|
370
|
+
protocols: XPaymentInfoProtocol[];
|
|
371
|
+
};
|
|
372
|
+
};
|
|
373
|
+
/**
|
|
374
|
+
* `info.x-guidance` extension, per the x402scan discovery spec. Spread into your
|
|
375
|
+
* OpenAPI document's `info` block to give agents a high-level prose description
|
|
376
|
+
* of how to use the API. Discovery crawlers surface this on the listing page.
|
|
377
|
+
*
|
|
378
|
+
* @example
|
|
379
|
+
* ```ts
|
|
380
|
+
* const spec = {
|
|
381
|
+
* openapi: '3.1.0',
|
|
382
|
+
* info: {
|
|
383
|
+
* title: 'My Merchant API',
|
|
384
|
+
* version: '1.0',
|
|
385
|
+
* ...xGuidanceExtension('Wine merchant. POST /purchase with a verified operator token...'),
|
|
386
|
+
* },
|
|
387
|
+
* };
|
|
388
|
+
* ```
|
|
389
|
+
*/
|
|
390
|
+
declare function xGuidanceExtension(text: string): {
|
|
391
|
+
'x-guidance': string;
|
|
392
|
+
};
|
|
269
393
|
interface BuildAgentScoreOpenApiSnippetsInput {
|
|
270
394
|
/** Include security schemes in the snippet. Default true. */
|
|
271
395
|
security?: boolean;
|
|
@@ -411,7 +535,7 @@ interface SkillMdLink {
|
|
|
411
535
|
interface BuildSkillMdInput {
|
|
412
536
|
/** Skill manifest identifier — kebab-case per agentskills.io spec: 1-64 chars, lowercase
|
|
413
537
|
* alphanumeric + hyphens, no leading/trailing/consecutive hyphens. Validated at build
|
|
414
|
-
* time; invalid names throw. e.g. '
|
|
538
|
+
* time; invalid names throw. e.g. 'example-merchant-commerce'. */
|
|
415
539
|
name: string;
|
|
416
540
|
/** Skill description — agentskills.io spec: 1-1024 chars, non-empty. Should describe both
|
|
417
541
|
* what the skill does AND when to use it; imperative phrasing recommended ("Use when…").
|
|
@@ -435,7 +559,7 @@ interface BuildSkillMdInput {
|
|
|
435
559
|
/** Additional caller-defined metadata entries — flat key/value strings nested under
|
|
436
560
|
* `metadata:`. Spec requires string values. */
|
|
437
561
|
metadata?: Record<string, string | number>;
|
|
438
|
-
/** Human display name (e.g. "
|
|
562
|
+
/** Human display name (e.g. "Example Merchant"). */
|
|
439
563
|
merchantName: string;
|
|
440
564
|
/** Optional one-line tagline appearing under the title. */
|
|
441
565
|
tagline?: string;
|
|
@@ -498,4 +622,4 @@ interface BuildSkillMdInput {
|
|
|
498
622
|
*/
|
|
499
623
|
declare function buildSkillMd(input: BuildSkillMdInput): string;
|
|
500
624
|
|
|
501
|
-
export { type BazaarDiscoveryConfig, type BuildAgentScoreOpenApiSnippetsInput, type BuildLlmsTxtInput, type BuildSkillMdInput, CompatibleClients, type DiscoveryProbeOptions, type DiscoveryProbeResponse, type LlmsTxtIdentitySectionInput, type LlmsTxtPaymentSectionInput, type NoindexNonDiscoveryOptions, type PaymentMethodConfig, RailKey, type RequestLike, type SkillMdEndpoint, type SkillMdIdentityRequirements, type SkillMdLink, type SkillMdShippingPolicy, type WellKnownMppInput, agentscoreDenialSchemas, agentscoreOpenApiSnippets, agentscorePaymentRequiredSchema, agentscoreSecuritySchemes, applyNoindexHeader, buildDiscoveryProbeResponse, buildLlmsTxt, buildSkillMd, buildWellKnownMpp, createBazaarDiscovery, defaultDiscoveryPaths, isDiscoveryPath, isDiscoveryProbeRequest, llmsTxtIdentitySection, llmsTxtPaymentSection, noindexNonDiscoveryPaths, noindexNonDiscoveryPathsExpress, noindexNonDiscoveryPathsFastify, sampleX402AcceptForNetwork, wrapNoindexResponse };
|
|
625
|
+
export { type BazaarDiscoveryConfig, type BuildAgentScoreOpenApiSnippetsInput, type BuildLlmsTxtInput, type BuildSkillMdInput, type BuildWellKnownX402Input, CompatibleClients, type DiscoveryProbeOptions, type DiscoveryProbeResponse, type LlmsTxtIdentitySectionInput, type LlmsTxtPaymentSectionInput, type NoindexNonDiscoveryOptions, type PaymentMethodConfig, RailKey, type RequestLike, type SkillMdEndpoint, type SkillMdIdentityRequirements, type SkillMdLink, type SkillMdShippingPolicy, type WellKnownMppInput, type WellKnownX402Document, type WellKnownX402Resource, type XPaymentInfoDynamicPrice, type XPaymentInfoFixedPrice, type XPaymentInfoInput, type XPaymentInfoMppProtocol, type XPaymentInfoPrice, type XPaymentInfoProtocol, type XPaymentInfoX402Protocol, agentscoreDenialSchemas, agentscoreOpenApiSnippets, agentscorePaymentRequiredSchema, agentscoreSecuritySchemes, applyNoindexHeader, buildDiscoveryProbeResponse, buildLlmsTxt, buildSkillMd, buildWellKnownMpp, buildWellKnownX402, createBazaarDiscovery, defaultDiscoveryPaths, isDiscoveryPath, isDiscoveryProbeRequest, llmsTxtIdentitySection, llmsTxtPaymentSection, noindexNonDiscoveryPaths, noindexNonDiscoveryPathsExpress, noindexNonDiscoveryPathsFastify, sampleX402AcceptForNetwork, siwxSecurityScheme, wrapNoindexResponse, xGuidanceExtension, xPaymentInfoExtension };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RailKey, C as CompatibleClients } from '../agent_instructions-
|
|
2
|
-
export {
|
|
1
|
+
import { R as RailKey, C as CompatibleClients } from '../agent_instructions-DiMSGkdm.js';
|
|
2
|
+
export { f as compatibleClientsByRails } from '../agent_instructions-DiMSGkdm.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Build a sample x402 accepts entry for a CAIP-2 network. Looks up the USDC asset
|
|
@@ -180,6 +180,40 @@ interface WellKnownMppInput {
|
|
|
180
180
|
*/
|
|
181
181
|
declare function buildWellKnownMpp(input: WellKnownMppInput): Record<string, unknown>;
|
|
182
182
|
|
|
183
|
+
/**
|
|
184
|
+
* `buildWellKnownX402`: emits the x402scan v1 `/.well-known/x402` discovery shape.
|
|
185
|
+
*
|
|
186
|
+
* x402scan accepts three discovery strategies (OpenAPI > `/.well-known/x402` > endpoint
|
|
187
|
+
* probe). Most AgentScore merchants already publish a richer `/.well-known/mpp.json`,
|
|
188
|
+
* but x402scan's strict parser only reads the v1 shape, so we emit both. The two
|
|
189
|
+
* coexist on different paths.
|
|
190
|
+
*
|
|
191
|
+
* Spec (verbatim, x402scan):
|
|
192
|
+
*
|
|
193
|
+
* {
|
|
194
|
+
* "version": 1,
|
|
195
|
+
* "resources": ["POST /api/route", ...]
|
|
196
|
+
* }
|
|
197
|
+
*
|
|
198
|
+
* Resource entries are `"METHOD /path"` strings, not objects. Runtime 402 behavior
|
|
199
|
+
* is authoritative over this static metadata.
|
|
200
|
+
*/
|
|
201
|
+
interface WellKnownX402Resource {
|
|
202
|
+
/** HTTP method, uppercase: `'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'`. */
|
|
203
|
+
method: string;
|
|
204
|
+
/** Path, leading slash: `'/purchase'`. */
|
|
205
|
+
path: string;
|
|
206
|
+
}
|
|
207
|
+
interface BuildWellKnownX402Input {
|
|
208
|
+
/** Invocable, payment-required routes. Each entry becomes `"METHOD /path"`. */
|
|
209
|
+
resources: WellKnownX402Resource[];
|
|
210
|
+
}
|
|
211
|
+
interface WellKnownX402Document {
|
|
212
|
+
version: 1;
|
|
213
|
+
resources: string[];
|
|
214
|
+
}
|
|
215
|
+
declare function buildWellKnownX402(input: BuildWellKnownX402Input): WellKnownX402Document;
|
|
216
|
+
|
|
183
217
|
interface LlmsTxtIdentitySectionInput {
|
|
184
218
|
/** When true, include the AgentScore identity-paths explanation (wallet vs operator-token). */
|
|
185
219
|
agentscore?: boolean;
|
|
@@ -199,7 +233,7 @@ interface LlmsTxtIdentitySectionInput {
|
|
|
199
233
|
declare function llmsTxtIdentitySection(input?: LlmsTxtIdentitySectionInput): string;
|
|
200
234
|
interface LlmsTxtPaymentSectionInput {
|
|
201
235
|
/** Symbolic rail names supported. */
|
|
202
|
-
rails: ('tempo-mainnet' | 'tempo-testnet' | 'x402-base-mainnet' | 'x402-base-sepolia' | '
|
|
236
|
+
rails: ('tempo-mainnet' | 'tempo-testnet' | 'x402-base-mainnet' | 'x402-base-sepolia' | 'mpp-solana-mainnet' | 'mpp-solana-devnet' | 'stripe-spt' | string)[];
|
|
203
237
|
/** Merchant URL — used in the example commands. */
|
|
204
238
|
appUrl: string;
|
|
205
239
|
/**
|
|
@@ -253,8 +287,20 @@ declare function buildLlmsTxt(input: BuildLlmsTxtInput): string;
|
|
|
253
287
|
*/
|
|
254
288
|
/**
|
|
255
289
|
* Standard AgentScore identity security schemes. Plug into `components.securitySchemes`.
|
|
290
|
+
*
|
|
291
|
+
* Includes `siwx` (Sign-In With X) per the x402scan discovery spec so identity-gated
|
|
292
|
+
* operations can declare `security: [{ siwx: [] }]` and stay classified as identity-only,
|
|
293
|
+
* not paid.
|
|
256
294
|
*/
|
|
257
295
|
declare function agentscoreSecuritySchemes(): Record<string, unknown>;
|
|
296
|
+
/**
|
|
297
|
+
* Sign-In With X security scheme entry, per the x402scan discovery spec.
|
|
298
|
+
*
|
|
299
|
+
* Reference it on identity-gated (but free) operations as
|
|
300
|
+
* `security: [{ siwx: [] }]`. Do NOT also attach `x-payment-info` to those routes,
|
|
301
|
+
* x402scan will misclassify them as paid.
|
|
302
|
+
*/
|
|
303
|
+
declare function siwxSecurityScheme(): Record<string, unknown>;
|
|
258
304
|
/**
|
|
259
305
|
* Standard AgentScore denial response schemas. Plug into `components.schemas` so OpenAPI
|
|
260
306
|
* validators understand the 403 body shape across denial codes.
|
|
@@ -266,6 +312,84 @@ declare function agentscoreDenialSchemas(): Record<string, unknown>;
|
|
|
266
312
|
* fields a typical merchant emits via build402Body.
|
|
267
313
|
*/
|
|
268
314
|
declare function agentscorePaymentRequiredSchema(): Record<string, unknown>;
|
|
315
|
+
/**
|
|
316
|
+
* Per-operation `x-payment-info` extension, per the x402scan discovery spec.
|
|
317
|
+
*
|
|
318
|
+
* Every payment-required OpenAPI operation should carry this block alongside a
|
|
319
|
+
* 402 response. Tells discovery crawlers (x402scan, agent CLIs) the static price
|
|
320
|
+
* and which protocols the route accepts. Runtime 402 behavior is authoritative
|
|
321
|
+
* over this static metadata; the static side is for indexability.
|
|
322
|
+
*
|
|
323
|
+
* @example fixed price across x402 + MPP Tempo
|
|
324
|
+
* ```ts
|
|
325
|
+
* Object.assign(operation, {
|
|
326
|
+
* ...xPaymentInfoExtension({
|
|
327
|
+
* price: { mode: 'fixed', currency: 'USD', amount: '0.10' },
|
|
328
|
+
* protocols: [
|
|
329
|
+
* { x402: {} },
|
|
330
|
+
* { mpp: { method: 'tempo/charge', intent: 'pay', currency: 'USD' } },
|
|
331
|
+
* ],
|
|
332
|
+
* }),
|
|
333
|
+
* responses: {
|
|
334
|
+
* '200': {...},
|
|
335
|
+
* '402': { description: 'Payment Required' },
|
|
336
|
+
* },
|
|
337
|
+
* });
|
|
338
|
+
* ```
|
|
339
|
+
*/
|
|
340
|
+
interface XPaymentInfoFixedPrice {
|
|
341
|
+
mode: 'fixed';
|
|
342
|
+
currency: string;
|
|
343
|
+
amount: string;
|
|
344
|
+
}
|
|
345
|
+
interface XPaymentInfoDynamicPrice {
|
|
346
|
+
mode: 'dynamic';
|
|
347
|
+
currency: string;
|
|
348
|
+
min: string;
|
|
349
|
+
max: string;
|
|
350
|
+
}
|
|
351
|
+
type XPaymentInfoPrice = XPaymentInfoFixedPrice | XPaymentInfoDynamicPrice;
|
|
352
|
+
interface XPaymentInfoX402Protocol {
|
|
353
|
+
x402: Record<string, unknown>;
|
|
354
|
+
}
|
|
355
|
+
interface XPaymentInfoMppProtocol {
|
|
356
|
+
mpp: {
|
|
357
|
+
method: string;
|
|
358
|
+
intent: string;
|
|
359
|
+
currency: string;
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
type XPaymentInfoProtocol = XPaymentInfoX402Protocol | XPaymentInfoMppProtocol;
|
|
363
|
+
interface XPaymentInfoInput {
|
|
364
|
+
price: XPaymentInfoPrice;
|
|
365
|
+
protocols: XPaymentInfoProtocol[];
|
|
366
|
+
}
|
|
367
|
+
declare function xPaymentInfoExtension(input: XPaymentInfoInput): {
|
|
368
|
+
'x-payment-info': {
|
|
369
|
+
price: XPaymentInfoPrice;
|
|
370
|
+
protocols: XPaymentInfoProtocol[];
|
|
371
|
+
};
|
|
372
|
+
};
|
|
373
|
+
/**
|
|
374
|
+
* `info.x-guidance` extension, per the x402scan discovery spec. Spread into your
|
|
375
|
+
* OpenAPI document's `info` block to give agents a high-level prose description
|
|
376
|
+
* of how to use the API. Discovery crawlers surface this on the listing page.
|
|
377
|
+
*
|
|
378
|
+
* @example
|
|
379
|
+
* ```ts
|
|
380
|
+
* const spec = {
|
|
381
|
+
* openapi: '3.1.0',
|
|
382
|
+
* info: {
|
|
383
|
+
* title: 'My Merchant API',
|
|
384
|
+
* version: '1.0',
|
|
385
|
+
* ...xGuidanceExtension('Wine merchant. POST /purchase with a verified operator token...'),
|
|
386
|
+
* },
|
|
387
|
+
* };
|
|
388
|
+
* ```
|
|
389
|
+
*/
|
|
390
|
+
declare function xGuidanceExtension(text: string): {
|
|
391
|
+
'x-guidance': string;
|
|
392
|
+
};
|
|
269
393
|
interface BuildAgentScoreOpenApiSnippetsInput {
|
|
270
394
|
/** Include security schemes in the snippet. Default true. */
|
|
271
395
|
security?: boolean;
|
|
@@ -411,7 +535,7 @@ interface SkillMdLink {
|
|
|
411
535
|
interface BuildSkillMdInput {
|
|
412
536
|
/** Skill manifest identifier — kebab-case per agentskills.io spec: 1-64 chars, lowercase
|
|
413
537
|
* alphanumeric + hyphens, no leading/trailing/consecutive hyphens. Validated at build
|
|
414
|
-
* time; invalid names throw. e.g. '
|
|
538
|
+
* time; invalid names throw. e.g. 'example-merchant-commerce'. */
|
|
415
539
|
name: string;
|
|
416
540
|
/** Skill description — agentskills.io spec: 1-1024 chars, non-empty. Should describe both
|
|
417
541
|
* what the skill does AND when to use it; imperative phrasing recommended ("Use when…").
|
|
@@ -435,7 +559,7 @@ interface BuildSkillMdInput {
|
|
|
435
559
|
/** Additional caller-defined metadata entries — flat key/value strings nested under
|
|
436
560
|
* `metadata:`. Spec requires string values. */
|
|
437
561
|
metadata?: Record<string, string | number>;
|
|
438
|
-
/** Human display name (e.g. "
|
|
562
|
+
/** Human display name (e.g. "Example Merchant"). */
|
|
439
563
|
merchantName: string;
|
|
440
564
|
/** Optional one-line tagline appearing under the title. */
|
|
441
565
|
tagline?: string;
|
|
@@ -498,4 +622,4 @@ interface BuildSkillMdInput {
|
|
|
498
622
|
*/
|
|
499
623
|
declare function buildSkillMd(input: BuildSkillMdInput): string;
|
|
500
624
|
|
|
501
|
-
export { type BazaarDiscoveryConfig, type BuildAgentScoreOpenApiSnippetsInput, type BuildLlmsTxtInput, type BuildSkillMdInput, CompatibleClients, type DiscoveryProbeOptions, type DiscoveryProbeResponse, type LlmsTxtIdentitySectionInput, type LlmsTxtPaymentSectionInput, type NoindexNonDiscoveryOptions, type PaymentMethodConfig, RailKey, type RequestLike, type SkillMdEndpoint, type SkillMdIdentityRequirements, type SkillMdLink, type SkillMdShippingPolicy, type WellKnownMppInput, agentscoreDenialSchemas, agentscoreOpenApiSnippets, agentscorePaymentRequiredSchema, agentscoreSecuritySchemes, applyNoindexHeader, buildDiscoveryProbeResponse, buildLlmsTxt, buildSkillMd, buildWellKnownMpp, createBazaarDiscovery, defaultDiscoveryPaths, isDiscoveryPath, isDiscoveryProbeRequest, llmsTxtIdentitySection, llmsTxtPaymentSection, noindexNonDiscoveryPaths, noindexNonDiscoveryPathsExpress, noindexNonDiscoveryPathsFastify, sampleX402AcceptForNetwork, wrapNoindexResponse };
|
|
625
|
+
export { type BazaarDiscoveryConfig, type BuildAgentScoreOpenApiSnippetsInput, type BuildLlmsTxtInput, type BuildSkillMdInput, type BuildWellKnownX402Input, CompatibleClients, type DiscoveryProbeOptions, type DiscoveryProbeResponse, type LlmsTxtIdentitySectionInput, type LlmsTxtPaymentSectionInput, type NoindexNonDiscoveryOptions, type PaymentMethodConfig, RailKey, type RequestLike, type SkillMdEndpoint, type SkillMdIdentityRequirements, type SkillMdLink, type SkillMdShippingPolicy, type WellKnownMppInput, type WellKnownX402Document, type WellKnownX402Resource, type XPaymentInfoDynamicPrice, type XPaymentInfoFixedPrice, type XPaymentInfoInput, type XPaymentInfoMppProtocol, type XPaymentInfoPrice, type XPaymentInfoProtocol, type XPaymentInfoX402Protocol, agentscoreDenialSchemas, agentscoreOpenApiSnippets, agentscorePaymentRequiredSchema, agentscoreSecuritySchemes, applyNoindexHeader, buildDiscoveryProbeResponse, buildLlmsTxt, buildSkillMd, buildWellKnownMpp, buildWellKnownX402, createBazaarDiscovery, defaultDiscoveryPaths, isDiscoveryPath, isDiscoveryProbeRequest, llmsTxtIdentitySection, llmsTxtPaymentSection, noindexNonDiscoveryPaths, noindexNonDiscoveryPathsExpress, noindexNonDiscoveryPathsFastify, sampleX402AcceptForNetwork, siwxSecurityScheme, wrapNoindexResponse, xGuidanceExtension, xPaymentInfoExtension };
|
package/dist/discovery/index.js
CHANGED
|
@@ -29,6 +29,7 @@ __export(discovery_exports, {
|
|
|
29
29
|
buildLlmsTxt: () => buildLlmsTxt,
|
|
30
30
|
buildSkillMd: () => buildSkillMd,
|
|
31
31
|
buildWellKnownMpp: () => buildWellKnownMpp,
|
|
32
|
+
buildWellKnownX402: () => buildWellKnownX402,
|
|
32
33
|
compatibleClientsByRails: () => compatibleClientsByRails,
|
|
33
34
|
createBazaarDiscovery: () => createBazaarDiscovery,
|
|
34
35
|
defaultDiscoveryPaths: () => defaultDiscoveryPaths,
|
|
@@ -40,7 +41,10 @@ __export(discovery_exports, {
|
|
|
40
41
|
noindexNonDiscoveryPathsExpress: () => noindexNonDiscoveryPathsExpress,
|
|
41
42
|
noindexNonDiscoveryPathsFastify: () => noindexNonDiscoveryPathsFastify,
|
|
42
43
|
sampleX402AcceptForNetwork: () => sampleX402AcceptForNetwork,
|
|
43
|
-
|
|
44
|
+
siwxSecurityScheme: () => siwxSecurityScheme,
|
|
45
|
+
wrapNoindexResponse: () => wrapNoindexResponse,
|
|
46
|
+
xGuidanceExtension: () => xGuidanceExtension,
|
|
47
|
+
xPaymentInfoExtension: () => xPaymentInfoExtension
|
|
44
48
|
});
|
|
45
49
|
module.exports = __toCommonJS(discovery_exports);
|
|
46
50
|
|
|
@@ -129,15 +133,15 @@ var rails = {
|
|
|
129
133
|
decimals: USDC.base.sepolia.decimals,
|
|
130
134
|
asset: USDC.base.sepolia.address
|
|
131
135
|
},
|
|
132
|
-
"
|
|
133
|
-
method: "
|
|
136
|
+
"mpp-solana-mainnet": {
|
|
137
|
+
method: "solana",
|
|
134
138
|
network: networks.solana.mainnet.caip2,
|
|
135
139
|
currency: USDC.solana.mainnet.mint,
|
|
136
140
|
decimals: USDC.solana.mainnet.decimals,
|
|
137
141
|
asset: USDC.solana.mainnet.mint
|
|
138
142
|
},
|
|
139
|
-
"
|
|
140
|
-
method: "
|
|
143
|
+
"mpp-solana-devnet": {
|
|
144
|
+
method: "solana",
|
|
141
145
|
network: networks.solana.devnet.caip2,
|
|
142
146
|
currency: USDC.solana.devnet.mint,
|
|
143
147
|
decimals: USDC.solana.devnet.decimals,
|
|
@@ -326,6 +330,14 @@ function buildWellKnownMpp(input) {
|
|
|
326
330
|
};
|
|
327
331
|
}
|
|
328
332
|
|
|
333
|
+
// src/discovery/well_known_x402.ts
|
|
334
|
+
function buildWellKnownX402(input) {
|
|
335
|
+
return {
|
|
336
|
+
version: 1,
|
|
337
|
+
resources: input.resources.map((r) => `${r.method.toUpperCase()} ${r.path}`)
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
|
|
329
341
|
// src/discovery/llms_txt.ts
|
|
330
342
|
function llmsTxtIdentitySection(input = {}) {
|
|
331
343
|
if (!input.agentscore) {
|
|
@@ -340,19 +352,13 @@ Compliance: ${[
|
|
|
340
352
|
compliance.allowed_jurisdictions?.length ? `${compliance.allowed_jurisdictions.join("/")} only` : null,
|
|
341
353
|
compliance.require_sanctions_clear ? "sanctions clear" : null
|
|
342
354
|
].filter(Boolean).join(", ")}.` : "";
|
|
343
|
-
return `##
|
|
355
|
+
return `## Identity
|
|
344
356
|
|
|
345
|
-
AgentScore
|
|
357
|
+
AgentScore identity is reusable across every AgentScore-gated merchant \u2014 one KYC, no re-verification per site. Pick a header:
|
|
346
358
|
|
|
347
|
-
-
|
|
348
|
-
-
|
|
349
|
-
- **Neither
|
|
350
|
-
|
|
351
|
-
If you reach another AgentScore-gated endpoint in the future, the same credential and/or any linked wallet already works \u2014 skip the session flow.
|
|
352
|
-
|
|
353
|
-
## Memory contract
|
|
354
|
-
|
|
355
|
-
First-encounter 403 responses (and the POST /v1/sessions success body) include an \`agent_memory\` block describing how AgentScore identity works across merchants. LLM-hosted agents should persist its contents (the pattern, never secrets) so subsequent AgentScore-gated endpoints become returning-customer encounters.${complianceNote}`;
|
|
359
|
+
- **\`X-Wallet-Address: 0x...\` or base58** \u2014 works on signing rails (Tempo, x402, Solana MPP). The wallet you claim must sign the payment.
|
|
360
|
+
- **\`X-Operator-Token: opc_...\`** \u2014 works on every rail, including Stripe SPT. Reusable across AgentScore merchants until expiry.
|
|
361
|
+
- **Neither** \u2014 you get a 403 with \`verify_url\`. Complete the session flow once and reuse the resulting \`opc_...\` everywhere.${complianceNote}`;
|
|
356
362
|
}
|
|
357
363
|
function llmsTxtPaymentSection(input) {
|
|
358
364
|
return input.verbose ? llmsTxtPaymentSectionVerbose(input) : llmsTxtPaymentSectionCompact(input);
|
|
@@ -372,8 +378,8 @@ function llmsTxtPaymentSectionCompact(input) {
|
|
|
372
378
|
if (hasRailFamily(rails2, "x402-base-")) {
|
|
373
379
|
lines.push("- **x402 USDC on Base** (EIP-3009) \u2014 `agentscore-pay pay POST " + input.appUrl + ` --chain base -H "X-Operator-Token: opc_..." -d '{...}'\``);
|
|
374
380
|
}
|
|
375
|
-
if (hasRailFamily(rails2, "
|
|
376
|
-
lines.push("- **
|
|
381
|
+
if (hasRailFamily(rails2, "mpp-solana-")) {
|
|
382
|
+
lines.push("- **USDC on Solana** \u2014 `agentscore-pay pay POST " + input.appUrl + ` --chain solana -H "X-Operator-Token: opc_..." -d '{...}'\``);
|
|
377
383
|
}
|
|
378
384
|
if (rails2.includes("stripe-spt")) {
|
|
379
385
|
lines.push("- **Stripe Shared Payment Token** \u2014 agent mints SPT (own Stripe account scoped to networkId, OR `link-cli spend-request create --credential-type shared_payment_token --network-id <profileId> ...`)");
|
|
@@ -389,72 +395,62 @@ function llmsTxtPaymentSectionVerbose(input) {
|
|
|
389
395
|
const tempoChain = input.tempoChainId ?? 4217;
|
|
390
396
|
const hasTempo = hasRailFamily(rails2, "tempo-");
|
|
391
397
|
const hasBase = hasRailFamily(rails2, "x402-base-");
|
|
392
|
-
const hasSolana = hasRailFamily(rails2, "
|
|
398
|
+
const hasSolana = hasRailFamily(rails2, "mpp-solana-");
|
|
393
399
|
const hasStripe = rails2.includes("stripe-spt");
|
|
394
400
|
const baseNetworkName = isTestnetRail(rails2, "x402-base-") ? "Base Sepolia" : "Base";
|
|
395
|
-
const solanaNetworkName = isTestnetRail(rails2, "
|
|
401
|
+
const solanaNetworkName = isTestnetRail(rails2, "mpp-solana-") ? "Solana devnet" : "Solana";
|
|
396
402
|
const lines = ["## Payment", ""];
|
|
397
|
-
lines.push("
|
|
403
|
+
lines.push("Accepted rails:");
|
|
398
404
|
lines.push("");
|
|
399
|
-
if (hasTempo) lines.push("- **
|
|
400
|
-
if (hasBase
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
}
|
|
404
|
-
if (hasStripe) lines.push("- **Stripe Shared Payment Token** (agent mints SPT on their Stripe account scoped to our networkId in the challenge, submits it in the credential)");
|
|
405
|
+
if (hasTempo) lines.push("- **USDC on Tempo**");
|
|
406
|
+
if (hasBase) lines.push(`- **USDC on ${baseNetworkName}**`);
|
|
407
|
+
if (hasSolana) lines.push(`- **USDC on ${solanaNetworkName}**`);
|
|
408
|
+
if (hasStripe) lines.push("- **Stripe Shared Payment Token**");
|
|
405
409
|
lines.push("");
|
|
406
410
|
if (hasTempo) {
|
|
407
|
-
lines.push("###
|
|
411
|
+
lines.push("### Pay with Tempo");
|
|
408
412
|
lines.push("");
|
|
409
|
-
lines.push("
|
|
410
|
-
lines.push("
|
|
411
|
-
lines.push(
|
|
412
|
-
lines.push(
|
|
413
|
-
lines.push("");
|
|
414
|
-
lines.push("Then use `tempo request` to make the paid purchase:");
|
|
413
|
+
lines.push("```bash");
|
|
414
|
+
lines.push("curl -fsSL https://tempo.xyz/install | bash");
|
|
415
|
+
lines.push("tempo wallet login");
|
|
416
|
+
lines.push(`tempo wallet whoami # need USDC.e on ${tempoNetwork} (chain ${tempoChain})`);
|
|
417
|
+
lines.push("tempo wallet fund # if zero");
|
|
415
418
|
lines.push("");
|
|
416
419
|
lines.push("tempo request -X POST \\");
|
|
417
|
-
lines.push(' -H "X-Operator-Token:
|
|
418
|
-
lines.push(' -H "Content-Type: application/json" \\');
|
|
420
|
+
lines.push(' -H "X-Operator-Token: opc_..." \\');
|
|
419
421
|
lines.push(" --json '{...}' \\");
|
|
420
422
|
lines.push(" --max-spend N \\");
|
|
421
423
|
lines.push(` ${input.appUrl}`);
|
|
422
|
-
lines.push("");
|
|
423
|
-
lines.push(`\`tempo request\` handles the full MPP handshake: sends the POST, receives the 402 challenge, signs the payment on ${tempoNetwork}, submits the credential, and returns the completed order.`);
|
|
424
|
+
lines.push("```");
|
|
424
425
|
lines.push("");
|
|
425
426
|
}
|
|
426
427
|
if (hasBase || hasSolana) {
|
|
427
428
|
const chainsLabel = [hasBase && baseNetworkName, hasSolana && solanaNetworkName].filter(Boolean).join(" or ");
|
|
428
429
|
const flags = [hasBase && "`--chain base`", hasSolana && "`--chain solana`"].filter(Boolean).join(" or ");
|
|
429
|
-
lines.push(`###
|
|
430
|
-
lines.push("");
|
|
431
|
-
lines.push("1. Install the agentscore-pay CLI: npm install -g @agent-score/pay (or: brew install agentscore/tap/agentscore-pay)");
|
|
432
|
-
lines.push(`2. Create a wallet on your chain of choice: agentscore-pay wallet create ${flags}`);
|
|
433
|
-
lines.push(`3. Fund the printed address with USDC on ${chainsLabel}`);
|
|
434
|
-
lines.push(`4. Confirm balance: agentscore-pay balance ${flags}`);
|
|
430
|
+
lines.push(`### Pay with ${chainsLabel}`);
|
|
435
431
|
lines.push("");
|
|
436
|
-
lines.push("
|
|
432
|
+
lines.push("```bash");
|
|
433
|
+
lines.push("npm install -g @agent-score/pay");
|
|
434
|
+
lines.push(`agentscore-pay wallet create ${flags}`);
|
|
435
|
+
lines.push(`agentscore-pay balance ${flags} # fund the printed address with USDC`);
|
|
437
436
|
lines.push("");
|
|
438
437
|
lines.push(`agentscore-pay pay POST ${input.appUrl} \\`);
|
|
439
438
|
lines.push(` ${hasBase ? "--chain base" : "--chain solana"} \\`);
|
|
440
|
-
lines.push(' -H "X-Operator-Token:
|
|
441
|
-
lines.push(' -H "Content-Type: application/json" \\');
|
|
439
|
+
lines.push(' -H "X-Operator-Token: opc_..." \\');
|
|
442
440
|
lines.push(" -d '{...}' \\");
|
|
443
441
|
lines.push(" --max-spend N");
|
|
444
|
-
lines.push("");
|
|
445
|
-
const handshakeChains = [hasBase && "EIP-3009 (Base)", hasSolana && "SPL Token (Solana)"].filter(Boolean).join(" or ");
|
|
446
|
-
lines.push(`The CLI handles the full x402 handshake: hits the URL, parses the 402 challenge, signs the ${handshakeChains} transaction, submits via X-Payment header, and returns the completed order.`);
|
|
442
|
+
lines.push("```");
|
|
447
443
|
lines.push("");
|
|
448
444
|
}
|
|
449
445
|
if (hasStripe) {
|
|
450
|
-
lines.push("###
|
|
446
|
+
lines.push("### Pay with Stripe SPT");
|
|
451
447
|
lines.push("");
|
|
452
|
-
lines.push("Mint a SharedPaymentToken scoped to the profile_id
|
|
448
|
+
lines.push("Mint a SharedPaymentToken scoped to the `profile_id` from the 402 body, then submit via `Authorization: Payment` with `method=stripe/charge`. Either your own Stripe account or `link-cli spend-request create --credential-type shared_payment_token --network-id <profileId> ...` for Stripe Link wallets.");
|
|
453
449
|
lines.push("");
|
|
454
450
|
}
|
|
455
|
-
lines.push("IMPORTANT:
|
|
451
|
+
lines.push("IMPORTANT: Use the CLIs above. Raw on-chain transfers (e.g. `tempo wallet transfer`, sending USDC manually to deposit addresses) bypass the protocol handshake and the order will not complete.");
|
|
456
452
|
if (hasBase || hasSolana) {
|
|
457
|
-
lines.push("IMPORTANT:
|
|
453
|
+
lines.push("IMPORTANT: Pay the exact amount in the 402 challenge. Overpayments and underpayments cannot be matched.");
|
|
458
454
|
}
|
|
459
455
|
lines.push("");
|
|
460
456
|
return lines.join("\n");
|
|
@@ -495,7 +491,16 @@ function agentscoreSecuritySchemes() {
|
|
|
495
491
|
in: "header",
|
|
496
492
|
name: "X-Wallet-Address",
|
|
497
493
|
description: "Wallet-path identity (0x... or base58). Only works on rails that carry a wallet signature (Tempo MPP, x402 EIP-3009, x402 SPL Token). The wallet you claim MUST sign the payment."
|
|
498
|
-
}
|
|
494
|
+
},
|
|
495
|
+
siwx: siwxSecurityScheme()
|
|
496
|
+
};
|
|
497
|
+
}
|
|
498
|
+
function siwxSecurityScheme() {
|
|
499
|
+
return {
|
|
500
|
+
type: "http",
|
|
501
|
+
scheme: "bearer",
|
|
502
|
+
bearerFormat: "SIWX",
|
|
503
|
+
description: "Sign-In With X wallet authentication. Agent signs a challenge with their wallet (any supported chain) and presents the proof in the Authorization header. Used for identity-gated free endpoints; payment-required endpoints declare x-payment-info instead."
|
|
499
504
|
};
|
|
500
505
|
}
|
|
501
506
|
function agentscoreDenialSchemas() {
|
|
@@ -568,6 +573,12 @@ function agentscorePaymentRequiredSchema() {
|
|
|
568
573
|
}
|
|
569
574
|
};
|
|
570
575
|
}
|
|
576
|
+
function xPaymentInfoExtension(input) {
|
|
577
|
+
return { "x-payment-info": { price: input.price, protocols: input.protocols } };
|
|
578
|
+
}
|
|
579
|
+
function xGuidanceExtension(text) {
|
|
580
|
+
return { "x-guidance": text };
|
|
581
|
+
}
|
|
571
582
|
function agentscoreOpenApiSnippets(opts = {}) {
|
|
572
583
|
const out = {};
|
|
573
584
|
if (opts.security !== false) {
|
|
@@ -589,6 +600,7 @@ var defaultDiscoveryPaths = /* @__PURE__ */ new Set([
|
|
|
589
600
|
"/skill.md",
|
|
590
601
|
"/SKILL.md",
|
|
591
602
|
"/.well-known/mpp.json",
|
|
603
|
+
"/.well-known/x402",
|
|
592
604
|
"/.well-known/agent-card.json",
|
|
593
605
|
"/.well-known/ucp",
|
|
594
606
|
"/favicon.png",
|
|
@@ -659,7 +671,7 @@ var applyNoindexHeader = wrapNoindexResponse;
|
|
|
659
671
|
var RAIL_CLIENTS = {
|
|
660
672
|
tempo_mpp: ["agentscore-pay", "tempo request", "x402-proxy"],
|
|
661
673
|
x402_base: ["agentscore-pay", "x402-proxy", "purl (omit --network flag)"],
|
|
662
|
-
|
|
674
|
+
solana_mpp: ["agentscore-pay"],
|
|
663
675
|
stripe: ["link-cli"]
|
|
664
676
|
};
|
|
665
677
|
function compatibleClientsByRails(rails2) {
|
|
@@ -672,13 +684,13 @@ function compatibleClientsByRails(rails2) {
|
|
|
672
684
|
var RAIL_LABELS = {
|
|
673
685
|
tempo_mpp: "MPP on Tempo",
|
|
674
686
|
x402_base: "x402 on Base",
|
|
675
|
-
|
|
687
|
+
solana_mpp: "MPP on Solana",
|
|
676
688
|
stripe: "Stripe Shared Payment Token"
|
|
677
689
|
};
|
|
678
690
|
var RAIL_NOTES = {
|
|
679
691
|
tempo_mpp: "USDC. Use `agentscore-pay --chain tempo` (or `tempo request`); MPP credential goes in `Authorization: Payment`.",
|
|
680
692
|
x402_base: "USDC (EIP-3009). Use `agentscore-pay`; X-Payment header carries the signed credential.",
|
|
681
|
-
|
|
693
|
+
solana_mpp: "USDC (SPL). Use `agentscore-pay --chain solana`; MPP credential goes in `Authorization: Payment`.",
|
|
682
694
|
stripe: "Card via Link wallet. Use `@stripe/link-cli` \u2014 `agentscore-pay` emits the handoff hint when this rail is picked."
|
|
683
695
|
};
|
|
684
696
|
var NAME_RE = /^[a-z0-9]+(-[a-z0-9]+)*$/;
|
|
@@ -863,6 +875,7 @@ function buildSkillMd(input) {
|
|
|
863
875
|
buildLlmsTxt,
|
|
864
876
|
buildSkillMd,
|
|
865
877
|
buildWellKnownMpp,
|
|
878
|
+
buildWellKnownX402,
|
|
866
879
|
compatibleClientsByRails,
|
|
867
880
|
createBazaarDiscovery,
|
|
868
881
|
defaultDiscoveryPaths,
|
|
@@ -874,6 +887,9 @@ function buildSkillMd(input) {
|
|
|
874
887
|
noindexNonDiscoveryPathsExpress,
|
|
875
888
|
noindexNonDiscoveryPathsFastify,
|
|
876
889
|
sampleX402AcceptForNetwork,
|
|
877
|
-
|
|
890
|
+
siwxSecurityScheme,
|
|
891
|
+
wrapNoindexResponse,
|
|
892
|
+
xGuidanceExtension,
|
|
893
|
+
xPaymentInfoExtension
|
|
878
894
|
});
|
|
879
895
|
//# sourceMappingURL=index.js.map
|