upfynai-code 2.6.6 → 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 +1 -1
- package/package.json +1 -1
- package/src/connect.js +36 -0
package/bin/cli.js
CHANGED
|
@@ -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.
|
|
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) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "upfynai-code",
|
|
3
|
-
"version": "2.6.
|
|
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...'));
|