ashlar-blue 1.0.0 → 1.0.1
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 +1 -1
- package/cli.js +76 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
## Overview
|
|
13
13
|
|
|
14
|
-
**Ashlar Blue
|
|
14
|
+
**Ashlar Blue™** is an institutional clearinghouse and attested settlement platform providing deterministic, non-custodial clearing across modern blockchain and financial rails.
|
|
15
15
|
|
|
16
16
|
This package provides direct access to the Ashlar Blue ecosystem and re-exports `@ashlar-blue/x402-trust`.
|
|
17
17
|
|
package/cli.js
CHANGED
|
@@ -4,6 +4,14 @@
|
|
|
4
4
|
* Documentation: https://ashlar.blue • Corrente Labs, Inc.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import * as fs from 'node:fs';
|
|
8
|
+
import * as path from 'node:path';
|
|
9
|
+
import {
|
|
10
|
+
checkService,
|
|
11
|
+
verifyReceipt,
|
|
12
|
+
startStdioMcpServer,
|
|
13
|
+
} from '@ashlar-blue/x402-trust';
|
|
14
|
+
|
|
7
15
|
const args = process.argv.slice(2);
|
|
8
16
|
const command = args[0] || 'info';
|
|
9
17
|
|
|
@@ -31,8 +39,11 @@ Usage:
|
|
|
31
39
|
npx ashlar-blue <command> [options]
|
|
32
40
|
|
|
33
41
|
Commands:
|
|
34
|
-
info
|
|
35
|
-
|
|
42
|
+
info Display Ashlar Blue settlement rails and attestation status
|
|
43
|
+
check <domain> Pre-flight discovery & attestation trust check
|
|
44
|
+
verify <receipt.json> Verify an offline Merkle receipt proof (RFC 6962)
|
|
45
|
+
mcp Start standalone stdio Model Context Protocol (MCP) server
|
|
46
|
+
version Display version
|
|
36
47
|
|
|
37
48
|
Documentation:
|
|
38
49
|
https://ashlar.blue
|
|
@@ -51,6 +62,69 @@ switch (command) {
|
|
|
51
62
|
console.log(' Portal: https://ashlar.blue\n');
|
|
52
63
|
break;
|
|
53
64
|
}
|
|
65
|
+
case 'check': {
|
|
66
|
+
const domain = args[1];
|
|
67
|
+
if (!domain) {
|
|
68
|
+
console.error('Error: Domain required. Usage: npx ashlar-blue check <domain>');
|
|
69
|
+
process.exit(1);
|
|
70
|
+
}
|
|
71
|
+
console.log(`Checking x402 trust for: ${domain}...`);
|
|
72
|
+
try {
|
|
73
|
+
const trust = await checkService(domain);
|
|
74
|
+
console.log('\nResult:');
|
|
75
|
+
console.log(` Domain: ${trust.domain}`);
|
|
76
|
+
console.log(` Reachable: ${trust.reachable ? 'YES' : 'NO'}`);
|
|
77
|
+
console.log(` Discoverable: ${trust.discoverable ? 'YES' : 'NO'}${trust.via ? ` (via ${trust.via})` : ''}`);
|
|
78
|
+
console.log(` Attested: ${trust.attested ? 'YES' : 'NO'}`);
|
|
79
|
+
console.log(` Attestation Checkable: ${trust.attestationCheckable ? 'YES' : 'NO'}`);
|
|
80
|
+
console.log(` Safe to Pay: ${trust.safeToPay ? '✅ YES' : '❌ NO'}`);
|
|
81
|
+
if (trust.reasons && trust.reasons.length > 0) {
|
|
82
|
+
console.log('\nReasons:');
|
|
83
|
+
for (const r of trust.reasons) {
|
|
84
|
+
console.log(` • ${r}`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (trust.warnings && trust.warnings.length > 0) {
|
|
88
|
+
console.log('\nWarnings:');
|
|
89
|
+
for (const w of trust.warnings) {
|
|
90
|
+
console.log(` ⚠️ ${w}`);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
process.exit(trust.safeToPay ? 0 : 2);
|
|
94
|
+
} catch (err) {
|
|
95
|
+
console.error(`Check failed: ${err.message}`);
|
|
96
|
+
process.exit(1);
|
|
97
|
+
}
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
case 'verify': {
|
|
101
|
+
const receiptPath = args[1];
|
|
102
|
+
if (!receiptPath) {
|
|
103
|
+
console.error('Error: Receipt file required. Usage: npx ashlar-blue verify <receipt.json>');
|
|
104
|
+
process.exit(1);
|
|
105
|
+
}
|
|
106
|
+
try {
|
|
107
|
+
const raw = fs.readFileSync(path.resolve(process.cwd(), receiptPath), 'utf-8');
|
|
108
|
+
const proof = JSON.parse(raw);
|
|
109
|
+
const valid = verifyReceipt(proof);
|
|
110
|
+
if (valid) {
|
|
111
|
+
console.log('✅ Receipt VERIFIED: Merkle inclusion proof is valid (RFC 6962).');
|
|
112
|
+
process.exit(0);
|
|
113
|
+
} else {
|
|
114
|
+
console.error('❌ Receipt INVALID: Merkle proof verification failed.');
|
|
115
|
+
process.exit(2);
|
|
116
|
+
}
|
|
117
|
+
} catch (err) {
|
|
118
|
+
console.error(`Verification error: ${err.message}`);
|
|
119
|
+
process.exit(1);
|
|
120
|
+
}
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
case 'mcp': {
|
|
124
|
+
const catalogPath = process.env.X402_CATALOG_PATH || path.resolve(process.cwd(), 'data/x402-catalog.json');
|
|
125
|
+
startStdioMcpServer(catalogPath);
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
54
128
|
default: {
|
|
55
129
|
console.error(`Unknown command: ${command}`);
|
|
56
130
|
process.exit(1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ashlar-blue",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Attested settlement rails and institutional clearinghouse platform (ashlar.blue) • Corrente Labs, Inc.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ashlar",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"LICENSE"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@ashlar-blue/x402-trust": "^0.5.
|
|
38
|
+
"@ashlar-blue/x402-trust": "^0.5.92"
|
|
39
39
|
},
|
|
40
40
|
"engines": {
|
|
41
41
|
"node": ">=18"
|