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
|
@@ -19,7 +19,7 @@ const { installPlugin: installPluginCore, uninstallPlugin: uninstallPluginCore }
|
|
|
19
19
|
const { initializePlugins, shutdownPlugins } = require('../../plugins/plugin-manager');
|
|
20
20
|
const { INSTALLED_DIR, CONFIG_DIR } = require('../../plugins/constants');
|
|
21
21
|
const { NATIVE_PATHS, PATHS } = require('../../config/paths');
|
|
22
|
-
const {
|
|
22
|
+
const { getOmpCommand } = require('./omp-config');
|
|
23
23
|
const { maskToken } = require('./oauth-utils');
|
|
24
24
|
const {
|
|
25
25
|
assertInsideAllowedRoots,
|
|
@@ -46,9 +46,9 @@ const DEFAULT_REPOS_BY_PLATFORM = {
|
|
|
46
46
|
codex: [],
|
|
47
47
|
gemini: [],
|
|
48
48
|
opencode: [],
|
|
49
|
-
|
|
49
|
+
omp: []
|
|
50
50
|
};
|
|
51
|
-
const SUPPORTED_PLATFORMS = ['claude', 'codex', 'gemini', 'opencode', '
|
|
51
|
+
const SUPPORTED_PLATFORMS = ['claude', 'codex', 'gemini', 'opencode', 'omp'];
|
|
52
52
|
const PLATFORM_CAPABILITIES = {
|
|
53
53
|
claude: {
|
|
54
54
|
platform: 'claude',
|
|
@@ -99,8 +99,8 @@ const PLATFORM_CAPABILITIES = {
|
|
|
99
99
|
import: false,
|
|
100
100
|
syncRepos: false
|
|
101
101
|
},
|
|
102
|
-
|
|
103
|
-
platform: '
|
|
102
|
+
omp: {
|
|
103
|
+
platform: 'omp',
|
|
104
104
|
supportsPlugins: true,
|
|
105
105
|
repositories: true,
|
|
106
106
|
market: true,
|
|
@@ -194,7 +194,7 @@ function splitPluginMarketplaceKey(key = '') {
|
|
|
194
194
|
};
|
|
195
195
|
}
|
|
196
196
|
|
|
197
|
-
function
|
|
197
|
+
function normalizeOmpPackageEntry(item = null) {
|
|
198
198
|
if (typeof item === 'string') {
|
|
199
199
|
const name = item.trim();
|
|
200
200
|
return name ? {
|
|
@@ -219,17 +219,17 @@ function normalizePiPackageEntry(item = null) {
|
|
|
219
219
|
source: item.source || installSource,
|
|
220
220
|
directory,
|
|
221
221
|
installSource,
|
|
222
|
-
resourceTypes:
|
|
222
|
+
resourceTypes: normalizeOmpResourceTypes(item.resourceTypes || item.resources || item.provides || item.capabilities)
|
|
223
223
|
};
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
-
function
|
|
227
|
-
const normalized =
|
|
226
|
+
function getOmpPackageIdentity(item = null) {
|
|
227
|
+
const normalized = normalizeOmpPackageEntry(item);
|
|
228
228
|
return normalized?.name || '';
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
-
function
|
|
232
|
-
const normalized =
|
|
231
|
+
function ompPackageSettingValue(item = null) {
|
|
232
|
+
const normalized = normalizeOmpPackageEntry(item);
|
|
233
233
|
if (!normalized) return null;
|
|
234
234
|
if (typeof item === 'string') return normalized.name;
|
|
235
235
|
|
|
@@ -237,7 +237,7 @@ function piPackageSettingValue(item = null) {
|
|
|
237
237
|
next.name = normalized.name;
|
|
238
238
|
next.directory = normalized.directory;
|
|
239
239
|
next.source = normalized.installSource;
|
|
240
|
-
const resourceTypes =
|
|
240
|
+
const resourceTypes = normalizeOmpResourceTypes(next.resourceTypes || next.resources || normalized.resourceTypes);
|
|
241
241
|
if (resourceTypes.length > 0) {
|
|
242
242
|
next.resourceTypes = resourceTypes;
|
|
243
243
|
} else {
|
|
@@ -246,7 +246,7 @@ function piPackageSettingValue(item = null) {
|
|
|
246
246
|
return next;
|
|
247
247
|
}
|
|
248
248
|
|
|
249
|
-
function
|
|
249
|
+
function normalizeOmpResourceType(value = '') {
|
|
250
250
|
const normalized = String(value || '').trim();
|
|
251
251
|
if (!normalized) return '';
|
|
252
252
|
const key = normalized
|
|
@@ -277,10 +277,10 @@ function normalizePiResourceType(value = '') {
|
|
|
277
277
|
return map[key] || normalized;
|
|
278
278
|
}
|
|
279
279
|
|
|
280
|
-
function
|
|
280
|
+
function normalizeOmpResourceTypes(input = []) {
|
|
281
281
|
const values = [];
|
|
282
282
|
const pushValue = (value) => {
|
|
283
|
-
const normalized =
|
|
283
|
+
const normalized = normalizeOmpResourceType(value);
|
|
284
284
|
if (normalized && !values.includes(normalized)) values.push(normalized);
|
|
285
285
|
};
|
|
286
286
|
|
|
@@ -304,7 +304,7 @@ function normalizePiResourceTypes(input = []) {
|
|
|
304
304
|
return values;
|
|
305
305
|
}
|
|
306
306
|
|
|
307
|
-
function
|
|
307
|
+
function isOmpPackageInstallSource(value = '') {
|
|
308
308
|
const source = String(value || '').trim();
|
|
309
309
|
if (!source) return false;
|
|
310
310
|
if (isLikelyLocalPath(source)) return true;
|
|
@@ -719,8 +719,8 @@ class PluginsService {
|
|
|
719
719
|
return this.platform === 'opencode';
|
|
720
720
|
}
|
|
721
721
|
|
|
722
|
-
|
|
723
|
-
return this.platform === '
|
|
722
|
+
_isOmp() {
|
|
723
|
+
return this.platform === 'omp';
|
|
724
724
|
}
|
|
725
725
|
|
|
726
726
|
_isCodex() {
|
|
@@ -748,10 +748,10 @@ class PluginsService {
|
|
|
748
748
|
return json;
|
|
749
749
|
}
|
|
750
750
|
|
|
751
|
-
|
|
752
|
-
const filePath = NATIVE_PATHS.
|
|
751
|
+
_readOmpSettings() {
|
|
752
|
+
const filePath = NATIVE_PATHS.omp.settings;
|
|
753
753
|
if (!fs.existsSync(filePath)) {
|
|
754
|
-
const legacyPath = NATIVE_PATHS.
|
|
754
|
+
const legacyPath = NATIVE_PATHS.omp.settingsJsonLegacy;
|
|
755
755
|
if (legacyPath && fs.existsSync(legacyPath)) {
|
|
756
756
|
try {
|
|
757
757
|
const raw = fs.readFileSync(legacyPath, 'utf8');
|
|
@@ -773,63 +773,63 @@ class PluginsService {
|
|
|
773
773
|
}
|
|
774
774
|
}
|
|
775
775
|
|
|
776
|
-
|
|
777
|
-
this._ensureDir(path.dirname(NATIVE_PATHS.
|
|
778
|
-
fs.writeFileSync(NATIVE_PATHS.
|
|
776
|
+
_writeOmpSettings(settings = {}) {
|
|
777
|
+
this._ensureDir(path.dirname(NATIVE_PATHS.omp.settings));
|
|
778
|
+
fs.writeFileSync(NATIVE_PATHS.omp.settings, yaml.dump(settings, {
|
|
779
779
|
lineWidth: 120,
|
|
780
780
|
noRefs: true,
|
|
781
781
|
sortKeys: false
|
|
782
782
|
}), 'utf8');
|
|
783
783
|
}
|
|
784
784
|
|
|
785
|
-
|
|
786
|
-
const settings = this.
|
|
785
|
+
_listOmpPackages() {
|
|
786
|
+
const settings = this._readOmpSettings();
|
|
787
787
|
return Array.isArray(settings.packages)
|
|
788
|
-
? settings.packages.map(
|
|
788
|
+
? settings.packages.map(normalizeOmpPackageEntry).filter(Boolean)
|
|
789
789
|
: [];
|
|
790
790
|
}
|
|
791
791
|
|
|
792
|
-
|
|
793
|
-
const settings = this.
|
|
792
|
+
_setOmpPackages(packages = []) {
|
|
793
|
+
const settings = this._readOmpSettings();
|
|
794
794
|
const seen = new Set();
|
|
795
795
|
settings.packages = packages
|
|
796
|
-
.map(item =>
|
|
796
|
+
.map(item => ompPackageSettingValue(item))
|
|
797
797
|
.filter((item) => {
|
|
798
|
-
const name =
|
|
798
|
+
const name = getOmpPackageIdentity(item);
|
|
799
799
|
if (!name || seen.has(name)) return false;
|
|
800
800
|
seen.add(name);
|
|
801
801
|
return true;
|
|
802
802
|
});
|
|
803
|
-
this.
|
|
803
|
+
this._writeOmpSettings(settings);
|
|
804
804
|
}
|
|
805
805
|
|
|
806
|
-
|
|
807
|
-
const settings = this.
|
|
806
|
+
_listOmpDisabledPackageEntries() {
|
|
807
|
+
const settings = this._readOmpSettings();
|
|
808
808
|
return Array.isArray(settings.disabledPackages)
|
|
809
|
-
? settings.disabledPackages.map(
|
|
809
|
+
? settings.disabledPackages.map(normalizeOmpPackageEntry).filter(Boolean)
|
|
810
810
|
: [];
|
|
811
811
|
}
|
|
812
812
|
|
|
813
|
-
|
|
814
|
-
return this.
|
|
813
|
+
_listOmpDisabledPackages() {
|
|
814
|
+
return this._listOmpDisabledPackageEntries().map(item => item.name).filter(Boolean);
|
|
815
815
|
}
|
|
816
816
|
|
|
817
|
-
|
|
818
|
-
const settings = this.
|
|
817
|
+
_setOmpDisabledPackages(packages = []) {
|
|
818
|
+
const settings = this._readOmpSettings();
|
|
819
819
|
const seen = new Set();
|
|
820
820
|
settings.disabledPackages = packages
|
|
821
|
-
.map(item =>
|
|
821
|
+
.map(item => ompPackageSettingValue(item))
|
|
822
822
|
.filter((item) => {
|
|
823
|
-
const name =
|
|
823
|
+
const name = getOmpPackageIdentity(item);
|
|
824
824
|
if (!name || seen.has(name)) return false;
|
|
825
825
|
seen.add(name);
|
|
826
826
|
return true;
|
|
827
827
|
});
|
|
828
|
-
this.
|
|
828
|
+
this._writeOmpSettings(settings);
|
|
829
829
|
}
|
|
830
830
|
|
|
831
|
-
|
|
832
|
-
execFileSync(
|
|
831
|
+
_runOmpPackageCommand(args = []) {
|
|
832
|
+
execFileSync(getOmpCommand(), args, {
|
|
833
833
|
cwd: process.cwd(),
|
|
834
834
|
encoding: 'utf8',
|
|
835
835
|
stdio: 'pipe',
|
|
@@ -837,12 +837,12 @@ class PluginsService {
|
|
|
837
837
|
});
|
|
838
838
|
}
|
|
839
839
|
|
|
840
|
-
|
|
841
|
-
const packages = this.
|
|
840
|
+
_registerOmpPackageReference(packageName, metadata = {}) {
|
|
841
|
+
const packages = this._listOmpPackages();
|
|
842
842
|
const installSource = String(metadata.installSource || metadata.source || packageName || '').trim();
|
|
843
843
|
const displayName = String(metadata.name || packageName || installSource).trim();
|
|
844
844
|
if (!packages.some(pkg => pkg.name === displayName || pkg.installSource === installSource)) {
|
|
845
|
-
const resourceTypes =
|
|
845
|
+
const resourceTypes = normalizeOmpResourceTypes(metadata.resourceTypes || metadata.resources);
|
|
846
846
|
const entry = installSource && installSource !== displayName
|
|
847
847
|
? {
|
|
848
848
|
name: displayName,
|
|
@@ -853,14 +853,14 @@ class PluginsService {
|
|
|
853
853
|
}
|
|
854
854
|
: displayName;
|
|
855
855
|
packages.push(entry);
|
|
856
|
-
this.
|
|
856
|
+
this._setOmpPackages(packages);
|
|
857
857
|
}
|
|
858
858
|
}
|
|
859
859
|
|
|
860
|
-
|
|
860
|
+
_buildOmpPackagePlugin(packageName, metadata = {}) {
|
|
861
861
|
const installSource = String(metadata.installSource || metadata.source || packageName || '').trim();
|
|
862
862
|
const name = String(metadata.name || packageName || installSource).trim();
|
|
863
|
-
const resourceTypes =
|
|
863
|
+
const resourceTypes = normalizeOmpResourceTypes(metadata.resourceTypes || metadata.resources);
|
|
864
864
|
return {
|
|
865
865
|
name,
|
|
866
866
|
directory: name,
|
|
@@ -873,42 +873,42 @@ class PluginsService {
|
|
|
873
873
|
};
|
|
874
874
|
}
|
|
875
875
|
|
|
876
|
-
|
|
876
|
+
_installOmpPackage(packageName, metadata = {}) {
|
|
877
877
|
const installSource = String(metadata.installSource || metadata.source || packageName || '').trim();
|
|
878
|
-
const plugin = this.
|
|
878
|
+
const plugin = this._buildOmpPackagePlugin(packageName, { ...metadata, installSource });
|
|
879
879
|
try {
|
|
880
|
-
this.
|
|
880
|
+
this._runOmpPackageCommand(['install', installSource || packageName]);
|
|
881
881
|
return {
|
|
882
882
|
success: true,
|
|
883
883
|
plugin
|
|
884
884
|
};
|
|
885
885
|
} catch (err) {
|
|
886
|
-
this.
|
|
886
|
+
this._registerOmpPackageReference(packageName, { ...metadata, installSource, name: plugin.name });
|
|
887
887
|
return {
|
|
888
888
|
success: true,
|
|
889
889
|
registeredOnly: true,
|
|
890
|
-
warning: `Failed to run "${
|
|
890
|
+
warning: `Failed to run "${getOmpCommand()} install"; saved the package reference so OMP can resolve it later. ${err.message}`,
|
|
891
891
|
plugin
|
|
892
892
|
};
|
|
893
893
|
}
|
|
894
894
|
}
|
|
895
895
|
|
|
896
|
-
|
|
896
|
+
_removeOmpPackage(packageName) {
|
|
897
897
|
try {
|
|
898
|
-
this.
|
|
898
|
+
this._runOmpPackageCommand(['remove', packageName]);
|
|
899
899
|
return true;
|
|
900
900
|
} catch (err) {
|
|
901
901
|
return false;
|
|
902
902
|
}
|
|
903
903
|
}
|
|
904
904
|
|
|
905
|
-
|
|
905
|
+
_listOmpLocalExtensions() {
|
|
906
906
|
const plugins = [];
|
|
907
|
-
const extensionsDir = NATIVE_PATHS.
|
|
907
|
+
const extensionsDir = NATIVE_PATHS.omp.extensions;
|
|
908
908
|
if (!fs.existsSync(extensionsDir)) return plugins;
|
|
909
909
|
|
|
910
910
|
try {
|
|
911
|
-
const disabled = new Set(this.
|
|
911
|
+
const disabled = new Set(this._listOmpDisabledPackages());
|
|
912
912
|
const entries = fs.readdirSync(extensionsDir, { withFileTypes: true });
|
|
913
913
|
for (const entry of entries) {
|
|
914
914
|
if (entry.name.startsWith('.')) continue;
|
|
@@ -920,7 +920,7 @@ class PluginsService {
|
|
|
920
920
|
name,
|
|
921
921
|
directory: entry.name,
|
|
922
922
|
installPath: fullPath,
|
|
923
|
-
source: '
|
|
923
|
+
source: 'omp-extension',
|
|
924
924
|
version: 'local',
|
|
925
925
|
description: '',
|
|
926
926
|
installed: true,
|
|
@@ -1452,13 +1452,13 @@ class PluginsService {
|
|
|
1452
1452
|
return { plugins };
|
|
1453
1453
|
}
|
|
1454
1454
|
|
|
1455
|
-
if (this.
|
|
1456
|
-
const disabledEntries = this.
|
|
1455
|
+
if (this._isOmp()) {
|
|
1456
|
+
const disabledEntries = this._listOmpDisabledPackageEntries();
|
|
1457
1457
|
const disabled = new Set(disabledEntries.flatMap(item => [item.name, item.installSource].filter(Boolean)));
|
|
1458
1458
|
const plugins = [];
|
|
1459
1459
|
const seen = new Set();
|
|
1460
1460
|
|
|
1461
|
-
for (const pkg of this.
|
|
1461
|
+
for (const pkg of this._listOmpPackages()) {
|
|
1462
1462
|
const seenKey = pkg.installSource || pkg.name;
|
|
1463
1463
|
if (seen.has(seenKey)) continue;
|
|
1464
1464
|
seen.add(seenKey);
|
|
@@ -1467,8 +1467,8 @@ class PluginsService {
|
|
|
1467
1467
|
name: pkg.name,
|
|
1468
1468
|
directory: pkg.directory || pkg.name,
|
|
1469
1469
|
installSource: pkg.installSource || pkg.source || pkg.name,
|
|
1470
|
-
resourceTypes:
|
|
1471
|
-
source: '
|
|
1470
|
+
resourceTypes: normalizeOmpResourceTypes(pkg.resourceTypes || pkg.resources),
|
|
1471
|
+
source: 'omp-settings',
|
|
1472
1472
|
version: pkg.version || 'latest',
|
|
1473
1473
|
description: pkg.description || '',
|
|
1474
1474
|
installed: true,
|
|
@@ -1478,7 +1478,7 @@ class PluginsService {
|
|
|
1478
1478
|
});
|
|
1479
1479
|
}
|
|
1480
1480
|
|
|
1481
|
-
for (const extension of this.
|
|
1481
|
+
for (const extension of this._listOmpLocalExtensions()) {
|
|
1482
1482
|
if (seen.has(extension.name)) continue;
|
|
1483
1483
|
seen.add(extension.name);
|
|
1484
1484
|
plugins.push(extension);
|
|
@@ -1626,7 +1626,7 @@ class PluginsService {
|
|
|
1626
1626
|
return plugin;
|
|
1627
1627
|
}
|
|
1628
1628
|
|
|
1629
|
-
if (this.
|
|
1629
|
+
if (this._isOmp()) {
|
|
1630
1630
|
const plugin = this.listPlugins().plugins.find(p => p.name === name || p.directory === name);
|
|
1631
1631
|
if (!plugin) return null;
|
|
1632
1632
|
return plugin;
|
|
@@ -1695,7 +1695,7 @@ class PluginsService {
|
|
|
1695
1695
|
};
|
|
1696
1696
|
}
|
|
1697
1697
|
|
|
1698
|
-
if (this.
|
|
1698
|
+
if (this._isOmp()) {
|
|
1699
1699
|
const packageMetadata = repoInfo && typeof repoInfo === 'object'
|
|
1700
1700
|
? {
|
|
1701
1701
|
name: repoInfo.name || repoInfo.packageName || repoInfo.displayName,
|
|
@@ -1710,28 +1710,28 @@ class PluginsService {
|
|
|
1710
1710
|
if (
|
|
1711
1711
|
repoInfo?.pluginKind === 'package' ||
|
|
1712
1712
|
repoInfo?.pluginType === 'package' ||
|
|
1713
|
-
(explicitPackageSource &&
|
|
1713
|
+
(explicitPackageSource && isOmpPackageInstallSource(explicitPackageSource) && !hasRepoInstallInfo(repoInfo))
|
|
1714
1714
|
) {
|
|
1715
|
-
return this.
|
|
1715
|
+
return this._installOmpPackage(explicitPackageSource, packageMetadata);
|
|
1716
1716
|
}
|
|
1717
1717
|
|
|
1718
1718
|
if (hasRepoInstallInfo(repoInfo)) {
|
|
1719
|
-
return this._installFromRepoDirectory(repoInfo, { installRoot: NATIVE_PATHS.
|
|
1719
|
+
return this._installFromRepoDirectory(repoInfo, { installRoot: NATIVE_PATHS.omp.extensions });
|
|
1720
1720
|
}
|
|
1721
1721
|
|
|
1722
1722
|
const parsedSource = this.parseRepoTreeSource(source);
|
|
1723
1723
|
if (parsedSource) {
|
|
1724
|
-
return this.
|
|
1724
|
+
return this._installOmpPackage(source);
|
|
1725
1725
|
}
|
|
1726
1726
|
|
|
1727
1727
|
const parsedRepo = this._repoFromGitUrl(source, 'main');
|
|
1728
1728
|
if (parsedRepo) {
|
|
1729
|
-
return this.
|
|
1729
|
+
return this._installOmpPackage(source);
|
|
1730
1730
|
}
|
|
1731
1731
|
|
|
1732
1732
|
const packageName = String(source || '').trim();
|
|
1733
|
-
if (packageName &&
|
|
1734
|
-
return this.
|
|
1733
|
+
if (packageName && isOmpPackageInstallSource(packageName)) {
|
|
1734
|
+
return this._installOmpPackage(packageName);
|
|
1735
1735
|
}
|
|
1736
1736
|
|
|
1737
1737
|
return {
|
|
@@ -1978,7 +1978,7 @@ class PluginsService {
|
|
|
1978
1978
|
} catch (e) {
|
|
1979
1979
|
console.error('[PluginsService] Failed to update native installed_plugins.json:', e.message);
|
|
1980
1980
|
}
|
|
1981
|
-
} else if (!this._isOpenCode() && !this.
|
|
1981
|
+
} else if (!this._isOpenCode() && !this._isOmp()) {
|
|
1982
1982
|
const installTimestamp = new Date().toISOString();
|
|
1983
1983
|
const sourceUrl = this.buildRepoBrowserUrl(normalizedRepo, directory) || buildRepoUrl(normalizedRepo);
|
|
1984
1984
|
const repoSourceMeta = {
|
|
@@ -2008,7 +2008,7 @@ class PluginsService {
|
|
|
2008
2008
|
}
|
|
2009
2009
|
|
|
2010
2010
|
this.writeRepoSourceMeta(pluginDir, repoSourceMeta);
|
|
2011
|
-
} else if (this.
|
|
2011
|
+
} else if (this._isOmp()) {
|
|
2012
2012
|
const sourceUrl = this.buildRepoBrowserUrl(normalizedRepo, directory) || buildRepoUrl(normalizedRepo);
|
|
2013
2013
|
this.writeRepoSourceMeta(pluginDir, {
|
|
2014
2014
|
repoId: normalizedRepo.id,
|
|
@@ -2048,8 +2048,8 @@ class PluginsService {
|
|
|
2048
2048
|
if (this._isOpenCode()) {
|
|
2049
2049
|
return ['package.json', 'plugin.json'];
|
|
2050
2050
|
}
|
|
2051
|
-
if (this.
|
|
2052
|
-
return ['
|
|
2051
|
+
if (this._isOmp()) {
|
|
2052
|
+
return ['omp.json', 'extension.json', 'plugin.json', 'package.json'];
|
|
2053
2053
|
}
|
|
2054
2054
|
return ['.claude-plugin/plugin.json', 'plugin.json', 'package.json'];
|
|
2055
2055
|
}
|
|
@@ -2182,7 +2182,7 @@ class PluginsService {
|
|
|
2182
2182
|
};
|
|
2183
2183
|
}
|
|
2184
2184
|
|
|
2185
|
-
if (this.
|
|
2185
|
+
if (this._isOmp()) {
|
|
2186
2186
|
const targetName = String(name || '').trim();
|
|
2187
2187
|
let safeName = '';
|
|
2188
2188
|
try {
|
|
@@ -2190,7 +2190,7 @@ class PluginsService {
|
|
|
2190
2190
|
} catch {
|
|
2191
2191
|
safeName = '';
|
|
2192
2192
|
}
|
|
2193
|
-
const packages = this.
|
|
2193
|
+
const packages = this._listOmpPackages();
|
|
2194
2194
|
let removed = false;
|
|
2195
2195
|
const packageToRemove = packages.find(pkg =>
|
|
2196
2196
|
pkg.name === targetName ||
|
|
@@ -2199,7 +2199,7 @@ class PluginsService {
|
|
|
2199
2199
|
pkg.installSource === safeName
|
|
2200
2200
|
);
|
|
2201
2201
|
if (packageToRemove) {
|
|
2202
|
-
this.
|
|
2202
|
+
this._removeOmpPackage(packageToRemove.installSource || packageToRemove.name);
|
|
2203
2203
|
}
|
|
2204
2204
|
const nextPackages = packages.filter(pkg =>
|
|
2205
2205
|
pkg.name !== safeName &&
|
|
@@ -2208,8 +2208,8 @@ class PluginsService {
|
|
|
2208
2208
|
pkg.installSource !== targetName
|
|
2209
2209
|
);
|
|
2210
2210
|
if (nextPackages.length !== packages.length) {
|
|
2211
|
-
this.
|
|
2212
|
-
const disabledEntries = this.
|
|
2211
|
+
this._setOmpPackages(nextPackages);
|
|
2212
|
+
const disabledEntries = this._listOmpDisabledPackageEntries().filter(pkg =>
|
|
2213
2213
|
pkg.name !== safeName &&
|
|
2214
2214
|
pkg.name !== targetName &&
|
|
2215
2215
|
pkg.installSource !== safeName &&
|
|
@@ -2217,11 +2217,11 @@ class PluginsService {
|
|
|
2217
2217
|
pkg.name !== packageToRemove?.name &&
|
|
2218
2218
|
pkg.installSource !== packageToRemove?.installSource
|
|
2219
2219
|
);
|
|
2220
|
-
this.
|
|
2220
|
+
this._setOmpDisabledPackages(disabledEntries);
|
|
2221
2221
|
removed = true;
|
|
2222
2222
|
}
|
|
2223
2223
|
|
|
2224
|
-
const extensionsDir = NATIVE_PATHS.
|
|
2224
|
+
const extensionsDir = NATIVE_PATHS.omp.extensions;
|
|
2225
2225
|
if (safeName && fs.existsSync(extensionsDir)) {
|
|
2226
2226
|
const directPath = resolveInsideRoot(extensionsDir, safeName, 'OMP extension path');
|
|
2227
2227
|
if (fs.existsSync(directPath)) {
|
|
@@ -2379,11 +2379,11 @@ class PluginsService {
|
|
|
2379
2379
|
throw new Error(`${this.platform} plugin management is not supported`);
|
|
2380
2380
|
}
|
|
2381
2381
|
|
|
2382
|
-
if (this.
|
|
2382
|
+
if (this._isOmp()) {
|
|
2383
2383
|
const targetName = String(name || '').trim();
|
|
2384
|
-
const packages = this.
|
|
2384
|
+
const packages = this._listOmpPackages();
|
|
2385
2385
|
const targetPackage = packages.find(pkg => pkg.name === targetName || pkg.installSource === targetName);
|
|
2386
|
-
const disabledEntries = this.
|
|
2386
|
+
const disabledEntries = this._listOmpDisabledPackageEntries();
|
|
2387
2387
|
const disabled = new Set(disabledEntries.flatMap(item => [item.name, item.installSource].filter(Boolean)));
|
|
2388
2388
|
if (enabled) {
|
|
2389
2389
|
disabled.delete(targetName);
|
|
@@ -2394,7 +2394,7 @@ class PluginsService {
|
|
|
2394
2394
|
} else {
|
|
2395
2395
|
disabled.add(targetPackage || targetName);
|
|
2396
2396
|
}
|
|
2397
|
-
this.
|
|
2397
|
+
this._setOmpDisabledPackages(Array.from(disabled));
|
|
2398
2398
|
return {
|
|
2399
2399
|
name: targetName,
|
|
2400
2400
|
enabled,
|
|
@@ -2495,13 +2495,13 @@ class PluginsService {
|
|
|
2495
2495
|
throw new Error(`${this.platform} plugin management is not supported`);
|
|
2496
2496
|
}
|
|
2497
2497
|
|
|
2498
|
-
if (this.
|
|
2499
|
-
const settings = this.
|
|
2498
|
+
if (this._isOmp()) {
|
|
2499
|
+
const settings = this._readOmpSettings();
|
|
2500
2500
|
settings.packageConfig = settings.packageConfig && typeof settings.packageConfig === 'object' && !Array.isArray(settings.packageConfig)
|
|
2501
2501
|
? settings.packageConfig
|
|
2502
2502
|
: {};
|
|
2503
2503
|
settings.packageConfig[name] = config;
|
|
2504
|
-
this.
|
|
2504
|
+
this._writeOmpSettings(settings);
|
|
2505
2505
|
return {
|
|
2506
2506
|
success: true,
|
|
2507
2507
|
message: `Configuration updated for plugin "${name}"`
|
|
@@ -3343,7 +3343,7 @@ class PluginsService {
|
|
|
3343
3343
|
lspServers: data.lspServers || null,
|
|
3344
3344
|
commands: data.commands || [],
|
|
3345
3345
|
hooks: data.hooks || [],
|
|
3346
|
-
resourceTypes:
|
|
3346
|
+
resourceTypes: normalizeOmpResourceTypes(data.resourceTypes || data.resources),
|
|
3347
3347
|
resources: data.resources || null,
|
|
3348
3348
|
containsSkills: Boolean(data.containsSkills),
|
|
3349
3349
|
skillPaths: Array.isArray(data.skillPaths) ? data.skillPaths : [],
|
|
@@ -3598,7 +3598,7 @@ class PluginsService {
|
|
|
3598
3598
|
return results;
|
|
3599
3599
|
}
|
|
3600
3600
|
|
|
3601
|
-
|
|
3601
|
+
_normalizeOmpCatalogEntries(catalog = null) {
|
|
3602
3602
|
if (Array.isArray(catalog)) return catalog;
|
|
3603
3603
|
if (!catalog || typeof catalog !== 'object') return [];
|
|
3604
3604
|
for (const key of ['packages', 'plugins', 'extensions']) {
|
|
@@ -3607,7 +3607,7 @@ class PluginsService {
|
|
|
3607
3607
|
return [];
|
|
3608
3608
|
}
|
|
3609
3609
|
|
|
3610
|
-
|
|
3610
|
+
_normalizeOmpCatalogPackage(repo, entry = {}, catalog = {}, defaults = {}) {
|
|
3611
3611
|
if (!entry || typeof entry !== 'object') return null;
|
|
3612
3612
|
const installSource = String(
|
|
3613
3613
|
entry.installSource ||
|
|
@@ -3622,11 +3622,11 @@ class PluginsService {
|
|
|
3622
3622
|
const name = String(entry.name || entry.id || entry.package || installSource || '').trim();
|
|
3623
3623
|
if (!name || !installSource) return null;
|
|
3624
3624
|
|
|
3625
|
-
const resourceTypes =
|
|
3625
|
+
const resourceTypes = normalizeOmpResourceTypes(
|
|
3626
3626
|
entry.resourceTypes ||
|
|
3627
3627
|
entry.resources ||
|
|
3628
3628
|
entry.provides ||
|
|
3629
|
-
entry.
|
|
3629
|
+
entry.omp?.resources ||
|
|
3630
3630
|
defaults.resourceTypes
|
|
3631
3631
|
);
|
|
3632
3632
|
return this.buildMarketPluginItem(repo, {
|
|
@@ -3639,7 +3639,7 @@ class PluginsService {
|
|
|
3639
3639
|
directory: entry.directory || name,
|
|
3640
3640
|
marketplace: entry.marketplace || repo.marketplace || catalog.name || defaults.marketplace || '',
|
|
3641
3641
|
installSource,
|
|
3642
|
-
marketplaceFormat: defaults.marketplaceFormat || '
|
|
3642
|
+
marketplaceFormat: defaults.marketplaceFormat || 'omp-package-catalog',
|
|
3643
3643
|
pluginKind: 'package',
|
|
3644
3644
|
pluginType: 'package',
|
|
3645
3645
|
resourceTypes,
|
|
@@ -3648,34 +3648,34 @@ class PluginsService {
|
|
|
3648
3648
|
});
|
|
3649
3649
|
}
|
|
3650
3650
|
|
|
3651
|
-
async
|
|
3652
|
-
if (!this.
|
|
3653
|
-
const catalogFiles = ['
|
|
3651
|
+
async _fetchOmpPackageCatalogPlugins(repo, fileMap, readJson) {
|
|
3652
|
+
if (!this._isOmp()) return [];
|
|
3653
|
+
const catalogFiles = ['omp-packages.json', '.omp/packages.json', 'packages.json'];
|
|
3654
3654
|
for (const catalogPath of catalogFiles) {
|
|
3655
3655
|
if (!fileMap.has(catalogPath)) continue;
|
|
3656
3656
|
const catalog = await readJson(catalogPath);
|
|
3657
|
-
const entries = this.
|
|
3657
|
+
const entries = this._normalizeOmpCatalogEntries(catalog);
|
|
3658
3658
|
const plugins = entries
|
|
3659
|
-
.map(entry => this.
|
|
3660
|
-
marketplaceFormat: '
|
|
3659
|
+
.map(entry => this._normalizeOmpCatalogPackage(repo, entry, catalog, {
|
|
3660
|
+
marketplaceFormat: 'omp-package-catalog'
|
|
3661
3661
|
}))
|
|
3662
3662
|
.filter(Boolean);
|
|
3663
3663
|
if (plugins.length > 0) return plugins;
|
|
3664
3664
|
}
|
|
3665
3665
|
|
|
3666
|
-
const manifestPath = fileMap.has('
|
|
3666
|
+
const manifestPath = fileMap.has('omp.json') ? 'omp.json' : (fileMap.has('package.json') ? 'package.json' : '');
|
|
3667
3667
|
if (!manifestPath) return [];
|
|
3668
3668
|
const manifest = await readJson(manifestPath);
|
|
3669
|
-
const
|
|
3670
|
-
const installSource =
|
|
3671
|
-
const resourceTypes =
|
|
3672
|
-
|
|
3673
|
-
|
|
3669
|
+
const ompMeta = manifest.omp && typeof manifest.omp === 'object' ? manifest.omp: {};
|
|
3670
|
+
const installSource = ompMeta.installSource || manifest.installSource || manifest.name;
|
|
3671
|
+
const resourceTypes = normalizeOmpResourceTypes(
|
|
3672
|
+
ompMeta.resourceTypes ||
|
|
3673
|
+
ompMeta.resources ||
|
|
3674
3674
|
manifest.resourceTypes ||
|
|
3675
3675
|
manifest.resources
|
|
3676
3676
|
);
|
|
3677
3677
|
if (!installSource || resourceTypes.length === 0) return [];
|
|
3678
|
-
const plugin = this.
|
|
3678
|
+
const plugin = this._normalizeOmpCatalogPackage(repo, {
|
|
3679
3679
|
name: manifest.name || repo.name,
|
|
3680
3680
|
installSource,
|
|
3681
3681
|
version: manifest.version,
|
|
@@ -3683,7 +3683,7 @@ class PluginsService {
|
|
|
3683
3683
|
author: manifest.author,
|
|
3684
3684
|
resourceTypes
|
|
3685
3685
|
}, { name: repo.marketplace || repo.name }, {
|
|
3686
|
-
marketplaceFormat: manifestPath === '
|
|
3686
|
+
marketplaceFormat: manifestPath === 'omp.json' ? 'omp-manifest' : 'omp-package-manifest'
|
|
3687
3687
|
});
|
|
3688
3688
|
return plugin ? [plugin] : [];
|
|
3689
3689
|
}
|
|
@@ -3764,11 +3764,11 @@ class PluginsService {
|
|
|
3764
3764
|
}
|
|
3765
3765
|
}
|
|
3766
3766
|
|
|
3767
|
-
// OMP package catalog format; legacy catalog filenames may still include
|
|
3768
|
-
if (this.
|
|
3769
|
-
const
|
|
3770
|
-
if (
|
|
3771
|
-
marketPlugins.push(...
|
|
3767
|
+
// OMP package catalog format; legacy catalog filenames may still include omp.
|
|
3768
|
+
if (this._isOmp()) {
|
|
3769
|
+
const ompPackagePlugins = await this._fetchOmpPackageCatalogPlugins(repo, fileMap, readJson);
|
|
3770
|
+
if (ompPackagePlugins.length > 0) {
|
|
3771
|
+
marketPlugins.push(...ompPackagePlugins);
|
|
3772
3772
|
continue;
|
|
3773
3773
|
}
|
|
3774
3774
|
}
|
|
@@ -3818,8 +3818,8 @@ class PluginsService {
|
|
|
3818
3818
|
|
|
3819
3819
|
for (const dir of pluginDirs) {
|
|
3820
3820
|
try {
|
|
3821
|
-
const manifest = this.
|
|
3822
|
-
? await this._readManifestFromRepo(repo, dir, ['
|
|
3821
|
+
const manifest = this._isOmp()
|
|
3822
|
+
? await this._readManifestFromRepo(repo, dir, ['omp.json', 'extension.json', 'plugin.json', 'package.json'])
|
|
3823
3823
|
: await readJson(`${dir}/plugin.json`);
|
|
3824
3824
|
if (!manifest) {
|
|
3825
3825
|
throw new Error(`File not found: ${dir}/plugin.json`);
|
|
@@ -3831,7 +3831,7 @@ class PluginsService {
|
|
|
3831
3831
|
author: manifest.author || repo.owner,
|
|
3832
3832
|
version: manifest.version || '1.0.0',
|
|
3833
3833
|
directory: dir,
|
|
3834
|
-
pluginKind: this.
|
|
3834
|
+
pluginKind: this._isOmp() ? 'extension' : undefined,
|
|
3835
3835
|
commands: manifest.commands || [],
|
|
3836
3836
|
hooks: manifest.hooks || []
|
|
3837
3837
|
}));
|