evil-omo 3.11.2 → 3.11.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +2 -2
- package/README.ko.md +2 -2
- package/README.md +21 -2
- package/README.ru.md +2 -2
- package/README.zh-cn.md +1 -1
- package/bin/{oh-my-opencode.js → evil-omo.js} +8 -5
- package/bin/platform.js +11 -8
- package/bin/platform.test.ts +20 -20
- package/dist/cli/config-manager/config-context.d.ts +1 -0
- package/dist/cli/doctor/constants.d.ts +1 -1
- package/dist/cli/index.js +366 -304
- package/dist/config/schema.d.ts +1 -1
- package/dist/{oh-my-opencode.schema.json → evil-omo.schema.json} +2 -2
- package/dist/features/claude-code-plugin-loader/types.d.ts +1 -1
- package/dist/hooks/auto-update-checker/constants.d.ts +2 -2
- package/dist/hooks/comment-checker/downloader.d.ts +1 -1
- package/dist/index.js +15317 -15225
- package/dist/shared/data-path.d.ts +2 -2
- package/dist/shared/external-plugin-detector.d.ts +1 -1
- package/dist/shared/plugin-identity.d.ts +19 -4
- package/dist/shared/system-directive.d.ts +5 -5
- package/package.json +15 -15
- package/postinstall.mjs +3 -2
- /package/dist/config/schema/{oh-my-opencode-config.d.ts → evil-omo-config.d.ts} +0 -0
package/dist/cli/index.js
CHANGED
|
@@ -4916,137 +4916,6 @@ var init_command_executor = __esm(() => {
|
|
|
4916
4916
|
|
|
4917
4917
|
// src/shared/file-reference-resolver.ts
|
|
4918
4918
|
var init_file_reference_resolver = () => {};
|
|
4919
|
-
// src/shared/logger.ts
|
|
4920
|
-
import * as fs from "fs";
|
|
4921
|
-
import * as os from "os";
|
|
4922
|
-
import * as path from "path";
|
|
4923
|
-
function log(message, data) {
|
|
4924
|
-
try {
|
|
4925
|
-
const timestamp2 = new Date().toISOString();
|
|
4926
|
-
const logEntry = `[${timestamp2}] ${message} ${data ? JSON.stringify(data) : ""}
|
|
4927
|
-
`;
|
|
4928
|
-
fs.appendFileSync(logFile, logEntry);
|
|
4929
|
-
} catch {}
|
|
4930
|
-
}
|
|
4931
|
-
var logFile;
|
|
4932
|
-
var init_logger = __esm(() => {
|
|
4933
|
-
logFile = path.join(os.tmpdir(), "oh-my-opencode.log");
|
|
4934
|
-
});
|
|
4935
|
-
|
|
4936
|
-
// src/shared/deep-merge.ts
|
|
4937
|
-
function isPlainObject(value) {
|
|
4938
|
-
return typeof value === "object" && value !== null && !Array.isArray(value) && Object.prototype.toString.call(value) === "[object Object]";
|
|
4939
|
-
}
|
|
4940
|
-
function deepMerge(base, override, depth = 0) {
|
|
4941
|
-
if (!base && !override)
|
|
4942
|
-
return;
|
|
4943
|
-
if (!base)
|
|
4944
|
-
return override;
|
|
4945
|
-
if (!override)
|
|
4946
|
-
return base;
|
|
4947
|
-
if (depth > MAX_DEPTH)
|
|
4948
|
-
return override ?? base;
|
|
4949
|
-
const result = { ...base };
|
|
4950
|
-
for (const key of Object.keys(override)) {
|
|
4951
|
-
if (DANGEROUS_KEYS.has(key))
|
|
4952
|
-
continue;
|
|
4953
|
-
const baseValue = base[key];
|
|
4954
|
-
const overrideValue = override[key];
|
|
4955
|
-
if (overrideValue === undefined)
|
|
4956
|
-
continue;
|
|
4957
|
-
if (isPlainObject(baseValue) && isPlainObject(overrideValue)) {
|
|
4958
|
-
result[key] = deepMerge(baseValue, overrideValue, depth + 1);
|
|
4959
|
-
} else {
|
|
4960
|
-
result[key] = overrideValue;
|
|
4961
|
-
}
|
|
4962
|
-
}
|
|
4963
|
-
return result;
|
|
4964
|
-
}
|
|
4965
|
-
var DANGEROUS_KEYS, MAX_DEPTH = 50;
|
|
4966
|
-
var init_deep_merge = __esm(() => {
|
|
4967
|
-
DANGEROUS_KEYS = new Set(["__proto__", "constructor", "prototype"]);
|
|
4968
|
-
});
|
|
4969
|
-
|
|
4970
|
-
// src/shared/snake-case.ts
|
|
4971
|
-
var init_snake_case = __esm(() => {
|
|
4972
|
-
init_deep_merge();
|
|
4973
|
-
});
|
|
4974
|
-
|
|
4975
|
-
// src/shared/tool-name.ts
|
|
4976
|
-
var init_tool_name = () => {};
|
|
4977
|
-
// src/shared/file-utils.ts
|
|
4978
|
-
var init_file_utils = () => {};
|
|
4979
|
-
|
|
4980
|
-
// src/shared/context-limit-resolver.ts
|
|
4981
|
-
var init_context_limit_resolver = () => {};
|
|
4982
|
-
|
|
4983
|
-
// src/shared/normalize-sdk-response.ts
|
|
4984
|
-
function normalizeSDKResponse(response, fallback, options) {
|
|
4985
|
-
if (response === null || response === undefined) {
|
|
4986
|
-
return fallback;
|
|
4987
|
-
}
|
|
4988
|
-
if (Array.isArray(response)) {
|
|
4989
|
-
return response;
|
|
4990
|
-
}
|
|
4991
|
-
if (typeof response === "object" && "data" in response) {
|
|
4992
|
-
const data = response.data;
|
|
4993
|
-
if (data !== null && data !== undefined) {
|
|
4994
|
-
return data;
|
|
4995
|
-
}
|
|
4996
|
-
if (options?.preferResponseOnMissingData === true) {
|
|
4997
|
-
return response;
|
|
4998
|
-
}
|
|
4999
|
-
return fallback;
|
|
5000
|
-
}
|
|
5001
|
-
if (options?.preferResponseOnMissingData === true) {
|
|
5002
|
-
return response;
|
|
5003
|
-
}
|
|
5004
|
-
return fallback;
|
|
5005
|
-
}
|
|
5006
|
-
|
|
5007
|
-
// src/shared/dynamic-truncator.ts
|
|
5008
|
-
var init_dynamic_truncator = __esm(() => {
|
|
5009
|
-
init_context_limit_resolver();
|
|
5010
|
-
});
|
|
5011
|
-
|
|
5012
|
-
// src/shared/data-path.ts
|
|
5013
|
-
import * as path2 from "path";
|
|
5014
|
-
import * as os2 from "os";
|
|
5015
|
-
function getDataDir() {
|
|
5016
|
-
return process.env.XDG_DATA_HOME ?? path2.join(os2.homedir(), ".local", "share");
|
|
5017
|
-
}
|
|
5018
|
-
function getOpenCodeStorageDir() {
|
|
5019
|
-
return path2.join(getDataDir(), "opencode", "storage");
|
|
5020
|
-
}
|
|
5021
|
-
function getCacheDir() {
|
|
5022
|
-
return process.env.XDG_CACHE_HOME ?? path2.join(os2.homedir(), ".cache");
|
|
5023
|
-
}
|
|
5024
|
-
function getOmoOpenCodeCacheDir() {
|
|
5025
|
-
return path2.join(getCacheDir(), "oh-my-opencode");
|
|
5026
|
-
}
|
|
5027
|
-
function getOpenCodeCacheDir() {
|
|
5028
|
-
return path2.join(getCacheDir(), "opencode");
|
|
5029
|
-
}
|
|
5030
|
-
var init_data_path = () => {};
|
|
5031
|
-
|
|
5032
|
-
// src/shared/config-errors.ts
|
|
5033
|
-
function getConfigLoadErrors() {
|
|
5034
|
-
return configLoadErrors;
|
|
5035
|
-
}
|
|
5036
|
-
function clearConfigLoadErrors() {
|
|
5037
|
-
configLoadErrors = [];
|
|
5038
|
-
}
|
|
5039
|
-
function addConfigLoadError(error) {
|
|
5040
|
-
configLoadErrors.push(error);
|
|
5041
|
-
}
|
|
5042
|
-
var configLoadErrors;
|
|
5043
|
-
var init_config_errors = __esm(() => {
|
|
5044
|
-
configLoadErrors = [];
|
|
5045
|
-
});
|
|
5046
|
-
|
|
5047
|
-
// src/shared/claude-config-dir.ts
|
|
5048
|
-
var init_claude_config_dir = () => {};
|
|
5049
|
-
|
|
5050
4919
|
// node_modules/jsonc-parser/lib/esm/impl/scanner.js
|
|
5051
4920
|
function createScanner(text, ignoreTrivia = false) {
|
|
5052
4921
|
const len = text.length;
|
|
@@ -5940,6 +5809,175 @@ var init_jsonc_parser = __esm(() => {
|
|
|
5940
5809
|
init_main();
|
|
5941
5810
|
});
|
|
5942
5811
|
|
|
5812
|
+
// src/shared/plugin-identity.ts
|
|
5813
|
+
import { join } from "path";
|
|
5814
|
+
function matchesManagedName(entry, packageName) {
|
|
5815
|
+
return entry === packageName || entry.startsWith(`${packageName}@`);
|
|
5816
|
+
}
|
|
5817
|
+
function findManagedPluginEntry(plugins) {
|
|
5818
|
+
for (const [index, entry] of plugins.entries()) {
|
|
5819
|
+
for (const packageName of ALL_PLUGIN_NAMES) {
|
|
5820
|
+
if (matchesManagedName(entry, packageName)) {
|
|
5821
|
+
return { index, packageName };
|
|
5822
|
+
}
|
|
5823
|
+
}
|
|
5824
|
+
}
|
|
5825
|
+
return null;
|
|
5826
|
+
}
|
|
5827
|
+
function detectManagedConfigFile(directory) {
|
|
5828
|
+
for (const baseName of ALL_CONFIG_BASENAMES) {
|
|
5829
|
+
const detected = detectConfigFile(join(directory, baseName));
|
|
5830
|
+
if (detected.format !== "none") {
|
|
5831
|
+
return { ...detected, baseName };
|
|
5832
|
+
}
|
|
5833
|
+
}
|
|
5834
|
+
return {
|
|
5835
|
+
format: "none",
|
|
5836
|
+
path: join(directory, `${CONFIG_BASENAME}.json`),
|
|
5837
|
+
baseName: CONFIG_BASENAME
|
|
5838
|
+
};
|
|
5839
|
+
}
|
|
5840
|
+
var PLUGIN_NAME = "evil-omo", ALL_PLUGIN_NAMES, CONFIG_BASENAME = "evil-omo", ALL_CONFIG_BASENAMES, LOG_FILENAME = "evil-omo.log", CACHE_DIR_NAME = "evil-omo", SCHEMA_FILENAME = "evil-omo.schema.json";
|
|
5841
|
+
var init_plugin_identity = __esm(() => {
|
|
5842
|
+
init_jsonc_parser();
|
|
5843
|
+
ALL_PLUGIN_NAMES = [PLUGIN_NAME];
|
|
5844
|
+
ALL_CONFIG_BASENAMES = [CONFIG_BASENAME];
|
|
5845
|
+
});
|
|
5846
|
+
|
|
5847
|
+
// src/shared/logger.ts
|
|
5848
|
+
import * as fs from "fs";
|
|
5849
|
+
import * as os from "os";
|
|
5850
|
+
import * as path from "path";
|
|
5851
|
+
function log(message, data) {
|
|
5852
|
+
try {
|
|
5853
|
+
const timestamp2 = new Date().toISOString();
|
|
5854
|
+
const logEntry = `[${timestamp2}] ${message} ${data ? JSON.stringify(data) : ""}
|
|
5855
|
+
`;
|
|
5856
|
+
fs.appendFileSync(logFile, logEntry);
|
|
5857
|
+
} catch {}
|
|
5858
|
+
}
|
|
5859
|
+
var logFile;
|
|
5860
|
+
var init_logger = __esm(() => {
|
|
5861
|
+
init_plugin_identity();
|
|
5862
|
+
logFile = path.join(os.tmpdir(), LOG_FILENAME);
|
|
5863
|
+
});
|
|
5864
|
+
|
|
5865
|
+
// src/shared/deep-merge.ts
|
|
5866
|
+
function isPlainObject(value) {
|
|
5867
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) && Object.prototype.toString.call(value) === "[object Object]";
|
|
5868
|
+
}
|
|
5869
|
+
function deepMerge(base, override, depth = 0) {
|
|
5870
|
+
if (!base && !override)
|
|
5871
|
+
return;
|
|
5872
|
+
if (!base)
|
|
5873
|
+
return override;
|
|
5874
|
+
if (!override)
|
|
5875
|
+
return base;
|
|
5876
|
+
if (depth > MAX_DEPTH)
|
|
5877
|
+
return override ?? base;
|
|
5878
|
+
const result = { ...base };
|
|
5879
|
+
for (const key of Object.keys(override)) {
|
|
5880
|
+
if (DANGEROUS_KEYS.has(key))
|
|
5881
|
+
continue;
|
|
5882
|
+
const baseValue = base[key];
|
|
5883
|
+
const overrideValue = override[key];
|
|
5884
|
+
if (overrideValue === undefined)
|
|
5885
|
+
continue;
|
|
5886
|
+
if (isPlainObject(baseValue) && isPlainObject(overrideValue)) {
|
|
5887
|
+
result[key] = deepMerge(baseValue, overrideValue, depth + 1);
|
|
5888
|
+
} else {
|
|
5889
|
+
result[key] = overrideValue;
|
|
5890
|
+
}
|
|
5891
|
+
}
|
|
5892
|
+
return result;
|
|
5893
|
+
}
|
|
5894
|
+
var DANGEROUS_KEYS, MAX_DEPTH = 50;
|
|
5895
|
+
var init_deep_merge = __esm(() => {
|
|
5896
|
+
DANGEROUS_KEYS = new Set(["__proto__", "constructor", "prototype"]);
|
|
5897
|
+
});
|
|
5898
|
+
|
|
5899
|
+
// src/shared/snake-case.ts
|
|
5900
|
+
var init_snake_case = __esm(() => {
|
|
5901
|
+
init_deep_merge();
|
|
5902
|
+
});
|
|
5903
|
+
|
|
5904
|
+
// src/shared/tool-name.ts
|
|
5905
|
+
var init_tool_name = () => {};
|
|
5906
|
+
// src/shared/file-utils.ts
|
|
5907
|
+
var init_file_utils = () => {};
|
|
5908
|
+
|
|
5909
|
+
// src/shared/context-limit-resolver.ts
|
|
5910
|
+
var init_context_limit_resolver = () => {};
|
|
5911
|
+
|
|
5912
|
+
// src/shared/normalize-sdk-response.ts
|
|
5913
|
+
function normalizeSDKResponse(response, fallback, options) {
|
|
5914
|
+
if (response === null || response === undefined) {
|
|
5915
|
+
return fallback;
|
|
5916
|
+
}
|
|
5917
|
+
if (Array.isArray(response)) {
|
|
5918
|
+
return response;
|
|
5919
|
+
}
|
|
5920
|
+
if (typeof response === "object" && "data" in response) {
|
|
5921
|
+
const data = response.data;
|
|
5922
|
+
if (data !== null && data !== undefined) {
|
|
5923
|
+
return data;
|
|
5924
|
+
}
|
|
5925
|
+
if (options?.preferResponseOnMissingData === true) {
|
|
5926
|
+
return response;
|
|
5927
|
+
}
|
|
5928
|
+
return fallback;
|
|
5929
|
+
}
|
|
5930
|
+
if (options?.preferResponseOnMissingData === true) {
|
|
5931
|
+
return response;
|
|
5932
|
+
}
|
|
5933
|
+
return fallback;
|
|
5934
|
+
}
|
|
5935
|
+
|
|
5936
|
+
// src/shared/dynamic-truncator.ts
|
|
5937
|
+
var init_dynamic_truncator = __esm(() => {
|
|
5938
|
+
init_context_limit_resolver();
|
|
5939
|
+
});
|
|
5940
|
+
|
|
5941
|
+
// src/shared/data-path.ts
|
|
5942
|
+
import * as path2 from "path";
|
|
5943
|
+
import * as os2 from "os";
|
|
5944
|
+
function getDataDir() {
|
|
5945
|
+
return process.env.XDG_DATA_HOME ?? path2.join(os2.homedir(), ".local", "share");
|
|
5946
|
+
}
|
|
5947
|
+
function getOpenCodeStorageDir() {
|
|
5948
|
+
return path2.join(getDataDir(), "opencode", "storage");
|
|
5949
|
+
}
|
|
5950
|
+
function getCacheDir() {
|
|
5951
|
+
return process.env.XDG_CACHE_HOME ?? path2.join(os2.homedir(), ".cache");
|
|
5952
|
+
}
|
|
5953
|
+
function getOmoOpenCodeCacheDir() {
|
|
5954
|
+
return path2.join(getCacheDir(), CACHE_DIR_NAME);
|
|
5955
|
+
}
|
|
5956
|
+
function getOpenCodeCacheDir() {
|
|
5957
|
+
return path2.join(getCacheDir(), "opencode");
|
|
5958
|
+
}
|
|
5959
|
+
var init_data_path = __esm(() => {
|
|
5960
|
+
init_plugin_identity();
|
|
5961
|
+
});
|
|
5962
|
+
|
|
5963
|
+
// src/shared/config-errors.ts
|
|
5964
|
+
function getConfigLoadErrors() {
|
|
5965
|
+
return configLoadErrors;
|
|
5966
|
+
}
|
|
5967
|
+
function clearConfigLoadErrors() {
|
|
5968
|
+
configLoadErrors = [];
|
|
5969
|
+
}
|
|
5970
|
+
function addConfigLoadError(error) {
|
|
5971
|
+
configLoadErrors.push(error);
|
|
5972
|
+
}
|
|
5973
|
+
var configLoadErrors;
|
|
5974
|
+
var init_config_errors = __esm(() => {
|
|
5975
|
+
configLoadErrors = [];
|
|
5976
|
+
});
|
|
5977
|
+
|
|
5978
|
+
// src/shared/claude-config-dir.ts
|
|
5979
|
+
var init_claude_config_dir = () => {};
|
|
5980
|
+
|
|
5943
5981
|
// src/shared/migration/agent-names.ts
|
|
5944
5982
|
function migrateAgentNames(agents) {
|
|
5945
5983
|
const migrated = {};
|
|
@@ -6197,7 +6235,7 @@ var init_migration = __esm(() => {
|
|
|
6197
6235
|
// src/shared/opencode-config-dir.ts
|
|
6198
6236
|
import { existsSync as existsSync2 } from "fs";
|
|
6199
6237
|
import { homedir as homedir2 } from "os";
|
|
6200
|
-
import { join as
|
|
6238
|
+
import { join as join4, resolve } from "path";
|
|
6201
6239
|
function isDevBuild(version) {
|
|
6202
6240
|
if (!version)
|
|
6203
6241
|
return false;
|
|
@@ -6207,15 +6245,15 @@ function getTauriConfigDir(identifier) {
|
|
|
6207
6245
|
const platform = process.platform;
|
|
6208
6246
|
switch (platform) {
|
|
6209
6247
|
case "darwin":
|
|
6210
|
-
return
|
|
6248
|
+
return join4(homedir2(), "Library", "Application Support", identifier);
|
|
6211
6249
|
case "win32": {
|
|
6212
|
-
const appData = process.env.APPDATA ||
|
|
6213
|
-
return
|
|
6250
|
+
const appData = process.env.APPDATA || join4(homedir2(), "AppData", "Roaming");
|
|
6251
|
+
return join4(appData, identifier);
|
|
6214
6252
|
}
|
|
6215
6253
|
case "linux":
|
|
6216
6254
|
default: {
|
|
6217
|
-
const xdgConfig = process.env.XDG_CONFIG_HOME ||
|
|
6218
|
-
return
|
|
6255
|
+
const xdgConfig = process.env.XDG_CONFIG_HOME || join4(homedir2(), ".config");
|
|
6256
|
+
return join4(xdgConfig, identifier);
|
|
6219
6257
|
}
|
|
6220
6258
|
}
|
|
6221
6259
|
}
|
|
@@ -6224,8 +6262,8 @@ function getCliConfigDir() {
|
|
|
6224
6262
|
if (envConfigDir) {
|
|
6225
6263
|
return resolve(envConfigDir);
|
|
6226
6264
|
}
|
|
6227
|
-
const xdgConfig = process.env.XDG_CONFIG_HOME ||
|
|
6228
|
-
return
|
|
6265
|
+
const xdgConfig = process.env.XDG_CONFIG_HOME || join4(homedir2(), ".config");
|
|
6266
|
+
return join4(xdgConfig, "opencode");
|
|
6229
6267
|
}
|
|
6230
6268
|
function getOpenCodeConfigDir(options) {
|
|
6231
6269
|
const { binary: binary2, version, checkExisting = true } = options;
|
|
@@ -6236,8 +6274,8 @@ function getOpenCodeConfigDir(options) {
|
|
|
6236
6274
|
const tauriDir = getTauriConfigDir(identifier);
|
|
6237
6275
|
if (checkExisting) {
|
|
6238
6276
|
const legacyDir = getCliConfigDir();
|
|
6239
|
-
const legacyConfig =
|
|
6240
|
-
const legacyConfigC =
|
|
6277
|
+
const legacyConfig = join4(legacyDir, "opencode.json");
|
|
6278
|
+
const legacyConfigC = join4(legacyDir, "opencode.jsonc");
|
|
6241
6279
|
if (existsSync2(legacyConfig) || existsSync2(legacyConfigC)) {
|
|
6242
6280
|
return legacyDir;
|
|
6243
6281
|
}
|
|
@@ -6248,14 +6286,16 @@ function getOpenCodeConfigPaths(options) {
|
|
|
6248
6286
|
const configDir = getOpenCodeConfigDir(options);
|
|
6249
6287
|
return {
|
|
6250
6288
|
configDir,
|
|
6251
|
-
configJson:
|
|
6252
|
-
configJsonc:
|
|
6253
|
-
packageJson:
|
|
6254
|
-
omoConfig:
|
|
6289
|
+
configJson: join4(configDir, "opencode.json"),
|
|
6290
|
+
configJsonc: join4(configDir, "opencode.jsonc"),
|
|
6291
|
+
packageJson: join4(configDir, "package.json"),
|
|
6292
|
+
omoConfig: join4(configDir, `${CONFIG_BASENAME}.json`)
|
|
6255
6293
|
};
|
|
6256
6294
|
}
|
|
6257
6295
|
var TAURI_APP_IDENTIFIER = "ai.opencode.desktop", TAURI_APP_IDENTIFIER_DEV = "ai.opencode.desktop.dev";
|
|
6258
|
-
var init_opencode_config_dir = () => {
|
|
6296
|
+
var init_opencode_config_dir = __esm(() => {
|
|
6297
|
+
init_plugin_identity();
|
|
6298
|
+
});
|
|
6259
6299
|
|
|
6260
6300
|
// src/shared/opencode-version.ts
|
|
6261
6301
|
var NOT_CACHED;
|
|
@@ -6275,6 +6315,7 @@ var init_opencode_storage_detection = __esm(() => {
|
|
|
6275
6315
|
var init_external_plugin_detector = __esm(() => {
|
|
6276
6316
|
init_logger();
|
|
6277
6317
|
init_jsonc_parser();
|
|
6318
|
+
init_plugin_identity();
|
|
6278
6319
|
});
|
|
6279
6320
|
|
|
6280
6321
|
// src/shared/zip-extractor.ts
|
|
@@ -6618,9 +6659,9 @@ var init_system_directive = () => {};
|
|
|
6618
6659
|
var init_agent_tool_restrictions = () => {};
|
|
6619
6660
|
// src/shared/connected-providers-cache.ts
|
|
6620
6661
|
import { existsSync as existsSync3, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync } from "fs";
|
|
6621
|
-
import { join as
|
|
6662
|
+
import { join as join5 } from "path";
|
|
6622
6663
|
function getCacheFilePath(filename) {
|
|
6623
|
-
return
|
|
6664
|
+
return join5(getOmoOpenCodeCacheDir(), filename);
|
|
6624
6665
|
}
|
|
6625
6666
|
function ensureCacheDir() {
|
|
6626
6667
|
const cacheDir = getOmoOpenCodeCacheDir();
|
|
@@ -6702,12 +6743,12 @@ var init_connected_providers_cache = __esm(() => {
|
|
|
6702
6743
|
|
|
6703
6744
|
// src/shared/model-availability.ts
|
|
6704
6745
|
import { existsSync as existsSync4, readFileSync as readFileSync3 } from "fs";
|
|
6705
|
-
import { join as
|
|
6746
|
+
import { join as join6 } from "path";
|
|
6706
6747
|
function isModelCacheAvailable() {
|
|
6707
6748
|
if (hasProviderModelsCache()) {
|
|
6708
6749
|
return true;
|
|
6709
6750
|
}
|
|
6710
|
-
const cacheFile =
|
|
6751
|
+
const cacheFile = join6(getOpenCodeCacheDir(), "models.json");
|
|
6711
6752
|
return existsSync4(cacheFile);
|
|
6712
6753
|
}
|
|
6713
6754
|
var init_model_availability = __esm(() => {
|
|
@@ -6769,14 +6810,14 @@ var init_hook_message_injector = __esm(() => {
|
|
|
6769
6810
|
});
|
|
6770
6811
|
|
|
6771
6812
|
// src/shared/opencode-storage-paths.ts
|
|
6772
|
-
import { join as
|
|
6813
|
+
import { join as join7 } from "path";
|
|
6773
6814
|
var OPENCODE_STORAGE, MESSAGE_STORAGE, PART_STORAGE, SESSION_STORAGE;
|
|
6774
6815
|
var init_opencode_storage_paths = __esm(() => {
|
|
6775
6816
|
init_data_path();
|
|
6776
6817
|
OPENCODE_STORAGE = getOpenCodeStorageDir();
|
|
6777
|
-
MESSAGE_STORAGE =
|
|
6778
|
-
PART_STORAGE =
|
|
6779
|
-
SESSION_STORAGE =
|
|
6818
|
+
MESSAGE_STORAGE = join7(OPENCODE_STORAGE, "message");
|
|
6819
|
+
PART_STORAGE = join7(OPENCODE_STORAGE, "part");
|
|
6820
|
+
SESSION_STORAGE = join7(OPENCODE_STORAGE, "session");
|
|
6780
6821
|
});
|
|
6781
6822
|
|
|
6782
6823
|
// src/shared/opencode-message-dir.ts
|
|
@@ -7051,6 +7092,7 @@ var sessionCategoryMap;
|
|
|
7051
7092
|
var init_session_category_registry = __esm(() => {
|
|
7052
7093
|
sessionCategoryMap = new Map;
|
|
7053
7094
|
});
|
|
7095
|
+
|
|
7054
7096
|
// src/shared/index.ts
|
|
7055
7097
|
var init_shared = __esm(() => {
|
|
7056
7098
|
init_model_resolver();
|
|
@@ -7100,6 +7142,7 @@ var init_shared = __esm(() => {
|
|
|
7100
7142
|
init_session_directory_resolver();
|
|
7101
7143
|
init_prompt_tools();
|
|
7102
7144
|
init_plugin_command_discovery();
|
|
7145
|
+
init_plugin_identity();
|
|
7103
7146
|
});
|
|
7104
7147
|
|
|
7105
7148
|
// src/cli/config-manager/config-context.ts
|
|
@@ -7126,9 +7169,14 @@ function getConfigJsonc() {
|
|
|
7126
7169
|
function getOmoConfigPath() {
|
|
7127
7170
|
return getConfigContext().paths.omoConfig;
|
|
7128
7171
|
}
|
|
7172
|
+
function getExistingOmoConfigPath() {
|
|
7173
|
+
const detected = detectManagedConfigFile(getConfigDir());
|
|
7174
|
+
return detected.format === "none" ? null : detected.path;
|
|
7175
|
+
}
|
|
7129
7176
|
var configContext = null;
|
|
7130
7177
|
var init_config_context = __esm(() => {
|
|
7131
7178
|
init_shared();
|
|
7179
|
+
init_plugin_identity();
|
|
7132
7180
|
});
|
|
7133
7181
|
|
|
7134
7182
|
// src/cli/config-manager/npm-dist-tags.ts
|
|
@@ -7167,8 +7215,10 @@ async function getPluginNameWithVersion(currentVersion, packageName = DEFAULT_PA
|
|
|
7167
7215
|
}
|
|
7168
7216
|
return getFallbackEntry(currentVersion, packageName);
|
|
7169
7217
|
}
|
|
7170
|
-
var DEFAULT_PACKAGE_NAME
|
|
7218
|
+
var DEFAULT_PACKAGE_NAME, PRIORITIZED_TAGS;
|
|
7171
7219
|
var init_plugin_name_with_version = __esm(() => {
|
|
7220
|
+
init_plugin_identity();
|
|
7221
|
+
DEFAULT_PACKAGE_NAME = PLUGIN_NAME;
|
|
7172
7222
|
PRIORITIZED_TAGS = ["latest", "beta", "next"];
|
|
7173
7223
|
});
|
|
7174
7224
|
|
|
@@ -7295,12 +7345,12 @@ async function addPluginToOpenCodeConfig(currentVersion) {
|
|
|
7295
7345
|
}
|
|
7296
7346
|
const config = parseResult.config;
|
|
7297
7347
|
const plugins = config.plugin ?? [];
|
|
7298
|
-
const
|
|
7299
|
-
if (
|
|
7300
|
-
if (plugins[
|
|
7348
|
+
const existingPlugin = findManagedPluginEntry(plugins);
|
|
7349
|
+
if (existingPlugin) {
|
|
7350
|
+
if (plugins[existingPlugin.index] === pluginEntry) {
|
|
7301
7351
|
return { success: true, configPath: path3 };
|
|
7302
7352
|
}
|
|
7303
|
-
plugins[
|
|
7353
|
+
plugins[existingPlugin.index] = pluginEntry;
|
|
7304
7354
|
} else {
|
|
7305
7355
|
plugins.push(pluginEntry);
|
|
7306
7356
|
}
|
|
@@ -7334,13 +7384,15 @@ async function addPluginToOpenCodeConfig(currentVersion) {
|
|
|
7334
7384
|
};
|
|
7335
7385
|
}
|
|
7336
7386
|
}
|
|
7337
|
-
var PACKAGE_NAME
|
|
7387
|
+
var PACKAGE_NAME;
|
|
7338
7388
|
var init_add_plugin_to_opencode_config = __esm(() => {
|
|
7389
|
+
init_plugin_identity();
|
|
7339
7390
|
init_config_context();
|
|
7340
7391
|
init_ensure_config_directory_exists();
|
|
7341
7392
|
init_opencode_config_format();
|
|
7342
7393
|
init_parse_opencode_config_file();
|
|
7343
7394
|
init_plugin_name_with_version();
|
|
7395
|
+
PACKAGE_NAME = PLUGIN_NAME;
|
|
7344
7396
|
});
|
|
7345
7397
|
|
|
7346
7398
|
// src/cli/model-fallback-requirements.ts
|
|
@@ -7535,11 +7587,13 @@ function generateModelConfig(config) {
|
|
|
7535
7587
|
};
|
|
7536
7588
|
return isOpenAiOnlyAvailability(avail) ? applyOpenAiOnlyModelCatalog(generatedConfig) : generatedConfig;
|
|
7537
7589
|
}
|
|
7538
|
-
var ZAI_MODEL = "zai-coding-plan/glm-4.7", ULTIMATE_FALLBACK = "opencode/glm-4.7-free", SCHEMA_URL
|
|
7590
|
+
var ZAI_MODEL = "zai-coding-plan/glm-4.7", ULTIMATE_FALLBACK = "opencode/glm-4.7-free", SCHEMA_URL;
|
|
7539
7591
|
var init_model_fallback = __esm(() => {
|
|
7540
7592
|
init_model_fallback_requirements();
|
|
7541
7593
|
init_openai_only_model_catalog();
|
|
7542
7594
|
init_fallback_chain_resolution();
|
|
7595
|
+
init_plugin_identity();
|
|
7596
|
+
SCHEMA_URL = `https://raw.githubusercontent.com/D4ch1au/evil-oh-my-openagent/dev/assets/${SCHEMA_FILENAME}`;
|
|
7543
7597
|
});
|
|
7544
7598
|
|
|
7545
7599
|
// src/cli/config-manager/generate-omo-config.ts
|
|
@@ -7583,12 +7637,13 @@ function writeOmoConfig(installConfig) {
|
|
|
7583
7637
|
};
|
|
7584
7638
|
}
|
|
7585
7639
|
const omoConfigPath = getOmoConfigPath();
|
|
7640
|
+
const existingConfigPath = getExistingOmoConfigPath() ?? omoConfigPath;
|
|
7586
7641
|
try {
|
|
7587
7642
|
const newConfig = generateOmoConfig(installConfig);
|
|
7588
|
-
if (existsSync7(
|
|
7643
|
+
if (existsSync7(existingConfigPath)) {
|
|
7589
7644
|
try {
|
|
7590
|
-
const stat = statSync2(
|
|
7591
|
-
const content = readFileSync6(
|
|
7645
|
+
const stat = statSync2(existingConfigPath);
|
|
7646
|
+
const content = readFileSync6(existingConfigPath, "utf-8");
|
|
7592
7647
|
if (stat.size === 0 || isEmptyOrWhitespace2(content)) {
|
|
7593
7648
|
writeFileSync4(omoConfigPath, JSON.stringify(newConfig, null, 2) + `
|
|
7594
7649
|
`);
|
|
@@ -7601,6 +7656,7 @@ function writeOmoConfig(installConfig) {
|
|
|
7601
7656
|
return { success: true, configPath: omoConfigPath };
|
|
7602
7657
|
}
|
|
7603
7658
|
const merged = deepMergeRecord(newConfig, existing);
|
|
7659
|
+
merged.$schema = newConfig.$schema;
|
|
7604
7660
|
writeFileSync4(omoConfigPath, JSON.stringify(merged, null, 2) + `
|
|
7605
7661
|
`);
|
|
7606
7662
|
} catch (parseErr) {
|
|
@@ -7620,7 +7676,7 @@ function writeOmoConfig(installConfig) {
|
|
|
7620
7676
|
return {
|
|
7621
7677
|
success: false,
|
|
7622
7678
|
configPath: omoConfigPath,
|
|
7623
|
-
error: formatErrorWithSuggestion(err, "write
|
|
7679
|
+
error: formatErrorWithSuggestion(err, "write evil-omo config")
|
|
7624
7680
|
};
|
|
7625
7681
|
}
|
|
7626
7682
|
}
|
|
@@ -7730,8 +7786,8 @@ var init_opencode_binary = __esm(() => {
|
|
|
7730
7786
|
// src/cli/config-manager/detect-current-config.ts
|
|
7731
7787
|
import { existsSync as existsSync8, readFileSync as readFileSync7 } from "fs";
|
|
7732
7788
|
function detectProvidersFromOmoConfig() {
|
|
7733
|
-
const omoConfigPath =
|
|
7734
|
-
if (!existsSync8(omoConfigPath)) {
|
|
7789
|
+
const omoConfigPath = getExistingOmoConfigPath();
|
|
7790
|
+
if (!omoConfigPath || !existsSync8(omoConfigPath)) {
|
|
7735
7791
|
return {
|
|
7736
7792
|
hasOpenAI: true,
|
|
7737
7793
|
hasOpencodeZen: true,
|
|
@@ -7770,7 +7826,6 @@ function detectProvidersFromOmoConfig() {
|
|
|
7770
7826
|
}
|
|
7771
7827
|
}
|
|
7772
7828
|
function detectCurrentConfig() {
|
|
7773
|
-
const PACKAGE_NAME2 = "oh-my-opencode";
|
|
7774
7829
|
const result = {
|
|
7775
7830
|
isInstalled: false,
|
|
7776
7831
|
hasClaude: true,
|
|
@@ -7793,7 +7848,7 @@ function detectCurrentConfig() {
|
|
|
7793
7848
|
}
|
|
7794
7849
|
const openCodeConfig = parseResult.config;
|
|
7795
7850
|
const plugins = openCodeConfig.plugin ?? [];
|
|
7796
|
-
result.isInstalled = plugins
|
|
7851
|
+
result.isInstalled = findManagedPluginEntry(plugins) !== null;
|
|
7797
7852
|
if (!result.isInstalled) {
|
|
7798
7853
|
return result;
|
|
7799
7854
|
}
|
|
@@ -7809,6 +7864,7 @@ function detectCurrentConfig() {
|
|
|
7809
7864
|
}
|
|
7810
7865
|
var init_detect_current_config = __esm(() => {
|
|
7811
7866
|
init_shared();
|
|
7867
|
+
init_plugin_identity();
|
|
7812
7868
|
init_config_context();
|
|
7813
7869
|
init_opencode_config_format();
|
|
7814
7870
|
init_parse_opencode_config_file();
|
|
@@ -7984,10 +8040,12 @@ function getWindowsAppdataDir() {
|
|
|
7984
8040
|
return null;
|
|
7985
8041
|
return process.env.APPDATA ?? path4.join(os3.homedir(), "AppData", "Roaming");
|
|
7986
8042
|
}
|
|
7987
|
-
var PACKAGE_NAME2
|
|
8043
|
+
var PACKAGE_NAME2, NPM_REGISTRY_URL, NPM_FETCH_TIMEOUT = 5000, CACHE_DIR, VERSION_FILE, USER_CONFIG_DIR, USER_OPENCODE_CONFIG, USER_OPENCODE_CONFIG_JSONC, INSTALLED_PACKAGE_JSON;
|
|
7988
8044
|
var init_constants3 = __esm(() => {
|
|
7989
8045
|
init_data_path();
|
|
7990
8046
|
init_opencode_config_dir();
|
|
8047
|
+
init_plugin_identity();
|
|
8048
|
+
PACKAGE_NAME2 = PLUGIN_NAME;
|
|
7991
8049
|
NPM_REGISTRY_URL = `https://registry.npmjs.org/-/package/${PACKAGE_NAME2}/dist-tags`;
|
|
7992
8050
|
CACHE_DIR = getOpenCodeCacheDir();
|
|
7993
8051
|
VERSION_FILE = path4.join(CACHE_DIR, "version");
|
|
@@ -8128,15 +8186,15 @@ function findPluginEntry(directory) {
|
|
|
8128
8186
|
const content = fs7.readFileSync(configPath, "utf-8");
|
|
8129
8187
|
const config2 = JSON.parse(stripJsonComments(content));
|
|
8130
8188
|
const plugins = config2.plugin ?? [];
|
|
8131
|
-
|
|
8132
|
-
|
|
8189
|
+
const managedEntry = findManagedPluginEntry(plugins);
|
|
8190
|
+
if (managedEntry) {
|
|
8191
|
+
const entry = plugins[managedEntry.index];
|
|
8192
|
+
if (entry === managedEntry.packageName) {
|
|
8133
8193
|
return { entry, isPinned: false, pinnedVersion: null, configPath };
|
|
8134
8194
|
}
|
|
8135
|
-
|
|
8136
|
-
|
|
8137
|
-
|
|
8138
|
-
return { entry, isPinned, pinnedVersion, configPath };
|
|
8139
|
-
}
|
|
8195
|
+
const pinnedVersion = entry.slice(managedEntry.packageName.length + 1);
|
|
8196
|
+
const isPinned = EXACT_SEMVER_REGEX.test(pinnedVersion.trim());
|
|
8197
|
+
return { entry, isPinned, pinnedVersion, configPath };
|
|
8140
8198
|
}
|
|
8141
8199
|
} catch {
|
|
8142
8200
|
continue;
|
|
@@ -8146,7 +8204,7 @@ function findPluginEntry(directory) {
|
|
|
8146
8204
|
}
|
|
8147
8205
|
var EXACT_SEMVER_REGEX;
|
|
8148
8206
|
var init_plugin_entry = __esm(() => {
|
|
8149
|
-
|
|
8207
|
+
init_plugin_identity();
|
|
8150
8208
|
init_config_paths();
|
|
8151
8209
|
EXACT_SEMVER_REGEX = /^\d+\.\d+\.\d+(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$/;
|
|
8152
8210
|
});
|
|
@@ -8807,13 +8865,13 @@ var {
|
|
|
8807
8865
|
// package.json
|
|
8808
8866
|
var package_default = {
|
|
8809
8867
|
name: "evil-omo",
|
|
8810
|
-
version: "3.11.
|
|
8868
|
+
version: "3.11.4",
|
|
8811
8869
|
description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
8812
8870
|
main: "dist/index.js",
|
|
8813
8871
|
types: "dist/index.d.ts",
|
|
8814
8872
|
type: "module",
|
|
8815
8873
|
bin: {
|
|
8816
|
-
"evil-omo": "bin/
|
|
8874
|
+
"evil-omo": "bin/evil-omo.js"
|
|
8817
8875
|
},
|
|
8818
8876
|
files: [
|
|
8819
8877
|
"dist",
|
|
@@ -8825,7 +8883,7 @@ var package_default = {
|
|
|
8825
8883
|
types: "./dist/index.d.ts",
|
|
8826
8884
|
import: "./dist/index.js"
|
|
8827
8885
|
},
|
|
8828
|
-
"./schema.json": "./dist/
|
|
8886
|
+
"./schema.json": "./dist/evil-omo.schema.json"
|
|
8829
8887
|
},
|
|
8830
8888
|
scripts: {
|
|
8831
8889
|
build: "bun build src/index.ts --outdir dist --target bun --format esm --external @ast-grep/napi && tsc --emitDeclarationOnly && bun build src/cli/index.ts --outdir dist/cli --target bun --format esm --external @ast-grep/napi && bun run build:schema",
|
|
@@ -8848,7 +8906,7 @@ var package_default = {
|
|
|
8848
8906
|
"ai",
|
|
8849
8907
|
"llm"
|
|
8850
8908
|
],
|
|
8851
|
-
author: "
|
|
8909
|
+
author: "D4ch1au",
|
|
8852
8910
|
license: "SUL-1.0",
|
|
8853
8911
|
repository: {
|
|
8854
8912
|
type: "git",
|
|
@@ -8883,17 +8941,17 @@ var package_default = {
|
|
|
8883
8941
|
typescript: "^5.7.3"
|
|
8884
8942
|
},
|
|
8885
8943
|
optionalDependencies: {
|
|
8886
|
-
"
|
|
8887
|
-
"
|
|
8888
|
-
"
|
|
8889
|
-
"
|
|
8890
|
-
"
|
|
8891
|
-
"
|
|
8892
|
-
"
|
|
8893
|
-
"
|
|
8894
|
-
"
|
|
8895
|
-
"
|
|
8896
|
-
"
|
|
8944
|
+
"evil-omo-darwin-arm64": "3.11.4",
|
|
8945
|
+
"evil-omo-darwin-x64": "3.11.4",
|
|
8946
|
+
"evil-omo-darwin-x64-baseline": "3.11.4",
|
|
8947
|
+
"evil-omo-linux-x64": "3.11.4",
|
|
8948
|
+
"evil-omo-linux-x64-baseline": "3.11.4",
|
|
8949
|
+
"evil-omo-linux-arm64": "3.11.4",
|
|
8950
|
+
"evil-omo-linux-x64-musl": "3.11.4",
|
|
8951
|
+
"evil-omo-linux-x64-musl-baseline": "3.11.4",
|
|
8952
|
+
"evil-omo-linux-arm64-musl": "3.11.4",
|
|
8953
|
+
"evil-omo-windows-x64": "3.11.4",
|
|
8954
|
+
"evil-omo-windows-x64-baseline": "3.11.4"
|
|
8897
8955
|
},
|
|
8898
8956
|
overrides: {
|
|
8899
8957
|
"@opencode-ai/sdk": "^1.2.24"
|
|
@@ -9064,7 +9122,7 @@ async function runCliInstaller(args, version) {
|
|
|
9064
9122
|
console.log(` ${SYMBOLS.bullet} ${err}`);
|
|
9065
9123
|
}
|
|
9066
9124
|
console.log();
|
|
9067
|
-
printInfo("Usage: bunx
|
|
9125
|
+
printInfo("Usage: bunx evil-omo install --no-tui --claude=<no|yes|max20> --gemini=<no|yes> --copilot=<no|yes>");
|
|
9068
9126
|
console.log();
|
|
9069
9127
|
return 1;
|
|
9070
9128
|
}
|
|
@@ -9087,14 +9145,14 @@ async function runCliInstaller(args, version) {
|
|
|
9087
9145
|
printInfo(`Current config: Claude=${initial.claude}, Gemini=${initial.gemini}`);
|
|
9088
9146
|
}
|
|
9089
9147
|
const config = argsToConfig(args);
|
|
9090
|
-
printStep(step++, totalSteps, "Adding
|
|
9148
|
+
printStep(step++, totalSteps, "Adding evil-omo plugin...");
|
|
9091
9149
|
const pluginResult = await addPluginToOpenCodeConfig(version);
|
|
9092
9150
|
if (!pluginResult.success) {
|
|
9093
9151
|
printError(`Failed: ${pluginResult.error}`);
|
|
9094
9152
|
return 1;
|
|
9095
9153
|
}
|
|
9096
9154
|
printSuccess(`Plugin ${isUpdate ? "verified" : "added"} ${SYMBOLS.arrow} ${import_picocolors2.default.dim(pluginResult.configPath)}`);
|
|
9097
|
-
printStep(step++, totalSteps, "Writing
|
|
9155
|
+
printStep(step++, totalSteps, "Writing evil-omo configuration...");
|
|
9098
9156
|
const omoResult = writeOmoConfig(config);
|
|
9099
9157
|
if (!omoResult.success) {
|
|
9100
9158
|
printError(`Failed: ${omoResult.error}`);
|
|
@@ -9860,7 +9918,7 @@ async function runTuiInstaller(args, version) {
|
|
|
9860
9918
|
const config = await promptInstallConfig(detected);
|
|
9861
9919
|
if (!config)
|
|
9862
9920
|
return 1;
|
|
9863
|
-
spinner.start("Adding
|
|
9921
|
+
spinner.start("Adding evil-omo to OpenCode config");
|
|
9864
9922
|
const pluginResult = await addPluginToOpenCodeConfig(version);
|
|
9865
9923
|
if (!pluginResult.success) {
|
|
9866
9924
|
spinner.stop(`Failed to add plugin: ${pluginResult.error}`);
|
|
@@ -9868,7 +9926,7 @@ async function runTuiInstaller(args, version) {
|
|
|
9868
9926
|
return 1;
|
|
9869
9927
|
}
|
|
9870
9928
|
spinner.stop(`Plugin added to ${import_picocolors4.default.cyan(pluginResult.configPath)}`);
|
|
9871
|
-
spinner.start("Writing
|
|
9929
|
+
spinner.start("Writing evil-omo configuration");
|
|
9872
9930
|
const omoResult = writeOmoConfig(config);
|
|
9873
9931
|
if (!omoResult.success) {
|
|
9874
9932
|
spinner.stop(`Failed to write config: ${omoResult.error}`);
|
|
@@ -24563,7 +24621,7 @@ var WebsearchConfigSchema = exports_external.object({
|
|
|
24563
24621
|
provider: WebsearchProviderSchema.optional()
|
|
24564
24622
|
});
|
|
24565
24623
|
|
|
24566
|
-
// src/config/schema/
|
|
24624
|
+
// src/config/schema/evil-omo-config.ts
|
|
24567
24625
|
var OhMyOpenCodeConfigSchema = exports_external.object({
|
|
24568
24626
|
$schema: exports_external.string().optional(),
|
|
24569
24627
|
new_task_system_enabled: exports_external.boolean().optional(),
|
|
@@ -24718,12 +24776,10 @@ function mergeConfigs(base, override) {
|
|
|
24718
24776
|
}
|
|
24719
24777
|
function loadPluginConfig(directory, ctx) {
|
|
24720
24778
|
const configDir = getOpenCodeConfigDir({ binary: "opencode" });
|
|
24721
|
-
const
|
|
24722
|
-
const
|
|
24723
|
-
const
|
|
24724
|
-
const
|
|
24725
|
-
const projectDetected = detectConfigFile(projectBasePath);
|
|
24726
|
-
const projectConfigPath = projectDetected.format !== "none" ? projectDetected.path : projectBasePath + ".json";
|
|
24779
|
+
const userDetected = detectManagedConfigFile(configDir);
|
|
24780
|
+
const userConfigPath = userDetected.path;
|
|
24781
|
+
const projectDetected = detectManagedConfigFile(path3.join(directory, ".opencode"));
|
|
24782
|
+
const projectConfigPath = projectDetected.path;
|
|
24727
24783
|
let config2 = loadConfigFromPath(userConfigPath, ctx) ?? {};
|
|
24728
24784
|
const projectConfig = loadConfigFromPath(projectConfigPath, ctx);
|
|
24729
24785
|
if (projectConfig) {
|
|
@@ -26189,7 +26245,7 @@ var import_picocolors9 = __toESM(require_picocolors(), 1);
|
|
|
26189
26245
|
|
|
26190
26246
|
// src/cli/run/opencode-binary-resolver.ts
|
|
26191
26247
|
init_spawn_with_windows_hide();
|
|
26192
|
-
import { delimiter, dirname, join as
|
|
26248
|
+
import { delimiter, dirname, join as join9 } from "path";
|
|
26193
26249
|
var OPENCODE_COMMANDS = ["opencode", "opencode-desktop"];
|
|
26194
26250
|
var WINDOWS_SUFFIXES = ["", ".exe", ".cmd", ".bat", ".ps1"];
|
|
26195
26251
|
function getCommandCandidates(platform) {
|
|
@@ -26212,7 +26268,7 @@ function collectCandidateBinaryPaths(pathEnv, which = Bun.which, platform = proc
|
|
|
26212
26268
|
}
|
|
26213
26269
|
for (const entry of (pathEnv ?? "").split(delimiter).filter(Boolean)) {
|
|
26214
26270
|
for (const command of commandCandidates) {
|
|
26215
|
-
addCandidate(
|
|
26271
|
+
addCandidate(join9(entry, command));
|
|
26216
26272
|
}
|
|
26217
26273
|
}
|
|
26218
26274
|
return candidates;
|
|
@@ -26346,6 +26402,7 @@ async function createServerConnection(options) {
|
|
|
26346
26402
|
|
|
26347
26403
|
// src/cli/run/session-resolver.ts
|
|
26348
26404
|
var import_picocolors10 = __toESM(require_picocolors(), 1);
|
|
26405
|
+
init_plugin_identity();
|
|
26349
26406
|
var SESSION_CREATE_MAX_RETRIES = 3;
|
|
26350
26407
|
var SESSION_CREATE_RETRY_DELAY_MS = 1000;
|
|
26351
26408
|
async function resolveSession(options) {
|
|
@@ -26363,7 +26420,7 @@ async function resolveSession(options) {
|
|
|
26363
26420
|
for (let attempt = 1;attempt <= SESSION_CREATE_MAX_RETRIES; attempt++) {
|
|
26364
26421
|
const res = await client3.session.create({
|
|
26365
26422
|
body: {
|
|
26366
|
-
title:
|
|
26423
|
+
title: `${PLUGIN_NAME} run`,
|
|
26367
26424
|
permission: [
|
|
26368
26425
|
{ permission: "question", action: "deny", pattern: "*" }
|
|
26369
26426
|
]
|
|
@@ -26579,9 +26636,9 @@ var NOTEPAD_DIR = "notepads";
|
|
|
26579
26636
|
var NOTEPAD_BASE_PATH = `${BOULDER_DIR}/${NOTEPAD_DIR}`;
|
|
26580
26637
|
// src/features/boulder-state/storage.ts
|
|
26581
26638
|
import { existsSync as existsSync11, readFileSync as readFileSync9, writeFileSync as writeFileSync5, mkdirSync as mkdirSync3, readdirSync } from "fs";
|
|
26582
|
-
import { dirname as dirname2, join as
|
|
26639
|
+
import { dirname as dirname2, join as join10, basename } from "path";
|
|
26583
26640
|
function getBoulderFilePath(directory) {
|
|
26584
|
-
return
|
|
26641
|
+
return join10(directory, BOULDER_DIR, BOULDER_FILE);
|
|
26585
26642
|
}
|
|
26586
26643
|
function readBoulderState(directory) {
|
|
26587
26644
|
const filePath = getBoulderFilePath(directory);
|
|
@@ -26625,9 +26682,9 @@ function getPlanProgress(planPath) {
|
|
|
26625
26682
|
var CONTINUATION_MARKER_DIR = ".sisyphus/run-continuation";
|
|
26626
26683
|
// src/features/run-continuation-state/storage.ts
|
|
26627
26684
|
import { existsSync as existsSync12, mkdirSync as mkdirSync4, readFileSync as readFileSync10, rmSync, writeFileSync as writeFileSync6 } from "fs";
|
|
26628
|
-
import { join as
|
|
26685
|
+
import { join as join11 } from "path";
|
|
26629
26686
|
function getMarkerPath(directory, sessionID) {
|
|
26630
|
-
return
|
|
26687
|
+
return join11(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
|
|
26631
26688
|
}
|
|
26632
26689
|
function readContinuationMarker(directory, sessionID) {
|
|
26633
26690
|
const markerPath = getMarkerPath(directory, sessionID);
|
|
@@ -26660,7 +26717,7 @@ function getActiveContinuationMarkerReason(marker) {
|
|
|
26660
26717
|
// src/hooks/ralph-loop/storage.ts
|
|
26661
26718
|
init_frontmatter();
|
|
26662
26719
|
import { existsSync as existsSync13, readFileSync as readFileSync11, writeFileSync as writeFileSync7, unlinkSync, mkdirSync as mkdirSync5 } from "fs";
|
|
26663
|
-
import { dirname as dirname3, join as
|
|
26720
|
+
import { dirname as dirname3, join as join12 } from "path";
|
|
26664
26721
|
|
|
26665
26722
|
// src/hooks/ralph-loop/constants.ts
|
|
26666
26723
|
var DEFAULT_STATE_FILE = ".sisyphus/ralph-loop.local.md";
|
|
@@ -26669,7 +26726,7 @@ var DEFAULT_COMPLETION_PROMISE = "DONE";
|
|
|
26669
26726
|
|
|
26670
26727
|
// src/hooks/ralph-loop/storage.ts
|
|
26671
26728
|
function getStateFilePath(directory, customPath) {
|
|
26672
|
-
return customPath ?
|
|
26729
|
+
return customPath ? join12(directory, customPath) : join12(directory, DEFAULT_STATE_FILE);
|
|
26673
26730
|
}
|
|
26674
26731
|
function readState(directory, customPath) {
|
|
26675
26732
|
const filePath = getStateFilePath(directory, customPath);
|
|
@@ -27211,7 +27268,7 @@ var SYMBOLS2 = {
|
|
|
27211
27268
|
function formatVersionOutput(info) {
|
|
27212
27269
|
const lines = [];
|
|
27213
27270
|
lines.push("");
|
|
27214
|
-
lines.push(import_picocolors15.default.bold(import_picocolors15.default.white("
|
|
27271
|
+
lines.push(import_picocolors15.default.bold(import_picocolors15.default.white("evil-omo Version Information")));
|
|
27215
27272
|
lines.push(import_picocolors15.default.dim("\u2500".repeat(50)));
|
|
27216
27273
|
lines.push("");
|
|
27217
27274
|
if (info.currentVersion) {
|
|
@@ -27229,7 +27286,7 @@ function formatVersionOutput(info) {
|
|
|
27229
27286
|
break;
|
|
27230
27287
|
case "outdated":
|
|
27231
27288
|
lines.push(` ${SYMBOLS2.warn} ${import_picocolors15.default.yellow("Update available")}`);
|
|
27232
|
-
lines.push(` ${import_picocolors15.default.dim("Run:")} ${import_picocolors15.default.cyan("cd ~/.config/opencode && bun update
|
|
27289
|
+
lines.push(` ${import_picocolors15.default.dim("Run:")} ${import_picocolors15.default.cyan("cd ~/.config/opencode && bun update evil-omo")}`);
|
|
27233
27290
|
break;
|
|
27234
27291
|
case "local-dev":
|
|
27235
27292
|
lines.push(` ${SYMBOLS2.dev} ${import_picocolors15.default.cyan("Running in local development mode")}`);
|
|
@@ -27344,6 +27401,7 @@ async function getLocalVersion(options = {}) {
|
|
|
27344
27401
|
}
|
|
27345
27402
|
}
|
|
27346
27403
|
// src/cli/doctor/constants.ts
|
|
27404
|
+
init_plugin_identity();
|
|
27347
27405
|
var import_picocolors16 = __toESM(require_picocolors(), 1);
|
|
27348
27406
|
var SYMBOLS3 = {
|
|
27349
27407
|
check: import_picocolors16.default.green("\u2713"),
|
|
@@ -27377,7 +27435,7 @@ var EXIT_CODES = {
|
|
|
27377
27435
|
FAILURE: 1
|
|
27378
27436
|
};
|
|
27379
27437
|
var MIN_OPENCODE_VERSION = "1.0.150";
|
|
27380
|
-
var PACKAGE_NAME3 =
|
|
27438
|
+
var PACKAGE_NAME3 = PLUGIN_NAME;
|
|
27381
27439
|
var OPENCODE_BINARIES2 = ["opencode", "opencode-desktop"];
|
|
27382
27440
|
|
|
27383
27441
|
// src/cli/doctor/checks/system.ts
|
|
@@ -27387,24 +27445,24 @@ import { existsSync as existsSync23, readFileSync as readFileSync21 } from "fs";
|
|
|
27387
27445
|
init_spawn_with_windows_hide();
|
|
27388
27446
|
import { existsSync as existsSync20 } from "fs";
|
|
27389
27447
|
import { homedir as homedir5 } from "os";
|
|
27390
|
-
import { join as
|
|
27448
|
+
import { join as join18 } from "path";
|
|
27391
27449
|
function getDesktopAppPaths(platform) {
|
|
27392
27450
|
const home = homedir5();
|
|
27393
27451
|
switch (platform) {
|
|
27394
27452
|
case "darwin":
|
|
27395
27453
|
return [
|
|
27396
27454
|
"/Applications/OpenCode.app/Contents/MacOS/OpenCode",
|
|
27397
|
-
|
|
27455
|
+
join18(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
|
|
27398
27456
|
];
|
|
27399
27457
|
case "win32": {
|
|
27400
27458
|
const programFiles = process.env.ProgramFiles;
|
|
27401
27459
|
const localAppData = process.env.LOCALAPPDATA;
|
|
27402
27460
|
const paths = [];
|
|
27403
27461
|
if (programFiles) {
|
|
27404
|
-
paths.push(
|
|
27462
|
+
paths.push(join18(programFiles, "OpenCode", "OpenCode.exe"));
|
|
27405
27463
|
}
|
|
27406
27464
|
if (localAppData) {
|
|
27407
|
-
paths.push(
|
|
27465
|
+
paths.push(join18(localAppData, "OpenCode", "OpenCode.exe"));
|
|
27408
27466
|
}
|
|
27409
27467
|
return paths;
|
|
27410
27468
|
}
|
|
@@ -27412,8 +27470,8 @@ function getDesktopAppPaths(platform) {
|
|
|
27412
27470
|
return [
|
|
27413
27471
|
"/usr/bin/opencode",
|
|
27414
27472
|
"/usr/lib/opencode/opencode",
|
|
27415
|
-
|
|
27416
|
-
|
|
27473
|
+
join18(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
|
|
27474
|
+
join18(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
|
|
27417
27475
|
];
|
|
27418
27476
|
default:
|
|
27419
27477
|
return [];
|
|
@@ -27553,21 +27611,21 @@ init_checker();
|
|
|
27553
27611
|
init_auto_update_checker();
|
|
27554
27612
|
import { existsSync as existsSync22, readFileSync as readFileSync20 } from "fs";
|
|
27555
27613
|
import { homedir as homedir6 } from "os";
|
|
27556
|
-
import { join as
|
|
27614
|
+
import { join as join19 } from "path";
|
|
27557
27615
|
init_shared();
|
|
27558
27616
|
function getPlatformDefaultCacheDir(platform = process.platform) {
|
|
27559
27617
|
if (platform === "darwin")
|
|
27560
|
-
return
|
|
27618
|
+
return join19(homedir6(), "Library", "Caches");
|
|
27561
27619
|
if (platform === "win32")
|
|
27562
|
-
return process.env.LOCALAPPDATA ??
|
|
27563
|
-
return
|
|
27620
|
+
return process.env.LOCALAPPDATA ?? join19(homedir6(), "AppData", "Local");
|
|
27621
|
+
return join19(homedir6(), ".cache");
|
|
27564
27622
|
}
|
|
27565
27623
|
function resolveOpenCodeCacheDir() {
|
|
27566
27624
|
const xdgCacheHome = process.env.XDG_CACHE_HOME;
|
|
27567
27625
|
if (xdgCacheHome)
|
|
27568
|
-
return
|
|
27626
|
+
return join19(xdgCacheHome, "opencode");
|
|
27569
27627
|
const fromShared = getOpenCodeCacheDir();
|
|
27570
|
-
const platformDefault =
|
|
27628
|
+
const platformDefault = join19(getPlatformDefaultCacheDir(), "opencode");
|
|
27571
27629
|
if (existsSync22(fromShared) || !existsSync22(platformDefault))
|
|
27572
27630
|
return fromShared;
|
|
27573
27631
|
return platformDefault;
|
|
@@ -27595,12 +27653,12 @@ function getLoadedPluginVersion() {
|
|
|
27595
27653
|
{
|
|
27596
27654
|
cacheDir: configPaths.configDir,
|
|
27597
27655
|
cachePackagePath: configPaths.packageJson,
|
|
27598
|
-
installedPackagePath:
|
|
27656
|
+
installedPackagePath: join19(configPaths.configDir, "node_modules", PACKAGE_NAME3, "package.json")
|
|
27599
27657
|
},
|
|
27600
27658
|
{
|
|
27601
27659
|
cacheDir,
|
|
27602
|
-
cachePackagePath:
|
|
27603
|
-
installedPackagePath:
|
|
27660
|
+
cachePackagePath: join19(cacheDir, "package.json"),
|
|
27661
|
+
installedPackagePath: join19(cacheDir, "node_modules", PACKAGE_NAME3, "package.json")
|
|
27604
27662
|
}
|
|
27605
27663
|
];
|
|
27606
27664
|
const selectedCandidate = candidates.find((candidate) => existsSync22(candidate.installedPackagePath)) ?? candidates[0];
|
|
@@ -27695,9 +27753,9 @@ async function checkSystem() {
|
|
|
27695
27753
|
}
|
|
27696
27754
|
if (!pluginInfo.registered) {
|
|
27697
27755
|
issues.push({
|
|
27698
|
-
title:
|
|
27756
|
+
title: `${PACKAGE_NAME3} is not registered`,
|
|
27699
27757
|
description: "Plugin entry is missing from OpenCode configuration.",
|
|
27700
|
-
fix:
|
|
27758
|
+
fix: `Run: bunx ${PACKAGE_NAME3} install`,
|
|
27701
27759
|
severity: "error",
|
|
27702
27760
|
affects: ["all agents"]
|
|
27703
27761
|
});
|
|
@@ -27715,7 +27773,7 @@ async function checkSystem() {
|
|
|
27715
27773
|
issues.push({
|
|
27716
27774
|
title: "Loaded plugin is outdated",
|
|
27717
27775
|
description: `Loaded ${systemInfo.loadedVersion}, latest ${latestVersion}.`,
|
|
27718
|
-
fix: `Update: cd "${loadedInfo.cacheDir}" && bun add
|
|
27776
|
+
fix: `Update: cd "${loadedInfo.cacheDir}" && bun add ${PACKAGE_NAME3}@${installTag}`,
|
|
27719
27777
|
severity: "warning",
|
|
27720
27778
|
affects: ["plugin features"]
|
|
27721
27779
|
});
|
|
@@ -27737,22 +27795,23 @@ async function checkSystem() {
|
|
|
27737
27795
|
|
|
27738
27796
|
// src/cli/doctor/checks/config.ts
|
|
27739
27797
|
import { readFileSync as readFileSync24 } from "fs";
|
|
27740
|
-
import { join as
|
|
27798
|
+
import { join as join23 } from "path";
|
|
27741
27799
|
init_shared();
|
|
27800
|
+
init_plugin_identity();
|
|
27742
27801
|
|
|
27743
27802
|
// src/cli/doctor/checks/model-resolution-cache.ts
|
|
27744
27803
|
init_shared();
|
|
27745
27804
|
import { existsSync as existsSync24, readFileSync as readFileSync22 } from "fs";
|
|
27746
27805
|
import { homedir as homedir7 } from "os";
|
|
27747
|
-
import { join as
|
|
27806
|
+
import { join as join20 } from "path";
|
|
27748
27807
|
function getOpenCodeCacheDir2() {
|
|
27749
27808
|
const xdgCache = process.env.XDG_CACHE_HOME;
|
|
27750
27809
|
if (xdgCache)
|
|
27751
|
-
return
|
|
27752
|
-
return
|
|
27810
|
+
return join20(xdgCache, "opencode");
|
|
27811
|
+
return join20(homedir7(), ".cache", "opencode");
|
|
27753
27812
|
}
|
|
27754
27813
|
function loadAvailableModelsFromCache() {
|
|
27755
|
-
const cacheFile =
|
|
27814
|
+
const cacheFile = join20(getOpenCodeCacheDir2(), "models.json");
|
|
27756
27815
|
if (!existsSync24(cacheFile)) {
|
|
27757
27816
|
return { providers: [], modelCount: 0, cacheExists: false };
|
|
27758
27817
|
}
|
|
@@ -27778,13 +27837,13 @@ init_model_requirements();
|
|
|
27778
27837
|
|
|
27779
27838
|
// src/cli/doctor/checks/model-resolution-config.ts
|
|
27780
27839
|
init_shared();
|
|
27840
|
+
init_plugin_identity();
|
|
27781
27841
|
import { readFileSync as readFileSync23 } from "fs";
|
|
27782
|
-
import { join as
|
|
27783
|
-
var
|
|
27784
|
-
var
|
|
27785
|
-
var PROJECT_CONFIG_BASE = join20(process.cwd(), ".opencode", PACKAGE_NAME4);
|
|
27842
|
+
import { join as join21 } from "path";
|
|
27843
|
+
var USER_CONFIG_DIR2 = getOpenCodeConfigPaths({ binary: "opencode", version: null }).configDir;
|
|
27844
|
+
var PROJECT_CONFIG_DIR = join21(process.cwd(), ".opencode");
|
|
27786
27845
|
function loadOmoConfig() {
|
|
27787
|
-
const projectDetected =
|
|
27846
|
+
const projectDetected = detectManagedConfigFile(PROJECT_CONFIG_DIR);
|
|
27788
27847
|
if (projectDetected.format !== "none") {
|
|
27789
27848
|
try {
|
|
27790
27849
|
const content = readFileSync23(projectDetected.path, "utf-8");
|
|
@@ -27793,7 +27852,7 @@ function loadOmoConfig() {
|
|
|
27793
27852
|
return null;
|
|
27794
27853
|
}
|
|
27795
27854
|
}
|
|
27796
|
-
const userDetected =
|
|
27855
|
+
const userDetected = detectManagedConfigFile(USER_CONFIG_DIR2);
|
|
27797
27856
|
if (userDetected.format !== "none") {
|
|
27798
27857
|
try {
|
|
27799
27858
|
const content = readFileSync23(userDetected.path, "utf-8");
|
|
@@ -27807,7 +27866,7 @@ function loadOmoConfig() {
|
|
|
27807
27866
|
|
|
27808
27867
|
// src/cli/doctor/checks/model-resolution-details.ts
|
|
27809
27868
|
init_shared();
|
|
27810
|
-
import { join as
|
|
27869
|
+
import { join as join22 } from "path";
|
|
27811
27870
|
|
|
27812
27871
|
// src/cli/doctor/checks/model-resolution-variant.ts
|
|
27813
27872
|
function formatModelWithVariant(model, variant) {
|
|
@@ -27846,7 +27905,7 @@ function getCategoryEffectiveVariant(categoryName, requirement, config2) {
|
|
|
27846
27905
|
// src/cli/doctor/checks/model-resolution-details.ts
|
|
27847
27906
|
function buildModelResolutionDetails(options) {
|
|
27848
27907
|
const details = [];
|
|
27849
|
-
const cacheFile =
|
|
27908
|
+
const cacheFile = join22(getOpenCodeCacheDir(), "models.json");
|
|
27850
27909
|
details.push("\u2550\u2550\u2550 Available Models (from cache) \u2550\u2550\u2550");
|
|
27851
27910
|
details.push("");
|
|
27852
27911
|
if (options.available.cacheExists) {
|
|
@@ -27958,13 +28017,11 @@ async function checkModels() {
|
|
|
27958
28017
|
}
|
|
27959
28018
|
|
|
27960
28019
|
// src/cli/doctor/checks/config.ts
|
|
27961
|
-
var USER_CONFIG_BASE2 = join22(getOpenCodeConfigDir({ binary: "opencode" }), PACKAGE_NAME3);
|
|
27962
|
-
var PROJECT_CONFIG_BASE2 = join22(process.cwd(), ".opencode", PACKAGE_NAME3);
|
|
27963
28020
|
function findConfigPath() {
|
|
27964
|
-
const projectConfig =
|
|
28021
|
+
const projectConfig = detectManagedConfigFile(join23(process.cwd(), ".opencode"));
|
|
27965
28022
|
if (projectConfig.format !== "none")
|
|
27966
28023
|
return projectConfig.path;
|
|
27967
|
-
const userConfig =
|
|
28024
|
+
const userConfig = detectManagedConfigFile(getOpenCodeConfigDir({ binary: "opencode" }));
|
|
27968
28025
|
if (userConfig.format !== "none")
|
|
27969
28026
|
return userConfig.path;
|
|
27970
28027
|
return null;
|
|
@@ -28081,7 +28138,7 @@ async function checkConfig() {
|
|
|
28081
28138
|
init_spawn_with_windows_hide();
|
|
28082
28139
|
import { existsSync as existsSync25 } from "fs";
|
|
28083
28140
|
import { createRequire } from "module";
|
|
28084
|
-
import { dirname as dirname6, join as
|
|
28141
|
+
import { dirname as dirname6, join as join24 } from "path";
|
|
28085
28142
|
async function checkBinaryExists(binary2) {
|
|
28086
28143
|
try {
|
|
28087
28144
|
const path10 = Bun.which(binary2);
|
|
@@ -28138,11 +28195,11 @@ async function checkAstGrepNapi() {
|
|
|
28138
28195
|
};
|
|
28139
28196
|
} catch {
|
|
28140
28197
|
const { existsSync: existsSync26 } = await import("fs");
|
|
28141
|
-
const { join:
|
|
28198
|
+
const { join: join25 } = await import("path");
|
|
28142
28199
|
const { homedir: homedir8 } = await import("os");
|
|
28143
28200
|
const pathsToCheck = [
|
|
28144
|
-
|
|
28145
|
-
|
|
28201
|
+
join25(homedir8(), ".config", "opencode", "node_modules", "@ast-grep", "napi"),
|
|
28202
|
+
join25(process.cwd(), "node_modules", "@ast-grep", "napi")
|
|
28146
28203
|
];
|
|
28147
28204
|
for (const napiPath of pathsToCheck) {
|
|
28148
28205
|
if (existsSync26(napiPath)) {
|
|
@@ -28170,7 +28227,7 @@ function findCommentCheckerPackageBinary() {
|
|
|
28170
28227
|
try {
|
|
28171
28228
|
const require2 = createRequire(import.meta.url);
|
|
28172
28229
|
const pkgPath = require2.resolve("@code-yeongyu/comment-checker/package.json");
|
|
28173
|
-
const binaryPath =
|
|
28230
|
+
const binaryPath = join24(dirname6(pkgPath), "bin", binaryName);
|
|
28174
28231
|
if (existsSync25(binaryPath))
|
|
28175
28232
|
return binaryPath;
|
|
28176
28233
|
} catch {}
|
|
@@ -28329,9 +28386,10 @@ var BUILTIN_SERVERS = {
|
|
|
28329
28386
|
};
|
|
28330
28387
|
// src/tools/lsp/server-config-loader.ts
|
|
28331
28388
|
import { existsSync as existsSync26, readFileSync as readFileSync25 } from "fs";
|
|
28332
|
-
import { join as
|
|
28389
|
+
import { join as join25 } from "path";
|
|
28333
28390
|
init_shared();
|
|
28334
28391
|
init_jsonc_parser();
|
|
28392
|
+
init_plugin_identity();
|
|
28335
28393
|
function loadJsonFile(path10) {
|
|
28336
28394
|
if (!existsSync26(path10))
|
|
28337
28395
|
return null;
|
|
@@ -28345,9 +28403,9 @@ function getConfigPaths2() {
|
|
|
28345
28403
|
const cwd = process.cwd();
|
|
28346
28404
|
const configDir = getOpenCodeConfigDir({ binary: "opencode" });
|
|
28347
28405
|
return {
|
|
28348
|
-
project:
|
|
28349
|
-
user:
|
|
28350
|
-
opencode: detectConfigFile(
|
|
28406
|
+
project: detectManagedConfigFile(join25(cwd, ".opencode")).path,
|
|
28407
|
+
user: detectManagedConfigFile(configDir).path,
|
|
28408
|
+
opencode: detectConfigFile(join25(configDir, "opencode")).path
|
|
28351
28409
|
};
|
|
28352
28410
|
}
|
|
28353
28411
|
function loadAllConfigs() {
|
|
@@ -28417,20 +28475,20 @@ function getMergedServers() {
|
|
|
28417
28475
|
|
|
28418
28476
|
// src/tools/lsp/server-installation.ts
|
|
28419
28477
|
import { existsSync as existsSync27 } from "fs";
|
|
28420
|
-
import { delimiter as delimiter2, join as
|
|
28478
|
+
import { delimiter as delimiter2, join as join27 } from "path";
|
|
28421
28479
|
|
|
28422
28480
|
// src/tools/lsp/server-path-bases.ts
|
|
28423
28481
|
init_shared();
|
|
28424
|
-
import { join as
|
|
28482
|
+
import { join as join26 } from "path";
|
|
28425
28483
|
function getLspServerAdditionalPathBases(workingDirectory) {
|
|
28426
28484
|
const configDir = getOpenCodeConfigDir({ binary: "opencode" });
|
|
28427
|
-
const dataDir =
|
|
28485
|
+
const dataDir = join26(getDataDir(), "opencode");
|
|
28428
28486
|
return [
|
|
28429
|
-
|
|
28430
|
-
|
|
28431
|
-
|
|
28432
|
-
|
|
28433
|
-
|
|
28487
|
+
join26(workingDirectory, "node_modules", ".bin"),
|
|
28488
|
+
join26(configDir, "bin"),
|
|
28489
|
+
join26(configDir, "node_modules", ".bin"),
|
|
28490
|
+
join26(dataDir, "bin"),
|
|
28491
|
+
join26(dataDir, "bin", "node_modules", ".bin")
|
|
28434
28492
|
];
|
|
28435
28493
|
}
|
|
28436
28494
|
|
|
@@ -28461,14 +28519,14 @@ function isServerInstalled(command) {
|
|
|
28461
28519
|
const paths = pathEnv.split(delimiter2);
|
|
28462
28520
|
for (const p2 of paths) {
|
|
28463
28521
|
for (const suffix of exts) {
|
|
28464
|
-
if (existsSync27(
|
|
28522
|
+
if (existsSync27(join27(p2, cmd + suffix))) {
|
|
28465
28523
|
return true;
|
|
28466
28524
|
}
|
|
28467
28525
|
}
|
|
28468
28526
|
}
|
|
28469
28527
|
for (const base of getLspServerAdditionalPathBases(process.cwd())) {
|
|
28470
28528
|
for (const suffix of exts) {
|
|
28471
|
-
if (existsSync27(
|
|
28529
|
+
if (existsSync27(join27(base, cmd + suffix))) {
|
|
28472
28530
|
return true;
|
|
28473
28531
|
}
|
|
28474
28532
|
}
|
|
@@ -28532,13 +28590,13 @@ function getInstalledLspServers() {
|
|
|
28532
28590
|
init_shared();
|
|
28533
28591
|
import { existsSync as existsSync28, readFileSync as readFileSync26 } from "fs";
|
|
28534
28592
|
import { homedir as homedir8 } from "os";
|
|
28535
|
-
import { join as
|
|
28593
|
+
import { join as join28 } from "path";
|
|
28536
28594
|
var BUILTIN_MCP_SERVERS = ["context7", "grep_app"];
|
|
28537
28595
|
function getMcpConfigPaths() {
|
|
28538
28596
|
return [
|
|
28539
|
-
|
|
28540
|
-
|
|
28541
|
-
|
|
28597
|
+
join28(homedir8(), ".claude", ".mcp.json"),
|
|
28598
|
+
join28(process.cwd(), ".mcp.json"),
|
|
28599
|
+
join28(process.cwd(), ".claude", ".mcp.json")
|
|
28542
28600
|
];
|
|
28543
28601
|
}
|
|
28544
28602
|
function loadUserMcpConfig() {
|
|
@@ -28747,6 +28805,7 @@ function formatIssue(issue2, index) {
|
|
|
28747
28805
|
}
|
|
28748
28806
|
|
|
28749
28807
|
// src/cli/doctor/format-default.ts
|
|
28808
|
+
init_plugin_identity();
|
|
28750
28809
|
function formatDefault(result) {
|
|
28751
28810
|
const lines = [];
|
|
28752
28811
|
lines.push(formatHeader());
|
|
@@ -28754,7 +28813,7 @@ function formatDefault(result) {
|
|
|
28754
28813
|
if (allIssues.length === 0) {
|
|
28755
28814
|
const opencodeVer = result.systemInfo.opencodeVersion ?? "unknown";
|
|
28756
28815
|
const pluginVer = result.systemInfo.pluginVersion ?? "unknown";
|
|
28757
|
-
lines.push(` ${import_picocolors18.default.green(SYMBOLS3.check)} ${import_picocolors18.default.green(`System OK (opencode ${opencodeVer} \xB7
|
|
28816
|
+
lines.push(` ${import_picocolors18.default.green(SYMBOLS3.check)} ${import_picocolors18.default.green(`System OK (opencode ${opencodeVer} \xB7 ${PLUGIN_NAME} ${pluginVer})`)}`);
|
|
28758
28817
|
} else {
|
|
28759
28818
|
const issueCount = allIssues.filter((i2) => i2.severity === "error").length;
|
|
28760
28819
|
const warnCount = allIssues.filter((i2) => i2.severity === "warning").length;
|
|
@@ -28802,6 +28861,7 @@ function formatStatus(result) {
|
|
|
28802
28861
|
|
|
28803
28862
|
// src/cli/doctor/format-verbose.ts
|
|
28804
28863
|
var import_picocolors20 = __toESM(require_picocolors(), 1);
|
|
28864
|
+
init_plugin_identity();
|
|
28805
28865
|
function formatVerbose(result) {
|
|
28806
28866
|
const lines = [];
|
|
28807
28867
|
lines.push(formatHeader());
|
|
@@ -28809,7 +28869,7 @@ function formatVerbose(result) {
|
|
|
28809
28869
|
lines.push(`${import_picocolors20.default.bold("System Information")}`);
|
|
28810
28870
|
lines.push(`${import_picocolors20.default.dim("\u2500".repeat(40))}`);
|
|
28811
28871
|
lines.push(` ${formatStatusSymbol("pass")} opencode ${systemInfo.opencodeVersion ?? "unknown"}`);
|
|
28812
|
-
lines.push(` ${formatStatusSymbol("pass")}
|
|
28872
|
+
lines.push(` ${formatStatusSymbol("pass")} ${PLUGIN_NAME} ${systemInfo.pluginVersion ?? "unknown"}`);
|
|
28813
28873
|
if (systemInfo.loadedVersion) {
|
|
28814
28874
|
lines.push(` ${formatStatusSymbol("pass")} loaded ${systemInfo.loadedVersion}`);
|
|
28815
28875
|
}
|
|
@@ -28969,10 +29029,10 @@ async function doctor(options = { mode: "default" }) {
|
|
|
28969
29029
|
// src/features/mcp-oauth/storage.ts
|
|
28970
29030
|
init_shared();
|
|
28971
29031
|
import { chmodSync, existsSync as existsSync29, mkdirSync as mkdirSync6, readFileSync as readFileSync27, unlinkSync as unlinkSync4, writeFileSync as writeFileSync10 } from "fs";
|
|
28972
|
-
import { dirname as dirname7, join as
|
|
29032
|
+
import { dirname as dirname7, join as join29 } from "path";
|
|
28973
29033
|
var STORAGE_FILE_NAME = "mcp-oauth.json";
|
|
28974
29034
|
function getMcpOauthStoragePath() {
|
|
28975
|
-
return
|
|
29035
|
+
return join29(getOpenCodeConfigDir({ binary: "opencode" }), STORAGE_FILE_NAME);
|
|
28976
29036
|
}
|
|
28977
29037
|
function normalizeHost(serverHost) {
|
|
28978
29038
|
let host = serverHost.trim();
|
|
@@ -29346,6 +29406,8 @@ async function runAuthorizationCodeRedirect(options) {
|
|
|
29346
29406
|
}
|
|
29347
29407
|
|
|
29348
29408
|
// src/features/mcp-oauth/provider.ts
|
|
29409
|
+
init_plugin_identity();
|
|
29410
|
+
|
|
29349
29411
|
class McpOAuthProvider {
|
|
29350
29412
|
serverUrl;
|
|
29351
29413
|
configClientId;
|
|
@@ -29413,7 +29475,7 @@ class McpOAuthProvider {
|
|
|
29413
29475
|
const clientInfo = await getOrRegisterClient({
|
|
29414
29476
|
registrationEndpoint: metadata.registrationEndpoint,
|
|
29415
29477
|
serverIdentifier: this.serverUrl,
|
|
29416
|
-
clientName:
|
|
29478
|
+
clientName: PLUGIN_NAME,
|
|
29417
29479
|
redirectUris: [this.redirectUrl()],
|
|
29418
29480
|
tokenEndpointAuthMethod: "none",
|
|
29419
29481
|
clientId: this.configClientId,
|
|
@@ -29591,12 +29653,12 @@ function createMcpOAuthCommand() {
|
|
|
29591
29653
|
// src/cli/cli-program.ts
|
|
29592
29654
|
var VERSION2 = package_default.version;
|
|
29593
29655
|
var program2 = new Command;
|
|
29594
|
-
program2.name("
|
|
29595
|
-
program2.command("install").description("Install and configure
|
|
29656
|
+
program2.name("evil-omo").description("The ultimate OpenCode plugin - multi-model orchestration, LSP tools, and more").version(VERSION2, "-v, --version", "Show version number").enablePositionalOptions();
|
|
29657
|
+
program2.command("install").description("Install and configure evil-omo with interactive setup").option("--no-tui", "Run in non-interactive mode (requires all options)").option("--claude <value>", "Claude subscription: no, yes, max20").option("--openai <value>", "OpenAI/ChatGPT subscription: no, yes (default: no)").option("--gemini <value>", "Gemini integration: no, yes").option("--copilot <value>", "GitHub Copilot subscription: no, yes").option("--opencode-zen <value>", "OpenCode Zen access: no, yes (default: no)").option("--zai-coding-plan <value>", "Z.ai Coding Plan subscription: no, yes (default: no)").option("--kimi-for-coding <value>", "Kimi For Coding subscription: no, yes (default: no)").option("--opencode-go <value>", "OpenCode Go subscription: no, yes (default: no)").option("--skip-auth", "Skip authentication setup hints").addHelpText("after", `
|
|
29596
29658
|
Examples:
|
|
29597
|
-
$ bunx
|
|
29598
|
-
$ bunx
|
|
29599
|
-
$ bunx
|
|
29659
|
+
$ bunx evil-omo install
|
|
29660
|
+
$ bunx evil-omo install --no-tui --claude=max20 --openai=yes --gemini=yes --copilot=no
|
|
29661
|
+
$ bunx evil-omo install --no-tui --claude=no --gemini=no --copilot=yes --opencode-zen=yes
|
|
29600
29662
|
|
|
29601
29663
|
Model Providers (Priority: Native > Copilot > OpenCode Zen > Z.ai > Kimi):
|
|
29602
29664
|
Claude Native anthropic/ models (Opus, Sonnet, Haiku)
|
|
@@ -29624,20 +29686,20 @@ Model Providers (Priority: Native > Copilot > OpenCode Zen > Z.ai > Kimi):
|
|
|
29624
29686
|
});
|
|
29625
29687
|
program2.command("run <message>").allowUnknownOption().passThroughOptions().description("Run opencode with todo/background task completion enforcement").option("-a, --agent <name>", "Agent to use (default: from CLI/env/config, fallback: Sisyphus)").option("-m, --model <provider/model>", "Model override (e.g., anthropic/claude-sonnet-4)").option("-d, --directory <path>", "Working directory").option("-p, --port <port>", "Server port (attaches if port already in use)", parseInt).option("--attach <url>", "Attach to existing opencode server URL").option("--on-complete <command>", "Shell command to run after completion").option("--json", "Output structured JSON result to stdout").option("--no-timestamp", "Disable timestamp prefix in run output").option("--verbose", "Show full event stream (default: messages/tools only)").option("--session-id <id>", "Resume existing session instead of creating new one").addHelpText("after", `
|
|
29626
29688
|
Examples:
|
|
29627
|
-
$ bunx
|
|
29628
|
-
$ bunx
|
|
29629
|
-
$ bunx
|
|
29630
|
-
$ bunx
|
|
29631
|
-
$ bunx
|
|
29632
|
-
$ bunx
|
|
29633
|
-
$ bunx
|
|
29634
|
-
$ bunx
|
|
29635
|
-
$ bunx
|
|
29689
|
+
$ bunx evil-omo run "Fix the bug in index.ts"
|
|
29690
|
+
$ bunx evil-omo run --agent Sisyphus "Implement feature X"
|
|
29691
|
+
$ bunx evil-omo run --port 4321 "Fix the bug"
|
|
29692
|
+
$ bunx evil-omo run --attach http://127.0.0.1:4321 "Fix the bug"
|
|
29693
|
+
$ bunx evil-omo run --json "Fix the bug" | jq .sessionId
|
|
29694
|
+
$ bunx evil-omo run --on-complete "notify-send Done" "Fix the bug"
|
|
29695
|
+
$ bunx evil-omo run --session-id ses_abc123 "Continue the work"
|
|
29696
|
+
$ bunx evil-omo run --model anthropic/claude-sonnet-4 "Fix the bug"
|
|
29697
|
+
$ bunx evil-omo run --agent Sisyphus --model openai/gpt-5.4 "Implement feature X"
|
|
29636
29698
|
|
|
29637
29699
|
Agent resolution order:
|
|
29638
29700
|
1) --agent flag
|
|
29639
29701
|
2) OPENCODE_DEFAULT_AGENT
|
|
29640
|
-
3)
|
|
29702
|
+
3) evil-omo.json "default_run_agent"
|
|
29641
29703
|
4) Sisyphus (fallback)
|
|
29642
29704
|
|
|
29643
29705
|
Available core agents:
|
|
@@ -29669,9 +29731,9 @@ Unlike 'opencode run', this command waits until:
|
|
|
29669
29731
|
});
|
|
29670
29732
|
program2.command("get-local-version").description("Show current installed version and check for updates").option("-d, --directory <path>", "Working directory to check config from").option("--json", "Output in JSON format for scripting").addHelpText("after", `
|
|
29671
29733
|
Examples:
|
|
29672
|
-
$ bunx
|
|
29673
|
-
$ bunx
|
|
29674
|
-
$ bunx
|
|
29734
|
+
$ bunx evil-omo get-local-version
|
|
29735
|
+
$ bunx evil-omo get-local-version --json
|
|
29736
|
+
$ bunx evil-omo get-local-version --directory /path/to/project
|
|
29675
29737
|
|
|
29676
29738
|
This command shows:
|
|
29677
29739
|
- Current installed version
|
|
@@ -29686,12 +29748,12 @@ This command shows:
|
|
|
29686
29748
|
const exitCode = await getLocalVersion(versionOptions);
|
|
29687
29749
|
process.exit(exitCode);
|
|
29688
29750
|
});
|
|
29689
|
-
program2.command("doctor").description("Check
|
|
29751
|
+
program2.command("doctor").description("Check evil-omo installation health and diagnose issues").option("--status", "Show compact system dashboard").option("--verbose", "Show detailed diagnostic information").option("--json", "Output results in JSON format").addHelpText("after", `
|
|
29690
29752
|
Examples:
|
|
29691
|
-
$ bunx
|
|
29692
|
-
$ bunx
|
|
29693
|
-
$ bunx
|
|
29694
|
-
$ bunx
|
|
29753
|
+
$ bunx evil-omo doctor # Show problems only
|
|
29754
|
+
$ bunx evil-omo doctor --status # Compact dashboard
|
|
29755
|
+
$ bunx evil-omo doctor --verbose # Deep diagnostics
|
|
29756
|
+
$ bunx evil-omo doctor --json # JSON output
|
|
29695
29757
|
`).action(async (options) => {
|
|
29696
29758
|
const mode = options.status ? "status" : options.verbose ? "verbose" : "default";
|
|
29697
29759
|
const doctorOptions = {
|
|
@@ -29702,7 +29764,7 @@ Examples:
|
|
|
29702
29764
|
process.exit(exitCode);
|
|
29703
29765
|
});
|
|
29704
29766
|
program2.command("version").description("Show version information").action(() => {
|
|
29705
|
-
console.log(`
|
|
29767
|
+
console.log(`evil-omo v${VERSION2}`);
|
|
29706
29768
|
});
|
|
29707
29769
|
program2.addCommand(createMcpOAuthCommand());
|
|
29708
29770
|
function runCli() {
|