coding-tool-x 3.5.6 → 3.5.8
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/README.md +17 -0
- package/bin/ctx.js +6 -1
- package/dist/web/assets/{Analytics-CRNCHeui.js → Analytics-BzoNzfbi.js} +2 -2
- package/dist/web/assets/Analytics-vQS5IWvs.css +1 -0
- package/dist/web/assets/{ConfigTemplates-C0erJdo2.js → ConfigTemplates-O4ikBt1o.js} +1 -1
- package/dist/web/assets/{Home-CL5z6Q4d.js → Home-BQjsnblU.js} +1 -1
- package/dist/web/assets/Home-qzk118Of.css +1 -0
- package/dist/web/assets/{PluginManager-hDx0XMO_.js → PluginManager-DS_DJnVc.js} +1 -1
- package/dist/web/assets/ProjectList-CqYDtsHx.js +1 -0
- package/dist/web/assets/ProjectList-GCC2QOmq.css +1 -0
- package/dist/web/assets/SessionList-CfPtcq6Y.css +1 -0
- package/dist/web/assets/SessionList-DMlLtMCz.js +1 -0
- package/dist/web/assets/{SkillManager-D6Vwpajh.js → SkillManager-DpNE02r0.js} +1 -1
- package/dist/web/assets/{WorkspaceManager-C3TjeOPy.js → WorkspaceManager-DMY7_SHh.js} +1 -1
- package/dist/web/assets/icons-CEq2hYB-.js +1 -0
- package/dist/web/assets/index-Clf0l3wc.js +2 -0
- package/dist/web/assets/index-Dih_bOsv.css +1 -0
- package/dist/web/assets/{naive-ui-BaTCPPL5.js → naive-ui-Cg4_ZeoT.js} +1 -1
- package/dist/web/assets/{vendors-Fza9uSYn.js → vendors-Bsp-dq2d.js} +1 -1
- package/dist/web/assets/vue-vendor-BxIT0uQq.js +45 -0
- package/dist/web/index.html +7 -7
- package/docs/Caddyfile.example +19 -0
- package/docs/reverse-proxy-https.md +57 -0
- package/package.json +2 -1
- package/src/commands/daemon.js +33 -5
- package/src/commands/export-config.js +6 -6
- package/src/commands/ui.js +12 -3
- package/src/config/default.js +2 -6
- package/src/config/loader.js +2 -2
- package/src/config/paths.js +166 -33
- package/src/index.js +124 -34
- package/src/server/api/agents.js +52 -2
- package/src/server/api/commands.js +38 -2
- package/src/server/api/plugins.js +104 -1
- package/src/server/api/sessions.js +5 -5
- package/src/server/index.js +25 -5
- package/src/server/services/agents-service.js +269 -62
- package/src/server/services/commands-service.js +281 -81
- package/src/server/services/config-export-service.js +7 -7
- package/src/server/services/config-registry-service.js +4 -5
- package/src/server/services/config-sync-manager.js +61 -41
- package/src/server/services/config-sync-service.js +3 -3
- package/src/server/services/gemini-channels.js +5 -5
- package/src/server/services/gemini-config.js +3 -4
- package/src/server/services/gemini-sessions.js +23 -20
- package/src/server/services/gemini-settings-manager.js +2 -3
- package/src/server/services/https-cert.js +171 -0
- package/src/server/services/mcp-service.js +9 -14
- package/src/server/services/native-oauth-adapters.js +3 -3
- package/src/server/services/network-access.js +47 -2
- package/src/server/services/notification-hooks.js +11 -5
- package/src/server/services/opencode-sessions.js +4 -4
- package/src/server/services/opencode-settings-manager.js +3 -3
- package/src/server/services/plugins-service.js +499 -23
- package/src/server/services/prompts-service.js +5 -9
- package/src/server/services/sessions.js +2 -2
- package/src/server/services/skill-service.js +155 -18
- package/src/server/services/web-ui-runtime.js +54 -0
- package/src/server/websocket-server.js +11 -4
- package/dist/web/assets/Analytics-RNn1BUbG.css +0 -1
- package/dist/web/assets/Home-BQxQ1LhR.css +0 -1
- package/dist/web/assets/ProjectList-BNsz96av.js +0 -1
- package/dist/web/assets/ProjectList-DL4JK6ci.css +0 -1
- package/dist/web/assets/SessionList-B8dXVXfi.css +0 -1
- package/dist/web/assets/SessionList-CG1UhFo3.js +0 -1
- package/dist/web/assets/icons-CQuif85v.js +0 -1
- package/dist/web/assets/index-GuER-BmS.js +0 -2
- package/dist/web/assets/index-VGAxnLqi.css +0 -1
- package/dist/web/assets/vue-vendor-aWwwFAao.js +0 -45
|
@@ -2,7 +2,7 @@ const fs = require('fs');
|
|
|
2
2
|
const path = require('path');
|
|
3
3
|
const archiver = require('archiver');
|
|
4
4
|
const chalk = require('chalk');
|
|
5
|
-
const { HOME_DIR } = require('../config/paths');
|
|
5
|
+
const { HOME_DIR, NATIVE_PATHS, joinNativeBasePath } = require('../config/paths');
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* 导出 Claude Code 配置为 ZIP 压缩包
|
|
@@ -15,7 +15,7 @@ async function exportConfig(options = {}) {
|
|
|
15
15
|
console.log(chalk.blue('[START] 开始导出 Claude Code 配置...'));
|
|
16
16
|
|
|
17
17
|
const homeDir = HOME_DIR;
|
|
18
|
-
const claudeDir =
|
|
18
|
+
const claudeDir = NATIVE_PATHS.claude.dir;
|
|
19
19
|
const currentDir = process.cwd();
|
|
20
20
|
|
|
21
21
|
// 检查 .claude 目录是否存在
|
|
@@ -54,7 +54,7 @@ async function exportConfig(options = {}) {
|
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
// 1. 导出全局 CLAUDE.md
|
|
57
|
-
const globalClaudeMd =
|
|
57
|
+
const globalClaudeMd = NATIVE_PATHS.claude.prompt;
|
|
58
58
|
if (fs.existsSync(globalClaudeMd)) {
|
|
59
59
|
archive.file(globalClaudeMd, { name: 'global/CLAUDE.md' });
|
|
60
60
|
manifest.globalConfig.claudeMd = true;
|
|
@@ -63,7 +63,7 @@ async function exportConfig(options = {}) {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
// 2. 导出 settings.json
|
|
66
|
-
const settingsJson =
|
|
66
|
+
const settingsJson = NATIVE_PATHS.claude.settings;
|
|
67
67
|
if (fs.existsSync(settingsJson)) {
|
|
68
68
|
archive.file(settingsJson, { name: 'global/settings.json' });
|
|
69
69
|
manifest.globalConfig.settings = true;
|
|
@@ -89,7 +89,7 @@ async function exportConfig(options = {}) {
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
// 3. 导出 Skills
|
|
92
|
-
const skillsDir =
|
|
92
|
+
const skillsDir = NATIVE_PATHS.claude.skills;
|
|
93
93
|
if (fs.existsSync(skillsDir)) {
|
|
94
94
|
const skills = fs.readdirSync(skillsDir).filter(f => !f.startsWith('.'));
|
|
95
95
|
if (skills.length > 0) {
|
|
@@ -121,7 +121,7 @@ async function exportConfig(options = {}) {
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
// 项目级 workspace CLAUDE.md
|
|
124
|
-
const workspaceClaudeMd =
|
|
124
|
+
const workspaceClaudeMd = joinNativeBasePath(homeDir, 'workspace', 'CLAUDE.md');
|
|
125
125
|
if (fs.existsSync(workspaceClaudeMd)) {
|
|
126
126
|
archive.file(workspaceClaudeMd, { name: 'workspace/CLAUDE.md' });
|
|
127
127
|
manifest.projectConfig.workspaceClaudeMd = true;
|
package/src/commands/ui.js
CHANGED
|
@@ -3,6 +3,7 @@ const { startServer } = require('../server');
|
|
|
3
3
|
const open = require('open');
|
|
4
4
|
const { getProxyStatus } = require('../server/proxy-server');
|
|
5
5
|
const { loadConfig } = require('../config/loader');
|
|
6
|
+
const { isHttpsEnabled, getWebUiBaseUrl } = require('../server/services/web-ui-runtime');
|
|
6
7
|
|
|
7
8
|
async function handleUI() {
|
|
8
9
|
// 检查是否为 daemon 模式(PM2 启动)
|
|
@@ -11,6 +12,8 @@ async function handleUI() {
|
|
|
11
12
|
// 检查是否启用 LAN 访问 (--host 标志)
|
|
12
13
|
const enableHost = process.argv.includes('--host');
|
|
13
14
|
const host = enableHost ? '0.0.0.0' : '127.0.0.1';
|
|
15
|
+
const httpsEnabled = isHttpsEnabled();
|
|
16
|
+
process.env.CC_TOOL_WEB_UI_PROTOCOL = httpsEnabled ? 'https' : 'http';
|
|
14
17
|
|
|
15
18
|
if (!isDaemon) {
|
|
16
19
|
console.clear();
|
|
@@ -18,15 +21,21 @@ async function handleUI() {
|
|
|
18
21
|
if (enableHost) {
|
|
19
22
|
console.log(chalk.yellow('[WARN] LAN 访问已启用 (--host)\n'));
|
|
20
23
|
}
|
|
24
|
+
if (httpsEnabled) {
|
|
25
|
+
console.log(chalk.yellow('[LOCK] 已启用原生 HTTPS (--https)\n'));
|
|
26
|
+
}
|
|
21
27
|
}
|
|
22
28
|
|
|
23
29
|
// 从配置加载端口
|
|
24
30
|
const config = loadConfig();
|
|
25
31
|
const port = config.ports?.webUI || 19999;
|
|
26
|
-
const url =
|
|
32
|
+
const url = getWebUiBaseUrl(port, {
|
|
33
|
+
https: httpsEnabled,
|
|
34
|
+
hostname: httpsEnabled ? '127.0.0.1' : 'localhost'
|
|
35
|
+
});
|
|
27
36
|
|
|
28
37
|
try {
|
|
29
|
-
await startServer(port, host);
|
|
38
|
+
await startServer(port, host, { https: httpsEnabled });
|
|
30
39
|
|
|
31
40
|
// 自动打开浏览器(仅非 daemon 模式)
|
|
32
41
|
if (!isDaemon) {
|
|
@@ -87,7 +96,7 @@ async function handleUI() {
|
|
|
87
96
|
console.log(chalk.gray('按 Ctrl+C 停止服务器'));
|
|
88
97
|
} else {
|
|
89
98
|
// Daemon 模式:保持运行
|
|
90
|
-
console.log(chalk.green(`[OK] Coding-Tool 服务已在后台启动 (端口: ${port})`));
|
|
99
|
+
console.log(chalk.green(`[OK] Coding-Tool 服务已在后台启动 (${httpsEnabled ? 'HTTPS' : 'HTTP'}, 端口: ${port})`));
|
|
91
100
|
}
|
|
92
101
|
|
|
93
102
|
} catch (error) {
|
package/src/config/default.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
// 默认配置
|
|
2
|
-
const
|
|
3
|
-
const os = require('os');
|
|
4
|
-
const { resolvePreferredHomeDir } = require('../utils/home-dir');
|
|
2
|
+
const { NATIVE_PATHS } = require('./paths');
|
|
5
3
|
const modelMetadataConfig = require('./model-metadata.json');
|
|
6
4
|
|
|
7
|
-
const HOME_DIR = resolvePreferredHomeDir(process.platform, process.env, os.homedir());
|
|
8
|
-
|
|
9
5
|
const DEFAULT_CONFIG = {
|
|
10
|
-
projectsDir:
|
|
6
|
+
projectsDir: NATIVE_PATHS.claude.projects,
|
|
11
7
|
defaultProject: null,
|
|
12
8
|
maxDisplaySessions: 100,
|
|
13
9
|
pageSize: 15,
|
package/src/config/loader.js
CHANGED
|
@@ -3,7 +3,7 @@ const fs = require('fs');
|
|
|
3
3
|
const path = require('path');
|
|
4
4
|
const os = require('os');
|
|
5
5
|
const DEFAULT_CONFIG = require('./default');
|
|
6
|
-
const { PATHS, ensureStorageDirMigrated } = require('./paths');
|
|
6
|
+
const { PATHS, ensureStorageDirMigrated, joinNativeBasePath } = require('./paths');
|
|
7
7
|
const { resolvePreferredHomeDir } = require('../utils/home-dir');
|
|
8
8
|
const eventBus = require('../plugins/event-bus');
|
|
9
9
|
|
|
@@ -11,7 +11,7 @@ const HOME_DIR = resolvePreferredHomeDir(process.platform, process.env, os.homed
|
|
|
11
11
|
|
|
12
12
|
const LEGACY_CONFIG_FILES = [
|
|
13
13
|
path.join(__dirname, '../../config.json'),
|
|
14
|
-
|
|
14
|
+
joinNativeBasePath(HOME_DIR, '.claude', 'config.json')
|
|
15
15
|
];
|
|
16
16
|
|
|
17
17
|
function getConfigFilePath() {
|
package/src/config/paths.js
CHANGED
|
@@ -28,6 +28,9 @@ const REPOS_SKILLS_DIR = path.join(REPOS_DIR, 'skills');
|
|
|
28
28
|
const REPOS_PLUGINS_DIR = path.join(REPOS_DIR, 'plugins');
|
|
29
29
|
const LOCAL_DIR = path.join(STORAGE_DIR, 'local');
|
|
30
30
|
const LOCAL_SKILLS_DIR = path.join(LOCAL_DIR, 'skills');
|
|
31
|
+
const LOCAL_COMMANDS_DIR = path.join(LOCAL_DIR, 'commands');
|
|
32
|
+
const LOCAL_AGENTS_DIR = path.join(LOCAL_DIR, 'agents');
|
|
33
|
+
const LOCAL_PLUGINS_DIR = path.join(LOCAL_DIR, 'plugins');
|
|
31
34
|
const REQUESTS_DIR = path.join(STORAGE_DIR, 'requests');
|
|
32
35
|
const BACKUPS_DIR = path.join(STORAGE_DIR, 'backups');
|
|
33
36
|
const SCRIPTS_DIR = path.join(STORAGE_DIR, 'scripts');
|
|
@@ -39,8 +42,8 @@ const LEGACY_STATS_DIR = path.join(LEGACY_DIR, 'stats');
|
|
|
39
42
|
|
|
40
43
|
// 旧目录(升级时自动合并到 ~/.cc-tool)
|
|
41
44
|
const LEGACY_BASE_DIRS = [
|
|
42
|
-
|
|
43
|
-
|
|
45
|
+
joinNativeBasePath(HOME_DIR, '.claude', 'ctx'),
|
|
46
|
+
joinNativeBasePath(HOME_DIR, '.claude', 'cc-tool')
|
|
44
47
|
];
|
|
45
48
|
|
|
46
49
|
let migrationChecked = false;
|
|
@@ -450,6 +453,12 @@ const PATHS = {
|
|
|
450
453
|
|
|
451
454
|
// 脚本
|
|
452
455
|
notifyHook: path.join(SCRIPTS_DIR, 'notify-hook.js'),
|
|
456
|
+
https: {
|
|
457
|
+
dir: path.join(CONFIG_DIR, 'https'),
|
|
458
|
+
key: path.join(CONFIG_DIR, 'https', 'localhost-key.pem'),
|
|
459
|
+
cert: path.join(CONFIG_DIR, 'https', 'localhost-cert.pem'),
|
|
460
|
+
meta: path.join(CONFIG_DIR, 'https', 'localhost-meta.json')
|
|
461
|
+
},
|
|
453
462
|
|
|
454
463
|
// 技能与插件(cc-tool 托管部分)
|
|
455
464
|
localSkills: {
|
|
@@ -458,6 +467,19 @@ const PATHS = {
|
|
|
458
467
|
gemini: path.join(LOCAL_SKILLS_DIR, 'gemini'),
|
|
459
468
|
opencode: path.join(LOCAL_SKILLS_DIR, 'opencode')
|
|
460
469
|
},
|
|
470
|
+
localCommands: {
|
|
471
|
+
claude: path.join(LOCAL_COMMANDS_DIR, 'claude'),
|
|
472
|
+
opencode: path.join(LOCAL_COMMANDS_DIR, 'opencode')
|
|
473
|
+
},
|
|
474
|
+
localAgents: {
|
|
475
|
+
claude: path.join(LOCAL_AGENTS_DIR, 'claude'),
|
|
476
|
+
codex: path.join(LOCAL_AGENTS_DIR, 'codex'),
|
|
477
|
+
opencode: path.join(LOCAL_AGENTS_DIR, 'opencode')
|
|
478
|
+
},
|
|
479
|
+
localPlugins: {
|
|
480
|
+
claude: path.join(LOCAL_PLUGINS_DIR, 'claude'),
|
|
481
|
+
opencode: path.join(LOCAL_PLUGINS_DIR, 'opencode')
|
|
482
|
+
},
|
|
461
483
|
skillRepos: {
|
|
462
484
|
claude: path.join(REPOS_SKILLS_DIR, 'claude.json'),
|
|
463
485
|
codex: path.join(REPOS_SKILLS_DIR, 'codex.json'),
|
|
@@ -480,7 +502,7 @@ const PATHS = {
|
|
|
480
502
|
},
|
|
481
503
|
|
|
482
504
|
// 原生路径兼容
|
|
483
|
-
skills:
|
|
505
|
+
skills: getNativePlatformSkillsDir('claude'),
|
|
484
506
|
|
|
485
507
|
// 旧版本遗留文件搬迁目标
|
|
486
508
|
legacy: {
|
|
@@ -709,15 +731,15 @@ function pickExistingDir(candidates, fallback) {
|
|
|
709
731
|
}
|
|
710
732
|
|
|
711
733
|
function getClaudeConfigDir() {
|
|
712
|
-
return resolveExistingEnvPath(process.env.CLAUDE_CONFIG_DIR) ||
|
|
734
|
+
return resolveExistingEnvPath(process.env.CLAUDE_CONFIG_DIR) || joinNativeBasePath(HOME_DIR, '.claude');
|
|
713
735
|
}
|
|
714
736
|
|
|
715
737
|
function getCodexDir() {
|
|
716
|
-
return resolveExistingEnvPath(process.env.CODEX_HOME) ||
|
|
738
|
+
return resolveExistingEnvPath(process.env.CODEX_HOME) || joinNativeBasePath(HOME_DIR, '.codex');
|
|
717
739
|
}
|
|
718
740
|
|
|
719
741
|
function getGeminiDir() {
|
|
720
|
-
return
|
|
742
|
+
return joinNativeBasePath(HOME_DIR, '.gemini');
|
|
721
743
|
}
|
|
722
744
|
|
|
723
745
|
function getOpenCodeDataDir() {
|
|
@@ -756,49 +778,151 @@ function getOpenCodeConfigDir() {
|
|
|
756
778
|
return preferredDir;
|
|
757
779
|
}
|
|
758
780
|
|
|
781
|
+
function isWindowsAbsolutePath(value = '') {
|
|
782
|
+
return /^[a-zA-Z]:[\\/]/.test(String(value || ''));
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
function isNativeAbsolutePath(value = '') {
|
|
786
|
+
return path.isAbsolute(String(value || '')) || isWindowsAbsolutePath(value);
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
function joinNativeBasePath(baseDir, ...segments) {
|
|
790
|
+
const base = String(baseDir || '');
|
|
791
|
+
const pathModule = isWindowsAbsolutePath(base) ? path.win32 : path;
|
|
792
|
+
return pathModule.join(base, ...segments);
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
function resolveNativeBasePath(baseDir, ...segments) {
|
|
796
|
+
const base = String(baseDir || '');
|
|
797
|
+
const pathModule = isWindowsAbsolutePath(base) ? path.win32 : path;
|
|
798
|
+
return pathModule.resolve(base, ...segments);
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
function getNativePathDir(filePath = '') {
|
|
802
|
+
const target = String(filePath || '');
|
|
803
|
+
const pathModule = isWindowsAbsolutePath(target) ? path.win32 : path;
|
|
804
|
+
return pathModule.dirname(target);
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
function getNativePlatformDir(platform) {
|
|
808
|
+
switch (platform) {
|
|
809
|
+
case 'claude':
|
|
810
|
+
return getClaudeConfigDir();
|
|
811
|
+
case 'codex':
|
|
812
|
+
return getCodexDir();
|
|
813
|
+
case 'gemini':
|
|
814
|
+
return getGeminiDir();
|
|
815
|
+
case 'opencode':
|
|
816
|
+
return getOpenCodeConfigDir();
|
|
817
|
+
default:
|
|
818
|
+
return '';
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
function getNativePlatformSubPath(platform, ...segments) {
|
|
823
|
+
const baseDir = getNativePlatformDir(platform);
|
|
824
|
+
return baseDir ? joinNativeBasePath(baseDir, ...segments) : '';
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
function getNativePlatformSkillsDir(platform) {
|
|
828
|
+
return getNativePlatformSubPath(platform, 'skills');
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
function getNativePlatformPromptPath(platform) {
|
|
832
|
+
if (!getNativePlatformDir(platform)) {
|
|
833
|
+
return '';
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
switch (platform) {
|
|
837
|
+
case 'claude':
|
|
838
|
+
return getNativePlatformSubPath(platform, 'CLAUDE.md');
|
|
839
|
+
case 'codex':
|
|
840
|
+
return getNativePlatformSubPath(platform, 'AGENTS.md');
|
|
841
|
+
case 'gemini':
|
|
842
|
+
return getNativePlatformSubPath(platform, 'GEMINI.md');
|
|
843
|
+
case 'opencode':
|
|
844
|
+
return getNativePlatformSubPath(platform, 'AGENTS.md');
|
|
845
|
+
default:
|
|
846
|
+
return '';
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
const CLAUDE_NATIVE_DIR = getNativePlatformDir('claude');
|
|
851
|
+
const CODEX_NATIVE_DIR = getNativePlatformDir('codex');
|
|
852
|
+
const GEMINI_NATIVE_DIR = getNativePlatformDir('gemini');
|
|
853
|
+
const OPENCODE_CONFIG_DIR = getNativePlatformDir('opencode');
|
|
854
|
+
const OPENCODE_DATA_DIR = getOpenCodeDataDir();
|
|
855
|
+
|
|
759
856
|
// 工具特定的原生配置路径(不改变)
|
|
760
857
|
const NATIVE_PATHS = {
|
|
761
858
|
// Claude Code 原生配置
|
|
762
859
|
claude: {
|
|
763
|
-
dir:
|
|
764
|
-
settings:
|
|
765
|
-
settingsBackup:
|
|
766
|
-
projects:
|
|
767
|
-
|
|
860
|
+
dir: CLAUDE_NATIVE_DIR,
|
|
861
|
+
settings: joinNativeBasePath(CLAUDE_NATIVE_DIR, 'settings.json'),
|
|
862
|
+
settingsBackup: joinNativeBasePath(CLAUDE_NATIVE_DIR, 'settings.json.cc-tool-backup'),
|
|
863
|
+
projects: joinNativeBasePath(CLAUDE_NATIVE_DIR, 'projects'),
|
|
864
|
+
commands: joinNativeBasePath(CLAUDE_NATIVE_DIR, 'commands'),
|
|
865
|
+
agents: joinNativeBasePath(CLAUDE_NATIVE_DIR, 'agents'),
|
|
866
|
+
plugins: joinNativeBasePath(CLAUDE_NATIVE_DIR, 'plugins'),
|
|
867
|
+
installedPlugins: joinNativeBasePath(CLAUDE_NATIVE_DIR, 'plugins', 'installed_plugins.json'),
|
|
868
|
+
pluginMarketplaces: joinNativeBasePath(CLAUDE_NATIVE_DIR, 'plugins', 'known_marketplaces.json'),
|
|
869
|
+
credentials: joinNativeBasePath(CLAUDE_NATIVE_DIR, '.credentials.json'),
|
|
870
|
+
skills: getNativePlatformSkillsDir('claude'),
|
|
871
|
+
prompt: getNativePlatformPromptPath('claude')
|
|
768
872
|
},
|
|
769
873
|
|
|
770
874
|
// Codex 原生配置
|
|
771
875
|
codex: {
|
|
772
|
-
dir:
|
|
773
|
-
config:
|
|
774
|
-
configBackup:
|
|
775
|
-
auth:
|
|
776
|
-
authBackup:
|
|
777
|
-
sessions:
|
|
876
|
+
dir: CODEX_NATIVE_DIR,
|
|
877
|
+
config: joinNativeBasePath(CODEX_NATIVE_DIR, 'config.toml'),
|
|
878
|
+
configBackup: joinNativeBasePath(CODEX_NATIVE_DIR, 'config.toml.cc-tool-backup'),
|
|
879
|
+
auth: joinNativeBasePath(CODEX_NATIVE_DIR, 'auth.json'),
|
|
880
|
+
authBackup: joinNativeBasePath(CODEX_NATIVE_DIR, 'auth.json.cc-tool-backup'),
|
|
881
|
+
sessions: joinNativeBasePath(CODEX_NATIVE_DIR, 'sessions'),
|
|
882
|
+
projects: joinNativeBasePath(CODEX_NATIVE_DIR, 'projects'),
|
|
883
|
+
agents: joinNativeBasePath(CODEX_NATIVE_DIR, 'agents'),
|
|
884
|
+
prompts: joinNativeBasePath(CODEX_NATIVE_DIR, 'prompts'),
|
|
885
|
+
skills: getNativePlatformSkillsDir('codex'),
|
|
886
|
+
prompt: getNativePlatformPromptPath('codex')
|
|
778
887
|
},
|
|
779
888
|
|
|
780
889
|
// Gemini 原生配置
|
|
781
890
|
gemini: {
|
|
782
|
-
dir:
|
|
783
|
-
env:
|
|
784
|
-
envBackup:
|
|
785
|
-
tmp:
|
|
786
|
-
settings:
|
|
787
|
-
settingsBackup:
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
891
|
+
dir: GEMINI_NATIVE_DIR,
|
|
892
|
+
env: joinNativeBasePath(GEMINI_NATIVE_DIR, '.env'),
|
|
893
|
+
envBackup: joinNativeBasePath(GEMINI_NATIVE_DIR, '.env.cc-tool-backup'),
|
|
894
|
+
tmp: joinNativeBasePath(GEMINI_NATIVE_DIR, 'tmp'),
|
|
895
|
+
settings: joinNativeBasePath(GEMINI_NATIVE_DIR, 'settings.json'),
|
|
896
|
+
settingsBackup: joinNativeBasePath(GEMINI_NATIVE_DIR, 'settings.json.cc-tool-backup'),
|
|
897
|
+
projects: joinNativeBasePath(GEMINI_NATIVE_DIR, 'projects'),
|
|
898
|
+
googleAccounts: joinNativeBasePath(GEMINI_NATIVE_DIR, 'google_accounts.json'),
|
|
899
|
+
oauthCredentialsLegacy: joinNativeBasePath(GEMINI_NATIVE_DIR, 'oauth_creds.json'),
|
|
900
|
+
oauthCredentialsEncrypted: joinNativeBasePath(GEMINI_NATIVE_DIR, 'mcp-oauth-tokens-v2.json'),
|
|
901
|
+
skills: getNativePlatformSkillsDir('gemini'),
|
|
902
|
+
prompt: getNativePlatformPromptPath('gemini')
|
|
791
903
|
},
|
|
792
904
|
|
|
793
905
|
// OpenCode 原生配置
|
|
794
906
|
opencode: {
|
|
795
|
-
data:
|
|
796
|
-
config:
|
|
797
|
-
sessions:
|
|
798
|
-
projects:
|
|
799
|
-
messages:
|
|
800
|
-
log:
|
|
801
|
-
auth:
|
|
907
|
+
data: OPENCODE_DATA_DIR,
|
|
908
|
+
config: OPENCODE_CONFIG_DIR,
|
|
909
|
+
sessions: joinNativeBasePath(OPENCODE_DATA_DIR, 'storage', 'session'),
|
|
910
|
+
projects: joinNativeBasePath(OPENCODE_DATA_DIR, 'storage', 'project'),
|
|
911
|
+
messages: joinNativeBasePath(OPENCODE_DATA_DIR, 'storage', 'message'),
|
|
912
|
+
log: joinNativeBasePath(OPENCODE_DATA_DIR, 'log'),
|
|
913
|
+
auth: joinNativeBasePath(OPENCODE_DATA_DIR, 'auth.json'),
|
|
914
|
+
commands: joinNativeBasePath(OPENCODE_CONFIG_DIR, 'commands'),
|
|
915
|
+
commandsLegacy: joinNativeBasePath(OPENCODE_CONFIG_DIR, 'command'),
|
|
916
|
+
agents: joinNativeBasePath(OPENCODE_CONFIG_DIR, 'agents'),
|
|
917
|
+
agentsLegacy: joinNativeBasePath(OPENCODE_CONFIG_DIR, 'agent'),
|
|
918
|
+
plugins: joinNativeBasePath(OPENCODE_CONFIG_DIR, 'plugins'),
|
|
919
|
+
pluginsLegacy: joinNativeBasePath(OPENCODE_CONFIG_DIR, 'plugin'),
|
|
920
|
+
pluginsConfig: joinNativeBasePath(OPENCODE_CONFIG_DIR, 'plugins-config'),
|
|
921
|
+
configJsonc: joinNativeBasePath(OPENCODE_CONFIG_DIR, 'opencode.jsonc'),
|
|
922
|
+
configJson: joinNativeBasePath(OPENCODE_CONFIG_DIR, 'opencode.json'),
|
|
923
|
+
configLegacy: joinNativeBasePath(OPENCODE_CONFIG_DIR, 'config.json'),
|
|
924
|
+
skills: getNativePlatformSkillsDir('opencode'),
|
|
925
|
+
prompt: getNativePlatformPromptPath('opencode')
|
|
802
926
|
}
|
|
803
927
|
};
|
|
804
928
|
|
|
@@ -817,6 +941,15 @@ module.exports = {
|
|
|
817
941
|
getClaudeConfigDir,
|
|
818
942
|
getCodexDir,
|
|
819
943
|
getGeminiDir,
|
|
944
|
+
isWindowsAbsolutePath,
|
|
945
|
+
isNativeAbsolutePath,
|
|
946
|
+
joinNativeBasePath,
|
|
947
|
+
resolveNativeBasePath,
|
|
948
|
+
getNativePathDir,
|
|
949
|
+
getNativePlatformDir,
|
|
950
|
+
getNativePlatformSubPath,
|
|
951
|
+
getNativePlatformSkillsDir,
|
|
952
|
+
getNativePlatformPromptPath,
|
|
820
953
|
getOpenCodeDataDir,
|
|
821
954
|
getOpenCodeConfigDir
|
|
822
955
|
};
|