x402-bazaar 3.4.0 → 3.5.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/bin/cli.js +2 -2
- package/package.json +1 -1
- package/src/commands/init.js +25 -6
package/bin/cli.js
CHANGED
|
@@ -25,7 +25,7 @@ const program = new Command();
|
|
|
25
25
|
program
|
|
26
26
|
.name('x402-bazaar')
|
|
27
27
|
.description(chalk.hex('#FF9900')('x402 Bazaar') + ' — Connect your AI agent to the marketplace in one command')
|
|
28
|
-
.version('3.
|
|
28
|
+
.version('3.4.0');
|
|
29
29
|
|
|
30
30
|
program
|
|
31
31
|
.command('init')
|
|
@@ -88,7 +88,7 @@ program
|
|
|
88
88
|
// Default: show help if no command given
|
|
89
89
|
if (process.argv.length <= 2) {
|
|
90
90
|
console.log('');
|
|
91
|
-
console.log(chalk.hex('#FF9900').bold(' x402 Bazaar') + chalk.dim(' — AI Agent Marketplace CLI v3'));
|
|
91
|
+
console.log(chalk.hex('#FF9900').bold(' x402 Bazaar') + chalk.dim(' — AI Agent Marketplace CLI v3.4.0'));
|
|
92
92
|
console.log('');
|
|
93
93
|
console.log(' Setup commands:');
|
|
94
94
|
console.log(chalk.cyan(' npx x402-bazaar init') + chalk.dim(' Full interactive setup'));
|
package/package.json
CHANGED
package/src/commands/init.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import inquirer from 'inquirer';
|
|
2
2
|
import ora from 'ora';
|
|
3
3
|
import chalk from 'chalk';
|
|
4
|
-
import { existsSync, mkdirSync, writeFileSync, readFileSync, copyFileSync, chmodSync } from 'fs';
|
|
4
|
+
import { existsSync, mkdirSync, writeFileSync, readFileSync, copyFileSync, chmodSync, cpSync, readdirSync } from 'fs';
|
|
5
5
|
import { join, dirname, resolve } from 'path';
|
|
6
6
|
import { execSync } from 'child_process';
|
|
7
7
|
import { randomBytes } from 'crypto';
|
|
@@ -126,12 +126,31 @@ export async function initCommand(options) {
|
|
|
126
126
|
if (mcpSource) {
|
|
127
127
|
copyFileSync(mcpSource, mcpServerDest);
|
|
128
128
|
spinner.text = 'Copied mcp-server.mjs from local project...';
|
|
129
|
+
|
|
130
|
+
// Copy lib/ and schemas/ directories (required by mcp-server.mjs)
|
|
131
|
+
const mcpSourceDir = dirname(mcpSource);
|
|
132
|
+
for (const subdir of ['lib', 'schemas']) {
|
|
133
|
+
const srcDir = join(mcpSourceDir, subdir);
|
|
134
|
+
const destDir = join(installDir, subdir);
|
|
135
|
+
if (existsSync(srcDir)) {
|
|
136
|
+
cpSync(srcDir, destDir, { recursive: true });
|
|
137
|
+
spinner.text = `Copied ${subdir}/ directory...`;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
129
140
|
} else {
|
|
130
141
|
spinner.text = 'Downloading MCP server from GitHub...';
|
|
131
142
|
try {
|
|
132
143
|
const dlRes = await fetch('https://raw.githubusercontent.com/Wintyx57/x402-backend/main/mcp-server.mjs');
|
|
133
144
|
if (!dlRes.ok) throw new Error(`HTTP ${dlRes.status}`);
|
|
134
145
|
writeFileSync(mcpServerDest, await dlRes.text());
|
|
146
|
+
|
|
147
|
+
// Download lib/protocolAdapter.js (required dependency)
|
|
148
|
+
const libDir = join(installDir, 'lib');
|
|
149
|
+
if (!existsSync(libDir)) mkdirSync(libDir, { recursive: true });
|
|
150
|
+
for (const libFile of ['protocolAdapter.js']) {
|
|
151
|
+
const libRes = await fetch(`https://raw.githubusercontent.com/Wintyx57/x402-backend/main/lib/${libFile}`);
|
|
152
|
+
if (libRes.ok) writeFileSync(join(libDir, libFile), await libRes.text());
|
|
153
|
+
}
|
|
135
154
|
} catch (dlErr) {
|
|
136
155
|
spinner.fail(`Could not download MCP server: ${dlErr.message}`);
|
|
137
156
|
log.error('Download the file manually from:');
|
|
@@ -146,13 +165,13 @@ export async function initCommand(options) {
|
|
|
146
165
|
if (!existsSync(pkgJsonPath)) {
|
|
147
166
|
writeFileSync(pkgJsonPath, JSON.stringify({
|
|
148
167
|
name: 'x402-bazaar-mcp',
|
|
149
|
-
version: '2.
|
|
150
|
-
type: '
|
|
168
|
+
version: '2.6.0',
|
|
169
|
+
type: 'commonjs',
|
|
151
170
|
private: true,
|
|
152
171
|
dependencies: {
|
|
153
|
-
'viem': '^2.
|
|
154
|
-
'@modelcontextprotocol/sdk': '^1.
|
|
155
|
-
'dotenv': '^17.
|
|
172
|
+
'viem': '^2.45.0',
|
|
173
|
+
'@modelcontextprotocol/sdk': '^1.27.0',
|
|
174
|
+
'dotenv': '^17.3.0',
|
|
156
175
|
'zod': '^4.3.6',
|
|
157
176
|
'ed2curve': '^0.3.0',
|
|
158
177
|
'@scure/bip32': '^1.6.0',
|