oh-my-opencode-gpt-slim 0.1.2 → 0.1.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.md +2 -2
- package/README.zh-cn.md +2 -2
- package/dist/agents/dynamic-agent-prompt-builder.d.ts +9 -1
- package/dist/agents/sisyphus/gpt-5-4.d.ts +1 -1
- package/dist/agents/sisyphus.d.ts +2 -2
- package/dist/cli/doctor/checks/config-validation.d.ts +10 -0
- package/dist/cli/index.js +264 -245
- package/dist/cli/run/event-state.d.ts +2 -0
- package/dist/cli/run/output-renderer.d.ts +2 -1
- package/dist/cli/run/types.d.ts +1 -0
- package/dist/index.js +686 -513
- package/dist/shared/agent-variant.d.ts +4 -0
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/omo-config-file.d.ts +5 -0
- package/package.json +10 -10
package/dist/cli/index.js
CHANGED
|
@@ -2145,7 +2145,7 @@ var package_default;
|
|
|
2145
2145
|
var init_package = __esm(() => {
|
|
2146
2146
|
package_default = {
|
|
2147
2147
|
name: "oh-my-opencode-gpt-slim",
|
|
2148
|
-
version: "0.1.
|
|
2148
|
+
version: "0.1.4",
|
|
2149
2149
|
description: "GPT-optimized lean fork of oh-my-openagent \u2014 33 hooks removed, 5 tools removed, Sisyphus prompt rewritten based on OpenAI Codex prompt.md",
|
|
2150
2150
|
main: "dist/index.js",
|
|
2151
2151
|
types: "dist/index.d.ts",
|
|
@@ -2223,15 +2223,15 @@ var init_package = __esm(() => {
|
|
|
2223
2223
|
typescript: "^5.7.3"
|
|
2224
2224
|
},
|
|
2225
2225
|
optionalDependencies: {
|
|
2226
|
-
"oh-my-opencode-gpt-slim-darwin-arm64": "0.1.
|
|
2227
|
-
"oh-my-opencode-gpt-slim-darwin-x64": "0.1.
|
|
2228
|
-
"oh-my-opencode-gpt-slim-darwin-x64-baseline": "0.1.
|
|
2229
|
-
"oh-my-opencode-gpt-slim-linux-arm64": "0.1.
|
|
2230
|
-
"oh-my-opencode-gpt-slim-linux-arm64-musl": "0.1.
|
|
2231
|
-
"oh-my-opencode-gpt-slim-linux-x64": "0.1.
|
|
2232
|
-
"oh-my-opencode-gpt-slim-linux-x64-baseline": "0.1.
|
|
2233
|
-
"oh-my-opencode-gpt-slim-linux-x64-musl": "0.1.
|
|
2234
|
-
"oh-my-opencode-gpt-slim-linux-x64-musl-baseline": "0.1.
|
|
2226
|
+
"oh-my-opencode-gpt-slim-darwin-arm64": "0.1.4",
|
|
2227
|
+
"oh-my-opencode-gpt-slim-darwin-x64": "0.1.4",
|
|
2228
|
+
"oh-my-opencode-gpt-slim-darwin-x64-baseline": "0.1.4",
|
|
2229
|
+
"oh-my-opencode-gpt-slim-linux-arm64": "0.1.4",
|
|
2230
|
+
"oh-my-opencode-gpt-slim-linux-arm64-musl": "0.1.4",
|
|
2231
|
+
"oh-my-opencode-gpt-slim-linux-x64": "0.1.4",
|
|
2232
|
+
"oh-my-opencode-gpt-slim-linux-x64-baseline": "0.1.4",
|
|
2233
|
+
"oh-my-opencode-gpt-slim-linux-x64-musl": "0.1.4",
|
|
2234
|
+
"oh-my-opencode-gpt-slim-linux-x64-musl-baseline": "0.1.4"
|
|
2235
2235
|
},
|
|
2236
2236
|
overrides: {
|
|
2237
2237
|
"@opencode-ai/sdk": "^1.2.17"
|
|
@@ -2451,11 +2451,10 @@ function getPluginEntrySource(entry) {
|
|
|
2451
2451
|
return "github";
|
|
2452
2452
|
return "package";
|
|
2453
2453
|
}
|
|
2454
|
-
var LEGACY_PLUGIN_PACKAGE_NAME = "oh-my-opencode", PLUGIN_PACKAGE_NAME,
|
|
2454
|
+
var LEGACY_PLUGIN_PACKAGE_NAME = "oh-my-opencode", PLUGIN_PACKAGE_NAME, rawRepositoryUrl, PLUGIN_REPOSITORY_URL, PLUGIN_GITHUB_REPOSITORY, CURRENT_PLUGIN_PREFIXES, LEGACY_PLUGIN_PREFIXES, FILE_REFERENCE_TOKENS;
|
|
2455
2455
|
var init_plugin_reference = __esm(() => {
|
|
2456
2456
|
init_package();
|
|
2457
2457
|
PLUGIN_PACKAGE_NAME = package_default.name;
|
|
2458
|
-
CONFIG_BASENAME = PLUGIN_PACKAGE_NAME;
|
|
2459
2458
|
rawRepositoryUrl = typeof package_default.repository === "string" ? package_default.repository : package_default.repository.url;
|
|
2460
2459
|
PLUGIN_REPOSITORY_URL = rawRepositoryUrl.replace(/^git\+/, "");
|
|
2461
2460
|
PLUGIN_GITHUB_REPOSITORY = PLUGIN_REPOSITORY_URL.replace(/^https:\/\/github\.com\//, "").replace(/\.git$/, "");
|
|
@@ -6234,7 +6233,6 @@ var init_main = __esm(() => {
|
|
|
6234
6233
|
});
|
|
6235
6234
|
|
|
6236
6235
|
// src/shared/jsonc-parser.ts
|
|
6237
|
-
import { existsSync as existsSync4, readFileSync } from "fs";
|
|
6238
6236
|
function parseJsonc(content) {
|
|
6239
6237
|
const errors = [];
|
|
6240
6238
|
const result = parse2(content, errors, {
|
|
@@ -6247,21 +6245,24 @@ function parseJsonc(content) {
|
|
|
6247
6245
|
}
|
|
6248
6246
|
return result;
|
|
6249
6247
|
}
|
|
6250
|
-
function detectConfigFile(basePath) {
|
|
6251
|
-
const jsoncPath = `${basePath}.jsonc`;
|
|
6252
|
-
const jsonPath = `${basePath}.json`;
|
|
6253
|
-
if (existsSync4(jsoncPath)) {
|
|
6254
|
-
return { format: "jsonc", path: jsoncPath };
|
|
6255
|
-
}
|
|
6256
|
-
if (existsSync4(jsonPath)) {
|
|
6257
|
-
return { format: "json", path: jsonPath };
|
|
6258
|
-
}
|
|
6259
|
-
return { format: "none", path: jsonPath };
|
|
6260
|
-
}
|
|
6261
6248
|
var init_jsonc_parser = __esm(() => {
|
|
6262
6249
|
init_main();
|
|
6263
6250
|
});
|
|
6264
6251
|
|
|
6252
|
+
// src/shared/omo-config-file.ts
|
|
6253
|
+
import { join as join5 } from "path";
|
|
6254
|
+
function getOmoConfigFilePath(directory) {
|
|
6255
|
+
return join5(directory, OMO_CONFIG_FILENAME);
|
|
6256
|
+
}
|
|
6257
|
+
function getProjectOmoConfigFilePath(projectRoot) {
|
|
6258
|
+
return getOmoConfigFilePath(join5(projectRoot, ".opencode"));
|
|
6259
|
+
}
|
|
6260
|
+
function parseOmoConfigJson(content) {
|
|
6261
|
+
return JSON.parse(content);
|
|
6262
|
+
}
|
|
6263
|
+
var OMO_CONFIG_FILENAME = "oh-my-opencode-gpt-slim.json";
|
|
6264
|
+
var init_omo_config_file = () => {};
|
|
6265
|
+
|
|
6265
6266
|
// src/shared/migration/agent-names.ts
|
|
6266
6267
|
function migrateAgentNames(agents) {
|
|
6267
6268
|
const migrated = {};
|
|
@@ -6624,8 +6625,8 @@ var init_opencode_version = __esm(() => {
|
|
|
6624
6625
|
});
|
|
6625
6626
|
|
|
6626
6627
|
// src/shared/opencode-storage-detection.ts
|
|
6627
|
-
import { existsSync as
|
|
6628
|
-
import { join as
|
|
6628
|
+
import { existsSync as existsSync4 } from "fs";
|
|
6629
|
+
import { join as join6 } from "path";
|
|
6629
6630
|
function isSqliteBackend() {
|
|
6630
6631
|
if (cachedResult === true)
|
|
6631
6632
|
return true;
|
|
@@ -6633,8 +6634,8 @@ function isSqliteBackend() {
|
|
|
6633
6634
|
return false;
|
|
6634
6635
|
const check = () => {
|
|
6635
6636
|
const versionOk = isOpenCodeVersionAtLeast(OPENCODE_SQLITE_VERSION);
|
|
6636
|
-
const dbPath =
|
|
6637
|
-
return versionOk &&
|
|
6637
|
+
const dbPath = join6(getDataDir(), "opencode", "opencode.db");
|
|
6638
|
+
return versionOk && existsSync4(dbPath);
|
|
6638
6639
|
};
|
|
6639
6640
|
if (cachedResult === FALSE_PENDING_RETRY) {
|
|
6640
6641
|
const result2 = check();
|
|
@@ -6988,19 +6989,19 @@ var init_hook_message_injector = __esm(() => {
|
|
|
6988
6989
|
});
|
|
6989
6990
|
|
|
6990
6991
|
// src/shared/opencode-storage-paths.ts
|
|
6991
|
-
import { join as
|
|
6992
|
+
import { join as join7 } from "path";
|
|
6992
6993
|
var OPENCODE_STORAGE, MESSAGE_STORAGE, PART_STORAGE, SESSION_STORAGE;
|
|
6993
6994
|
var init_opencode_storage_paths = __esm(() => {
|
|
6994
6995
|
init_data_path();
|
|
6995
6996
|
OPENCODE_STORAGE = getOpenCodeStorageDir();
|
|
6996
|
-
MESSAGE_STORAGE =
|
|
6997
|
-
PART_STORAGE =
|
|
6998
|
-
SESSION_STORAGE =
|
|
6997
|
+
MESSAGE_STORAGE = join7(OPENCODE_STORAGE, "message");
|
|
6998
|
+
PART_STORAGE = join7(OPENCODE_STORAGE, "part");
|
|
6999
|
+
SESSION_STORAGE = join7(OPENCODE_STORAGE, "session");
|
|
6999
7000
|
});
|
|
7000
7001
|
|
|
7001
7002
|
// src/shared/opencode-message-dir.ts
|
|
7002
|
-
import { existsSync as
|
|
7003
|
-
import { join as
|
|
7003
|
+
import { existsSync as existsSync5, readdirSync } from "fs";
|
|
7004
|
+
import { join as join8 } from "path";
|
|
7004
7005
|
function getMessageDir(sessionID) {
|
|
7005
7006
|
if (!sessionID.startsWith("ses_"))
|
|
7006
7007
|
return null;
|
|
@@ -7008,16 +7009,16 @@ function getMessageDir(sessionID) {
|
|
|
7008
7009
|
return null;
|
|
7009
7010
|
if (isSqliteBackend())
|
|
7010
7011
|
return null;
|
|
7011
|
-
if (!
|
|
7012
|
+
if (!existsSync5(MESSAGE_STORAGE))
|
|
7012
7013
|
return null;
|
|
7013
|
-
const directPath =
|
|
7014
|
-
if (
|
|
7014
|
+
const directPath = join8(MESSAGE_STORAGE, sessionID);
|
|
7015
|
+
if (existsSync5(directPath)) {
|
|
7015
7016
|
return directPath;
|
|
7016
7017
|
}
|
|
7017
7018
|
try {
|
|
7018
7019
|
for (const dir of readdirSync(MESSAGE_STORAGE)) {
|
|
7019
|
-
const sessionPath =
|
|
7020
|
-
if (
|
|
7020
|
+
const sessionPath = join8(MESSAGE_STORAGE, dir, sessionID);
|
|
7021
|
+
if (existsSync5(sessionPath)) {
|
|
7021
7022
|
return sessionPath;
|
|
7022
7023
|
}
|
|
7023
7024
|
}
|
|
@@ -7328,6 +7329,7 @@ var init_shared = __esm(() => {
|
|
|
7328
7329
|
init_config_errors();
|
|
7329
7330
|
init_claude_config_dir();
|
|
7330
7331
|
init_jsonc_parser();
|
|
7332
|
+
init_omo_config_file();
|
|
7331
7333
|
init_migration();
|
|
7332
7334
|
init_opencode_config_dir();
|
|
7333
7335
|
init_opencode_version();
|
|
@@ -7361,7 +7363,7 @@ var init_shared = __esm(() => {
|
|
|
7361
7363
|
});
|
|
7362
7364
|
|
|
7363
7365
|
// src/cli/config-manager/parse-opencode-config-file.ts
|
|
7364
|
-
import { readFileSync
|
|
7366
|
+
import { readFileSync, statSync } from "fs";
|
|
7365
7367
|
function isEmptyOrWhitespace(content) {
|
|
7366
7368
|
return content.trim().length === 0;
|
|
7367
7369
|
}
|
|
@@ -7371,7 +7373,7 @@ function parseOpenCodeConfigFileWithError(path3) {
|
|
|
7371
7373
|
if (stat.size === 0) {
|
|
7372
7374
|
return { config: null, error: `Config file is empty: ${path3}. Delete it or add valid JSON content.` };
|
|
7373
7375
|
}
|
|
7374
|
-
const content =
|
|
7376
|
+
const content = readFileSync(path3, "utf-8");
|
|
7375
7377
|
if (isEmptyOrWhitespace(content)) {
|
|
7376
7378
|
return { config: null, error: `Config file contains only whitespace: ${path3}. Delete it or add valid JSON content.` };
|
|
7377
7379
|
}
|
|
@@ -7413,7 +7415,7 @@ var init_plugin_array_updater = __esm(() => {
|
|
|
7413
7415
|
});
|
|
7414
7416
|
|
|
7415
7417
|
// src/cli/config-manager/add-plugin-to-opencode-config.ts
|
|
7416
|
-
import { readFileSync as
|
|
7418
|
+
import { readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "fs";
|
|
7417
7419
|
async function addPluginToOpenCodeConfig(currentVersion) {
|
|
7418
7420
|
try {
|
|
7419
7421
|
ensureConfigDirectoryExists();
|
|
@@ -7448,7 +7450,7 @@ async function addPluginToOpenCodeConfig(currentVersion) {
|
|
|
7448
7450
|
}
|
|
7449
7451
|
config.plugin = plugins;
|
|
7450
7452
|
if (format2 === "jsonc") {
|
|
7451
|
-
const content =
|
|
7453
|
+
const content = readFileSync2(path3, "utf-8");
|
|
7452
7454
|
const pluginArrayRegex = /"plugin"\s*:\s*\[([\s\S]*?)\]/;
|
|
7453
7455
|
const match = content.match(pluginArrayRegex);
|
|
7454
7456
|
if (match) {
|
|
@@ -7887,7 +7889,7 @@ function deepMergeRecord(target, source) {
|
|
|
7887
7889
|
}
|
|
7888
7890
|
|
|
7889
7891
|
// src/cli/config-manager/write-omo-config.ts
|
|
7890
|
-
import { existsSync as
|
|
7892
|
+
import { existsSync as existsSync6, readFileSync as readFileSync3, statSync as statSync2, writeFileSync as writeFileSync3 } from "fs";
|
|
7891
7893
|
function isEmptyOrWhitespace2(content) {
|
|
7892
7894
|
return content.trim().length === 0;
|
|
7893
7895
|
}
|
|
@@ -7904,34 +7906,34 @@ function writeOmoConfig(installConfig) {
|
|
|
7904
7906
|
const omoConfigPath = getOmoConfigPath();
|
|
7905
7907
|
try {
|
|
7906
7908
|
const newConfig = generateOmoConfig(installConfig);
|
|
7907
|
-
if (
|
|
7909
|
+
if (existsSync6(omoConfigPath)) {
|
|
7908
7910
|
try {
|
|
7909
7911
|
const stat = statSync2(omoConfigPath);
|
|
7910
|
-
const content =
|
|
7912
|
+
const content = readFileSync3(omoConfigPath, "utf-8");
|
|
7911
7913
|
if (stat.size === 0 || isEmptyOrWhitespace2(content)) {
|
|
7912
|
-
writeFileSync3(omoConfigPath, JSON.stringify(newConfig, null, 2)
|
|
7914
|
+
writeFileSync3(omoConfigPath, `${JSON.stringify(newConfig, null, 2)}
|
|
7913
7915
|
`);
|
|
7914
7916
|
return { success: true, configPath: omoConfigPath };
|
|
7915
7917
|
}
|
|
7916
|
-
const existing =
|
|
7918
|
+
const existing = parseOmoConfigJson(content);
|
|
7917
7919
|
if (!existing || typeof existing !== "object" || Array.isArray(existing)) {
|
|
7918
|
-
writeFileSync3(omoConfigPath, JSON.stringify(newConfig, null, 2)
|
|
7920
|
+
writeFileSync3(omoConfigPath, `${JSON.stringify(newConfig, null, 2)}
|
|
7919
7921
|
`);
|
|
7920
7922
|
return { success: true, configPath: omoConfigPath };
|
|
7921
7923
|
}
|
|
7922
7924
|
const merged = deepMergeRecord(newConfig, existing);
|
|
7923
|
-
writeFileSync3(omoConfigPath, JSON.stringify(merged, null, 2)
|
|
7925
|
+
writeFileSync3(omoConfigPath, `${JSON.stringify(merged, null, 2)}
|
|
7924
7926
|
`);
|
|
7925
7927
|
} catch (parseErr) {
|
|
7926
7928
|
if (parseErr instanceof SyntaxError) {
|
|
7927
|
-
writeFileSync3(omoConfigPath, JSON.stringify(newConfig, null, 2)
|
|
7929
|
+
writeFileSync3(omoConfigPath, `${JSON.stringify(newConfig, null, 2)}
|
|
7928
7930
|
`);
|
|
7929
7931
|
return { success: true, configPath: omoConfigPath };
|
|
7930
7932
|
}
|
|
7931
7933
|
throw parseErr;
|
|
7932
7934
|
}
|
|
7933
7935
|
} else {
|
|
7934
|
-
writeFileSync3(omoConfigPath, JSON.stringify(newConfig, null, 2)
|
|
7936
|
+
writeFileSync3(omoConfigPath, `${JSON.stringify(newConfig, null, 2)}
|
|
7935
7937
|
`);
|
|
7936
7938
|
}
|
|
7937
7939
|
return { success: true, configPath: omoConfigPath };
|
|
@@ -8047,17 +8049,27 @@ var init_opencode_binary = __esm(() => {
|
|
|
8047
8049
|
});
|
|
8048
8050
|
|
|
8049
8051
|
// src/cli/config-manager/detect-current-config.ts
|
|
8050
|
-
import { existsSync as
|
|
8052
|
+
import { existsSync as existsSync7, readFileSync as readFileSync4 } from "fs";
|
|
8051
8053
|
function detectProvidersFromOmoConfig() {
|
|
8052
8054
|
const omoConfigPath = getOmoConfigPath();
|
|
8053
|
-
if (!
|
|
8054
|
-
return {
|
|
8055
|
+
if (!existsSync7(omoConfigPath)) {
|
|
8056
|
+
return {
|
|
8057
|
+
hasOpenAI: true,
|
|
8058
|
+
hasOpencodeZen: true,
|
|
8059
|
+
hasZaiCodingPlan: false,
|
|
8060
|
+
hasKimiForCoding: false
|
|
8061
|
+
};
|
|
8055
8062
|
}
|
|
8056
8063
|
try {
|
|
8057
|
-
const content =
|
|
8058
|
-
const omoConfig =
|
|
8064
|
+
const content = readFileSync4(omoConfigPath, "utf-8");
|
|
8065
|
+
const omoConfig = parseOmoConfigJson(content);
|
|
8059
8066
|
if (!omoConfig || typeof omoConfig !== "object") {
|
|
8060
|
-
return {
|
|
8067
|
+
return {
|
|
8068
|
+
hasOpenAI: true,
|
|
8069
|
+
hasOpencodeZen: true,
|
|
8070
|
+
hasZaiCodingPlan: false,
|
|
8071
|
+
hasKimiForCoding: false
|
|
8072
|
+
};
|
|
8061
8073
|
}
|
|
8062
8074
|
const configStr = JSON.stringify(omoConfig);
|
|
8063
8075
|
const hasOpenAI = configStr.includes('"openai/');
|
|
@@ -8066,7 +8078,12 @@ function detectProvidersFromOmoConfig() {
|
|
|
8066
8078
|
const hasKimiForCoding = configStr.includes('"kimi-for-coding/');
|
|
8067
8079
|
return { hasOpenAI, hasOpencodeZen, hasZaiCodingPlan, hasKimiForCoding };
|
|
8068
8080
|
} catch {
|
|
8069
|
-
return {
|
|
8081
|
+
return {
|
|
8082
|
+
hasOpenAI: true,
|
|
8083
|
+
hasOpencodeZen: true,
|
|
8084
|
+
hasZaiCodingPlan: false,
|
|
8085
|
+
hasKimiForCoding: false
|
|
8086
|
+
};
|
|
8070
8087
|
}
|
|
8071
8088
|
}
|
|
8072
8089
|
function detectCurrentConfig() {
|
|
@@ -8105,15 +8122,15 @@ function detectCurrentConfig() {
|
|
|
8105
8122
|
return result;
|
|
8106
8123
|
}
|
|
8107
8124
|
var init_detect_current_config = __esm(() => {
|
|
8108
|
-
|
|
8125
|
+
init_omo_config_file();
|
|
8109
8126
|
init_plugin_reference();
|
|
8110
|
-
|
|
8127
|
+
init_config_context();
|
|
8111
8128
|
init_opencode_config_format();
|
|
8112
8129
|
init_parse_opencode_config_file();
|
|
8113
8130
|
});
|
|
8114
8131
|
|
|
8115
8132
|
// src/cli/config-manager/bun-install.ts
|
|
8116
|
-
import { existsSync as
|
|
8133
|
+
import { existsSync as existsSync8 } from "fs";
|
|
8117
8134
|
async function runBunInstall() {
|
|
8118
8135
|
const result = await runBunInstallWithDetails();
|
|
8119
8136
|
return result.success;
|
|
@@ -8121,7 +8138,7 @@ async function runBunInstall() {
|
|
|
8121
8138
|
async function runBunInstallWithDetails() {
|
|
8122
8139
|
const cacheDir = getOpenCodeCacheDir();
|
|
8123
8140
|
const packageJsonPath = `${cacheDir}/package.json`;
|
|
8124
|
-
if (!
|
|
8141
|
+
if (!existsSync8(packageJsonPath)) {
|
|
8125
8142
|
return {
|
|
8126
8143
|
success: false,
|
|
8127
8144
|
error: `Workspace not initialized: ${packageJsonPath} not found. OpenCode should create this on first run.`
|
|
@@ -8261,16 +8278,16 @@ var init_config_paths = __esm(() => {
|
|
|
8261
8278
|
});
|
|
8262
8279
|
|
|
8263
8280
|
// src/hooks/auto-update-checker/checker/plugin-entry.ts
|
|
8264
|
-
import { existsSync as
|
|
8281
|
+
import { existsSync as existsSync13, readFileSync as readFileSync9 } from "fs";
|
|
8265
8282
|
function isExplicitVersionPin(version2) {
|
|
8266
8283
|
return version2 !== null && /^\d+\.\d+\.\d+/.test(version2);
|
|
8267
8284
|
}
|
|
8268
8285
|
function findPluginEntry(directory) {
|
|
8269
8286
|
for (const configPath of getConfigPaths(directory)) {
|
|
8270
8287
|
try {
|
|
8271
|
-
if (!
|
|
8288
|
+
if (!existsSync13(configPath))
|
|
8272
8289
|
continue;
|
|
8273
|
-
const config2 = parseJsonc(
|
|
8290
|
+
const config2 = parseJsonc(readFileSync9(configPath, "utf-8"));
|
|
8274
8291
|
for (const entry of config2.plugin ?? []) {
|
|
8275
8292
|
if (!isManagedPluginEntry(entry))
|
|
8276
8293
|
continue;
|
|
@@ -8311,11 +8328,11 @@ var init_constants3 = __esm(() => {
|
|
|
8311
8328
|
});
|
|
8312
8329
|
|
|
8313
8330
|
// src/hooks/auto-update-checker/checker/cached-version.ts
|
|
8314
|
-
import { existsSync as
|
|
8331
|
+
import { existsSync as existsSync14, readFileSync as readFileSync10 } from "fs";
|
|
8315
8332
|
function getCachedVersion() {
|
|
8316
8333
|
try {
|
|
8317
|
-
if (
|
|
8318
|
-
const installedPackage = JSON.parse(
|
|
8334
|
+
if (existsSync14(INSTALLED_PACKAGE_JSON)) {
|
|
8335
|
+
const installedPackage = JSON.parse(readFileSync10(INSTALLED_PACKAGE_JSON, "utf-8"));
|
|
8319
8336
|
if (installedPackage.version)
|
|
8320
8337
|
return installedPackage.version;
|
|
8321
8338
|
}
|
|
@@ -8351,14 +8368,14 @@ var init_latest_version = __esm(() => {
|
|
|
8351
8368
|
});
|
|
8352
8369
|
|
|
8353
8370
|
// src/hooks/auto-update-checker/checker/local-dev-path.ts
|
|
8354
|
-
import { existsSync as
|
|
8371
|
+
import { existsSync as existsSync15, readFileSync as readFileSync11 } from "fs";
|
|
8355
8372
|
import { fileURLToPath } from "url";
|
|
8356
8373
|
function getLocalDevPath(directory) {
|
|
8357
8374
|
for (const configPath of getConfigPaths(directory)) {
|
|
8358
8375
|
try {
|
|
8359
|
-
if (!
|
|
8376
|
+
if (!existsSync15(configPath))
|
|
8360
8377
|
continue;
|
|
8361
|
-
const config2 = parseJsonc(
|
|
8378
|
+
const config2 = parseJsonc(readFileSync11(configPath, "utf-8"));
|
|
8362
8379
|
for (const entry of config2.plugin ?? []) {
|
|
8363
8380
|
if (!isManagedPluginEntry(entry))
|
|
8364
8381
|
continue;
|
|
@@ -8386,13 +8403,13 @@ var init_local_dev_path = __esm(() => {
|
|
|
8386
8403
|
});
|
|
8387
8404
|
|
|
8388
8405
|
// src/hooks/auto-update-checker/checker/local-dev-version.ts
|
|
8389
|
-
import { existsSync as
|
|
8406
|
+
import { existsSync as existsSync16, readFileSync as readFileSync12 } from "fs";
|
|
8390
8407
|
import { dirname as dirname3, join as join15 } from "path";
|
|
8391
8408
|
function findPackageJsonUp(startPath) {
|
|
8392
8409
|
let current = startPath;
|
|
8393
8410
|
while (true) {
|
|
8394
8411
|
const candidate = join15(current, "package.json");
|
|
8395
|
-
if (
|
|
8412
|
+
if (existsSync16(candidate))
|
|
8396
8413
|
return candidate;
|
|
8397
8414
|
const parent = dirname3(current);
|
|
8398
8415
|
if (parent === current)
|
|
@@ -8408,7 +8425,7 @@ function getLocalDevVersion(directory) {
|
|
|
8408
8425
|
const packageJsonPath = findPackageJsonUp(localPath);
|
|
8409
8426
|
if (!packageJsonPath)
|
|
8410
8427
|
return null;
|
|
8411
|
-
const packageJson = JSON.parse(
|
|
8428
|
+
const packageJson = JSON.parse(readFileSync12(packageJsonPath, "utf-8"));
|
|
8412
8429
|
return packageJson.version ?? null;
|
|
8413
8430
|
} catch {
|
|
8414
8431
|
return null;
|
|
@@ -8515,10 +8532,10 @@ var init_checker = __esm(() => {
|
|
|
8515
8532
|
});
|
|
8516
8533
|
|
|
8517
8534
|
// src/hooks/auto-update-checker/cache.ts
|
|
8518
|
-
import { existsSync as
|
|
8535
|
+
import { existsSync as existsSync17, rmSync as rmSync3, unlinkSync } from "fs";
|
|
8519
8536
|
import { join as join16 } from "path";
|
|
8520
8537
|
function deleteLockfile(lockPath) {
|
|
8521
|
-
if (!
|
|
8538
|
+
if (!existsSync17(lockPath))
|
|
8522
8539
|
return false;
|
|
8523
8540
|
try {
|
|
8524
8541
|
unlinkSync(lockPath);
|
|
@@ -8534,7 +8551,7 @@ function invalidatePackage(packageName = PACKAGE_NAME) {
|
|
|
8534
8551
|
join16(USER_CONFIG_DIR, "node_modules", packageName),
|
|
8535
8552
|
join16(CACHE_DIR, "node_modules", packageName)
|
|
8536
8553
|
]) {
|
|
8537
|
-
if (!
|
|
8554
|
+
if (!existsSync17(packageDir))
|
|
8538
8555
|
continue;
|
|
8539
8556
|
rmSync3(packageDir, { recursive: true, force: true });
|
|
8540
8557
|
changed = true;
|
|
@@ -9669,6 +9686,7 @@ function createEventState() {
|
|
|
9669
9686
|
currentAgent: null,
|
|
9670
9687
|
currentModel: null,
|
|
9671
9688
|
currentVariant: null,
|
|
9689
|
+
currentReasoningEffort: null,
|
|
9672
9690
|
currentMessageRole: null,
|
|
9673
9691
|
agentColorsByName: {},
|
|
9674
9692
|
partTypesById: {},
|
|
@@ -9951,13 +9969,13 @@ var displayChars = {
|
|
|
9951
9969
|
|
|
9952
9970
|
// src/cli/run/output-renderer.ts
|
|
9953
9971
|
var import_picocolors6 = __toESM(require_picocolors(), 1);
|
|
9954
|
-
function renderAgentHeader(agent, model, variant, agentColorsByName) {
|
|
9972
|
+
function renderAgentHeader(agent, model, variant, reasoningEffort, agentColorsByName) {
|
|
9955
9973
|
if (!agent && !model)
|
|
9956
9974
|
return;
|
|
9957
9975
|
const agentLabel = agent ? import_picocolors6.default.bold(colorizeWithProfileColor(agent, agentColorsByName[agent])) : "";
|
|
9958
9976
|
const modelBase = model ?? "";
|
|
9959
|
-
const
|
|
9960
|
-
const modelLabel = model ? import_picocolors6.default.dim(`${modelBase}${
|
|
9977
|
+
const modelDetails = formatModelDetails(variant, reasoningEffort);
|
|
9978
|
+
const modelLabel = model ? import_picocolors6.default.dim(`${modelBase}${modelDetails}`) : "";
|
|
9961
9979
|
process.stdout.write(`
|
|
9962
9980
|
`);
|
|
9963
9981
|
if (modelLabel) {
|
|
@@ -9971,6 +9989,10 @@ function renderAgentHeader(agent, model, variant, agentColorsByName) {
|
|
|
9971
9989
|
process.stdout.write(`
|
|
9972
9990
|
`);
|
|
9973
9991
|
}
|
|
9992
|
+
function formatModelDetails(variant, reasoningEffort) {
|
|
9993
|
+
const details = [variant, reasoningEffort ? `effort: ${reasoningEffort}` : null].filter(Boolean);
|
|
9994
|
+
return details.length > 0 ? ` (${details.join(", ")})` : "";
|
|
9995
|
+
}
|
|
9974
9996
|
function openThinkBlock() {
|
|
9975
9997
|
process.stdout.write(`
|
|
9976
9998
|
${import_picocolors6.default.dim("\u2503 Thinking:")} `);
|
|
@@ -10049,9 +10071,9 @@ function renderCompletionMetaLine(state, messageID) {
|
|
|
10049
10071
|
const elapsedSec = startedAt ? ((Date.now() - startedAt) / 1000).toFixed(1) : "0.0";
|
|
10050
10072
|
const agent = state.currentAgent ?? "assistant";
|
|
10051
10073
|
const model = state.currentModel ?? "unknown-model";
|
|
10052
|
-
const
|
|
10074
|
+
const modelDetails = formatModelDetails(state.currentVariant, state.currentReasoningEffort);
|
|
10053
10075
|
process.stdout.write(import_picocolors7.default.dim(`
|
|
10054
|
-
${displayChars.treeEnd} ${agent} \xB7 ${model}${
|
|
10076
|
+
${displayChars.treeEnd} ${agent} \xB7 ${model}${modelDetails} \xB7 ${elapsedSec}s
|
|
10055
10077
|
`));
|
|
10056
10078
|
state.completionMetaPrintedByMessageId[messageID] = true;
|
|
10057
10079
|
}
|
|
@@ -10237,11 +10259,13 @@ function handleMessageUpdated(ctx, payload, state) {
|
|
|
10237
10259
|
const agent = props?.info?.agent ?? null;
|
|
10238
10260
|
const model = props?.info?.modelID ?? null;
|
|
10239
10261
|
const variant = props?.info?.variant ?? null;
|
|
10240
|
-
|
|
10262
|
+
const reasoningEffort = props?.info?.reasoningEffort ?? null;
|
|
10263
|
+
if (agent !== state.currentAgent || model !== state.currentModel || variant !== state.currentVariant || reasoningEffort !== state.currentReasoningEffort) {
|
|
10241
10264
|
state.currentAgent = agent;
|
|
10242
10265
|
state.currentModel = model;
|
|
10243
10266
|
state.currentVariant = variant;
|
|
10244
|
-
|
|
10267
|
+
state.currentReasoningEffort = reasoningEffort;
|
|
10268
|
+
renderAgentHeader(agent, model, variant, reasoningEffort, state.agentColorsByName);
|
|
10245
10269
|
}
|
|
10246
10270
|
}
|
|
10247
10271
|
function handleToolExecute(ctx, payload, state) {
|
|
@@ -10349,7 +10373,6 @@ async function processEvents(ctx, stream, state) {
|
|
|
10349
10373
|
}
|
|
10350
10374
|
// src/plugin-config.ts
|
|
10351
10375
|
import * as fs3 from "fs";
|
|
10352
|
-
import * as path3 from "path";
|
|
10353
10376
|
|
|
10354
10377
|
// node_modules/zod/v4/classic/external.js
|
|
10355
10378
|
var exports_external = {};
|
|
@@ -24309,7 +24332,9 @@ function parseConfigPartially(rawConfig) {
|
|
|
24309
24332
|
const partialConfig = {};
|
|
24310
24333
|
const invalidSections = [];
|
|
24311
24334
|
for (const key of Object.keys(rawConfig)) {
|
|
24312
|
-
const sectionResult = OhMyOpenCodeConfigSchema.safeParse({
|
|
24335
|
+
const sectionResult = OhMyOpenCodeConfigSchema.safeParse({
|
|
24336
|
+
[key]: rawConfig[key]
|
|
24337
|
+
});
|
|
24313
24338
|
if (sectionResult.success) {
|
|
24314
24339
|
const parsed = sectionResult.data;
|
|
24315
24340
|
if (parsed[key] !== undefined) {
|
|
@@ -24331,7 +24356,7 @@ function loadConfigFromPath(configPath, _ctx) {
|
|
|
24331
24356
|
try {
|
|
24332
24357
|
if (fs3.existsSync(configPath)) {
|
|
24333
24358
|
const content = fs3.readFileSync(configPath, "utf-8");
|
|
24334
|
-
const rawConfig =
|
|
24359
|
+
const rawConfig = parseOmoConfigJson(content);
|
|
24335
24360
|
migrateConfigFile(configPath, rawConfig);
|
|
24336
24361
|
const result = OhMyOpenCodeConfigSchema.safeParse(rawConfig);
|
|
24337
24362
|
if (result.success) {
|
|
@@ -24346,7 +24371,9 @@ function loadConfigFromPath(configPath, _ctx) {
|
|
|
24346
24371
|
});
|
|
24347
24372
|
const partialResult = parseConfigPartially(rawConfig);
|
|
24348
24373
|
if (partialResult) {
|
|
24349
|
-
log(`Partial config loaded from ${configPath}`, {
|
|
24374
|
+
log(`Partial config loaded from ${configPath}`, {
|
|
24375
|
+
agents: partialResult.agents
|
|
24376
|
+
});
|
|
24350
24377
|
return partialResult;
|
|
24351
24378
|
}
|
|
24352
24379
|
return null;
|
|
@@ -24398,13 +24425,11 @@ function mergeConfigs(base, override) {
|
|
|
24398
24425
|
};
|
|
24399
24426
|
}
|
|
24400
24427
|
function loadPluginConfig(directory, ctx) {
|
|
24401
|
-
const
|
|
24402
|
-
|
|
24403
|
-
|
|
24404
|
-
|
|
24405
|
-
const
|
|
24406
|
-
const projectDetected = detectConfigFile(projectBasePath);
|
|
24407
|
-
const projectConfigPath = projectDetected.format !== "none" ? projectDetected.path : projectBasePath + ".json";
|
|
24428
|
+
const userConfigPath = getOpenCodeConfigPaths({
|
|
24429
|
+
binary: "opencode",
|
|
24430
|
+
version: null
|
|
24431
|
+
}).omoConfig;
|
|
24432
|
+
const projectConfigPath = getProjectOmoConfigFilePath(directory);
|
|
24408
24433
|
let config2 = loadConfigFromPath(userConfigPath, ctx) ?? {};
|
|
24409
24434
|
const projectConfig = loadConfigFromPath(projectConfigPath, ctx);
|
|
24410
24435
|
if (projectConfig) {
|
|
@@ -24656,7 +24681,7 @@ var serializeObjectParam = ({ allowReserved, explode, name, style, value, valueO
|
|
|
24656
24681
|
|
|
24657
24682
|
// node_modules/@opencode-ai/sdk/dist/gen/core/utils.gen.js
|
|
24658
24683
|
var PATH_PARAM_RE = /\{[^{}]+\}/g;
|
|
24659
|
-
var defaultPathSerializer = ({ path:
|
|
24684
|
+
var defaultPathSerializer = ({ path: path3, url: _url2 }) => {
|
|
24660
24685
|
let url2 = _url2;
|
|
24661
24686
|
const matches = _url2.match(PATH_PARAM_RE);
|
|
24662
24687
|
if (matches) {
|
|
@@ -24675,7 +24700,7 @@ var defaultPathSerializer = ({ path: path4, url: _url2 }) => {
|
|
|
24675
24700
|
name = name.substring(1);
|
|
24676
24701
|
style = "matrix";
|
|
24677
24702
|
}
|
|
24678
|
-
const value =
|
|
24703
|
+
const value = path3[name];
|
|
24679
24704
|
if (value === undefined || value === null) {
|
|
24680
24705
|
continue;
|
|
24681
24706
|
}
|
|
@@ -24706,11 +24731,11 @@ var defaultPathSerializer = ({ path: path4, url: _url2 }) => {
|
|
|
24706
24731
|
}
|
|
24707
24732
|
return url2;
|
|
24708
24733
|
};
|
|
24709
|
-
var getUrl = ({ baseUrl, path:
|
|
24734
|
+
var getUrl = ({ baseUrl, path: path3, query, querySerializer, url: _url2 }) => {
|
|
24710
24735
|
const pathUrl = _url2.startsWith("/") ? _url2 : `/${_url2}`;
|
|
24711
24736
|
let url2 = (baseUrl ?? "") + pathUrl;
|
|
24712
|
-
if (
|
|
24713
|
-
url2 = defaultPathSerializer({ path:
|
|
24737
|
+
if (path3) {
|
|
24738
|
+
url2 = defaultPathSerializer({ path: path3, url: url2 });
|
|
24714
24739
|
}
|
|
24715
24740
|
let search = query ? querySerializer(query) : "";
|
|
24716
24741
|
if (search.startsWith("?")) {
|
|
@@ -26205,18 +26230,18 @@ var BOULDER_STATE_PATH = `${BOULDER_DIR}/${BOULDER_FILE}`;
|
|
|
26205
26230
|
var NOTEPAD_DIR = "notepads";
|
|
26206
26231
|
var NOTEPAD_BASE_PATH = `${BOULDER_DIR}/${NOTEPAD_DIR}`;
|
|
26207
26232
|
// src/features/boulder-state/storage.ts
|
|
26208
|
-
import { existsSync as
|
|
26233
|
+
import { existsSync as existsSync10, readFileSync as readFileSync6, writeFileSync as writeFileSync4, mkdirSync as mkdirSync2, readdirSync as readdirSync2 } from "fs";
|
|
26209
26234
|
import { dirname as dirname2, join as join10, basename } from "path";
|
|
26210
26235
|
function getBoulderFilePath(directory) {
|
|
26211
26236
|
return join10(directory, BOULDER_DIR, BOULDER_FILE);
|
|
26212
26237
|
}
|
|
26213
26238
|
function readBoulderState(directory) {
|
|
26214
26239
|
const filePath = getBoulderFilePath(directory);
|
|
26215
|
-
if (!
|
|
26240
|
+
if (!existsSync10(filePath)) {
|
|
26216
26241
|
return null;
|
|
26217
26242
|
}
|
|
26218
26243
|
try {
|
|
26219
|
-
const content =
|
|
26244
|
+
const content = readFileSync6(filePath, "utf-8");
|
|
26220
26245
|
const parsed = JSON.parse(content);
|
|
26221
26246
|
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
26222
26247
|
return null;
|
|
@@ -26230,11 +26255,11 @@ function readBoulderState(directory) {
|
|
|
26230
26255
|
}
|
|
26231
26256
|
}
|
|
26232
26257
|
function getPlanProgress(planPath) {
|
|
26233
|
-
if (!
|
|
26258
|
+
if (!existsSync10(planPath)) {
|
|
26234
26259
|
return { total: 0, completed: 0, isComplete: true };
|
|
26235
26260
|
}
|
|
26236
26261
|
try {
|
|
26237
|
-
const content =
|
|
26262
|
+
const content = readFileSync6(planPath, "utf-8");
|
|
26238
26263
|
const uncheckedMatches = content.match(/^\s*[-*]\s*\[\s*\]/gm) || [];
|
|
26239
26264
|
const checkedMatches = content.match(/^\s*[-*]\s*\[[xX]\]/gm) || [];
|
|
26240
26265
|
const total = uncheckedMatches.length + checkedMatches.length;
|
|
@@ -26251,17 +26276,17 @@ function getPlanProgress(planPath) {
|
|
|
26251
26276
|
// src/features/run-continuation-state/constants.ts
|
|
26252
26277
|
var CONTINUATION_MARKER_DIR = ".sisyphus/run-continuation";
|
|
26253
26278
|
// src/features/run-continuation-state/storage.ts
|
|
26254
|
-
import { existsSync as
|
|
26279
|
+
import { existsSync as existsSync11, mkdirSync as mkdirSync3, readFileSync as readFileSync7, rmSync, writeFileSync as writeFileSync5 } from "fs";
|
|
26255
26280
|
import { join as join11 } from "path";
|
|
26256
26281
|
function getMarkerPath(directory, sessionID) {
|
|
26257
26282
|
return join11(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
|
|
26258
26283
|
}
|
|
26259
26284
|
function readContinuationMarker(directory, sessionID) {
|
|
26260
26285
|
const markerPath = getMarkerPath(directory, sessionID);
|
|
26261
|
-
if (!
|
|
26286
|
+
if (!existsSync11(markerPath))
|
|
26262
26287
|
return null;
|
|
26263
26288
|
try {
|
|
26264
|
-
const raw =
|
|
26289
|
+
const raw = readFileSync7(markerPath, "utf-8");
|
|
26265
26290
|
const parsed = JSON.parse(raw);
|
|
26266
26291
|
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
|
|
26267
26292
|
return null;
|
|
@@ -26285,17 +26310,17 @@ function getActiveContinuationMarkerReason(marker) {
|
|
|
26285
26310
|
return entry.reason ?? `${source} continuation is active`;
|
|
26286
26311
|
}
|
|
26287
26312
|
// src/hooks/ralph-loop/storage.ts
|
|
26288
|
-
import { existsSync as
|
|
26313
|
+
import { existsSync as existsSync12, mkdirSync as mkdirSync4, readFileSync as readFileSync8, rmSync as rmSync2, writeFileSync as writeFileSync6 } from "fs";
|
|
26289
26314
|
import { join as join12 } from "path";
|
|
26290
26315
|
function getStatePath(directory) {
|
|
26291
26316
|
return join12(directory, ".sisyphus", "ralph-loop-state.json");
|
|
26292
26317
|
}
|
|
26293
26318
|
function readState(directory) {
|
|
26294
26319
|
const statePath = getStatePath(directory);
|
|
26295
|
-
if (!
|
|
26320
|
+
if (!existsSync12(statePath))
|
|
26296
26321
|
return null;
|
|
26297
26322
|
try {
|
|
26298
|
-
return JSON.parse(
|
|
26323
|
+
return JSON.parse(readFileSync8(statePath, "utf-8"));
|
|
26299
26324
|
} catch {
|
|
26300
26325
|
return null;
|
|
26301
26326
|
}
|
|
@@ -26982,17 +27007,16 @@ var EXIT_CODES = {
|
|
|
26982
27007
|
FAILURE: 1
|
|
26983
27008
|
};
|
|
26984
27009
|
var MIN_OPENCODE_VERSION = "1.0.150";
|
|
26985
|
-
var CONFIG_BASENAME2 = "oh-my-opencode-gpt-slim";
|
|
26986
27010
|
var OPENCODE_BINARIES2 = ["opencode", "opencode-desktop"];
|
|
26987
27011
|
|
|
26988
27012
|
// src/cli/doctor/checks/system.ts
|
|
26989
27013
|
init_plugin_reference();
|
|
26990
27014
|
init_jsonc_parser();
|
|
26991
|
-
import { existsSync as
|
|
27015
|
+
import { existsSync as existsSync21, readFileSync as readFileSync15 } from "fs";
|
|
26992
27016
|
|
|
26993
27017
|
// src/cli/doctor/checks/system-binary.ts
|
|
26994
27018
|
init_spawn_with_windows_hide();
|
|
26995
|
-
import { existsSync as
|
|
27019
|
+
import { existsSync as existsSync18 } from "fs";
|
|
26996
27020
|
import { homedir as homedir4 } from "os";
|
|
26997
27021
|
import { join as join17 } from "path";
|
|
26998
27022
|
function getDesktopAppPaths(platform) {
|
|
@@ -27032,7 +27056,7 @@ function buildVersionCommand(binaryPath, platform) {
|
|
|
27032
27056
|
}
|
|
27033
27057
|
return [binaryPath, "--version"];
|
|
27034
27058
|
}
|
|
27035
|
-
function findDesktopBinary(platform = process.platform, checkExists =
|
|
27059
|
+
function findDesktopBinary(platform = process.platform, checkExists = existsSync18) {
|
|
27036
27060
|
for (const desktopPath of getDesktopAppPaths(platform)) {
|
|
27037
27061
|
if (checkExists(desktopPath)) {
|
|
27038
27062
|
return { binary: "opencode", path: desktopPath };
|
|
@@ -27042,9 +27066,9 @@ function findDesktopBinary(platform = process.platform, checkExists = existsSync
|
|
|
27042
27066
|
}
|
|
27043
27067
|
async function findOpenCodeBinary() {
|
|
27044
27068
|
for (const binary2 of OPENCODE_BINARIES2) {
|
|
27045
|
-
const
|
|
27046
|
-
if (
|
|
27047
|
-
return { binary: binary2, path:
|
|
27069
|
+
const path3 = Bun.which(binary2);
|
|
27070
|
+
if (path3) {
|
|
27071
|
+
return { binary: binary2, path: path3 };
|
|
27048
27072
|
}
|
|
27049
27073
|
}
|
|
27050
27074
|
return findDesktopBinary();
|
|
@@ -27084,7 +27108,7 @@ init_auto_update_checker();
|
|
|
27084
27108
|
init_plugin_reference();
|
|
27085
27109
|
init_data_path();
|
|
27086
27110
|
init_jsonc_parser();
|
|
27087
|
-
import { existsSync as
|
|
27111
|
+
import { existsSync as existsSync19, readFileSync as readFileSync13 } from "fs";
|
|
27088
27112
|
import { homedir as homedir5 } from "os";
|
|
27089
27113
|
import { join as join18 } from "path";
|
|
27090
27114
|
function getPlatformDefaultCacheDir(platform = process.platform) {
|
|
@@ -27100,15 +27124,15 @@ function resolveOpenCodeCacheDir() {
|
|
|
27100
27124
|
return join18(xdgCacheHome, "opencode");
|
|
27101
27125
|
const fromShared = getOpenCodeCacheDir();
|
|
27102
27126
|
const platformDefault = join18(getPlatformDefaultCacheDir(), "opencode");
|
|
27103
|
-
if (
|
|
27127
|
+
if (existsSync19(fromShared) || !existsSync19(platformDefault))
|
|
27104
27128
|
return fromShared;
|
|
27105
27129
|
return platformDefault;
|
|
27106
27130
|
}
|
|
27107
27131
|
function readPackageJson(filePath) {
|
|
27108
|
-
if (!
|
|
27132
|
+
if (!existsSync19(filePath))
|
|
27109
27133
|
return null;
|
|
27110
27134
|
try {
|
|
27111
|
-
const content =
|
|
27135
|
+
const content = readFileSync13(filePath, "utf-8");
|
|
27112
27136
|
return parseJsonc(content);
|
|
27113
27137
|
} catch {
|
|
27114
27138
|
return null;
|
|
@@ -27148,12 +27172,12 @@ function getSuggestedInstallTag(currentVersion) {
|
|
|
27148
27172
|
init_plugin_reference();
|
|
27149
27173
|
init_opencode_config_dir();
|
|
27150
27174
|
init_jsonc_parser();
|
|
27151
|
-
import { existsSync as
|
|
27175
|
+
import { existsSync as existsSync20, readFileSync as readFileSync14 } from "fs";
|
|
27152
27176
|
function detectConfigPath() {
|
|
27153
27177
|
const paths = getOpenCodeConfigPaths({ binary: "opencode", version: null });
|
|
27154
|
-
if (
|
|
27178
|
+
if (existsSync20(paths.configJsonc))
|
|
27155
27179
|
return paths.configJsonc;
|
|
27156
|
-
if (
|
|
27180
|
+
if (existsSync20(paths.configJson))
|
|
27157
27181
|
return paths.configJson;
|
|
27158
27182
|
return null;
|
|
27159
27183
|
}
|
|
@@ -27180,7 +27204,7 @@ function getPluginInfo() {
|
|
|
27180
27204
|
};
|
|
27181
27205
|
}
|
|
27182
27206
|
try {
|
|
27183
|
-
const content =
|
|
27207
|
+
const content = readFileSync14(configPath, "utf-8");
|
|
27184
27208
|
const parsedConfig = parseJsonc(content);
|
|
27185
27209
|
const pluginEntry = findPluginEntry2(parsedConfig.plugin ?? []);
|
|
27186
27210
|
if (!pluginEntry) {
|
|
@@ -27221,10 +27245,10 @@ function getPluginInfo() {
|
|
|
27221
27245
|
function isConfigValid(configPath) {
|
|
27222
27246
|
if (!configPath)
|
|
27223
27247
|
return true;
|
|
27224
|
-
if (!
|
|
27248
|
+
if (!existsSync21(configPath))
|
|
27225
27249
|
return false;
|
|
27226
27250
|
try {
|
|
27227
|
-
parseJsonc(
|
|
27251
|
+
parseJsonc(readFileSync15(configPath, "utf-8"));
|
|
27228
27252
|
return true;
|
|
27229
27253
|
} catch {
|
|
27230
27254
|
return false;
|
|
@@ -27327,11 +27351,56 @@ async function checkSystem() {
|
|
|
27327
27351
|
}
|
|
27328
27352
|
|
|
27329
27353
|
// src/cli/doctor/checks/config.ts
|
|
27330
|
-
import { existsSync as existsSync24, readFileSync as readFileSync19 } from "fs";
|
|
27331
|
-
import { join as join22 } from "path";
|
|
27332
27354
|
init_data_path();
|
|
27355
|
+
import { existsSync as existsSync24, readFileSync as readFileSync19 } from "fs";
|
|
27356
|
+
import { join as join21 } from "path";
|
|
27357
|
+
|
|
27358
|
+
// src/cli/doctor/checks/config-validation.ts
|
|
27359
|
+
import { existsSync as existsSync22, readFileSync as readFileSync16 } from "fs";
|
|
27360
|
+
init_omo_config_file();
|
|
27333
27361
|
init_opencode_config_dir();
|
|
27334
|
-
|
|
27362
|
+
var USER_CONFIG_PATH = getOmoConfigFilePath(getOpenCodeConfigDir({ binary: "opencode" }));
|
|
27363
|
+
var PROJECT_CONFIG_PATH = getProjectOmoConfigFilePath(process.cwd());
|
|
27364
|
+
function findConfigPath() {
|
|
27365
|
+
if (existsSync22(PROJECT_CONFIG_PATH)) {
|
|
27366
|
+
return PROJECT_CONFIG_PATH;
|
|
27367
|
+
}
|
|
27368
|
+
if (existsSync22(USER_CONFIG_PATH)) {
|
|
27369
|
+
return USER_CONFIG_PATH;
|
|
27370
|
+
}
|
|
27371
|
+
return null;
|
|
27372
|
+
}
|
|
27373
|
+
function validateConfig() {
|
|
27374
|
+
const configPath = findConfigPath();
|
|
27375
|
+
if (!configPath) {
|
|
27376
|
+
return { exists: false, path: null, valid: true, config: null, errors: [] };
|
|
27377
|
+
}
|
|
27378
|
+
try {
|
|
27379
|
+
const rawConfig = parseOmoConfigJson(readFileSync16(configPath, "utf-8"));
|
|
27380
|
+
const schemaResult = OhMyOpenCodeConfigSchema.safeParse(rawConfig);
|
|
27381
|
+
if (!schemaResult.success) {
|
|
27382
|
+
return {
|
|
27383
|
+
exists: true,
|
|
27384
|
+
path: configPath,
|
|
27385
|
+
valid: false,
|
|
27386
|
+
config: rawConfig,
|
|
27387
|
+
errors: schemaResult.error.issues.map((issue2) => `${issue2.path.join(".")}: ${issue2.message}`)
|
|
27388
|
+
};
|
|
27389
|
+
}
|
|
27390
|
+
return { exists: true, path: configPath, valid: true, config: rawConfig, errors: [] };
|
|
27391
|
+
} catch (error48) {
|
|
27392
|
+
return {
|
|
27393
|
+
exists: true,
|
|
27394
|
+
path: configPath,
|
|
27395
|
+
valid: false,
|
|
27396
|
+
config: null,
|
|
27397
|
+
errors: [error48 instanceof Error ? error48.message : "Failed to parse config"]
|
|
27398
|
+
};
|
|
27399
|
+
}
|
|
27400
|
+
}
|
|
27401
|
+
|
|
27402
|
+
// src/cli/doctor/checks/model-resolution.ts
|
|
27403
|
+
init_model_requirements();
|
|
27335
27404
|
|
|
27336
27405
|
// src/cli/doctor/checks/model-resolution-cache.ts
|
|
27337
27406
|
init_shared();
|
|
@@ -27366,42 +27435,31 @@ function loadAvailableModelsFromCache() {
|
|
|
27366
27435
|
}
|
|
27367
27436
|
}
|
|
27368
27437
|
|
|
27369
|
-
// src/cli/doctor/checks/model-resolution.ts
|
|
27370
|
-
init_model_requirements();
|
|
27371
|
-
|
|
27372
27438
|
// src/cli/doctor/checks/model-resolution-config.ts
|
|
27373
|
-
|
|
27439
|
+
init_omo_config_file();
|
|
27374
27440
|
init_opencode_config_dir();
|
|
27375
|
-
init_jsonc_parser();
|
|
27376
27441
|
import { readFileSync as readFileSync18 } from "fs";
|
|
27377
|
-
|
|
27378
|
-
|
|
27379
|
-
|
|
27442
|
+
var USER_CONFIG_PATH2 = getOpenCodeConfigPaths({
|
|
27443
|
+
binary: "opencode",
|
|
27444
|
+
version: null
|
|
27445
|
+
}).omoConfig;
|
|
27446
|
+
var PROJECT_CONFIG_PATH2 = getProjectOmoConfigFilePath(process.cwd());
|
|
27380
27447
|
function loadOmoConfig() {
|
|
27381
|
-
|
|
27382
|
-
|
|
27383
|
-
|
|
27384
|
-
|
|
27385
|
-
|
|
27386
|
-
|
|
27387
|
-
|
|
27388
|
-
|
|
27389
|
-
|
|
27390
|
-
const userDetected = detectConfigFile(USER_CONFIG_BASE);
|
|
27391
|
-
if (userDetected.format !== "none") {
|
|
27392
|
-
try {
|
|
27393
|
-
const content = readFileSync18(userDetected.path, "utf-8");
|
|
27394
|
-
return parseJsonc(content);
|
|
27395
|
-
} catch {
|
|
27396
|
-
return null;
|
|
27397
|
-
}
|
|
27448
|
+
try {
|
|
27449
|
+
const content = readFileSync18(PROJECT_CONFIG_PATH2, "utf-8");
|
|
27450
|
+
return parseOmoConfigJson(content);
|
|
27451
|
+
} catch {}
|
|
27452
|
+
try {
|
|
27453
|
+
const content = readFileSync18(USER_CONFIG_PATH2, "utf-8");
|
|
27454
|
+
return parseOmoConfigJson(content);
|
|
27455
|
+
} catch {
|
|
27456
|
+
return null;
|
|
27398
27457
|
}
|
|
27399
|
-
return null;
|
|
27400
27458
|
}
|
|
27401
27459
|
|
|
27402
27460
|
// src/cli/doctor/checks/model-resolution-details.ts
|
|
27403
27461
|
init_shared();
|
|
27404
|
-
import { join as
|
|
27462
|
+
import { join as join20 } from "path";
|
|
27405
27463
|
|
|
27406
27464
|
// src/cli/doctor/checks/model-resolution-variant.ts
|
|
27407
27465
|
function formatModelWithVariant(model, variant) {
|
|
@@ -27440,7 +27498,7 @@ function getCategoryEffectiveVariant(categoryName, requirement, config2) {
|
|
|
27440
27498
|
// src/cli/doctor/checks/model-resolution-details.ts
|
|
27441
27499
|
function buildModelResolutionDetails(options) {
|
|
27442
27500
|
const details = [];
|
|
27443
|
-
const cacheFile =
|
|
27501
|
+
const cacheFile = join20(getOpenCodeCacheDir(), "models.json");
|
|
27444
27502
|
details.push("\u2550\u2550\u2550 Available Models (from cache) \u2550\u2550\u2550");
|
|
27445
27503
|
details.push("");
|
|
27446
27504
|
if (options.available.cacheExists) {
|
|
@@ -27552,55 +27610,15 @@ async function checkModels() {
|
|
|
27552
27610
|
}
|
|
27553
27611
|
|
|
27554
27612
|
// src/cli/doctor/checks/config.ts
|
|
27555
|
-
var USER_CONFIG_BASE2 = join22(getOpenCodeConfigDir({ binary: "opencode" }), CONFIG_BASENAME2);
|
|
27556
|
-
var PROJECT_CONFIG_BASE2 = join22(process.cwd(), ".opencode", CONFIG_BASENAME2);
|
|
27557
|
-
function findConfigPath() {
|
|
27558
|
-
const projectConfig = detectConfigFile(PROJECT_CONFIG_BASE2);
|
|
27559
|
-
if (projectConfig.format !== "none")
|
|
27560
|
-
return projectConfig.path;
|
|
27561
|
-
const userConfig = detectConfigFile(USER_CONFIG_BASE2);
|
|
27562
|
-
if (userConfig.format !== "none")
|
|
27563
|
-
return userConfig.path;
|
|
27564
|
-
return null;
|
|
27565
|
-
}
|
|
27566
|
-
function validateConfig() {
|
|
27567
|
-
const configPath = findConfigPath();
|
|
27568
|
-
if (!configPath) {
|
|
27569
|
-
return { exists: false, path: null, valid: true, config: null, errors: [] };
|
|
27570
|
-
}
|
|
27571
|
-
try {
|
|
27572
|
-
const content = readFileSync19(configPath, "utf-8");
|
|
27573
|
-
const rawConfig = parseJsonc(content);
|
|
27574
|
-
const schemaResult = OhMyOpenCodeConfigSchema.safeParse(rawConfig);
|
|
27575
|
-
if (!schemaResult.success) {
|
|
27576
|
-
return {
|
|
27577
|
-
exists: true,
|
|
27578
|
-
path: configPath,
|
|
27579
|
-
valid: false,
|
|
27580
|
-
config: rawConfig,
|
|
27581
|
-
errors: schemaResult.error.issues.map((issue2) => `${issue2.path.join(".")}: ${issue2.message}`)
|
|
27582
|
-
};
|
|
27583
|
-
}
|
|
27584
|
-
return { exists: true, path: configPath, valid: true, config: rawConfig, errors: [] };
|
|
27585
|
-
} catch (error48) {
|
|
27586
|
-
return {
|
|
27587
|
-
exists: true,
|
|
27588
|
-
path: configPath,
|
|
27589
|
-
valid: false,
|
|
27590
|
-
config: null,
|
|
27591
|
-
errors: [error48 instanceof Error ? error48.message : "Failed to parse config"]
|
|
27592
|
-
};
|
|
27593
|
-
}
|
|
27594
|
-
}
|
|
27595
27613
|
function loadKnownProviderIds() {
|
|
27596
27614
|
const availableModels = loadAvailableModelsFromCache();
|
|
27597
27615
|
const providers = new Set(availableModels.providers);
|
|
27598
27616
|
const cacheDirs = [
|
|
27599
|
-
|
|
27600
|
-
|
|
27617
|
+
join21(getCacheDir(), "oh-my-opencode-gpt-slim"),
|
|
27618
|
+
join21(getCacheDir(), "oh-my-opencode")
|
|
27601
27619
|
];
|
|
27602
27620
|
for (const cacheDir of cacheDirs) {
|
|
27603
|
-
const providerModelsPath =
|
|
27621
|
+
const providerModelsPath = join21(cacheDir, "provider-models.json");
|
|
27604
27622
|
if (existsSync24(providerModelsPath)) {
|
|
27605
27623
|
try {
|
|
27606
27624
|
const content = readFileSync19(providerModelsPath, "utf-8");
|
|
@@ -27610,7 +27628,7 @@ function loadKnownProviderIds() {
|
|
|
27610
27628
|
}
|
|
27611
27629
|
} catch {}
|
|
27612
27630
|
}
|
|
27613
|
-
const connectedProvidersPath =
|
|
27631
|
+
const connectedProvidersPath = join21(cacheDir, "connected-providers.json");
|
|
27614
27632
|
if (existsSync24(connectedProvidersPath)) {
|
|
27615
27633
|
try {
|
|
27616
27634
|
const content = readFileSync19(connectedProvidersPath, "utf-8");
|
|
@@ -27705,12 +27723,12 @@ async function checkConfig() {
|
|
|
27705
27723
|
init_spawn_with_windows_hide();
|
|
27706
27724
|
import { existsSync as existsSync25 } from "fs";
|
|
27707
27725
|
import { createRequire } from "module";
|
|
27708
|
-
import { dirname as dirname4, join as
|
|
27726
|
+
import { dirname as dirname4, join as join22 } from "path";
|
|
27709
27727
|
async function checkBinaryExists(binary2) {
|
|
27710
27728
|
try {
|
|
27711
|
-
const
|
|
27712
|
-
if (
|
|
27713
|
-
return { exists: true, path:
|
|
27729
|
+
const path3 = Bun.which(binary2);
|
|
27730
|
+
if (path3) {
|
|
27731
|
+
return { exists: true, path: path3 };
|
|
27714
27732
|
}
|
|
27715
27733
|
} catch {}
|
|
27716
27734
|
return { exists: false, path: null };
|
|
@@ -27762,11 +27780,11 @@ async function checkAstGrepNapi() {
|
|
|
27762
27780
|
};
|
|
27763
27781
|
} catch {
|
|
27764
27782
|
const { existsSync: existsSync26 } = await import("fs");
|
|
27765
|
-
const { join:
|
|
27783
|
+
const { join: join23 } = await import("path");
|
|
27766
27784
|
const { homedir: homedir7 } = await import("os");
|
|
27767
27785
|
const pathsToCheck = [
|
|
27768
|
-
|
|
27769
|
-
|
|
27786
|
+
join23(homedir7(), ".config", "opencode", "node_modules", "@ast-grep", "napi"),
|
|
27787
|
+
join23(process.cwd(), "node_modules", "@ast-grep", "napi")
|
|
27770
27788
|
];
|
|
27771
27789
|
for (const napiPath of pathsToCheck) {
|
|
27772
27790
|
if (existsSync26(napiPath)) {
|
|
@@ -27794,7 +27812,7 @@ function findCommentCheckerPackageBinary() {
|
|
|
27794
27812
|
try {
|
|
27795
27813
|
const require2 = createRequire(import.meta.url);
|
|
27796
27814
|
const pkgPath = require2.resolve("@code-yeongyu/comment-checker/package.json");
|
|
27797
|
-
const binaryPath =
|
|
27815
|
+
const binaryPath = join22(dirname4(pkgPath), "bin", binaryName);
|
|
27798
27816
|
if (existsSync25(binaryPath))
|
|
27799
27817
|
return binaryPath;
|
|
27800
27818
|
} catch {}
|
|
@@ -27911,11 +27929,12 @@ async function getGhCliInfo() {
|
|
|
27911
27929
|
// src/tools/lsp/server-config-loader.ts
|
|
27912
27930
|
init_shared();
|
|
27913
27931
|
init_jsonc_parser();
|
|
27932
|
+
init_omo_config_file();
|
|
27914
27933
|
|
|
27915
27934
|
// src/tools/lsp/server-installation.ts
|
|
27916
27935
|
init_shared();
|
|
27917
27936
|
import { existsSync as existsSync26 } from "fs";
|
|
27918
|
-
import { join as
|
|
27937
|
+
import { join as join23 } from "path";
|
|
27919
27938
|
function isServerInstalled(command) {
|
|
27920
27939
|
if (command.length === 0)
|
|
27921
27940
|
return false;
|
|
@@ -27943,23 +27962,23 @@ function isServerInstalled(command) {
|
|
|
27943
27962
|
const paths = pathEnv.split(pathSeparator);
|
|
27944
27963
|
for (const p2 of paths) {
|
|
27945
27964
|
for (const suffix of exts) {
|
|
27946
|
-
if (existsSync26(
|
|
27965
|
+
if (existsSync26(join23(p2, cmd + suffix))) {
|
|
27947
27966
|
return true;
|
|
27948
27967
|
}
|
|
27949
27968
|
}
|
|
27950
27969
|
}
|
|
27951
27970
|
const cwd = process.cwd();
|
|
27952
27971
|
const configDir = getOpenCodeConfigDir({ binary: "opencode" });
|
|
27953
|
-
const dataDir =
|
|
27972
|
+
const dataDir = join23(getDataDir(), "opencode");
|
|
27954
27973
|
const additionalBases = [
|
|
27955
|
-
|
|
27956
|
-
|
|
27957
|
-
|
|
27958
|
-
|
|
27974
|
+
join23(cwd, "node_modules", ".bin"),
|
|
27975
|
+
join23(configDir, "bin"),
|
|
27976
|
+
join23(configDir, "node_modules", ".bin"),
|
|
27977
|
+
join23(dataDir, "bin")
|
|
27959
27978
|
];
|
|
27960
27979
|
for (const base of additionalBases) {
|
|
27961
27980
|
for (const suffix of exts) {
|
|
27962
|
-
if (existsSync26(
|
|
27981
|
+
if (existsSync26(join23(base, cmd + suffix))) {
|
|
27963
27982
|
return true;
|
|
27964
27983
|
}
|
|
27965
27984
|
}
|
|
@@ -27995,13 +28014,13 @@ function getLspServerStats(servers) {
|
|
|
27995
28014
|
init_shared();
|
|
27996
28015
|
import { existsSync as existsSync27, readFileSync as readFileSync20 } from "fs";
|
|
27997
28016
|
import { homedir as homedir7 } from "os";
|
|
27998
|
-
import { join as
|
|
28017
|
+
import { join as join24 } from "path";
|
|
27999
28018
|
var BUILTIN_MCP_SERVERS = ["context7", "grep_app"];
|
|
28000
28019
|
function getMcpConfigPaths() {
|
|
28001
28020
|
return [
|
|
28002
|
-
|
|
28003
|
-
|
|
28004
|
-
|
|
28021
|
+
join24(homedir7(), ".claude", ".mcp.json"),
|
|
28022
|
+
join24(process.cwd(), ".mcp.json"),
|
|
28023
|
+
join24(process.cwd(), ".claude", ".mcp.json")
|
|
28005
28024
|
];
|
|
28006
28025
|
}
|
|
28007
28026
|
function loadUserMcpConfig() {
|
|
@@ -28413,10 +28432,10 @@ async function doctor(options = { mode: "default" }) {
|
|
|
28413
28432
|
// src/features/mcp-oauth/storage.ts
|
|
28414
28433
|
init_shared();
|
|
28415
28434
|
import { chmodSync, existsSync as existsSync28, mkdirSync as mkdirSync5, readFileSync as readFileSync21, unlinkSync as unlinkSync2, writeFileSync as writeFileSync7 } from "fs";
|
|
28416
|
-
import { dirname as dirname5, join as
|
|
28435
|
+
import { dirname as dirname5, join as join25 } from "path";
|
|
28417
28436
|
var STORAGE_FILE_NAME = "mcp-oauth.json";
|
|
28418
28437
|
function getMcpOauthStoragePath() {
|
|
28419
|
-
return
|
|
28438
|
+
return join25(getOpenCodeConfigDir({ binary: "opencode" }), STORAGE_FILE_NAME);
|
|
28420
28439
|
}
|
|
28421
28440
|
function normalizeHost(serverHost) {
|
|
28422
28441
|
let host = serverHost.trim();
|
|
@@ -29034,7 +29053,7 @@ function createMcpOAuthCommand() {
|
|
|
29034
29053
|
|
|
29035
29054
|
// src/cli/validate-skill/validate-skill.ts
|
|
29036
29055
|
import { existsSync as existsSync30 } from "fs";
|
|
29037
|
-
import { join as
|
|
29056
|
+
import { join as join30 } from "path";
|
|
29038
29057
|
|
|
29039
29058
|
// src/features/skill-creator/eval-grader.ts
|
|
29040
29059
|
function includesAll(text, values) {
|
|
@@ -29113,7 +29132,7 @@ function gradeEvalReport(report, sourceReport) {
|
|
|
29113
29132
|
}
|
|
29114
29133
|
// src/features/skill-creator/eval-runner.ts
|
|
29115
29134
|
import { mkdtemp, mkdir, cp, rm } from "fs/promises";
|
|
29116
|
-
import { dirname as dirname6, join as
|
|
29135
|
+
import { dirname as dirname6, join as join28, resolve as resolve2 } from "path";
|
|
29117
29136
|
import { tmpdir as tmpdir2 } from "os";
|
|
29118
29137
|
|
|
29119
29138
|
// src/tools/session-manager/storage.ts
|
|
@@ -29122,14 +29141,14 @@ init_opencode_message_dir();
|
|
|
29122
29141
|
init_opencode_storage_detection();
|
|
29123
29142
|
import { existsSync as existsSync29 } from "fs";
|
|
29124
29143
|
import { readdir, readFile } from "fs/promises";
|
|
29125
|
-
import { join as
|
|
29144
|
+
import { join as join27 } from "path";
|
|
29126
29145
|
|
|
29127
29146
|
// src/tools/session-manager/constants.ts
|
|
29128
29147
|
init_shared();
|
|
29129
29148
|
init_shared();
|
|
29130
|
-
import { join as
|
|
29131
|
-
var TODO_DIR =
|
|
29132
|
-
var TRANSCRIPT_DIR =
|
|
29149
|
+
import { join as join26 } from "path";
|
|
29150
|
+
var TODO_DIR = join26(getClaudeConfigDir(), "todos");
|
|
29151
|
+
var TRANSCRIPT_DIR = join26(getClaudeConfigDir(), "transcripts");
|
|
29133
29152
|
|
|
29134
29153
|
// src/tools/session-manager/storage.ts
|
|
29135
29154
|
init_opencode_message_dir();
|
|
@@ -29201,7 +29220,7 @@ async function readSessionMessages(sessionID) {
|
|
|
29201
29220
|
if (!file2.endsWith(".json"))
|
|
29202
29221
|
continue;
|
|
29203
29222
|
try {
|
|
29204
|
-
const content = await readFile(
|
|
29223
|
+
const content = await readFile(join27(messageDir, file2), "utf-8");
|
|
29205
29224
|
const meta3 = JSON.parse(content);
|
|
29206
29225
|
const parts = await readParts(meta3.id);
|
|
29207
29226
|
messages.push({
|
|
@@ -29225,7 +29244,7 @@ async function readSessionMessages(sessionID) {
|
|
|
29225
29244
|
});
|
|
29226
29245
|
}
|
|
29227
29246
|
async function readParts(messageID) {
|
|
29228
|
-
const partDir =
|
|
29247
|
+
const partDir = join27(PART_STORAGE, messageID);
|
|
29229
29248
|
if (!existsSync29(partDir))
|
|
29230
29249
|
return [];
|
|
29231
29250
|
const parts = [];
|
|
@@ -29235,7 +29254,7 @@ async function readParts(messageID) {
|
|
|
29235
29254
|
if (!file2.endsWith(".json"))
|
|
29236
29255
|
continue;
|
|
29237
29256
|
try {
|
|
29238
|
-
const content = await readFile(
|
|
29257
|
+
const content = await readFile(join27(partDir, file2), "utf-8");
|
|
29239
29258
|
parts.push(JSON.parse(content));
|
|
29240
29259
|
} catch {}
|
|
29241
29260
|
}
|
|
@@ -29317,13 +29336,13 @@ function detectSkillInvocation(messages, skillName) {
|
|
|
29317
29336
|
}));
|
|
29318
29337
|
}
|
|
29319
29338
|
async function createEvalWorkspace(skillDir, skillName, evalBaseDir, files) {
|
|
29320
|
-
const workspaceDir = await mkdtemp(
|
|
29321
|
-
const skillTargetDir =
|
|
29339
|
+
const workspaceDir = await mkdtemp(join28(tmpdir2(), "omo-skill-eval-"));
|
|
29340
|
+
const skillTargetDir = join28(workspaceDir, ".opencode", "skills", skillName);
|
|
29322
29341
|
await mkdir(dirname6(skillTargetDir), { recursive: true });
|
|
29323
29342
|
await cp(skillDir, skillTargetDir, { recursive: true });
|
|
29324
29343
|
for (const file2 of files) {
|
|
29325
29344
|
const sourcePath = resolve2(evalBaseDir, file2);
|
|
29326
|
-
const targetPath =
|
|
29345
|
+
const targetPath = join28(workspaceDir, file2);
|
|
29327
29346
|
await mkdir(dirname6(targetPath), { recursive: true });
|
|
29328
29347
|
await cp(sourcePath, targetPath, { recursive: true });
|
|
29329
29348
|
}
|
|
@@ -29430,7 +29449,7 @@ async function loadSkillEvalSuite(evalFilePath) {
|
|
|
29430
29449
|
}
|
|
29431
29450
|
// src/features/skill-creator/skill-validator.ts
|
|
29432
29451
|
import { access, readFile as readFile3 } from "fs/promises";
|
|
29433
|
-
import { dirname as dirname7, join as
|
|
29452
|
+
import { dirname as dirname7, join as join29, resolve as resolve3 } from "path";
|
|
29434
29453
|
init_frontmatter();
|
|
29435
29454
|
var ALLOWED_FRONTMATTER_KEYS = new Set([
|
|
29436
29455
|
"name",
|
|
@@ -29448,16 +29467,16 @@ var ALLOWED_FRONTMATTER_KEYS = new Set([
|
|
|
29448
29467
|
function isZodError(error48) {
|
|
29449
29468
|
return error48 instanceof exports_external.ZodError;
|
|
29450
29469
|
}
|
|
29451
|
-
async function pathExists(
|
|
29470
|
+
async function pathExists(path3) {
|
|
29452
29471
|
try {
|
|
29453
|
-
await access(
|
|
29472
|
+
await access(path3);
|
|
29454
29473
|
return true;
|
|
29455
29474
|
} catch {
|
|
29456
29475
|
return false;
|
|
29457
29476
|
}
|
|
29458
29477
|
}
|
|
29459
29478
|
async function resolveSkillFilePath(skillPath) {
|
|
29460
|
-
const directSkillFile = skillPath.endsWith("SKILL.md") ? skillPath :
|
|
29479
|
+
const directSkillFile = skillPath.endsWith("SKILL.md") ? skillPath : join29(skillPath, "SKILL.md");
|
|
29461
29480
|
const exists = await pathExists(directSkillFile);
|
|
29462
29481
|
if (!exists) {
|
|
29463
29482
|
throw new Error(`SKILL.md not found at ${directSkillFile}`);
|
|
@@ -29579,9 +29598,9 @@ async function validateSkillDirectory(skillPath, evalFilePath) {
|
|
|
29579
29598
|
// src/cli/validate-skill/validate-skill.ts
|
|
29580
29599
|
function findDefaultEvalFile(skillDir) {
|
|
29581
29600
|
const candidates = [
|
|
29582
|
-
|
|
29583
|
-
|
|
29584
|
-
|
|
29601
|
+
join30(skillDir, "evals", "evals.json"),
|
|
29602
|
+
join30(skillDir, "evals", "evals.yaml"),
|
|
29603
|
+
join30(skillDir, "evals", "evals.yml")
|
|
29585
29604
|
];
|
|
29586
29605
|
return candidates.find((candidate) => existsSync30(candidate));
|
|
29587
29606
|
}
|