@devlab.group/agent-commerce 2.7.2 → 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 +71 -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-XXHC6AA3.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-O3HJSS2E.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-B4QJV7OC.js.map → chunk-SAAT2XFX.js.map} +1 -1
- package/dist/cli/{chunk-S5TQXKQ7.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-QUFFT5K3.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-XRG5UTIC.js → chunk-YXXPZFWC.js} +4 -4
- package/dist/cli/{chunk-XRG5UTIC.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 +349 -78
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/{mcp-G2D2Z77G.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-7RIIZ5OF.js.map → payment-providers-QL2BJYMD.js.map} +1 -1
- package/dist/cli/{provider-ARV3VAQ7.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-HLQ7D722.js.map → receipts-FQUFGEQD.js.map} +1 -1
- package/dist/cli/{run-BHODKC6H.js → run-KF5OQYPL.js} +92 -63
- package/dist/cli/run-KF5OQYPL.js.map +1 -0
- package/dist/cli/{x402-LHW2YQ6W.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 +340 -394
- 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-2573DASO.js +0 -8
- package/dist/chunk-2573DASO.js.map +0 -1
- package/dist/chunk-5AO5N2XY.js.map +0 -1
- package/dist/chunk-77HLISG4.js.map +0 -1
- package/dist/chunk-XXHC6AA3.js.map +0 -1
- package/dist/chunk-YHNTTMED.js.map +0 -1
- package/dist/cli/ap2-O3HJSS2E.js.map +0 -1
- 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-B4QJV7OC.js +0 -8
- 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-OETKXDGA.js.map +0 -1
- package/dist/cli/chunk-QUFFT5K3.js.map +0 -1
- package/dist/cli/chunk-S5TQXKQ7.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-G2D2Z77G.js.map +0 -1
- package/dist/cli/payment-providers-7RIIZ5OF.js +0 -6
- package/dist/cli/provider-ARV3VAQ7.js.map +0 -1
- package/dist/cli/receipts-HLQ7D722.js +0 -9
- package/dist/cli/run-BHODKC6H.js.map +0 -1
- package/dist/cli/x402-LHW2YQ6W.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 ?? {};
|
|
@@ -6742,6 +6754,7 @@ function createReadinessProbe(options, ttlMs = READINESS_TTL_MS) {
|
|
|
6742
6754
|
|
|
6743
6755
|
// src/gateway/well-known.ts
|
|
6744
6756
|
var GATEWAY_SUPPORTED_SPEC = "agent-commerce/v1.0.0";
|
|
6757
|
+
var QUOTE_STATUS = featureStatus(x402_default, "erc-8409-quotes");
|
|
6745
6758
|
function publicHealth(health) {
|
|
6746
6759
|
const { detail: _detail, ...rest } = health;
|
|
6747
6760
|
return rest;
|
|
@@ -6754,9 +6767,15 @@ function publicProtocols(protocols) {
|
|
|
6754
6767
|
acp: { enabled: protocols.acp.enabled, mountPath: protocols.acp.mountPath }
|
|
6755
6768
|
};
|
|
6756
6769
|
}
|
|
6757
|
-
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) {
|
|
6758
6778
|
const { network, asset, assetName, assetVersion, assetDecimals, payTo, assetTransferMethod } = option;
|
|
6759
|
-
const status = statuses.get(x402OfferName(option));
|
|
6760
6779
|
return {
|
|
6761
6780
|
network,
|
|
6762
6781
|
asset,
|
|
@@ -6765,7 +6784,7 @@ function publicOffer(option, statuses) {
|
|
|
6765
6784
|
assetDecimals,
|
|
6766
6785
|
payTo,
|
|
6767
6786
|
...assetTransferMethod !== void 0 ? { assetTransferMethod } : {},
|
|
6768
|
-
...
|
|
6787
|
+
...offerHealth(health, option)
|
|
6769
6788
|
};
|
|
6770
6789
|
}
|
|
6771
6790
|
function flowOverrides(flows) {
|
|
@@ -6775,7 +6794,7 @@ function publicQuote(providers) {
|
|
|
6775
6794
|
const x402 = providers.find((provider) => provider.name === "x402");
|
|
6776
6795
|
if (x402?.quote === void 0) return void 0;
|
|
6777
6796
|
const { issuer, requestScheme, extension } = x402.quote;
|
|
6778
|
-
return { issuer, requestScheme, extension, status:
|
|
6797
|
+
return { issuer, requestScheme, extension, status: QUOTE_STATUS };
|
|
6779
6798
|
}
|
|
6780
6799
|
function buildWellKnownDocument(options) {
|
|
6781
6800
|
const adapters = options.adapters.map(({ descriptor, health }) => ({
|
|
@@ -6783,10 +6802,9 @@ function buildWellKnownDocument(options) {
|
|
|
6783
6802
|
health: publicHealth(health)
|
|
6784
6803
|
}));
|
|
6785
6804
|
const { x402, mpp } = options.config.payments;
|
|
6786
|
-
const
|
|
6787
|
-
const
|
|
6788
|
-
|
|
6789
|
-
);
|
|
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 : [];
|
|
6790
6808
|
const quote = publicQuote(options.paymentProviders);
|
|
6791
6809
|
return {
|
|
6792
6810
|
gateway: {
|
|
@@ -6819,12 +6837,12 @@ function buildWellKnownDocument(options) {
|
|
|
6819
6837
|
),
|
|
6820
6838
|
paymentFlow: x402.paymentFlow ?? X402_DEFAULT_PAYMENT_FLOW,
|
|
6821
6839
|
...flowOverrides(x402.resourcePaymentFlows),
|
|
6822
|
-
...
|
|
6840
|
+
...x402Options.length > 0 ? { options: x402Options.map((option) => publicOffer(option, x402Health)) } : offerHealth(x402Health, x402),
|
|
6823
6841
|
...x402.resourceOptions !== void 0 ? {
|
|
6824
6842
|
resourceOptions: Object.fromEntries(
|
|
6825
6843
|
Object.entries(x402.resourceOptions).map(([id, list]) => [
|
|
6826
6844
|
id,
|
|
6827
|
-
list.map((option) => publicOffer(option,
|
|
6845
|
+
list.map((option) => publicOffer(option, x402Health))
|
|
6828
6846
|
])
|
|
6829
6847
|
)
|
|
6830
6848
|
} : {},
|
|
@@ -6843,7 +6861,13 @@ function buildWellKnownDocument(options) {
|
|
|
6843
6861
|
facilitator: { mode: mpp.facilitator.mode },
|
|
6844
6862
|
mode: resolveDeploymentMode(requireX402Network(mpp.network, "payments.mpp.network")),
|
|
6845
6863
|
paymentFlow: mpp.paymentFlow ?? MPP_DEFAULT_PAYMENT_FLOW,
|
|
6846
|
-
...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
|
+
})
|
|
6847
6871
|
}
|
|
6848
6872
|
} : {}
|
|
6849
6873
|
}
|
|
@@ -7447,9 +7471,9 @@ async function runGateway(options = {}) {
|
|
|
7447
7471
|
const { core: logger } = createGatewayLogger({ name: config.merchant.id });
|
|
7448
7472
|
const paymentProviders = await createConfiguredPaymentProviders(config.payments, logger);
|
|
7449
7473
|
const ap2 = config.authorization?.ap2;
|
|
7450
|
-
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;
|
|
7451
7475
|
const mcp = config.protocols.mcp;
|
|
7452
|
-
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;
|
|
7453
7477
|
const acp = config.protocols.acp;
|
|
7454
7478
|
const ap2Replay = ap2?.enabled ? ap2.replay?.path : void 0;
|
|
7455
7479
|
const acpIdempotency = acp.enabled ? acp.idempotency.path : void 0;
|
|
@@ -7487,7 +7511,12 @@ async function runGateway(options = {}) {
|
|
|
7487
7511
|
}
|
|
7488
7512
|
const protocolAdapters = [];
|
|
7489
7513
|
if (mcpModule !== void 0) {
|
|
7490
|
-
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
|
+
);
|
|
7491
7520
|
}
|
|
7492
7521
|
if (config.protocols.a2a.enabled) {
|
|
7493
7522
|
protocolAdapters.push(
|
|
@@ -7599,5 +7628,5 @@ function printStartupError(error) {
|
|
|
7599
7628
|
}
|
|
7600
7629
|
|
|
7601
7630
|
export { printStartupError, runGateway };
|
|
7602
|
-
//# sourceMappingURL=run-
|
|
7603
|
-
//# sourceMappingURL=run-
|
|
7631
|
+
//# sourceMappingURL=run-KF5OQYPL.js.map
|
|
7632
|
+
//# sourceMappingURL=run-KF5OQYPL.js.map
|