langchain-mcp 1.0.2 → 1.0.4
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/dist/bin/cli.js +20 -10
- package/package.json +1 -1
package/dist/bin/cli.js
CHANGED
|
@@ -6,17 +6,17 @@ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
|
|
|
6
6
|
import { loadConfig, saveConfig, deleteConfig, getConfigPath, DEFAULT_API_URL } from '../src/config.js';
|
|
7
7
|
import { APIClient } from '../src/api-client.js';
|
|
8
8
|
import { createServer } from '../src/server.js';
|
|
9
|
-
// ASCII Art Banner
|
|
10
|
-
const BANNER = `
|
|
11
|
-
_ _ _ __ __ ____ ____
|
|
12
|
-
| | __ _ _ __ __ _ ___| |__ __ _(_)_ __ | \\/ |/ ___| _ \\
|
|
13
|
-
| | / _\` | '_ \\ / _\` |/ __| '_ \\ / _\` | | '_ \\ _____| |\\/| | | | |_) |
|
|
14
|
-
| |__| (_| | | | | (_| | (__| | | | (_| | | | | |_____| | | | |___| __/
|
|
15
|
-
|_____\\__,_|_| |_|\\__, |\\___|_| |_|\\__,_|_|_| |_| |_| |_|\\____|_|
|
|
16
|
-
|___/
|
|
17
|
-
`;
|
|
9
|
+
// ASCII Art Banner - Generated with oh-my-logo (shade style)
|
|
18
10
|
function printBanner() {
|
|
19
|
-
|
|
11
|
+
const green = '\x1b[32m';
|
|
12
|
+
const reset = '\x1b[0m';
|
|
13
|
+
console.log(`
|
|
14
|
+
${green}░█░░░░░██░░█░░█░░███░████░█░░█░░██░░███░█░░█░░░░░░█░░█░████░███░
|
|
15
|
+
░█░░░░█ █░██░█░█ ░█ ░█░░█░█ █░ █ ░██░█░░░░░░████░█ ░█ █
|
|
16
|
+
░█░░░░████░█ ██░█░██░█░░░░████░████░░█░░█ ██░████░█ █░█░░░░███░
|
|
17
|
+
░█░░░░█ █░█░ █░█░ █░█░░░░█ █░█ █░░█░░█░ █░ ░█░░█░█░░░░█░░░
|
|
18
|
+
░████░█░░█░█░░█░███░░████░█░░█░█░░█░███░█░░█░░░░░░█░░█░████░█░░░${reset}
|
|
19
|
+
`);
|
|
20
20
|
}
|
|
21
21
|
function printDivider(char = '─', length = 70) {
|
|
22
22
|
console.log('\x1b[90m' + char.repeat(length) + '\x1b[0m');
|
|
@@ -109,6 +109,8 @@ async function loginWithWebFlow(apiUrl, provider, openBrowser) {
|
|
|
109
109
|
printSection('💰 Credits');
|
|
110
110
|
const creditColor = user.credits > 5 ? '\x1b[32m' : user.credits > 1 ? '\x1b[33m' : '\x1b[31m';
|
|
111
111
|
console.log(` Remaining: ${creditColor}$${user.credits.toFixed(2)}\x1b[0m`);
|
|
112
|
+
printSection('☕ Support');
|
|
113
|
+
console.log(` Ko-fi: \x1b[36mhttps://ko-fi.com/baixianger\x1b[0m`);
|
|
112
114
|
printSection('⚙️ Config');
|
|
113
115
|
console.log(` Saved to: ${getConfigPath()}`);
|
|
114
116
|
console.log('');
|
|
@@ -209,11 +211,19 @@ program
|
|
|
209
211
|
const remaining = usage.credits.remaining;
|
|
210
212
|
const creditColor = remaining > 5 ? '\x1b[32m' : remaining > 1 ? '\x1b[33m' : '\x1b[31m';
|
|
211
213
|
console.log(` Remaining: ${creditColor}$${remaining.toFixed(2)}\x1b[0m`);
|
|
214
|
+
// Show Ko-fi prompt when low on credits
|
|
215
|
+
if (remaining <= 1) {
|
|
216
|
+
console.log(`\n \x1b[33m⚠️ Low credits! Support the project:\x1b[0m`);
|
|
217
|
+
console.log(` \x1b[36m☕ https://ko-fi.com/baixianger\x1b[0m`);
|
|
218
|
+
}
|
|
212
219
|
// Token Usage Section
|
|
213
220
|
printSection('📊 Token Usage');
|
|
214
221
|
console.log(` Today: ${usage.usage.today.tokens.toLocaleString().padStart(12)} tokens (${usage.usage.today.requests} requests)`);
|
|
215
222
|
console.log(` This Month: ${usage.usage.this_month.tokens.toLocaleString().padStart(12)} tokens (${usage.usage.this_month.requests} requests)`);
|
|
216
223
|
console.log(` All Time: ${usage.usage.all_time.tokens.toLocaleString().padStart(12)} tokens (${usage.usage.all_time.requests} requests)`);
|
|
224
|
+
// Support Section
|
|
225
|
+
printSection('☕ Support');
|
|
226
|
+
console.log(` Ko-fi: \x1b[36mhttps://ko-fi.com/baixianger\x1b[0m`);
|
|
217
227
|
// Config Section
|
|
218
228
|
printSection('⚙️ Config');
|
|
219
229
|
console.log(` Path: ${getConfigPath()}`);
|