@devlab.group/agent-commerce 2.7.1 → 2.8.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 +72 -24
- package/dist/ap2.d.ts +3 -11
- package/dist/ap2.js +96 -27
- package/dist/ap2.js.map +1 -1
- package/dist/{chunk-77HLISG4.js → chunk-2PVRHMVT.js} +14 -10
- package/dist/chunk-2PVRHMVT.js.map +1 -0
- package/dist/chunk-ENK63GKR.js +22 -0
- package/dist/chunk-ENK63GKR.js.map +1 -0
- package/dist/{chunk-YHNTTMED.js → chunk-MDOGXTZD.js} +2 -2
- package/dist/chunk-MDOGXTZD.js.map +1 -0
- package/dist/chunk-MNI6APE6.js +64 -0
- package/dist/chunk-MNI6APE6.js.map +1 -0
- package/dist/{chunk-5VW32JPV.js → chunk-QZW5YL3G.js} +160 -41
- package/dist/chunk-QZW5YL3G.js.map +1 -0
- package/dist/{chunk-DJRWYDKJ.js → chunk-RXYGC7A3.js} +3 -3
- package/dist/{chunk-DJRWYDKJ.js.map → chunk-RXYGC7A3.js.map} +1 -1
- package/dist/{chunk-5AO5N2XY.js → chunk-VHS6MGXJ.js} +621 -4
- package/dist/chunk-VHS6MGXJ.js.map +1 -0
- package/dist/cli/{ap2-NTYL7H4I.js → ap2-GYKFGE66.js} +35 -8
- package/dist/cli/ap2-GYKFGE66.js.map +1 -0
- package/dist/cli/chunk-2PO65227.js +619 -0
- package/dist/cli/chunk-2PO65227.js.map +1 -0
- package/dist/cli/{chunk-GBBG66O6.js → chunk-3PGFOEVJ.js} +132 -103
- package/dist/cli/chunk-3PGFOEVJ.js.map +1 -0
- package/dist/cli/chunk-4YZULHX2.js +64 -0
- package/dist/cli/chunk-4YZULHX2.js.map +1 -0
- package/dist/cli/chunk-526C4KZA.js +93 -0
- package/dist/cli/chunk-526C4KZA.js.map +1 -0
- package/dist/cli/{chunk-FETTSOMT.js → chunk-5CH5VFC6.js} +139 -4
- package/dist/cli/chunk-5CH5VFC6.js.map +1 -0
- package/dist/cli/chunk-6BWEHQPJ.js +215 -0
- package/dist/cli/chunk-6BWEHQPJ.js.map +1 -0
- package/dist/cli/chunk-GISJ73ML.js +20 -0
- package/dist/cli/chunk-GISJ73ML.js.map +1 -0
- package/dist/cli/chunk-MASLG557.js +26 -0
- package/dist/cli/chunk-MASLG557.js.map +1 -0
- package/dist/cli/chunk-RQ7W3NA5.js +143 -0
- package/dist/cli/chunk-RQ7W3NA5.js.map +1 -0
- package/dist/cli/chunk-RWBUHDU7.js +48 -0
- package/dist/cli/chunk-RWBUHDU7.js.map +1 -0
- package/dist/cli/chunk-SAAT2XFX.js +8 -0
- package/dist/cli/{chunk-2M2RF3CT.js.map → chunk-SAAT2XFX.js.map} +1 -1
- package/dist/cli/{chunk-MBPOKPQM.js → chunk-SYXLQ5BS.js} +7 -5
- package/dist/cli/chunk-SYXLQ5BS.js.map +1 -0
- package/dist/cli/{chunk-FL4HPCD4.js → chunk-THH7Y3OO.js} +3 -35
- package/dist/cli/chunk-THH7Y3OO.js.map +1 -0
- package/dist/cli/{chunk-55AI6CLW.js → chunk-USIXWAXZ.js} +2 -2
- package/dist/cli/chunk-USIXWAXZ.js.map +1 -0
- package/dist/cli/{chunk-EVCIEKHN.js → chunk-VWQMSWDF.js} +141 -42
- package/dist/cli/chunk-VWQMSWDF.js.map +1 -0
- package/dist/cli/{chunk-OETKXDGA.js → chunk-WFIR374D.js} +89 -272
- package/dist/cli/chunk-WFIR374D.js.map +1 -0
- package/dist/cli/{chunk-A42BCWZ2.js → chunk-YXXPZFWC.js} +4 -4
- package/dist/cli/{chunk-A42BCWZ2.js.map → chunk-YXXPZFWC.js.map} +1 -1
- package/dist/cli/config-JWMHWVRT.js +14 -0
- package/dist/cli/{config-ODN4IEMZ.js.map → config-JWMHWVRT.js.map} +1 -1
- package/dist/cli/index.js +363 -84
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/{mcp-V27OKTOV.js → mcp-OW5GY7TT.js} +84 -45
- package/dist/cli/mcp-OW5GY7TT.js.map +1 -0
- package/dist/cli/payment-providers-QL2BJYMD.js +6 -0
- package/dist/cli/{payment-providers-SUATT75K.js.map → payment-providers-QL2BJYMD.js.map} +1 -1
- package/dist/cli/{provider-C3QDAXMR.js → provider-3A2LVEQS.js} +145 -23
- package/dist/cli/provider-3A2LVEQS.js.map +1 -0
- package/dist/cli/receipts-FQUFGEQD.js +9 -0
- package/dist/cli/{receipts-ZS3VZ2D4.js.map → receipts-FQUFGEQD.js.map} +1 -1
- package/dist/cli/{run-WYFZUO5D.js → run-KF5OQYPL.js} +97 -66
- package/dist/cli/run-KF5OQYPL.js.map +1 -0
- package/dist/cli/{x402-UGLZ3LA7.js → x402-5A7CVCIJ.js} +12 -8
- package/dist/cli/x402-5A7CVCIJ.js.map +1 -0
- package/dist/index.d.ts +36 -12
- package/dist/index.js +345 -397
- package/dist/index.js.map +1 -1
- package/dist/mcp.d.ts +2 -2
- package/dist/mcp.js +80 -42
- package/dist/mcp.js.map +1 -1
- package/dist/mpp.d.ts +3 -2
- package/dist/mpp.js +139 -20
- package/dist/mpp.js.map +1 -1
- package/dist/{protocol-adapter-DdFL5LBU.d.ts → protocol-adapter-D6JH_kk-.d.ts} +2 -2
- package/dist/{runtime-BmaSp2Ce.d.ts → runtime-D8u6lYfx.d.ts} +10 -0
- package/dist/{store-DQwbKhnc.d.ts → store-BzgwHOPu.d.ts} +2 -2
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/dist/{transaction-BXXJltZ-.d.ts → transaction-F9ZvhokH.d.ts} +1 -1
- package/dist/types-Dl27vhEc.d.ts +167 -0
- package/dist/x402.d.ts +7 -110
- package/dist/x402.js +6 -5
- package/dist/x402.js.map +1 -1
- package/package.json +3 -1
- package/dist/chunk-5AO5N2XY.js.map +0 -1
- package/dist/chunk-5VW32JPV.js.map +0 -1
- package/dist/chunk-77HLISG4.js.map +0 -1
- package/dist/chunk-IGXQMAKM.js +0 -8
- package/dist/chunk-IGXQMAKM.js.map +0 -1
- package/dist/chunk-YHNTTMED.js.map +0 -1
- package/dist/cli/ap2-NTYL7H4I.js.map +0 -1
- package/dist/cli/chunk-2M2RF3CT.js +0 -8
- package/dist/cli/chunk-3NVJAQRO.js +0 -119
- package/dist/cli/chunk-3NVJAQRO.js.map +0 -1
- package/dist/cli/chunk-55AI6CLW.js.map +0 -1
- package/dist/cli/chunk-66NTYSXI.js +0 -277
- package/dist/cli/chunk-66NTYSXI.js.map +0 -1
- package/dist/cli/chunk-EVCIEKHN.js.map +0 -1
- package/dist/cli/chunk-FETTSOMT.js.map +0 -1
- package/dist/cli/chunk-FL4HPCD4.js.map +0 -1
- package/dist/cli/chunk-GBBG66O6.js.map +0 -1
- package/dist/cli/chunk-H7EBJ4I3.js +0 -53
- package/dist/cli/chunk-H7EBJ4I3.js.map +0 -1
- package/dist/cli/chunk-MBPOKPQM.js.map +0 -1
- package/dist/cli/chunk-OETKXDGA.js.map +0 -1
- package/dist/cli/chunk-TPC4EJLT.js +0 -11
- package/dist/cli/chunk-TPC4EJLT.js.map +0 -1
- package/dist/cli/config-ODN4IEMZ.js +0 -13
- package/dist/cli/mcp-V27OKTOV.js.map +0 -1
- package/dist/cli/payment-providers-SUATT75K.js +0 -6
- package/dist/cli/provider-C3QDAXMR.js.map +0 -1
- package/dist/cli/receipts-ZS3VZ2D4.js +0 -9
- package/dist/cli/run-WYFZUO5D.js.map +0 -1
- package/dist/cli/x402-UGLZ3LA7.js.map +0 -1
- package/dist/networks-DDHYJLcg.d.ts +0 -39
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { createSqliteReceiptStore, openSqliteReceiptStoreReadOnly, readMissingLegacyImports } from './chunk-YXXPZFWC.js';
|
|
2
|
+
import './chunk-6EBDOH37.js';
|
|
3
|
+
import './chunk-APC5BTQM.js';
|
|
4
|
+
import './chunk-SAAT2XFX.js';
|
|
5
|
+
import './chunk-USIXWAXZ.js';
|
|
6
|
+
import './chunk-C5YISPT6.js';
|
|
7
|
+
import './chunk-3M6U7ILB.js';
|
|
8
|
+
//# sourceMappingURL=receipts-FQUFGEQD.js.map
|
|
9
|
+
//# sourceMappingURL=receipts-FQUFGEQD.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"receipts-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"receipts-FQUFGEQD.js"}
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
import { createConfiguredPaymentProviders, importOptionalPeer } from './chunk-
|
|
2
|
-
import {
|
|
3
|
-
import { A2A_DEFAULT_MOUNT_PATH, A2A_DEFAULT_AGENT_NAME,
|
|
4
|
-
import { loadConfig } from './chunk-
|
|
5
|
-
import { HttpBackendExecutor, createResourceRegistry, assertRetrySupport, createStoreEventSink, createExecutionPipeline, ACP_WELL_KNOWN_PATH,
|
|
1
|
+
import { createConfiguredPaymentProviders, importOptionalPeer } from './chunk-SYXLQ5BS.js';
|
|
2
|
+
import { settlementResponse, settlementResponseFromDetails, settlementFailure, x402ErrorCode, x402RefusalStatus } from './chunk-THH7Y3OO.js';
|
|
3
|
+
import { a2a_default, acp_default, A2A_DEFAULT_MOUNT_PATH, A2A_DEFAULT_AGENT_NAME, A2A_AGENT_CARD_PATH, A2A_JSON_MEDIA_TYPE, A2A_VERSION_HEADER, A2A_PROTOCOL_VERSION, A2A_EXTENSIONS_HEADER, A2A_PUSH_CONFIG_METHODS, A2A_TASK_LOOKUP_METHODS, A2A_UNSUPPORTED_METHODS, A2A_METHOD_SEND_MESSAGE, A2A_SPEC_VERSION, A2A_PROTOCOL_BINDING, A2A_TASK_STATE_FAILED, A2A_TASK_STATE_COMPLETED, A2A_TASK_STATE_INPUT_REQUIRED } from './chunk-6BWEHQPJ.js';
|
|
4
|
+
import { loadConfig } from './chunk-3PGFOEVJ.js';
|
|
5
|
+
import { ACP_CHECKOUT_OPERATIONS, HttpBackendExecutor, createResourceRegistry, assertRetrySupport, createStoreEventSink, createExecutionPipeline, ACP_WELL_KNOWN_PATH, ACP_IN_FLIGHT_RETRY_AFTER_SECONDS, ACP_IDEMPOTENT_REPLAYED_HEADER, ACP_IDEMPOTENCY_KEY_HEADER, ACP_REQUEST_ID_HEADER, ACP_SPEC_VERSION, ACP_JSON_MEDIA_TYPE, ACP_API_VERSION, ACP_API_VERSION_HEADER, ACP_MAX_REQUEST_ID_LENGTH, ACP_OPERATION_INPUT_KEYS, ACP_OPERATION_OPTIONAL_INPUT_KEYS, ACP_SESSION_ID_INPUT_KEY, ACP_FORWARDED_HEADERS, ACP_MAX_FORWARDED_HEADER_LENGTH, BackendErrorResponse, ACP_MERCHANT_RETRY_AFTER_DEFAULT_SECONDS, ACP_MERCHANT_RETRY_AFTER_MAX_SECONDS } from './chunk-WFIR374D.js';
|
|
6
6
|
import { hasMethodGroup } from './chunk-DKWO6LLX.js';
|
|
7
|
-
import './chunk-
|
|
8
|
-
import { createSqliteReceiptStore } from './chunk-
|
|
7
|
+
import { readCappedBody, createBearerCheck, joinUrl } from './chunk-RWBUHDU7.js';
|
|
8
|
+
import { createSqliteReceiptStore } from './chunk-YXXPZFWC.js';
|
|
9
9
|
import { openSqliteDatabase } from './chunk-6EBDOH37.js';
|
|
10
10
|
import { PAYMENT_KEY_ENDPOINT_PREFIX } from './chunk-APC5BTQM.js';
|
|
11
11
|
import { resolveManually, journalOf } from './chunk-VSSSU4AU.js';
|
|
12
12
|
import { contentDigest, CONTENT_DIGEST_METADATA_KEY, mppProblem, mppProblemDetail } from './chunk-3IEXJ7I3.js';
|
|
13
13
|
import { MPP_DEFAULT_PAYMENT_FLOW, MPP_PROFILE } from './chunk-AA3FIEAR.js';
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
14
|
+
import { x402_default } from './chunk-RQ7W3NA5.js';
|
|
15
|
+
import { exclusionNames, featureStatus, descriptorStatus } from './chunk-GISJ73ML.js';
|
|
16
|
+
import { x402OfferName } from './chunk-5CH5VFC6.js';
|
|
17
|
+
import { exampleObject } from './chunk-4YZULHX2.js';
|
|
18
|
+
import { X402_DEFAULT_PAYMENT_FLOW, resolveDeploymentMode, requireX402Network } from './chunk-2PO65227.js';
|
|
19
|
+
import { PACKAGE_VERSION } from './chunk-SAAT2XFX.js';
|
|
20
|
+
import { PAYMENT_HEADER, AUTHORIZATION_HEADER, systemClock, extractReservedInputFields, isHttpProtocolAdapter, toErrorEnvelope, DELIVERY_SUMMARY_META_KEY, toDeliverySummary, toPaymentRequiredEnvelope, NOOP_LOGGER, parseAuthorizationHeader, PAYMENT_REQUIRED_HEADER, PAYMENT_RESPONSE_HEADER, PAYMENT_INPUT_FIELD, AUTHORIZATION_INPUT_FIELD, parseAuthorizationSubmission, TRANSACTION_STATES } from './chunk-USIXWAXZ.js';
|
|
18
21
|
import { CommerceError, isCommerceError, toLogInfo, toCommerceError } from './chunk-C5YISPT6.js';
|
|
19
22
|
import { isRecord } from './chunk-3M6U7ILB.js';
|
|
20
23
|
import { createHash, randomUUID } from 'crypto';
|
|
@@ -449,42 +452,6 @@ function skillDescription(resource) {
|
|
|
449
452
|
}
|
|
450
453
|
return base;
|
|
451
454
|
}
|
|
452
|
-
function exampleValue(schema, name) {
|
|
453
|
-
if (!isRecord(schema)) return `<${name}>`;
|
|
454
|
-
const examples = schema["examples"];
|
|
455
|
-
if (Array.isArray(examples) && examples.length > 0) return examples[0];
|
|
456
|
-
if (schema["default"] !== void 0) return schema["default"];
|
|
457
|
-
const allowed = schema["enum"];
|
|
458
|
-
if (Array.isArray(allowed) && allowed.length > 0) return allowed[0];
|
|
459
|
-
const declared = schema["type"];
|
|
460
|
-
const type = Array.isArray(declared) ? declared[0] : declared;
|
|
461
|
-
switch (type) {
|
|
462
|
-
case "object":
|
|
463
|
-
return exampleObject(schema);
|
|
464
|
-
case "array":
|
|
465
|
-
return schema["items"] !== void 0 ? [exampleValue(schema["items"], name)] : [];
|
|
466
|
-
case "number":
|
|
467
|
-
case "integer":
|
|
468
|
-
return 0;
|
|
469
|
-
case "boolean":
|
|
470
|
-
return false;
|
|
471
|
-
case "null":
|
|
472
|
-
return null;
|
|
473
|
-
default:
|
|
474
|
-
return `<${name}>`;
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
function exampleObject(schema) {
|
|
478
|
-
const properties = isRecord(schema["properties"]) ? schema["properties"] : {};
|
|
479
|
-
const required = Array.isArray(schema["required"]) ? schema["required"] : [];
|
|
480
|
-
const example = {};
|
|
481
|
-
for (const key of required) {
|
|
482
|
-
if (typeof key !== "string" || key === PAYMENT_INPUT_FIELD || key === AUTHORIZATION_INPUT_FIELD)
|
|
483
|
-
continue;
|
|
484
|
-
example[key] = exampleValue(properties[key], key);
|
|
485
|
-
}
|
|
486
|
-
return example;
|
|
487
|
-
}
|
|
488
455
|
function skillExample(resource) {
|
|
489
456
|
return JSON.stringify({
|
|
490
457
|
resource: resource.id,
|
|
@@ -543,6 +510,27 @@ function buildAgentCard(options) {
|
|
|
543
510
|
};
|
|
544
511
|
}
|
|
545
512
|
|
|
513
|
+
// src/protocols/a2a/descriptor.ts
|
|
514
|
+
var A2A_CAPABILITIES = [
|
|
515
|
+
"agent-card",
|
|
516
|
+
"jsonrpc",
|
|
517
|
+
"SendMessage",
|
|
518
|
+
// The x402 A2A transport, opt-in per request
|
|
519
|
+
"x402-extension"
|
|
520
|
+
];
|
|
521
|
+
var A2A_UNSUPPORTED = exclusionNames(a2a_default);
|
|
522
|
+
function buildDescriptor(implementationVersion) {
|
|
523
|
+
return {
|
|
524
|
+
name: "a2a",
|
|
525
|
+
kind: "protocol",
|
|
526
|
+
implementationVersion,
|
|
527
|
+
supportedSpec: A2A_SPEC_VERSION,
|
|
528
|
+
capabilities: A2A_CAPABILITIES,
|
|
529
|
+
status: descriptorStatus(a2a_default),
|
|
530
|
+
unsupported: A2A_UNSUPPORTED
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
|
|
546
534
|
// src/protocols/a2a/task-mapping.ts
|
|
547
535
|
function dataPayload(body) {
|
|
548
536
|
return isRecord(body) ? body : { value: body ?? null };
|
|
@@ -1115,6 +1103,30 @@ function canonicalInput(request) {
|
|
|
1115
1103
|
return input;
|
|
1116
1104
|
}
|
|
1117
1105
|
|
|
1106
|
+
// src/protocols/acp/descriptor.ts
|
|
1107
|
+
var ACP_CAPABILITIES = [
|
|
1108
|
+
"rest transport",
|
|
1109
|
+
"well-known discovery",
|
|
1110
|
+
"bearer authentication",
|
|
1111
|
+
"API-Version enforcement",
|
|
1112
|
+
// Forwarded as received: the gateway verifies neither signature header
|
|
1113
|
+
"request header forwarding to the merchant",
|
|
1114
|
+
"checkout service",
|
|
1115
|
+
...ACP_CHECKOUT_OPERATIONS
|
|
1116
|
+
];
|
|
1117
|
+
var ACP_UNSUPPORTED = exclusionNames(acp_default);
|
|
1118
|
+
function buildDescriptor2(implementationVersion) {
|
|
1119
|
+
return {
|
|
1120
|
+
name: "acp",
|
|
1121
|
+
kind: "protocol",
|
|
1122
|
+
implementationVersion,
|
|
1123
|
+
supportedSpec: ACP_SPEC_VERSION,
|
|
1124
|
+
capabilities: ACP_CAPABILITIES,
|
|
1125
|
+
status: descriptorStatus(acp_default),
|
|
1126
|
+
unsupported: ACP_UNSUPPORTED
|
|
1127
|
+
};
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1118
1130
|
// src/protocols/acp/discovery.ts
|
|
1119
1131
|
function buildAcpDiscoveryDocument(options) {
|
|
1120
1132
|
const metadata = options.metadata ?? {};
|
|
@@ -6300,6 +6312,7 @@ function wrapPino(instance) {
|
|
|
6300
6312
|
}
|
|
6301
6313
|
|
|
6302
6314
|
// src/gateway/access-control.ts
|
|
6315
|
+
var HEALTH_PATH = "/health";
|
|
6303
6316
|
var CORS_METHODS = "GET,POST,OPTIONS";
|
|
6304
6317
|
var CORS_HEADERS = [
|
|
6305
6318
|
"content-type",
|
|
@@ -6333,8 +6346,9 @@ function buildAccessControlHook(options) {
|
|
|
6333
6346
|
const allowedOrigins = new Set(options.allowedOrigins.map((origin) => origin.toLowerCase()));
|
|
6334
6347
|
const publicHostname = hostnameOf(options.publicBaseUrl);
|
|
6335
6348
|
return async (request, reply) => {
|
|
6336
|
-
const
|
|
6337
|
-
|
|
6349
|
+
const route = request.routeOptions;
|
|
6350
|
+
const isHealthProbe = route.url === HEALTH_PATH && (route.method === "GET" || route.method === "HEAD");
|
|
6351
|
+
if (!isHealthProbe && !isAllowedHost(request.headers.host, publicHostname)) {
|
|
6338
6352
|
reply.status(403).send({ status: "error", code: "FORBIDDEN", message: "Host not allowed" });
|
|
6339
6353
|
return;
|
|
6340
6354
|
}
|
|
@@ -6740,6 +6754,7 @@ function createReadinessProbe(options, ttlMs = READINESS_TTL_MS) {
|
|
|
6740
6754
|
|
|
6741
6755
|
// src/gateway/well-known.ts
|
|
6742
6756
|
var GATEWAY_SUPPORTED_SPEC = "agent-commerce/v1.0.0";
|
|
6757
|
+
var QUOTE_STATUS = featureStatus(x402_default, "erc-8409-quotes");
|
|
6743
6758
|
function publicHealth(health) {
|
|
6744
6759
|
const { detail: _detail, ...rest } = health;
|
|
6745
6760
|
return rest;
|
|
@@ -6752,9 +6767,15 @@ function publicProtocols(protocols) {
|
|
|
6752
6767
|
acp: { enabled: protocols.acp.enabled, mountPath: protocols.acp.mountPath }
|
|
6753
6768
|
};
|
|
6754
6769
|
}
|
|
6755
|
-
function
|
|
6770
|
+
function offerHealth(health, offer) {
|
|
6771
|
+
const name = x402OfferName(offer);
|
|
6772
|
+
const component = health?.components?.find((candidate) => candidate.name === name);
|
|
6773
|
+
if (component === void 0) return {};
|
|
6774
|
+
const { status, undetermined } = component;
|
|
6775
|
+
return { status, ...undetermined !== void 0 ? { undetermined } : {} };
|
|
6776
|
+
}
|
|
6777
|
+
function publicOffer(option, health) {
|
|
6756
6778
|
const { network, asset, assetName, assetVersion, assetDecimals, payTo, assetTransferMethod } = option;
|
|
6757
|
-
const status = statuses.get(x402OfferName(option));
|
|
6758
6779
|
return {
|
|
6759
6780
|
network,
|
|
6760
6781
|
asset,
|
|
@@ -6763,7 +6784,7 @@ function publicOffer(option, statuses) {
|
|
|
6763
6784
|
assetDecimals,
|
|
6764
6785
|
payTo,
|
|
6765
6786
|
...assetTransferMethod !== void 0 ? { assetTransferMethod } : {},
|
|
6766
|
-
...
|
|
6787
|
+
...offerHealth(health, option)
|
|
6767
6788
|
};
|
|
6768
6789
|
}
|
|
6769
6790
|
function flowOverrides(flows) {
|
|
@@ -6773,7 +6794,7 @@ function publicQuote(providers) {
|
|
|
6773
6794
|
const x402 = providers.find((provider) => provider.name === "x402");
|
|
6774
6795
|
if (x402?.quote === void 0) return void 0;
|
|
6775
6796
|
const { issuer, requestScheme, extension } = x402.quote;
|
|
6776
|
-
return { issuer, requestScheme, extension, status:
|
|
6797
|
+
return { issuer, requestScheme, extension, status: QUOTE_STATUS };
|
|
6777
6798
|
}
|
|
6778
6799
|
function buildWellKnownDocument(options) {
|
|
6779
6800
|
const adapters = options.adapters.map(({ descriptor, health }) => ({
|
|
@@ -6781,10 +6802,9 @@ function buildWellKnownDocument(options) {
|
|
|
6781
6802
|
health: publicHealth(health)
|
|
6782
6803
|
}));
|
|
6783
6804
|
const { x402, mpp } = options.config.payments;
|
|
6784
|
-
const
|
|
6785
|
-
const
|
|
6786
|
-
|
|
6787
|
-
);
|
|
6805
|
+
const probed = (name) => options.paymentHealth?.find((provider) => provider.name === name)?.health;
|
|
6806
|
+
const x402Health = probed("x402");
|
|
6807
|
+
const x402Options = x402?.options !== void 0 && x402.options.length > 1 ? x402.options : [];
|
|
6788
6808
|
const quote = publicQuote(options.paymentProviders);
|
|
6789
6809
|
return {
|
|
6790
6810
|
gateway: {
|
|
@@ -6817,12 +6837,12 @@ function buildWellKnownDocument(options) {
|
|
|
6817
6837
|
),
|
|
6818
6838
|
paymentFlow: x402.paymentFlow ?? X402_DEFAULT_PAYMENT_FLOW,
|
|
6819
6839
|
...flowOverrides(x402.resourcePaymentFlows),
|
|
6820
|
-
...
|
|
6840
|
+
...x402Options.length > 0 ? { options: x402Options.map((option) => publicOffer(option, x402Health)) } : offerHealth(x402Health, x402),
|
|
6821
6841
|
...x402.resourceOptions !== void 0 ? {
|
|
6822
6842
|
resourceOptions: Object.fromEntries(
|
|
6823
6843
|
Object.entries(x402.resourceOptions).map(([id, list]) => [
|
|
6824
6844
|
id,
|
|
6825
|
-
list.map((option) => publicOffer(option,
|
|
6845
|
+
list.map((option) => publicOffer(option, x402Health))
|
|
6826
6846
|
])
|
|
6827
6847
|
)
|
|
6828
6848
|
} : {},
|
|
@@ -6841,7 +6861,13 @@ function buildWellKnownDocument(options) {
|
|
|
6841
6861
|
facilitator: { mode: mpp.facilitator.mode },
|
|
6842
6862
|
mode: resolveDeploymentMode(requireX402Network(mpp.network, "payments.mpp.network")),
|
|
6843
6863
|
paymentFlow: mpp.paymentFlow ?? MPP_DEFAULT_PAYMENT_FLOW,
|
|
6844
|
-
...flowOverrides(mpp.resourcePaymentFlows)
|
|
6864
|
+
...flowOverrides(mpp.resourcePaymentFlows),
|
|
6865
|
+
// MPP settles through an x402 provider, which names the offer
|
|
6866
|
+
...offerHealth(probed("mpp"), {
|
|
6867
|
+
network: mpp.network,
|
|
6868
|
+
asset: mpp.asset,
|
|
6869
|
+
payTo: mpp.recipient
|
|
6870
|
+
})
|
|
6845
6871
|
}
|
|
6846
6872
|
} : {}
|
|
6847
6873
|
}
|
|
@@ -6869,7 +6895,7 @@ function registerRoutes(options) {
|
|
|
6869
6895
|
clock: options.clock,
|
|
6870
6896
|
logger: options.logger
|
|
6871
6897
|
});
|
|
6872
|
-
server.get(
|
|
6898
|
+
server.get(HEALTH_PATH, async () => ({ status: "ok" }));
|
|
6873
6899
|
server.get("/ready", async (_request, reply) => {
|
|
6874
6900
|
const readiness = await readinessProbe.check();
|
|
6875
6901
|
reply.status(readiness.ready ? 200 : 503);
|
|
@@ -7445,9 +7471,9 @@ async function runGateway(options = {}) {
|
|
|
7445
7471
|
const { core: logger } = createGatewayLogger({ name: config.merchant.id });
|
|
7446
7472
|
const paymentProviders = await createConfiguredPaymentProviders(config.payments, logger);
|
|
7447
7473
|
const ap2 = config.authorization?.ap2;
|
|
7448
|
-
const ap2Module = ap2?.enabled ? await importOptionalPeer("authorization.ap2", () => import('./ap2-
|
|
7474
|
+
const ap2Module = ap2?.enabled ? await importOptionalPeer("authorization.ap2", () => import('./ap2-GYKFGE66.js')) : void 0;
|
|
7449
7475
|
const mcp = config.protocols.mcp;
|
|
7450
|
-
const mcpModule = mcp.enabled ? await importOptionalPeer("protocols.mcp", () => import('./mcp-
|
|
7476
|
+
const mcpModule = mcp.enabled ? await importOptionalPeer("protocols.mcp", () => import('./mcp-OW5GY7TT.js')) : void 0;
|
|
7451
7477
|
const acp = config.protocols.acp;
|
|
7452
7478
|
const ap2Replay = ap2?.enabled ? ap2.replay?.path : void 0;
|
|
7453
7479
|
const acpIdempotency = acp.enabled ? acp.idempotency.path : void 0;
|
|
@@ -7485,7 +7511,12 @@ async function runGateway(options = {}) {
|
|
|
7485
7511
|
}
|
|
7486
7512
|
const protocolAdapters = [];
|
|
7487
7513
|
if (mcpModule !== void 0) {
|
|
7488
|
-
protocolAdapters.push(
|
|
7514
|
+
protocolAdapters.push(
|
|
7515
|
+
mcpModule.createMcpAdapter({
|
|
7516
|
+
mountPath: mcp.mountPath,
|
|
7517
|
+
...mcp.registry !== void 0 ? { serverName: mcp.registry.name, serverVersion: mcp.registry.version } : {}
|
|
7518
|
+
})
|
|
7519
|
+
);
|
|
7489
7520
|
}
|
|
7490
7521
|
if (config.protocols.a2a.enabled) {
|
|
7491
7522
|
protocolAdapters.push(
|
|
@@ -7597,5 +7628,5 @@ function printStartupError(error) {
|
|
|
7597
7628
|
}
|
|
7598
7629
|
|
|
7599
7630
|
export { printStartupError, runGateway };
|
|
7600
|
-
//# sourceMappingURL=run-
|
|
7601
|
-
//# sourceMappingURL=run-
|
|
7631
|
+
//# sourceMappingURL=run-KF5OQYPL.js.map
|
|
7632
|
+
//# sourceMappingURL=run-KF5OQYPL.js.map
|