cc-hub-cli 1.1.2 → 1.1.4
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/dist/index.js +33 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -39,7 +39,11 @@ var MacOSDesktopApp = class {
|
|
|
39
39
|
return this.isInstalled() ? path.join(this.supportDir, "local-agent-mode-sessions") : void 0;
|
|
40
40
|
}
|
|
41
41
|
getConfigLibrary() {
|
|
42
|
-
|
|
42
|
+
if (!this.isInstalled()) return void 0;
|
|
43
|
+
const configLib = path.join(this.supportDir, "configLibrary");
|
|
44
|
+
if (fs.existsSync(path.join(configLib, "_meta.json"))) return configLib;
|
|
45
|
+
if (fs.existsSync(configLib)) return configLib;
|
|
46
|
+
return configLib;
|
|
43
47
|
}
|
|
44
48
|
findBinary() {
|
|
45
49
|
const claudeCodeDir = path.join(this.supportDir, "claude-code");
|
|
@@ -60,10 +64,10 @@ var MacOSDesktopApp = class {
|
|
|
60
64
|
var WindowsDesktopApp = class {
|
|
61
65
|
_buildCandidates() {
|
|
62
66
|
const candidates = [
|
|
63
|
-
path.join(process.env.APPDATA || path.join(os.homedir(), "AppData", "Roaming"), "Claude"),
|
|
64
67
|
path.join(process.env.APPDATA || path.join(os.homedir(), "AppData", "Roaming"), "Claude-3p"),
|
|
65
|
-
path.join(process.env.
|
|
66
|
-
path.join(process.env.LOCALAPPDATA || path.join(os.homedir(), "AppData", "Local"), "Claude-3p")
|
|
68
|
+
path.join(process.env.APPDATA || path.join(os.homedir(), "AppData", "Roaming"), "Claude"),
|
|
69
|
+
path.join(process.env.LOCALAPPDATA || path.join(os.homedir(), "AppData", "Local"), "Claude-3p"),
|
|
70
|
+
path.join(process.env.LOCALAPPDATA || path.join(os.homedir(), "AppData", "Local"), "Claude")
|
|
67
71
|
];
|
|
68
72
|
const packagesDir = path.join(
|
|
69
73
|
process.env.LOCALAPPDATA || path.join(os.homedir(), "AppData", "Local"),
|
|
@@ -74,8 +78,8 @@ var WindowsDesktopApp = class {
|
|
|
74
78
|
const entries = fs.readdirSync(packagesDir);
|
|
75
79
|
for (const entry of entries) {
|
|
76
80
|
if (entry.startsWith("Claude_")) {
|
|
77
|
-
candidates.push(path.join(packagesDir, entry, "LocalCache", "Roaming", "Claude"));
|
|
78
81
|
candidates.push(path.join(packagesDir, entry, "LocalCache", "Roaming", "Claude-3p"));
|
|
82
|
+
candidates.push(path.join(packagesDir, entry, "LocalCache", "Roaming", "Claude"));
|
|
79
83
|
}
|
|
80
84
|
}
|
|
81
85
|
} catch {
|
|
@@ -95,14 +99,34 @@ var WindowsDesktopApp = class {
|
|
|
95
99
|
getSupportDir() {
|
|
96
100
|
return this._findSupportDir();
|
|
97
101
|
}
|
|
98
|
-
getSessionsDir() {
|
|
99
|
-
const dir = this._findSupportDir();
|
|
100
|
-
return dir ? path.join(dir, "local-agent-mode-sessions") : void 0;
|
|
101
|
-
}
|
|
102
102
|
getConfigLibrary() {
|
|
103
|
+
const candidates = this._buildCandidates();
|
|
104
|
+
for (const dir2 of candidates) {
|
|
105
|
+
const configLib = path.join(dir2, "configLibrary");
|
|
106
|
+
if (fs.existsSync(path.join(configLib, "_meta.json"))) {
|
|
107
|
+
return configLib;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
for (const dir2 of candidates) {
|
|
111
|
+
const configLib = path.join(dir2, "configLibrary");
|
|
112
|
+
if (fs.existsSync(configLib)) {
|
|
113
|
+
return configLib;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
103
116
|
const dir = this._findSupportDir();
|
|
104
117
|
return dir ? path.join(dir, "configLibrary") : void 0;
|
|
105
118
|
}
|
|
119
|
+
getSessionsDir() {
|
|
120
|
+
const candidates = this._buildCandidates();
|
|
121
|
+
for (const dir2 of candidates) {
|
|
122
|
+
const sessionsDir = path.join(dir2, "local-agent-mode-sessions");
|
|
123
|
+
if (fs.existsSync(sessionsDir)) {
|
|
124
|
+
return sessionsDir;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
const dir = this._findSupportDir();
|
|
128
|
+
return dir ? path.join(dir, "local-agent-mode-sessions") : void 0;
|
|
129
|
+
}
|
|
106
130
|
findBinary() {
|
|
107
131
|
const win32Binary = path.join(process.env.LOCALAPPDATA || "", "Programs", "Claude", "Claude.exe");
|
|
108
132
|
if (fs.existsSync(win32Binary)) return win32Binary;
|