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
|
@@ -28,8 +28,8 @@ const OPENCODE_CONFIG_PATHS = {
|
|
|
28
28
|
json: path.join(OPENCODE_CONFIG_DIR, 'opencode.json'),
|
|
29
29
|
legacy: path.join(OPENCODE_CONFIG_DIR, 'config.json')
|
|
30
30
|
};
|
|
31
|
-
const
|
|
32
|
-
|| path.join(NATIVE_PATHS.
|
|
31
|
+
const OMP_MCP_CONFIG_PATH = NATIVE_PATHS.omp?.mcp
|
|
32
|
+
|| path.join(NATIVE_PATHS.omp?.dir || path.join(HOME_DIR, '.omp', 'agent'), 'mcp.json');
|
|
33
33
|
|
|
34
34
|
// MCP 客户端连接池
|
|
35
35
|
// serverId -> { client, timestamp }
|
|
@@ -38,8 +38,8 @@ const POOL_TTL = 5 * 60 * 1000; // 5 minutes
|
|
|
38
38
|
const STREAMABLE_HTTP_TYPE = 'streamable_http';
|
|
39
39
|
const MCP_SERVER_TYPES = ['stdio', STREAMABLE_HTTP_TYPE, 'sse'];
|
|
40
40
|
const REMOTE_MCP_SERVER_TYPES = [STREAMABLE_HTTP_TYPE, 'sse'];
|
|
41
|
-
const MCP_PLATFORM_KEYS = ['claude', 'codex', 'gemini', 'opencode', '
|
|
42
|
-
const OMP_MCP_SCHEMA_URL = 'https://raw.githubusercontent.com/can1357/oh-my-
|
|
41
|
+
const MCP_PLATFORM_KEYS = ['claude', 'codex', 'gemini', 'opencode', 'omp'];
|
|
42
|
+
const OMP_MCP_SCHEMA_URL = 'https://raw.githubusercontent.com/can1357/oh-my-omp/main/packages/coding-agent/src/config/mcp-schema.json';
|
|
43
43
|
const OMP_SERVER_NAME_PATTERN = /^[a-zA-Z0-9_.-]{1,100}$/;
|
|
44
44
|
|
|
45
45
|
function normalizeServerSpec(spec = {}) {
|
|
@@ -538,7 +538,7 @@ const DEFAULT_SERVER_APPS = {
|
|
|
538
538
|
codex: false,
|
|
539
539
|
gemini: false,
|
|
540
540
|
opencode: false,
|
|
541
|
-
|
|
541
|
+
omp: false
|
|
542
542
|
};
|
|
543
543
|
|
|
544
544
|
function normalizeServerApps(apps = {}, fallbackApps = DEFAULT_SERVER_APPS) {
|
|
@@ -547,7 +547,7 @@ function normalizeServerApps(apps = {}, fallbackApps = DEFAULT_SERVER_APPS) {
|
|
|
547
547
|
codex: apps.codex !== undefined ? !!apps.codex : !!fallbackApps.codex,
|
|
548
548
|
gemini: apps.gemini !== undefined ? !!apps.gemini : !!fallbackApps.gemini,
|
|
549
549
|
opencode: apps.opencode !== undefined ? !!apps.opencode : !!fallbackApps.opencode,
|
|
550
|
-
|
|
550
|
+
omp: apps.omp !== undefined ? !!apps.omp: !!fallbackApps.omp
|
|
551
551
|
};
|
|
552
552
|
}
|
|
553
553
|
|
|
@@ -763,7 +763,7 @@ async function syncServerToPlatform(server, platform) {
|
|
|
763
763
|
case 'opencode':
|
|
764
764
|
syncToOpenCodeConfig(server);
|
|
765
765
|
break;
|
|
766
|
-
case '
|
|
766
|
+
case 'omp':
|
|
767
767
|
syncToOmpMcpConfig(server);
|
|
768
768
|
break;
|
|
769
769
|
}
|
|
@@ -792,7 +792,7 @@ async function removeServerFromPlatform(serverId, platform) {
|
|
|
792
792
|
case 'opencode':
|
|
793
793
|
removeFromOpenCodeConfig(serverId);
|
|
794
794
|
break;
|
|
795
|
-
case '
|
|
795
|
+
case 'omp':
|
|
796
796
|
removeFromOmpMcpConfig(serverId);
|
|
797
797
|
break;
|
|
798
798
|
}
|
|
@@ -954,7 +954,7 @@ function validateOmpServerName(serverId) {
|
|
|
954
954
|
}
|
|
955
955
|
|
|
956
956
|
function readOmpMcpConfig() {
|
|
957
|
-
const config = readJsonFile(
|
|
957
|
+
const config = readJsonFile(OMP_MCP_CONFIG_PATH, { mcpServers: {} });
|
|
958
958
|
if (!config || typeof config !== 'object' || Array.isArray(config)) {
|
|
959
959
|
return { mcpServers: {} };
|
|
960
960
|
}
|
|
@@ -1059,14 +1059,14 @@ function syncToOmpMcpConfig(server) {
|
|
|
1059
1059
|
validateOmpServerName(server.id);
|
|
1060
1060
|
const config = readOmpMcpConfig();
|
|
1061
1061
|
config.mcpServers[server.id] = convertToOmpMcpFormat(server.server);
|
|
1062
|
-
writeJsonFile(
|
|
1062
|
+
writeJsonFile(OMP_MCP_CONFIG_PATH, config);
|
|
1063
1063
|
}
|
|
1064
1064
|
|
|
1065
1065
|
function removeFromOmpMcpConfig(serverId) {
|
|
1066
1066
|
const config = readOmpMcpConfig();
|
|
1067
1067
|
if (config.mcpServers && config.mcpServers[serverId]) {
|
|
1068
1068
|
delete config.mcpServers[serverId];
|
|
1069
|
-
writeJsonFile(
|
|
1069
|
+
writeJsonFile(OMP_MCP_CONFIG_PATH, config);
|
|
1070
1070
|
}
|
|
1071
1071
|
}
|
|
1072
1072
|
|
|
@@ -1231,7 +1231,7 @@ async function importFromPlatform(platform) {
|
|
|
1231
1231
|
case 'opencode':
|
|
1232
1232
|
importedCount = importFromOpenCode(servers);
|
|
1233
1233
|
break;
|
|
1234
|
-
case '
|
|
1234
|
+
case 'omp':
|
|
1235
1235
|
importedCount = importFromOmp(servers);
|
|
1236
1236
|
break;
|
|
1237
1237
|
default:
|
|
@@ -1389,8 +1389,8 @@ function importFromOmp(servers) {
|
|
|
1389
1389
|
|
|
1390
1390
|
if (servers[id]) {
|
|
1391
1391
|
servers[id].apps = normalizeServerApps(servers[id].apps);
|
|
1392
|
-
if (!servers[id].apps.
|
|
1393
|
-
servers[id].apps.
|
|
1392
|
+
if (!servers[id].apps.omp) {
|
|
1393
|
+
servers[id].apps.omp = true;
|
|
1394
1394
|
count++;
|
|
1395
1395
|
}
|
|
1396
1396
|
} else {
|
|
@@ -1398,7 +1398,7 @@ function importFromOmp(servers) {
|
|
|
1398
1398
|
id,
|
|
1399
1399
|
name: id,
|
|
1400
1400
|
server: convertedSpec,
|
|
1401
|
-
apps: { claude: false, codex: false, gemini: false, opencode: false,
|
|
1401
|
+
apps: { claude: false, codex: false, gemini: false, opencode: false, omp: true },
|
|
1402
1402
|
createdAt: Date.now(),
|
|
1403
1403
|
updatedAt: Date.now()
|
|
1404
1404
|
};
|
|
@@ -1471,7 +1471,7 @@ function getStats() {
|
|
|
1471
1471
|
codex: serverList.filter(s => s.apps?.codex).length,
|
|
1472
1472
|
gemini: serverList.filter(s => s.apps?.gemini).length,
|
|
1473
1473
|
opencode: serverList.filter(s => s.apps?.opencode).length,
|
|
1474
|
-
|
|
1474
|
+
omp: serverList.filter(s => s.apps?.omp).length
|
|
1475
1475
|
};
|
|
1476
1476
|
}
|
|
1477
1477
|
|
|
@@ -1923,7 +1923,7 @@ function updateServerOrder(serverIds) {
|
|
|
1923
1923
|
|
|
1924
1924
|
/**
|
|
1925
1925
|
* 导出所有 MCP 配置
|
|
1926
|
-
* @param {string} format - 导出格式: 'json' | 'claude' | 'codex' | 'opencode' | 'gemini' | '
|
|
1926
|
+
* @param {string} format - 导出格式: 'json' | 'claude' | 'codex' | 'opencode' | 'gemini' | 'omp'
|
|
1927
1927
|
*/
|
|
1928
1928
|
function exportServers(format = 'json') {
|
|
1929
1929
|
const servers = getAllServers();
|
|
@@ -1937,7 +1937,7 @@ function exportServers(format = 'json') {
|
|
|
1937
1937
|
return exportForOpenCode(servers);
|
|
1938
1938
|
case 'gemini':
|
|
1939
1939
|
return exportForGemini(servers);
|
|
1940
|
-
case '
|
|
1940
|
+
case 'omp':
|
|
1941
1941
|
return exportForOmp(servers);
|
|
1942
1942
|
case 'json':
|
|
1943
1943
|
default:
|
|
@@ -2045,14 +2045,14 @@ function exportForOmp(servers) {
|
|
|
2045
2045
|
const mcpServers = {};
|
|
2046
2046
|
|
|
2047
2047
|
for (const [id, server] of Object.entries(servers)) {
|
|
2048
|
-
if (server.apps?.
|
|
2048
|
+
if (server.apps?.omp) {
|
|
2049
2049
|
validateOmpServerName(id);
|
|
2050
2050
|
mcpServers[id] = convertToOmpMcpFormat(server.server);
|
|
2051
2051
|
}
|
|
2052
2052
|
}
|
|
2053
2053
|
|
|
2054
2054
|
return {
|
|
2055
|
-
format: '
|
|
2055
|
+
format: 'omp',
|
|
2056
2056
|
content: JSON.stringify({ $schema: OMP_MCP_SCHEMA_URL, mcpServers }, null, 2),
|
|
2057
2057
|
filename: 'omp-mcp-config.json'
|
|
2058
2058
|
};
|
|
@@ -13,6 +13,7 @@ const geminiSettingsManager = require('./gemini-settings-manager');
|
|
|
13
13
|
|
|
14
14
|
const MANAGED_HOOK_NAME = 'coding-tool-notify';
|
|
15
15
|
const MANAGED_OPENCODE_PLUGIN_FILE = 'coding-tool-notify.js';
|
|
16
|
+
const MANAGED_OMP_EXTENSION_FILE = 'coding-tool-notify.ts';
|
|
16
17
|
const REMOTE_PROVIDER_TYPES = [
|
|
17
18
|
'wechatBot',
|
|
18
19
|
'qqBot',
|
|
@@ -371,6 +372,13 @@ function getOpenCodeManagedPluginPath() {
|
|
|
371
372
|
return path.join(NATIVE_PATHS.opencode.config, 'plugins', MANAGED_OPENCODE_PLUGIN_FILE);
|
|
372
373
|
}
|
|
373
374
|
|
|
375
|
+
function getOmpManagedExtensionPath() {
|
|
376
|
+
const ompPaths = NATIVE_PATHS.omp || {};
|
|
377
|
+
const extensionsDir = ompPaths.extensions ||
|
|
378
|
+
path.join(ompPaths.dir || path.dirname(ompPaths.settings || PATHS.notifyHook), 'extensions');
|
|
379
|
+
return path.join(extensionsDir, MANAGED_OMP_EXTENSION_FILE);
|
|
380
|
+
}
|
|
381
|
+
|
|
374
382
|
function buildOpenCodePluginContent(type) {
|
|
375
383
|
const mode = normalizeType(type);
|
|
376
384
|
return `// Managed by Coding Tool. Do not edit manually.
|
|
@@ -410,6 +418,64 @@ export const CodingToolNotifyPlugin = async () => ({
|
|
|
410
418
|
`;
|
|
411
419
|
}
|
|
412
420
|
|
|
421
|
+
function buildOmpExtensionContent(type) {
|
|
422
|
+
const mode = normalizeType(type);
|
|
423
|
+
return `// Managed by Coding Tool. Do not edit manually.
|
|
424
|
+
// mode:${mode}
|
|
425
|
+
import { spawn } from 'node:child_process'
|
|
426
|
+
|
|
427
|
+
const SCRIPT_PATH = ${JSON.stringify(PATHS.notifyHook)}
|
|
428
|
+
const MODE = ${JSON.stringify(mode)}
|
|
429
|
+
let lastFireAt = 0
|
|
430
|
+
|
|
431
|
+
function shouldFire() {
|
|
432
|
+
const now = Date.now()
|
|
433
|
+
if (now - lastFireAt < 1000) {
|
|
434
|
+
return false
|
|
435
|
+
}
|
|
436
|
+
lastFireAt = now
|
|
437
|
+
return true
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
function fire(eventType) {
|
|
441
|
+
if (!shouldFire()) {
|
|
442
|
+
return
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
try {
|
|
446
|
+
const child = spawn('node', [
|
|
447
|
+
SCRIPT_PATH,
|
|
448
|
+
'--source=omp',
|
|
449
|
+
\`--mode=\${MODE}\`,
|
|
450
|
+
\`--cc-notify-type=\${MODE}\`,
|
|
451
|
+
\`--event-type=\${eventType}\`
|
|
452
|
+
], {
|
|
453
|
+
detached: true,
|
|
454
|
+
stdio: 'ignore',
|
|
455
|
+
windowsHide: true
|
|
456
|
+
})
|
|
457
|
+
child.unref()
|
|
458
|
+
} catch (error) {
|
|
459
|
+
// Ignore notification failures.
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
export default async function CodingToolNotifyExtension(omp) {
|
|
464
|
+
const register = (eventName) => {
|
|
465
|
+
if (typeof omp?.on !== 'function') {
|
|
466
|
+
return
|
|
467
|
+
}
|
|
468
|
+
omp.on(eventName, async () => {
|
|
469
|
+
fire(eventName)
|
|
470
|
+
})
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
register('agent_settled')
|
|
474
|
+
register('turn_end')
|
|
475
|
+
}
|
|
476
|
+
`;
|
|
477
|
+
}
|
|
478
|
+
|
|
413
479
|
function escapeForAppleScript(value) {
|
|
414
480
|
return String(value || '').replace(/\\/g, '\\\\').replace(/"/g, '\\"');
|
|
415
481
|
}
|
|
@@ -712,6 +778,10 @@ function resolveMessage(source, eventType, payload) {
|
|
|
712
778
|
return 'OpenCode 响应已完成 | 等待交互'
|
|
713
779
|
}
|
|
714
780
|
|
|
781
|
+
if (source === 'omp') {
|
|
782
|
+
return 'OMP 回合已完成 | 等待交互'
|
|
783
|
+
}
|
|
784
|
+
|
|
715
785
|
return 'Claude Code 任务已完成 | 等待交互'
|
|
716
786
|
}
|
|
717
787
|
|
|
@@ -886,12 +956,17 @@ function sendTelegramMessage(config = {}, ctx, send = postJson) {
|
|
|
886
956
|
return send(url, payload, {}, agent ? { agent } : {})
|
|
887
957
|
}
|
|
888
958
|
|
|
959
|
+
function resolveDisplaySource(source) {
|
|
960
|
+
if (source === 'omp') return 'OMP'
|
|
961
|
+
return source
|
|
962
|
+
}
|
|
963
|
+
|
|
889
964
|
function buildNotificationContext(message, source, eventType) {
|
|
890
965
|
const timestamp = new Date().toLocaleString('zh-CN')
|
|
891
966
|
return {
|
|
892
967
|
title: 'Coding Tool - 通知',
|
|
893
968
|
message,
|
|
894
|
-
source,
|
|
969
|
+
source: resolveDisplaySource(source),
|
|
895
970
|
eventType,
|
|
896
971
|
timestamp,
|
|
897
972
|
hostname: os.hostname()
|
|
@@ -1545,6 +1620,24 @@ function parseOpenCodeNotificationStatus(content = '') {
|
|
|
1545
1620
|
};
|
|
1546
1621
|
}
|
|
1547
1622
|
|
|
1623
|
+
function parseOmpNotificationStatus(content = '') {
|
|
1624
|
+
if (!content) {
|
|
1625
|
+
return {
|
|
1626
|
+
enabled: false,
|
|
1627
|
+
external: false,
|
|
1628
|
+
type: 'notification',
|
|
1629
|
+
method: 'Extension Events'
|
|
1630
|
+
};
|
|
1631
|
+
}
|
|
1632
|
+
|
|
1633
|
+
return {
|
|
1634
|
+
enabled: true,
|
|
1635
|
+
external: false,
|
|
1636
|
+
type: parseManagedType(content) || 'notification',
|
|
1637
|
+
method: 'Extension Events'
|
|
1638
|
+
};
|
|
1639
|
+
}
|
|
1640
|
+
|
|
1548
1641
|
function getOpenCodeHookStatus() {
|
|
1549
1642
|
const pluginPath = getOpenCodeManagedPluginPath();
|
|
1550
1643
|
if (!fs.existsSync(pluginPath)) {
|
|
@@ -1554,6 +1647,15 @@ function getOpenCodeHookStatus() {
|
|
|
1554
1647
|
return parseOpenCodeNotificationStatus(fs.readFileSync(pluginPath, 'utf8'));
|
|
1555
1648
|
}
|
|
1556
1649
|
|
|
1650
|
+
function getOmpHookStatus() {
|
|
1651
|
+
const extensionPath = getOmpManagedExtensionPath();
|
|
1652
|
+
if (!fs.existsSync(extensionPath)) {
|
|
1653
|
+
return parseOmpNotificationStatus('');
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
return parseOmpNotificationStatus(fs.readFileSync(extensionPath, 'utf8'));
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1557
1659
|
function saveOpenCodeHook(enabled, type) {
|
|
1558
1660
|
const pluginPath = getOpenCodeManagedPluginPath();
|
|
1559
1661
|
const opencodeSettingsManager = require('./opencode-settings-manager');
|
|
@@ -1608,6 +1710,20 @@ function saveOpenCodeHook(enabled, type) {
|
|
|
1608
1710
|
}
|
|
1609
1711
|
}
|
|
1610
1712
|
|
|
1713
|
+
function saveOmpHook(enabled, type) {
|
|
1714
|
+
const extensionPath = getOmpManagedExtensionPath();
|
|
1715
|
+
|
|
1716
|
+
if (!enabled) {
|
|
1717
|
+
if (fs.existsSync(extensionPath)) {
|
|
1718
|
+
fs.unlinkSync(extensionPath);
|
|
1719
|
+
}
|
|
1720
|
+
return;
|
|
1721
|
+
}
|
|
1722
|
+
|
|
1723
|
+
ensureParentDir(extensionPath);
|
|
1724
|
+
fs.writeFileSync(extensionPath, buildOmpExtensionContent(type), 'utf8');
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1611
1727
|
function getNotificationSettings() {
|
|
1612
1728
|
const uiConfig = loadUIConfig();
|
|
1613
1729
|
const remoteNotifications = getRemoteNotificationsConfig(uiConfig);
|
|
@@ -1623,7 +1739,8 @@ function getNotificationSettings() {
|
|
|
1623
1739
|
claude: getClaudeHookStatus(),
|
|
1624
1740
|
codex: getCodexHookStatus(),
|
|
1625
1741
|
gemini: getGeminiHookStatus(),
|
|
1626
|
-
opencode: getOpenCodeHookStatus()
|
|
1742
|
+
opencode: getOpenCodeHookStatus(),
|
|
1743
|
+
omp: getOmpHookStatus()
|
|
1627
1744
|
}
|
|
1628
1745
|
};
|
|
1629
1746
|
}
|
|
@@ -1643,6 +1760,8 @@ function resolveBrowserNotificationTitle(source = 'claude') {
|
|
|
1643
1760
|
return 'Gemini CLI';
|
|
1644
1761
|
case 'opencode':
|
|
1645
1762
|
return 'OpenCode';
|
|
1763
|
+
case 'omp':
|
|
1764
|
+
return 'OMP';
|
|
1646
1765
|
default:
|
|
1647
1766
|
return 'Claude Code';
|
|
1648
1767
|
}
|
|
@@ -1656,6 +1775,8 @@ function resolveBrowserNotificationUrl(source = 'claude') {
|
|
|
1656
1775
|
return '/gemini';
|
|
1657
1776
|
case 'opencode':
|
|
1658
1777
|
return '/opencode';
|
|
1778
|
+
case 'omp':
|
|
1779
|
+
return '/omp';
|
|
1659
1780
|
default:
|
|
1660
1781
|
return '/claude';
|
|
1661
1782
|
}
|
|
@@ -1694,7 +1815,8 @@ function saveNotificationSettings(input = {}) {
|
|
|
1694
1815
|
claude: normalizePlatformInput(input?.platforms?.claude),
|
|
1695
1816
|
codex: normalizePlatformInput(input?.platforms?.codex),
|
|
1696
1817
|
gemini: normalizePlatformInput(input?.platforms?.gemini),
|
|
1697
|
-
opencode: normalizePlatformInput(input?.platforms?.opencode)
|
|
1818
|
+
opencode: normalizePlatformInput(input?.platforms?.opencode),
|
|
1819
|
+
omp: normalizePlatformInput(input?.platforms?.omp)
|
|
1698
1820
|
};
|
|
1699
1821
|
|
|
1700
1822
|
saveNotificationUiConfig(remoteNotifications, platforms.claude.enabled);
|
|
@@ -1708,6 +1830,7 @@ function saveNotificationSettings(input = {}) {
|
|
|
1708
1830
|
saveCodexHook(platforms.codex.enabled, platforms.codex.type);
|
|
1709
1831
|
saveGeminiHook(platforms.gemini.enabled, platforms.gemini.type);
|
|
1710
1832
|
saveOpenCodeHook(platforms.opencode.enabled, platforms.opencode.type);
|
|
1833
|
+
saveOmpHook(platforms.omp.enabled, platforms.omp.type);
|
|
1711
1834
|
|
|
1712
1835
|
if (!hasManagedPlatform) {
|
|
1713
1836
|
removeNotifyScript();
|
|
@@ -1834,7 +1957,8 @@ function buildLegacyClaudeSaveInput(input = {}, currentSettings = getNotificatio
|
|
|
1834
1957
|
: { enabled: false, type: 'notification' },
|
|
1835
1958
|
codex: normalizeSavedPlatformStatus(currentSettings?.platforms?.codex),
|
|
1836
1959
|
gemini: normalizeSavedPlatformStatus(currentSettings?.platforms?.gemini),
|
|
1837
|
-
opencode: normalizeSavedPlatformStatus(currentSettings?.platforms?.opencode)
|
|
1960
|
+
opencode: normalizeSavedPlatformStatus(currentSettings?.platforms?.opencode),
|
|
1961
|
+
omp: normalizeSavedPlatformStatus(currentSettings?.platforms?.omp)
|
|
1838
1962
|
},
|
|
1839
1963
|
remoteNotifications: currentSettings?.remoteNotifications || { providers: [] }
|
|
1840
1964
|
};
|
|
@@ -1873,7 +1997,8 @@ function initDefaultHooks() {
|
|
|
1873
1997
|
claude: { enabled: true, type: currentStatus.type || 'notification' },
|
|
1874
1998
|
codex: normalizeSavedPlatformStatus(currentSettings?.platforms?.codex),
|
|
1875
1999
|
gemini: normalizeSavedPlatformStatus(currentSettings?.platforms?.gemini),
|
|
1876
|
-
opencode: normalizeSavedPlatformStatus(currentSettings?.platforms?.opencode)
|
|
2000
|
+
opencode: normalizeSavedPlatformStatus(currentSettings?.platforms?.opencode),
|
|
2001
|
+
omp: normalizeSavedPlatformStatus(currentSettings?.platforms?.omp)
|
|
1877
2002
|
},
|
|
1878
2003
|
remoteNotifications: currentSettings?.remoteNotifications || { providers: [] }
|
|
1879
2004
|
});
|
|
@@ -1890,7 +2015,8 @@ function initDefaultHooks() {
|
|
|
1890
2015
|
claude: { enabled: true, type: 'notification' },
|
|
1891
2016
|
codex: normalizeSavedPlatformStatus(currentSettings?.platforms?.codex),
|
|
1892
2017
|
gemini: normalizeSavedPlatformStatus(currentSettings?.platforms?.gemini),
|
|
1893
|
-
opencode: normalizeSavedPlatformStatus(currentSettings?.platforms?.opencode)
|
|
2018
|
+
opencode: normalizeSavedPlatformStatus(currentSettings?.platforms?.opencode),
|
|
2019
|
+
omp: normalizeSavedPlatformStatus(currentSettings?.platforms?.omp)
|
|
1894
2020
|
},
|
|
1895
2021
|
remoteNotifications: currentSettings?.remoteNotifications || { providers: [] }
|
|
1896
2022
|
});
|
|
@@ -2277,7 +2403,9 @@ module.exports = {
|
|
|
2277
2403
|
initDefaultHooks,
|
|
2278
2404
|
syncManagedNotificationAssets,
|
|
2279
2405
|
getOpenCodeManagedPluginPath,
|
|
2406
|
+
getOmpManagedExtensionPath,
|
|
2280
2407
|
buildOpenCodePluginContent,
|
|
2408
|
+
buildOmpExtensionContent,
|
|
2281
2409
|
buildCodexNotifyCommand,
|
|
2282
2410
|
writeNotifyScript,
|
|
2283
2411
|
generateNotifyScript,
|
|
@@ -2292,9 +2420,11 @@ module.exports = {
|
|
|
2292
2420
|
getCodexHookStatus,
|
|
2293
2421
|
getGeminiHookStatus,
|
|
2294
2422
|
getOpenCodeHookStatus,
|
|
2423
|
+
getOmpHookStatus,
|
|
2295
2424
|
parseCodexNotificationStatus,
|
|
2296
2425
|
parseGeminiNotificationStatus,
|
|
2297
2426
|
parseOpenCodeNotificationStatus,
|
|
2427
|
+
parseOmpNotificationStatus,
|
|
2298
2428
|
validateFeishuWebhookUrl,
|
|
2299
2429
|
normalizeRemoteNotificationsConfig,
|
|
2300
2430
|
validateRemoteProviderConfig,
|
|
@@ -2303,7 +2433,9 @@ module.exports = {
|
|
|
2303
2433
|
buildStopHookCommand,
|
|
2304
2434
|
buildClaudeCommand,
|
|
2305
2435
|
buildOpenCodePluginContent,
|
|
2436
|
+
buildOmpExtensionContent,
|
|
2306
2437
|
getOpenCodeManagedPluginPath,
|
|
2438
|
+
getOmpManagedExtensionPath,
|
|
2307
2439
|
generateNotifyScript,
|
|
2308
2440
|
generateSystemNotificationCommand,
|
|
2309
2441
|
emitBrowserNotification,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const { spawnSync } = require('child_process');
|
|
2
|
-
const
|
|
2
|
+
const ompConfig = require('./omp-config');
|
|
3
3
|
|
|
4
4
|
const COMMAND_TIMEOUT_MS = 5000;
|
|
5
5
|
const TOKEN_LIST_TIMEOUT_MS = 3000;
|
|
@@ -214,7 +214,7 @@ function getOmpAuthProviderSnapshot(options = {}) {
|
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
const env = options.env || process.env;
|
|
217
|
-
const runtime = options.runtime ||
|
|
217
|
+
const runtime = options.runtime || ompConfig.resolveOmpRuntime(env, options.runtimeOptions || {});
|
|
218
218
|
if (!runtime || runtime.runtime !== 'omp' || !runtime.installed) {
|
|
219
219
|
const value = buildEmptySnapshot(runtime || null, 'omp-not-available');
|
|
220
220
|
snapshotCache[cacheKey] = { loadedAt: now, value };
|
|
@@ -5,13 +5,13 @@ const {
|
|
|
5
5
|
removeManagedOmpProviders,
|
|
6
6
|
isManagedOmpProvidersActive,
|
|
7
7
|
getLastManagedOmpSyncResult
|
|
8
|
-
} = require('./
|
|
8
|
+
} = require('./omp-settings-manager');
|
|
9
9
|
|
|
10
|
-
class
|
|
10
|
+
class OmpChannelService extends BaseChannelService {
|
|
11
11
|
constructor() {
|
|
12
12
|
super({
|
|
13
|
-
platform: '
|
|
14
|
-
channelsFilePath: PATHS.channels.
|
|
13
|
+
platform: 'omp',
|
|
14
|
+
channelsFilePath: PATHS.channels.omp,
|
|
15
15
|
defaultGatewaySource: 'openai_compatible',
|
|
16
16
|
isProxyRunning: () => isManagedOmpProvidersActive()
|
|
17
17
|
});
|
|
@@ -69,7 +69,7 @@ class PiChannelService extends BaseChannelService {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
const service = new
|
|
72
|
+
const service = new OmpChannelService();
|
|
73
73
|
|
|
74
74
|
module.exports = {
|
|
75
75
|
getChannels: () => service.getChannels(),
|