coding-tool-x 3.7.0 → 3.7.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/README.md +5 -6
- package/dist/web/assets/{Analytics-Dma_j2Rq.js → Analytics-Dpje9L84.js} +1 -1
- package/dist/web/assets/{ConfigTemplates-C49Y1PLH.js → ConfigTemplates-Cz6kasek.js} +1 -1
- package/dist/web/assets/Home-BwTaYu3q.js +1 -0
- package/dist/web/assets/Home-Jom_ZcdY.css +1 -0
- package/dist/web/assets/{PluginManager-B1ECTHyY.js → PluginManager-DsN-xNXx.js} +1 -1
- package/dist/web/assets/ProjectList-4BCObimU.js +1 -0
- package/dist/web/assets/{ProjectList-B_L55-l9.css → ProjectList-D3a0oRum.css} +1 -1
- package/dist/web/assets/{SessionList-CH5GwwiJ.js → SessionList-D4c8FRzq.js} +1 -1
- package/dist/web/assets/{SkillManager-CRyVhjYQ.js → SkillManager-C-KYbXB5.js} +1 -1
- package/dist/web/assets/{WorkspaceManager-CO9tclVt.js → WorkspaceManager-B-BlPJHX.js} +1 -1
- package/dist/web/assets/index-Btfvh0GG.js +2 -0
- package/dist/web/assets/{index-CM26UrnJ.css → index-CLNa6DhH.css} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +2 -1
- package/src/commands/channels.js +8 -8
- package/src/commands/daemon.js +4 -4
- package/src/commands/doctor.js +1 -1
- package/src/commands/logs.js +1 -3
- package/src/commands/port-config.js +4 -4
- package/src/commands/proxy-control.js +13 -13
- package/src/commands/stats.js +6 -6
- package/src/commands/toggle-proxy.js +8 -8
- package/src/config/default.js +3 -3
- package/src/config/paths.js +46 -49
- package/src/index.js +4 -5
- package/src/server/api/commands.js +1 -1
- package/src/server/api/config-export.js +2 -2
- package/src/server/api/config-registry.js +1 -1
- package/src/server/api/config.js +1 -1
- package/src/server/api/dashboard.js +16 -16
- package/src/server/api/mcp.js +2 -2
- package/src/server/api/{pi-channels.js → omp-channels.js} +15 -15
- package/src/server/api/{pi-config.js → omp-config.js} +13 -13
- package/src/server/api/{pi-projects.js → omp-projects.js} +5 -5
- package/src/server/api/{pi-proxy.js → omp-proxy.js} +18 -18
- package/src/server/api/{pi-sessions.js → omp-sessions.js} +21 -21
- package/src/server/api/{pi-statistics.js → omp-statistics.js} +1 -1
- package/src/server/api/plugins.js +1 -1
- package/src/server/api/skills.js +1 -1
- package/src/server/api/workspaces.js +1 -1
- package/src/server/index.js +10 -10
- package/src/server/{pi-proxy-server.js → omp-proxy-server.js} +13 -13
- package/src/server/services/channel-balance.js +3 -3
- package/src/server/services/channel-scheduler.js +4 -4
- package/src/server/services/commands-service.js +5 -5
- package/src/server/services/config-export-service.js +53 -53
- package/src/server/services/config-registry-service.js +8 -8
- package/src/server/services/config-sync-manager.js +26 -26
- package/src/server/services/config-templates-service.js +28 -28
- package/src/server/services/mcp-service.js +20 -20
- package/src/server/services/notification-hooks.js +138 -6
- package/src/server/services/{pi-auth-providers.js → omp-auth-providers.js} +2 -2
- package/src/server/services/{pi-channels.js → omp-channels.js} +5 -5
- package/src/server/services/{pi-config.js → omp-config.js} +47 -65
- package/src/server/services/{pi-sessions.js → omp-sessions.js} +20 -20
- package/src/server/services/{pi-settings-manager.js → omp-settings-manager.js} +422 -18
- package/src/server/services/{pi-statistics-service.js → omp-statistics-service.js} +2 -2
- package/src/server/services/plugins-service.js +122 -122
- package/src/server/services/prompts-service.js +20 -20
- package/src/server/services/proxy-log-helper.js +1 -1
- package/src/server/services/proxy-runtime.js +1 -1
- package/src/server/services/skill-service.js +7 -7
- package/src/server/services/speed-test.js +29 -29
- package/src/server/services/ui-config.js +3 -3
- package/src/server/services/workspace-service.js +8 -8
- package/src/server/websocket-server.js +4 -4
- package/src/shared/platforms.js +201 -0
- package/dist/web/assets/Home-DGGC8H4g.js +0 -1
- package/dist/web/assets/Home-ewgeIhF7.css +0 -1
- package/dist/web/assets/ProjectList-DyiGyT-H.js +0 -1
- package/dist/web/assets/index-EQq56pRa.js +0 -2
package/dist/web/index.html
CHANGED
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
<link rel="icon" href="/favicon.ico">
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
7
|
<title>coding-tool-x · AI 编程工作台</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-Btfvh0GG.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/markdown-BNJfEgCA.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/vue-vendor-B5RqjEjQ.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/naive-ui-CVyvdmg1.js">
|
|
12
12
|
<link rel="modulepreload" crossorigin href="/assets/icons-Dop5j7Bf.js">
|
|
13
13
|
<link rel="modulepreload" crossorigin href="/assets/vendors-DQA4Hw9v.js">
|
|
14
14
|
<link rel="stylesheet" crossorigin href="/assets/markdown-BfC0goYb.css">
|
|
15
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
15
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CLNa6DhH.css">
|
|
16
16
|
</head>
|
|
17
17
|
<body>
|
|
18
18
|
<div id="app"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coding-tool-x",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.1",
|
|
4
4
|
"description": "Vibe Coding 增强工作助手 - 智能会话管理、动态渠道切换、全局搜索、实时监控",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
"src/config/",
|
|
46
46
|
"src/plugins/",
|
|
47
47
|
"src/server/",
|
|
48
|
+
"src/shared/",
|
|
48
49
|
"src/ui/",
|
|
49
50
|
"src/utils/",
|
|
50
51
|
"src/index.js",
|
package/src/commands/channels.js
CHANGED
|
@@ -65,13 +65,13 @@ function getChannelServices(cliType) {
|
|
|
65
65
|
updateChannel,
|
|
66
66
|
getProxyStatus: getOpenCodeProxyStatus
|
|
67
67
|
};
|
|
68
|
-
} else if (normalizedCliType === '
|
|
68
|
+
} else if (normalizedCliType === 'omp') {
|
|
69
69
|
const {
|
|
70
70
|
getChannels,
|
|
71
71
|
createChannel,
|
|
72
72
|
updateChannel
|
|
73
|
-
} = require('../server/services/
|
|
74
|
-
const {
|
|
73
|
+
} = require('../server/services/omp-channels');
|
|
74
|
+
const { getOmpProxyStatus } = require('../server/omp-proxy-server');
|
|
75
75
|
return {
|
|
76
76
|
getAllChannels: () => {
|
|
77
77
|
const result = getChannels();
|
|
@@ -79,7 +79,7 @@ function getChannelServices(cliType) {
|
|
|
79
79
|
},
|
|
80
80
|
createChannel,
|
|
81
81
|
updateChannel,
|
|
82
|
-
getProxyStatus:
|
|
82
|
+
getProxyStatus: getOmpProxyStatus,
|
|
83
83
|
supportsCliCreate: false,
|
|
84
84
|
managedProviderConfig: true
|
|
85
85
|
};
|
|
@@ -110,7 +110,7 @@ async function handleChannelManagement() {
|
|
|
110
110
|
|
|
111
111
|
if (channels.length === 0) {
|
|
112
112
|
console.log(chalk.yellow('还没有添加任何渠道'));
|
|
113
|
-
if (cliType === '
|
|
113
|
+
if (cliType === 'omp') {
|
|
114
114
|
console.log(chalk.gray('提示: OMP 渠道请通过 Web UI 或 API 添加后,再在这里启停调度。\n'));
|
|
115
115
|
} else if (services.supportsCliCreate === false || typeof services.createChannel !== 'function') {
|
|
116
116
|
console.log(chalk.gray('提示: 当前平台不支持在 CLI 中添加渠道,请通过 Web UI 添加。\n'));
|
|
@@ -156,7 +156,7 @@ async function handleAddChannel() {
|
|
|
156
156
|
const services = getChannelServices(cliType);
|
|
157
157
|
|
|
158
158
|
if (!services || services.supportsCliCreate === false || typeof services.createChannel !== 'function') {
|
|
159
|
-
if (cliType === '
|
|
159
|
+
if (cliType === 'omp') {
|
|
160
160
|
console.log(chalk.yellow('OMP 渠道创建/编辑需要使用 Web UI 或 API,以便配置 providerKey、providerApi、模型白名单等 OMP 字段。\n'));
|
|
161
161
|
} else {
|
|
162
162
|
console.log(chalk.red(`当前 CLI 类型 (${cliType}) 暂不支持添加渠道\n`));
|
|
@@ -374,7 +374,7 @@ async function handleChannelToggle(channels, services, cliType) {
|
|
|
374
374
|
detailParts.push(`model ${channel.model}`);
|
|
375
375
|
}
|
|
376
376
|
|
|
377
|
-
if (normalizedCliType === '
|
|
377
|
+
if (normalizedCliType === 'omp') {
|
|
378
378
|
if (channel.providerKey) {
|
|
379
379
|
detailParts.push(`provider ${channel.providerKey}`);
|
|
380
380
|
}
|
|
@@ -569,7 +569,7 @@ function buildSchedulerSources() {
|
|
|
569
569
|
{ key: 'codex', label: 'Codex (OpenAI)' },
|
|
570
570
|
{ key: 'gemini', label: 'Gemini' },
|
|
571
571
|
{ key: 'opencode', label: 'OpenCode' },
|
|
572
|
-
{ key: '
|
|
572
|
+
{ key: 'omp', label: 'OMP' }
|
|
573
573
|
];
|
|
574
574
|
}
|
|
575
575
|
|
package/src/commands/daemon.js
CHANGED
|
@@ -260,7 +260,7 @@ function getManagedPorts(config = loadConfig()) {
|
|
|
260
260
|
config.ports?.codexProxy || 20089,
|
|
261
261
|
config.ports?.geminiProxy || 20090,
|
|
262
262
|
config.ports?.opencodeProxy || 20091,
|
|
263
|
-
config.ports?.
|
|
263
|
+
config.ports?.ompProxy || 20092
|
|
264
264
|
].filter((port, index, list) => Number.isInteger(port) && port > 0 && list.indexOf(port) === index);
|
|
265
265
|
}
|
|
266
266
|
|
|
@@ -668,7 +668,7 @@ async function handleStatus() {
|
|
|
668
668
|
const codexActive = fs.existsSync(PATHS.activeChannel.codex);
|
|
669
669
|
const geminiActive = fs.existsSync(PATHS.activeChannel.gemini);
|
|
670
670
|
const opencodeActive = fs.existsSync(PATHS.activeChannel.opencode);
|
|
671
|
-
const
|
|
671
|
+
const ompActive = fs.existsSync(PATHS.activeChannel.omp);
|
|
672
672
|
|
|
673
673
|
console.log(chalk.bold('\n[PROXY] 代理服务:'));
|
|
674
674
|
|
|
@@ -684,8 +684,8 @@ async function handleStatus() {
|
|
|
684
684
|
console.log(chalk.gray(' OpenCode:') + (opencodeActive ? chalk.green('[OK] 运行中') : chalk.gray('[STOP] 未启动')) +
|
|
685
685
|
chalk.gray(` (http://localhost:${config.ports?.opencodeProxy || 20091})`));
|
|
686
686
|
|
|
687
|
-
console.log(chalk.gray(' OMP: ') + (
|
|
688
|
-
chalk.gray(` (http://localhost:${config.ports?.
|
|
687
|
+
console.log(chalk.gray(' OMP: ') + (ompActive ? chalk.green('[OK] 运行中') : chalk.gray('[STOP] 未启动')) +
|
|
688
|
+
chalk.gray(` (http://localhost:${config.ports?.ompProxy || 20092})`));
|
|
689
689
|
|
|
690
690
|
console.log(chalk.bold('\n[TIP] 提示:'));
|
|
691
691
|
console.log(chalk.gray(' • 代理服务通过 Web UI 界面控制'));
|
package/src/commands/doctor.js
CHANGED
|
@@ -182,7 +182,7 @@ function buildPortCheckMap(config = {}) {
|
|
|
182
182
|
'Codex Proxy': config.ports?.codexProxy || 20089,
|
|
183
183
|
'Gemini Proxy': config.ports?.geminiProxy || 20090,
|
|
184
184
|
'OpenCode Proxy': config.ports?.opencodeProxy || 20091,
|
|
185
|
-
'OMP Proxy': config.ports?.
|
|
185
|
+
'OMP Proxy': config.ports?.ompProxy || 20092
|
|
186
186
|
};
|
|
187
187
|
}
|
|
188
188
|
|
package/src/commands/logs.js
CHANGED
|
@@ -15,16 +15,14 @@ const LOG_FILES = {
|
|
|
15
15
|
opencode: 'opencode-proxy.log'
|
|
16
16
|
};
|
|
17
17
|
const LOG_ALIASES = {
|
|
18
|
-
pi: 'ui',
|
|
19
18
|
omp: 'ui'
|
|
20
19
|
};
|
|
21
20
|
const LOG_ALIAS_NOTES = {
|
|
22
|
-
pi: 'OMP 受管 provider 配置没有独立请求代理日志,相关活动记录在 UI/server 日志中。',
|
|
23
21
|
omp: 'OMP 受管 provider 配置没有独立请求代理日志,相关活动记录在 UI/server 日志中。'
|
|
24
22
|
};
|
|
25
23
|
|
|
26
24
|
function getSupportedLogTypes() {
|
|
27
|
-
return [...Object.keys(LOG_FILES), '
|
|
25
|
+
return [...Object.keys(LOG_FILES), 'omp'];
|
|
28
26
|
}
|
|
29
27
|
|
|
30
28
|
function resolveLogType(type) {
|
|
@@ -56,9 +56,9 @@ function buildPortQuestions(config = {}) {
|
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
type: 'input',
|
|
59
|
-
name: '
|
|
59
|
+
name: 'ompProxy',
|
|
60
60
|
message: 'OMP 代理服务端口:',
|
|
61
|
-
default: ports.
|
|
61
|
+
default: ports.ompProxy || 20092,
|
|
62
62
|
validate: validatePort,
|
|
63
63
|
},
|
|
64
64
|
];
|
|
@@ -71,7 +71,7 @@ function buildPortsConfig(answers = {}) {
|
|
|
71
71
|
codexProxy: normalizePort(answers.codexProxy),
|
|
72
72
|
geminiProxy: normalizePort(answers.geminiProxy),
|
|
73
73
|
opencodeProxy: normalizePort(answers.opencodeProxy),
|
|
74
|
-
|
|
74
|
+
ompProxy: normalizePort(answers.ompProxy),
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
77
|
|
|
@@ -98,7 +98,7 @@ async function handlePortConfig() {
|
|
|
98
98
|
console.log(chalk.gray(`• Codex 代理端口: ${ports.codexProxy || 20089}`));
|
|
99
99
|
console.log(chalk.gray(`• Gemini 代理端口: ${ports.geminiProxy || 20090}`));
|
|
100
100
|
console.log(chalk.gray(`• OpenCode 代理端口: ${ports.opencodeProxy || 20091}`));
|
|
101
|
-
console.log(chalk.gray(`• OMP 代理端口: ${ports.
|
|
101
|
+
console.log(chalk.gray(`• OMP 代理端口: ${ports.ompProxy || 20092}\n`));
|
|
102
102
|
|
|
103
103
|
console.log(chalk.yellow('说明:'));
|
|
104
104
|
console.log(chalk.gray('• 端口范围: 1024-65535'));
|
|
@@ -7,27 +7,27 @@ const CHANNEL_CONFIG = {
|
|
|
7
7
|
claude: {
|
|
8
8
|
name: 'Claude',
|
|
9
9
|
icon: '[*]',
|
|
10
|
-
|
|
10
|
+
aompPath: '/api/proxy'
|
|
11
11
|
},
|
|
12
12
|
codex: {
|
|
13
13
|
name: 'Codex',
|
|
14
14
|
icon: '[*]',
|
|
15
|
-
|
|
15
|
+
aompPath: '/api/codex/proxy'
|
|
16
16
|
},
|
|
17
17
|
gemini: {
|
|
18
18
|
name: 'Gemini',
|
|
19
19
|
icon: '[*]',
|
|
20
|
-
|
|
20
|
+
aompPath: '/api/gemini/proxy'
|
|
21
21
|
},
|
|
22
22
|
opencode: {
|
|
23
23
|
name: 'OpenCode',
|
|
24
24
|
icon: '[*]',
|
|
25
|
-
|
|
25
|
+
aompPath: '/api/opencode/proxy'
|
|
26
26
|
},
|
|
27
|
-
|
|
27
|
+
omp: {
|
|
28
28
|
name: 'OMP',
|
|
29
29
|
icon: '[*]',
|
|
30
|
-
|
|
30
|
+
aompPath: '/api/omp/proxy',
|
|
31
31
|
serviceLabel: 'OMP 受管模型配置',
|
|
32
32
|
proxyLabel: '受管模型配置',
|
|
33
33
|
startAction: '启用',
|
|
@@ -126,7 +126,7 @@ async function handleProxyStart(channel) {
|
|
|
126
126
|
const channelInfo = CHANNEL_CONFIG[normalizedChannel];
|
|
127
127
|
if (!channelInfo) {
|
|
128
128
|
console.error(chalk.red(`\n[ERROR] 无效的渠道类型: ${channel}\n`));
|
|
129
|
-
console.log(chalk.gray('支持的渠道: claude, codex, gemini, opencode,
|
|
129
|
+
console.log(chalk.gray('支持的渠道: claude, codex, gemini, opencode, omp\n'));
|
|
130
130
|
process.exit(1);
|
|
131
131
|
}
|
|
132
132
|
|
|
@@ -142,7 +142,7 @@ async function handleProxyStart(channel) {
|
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
try {
|
|
145
|
-
const response = await httpRequest('POST', `${channelInfo.
|
|
145
|
+
const response = await httpRequest('POST', `${channelInfo.aompPath}/start`);
|
|
146
146
|
|
|
147
147
|
if (response.data.success) {
|
|
148
148
|
console.log(chalk.green(`[OK] ${channelInfo.startedMessage || `${channelInfo.name} ${getProxyLabel(channelInfo)}已启动`}\n`));
|
|
@@ -171,7 +171,7 @@ async function handleProxyStop(channel) {
|
|
|
171
171
|
const channelInfo = CHANNEL_CONFIG[normalizedChannel];
|
|
172
172
|
if (!channelInfo) {
|
|
173
173
|
console.error(chalk.red(`\n[ERROR] 无效的渠道类型: ${channel}\n`));
|
|
174
|
-
console.log(chalk.gray('支持的渠道: claude, codex, gemini, opencode,
|
|
174
|
+
console.log(chalk.gray('支持的渠道: claude, codex, gemini, opencode, omp\n'));
|
|
175
175
|
process.exit(1);
|
|
176
176
|
}
|
|
177
177
|
|
|
@@ -184,7 +184,7 @@ async function handleProxyStop(channel) {
|
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
try {
|
|
187
|
-
const response = await httpRequest('POST', `${channelInfo.
|
|
187
|
+
const response = await httpRequest('POST', `${channelInfo.aompPath}/stop`);
|
|
188
188
|
|
|
189
189
|
if (response.data.success) {
|
|
190
190
|
console.log(chalk.green(`[OK] ${channelInfo.stoppedMessage || `${channelInfo.name} ${getProxyLabel(channelInfo)}已停止`}\n`));
|
|
@@ -206,7 +206,7 @@ async function handleProxyRestart(channel) {
|
|
|
206
206
|
const channelInfo = CHANNEL_CONFIG[normalizedChannel];
|
|
207
207
|
if (!channelInfo) {
|
|
208
208
|
console.error(chalk.red(`\n[ERROR] 无效的渠道类型: ${channel}\n`));
|
|
209
|
-
console.log(chalk.gray('支持的渠道: claude, codex, gemini, opencode,
|
|
209
|
+
console.log(chalk.gray('支持的渠道: claude, codex, gemini, opencode, omp\n'));
|
|
210
210
|
process.exit(1);
|
|
211
211
|
}
|
|
212
212
|
|
|
@@ -225,7 +225,7 @@ async function handleProxyStatus(channel) {
|
|
|
225
225
|
const channelInfo = CHANNEL_CONFIG[normalizedChannel];
|
|
226
226
|
if (!channelInfo) {
|
|
227
227
|
console.error(chalk.red(`\n[ERROR] 无效的渠道类型: ${channel}\n`));
|
|
228
|
-
console.log(chalk.gray('支持的渠道: claude, codex, gemini, opencode,
|
|
228
|
+
console.log(chalk.gray('支持的渠道: claude, codex, gemini, opencode, omp\n'));
|
|
229
229
|
process.exit(1);
|
|
230
230
|
}
|
|
231
231
|
|
|
@@ -240,7 +240,7 @@ async function handleProxyStatus(channel) {
|
|
|
240
240
|
}
|
|
241
241
|
|
|
242
242
|
try {
|
|
243
|
-
const response = await httpRequest('GET', `${channelInfo.
|
|
243
|
+
const response = await httpRequest('GET', `${channelInfo.aompPath}/status`);
|
|
244
244
|
const payload = response.data || {};
|
|
245
245
|
const status = payload.proxy || payload;
|
|
246
246
|
|
package/src/commands/stats.js
CHANGED
|
@@ -3,13 +3,13 @@ const http = require('http');
|
|
|
3
3
|
const { loadConfig } = require('../config/loader');
|
|
4
4
|
const { normalizePlatformKey } = require('../shared/platforms');
|
|
5
5
|
|
|
6
|
-
const TOOL_TYPES = ['claude', 'codex', 'gemini', 'opencode', '
|
|
6
|
+
const TOOL_TYPES = ['claude', 'codex', 'gemini', 'opencode', 'omp'];
|
|
7
7
|
const TOOL_ENDPOINTS = {
|
|
8
8
|
claude: '/api/claude/statistics',
|
|
9
9
|
codex: '/api/codex/statistics',
|
|
10
10
|
gemini: '/api/gemini/statistics',
|
|
11
11
|
opencode: '/api/opencode/statistics',
|
|
12
|
-
|
|
12
|
+
omp: '/api/omp/statistics'
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -252,7 +252,7 @@ async function handleStats(type = null, options = {}) {
|
|
|
252
252
|
try {
|
|
253
253
|
if (!validateToolType(normalizedType)) {
|
|
254
254
|
console.error(chalk.red(`\n[ERROR] 无效的渠道类型: ${type}\n`));
|
|
255
|
-
console.log(chalk.gray('支持的类型: claude, codex, gemini, opencode,
|
|
255
|
+
console.log(chalk.gray('支持的类型: claude, codex, gemini, opencode, omp\n'));
|
|
256
256
|
process.exit(1);
|
|
257
257
|
}
|
|
258
258
|
|
|
@@ -320,7 +320,7 @@ function displayStats(stats) {
|
|
|
320
320
|
}
|
|
321
321
|
|
|
322
322
|
if (!type && stats.byToolType) {
|
|
323
|
-
const iconMap = { claude: '[*]', codex: '[*]', gemini: '[*]', opencode: '[*]',
|
|
323
|
+
const iconMap = { claude: '[*]', codex: '[*]', gemini: '[*]', opencode: '[*]', omp: '[*]' };
|
|
324
324
|
console.log(chalk.bold('\n[CH] 分渠道汇总:'));
|
|
325
325
|
TOOL_TYPES.forEach((toolType) => {
|
|
326
326
|
const item = stats.byToolType[toolType] || emptySummary();
|
|
@@ -343,7 +343,7 @@ function displayStats(stats) {
|
|
|
343
343
|
|
|
344
344
|
function getToolDisplayName(type) {
|
|
345
345
|
const normalizedType = normalizePlatformKey(type);
|
|
346
|
-
if (normalizedType === '
|
|
346
|
+
if (normalizedType === 'omp') return 'OMP';
|
|
347
347
|
return String(normalizedType || '').toUpperCase();
|
|
348
348
|
}
|
|
349
349
|
|
|
@@ -371,7 +371,7 @@ async function handleStatsExport(type = null, format = 'json') {
|
|
|
371
371
|
try {
|
|
372
372
|
if (!validateToolType(normalizedType)) {
|
|
373
373
|
console.error(chalk.red(`\n[ERROR] 无效的渠道类型: ${type}\n`));
|
|
374
|
-
console.log(chalk.gray('支持的类型: claude, codex, gemini, opencode,
|
|
374
|
+
console.log(chalk.gray('支持的类型: claude, codex, gemini, opencode, omp\n'));
|
|
375
375
|
process.exit(1);
|
|
376
376
|
}
|
|
377
377
|
|
|
@@ -45,14 +45,14 @@ function getProxyServices(cliType) {
|
|
|
45
45
|
stopProxyServer: stopOpenCodeProxyServer,
|
|
46
46
|
defaultPort: 20091
|
|
47
47
|
};
|
|
48
|
-
} else if (normalizedCliType === '
|
|
49
|
-
const {
|
|
48
|
+
} else if (normalizedCliType === 'omp') {
|
|
49
|
+
const { getOmpProxyStatus, startOmpProxyServer, stopOmpProxyServer } = require('../server/omp-proxy-server');
|
|
50
50
|
const config = loadConfig();
|
|
51
51
|
return {
|
|
52
|
-
getProxyStatus:
|
|
53
|
-
startProxyServer:
|
|
54
|
-
stopProxyServer:
|
|
55
|
-
defaultPort: config.ports?.
|
|
52
|
+
getProxyStatus: getOmpProxyStatus,
|
|
53
|
+
startProxyServer: startOmpProxyServer,
|
|
54
|
+
stopProxyServer: stopOmpProxyServer,
|
|
55
|
+
defaultPort: config.ports?.ompProxy || 20092,
|
|
56
56
|
managedProviderConfig: true
|
|
57
57
|
};
|
|
58
58
|
}
|
|
@@ -198,7 +198,7 @@ async function handleStartProxy(cliType, services) {
|
|
|
198
198
|
codex: 'Codex',
|
|
199
199
|
gemini: 'Gemini',
|
|
200
200
|
opencode: 'OpenCode',
|
|
201
|
-
|
|
201
|
+
omp: 'OMP'
|
|
202
202
|
};
|
|
203
203
|
const toolName = toolNameMap[cliType] || 'Claude Code';
|
|
204
204
|
const defaultPort = services.defaultPort;
|
|
@@ -316,7 +316,7 @@ async function handleStopProxy(cliType, services) {
|
|
|
316
316
|
codex: 'Codex',
|
|
317
317
|
gemini: 'Gemini',
|
|
318
318
|
opencode: 'OpenCode',
|
|
319
|
-
|
|
319
|
+
omp: 'OMP'
|
|
320
320
|
};
|
|
321
321
|
const toolName = toolNameMap[cliType] || 'Claude Code';
|
|
322
322
|
const proxyStatus = services.getProxyStatus();
|
package/src/config/default.js
CHANGED
|
@@ -14,14 +14,14 @@ const DEFAULT_CONFIG = {
|
|
|
14
14
|
defaultProject: null,
|
|
15
15
|
maxDisplaySessions: 100,
|
|
16
16
|
pageSize: 15,
|
|
17
|
-
currentCliType: 'claude', // 当前CLI工具类型: claude, codex, gemini, opencode,
|
|
17
|
+
currentCliType: 'claude', // 当前CLI工具类型: claude, codex, gemini, opencode, omp
|
|
18
18
|
ports: {
|
|
19
19
|
webUI: 19999, // Web UI 页面端口 (同时用于 WebSocket)
|
|
20
20
|
proxy: 20088, // Claude 代理服务端口
|
|
21
21
|
codexProxy: 20089, // Codex 代理服务端口
|
|
22
22
|
geminiProxy: 20090, // Gemini 代理服务端口
|
|
23
23
|
opencodeProxy: 20091, // OpenCode 代理服务端口
|
|
24
|
-
|
|
24
|
+
ompProxy: 20092 // OMP 托管 provider 状态端口占位
|
|
25
25
|
},
|
|
26
26
|
maxLogs: 100,
|
|
27
27
|
statsInterval: 30,
|
|
@@ -73,7 +73,7 @@ const DEFAULT_CONFIG = {
|
|
|
73
73
|
cacheRead: 0.25,
|
|
74
74
|
models: {}
|
|
75
75
|
},
|
|
76
|
-
|
|
76
|
+
omp: {
|
|
77
77
|
mode: 'auto',
|
|
78
78
|
input: 2.5,
|
|
79
79
|
output: 15,
|
package/src/config/paths.js
CHANGED
|
@@ -392,8 +392,8 @@ const PATHS = {
|
|
|
392
392
|
forkRelations: path.join(CONFIG_DIR, 'fork-relations.json'),
|
|
393
393
|
opencodeProjectOrder: path.join(CONFIG_DIR, 'opencode-project-order.json'),
|
|
394
394
|
opencodeSessionOrder: path.join(CONFIG_DIR, 'opencode-session-order.json'),
|
|
395
|
-
|
|
396
|
-
|
|
395
|
+
ompProjectOrder: path.join(CONFIG_DIR, 'omp-project-order.json'),
|
|
396
|
+
ompSessionOrder: path.join(CONFIG_DIR, 'omp-session-order.json'),
|
|
397
397
|
|
|
398
398
|
// 渠道配置
|
|
399
399
|
channelsDir: CHANNELS_DIR,
|
|
@@ -402,7 +402,7 @@ const PATHS = {
|
|
|
402
402
|
codex: path.join(CHANNELS_DIR, 'codex.json'),
|
|
403
403
|
gemini: path.join(CHANNELS_DIR, 'gemini.json'),
|
|
404
404
|
opencode: path.join(CHANNELS_DIR, 'opencode.json'),
|
|
405
|
-
|
|
405
|
+
omp: path.join(CHANNELS_DIR, 'omp.json')
|
|
406
406
|
},
|
|
407
407
|
activeChannelDir: ACTIVE_CHANNELS_DIR,
|
|
408
408
|
activeChannel: {
|
|
@@ -410,7 +410,7 @@ const PATHS = {
|
|
|
410
410
|
codex: path.join(ACTIVE_CHANNELS_DIR, 'codex.json'),
|
|
411
411
|
gemini: path.join(ACTIVE_CHANNELS_DIR, 'gemini.json'),
|
|
412
412
|
opencode: path.join(ACTIVE_CHANNELS_DIR, 'opencode.json'),
|
|
413
|
-
|
|
413
|
+
omp: path.join(ACTIVE_CHANNELS_DIR, 'omp.json')
|
|
414
414
|
},
|
|
415
415
|
|
|
416
416
|
// 统计与日志快照
|
|
@@ -442,7 +442,7 @@ const PATHS = {
|
|
|
442
442
|
codex: path.join(RUNTIME_DIR, 'codex-proxy.json'),
|
|
443
443
|
gemini: path.join(RUNTIME_DIR, 'gemini-proxy.json'),
|
|
444
444
|
opencode: path.join(RUNTIME_DIR, 'opencode-proxy.json'),
|
|
445
|
-
|
|
445
|
+
omp: path.join(RUNTIME_DIR, 'omp-proxy.json')
|
|
446
446
|
},
|
|
447
447
|
|
|
448
448
|
// 请求记录
|
|
@@ -451,7 +451,7 @@ const PATHS = {
|
|
|
451
451
|
codex: path.join(REQUESTS_DIR, 'codex.jsonl'),
|
|
452
452
|
gemini: path.join(REQUESTS_DIR, 'gemini.jsonl'),
|
|
453
453
|
opencode: path.join(REQUESTS_DIR, 'opencode.jsonl'),
|
|
454
|
-
|
|
454
|
+
omp: path.join(REQUESTS_DIR, 'omp.jsonl')
|
|
455
455
|
},
|
|
456
456
|
claudeRequestTemplate: path.join(REQUESTS_DIR, 'claude-request-template.json'),
|
|
457
457
|
|
|
@@ -464,35 +464,35 @@ const PATHS = {
|
|
|
464
464
|
codex: path.join(LOCAL_SKILLS_DIR, 'codex'),
|
|
465
465
|
gemini: path.join(LOCAL_SKILLS_DIR, 'gemini'),
|
|
466
466
|
opencode: path.join(LOCAL_SKILLS_DIR, 'opencode'),
|
|
467
|
-
|
|
467
|
+
omp: path.join(LOCAL_SKILLS_DIR, 'omp')
|
|
468
468
|
},
|
|
469
469
|
skillRepos: {
|
|
470
470
|
claude: path.join(REPOS_SKILLS_DIR, 'claude.json'),
|
|
471
471
|
codex: path.join(REPOS_SKILLS_DIR, 'codex.json'),
|
|
472
472
|
gemini: path.join(REPOS_SKILLS_DIR, 'gemini.json'),
|
|
473
473
|
opencode: path.join(REPOS_SKILLS_DIR, 'opencode.json'),
|
|
474
|
-
|
|
474
|
+
omp: path.join(REPOS_SKILLS_DIR, 'omp.json')
|
|
475
475
|
},
|
|
476
476
|
skillCaches: {
|
|
477
477
|
claude: path.join(CACHE_SKILLS_DIR, 'claude.json'),
|
|
478
478
|
codex: path.join(CACHE_SKILLS_DIR, 'codex.json'),
|
|
479
479
|
gemini: path.join(CACHE_SKILLS_DIR, 'gemini.json'),
|
|
480
480
|
opencode: path.join(CACHE_SKILLS_DIR, 'opencode.json'),
|
|
481
|
-
|
|
481
|
+
omp: path.join(CACHE_SKILLS_DIR, 'omp.json')
|
|
482
482
|
},
|
|
483
483
|
pluginRepos: {
|
|
484
484
|
claude: path.join(REPOS_PLUGINS_DIR, 'claude.json'),
|
|
485
485
|
codex: path.join(REPOS_PLUGINS_DIR, 'codex.json'),
|
|
486
486
|
gemini: path.join(REPOS_PLUGINS_DIR, 'gemini.json'),
|
|
487
487
|
opencode: path.join(REPOS_PLUGINS_DIR, 'opencode.json'),
|
|
488
|
-
|
|
488
|
+
omp: path.join(REPOS_PLUGINS_DIR, 'omp.json')
|
|
489
489
|
},
|
|
490
490
|
pluginMarketCache: {
|
|
491
491
|
claude: path.join(CACHE_PLUGINS_DIR, 'claude-market.json'),
|
|
492
492
|
codex: path.join(CACHE_PLUGINS_DIR, 'codex-market.json'),
|
|
493
493
|
gemini: path.join(CACHE_PLUGINS_DIR, 'gemini-market.json'),
|
|
494
494
|
opencode: path.join(CACHE_PLUGINS_DIR, 'opencode-market.json'),
|
|
495
|
-
|
|
495
|
+
omp: path.join(CACHE_PLUGINS_DIR, 'omp-market.json')
|
|
496
496
|
},
|
|
497
497
|
|
|
498
498
|
// 原生路径兼容
|
|
@@ -532,20 +532,20 @@ const LEGACY_STORAGE_RELOCATIONS = [
|
|
|
532
532
|
{ source: rootEntry('fork-relations.json'), target: PATHS.forkRelations },
|
|
533
533
|
{ source: rootEntry('opencode-project-order.json'), target: PATHS.opencodeProjectOrder },
|
|
534
534
|
{ source: rootEntry('opencode-session-order.json'), target: PATHS.opencodeSessionOrder },
|
|
535
|
-
{ source: rootEntry('
|
|
536
|
-
{ source: rootEntry('
|
|
535
|
+
{ source: rootEntry('omp-project-order.json'), target: PATHS.ompProjectOrder },
|
|
536
|
+
{ source: rootEntry('omp-session-order.json'), target: PATHS.ompSessionOrder },
|
|
537
537
|
|
|
538
538
|
// 渠道相关
|
|
539
539
|
{ source: rootEntry('channels.json'), target: PATHS.channels.claude },
|
|
540
540
|
{ source: rootEntry('codex-channels.json'), target: PATHS.channels.codex },
|
|
541
541
|
{ source: rootEntry('gemini-channels.json'), target: PATHS.channels.gemini },
|
|
542
542
|
{ source: rootEntry('opencode-channels.json'), target: PATHS.channels.opencode },
|
|
543
|
-
{ source: rootEntry('
|
|
543
|
+
{ source: rootEntry('omp-channels.json'), target: PATHS.channels.omp },
|
|
544
544
|
{ source: rootEntry('active-channel.json'), target: PATHS.activeChannel.claude },
|
|
545
545
|
{ source: rootEntry('codex-active-channel.json'), target: PATHS.activeChannel.codex },
|
|
546
546
|
{ source: rootEntry('gemini-active-channel.json'), target: PATHS.activeChannel.gemini },
|
|
547
547
|
{ source: rootEntry('opencode-active-channel.json'), target: PATHS.activeChannel.opencode },
|
|
548
|
-
{ source: rootEntry('
|
|
548
|
+
{ source: rootEntry('omp-active-channel.json'), target: PATHS.activeChannel.omp },
|
|
549
549
|
|
|
550
550
|
// 统计与日志
|
|
551
551
|
{ source: rootEntry('statistics.json'), target: PATHS.statistics.summary },
|
|
@@ -568,14 +568,14 @@ const LEGACY_STORAGE_RELOCATIONS = [
|
|
|
568
568
|
{ source: rootEntry('codex-proxy-runtime.json'), target: PATHS.proxyRuntime.codex },
|
|
569
569
|
{ source: rootEntry('gemini-proxy-runtime.json'), target: PATHS.proxyRuntime.gemini },
|
|
570
570
|
{ source: rootEntry('opencode-proxy-runtime.json'), target: PATHS.proxyRuntime.opencode },
|
|
571
|
-
{ source: rootEntry('
|
|
571
|
+
{ source: rootEntry('omp-proxy-runtime.json'), target: PATHS.proxyRuntime.omp },
|
|
572
572
|
{ source: rootEntry('notify-hook.js'), target: PATHS.notifyHook },
|
|
573
573
|
{ source: rootEntry('claude-request-template.json'), target: PATHS.claudeRequestTemplate },
|
|
574
574
|
{ source: rootEntry('claude-requests.jsonl'), target: PATHS.requestSnapshots.claude },
|
|
575
575
|
{ source: rootEntry('codex-requests.jsonl'), target: PATHS.requestSnapshots.codex },
|
|
576
576
|
{ source: rootEntry('gemini-requests.jsonl'), target: PATHS.requestSnapshots.gemini },
|
|
577
577
|
{ source: rootEntry('opencode-requests.jsonl'), target: PATHS.requestSnapshots.opencode },
|
|
578
|
-
{ source: rootEntry('
|
|
578
|
+
{ source: rootEntry('omp-requests.jsonl'), target: PATHS.requestSnapshots.omp },
|
|
579
579
|
|
|
580
580
|
// 备份
|
|
581
581
|
{ source: rootEntry('env-backups'), target: PATHS.envBackups },
|
|
@@ -585,29 +585,29 @@ const LEGACY_STORAGE_RELOCATIONS = [
|
|
|
585
585
|
{ source: rootEntry('codex-skills'), target: PATHS.localSkills.codex },
|
|
586
586
|
{ source: rootEntry('gemini-skills'), target: PATHS.localSkills.gemini },
|
|
587
587
|
{ source: rootEntry('opencode-skills'), target: PATHS.localSkills.opencode },
|
|
588
|
-
{ source: rootEntry('
|
|
588
|
+
{ source: rootEntry('omp-skills'), target: PATHS.localSkills.omp },
|
|
589
589
|
{ source: rootEntry('skill-repos.json'), target: PATHS.skillRepos.claude },
|
|
590
590
|
{ source: rootEntry('codex-skill-repos.json'), target: PATHS.skillRepos.codex },
|
|
591
591
|
{ source: rootEntry('gemini-skill-repos.json'), target: PATHS.skillRepos.gemini },
|
|
592
592
|
{ source: rootEntry('opencode-skill-repos.json'), target: PATHS.skillRepos.opencode },
|
|
593
|
-
{ source: rootEntry('
|
|
593
|
+
{ source: rootEntry('omp-skill-repos.json'), target: PATHS.skillRepos.omp },
|
|
594
594
|
{ source: rootEntry('skills-cache.json'), target: PATHS.skillCaches.claude },
|
|
595
595
|
{ source: rootEntry('codex-skills-cache.json'), target: PATHS.skillCaches.codex },
|
|
596
596
|
{ source: rootEntry('gemini-skills-cache.json'), target: PATHS.skillCaches.gemini },
|
|
597
597
|
{ source: rootEntry('opencode-skills-cache.json'), target: PATHS.skillCaches.opencode },
|
|
598
|
-
{ source: rootEntry('
|
|
598
|
+
{ source: rootEntry('omp-skills-cache.json'), target: PATHS.skillCaches.omp },
|
|
599
599
|
|
|
600
600
|
// 插件仓库缓存
|
|
601
601
|
{ source: rootEntry('plugin-repos.json'), target: PATHS.pluginRepos.claude },
|
|
602
602
|
{ source: rootEntry('codex-plugin-repos.json'), target: PATHS.pluginRepos.codex },
|
|
603
603
|
{ source: rootEntry('gemini-plugin-repos.json'), target: PATHS.pluginRepos.gemini },
|
|
604
604
|
{ source: rootEntry('opencode-plugin-repos.json'), target: PATHS.pluginRepos.opencode },
|
|
605
|
-
{ source: rootEntry('
|
|
605
|
+
{ source: rootEntry('omp-plugin-repos.json'), target: PATHS.pluginRepos.omp },
|
|
606
606
|
{ source: rootEntry('plugins-market-cache.json'), target: PATHS.pluginMarketCache.claude },
|
|
607
607
|
{ source: rootEntry('codex-plugins-market-cache.json'), target: PATHS.pluginMarketCache.codex },
|
|
608
608
|
{ source: rootEntry('gemini-plugins-market-cache.json'), target: PATHS.pluginMarketCache.gemini },
|
|
609
609
|
{ source: rootEntry('opencode-plugins-market-cache.json'), target: PATHS.pluginMarketCache.opencode },
|
|
610
|
-
{ source: rootEntry('
|
|
610
|
+
{ source: rootEntry('omp-plugins-market-cache.json'), target: PATHS.pluginMarketCache.omp },
|
|
611
611
|
|
|
612
612
|
// 已废弃但需要保留的数据
|
|
613
613
|
{ source: rootEntry('oauth-tokens.json'), target: PATHS.legacy.oauthTokens }
|
|
@@ -803,18 +803,15 @@ function normalizeOmpProfileName(profile = '') {
|
|
|
803
803
|
}
|
|
804
804
|
|
|
805
805
|
function getOmpProfileName() {
|
|
806
|
-
|
|
807
|
-
return normalizeOmpProfileName(process.env.OMP_PROFILE);
|
|
808
|
-
}
|
|
809
|
-
return normalizeOmpProfileName(process.env.PI_PROFILE);
|
|
806
|
+
return normalizeOmpProfileName(process.env.OMP_PROFILE);
|
|
810
807
|
}
|
|
811
808
|
|
|
812
809
|
function getOmpConfigRoot() {
|
|
813
|
-
return expandHomePath(resolveExistingEnvPath(process.env.
|
|
810
|
+
return expandHomePath(resolveExistingEnvPath(process.env.OMP_CONFIG_DIR) || path.join(HOME_DIR, '.omp'));
|
|
814
811
|
}
|
|
815
812
|
|
|
816
|
-
function
|
|
817
|
-
const configuredDir = resolveExistingEnvPath(process.env.
|
|
813
|
+
function getOmpAgentDir() {
|
|
814
|
+
const configuredDir = resolveExistingEnvPath(process.env.OMP_CODING_AGENT_DIR);
|
|
818
815
|
if (configuredDir) {
|
|
819
816
|
return path.resolve(expandHomePath(configuredDir));
|
|
820
817
|
}
|
|
@@ -876,25 +873,25 @@ const NATIVE_PATHS = {
|
|
|
876
873
|
auth: path.join(getOpenCodeDataDir(), 'auth.json')
|
|
877
874
|
},
|
|
878
875
|
|
|
879
|
-
// OMP
|
|
880
|
-
|
|
881
|
-
dir:
|
|
882
|
-
config: path.join(
|
|
883
|
-
settings: path.join(
|
|
884
|
-
settingsJsonLegacy: path.join(
|
|
885
|
-
auth: path.join(
|
|
886
|
-
models: path.join(
|
|
887
|
-
modelsYml: path.join(
|
|
888
|
-
modelsJsonLegacy: path.join(
|
|
889
|
-
mcp: path.join(
|
|
890
|
-
sessions: path.join(
|
|
891
|
-
skills: path.join(
|
|
892
|
-
prompts: path.join(
|
|
893
|
-
commands: path.join(
|
|
894
|
-
notes: path.join(
|
|
895
|
-
extensions: path.join(
|
|
896
|
-
themes: path.join(
|
|
897
|
-
packages: path.join(
|
|
876
|
+
// OMP 原生配置。
|
|
877
|
+
omp: {
|
|
878
|
+
dir: getOmpAgentDir(),
|
|
879
|
+
config: path.join(getOmpAgentDir(), 'config.yml'),
|
|
880
|
+
settings: path.join(getOmpAgentDir(), 'config.yml'),
|
|
881
|
+
settingsJsonLegacy: path.join(getOmpAgentDir(), 'settings.json'),
|
|
882
|
+
auth: path.join(getOmpAgentDir(), 'auth.json'),
|
|
883
|
+
models: path.join(getOmpAgentDir(), 'models.yml'),
|
|
884
|
+
modelsYml: path.join(getOmpAgentDir(), 'models.yml'),
|
|
885
|
+
modelsJsonLegacy: path.join(getOmpAgentDir(), 'models.json'),
|
|
886
|
+
mcp: path.join(getOmpAgentDir(), 'mcp.json'),
|
|
887
|
+
sessions: path.join(getOmpAgentDir(), 'sessions'),
|
|
888
|
+
skills: path.join(getOmpAgentDir(), 'skills'),
|
|
889
|
+
prompts: path.join(getOmpAgentDir(), 'prompts'),
|
|
890
|
+
commands: path.join(getOmpAgentDir(), 'commands'),
|
|
891
|
+
notes: path.join(getOmpAgentDir(), 'notes'),
|
|
892
|
+
extensions: path.join(getOmpAgentDir(), 'extensions'),
|
|
893
|
+
themes: path.join(getOmpAgentDir(), 'themes'),
|
|
894
|
+
packages: path.join(getOmpAgentDir(), 'packages')
|
|
898
895
|
}
|
|
899
896
|
};
|
|
900
897
|
|
|
@@ -915,5 +912,5 @@ module.exports = {
|
|
|
915
912
|
getGeminiDir,
|
|
916
913
|
getOpenCodeDataDir,
|
|
917
914
|
getOpenCodeConfigDir,
|
|
918
|
-
|
|
915
|
+
getOmpAgentDir
|
|
919
916
|
};
|