oh-my-opencode 3.12.3 → 3.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +11 -0
- package/README.ko.md +11 -0
- package/README.md +12 -2
- package/README.ru.md +11 -0
- package/README.zh-cn.md +11 -0
- package/dist/agents/prometheus/system-prompt.d.ts +1 -1
- package/dist/cli/index.js +193 -126
- package/dist/config/schema/hooks.d.ts +1 -1
- package/dist/config/schema/oh-my-opencode-config.d.ts +31 -0
- package/dist/config/schema/openclaw.d.ts +64 -0
- package/dist/create-hooks.d.ts +1 -1
- package/dist/features/background-agent/constants.d.ts +3 -3
- package/dist/features/boulder-state/index.d.ts +1 -0
- package/dist/features/boulder-state/storage.d.ts +10 -1
- package/dist/features/boulder-state/top-level-task.d.ts +2 -0
- package/dist/features/boulder-state/types.d.ts +28 -0
- package/dist/hooks/atlas/boulder-continuation-injector.d.ts +2 -0
- package/dist/hooks/atlas/subagent-session-id.d.ts +7 -1
- package/dist/hooks/atlas/tool-execute-after.d.ts +2 -1
- package/dist/hooks/atlas/tool-execute-before.d.ts +2 -0
- package/dist/hooks/atlas/types.d.ts +13 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/keyword-detector/constants.d.ts +1 -1
- package/dist/hooks/keyword-detector/ultrawork/index.d.ts +1 -1
- package/dist/hooks/keyword-detector/ultrawork/source-detector.d.ts +5 -0
- package/dist/hooks/openclaw.d.ts +11 -0
- package/dist/hooks/preemptive-compaction-degradation-monitor.d.ts +55 -0
- package/dist/hooks/preemptive-compaction-no-text-tail.d.ts +18 -0
- package/dist/hooks/session-recovery/storage/thinking-prepend.d.ts +27 -2
- package/dist/hooks/todo-continuation-enforcer/compaction-guard.d.ts +2 -0
- package/dist/hooks/todo-continuation-enforcer/handler.d.ts +0 -1
- package/dist/hooks/todo-continuation-enforcer/idle-event.d.ts +0 -1
- package/dist/hooks/todo-continuation-enforcer/types.d.ts +2 -1
- package/dist/hooks/webfetch-redirect-guard/constants.d.ts +6 -0
- package/dist/hooks/webfetch-redirect-guard/hook.d.ts +19 -0
- package/dist/hooks/webfetch-redirect-guard/index.d.ts +1 -0
- package/dist/hooks/webfetch-redirect-guard/redirect-resolution.d.ts +16 -0
- package/dist/index.js +1925 -1134
- package/dist/oh-my-opencode.schema.json +141 -0
- package/dist/openclaw/config.d.ts +8 -0
- package/dist/openclaw/daemon.d.ts +1 -0
- package/dist/openclaw/dispatcher.d.ts +16 -0
- package/dist/openclaw/index.d.ts +5 -0
- package/dist/openclaw/reply-listener.d.ts +31 -0
- package/dist/openclaw/session-registry.d.ts +17 -0
- package/dist/openclaw/tmux.d.ts +8 -0
- package/dist/openclaw/types.d.ts +38 -0
- package/dist/plugin/chat-params.d.ts +5 -1
- package/dist/plugin/hooks/create-continuation-hooks.d.ts +1 -2
- package/dist/plugin/hooks/create-core-hooks.d.ts +1 -0
- package/dist/plugin/hooks/create-tool-guard-hooks.d.ts +2 -1
- package/dist/plugin/normalize-tool-arg-schemas.d.ts +1 -0
- package/dist/plugin-handlers/prometheus-agent-config-builder.d.ts +1 -0
- package/dist/shared/jsonc-parser.d.ts +4 -0
- package/dist/shared/shell-env.d.ts +1 -1
- package/dist/tools/delegate-task/categories.d.ts +1 -0
- package/dist/tools/delegate-task/constants.d.ts +2 -2
- package/dist/tools/delegate-task/model-selection.d.ts +1 -0
- package/dist/tools/delegate-task/subagent-resolver.d.ts +1 -1
- package/dist/tools/hashline-edit/formatter-trigger.d.ts +38 -0
- package/dist/tools/hashline-edit/hashline-edit-executor.d.ts +2 -1
- package/dist/tools/hashline-edit/tools.d.ts +2 -1
- package/package.json +12 -12
- package/dist/hooks/gpt-permission-continuation/assistant-message.d.ts +0 -23
- package/dist/hooks/gpt-permission-continuation/constants.d.ts +0 -4
- package/dist/hooks/gpt-permission-continuation/detector.d.ts +0 -1
- package/dist/hooks/gpt-permission-continuation/handler.d.ts +0 -12
- package/dist/hooks/gpt-permission-continuation/index.d.ts +0 -13
- package/dist/hooks/gpt-permission-continuation/session-state.d.ts +0 -15
package/dist/cli/index.js
CHANGED
|
@@ -5041,14 +5041,28 @@ var init_dynamic_truncator = __esm(() => {
|
|
|
5041
5041
|
// src/shared/data-path.ts
|
|
5042
5042
|
import * as path2 from "path";
|
|
5043
5043
|
import * as os2 from "os";
|
|
5044
|
+
import { accessSync, constants, mkdirSync } from "fs";
|
|
5045
|
+
function resolveWritableDirectory(preferredDir, fallbackSuffix) {
|
|
5046
|
+
try {
|
|
5047
|
+
mkdirSync(preferredDir, { recursive: true });
|
|
5048
|
+
accessSync(preferredDir, constants.W_OK);
|
|
5049
|
+
return preferredDir;
|
|
5050
|
+
} catch {
|
|
5051
|
+
const fallbackDir = path2.join(os2.tmpdir(), fallbackSuffix);
|
|
5052
|
+
mkdirSync(fallbackDir, { recursive: true });
|
|
5053
|
+
return fallbackDir;
|
|
5054
|
+
}
|
|
5055
|
+
}
|
|
5044
5056
|
function getDataDir() {
|
|
5045
|
-
|
|
5057
|
+
const preferredDir = process.env.XDG_DATA_HOME ?? path2.join(os2.homedir(), ".local", "share");
|
|
5058
|
+
return resolveWritableDirectory(preferredDir, "opencode-data");
|
|
5046
5059
|
}
|
|
5047
5060
|
function getOpenCodeStorageDir() {
|
|
5048
5061
|
return path2.join(getDataDir(), "opencode", "storage");
|
|
5049
5062
|
}
|
|
5050
5063
|
function getCacheDir() {
|
|
5051
|
-
|
|
5064
|
+
const preferredDir = process.env.XDG_CACHE_HOME ?? path2.join(os2.homedir(), ".cache");
|
|
5065
|
+
return resolveWritableDirectory(preferredDir, "opencode-cache");
|
|
5052
5066
|
}
|
|
5053
5067
|
function getOmoOpenCodeCacheDir() {
|
|
5054
5068
|
return path2.join(getCacheDir(), "oh-my-opencode");
|
|
@@ -5942,6 +5956,7 @@ var init_main = __esm(() => {
|
|
|
5942
5956
|
|
|
5943
5957
|
// src/shared/jsonc-parser.ts
|
|
5944
5958
|
import { existsSync, readFileSync } from "fs";
|
|
5959
|
+
import { join as join3 } from "path";
|
|
5945
5960
|
function parseJsonc(content) {
|
|
5946
5961
|
const errors = [];
|
|
5947
5962
|
const result = parse2(content, errors, {
|
|
@@ -5965,8 +5980,18 @@ function detectConfigFile(basePath) {
|
|
|
5965
5980
|
}
|
|
5966
5981
|
return { format: "none", path: jsonPath };
|
|
5967
5982
|
}
|
|
5983
|
+
function detectPluginConfigFile(dir) {
|
|
5984
|
+
for (const name of PLUGIN_CONFIG_NAMES) {
|
|
5985
|
+
const result = detectConfigFile(join3(dir, name));
|
|
5986
|
+
if (result.format !== "none")
|
|
5987
|
+
return result;
|
|
5988
|
+
}
|
|
5989
|
+
return { format: "none", path: join3(dir, PLUGIN_CONFIG_NAMES[0] + ".json") };
|
|
5990
|
+
}
|
|
5991
|
+
var PLUGIN_CONFIG_NAMES;
|
|
5968
5992
|
var init_jsonc_parser = __esm(() => {
|
|
5969
5993
|
init_main();
|
|
5994
|
+
PLUGIN_CONFIG_NAMES = ["oh-my-opencode", "oh-my-openagent"];
|
|
5970
5995
|
});
|
|
5971
5996
|
|
|
5972
5997
|
// src/shared/migration/agent-names.ts
|
|
@@ -6052,7 +6077,8 @@ var init_hook_names = __esm(() => {
|
|
|
6052
6077
|
"sisyphus-orchestrator": "atlas",
|
|
6053
6078
|
"sisyphus-gpt-hephaestus-reminder": "no-sisyphus-gpt",
|
|
6054
6079
|
"empty-message-sanitizer": null,
|
|
6055
|
-
"delegate-task-english-directive": null
|
|
6080
|
+
"delegate-task-english-directive": null,
|
|
6081
|
+
"gpt-permission-continuation": null
|
|
6056
6082
|
};
|
|
6057
6083
|
});
|
|
6058
6084
|
|
|
@@ -6226,7 +6252,7 @@ var init_migration = __esm(() => {
|
|
|
6226
6252
|
// src/shared/opencode-config-dir.ts
|
|
6227
6253
|
import { existsSync as existsSync2 } from "fs";
|
|
6228
6254
|
import { homedir as homedir2 } from "os";
|
|
6229
|
-
import { join as
|
|
6255
|
+
import { join as join4, resolve } from "path";
|
|
6230
6256
|
function isDevBuild(version) {
|
|
6231
6257
|
if (!version)
|
|
6232
6258
|
return false;
|
|
@@ -6236,15 +6262,15 @@ function getTauriConfigDir(identifier) {
|
|
|
6236
6262
|
const platform = process.platform;
|
|
6237
6263
|
switch (platform) {
|
|
6238
6264
|
case "darwin":
|
|
6239
|
-
return
|
|
6265
|
+
return join4(homedir2(), "Library", "Application Support", identifier);
|
|
6240
6266
|
case "win32": {
|
|
6241
|
-
const appData = process.env.APPDATA ||
|
|
6242
|
-
return
|
|
6267
|
+
const appData = process.env.APPDATA || join4(homedir2(), "AppData", "Roaming");
|
|
6268
|
+
return join4(appData, identifier);
|
|
6243
6269
|
}
|
|
6244
6270
|
case "linux":
|
|
6245
6271
|
default: {
|
|
6246
|
-
const xdgConfig = process.env.XDG_CONFIG_HOME ||
|
|
6247
|
-
return
|
|
6272
|
+
const xdgConfig = process.env.XDG_CONFIG_HOME || join4(homedir2(), ".config");
|
|
6273
|
+
return join4(xdgConfig, identifier);
|
|
6248
6274
|
}
|
|
6249
6275
|
}
|
|
6250
6276
|
}
|
|
@@ -6253,8 +6279,8 @@ function getCliConfigDir() {
|
|
|
6253
6279
|
if (envConfigDir) {
|
|
6254
6280
|
return resolve(envConfigDir);
|
|
6255
6281
|
}
|
|
6256
|
-
const xdgConfig = process.env.XDG_CONFIG_HOME ||
|
|
6257
|
-
return
|
|
6282
|
+
const xdgConfig = process.env.XDG_CONFIG_HOME || join4(homedir2(), ".config");
|
|
6283
|
+
return join4(xdgConfig, "opencode");
|
|
6258
6284
|
}
|
|
6259
6285
|
function getOpenCodeConfigDir(options) {
|
|
6260
6286
|
const { binary: binary2, version, checkExisting = true } = options;
|
|
@@ -6265,8 +6291,8 @@ function getOpenCodeConfigDir(options) {
|
|
|
6265
6291
|
const tauriDir = getTauriConfigDir(identifier);
|
|
6266
6292
|
if (checkExisting) {
|
|
6267
6293
|
const legacyDir = getCliConfigDir();
|
|
6268
|
-
const legacyConfig =
|
|
6269
|
-
const legacyConfigC =
|
|
6294
|
+
const legacyConfig = join4(legacyDir, "opencode.json");
|
|
6295
|
+
const legacyConfigC = join4(legacyDir, "opencode.jsonc");
|
|
6270
6296
|
if (existsSync2(legacyConfig) || existsSync2(legacyConfigC)) {
|
|
6271
6297
|
return legacyDir;
|
|
6272
6298
|
}
|
|
@@ -6277,10 +6303,10 @@ function getOpenCodeConfigPaths(options) {
|
|
|
6277
6303
|
const configDir = getOpenCodeConfigDir(options);
|
|
6278
6304
|
return {
|
|
6279
6305
|
configDir,
|
|
6280
|
-
configJson:
|
|
6281
|
-
configJsonc:
|
|
6282
|
-
packageJson:
|
|
6283
|
-
omoConfig:
|
|
6306
|
+
configJson: join4(configDir, "opencode.json"),
|
|
6307
|
+
configJsonc: join4(configDir, "opencode.jsonc"),
|
|
6308
|
+
packageJson: join4(configDir, "package.json"),
|
|
6309
|
+
omoConfig: join4(configDir, "oh-my-opencode.json")
|
|
6284
6310
|
};
|
|
6285
6311
|
}
|
|
6286
6312
|
var TAURI_APP_IDENTIFIER = "ai.opencode.desktop", TAURI_APP_IDENTIFIER_DEV = "ai.opencode.desktop.dev";
|
|
@@ -6555,6 +6581,10 @@ var init_model_requirements = __esm(() => {
|
|
|
6555
6581
|
},
|
|
6556
6582
|
quick: {
|
|
6557
6583
|
fallbackChain: [
|
|
6584
|
+
{
|
|
6585
|
+
providers: ["openai", "github-copilot", "opencode"],
|
|
6586
|
+
model: "gpt-5.4-mini"
|
|
6587
|
+
},
|
|
6558
6588
|
{
|
|
6559
6589
|
providers: ["anthropic", "github-copilot", "opencode"],
|
|
6560
6590
|
model: "claude-haiku-4-5"
|
|
@@ -6646,18 +6676,18 @@ var init_system_directive = () => {};
|
|
|
6646
6676
|
// src/shared/agent-tool-restrictions.ts
|
|
6647
6677
|
var init_agent_tool_restrictions = () => {};
|
|
6648
6678
|
// src/shared/connected-providers-cache.ts
|
|
6649
|
-
import { existsSync as existsSync3, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync } from "fs";
|
|
6650
|
-
import { join as
|
|
6679
|
+
import { existsSync as existsSync3, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "fs";
|
|
6680
|
+
import { join as join5 } from "path";
|
|
6651
6681
|
function createConnectedProvidersCacheStore(getCacheDir2 = getOmoOpenCodeCacheDir) {
|
|
6652
6682
|
function getCacheFilePath(filename) {
|
|
6653
|
-
return
|
|
6683
|
+
return join5(getCacheDir2(), filename);
|
|
6654
6684
|
}
|
|
6655
6685
|
let memConnected;
|
|
6656
6686
|
let memProviderModels;
|
|
6657
6687
|
function ensureCacheDir() {
|
|
6658
6688
|
const cacheDir = getCacheDir2();
|
|
6659
6689
|
if (!existsSync3(cacheDir)) {
|
|
6660
|
-
|
|
6690
|
+
mkdirSync2(cacheDir, { recursive: true });
|
|
6661
6691
|
}
|
|
6662
6692
|
}
|
|
6663
6693
|
function readConnectedProvidersCache() {
|
|
@@ -6806,12 +6836,12 @@ var init_connected_providers_cache = __esm(() => {
|
|
|
6806
6836
|
|
|
6807
6837
|
// src/shared/model-availability.ts
|
|
6808
6838
|
import { existsSync as existsSync4, readFileSync as readFileSync3 } from "fs";
|
|
6809
|
-
import { join as
|
|
6839
|
+
import { join as join6 } from "path";
|
|
6810
6840
|
function isModelCacheAvailable() {
|
|
6811
6841
|
if (hasProviderModelsCache()) {
|
|
6812
6842
|
return true;
|
|
6813
6843
|
}
|
|
6814
|
-
const cacheFile =
|
|
6844
|
+
const cacheFile = join6(getOpenCodeCacheDir(), "models.json");
|
|
6815
6845
|
return existsSync4(cacheFile);
|
|
6816
6846
|
}
|
|
6817
6847
|
var init_model_availability = __esm(() => {
|
|
@@ -6873,14 +6903,14 @@ var init_hook_message_injector = __esm(() => {
|
|
|
6873
6903
|
});
|
|
6874
6904
|
|
|
6875
6905
|
// src/shared/opencode-storage-paths.ts
|
|
6876
|
-
import { join as
|
|
6906
|
+
import { join as join7 } from "path";
|
|
6877
6907
|
var OPENCODE_STORAGE, MESSAGE_STORAGE, PART_STORAGE, SESSION_STORAGE;
|
|
6878
6908
|
var init_opencode_storage_paths = __esm(() => {
|
|
6879
6909
|
init_data_path();
|
|
6880
6910
|
OPENCODE_STORAGE = getOpenCodeStorageDir();
|
|
6881
|
-
MESSAGE_STORAGE =
|
|
6882
|
-
PART_STORAGE =
|
|
6883
|
-
SESSION_STORAGE =
|
|
6911
|
+
MESSAGE_STORAGE = join7(OPENCODE_STORAGE, "message");
|
|
6912
|
+
PART_STORAGE = join7(OPENCODE_STORAGE, "part");
|
|
6913
|
+
SESSION_STORAGE = join7(OPENCODE_STORAGE, "session");
|
|
6884
6914
|
});
|
|
6885
6915
|
|
|
6886
6916
|
// src/shared/opencode-message-dir.ts
|
|
@@ -7282,11 +7312,11 @@ var init_plugin_name_with_version = __esm(() => {
|
|
|
7282
7312
|
});
|
|
7283
7313
|
|
|
7284
7314
|
// src/cli/config-manager/ensure-config-directory-exists.ts
|
|
7285
|
-
import { existsSync as existsSync5, mkdirSync as
|
|
7315
|
+
import { existsSync as existsSync5, mkdirSync as mkdirSync3 } from "fs";
|
|
7286
7316
|
function ensureConfigDirectoryExists() {
|
|
7287
7317
|
const configDir = getConfigDir();
|
|
7288
7318
|
if (!existsSync5(configDir)) {
|
|
7289
|
-
|
|
7319
|
+
mkdirSync3(configDir, { recursive: true });
|
|
7290
7320
|
}
|
|
7291
7321
|
}
|
|
7292
7322
|
var init_ensure_config_directory_exists = __esm(() => {
|
|
@@ -7488,7 +7518,7 @@ var init_openai_only_model_catalog = __esm(() => {
|
|
|
7488
7518
|
};
|
|
7489
7519
|
OPENAI_ONLY_CATEGORY_OVERRIDES = {
|
|
7490
7520
|
artistry: { model: "openai/gpt-5.4", variant: "xhigh" },
|
|
7491
|
-
quick: { model: "openai/gpt-5.
|
|
7521
|
+
quick: { model: "openai/gpt-5.4-mini" },
|
|
7492
7522
|
"visual-engineering": { model: "openai/gpt-5.4", variant: "high" },
|
|
7493
7523
|
writing: { model: "openai/gpt-5.4", variant: "medium" }
|
|
7494
7524
|
};
|
|
@@ -8625,15 +8655,15 @@ var init_update_toasts = __esm(() => {
|
|
|
8625
8655
|
|
|
8626
8656
|
// src/hooks/auto-update-checker/hook/background-update-check.ts
|
|
8627
8657
|
import { existsSync as existsSync20 } from "fs";
|
|
8628
|
-
import { join as
|
|
8658
|
+
import { join as join18 } from "path";
|
|
8629
8659
|
function getPinnedVersionToastMessage(latestVersion) {
|
|
8630
8660
|
return `Update available: ${latestVersion} (version pinned, update manually)`;
|
|
8631
8661
|
}
|
|
8632
8662
|
function resolveActiveInstallWorkspace() {
|
|
8633
8663
|
const configPaths = getOpenCodeConfigPaths({ binary: "opencode" });
|
|
8634
8664
|
const cacheDir = getOpenCodeCacheDir();
|
|
8635
|
-
const configInstallPath =
|
|
8636
|
-
const cacheInstallPath =
|
|
8665
|
+
const configInstallPath = join18(configPaths.configDir, "node_modules", PACKAGE_NAME, "package.json");
|
|
8666
|
+
const cacheInstallPath = join18(cacheDir, "node_modules", PACKAGE_NAME, "package.json");
|
|
8637
8667
|
if (existsSync20(configInstallPath)) {
|
|
8638
8668
|
log(`[auto-update-checker] Active workspace: config-dir (${configPaths.configDir})`);
|
|
8639
8669
|
return configPaths.configDir;
|
|
@@ -8941,7 +8971,7 @@ var {
|
|
|
8941
8971
|
// package.json
|
|
8942
8972
|
var package_default = {
|
|
8943
8973
|
name: "oh-my-opencode",
|
|
8944
|
-
version: "3.
|
|
8974
|
+
version: "3.13.1",
|
|
8945
8975
|
description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
8946
8976
|
main: "dist/index.js",
|
|
8947
8977
|
types: "dist/index.d.ts",
|
|
@@ -9017,17 +9047,17 @@ var package_default = {
|
|
|
9017
9047
|
typescript: "^5.7.3"
|
|
9018
9048
|
},
|
|
9019
9049
|
optionalDependencies: {
|
|
9020
|
-
"oh-my-opencode-darwin-arm64": "3.
|
|
9021
|
-
"oh-my-opencode-darwin-x64": "3.
|
|
9022
|
-
"oh-my-opencode-darwin-x64-baseline": "3.
|
|
9023
|
-
"oh-my-opencode-linux-arm64": "3.
|
|
9024
|
-
"oh-my-opencode-linux-arm64-musl": "3.
|
|
9025
|
-
"oh-my-opencode-linux-x64": "3.
|
|
9026
|
-
"oh-my-opencode-linux-x64-baseline": "3.
|
|
9027
|
-
"oh-my-opencode-linux-x64-musl": "3.
|
|
9028
|
-
"oh-my-opencode-linux-x64-musl-baseline": "3.
|
|
9029
|
-
"oh-my-opencode-windows-x64": "3.
|
|
9030
|
-
"oh-my-opencode-windows-x64-baseline": "3.
|
|
9050
|
+
"oh-my-opencode-darwin-arm64": "3.13.1",
|
|
9051
|
+
"oh-my-opencode-darwin-x64": "3.13.1",
|
|
9052
|
+
"oh-my-opencode-darwin-x64-baseline": "3.13.1",
|
|
9053
|
+
"oh-my-opencode-linux-arm64": "3.13.1",
|
|
9054
|
+
"oh-my-opencode-linux-arm64-musl": "3.13.1",
|
|
9055
|
+
"oh-my-opencode-linux-x64": "3.13.1",
|
|
9056
|
+
"oh-my-opencode-linux-x64-baseline": "3.13.1",
|
|
9057
|
+
"oh-my-opencode-linux-x64-musl": "3.13.1",
|
|
9058
|
+
"oh-my-opencode-linux-x64-musl-baseline": "3.13.1",
|
|
9059
|
+
"oh-my-opencode-windows-x64": "3.13.1",
|
|
9060
|
+
"oh-my-opencode-windows-x64-baseline": "3.13.1"
|
|
9031
9061
|
},
|
|
9032
9062
|
overrides: {
|
|
9033
9063
|
"@opencode-ai/sdk": "^1.2.24"
|
|
@@ -9898,7 +9928,7 @@ async function promptInstallConfig(detected) {
|
|
|
9898
9928
|
message: "Will you integrate Google Gemini?",
|
|
9899
9929
|
options: [
|
|
9900
9930
|
{ value: "no", label: "No", hint: "Frontend/docs agents will use fallback" },
|
|
9901
|
-
{ value: "yes", label: "Yes", hint: "Beautiful UI generation with Gemini 3 Pro" }
|
|
9931
|
+
{ value: "yes", label: "Yes", hint: "Beautiful UI generation with Gemini 3.1 Pro" }
|
|
9902
9932
|
],
|
|
9903
9933
|
initialValue: initial.gemini
|
|
9904
9934
|
});
|
|
@@ -24551,7 +24581,6 @@ var GitMasterConfigSchema = exports_external.object({
|
|
|
24551
24581
|
});
|
|
24552
24582
|
// src/config/schema/hooks.ts
|
|
24553
24583
|
var HookNameSchema = exports_external.enum([
|
|
24554
|
-
"gpt-permission-continuation",
|
|
24555
24584
|
"todo-continuation-enforcer",
|
|
24556
24585
|
"context-window-monitor",
|
|
24557
24586
|
"session-recovery",
|
|
@@ -24599,7 +24628,8 @@ var HookNameSchema = exports_external.enum([
|
|
|
24599
24628
|
"anthropic-effort",
|
|
24600
24629
|
"hashline-read-enhancer",
|
|
24601
24630
|
"read-image-resizer",
|
|
24602
|
-
"todo-description-override"
|
|
24631
|
+
"todo-description-override",
|
|
24632
|
+
"webfetch-redirect-guard"
|
|
24603
24633
|
]);
|
|
24604
24634
|
// src/config/schema/notification.ts
|
|
24605
24635
|
var NotificationConfigSchema = exports_external.object({
|
|
@@ -24609,6 +24639,39 @@ var NotificationConfigSchema = exports_external.object({
|
|
|
24609
24639
|
var McpNameSchema = exports_external.enum(["websearch", "context7", "grep_app"]);
|
|
24610
24640
|
var AnyMcpNameSchema = exports_external.string().min(1);
|
|
24611
24641
|
|
|
24642
|
+
// src/config/schema/openclaw.ts
|
|
24643
|
+
var OpenClawGatewaySchema = exports_external.object({
|
|
24644
|
+
type: exports_external.enum(["http", "command"]).default("http"),
|
|
24645
|
+
url: exports_external.string().optional(),
|
|
24646
|
+
method: exports_external.string().default("POST"),
|
|
24647
|
+
headers: exports_external.record(exports_external.string(), exports_external.string()).optional(),
|
|
24648
|
+
command: exports_external.string().optional(),
|
|
24649
|
+
timeout: exports_external.number().optional()
|
|
24650
|
+
});
|
|
24651
|
+
var OpenClawHookSchema = exports_external.object({
|
|
24652
|
+
enabled: exports_external.boolean().default(true),
|
|
24653
|
+
gateway: exports_external.string(),
|
|
24654
|
+
instruction: exports_external.string()
|
|
24655
|
+
});
|
|
24656
|
+
var OpenClawReplyListenerConfigSchema = exports_external.object({
|
|
24657
|
+
discordBotToken: exports_external.string().optional(),
|
|
24658
|
+
discordChannelId: exports_external.string().optional(),
|
|
24659
|
+
discordMention: exports_external.string().optional(),
|
|
24660
|
+
authorizedDiscordUserIds: exports_external.array(exports_external.string()).default([]),
|
|
24661
|
+
telegramBotToken: exports_external.string().optional(),
|
|
24662
|
+
telegramChatId: exports_external.string().optional(),
|
|
24663
|
+
pollIntervalMs: exports_external.number().default(3000),
|
|
24664
|
+
rateLimitPerMinute: exports_external.number().default(10),
|
|
24665
|
+
maxMessageLength: exports_external.number().default(500),
|
|
24666
|
+
includePrefix: exports_external.boolean().default(true)
|
|
24667
|
+
});
|
|
24668
|
+
var OpenClawConfigSchema = exports_external.object({
|
|
24669
|
+
enabled: exports_external.boolean().default(false),
|
|
24670
|
+
gateways: exports_external.record(exports_external.string(), OpenClawGatewaySchema).default({}),
|
|
24671
|
+
hooks: exports_external.record(exports_external.string(), OpenClawHookSchema).default({}),
|
|
24672
|
+
replyListener: OpenClawReplyListenerConfigSchema.optional()
|
|
24673
|
+
});
|
|
24674
|
+
|
|
24612
24675
|
// src/config/schema/ralph-loop.ts
|
|
24613
24676
|
var RalphLoopConfigSchema = exports_external.object({
|
|
24614
24677
|
enabled: exports_external.boolean().default(false),
|
|
@@ -24730,6 +24793,7 @@ var OhMyOpenCodeConfigSchema = exports_external.object({
|
|
|
24730
24793
|
runtime_fallback: exports_external.union([exports_external.boolean(), RuntimeFallbackConfigSchema]).optional(),
|
|
24731
24794
|
background_task: BackgroundTaskConfigSchema.optional(),
|
|
24732
24795
|
notification: NotificationConfigSchema.optional(),
|
|
24796
|
+
openclaw: OpenClawConfigSchema.optional(),
|
|
24733
24797
|
babysitting: BabysittingConfigSchema.optional(),
|
|
24734
24798
|
git_master: GitMasterConfigSchema.optional(),
|
|
24735
24799
|
browser_automation_engine: BrowserAutomationConfigSchema.optional(),
|
|
@@ -24860,12 +24924,11 @@ function mergeConfigs(base, override) {
|
|
|
24860
24924
|
}
|
|
24861
24925
|
function loadPluginConfig(directory, ctx) {
|
|
24862
24926
|
const configDir = getOpenCodeConfigDir({ binary: "opencode" });
|
|
24863
|
-
const
|
|
24864
|
-
const
|
|
24865
|
-
const
|
|
24866
|
-
const
|
|
24867
|
-
const
|
|
24868
|
-
const projectConfigPath = projectDetected.format !== "none" ? projectDetected.path : projectBasePath + ".json";
|
|
24927
|
+
const userDetected = detectPluginConfigFile(configDir);
|
|
24928
|
+
const userConfigPath = userDetected.format !== "none" ? userDetected.path : path3.join(configDir, "oh-my-opencode.json");
|
|
24929
|
+
const projectBasePath = path3.join(directory, ".opencode");
|
|
24930
|
+
const projectDetected = detectPluginConfigFile(projectBasePath);
|
|
24931
|
+
const projectConfigPath = projectDetected.format !== "none" ? projectDetected.path : path3.join(projectBasePath, "oh-my-opencode.json");
|
|
24869
24932
|
let config2 = loadConfigFromPath(userConfigPath, ctx) ?? {};
|
|
24870
24933
|
const projectConfig = loadConfigFromPath(projectConfigPath, ctx);
|
|
24871
24934
|
if (projectConfig) {
|
|
@@ -26331,7 +26394,7 @@ var import_picocolors9 = __toESM(require_picocolors(), 1);
|
|
|
26331
26394
|
|
|
26332
26395
|
// src/cli/run/opencode-binary-resolver.ts
|
|
26333
26396
|
init_spawn_with_windows_hide();
|
|
26334
|
-
import { delimiter, dirname, join as
|
|
26397
|
+
import { delimiter, dirname, join as join9 } from "path";
|
|
26335
26398
|
var OPENCODE_COMMANDS = ["opencode", "opencode-desktop"];
|
|
26336
26399
|
var WINDOWS_SUFFIXES = ["", ".exe", ".cmd", ".bat", ".ps1"];
|
|
26337
26400
|
function getCommandCandidates(platform) {
|
|
@@ -26354,7 +26417,7 @@ function collectCandidateBinaryPaths(pathEnv, which = Bun.which, platform = proc
|
|
|
26354
26417
|
}
|
|
26355
26418
|
for (const entry of (pathEnv ?? "").split(delimiter).filter(Boolean)) {
|
|
26356
26419
|
for (const command of commandCandidates) {
|
|
26357
|
-
addCandidate(
|
|
26420
|
+
addCandidate(join9(entry, command));
|
|
26358
26421
|
}
|
|
26359
26422
|
}
|
|
26360
26423
|
return candidates;
|
|
@@ -26720,10 +26783,11 @@ var BOULDER_STATE_PATH = `${BOULDER_DIR}/${BOULDER_FILE}`;
|
|
|
26720
26783
|
var NOTEPAD_DIR = "notepads";
|
|
26721
26784
|
var NOTEPAD_BASE_PATH = `${BOULDER_DIR}/${NOTEPAD_DIR}`;
|
|
26722
26785
|
// src/features/boulder-state/storage.ts
|
|
26723
|
-
import { existsSync as existsSync11, readFileSync as readFileSync9, writeFileSync as writeFileSync5, mkdirSync as
|
|
26724
|
-
import { dirname as dirname2, join as
|
|
26786
|
+
import { existsSync as existsSync11, readFileSync as readFileSync9, writeFileSync as writeFileSync5, mkdirSync as mkdirSync4, readdirSync } from "fs";
|
|
26787
|
+
import { dirname as dirname2, join as join10, basename } from "path";
|
|
26788
|
+
var RESERVED_KEYS = new Set(["__proto__", "prototype", "constructor"]);
|
|
26725
26789
|
function getBoulderFilePath(directory) {
|
|
26726
|
-
return
|
|
26790
|
+
return join10(directory, BOULDER_DIR, BOULDER_FILE);
|
|
26727
26791
|
}
|
|
26728
26792
|
function readBoulderState(directory) {
|
|
26729
26793
|
const filePath = getBoulderFilePath(directory);
|
|
@@ -26739,6 +26803,9 @@ function readBoulderState(directory) {
|
|
|
26739
26803
|
if (!Array.isArray(parsed.session_ids)) {
|
|
26740
26804
|
parsed.session_ids = [];
|
|
26741
26805
|
}
|
|
26806
|
+
if (!parsed.task_sessions || typeof parsed.task_sessions !== "object" || Array.isArray(parsed.task_sessions)) {
|
|
26807
|
+
parsed.task_sessions = {};
|
|
26808
|
+
}
|
|
26742
26809
|
return parsed;
|
|
26743
26810
|
} catch {
|
|
26744
26811
|
return null;
|
|
@@ -26757,7 +26824,7 @@ function getPlanProgress(planPath) {
|
|
|
26757
26824
|
return {
|
|
26758
26825
|
total,
|
|
26759
26826
|
completed,
|
|
26760
|
-
isComplete: total
|
|
26827
|
+
isComplete: total > 0 && completed === total
|
|
26761
26828
|
};
|
|
26762
26829
|
} catch {
|
|
26763
26830
|
return { total: 0, completed: 0, isComplete: true };
|
|
@@ -26766,10 +26833,10 @@ function getPlanProgress(planPath) {
|
|
|
26766
26833
|
// src/features/run-continuation-state/constants.ts
|
|
26767
26834
|
var CONTINUATION_MARKER_DIR = ".sisyphus/run-continuation";
|
|
26768
26835
|
// src/features/run-continuation-state/storage.ts
|
|
26769
|
-
import { existsSync as existsSync12, mkdirSync as
|
|
26770
|
-
import { join as
|
|
26836
|
+
import { existsSync as existsSync12, mkdirSync as mkdirSync5, readFileSync as readFileSync10, rmSync, writeFileSync as writeFileSync6 } from "fs";
|
|
26837
|
+
import { join as join11 } from "path";
|
|
26771
26838
|
function getMarkerPath(directory, sessionID) {
|
|
26772
|
-
return
|
|
26839
|
+
return join11(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
|
|
26773
26840
|
}
|
|
26774
26841
|
function readContinuationMarker(directory, sessionID) {
|
|
26775
26842
|
const markerPath = getMarkerPath(directory, sessionID);
|
|
@@ -26801,8 +26868,8 @@ function getActiveContinuationMarkerReason(marker) {
|
|
|
26801
26868
|
}
|
|
26802
26869
|
// src/hooks/ralph-loop/storage.ts
|
|
26803
26870
|
init_frontmatter();
|
|
26804
|
-
import { existsSync as existsSync13, readFileSync as readFileSync11, writeFileSync as writeFileSync7, unlinkSync, mkdirSync as
|
|
26805
|
-
import { dirname as dirname3, join as
|
|
26871
|
+
import { existsSync as existsSync13, readFileSync as readFileSync11, writeFileSync as writeFileSync7, unlinkSync, mkdirSync as mkdirSync6 } from "fs";
|
|
26872
|
+
import { dirname as dirname3, join as join12 } from "path";
|
|
26806
26873
|
|
|
26807
26874
|
// src/hooks/ralph-loop/constants.ts
|
|
26808
26875
|
var DEFAULT_STATE_FILE = ".sisyphus/ralph-loop.local.md";
|
|
@@ -26811,7 +26878,7 @@ var DEFAULT_COMPLETION_PROMISE = "DONE";
|
|
|
26811
26878
|
|
|
26812
26879
|
// src/hooks/ralph-loop/storage.ts
|
|
26813
26880
|
function getStateFilePath(directory, customPath) {
|
|
26814
|
-
return customPath ?
|
|
26881
|
+
return customPath ? join12(directory, customPath) : join12(directory, DEFAULT_STATE_FILE);
|
|
26815
26882
|
}
|
|
26816
26883
|
function readState(directory, customPath) {
|
|
26817
26884
|
const filePath = getStateFilePath(directory, customPath);
|
|
@@ -27227,6 +27294,7 @@ async function waitForEventProcessorShutdown(eventProcessor, timeoutMs = EVENT_P
|
|
|
27227
27294
|
}
|
|
27228
27295
|
async function run(options) {
|
|
27229
27296
|
process.env.OPENCODE_CLI_RUN_MODE = "true";
|
|
27297
|
+
process.env.OPENCODE_CLIENT = "run";
|
|
27230
27298
|
const startTime = Date.now();
|
|
27231
27299
|
const {
|
|
27232
27300
|
message,
|
|
@@ -27529,24 +27597,24 @@ import { existsSync as existsSync24, readFileSync as readFileSync21 } from "fs";
|
|
|
27529
27597
|
init_spawn_with_windows_hide();
|
|
27530
27598
|
import { existsSync as existsSync21 } from "fs";
|
|
27531
27599
|
import { homedir as homedir5 } from "os";
|
|
27532
|
-
import { join as
|
|
27600
|
+
import { join as join19 } from "path";
|
|
27533
27601
|
function getDesktopAppPaths(platform) {
|
|
27534
27602
|
const home = homedir5();
|
|
27535
27603
|
switch (platform) {
|
|
27536
27604
|
case "darwin":
|
|
27537
27605
|
return [
|
|
27538
27606
|
"/Applications/OpenCode.app/Contents/MacOS/OpenCode",
|
|
27539
|
-
|
|
27607
|
+
join19(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
|
|
27540
27608
|
];
|
|
27541
27609
|
case "win32": {
|
|
27542
27610
|
const programFiles = process.env.ProgramFiles;
|
|
27543
27611
|
const localAppData = process.env.LOCALAPPDATA;
|
|
27544
27612
|
const paths = [];
|
|
27545
27613
|
if (programFiles) {
|
|
27546
|
-
paths.push(
|
|
27614
|
+
paths.push(join19(programFiles, "OpenCode", "OpenCode.exe"));
|
|
27547
27615
|
}
|
|
27548
27616
|
if (localAppData) {
|
|
27549
|
-
paths.push(
|
|
27617
|
+
paths.push(join19(localAppData, "OpenCode", "OpenCode.exe"));
|
|
27550
27618
|
}
|
|
27551
27619
|
return paths;
|
|
27552
27620
|
}
|
|
@@ -27554,8 +27622,8 @@ function getDesktopAppPaths(platform) {
|
|
|
27554
27622
|
return [
|
|
27555
27623
|
"/usr/bin/opencode",
|
|
27556
27624
|
"/usr/lib/opencode/opencode",
|
|
27557
|
-
|
|
27558
|
-
|
|
27625
|
+
join19(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
|
|
27626
|
+
join19(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
|
|
27559
27627
|
];
|
|
27560
27628
|
default:
|
|
27561
27629
|
return [];
|
|
@@ -27705,21 +27773,21 @@ init_checker();
|
|
|
27705
27773
|
init_auto_update_checker();
|
|
27706
27774
|
import { existsSync as existsSync23, readFileSync as readFileSync20 } from "fs";
|
|
27707
27775
|
import { homedir as homedir6 } from "os";
|
|
27708
|
-
import { join as
|
|
27776
|
+
import { join as join20 } from "path";
|
|
27709
27777
|
init_shared();
|
|
27710
27778
|
function getPlatformDefaultCacheDir(platform = process.platform) {
|
|
27711
27779
|
if (platform === "darwin")
|
|
27712
|
-
return
|
|
27780
|
+
return join20(homedir6(), "Library", "Caches");
|
|
27713
27781
|
if (platform === "win32")
|
|
27714
|
-
return process.env.LOCALAPPDATA ??
|
|
27715
|
-
return
|
|
27782
|
+
return process.env.LOCALAPPDATA ?? join20(homedir6(), "AppData", "Local");
|
|
27783
|
+
return join20(homedir6(), ".cache");
|
|
27716
27784
|
}
|
|
27717
27785
|
function resolveOpenCodeCacheDir() {
|
|
27718
27786
|
const xdgCacheHome = process.env.XDG_CACHE_HOME;
|
|
27719
27787
|
if (xdgCacheHome)
|
|
27720
|
-
return
|
|
27788
|
+
return join20(xdgCacheHome, "opencode");
|
|
27721
27789
|
const fromShared = getOpenCodeCacheDir();
|
|
27722
|
-
const platformDefault =
|
|
27790
|
+
const platformDefault = join20(getPlatformDefaultCacheDir(), "opencode");
|
|
27723
27791
|
if (existsSync23(fromShared) || !existsSync23(platformDefault))
|
|
27724
27792
|
return fromShared;
|
|
27725
27793
|
return platformDefault;
|
|
@@ -27747,12 +27815,12 @@ function getLoadedPluginVersion() {
|
|
|
27747
27815
|
{
|
|
27748
27816
|
cacheDir: configPaths.configDir,
|
|
27749
27817
|
cachePackagePath: configPaths.packageJson,
|
|
27750
|
-
installedPackagePath:
|
|
27818
|
+
installedPackagePath: join20(configPaths.configDir, "node_modules", PACKAGE_NAME2, "package.json")
|
|
27751
27819
|
},
|
|
27752
27820
|
{
|
|
27753
27821
|
cacheDir,
|
|
27754
|
-
cachePackagePath:
|
|
27755
|
-
installedPackagePath:
|
|
27822
|
+
cachePackagePath: join20(cacheDir, "package.json"),
|
|
27823
|
+
installedPackagePath: join20(cacheDir, "node_modules", PACKAGE_NAME2, "package.json")
|
|
27756
27824
|
}
|
|
27757
27825
|
];
|
|
27758
27826
|
const selectedCandidate = candidates.find((candidate) => existsSync23(candidate.installedPackagePath)) ?? candidates[0];
|
|
@@ -27889,22 +27957,22 @@ async function checkSystem() {
|
|
|
27889
27957
|
|
|
27890
27958
|
// src/cli/doctor/checks/config.ts
|
|
27891
27959
|
import { readFileSync as readFileSync24 } from "fs";
|
|
27892
|
-
import { join as
|
|
27960
|
+
import { join as join24 } from "path";
|
|
27893
27961
|
init_shared();
|
|
27894
27962
|
|
|
27895
27963
|
// src/cli/doctor/checks/model-resolution-cache.ts
|
|
27896
27964
|
init_shared();
|
|
27897
27965
|
import { existsSync as existsSync25, readFileSync as readFileSync22 } from "fs";
|
|
27898
27966
|
import { homedir as homedir7 } from "os";
|
|
27899
|
-
import { join as
|
|
27967
|
+
import { join as join21 } from "path";
|
|
27900
27968
|
function getOpenCodeCacheDir2() {
|
|
27901
27969
|
const xdgCache = process.env.XDG_CACHE_HOME;
|
|
27902
27970
|
if (xdgCache)
|
|
27903
|
-
return
|
|
27904
|
-
return
|
|
27971
|
+
return join21(xdgCache, "opencode");
|
|
27972
|
+
return join21(homedir7(), ".cache", "opencode");
|
|
27905
27973
|
}
|
|
27906
27974
|
function loadAvailableModelsFromCache() {
|
|
27907
|
-
const cacheFile =
|
|
27975
|
+
const cacheFile = join21(getOpenCodeCacheDir2(), "models.json");
|
|
27908
27976
|
if (!existsSync25(cacheFile)) {
|
|
27909
27977
|
return { providers: [], modelCount: 0, cacheExists: false };
|
|
27910
27978
|
}
|
|
@@ -27931,12 +27999,11 @@ init_model_requirements();
|
|
|
27931
27999
|
// src/cli/doctor/checks/model-resolution-config.ts
|
|
27932
28000
|
init_shared();
|
|
27933
28001
|
import { readFileSync as readFileSync23 } from "fs";
|
|
27934
|
-
import { join as
|
|
27935
|
-
var
|
|
27936
|
-
var
|
|
27937
|
-
var PROJECT_CONFIG_BASE = join21(process.cwd(), ".opencode", PACKAGE_NAME3);
|
|
28002
|
+
import { join as join22 } from "path";
|
|
28003
|
+
var USER_CONFIG_DIR2 = getOpenCodeConfigPaths({ binary: "opencode", version: null }).configDir;
|
|
28004
|
+
var PROJECT_CONFIG_DIR = join22(process.cwd(), ".opencode");
|
|
27938
28005
|
function loadOmoConfig() {
|
|
27939
|
-
const projectDetected =
|
|
28006
|
+
const projectDetected = detectPluginConfigFile(PROJECT_CONFIG_DIR);
|
|
27940
28007
|
if (projectDetected.format !== "none") {
|
|
27941
28008
|
try {
|
|
27942
28009
|
const content = readFileSync23(projectDetected.path, "utf-8");
|
|
@@ -27945,7 +28012,7 @@ function loadOmoConfig() {
|
|
|
27945
28012
|
return null;
|
|
27946
28013
|
}
|
|
27947
28014
|
}
|
|
27948
|
-
const userDetected =
|
|
28015
|
+
const userDetected = detectPluginConfigFile(USER_CONFIG_DIR2);
|
|
27949
28016
|
if (userDetected.format !== "none") {
|
|
27950
28017
|
try {
|
|
27951
28018
|
const content = readFileSync23(userDetected.path, "utf-8");
|
|
@@ -27959,7 +28026,7 @@ function loadOmoConfig() {
|
|
|
27959
28026
|
|
|
27960
28027
|
// src/cli/doctor/checks/model-resolution-details.ts
|
|
27961
28028
|
init_shared();
|
|
27962
|
-
import { join as
|
|
28029
|
+
import { join as join23 } from "path";
|
|
27963
28030
|
|
|
27964
28031
|
// src/cli/doctor/checks/model-resolution-variant.ts
|
|
27965
28032
|
function formatModelWithVariant(model, variant) {
|
|
@@ -27998,7 +28065,7 @@ function getCategoryEffectiveVariant(categoryName, requirement, config2) {
|
|
|
27998
28065
|
// src/cli/doctor/checks/model-resolution-details.ts
|
|
27999
28066
|
function buildModelResolutionDetails(options) {
|
|
28000
28067
|
const details = [];
|
|
28001
|
-
const cacheFile =
|
|
28068
|
+
const cacheFile = join23(getOpenCodeCacheDir(), "models.json");
|
|
28002
28069
|
details.push("\u2550\u2550\u2550 Available Models (from cache) \u2550\u2550\u2550");
|
|
28003
28070
|
details.push("");
|
|
28004
28071
|
if (options.available.cacheExists) {
|
|
@@ -28110,13 +28177,13 @@ async function checkModels() {
|
|
|
28110
28177
|
}
|
|
28111
28178
|
|
|
28112
28179
|
// src/cli/doctor/checks/config.ts
|
|
28113
|
-
var
|
|
28114
|
-
var
|
|
28180
|
+
var USER_CONFIG_DIR3 = getOpenCodeConfigDir({ binary: "opencode" });
|
|
28181
|
+
var PROJECT_CONFIG_DIR2 = join24(process.cwd(), ".opencode");
|
|
28115
28182
|
function findConfigPath() {
|
|
28116
|
-
const projectConfig =
|
|
28183
|
+
const projectConfig = detectPluginConfigFile(PROJECT_CONFIG_DIR2);
|
|
28117
28184
|
if (projectConfig.format !== "none")
|
|
28118
28185
|
return projectConfig.path;
|
|
28119
|
-
const userConfig =
|
|
28186
|
+
const userConfig = detectPluginConfigFile(USER_CONFIG_DIR3);
|
|
28120
28187
|
if (userConfig.format !== "none")
|
|
28121
28188
|
return userConfig.path;
|
|
28122
28189
|
return null;
|
|
@@ -28233,7 +28300,7 @@ async function checkConfig() {
|
|
|
28233
28300
|
init_spawn_with_windows_hide();
|
|
28234
28301
|
import { existsSync as existsSync26 } from "fs";
|
|
28235
28302
|
import { createRequire } from "module";
|
|
28236
|
-
import { dirname as dirname6, join as
|
|
28303
|
+
import { dirname as dirname6, join as join25 } from "path";
|
|
28237
28304
|
async function checkBinaryExists(binary2) {
|
|
28238
28305
|
try {
|
|
28239
28306
|
const path10 = Bun.which(binary2);
|
|
@@ -28290,11 +28357,11 @@ async function checkAstGrepNapi() {
|
|
|
28290
28357
|
};
|
|
28291
28358
|
} catch {
|
|
28292
28359
|
const { existsSync: existsSync27 } = await import("fs");
|
|
28293
|
-
const { join:
|
|
28360
|
+
const { join: join26 } = await import("path");
|
|
28294
28361
|
const { homedir: homedir8 } = await import("os");
|
|
28295
28362
|
const pathsToCheck = [
|
|
28296
|
-
|
|
28297
|
-
|
|
28363
|
+
join26(homedir8(), ".config", "opencode", "node_modules", "@ast-grep", "napi"),
|
|
28364
|
+
join26(process.cwd(), "node_modules", "@ast-grep", "napi")
|
|
28298
28365
|
];
|
|
28299
28366
|
for (const napiPath of pathsToCheck) {
|
|
28300
28367
|
if (existsSync27(napiPath)) {
|
|
@@ -28322,7 +28389,7 @@ function findCommentCheckerPackageBinary() {
|
|
|
28322
28389
|
try {
|
|
28323
28390
|
const require2 = createRequire(import.meta.url);
|
|
28324
28391
|
const pkgPath = require2.resolve("@code-yeongyu/comment-checker/package.json");
|
|
28325
|
-
const binaryPath =
|
|
28392
|
+
const binaryPath = join25(dirname6(pkgPath), "bin", binaryName);
|
|
28326
28393
|
if (existsSync26(binaryPath))
|
|
28327
28394
|
return binaryPath;
|
|
28328
28395
|
} catch {}
|
|
@@ -28481,7 +28548,7 @@ var BUILTIN_SERVERS = {
|
|
|
28481
28548
|
};
|
|
28482
28549
|
// src/tools/lsp/server-config-loader.ts
|
|
28483
28550
|
import { existsSync as existsSync27, readFileSync as readFileSync25 } from "fs";
|
|
28484
|
-
import { join as
|
|
28551
|
+
import { join as join26 } from "path";
|
|
28485
28552
|
init_shared();
|
|
28486
28553
|
init_jsonc_parser();
|
|
28487
28554
|
function loadJsonFile(path10) {
|
|
@@ -28497,9 +28564,9 @@ function getConfigPaths2() {
|
|
|
28497
28564
|
const cwd = process.cwd();
|
|
28498
28565
|
const configDir = getOpenCodeConfigDir({ binary: "opencode" });
|
|
28499
28566
|
return {
|
|
28500
|
-
project:
|
|
28501
|
-
user:
|
|
28502
|
-
opencode: detectConfigFile(
|
|
28567
|
+
project: detectPluginConfigFile(join26(cwd, ".opencode")).path,
|
|
28568
|
+
user: detectPluginConfigFile(configDir).path,
|
|
28569
|
+
opencode: detectConfigFile(join26(configDir, "opencode")).path
|
|
28503
28570
|
};
|
|
28504
28571
|
}
|
|
28505
28572
|
function loadAllConfigs() {
|
|
@@ -28569,20 +28636,20 @@ function getMergedServers() {
|
|
|
28569
28636
|
|
|
28570
28637
|
// src/tools/lsp/server-installation.ts
|
|
28571
28638
|
import { existsSync as existsSync28 } from "fs";
|
|
28572
|
-
import { delimiter as delimiter2, join as
|
|
28639
|
+
import { delimiter as delimiter2, join as join28 } from "path";
|
|
28573
28640
|
|
|
28574
28641
|
// src/tools/lsp/server-path-bases.ts
|
|
28575
28642
|
init_shared();
|
|
28576
|
-
import { join as
|
|
28643
|
+
import { join as join27 } from "path";
|
|
28577
28644
|
function getLspServerAdditionalPathBases(workingDirectory) {
|
|
28578
28645
|
const configDir = getOpenCodeConfigDir({ binary: "opencode" });
|
|
28579
|
-
const dataDir =
|
|
28646
|
+
const dataDir = join27(getDataDir(), "opencode");
|
|
28580
28647
|
return [
|
|
28581
|
-
|
|
28582
|
-
|
|
28583
|
-
|
|
28584
|
-
|
|
28585
|
-
|
|
28648
|
+
join27(workingDirectory, "node_modules", ".bin"),
|
|
28649
|
+
join27(configDir, "bin"),
|
|
28650
|
+
join27(configDir, "node_modules", ".bin"),
|
|
28651
|
+
join27(dataDir, "bin"),
|
|
28652
|
+
join27(dataDir, "bin", "node_modules", ".bin")
|
|
28586
28653
|
];
|
|
28587
28654
|
}
|
|
28588
28655
|
|
|
@@ -28613,14 +28680,14 @@ function isServerInstalled(command) {
|
|
|
28613
28680
|
const paths = pathEnv.split(delimiter2);
|
|
28614
28681
|
for (const p2 of paths) {
|
|
28615
28682
|
for (const suffix of exts) {
|
|
28616
|
-
if (existsSync28(
|
|
28683
|
+
if (existsSync28(join28(p2, cmd + suffix))) {
|
|
28617
28684
|
return true;
|
|
28618
28685
|
}
|
|
28619
28686
|
}
|
|
28620
28687
|
}
|
|
28621
28688
|
for (const base of getLspServerAdditionalPathBases(process.cwd())) {
|
|
28622
28689
|
for (const suffix of exts) {
|
|
28623
|
-
if (existsSync28(
|
|
28690
|
+
if (existsSync28(join28(base, cmd + suffix))) {
|
|
28624
28691
|
return true;
|
|
28625
28692
|
}
|
|
28626
28693
|
}
|
|
@@ -28684,13 +28751,13 @@ function getInstalledLspServers() {
|
|
|
28684
28751
|
init_shared();
|
|
28685
28752
|
import { existsSync as existsSync29, readFileSync as readFileSync26 } from "fs";
|
|
28686
28753
|
import { homedir as homedir8 } from "os";
|
|
28687
|
-
import { join as
|
|
28754
|
+
import { join as join29 } from "path";
|
|
28688
28755
|
var BUILTIN_MCP_SERVERS = ["context7", "grep_app"];
|
|
28689
28756
|
function getMcpConfigPaths() {
|
|
28690
28757
|
return [
|
|
28691
|
-
|
|
28692
|
-
|
|
28693
|
-
|
|
28758
|
+
join29(homedir8(), ".claude", ".mcp.json"),
|
|
28759
|
+
join29(process.cwd(), ".mcp.json"),
|
|
28760
|
+
join29(process.cwd(), ".claude", ".mcp.json")
|
|
28694
28761
|
];
|
|
28695
28762
|
}
|
|
28696
28763
|
function loadUserMcpConfig() {
|
|
@@ -29120,11 +29187,11 @@ async function doctor(options = { mode: "default" }) {
|
|
|
29120
29187
|
|
|
29121
29188
|
// src/features/mcp-oauth/storage.ts
|
|
29122
29189
|
init_shared();
|
|
29123
|
-
import { chmodSync, existsSync as existsSync30, mkdirSync as
|
|
29124
|
-
import { dirname as dirname7, join as
|
|
29190
|
+
import { chmodSync, existsSync as existsSync30, mkdirSync as mkdirSync7, readFileSync as readFileSync27, unlinkSync as unlinkSync4, writeFileSync as writeFileSync10 } from "fs";
|
|
29191
|
+
import { dirname as dirname7, join as join30 } from "path";
|
|
29125
29192
|
var STORAGE_FILE_NAME = "mcp-oauth.json";
|
|
29126
29193
|
function getMcpOauthStoragePath() {
|
|
29127
|
-
return
|
|
29194
|
+
return join30(getOpenCodeConfigDir({ binary: "opencode" }), STORAGE_FILE_NAME);
|
|
29128
29195
|
}
|
|
29129
29196
|
function normalizeHost(serverHost) {
|
|
29130
29197
|
let host = serverHost.trim();
|
|
@@ -29176,7 +29243,7 @@ function writeStore(store2) {
|
|
|
29176
29243
|
try {
|
|
29177
29244
|
const dir = dirname7(filePath);
|
|
29178
29245
|
if (!existsSync30(dir)) {
|
|
29179
|
-
|
|
29246
|
+
mkdirSync7(dir, { recursive: true });
|
|
29180
29247
|
}
|
|
29181
29248
|
writeFileSync10(filePath, JSON.stringify(store2, null, 2), { encoding: "utf-8", mode: 384 });
|
|
29182
29249
|
chmodSync(filePath, 384);
|
|
@@ -29753,7 +29820,7 @@ Examples:
|
|
|
29753
29820
|
Model Providers (Priority: Native > Copilot > OpenCode Zen > Z.ai > Kimi):
|
|
29754
29821
|
Claude Native anthropic/ models (Opus, Sonnet, Haiku)
|
|
29755
29822
|
OpenAI Native openai/ models (GPT-5.4 for Oracle)
|
|
29756
|
-
Gemini Native google/ models (Gemini 3 Pro, Flash)
|
|
29823
|
+
Gemini Native google/ models (Gemini 3.1 Pro, Flash)
|
|
29757
29824
|
Copilot github-copilot/ models (fallback)
|
|
29758
29825
|
OpenCode Zen opencode/ models (opencode/claude-opus-4-6, etc.)
|
|
29759
29826
|
Z.ai zai-coding-plan/glm-5 (visual-engineering fallback)
|