upfynai-code 2.9.0 → 2.9.2
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 +91 -66
- package/client/dist/api-docs.html +838 -0
- package/client/dist/assets/AppContent-BXZDeSIC.js +545 -0
- package/client/dist/assets/CanvasFullScreen-mnpCnLZ9.js +1 -0
- package/client/dist/assets/CanvasWorkspace-4CqmjAVQ.js +163 -0
- package/client/dist/assets/DashboardPanel-zFIFlw56.js +1 -0
- package/client/dist/assets/FileTree-B0c_GaB3.js +1 -0
- package/client/dist/assets/GitPanel-DUP4zVU4.js +2 -0
- package/client/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/client/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/client/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/client/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/client/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/client/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/client/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/client/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/client/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/client/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/client/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/client/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/client/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/client/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/client/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/client/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/client/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/client/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/client/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/client/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/client/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/client/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/client/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/client/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/client/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/client/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/client/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/client/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/client/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/client/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/client/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/client/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/client/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/client/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/client/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/client/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/client/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/client/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/client/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/client/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/client/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/client/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/client/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/client/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/client/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/client/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/client/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/client/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/client/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/client/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/client/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/client/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/client/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/client/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/client/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/client/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/client/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/client/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/client/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/client/dist/assets/LoginModal-BRycfsyD.js +13 -0
- package/client/dist/assets/MarkdownPreview-DHmk3qzu.js +1 -0
- package/client/dist/assets/MermaidBlock-BuBc_G-F.js +2 -0
- package/client/dist/assets/Onboarding-BcnaZZ0o.js +1 -0
- package/client/dist/assets/PreviewPanel-CqCa92Tf.js +32 -0
- package/client/dist/assets/SetupForm-S0g6u5yT.js +1 -0
- package/client/dist/assets/WorkflowsPanel-CouH9JDO.js +1 -0
- package/client/dist/assets/index-BFuqS0tY.css +1 -0
- package/client/dist/assets/index-CNDcVl2g.js +68 -0
- package/client/dist/assets/pdf-CE_K4jFx.js +12 -0
- package/client/dist/assets/vendor-canvas-BZV40eAE.css +1 -0
- package/client/dist/assets/vendor-canvas-D39yWul6.js +49 -0
- package/client/dist/assets/vendor-codemirror-CbtmxxaB.js +35 -0
- package/client/dist/assets/vendor-diff-DNQpbhrT.js +69 -0
- package/client/dist/assets/vendor-i18n-DCFGyhQR.js +1 -0
- package/client/dist/assets/vendor-icons-BaD0x9SL.js +711 -0
- package/client/dist/assets/vendor-markdown-CimbIo6Y.js +296 -0
- package/client/dist/assets/vendor-mermaid-CH7SGc99.js +2556 -0
- package/client/dist/assets/vendor-react-96lCPsRK.js +67 -0
- package/client/dist/assets/vendor-syntax-DuHI9Ok6.js +16 -0
- package/client/dist/assets/vendor-xterm-CZq1hqo1.js +66 -0
- package/client/dist/assets/vendor-xterm-qxJ8_QYu.css +32 -0
- package/client/dist/clear-cache.html +85 -0
- package/client/dist/convert-icons.md +53 -0
- package/client/dist/favicon.png +0 -0
- package/client/dist/favicon.svg +5 -0
- package/client/dist/generate-icons.js +49 -0
- package/client/dist/icons/claude-ai-icon.svg +1 -0
- package/client/dist/icons/codex-white.svg +3 -0
- package/client/dist/icons/codex.svg +3 -0
- package/client/dist/icons/cursor-white.svg +12 -0
- package/client/dist/icons/cursor.svg +1 -0
- package/client/dist/icons/icon-128x128.png +0 -0
- package/client/dist/icons/icon-128x128.svg +5 -0
- package/client/dist/icons/icon-144x144.png +0 -0
- package/client/dist/icons/icon-144x144.svg +5 -0
- package/client/dist/icons/icon-152x152.png +0 -0
- package/client/dist/icons/icon-152x152.svg +5 -0
- package/client/dist/icons/icon-192x192.png +0 -0
- package/client/dist/icons/icon-192x192.svg +5 -0
- package/client/dist/icons/icon-384x384.png +0 -0
- package/client/dist/icons/icon-384x384.svg +5 -0
- package/client/dist/icons/icon-512x512.png +0 -0
- package/client/dist/icons/icon-512x512.svg +5 -0
- package/client/dist/icons/icon-72x72.png +0 -0
- package/client/dist/icons/icon-72x72.svg +5 -0
- package/client/dist/icons/icon-96x96.png +0 -0
- package/client/dist/icons/icon-96x96.svg +5 -0
- package/client/dist/icons/icon-template.svg +5 -0
- package/client/dist/index.html +119 -0
- package/client/dist/logo-128.png +0 -0
- package/client/dist/logo-256.png +0 -0
- package/client/dist/logo-32.png +0 -0
- package/client/dist/logo-512.png +0 -0
- package/client/dist/logo-64.png +0 -0
- package/client/dist/logo.svg +14 -0
- package/client/dist/manifest.json +61 -0
- package/client/dist/mcp-docs.html +108 -0
- package/client/dist/offline.html +84 -0
- package/client/dist/screenshots/cli-selection.png +0 -0
- package/client/dist/screenshots/desktop-main.png +0 -0
- package/client/dist/screenshots/mobile-chat.png +0 -0
- package/client/dist/screenshots/tools-modal.png +0 -0
- package/client/dist/sw.js +82 -0
- package/commands/upfynai-connect.md +59 -0
- package/commands/upfynai-disconnect.md +31 -0
- package/commands/upfynai-doctor.md +99 -0
- package/commands/upfynai-export.md +49 -0
- package/commands/upfynai-local.md +82 -0
- package/commands/upfynai-status.md +75 -0
- package/commands/upfynai-stop.md +49 -0
- package/commands/upfynai-uninstall.md +58 -0
- package/commands/upfynai.md +69 -0
- package/package.json +143 -82
- package/scripts/build-client.js +17 -0
- package/scripts/fix-node-pty.js +67 -0
- package/scripts/install-commands.js +78 -0
- package/server/agent-loop.js +242 -0
- package/server/auto-compact.js +99 -0
- package/server/claude-sdk.js +797 -0
- package/server/cli-ui.js +785 -0
- package/server/cli.js +596 -0
- package/server/constants/config.js +31 -0
- package/server/cursor-cli.js +270 -0
- package/server/database/auth.db +0 -0
- package/server/database/db.js +1391 -0
- package/server/database/init.sql +70 -0
- package/server/index.js +3799 -0
- package/server/load-env.js +26 -0
- package/server/mcp-server.js +621 -0
- package/server/middleware/auth.js +176 -0
- package/server/middleware/relayHelpers.js +44 -0
- package/server/middleware/sandboxRouter.js +174 -0
- package/server/openai-codex.js +403 -0
- package/server/openrouter.js +137 -0
- package/server/projects.js +1807 -0
- package/server/provider-factory.js +174 -0
- package/server/relay-client.js +379 -0
- package/server/routes/agent.js +1226 -0
- package/server/routes/auth.js +554 -0
- package/server/routes/canvas.js +53 -0
- package/server/routes/cli-auth.js +263 -0
- package/server/routes/codex.js +396 -0
- package/server/routes/commands.js +707 -0
- package/server/routes/composio.js +176 -0
- package/server/routes/cursor.js +770 -0
- package/server/routes/dashboard.js +295 -0
- package/server/routes/git.js +1208 -0
- package/server/routes/keys.js +34 -0
- package/server/routes/mcp-utils.js +48 -0
- package/server/routes/mcp.js +661 -0
- package/server/routes/payments.js +227 -0
- package/server/routes/projects.js +655 -0
- package/server/routes/sessions.js +146 -0
- package/server/routes/settings.js +261 -0
- package/server/routes/taskmaster.js +1928 -0
- package/server/routes/user.js +106 -0
- package/server/routes/vapi-chat.js +624 -0
- package/server/routes/voice.js +235 -0
- package/server/routes/webhooks.js +166 -0
- package/server/routes/workflows.js +312 -0
- package/server/sandbox.js +120 -0
- package/server/services/composio.js +204 -0
- package/server/services/sessionRegistry.js +139 -0
- package/server/services/whisperService.js +84 -0
- package/server/services/workflowScheduler.js +206 -0
- package/server/tests/relay-flow.test.js +570 -0
- package/server/tests/sessions.test.js +259 -0
- package/server/utils/commandParser.js +303 -0
- package/server/utils/email.js +61 -0
- package/server/utils/gitConfig.js +24 -0
- package/server/utils/mcp-detector.js +198 -0
- package/server/utils/taskmaster-websocket.js +129 -0
- package/shared/integrationCatalog.d.ts +12 -0
- package/shared/integrationCatalog.js +172 -0
- package/shared/modelConstants.js +96 -0
- package/bin/cli.js +0 -97
- package/dist/agents/claude.js +0 -229
- package/dist/agents/codex.js +0 -48
- package/dist/agents/cursor.js +0 -48
- package/dist/agents/detect.js +0 -51
- package/dist/agents/exec.js +0 -31
- package/dist/agents/files.js +0 -105
- package/dist/agents/git.js +0 -18
- package/dist/agents/gitagent.js +0 -67
- package/dist/agents/index.js +0 -88
- package/dist/agents/shell.js +0 -38
- package/dist/agents/utils.js +0 -136
- package/scripts/postinstall.js +0 -9
- package/scripts/prepublish.js +0 -58
- package/src/animation.js +0 -228
- package/src/auth.js +0 -122
- package/src/config.js +0 -40
- package/src/connect.js +0 -416
- package/src/launch.js +0 -78
- package/src/mcp.js +0 -57
- package/src/permissions.js +0 -140
- package/src/persistent-shell.js +0 -261
- package/src/server.js +0 -54
- /package/{dist → shared}/gitagent/index.js +0 -0
- /package/{dist → shared}/gitagent/parser.js +0 -0
- /package/{dist → shared}/gitagent/prompt-builder.js +0 -0
package/src/config.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { readFileSync, writeFileSync, mkdirSync } from 'fs';
|
|
2
|
-
import { homedir } from 'os';
|
|
3
|
-
import { join, dirname } from 'path';
|
|
4
|
-
|
|
5
|
-
const CONFIG_PATH = join(homedir(), '.upfynrc');
|
|
6
|
-
|
|
7
|
-
const DEFAULTS = {
|
|
8
|
-
serverUrl: 'https://upfynai-code-production.up.railway.app',
|
|
9
|
-
localPort: 4200,
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export function readConfig() {
|
|
13
|
-
try {
|
|
14
|
-
const raw = readFileSync(CONFIG_PATH, 'utf-8');
|
|
15
|
-
return { ...DEFAULTS, ...JSON.parse(raw) };
|
|
16
|
-
} catch {
|
|
17
|
-
return { ...DEFAULTS };
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function writeConfig(data) {
|
|
22
|
-
const existing = readConfig();
|
|
23
|
-
const merged = { ...existing, ...data };
|
|
24
|
-
mkdirSync(dirname(CONFIG_PATH), { recursive: true });
|
|
25
|
-
writeFileSync(CONFIG_PATH, JSON.stringify(merged, null, 2) + '\n', 'utf-8');
|
|
26
|
-
return merged;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export function clearConfig() {
|
|
30
|
-
writeFileSync(CONFIG_PATH, JSON.stringify(DEFAULTS, null, 2) + '\n', 'utf-8');
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/** Display-friendly server label — masks the internal URL */
|
|
34
|
-
export function displayUrl(url) {
|
|
35
|
-
if (!url || url === DEFAULTS.serverUrl) return 'Upfyn Cloud';
|
|
36
|
-
// Custom server — show the hostname only
|
|
37
|
-
try { return new URL(url).host; } catch { return url; }
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export { CONFIG_PATH, DEFAULTS };
|
package/src/connect.js
DELETED
|
@@ -1,416 +0,0 @@
|
|
|
1
|
-
import WebSocket from 'ws';
|
|
2
|
-
import os from 'os';
|
|
3
|
-
import { spawn } from 'child_process';
|
|
4
|
-
import { promises as fsPromises, existsSync } from 'fs';
|
|
5
|
-
import path, { dirname, join } from 'path';
|
|
6
|
-
import { fileURLToPath } from 'url';
|
|
7
|
-
import chalk from 'chalk';
|
|
8
|
-
import { readConfig, writeConfig, displayUrl } from './config.js';
|
|
9
|
-
import { getToken, validateToken } from './auth.js';
|
|
10
|
-
import { getPersistentShell } from './persistent-shell.js';
|
|
11
|
-
import { needsPermission, requestPermission, handlePermissionResponse } from './permissions.js';
|
|
12
|
-
import { playConnectAnimation } from './animation.js';
|
|
13
|
-
|
|
14
|
-
// Optional node-pty for proper terminal emulation (graceful fallback to spawn)
|
|
15
|
-
let pty;
|
|
16
|
-
try { pty = (await import('node-pty')).default; } catch { pty = null; }
|
|
17
|
-
|
|
18
|
-
// Resolve agents: dist/agents/ (npm package) or ../../shared/agents/ (monorepo)
|
|
19
|
-
const __connectDir = dirname(fileURLToPath(import.meta.url));
|
|
20
|
-
const _agentsPath = existsSync(join(__connectDir, '../dist/agents/index.js'))
|
|
21
|
-
? '../dist/agents/index.js'
|
|
22
|
-
: '../../shared/agents/index.js';
|
|
23
|
-
const { executeAction, isStreamingAction } = await import(_agentsPath);
|
|
24
|
-
|
|
25
|
-
// Active process tracking (opencode pattern: activeRequests sync.Map)
|
|
26
|
-
const activeProcesses = new Map(); // requestId → { proc, action }
|
|
27
|
-
|
|
28
|
-
// Active shell sessions for relay terminal (shellSessionId → { proc })
|
|
29
|
-
const activeShellSessions = new Map();
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Start an interactive shell session on the local machine, relayed to the browser.
|
|
33
|
-
* Uses node-pty for proper terminal emulation when available, falls back to spawn.
|
|
34
|
-
*/
|
|
35
|
-
function handleShellSessionStart(data, ws) {
|
|
36
|
-
const shellSessionId = data.requestId;
|
|
37
|
-
const projectPath = data.projectPath || process.cwd();
|
|
38
|
-
const isWin = process.platform === 'win32';
|
|
39
|
-
const shellType = data.shellType;
|
|
40
|
-
const cols = data.cols || 80;
|
|
41
|
-
const rows = data.rows || 24;
|
|
42
|
-
|
|
43
|
-
console.log(chalk.cyan(` [relay] Starting shell session in ${projectPath}${pty ? ' (pty)' : ' (spawn)'}`));
|
|
44
|
-
|
|
45
|
-
let shellCmd, shellArgs;
|
|
46
|
-
const provider = data.provider || 'claude';
|
|
47
|
-
const isPlainShell = data.isPlainShell || (!!data.initialCommand && !data.hasSession) || provider === 'plain-shell';
|
|
48
|
-
|
|
49
|
-
function getInteractiveShell(projectDir) {
|
|
50
|
-
if (isWin) {
|
|
51
|
-
if (shellType === 'cmd') return { cmd: 'cmd.exe', args: [] };
|
|
52
|
-
return { cmd: 'powershell.exe', args: ['-NoExit'] };
|
|
53
|
-
}
|
|
54
|
-
const sh = shellType || process.env.SHELL || 'bash';
|
|
55
|
-
return { cmd: sh, args: ['--login'] };
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function wrapCommand(command, projectDir) {
|
|
59
|
-
if (isWin) {
|
|
60
|
-
if (shellType === 'cmd') return { cmd: 'cmd.exe', args: ['/C', `cd /d "${projectDir}" && ${command}`] };
|
|
61
|
-
return { cmd: 'powershell.exe', args: ['-Command', `Set-Location -LiteralPath '${projectDir.replace(/'/g, "''")}'; ${command}`] };
|
|
62
|
-
}
|
|
63
|
-
const sh = shellType || 'bash';
|
|
64
|
-
return { cmd: sh, args: ['-c', `cd "${projectDir}" && ${command}`] };
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if (isPlainShell && data.initialCommand) {
|
|
68
|
-
const s = wrapCommand(data.initialCommand, projectPath);
|
|
69
|
-
shellCmd = s.cmd; shellArgs = s.args;
|
|
70
|
-
} else if (isPlainShell) {
|
|
71
|
-
const s = getInteractiveShell(projectPath);
|
|
72
|
-
shellCmd = s.cmd; shellArgs = s.args;
|
|
73
|
-
} else if (provider === 'cursor') {
|
|
74
|
-
const cursorCmd = data.hasSession && data.sessionId
|
|
75
|
-
? `cursor-agent --resume="${data.sessionId}"`
|
|
76
|
-
: 'cursor-agent';
|
|
77
|
-
const s = wrapCommand(cursorCmd, projectPath);
|
|
78
|
-
shellCmd = s.cmd; shellArgs = s.args;
|
|
79
|
-
} else {
|
|
80
|
-
const command = data.initialCommand || 'claude';
|
|
81
|
-
let claudeCmd;
|
|
82
|
-
if (isWin) {
|
|
83
|
-
claudeCmd = data.hasSession && data.sessionId
|
|
84
|
-
? `claude --resume ${data.sessionId}`
|
|
85
|
-
: command;
|
|
86
|
-
} else {
|
|
87
|
-
claudeCmd = data.hasSession && data.sessionId
|
|
88
|
-
? `claude --resume ${data.sessionId} || claude`
|
|
89
|
-
: command;
|
|
90
|
-
}
|
|
91
|
-
const s = wrapCommand(claudeCmd, projectPath);
|
|
92
|
-
shellCmd = s.cmd; shellArgs = s.args;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
ws.send(JSON.stringify({ type: 'relay-shell-output', shellSessionId, data: '' }));
|
|
96
|
-
|
|
97
|
-
// Use node-pty for proper terminal emulation (resize, isatty, line discipline)
|
|
98
|
-
if (pty) {
|
|
99
|
-
const proc = pty.spawn(shellCmd, shellArgs, {
|
|
100
|
-
name: 'xterm-256color',
|
|
101
|
-
cols,
|
|
102
|
-
rows,
|
|
103
|
-
cwd: projectPath,
|
|
104
|
-
env: { ...process.env, TERM: 'xterm-256color', COLORTERM: 'truecolor', FORCE_COLOR: '3' },
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
activeShellSessions.set(shellSessionId, { proc, projectPath, isPty: true });
|
|
108
|
-
|
|
109
|
-
proc.onData((chunk) => {
|
|
110
|
-
if (ws.readyState === WebSocket.OPEN) {
|
|
111
|
-
ws.send(JSON.stringify({ type: 'relay-shell-output', shellSessionId, data: chunk }));
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
proc.onExit(({ exitCode }) => {
|
|
116
|
-
activeShellSessions.delete(shellSessionId);
|
|
117
|
-
if (ws.readyState === WebSocket.OPEN) {
|
|
118
|
-
ws.send(JSON.stringify({ type: 'relay-shell-exited', shellSessionId, exitCode }));
|
|
119
|
-
}
|
|
120
|
-
console.log(chalk.dim(` [relay] Shell session ended (code ${exitCode})`));
|
|
121
|
-
});
|
|
122
|
-
} else {
|
|
123
|
-
// Fallback: spawn without PTY (text wrapping may be incorrect)
|
|
124
|
-
const proc = spawn(shellCmd, shellArgs, {
|
|
125
|
-
cwd: projectPath,
|
|
126
|
-
env: { ...process.env, TERM: 'xterm-256color', COLORTERM: 'truecolor', FORCE_COLOR: '3', COLUMNS: String(cols), LINES: String(rows) },
|
|
127
|
-
stdio: ['pipe', 'pipe', 'pipe'],
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
activeShellSessions.set(shellSessionId, { proc, projectPath, isPty: false });
|
|
131
|
-
|
|
132
|
-
proc.stdout.on('data', (chunk) => {
|
|
133
|
-
if (ws.readyState === WebSocket.OPEN) {
|
|
134
|
-
ws.send(JSON.stringify({ type: 'relay-shell-output', shellSessionId, data: chunk.toString() }));
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
proc.stderr.on('data', (chunk) => {
|
|
139
|
-
if (ws.readyState === WebSocket.OPEN) {
|
|
140
|
-
ws.send(JSON.stringify({ type: 'relay-shell-output', shellSessionId, data: chunk.toString() }));
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
proc.on('close', (code) => {
|
|
145
|
-
activeShellSessions.delete(shellSessionId);
|
|
146
|
-
if (ws.readyState === WebSocket.OPEN) {
|
|
147
|
-
ws.send(JSON.stringify({ type: 'relay-shell-exited', shellSessionId, exitCode: code }));
|
|
148
|
-
}
|
|
149
|
-
console.log(chalk.dim(` [relay] Shell session ended (code ${code})`));
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
proc.on('error', (err) => {
|
|
153
|
-
activeShellSessions.delete(shellSessionId);
|
|
154
|
-
if (ws.readyState === WebSocket.OPEN) {
|
|
155
|
-
ws.send(JSON.stringify({ type: 'relay-shell-output', shellSessionId, data: `\r\n\x1b[31mError: ${err.message}\x1b[0m\r\n` }));
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Build execution context for shared agents.
|
|
163
|
-
* Provides CLI-specific capabilities (persistent shell, process tracking, streaming).
|
|
164
|
-
*/
|
|
165
|
-
function buildAgentContext(requestId, ws) {
|
|
166
|
-
return {
|
|
167
|
-
requestId,
|
|
168
|
-
streamMode: 'structured',
|
|
169
|
-
getPersistentShell,
|
|
170
|
-
trackProcess: (id, entry) => activeProcesses.set(id, entry),
|
|
171
|
-
untrackProcess: (id) => activeProcesses.delete(id),
|
|
172
|
-
stream: (data) => {
|
|
173
|
-
if (ws.readyState === WebSocket.OPEN) {
|
|
174
|
-
ws.send(JSON.stringify({ type: 'relay-stream', requestId, data }));
|
|
175
|
-
}
|
|
176
|
-
},
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* Handle incoming relay commands from the server.
|
|
182
|
-
* Delegates to shared agent modules for action execution.
|
|
183
|
-
*/
|
|
184
|
-
async function handleRelayCommand(data, ws) {
|
|
185
|
-
const { requestId, action } = data;
|
|
186
|
-
|
|
187
|
-
try {
|
|
188
|
-
// Permission gate (opencode pattern: dangerous actions require browser approval)
|
|
189
|
-
if (needsPermission(action, data)) {
|
|
190
|
-
const approved = await requestPermission(ws, requestId, action, data);
|
|
191
|
-
if (!approved) {
|
|
192
|
-
ws.send(JSON.stringify({ type: 'relay-response', requestId, error: 'Permission denied by user' }));
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
const ctx = buildAgentContext(requestId, ws);
|
|
198
|
-
|
|
199
|
-
// For the exec action, params come from data.options in the old format
|
|
200
|
-
const params = action === 'exec'
|
|
201
|
-
? { command: data.options?.command || data.command, timeout: data.options?.timeout || data.timeout, cwd: data.options?.cwd || data.cwd }
|
|
202
|
-
: data;
|
|
203
|
-
|
|
204
|
-
if (isStreamingAction(action)) {
|
|
205
|
-
// Streaming actions: agent calls ctx.stream() for chunks, returns on completion
|
|
206
|
-
const result = await executeAction(action, params, ctx);
|
|
207
|
-
ws.send(JSON.stringify({ type: 'relay-complete', requestId, exitCode: result.exitCode, sessionId: result.sessionId }));
|
|
208
|
-
} else {
|
|
209
|
-
// Sync actions: agent returns data directly
|
|
210
|
-
const result = await executeAction(action, params, ctx);
|
|
211
|
-
ws.send(JSON.stringify({ type: 'relay-response', requestId, data: result }));
|
|
212
|
-
}
|
|
213
|
-
} catch (err) {
|
|
214
|
-
ws.send(JSON.stringify({ type: 'relay-response', requestId, error: err.message }));
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* Connect to the remote server via WebSocket relay.
|
|
220
|
-
* Bridges local Claude Code, shell, filesystem, and git to the web UI.
|
|
221
|
-
*/
|
|
222
|
-
export async function connect(options = {}) {
|
|
223
|
-
const config = readConfig();
|
|
224
|
-
const serverUrl = options.server || config.serverUrl;
|
|
225
|
-
let relayKey = options.key;
|
|
226
|
-
|
|
227
|
-
if (!relayKey) {
|
|
228
|
-
const token = getToken();
|
|
229
|
-
if (!token) {
|
|
230
|
-
console.log(chalk.yellow('\n No account found. Run `uc login` first.\n'));
|
|
231
|
-
process.exit(1);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
console.log(chalk.dim('\n Validating session...'));
|
|
235
|
-
const user = await validateToken();
|
|
236
|
-
if (!user) {
|
|
237
|
-
console.log(chalk.yellow(' Session expired. Run `uc login` to re-authenticate.\n'));
|
|
238
|
-
process.exit(1);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
try {
|
|
242
|
-
const res = await fetch(`${serverUrl}/api/auth/connect-token`, {
|
|
243
|
-
headers: { Authorization: `Bearer ${token}` },
|
|
244
|
-
});
|
|
245
|
-
if (!res.ok) throw new Error('Failed to get connect token');
|
|
246
|
-
const data = await res.json();
|
|
247
|
-
relayKey = data.token;
|
|
248
|
-
} catch (err) {
|
|
249
|
-
console.log(chalk.red('\n Could not get connection token. Check your network and try again.\n'));
|
|
250
|
-
process.exit(1);
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
writeConfig({ relayKey });
|
|
255
|
-
|
|
256
|
-
const wsUrl = serverUrl.replace(/^http/, 'ws') + '/relay?token=' + encodeURIComponent(relayKey);
|
|
257
|
-
|
|
258
|
-
// Play spaceship launch animation
|
|
259
|
-
try { await playConnectAnimation(); } catch { /* cosmetic — don't block connect */ }
|
|
260
|
-
|
|
261
|
-
console.log(chalk.bold('\n Upfyn-Code Relay Client\n'));
|
|
262
|
-
console.log(` Server: ${chalk.cyan(displayUrl(serverUrl))}`);
|
|
263
|
-
console.log(` Machine: ${chalk.dim(os.hostname())}`);
|
|
264
|
-
console.log(` User: ${chalk.dim(os.userInfo().username)}\n`);
|
|
265
|
-
|
|
266
|
-
let reconnectAttempts = 0;
|
|
267
|
-
const MAX_RECONNECT = 10;
|
|
268
|
-
|
|
269
|
-
function doConnect() {
|
|
270
|
-
const ws = new WebSocket(wsUrl, {
|
|
271
|
-
headers: {
|
|
272
|
-
'x-upfyn-machine': os.hostname(),
|
|
273
|
-
'x-upfyn-platform': process.platform,
|
|
274
|
-
'x-upfyn-cwd': process.cwd(),
|
|
275
|
-
},
|
|
276
|
-
});
|
|
277
|
-
|
|
278
|
-
// Respond to native WebSocket pings from server (Railway proxy keepalive)
|
|
279
|
-
ws.on('ping', () => { try { ws.pong(); } catch { /* ignore */ } });
|
|
280
|
-
|
|
281
|
-
ws.on('open', () => {
|
|
282
|
-
reconnectAttempts = 0;
|
|
283
|
-
console.log(chalk.green(' Connected! Your local machine is now bridged to the server.'));
|
|
284
|
-
console.log(chalk.dim(' Claude Code is the AI brain. Press Ctrl+C to disconnect.\n'));
|
|
285
|
-
|
|
286
|
-
const cwd = process.cwd();
|
|
287
|
-
const dirName = path.basename(cwd);
|
|
288
|
-
ws.send(JSON.stringify({
|
|
289
|
-
type: 'relay-init', cwd, dirName,
|
|
290
|
-
homedir: os.homedir(), platform: process.platform, hostname: os.hostname(),
|
|
291
|
-
}));
|
|
292
|
-
console.log(chalk.dim(` Default project: ${cwd}\n`));
|
|
293
|
-
|
|
294
|
-
const heartbeat = setInterval(() => {
|
|
295
|
-
if (ws.readyState === WebSocket.OPEN) {
|
|
296
|
-
ws.send(JSON.stringify({ type: 'ping' }));
|
|
297
|
-
try { ws.ping(); } catch { /* ignore */ }
|
|
298
|
-
}
|
|
299
|
-
}, 20000);
|
|
300
|
-
ws.on('close', () => clearInterval(heartbeat));
|
|
301
|
-
});
|
|
302
|
-
|
|
303
|
-
ws.on('message', (rawMessage) => {
|
|
304
|
-
try {
|
|
305
|
-
const data = JSON.parse(rawMessage);
|
|
306
|
-
|
|
307
|
-
if (data.type === 'relay-connected') {
|
|
308
|
-
console.log(chalk.green(` ${data.message}`));
|
|
309
|
-
return;
|
|
310
|
-
}
|
|
311
|
-
if (data.type === 'relay-command') {
|
|
312
|
-
if (data.action === 'shell-session-start') {
|
|
313
|
-
handleShellSessionStart(data, ws);
|
|
314
|
-
} else {
|
|
315
|
-
handleRelayCommand(data, ws);
|
|
316
|
-
}
|
|
317
|
-
return;
|
|
318
|
-
}
|
|
319
|
-
if (data.type === 'relay-abort') {
|
|
320
|
-
const entry = activeProcesses.get(data.requestId);
|
|
321
|
-
if (entry?.instance?.interrupt) {
|
|
322
|
-
// SDK query instance — use interrupt()
|
|
323
|
-
entry.instance.interrupt().catch(() => {});
|
|
324
|
-
activeProcesses.delete(data.requestId);
|
|
325
|
-
ws.send(JSON.stringify({ type: 'relay-complete', requestId: data.requestId, exitCode: -1, aborted: true }));
|
|
326
|
-
console.log(chalk.yellow(' [relay] SDK session interrupted by user'));
|
|
327
|
-
} else if (entry?.proc) {
|
|
328
|
-
// Legacy subprocess — use kill()
|
|
329
|
-
entry.proc.kill('SIGTERM');
|
|
330
|
-
activeProcesses.delete(data.requestId);
|
|
331
|
-
ws.send(JSON.stringify({ type: 'relay-complete', requestId: data.requestId, exitCode: -1, aborted: true }));
|
|
332
|
-
console.log(chalk.yellow(' [relay] Process aborted by user'));
|
|
333
|
-
}
|
|
334
|
-
return;
|
|
335
|
-
}
|
|
336
|
-
if (data.type === 'relay-permission-response') {
|
|
337
|
-
handlePermissionResponse(data);
|
|
338
|
-
return;
|
|
339
|
-
}
|
|
340
|
-
if (data.type === 'relay-shell-input') {
|
|
341
|
-
const session = activeShellSessions.get(data.shellSessionId);
|
|
342
|
-
if (session) {
|
|
343
|
-
if (session.isPty) {
|
|
344
|
-
session.proc.write(data.data);
|
|
345
|
-
} else if (session.proc?.stdin?.writable) {
|
|
346
|
-
session.proc.stdin.write(data.data);
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
return;
|
|
350
|
-
}
|
|
351
|
-
if (data.type === 'relay-shell-resize') {
|
|
352
|
-
const session = activeShellSessions.get(data.shellSessionId);
|
|
353
|
-
if (session?.isPty && session.proc?.resize) {
|
|
354
|
-
try { session.proc.resize(data.cols || 80, data.rows || 24); } catch { /* ignore resize errors */ }
|
|
355
|
-
}
|
|
356
|
-
return;
|
|
357
|
-
}
|
|
358
|
-
if (data.type === 'relay-shell-kill') {
|
|
359
|
-
const session = activeShellSessions.get(data.shellSessionId);
|
|
360
|
-
if (session?.proc) {
|
|
361
|
-
if (session.isPty) {
|
|
362
|
-
session.proc.kill();
|
|
363
|
-
} else {
|
|
364
|
-
session.proc.kill('SIGTERM');
|
|
365
|
-
}
|
|
366
|
-
activeShellSessions.delete(data.shellSessionId);
|
|
367
|
-
console.log(chalk.dim(' [relay] Shell session killed'));
|
|
368
|
-
}
|
|
369
|
-
return;
|
|
370
|
-
}
|
|
371
|
-
if (data.type === 'pong') return;
|
|
372
|
-
if (data.type === 'server-ping') {
|
|
373
|
-
if (ws.readyState === WebSocket.OPEN) {
|
|
374
|
-
ws.send(JSON.stringify({ type: 'server-pong' }));
|
|
375
|
-
}
|
|
376
|
-
return;
|
|
377
|
-
}
|
|
378
|
-
if (data.type === 'error') {
|
|
379
|
-
console.error(chalk.red(` Server error: ${data.error}`));
|
|
380
|
-
return;
|
|
381
|
-
}
|
|
382
|
-
} catch (e) {
|
|
383
|
-
// message parse error
|
|
384
|
-
}
|
|
385
|
-
});
|
|
386
|
-
|
|
387
|
-
ws.on('close', (code) => {
|
|
388
|
-
if (code === 1000) {
|
|
389
|
-
console.log(chalk.dim(' Disconnected.'));
|
|
390
|
-
process.exit(0);
|
|
391
|
-
}
|
|
392
|
-
reconnectAttempts++;
|
|
393
|
-
if (reconnectAttempts <= MAX_RECONNECT) {
|
|
394
|
-
const delay = Math.min(1000 * Math.pow(2, reconnectAttempts), 30000);
|
|
395
|
-
console.log(chalk.dim(` Connection lost. Reconnecting in ${delay / 1000}s... (${reconnectAttempts}/${MAX_RECONNECT})`));
|
|
396
|
-
setTimeout(doConnect, delay);
|
|
397
|
-
} else {
|
|
398
|
-
console.error(chalk.red(' Max reconnection attempts reached. Exiting.'));
|
|
399
|
-
process.exit(1);
|
|
400
|
-
}
|
|
401
|
-
});
|
|
402
|
-
|
|
403
|
-
ws.on('error', (err) => {
|
|
404
|
-
if (err.code === 'ECONNREFUSED') {
|
|
405
|
-
console.error(chalk.red(` Cannot reach ${displayUrl(serverUrl)}. Is the server running?`));
|
|
406
|
-
}
|
|
407
|
-
});
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
doConnect();
|
|
411
|
-
|
|
412
|
-
process.on('SIGINT', () => {
|
|
413
|
-
console.log(chalk.dim('\n Disconnecting...'));
|
|
414
|
-
process.exit(0);
|
|
415
|
-
});
|
|
416
|
-
}
|
package/src/launch.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import open from 'open';
|
|
2
|
-
import chalk from 'chalk';
|
|
3
|
-
import { readConfig } from './config.js';
|
|
4
|
-
import { getToken, validateToken } from './auth.js';
|
|
5
|
-
import { startServer } from './server.js';
|
|
6
|
-
import { spawn } from 'child_process';
|
|
7
|
-
import { fileURLToPath } from 'url';
|
|
8
|
-
import { dirname, join } from 'path';
|
|
9
|
-
|
|
10
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
11
|
-
|
|
12
|
-
export async function openHosted() {
|
|
13
|
-
const token = getToken();
|
|
14
|
-
|
|
15
|
-
if (!token) {
|
|
16
|
-
console.log(chalk.yellow('\n No account found. Run `uc login` first.\n'));
|
|
17
|
-
process.exit(1);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
console.log(chalk.dim('\n Validating session...'));
|
|
21
|
-
const user = await validateToken();
|
|
22
|
-
|
|
23
|
-
if (!user) {
|
|
24
|
-
console.log(chalk.yellow(' Session expired. Run `uc login` to re-authenticate.\n'));
|
|
25
|
-
process.exit(1);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const config = readConfig();
|
|
29
|
-
const url = `${config.serverUrl}?token=${encodeURIComponent(token)}`;
|
|
30
|
-
|
|
31
|
-
const name = user.first_name || user.username;
|
|
32
|
-
console.log(chalk.green(` Welcome back, ${chalk.bold(name)}!`));
|
|
33
|
-
console.log(chalk.dim(' Opening Upfyn-Code in your browser...\n'));
|
|
34
|
-
|
|
35
|
-
await open(url);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export async function startLocal() {
|
|
39
|
-
const config = readConfig();
|
|
40
|
-
const port = config.localPort || 3001;
|
|
41
|
-
|
|
42
|
-
console.log(chalk.dim('\n Starting local server...'));
|
|
43
|
-
|
|
44
|
-
// Try the new local-server package first
|
|
45
|
-
const localServerPath = join(__dirname, '../../local-server/index.js');
|
|
46
|
-
|
|
47
|
-
try {
|
|
48
|
-
// Dynamically import the local server
|
|
49
|
-
process.env.PORT = String(port);
|
|
50
|
-
await import(localServerPath);
|
|
51
|
-
|
|
52
|
-
// Auto-open browser after server starts
|
|
53
|
-
setTimeout(async () => {
|
|
54
|
-
const url = `http://localhost:${port}`;
|
|
55
|
-
console.log(chalk.dim(` Opening ${url} in browser...\n`));
|
|
56
|
-
await open(url);
|
|
57
|
-
}, 2000);
|
|
58
|
-
} catch (err) {
|
|
59
|
-
// Fallback: if local-server fails (missing deps), use the old proxy approach
|
|
60
|
-
console.log(chalk.dim(` Local server not available (${err.message}), falling back to proxy mode...`));
|
|
61
|
-
|
|
62
|
-
const token = getToken();
|
|
63
|
-
if (!token) {
|
|
64
|
-
console.log(chalk.yellow('\n No account found. Run `uc login` first.\n'));
|
|
65
|
-
process.exit(1);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const user = await validateToken();
|
|
69
|
-
if (!user) {
|
|
70
|
-
console.log(chalk.yellow(' Session expired. Run `uc login` to re-authenticate.\n'));
|
|
71
|
-
process.exit(1);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const name = user.first_name || user.username;
|
|
75
|
-
console.log(chalk.green(` Welcome back, ${chalk.bold(name)}!`));
|
|
76
|
-
await startServer(port, config.serverUrl, token);
|
|
77
|
-
}
|
|
78
|
-
}
|
package/src/mcp.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
import { readConfig } from './config.js';
|
|
3
|
-
import { getToken, validateToken } from './auth.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Print MCP configuration for Claude / Cursor / other AI tools.
|
|
7
|
-
* Optionally accepts --server and --key overrides.
|
|
8
|
-
*/
|
|
9
|
-
export async function mcp(options = {}) {
|
|
10
|
-
const config = readConfig();
|
|
11
|
-
const serverUrl = options.server || config.serverUrl;
|
|
12
|
-
let relayKey = options.key;
|
|
13
|
-
|
|
14
|
-
// If no key provided, fetch one using auth token
|
|
15
|
-
if (!relayKey) {
|
|
16
|
-
const token = getToken();
|
|
17
|
-
if (!token) {
|
|
18
|
-
console.log(chalk.yellow('\n No account found. Run `uc login` first.\n'));
|
|
19
|
-
process.exit(1);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const user = await validateToken();
|
|
23
|
-
if (!user) {
|
|
24
|
-
console.log(chalk.yellow('\n Session expired. Run `uc login` to re-authenticate.\n'));
|
|
25
|
-
process.exit(1);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
try {
|
|
29
|
-
const res = await fetch(`${serverUrl}/api/auth/connect-token`, {
|
|
30
|
-
headers: { Authorization: `Bearer ${token}` },
|
|
31
|
-
});
|
|
32
|
-
if (!res.ok) throw new Error('Failed to get connect token');
|
|
33
|
-
const data = await res.json();
|
|
34
|
-
relayKey = data.token;
|
|
35
|
-
} catch (err) {
|
|
36
|
-
console.log(chalk.red('\n Could not get connection token. Check your network and try again.\n'));
|
|
37
|
-
process.exit(1);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const mcpConfig = {
|
|
42
|
-
mcpServers: {
|
|
43
|
-
'upfynai-code': {
|
|
44
|
-
url: `${serverUrl}/mcp`,
|
|
45
|
-
headers: {
|
|
46
|
-
Authorization: `Bearer ${relayKey}`,
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
console.log(chalk.bold('\n Upfyn-Code — MCP Integration\n'));
|
|
53
|
-
console.log(chalk.dim(' Add this to your Claude / Cursor MCP settings:\n'));
|
|
54
|
-
console.log(chalk.white(JSON.stringify(mcpConfig, null, 2)));
|
|
55
|
-
console.log('');
|
|
56
|
-
console.log(chalk.dim(' The JSON above contains your MCP URL and authorization header.\n'));
|
|
57
|
-
}
|