x402-surface-check 0.2.6 → 0.2.7
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/bin/x402-surface-check.mjs +19 -1
- package/package.json +1 -1
|
@@ -365,6 +365,24 @@ function valueList(value) {
|
|
|
365
365
|
return []
|
|
366
366
|
}
|
|
367
367
|
|
|
368
|
+
function displayMetadataValue(value) {
|
|
369
|
+
if (value === null || value === undefined || value === '') return '-'
|
|
370
|
+
if (Array.isArray(value)) {
|
|
371
|
+
return value.map(displayMetadataValue).filter(item => item && item !== '-').join(', ') || '-'
|
|
372
|
+
}
|
|
373
|
+
if (typeof value === 'object') {
|
|
374
|
+
const parts = [
|
|
375
|
+
value.name,
|
|
376
|
+
value.operator,
|
|
377
|
+
value.url,
|
|
378
|
+
value.jurisdiction,
|
|
379
|
+
value.network,
|
|
380
|
+
].filter(item => item !== null && item !== undefined && item !== '').map(String)
|
|
381
|
+
return parts.join(' / ') || Object.keys(value).join(', ') || '-'
|
|
382
|
+
}
|
|
383
|
+
return String(value)
|
|
384
|
+
}
|
|
385
|
+
|
|
368
386
|
function capabilityList(value) {
|
|
369
387
|
if (!Array.isArray(value)) return []
|
|
370
388
|
return value.map(item => item?.id ?? item?.name ?? item).filter(Boolean).map(String)
|
|
@@ -520,7 +538,7 @@ function formatMarkdown(report) {
|
|
|
520
538
|
`- Type: ${report.directEndpoint ? 'direct endpoint' : (document.openapi ? 'OpenAPI' : 'x402 manifest or JSON document')}`,
|
|
521
539
|
`- Agent: ${document.agent?.name ?? '-'}`,
|
|
522
540
|
`- Wallet: ${document.agent?.wallet ?? '-'}`,
|
|
523
|
-
`- Facilitator: ${document.facilitator
|
|
541
|
+
`- Facilitator: ${displayMetadataValue(document.facilitator)}`,
|
|
524
542
|
`- Networks: ${valueList(document.networks).join(', ') || '-'}`,
|
|
525
543
|
`- Capabilities: ${capabilityList(document.capabilities).join(', ') || '-'}`,
|
|
526
544
|
`- Probed endpoints: ${report.entries.length}`,
|