upfynai-code 2.9.7 → 2.9.9
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/client/dist/assets/{AppContent-BXZDeSIC.js → AppContent-CapWOZnI.js} +3 -3
- package/client/dist/assets/{CanvasFullScreen-mnpCnLZ9.js → CanvasFullScreen-WOseUyrD.js} +1 -1
- package/client/dist/assets/{CanvasWorkspace-4CqmjAVQ.js → CanvasWorkspace-DksIgrfl.js} +1 -1
- package/client/dist/assets/{DashboardPanel-zFIFlw56.js → DashboardPanel-DmHbSyTP.js} +1 -1
- package/client/dist/assets/{FileTree-B0c_GaB3.js → FileTree-CbJF7m5P.js} +1 -1
- package/client/dist/assets/{GitPanel-DUP4zVU4.js → GitPanel-avzqm9Zj.js} +1 -1
- package/client/dist/assets/{LoginModal-BRycfsyD.js → LoginModal-Bk9mxZsi.js} +1 -1
- package/client/dist/assets/{Onboarding-BcnaZZ0o.js → Onboarding-CaiBrbYB.js} +1 -1
- package/client/dist/assets/{SetupForm-S0g6u5yT.js → SetupForm-DuIDpVGw.js} +1 -1
- package/client/dist/assets/{WorkflowsPanel-CouH9JDO.js → WorkflowsPanel-BOaVEpdu.js} +1 -1
- package/client/dist/assets/{index-CNDcVl2g.js → index-DtIQCXd6.js} +3 -3
- package/client/dist/index.html +1 -1
- package/package.json +5 -3
- package/server/cli.js +8 -2
- package/server/database/db.js +9 -1
- package/server/relay-client.js +11 -4
- package/server/routes/auth.js +7 -2
- package/server/utils/email.js +7 -2
package/server/cli.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
3
|
* Upfyn-Code CLI
|
|
4
4
|
* by Thinqmesh Technologies
|
|
@@ -46,6 +46,12 @@ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
|
|
46
46
|
const CONFIG_DIR = path.join(os.homedir(), '.upfynai');
|
|
47
47
|
const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
|
|
48
48
|
|
|
49
|
+
/** Mask internal Railway URL for display */
|
|
50
|
+
function displayServerUrl(url) {
|
|
51
|
+
if (!url || url === 'https://upfynai-code-production.up.railway.app') return 'Upfyn Cloud';
|
|
52
|
+
try { return new URL(url).host; } catch { return url; }
|
|
53
|
+
}
|
|
54
|
+
|
|
49
55
|
// Load environment variables from .env file if it exists
|
|
50
56
|
function loadEnvFile() {
|
|
51
57
|
try {
|
|
@@ -351,7 +357,7 @@ async function launchInteractive() {
|
|
|
351
357
|
// 5. Show launch screen
|
|
352
358
|
showLaunchScreen(packageJson.version, claudeBin, {
|
|
353
359
|
relayStatus: config.relayKey && config.server
|
|
354
|
-
? `Auto-connecting to ${config.server}`
|
|
360
|
+
? `Auto-connecting to ${displayServerUrl(config.server)}`
|
|
355
361
|
: null,
|
|
356
362
|
apiKey: config.anthropicApiKey || null,
|
|
357
363
|
});
|
package/server/database/db.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
let createClient;
|
|
2
|
+
try {
|
|
3
|
+
createClient = (await import('@libsql/client')).createClient;
|
|
4
|
+
} catch (e) {
|
|
5
|
+
console.warn('[DB] @libsql/client not available — cloud database features disabled.', e?.message || '');
|
|
6
|
+
}
|
|
2
7
|
import path from 'path';
|
|
3
8
|
import fs from 'fs';
|
|
4
9
|
import crypto from 'crypto';
|
|
@@ -44,6 +49,9 @@ function resolveDbConfig() {
|
|
|
44
49
|
|
|
45
50
|
function getDb() {
|
|
46
51
|
if (!_db) {
|
|
52
|
+
if (!createClient) {
|
|
53
|
+
throw new Error('[DB] @libsql/client is not installed. Run: npm install @libsql/client');
|
|
54
|
+
}
|
|
47
55
|
resolveDbConfig();
|
|
48
56
|
_db = createClient({ url: _dbUrl, ...(_dbAuthToken ? { authToken: _dbAuthToken } : {}) });
|
|
49
57
|
}
|
package/server/relay-client.js
CHANGED
|
@@ -36,6 +36,13 @@ try {
|
|
|
36
36
|
|
|
37
37
|
const CONFIG_DIR = path.join(os.homedir(), '.upfynai');
|
|
38
38
|
const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
|
|
39
|
+
const CLOUD_SERVER = 'https://upfynai-code-production.up.railway.app';
|
|
40
|
+
|
|
41
|
+
/** Mask internal server URL for display */
|
|
42
|
+
function displayUrl(url) {
|
|
43
|
+
if (!url || url === CLOUD_SERVER) return 'Upfyn Cloud (cli.upfyn.com)';
|
|
44
|
+
try { return new URL(url).host; } catch { return url; }
|
|
45
|
+
}
|
|
39
46
|
|
|
40
47
|
function loadConfig() {
|
|
41
48
|
try {
|
|
@@ -163,7 +170,7 @@ function createRelayConnection(wsUrl, config = {}) {
|
|
|
163
170
|
*/
|
|
164
171
|
export async function connectToServer(options = {}) {
|
|
165
172
|
const config = loadConfig();
|
|
166
|
-
const serverUrl = options.server || config.server ||
|
|
173
|
+
const serverUrl = options.server || config.server || CLOUD_SERVER;
|
|
167
174
|
const relayKey = options.key || config.relayKey;
|
|
168
175
|
|
|
169
176
|
if (!relayKey) {
|
|
@@ -182,7 +189,7 @@ export async function connectToServer(options = {}) {
|
|
|
182
189
|
|
|
183
190
|
saveConfig({ ...config, server: serverUrl, relayKey });
|
|
184
191
|
|
|
185
|
-
await showConnectStartup(serverUrl, os.hostname(), os.userInfo().username, VERSION);
|
|
192
|
+
await showConnectStartup(displayUrl(serverUrl), os.hostname(), os.userInfo().username, VERSION);
|
|
186
193
|
|
|
187
194
|
const wsUrl = serverUrl.replace(/^http/, 'ws') + '/relay?token=' + encodeURIComponent(relayKey);
|
|
188
195
|
|
|
@@ -210,7 +217,7 @@ export async function connectToServer(options = {}) {
|
|
|
210
217
|
spinner.stop('Connected!');
|
|
211
218
|
const nameMatch = data.message?.match(/Connected as (.+?)\./);
|
|
212
219
|
const username = nameMatch ? nameMatch[1] : 'Unknown';
|
|
213
|
-
showConnectionBanner(username, serverUrl);
|
|
220
|
+
showConnectionBanner(username, displayUrl(serverUrl));
|
|
214
221
|
|
|
215
222
|
const agents = detectInstalledAgents();
|
|
216
223
|
const installed = Object.entries(agents)
|
|
@@ -271,7 +278,7 @@ export async function connectToServer(options = {}) {
|
|
|
271
278
|
|
|
272
279
|
ws.on('error', (err) => {
|
|
273
280
|
if (err.code === 'ECONNREFUSED') {
|
|
274
|
-
spinner.fail(`Cannot reach ${serverUrl}. Is the server running?`);
|
|
281
|
+
spinner.fail(`Cannot reach ${displayUrl(serverUrl)}. Is the server running?`);
|
|
275
282
|
} else if (err.message?.includes('401')) {
|
|
276
283
|
spinner.fail('Authentication failed (401). Your relay token may be invalid or expired.');
|
|
277
284
|
logRelayEvent('!', 'Get a new token from the dashboard: https://cli.upfyn.com/dashboard', 'yellow');
|
package/server/routes/auth.js
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
2
|
import crypto from 'crypto';
|
|
3
3
|
// bcrypt removed — plaintext password storage for admin access
|
|
4
|
-
|
|
4
|
+
let OAuth2Client;
|
|
5
|
+
try {
|
|
6
|
+
OAuth2Client = (await import('google-auth-library')).OAuth2Client;
|
|
7
|
+
} catch {
|
|
8
|
+
// google-auth-library not available — Google OAuth will be disabled
|
|
9
|
+
}
|
|
5
10
|
import { db, userDb, subscriptionDb, relayTokensDb, apiKeysDb, resetTokenDb } from '../database/db.js';
|
|
6
11
|
import { generateToken, authenticateToken, setSessionCookie, clearSessionCookie } from '../middleware/auth.js';
|
|
7
12
|
import { sendPasswordResetEmail } from '../utils/email.js';
|
|
8
13
|
|
|
9
|
-
const googleClient = process.env.GOOGLE_CLIENT_ID ? new OAuth2Client(process.env.GOOGLE_CLIENT_ID) : null;
|
|
14
|
+
const googleClient = (process.env.GOOGLE_CLIENT_ID && OAuth2Client) ? new OAuth2Client(process.env.GOOGLE_CLIENT_ID) : null;
|
|
10
15
|
|
|
11
16
|
const router = express.Router();
|
|
12
17
|
|
package/server/utils/email.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
let Resend;
|
|
2
|
+
try {
|
|
3
|
+
Resend = (await import('resend')).Resend;
|
|
4
|
+
} catch {
|
|
5
|
+
// resend not available — email features will be disabled
|
|
6
|
+
}
|
|
2
7
|
|
|
3
|
-
const resend = process.env.RESEND_API_KEY ? new Resend(process.env.RESEND_API_KEY) : null;
|
|
8
|
+
const resend = (process.env.RESEND_API_KEY && Resend) ? new Resend(process.env.RESEND_API_KEY) : null;
|
|
4
9
|
|
|
5
10
|
const FROM_EMAIL = process.env.FROM_EMAIL || 'Upfyn Code <noreply@upfyn.com>';
|
|
6
11
|
const APP_URL = process.env.APP_URL || 'https://cli.upfyn.com';
|