upfynai-code 2.6.5 → 2.6.7

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 CHANGED
@@ -5,7 +5,7 @@ import { login, logout, status } from '../src/auth.js';
5
5
  import { openHosted, startLocal } from '../src/launch.js';
6
6
  import { connect } from '../src/connect.js';
7
7
  import { mcp } from '../src/mcp.js';
8
- import { readConfig, writeConfig, DEFAULTS, displayUrl } from '../src/config.js';
8
+ import { readConfig, writeConfig, clearConfig, DEFAULTS, displayUrl } from '../src/config.js';
9
9
  import chalk from 'chalk';
10
10
 
11
11
  const program = new Command();
@@ -13,7 +13,7 @@ const program = new Command();
13
13
  program
14
14
  .name('upfynai-code')
15
15
  .description('Launch Upfyn AI coding environment from your terminal')
16
- .version('2.6.5')
16
+ .version('2.6.7')
17
17
  .option('--local', 'Start a local server instead of opening the hosted app')
18
18
  .action(async (options) => {
19
19
  if (options.local) {
@@ -70,7 +70,7 @@ program
70
70
  .option('--reset', 'Reset config to defaults')
71
71
  .action((options) => {
72
72
  if (options.reset) {
73
- writeConfig({ serverUrl: DEFAULTS.serverUrl, localPort: DEFAULTS.localPort });
73
+ clearConfig();
74
74
  console.log(chalk.green('\n Config reset to defaults.\n'));
75
75
  return;
76
76
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "upfynai-code",
3
- "version": "2.6.5",
3
+ "version": "2.6.7",
4
4
  "description": "Unified AI coding interface — access AI chat, terminal, file explorer, git, and visual canvas from any browser. Connect your local machine and code from anywhere.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/connect.js CHANGED
@@ -166,6 +166,42 @@ async function handleRelayCommand(data, ws) {
166
166
  break;
167
167
  }
168
168
 
169
+ case 'browse-dirs': {
170
+ // Browse directories on user's local machine
171
+ const { dirPath: browsePath } = data;
172
+ const os = await import('os');
173
+ let targetDir = browsePath || os.default.homedir();
174
+ if (targetDir === '~') targetDir = os.default.homedir();
175
+ else if (targetDir.startsWith('~/') || targetDir.startsWith('~\\')) targetDir = path.join(os.default.homedir(), targetDir.slice(2));
176
+ targetDir = path.resolve(targetDir);
177
+
178
+ const entries = await fsPromises.readdir(targetDir, { withFileTypes: true });
179
+ const dirs = entries
180
+ .filter(e => e.isDirectory() && !e.name.startsWith('.'))
181
+ .map(e => ({ name: e.name, path: path.join(targetDir, e.name), type: 'directory' }))
182
+ .sort((a, b) => a.name.localeCompare(b.name));
183
+ ws.send(JSON.stringify({ type: 'relay-response', requestId, data: { path: targetDir, suggestions: dirs, homedir: os.default.homedir() } }));
184
+ break;
185
+ }
186
+
187
+ case 'validate-path': {
188
+ // Check if a path exists on user's machine
189
+ const { targetPath } = data;
190
+ const os2 = await import('os');
191
+ let checkPath = targetPath || '';
192
+ if (checkPath === '~') checkPath = os2.default.homedir();
193
+ else if (checkPath.startsWith('~/') || checkPath.startsWith('~\\')) checkPath = path.join(os2.default.homedir(), checkPath.slice(2));
194
+ checkPath = path.resolve(checkPath);
195
+
196
+ try {
197
+ const stats = await fsPromises.stat(checkPath);
198
+ ws.send(JSON.stringify({ type: 'relay-response', requestId, data: { exists: true, isDirectory: stats.isDirectory(), resolvedPath: checkPath } }));
199
+ } catch {
200
+ ws.send(JSON.stringify({ type: 'relay-response', requestId, data: { exists: false, resolvedPath: checkPath } }));
201
+ }
202
+ break;
203
+ }
204
+
169
205
  case 'git-operation': {
170
206
  const { gitCommand, cwd: gitCwd } = data;
171
207
  console.log(chalk.dim(' [relay] Running git operation...'));