oh-my-opencode 3.0.0 → 3.1.0
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/dist/agents/atlas.d.ts +1 -1
- package/dist/agents/utils.d.ts +3 -2
- package/dist/cli/config-manager.d.ts +77 -14
- package/dist/cli/index.js +340 -122
- package/dist/config/index.d.ts +2 -2
- package/dist/config/schema.d.ts +59 -0
- package/dist/features/background-agent/manager.d.ts +13 -2
- package/dist/features/builtin-commands/templates/ralph-loop.d.ts +1 -1
- package/dist/features/builtin-commands/templates/start-work.d.ts +1 -1
- package/dist/features/builtin-skills/index.d.ts +1 -1
- package/dist/features/builtin-skills/skills.d.ts +5 -1
- package/dist/features/builtin-skills/skills.test.d.ts +1 -0
- package/dist/features/opencode-skill-loader/skill-content.d.ts +3 -2
- package/dist/features/tmux-subagent/action-executor.d.ts +22 -0
- package/dist/features/tmux-subagent/decision-engine.d.ts +38 -0
- package/dist/features/tmux-subagent/decision-engine.test.d.ts +1 -0
- package/dist/features/tmux-subagent/index.d.ts +5 -0
- package/dist/features/tmux-subagent/manager.d.ts +54 -0
- package/dist/features/tmux-subagent/manager.test.d.ts +1 -0
- package/dist/features/tmux-subagent/pane-state-querier.d.ts +2 -0
- package/dist/features/tmux-subagent/types.d.ts +51 -0
- package/dist/hooks/category-skill-reminder/index.d.ts +22 -0
- package/dist/hooks/category-skill-reminder/index.test.d.ts +1 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/sisyphus-junior-notepad/constants.d.ts +2 -0
- package/dist/hooks/sisyphus-junior-notepad/index.d.ts +12 -0
- package/dist/index.js +2905 -1009
- package/dist/shared/connected-providers-cache.d.ts +52 -0
- package/dist/shared/data-path.d.ts +16 -0
- package/dist/shared/index.d.ts +3 -1
- package/dist/shared/model-availability.d.ts +4 -5
- package/dist/shared/session-utils.d.ts +2 -0
- package/dist/shared/tmux/constants.d.ts +5 -0
- package/dist/shared/tmux/index.d.ts +3 -0
- package/dist/shared/tmux/tmux-utils.d.ts +17 -0
- package/dist/shared/tmux/tmux-utils.test.d.ts +1 -0
- package/dist/shared/tmux/types.d.ts +4 -0
- package/dist/tools/call-omo-agent/constants.d.ts +1 -1
- package/dist/tools/delegate-task/tools.d.ts +8 -1
- package/dist/tools/delegate-task/types.d.ts +2 -1
- package/dist/tools/index.d.ts +1 -2
- package/dist/tools/slashcommand/tools.test.d.ts +1 -0
- package/package.json +8 -8
- package/dist/hooks/background-compaction/index.d.ts +0 -19
- package/dist/shared/config-path.d.ts +0 -13
package/dist/cli/index.js
CHANGED
|
@@ -4913,15 +4913,24 @@ var init_dynamic_truncator = __esm(() => {
|
|
|
4913
4913
|
ANTHROPIC_ACTUAL_LIMIT = process.env.ANTHROPIC_1M_CONTEXT === "true" || process.env.VERTEX_ANTHROPIC_1M_CONTEXT === "true" ? 1e6 : 200000;
|
|
4914
4914
|
});
|
|
4915
4915
|
|
|
4916
|
-
// src/shared/config-path.ts
|
|
4917
|
-
var init_config_path = () => {};
|
|
4918
|
-
|
|
4919
4916
|
// src/shared/data-path.ts
|
|
4920
4917
|
import * as path2 from "path";
|
|
4921
4918
|
import * as os2 from "os";
|
|
4922
4919
|
function getDataDir() {
|
|
4923
4920
|
return process.env.XDG_DATA_HOME ?? path2.join(os2.homedir(), ".local", "share");
|
|
4924
4921
|
}
|
|
4922
|
+
function getOpenCodeStorageDir() {
|
|
4923
|
+
return path2.join(getDataDir(), "opencode", "storage");
|
|
4924
|
+
}
|
|
4925
|
+
function getCacheDir() {
|
|
4926
|
+
return process.env.XDG_CACHE_HOME ?? path2.join(os2.homedir(), ".cache");
|
|
4927
|
+
}
|
|
4928
|
+
function getOmoOpenCodeCacheDir() {
|
|
4929
|
+
return path2.join(getCacheDir(), "oh-my-opencode");
|
|
4930
|
+
}
|
|
4931
|
+
function getOpenCodeCacheDir() {
|
|
4932
|
+
return path2.join(getCacheDir(), "opencode");
|
|
4933
|
+
}
|
|
4925
4934
|
var init_data_path = () => {};
|
|
4926
4935
|
|
|
4927
4936
|
// src/shared/config-errors.ts
|
|
@@ -5983,6 +5992,7 @@ var init_model_requirements = __esm(() => {
|
|
|
5983
5992
|
explore: {
|
|
5984
5993
|
fallbackChain: [
|
|
5985
5994
|
{ providers: ["anthropic", "opencode"], model: "claude-haiku-4-5" },
|
|
5995
|
+
{ providers: ["github-copilot"], model: "gpt-5-mini" },
|
|
5986
5996
|
{ providers: ["opencode"], model: "gpt-5-nano" }
|
|
5987
5997
|
]
|
|
5988
5998
|
},
|
|
@@ -6078,28 +6088,165 @@ var init_model_requirements = __esm(() => {
|
|
|
6078
6088
|
};
|
|
6079
6089
|
});
|
|
6080
6090
|
|
|
6081
|
-
// src/shared/
|
|
6082
|
-
import { existsSync as existsSync3, readFileSync as readFileSync2 } from "fs";
|
|
6083
|
-
import { homedir as homedir3 } from "os";
|
|
6091
|
+
// src/shared/connected-providers-cache.ts
|
|
6092
|
+
import { existsSync as existsSync3, readFileSync as readFileSync2, writeFileSync, mkdirSync } from "fs";
|
|
6084
6093
|
import { join as join4 } from "path";
|
|
6085
|
-
function
|
|
6086
|
-
|
|
6087
|
-
if (xdgCache)
|
|
6088
|
-
return join4(xdgCache, "opencode");
|
|
6089
|
-
return join4(homedir3(), ".cache", "opencode");
|
|
6094
|
+
function getCacheFilePath(filename) {
|
|
6095
|
+
return join4(getOmoOpenCodeCacheDir(), filename);
|
|
6090
6096
|
}
|
|
6091
|
-
function
|
|
6092
|
-
const
|
|
6097
|
+
function ensureCacheDir() {
|
|
6098
|
+
const cacheDir = getOmoOpenCodeCacheDir();
|
|
6099
|
+
if (!existsSync3(cacheDir)) {
|
|
6100
|
+
mkdirSync(cacheDir, { recursive: true });
|
|
6101
|
+
}
|
|
6102
|
+
}
|
|
6103
|
+
function hasConnectedProvidersCache() {
|
|
6104
|
+
const cacheFile = getCacheFilePath(CONNECTED_PROVIDERS_CACHE_FILE);
|
|
6093
6105
|
return existsSync3(cacheFile);
|
|
6094
6106
|
}
|
|
6107
|
+
function writeConnectedProvidersCache(connected) {
|
|
6108
|
+
ensureCacheDir();
|
|
6109
|
+
const cacheFile = getCacheFilePath(CONNECTED_PROVIDERS_CACHE_FILE);
|
|
6110
|
+
const data = {
|
|
6111
|
+
connected,
|
|
6112
|
+
updatedAt: new Date().toISOString()
|
|
6113
|
+
};
|
|
6114
|
+
try {
|
|
6115
|
+
writeFileSync(cacheFile, JSON.stringify(data, null, 2));
|
|
6116
|
+
log("[connected-providers-cache] Cache written", { count: connected.length });
|
|
6117
|
+
} catch (err) {
|
|
6118
|
+
log("[connected-providers-cache] Error writing cache", { error: String(err) });
|
|
6119
|
+
}
|
|
6120
|
+
}
|
|
6121
|
+
function hasProviderModelsCache() {
|
|
6122
|
+
const cacheFile = getCacheFilePath(PROVIDER_MODELS_CACHE_FILE);
|
|
6123
|
+
return existsSync3(cacheFile);
|
|
6124
|
+
}
|
|
6125
|
+
function writeProviderModelsCache(data) {
|
|
6126
|
+
ensureCacheDir();
|
|
6127
|
+
const cacheFile = getCacheFilePath(PROVIDER_MODELS_CACHE_FILE);
|
|
6128
|
+
const cacheData = {
|
|
6129
|
+
...data,
|
|
6130
|
+
updatedAt: new Date().toISOString()
|
|
6131
|
+
};
|
|
6132
|
+
try {
|
|
6133
|
+
writeFileSync(cacheFile, JSON.stringify(cacheData, null, 2));
|
|
6134
|
+
log("[connected-providers-cache] Provider-models cache written", {
|
|
6135
|
+
providerCount: Object.keys(data.models).length
|
|
6136
|
+
});
|
|
6137
|
+
} catch (err) {
|
|
6138
|
+
log("[connected-providers-cache] Error writing provider-models cache", { error: String(err) });
|
|
6139
|
+
}
|
|
6140
|
+
}
|
|
6141
|
+
async function updateConnectedProvidersCache(client) {
|
|
6142
|
+
if (!client?.provider?.list) {
|
|
6143
|
+
log("[connected-providers-cache] client.provider.list not available");
|
|
6144
|
+
return;
|
|
6145
|
+
}
|
|
6146
|
+
try {
|
|
6147
|
+
const result = await client.provider.list();
|
|
6148
|
+
const connected = result.data?.connected ?? [];
|
|
6149
|
+
log("[connected-providers-cache] Fetched connected providers", { count: connected.length, providers: connected });
|
|
6150
|
+
writeConnectedProvidersCache(connected);
|
|
6151
|
+
if (client.model?.list) {
|
|
6152
|
+
try {
|
|
6153
|
+
const modelsResult = await client.model.list();
|
|
6154
|
+
const models = modelsResult.data ?? [];
|
|
6155
|
+
const modelsByProvider = {};
|
|
6156
|
+
for (const model of models) {
|
|
6157
|
+
if (!modelsByProvider[model.provider]) {
|
|
6158
|
+
modelsByProvider[model.provider] = [];
|
|
6159
|
+
}
|
|
6160
|
+
modelsByProvider[model.provider].push(model.id);
|
|
6161
|
+
}
|
|
6162
|
+
writeProviderModelsCache({
|
|
6163
|
+
models: modelsByProvider,
|
|
6164
|
+
connected
|
|
6165
|
+
});
|
|
6166
|
+
log("[connected-providers-cache] Provider-models cache updated", {
|
|
6167
|
+
providerCount: Object.keys(modelsByProvider).length,
|
|
6168
|
+
totalModels: models.length
|
|
6169
|
+
});
|
|
6170
|
+
} catch (modelErr) {
|
|
6171
|
+
log("[connected-providers-cache] Error fetching models", { error: String(modelErr) });
|
|
6172
|
+
}
|
|
6173
|
+
}
|
|
6174
|
+
} catch (err) {
|
|
6175
|
+
log("[connected-providers-cache] Error updating cache", { error: String(err) });
|
|
6176
|
+
}
|
|
6177
|
+
}
|
|
6178
|
+
var CONNECTED_PROVIDERS_CACHE_FILE = "connected-providers.json", PROVIDER_MODELS_CACHE_FILE = "provider-models.json";
|
|
6179
|
+
var init_connected_providers_cache = __esm(() => {
|
|
6180
|
+
init_logger();
|
|
6181
|
+
init_data_path();
|
|
6182
|
+
});
|
|
6183
|
+
|
|
6184
|
+
// src/shared/model-availability.ts
|
|
6185
|
+
import { existsSync as existsSync4, readFileSync as readFileSync3 } from "fs";
|
|
6186
|
+
import { join as join5 } from "path";
|
|
6187
|
+
function isModelCacheAvailable() {
|
|
6188
|
+
if (hasProviderModelsCache()) {
|
|
6189
|
+
return true;
|
|
6190
|
+
}
|
|
6191
|
+
const cacheFile = join5(getOpenCodeCacheDir(), "models.json");
|
|
6192
|
+
return existsSync4(cacheFile);
|
|
6193
|
+
}
|
|
6095
6194
|
var init_model_availability = __esm(() => {
|
|
6096
6195
|
init_logger();
|
|
6196
|
+
init_data_path();
|
|
6197
|
+
init_connected_providers_cache();
|
|
6097
6198
|
});
|
|
6098
6199
|
|
|
6099
6200
|
// src/shared/model-resolver.ts
|
|
6100
6201
|
var init_model_resolver = __esm(() => {
|
|
6101
6202
|
init_logger();
|
|
6102
6203
|
init_model_availability();
|
|
6204
|
+
init_connected_providers_cache();
|
|
6205
|
+
});
|
|
6206
|
+
|
|
6207
|
+
// src/features/hook-message-injector/constants.ts
|
|
6208
|
+
import { join as join6 } from "path";
|
|
6209
|
+
var OPENCODE_STORAGE, MESSAGE_STORAGE, PART_STORAGE;
|
|
6210
|
+
var init_constants = __esm(() => {
|
|
6211
|
+
init_data_path();
|
|
6212
|
+
OPENCODE_STORAGE = getOpenCodeStorageDir();
|
|
6213
|
+
MESSAGE_STORAGE = join6(OPENCODE_STORAGE, "message");
|
|
6214
|
+
PART_STORAGE = join6(OPENCODE_STORAGE, "part");
|
|
6215
|
+
});
|
|
6216
|
+
|
|
6217
|
+
// src/features/hook-message-injector/injector.ts
|
|
6218
|
+
var init_injector = __esm(() => {
|
|
6219
|
+
init_constants();
|
|
6220
|
+
});
|
|
6221
|
+
|
|
6222
|
+
// src/features/hook-message-injector/index.ts
|
|
6223
|
+
var init_hook_message_injector = __esm(() => {
|
|
6224
|
+
init_injector();
|
|
6225
|
+
init_constants();
|
|
6226
|
+
});
|
|
6227
|
+
|
|
6228
|
+
// src/shared/session-utils.ts
|
|
6229
|
+
var init_session_utils = __esm(() => {
|
|
6230
|
+
init_hook_message_injector();
|
|
6231
|
+
});
|
|
6232
|
+
// src/shared/tmux/constants.ts
|
|
6233
|
+
var SESSION_TIMEOUT_MS;
|
|
6234
|
+
var init_constants2 = __esm(() => {
|
|
6235
|
+
SESSION_TIMEOUT_MS = 10 * 60 * 1000;
|
|
6236
|
+
});
|
|
6237
|
+
|
|
6238
|
+
// src/tools/interactive-bash/utils.ts
|
|
6239
|
+
var init_utils = () => {};
|
|
6240
|
+
|
|
6241
|
+
// src/shared/tmux/tmux-utils.ts
|
|
6242
|
+
var init_tmux_utils = __esm(() => {
|
|
6243
|
+
init_utils();
|
|
6244
|
+
});
|
|
6245
|
+
|
|
6246
|
+
// src/shared/tmux/index.ts
|
|
6247
|
+
var init_tmux = __esm(() => {
|
|
6248
|
+
init_constants2();
|
|
6249
|
+
init_tmux_utils();
|
|
6103
6250
|
});
|
|
6104
6251
|
|
|
6105
6252
|
// src/shared/index.ts
|
|
@@ -6113,7 +6260,6 @@ var init_shared = __esm(() => {
|
|
|
6113
6260
|
init_deep_merge();
|
|
6114
6261
|
init_file_utils();
|
|
6115
6262
|
init_dynamic_truncator();
|
|
6116
|
-
init_config_path();
|
|
6117
6263
|
init_data_path();
|
|
6118
6264
|
init_config_errors();
|
|
6119
6265
|
init_claude_config_dir();
|
|
@@ -6130,6 +6276,9 @@ var init_shared = __esm(() => {
|
|
|
6130
6276
|
init_model_requirements();
|
|
6131
6277
|
init_model_resolver();
|
|
6132
6278
|
init_model_availability();
|
|
6279
|
+
init_connected_providers_cache();
|
|
6280
|
+
init_session_utils();
|
|
6281
|
+
init_tmux();
|
|
6133
6282
|
});
|
|
6134
6283
|
|
|
6135
6284
|
// src/cli/model-fallback.ts
|
|
@@ -6209,6 +6358,8 @@ function generateModelConfig(config) {
|
|
|
6209
6358
|
agents[role] = { model: "anthropic/claude-haiku-4-5" };
|
|
6210
6359
|
} else if (avail.opencodeZen) {
|
|
6211
6360
|
agents[role] = { model: "opencode/claude-haiku-4-5" };
|
|
6361
|
+
} else if (avail.copilot) {
|
|
6362
|
+
agents[role] = { model: "github-copilot/gpt-5-mini" };
|
|
6212
6363
|
} else {
|
|
6213
6364
|
agents[role] = { model: "opencode/gpt-5-nano" };
|
|
6214
6365
|
}
|
|
@@ -6245,7 +6396,7 @@ var init_model_fallback = __esm(() => {
|
|
|
6245
6396
|
});
|
|
6246
6397
|
|
|
6247
6398
|
// src/cli/config-manager.ts
|
|
6248
|
-
import { existsSync as
|
|
6399
|
+
import { existsSync as existsSync5, mkdirSync as mkdirSync2, readFileSync as readFileSync4, writeFileSync as writeFileSync2, statSync } from "fs";
|
|
6249
6400
|
function initConfigContext(binary2, version) {
|
|
6250
6401
|
const paths = getOpenCodeConfigPaths({ binary: binary2, version });
|
|
6251
6402
|
configContext = { binary: binary2, version, paths };
|
|
@@ -6335,10 +6486,10 @@ async function getPluginNameWithVersion(currentVersion) {
|
|
|
6335
6486
|
function detectConfigFormat() {
|
|
6336
6487
|
const configJsonc = getConfigJsonc();
|
|
6337
6488
|
const configJson = getConfigJson();
|
|
6338
|
-
if (
|
|
6489
|
+
if (existsSync5(configJsonc)) {
|
|
6339
6490
|
return { format: "jsonc", path: configJsonc };
|
|
6340
6491
|
}
|
|
6341
|
-
if (
|
|
6492
|
+
if (existsSync5(configJson)) {
|
|
6342
6493
|
return { format: "json", path: configJson };
|
|
6343
6494
|
}
|
|
6344
6495
|
return { format: "none", path: configJson };
|
|
@@ -6352,7 +6503,7 @@ function parseConfigWithError(path3) {
|
|
|
6352
6503
|
if (stat.size === 0) {
|
|
6353
6504
|
return { config: null, error: `Config file is empty: ${path3}. Delete it or add valid JSON content.` };
|
|
6354
6505
|
}
|
|
6355
|
-
const content =
|
|
6506
|
+
const content = readFileSync4(path3, "utf-8");
|
|
6356
6507
|
if (isEmptyOrWhitespace(content)) {
|
|
6357
6508
|
return { config: null, error: `Config file contains only whitespace: ${path3}. Delete it or add valid JSON content.` };
|
|
6358
6509
|
}
|
|
@@ -6370,8 +6521,8 @@ function parseConfigWithError(path3) {
|
|
|
6370
6521
|
}
|
|
6371
6522
|
function ensureConfigDir() {
|
|
6372
6523
|
const configDir = getConfigDir();
|
|
6373
|
-
if (!
|
|
6374
|
-
|
|
6524
|
+
if (!existsSync5(configDir)) {
|
|
6525
|
+
mkdirSync2(configDir, { recursive: true });
|
|
6375
6526
|
}
|
|
6376
6527
|
}
|
|
6377
6528
|
async function addPluginToOpenCodeConfig(currentVersion) {
|
|
@@ -6385,7 +6536,7 @@ async function addPluginToOpenCodeConfig(currentVersion) {
|
|
|
6385
6536
|
try {
|
|
6386
6537
|
if (format2 === "none") {
|
|
6387
6538
|
const config2 = { plugin: [pluginEntry] };
|
|
6388
|
-
|
|
6539
|
+
writeFileSync2(path3, JSON.stringify(config2, null, 2) + `
|
|
6389
6540
|
`);
|
|
6390
6541
|
return { success: true, configPath: path3 };
|
|
6391
6542
|
}
|
|
@@ -6406,7 +6557,7 @@ async function addPluginToOpenCodeConfig(currentVersion) {
|
|
|
6406
6557
|
}
|
|
6407
6558
|
config.plugin = plugins;
|
|
6408
6559
|
if (format2 === "jsonc") {
|
|
6409
|
-
const content =
|
|
6560
|
+
const content = readFileSync4(path3, "utf-8");
|
|
6410
6561
|
const pluginArrayRegex = /"plugin"\s*:\s*\[([\s\S]*?)\]/;
|
|
6411
6562
|
const match = content.match(pluginArrayRegex);
|
|
6412
6563
|
if (match) {
|
|
@@ -6415,14 +6566,14 @@ async function addPluginToOpenCodeConfig(currentVersion) {
|
|
|
6415
6566
|
const newContent = content.replace(pluginArrayRegex, `"plugin": [
|
|
6416
6567
|
${formattedPlugins}
|
|
6417
6568
|
]`);
|
|
6418
|
-
|
|
6569
|
+
writeFileSync2(path3, newContent);
|
|
6419
6570
|
} else {
|
|
6420
6571
|
const newContent = content.replace(/^(\s*\{)/, `$1
|
|
6421
6572
|
"plugin": ["${pluginEntry}"],`);
|
|
6422
|
-
|
|
6573
|
+
writeFileSync2(path3, newContent);
|
|
6423
6574
|
}
|
|
6424
6575
|
} else {
|
|
6425
|
-
|
|
6576
|
+
writeFileSync2(path3, JSON.stringify(config, null, 2) + `
|
|
6426
6577
|
`);
|
|
6427
6578
|
}
|
|
6428
6579
|
return { success: true, configPath: path3 };
|
|
@@ -6455,34 +6606,34 @@ function writeOmoConfig(installConfig) {
|
|
|
6455
6606
|
const omoConfigPath = getOmoConfig();
|
|
6456
6607
|
try {
|
|
6457
6608
|
const newConfig = generateOmoConfig(installConfig);
|
|
6458
|
-
if (
|
|
6609
|
+
if (existsSync5(omoConfigPath)) {
|
|
6459
6610
|
try {
|
|
6460
6611
|
const stat = statSync(omoConfigPath);
|
|
6461
|
-
const content =
|
|
6612
|
+
const content = readFileSync4(omoConfigPath, "utf-8");
|
|
6462
6613
|
if (stat.size === 0 || isEmptyOrWhitespace(content)) {
|
|
6463
|
-
|
|
6614
|
+
writeFileSync2(omoConfigPath, JSON.stringify(newConfig, null, 2) + `
|
|
6464
6615
|
`);
|
|
6465
6616
|
return { success: true, configPath: omoConfigPath };
|
|
6466
6617
|
}
|
|
6467
6618
|
const existing = parseJsonc(content);
|
|
6468
6619
|
if (!existing || typeof existing !== "object" || Array.isArray(existing)) {
|
|
6469
|
-
|
|
6620
|
+
writeFileSync2(omoConfigPath, JSON.stringify(newConfig, null, 2) + `
|
|
6470
6621
|
`);
|
|
6471
6622
|
return { success: true, configPath: omoConfigPath };
|
|
6472
6623
|
}
|
|
6473
6624
|
const merged = deepMerge(existing, newConfig);
|
|
6474
|
-
|
|
6625
|
+
writeFileSync2(omoConfigPath, JSON.stringify(merged, null, 2) + `
|
|
6475
6626
|
`);
|
|
6476
6627
|
} catch (parseErr) {
|
|
6477
6628
|
if (parseErr instanceof SyntaxError) {
|
|
6478
|
-
|
|
6629
|
+
writeFileSync2(omoConfigPath, JSON.stringify(newConfig, null, 2) + `
|
|
6479
6630
|
`);
|
|
6480
6631
|
return { success: true, configPath: omoConfigPath };
|
|
6481
6632
|
}
|
|
6482
6633
|
throw parseErr;
|
|
6483
6634
|
}
|
|
6484
6635
|
} else {
|
|
6485
|
-
|
|
6636
|
+
writeFileSync2(omoConfigPath, JSON.stringify(newConfig, null, 2) + `
|
|
6486
6637
|
`);
|
|
6487
6638
|
}
|
|
6488
6639
|
return { success: true, configPath: omoConfigPath };
|
|
@@ -6544,7 +6695,7 @@ async function addAuthPlugins(config) {
|
|
|
6544
6695
|
}
|
|
6545
6696
|
}
|
|
6546
6697
|
const newConfig = { ...existingConfig ?? {}, plugin: plugins };
|
|
6547
|
-
|
|
6698
|
+
writeFileSync2(path3, JSON.stringify(newConfig, null, 2) + `
|
|
6548
6699
|
`);
|
|
6549
6700
|
return { success: true, configPath: path3 };
|
|
6550
6701
|
} catch (err) {
|
|
@@ -6616,7 +6767,7 @@ function addProviderConfig(config) {
|
|
|
6616
6767
|
if (Object.keys(providers).length > 0) {
|
|
6617
6768
|
newConfig.provider = providers;
|
|
6618
6769
|
}
|
|
6619
|
-
|
|
6770
|
+
writeFileSync2(path3, JSON.stringify(newConfig, null, 2) + `
|
|
6620
6771
|
`);
|
|
6621
6772
|
return { success: true, configPath: path3 };
|
|
6622
6773
|
} catch (err) {
|
|
@@ -6625,11 +6776,11 @@ function addProviderConfig(config) {
|
|
|
6625
6776
|
}
|
|
6626
6777
|
function detectProvidersFromOmoConfig() {
|
|
6627
6778
|
const omoConfigPath = getOmoConfig();
|
|
6628
|
-
if (!
|
|
6779
|
+
if (!existsSync5(omoConfigPath)) {
|
|
6629
6780
|
return { hasOpenAI: true, hasOpencodeZen: true, hasZaiCodingPlan: false };
|
|
6630
6781
|
}
|
|
6631
6782
|
try {
|
|
6632
|
-
const content =
|
|
6783
|
+
const content = readFileSync4(omoConfigPath, "utf-8");
|
|
6633
6784
|
const omoConfig = parseJsonc(content);
|
|
6634
6785
|
if (!omoConfig || typeof omoConfig !== "object") {
|
|
6635
6786
|
return { hasOpenAI: true, hasOpencodeZen: true, hasZaiCodingPlan: false };
|
|
@@ -6686,25 +6837,48 @@ var init_config_manager = __esm(() => {
|
|
|
6686
6837
|
google: {
|
|
6687
6838
|
name: "Google",
|
|
6688
6839
|
models: {
|
|
6689
|
-
"antigravity-gemini-3-pro
|
|
6690
|
-
name: "Gemini 3 Pro
|
|
6691
|
-
thinking: true,
|
|
6692
|
-
attachment: true,
|
|
6693
|
-
limit: { context: 1048576, output: 65535 },
|
|
6694
|
-
modalities: { input: ["text", "image", "pdf"], output: ["text"] }
|
|
6695
|
-
},
|
|
6696
|
-
"antigravity-gemini-3-pro-low": {
|
|
6697
|
-
name: "Gemini 3 Pro Low (Antigravity)",
|
|
6698
|
-
thinking: true,
|
|
6699
|
-
attachment: true,
|
|
6840
|
+
"antigravity-gemini-3-pro": {
|
|
6841
|
+
name: "Gemini 3 Pro (Antigravity)",
|
|
6700
6842
|
limit: { context: 1048576, output: 65535 },
|
|
6701
|
-
modalities: { input: ["text", "image", "pdf"], output: ["text"] }
|
|
6843
|
+
modalities: { input: ["text", "image", "pdf"], output: ["text"] },
|
|
6844
|
+
variants: {
|
|
6845
|
+
low: { thinkingLevel: "low" },
|
|
6846
|
+
high: { thinkingLevel: "high" }
|
|
6847
|
+
}
|
|
6702
6848
|
},
|
|
6703
6849
|
"antigravity-gemini-3-flash": {
|
|
6704
6850
|
name: "Gemini 3 Flash (Antigravity)",
|
|
6705
|
-
attachment: true,
|
|
6706
6851
|
limit: { context: 1048576, output: 65536 },
|
|
6852
|
+
modalities: { input: ["text", "image", "pdf"], output: ["text"] },
|
|
6853
|
+
variants: {
|
|
6854
|
+
minimal: { thinkingLevel: "minimal" },
|
|
6855
|
+
low: { thinkingLevel: "low" },
|
|
6856
|
+
medium: { thinkingLevel: "medium" },
|
|
6857
|
+
high: { thinkingLevel: "high" }
|
|
6858
|
+
}
|
|
6859
|
+
},
|
|
6860
|
+
"antigravity-claude-sonnet-4-5": {
|
|
6861
|
+
name: "Claude Sonnet 4.5 (Antigravity)",
|
|
6862
|
+
limit: { context: 200000, output: 64000 },
|
|
6707
6863
|
modalities: { input: ["text", "image", "pdf"], output: ["text"] }
|
|
6864
|
+
},
|
|
6865
|
+
"antigravity-claude-sonnet-4-5-thinking": {
|
|
6866
|
+
name: "Claude Sonnet 4.5 Thinking (Antigravity)",
|
|
6867
|
+
limit: { context: 200000, output: 64000 },
|
|
6868
|
+
modalities: { input: ["text", "image", "pdf"], output: ["text"] },
|
|
6869
|
+
variants: {
|
|
6870
|
+
low: { thinkingConfig: { thinkingBudget: 8192 } },
|
|
6871
|
+
max: { thinkingConfig: { thinkingBudget: 32768 } }
|
|
6872
|
+
}
|
|
6873
|
+
},
|
|
6874
|
+
"antigravity-claude-opus-4-5-thinking": {
|
|
6875
|
+
name: "Claude Opus 4.5 Thinking (Antigravity)",
|
|
6876
|
+
limit: { context: 200000, output: 64000 },
|
|
6877
|
+
modalities: { input: ["text", "image", "pdf"], output: ["text"] },
|
|
6878
|
+
variants: {
|
|
6879
|
+
low: { thinkingConfig: { thinkingBudget: 8192 } },
|
|
6880
|
+
max: { thinkingConfig: { thinkingBudget: 32768 } }
|
|
6881
|
+
}
|
|
6708
6882
|
}
|
|
6709
6883
|
}
|
|
6710
6884
|
}
|
|
@@ -6714,7 +6888,7 @@ var init_config_manager = __esm(() => {
|
|
|
6714
6888
|
// src/hooks/auto-update-checker/constants.ts
|
|
6715
6889
|
import * as path3 from "path";
|
|
6716
6890
|
import * as os3 from "os";
|
|
6717
|
-
function
|
|
6891
|
+
function getCacheDir2() {
|
|
6718
6892
|
if (process.platform === "win32") {
|
|
6719
6893
|
return path3.join(process.env.LOCALAPPDATA ?? os3.homedir(), "opencode");
|
|
6720
6894
|
}
|
|
@@ -6726,10 +6900,10 @@ function getWindowsAppdataDir() {
|
|
|
6726
6900
|
return process.env.APPDATA ?? path3.join(os3.homedir(), "AppData", "Roaming");
|
|
6727
6901
|
}
|
|
6728
6902
|
var PACKAGE_NAME2 = "oh-my-opencode", NPM_REGISTRY_URL, NPM_FETCH_TIMEOUT = 5000, CACHE_DIR, VERSION_FILE, INSTALLED_PACKAGE_JSON, USER_CONFIG_DIR, USER_OPENCODE_CONFIG, USER_OPENCODE_CONFIG_JSONC;
|
|
6729
|
-
var
|
|
6903
|
+
var init_constants3 = __esm(() => {
|
|
6730
6904
|
init_shared();
|
|
6731
6905
|
NPM_REGISTRY_URL = `https://registry.npmjs.org/-/package/${PACKAGE_NAME2}/dist-tags`;
|
|
6732
|
-
CACHE_DIR =
|
|
6906
|
+
CACHE_DIR = getCacheDir2();
|
|
6733
6907
|
VERSION_FILE = path3.join(CACHE_DIR, "version");
|
|
6734
6908
|
INSTALLED_PACKAGE_JSON = path3.join(CACHE_DIR, "node_modules", PACKAGE_NAME2, "package.json");
|
|
6735
6909
|
USER_CONFIG_DIR = getOpenCodeConfigDir({ binary: "opencode" });
|
|
@@ -6806,7 +6980,7 @@ function invalidateCache() {
|
|
|
6806
6980
|
return invalidatePackage();
|
|
6807
6981
|
}
|
|
6808
6982
|
var init_cache = __esm(() => {
|
|
6809
|
-
|
|
6983
|
+
init_constants3();
|
|
6810
6984
|
init_logger();
|
|
6811
6985
|
});
|
|
6812
6986
|
|
|
@@ -6878,6 +7052,7 @@ v${latestVersion} available. Restart OpenCode to apply.` : `OpenCode is now on S
|
|
|
6878
7052
|
const displayVersion = localDevVersion ?? cachedVersion;
|
|
6879
7053
|
await showConfigErrorsIfAny(ctx);
|
|
6880
7054
|
await showModelCacheWarningIfNeeded(ctx);
|
|
7055
|
+
await updateAndShowConnectedProvidersCacheStatus(ctx);
|
|
6881
7056
|
if (localDevVersion) {
|
|
6882
7057
|
if (showStartupToast) {
|
|
6883
7058
|
showLocalDevToast(ctx, displayVersion, isSisyphusEnabled).catch(() => {});
|
|
@@ -6964,6 +7139,23 @@ async function showModelCacheWarningIfNeeded(ctx) {
|
|
|
6964
7139
|
}).catch(() => {});
|
|
6965
7140
|
log("[auto-update-checker] Model cache warning shown");
|
|
6966
7141
|
}
|
|
7142
|
+
async function updateAndShowConnectedProvidersCacheStatus(ctx) {
|
|
7143
|
+
const hadCache = hasConnectedProvidersCache();
|
|
7144
|
+
updateConnectedProvidersCache(ctx.client).catch(() => {});
|
|
7145
|
+
if (!hadCache) {
|
|
7146
|
+
await ctx.client.tui.showToast({
|
|
7147
|
+
body: {
|
|
7148
|
+
title: "Connected Providers Cache",
|
|
7149
|
+
message: "Building provider cache for first time. Restart OpenCode for full model filtering.",
|
|
7150
|
+
variant: "info",
|
|
7151
|
+
duration: 8000
|
|
7152
|
+
}
|
|
7153
|
+
}).catch(() => {});
|
|
7154
|
+
log("[auto-update-checker] Connected providers cache toast shown (first run)");
|
|
7155
|
+
} else {
|
|
7156
|
+
log("[auto-update-checker] Connected providers cache exists, updating in background");
|
|
7157
|
+
}
|
|
7158
|
+
}
|
|
6967
7159
|
async function showConfigErrorsIfAny(ctx) {
|
|
6968
7160
|
const errors = getConfigLoadErrors();
|
|
6969
7161
|
if (errors.length === 0)
|
|
@@ -7037,11 +7229,12 @@ var SISYPHUS_SPINNER;
|
|
|
7037
7229
|
var init_auto_update_checker = __esm(() => {
|
|
7038
7230
|
init_checker();
|
|
7039
7231
|
init_cache();
|
|
7040
|
-
|
|
7232
|
+
init_constants3();
|
|
7041
7233
|
init_logger();
|
|
7042
7234
|
init_config_errors();
|
|
7043
7235
|
init_config_manager();
|
|
7044
7236
|
init_model_availability();
|
|
7237
|
+
init_connected_providers_cache();
|
|
7045
7238
|
init_checker();
|
|
7046
7239
|
init_cache();
|
|
7047
7240
|
SISYPHUS_SPINNER = ["\xB7", "\u2022", "\u25CF", "\u25CB", "\u25CC", "\u25E6", " "];
|
|
@@ -7276,7 +7469,7 @@ async function checkForUpdate(directory) {
|
|
|
7276
7469
|
return { needsUpdate, currentVersion, latestVersion, isLocalDev: false, isPinned: pluginInfo.isPinned };
|
|
7277
7470
|
}
|
|
7278
7471
|
var init_checker = __esm(() => {
|
|
7279
|
-
|
|
7472
|
+
init_constants3();
|
|
7280
7473
|
init_logger();
|
|
7281
7474
|
});
|
|
7282
7475
|
|
|
@@ -7882,7 +8075,7 @@ var import_picocolors2 = __toESM(require_picocolors(), 1);
|
|
|
7882
8075
|
// package.json
|
|
7883
8076
|
var package_default = {
|
|
7884
8077
|
name: "oh-my-opencode",
|
|
7885
|
-
version: "3.
|
|
8078
|
+
version: "3.1.0",
|
|
7886
8079
|
description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
7887
8080
|
main: "dist/index.js",
|
|
7888
8081
|
types: "dist/index.d.ts",
|
|
@@ -7955,13 +8148,13 @@ var package_default = {
|
|
|
7955
8148
|
typescript: "^5.7.3"
|
|
7956
8149
|
},
|
|
7957
8150
|
optionalDependencies: {
|
|
7958
|
-
"oh-my-opencode-darwin-arm64": "3.
|
|
7959
|
-
"oh-my-opencode-darwin-x64": "3.
|
|
7960
|
-
"oh-my-opencode-linux-arm64": "3.
|
|
7961
|
-
"oh-my-opencode-linux-arm64-musl": "3.
|
|
7962
|
-
"oh-my-opencode-linux-x64": "3.
|
|
7963
|
-
"oh-my-opencode-linux-x64-musl": "3.
|
|
7964
|
-
"oh-my-opencode-windows-x64": "3.
|
|
8151
|
+
"oh-my-opencode-darwin-arm64": "3.1.0",
|
|
8152
|
+
"oh-my-opencode-darwin-x64": "3.1.0",
|
|
8153
|
+
"oh-my-opencode-linux-arm64": "3.1.0",
|
|
8154
|
+
"oh-my-opencode-linux-arm64-musl": "3.1.0",
|
|
8155
|
+
"oh-my-opencode-linux-x64": "3.1.0",
|
|
8156
|
+
"oh-my-opencode-linux-x64-musl": "3.1.0",
|
|
8157
|
+
"oh-my-opencode-windows-x64": "3.1.0"
|
|
7965
8158
|
},
|
|
7966
8159
|
trustedDependencies: [
|
|
7967
8160
|
"@ast-grep/cli",
|
|
@@ -10623,14 +10816,14 @@ function getOpenCodeCheckDefinition() {
|
|
|
10623
10816
|
}
|
|
10624
10817
|
|
|
10625
10818
|
// src/cli/doctor/checks/plugin.ts
|
|
10626
|
-
import { existsSync as
|
|
10819
|
+
import { existsSync as existsSync8, readFileSync as readFileSync7 } from "fs";
|
|
10627
10820
|
init_shared();
|
|
10628
10821
|
function detectConfigPath() {
|
|
10629
10822
|
const paths = getOpenCodeConfigPaths({ binary: "opencode", version: null });
|
|
10630
|
-
if (
|
|
10823
|
+
if (existsSync8(paths.configJsonc)) {
|
|
10631
10824
|
return { path: paths.configJsonc, format: "jsonc" };
|
|
10632
10825
|
}
|
|
10633
|
-
if (
|
|
10826
|
+
if (existsSync8(paths.configJson)) {
|
|
10634
10827
|
return { path: paths.configJson, format: "json" };
|
|
10635
10828
|
}
|
|
10636
10829
|
return null;
|
|
@@ -10660,7 +10853,7 @@ function getPluginInfo() {
|
|
|
10660
10853
|
};
|
|
10661
10854
|
}
|
|
10662
10855
|
try {
|
|
10663
|
-
const content =
|
|
10856
|
+
const content = readFileSync7(configInfo.path, "utf-8");
|
|
10664
10857
|
const config = parseJsonc(content);
|
|
10665
10858
|
const plugins = config.plugin ?? [];
|
|
10666
10859
|
const pluginEntry = findPluginEntry2(plugins);
|
|
@@ -10734,8 +10927,8 @@ function getPluginCheckDefinition() {
|
|
|
10734
10927
|
}
|
|
10735
10928
|
|
|
10736
10929
|
// src/cli/doctor/checks/config.ts
|
|
10737
|
-
import { existsSync as
|
|
10738
|
-
import { join as
|
|
10930
|
+
import { existsSync as existsSync9, readFileSync as readFileSync8 } from "fs";
|
|
10931
|
+
import { join as join10 } from "path";
|
|
10739
10932
|
init_shared();
|
|
10740
10933
|
|
|
10741
10934
|
// node_modules/zod/v4/classic/external.js
|
|
@@ -20822,10 +21015,10 @@ function _property(property, schema2, params) {
|
|
|
20822
21015
|
...normalizeParams(params)
|
|
20823
21016
|
});
|
|
20824
21017
|
}
|
|
20825
|
-
function _mime(
|
|
21018
|
+
function _mime(types3, params) {
|
|
20826
21019
|
return new $ZodCheckMimeType({
|
|
20827
21020
|
check: "mime_type",
|
|
20828
|
-
mime:
|
|
21021
|
+
mime: types3,
|
|
20829
21022
|
...normalizeParams(params)
|
|
20830
21023
|
});
|
|
20831
21024
|
}
|
|
@@ -22735,7 +22928,7 @@ var ZodFile = /* @__PURE__ */ $constructor("ZodFile", (inst, def) => {
|
|
|
22735
22928
|
ZodType.init(inst, def);
|
|
22736
22929
|
inst.min = (size, params) => inst.check(_minSize(size, params));
|
|
22737
22930
|
inst.max = (size, params) => inst.check(_maxSize(size, params));
|
|
22738
|
-
inst.mime = (
|
|
22931
|
+
inst.mime = (types3, params) => inst.check(_mime(Array.isArray(types3) ? types3 : [types3], params));
|
|
22739
22932
|
});
|
|
22740
22933
|
function file(params) {
|
|
22741
22934
|
return _file(ZodFile, params);
|
|
@@ -23083,6 +23276,7 @@ var BuiltinAgentNameSchema = exports_external.enum([
|
|
|
23083
23276
|
]);
|
|
23084
23277
|
var BuiltinSkillNameSchema = exports_external.enum([
|
|
23085
23278
|
"playwright",
|
|
23279
|
+
"agent-browser",
|
|
23086
23280
|
"frontend-ui-ux",
|
|
23087
23281
|
"git-master"
|
|
23088
23282
|
]);
|
|
@@ -23124,12 +23318,14 @@ var HookNameSchema = exports_external.enum([
|
|
|
23124
23318
|
"interactive-bash-session",
|
|
23125
23319
|
"thinking-block-validator",
|
|
23126
23320
|
"ralph-loop",
|
|
23321
|
+
"category-skill-reminder",
|
|
23127
23322
|
"compaction-context-injector",
|
|
23128
23323
|
"claude-code-hooks",
|
|
23129
23324
|
"auto-slash-command",
|
|
23130
23325
|
"edit-error-recovery",
|
|
23131
23326
|
"delegate-task-retry",
|
|
23132
23327
|
"prometheus-md-only",
|
|
23328
|
+
"sisyphus-junior-notepad",
|
|
23133
23329
|
"start-work",
|
|
23134
23330
|
"atlas"
|
|
23135
23331
|
]);
|
|
@@ -23301,6 +23497,24 @@ var GitMasterConfigSchema = exports_external.object({
|
|
|
23301
23497
|
commit_footer: exports_external.boolean().default(true),
|
|
23302
23498
|
include_co_authored_by: exports_external.boolean().default(true)
|
|
23303
23499
|
});
|
|
23500
|
+
var BrowserAutomationProviderSchema = exports_external.enum(["playwright", "agent-browser"]);
|
|
23501
|
+
var BrowserAutomationConfigSchema = exports_external.object({
|
|
23502
|
+
provider: BrowserAutomationProviderSchema.default("playwright")
|
|
23503
|
+
});
|
|
23504
|
+
var TmuxLayoutSchema = exports_external.enum([
|
|
23505
|
+
"main-horizontal",
|
|
23506
|
+
"main-vertical",
|
|
23507
|
+
"tiled",
|
|
23508
|
+
"even-horizontal",
|
|
23509
|
+
"even-vertical"
|
|
23510
|
+
]);
|
|
23511
|
+
var TmuxConfigSchema = exports_external.object({
|
|
23512
|
+
enabled: exports_external.boolean().default(false),
|
|
23513
|
+
layout: TmuxLayoutSchema.default("main-vertical"),
|
|
23514
|
+
main_pane_size: exports_external.number().min(20).max(80).default(60),
|
|
23515
|
+
main_pane_min_width: exports_external.number().min(40).default(120),
|
|
23516
|
+
agent_pane_min_width: exports_external.number().min(20).default(40)
|
|
23517
|
+
});
|
|
23304
23518
|
var OhMyOpenCodeConfigSchema = exports_external.object({
|
|
23305
23519
|
$schema: exports_external.string().optional(),
|
|
23306
23520
|
disabled_mcps: exports_external.array(AnyMcpNameSchema).optional(),
|
|
@@ -23319,12 +23533,14 @@ var OhMyOpenCodeConfigSchema = exports_external.object({
|
|
|
23319
23533
|
ralph_loop: RalphLoopConfigSchema.optional(),
|
|
23320
23534
|
background_task: BackgroundTaskConfigSchema.optional(),
|
|
23321
23535
|
notification: NotificationConfigSchema.optional(),
|
|
23322
|
-
git_master: GitMasterConfigSchema.optional()
|
|
23536
|
+
git_master: GitMasterConfigSchema.optional(),
|
|
23537
|
+
browser_automation_engine: BrowserAutomationConfigSchema.optional(),
|
|
23538
|
+
tmux: TmuxConfigSchema.optional()
|
|
23323
23539
|
});
|
|
23324
23540
|
// src/cli/doctor/checks/config.ts
|
|
23325
23541
|
var USER_CONFIG_DIR2 = getOpenCodeConfigDir({ binary: "opencode" });
|
|
23326
|
-
var USER_CONFIG_BASE =
|
|
23327
|
-
var PROJECT_CONFIG_BASE =
|
|
23542
|
+
var USER_CONFIG_BASE = join10(USER_CONFIG_DIR2, `${PACKAGE_NAME3}`);
|
|
23543
|
+
var PROJECT_CONFIG_BASE = join10(process.cwd(), ".opencode", PACKAGE_NAME3);
|
|
23328
23544
|
function findConfigPath() {
|
|
23329
23545
|
const projectDetected = detectConfigFile(PROJECT_CONFIG_BASE);
|
|
23330
23546
|
if (projectDetected.format !== "none") {
|
|
@@ -23338,7 +23554,7 @@ function findConfigPath() {
|
|
|
23338
23554
|
}
|
|
23339
23555
|
function validateConfig(configPath) {
|
|
23340
23556
|
try {
|
|
23341
|
-
const content =
|
|
23557
|
+
const content = readFileSync8(configPath, "utf-8");
|
|
23342
23558
|
const rawConfig = parseJsonc(content);
|
|
23343
23559
|
const result = OhMyOpenCodeConfigSchema.safeParse(rawConfig);
|
|
23344
23560
|
if (!result.success) {
|
|
@@ -23364,7 +23580,7 @@ function getConfigInfo() {
|
|
|
23364
23580
|
errors: []
|
|
23365
23581
|
};
|
|
23366
23582
|
}
|
|
23367
|
-
if (!
|
|
23583
|
+
if (!existsSync9(configPath.path)) {
|
|
23368
23584
|
return {
|
|
23369
23585
|
exists: false,
|
|
23370
23586
|
path: configPath.path,
|
|
@@ -23421,24 +23637,24 @@ function getConfigCheckDefinition() {
|
|
|
23421
23637
|
}
|
|
23422
23638
|
|
|
23423
23639
|
// src/cli/doctor/checks/model-resolution.ts
|
|
23424
|
-
import { readFileSync as
|
|
23640
|
+
import { readFileSync as readFileSync9, existsSync as existsSync10 } from "fs";
|
|
23425
23641
|
init_shared();
|
|
23426
23642
|
init_model_requirements();
|
|
23427
|
-
import { homedir as
|
|
23428
|
-
import { join as
|
|
23643
|
+
import { homedir as homedir5 } from "os";
|
|
23644
|
+
import { join as join11 } from "path";
|
|
23429
23645
|
function getOpenCodeCacheDir2() {
|
|
23430
23646
|
const xdgCache = process.env.XDG_CACHE_HOME;
|
|
23431
23647
|
if (xdgCache)
|
|
23432
|
-
return
|
|
23433
|
-
return
|
|
23648
|
+
return join11(xdgCache, "opencode");
|
|
23649
|
+
return join11(homedir5(), ".cache", "opencode");
|
|
23434
23650
|
}
|
|
23435
23651
|
function loadAvailableModels() {
|
|
23436
|
-
const cacheFile =
|
|
23437
|
-
if (!
|
|
23652
|
+
const cacheFile = join11(getOpenCodeCacheDir2(), "models.json");
|
|
23653
|
+
if (!existsSync10(cacheFile)) {
|
|
23438
23654
|
return { providers: [], modelCount: 0, cacheExists: false };
|
|
23439
23655
|
}
|
|
23440
23656
|
try {
|
|
23441
|
-
const content =
|
|
23657
|
+
const content = readFileSync9(cacheFile, "utf-8");
|
|
23442
23658
|
const data = JSON.parse(content);
|
|
23443
23659
|
const providers = Object.keys(data);
|
|
23444
23660
|
let modelCount = 0;
|
|
@@ -23454,14 +23670,14 @@ function loadAvailableModels() {
|
|
|
23454
23670
|
}
|
|
23455
23671
|
}
|
|
23456
23672
|
var PACKAGE_NAME4 = "oh-my-opencode";
|
|
23457
|
-
var USER_CONFIG_DIR3 =
|
|
23458
|
-
var USER_CONFIG_BASE2 =
|
|
23459
|
-
var PROJECT_CONFIG_BASE2 =
|
|
23673
|
+
var USER_CONFIG_DIR3 = join11(homedir5(), ".config", "opencode");
|
|
23674
|
+
var USER_CONFIG_BASE2 = join11(USER_CONFIG_DIR3, PACKAGE_NAME4);
|
|
23675
|
+
var PROJECT_CONFIG_BASE2 = join11(process.cwd(), ".opencode", PACKAGE_NAME4);
|
|
23460
23676
|
function loadConfig() {
|
|
23461
23677
|
const projectDetected = detectConfigFile(PROJECT_CONFIG_BASE2);
|
|
23462
23678
|
if (projectDetected.format !== "none") {
|
|
23463
23679
|
try {
|
|
23464
|
-
const content =
|
|
23680
|
+
const content = readFileSync9(projectDetected.path, "utf-8");
|
|
23465
23681
|
return parseJsonc(content);
|
|
23466
23682
|
} catch {
|
|
23467
23683
|
return null;
|
|
@@ -23470,7 +23686,7 @@ function loadConfig() {
|
|
|
23470
23686
|
const userDetected = detectConfigFile(USER_CONFIG_BASE2);
|
|
23471
23687
|
if (userDetected.format !== "none") {
|
|
23472
23688
|
try {
|
|
23473
|
-
const content =
|
|
23689
|
+
const content = readFileSync9(userDetected.path, "utf-8");
|
|
23474
23690
|
return parseJsonc(content);
|
|
23475
23691
|
} catch {
|
|
23476
23692
|
return null;
|
|
@@ -23536,9 +23752,11 @@ function buildDetailsArray(info, available) {
|
|
|
23536
23752
|
details.push("\u2550\u2550\u2550 Available Models (from cache) \u2550\u2550\u2550");
|
|
23537
23753
|
details.push("");
|
|
23538
23754
|
if (available.cacheExists) {
|
|
23539
|
-
details.push(` Providers
|
|
23755
|
+
details.push(` Providers in cache: ${available.providers.length}`);
|
|
23756
|
+
details.push(` Sample: ${available.providers.slice(0, 6).join(", ")}${available.providers.length > 6 ? "..." : ""}`);
|
|
23540
23757
|
details.push(` Total models: ${available.modelCount}`);
|
|
23541
23758
|
details.push(` Cache: ~/.cache/opencode/models.json`);
|
|
23759
|
+
details.push(` \u2139 Runtime: only connected providers used`);
|
|
23542
23760
|
details.push(` Refresh: opencode models --refresh`);
|
|
23543
23761
|
} else {
|
|
23544
23762
|
details.push(" \u26A0 Cache not found. Run 'opencode' to populate.");
|
|
@@ -23592,23 +23810,23 @@ function getModelResolutionCheckDefinition() {
|
|
|
23592
23810
|
}
|
|
23593
23811
|
|
|
23594
23812
|
// src/cli/doctor/checks/auth.ts
|
|
23595
|
-
import { existsSync as
|
|
23596
|
-
import { join as
|
|
23813
|
+
import { existsSync as existsSync11, readFileSync as readFileSync10 } from "fs";
|
|
23814
|
+
import { join as join12 } from "path";
|
|
23597
23815
|
init_shared();
|
|
23598
23816
|
var OPENCODE_CONFIG_DIR = getOpenCodeConfigDir({ binary: "opencode" });
|
|
23599
|
-
var OPENCODE_JSON =
|
|
23600
|
-
var OPENCODE_JSONC =
|
|
23817
|
+
var OPENCODE_JSON = join12(OPENCODE_CONFIG_DIR, "opencode.json");
|
|
23818
|
+
var OPENCODE_JSONC = join12(OPENCODE_CONFIG_DIR, "opencode.jsonc");
|
|
23601
23819
|
var AUTH_PLUGINS = {
|
|
23602
23820
|
anthropic: { plugin: "builtin", name: "Anthropic (Claude)" },
|
|
23603
23821
|
openai: { plugin: "opencode-openai-codex-auth", name: "OpenAI (ChatGPT)" },
|
|
23604
23822
|
google: { plugin: "opencode-antigravity-auth", name: "Google (Gemini)" }
|
|
23605
23823
|
};
|
|
23606
23824
|
function getOpenCodeConfig() {
|
|
23607
|
-
const configPath =
|
|
23608
|
-
if (!
|
|
23825
|
+
const configPath = existsSync11(OPENCODE_JSONC) ? OPENCODE_JSONC : OPENCODE_JSON;
|
|
23826
|
+
if (!existsSync11(configPath))
|
|
23609
23827
|
return null;
|
|
23610
23828
|
try {
|
|
23611
|
-
const content =
|
|
23829
|
+
const content = readFileSync10(configPath, "utf-8");
|
|
23612
23830
|
return parseJsonc(content);
|
|
23613
23831
|
} catch {
|
|
23614
23832
|
return null;
|
|
@@ -23748,15 +23966,15 @@ async function checkAstGrepNapi() {
|
|
|
23748
23966
|
path: null
|
|
23749
23967
|
};
|
|
23750
23968
|
} catch {
|
|
23751
|
-
const { existsSync:
|
|
23752
|
-
const { join:
|
|
23753
|
-
const { homedir:
|
|
23969
|
+
const { existsSync: existsSync12 } = await import("fs");
|
|
23970
|
+
const { join: join13 } = await import("path");
|
|
23971
|
+
const { homedir: homedir6 } = await import("os");
|
|
23754
23972
|
const pathsToCheck = [
|
|
23755
|
-
|
|
23756
|
-
|
|
23973
|
+
join13(homedir6(), ".config", "opencode", "node_modules", "@ast-grep", "napi"),
|
|
23974
|
+
join13(process.cwd(), "node_modules", "@ast-grep", "napi")
|
|
23757
23975
|
];
|
|
23758
23976
|
for (const napiPath of pathsToCheck) {
|
|
23759
|
-
if (
|
|
23977
|
+
if (existsSync12(napiPath)) {
|
|
23760
23978
|
return {
|
|
23761
23979
|
name: "AST-Grep NAPI",
|
|
23762
23980
|
required: false,
|
|
@@ -23985,15 +24203,15 @@ function getGhCliCheckDefinition() {
|
|
|
23985
24203
|
}
|
|
23986
24204
|
|
|
23987
24205
|
// src/tools/lsp/config.ts
|
|
23988
|
-
import { existsSync as
|
|
23989
|
-
import { join as
|
|
24206
|
+
import { existsSync as existsSync12, readFileSync as readFileSync11 } from "fs";
|
|
24207
|
+
import { join as join13 } from "path";
|
|
23990
24208
|
init_shared();
|
|
23991
24209
|
function isServerInstalled(command) {
|
|
23992
24210
|
if (command.length === 0)
|
|
23993
24211
|
return false;
|
|
23994
24212
|
const cmd = command[0];
|
|
23995
24213
|
if (cmd.includes("/") || cmd.includes("\\")) {
|
|
23996
|
-
if (
|
|
24214
|
+
if (existsSync12(cmd))
|
|
23997
24215
|
return true;
|
|
23998
24216
|
}
|
|
23999
24217
|
const isWindows = process.platform === "win32";
|
|
@@ -24015,23 +24233,23 @@ function isServerInstalled(command) {
|
|
|
24015
24233
|
const paths = pathEnv.split(pathSeparator);
|
|
24016
24234
|
for (const p2 of paths) {
|
|
24017
24235
|
for (const suffix of exts) {
|
|
24018
|
-
if (
|
|
24236
|
+
if (existsSync12(join13(p2, cmd + suffix))) {
|
|
24019
24237
|
return true;
|
|
24020
24238
|
}
|
|
24021
24239
|
}
|
|
24022
24240
|
}
|
|
24023
24241
|
const cwd = process.cwd();
|
|
24024
24242
|
const configDir = getOpenCodeConfigDir({ binary: "opencode" });
|
|
24025
|
-
const dataDir =
|
|
24243
|
+
const dataDir = join13(getDataDir(), "opencode");
|
|
24026
24244
|
const additionalBases = [
|
|
24027
|
-
|
|
24028
|
-
|
|
24029
|
-
|
|
24030
|
-
|
|
24245
|
+
join13(cwd, "node_modules", ".bin"),
|
|
24246
|
+
join13(configDir, "bin"),
|
|
24247
|
+
join13(configDir, "node_modules", ".bin"),
|
|
24248
|
+
join13(dataDir, "bin")
|
|
24031
24249
|
];
|
|
24032
24250
|
for (const base of additionalBases) {
|
|
24033
24251
|
for (const suffix of exts) {
|
|
24034
|
-
if (
|
|
24252
|
+
if (existsSync12(join13(base, cmd + suffix))) {
|
|
24035
24253
|
return true;
|
|
24036
24254
|
}
|
|
24037
24255
|
}
|
|
@@ -24104,23 +24322,23 @@ function getLspCheckDefinition() {
|
|
|
24104
24322
|
}
|
|
24105
24323
|
|
|
24106
24324
|
// src/cli/doctor/checks/mcp.ts
|
|
24107
|
-
import { existsSync as
|
|
24108
|
-
import { homedir as
|
|
24109
|
-
import { join as
|
|
24325
|
+
import { existsSync as existsSync13, readFileSync as readFileSync12 } from "fs";
|
|
24326
|
+
import { homedir as homedir6 } from "os";
|
|
24327
|
+
import { join as join14 } from "path";
|
|
24110
24328
|
init_shared();
|
|
24111
24329
|
var BUILTIN_MCP_SERVERS = ["context7", "grep_app"];
|
|
24112
24330
|
var MCP_CONFIG_PATHS = [
|
|
24113
|
-
|
|
24114
|
-
|
|
24115
|
-
|
|
24331
|
+
join14(homedir6(), ".claude", ".mcp.json"),
|
|
24332
|
+
join14(process.cwd(), ".mcp.json"),
|
|
24333
|
+
join14(process.cwd(), ".claude", ".mcp.json")
|
|
24116
24334
|
];
|
|
24117
24335
|
function loadUserMcpConfig() {
|
|
24118
24336
|
const servers = {};
|
|
24119
24337
|
for (const configPath of MCP_CONFIG_PATHS) {
|
|
24120
|
-
if (!
|
|
24338
|
+
if (!existsSync13(configPath))
|
|
24121
24339
|
continue;
|
|
24122
24340
|
try {
|
|
24123
|
-
const content =
|
|
24341
|
+
const content = readFileSync12(configPath, "utf-8");
|
|
24124
24342
|
const config2 = parseJsonc(content);
|
|
24125
24343
|
if (config2.mcpServers) {
|
|
24126
24344
|
Object.assign(servers, config2.mcpServers);
|