claude-relay 2.1.0 → 2.1.1
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 +16 -1
- package/lib/public/app.js +4 -2
- package/lib/sessions.js +0 -1
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -6,7 +6,7 @@ var path = require("path");
|
|
|
6
6
|
var { execSync, execFileSync, spawn } = require("child_process");
|
|
7
7
|
var qrcode = require("qrcode-terminal");
|
|
8
8
|
var net = require("net");
|
|
9
|
-
var { loadConfig, saveConfig, configPath, socketPath, logPath, ensureConfigDir, isDaemonAlive, isDaemonAliveAsync, generateSlug, clearStaleConfig, loadClayrc } = require("../lib/config");
|
|
9
|
+
var { loadConfig, saveConfig, configPath, socketPath, logPath, ensureConfigDir, isDaemonAlive, isDaemonAliveAsync, generateSlug, clearStaleConfig, loadClayrc, saveClayrc } = require("../lib/config");
|
|
10
10
|
var { sendIPCCommand } = require("../lib/ipc");
|
|
11
11
|
var { generateAuthToken } = require("../lib/server");
|
|
12
12
|
|
|
@@ -809,6 +809,21 @@ function promptRestoreProjects(projects, callback) {
|
|
|
809
809
|
});
|
|
810
810
|
|
|
811
811
|
promptMultiSelect("Restore projects", items, function (selected) {
|
|
812
|
+
// Remove unselected projects from ~/.clayrc
|
|
813
|
+
if (selected.length < projects.length) {
|
|
814
|
+
var selectedPaths = {};
|
|
815
|
+
for (var si = 0; si < selected.length; si++) {
|
|
816
|
+
selectedPaths[selected[si].path] = true;
|
|
817
|
+
}
|
|
818
|
+
try {
|
|
819
|
+
var rc = loadClayrc();
|
|
820
|
+
rc.recentProjects = (rc.recentProjects || []).filter(function (p) {
|
|
821
|
+
return selectedPaths[p.path];
|
|
822
|
+
});
|
|
823
|
+
saveClayrc(rc);
|
|
824
|
+
} catch (e) {}
|
|
825
|
+
}
|
|
826
|
+
|
|
812
827
|
log(sym.bar);
|
|
813
828
|
if (selected.length > 0) {
|
|
814
829
|
log(sym.done + " " + a.green + "Restoring " + selected.length + (selected.length === 1 ? " project" : " projects") + a.reset);
|
package/lib/public/app.js
CHANGED
|
@@ -46,11 +46,13 @@ import { initTools, resetToolState, saveToolState, restoreToolState, renderAskUs
|
|
|
46
46
|
var projectHint = $("project-hint");
|
|
47
47
|
var projectHintDismiss = $("project-hint-dismiss");
|
|
48
48
|
var cachedProjects = [];
|
|
49
|
+
var cachedProjectCount = 0;
|
|
49
50
|
var currentSlug = slugMatch ? slugMatch[1] : null;
|
|
50
51
|
|
|
51
52
|
function updateProjectSwitcher(msg) {
|
|
52
|
-
|
|
53
|
-
cachedProjects = msg.projects
|
|
53
|
+
if (typeof msg.projectCount === "number") cachedProjectCount = msg.projectCount;
|
|
54
|
+
if (msg.projects) cachedProjects = msg.projects;
|
|
55
|
+
var count = cachedProjectCount || 0;
|
|
54
56
|
projectSwitcherName.textContent = projectName || "Project";
|
|
55
57
|
projectSwitcherCount.textContent = count ? count + (count === 1 ? " project" : " projects") : "";
|
|
56
58
|
if (count === 1 && projectHint) {
|
package/lib/sessions.js
CHANGED
|
@@ -187,7 +187,6 @@ function createSessionManager(opts) {
|
|
|
187
187
|
var session = sessions.get(localId);
|
|
188
188
|
if (!session) return;
|
|
189
189
|
|
|
190
|
-
session.lastActivity = Date.now();
|
|
191
190
|
activeSessionId = localId;
|
|
192
191
|
send({ type: "session_switched", id: localId, cliSessionId: session.cliSessionId || null });
|
|
193
192
|
broadcastSessionList();
|