oh-my-opencode 3.11.1 → 3.12.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/README.ja.md +18 -12
- package/README.ko.md +18 -12
- package/README.md +16 -16
- package/README.ru.md +12 -6
- package/README.zh-cn.md +18 -12
- package/dist/agents/atlas/default.d.ts +1 -1
- package/dist/agents/atlas/gemini.d.ts +1 -1
- package/dist/agents/atlas/gpt.d.ts +1 -1
- package/dist/agents/builtin-agents/general-agents.d.ts +1 -0
- package/dist/agents/dynamic-agent-prompt-builder.d.ts +2 -0
- package/dist/agents/env-context.d.ts +1 -1
- package/dist/agents/index.d.ts +1 -0
- package/dist/agents/metis.d.ts +1 -1
- package/dist/agents/prometheus/gemini.d.ts +1 -1
- package/dist/agents/prometheus/gpt.d.ts +1 -1
- package/dist/agents/prometheus/interview-mode.d.ts +1 -1
- package/dist/agents/prometheus/plan-generation.d.ts +1 -1
- package/dist/agents/prometheus/plan-template.d.ts +1 -1
- package/dist/agents/prometheus/system-prompt.d.ts +1 -1
- package/dist/agents/types.d.ts +1 -1
- package/dist/cli/config-manager/bun-install.d.ts +8 -1
- package/dist/cli/config-manager/plugin-name-with-version.d.ts +1 -1
- package/dist/cli/doctor/checks/tools-lsp.d.ts +4 -6
- package/dist/cli/doctor/types.d.ts +4 -8
- package/dist/cli/index.js +960 -733
- package/dist/cli/install-validators.d.ts +1 -0
- package/dist/cli/model-fallback-requirements.d.ts +1 -1
- package/dist/cli/model-fallback-types.d.ts +1 -0
- package/dist/cli/openai-only-model-catalog.d.ts +3 -0
- package/dist/cli/run/index.d.ts +1 -0
- package/dist/cli/run/model-resolver.d.ts +4 -0
- package/dist/cli/run/types.d.ts +1 -0
- package/dist/cli/types.d.ts +3 -0
- package/dist/config/schema/agent-names.d.ts +3 -1
- package/dist/config/schema/background-task.d.ts +8 -0
- package/dist/config/schema/git-env-prefix.d.ts +5 -0
- package/dist/config/schema/git-master.d.ts +1 -0
- package/dist/config/schema/hooks.d.ts +1 -0
- package/dist/config/schema/oh-my-opencode-config.d.ts +9 -0
- package/dist/config/schema.d.ts +1 -0
- package/dist/create-hooks.d.ts +12 -0
- package/dist/features/background-agent/compaction-aware-message-resolver.d.ts +16 -1
- package/dist/features/background-agent/constants.d.ts +6 -2
- package/dist/features/background-agent/loop-detector.d.ts +17 -0
- package/dist/features/background-agent/manager.d.ts +20 -4
- package/dist/features/background-agent/process-cleanup.d.ts +1 -1
- package/dist/features/background-agent/remove-task-toast-tracking.d.ts +1 -0
- package/dist/features/background-agent/subagent-spawn-limits.d.ts +23 -0
- package/dist/features/background-agent/task-history.d.ts +1 -0
- package/dist/features/background-agent/task-poller.d.ts +1 -0
- package/dist/features/background-agent/types.d.ts +11 -0
- package/dist/features/claude-code-agent-loader/claude-model-mapper.d.ts +4 -0
- package/dist/features/claude-code-agent-loader/loader.d.ts +3 -3
- package/dist/features/claude-code-agent-loader/types.d.ts +8 -1
- package/dist/features/claude-code-plugin-loader/agent-loader.d.ts +2 -2
- package/dist/features/claude-code-plugin-loader/loader.d.ts +2 -2
- package/dist/features/claude-code-plugin-loader/types.d.ts +22 -3
- package/dist/features/opencode-skill-loader/git-master-template-injection.d.ts +1 -1
- package/dist/features/skill-mcp-manager/types.d.ts +4 -0
- package/dist/features/tmux-subagent/index.d.ts +1 -0
- package/dist/features/tmux-subagent/manager.d.ts +5 -0
- package/dist/features/tmux-subagent/pane-state-parser.d.ts +8 -0
- package/dist/features/tmux-subagent/tracked-session-state.d.ts +8 -0
- package/dist/features/tmux-subagent/types.d.ts +2 -0
- package/dist/hooks/atlas/boulder-session-lineage.d.ts +6 -0
- package/dist/hooks/atlas/final-wave-approval-gate.d.ts +6 -0
- package/dist/hooks/atlas/final-wave-plan-state.d.ts +5 -0
- package/dist/hooks/atlas/idle-event.d.ts +8 -0
- package/dist/hooks/atlas/resolve-active-boulder-session.d.ts +11 -0
- package/dist/hooks/atlas/tool-execute-after.d.ts +2 -0
- package/dist/hooks/atlas/types.d.ts +4 -0
- package/dist/hooks/atlas/verification-reminders.d.ts +4 -0
- package/dist/hooks/auto-slash-command/executor.d.ts +1 -0
- package/dist/hooks/auto-slash-command/hook.d.ts +7 -0
- package/dist/hooks/auto-slash-command/processed-command-store.d.ts +7 -0
- package/dist/hooks/auto-slash-command/types.d.ts +9 -0
- package/dist/hooks/auto-update-checker/checker/sync-package-json.d.ts +7 -0
- package/dist/hooks/auto-update-checker/checker.d.ts +3 -1
- package/dist/hooks/compaction-context-injector/compaction-context-prompt.d.ts +1 -0
- package/dist/hooks/compaction-context-injector/constants.d.ts +5 -0
- package/dist/hooks/compaction-context-injector/hook.d.ts +5 -1
- package/dist/hooks/compaction-context-injector/recovery-prompt-config.d.ts +6 -0
- package/dist/hooks/compaction-context-injector/recovery.d.ts +6 -0
- package/dist/hooks/compaction-context-injector/session-id.d.ts +2 -0
- package/dist/hooks/compaction-context-injector/session-prompt-config-resolver.d.ts +16 -0
- package/dist/hooks/compaction-context-injector/tail-monitor.d.ts +13 -0
- package/dist/hooks/compaction-context-injector/types.d.ts +43 -0
- package/dist/hooks/compaction-context-injector/validated-model.d.ts +13 -0
- package/dist/hooks/context-window-monitor.d.ts +2 -5
- package/dist/hooks/gpt-permission-continuation/assistant-message.d.ts +23 -0
- package/dist/hooks/gpt-permission-continuation/constants.d.ts +4 -0
- package/dist/hooks/gpt-permission-continuation/detector.d.ts +1 -0
- package/dist/hooks/gpt-permission-continuation/handler.d.ts +12 -0
- package/dist/hooks/gpt-permission-continuation/index.d.ts +13 -0
- package/dist/hooks/gpt-permission-continuation/session-state.d.ts +15 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/keyword-detector/hook.d.ts +1 -0
- package/dist/hooks/preemptive-compaction.d.ts +2 -5
- package/dist/hooks/ralph-loop/pending-verification-handler.d.ts +17 -0
- package/dist/hooks/runtime-fallback/fallback-bootstrap-model.d.ts +10 -0
- package/dist/hooks/runtime-fallback/fallback-retry-dispatcher.d.ts +11 -0
- package/dist/hooks/runtime-fallback/hook.d.ts +2 -3
- package/dist/hooks/runtime-fallback/last-user-retry-parts.d.ts +4 -0
- package/dist/hooks/runtime-fallback/message-update-handler.d.ts +1 -2
- package/dist/hooks/runtime-fallback/retry-model-payload.d.ts +7 -0
- package/dist/hooks/runtime-fallback/session-messages.d.ts +9 -0
- package/dist/hooks/runtime-fallback/session-status-handler.d.ts +3 -0
- package/dist/hooks/runtime-fallback/types.d.ts +57 -3
- package/dist/hooks/runtime-fallback/visible-assistant-response.d.ts +3 -0
- package/dist/hooks/session-notification-content.d.ts +30 -0
- package/dist/hooks/session-notification-scheduler.d.ts +3 -3
- package/dist/hooks/session-notification.d.ts +2 -0
- package/dist/hooks/start-work/index.d.ts +1 -1
- package/dist/hooks/start-work/worktree-detector.d.ts +7 -0
- package/dist/hooks/todo-continuation-enforcer/compaction-guard.d.ts +2 -0
- package/dist/hooks/todo-continuation-enforcer/constants.d.ts +2 -0
- package/dist/hooks/todo-continuation-enforcer/handler.d.ts +1 -0
- package/dist/hooks/todo-continuation-enforcer/idle-event.d.ts +1 -0
- package/dist/hooks/todo-continuation-enforcer/resolve-message-info.d.ts +3 -0
- package/dist/hooks/todo-continuation-enforcer/session-state.d.ts +10 -1
- package/dist/hooks/todo-continuation-enforcer/stagnation-detection.d.ts +6 -0
- package/dist/hooks/todo-continuation-enforcer/types.d.ts +10 -0
- package/dist/hooks/tool-output-truncator.d.ts +1 -0
- package/dist/index.js +10638 -6871
- package/dist/oh-my-opencode.schema.json +43 -2
- package/dist/plugin/hooks/create-continuation-hooks.d.ts +2 -1
- package/dist/plugin/normalize-tool-arg-schemas.d.ts +2 -0
- package/dist/plugin/ultrawork-model-override.d.ts +1 -15
- package/dist/plugin/ultrawork-variant-availability.d.ts +6 -0
- package/dist/plugin-dispose.d.ts +10 -0
- package/dist/plugin-handlers/agent-override-protection.d.ts +3 -0
- package/dist/plugin-state.d.ts +5 -0
- package/dist/shared/compaction-agent-config-checkpoint.d.ts +11 -0
- package/dist/shared/context-limit-resolver.d.ts +5 -0
- package/dist/shared/dynamic-truncator.d.ts +4 -7
- package/dist/shared/fallback-chain-from-models.d.ts +3 -0
- package/dist/shared/index.d.ts +3 -0
- package/dist/shared/model-error-classifier.d.ts +2 -1
- package/dist/shared/opencode-command-dirs.d.ts +3 -0
- package/dist/shared/plugin-identity.d.ts +5 -0
- package/dist/shared/question-denied-session-permission.d.ts +6 -0
- package/dist/shared/retry-status-utils.d.ts +2 -0
- package/dist/shared/shell-env.d.ts +27 -0
- package/dist/shared/tmux/tmux-utils/environment.d.ts +1 -0
- package/dist/shared/vision-capable-models-cache.d.ts +4 -0
- package/dist/tools/call-omo-agent/background-executor.d.ts +2 -1
- package/dist/tools/call-omo-agent/constants.d.ts +1 -1
- package/dist/tools/call-omo-agent/sync-executor.d.ts +11 -3
- package/dist/tools/call-omo-agent/tools.d.ts +2 -1
- package/dist/tools/delegate-task/cancel-unstable-agent-task.d.ts +2 -0
- package/dist/tools/delegate-task/model-selection.d.ts +3 -0
- package/dist/tools/delegate-task/model-string-parser.d.ts +5 -3
- package/dist/tools/hashline-edit/hash-computation.d.ts +1 -0
- package/dist/tools/hashline-edit/tool-description.d.ts +1 -1
- package/dist/tools/look-at/constants.d.ts +1 -1
- package/dist/tools/look-at/multimodal-fallback-chain.d.ts +4 -0
- package/dist/tools/lsp/constants.d.ts +1 -0
- package/dist/tools/lsp/directory-diagnostics.d.ts +1 -0
- package/dist/tools/lsp/lsp-client-transport.d.ts +4 -2
- package/dist/tools/lsp/lsp-client-wrapper.d.ts +2 -1
- package/dist/tools/lsp/server-path-bases.d.ts +1 -0
- package/package.json +18 -18
package/dist/cli/index.js
CHANGED
|
@@ -4977,6 +4977,9 @@ var init_tool_name = () => {};
|
|
|
4977
4977
|
// src/shared/file-utils.ts
|
|
4978
4978
|
var init_file_utils = () => {};
|
|
4979
4979
|
|
|
4980
|
+
// src/shared/context-limit-resolver.ts
|
|
4981
|
+
var init_context_limit_resolver = () => {};
|
|
4982
|
+
|
|
4980
4983
|
// src/shared/normalize-sdk-response.ts
|
|
4981
4984
|
function normalizeSDKResponse(response, fallback, options) {
|
|
4982
4985
|
if (response === null || response === undefined) {
|
|
@@ -5002,7 +5005,9 @@ function normalizeSDKResponse(response, fallback, options) {
|
|
|
5002
5005
|
}
|
|
5003
5006
|
|
|
5004
5007
|
// src/shared/dynamic-truncator.ts
|
|
5005
|
-
var init_dynamic_truncator = () => {
|
|
5008
|
+
var init_dynamic_truncator = __esm(() => {
|
|
5009
|
+
init_context_limit_resolver();
|
|
5010
|
+
});
|
|
5006
5011
|
|
|
5007
5012
|
// src/shared/data-path.ts
|
|
5008
5013
|
import * as path2 from "path";
|
|
@@ -6017,7 +6022,8 @@ var init_hook_names = __esm(() => {
|
|
|
6017
6022
|
"anthropic-auto-compact": "anthropic-context-window-limit-recovery",
|
|
6018
6023
|
"sisyphus-orchestrator": "atlas",
|
|
6019
6024
|
"sisyphus-gpt-hephaestus-reminder": "no-sisyphus-gpt",
|
|
6020
|
-
"empty-message-sanitizer": null
|
|
6025
|
+
"empty-message-sanitizer": null,
|
|
6026
|
+
"delegate-task-english-directive": null
|
|
6021
6027
|
};
|
|
6022
6028
|
});
|
|
6023
6029
|
|
|
@@ -6218,20 +6224,6 @@ function getCliConfigDir() {
|
|
|
6218
6224
|
if (envConfigDir) {
|
|
6219
6225
|
return resolve(envConfigDir);
|
|
6220
6226
|
}
|
|
6221
|
-
if (process.platform === "win32") {
|
|
6222
|
-
const crossPlatformDir = join3(homedir2(), ".config", "opencode");
|
|
6223
|
-
const crossPlatformConfig = join3(crossPlatformDir, "opencode.json");
|
|
6224
|
-
if (existsSync2(crossPlatformConfig)) {
|
|
6225
|
-
return crossPlatformDir;
|
|
6226
|
-
}
|
|
6227
|
-
const appData = process.env.APPDATA || join3(homedir2(), "AppData", "Roaming");
|
|
6228
|
-
const appdataDir = join3(appData, "opencode");
|
|
6229
|
-
const appdataConfig = join3(appdataDir, "opencode.json");
|
|
6230
|
-
if (existsSync2(appdataConfig)) {
|
|
6231
|
-
return appdataDir;
|
|
6232
|
-
}
|
|
6233
|
-
return crossPlatformDir;
|
|
6234
|
-
}
|
|
6235
6227
|
const xdgConfig = process.env.XDG_CONFIG_HOME || join3(homedir2(), ".config");
|
|
6236
6228
|
return join3(xdgConfig, "opencode");
|
|
6237
6229
|
}
|
|
@@ -6304,6 +6296,7 @@ var init_model_requirements = __esm(() => {
|
|
|
6304
6296
|
model: "claude-opus-4-6",
|
|
6305
6297
|
variant: "max"
|
|
6306
6298
|
},
|
|
6299
|
+
{ providers: ["opencode-go"], model: "kimi-k2.5" },
|
|
6307
6300
|
{ providers: ["kimi-for-coding"], model: "k2p5" },
|
|
6308
6301
|
{
|
|
6309
6302
|
providers: [
|
|
@@ -6349,22 +6342,22 @@ var init_model_requirements = __esm(() => {
|
|
|
6349
6342
|
providers: ["anthropic", "github-copilot", "opencode"],
|
|
6350
6343
|
model: "claude-opus-4-6",
|
|
6351
6344
|
variant: "max"
|
|
6352
|
-
}
|
|
6345
|
+
},
|
|
6346
|
+
{ providers: ["opencode-go"], model: "glm-5" }
|
|
6353
6347
|
]
|
|
6354
6348
|
},
|
|
6355
6349
|
librarian: {
|
|
6356
6350
|
fallbackChain: [
|
|
6357
|
-
{
|
|
6358
|
-
providers: ["google", "github-copilot", "opencode"],
|
|
6359
|
-
model: "gemini-3-flash"
|
|
6360
|
-
},
|
|
6351
|
+
{ providers: ["opencode-go"], model: "minimax-m2.5" },
|
|
6361
6352
|
{ providers: ["opencode"], model: "minimax-m2.5-free" },
|
|
6362
|
-
{ providers: ["opencode"], model: "
|
|
6353
|
+
{ providers: ["anthropic", "opencode"], model: "claude-haiku-4-5" },
|
|
6354
|
+
{ providers: ["opencode"], model: "gpt-5-nano" }
|
|
6363
6355
|
]
|
|
6364
6356
|
},
|
|
6365
6357
|
explore: {
|
|
6366
6358
|
fallbackChain: [
|
|
6367
6359
|
{ providers: ["github-copilot"], model: "grok-code-fast-1" },
|
|
6360
|
+
{ providers: ["opencode-go"], model: "minimax-m2.5" },
|
|
6368
6361
|
{ providers: ["opencode"], model: "minimax-m2.5-free" },
|
|
6369
6362
|
{ providers: ["anthropic", "opencode"], model: "claude-haiku-4-5" },
|
|
6370
6363
|
{ providers: ["opencode"], model: "gpt-5-nano" }
|
|
@@ -6372,21 +6365,10 @@ var init_model_requirements = __esm(() => {
|
|
|
6372
6365
|
},
|
|
6373
6366
|
"multimodal-looker": {
|
|
6374
6367
|
fallbackChain: [
|
|
6375
|
-
{
|
|
6376
|
-
|
|
6377
|
-
model: "gpt-5.4",
|
|
6378
|
-
variant: "medium"
|
|
6379
|
-
},
|
|
6380
|
-
{ providers: ["kimi-for-coding"], model: "k2p5" },
|
|
6381
|
-
{
|
|
6382
|
-
providers: ["google", "github-copilot", "opencode"],
|
|
6383
|
-
model: "gemini-3-flash"
|
|
6384
|
-
},
|
|
6368
|
+
{ providers: ["openai", "opencode"], model: "gpt-5.4", variant: "medium" },
|
|
6369
|
+
{ providers: ["opencode-go"], model: "kimi-k2.5" },
|
|
6385
6370
|
{ providers: ["zai-coding-plan"], model: "glm-4.6v" },
|
|
6386
|
-
{
|
|
6387
|
-
providers: ["openai", "github-copilot", "opencode"],
|
|
6388
|
-
model: "gpt-5-nano"
|
|
6389
|
-
}
|
|
6371
|
+
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5-nano" }
|
|
6390
6372
|
]
|
|
6391
6373
|
},
|
|
6392
6374
|
prometheus: {
|
|
@@ -6401,6 +6383,7 @@ var init_model_requirements = __esm(() => {
|
|
|
6401
6383
|
model: "gpt-5.4",
|
|
6402
6384
|
variant: "high"
|
|
6403
6385
|
},
|
|
6386
|
+
{ providers: ["opencode-go"], model: "glm-5" },
|
|
6404
6387
|
{
|
|
6405
6388
|
providers: ["google", "github-copilot", "opencode"],
|
|
6406
6389
|
model: "gemini-3.1-pro"
|
|
@@ -6419,11 +6402,8 @@ var init_model_requirements = __esm(() => {
|
|
|
6419
6402
|
model: "gpt-5.4",
|
|
6420
6403
|
variant: "high"
|
|
6421
6404
|
},
|
|
6422
|
-
{
|
|
6423
|
-
|
|
6424
|
-
model: "gemini-3.1-pro",
|
|
6425
|
-
variant: "high"
|
|
6426
|
-
}
|
|
6405
|
+
{ providers: ["opencode-go"], model: "glm-5" },
|
|
6406
|
+
{ providers: ["kimi-for-coding"], model: "k2p5" }
|
|
6427
6407
|
]
|
|
6428
6408
|
},
|
|
6429
6409
|
momus: {
|
|
@@ -6442,16 +6422,31 @@ var init_model_requirements = __esm(() => {
|
|
|
6442
6422
|
providers: ["google", "github-copilot", "opencode"],
|
|
6443
6423
|
model: "gemini-3.1-pro",
|
|
6444
6424
|
variant: "high"
|
|
6445
|
-
}
|
|
6425
|
+
},
|
|
6426
|
+
{ providers: ["opencode-go"], model: "glm-5" }
|
|
6446
6427
|
]
|
|
6447
6428
|
},
|
|
6448
6429
|
atlas: {
|
|
6449
6430
|
fallbackChain: [
|
|
6431
|
+
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-sonnet-4-6" },
|
|
6432
|
+
{ providers: ["opencode-go"], model: "kimi-k2.5" },
|
|
6450
6433
|
{
|
|
6451
|
-
providers: ["
|
|
6452
|
-
model: "
|
|
6434
|
+
providers: ["openai", "github-copilot", "opencode"],
|
|
6435
|
+
model: "gpt-5.4",
|
|
6436
|
+
variant: "medium"
|
|
6437
|
+
}
|
|
6438
|
+
]
|
|
6439
|
+
},
|
|
6440
|
+
"sisyphus-junior": {
|
|
6441
|
+
fallbackChain: [
|
|
6442
|
+
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-sonnet-4-6" },
|
|
6443
|
+
{ providers: ["opencode-go"], model: "kimi-k2.5" },
|
|
6444
|
+
{
|
|
6445
|
+
providers: ["openai", "github-copilot", "opencode"],
|
|
6446
|
+
model: "gpt-5.4",
|
|
6447
|
+
variant: "medium"
|
|
6453
6448
|
},
|
|
6454
|
-
{ providers: ["
|
|
6449
|
+
{ providers: ["opencode"], model: "big-pickle" }
|
|
6455
6450
|
]
|
|
6456
6451
|
}
|
|
6457
6452
|
};
|
|
@@ -6468,14 +6463,16 @@ var init_model_requirements = __esm(() => {
|
|
|
6468
6463
|
providers: ["anthropic", "github-copilot", "opencode"],
|
|
6469
6464
|
model: "claude-opus-4-6",
|
|
6470
6465
|
variant: "max"
|
|
6471
|
-
}
|
|
6466
|
+
},
|
|
6467
|
+
{ providers: ["opencode-go"], model: "glm-5" },
|
|
6468
|
+
{ providers: ["kimi-for-coding"], model: "k2p5" }
|
|
6472
6469
|
]
|
|
6473
6470
|
},
|
|
6474
6471
|
ultrabrain: {
|
|
6475
6472
|
fallbackChain: [
|
|
6476
6473
|
{
|
|
6477
6474
|
providers: ["openai", "opencode"],
|
|
6478
|
-
model: "gpt-5.
|
|
6475
|
+
model: "gpt-5.4",
|
|
6479
6476
|
variant: "xhigh"
|
|
6480
6477
|
},
|
|
6481
6478
|
{
|
|
@@ -6487,7 +6484,8 @@ var init_model_requirements = __esm(() => {
|
|
|
6487
6484
|
providers: ["anthropic", "github-copilot", "opencode"],
|
|
6488
6485
|
model: "claude-opus-4-6",
|
|
6489
6486
|
variant: "max"
|
|
6490
|
-
}
|
|
6487
|
+
},
|
|
6488
|
+
{ providers: ["opencode-go"], model: "glm-5" }
|
|
6491
6489
|
]
|
|
6492
6490
|
},
|
|
6493
6491
|
deep: {
|
|
@@ -6536,6 +6534,7 @@ var init_model_requirements = __esm(() => {
|
|
|
6536
6534
|
providers: ["google", "github-copilot", "opencode"],
|
|
6537
6535
|
model: "gemini-3-flash"
|
|
6538
6536
|
},
|
|
6537
|
+
{ providers: ["opencode-go"], model: "minimax-m2.5" },
|
|
6539
6538
|
{ providers: ["opencode"], model: "gpt-5-nano" }
|
|
6540
6539
|
]
|
|
6541
6540
|
},
|
|
@@ -6550,6 +6549,7 @@ var init_model_requirements = __esm(() => {
|
|
|
6550
6549
|
model: "gpt-5.3-codex",
|
|
6551
6550
|
variant: "medium"
|
|
6552
6551
|
},
|
|
6552
|
+
{ providers: ["opencode-go"], model: "kimi-k2.5" },
|
|
6553
6553
|
{
|
|
6554
6554
|
providers: ["google", "github-copilot", "opencode"],
|
|
6555
6555
|
model: "gemini-3-flash"
|
|
@@ -6558,18 +6558,20 @@ var init_model_requirements = __esm(() => {
|
|
|
6558
6558
|
},
|
|
6559
6559
|
"unspecified-high": {
|
|
6560
6560
|
fallbackChain: [
|
|
6561
|
-
{
|
|
6562
|
-
providers: ["openai", "github-copilot", "opencode"],
|
|
6563
|
-
model: "gpt-5.4",
|
|
6564
|
-
variant: "high"
|
|
6565
|
-
},
|
|
6566
6561
|
{
|
|
6567
6562
|
providers: ["anthropic", "github-copilot", "opencode"],
|
|
6568
6563
|
model: "claude-opus-4-6",
|
|
6569
6564
|
variant: "max"
|
|
6570
6565
|
},
|
|
6566
|
+
{
|
|
6567
|
+
providers: ["openai", "github-copilot", "opencode"],
|
|
6568
|
+
model: "gpt-5.4",
|
|
6569
|
+
variant: "high"
|
|
6570
|
+
},
|
|
6571
6571
|
{ providers: ["zai-coding-plan", "opencode"], model: "glm-5" },
|
|
6572
6572
|
{ providers: ["kimi-for-coding"], model: "k2p5" },
|
|
6573
|
+
{ providers: ["opencode-go"], model: "glm-5" },
|
|
6574
|
+
{ providers: ["opencode"], model: "kimi-k2.5" },
|
|
6573
6575
|
{
|
|
6574
6576
|
providers: [
|
|
6575
6577
|
"opencode",
|
|
@@ -6589,6 +6591,7 @@ var init_model_requirements = __esm(() => {
|
|
|
6589
6591
|
providers: ["google", "github-copilot", "opencode"],
|
|
6590
6592
|
model: "gemini-3-flash"
|
|
6591
6593
|
},
|
|
6594
|
+
{ providers: ["opencode-go"], model: "kimi-k2.5" },
|
|
6592
6595
|
{
|
|
6593
6596
|
providers: ["anthropic", "github-copilot", "opencode"],
|
|
6594
6597
|
model: "claude-sonnet-4-6"
|
|
@@ -6940,6 +6943,11 @@ var init_git_worktree = __esm(() => {
|
|
|
6940
6943
|
var init_safe_create_hook = __esm(() => {
|
|
6941
6944
|
init_logger();
|
|
6942
6945
|
});
|
|
6946
|
+
// src/shared/opencode-command-dirs.ts
|
|
6947
|
+
var init_opencode_command_dirs = __esm(() => {
|
|
6948
|
+
init_opencode_config_dir();
|
|
6949
|
+
});
|
|
6950
|
+
|
|
6943
6951
|
// src/shared/session-directory-resolver.ts
|
|
6944
6952
|
var init_session_directory_resolver = () => {};
|
|
6945
6953
|
|
|
@@ -6975,12 +6983,22 @@ var init_skill_loader = __esm(() => {
|
|
|
6975
6983
|
init_skill_path_resolver();
|
|
6976
6984
|
init_logger();
|
|
6977
6985
|
});
|
|
6986
|
+
// src/features/claude-code-agent-loader/claude-model-mapper.ts
|
|
6987
|
+
var ANTHROPIC_PREFIX = "anthropic/", CLAUDE_CODE_ALIAS_MAP;
|
|
6988
|
+
var init_claude_model_mapper = __esm(() => {
|
|
6989
|
+
CLAUDE_CODE_ALIAS_MAP = new Map([
|
|
6990
|
+
["sonnet", `${ANTHROPIC_PREFIX}claude-sonnet-4-6`],
|
|
6991
|
+
["opus", `${ANTHROPIC_PREFIX}claude-opus-4-6`],
|
|
6992
|
+
["haiku", `${ANTHROPIC_PREFIX}claude-haiku-4-5`]
|
|
6993
|
+
]);
|
|
6994
|
+
});
|
|
6978
6995
|
|
|
6979
6996
|
// src/features/claude-code-plugin-loader/agent-loader.ts
|
|
6980
6997
|
var init_agent_loader = __esm(() => {
|
|
6981
6998
|
init_frontmatter();
|
|
6982
6999
|
init_file_utils();
|
|
6983
7000
|
init_logger();
|
|
7001
|
+
init_claude_model_mapper();
|
|
6984
7002
|
});
|
|
6985
7003
|
// src/features/claude-code-mcp-loader/transformer.ts
|
|
6986
7004
|
var init_transformer = () => {};
|
|
@@ -7034,6 +7052,9 @@ var init_session_category_registry = __esm(() => {
|
|
|
7034
7052
|
sessionCategoryMap = new Map;
|
|
7035
7053
|
});
|
|
7036
7054
|
|
|
7055
|
+
// src/shared/plugin-identity.ts
|
|
7056
|
+
var PLUGIN_NAME = "oh-my-opencode", LEGACY_PLUGIN_NAME = "oh-my-openagent";
|
|
7057
|
+
|
|
7037
7058
|
// src/shared/index.ts
|
|
7038
7059
|
var init_shared = __esm(() => {
|
|
7039
7060
|
init_model_resolver();
|
|
@@ -7068,6 +7089,7 @@ var init_shared = __esm(() => {
|
|
|
7068
7089
|
init_model_availability();
|
|
7069
7090
|
init_fallback_model_availability();
|
|
7070
7091
|
init_connected_providers_cache();
|
|
7092
|
+
init_context_limit_resolver();
|
|
7071
7093
|
init_session_utils();
|
|
7072
7094
|
init_tmux();
|
|
7073
7095
|
init_model_suggestion_retry();
|
|
@@ -7078,6 +7100,7 @@ var init_shared = __esm(() => {
|
|
|
7078
7100
|
init_safe_create_hook();
|
|
7079
7101
|
init_opencode_storage_paths();
|
|
7080
7102
|
init_opencode_message_dir();
|
|
7103
|
+
init_opencode_command_dirs();
|
|
7081
7104
|
init_session_directory_resolver();
|
|
7082
7105
|
init_prompt_tools();
|
|
7083
7106
|
init_plugin_command_discovery();
|
|
@@ -7129,26 +7152,26 @@ async function fetchNpmDistTags(packageName) {
|
|
|
7129
7152
|
var NPM_FETCH_TIMEOUT_MS = 5000;
|
|
7130
7153
|
|
|
7131
7154
|
// src/cli/config-manager/plugin-name-with-version.ts
|
|
7132
|
-
function getFallbackEntry(version) {
|
|
7155
|
+
function getFallbackEntry(version, packageName) {
|
|
7133
7156
|
const prereleaseMatch = version.match(/-([a-zA-Z][a-zA-Z0-9-]*)(?:\.|$)/);
|
|
7134
7157
|
if (prereleaseMatch) {
|
|
7135
|
-
return `${
|
|
7158
|
+
return `${packageName}@${prereleaseMatch[1]}`;
|
|
7136
7159
|
}
|
|
7137
|
-
return
|
|
7160
|
+
return packageName;
|
|
7138
7161
|
}
|
|
7139
|
-
async function getPluginNameWithVersion(currentVersion) {
|
|
7140
|
-
const distTags = await fetchNpmDistTags(
|
|
7162
|
+
async function getPluginNameWithVersion(currentVersion, packageName = DEFAULT_PACKAGE_NAME) {
|
|
7163
|
+
const distTags = await fetchNpmDistTags(packageName);
|
|
7141
7164
|
if (distTags) {
|
|
7142
7165
|
const allTags = new Set([...PRIORITIZED_TAGS, ...Object.keys(distTags)]);
|
|
7143
7166
|
for (const tag of allTags) {
|
|
7144
7167
|
if (distTags[tag] === currentVersion) {
|
|
7145
|
-
return `${
|
|
7168
|
+
return `${packageName}@${tag}`;
|
|
7146
7169
|
}
|
|
7147
7170
|
}
|
|
7148
7171
|
}
|
|
7149
|
-
return getFallbackEntry(currentVersion);
|
|
7172
|
+
return getFallbackEntry(currentVersion, packageName);
|
|
7150
7173
|
}
|
|
7151
|
-
var
|
|
7174
|
+
var DEFAULT_PACKAGE_NAME = "oh-my-opencode", PRIORITIZED_TAGS;
|
|
7152
7175
|
var init_plugin_name_with_version = __esm(() => {
|
|
7153
7176
|
PRIORITIZED_TAGS = ["latest", "beta", "next"];
|
|
7154
7177
|
});
|
|
@@ -7258,7 +7281,7 @@ async function addPluginToOpenCodeConfig(currentVersion) {
|
|
|
7258
7281
|
};
|
|
7259
7282
|
}
|
|
7260
7283
|
const { format: format2, path: path3 } = detectConfigFormat();
|
|
7261
|
-
const pluginEntry = await getPluginNameWithVersion(currentVersion);
|
|
7284
|
+
const pluginEntry = await getPluginNameWithVersion(currentVersion, PLUGIN_NAME);
|
|
7262
7285
|
try {
|
|
7263
7286
|
if (format2 === "none") {
|
|
7264
7287
|
const config2 = { plugin: [pluginEntry] };
|
|
@@ -7276,12 +7299,15 @@ async function addPluginToOpenCodeConfig(currentVersion) {
|
|
|
7276
7299
|
}
|
|
7277
7300
|
const config = parseResult.config;
|
|
7278
7301
|
const plugins = config.plugin ?? [];
|
|
7279
|
-
const
|
|
7280
|
-
|
|
7281
|
-
|
|
7302
|
+
const currentNameIndex = plugins.findIndex((plugin) => plugin === PLUGIN_NAME || plugin.startsWith(`${PLUGIN_NAME}@`));
|
|
7303
|
+
const legacyNameIndex = plugins.findIndex((plugin) => plugin === LEGACY_PLUGIN_NAME || plugin.startsWith(`${LEGACY_PLUGIN_NAME}@`));
|
|
7304
|
+
if (currentNameIndex !== -1) {
|
|
7305
|
+
if (plugins[currentNameIndex] === pluginEntry) {
|
|
7282
7306
|
return { success: true, configPath: path3 };
|
|
7283
7307
|
}
|
|
7284
|
-
plugins[
|
|
7308
|
+
plugins[currentNameIndex] = pluginEntry;
|
|
7309
|
+
} else if (legacyNameIndex !== -1) {
|
|
7310
|
+
plugins[legacyNameIndex] = pluginEntry;
|
|
7285
7311
|
} else {
|
|
7286
7312
|
plugins.push(pluginEntry);
|
|
7287
7313
|
}
|
|
@@ -7315,8 +7341,8 @@ async function addPluginToOpenCodeConfig(currentVersion) {
|
|
|
7315
7341
|
};
|
|
7316
7342
|
}
|
|
7317
7343
|
}
|
|
7318
|
-
var PACKAGE_NAME2 = "oh-my-opencode";
|
|
7319
7344
|
var init_add_plugin_to_opencode_config = __esm(() => {
|
|
7345
|
+
init_shared();
|
|
7320
7346
|
init_config_context();
|
|
7321
7347
|
init_ensure_config_directory_exists();
|
|
7322
7348
|
init_opencode_config_format();
|
|
@@ -7327,290 +7353,39 @@ var init_add_plugin_to_opencode_config = __esm(() => {
|
|
|
7327
7353
|
// src/cli/model-fallback-requirements.ts
|
|
7328
7354
|
var CLI_AGENT_MODEL_REQUIREMENTS, CLI_CATEGORY_MODEL_REQUIREMENTS;
|
|
7329
7355
|
var init_model_fallback_requirements = __esm(() => {
|
|
7330
|
-
|
|
7331
|
-
|
|
7332
|
-
|
|
7333
|
-
|
|
7334
|
-
|
|
7335
|
-
|
|
7336
|
-
|
|
7337
|
-
|
|
7338
|
-
|
|
7339
|
-
|
|
7340
|
-
|
|
7341
|
-
|
|
7342
|
-
|
|
7343
|
-
|
|
7344
|
-
|
|
7345
|
-
fallbackChain: [
|
|
7346
|
-
{
|
|
7347
|
-
providers: ["openai", "opencode"],
|
|
7348
|
-
model: "gpt-5.3-codex",
|
|
7349
|
-
variant: "medium"
|
|
7350
|
-
}
|
|
7351
|
-
],
|
|
7352
|
-
requiresProvider: ["openai", "opencode"]
|
|
7353
|
-
},
|
|
7354
|
-
oracle: {
|
|
7355
|
-
fallbackChain: [
|
|
7356
|
-
{
|
|
7357
|
-
providers: ["openai", "github-copilot", "opencode"],
|
|
7358
|
-
model: "gpt-5.4",
|
|
7359
|
-
variant: "high"
|
|
7360
|
-
},
|
|
7361
|
-
{
|
|
7362
|
-
providers: ["google", "github-copilot", "opencode"],
|
|
7363
|
-
model: "gemini-3.1-pro",
|
|
7364
|
-
variant: "high"
|
|
7365
|
-
},
|
|
7366
|
-
{
|
|
7367
|
-
providers: ["anthropic", "github-copilot", "opencode"],
|
|
7368
|
-
model: "claude-opus-4-6",
|
|
7369
|
-
variant: "max"
|
|
7370
|
-
}
|
|
7371
|
-
]
|
|
7372
|
-
},
|
|
7373
|
-
librarian: {
|
|
7374
|
-
fallbackChain: [
|
|
7375
|
-
{ providers: ["zai-coding-plan"], model: "glm-4.7" },
|
|
7376
|
-
{ providers: ["opencode"], model: "glm-4.7-free" },
|
|
7377
|
-
{
|
|
7378
|
-
providers: ["anthropic", "github-copilot", "opencode"],
|
|
7379
|
-
model: "claude-sonnet-4-5"
|
|
7380
|
-
}
|
|
7381
|
-
]
|
|
7382
|
-
},
|
|
7383
|
-
explore: {
|
|
7384
|
-
fallbackChain: [
|
|
7385
|
-
{ providers: ["github-copilot"], model: "grok-code-fast-1" },
|
|
7386
|
-
{ providers: ["anthropic", "opencode"], model: "claude-haiku-4-5" },
|
|
7387
|
-
{ providers: ["opencode"], model: "gpt-5-nano" }
|
|
7388
|
-
]
|
|
7389
|
-
},
|
|
7390
|
-
"multimodal-looker": {
|
|
7391
|
-
fallbackChain: [
|
|
7392
|
-
{
|
|
7393
|
-
providers: ["openai", "opencode"],
|
|
7394
|
-
model: "gpt-5.4",
|
|
7395
|
-
variant: "medium"
|
|
7396
|
-
},
|
|
7397
|
-
{ providers: ["kimi-for-coding"], model: "k2p5" },
|
|
7398
|
-
{
|
|
7399
|
-
providers: ["google", "github-copilot", "opencode"],
|
|
7400
|
-
model: "gemini-3-flash"
|
|
7401
|
-
},
|
|
7402
|
-
{ providers: ["zai-coding-plan"], model: "glm-4.6v" },
|
|
7403
|
-
{ providers: ["opencode"], model: "gpt-5-nano" }
|
|
7404
|
-
]
|
|
7405
|
-
},
|
|
7406
|
-
prometheus: {
|
|
7407
|
-
fallbackChain: [
|
|
7408
|
-
{
|
|
7409
|
-
providers: ["anthropic", "github-copilot", "opencode"],
|
|
7410
|
-
model: "claude-opus-4-6",
|
|
7411
|
-
variant: "max"
|
|
7412
|
-
},
|
|
7413
|
-
{ providers: ["kimi-for-coding"], model: "k2p5" },
|
|
7414
|
-
{
|
|
7415
|
-
providers: ["openai", "github-copilot", "opencode"],
|
|
7416
|
-
model: "gpt-5.4",
|
|
7417
|
-
variant: "high"
|
|
7418
|
-
},
|
|
7419
|
-
{
|
|
7420
|
-
providers: ["google", "github-copilot", "opencode"],
|
|
7421
|
-
model: "gemini-3.1-pro"
|
|
7422
|
-
}
|
|
7423
|
-
]
|
|
7424
|
-
},
|
|
7425
|
-
metis: {
|
|
7426
|
-
fallbackChain: [
|
|
7427
|
-
{
|
|
7428
|
-
providers: ["anthropic", "github-copilot", "opencode"],
|
|
7429
|
-
model: "claude-opus-4-6",
|
|
7430
|
-
variant: "max"
|
|
7431
|
-
},
|
|
7432
|
-
{ providers: ["kimi-for-coding"], model: "k2p5" },
|
|
7433
|
-
{
|
|
7434
|
-
providers: ["openai", "github-copilot", "opencode"],
|
|
7435
|
-
model: "gpt-5.4",
|
|
7436
|
-
variant: "high"
|
|
7437
|
-
},
|
|
7438
|
-
{
|
|
7439
|
-
providers: ["google", "github-copilot", "opencode"],
|
|
7440
|
-
model: "gemini-3.1-pro",
|
|
7441
|
-
variant: "high"
|
|
7442
|
-
}
|
|
7443
|
-
]
|
|
7444
|
-
},
|
|
7445
|
-
momus: {
|
|
7446
|
-
fallbackChain: [
|
|
7447
|
-
{
|
|
7448
|
-
providers: ["openai", "github-copilot", "opencode"],
|
|
7449
|
-
model: "gpt-5.4",
|
|
7450
|
-
variant: "xhigh"
|
|
7451
|
-
},
|
|
7452
|
-
{
|
|
7453
|
-
providers: ["anthropic", "github-copilot", "opencode"],
|
|
7454
|
-
model: "claude-opus-4-6",
|
|
7455
|
-
variant: "max"
|
|
7456
|
-
},
|
|
7457
|
-
{
|
|
7458
|
-
providers: ["google", "github-copilot", "opencode"],
|
|
7459
|
-
model: "gemini-3.1-pro",
|
|
7460
|
-
variant: "high"
|
|
7461
|
-
}
|
|
7462
|
-
]
|
|
7356
|
+
init_model_requirements();
|
|
7357
|
+
CLI_AGENT_MODEL_REQUIREMENTS = AGENT_MODEL_REQUIREMENTS;
|
|
7358
|
+
CLI_CATEGORY_MODEL_REQUIREMENTS = CATEGORY_MODEL_REQUIREMENTS;
|
|
7359
|
+
});
|
|
7360
|
+
|
|
7361
|
+
// src/cli/openai-only-model-catalog.ts
|
|
7362
|
+
function isOpenAiOnlyAvailability(availability) {
|
|
7363
|
+
return availability.native.openai && !availability.native.claude && !availability.native.gemini && !availability.opencodeGo && !availability.opencodeZen && !availability.copilot && !availability.zai && !availability.kimiForCoding;
|
|
7364
|
+
}
|
|
7365
|
+
function applyOpenAiOnlyModelCatalog(config) {
|
|
7366
|
+
return {
|
|
7367
|
+
...config,
|
|
7368
|
+
agents: {
|
|
7369
|
+
...config.agents,
|
|
7370
|
+
...OPENAI_ONLY_AGENT_OVERRIDES
|
|
7463
7371
|
},
|
|
7464
|
-
|
|
7465
|
-
|
|
7466
|
-
|
|
7467
|
-
{
|
|
7468
|
-
providers: ["anthropic", "github-copilot", "opencode"],
|
|
7469
|
-
model: "claude-sonnet-4-5"
|
|
7470
|
-
},
|
|
7471
|
-
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.4", variant: "medium" },
|
|
7472
|
-
{
|
|
7473
|
-
providers: ["google", "github-copilot", "opencode"],
|
|
7474
|
-
model: "gemini-3.1-pro"
|
|
7475
|
-
}
|
|
7476
|
-
]
|
|
7372
|
+
categories: {
|
|
7373
|
+
...config.categories,
|
|
7374
|
+
...OPENAI_ONLY_CATEGORY_OVERRIDES
|
|
7477
7375
|
}
|
|
7478
7376
|
};
|
|
7479
|
-
|
|
7480
|
-
|
|
7481
|
-
|
|
7482
|
-
|
|
7483
|
-
|
|
7484
|
-
|
|
7485
|
-
|
|
7486
|
-
|
|
7487
|
-
|
|
7488
|
-
|
|
7489
|
-
|
|
7490
|
-
|
|
7491
|
-
variant: "max"
|
|
7492
|
-
},
|
|
7493
|
-
{ providers: ["kimi-for-coding"], model: "k2p5" }
|
|
7494
|
-
]
|
|
7495
|
-
},
|
|
7496
|
-
ultrabrain: {
|
|
7497
|
-
fallbackChain: [
|
|
7498
|
-
{
|
|
7499
|
-
providers: ["openai", "opencode"],
|
|
7500
|
-
model: "gpt-5.3-codex",
|
|
7501
|
-
variant: "xhigh"
|
|
7502
|
-
},
|
|
7503
|
-
{
|
|
7504
|
-
providers: ["google", "github-copilot", "opencode"],
|
|
7505
|
-
model: "gemini-3.1-pro",
|
|
7506
|
-
variant: "high"
|
|
7507
|
-
},
|
|
7508
|
-
{
|
|
7509
|
-
providers: ["anthropic", "github-copilot", "opencode"],
|
|
7510
|
-
model: "claude-opus-4-6",
|
|
7511
|
-
variant: "max"
|
|
7512
|
-
}
|
|
7513
|
-
]
|
|
7514
|
-
},
|
|
7515
|
-
deep: {
|
|
7516
|
-
fallbackChain: [
|
|
7517
|
-
{
|
|
7518
|
-
providers: ["openai", "opencode"],
|
|
7519
|
-
model: "gpt-5.3-codex",
|
|
7520
|
-
variant: "medium"
|
|
7521
|
-
},
|
|
7522
|
-
{
|
|
7523
|
-
providers: ["anthropic", "github-copilot", "opencode"],
|
|
7524
|
-
model: "claude-opus-4-6",
|
|
7525
|
-
variant: "max"
|
|
7526
|
-
},
|
|
7527
|
-
{
|
|
7528
|
-
providers: ["google", "github-copilot", "opencode"],
|
|
7529
|
-
model: "gemini-3.1-pro",
|
|
7530
|
-
variant: "high"
|
|
7531
|
-
}
|
|
7532
|
-
],
|
|
7533
|
-
requiresModel: "gpt-5.3-codex"
|
|
7534
|
-
},
|
|
7535
|
-
artistry: {
|
|
7536
|
-
fallbackChain: [
|
|
7537
|
-
{
|
|
7538
|
-
providers: ["google", "github-copilot", "opencode"],
|
|
7539
|
-
model: "gemini-3.1-pro",
|
|
7540
|
-
variant: "high"
|
|
7541
|
-
},
|
|
7542
|
-
{
|
|
7543
|
-
providers: ["anthropic", "github-copilot", "opencode"],
|
|
7544
|
-
model: "claude-opus-4-6",
|
|
7545
|
-
variant: "max"
|
|
7546
|
-
},
|
|
7547
|
-
{
|
|
7548
|
-
providers: ["openai", "github-copilot", "opencode"],
|
|
7549
|
-
model: "gpt-5.4"
|
|
7550
|
-
}
|
|
7551
|
-
],
|
|
7552
|
-
requiresModel: "gemini-3.1-pro"
|
|
7553
|
-
},
|
|
7554
|
-
quick: {
|
|
7555
|
-
fallbackChain: [
|
|
7556
|
-
{
|
|
7557
|
-
providers: ["anthropic", "github-copilot", "opencode"],
|
|
7558
|
-
model: "claude-haiku-4-5"
|
|
7559
|
-
},
|
|
7560
|
-
{
|
|
7561
|
-
providers: ["google", "github-copilot", "opencode"],
|
|
7562
|
-
model: "gemini-3-flash"
|
|
7563
|
-
},
|
|
7564
|
-
{ providers: ["opencode"], model: "gpt-5-nano" }
|
|
7565
|
-
]
|
|
7566
|
-
},
|
|
7567
|
-
"unspecified-low": {
|
|
7568
|
-
fallbackChain: [
|
|
7569
|
-
{
|
|
7570
|
-
providers: ["anthropic", "github-copilot", "opencode"],
|
|
7571
|
-
model: "claude-sonnet-4-5"
|
|
7572
|
-
},
|
|
7573
|
-
{
|
|
7574
|
-
providers: ["openai", "opencode"],
|
|
7575
|
-
model: "gpt-5.3-codex",
|
|
7576
|
-
variant: "medium"
|
|
7577
|
-
},
|
|
7578
|
-
{
|
|
7579
|
-
providers: ["google", "github-copilot", "opencode"],
|
|
7580
|
-
model: "gemini-3-flash"
|
|
7581
|
-
}
|
|
7582
|
-
]
|
|
7583
|
-
},
|
|
7584
|
-
"unspecified-high": {
|
|
7585
|
-
fallbackChain: [
|
|
7586
|
-
{
|
|
7587
|
-
providers: ["openai", "github-copilot", "opencode"],
|
|
7588
|
-
model: "gpt-5.4",
|
|
7589
|
-
variant: "high"
|
|
7590
|
-
},
|
|
7591
|
-
{
|
|
7592
|
-
providers: ["anthropic", "github-copilot", "opencode"],
|
|
7593
|
-
model: "claude-opus-4-6",
|
|
7594
|
-
variant: "max"
|
|
7595
|
-
},
|
|
7596
|
-
{ providers: ["zai-coding-plan", "opencode"], model: "glm-5" },
|
|
7597
|
-
{ providers: ["kimi-for-coding"], model: "k2p5" },
|
|
7598
|
-
{ providers: ["opencode"], model: "kimi-k2.5" }
|
|
7599
|
-
]
|
|
7600
|
-
},
|
|
7601
|
-
writing: {
|
|
7602
|
-
fallbackChain: [
|
|
7603
|
-
{ providers: ["kimi-for-coding"], model: "k2p5" },
|
|
7604
|
-
{
|
|
7605
|
-
providers: ["google", "github-copilot", "opencode"],
|
|
7606
|
-
model: "gemini-3-flash"
|
|
7607
|
-
},
|
|
7608
|
-
{
|
|
7609
|
-
providers: ["anthropic", "github-copilot", "opencode"],
|
|
7610
|
-
model: "claude-sonnet-4-5"
|
|
7611
|
-
}
|
|
7612
|
-
]
|
|
7613
|
-
}
|
|
7377
|
+
}
|
|
7378
|
+
var OPENAI_ONLY_AGENT_OVERRIDES, OPENAI_ONLY_CATEGORY_OVERRIDES;
|
|
7379
|
+
var init_openai_only_model_catalog = __esm(() => {
|
|
7380
|
+
OPENAI_ONLY_AGENT_OVERRIDES = {
|
|
7381
|
+
explore: { model: "openai/gpt-5.4", variant: "medium" },
|
|
7382
|
+
librarian: { model: "openai/gpt-5.4", variant: "medium" }
|
|
7383
|
+
};
|
|
7384
|
+
OPENAI_ONLY_CATEGORY_OVERRIDES = {
|
|
7385
|
+
artistry: { model: "openai/gpt-5.4", variant: "xhigh" },
|
|
7386
|
+
quick: { model: "openai/gpt-5.3-codex", variant: "low" },
|
|
7387
|
+
"visual-engineering": { model: "openai/gpt-5.4", variant: "high" },
|
|
7388
|
+
writing: { model: "openai/gpt-5.4", variant: "medium" }
|
|
7614
7389
|
};
|
|
7615
7390
|
});
|
|
7616
7391
|
|
|
@@ -7626,6 +7401,7 @@ function toProviderAvailability(config) {
|
|
|
7626
7401
|
copilot: config.hasCopilot,
|
|
7627
7402
|
zai: config.hasZaiCodingPlan,
|
|
7628
7403
|
kimiForCoding: config.hasKimiForCoding,
|
|
7404
|
+
opencodeGo: config.hasOpencodeGo,
|
|
7629
7405
|
isMaxPlan: config.isMax20
|
|
7630
7406
|
};
|
|
7631
7407
|
}
|
|
@@ -7637,7 +7413,8 @@ function isProviderAvailable(provider, availability) {
|
|
|
7637
7413
|
"github-copilot": availability.copilot,
|
|
7638
7414
|
opencode: availability.opencodeZen,
|
|
7639
7415
|
"zai-coding-plan": availability.zai,
|
|
7640
|
-
"kimi-for-coding": availability.kimiForCoding
|
|
7416
|
+
"kimi-for-coding": availability.kimiForCoding,
|
|
7417
|
+
"opencode-go": availability.opencodeGo
|
|
7641
7418
|
};
|
|
7642
7419
|
return mapping[provider] ?? false;
|
|
7643
7420
|
}
|
|
@@ -7683,7 +7460,7 @@ var init_fallback_chain_resolution = __esm(() => {
|
|
|
7683
7460
|
// src/cli/model-fallback.ts
|
|
7684
7461
|
function generateModelConfig(config) {
|
|
7685
7462
|
const avail = toProviderAvailability(config);
|
|
7686
|
-
const hasAnyProvider = avail.native.claude || avail.native.openai || avail.native.gemini || avail.opencodeZen || avail.copilot || avail.zai || avail.kimiForCoding;
|
|
7463
|
+
const hasAnyProvider = avail.native.claude || avail.native.openai || avail.native.gemini || avail.opencodeZen || avail.copilot || avail.zai || avail.kimiForCoding || avail.opencodeGo;
|
|
7687
7464
|
if (!hasAnyProvider) {
|
|
7688
7465
|
return {
|
|
7689
7466
|
$schema: SCHEMA_URL,
|
|
@@ -7694,8 +7471,12 @@ function generateModelConfig(config) {
|
|
|
7694
7471
|
const agents = {};
|
|
7695
7472
|
const categories = {};
|
|
7696
7473
|
for (const [role, req] of Object.entries(CLI_AGENT_MODEL_REQUIREMENTS)) {
|
|
7697
|
-
if (role === "librarian"
|
|
7698
|
-
|
|
7474
|
+
if (role === "librarian") {
|
|
7475
|
+
if (avail.opencodeGo) {
|
|
7476
|
+
agents[role] = { model: "opencode-go/minimax-m2.5" };
|
|
7477
|
+
} else if (avail.zai) {
|
|
7478
|
+
agents[role] = { model: ZAI_MODEL };
|
|
7479
|
+
}
|
|
7699
7480
|
continue;
|
|
7700
7481
|
}
|
|
7701
7482
|
if (role === "explore") {
|
|
@@ -7703,6 +7484,8 @@ function generateModelConfig(config) {
|
|
|
7703
7484
|
agents[role] = { model: "anthropic/claude-haiku-4-5" };
|
|
7704
7485
|
} else if (avail.opencodeZen) {
|
|
7705
7486
|
agents[role] = { model: "opencode/claude-haiku-4-5" };
|
|
7487
|
+
} else if (avail.opencodeGo) {
|
|
7488
|
+
agents[role] = { model: "opencode-go/minimax-m2.5" };
|
|
7706
7489
|
} else if (avail.copilot) {
|
|
7707
7490
|
agents[role] = { model: "github-copilot/gpt-5-mini" };
|
|
7708
7491
|
} else {
|
|
@@ -7752,15 +7535,17 @@ function generateModelConfig(config) {
|
|
|
7752
7535
|
categories[cat] = { model: ULTIMATE_FALLBACK };
|
|
7753
7536
|
}
|
|
7754
7537
|
}
|
|
7755
|
-
|
|
7538
|
+
const generatedConfig = {
|
|
7756
7539
|
$schema: SCHEMA_URL,
|
|
7757
7540
|
agents,
|
|
7758
7541
|
categories
|
|
7759
7542
|
};
|
|
7543
|
+
return isOpenAiOnlyAvailability(avail) ? applyOpenAiOnlyModelCatalog(generatedConfig) : generatedConfig;
|
|
7760
7544
|
}
|
|
7761
|
-
var ZAI_MODEL = "zai-coding-plan/glm-4.7", ULTIMATE_FALLBACK = "opencode/
|
|
7545
|
+
var ZAI_MODEL = "zai-coding-plan/glm-4.7", ULTIMATE_FALLBACK = "opencode/gpt-5-nano", SCHEMA_URL = "https://raw.githubusercontent.com/code-yeongyu/oh-my-openagent/dev/assets/oh-my-opencode.schema.json";
|
|
7762
7546
|
var init_model_fallback = __esm(() => {
|
|
7763
7547
|
init_model_fallback_requirements();
|
|
7548
|
+
init_openai_only_model_catalog();
|
|
7764
7549
|
init_fallback_chain_resolution();
|
|
7765
7550
|
});
|
|
7766
7551
|
|
|
@@ -7954,24 +7739,46 @@ import { existsSync as existsSync8, readFileSync as readFileSync7 } from "fs";
|
|
|
7954
7739
|
function detectProvidersFromOmoConfig() {
|
|
7955
7740
|
const omoConfigPath = getOmoConfigPath();
|
|
7956
7741
|
if (!existsSync8(omoConfigPath)) {
|
|
7957
|
-
return {
|
|
7742
|
+
return {
|
|
7743
|
+
hasOpenAI: true,
|
|
7744
|
+
hasOpencodeZen: true,
|
|
7745
|
+
hasZaiCodingPlan: false,
|
|
7746
|
+
hasKimiForCoding: false,
|
|
7747
|
+
hasOpencodeGo: false
|
|
7748
|
+
};
|
|
7958
7749
|
}
|
|
7959
7750
|
try {
|
|
7960
7751
|
const content = readFileSync7(omoConfigPath, "utf-8");
|
|
7961
7752
|
const omoConfig = parseJsonc(content);
|
|
7962
7753
|
if (!omoConfig || typeof omoConfig !== "object") {
|
|
7963
|
-
return {
|
|
7754
|
+
return {
|
|
7755
|
+
hasOpenAI: true,
|
|
7756
|
+
hasOpencodeZen: true,
|
|
7757
|
+
hasZaiCodingPlan: false,
|
|
7758
|
+
hasKimiForCoding: false,
|
|
7759
|
+
hasOpencodeGo: false
|
|
7760
|
+
};
|
|
7964
7761
|
}
|
|
7965
7762
|
const configStr = JSON.stringify(omoConfig);
|
|
7966
7763
|
const hasOpenAI = configStr.includes('"openai/');
|
|
7967
7764
|
const hasOpencodeZen = configStr.includes('"opencode/');
|
|
7968
7765
|
const hasZaiCodingPlan = configStr.includes('"zai-coding-plan/');
|
|
7969
7766
|
const hasKimiForCoding = configStr.includes('"kimi-for-coding/');
|
|
7970
|
-
|
|
7767
|
+
const hasOpencodeGo = configStr.includes('"opencode-go/');
|
|
7768
|
+
return { hasOpenAI, hasOpencodeZen, hasZaiCodingPlan, hasKimiForCoding, hasOpencodeGo };
|
|
7971
7769
|
} catch {
|
|
7972
|
-
return {
|
|
7770
|
+
return {
|
|
7771
|
+
hasOpenAI: true,
|
|
7772
|
+
hasOpencodeZen: true,
|
|
7773
|
+
hasZaiCodingPlan: false,
|
|
7774
|
+
hasKimiForCoding: false,
|
|
7775
|
+
hasOpencodeGo: false
|
|
7776
|
+
};
|
|
7973
7777
|
}
|
|
7974
7778
|
}
|
|
7779
|
+
function isOurPlugin(plugin) {
|
|
7780
|
+
return plugin === PLUGIN_NAME || plugin.startsWith(`${PLUGIN_NAME}@`) || plugin === LEGACY_PLUGIN_NAME || plugin.startsWith(`${LEGACY_PLUGIN_NAME}@`);
|
|
7781
|
+
}
|
|
7975
7782
|
function detectCurrentConfig() {
|
|
7976
7783
|
const result = {
|
|
7977
7784
|
isInstalled: false,
|
|
@@ -7982,7 +7789,8 @@ function detectCurrentConfig() {
|
|
|
7982
7789
|
hasCopilot: false,
|
|
7983
7790
|
hasOpencodeZen: true,
|
|
7984
7791
|
hasZaiCodingPlan: false,
|
|
7985
|
-
hasKimiForCoding: false
|
|
7792
|
+
hasKimiForCoding: false,
|
|
7793
|
+
hasOpencodeGo: false
|
|
7986
7794
|
};
|
|
7987
7795
|
const { format: format2, path: path3 } = detectConfigFormat();
|
|
7988
7796
|
if (format2 === "none") {
|
|
@@ -7994,17 +7802,18 @@ function detectCurrentConfig() {
|
|
|
7994
7802
|
}
|
|
7995
7803
|
const openCodeConfig = parseResult.config;
|
|
7996
7804
|
const plugins = openCodeConfig.plugin ?? [];
|
|
7997
|
-
result.isInstalled = plugins.some(
|
|
7805
|
+
result.isInstalled = plugins.some(isOurPlugin);
|
|
7998
7806
|
if (!result.isInstalled) {
|
|
7999
7807
|
return result;
|
|
8000
7808
|
}
|
|
8001
7809
|
const providers = openCodeConfig.provider;
|
|
8002
7810
|
result.hasGemini = providers ? "google" in providers : false;
|
|
8003
|
-
const { hasOpenAI, hasOpencodeZen, hasZaiCodingPlan, hasKimiForCoding } = detectProvidersFromOmoConfig();
|
|
7811
|
+
const { hasOpenAI, hasOpencodeZen, hasZaiCodingPlan, hasKimiForCoding, hasOpencodeGo } = detectProvidersFromOmoConfig();
|
|
8004
7812
|
result.hasOpenAI = hasOpenAI;
|
|
8005
7813
|
result.hasOpencodeZen = hasOpencodeZen;
|
|
8006
7814
|
result.hasZaiCodingPlan = hasZaiCodingPlan;
|
|
8007
7815
|
result.hasKimiForCoding = hasKimiForCoding;
|
|
7816
|
+
result.hasOpencodeGo = hasOpencodeGo;
|
|
8008
7817
|
return result;
|
|
8009
7818
|
}
|
|
8010
7819
|
var init_detect_current_config = __esm(() => {
|
|
@@ -8015,35 +7824,75 @@ var init_detect_current_config = __esm(() => {
|
|
|
8015
7824
|
});
|
|
8016
7825
|
|
|
8017
7826
|
// src/cli/config-manager/bun-install.ts
|
|
8018
|
-
|
|
8019
|
-
|
|
8020
|
-
|
|
7827
|
+
import { existsSync as existsSync9 } from "fs";
|
|
7828
|
+
function readProcessOutput(stream) {
|
|
7829
|
+
if (!stream) {
|
|
7830
|
+
return Promise.resolve("");
|
|
7831
|
+
}
|
|
7832
|
+
return Bun.readableStreamToText(stream);
|
|
8021
7833
|
}
|
|
8022
|
-
|
|
7834
|
+
function logCapturedOutputOnFailure(outputMode, output) {
|
|
7835
|
+
if (outputMode !== "pipe") {
|
|
7836
|
+
return;
|
|
7837
|
+
}
|
|
7838
|
+
const stdout = output.stdout.trim();
|
|
7839
|
+
const stderr = output.stderr.trim();
|
|
7840
|
+
if (!stdout && !stderr) {
|
|
7841
|
+
return;
|
|
7842
|
+
}
|
|
7843
|
+
log("[bun-install] Captured output from failed bun install", {
|
|
7844
|
+
stdout,
|
|
7845
|
+
stderr
|
|
7846
|
+
});
|
|
7847
|
+
}
|
|
7848
|
+
async function runBunInstallWithDetails(options) {
|
|
7849
|
+
const outputMode = options?.outputMode ?? "pipe";
|
|
7850
|
+
const cacheDir = options?.workspaceDir ?? getOpenCodeCacheDir();
|
|
7851
|
+
const packageJsonPath = `${cacheDir}/package.json`;
|
|
7852
|
+
if (!existsSync9(packageJsonPath)) {
|
|
7853
|
+
return {
|
|
7854
|
+
success: false,
|
|
7855
|
+
error: `Workspace not initialized: ${packageJsonPath} not found. OpenCode should create this on first run.`
|
|
7856
|
+
};
|
|
7857
|
+
}
|
|
8023
7858
|
try {
|
|
8024
7859
|
const proc = spawnWithWindowsHide(["bun", "install"], {
|
|
8025
|
-
cwd:
|
|
8026
|
-
stdout:
|
|
8027
|
-
stderr:
|
|
7860
|
+
cwd: cacheDir,
|
|
7861
|
+
stdout: outputMode,
|
|
7862
|
+
stderr: outputMode
|
|
8028
7863
|
});
|
|
7864
|
+
const outputPromise = Promise.all([readProcessOutput(proc.stdout), readProcessOutput(proc.stderr)]).then(([stdout, stderr]) => ({ stdout, stderr }));
|
|
8029
7865
|
let timeoutId;
|
|
8030
7866
|
const timeoutPromise = new Promise((resolve2) => {
|
|
8031
7867
|
timeoutId = setTimeout(() => resolve2("timeout"), BUN_INSTALL_TIMEOUT_MS);
|
|
8032
7868
|
});
|
|
8033
7869
|
const exitPromise = proc.exited.then(() => "completed");
|
|
8034
7870
|
const result = await Promise.race([exitPromise, timeoutPromise]);
|
|
8035
|
-
|
|
7871
|
+
if (timeoutId) {
|
|
7872
|
+
clearTimeout(timeoutId);
|
|
7873
|
+
}
|
|
8036
7874
|
if (result === "timeout") {
|
|
8037
7875
|
try {
|
|
8038
7876
|
proc.kill();
|
|
8039
|
-
} catch {
|
|
7877
|
+
} catch (err) {
|
|
7878
|
+
log("[cli/install] Failed to kill timed out bun install process:", err);
|
|
7879
|
+
}
|
|
7880
|
+
if (outputMode === "pipe") {
|
|
7881
|
+
outputPromise.then((output2) => {
|
|
7882
|
+
logCapturedOutputOnFailure(outputMode, output2);
|
|
7883
|
+
}).catch((err) => {
|
|
7884
|
+
log("[bun-install] Failed to read captured output after timeout:", err);
|
|
7885
|
+
});
|
|
7886
|
+
}
|
|
8040
7887
|
return {
|
|
8041
7888
|
success: false,
|
|
8042
7889
|
timedOut: true,
|
|
8043
|
-
error: `bun install timed out after ${BUN_INSTALL_TIMEOUT_SECONDS} seconds. Try running manually: cd ${
|
|
7890
|
+
error: `bun install timed out after ${BUN_INSTALL_TIMEOUT_SECONDS} seconds. Try running manually: cd "${cacheDir}" && bun i`
|
|
8044
7891
|
};
|
|
8045
7892
|
}
|
|
7893
|
+
const output = await outputPromise;
|
|
8046
7894
|
if (proc.exitCode !== 0) {
|
|
7895
|
+
logCapturedOutputOnFailure(outputMode, output);
|
|
8047
7896
|
return {
|
|
8048
7897
|
success: false,
|
|
8049
7898
|
error: `bun install failed with exit code ${proc.exitCode}`
|
|
@@ -8060,7 +7909,8 @@ async function runBunInstallWithDetails() {
|
|
|
8060
7909
|
}
|
|
8061
7910
|
var BUN_INSTALL_TIMEOUT_SECONDS = 60, BUN_INSTALL_TIMEOUT_MS;
|
|
8062
7911
|
var init_bun_install = __esm(() => {
|
|
8063
|
-
|
|
7912
|
+
init_data_path();
|
|
7913
|
+
init_logger();
|
|
8064
7914
|
init_spawn_with_windows_hide();
|
|
8065
7915
|
BUN_INSTALL_TIMEOUT_MS = BUN_INSTALL_TIMEOUT_SECONDS * 1000;
|
|
8066
7916
|
});
|
|
@@ -8138,27 +7988,22 @@ var require_src = __commonJS((exports, module) => {
|
|
|
8138
7988
|
// src/hooks/auto-update-checker/constants.ts
|
|
8139
7989
|
import * as path4 from "path";
|
|
8140
7990
|
import * as os3 from "os";
|
|
8141
|
-
function getCacheDir2() {
|
|
8142
|
-
if (process.platform === "win32") {
|
|
8143
|
-
return path4.join(process.env.LOCALAPPDATA ?? os3.homedir(), "opencode");
|
|
8144
|
-
}
|
|
8145
|
-
return path4.join(os3.homedir(), ".cache", "opencode");
|
|
8146
|
-
}
|
|
8147
7991
|
function getWindowsAppdataDir() {
|
|
8148
7992
|
if (process.platform !== "win32")
|
|
8149
7993
|
return null;
|
|
8150
7994
|
return process.env.APPDATA ?? path4.join(os3.homedir(), "AppData", "Roaming");
|
|
8151
7995
|
}
|
|
8152
|
-
var
|
|
7996
|
+
var PACKAGE_NAME = "oh-my-opencode", NPM_REGISTRY_URL, NPM_FETCH_TIMEOUT = 5000, CACHE_DIR, VERSION_FILE, USER_CONFIG_DIR, USER_OPENCODE_CONFIG, USER_OPENCODE_CONFIG_JSONC, INSTALLED_PACKAGE_JSON;
|
|
8153
7997
|
var init_constants3 = __esm(() => {
|
|
8154
|
-
|
|
8155
|
-
|
|
8156
|
-
|
|
7998
|
+
init_data_path();
|
|
7999
|
+
init_opencode_config_dir();
|
|
8000
|
+
NPM_REGISTRY_URL = `https://registry.npmjs.org/-/package/${PACKAGE_NAME}/dist-tags`;
|
|
8001
|
+
CACHE_DIR = getOpenCodeCacheDir();
|
|
8157
8002
|
VERSION_FILE = path4.join(CACHE_DIR, "version");
|
|
8158
8003
|
USER_CONFIG_DIR = getOpenCodeConfigDir({ binary: "opencode" });
|
|
8159
8004
|
USER_OPENCODE_CONFIG = path4.join(USER_CONFIG_DIR, "opencode.json");
|
|
8160
8005
|
USER_OPENCODE_CONFIG_JSONC = path4.join(USER_CONFIG_DIR, "opencode.jsonc");
|
|
8161
|
-
INSTALLED_PACKAGE_JSON = path4.join(
|
|
8006
|
+
INSTALLED_PACKAGE_JSON = path4.join(CACHE_DIR, "node_modules", PACKAGE_NAME, "package.json");
|
|
8162
8007
|
});
|
|
8163
8008
|
|
|
8164
8009
|
// src/hooks/auto-update-checker/checker/config-paths.ts
|
|
@@ -8212,7 +8057,7 @@ function getLocalDevPath(directory) {
|
|
|
8212
8057
|
const config2 = JSON.parse(stripJsonComments(content));
|
|
8213
8058
|
const plugins = config2.plugin ?? [];
|
|
8214
8059
|
for (const entry of plugins) {
|
|
8215
|
-
if (entry.startsWith("file://") && entry.includes(
|
|
8060
|
+
if (entry.startsWith("file://") && entry.includes(PACKAGE_NAME)) {
|
|
8216
8061
|
try {
|
|
8217
8062
|
return fileURLToPath(entry);
|
|
8218
8063
|
} catch {
|
|
@@ -8244,7 +8089,7 @@ function findPackageJsonUp(startPath) {
|
|
|
8244
8089
|
try {
|
|
8245
8090
|
const content = fs5.readFileSync(pkgPath, "utf-8");
|
|
8246
8091
|
const pkg = JSON.parse(content);
|
|
8247
|
-
if (pkg.name ===
|
|
8092
|
+
if (pkg.name === PACKAGE_NAME)
|
|
8248
8093
|
return pkgPath;
|
|
8249
8094
|
} catch {}
|
|
8250
8095
|
}
|
|
@@ -8284,9 +8129,6 @@ var init_local_dev_version = __esm(() => {
|
|
|
8284
8129
|
|
|
8285
8130
|
// src/hooks/auto-update-checker/checker/plugin-entry.ts
|
|
8286
8131
|
import * as fs7 from "fs";
|
|
8287
|
-
function isExplicitVersionPin(pinnedVersion) {
|
|
8288
|
-
return /^\d+\.\d+\.\d+/.test(pinnedVersion);
|
|
8289
|
-
}
|
|
8290
8132
|
function findPluginEntry(directory) {
|
|
8291
8133
|
for (const configPath of getConfigPaths(directory)) {
|
|
8292
8134
|
try {
|
|
@@ -8296,12 +8138,12 @@ function findPluginEntry(directory) {
|
|
|
8296
8138
|
const config2 = JSON.parse(stripJsonComments(content));
|
|
8297
8139
|
const plugins = config2.plugin ?? [];
|
|
8298
8140
|
for (const entry of plugins) {
|
|
8299
|
-
if (entry ===
|
|
8141
|
+
if (entry === PACKAGE_NAME) {
|
|
8300
8142
|
return { entry, isPinned: false, pinnedVersion: null, configPath };
|
|
8301
8143
|
}
|
|
8302
|
-
if (entry.startsWith(`${
|
|
8303
|
-
const pinnedVersion = entry.slice(
|
|
8304
|
-
const isPinned =
|
|
8144
|
+
if (entry.startsWith(`${PACKAGE_NAME}@`)) {
|
|
8145
|
+
const pinnedVersion = entry.slice(PACKAGE_NAME.length + 1);
|
|
8146
|
+
const isPinned = EXACT_SEMVER_REGEX.test(pinnedVersion.trim());
|
|
8305
8147
|
return { entry, isPinned, pinnedVersion, configPath };
|
|
8306
8148
|
}
|
|
8307
8149
|
}
|
|
@@ -8311,9 +8153,11 @@ function findPluginEntry(directory) {
|
|
|
8311
8153
|
}
|
|
8312
8154
|
return null;
|
|
8313
8155
|
}
|
|
8156
|
+
var EXACT_SEMVER_REGEX;
|
|
8314
8157
|
var init_plugin_entry = __esm(() => {
|
|
8315
8158
|
init_constants3();
|
|
8316
8159
|
init_config_paths();
|
|
8160
|
+
EXACT_SEMVER_REGEX = /^\d+\.\d+\.\d+(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$/;
|
|
8317
8161
|
});
|
|
8318
8162
|
|
|
8319
8163
|
// src/hooks/auto-update-checker/checker/cached-version.ts
|
|
@@ -8362,52 +8206,6 @@ var init_cached_version = __esm(() => {
|
|
|
8362
8206
|
});
|
|
8363
8207
|
|
|
8364
8208
|
// src/hooks/auto-update-checker/checker/pinned-version-updater.ts
|
|
8365
|
-
import * as fs9 from "fs";
|
|
8366
|
-
function replacePluginEntry(configPath, oldEntry, newEntry) {
|
|
8367
|
-
try {
|
|
8368
|
-
const content = fs9.readFileSync(configPath, "utf-8");
|
|
8369
|
-
const pluginMatch = content.match(/"plugin"\s*:\s*\[/);
|
|
8370
|
-
if (!pluginMatch || pluginMatch.index === undefined) {
|
|
8371
|
-
log(`[auto-update-checker] No "plugin" array found in ${configPath}`);
|
|
8372
|
-
return false;
|
|
8373
|
-
}
|
|
8374
|
-
const startIndex = pluginMatch.index + pluginMatch[0].length;
|
|
8375
|
-
let bracketCount = 1;
|
|
8376
|
-
let endIndex = startIndex;
|
|
8377
|
-
for (let i2 = startIndex;i2 < content.length && bracketCount > 0; i2++) {
|
|
8378
|
-
if (content[i2] === "[")
|
|
8379
|
-
bracketCount++;
|
|
8380
|
-
else if (content[i2] === "]")
|
|
8381
|
-
bracketCount--;
|
|
8382
|
-
endIndex = i2;
|
|
8383
|
-
}
|
|
8384
|
-
const before = content.slice(0, startIndex);
|
|
8385
|
-
const pluginArrayContent = content.slice(startIndex, endIndex);
|
|
8386
|
-
const after = content.slice(endIndex);
|
|
8387
|
-
const escapedOldEntry = oldEntry.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
8388
|
-
const regex = new RegExp(`["']${escapedOldEntry}["']`);
|
|
8389
|
-
if (!regex.test(pluginArrayContent)) {
|
|
8390
|
-
log(`[auto-update-checker] Entry "${oldEntry}" not found in plugin array of ${configPath}`);
|
|
8391
|
-
return false;
|
|
8392
|
-
}
|
|
8393
|
-
const updatedPluginArray = pluginArrayContent.replace(regex, `"${newEntry}"`);
|
|
8394
|
-
const updatedContent = before + updatedPluginArray + after;
|
|
8395
|
-
if (updatedContent === content) {
|
|
8396
|
-
log(`[auto-update-checker] No changes made to ${configPath}`);
|
|
8397
|
-
return false;
|
|
8398
|
-
}
|
|
8399
|
-
fs9.writeFileSync(configPath, updatedContent, "utf-8");
|
|
8400
|
-
log(`[auto-update-checker] Updated ${configPath}: ${oldEntry} \u2192 ${newEntry}`);
|
|
8401
|
-
return true;
|
|
8402
|
-
} catch (err) {
|
|
8403
|
-
log(`[auto-update-checker] Failed to update config file ${configPath}:`, err);
|
|
8404
|
-
return false;
|
|
8405
|
-
}
|
|
8406
|
-
}
|
|
8407
|
-
function revertPinnedVersion(configPath, failedVersion, originalEntry) {
|
|
8408
|
-
const failedEntry = `${PACKAGE_NAME3}@${failedVersion}`;
|
|
8409
|
-
return replacePluginEntry(configPath, failedEntry, originalEntry);
|
|
8410
|
-
}
|
|
8411
8209
|
var init_pinned_version_updater = __esm(() => {
|
|
8412
8210
|
init_logger();
|
|
8413
8211
|
init_constants3();
|
|
@@ -8531,6 +8329,79 @@ var init_check_for_update = __esm(() => {
|
|
|
8531
8329
|
init_latest_version();
|
|
8532
8330
|
});
|
|
8533
8331
|
|
|
8332
|
+
// src/hooks/auto-update-checker/checker/sync-package-json.ts
|
|
8333
|
+
import * as crypto from "crypto";
|
|
8334
|
+
import * as fs9 from "fs";
|
|
8335
|
+
import * as path8 from "path";
|
|
8336
|
+
function safeUnlink(filePath) {
|
|
8337
|
+
try {
|
|
8338
|
+
fs9.unlinkSync(filePath);
|
|
8339
|
+
} catch (err) {
|
|
8340
|
+
log(`[auto-update-checker] Failed to cleanup temp file: ${filePath}`, err);
|
|
8341
|
+
}
|
|
8342
|
+
}
|
|
8343
|
+
function getIntentVersion(pluginInfo) {
|
|
8344
|
+
if (!pluginInfo.pinnedVersion) {
|
|
8345
|
+
return "latest";
|
|
8346
|
+
}
|
|
8347
|
+
return pluginInfo.pinnedVersion;
|
|
8348
|
+
}
|
|
8349
|
+
function syncCachePackageJsonToIntent(pluginInfo) {
|
|
8350
|
+
const cachePackageJsonPath = path8.join(CACHE_DIR, "package.json");
|
|
8351
|
+
if (!fs9.existsSync(cachePackageJsonPath)) {
|
|
8352
|
+
log("[auto-update-checker] Cache package.json not found, nothing to sync");
|
|
8353
|
+
return { synced: false, error: "file_not_found", message: "Cache package.json not found" };
|
|
8354
|
+
}
|
|
8355
|
+
let content;
|
|
8356
|
+
let pkgJson;
|
|
8357
|
+
try {
|
|
8358
|
+
content = fs9.readFileSync(cachePackageJsonPath, "utf-8");
|
|
8359
|
+
} catch (err) {
|
|
8360
|
+
log("[auto-update-checker] Failed to read cache package.json:", err);
|
|
8361
|
+
return { synced: false, error: "parse_error", message: "Failed to read cache package.json" };
|
|
8362
|
+
}
|
|
8363
|
+
try {
|
|
8364
|
+
pkgJson = JSON.parse(content);
|
|
8365
|
+
} catch (err) {
|
|
8366
|
+
log("[auto-update-checker] Failed to parse cache package.json:", err);
|
|
8367
|
+
return { synced: false, error: "parse_error", message: "Failed to parse cache package.json (malformed JSON)" };
|
|
8368
|
+
}
|
|
8369
|
+
if (!pkgJson || !pkgJson.dependencies?.[PACKAGE_NAME]) {
|
|
8370
|
+
log("[auto-update-checker] Plugin not in cache package.json dependencies, nothing to sync");
|
|
8371
|
+
return { synced: false, error: "plugin_not_in_deps", message: "Plugin not in cache package.json dependencies" };
|
|
8372
|
+
}
|
|
8373
|
+
const currentVersion = pkgJson.dependencies[PACKAGE_NAME];
|
|
8374
|
+
const intentVersion = getIntentVersion(pluginInfo);
|
|
8375
|
+
if (currentVersion === intentVersion) {
|
|
8376
|
+
log("[auto-update-checker] Cache package.json already matches intent:", intentVersion);
|
|
8377
|
+
return { synced: false, error: null, message: `Already matches intent: ${intentVersion}` };
|
|
8378
|
+
}
|
|
8379
|
+
const intentIsTag = !EXACT_SEMVER_REGEX2.test(intentVersion.trim());
|
|
8380
|
+
const currentIsSemver = EXACT_SEMVER_REGEX2.test(String(currentVersion).trim());
|
|
8381
|
+
if (intentIsTag && currentIsSemver) {
|
|
8382
|
+
log(`[auto-update-checker] Syncing cache package.json: "${currentVersion}" \u2192 "${intentVersion}" (opencode.json intent)`);
|
|
8383
|
+
} else {
|
|
8384
|
+
log(`[auto-update-checker] Updating cache package.json: "${currentVersion}" \u2192 "${intentVersion}"`);
|
|
8385
|
+
}
|
|
8386
|
+
pkgJson.dependencies[PACKAGE_NAME] = intentVersion;
|
|
8387
|
+
const tmpPath = `${cachePackageJsonPath}.${crypto.randomUUID()}`;
|
|
8388
|
+
try {
|
|
8389
|
+
fs9.writeFileSync(tmpPath, JSON.stringify(pkgJson, null, 2));
|
|
8390
|
+
fs9.renameSync(tmpPath, cachePackageJsonPath);
|
|
8391
|
+
return { synced: true, error: null, message: `Updated: "${currentVersion}" \u2192 "${intentVersion}"` };
|
|
8392
|
+
} catch (err) {
|
|
8393
|
+
log("[auto-update-checker] Failed to write cache package.json:", err);
|
|
8394
|
+
safeUnlink(tmpPath);
|
|
8395
|
+
return { synced: false, error: "write_error", message: "Failed to write cache package.json" };
|
|
8396
|
+
}
|
|
8397
|
+
}
|
|
8398
|
+
var EXACT_SEMVER_REGEX2;
|
|
8399
|
+
var init_sync_package_json = __esm(() => {
|
|
8400
|
+
init_constants3();
|
|
8401
|
+
init_logger();
|
|
8402
|
+
EXACT_SEMVER_REGEX2 = /^\d+\.\d+\.\d+(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$/;
|
|
8403
|
+
});
|
|
8404
|
+
|
|
8534
8405
|
// src/hooks/auto-update-checker/checker.ts
|
|
8535
8406
|
var init_checker = __esm(() => {
|
|
8536
8407
|
init_local_dev_path();
|
|
@@ -8540,63 +8411,67 @@ var init_checker = __esm(() => {
|
|
|
8540
8411
|
init_pinned_version_updater();
|
|
8541
8412
|
init_latest_version();
|
|
8542
8413
|
init_check_for_update();
|
|
8414
|
+
init_sync_package_json();
|
|
8543
8415
|
});
|
|
8544
8416
|
|
|
8545
8417
|
// src/hooks/auto-update-checker/cache.ts
|
|
8546
8418
|
import * as fs10 from "fs";
|
|
8547
|
-
import * as
|
|
8419
|
+
import * as path9 from "path";
|
|
8548
8420
|
function stripTrailingCommas(json3) {
|
|
8549
8421
|
return json3.replace(/,(\s*[}\]])/g, "$1");
|
|
8550
8422
|
}
|
|
8551
|
-
function
|
|
8552
|
-
const lockPath = path8.join(USER_CONFIG_DIR, "bun.lock");
|
|
8553
|
-
if (!fs10.existsSync(lockPath))
|
|
8554
|
-
return false;
|
|
8423
|
+
function removeFromTextBunLock(lockPath, packageName) {
|
|
8555
8424
|
try {
|
|
8556
8425
|
const content = fs10.readFileSync(lockPath, "utf-8");
|
|
8557
8426
|
const lock = JSON.parse(stripTrailingCommas(content));
|
|
8558
|
-
let modified = false;
|
|
8559
|
-
if (lock.workspaces?.[""]?.dependencies?.[packageName]) {
|
|
8560
|
-
delete lock.workspaces[""].dependencies[packageName];
|
|
8561
|
-
modified = true;
|
|
8562
|
-
}
|
|
8563
8427
|
if (lock.packages?.[packageName]) {
|
|
8564
8428
|
delete lock.packages[packageName];
|
|
8565
|
-
modified = true;
|
|
8566
|
-
}
|
|
8567
|
-
if (modified) {
|
|
8568
8429
|
fs10.writeFileSync(lockPath, JSON.stringify(lock, null, 2));
|
|
8569
8430
|
log(`[auto-update-checker] Removed from bun.lock: ${packageName}`);
|
|
8431
|
+
return true;
|
|
8570
8432
|
}
|
|
8571
|
-
return
|
|
8433
|
+
return false;
|
|
8434
|
+
} catch {
|
|
8435
|
+
return false;
|
|
8436
|
+
}
|
|
8437
|
+
}
|
|
8438
|
+
function deleteBinaryBunLock(lockPath) {
|
|
8439
|
+
try {
|
|
8440
|
+
fs10.unlinkSync(lockPath);
|
|
8441
|
+
log(`[auto-update-checker] Removed bun.lockb to force re-resolution`);
|
|
8442
|
+
return true;
|
|
8572
8443
|
} catch {
|
|
8573
8444
|
return false;
|
|
8574
8445
|
}
|
|
8575
8446
|
}
|
|
8576
|
-
function
|
|
8447
|
+
function removeFromBunLock(packageName) {
|
|
8448
|
+
const textLockPath = path9.join(CACHE_DIR, "bun.lock");
|
|
8449
|
+
const binaryLockPath = path9.join(CACHE_DIR, "bun.lockb");
|
|
8450
|
+
if (fs10.existsSync(textLockPath)) {
|
|
8451
|
+
return removeFromTextBunLock(textLockPath, packageName);
|
|
8452
|
+
}
|
|
8453
|
+
if (fs10.existsSync(binaryLockPath)) {
|
|
8454
|
+
return deleteBinaryBunLock(binaryLockPath);
|
|
8455
|
+
}
|
|
8456
|
+
return false;
|
|
8457
|
+
}
|
|
8458
|
+
function invalidatePackage(packageName = PACKAGE_NAME) {
|
|
8577
8459
|
try {
|
|
8578
|
-
const
|
|
8579
|
-
|
|
8460
|
+
const pkgDirs = [
|
|
8461
|
+
path9.join(USER_CONFIG_DIR, "node_modules", packageName),
|
|
8462
|
+
path9.join(CACHE_DIR, "node_modules", packageName)
|
|
8463
|
+
];
|
|
8580
8464
|
let packageRemoved = false;
|
|
8581
|
-
let dependencyRemoved = false;
|
|
8582
8465
|
let lockRemoved = false;
|
|
8583
|
-
|
|
8584
|
-
fs10.
|
|
8585
|
-
|
|
8586
|
-
|
|
8587
|
-
|
|
8588
|
-
if (fs10.existsSync(pkgJsonPath)) {
|
|
8589
|
-
const content = fs10.readFileSync(pkgJsonPath, "utf-8");
|
|
8590
|
-
const pkgJson = JSON.parse(content);
|
|
8591
|
-
if (pkgJson.dependencies?.[packageName]) {
|
|
8592
|
-
delete pkgJson.dependencies[packageName];
|
|
8593
|
-
fs10.writeFileSync(pkgJsonPath, JSON.stringify(pkgJson, null, 2));
|
|
8594
|
-
log(`[auto-update-checker] Dependency removed from package.json: ${packageName}`);
|
|
8595
|
-
dependencyRemoved = true;
|
|
8466
|
+
for (const pkgDir of pkgDirs) {
|
|
8467
|
+
if (fs10.existsSync(pkgDir)) {
|
|
8468
|
+
fs10.rmSync(pkgDir, { recursive: true, force: true });
|
|
8469
|
+
log(`[auto-update-checker] Package removed: ${pkgDir}`);
|
|
8470
|
+
packageRemoved = true;
|
|
8596
8471
|
}
|
|
8597
8472
|
}
|
|
8598
8473
|
lockRemoved = removeFromBunLock(packageName);
|
|
8599
|
-
if (!packageRemoved && !
|
|
8474
|
+
if (!packageRemoved && !lockRemoved) {
|
|
8600
8475
|
log(`[auto-update-checker] Package not found, nothing to invalidate: ${packageName}`);
|
|
8601
8476
|
return false;
|
|
8602
8477
|
}
|
|
@@ -8644,12 +8519,34 @@ var init_update_toasts = __esm(() => {
|
|
|
8644
8519
|
});
|
|
8645
8520
|
|
|
8646
8521
|
// src/hooks/auto-update-checker/hook/background-update-check.ts
|
|
8522
|
+
import { existsSync as existsSync20 } from "fs";
|
|
8523
|
+
import { join as join17 } from "path";
|
|
8647
8524
|
function getPinnedVersionToastMessage(latestVersion) {
|
|
8648
8525
|
return `Update available: ${latestVersion} (version pinned, update manually)`;
|
|
8649
8526
|
}
|
|
8650
|
-
|
|
8527
|
+
function resolveActiveInstallWorkspace() {
|
|
8528
|
+
const configPaths = getOpenCodeConfigPaths({ binary: "opencode" });
|
|
8529
|
+
const cacheDir = getOpenCodeCacheDir();
|
|
8530
|
+
const configInstallPath = join17(configPaths.configDir, "node_modules", PACKAGE_NAME, "package.json");
|
|
8531
|
+
const cacheInstallPath = join17(cacheDir, "node_modules", PACKAGE_NAME, "package.json");
|
|
8532
|
+
if (existsSync20(configInstallPath)) {
|
|
8533
|
+
log(`[auto-update-checker] Active workspace: config-dir (${configPaths.configDir})`);
|
|
8534
|
+
return configPaths.configDir;
|
|
8535
|
+
}
|
|
8536
|
+
if (existsSync20(cacheInstallPath)) {
|
|
8537
|
+
log(`[auto-update-checker] Active workspace: cache-dir (${cacheDir})`);
|
|
8538
|
+
return cacheDir;
|
|
8539
|
+
}
|
|
8540
|
+
log(`[auto-update-checker] Active workspace: config-dir (default, no install detected)`);
|
|
8541
|
+
return configPaths.configDir;
|
|
8542
|
+
}
|
|
8543
|
+
async function runBunInstallSafe(workspaceDir) {
|
|
8651
8544
|
try {
|
|
8652
|
-
|
|
8545
|
+
const result = await runBunInstallWithDetails({ outputMode: "pipe", workspaceDir });
|
|
8546
|
+
if (!result.success && result.error) {
|
|
8547
|
+
log("[auto-update-checker] bun install error:", result.error);
|
|
8548
|
+
}
|
|
8549
|
+
return result.success;
|
|
8653
8550
|
} catch (err) {
|
|
8654
8551
|
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
8655
8552
|
log("[auto-update-checker] bun install error:", errorMessage);
|
|
@@ -8689,23 +8586,27 @@ async function runBackgroundUpdateCheck(ctx, autoUpdate, getToastMessage) {
|
|
|
8689
8586
|
log(`[auto-update-checker] User-pinned version detected (${pluginInfo.entry}), skipping auto-update. Notification only.`);
|
|
8690
8587
|
return;
|
|
8691
8588
|
}
|
|
8692
|
-
|
|
8693
|
-
|
|
8589
|
+
const syncResult = syncCachePackageJsonToIntent(pluginInfo);
|
|
8590
|
+
if (syncResult.error) {
|
|
8591
|
+
log(`[auto-update-checker] Sync failed with error: ${syncResult.error}`, syncResult.message);
|
|
8592
|
+
await showUpdateAvailableToast(ctx, latestVersion, getToastMessage);
|
|
8593
|
+
return;
|
|
8594
|
+
}
|
|
8595
|
+
invalidatePackage(PACKAGE_NAME);
|
|
8596
|
+
const activeWorkspace = resolveActiveInstallWorkspace();
|
|
8597
|
+
const installSuccess = await runBunInstallSafe(activeWorkspace);
|
|
8694
8598
|
if (installSuccess) {
|
|
8695
8599
|
await showAutoUpdatedToast(ctx, currentVersion, latestVersion);
|
|
8696
8600
|
log(`[auto-update-checker] Update installed: ${currentVersion} \u2192 ${latestVersion}`);
|
|
8697
8601
|
return;
|
|
8698
8602
|
}
|
|
8699
|
-
if (pluginInfo.isPinned) {
|
|
8700
|
-
revertPinnedVersion(pluginInfo.configPath, latestVersion, pluginInfo.entry);
|
|
8701
|
-
log("[auto-update-checker] Config reverted due to install failure");
|
|
8702
|
-
}
|
|
8703
8603
|
await showUpdateAvailableToast(ctx, latestVersion, getToastMessage);
|
|
8704
8604
|
log("[auto-update-checker] bun install failed; update not installed (falling back to notification-only)");
|
|
8705
8605
|
}
|
|
8706
8606
|
var init_background_update_check = __esm(() => {
|
|
8707
8607
|
init_config_manager();
|
|
8708
8608
|
init_logger();
|
|
8609
|
+
init_shared();
|
|
8709
8610
|
init_cache();
|
|
8710
8611
|
init_constants3();
|
|
8711
8612
|
init_checker();
|
|
@@ -8935,7 +8836,7 @@ var {
|
|
|
8935
8836
|
// package.json
|
|
8936
8837
|
var package_default = {
|
|
8937
8838
|
name: "oh-my-opencode",
|
|
8938
|
-
version: "3.
|
|
8839
|
+
version: "3.12.0",
|
|
8939
8840
|
description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
8940
8841
|
main: "dist/index.js",
|
|
8941
8842
|
types: "dist/index.d.ts",
|
|
@@ -8987,13 +8888,13 @@ var package_default = {
|
|
|
8987
8888
|
},
|
|
8988
8889
|
homepage: "https://github.com/code-yeongyu/oh-my-openagent#readme",
|
|
8989
8890
|
dependencies: {
|
|
8990
|
-
"@ast-grep/cli": "^0.
|
|
8991
|
-
"@ast-grep/napi": "^0.
|
|
8891
|
+
"@ast-grep/cli": "^0.41.1",
|
|
8892
|
+
"@ast-grep/napi": "^0.41.1",
|
|
8992
8893
|
"@clack/prompts": "^0.11.0",
|
|
8993
8894
|
"@code-yeongyu/comment-checker": "^0.7.0",
|
|
8994
8895
|
"@modelcontextprotocol/sdk": "^1.25.2",
|
|
8995
|
-
"@opencode-ai/plugin": "^1.2.
|
|
8996
|
-
"@opencode-ai/sdk": "^1.2.
|
|
8896
|
+
"@opencode-ai/plugin": "^1.2.24",
|
|
8897
|
+
"@opencode-ai/sdk": "^1.2.24",
|
|
8997
8898
|
commander: "^14.0.2",
|
|
8998
8899
|
"detect-libc": "^2.0.0",
|
|
8999
8900
|
diff: "^8.0.3",
|
|
@@ -9007,24 +8908,24 @@ var package_default = {
|
|
|
9007
8908
|
devDependencies: {
|
|
9008
8909
|
"@types/js-yaml": "^4.0.9",
|
|
9009
8910
|
"@types/picomatch": "^3.0.2",
|
|
9010
|
-
"bun-types": "1.3.
|
|
8911
|
+
"bun-types": "1.3.10",
|
|
9011
8912
|
typescript: "^5.7.3"
|
|
9012
8913
|
},
|
|
9013
8914
|
optionalDependencies: {
|
|
9014
|
-
"oh-my-opencode-darwin-arm64": "3.
|
|
9015
|
-
"oh-my-opencode-darwin-x64": "3.
|
|
9016
|
-
"oh-my-opencode-darwin-x64-baseline": "3.
|
|
9017
|
-
"oh-my-opencode-linux-arm64": "3.
|
|
9018
|
-
"oh-my-opencode-linux-arm64-musl": "3.
|
|
9019
|
-
"oh-my-opencode-linux-x64": "3.
|
|
9020
|
-
"oh-my-opencode-linux-x64-baseline": "3.
|
|
9021
|
-
"oh-my-opencode-linux-x64-musl": "3.
|
|
9022
|
-
"oh-my-opencode-linux-x64-musl-baseline": "3.
|
|
9023
|
-
"oh-my-opencode-windows-x64": "3.
|
|
9024
|
-
"oh-my-opencode-windows-x64-baseline": "3.
|
|
8915
|
+
"oh-my-opencode-darwin-arm64": "3.12.0",
|
|
8916
|
+
"oh-my-opencode-darwin-x64": "3.12.0",
|
|
8917
|
+
"oh-my-opencode-darwin-x64-baseline": "3.12.0",
|
|
8918
|
+
"oh-my-opencode-linux-arm64": "3.12.0",
|
|
8919
|
+
"oh-my-opencode-linux-arm64-musl": "3.12.0",
|
|
8920
|
+
"oh-my-opencode-linux-x64": "3.12.0",
|
|
8921
|
+
"oh-my-opencode-linux-x64-baseline": "3.12.0",
|
|
8922
|
+
"oh-my-opencode-linux-x64-musl": "3.12.0",
|
|
8923
|
+
"oh-my-opencode-linux-x64-musl-baseline": "3.12.0",
|
|
8924
|
+
"oh-my-opencode-windows-x64": "3.12.0",
|
|
8925
|
+
"oh-my-opencode-windows-x64-baseline": "3.12.0"
|
|
9025
8926
|
},
|
|
9026
8927
|
overrides: {
|
|
9027
|
-
"@opencode-ai/sdk": "^1.2.
|
|
8928
|
+
"@opencode-ai/sdk": "^1.2.24"
|
|
9028
8929
|
},
|
|
9029
8930
|
trustedDependencies: [
|
|
9030
8931
|
"@ast-grep/cli",
|
|
@@ -9048,6 +8949,7 @@ var SYMBOLS = {
|
|
|
9048
8949
|
warn: import_picocolors.default.yellow("[!]"),
|
|
9049
8950
|
star: import_picocolors.default.yellow("*")
|
|
9050
8951
|
};
|
|
8952
|
+
var ANSI_COLOR_PATTERN = new RegExp("\x1B\\[[0-9;]*m", "g");
|
|
9051
8953
|
function formatProvider(name, enabled, detail) {
|
|
9052
8954
|
const status = enabled ? SYMBOLS.check : import_picocolors.default.dim("\u25CB");
|
|
9053
8955
|
const label = enabled ? import_picocolors.default.white(name) : import_picocolors.default.dim(name);
|
|
@@ -9101,7 +9003,7 @@ function printWarning(message) {
|
|
|
9101
9003
|
function printBox(content, title) {
|
|
9102
9004
|
const lines = content.split(`
|
|
9103
9005
|
`);
|
|
9104
|
-
const maxWidth = Math.max(...lines.map((line) => line.replace(
|
|
9006
|
+
const maxWidth = Math.max(...lines.map((line) => line.replace(ANSI_COLOR_PATTERN, "").length), title?.length ?? 0) + 4;
|
|
9105
9007
|
const border = import_picocolors.default.dim("\u2500".repeat(maxWidth));
|
|
9106
9008
|
console.log();
|
|
9107
9009
|
if (title) {
|
|
@@ -9110,7 +9012,7 @@ function printBox(content, title) {
|
|
|
9110
9012
|
console.log(import_picocolors.default.dim("\u250C") + border + import_picocolors.default.dim("\u2510"));
|
|
9111
9013
|
}
|
|
9112
9014
|
for (const line of lines) {
|
|
9113
|
-
const stripped = line.replace(
|
|
9015
|
+
const stripped = line.replace(ANSI_COLOR_PATTERN, "");
|
|
9114
9016
|
const padding = maxWidth - stripped.length;
|
|
9115
9017
|
console.log(import_picocolors.default.dim("\u2502") + ` ${line}${" ".repeat(padding - 1)}` + import_picocolors.default.dim("\u2502"));
|
|
9116
9018
|
}
|
|
@@ -9137,6 +9039,9 @@ function validateNonTuiArgs(args) {
|
|
|
9137
9039
|
if (args.openai !== undefined && !["no", "yes"].includes(args.openai)) {
|
|
9138
9040
|
errors.push(`Invalid --openai value: ${args.openai} (expected: no, yes)`);
|
|
9139
9041
|
}
|
|
9042
|
+
if (args.opencodeGo !== undefined && !["no", "yes"].includes(args.opencodeGo)) {
|
|
9043
|
+
errors.push(`Invalid --opencode-go value: ${args.opencodeGo} (expected: no, yes)`);
|
|
9044
|
+
}
|
|
9140
9045
|
if (args.opencodeZen !== undefined && !["no", "yes"].includes(args.opencodeZen)) {
|
|
9141
9046
|
errors.push(`Invalid --opencode-zen value: ${args.opencodeZen} (expected: no, yes)`);
|
|
9142
9047
|
}
|
|
@@ -9157,7 +9062,8 @@ function argsToConfig(args) {
|
|
|
9157
9062
|
hasCopilot: args.copilot === "yes",
|
|
9158
9063
|
hasOpencodeZen: args.opencodeZen === "yes",
|
|
9159
9064
|
hasZaiCodingPlan: args.zaiCodingPlan === "yes",
|
|
9160
|
-
hasKimiForCoding: args.kimiForCoding === "yes"
|
|
9065
|
+
hasKimiForCoding: args.kimiForCoding === "yes",
|
|
9066
|
+
hasOpencodeGo: args.opencodeGo === "yes"
|
|
9161
9067
|
};
|
|
9162
9068
|
}
|
|
9163
9069
|
function detectedToInitialValues(detected) {
|
|
@@ -9172,7 +9078,8 @@ function detectedToInitialValues(detected) {
|
|
|
9172
9078
|
copilot: detected.hasCopilot ? "yes" : "no",
|
|
9173
9079
|
opencodeZen: detected.hasOpencodeZen ? "yes" : "no",
|
|
9174
9080
|
zaiCodingPlan: detected.hasZaiCodingPlan ? "yes" : "no",
|
|
9175
|
-
kimiForCoding: detected.hasKimiForCoding ? "yes" : "no"
|
|
9081
|
+
kimiForCoding: detected.hasKimiForCoding ? "yes" : "no",
|
|
9082
|
+
opencodeGo: detected.hasOpencodeGo ? "yes" : "no"
|
|
9176
9083
|
};
|
|
9177
9084
|
}
|
|
9178
9085
|
|
|
@@ -9247,7 +9154,7 @@ async function runCliInstaller(args, version) {
|
|
|
9247
9154
|
` + `All features work like magic\u2014parallel agents, background tasks,
|
|
9248
9155
|
` + `deep exploration, and relentless execution until completion.`, "The Magic Word");
|
|
9249
9156
|
console.log(`${SYMBOLS.star} ${import_picocolors2.default.yellow("If you found this helpful, consider starring the repo!")}`);
|
|
9250
|
-
console.log(` ${import_picocolors2.default.dim("gh api --silent --method PUT /user/starred/code-yeongyu/oh-my-
|
|
9157
|
+
console.log(` ${import_picocolors2.default.dim("gh api --silent --method PUT /user/starred/code-yeongyu/oh-my-openagent >/dev/null 2>&1 || true")}`);
|
|
9251
9158
|
console.log();
|
|
9252
9159
|
console.log(import_picocolors2.default.dim("oMoMoMoMo... Enjoy!"));
|
|
9253
9160
|
console.log();
|
|
@@ -9932,6 +9839,16 @@ async function promptInstallConfig(detected) {
|
|
|
9932
9839
|
});
|
|
9933
9840
|
if (!kimiForCoding)
|
|
9934
9841
|
return null;
|
|
9842
|
+
const opencodeGo = await selectOrCancel({
|
|
9843
|
+
message: "Do you have an OpenCode Go subscription?",
|
|
9844
|
+
options: [
|
|
9845
|
+
{ value: "no", label: "No", hint: "Will use other configured providers" },
|
|
9846
|
+
{ value: "yes", label: "Yes", hint: "OpenCode Go for quick tasks" }
|
|
9847
|
+
],
|
|
9848
|
+
initialValue: initial.opencodeGo
|
|
9849
|
+
});
|
|
9850
|
+
if (!opencodeGo)
|
|
9851
|
+
return null;
|
|
9935
9852
|
return {
|
|
9936
9853
|
hasClaude: claude !== "no",
|
|
9937
9854
|
isMax20: claude === "max20",
|
|
@@ -9940,7 +9857,8 @@ async function promptInstallConfig(detected) {
|
|
|
9940
9857
|
hasCopilot: copilot === "yes",
|
|
9941
9858
|
hasOpencodeZen: opencodeZen === "yes",
|
|
9942
9859
|
hasZaiCodingPlan: zaiCodingPlan === "yes",
|
|
9943
|
-
hasKimiForCoding: kimiForCoding === "yes"
|
|
9860
|
+
hasKimiForCoding: kimiForCoding === "yes",
|
|
9861
|
+
hasOpencodeGo: opencodeGo === "yes"
|
|
9944
9862
|
};
|
|
9945
9863
|
}
|
|
9946
9864
|
|
|
@@ -10010,7 +9928,7 @@ async function runTuiInstaller(args, version) {
|
|
|
10010
9928
|
` + `All features work like magic\u2014parallel agents, background tasks,
|
|
10011
9929
|
` + `deep exploration, and relentless execution until completion.`, "The Magic Word");
|
|
10012
9930
|
M2.message(`${import_picocolors4.default.yellow("\u2605")} If you found this helpful, consider starring the repo!`);
|
|
10013
|
-
M2.message(` ${import_picocolors4.default.dim("gh api --silent --method PUT /user/starred/code-yeongyu/oh-my-
|
|
9931
|
+
M2.message(` ${import_picocolors4.default.dim("gh api --silent --method PUT /user/starred/code-yeongyu/oh-my-openagent >/dev/null 2>&1 || true")}`);
|
|
10014
9932
|
Se(import_picocolors4.default.green("oMoMoMoMo... Enjoy!"));
|
|
10015
9933
|
if ((config.hasClaude || config.hasGemini || config.hasCopilot) && !args.skipAuth) {
|
|
10016
9934
|
const providers = [];
|
|
@@ -10039,7 +9957,7 @@ async function install(args) {
|
|
|
10039
9957
|
}
|
|
10040
9958
|
|
|
10041
9959
|
// src/cli/run/runner.ts
|
|
10042
|
-
var
|
|
9960
|
+
var import_picocolors14 = __toESM(require_picocolors(), 1);
|
|
10043
9961
|
|
|
10044
9962
|
// src/cli/run/event-state.ts
|
|
10045
9963
|
function createEventState() {
|
|
@@ -24281,7 +24199,8 @@ var BuiltinAgentNameSchema = exports_external.enum([
|
|
|
24281
24199
|
"multimodal-looker",
|
|
24282
24200
|
"metis",
|
|
24283
24201
|
"momus",
|
|
24284
|
-
"atlas"
|
|
24202
|
+
"atlas",
|
|
24203
|
+
"sisyphus-junior"
|
|
24285
24204
|
]);
|
|
24286
24205
|
var BuiltinSkillNameSchema = exports_external.enum([
|
|
24287
24206
|
"playwright",
|
|
@@ -24381,13 +24300,22 @@ var BabysittingConfigSchema = exports_external.object({
|
|
|
24381
24300
|
timeout_ms: exports_external.number().default(120000)
|
|
24382
24301
|
});
|
|
24383
24302
|
// src/config/schema/background-task.ts
|
|
24303
|
+
var CircuitBreakerConfigSchema = exports_external.object({
|
|
24304
|
+
maxToolCalls: exports_external.number().int().min(10).optional(),
|
|
24305
|
+
windowSize: exports_external.number().int().min(5).optional(),
|
|
24306
|
+
repetitionThresholdPercent: exports_external.number().gt(0).max(100).optional()
|
|
24307
|
+
});
|
|
24384
24308
|
var BackgroundTaskConfigSchema = exports_external.object({
|
|
24385
24309
|
defaultConcurrency: exports_external.number().min(1).optional(),
|
|
24386
24310
|
providerConcurrency: exports_external.record(exports_external.string(), exports_external.number().min(0)).optional(),
|
|
24387
24311
|
modelConcurrency: exports_external.record(exports_external.string(), exports_external.number().min(0)).optional(),
|
|
24312
|
+
maxDepth: exports_external.number().int().min(1).optional(),
|
|
24313
|
+
maxDescendants: exports_external.number().int().min(1).optional(),
|
|
24388
24314
|
staleTimeoutMs: exports_external.number().min(60000).optional(),
|
|
24389
24315
|
messageStalenessTimeoutMs: exports_external.number().min(60000).optional(),
|
|
24390
|
-
syncPollTimeoutMs: exports_external.number().min(60000).optional()
|
|
24316
|
+
syncPollTimeoutMs: exports_external.number().min(60000).optional(),
|
|
24317
|
+
maxToolCalls: exports_external.number().int().min(10).optional(),
|
|
24318
|
+
circuitBreaker: CircuitBreakerConfigSchema.optional()
|
|
24391
24319
|
});
|
|
24392
24320
|
// src/config/schema/browser-automation.ts
|
|
24393
24321
|
var BrowserAutomationProviderSchema = exports_external.enum([
|
|
@@ -24500,13 +24428,25 @@ var ExperimentalConfigSchema = exports_external.object({
|
|
|
24500
24428
|
hashline_edit: exports_external.boolean().optional(),
|
|
24501
24429
|
model_fallback_title: exports_external.boolean().optional()
|
|
24502
24430
|
});
|
|
24431
|
+
// src/config/schema/git-env-prefix.ts
|
|
24432
|
+
var GIT_ENV_ASSIGNMENT_PATTERN = /^(?:[A-Za-z_][A-Za-z0-9_]*=[A-Za-z0-9_-]*)(?: [A-Za-z_][A-Za-z0-9_]*=[A-Za-z0-9_-]*)*$/;
|
|
24433
|
+
var GIT_ENV_PREFIX_VALIDATION_MESSAGE = 'git_env_prefix must be empty or use shell-safe env assignments like "GIT_MASTER=1"';
|
|
24434
|
+
function isValidGitEnvPrefix(value) {
|
|
24435
|
+
if (value === "") {
|
|
24436
|
+
return true;
|
|
24437
|
+
}
|
|
24438
|
+
return GIT_ENV_ASSIGNMENT_PATTERN.test(value);
|
|
24439
|
+
}
|
|
24440
|
+
var GitEnvPrefixSchema = exports_external.string().refine(isValidGitEnvPrefix, { message: GIT_ENV_PREFIX_VALIDATION_MESSAGE }).default("GIT_MASTER=1");
|
|
24503
24441
|
// src/config/schema/git-master.ts
|
|
24504
24442
|
var GitMasterConfigSchema = exports_external.object({
|
|
24505
24443
|
commit_footer: exports_external.union([exports_external.boolean(), exports_external.string()]).default(true),
|
|
24506
|
-
include_co_authored_by: exports_external.boolean().default(true)
|
|
24444
|
+
include_co_authored_by: exports_external.boolean().default(true),
|
|
24445
|
+
git_env_prefix: GitEnvPrefixSchema
|
|
24507
24446
|
});
|
|
24508
24447
|
// src/config/schema/hooks.ts
|
|
24509
24448
|
var HookNameSchema = exports_external.enum([
|
|
24449
|
+
"gpt-permission-continuation",
|
|
24510
24450
|
"todo-continuation-enforcer",
|
|
24511
24451
|
"context-window-monitor",
|
|
24512
24452
|
"session-recovery",
|
|
@@ -24695,6 +24635,14 @@ var OhMyOpenCodeConfigSchema = exports_external.object({
|
|
|
24695
24635
|
});
|
|
24696
24636
|
// src/plugin-config.ts
|
|
24697
24637
|
init_shared();
|
|
24638
|
+
var PARTIAL_STRING_ARRAY_KEYS = new Set([
|
|
24639
|
+
"disabled_mcps",
|
|
24640
|
+
"disabled_agents",
|
|
24641
|
+
"disabled_skills",
|
|
24642
|
+
"disabled_hooks",
|
|
24643
|
+
"disabled_commands",
|
|
24644
|
+
"disabled_tools"
|
|
24645
|
+
]);
|
|
24698
24646
|
function parseConfigPartially(rawConfig) {
|
|
24699
24647
|
const fullResult = OhMyOpenCodeConfigSchema.safeParse(rawConfig);
|
|
24700
24648
|
if (fullResult.success) {
|
|
@@ -24703,6 +24651,13 @@ function parseConfigPartially(rawConfig) {
|
|
|
24703
24651
|
const partialConfig = {};
|
|
24704
24652
|
const invalidSections = [];
|
|
24705
24653
|
for (const key of Object.keys(rawConfig)) {
|
|
24654
|
+
if (PARTIAL_STRING_ARRAY_KEYS.has(key)) {
|
|
24655
|
+
const sectionValue = rawConfig[key];
|
|
24656
|
+
if (Array.isArray(sectionValue) && sectionValue.every((value) => typeof value === "string")) {
|
|
24657
|
+
partialConfig[key] = sectionValue;
|
|
24658
|
+
}
|
|
24659
|
+
continue;
|
|
24660
|
+
}
|
|
24706
24661
|
const sectionResult = OhMyOpenCodeConfigSchema.safeParse({ [key]: rawConfig[key] });
|
|
24707
24662
|
if (sectionResult.success) {
|
|
24708
24663
|
const parsed = sectionResult.data;
|
|
@@ -24788,6 +24743,12 @@ function mergeConfigs(base, override) {
|
|
|
24788
24743
|
...override.disabled_skills ?? []
|
|
24789
24744
|
])
|
|
24790
24745
|
],
|
|
24746
|
+
disabled_tools: [
|
|
24747
|
+
...new Set([
|
|
24748
|
+
...base.disabled_tools ?? [],
|
|
24749
|
+
...override.disabled_tools ?? []
|
|
24750
|
+
])
|
|
24751
|
+
],
|
|
24791
24752
|
claude_code: deepMerge(base.claude_code, override.claude_code)
|
|
24792
24753
|
};
|
|
24793
24754
|
}
|
|
@@ -26501,14 +26462,28 @@ function createJsonOutputManager(options = {}) {
|
|
|
26501
26462
|
|
|
26502
26463
|
// src/cli/run/on-complete-hook.ts
|
|
26503
26464
|
init_spawn_with_windows_hide();
|
|
26504
|
-
|
|
26465
|
+
init_shared();
|
|
26466
|
+
async function readOutput(stream, streamName) {
|
|
26467
|
+
if (!stream) {
|
|
26468
|
+
return "";
|
|
26469
|
+
}
|
|
26470
|
+
try {
|
|
26471
|
+
return await new Response(stream).text();
|
|
26472
|
+
} catch (error48) {
|
|
26473
|
+
log("Failed to read on-complete hook output", {
|
|
26474
|
+
stream: streamName,
|
|
26475
|
+
error: error48 instanceof Error ? error48.message : String(error48)
|
|
26476
|
+
});
|
|
26477
|
+
return "";
|
|
26478
|
+
}
|
|
26479
|
+
}
|
|
26505
26480
|
async function executeOnCompleteHook(options) {
|
|
26506
26481
|
const { command, sessionId, exitCode, durationMs, messageCount } = options;
|
|
26507
26482
|
const trimmedCommand = command.trim();
|
|
26508
26483
|
if (!trimmedCommand) {
|
|
26509
26484
|
return;
|
|
26510
26485
|
}
|
|
26511
|
-
|
|
26486
|
+
log("Running on-complete hook", { command: trimmedCommand });
|
|
26512
26487
|
try {
|
|
26513
26488
|
const proc = spawnWithWindowsHide(["sh", "-c", trimmedCommand], {
|
|
26514
26489
|
env: {
|
|
@@ -26518,21 +26493,37 @@ async function executeOnCompleteHook(options) {
|
|
|
26518
26493
|
DURATION_MS: String(durationMs),
|
|
26519
26494
|
MESSAGE_COUNT: String(messageCount)
|
|
26520
26495
|
},
|
|
26521
|
-
stdout: "
|
|
26522
|
-
stderr: "
|
|
26496
|
+
stdout: "pipe",
|
|
26497
|
+
stderr: "pipe"
|
|
26523
26498
|
});
|
|
26524
|
-
const hookExitCode = await
|
|
26499
|
+
const [hookExitCode, stdout, stderr] = await Promise.all([
|
|
26500
|
+
proc.exited,
|
|
26501
|
+
readOutput(proc.stdout, "stdout"),
|
|
26502
|
+
readOutput(proc.stderr, "stderr")
|
|
26503
|
+
]);
|
|
26504
|
+
if (stdout.trim()) {
|
|
26505
|
+
log("On-complete hook stdout", { command: trimmedCommand, stdout: stdout.trim() });
|
|
26506
|
+
}
|
|
26507
|
+
if (stderr.trim()) {
|
|
26508
|
+
log("On-complete hook stderr", { command: trimmedCommand, stderr: stderr.trim() });
|
|
26509
|
+
}
|
|
26525
26510
|
if (hookExitCode !== 0) {
|
|
26526
|
-
|
|
26511
|
+
log("On-complete hook exited with non-zero code", {
|
|
26512
|
+
command: trimmedCommand,
|
|
26513
|
+
exitCode: hookExitCode
|
|
26514
|
+
});
|
|
26527
26515
|
}
|
|
26528
26516
|
} catch (error48) {
|
|
26529
|
-
|
|
26517
|
+
log("Failed to execute on-complete hook", {
|
|
26518
|
+
command: trimmedCommand,
|
|
26519
|
+
error: error48 instanceof Error ? error48.message : String(error48)
|
|
26520
|
+
});
|
|
26530
26521
|
}
|
|
26531
26522
|
}
|
|
26532
26523
|
|
|
26533
26524
|
// src/cli/run/agent-resolver.ts
|
|
26534
26525
|
init_agent_display_names();
|
|
26535
|
-
var
|
|
26526
|
+
var import_picocolors11 = __toESM(require_picocolors(), 1);
|
|
26536
26527
|
var CORE_AGENT_ORDER = ["sisyphus", "hephaestus", "prometheus", "atlas"];
|
|
26537
26528
|
var DEFAULT_AGENT = "sisyphus";
|
|
26538
26529
|
var normalizeAgentName = (agent) => {
|
|
@@ -26577,21 +26568,45 @@ var resolveRunAgent = (options, pluginConfig, env = process.env) => {
|
|
|
26577
26568
|
const fallbackName = getAgentDisplayName(fallback);
|
|
26578
26569
|
const fallbackDisabled = isAgentDisabled(fallback, pluginConfig);
|
|
26579
26570
|
if (fallbackDisabled) {
|
|
26580
|
-
console.log(
|
|
26571
|
+
console.log(import_picocolors11.default.yellow(`Requested agent "${resolved.resolvedName}" is disabled and no enabled core agent was found. Proceeding with "${fallbackName}".`));
|
|
26581
26572
|
return fallbackName;
|
|
26582
26573
|
}
|
|
26583
|
-
console.log(
|
|
26574
|
+
console.log(import_picocolors11.default.yellow(`Requested agent "${resolved.resolvedName}" is disabled. Falling back to "${fallbackName}".`));
|
|
26584
26575
|
return fallbackName;
|
|
26585
26576
|
}
|
|
26586
26577
|
return resolved.resolvedName;
|
|
26587
26578
|
};
|
|
26588
26579
|
|
|
26580
|
+
// src/cli/run/model-resolver.ts
|
|
26581
|
+
function resolveRunModel(modelString) {
|
|
26582
|
+
if (modelString === undefined) {
|
|
26583
|
+
return;
|
|
26584
|
+
}
|
|
26585
|
+
const trimmed = modelString.trim();
|
|
26586
|
+
if (trimmed.length === 0) {
|
|
26587
|
+
throw new Error("Model string cannot be empty");
|
|
26588
|
+
}
|
|
26589
|
+
const parts = trimmed.split("/");
|
|
26590
|
+
if (parts.length < 2) {
|
|
26591
|
+
throw new Error("Model string must be in 'provider/model' format");
|
|
26592
|
+
}
|
|
26593
|
+
const providerID = parts[0];
|
|
26594
|
+
if (providerID.length === 0) {
|
|
26595
|
+
throw new Error("Provider cannot be empty");
|
|
26596
|
+
}
|
|
26597
|
+
const modelID = parts.slice(1).join("/");
|
|
26598
|
+
if (modelID.length === 0) {
|
|
26599
|
+
throw new Error("Model ID cannot be empty");
|
|
26600
|
+
}
|
|
26601
|
+
return { providerID, modelID };
|
|
26602
|
+
}
|
|
26603
|
+
|
|
26589
26604
|
// src/cli/run/poll-for-completion.ts
|
|
26590
|
-
var
|
|
26605
|
+
var import_picocolors13 = __toESM(require_picocolors(), 1);
|
|
26591
26606
|
|
|
26592
26607
|
// src/cli/run/completion.ts
|
|
26593
26608
|
init_shared();
|
|
26594
|
-
var
|
|
26609
|
+
var import_picocolors12 = __toESM(require_picocolors(), 1);
|
|
26595
26610
|
// src/features/boulder-state/constants.ts
|
|
26596
26611
|
var BOULDER_DIR = ".sisyphus";
|
|
26597
26612
|
var BOULDER_FILE = "boulder.json";
|
|
@@ -26599,14 +26614,14 @@ var BOULDER_STATE_PATH = `${BOULDER_DIR}/${BOULDER_FILE}`;
|
|
|
26599
26614
|
var NOTEPAD_DIR = "notepads";
|
|
26600
26615
|
var NOTEPAD_BASE_PATH = `${BOULDER_DIR}/${NOTEPAD_DIR}`;
|
|
26601
26616
|
// src/features/boulder-state/storage.ts
|
|
26602
|
-
import { existsSync as
|
|
26617
|
+
import { existsSync as existsSync11, readFileSync as readFileSync9, writeFileSync as writeFileSync5, mkdirSync as mkdirSync3, readdirSync } from "fs";
|
|
26603
26618
|
import { dirname as dirname2, join as join9, basename } from "path";
|
|
26604
26619
|
function getBoulderFilePath(directory) {
|
|
26605
26620
|
return join9(directory, BOULDER_DIR, BOULDER_FILE);
|
|
26606
26621
|
}
|
|
26607
26622
|
function readBoulderState(directory) {
|
|
26608
26623
|
const filePath = getBoulderFilePath(directory);
|
|
26609
|
-
if (!
|
|
26624
|
+
if (!existsSync11(filePath)) {
|
|
26610
26625
|
return null;
|
|
26611
26626
|
}
|
|
26612
26627
|
try {
|
|
@@ -26624,7 +26639,7 @@ function readBoulderState(directory) {
|
|
|
26624
26639
|
}
|
|
26625
26640
|
}
|
|
26626
26641
|
function getPlanProgress(planPath) {
|
|
26627
|
-
if (!
|
|
26642
|
+
if (!existsSync11(planPath)) {
|
|
26628
26643
|
return { total: 0, completed: 0, isComplete: true };
|
|
26629
26644
|
}
|
|
26630
26645
|
try {
|
|
@@ -26645,14 +26660,14 @@ function getPlanProgress(planPath) {
|
|
|
26645
26660
|
// src/features/run-continuation-state/constants.ts
|
|
26646
26661
|
var CONTINUATION_MARKER_DIR = ".sisyphus/run-continuation";
|
|
26647
26662
|
// src/features/run-continuation-state/storage.ts
|
|
26648
|
-
import { existsSync as
|
|
26663
|
+
import { existsSync as existsSync12, mkdirSync as mkdirSync4, readFileSync as readFileSync10, rmSync, writeFileSync as writeFileSync6 } from "fs";
|
|
26649
26664
|
import { join as join10 } from "path";
|
|
26650
26665
|
function getMarkerPath(directory, sessionID) {
|
|
26651
26666
|
return join10(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
|
|
26652
26667
|
}
|
|
26653
26668
|
function readContinuationMarker(directory, sessionID) {
|
|
26654
26669
|
const markerPath = getMarkerPath(directory, sessionID);
|
|
26655
|
-
if (!
|
|
26670
|
+
if (!existsSync12(markerPath))
|
|
26656
26671
|
return null;
|
|
26657
26672
|
try {
|
|
26658
26673
|
const raw = readFileSync10(markerPath, "utf-8");
|
|
@@ -26680,7 +26695,7 @@ function getActiveContinuationMarkerReason(marker) {
|
|
|
26680
26695
|
}
|
|
26681
26696
|
// src/hooks/ralph-loop/storage.ts
|
|
26682
26697
|
init_frontmatter();
|
|
26683
|
-
import { existsSync as
|
|
26698
|
+
import { existsSync as existsSync13, readFileSync as readFileSync11, writeFileSync as writeFileSync7, unlinkSync, mkdirSync as mkdirSync5 } from "fs";
|
|
26684
26699
|
import { dirname as dirname3, join as join11 } from "path";
|
|
26685
26700
|
|
|
26686
26701
|
// src/hooks/ralph-loop/constants.ts
|
|
@@ -26694,7 +26709,7 @@ function getStateFilePath(directory, customPath) {
|
|
|
26694
26709
|
}
|
|
26695
26710
|
function readState(directory, customPath) {
|
|
26696
26711
|
const filePath = getStateFilePath(directory, customPath);
|
|
26697
|
-
if (!
|
|
26712
|
+
if (!existsSync13(filePath)) {
|
|
26698
26713
|
return null;
|
|
26699
26714
|
}
|
|
26700
26715
|
try {
|
|
@@ -26788,7 +26803,7 @@ async function checkCompletionConditions(ctx) {
|
|
|
26788
26803
|
}
|
|
26789
26804
|
return true;
|
|
26790
26805
|
} catch (err) {
|
|
26791
|
-
console.error(
|
|
26806
|
+
console.error(import_picocolors12.default.red(`[completion] API error: ${err}`));
|
|
26792
26807
|
return false;
|
|
26793
26808
|
}
|
|
26794
26809
|
}
|
|
@@ -26849,7 +26864,7 @@ function logWaiting(ctx, message) {
|
|
|
26849
26864
|
if (!ctx.verbose) {
|
|
26850
26865
|
return;
|
|
26851
26866
|
}
|
|
26852
|
-
console.log(
|
|
26867
|
+
console.log(import_picocolors12.default.dim(` Waiting: ${message}`));
|
|
26853
26868
|
}
|
|
26854
26869
|
|
|
26855
26870
|
// src/cli/run/poll-for-completion.ts
|
|
@@ -26880,10 +26895,10 @@ async function pollForCompletion(ctx, eventState, abortController, options = {})
|
|
|
26880
26895
|
if (eventState.mainSessionError) {
|
|
26881
26896
|
errorCycleCount++;
|
|
26882
26897
|
if (errorCycleCount >= ERROR_GRACE_CYCLES) {
|
|
26883
|
-
console.error(
|
|
26898
|
+
console.error(import_picocolors13.default.red(`
|
|
26884
26899
|
|
|
26885
26900
|
Session ended with error: ${eventState.lastError}`));
|
|
26886
|
-
console.error(
|
|
26901
|
+
console.error(import_picocolors13.default.yellow("Check if todos were completed before the error."));
|
|
26887
26902
|
return 1;
|
|
26888
26903
|
}
|
|
26889
26904
|
continue;
|
|
@@ -26894,7 +26909,7 @@ Session ended with error: ${eventState.lastError}`));
|
|
|
26894
26909
|
if (eventState.lastEventTimestamp !== null) {
|
|
26895
26910
|
const timeSinceLastEvent = Date.now() - eventState.lastEventTimestamp;
|
|
26896
26911
|
if (timeSinceLastEvent > eventWatchdogMs) {
|
|
26897
|
-
console.log(
|
|
26912
|
+
console.log(import_picocolors13.default.yellow(`
|
|
26898
26913
|
No events for ${Math.round(timeSinceLastEvent / 1000)}s, verifying session status...`));
|
|
26899
26914
|
mainSessionStatus = await getMainSessionStatus(ctx);
|
|
26900
26915
|
if (mainSessionStatus === "idle") {
|
|
@@ -26943,7 +26958,7 @@ Session ended with error: ${eventState.lastError}`));
|
|
|
26943
26958
|
const hasActiveWork = hasActiveChildren || hasActiveTodos;
|
|
26944
26959
|
if (hasActiveWork) {
|
|
26945
26960
|
eventState.hasReceivedMeaningfulWork = true;
|
|
26946
|
-
console.log(
|
|
26961
|
+
console.log(import_picocolors13.default.yellow(`
|
|
26947
26962
|
No meaningful work events for ${Math.round(secondaryMeaningfulWorkTimeoutMs / 1000)}s but session has active work - assuming in progress`));
|
|
26948
26963
|
}
|
|
26949
26964
|
}
|
|
@@ -26963,7 +26978,7 @@ Session ended with error: ${eventState.lastError}`));
|
|
|
26963
26978
|
}
|
|
26964
26979
|
consecutiveCompleteChecks++;
|
|
26965
26980
|
if (consecutiveCompleteChecks >= requiredConsecutive) {
|
|
26966
|
-
console.log(
|
|
26981
|
+
console.log(import_picocolors13.default.green(`
|
|
26967
26982
|
|
|
26968
26983
|
All tasks completed.`));
|
|
26969
26984
|
return 0;
|
|
@@ -27120,6 +27135,7 @@ async function run(options) {
|
|
|
27120
27135
|
const resolvedAgent = resolveRunAgent(options, pluginConfig);
|
|
27121
27136
|
const abortController = new AbortController;
|
|
27122
27137
|
try {
|
|
27138
|
+
const resolvedModel = resolveRunModel(options.model);
|
|
27123
27139
|
const { client: client3, cleanup: serverCleanup } = await createServerConnection({
|
|
27124
27140
|
port: options.port,
|
|
27125
27141
|
attach: options.attach,
|
|
@@ -27130,7 +27146,7 @@ async function run(options) {
|
|
|
27130
27146
|
};
|
|
27131
27147
|
const restoreInput = suppressRunInput();
|
|
27132
27148
|
const handleSigint = () => {
|
|
27133
|
-
console.log(
|
|
27149
|
+
console.log(import_picocolors14.default.yellow(`
|
|
27134
27150
|
Interrupted. Shutting down...`));
|
|
27135
27151
|
restoreInput();
|
|
27136
27152
|
cleanup();
|
|
@@ -27143,7 +27159,10 @@ Interrupted. Shutting down...`));
|
|
|
27143
27159
|
sessionId: options.sessionId,
|
|
27144
27160
|
directory
|
|
27145
27161
|
});
|
|
27146
|
-
console.log(
|
|
27162
|
+
console.log(import_picocolors14.default.dim(`Session: ${sessionID}`));
|
|
27163
|
+
if (resolvedModel) {
|
|
27164
|
+
console.log(import_picocolors14.default.dim(`Model: ${resolvedModel.providerID}/${resolvedModel.modelID}`));
|
|
27165
|
+
}
|
|
27147
27166
|
const ctx = {
|
|
27148
27167
|
client: client3,
|
|
27149
27168
|
sessionID,
|
|
@@ -27159,6 +27178,7 @@ Interrupted. Shutting down...`));
|
|
|
27159
27178
|
path: { id: sessionID },
|
|
27160
27179
|
body: {
|
|
27161
27180
|
agent: resolvedAgent,
|
|
27181
|
+
...resolvedModel ? { model: resolvedModel } : {},
|
|
27162
27182
|
tools: {
|
|
27163
27183
|
question: false
|
|
27164
27184
|
},
|
|
@@ -27204,7 +27224,7 @@ Interrupted. Shutting down...`));
|
|
|
27204
27224
|
if (err instanceof Error && err.name === "AbortError") {
|
|
27205
27225
|
return 130;
|
|
27206
27226
|
}
|
|
27207
|
-
console.error(
|
|
27227
|
+
console.error(import_picocolors14.default.red(`Error: ${serializeError(err)}`));
|
|
27208
27228
|
return 1;
|
|
27209
27229
|
} finally {
|
|
27210
27230
|
timestampOutput?.restore();
|
|
@@ -27214,53 +27234,53 @@ Interrupted. Shutting down...`));
|
|
|
27214
27234
|
init_checker();
|
|
27215
27235
|
|
|
27216
27236
|
// src/cli/get-local-version/formatter.ts
|
|
27217
|
-
var
|
|
27237
|
+
var import_picocolors15 = __toESM(require_picocolors(), 1);
|
|
27218
27238
|
var SYMBOLS2 = {
|
|
27219
|
-
check:
|
|
27220
|
-
cross:
|
|
27221
|
-
arrow:
|
|
27222
|
-
info:
|
|
27223
|
-
warn:
|
|
27224
|
-
pin:
|
|
27225
|
-
dev:
|
|
27239
|
+
check: import_picocolors15.default.green("[OK]"),
|
|
27240
|
+
cross: import_picocolors15.default.red("[X]"),
|
|
27241
|
+
arrow: import_picocolors15.default.cyan("->"),
|
|
27242
|
+
info: import_picocolors15.default.blue("[i]"),
|
|
27243
|
+
warn: import_picocolors15.default.yellow("[!]"),
|
|
27244
|
+
pin: import_picocolors15.default.magenta("[PINNED]"),
|
|
27245
|
+
dev: import_picocolors15.default.cyan("[DEV]")
|
|
27226
27246
|
};
|
|
27227
27247
|
function formatVersionOutput(info) {
|
|
27228
27248
|
const lines = [];
|
|
27229
27249
|
lines.push("");
|
|
27230
|
-
lines.push(
|
|
27231
|
-
lines.push(
|
|
27250
|
+
lines.push(import_picocolors15.default.bold(import_picocolors15.default.white("oh-my-opencode Version Information")));
|
|
27251
|
+
lines.push(import_picocolors15.default.dim("\u2500".repeat(50)));
|
|
27232
27252
|
lines.push("");
|
|
27233
27253
|
if (info.currentVersion) {
|
|
27234
|
-
lines.push(` Current Version: ${
|
|
27254
|
+
lines.push(` Current Version: ${import_picocolors15.default.cyan(info.currentVersion)}`);
|
|
27235
27255
|
} else {
|
|
27236
|
-
lines.push(` Current Version: ${
|
|
27256
|
+
lines.push(` Current Version: ${import_picocolors15.default.dim("unknown")}`);
|
|
27237
27257
|
}
|
|
27238
27258
|
if (!info.isLocalDev && info.latestVersion) {
|
|
27239
|
-
lines.push(` Latest Version: ${
|
|
27259
|
+
lines.push(` Latest Version: ${import_picocolors15.default.cyan(info.latestVersion)}`);
|
|
27240
27260
|
}
|
|
27241
27261
|
lines.push("");
|
|
27242
27262
|
switch (info.status) {
|
|
27243
27263
|
case "up-to-date":
|
|
27244
|
-
lines.push(` ${SYMBOLS2.check} ${
|
|
27264
|
+
lines.push(` ${SYMBOLS2.check} ${import_picocolors15.default.green("You're up to date!")}`);
|
|
27245
27265
|
break;
|
|
27246
27266
|
case "outdated":
|
|
27247
|
-
lines.push(` ${SYMBOLS2.warn} ${
|
|
27248
|
-
lines.push(` ${
|
|
27267
|
+
lines.push(` ${SYMBOLS2.warn} ${import_picocolors15.default.yellow("Update available")}`);
|
|
27268
|
+
lines.push(` ${import_picocolors15.default.dim("Run:")} ${import_picocolors15.default.cyan("cd ~/.config/opencode && bun update oh-my-opencode")}`);
|
|
27249
27269
|
break;
|
|
27250
27270
|
case "local-dev":
|
|
27251
|
-
lines.push(` ${SYMBOLS2.dev} ${
|
|
27252
|
-
lines.push(` ${
|
|
27271
|
+
lines.push(` ${SYMBOLS2.dev} ${import_picocolors15.default.cyan("Running in local development mode")}`);
|
|
27272
|
+
lines.push(` ${import_picocolors15.default.dim("Using file:// protocol from config")}`);
|
|
27253
27273
|
break;
|
|
27254
27274
|
case "pinned":
|
|
27255
|
-
lines.push(` ${SYMBOLS2.pin} ${
|
|
27256
|
-
lines.push(` ${
|
|
27275
|
+
lines.push(` ${SYMBOLS2.pin} ${import_picocolors15.default.magenta(`Version pinned to ${info.pinnedVersion}`)}`);
|
|
27276
|
+
lines.push(` ${import_picocolors15.default.dim("Update check skipped for pinned versions")}`);
|
|
27257
27277
|
break;
|
|
27258
27278
|
case "error":
|
|
27259
|
-
lines.push(` ${SYMBOLS2.cross} ${
|
|
27260
|
-
lines.push(` ${
|
|
27279
|
+
lines.push(` ${SYMBOLS2.cross} ${import_picocolors15.default.red("Unable to check for updates")}`);
|
|
27280
|
+
lines.push(` ${import_picocolors15.default.dim("Network error or npm registry unavailable")}`);
|
|
27261
27281
|
break;
|
|
27262
27282
|
case "unknown":
|
|
27263
|
-
lines.push(` ${SYMBOLS2.info} ${
|
|
27283
|
+
lines.push(` ${SYMBOLS2.info} ${import_picocolors15.default.yellow("Version information unavailable")}`);
|
|
27264
27284
|
break;
|
|
27265
27285
|
}
|
|
27266
27286
|
lines.push("");
|
|
@@ -27360,21 +27380,21 @@ async function getLocalVersion(options = {}) {
|
|
|
27360
27380
|
}
|
|
27361
27381
|
}
|
|
27362
27382
|
// src/cli/doctor/constants.ts
|
|
27363
|
-
var
|
|
27383
|
+
var import_picocolors16 = __toESM(require_picocolors(), 1);
|
|
27364
27384
|
var SYMBOLS3 = {
|
|
27365
|
-
check:
|
|
27366
|
-
cross:
|
|
27367
|
-
warn:
|
|
27368
|
-
info:
|
|
27369
|
-
arrow:
|
|
27370
|
-
bullet:
|
|
27371
|
-
skip:
|
|
27385
|
+
check: import_picocolors16.default.green("\u2713"),
|
|
27386
|
+
cross: import_picocolors16.default.red("\u2717"),
|
|
27387
|
+
warn: import_picocolors16.default.yellow("\u26A0"),
|
|
27388
|
+
info: import_picocolors16.default.blue("\u2139"),
|
|
27389
|
+
arrow: import_picocolors16.default.cyan("\u2192"),
|
|
27390
|
+
bullet: import_picocolors16.default.dim("\u2022"),
|
|
27391
|
+
skip: import_picocolors16.default.dim("\u25CB")
|
|
27372
27392
|
};
|
|
27373
27393
|
var STATUS_COLORS = {
|
|
27374
|
-
pass:
|
|
27375
|
-
fail:
|
|
27376
|
-
warn:
|
|
27377
|
-
skip:
|
|
27394
|
+
pass: import_picocolors16.default.green,
|
|
27395
|
+
fail: import_picocolors16.default.red,
|
|
27396
|
+
warn: import_picocolors16.default.yellow,
|
|
27397
|
+
skip: import_picocolors16.default.dim
|
|
27378
27398
|
};
|
|
27379
27399
|
var CHECK_IDS = {
|
|
27380
27400
|
SYSTEM: "system",
|
|
@@ -27393,34 +27413,34 @@ var EXIT_CODES = {
|
|
|
27393
27413
|
FAILURE: 1
|
|
27394
27414
|
};
|
|
27395
27415
|
var MIN_OPENCODE_VERSION = "1.0.150";
|
|
27396
|
-
var
|
|
27416
|
+
var PACKAGE_NAME2 = "oh-my-opencode";
|
|
27397
27417
|
var OPENCODE_BINARIES2 = ["opencode", "opencode-desktop"];
|
|
27398
27418
|
|
|
27399
27419
|
// src/cli/doctor/checks/system.ts
|
|
27400
|
-
import { existsSync as
|
|
27420
|
+
import { existsSync as existsSync24, readFileSync as readFileSync21 } from "fs";
|
|
27401
27421
|
|
|
27402
27422
|
// src/cli/doctor/checks/system-binary.ts
|
|
27403
27423
|
init_spawn_with_windows_hide();
|
|
27404
|
-
import { existsSync as
|
|
27424
|
+
import { existsSync as existsSync21 } from "fs";
|
|
27405
27425
|
import { homedir as homedir5 } from "os";
|
|
27406
|
-
import { join as
|
|
27426
|
+
import { join as join18 } from "path";
|
|
27407
27427
|
function getDesktopAppPaths(platform) {
|
|
27408
27428
|
const home = homedir5();
|
|
27409
27429
|
switch (platform) {
|
|
27410
27430
|
case "darwin":
|
|
27411
27431
|
return [
|
|
27412
27432
|
"/Applications/OpenCode.app/Contents/MacOS/OpenCode",
|
|
27413
|
-
|
|
27433
|
+
join18(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
|
|
27414
27434
|
];
|
|
27415
27435
|
case "win32": {
|
|
27416
27436
|
const programFiles = process.env.ProgramFiles;
|
|
27417
27437
|
const localAppData = process.env.LOCALAPPDATA;
|
|
27418
27438
|
const paths = [];
|
|
27419
27439
|
if (programFiles) {
|
|
27420
|
-
paths.push(
|
|
27440
|
+
paths.push(join18(programFiles, "OpenCode", "OpenCode.exe"));
|
|
27421
27441
|
}
|
|
27422
27442
|
if (localAppData) {
|
|
27423
|
-
paths.push(
|
|
27443
|
+
paths.push(join18(localAppData, "OpenCode", "OpenCode.exe"));
|
|
27424
27444
|
}
|
|
27425
27445
|
return paths;
|
|
27426
27446
|
}
|
|
@@ -27428,8 +27448,8 @@ function getDesktopAppPaths(platform) {
|
|
|
27428
27448
|
return [
|
|
27429
27449
|
"/usr/bin/opencode",
|
|
27430
27450
|
"/usr/lib/opencode/opencode",
|
|
27431
|
-
|
|
27432
|
-
|
|
27451
|
+
join18(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
|
|
27452
|
+
join18(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
|
|
27433
27453
|
];
|
|
27434
27454
|
default:
|
|
27435
27455
|
return [];
|
|
@@ -27441,7 +27461,7 @@ function buildVersionCommand(binaryPath, platform) {
|
|
|
27441
27461
|
}
|
|
27442
27462
|
return [binaryPath, "--version"];
|
|
27443
27463
|
}
|
|
27444
|
-
function findDesktopBinary(platform = process.platform, checkExists =
|
|
27464
|
+
function findDesktopBinary(platform = process.platform, checkExists = existsSync21) {
|
|
27445
27465
|
for (const desktopPath of getDesktopAppPaths(platform)) {
|
|
27446
27466
|
if (checkExists(desktopPath)) {
|
|
27447
27467
|
return { binary: "opencode", path: desktopPath };
|
|
@@ -27451,9 +27471,9 @@ function findDesktopBinary(platform = process.platform, checkExists = existsSync
|
|
|
27451
27471
|
}
|
|
27452
27472
|
async function findOpenCodeBinary() {
|
|
27453
27473
|
for (const binary2 of OPENCODE_BINARIES2) {
|
|
27454
|
-
const
|
|
27455
|
-
if (
|
|
27456
|
-
return { binary: binary2, path:
|
|
27474
|
+
const path10 = Bun.which(binary2);
|
|
27475
|
+
if (path10) {
|
|
27476
|
+
return { binary: binary2, path: path10 };
|
|
27457
27477
|
}
|
|
27458
27478
|
}
|
|
27459
27479
|
return findDesktopBinary();
|
|
@@ -27488,30 +27508,40 @@ function compareVersions(current, minimum) {
|
|
|
27488
27508
|
}
|
|
27489
27509
|
|
|
27490
27510
|
// src/cli/doctor/checks/system-plugin.ts
|
|
27491
|
-
import { existsSync as existsSync19, readFileSync as readFileSync19 } from "fs";
|
|
27492
27511
|
init_shared();
|
|
27512
|
+
import { existsSync as existsSync22, readFileSync as readFileSync19 } from "fs";
|
|
27493
27513
|
function detectConfigPath() {
|
|
27494
27514
|
const paths = getOpenCodeConfigPaths({ binary: "opencode", version: null });
|
|
27495
|
-
if (
|
|
27515
|
+
if (existsSync22(paths.configJsonc))
|
|
27496
27516
|
return paths.configJsonc;
|
|
27497
|
-
if (
|
|
27517
|
+
if (existsSync22(paths.configJson))
|
|
27498
27518
|
return paths.configJson;
|
|
27499
27519
|
return null;
|
|
27500
27520
|
}
|
|
27501
27521
|
function parsePluginVersion(entry) {
|
|
27502
|
-
if (
|
|
27503
|
-
|
|
27504
|
-
|
|
27505
|
-
|
|
27506
|
-
return
|
|
27507
|
-
|
|
27522
|
+
if (entry.startsWith(`${PLUGIN_NAME}@`)) {
|
|
27523
|
+
const value = entry.slice(PLUGIN_NAME.length + 1);
|
|
27524
|
+
if (!value || value === "latest")
|
|
27525
|
+
return null;
|
|
27526
|
+
return value;
|
|
27527
|
+
}
|
|
27528
|
+
if (entry.startsWith(`${LEGACY_PLUGIN_NAME}@`)) {
|
|
27529
|
+
const value = entry.slice(LEGACY_PLUGIN_NAME.length + 1);
|
|
27530
|
+
if (!value || value === "latest")
|
|
27531
|
+
return null;
|
|
27532
|
+
return value;
|
|
27533
|
+
}
|
|
27534
|
+
return null;
|
|
27508
27535
|
}
|
|
27509
27536
|
function findPluginEntry2(entries) {
|
|
27510
27537
|
for (const entry of entries) {
|
|
27511
|
-
if (entry ===
|
|
27538
|
+
if (entry === PLUGIN_NAME || entry.startsWith(`${PLUGIN_NAME}@`)) {
|
|
27539
|
+
return { entry, isLocalDev: false };
|
|
27540
|
+
}
|
|
27541
|
+
if (entry === LEGACY_PLUGIN_NAME || entry.startsWith(`${LEGACY_PLUGIN_NAME}@`)) {
|
|
27512
27542
|
return { entry, isLocalDev: false };
|
|
27513
27543
|
}
|
|
27514
|
-
if (entry.startsWith("file://") && entry.includes(
|
|
27544
|
+
if (entry.startsWith("file://") && (entry.includes(PLUGIN_NAME) || entry.includes(LEGACY_PLUGIN_NAME))) {
|
|
27515
27545
|
return { entry, isLocalDev: true };
|
|
27516
27546
|
}
|
|
27517
27547
|
}
|
|
@@ -27548,7 +27578,7 @@ function getPluginInfo() {
|
|
|
27548
27578
|
registered: true,
|
|
27549
27579
|
configPath,
|
|
27550
27580
|
entry: pluginEntry.entry,
|
|
27551
|
-
isPinned: pinnedVersion !== null && /^\d+\.\d+\.\d+/.test(pinnedVersion),
|
|
27581
|
+
isPinned: pinnedVersion !== null && /^\d+\.\d+\.\d+/.test(pinnedVersion ?? ""),
|
|
27552
27582
|
pinnedVersion,
|
|
27553
27583
|
isLocalDev: pluginEntry.isLocalDev
|
|
27554
27584
|
};
|
|
@@ -27567,29 +27597,29 @@ function getPluginInfo() {
|
|
|
27567
27597
|
// src/cli/doctor/checks/system-loaded-version.ts
|
|
27568
27598
|
init_checker();
|
|
27569
27599
|
init_auto_update_checker();
|
|
27570
|
-
import { existsSync as
|
|
27600
|
+
import { existsSync as existsSync23, readFileSync as readFileSync20 } from "fs";
|
|
27571
27601
|
import { homedir as homedir6 } from "os";
|
|
27572
|
-
import { join as
|
|
27602
|
+
import { join as join19 } from "path";
|
|
27573
27603
|
init_shared();
|
|
27574
27604
|
function getPlatformDefaultCacheDir(platform = process.platform) {
|
|
27575
27605
|
if (platform === "darwin")
|
|
27576
|
-
return
|
|
27606
|
+
return join19(homedir6(), "Library", "Caches");
|
|
27577
27607
|
if (platform === "win32")
|
|
27578
|
-
return process.env.LOCALAPPDATA ??
|
|
27579
|
-
return
|
|
27608
|
+
return process.env.LOCALAPPDATA ?? join19(homedir6(), "AppData", "Local");
|
|
27609
|
+
return join19(homedir6(), ".cache");
|
|
27580
27610
|
}
|
|
27581
27611
|
function resolveOpenCodeCacheDir() {
|
|
27582
27612
|
const xdgCacheHome = process.env.XDG_CACHE_HOME;
|
|
27583
27613
|
if (xdgCacheHome)
|
|
27584
|
-
return
|
|
27614
|
+
return join19(xdgCacheHome, "opencode");
|
|
27585
27615
|
const fromShared = getOpenCodeCacheDir();
|
|
27586
|
-
const platformDefault =
|
|
27587
|
-
if (
|
|
27616
|
+
const platformDefault = join19(getPlatformDefaultCacheDir(), "opencode");
|
|
27617
|
+
if (existsSync23(fromShared) || !existsSync23(platformDefault))
|
|
27588
27618
|
return fromShared;
|
|
27589
27619
|
return platformDefault;
|
|
27590
27620
|
}
|
|
27591
27621
|
function readPackageJson(filePath) {
|
|
27592
|
-
if (!
|
|
27622
|
+
if (!existsSync23(filePath))
|
|
27593
27623
|
return null;
|
|
27594
27624
|
try {
|
|
27595
27625
|
const content = readFileSync20(filePath, "utf-8");
|
|
@@ -27605,15 +27635,28 @@ function normalizeVersion(value) {
|
|
|
27605
27635
|
return match?.[0] ?? null;
|
|
27606
27636
|
}
|
|
27607
27637
|
function getLoadedPluginVersion() {
|
|
27638
|
+
const configPaths = getOpenCodeConfigPaths({ binary: "opencode" });
|
|
27608
27639
|
const cacheDir = resolveOpenCodeCacheDir();
|
|
27609
|
-
const
|
|
27610
|
-
|
|
27640
|
+
const candidates = [
|
|
27641
|
+
{
|
|
27642
|
+
cacheDir: configPaths.configDir,
|
|
27643
|
+
cachePackagePath: configPaths.packageJson,
|
|
27644
|
+
installedPackagePath: join19(configPaths.configDir, "node_modules", PACKAGE_NAME2, "package.json")
|
|
27645
|
+
},
|
|
27646
|
+
{
|
|
27647
|
+
cacheDir,
|
|
27648
|
+
cachePackagePath: join19(cacheDir, "package.json"),
|
|
27649
|
+
installedPackagePath: join19(cacheDir, "node_modules", PACKAGE_NAME2, "package.json")
|
|
27650
|
+
}
|
|
27651
|
+
];
|
|
27652
|
+
const selectedCandidate = candidates.find((candidate) => existsSync23(candidate.installedPackagePath)) ?? candidates[0];
|
|
27653
|
+
const { cacheDir: selectedDir, cachePackagePath, installedPackagePath } = selectedCandidate;
|
|
27611
27654
|
const cachePackage = readPackageJson(cachePackagePath);
|
|
27612
27655
|
const installedPackage = readPackageJson(installedPackagePath);
|
|
27613
|
-
const expectedVersion = normalizeVersion(cachePackage?.dependencies?.[
|
|
27656
|
+
const expectedVersion = normalizeVersion(cachePackage?.dependencies?.[PACKAGE_NAME2]);
|
|
27614
27657
|
const loadedVersion = normalizeVersion(installedPackage?.version);
|
|
27615
27658
|
return {
|
|
27616
|
-
cacheDir,
|
|
27659
|
+
cacheDir: selectedDir,
|
|
27617
27660
|
cachePackagePath,
|
|
27618
27661
|
installedPackagePath,
|
|
27619
27662
|
expectedVersion,
|
|
@@ -27633,7 +27676,7 @@ init_shared();
|
|
|
27633
27676
|
function isConfigValid(configPath) {
|
|
27634
27677
|
if (!configPath)
|
|
27635
27678
|
return true;
|
|
27636
|
-
if (!
|
|
27679
|
+
if (!existsSync24(configPath))
|
|
27637
27680
|
return false;
|
|
27638
27681
|
try {
|
|
27639
27682
|
parseJsonc(readFileSync21(configPath, "utf-8"));
|
|
@@ -27660,7 +27703,7 @@ async function gatherSystemInfo() {
|
|
|
27660
27703
|
const [binaryInfo, pluginInfo] = await Promise.all([findOpenCodeBinary(), Promise.resolve(getPluginInfo())]);
|
|
27661
27704
|
const loadedInfo = getLoadedPluginVersion();
|
|
27662
27705
|
const opencodeVersion = binaryInfo ? await getOpenCodeVersion2(binaryInfo.path) : null;
|
|
27663
|
-
const pluginVersion = pluginInfo.pinnedVersion ?? loadedInfo.expectedVersion;
|
|
27706
|
+
const pluginVersion = pluginInfo.pinnedVersion ?? loadedInfo.expectedVersion ?? loadedInfo.loadedVersion;
|
|
27664
27707
|
return {
|
|
27665
27708
|
opencodeVersion,
|
|
27666
27709
|
opencodePath: binaryInfo?.path ?? null,
|
|
@@ -27740,23 +27783,23 @@ async function checkSystem() {
|
|
|
27740
27783
|
|
|
27741
27784
|
// src/cli/doctor/checks/config.ts
|
|
27742
27785
|
import { readFileSync as readFileSync24 } from "fs";
|
|
27743
|
-
import { join as
|
|
27786
|
+
import { join as join23 } from "path";
|
|
27744
27787
|
init_shared();
|
|
27745
27788
|
|
|
27746
27789
|
// src/cli/doctor/checks/model-resolution-cache.ts
|
|
27747
27790
|
init_shared();
|
|
27748
|
-
import { existsSync as
|
|
27791
|
+
import { existsSync as existsSync25, readFileSync as readFileSync22 } from "fs";
|
|
27749
27792
|
import { homedir as homedir7 } from "os";
|
|
27750
|
-
import { join as
|
|
27793
|
+
import { join as join20 } from "path";
|
|
27751
27794
|
function getOpenCodeCacheDir2() {
|
|
27752
27795
|
const xdgCache = process.env.XDG_CACHE_HOME;
|
|
27753
27796
|
if (xdgCache)
|
|
27754
|
-
return
|
|
27755
|
-
return
|
|
27797
|
+
return join20(xdgCache, "opencode");
|
|
27798
|
+
return join20(homedir7(), ".cache", "opencode");
|
|
27756
27799
|
}
|
|
27757
27800
|
function loadAvailableModelsFromCache() {
|
|
27758
|
-
const cacheFile =
|
|
27759
|
-
if (!
|
|
27801
|
+
const cacheFile = join20(getOpenCodeCacheDir2(), "models.json");
|
|
27802
|
+
if (!existsSync25(cacheFile)) {
|
|
27760
27803
|
return { providers: [], modelCount: 0, cacheExists: false };
|
|
27761
27804
|
}
|
|
27762
27805
|
try {
|
|
@@ -27782,10 +27825,10 @@ init_model_requirements();
|
|
|
27782
27825
|
// src/cli/doctor/checks/model-resolution-config.ts
|
|
27783
27826
|
init_shared();
|
|
27784
27827
|
import { readFileSync as readFileSync23 } from "fs";
|
|
27785
|
-
import { join as
|
|
27786
|
-
var
|
|
27787
|
-
var USER_CONFIG_BASE =
|
|
27788
|
-
var PROJECT_CONFIG_BASE =
|
|
27828
|
+
import { join as join21 } from "path";
|
|
27829
|
+
var PACKAGE_NAME3 = "oh-my-opencode";
|
|
27830
|
+
var USER_CONFIG_BASE = join21(getOpenCodeConfigPaths({ binary: "opencode", version: null }).configDir, PACKAGE_NAME3);
|
|
27831
|
+
var PROJECT_CONFIG_BASE = join21(process.cwd(), ".opencode", PACKAGE_NAME3);
|
|
27789
27832
|
function loadOmoConfig() {
|
|
27790
27833
|
const projectDetected = detectConfigFile(PROJECT_CONFIG_BASE);
|
|
27791
27834
|
if (projectDetected.format !== "none") {
|
|
@@ -27810,7 +27853,7 @@ function loadOmoConfig() {
|
|
|
27810
27853
|
|
|
27811
27854
|
// src/cli/doctor/checks/model-resolution-details.ts
|
|
27812
27855
|
init_shared();
|
|
27813
|
-
import { join as
|
|
27856
|
+
import { join as join22 } from "path";
|
|
27814
27857
|
|
|
27815
27858
|
// src/cli/doctor/checks/model-resolution-variant.ts
|
|
27816
27859
|
function formatModelWithVariant(model, variant) {
|
|
@@ -27849,7 +27892,7 @@ function getCategoryEffectiveVariant(categoryName, requirement, config2) {
|
|
|
27849
27892
|
// src/cli/doctor/checks/model-resolution-details.ts
|
|
27850
27893
|
function buildModelResolutionDetails(options) {
|
|
27851
27894
|
const details = [];
|
|
27852
|
-
const cacheFile =
|
|
27895
|
+
const cacheFile = join22(getOpenCodeCacheDir(), "models.json");
|
|
27853
27896
|
details.push("\u2550\u2550\u2550 Available Models (from cache) \u2550\u2550\u2550");
|
|
27854
27897
|
details.push("");
|
|
27855
27898
|
if (options.available.cacheExists) {
|
|
@@ -27961,8 +28004,8 @@ async function checkModels() {
|
|
|
27961
28004
|
}
|
|
27962
28005
|
|
|
27963
28006
|
// src/cli/doctor/checks/config.ts
|
|
27964
|
-
var USER_CONFIG_BASE2 =
|
|
27965
|
-
var PROJECT_CONFIG_BASE2 =
|
|
28007
|
+
var USER_CONFIG_BASE2 = join23(getOpenCodeConfigDir({ binary: "opencode" }), PACKAGE_NAME2);
|
|
28008
|
+
var PROJECT_CONFIG_BASE2 = join23(process.cwd(), ".opencode", PACKAGE_NAME2);
|
|
27966
28009
|
function findConfigPath() {
|
|
27967
28010
|
const projectConfig = detectConfigFile(PROJECT_CONFIG_BASE2);
|
|
27968
28011
|
if (projectConfig.format !== "none")
|
|
@@ -28082,14 +28125,14 @@ async function checkConfig() {
|
|
|
28082
28125
|
|
|
28083
28126
|
// src/cli/doctor/checks/dependencies.ts
|
|
28084
28127
|
init_spawn_with_windows_hide();
|
|
28085
|
-
import { existsSync as
|
|
28128
|
+
import { existsSync as existsSync26 } from "fs";
|
|
28086
28129
|
import { createRequire } from "module";
|
|
28087
|
-
import { dirname as dirname6, join as
|
|
28130
|
+
import { dirname as dirname6, join as join24 } from "path";
|
|
28088
28131
|
async function checkBinaryExists(binary2) {
|
|
28089
28132
|
try {
|
|
28090
|
-
const
|
|
28091
|
-
if (
|
|
28092
|
-
return { exists: true, path:
|
|
28133
|
+
const path10 = Bun.which(binary2);
|
|
28134
|
+
if (path10) {
|
|
28135
|
+
return { exists: true, path: path10 };
|
|
28093
28136
|
}
|
|
28094
28137
|
} catch {}
|
|
28095
28138
|
return { exists: false, path: null };
|
|
@@ -28140,15 +28183,15 @@ async function checkAstGrepNapi() {
|
|
|
28140
28183
|
path: null
|
|
28141
28184
|
};
|
|
28142
28185
|
} catch {
|
|
28143
|
-
const { existsSync:
|
|
28144
|
-
const { join:
|
|
28186
|
+
const { existsSync: existsSync27 } = await import("fs");
|
|
28187
|
+
const { join: join25 } = await import("path");
|
|
28145
28188
|
const { homedir: homedir8 } = await import("os");
|
|
28146
28189
|
const pathsToCheck = [
|
|
28147
|
-
|
|
28148
|
-
|
|
28190
|
+
join25(homedir8(), ".config", "opencode", "node_modules", "@ast-grep", "napi"),
|
|
28191
|
+
join25(process.cwd(), "node_modules", "@ast-grep", "napi")
|
|
28149
28192
|
];
|
|
28150
28193
|
for (const napiPath of pathsToCheck) {
|
|
28151
|
-
if (
|
|
28194
|
+
if (existsSync27(napiPath)) {
|
|
28152
28195
|
return {
|
|
28153
28196
|
name: "AST-Grep NAPI",
|
|
28154
28197
|
required: false,
|
|
@@ -28173,8 +28216,8 @@ function findCommentCheckerPackageBinary() {
|
|
|
28173
28216
|
try {
|
|
28174
28217
|
const require2 = createRequire(import.meta.url);
|
|
28175
28218
|
const pkgPath = require2.resolve("@code-yeongyu/comment-checker/package.json");
|
|
28176
|
-
const binaryPath =
|
|
28177
|
-
if (
|
|
28219
|
+
const binaryPath = join24(dirname6(pkgPath), "bin", binaryName);
|
|
28220
|
+
if (existsSync26(binaryPath))
|
|
28178
28221
|
return binaryPath;
|
|
28179
28222
|
} catch {}
|
|
28180
28223
|
return null;
|
|
@@ -28287,20 +28330,163 @@ async function getGhCliInfo() {
|
|
|
28287
28330
|
error: authStatus.error
|
|
28288
28331
|
};
|
|
28289
28332
|
}
|
|
28333
|
+
// src/tools/lsp/server-definitions.ts
|
|
28334
|
+
var BUILTIN_SERVERS = {
|
|
28335
|
+
typescript: { command: ["typescript-language-server", "--stdio"], extensions: [".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".mts", ".cts"] },
|
|
28336
|
+
deno: { command: ["deno", "lsp"], extensions: [".ts", ".tsx", ".js", ".jsx", ".mjs"] },
|
|
28337
|
+
vue: { command: ["vue-language-server", "--stdio"], extensions: [".vue"] },
|
|
28338
|
+
eslint: { command: ["vscode-eslint-language-server", "--stdio"], extensions: [".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".mts", ".cts", ".vue"] },
|
|
28339
|
+
oxlint: { command: ["oxlint", "--lsp"], extensions: [".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".mts", ".cts", ".vue", ".astro", ".svelte"] },
|
|
28340
|
+
biome: { command: ["biome", "lsp-proxy", "--stdio"], extensions: [".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".mts", ".cts", ".json", ".jsonc", ".vue", ".astro", ".svelte", ".css", ".graphql", ".gql", ".html"] },
|
|
28341
|
+
gopls: { command: ["gopls"], extensions: [".go"] },
|
|
28342
|
+
"ruby-lsp": { command: ["rubocop", "--lsp"], extensions: [".rb", ".rake", ".gemspec", ".ru"] },
|
|
28343
|
+
basedpyright: { command: ["basedpyright-langserver", "--stdio"], extensions: [".py", ".pyi"] },
|
|
28344
|
+
pyright: { command: ["pyright-langserver", "--stdio"], extensions: [".py", ".pyi"] },
|
|
28345
|
+
ty: { command: ["ty", "server"], extensions: [".py", ".pyi"] },
|
|
28346
|
+
ruff: { command: ["ruff", "server"], extensions: [".py", ".pyi"] },
|
|
28347
|
+
"elixir-ls": { command: ["elixir-ls"], extensions: [".ex", ".exs"] },
|
|
28348
|
+
zls: { command: ["zls"], extensions: [".zig", ".zon"] },
|
|
28349
|
+
csharp: { command: ["csharp-ls"], extensions: [".cs"] },
|
|
28350
|
+
fsharp: { command: ["fsautocomplete"], extensions: [".fs", ".fsi", ".fsx", ".fsscript"] },
|
|
28351
|
+
"sourcekit-lsp": { command: ["sourcekit-lsp"], extensions: [".swift", ".objc", ".objcpp"] },
|
|
28352
|
+
rust: { command: ["rust-analyzer"], extensions: [".rs"] },
|
|
28353
|
+
clangd: { command: ["clangd", "--background-index", "--clang-tidy"], extensions: [".c", ".cpp", ".cc", ".cxx", ".c++", ".h", ".hpp", ".hh", ".hxx", ".h++"] },
|
|
28354
|
+
svelte: { command: ["svelteserver", "--stdio"], extensions: [".svelte"] },
|
|
28355
|
+
astro: { command: ["astro-ls", "--stdio"], extensions: [".astro"] },
|
|
28356
|
+
bash: { command: ["bash-language-server", "start"], extensions: [".sh", ".bash", ".zsh", ".ksh"] },
|
|
28357
|
+
"bash-ls": { command: ["bash-language-server", "start"], extensions: [".sh", ".bash", ".zsh", ".ksh"] },
|
|
28358
|
+
jdtls: { command: ["jdtls"], extensions: [".java"] },
|
|
28359
|
+
"yaml-ls": { command: ["yaml-language-server", "--stdio"], extensions: [".yaml", ".yml"] },
|
|
28360
|
+
"lua-ls": { command: ["lua-language-server"], extensions: [".lua"] },
|
|
28361
|
+
php: { command: ["intelephense", "--stdio"], extensions: [".php"] },
|
|
28362
|
+
dart: { command: ["dart", "language-server", "--lsp"], extensions: [".dart"] },
|
|
28363
|
+
terraform: { command: ["terraform-ls", "serve"], extensions: [".tf", ".tfvars"] },
|
|
28364
|
+
"terraform-ls": { command: ["terraform-ls", "serve"], extensions: [".tf", ".tfvars"] },
|
|
28365
|
+
prisma: { command: ["prisma", "language-server"], extensions: [".prisma"] },
|
|
28366
|
+
"ocaml-lsp": { command: ["ocamllsp"], extensions: [".ml", ".mli"] },
|
|
28367
|
+
texlab: { command: ["texlab"], extensions: [".tex", ".bib"] },
|
|
28368
|
+
dockerfile: { command: ["docker-langserver", "--stdio"], extensions: [".dockerfile"] },
|
|
28369
|
+
gleam: { command: ["gleam", "lsp"], extensions: [".gleam"] },
|
|
28370
|
+
"clojure-lsp": { command: ["clojure-lsp", "listen"], extensions: [".clj", ".cljs", ".cljc", ".edn"] },
|
|
28371
|
+
nixd: { command: ["nixd"], extensions: [".nix"] },
|
|
28372
|
+
tinymist: { command: ["tinymist"], extensions: [".typ", ".typc"] },
|
|
28373
|
+
"haskell-language-server": { command: ["haskell-language-server-wrapper", "--lsp"], extensions: [".hs", ".lhs"] },
|
|
28374
|
+
"kotlin-ls": { command: ["kotlin-lsp"], extensions: [".kt", ".kts"] }
|
|
28375
|
+
};
|
|
28290
28376
|
// src/tools/lsp/server-config-loader.ts
|
|
28377
|
+
import { existsSync as existsSync27, readFileSync as readFileSync25 } from "fs";
|
|
28378
|
+
import { join as join25 } from "path";
|
|
28291
28379
|
init_shared();
|
|
28292
28380
|
init_jsonc_parser();
|
|
28381
|
+
function loadJsonFile(path10) {
|
|
28382
|
+
if (!existsSync27(path10))
|
|
28383
|
+
return null;
|
|
28384
|
+
try {
|
|
28385
|
+
return parseJsonc(readFileSync25(path10, "utf-8"));
|
|
28386
|
+
} catch {
|
|
28387
|
+
return null;
|
|
28388
|
+
}
|
|
28389
|
+
}
|
|
28390
|
+
function getConfigPaths2() {
|
|
28391
|
+
const cwd = process.cwd();
|
|
28392
|
+
const configDir = getOpenCodeConfigDir({ binary: "opencode" });
|
|
28393
|
+
return {
|
|
28394
|
+
project: detectConfigFile(join25(cwd, ".opencode", "oh-my-opencode")).path,
|
|
28395
|
+
user: detectConfigFile(join25(configDir, "oh-my-opencode")).path,
|
|
28396
|
+
opencode: detectConfigFile(join25(configDir, "opencode")).path
|
|
28397
|
+
};
|
|
28398
|
+
}
|
|
28399
|
+
function loadAllConfigs() {
|
|
28400
|
+
const paths = getConfigPaths2();
|
|
28401
|
+
const configs = new Map;
|
|
28402
|
+
const project = loadJsonFile(paths.project);
|
|
28403
|
+
if (project)
|
|
28404
|
+
configs.set("project", project);
|
|
28405
|
+
const user = loadJsonFile(paths.user);
|
|
28406
|
+
if (user)
|
|
28407
|
+
configs.set("user", user);
|
|
28408
|
+
const opencode = loadJsonFile(paths.opencode);
|
|
28409
|
+
if (opencode)
|
|
28410
|
+
configs.set("opencode", opencode);
|
|
28411
|
+
return configs;
|
|
28412
|
+
}
|
|
28413
|
+
function getMergedServers() {
|
|
28414
|
+
const configs = loadAllConfigs();
|
|
28415
|
+
const servers = [];
|
|
28416
|
+
const disabled = new Set;
|
|
28417
|
+
const seen = new Set;
|
|
28418
|
+
const sources = ["project", "user", "opencode"];
|
|
28419
|
+
for (const source of sources) {
|
|
28420
|
+
const config2 = configs.get(source);
|
|
28421
|
+
if (!config2?.lsp)
|
|
28422
|
+
continue;
|
|
28423
|
+
for (const [id, entry] of Object.entries(config2.lsp)) {
|
|
28424
|
+
if (entry.disabled) {
|
|
28425
|
+
disabled.add(id);
|
|
28426
|
+
continue;
|
|
28427
|
+
}
|
|
28428
|
+
if (seen.has(id))
|
|
28429
|
+
continue;
|
|
28430
|
+
if (!entry.command || !entry.extensions)
|
|
28431
|
+
continue;
|
|
28432
|
+
servers.push({
|
|
28433
|
+
id,
|
|
28434
|
+
command: entry.command,
|
|
28435
|
+
extensions: entry.extensions,
|
|
28436
|
+
priority: entry.priority ?? 0,
|
|
28437
|
+
env: entry.env,
|
|
28438
|
+
initialization: entry.initialization,
|
|
28439
|
+
source
|
|
28440
|
+
});
|
|
28441
|
+
seen.add(id);
|
|
28442
|
+
}
|
|
28443
|
+
}
|
|
28444
|
+
for (const [id, config2] of Object.entries(BUILTIN_SERVERS)) {
|
|
28445
|
+
if (disabled.has(id) || seen.has(id))
|
|
28446
|
+
continue;
|
|
28447
|
+
servers.push({
|
|
28448
|
+
id,
|
|
28449
|
+
command: config2.command,
|
|
28450
|
+
extensions: config2.extensions,
|
|
28451
|
+
priority: -100,
|
|
28452
|
+
source: "opencode"
|
|
28453
|
+
});
|
|
28454
|
+
}
|
|
28455
|
+
return servers.sort((a, b3) => {
|
|
28456
|
+
if (a.source !== b3.source) {
|
|
28457
|
+
const order = { project: 0, user: 1, opencode: 2 };
|
|
28458
|
+
return order[a.source] - order[b3.source];
|
|
28459
|
+
}
|
|
28460
|
+
return b3.priority - a.priority;
|
|
28461
|
+
});
|
|
28462
|
+
}
|
|
28293
28463
|
|
|
28294
28464
|
// src/tools/lsp/server-installation.ts
|
|
28465
|
+
import { existsSync as existsSync28 } from "fs";
|
|
28466
|
+
import { delimiter as delimiter2, join as join27 } from "path";
|
|
28467
|
+
|
|
28468
|
+
// src/tools/lsp/server-path-bases.ts
|
|
28295
28469
|
init_shared();
|
|
28296
|
-
import {
|
|
28297
|
-
|
|
28470
|
+
import { join as join26 } from "path";
|
|
28471
|
+
function getLspServerAdditionalPathBases(workingDirectory) {
|
|
28472
|
+
const configDir = getOpenCodeConfigDir({ binary: "opencode" });
|
|
28473
|
+
const dataDir = join26(getDataDir(), "opencode");
|
|
28474
|
+
return [
|
|
28475
|
+
join26(workingDirectory, "node_modules", ".bin"),
|
|
28476
|
+
join26(configDir, "bin"),
|
|
28477
|
+
join26(configDir, "node_modules", ".bin"),
|
|
28478
|
+
join26(dataDir, "bin"),
|
|
28479
|
+
join26(dataDir, "bin", "node_modules", ".bin")
|
|
28480
|
+
];
|
|
28481
|
+
}
|
|
28482
|
+
|
|
28483
|
+
// src/tools/lsp/server-installation.ts
|
|
28298
28484
|
function isServerInstalled(command) {
|
|
28299
28485
|
if (command.length === 0)
|
|
28300
28486
|
return false;
|
|
28301
28487
|
const cmd = command[0];
|
|
28302
28488
|
if (cmd.includes("/") || cmd.includes("\\")) {
|
|
28303
|
-
if (
|
|
28489
|
+
if (existsSync28(cmd))
|
|
28304
28490
|
return true;
|
|
28305
28491
|
}
|
|
28306
28492
|
const isWindows = process.platform === "win32";
|
|
@@ -28318,27 +28504,17 @@ function isServerInstalled(command) {
|
|
|
28318
28504
|
if (isWindows && !pathEnv) {
|
|
28319
28505
|
pathEnv = process.env.Path || "";
|
|
28320
28506
|
}
|
|
28321
|
-
const
|
|
28322
|
-
const paths = pathEnv.split(pathSeparator);
|
|
28507
|
+
const paths = pathEnv.split(delimiter2);
|
|
28323
28508
|
for (const p2 of paths) {
|
|
28324
28509
|
for (const suffix of exts) {
|
|
28325
|
-
if (
|
|
28510
|
+
if (existsSync28(join27(p2, cmd + suffix))) {
|
|
28326
28511
|
return true;
|
|
28327
28512
|
}
|
|
28328
28513
|
}
|
|
28329
28514
|
}
|
|
28330
|
-
const
|
|
28331
|
-
const configDir = getOpenCodeConfigDir({ binary: "opencode" });
|
|
28332
|
-
const dataDir = join23(getDataDir(), "opencode");
|
|
28333
|
-
const additionalBases = [
|
|
28334
|
-
join23(cwd, "node_modules", ".bin"),
|
|
28335
|
-
join23(configDir, "bin"),
|
|
28336
|
-
join23(configDir, "node_modules", ".bin"),
|
|
28337
|
-
join23(dataDir, "bin")
|
|
28338
|
-
];
|
|
28339
|
-
for (const base of additionalBases) {
|
|
28515
|
+
for (const base of getLspServerAdditionalPathBases(process.cwd())) {
|
|
28340
28516
|
for (const suffix of exts) {
|
|
28341
|
-
if (
|
|
28517
|
+
if (existsSync28(join27(base, cmd + suffix))) {
|
|
28342
28518
|
return true;
|
|
28343
28519
|
}
|
|
28344
28520
|
}
|
|
@@ -28348,48 +28524,76 @@ function isServerInstalled(command) {
|
|
|
28348
28524
|
}
|
|
28349
28525
|
return false;
|
|
28350
28526
|
}
|
|
28351
|
-
|
|
28352
|
-
|
|
28353
|
-
|
|
28354
|
-
|
|
28355
|
-
|
|
28356
|
-
|
|
28357
|
-
|
|
28358
|
-
|
|
28359
|
-
|
|
28360
|
-
id
|
|
28361
|
-
|
|
28362
|
-
|
|
28363
|
-
|
|
28364
|
-
}
|
|
28527
|
+
|
|
28528
|
+
// src/tools/lsp/server-resolution.ts
|
|
28529
|
+
function getAllServers() {
|
|
28530
|
+
const configs = loadAllConfigs();
|
|
28531
|
+
const servers = getMergedServers();
|
|
28532
|
+
const disabled = new Set;
|
|
28533
|
+
for (const config2 of configs.values()) {
|
|
28534
|
+
if (!config2.lsp)
|
|
28535
|
+
continue;
|
|
28536
|
+
for (const [id, entry] of Object.entries(config2.lsp)) {
|
|
28537
|
+
if (entry.disabled)
|
|
28538
|
+
disabled.add(id);
|
|
28539
|
+
}
|
|
28540
|
+
}
|
|
28541
|
+
const result = [];
|
|
28542
|
+
const seen = new Set;
|
|
28543
|
+
for (const server2 of servers) {
|
|
28544
|
+
if (seen.has(server2.id))
|
|
28545
|
+
continue;
|
|
28546
|
+
result.push({
|
|
28547
|
+
id: server2.id,
|
|
28548
|
+
installed: isServerInstalled(server2.command),
|
|
28549
|
+
extensions: server2.extensions,
|
|
28550
|
+
disabled: false,
|
|
28551
|
+
source: server2.source,
|
|
28552
|
+
priority: server2.priority
|
|
28553
|
+
});
|
|
28554
|
+
seen.add(server2.id);
|
|
28555
|
+
}
|
|
28556
|
+
for (const id of disabled) {
|
|
28557
|
+
if (seen.has(id))
|
|
28558
|
+
continue;
|
|
28559
|
+
const builtin = BUILTIN_SERVERS[id];
|
|
28560
|
+
result.push({
|
|
28561
|
+
id,
|
|
28562
|
+
installed: builtin ? isServerInstalled(builtin.command) : false,
|
|
28563
|
+
extensions: builtin?.extensions || [],
|
|
28564
|
+
disabled: true,
|
|
28565
|
+
source: "disabled",
|
|
28566
|
+
priority: 0
|
|
28567
|
+
});
|
|
28568
|
+
}
|
|
28569
|
+
return result;
|
|
28365
28570
|
}
|
|
28366
|
-
|
|
28367
|
-
|
|
28368
|
-
|
|
28369
|
-
|
|
28370
|
-
};
|
|
28571
|
+
// src/cli/doctor/checks/tools-lsp.ts
|
|
28572
|
+
function getInstalledLspServers() {
|
|
28573
|
+
const servers = getAllServers();
|
|
28574
|
+
return servers.filter((s) => s.installed && !s.disabled).map((s) => ({ id: s.id, extensions: s.extensions }));
|
|
28371
28575
|
}
|
|
28372
28576
|
|
|
28373
28577
|
// src/cli/doctor/checks/tools-mcp.ts
|
|
28374
28578
|
init_shared();
|
|
28375
|
-
import { existsSync as
|
|
28579
|
+
import { existsSync as existsSync29, readFileSync as readFileSync26 } from "fs";
|
|
28376
28580
|
import { homedir as homedir8 } from "os";
|
|
28377
|
-
import { join as
|
|
28581
|
+
import { join as join28 } from "path";
|
|
28378
28582
|
var BUILTIN_MCP_SERVERS = ["context7", "grep_app"];
|
|
28379
28583
|
function getMcpConfigPaths() {
|
|
28380
28584
|
return [
|
|
28381
|
-
|
|
28382
|
-
|
|
28383
|
-
|
|
28585
|
+
join28(homedir8(), ".claude", ".mcp.json"),
|
|
28586
|
+
join28(process.cwd(), ".mcp.json"),
|
|
28587
|
+
join28(process.cwd(), ".claude", ".mcp.json")
|
|
28384
28588
|
];
|
|
28385
28589
|
}
|
|
28386
28590
|
function loadUserMcpConfig() {
|
|
28387
28591
|
const servers = {};
|
|
28388
28592
|
for (const configPath of getMcpConfigPaths()) {
|
|
28389
|
-
if (!
|
|
28593
|
+
if (!existsSync29(configPath))
|
|
28390
28594
|
continue;
|
|
28391
28595
|
try {
|
|
28392
|
-
const content =
|
|
28596
|
+
const content = readFileSync26(configPath, "utf-8");
|
|
28393
28597
|
const config2 = parseJsonc(content);
|
|
28394
28598
|
if (config2.mcpServers) {
|
|
28395
28599
|
Object.assign(servers, config2.mcpServers);
|
|
@@ -28429,13 +28633,11 @@ async function gatherToolsSummary() {
|
|
|
28429
28633
|
checkCommentChecker(),
|
|
28430
28634
|
getGhCliInfo()
|
|
28431
28635
|
]);
|
|
28432
|
-
const lspServers =
|
|
28433
|
-
const lspStats = getLspServerStats(lspServers);
|
|
28636
|
+
const lspServers = getInstalledLspServers();
|
|
28434
28637
|
const builtinMcp = getBuiltinMcpInfo();
|
|
28435
28638
|
const userMcp = getUserMcpInfo();
|
|
28436
28639
|
return {
|
|
28437
|
-
|
|
28438
|
-
lspTotal: lspStats.total,
|
|
28640
|
+
lspServers,
|
|
28439
28641
|
astGrepCli: astGrepCliInfo.installed,
|
|
28440
28642
|
astGrepNapi: astGrepNapiInfo.installed,
|
|
28441
28643
|
commentChecker: commentCheckerInfo.installed,
|
|
@@ -28468,7 +28670,7 @@ function buildToolIssues(summary) {
|
|
|
28468
28670
|
affects: ["comment-checker hook"]
|
|
28469
28671
|
});
|
|
28470
28672
|
}
|
|
28471
|
-
if (summary.
|
|
28673
|
+
if (summary.lspServers.length === 0) {
|
|
28472
28674
|
issues.push({
|
|
28473
28675
|
title: "No LSP servers detected",
|
|
28474
28676
|
description: "LSP-dependent tools will be limited until at least one server is installed.",
|
|
@@ -28515,7 +28717,7 @@ async function checkTools() {
|
|
|
28515
28717
|
details: [
|
|
28516
28718
|
`AST-Grep: cli=${summary.astGrepCli ? "yes" : "no"}, napi=${summary.astGrepNapi ? "yes" : "no"}`,
|
|
28517
28719
|
`Comment checker: ${summary.commentChecker ? "yes" : "no"}`,
|
|
28518
|
-
`LSP: ${summary.
|
|
28720
|
+
`LSP: ${summary.lspServers.length > 0 ? `${summary.lspServers.length} server(s)` : "none"}`,
|
|
28519
28721
|
`GH CLI: ${summary.ghCli.installed ? "installed" : "missing"}${summary.ghCli.authenticated ? " (authenticated)" : ""}`,
|
|
28520
28722
|
`MCP: builtin=${summary.mcpBuiltin.length}, user=${summary.mcpUser.length}`
|
|
28521
28723
|
],
|
|
@@ -28550,10 +28752,10 @@ function getAllCheckDefinitions() {
|
|
|
28550
28752
|
}
|
|
28551
28753
|
|
|
28552
28754
|
// src/cli/doctor/format-default.ts
|
|
28553
|
-
var
|
|
28755
|
+
var import_picocolors18 = __toESM(require_picocolors(), 1);
|
|
28554
28756
|
|
|
28555
28757
|
// src/cli/doctor/format-shared.ts
|
|
28556
|
-
var
|
|
28758
|
+
var import_picocolors17 = __toESM(require_picocolors(), 1);
|
|
28557
28759
|
function formatStatusSymbol(status) {
|
|
28558
28760
|
const colorFn = STATUS_COLORS[status];
|
|
28559
28761
|
switch (status) {
|
|
@@ -28568,23 +28770,23 @@ function formatStatusSymbol(status) {
|
|
|
28568
28770
|
}
|
|
28569
28771
|
}
|
|
28570
28772
|
function formatStatusMark(available) {
|
|
28571
|
-
return available ?
|
|
28773
|
+
return available ? import_picocolors17.default.green(SYMBOLS3.check) : import_picocolors17.default.red(SYMBOLS3.cross);
|
|
28572
28774
|
}
|
|
28573
28775
|
function formatHeader() {
|
|
28574
28776
|
return `
|
|
28575
|
-
${
|
|
28777
|
+
${import_picocolors17.default.bgMagenta(import_picocolors17.default.white(" oMoMoMoMo Doctor "))}
|
|
28576
28778
|
`;
|
|
28577
28779
|
}
|
|
28578
28780
|
function formatIssue(issue2, index) {
|
|
28579
28781
|
const lines = [];
|
|
28580
|
-
const severityColor = issue2.severity === "error" ?
|
|
28782
|
+
const severityColor = issue2.severity === "error" ? import_picocolors17.default.red : import_picocolors17.default.yellow;
|
|
28581
28783
|
lines.push(`${index}. ${severityColor(issue2.title)}`);
|
|
28582
|
-
lines.push(` ${
|
|
28784
|
+
lines.push(` ${import_picocolors17.default.dim(issue2.description)}`);
|
|
28583
28785
|
if (issue2.fix) {
|
|
28584
|
-
lines.push(` ${
|
|
28786
|
+
lines.push(` ${import_picocolors17.default.cyan("Fix:")} ${import_picocolors17.default.dim(issue2.fix)}`);
|
|
28585
28787
|
}
|
|
28586
28788
|
if (issue2.affects && issue2.affects.length > 0) {
|
|
28587
|
-
lines.push(` ${
|
|
28789
|
+
lines.push(` ${import_picocolors17.default.cyan("Affects:")} ${import_picocolors17.default.dim(issue2.affects.join(", "))}`);
|
|
28588
28790
|
}
|
|
28589
28791
|
return lines.join(`
|
|
28590
28792
|
`);
|
|
@@ -28598,12 +28800,12 @@ function formatDefault(result) {
|
|
|
28598
28800
|
if (allIssues.length === 0) {
|
|
28599
28801
|
const opencodeVer = result.systemInfo.opencodeVersion ?? "unknown";
|
|
28600
28802
|
const pluginVer = result.systemInfo.pluginVersion ?? "unknown";
|
|
28601
|
-
lines.push(` ${
|
|
28803
|
+
lines.push(` ${import_picocolors18.default.green(SYMBOLS3.check)} ${import_picocolors18.default.green(`System OK (opencode ${opencodeVer} \xB7 oh-my-opencode ${pluginVer})`)}`);
|
|
28602
28804
|
} else {
|
|
28603
28805
|
const issueCount = allIssues.filter((i2) => i2.severity === "error").length;
|
|
28604
28806
|
const warnCount = allIssues.filter((i2) => i2.severity === "warning").length;
|
|
28605
28807
|
const totalStr = `${issueCount + warnCount} ${issueCount + warnCount === 1 ? "issue" : "issues"}`;
|
|
28606
|
-
lines.push(` ${
|
|
28808
|
+
lines.push(` ${import_picocolors18.default.yellow(SYMBOLS3.warn)} ${totalStr} found:
|
|
28607
28809
|
`);
|
|
28608
28810
|
allIssues.forEach((issue2, index) => {
|
|
28609
28811
|
lines.push(formatIssue(issue2, index + 1));
|
|
@@ -28615,7 +28817,7 @@ function formatDefault(result) {
|
|
|
28615
28817
|
}
|
|
28616
28818
|
|
|
28617
28819
|
// src/cli/doctor/format-status.ts
|
|
28618
|
-
var
|
|
28820
|
+
var import_picocolors19 = __toESM(require_picocolors(), 1);
|
|
28619
28821
|
function formatStatus(result) {
|
|
28620
28822
|
const lines = [];
|
|
28621
28823
|
lines.push(formatHeader());
|
|
@@ -28626,13 +28828,15 @@ function formatStatus(result) {
|
|
|
28626
28828
|
const bunVer = systemInfo.bunVersion ?? "unknown";
|
|
28627
28829
|
lines.push(` ${padding}System ${opencodeVer} \xB7 ${pluginVer} \xB7 Bun ${bunVer}`);
|
|
28628
28830
|
const configPath = systemInfo.configPath ?? "unknown";
|
|
28629
|
-
const configStatus = systemInfo.configValid ?
|
|
28831
|
+
const configStatus = systemInfo.configValid ? import_picocolors19.default.green("(valid)") : import_picocolors19.default.red("(invalid)");
|
|
28630
28832
|
lines.push(` ${padding}Config ${configPath} ${configStatus}`);
|
|
28631
|
-
const
|
|
28833
|
+
const serverCount = tools.lspServers.length;
|
|
28834
|
+
const lspMark = formatStatusMark(serverCount > 0);
|
|
28835
|
+
const lspText = serverCount > 0 ? `${serverCount} server${serverCount === 1 ? "" : "s"}` : "none";
|
|
28632
28836
|
const astGrepMark = formatStatusMark(tools.astGrepCli);
|
|
28633
28837
|
const ghMark = formatStatusMark(tools.ghCli.installed && tools.ghCli.authenticated);
|
|
28634
28838
|
const ghUser = tools.ghCli.username ?? "";
|
|
28635
|
-
lines.push(` ${padding}Tools ${lspText} \xB7 AST-Grep ${astGrepMark} \xB7 gh ${ghMark}${ghUser ? ` (${ghUser})` : ""}`);
|
|
28839
|
+
lines.push(` ${padding}Tools LSP ${lspMark} ${lspText} \xB7 AST-Grep ${astGrepMark} \xB7 gh ${ghMark}${ghUser ? ` (${ghUser})` : ""}`);
|
|
28636
28840
|
const builtinCount = tools.mcpBuiltin.length;
|
|
28637
28841
|
const userCount = tools.mcpUser.length;
|
|
28638
28842
|
const builtinText = builtinCount > 0 ? tools.mcpBuiltin.join(" \xB7 ") : "none";
|
|
@@ -28643,13 +28847,13 @@ function formatStatus(result) {
|
|
|
28643
28847
|
}
|
|
28644
28848
|
|
|
28645
28849
|
// src/cli/doctor/format-verbose.ts
|
|
28646
|
-
var
|
|
28850
|
+
var import_picocolors20 = __toESM(require_picocolors(), 1);
|
|
28647
28851
|
function formatVerbose(result) {
|
|
28648
28852
|
const lines = [];
|
|
28649
28853
|
lines.push(formatHeader());
|
|
28650
28854
|
const { systemInfo, tools, results, summary } = result;
|
|
28651
|
-
lines.push(`${
|
|
28652
|
-
lines.push(`${
|
|
28855
|
+
lines.push(`${import_picocolors20.default.bold("System Information")}`);
|
|
28856
|
+
lines.push(`${import_picocolors20.default.dim("\u2500".repeat(40))}`);
|
|
28653
28857
|
lines.push(` ${formatStatusSymbol("pass")} opencode ${systemInfo.opencodeVersion ?? "unknown"}`);
|
|
28654
28858
|
lines.push(` ${formatStatusSymbol("pass")} oh-my-opencode ${systemInfo.pluginVersion ?? "unknown"}`);
|
|
28655
28859
|
if (systemInfo.loadedVersion) {
|
|
@@ -28660,54 +28864,73 @@ function formatVerbose(result) {
|
|
|
28660
28864
|
}
|
|
28661
28865
|
lines.push(` ${formatStatusSymbol("pass")} path ${systemInfo.opencodePath ?? "unknown"}`);
|
|
28662
28866
|
if (systemInfo.isLocalDev) {
|
|
28663
|
-
lines.push(` ${
|
|
28867
|
+
lines.push(` ${import_picocolors20.default.yellow("*")} ${import_picocolors20.default.dim("(local development mode)")}`);
|
|
28664
28868
|
}
|
|
28665
28869
|
lines.push("");
|
|
28666
|
-
lines.push(`${
|
|
28667
|
-
lines.push(`${
|
|
28668
|
-
const configStatus = systemInfo.configValid ?
|
|
28870
|
+
lines.push(`${import_picocolors20.default.bold("Configuration")}`);
|
|
28871
|
+
lines.push(`${import_picocolors20.default.dim("\u2500".repeat(40))}`);
|
|
28872
|
+
const configStatus = systemInfo.configValid ? import_picocolors20.default.green("valid") : import_picocolors20.default.red("invalid");
|
|
28669
28873
|
lines.push(` ${formatStatusSymbol(systemInfo.configValid ? "pass" : "fail")} ${systemInfo.configPath ?? "unknown"} (${configStatus})`);
|
|
28670
28874
|
lines.push("");
|
|
28671
|
-
lines.push(`${
|
|
28672
|
-
lines.push(`${
|
|
28673
|
-
|
|
28875
|
+
lines.push(`${import_picocolors20.default.bold("Tools")}`);
|
|
28876
|
+
lines.push(`${import_picocolors20.default.dim("\u2500".repeat(40))}`);
|
|
28877
|
+
if (tools.lspServers.length === 0) {
|
|
28878
|
+
lines.push(` ${formatStatusSymbol("warn")} LSP none detected`);
|
|
28879
|
+
} else {
|
|
28880
|
+
const count = tools.lspServers.length;
|
|
28881
|
+
lines.push(` ${formatStatusSymbol("pass")} LSP ${count} server${count === 1 ? "" : "s"}`);
|
|
28882
|
+
for (const server2 of tools.lspServers) {
|
|
28883
|
+
lines.push(`${" ".repeat(20)}${server2.id} (${server2.extensions.join(", ")})`);
|
|
28884
|
+
}
|
|
28885
|
+
}
|
|
28674
28886
|
lines.push(` ${formatStatusSymbol(tools.astGrepCli ? "pass" : "fail")} ast-grep CLI ${tools.astGrepCli ? "installed" : "not found"}`);
|
|
28675
28887
|
lines.push(` ${formatStatusSymbol(tools.astGrepNapi ? "pass" : "fail")} ast-grep napi ${tools.astGrepNapi ? "installed" : "not found"}`);
|
|
28676
28888
|
lines.push(` ${formatStatusSymbol(tools.commentChecker ? "pass" : "fail")} comment-checker ${tools.commentChecker ? "installed" : "not found"}`);
|
|
28677
28889
|
lines.push(` ${formatStatusSymbol(tools.ghCli.installed && tools.ghCli.authenticated ? "pass" : "fail")} gh CLI ${tools.ghCli.installed ? "installed" : "not found"}${tools.ghCli.authenticated && tools.ghCli.username ? ` (${tools.ghCli.username})` : ""}`);
|
|
28678
28890
|
lines.push("");
|
|
28679
|
-
lines.push(`${
|
|
28680
|
-
lines.push(`${
|
|
28891
|
+
lines.push(`${import_picocolors20.default.bold("MCPs")}`);
|
|
28892
|
+
lines.push(`${import_picocolors20.default.dim("\u2500".repeat(40))}`);
|
|
28681
28893
|
if (tools.mcpBuiltin.length === 0) {
|
|
28682
|
-
lines.push(` ${
|
|
28894
|
+
lines.push(` ${import_picocolors20.default.dim("No built-in MCPs")}`);
|
|
28683
28895
|
} else {
|
|
28684
28896
|
for (const mcp of tools.mcpBuiltin) {
|
|
28685
28897
|
lines.push(` ${formatStatusSymbol("pass")} ${mcp}`);
|
|
28686
28898
|
}
|
|
28687
28899
|
}
|
|
28688
28900
|
if (tools.mcpUser.length > 0) {
|
|
28689
|
-
lines.push(` ${
|
|
28901
|
+
lines.push(` ${import_picocolors20.default.cyan("+")} ${tools.mcpUser.length} user MCP(s):`);
|
|
28690
28902
|
for (const mcp of tools.mcpUser) {
|
|
28691
28903
|
lines.push(` ${formatStatusSymbol("pass")} ${mcp}`);
|
|
28692
28904
|
}
|
|
28693
28905
|
}
|
|
28694
28906
|
lines.push("");
|
|
28907
|
+
for (const check2 of results) {
|
|
28908
|
+
if (!check2.details || check2.details.length === 0) {
|
|
28909
|
+
continue;
|
|
28910
|
+
}
|
|
28911
|
+
lines.push(`${import_picocolors20.default.bold(check2.name)}`);
|
|
28912
|
+
lines.push(`${import_picocolors20.default.dim("\u2500".repeat(40))}`);
|
|
28913
|
+
for (const detail of check2.details) {
|
|
28914
|
+
lines.push(detail);
|
|
28915
|
+
}
|
|
28916
|
+
lines.push("");
|
|
28917
|
+
}
|
|
28695
28918
|
const allIssues = results.flatMap((r2) => r2.issues);
|
|
28696
28919
|
if (allIssues.length > 0) {
|
|
28697
|
-
lines.push(`${
|
|
28698
|
-
lines.push(`${
|
|
28920
|
+
lines.push(`${import_picocolors20.default.bold("Issues")}`);
|
|
28921
|
+
lines.push(`${import_picocolors20.default.dim("\u2500".repeat(40))}`);
|
|
28699
28922
|
allIssues.forEach((issue2, index) => {
|
|
28700
28923
|
lines.push(formatIssue(issue2, index + 1));
|
|
28701
28924
|
lines.push("");
|
|
28702
28925
|
});
|
|
28703
28926
|
}
|
|
28704
|
-
lines.push(`${
|
|
28705
|
-
lines.push(`${
|
|
28706
|
-
const passText = summary.passed > 0 ?
|
|
28707
|
-
const failText = summary.failed > 0 ?
|
|
28708
|
-
const warnText = summary.warnings > 0 ?
|
|
28927
|
+
lines.push(`${import_picocolors20.default.bold("Summary")}`);
|
|
28928
|
+
lines.push(`${import_picocolors20.default.dim("\u2500".repeat(40))}`);
|
|
28929
|
+
const passText = summary.passed > 0 ? import_picocolors20.default.green(`${summary.passed} passed`) : `${summary.passed} passed`;
|
|
28930
|
+
const failText = summary.failed > 0 ? import_picocolors20.default.red(`${summary.failed} failed`) : `${summary.failed} failed`;
|
|
28931
|
+
const warnText = summary.warnings > 0 ? import_picocolors20.default.yellow(`${summary.warnings} warnings`) : `${summary.warnings} warnings`;
|
|
28709
28932
|
lines.push(` ${passText}, ${failText}, ${warnText}`);
|
|
28710
|
-
lines.push(` ${
|
|
28933
|
+
lines.push(` ${import_picocolors20.default.dim(`Total: ${summary.total} checks in ${summary.duration}ms`)}`);
|
|
28711
28934
|
return lines.join(`
|
|
28712
28935
|
`);
|
|
28713
28936
|
}
|
|
@@ -28791,11 +29014,11 @@ async function doctor(options = { mode: "default" }) {
|
|
|
28791
29014
|
|
|
28792
29015
|
// src/features/mcp-oauth/storage.ts
|
|
28793
29016
|
init_shared();
|
|
28794
|
-
import { chmodSync, existsSync as
|
|
28795
|
-
import { dirname as dirname7, join as
|
|
29017
|
+
import { chmodSync, existsSync as existsSync30, mkdirSync as mkdirSync6, readFileSync as readFileSync27, unlinkSync as unlinkSync4, writeFileSync as writeFileSync10 } from "fs";
|
|
29018
|
+
import { dirname as dirname7, join as join29 } from "path";
|
|
28796
29019
|
var STORAGE_FILE_NAME = "mcp-oauth.json";
|
|
28797
29020
|
function getMcpOauthStoragePath() {
|
|
28798
|
-
return
|
|
29021
|
+
return join29(getOpenCodeConfigDir({ binary: "opencode" }), STORAGE_FILE_NAME);
|
|
28799
29022
|
}
|
|
28800
29023
|
function normalizeHost(serverHost) {
|
|
28801
29024
|
let host = serverHost.trim();
|
|
@@ -28832,11 +29055,11 @@ function buildKey(serverHost, resource) {
|
|
|
28832
29055
|
}
|
|
28833
29056
|
function readStore() {
|
|
28834
29057
|
const filePath = getMcpOauthStoragePath();
|
|
28835
|
-
if (!
|
|
29058
|
+
if (!existsSync30(filePath)) {
|
|
28836
29059
|
return null;
|
|
28837
29060
|
}
|
|
28838
29061
|
try {
|
|
28839
|
-
const content =
|
|
29062
|
+
const content = readFileSync27(filePath, "utf-8");
|
|
28840
29063
|
return JSON.parse(content);
|
|
28841
29064
|
} catch {
|
|
28842
29065
|
return null;
|
|
@@ -28846,7 +29069,7 @@ function writeStore(store2) {
|
|
|
28846
29069
|
const filePath = getMcpOauthStoragePath();
|
|
28847
29070
|
try {
|
|
28848
29071
|
const dir = dirname7(filePath);
|
|
28849
|
-
if (!
|
|
29072
|
+
if (!existsSync30(dir)) {
|
|
28850
29073
|
mkdirSync6(dir, { recursive: true });
|
|
28851
29074
|
}
|
|
28852
29075
|
writeFileSync10(filePath, JSON.stringify(store2, null, 2), { encoding: "utf-8", mode: 384 });
|
|
@@ -28881,8 +29104,8 @@ function deleteToken(serverHost, resource) {
|
|
|
28881
29104
|
if (Object.keys(store2).length === 0) {
|
|
28882
29105
|
try {
|
|
28883
29106
|
const filePath = getMcpOauthStoragePath();
|
|
28884
|
-
if (
|
|
28885
|
-
|
|
29107
|
+
if (existsSync30(filePath)) {
|
|
29108
|
+
unlinkSync4(filePath);
|
|
28886
29109
|
}
|
|
28887
29110
|
return true;
|
|
28888
29111
|
} catch {
|
|
@@ -29415,7 +29638,7 @@ function createMcpOAuthCommand() {
|
|
|
29415
29638
|
var VERSION2 = package_default.version;
|
|
29416
29639
|
var program2 = new Command;
|
|
29417
29640
|
program2.name("oh-my-opencode").description("The ultimate OpenCode plugin - multi-model orchestration, LSP tools, and more").version(VERSION2, "-v, --version", "Show version number").enablePositionalOptions();
|
|
29418
|
-
program2.command("install").description("Install and configure oh-my-opencode with interactive setup").option("--no-tui", "Run in non-interactive mode (requires all options)").option("--claude <value>", "Claude subscription: no, yes, max20").option("--openai <value>", "OpenAI/ChatGPT subscription: no, yes (default: no)").option("--gemini <value>", "Gemini integration: no, yes").option("--copilot <value>", "GitHub Copilot subscription: no, yes").option("--opencode-zen <value>", "OpenCode Zen access: no, yes (default: no)").option("--zai-coding-plan <value>", "Z.ai Coding Plan subscription: no, yes (default: no)").option("--kimi-for-coding <value>", "Kimi For Coding subscription: no, yes (default: no)").option("--skip-auth", "Skip authentication setup hints").addHelpText("after", `
|
|
29641
|
+
program2.command("install").description("Install and configure oh-my-opencode with interactive setup").option("--no-tui", "Run in non-interactive mode (requires all options)").option("--claude <value>", "Claude subscription: no, yes, max20").option("--openai <value>", "OpenAI/ChatGPT subscription: no, yes (default: no)").option("--gemini <value>", "Gemini integration: no, yes").option("--copilot <value>", "GitHub Copilot subscription: no, yes").option("--opencode-zen <value>", "OpenCode Zen access: no, yes (default: no)").option("--zai-coding-plan <value>", "Z.ai Coding Plan subscription: no, yes (default: no)").option("--kimi-for-coding <value>", "Kimi For Coding subscription: no, yes (default: no)").option("--opencode-go <value>", "OpenCode Go subscription: no, yes (default: no)").option("--skip-auth", "Skip authentication setup hints").addHelpText("after", `
|
|
29419
29642
|
Examples:
|
|
29420
29643
|
$ bunx oh-my-opencode install
|
|
29421
29644
|
$ bunx oh-my-opencode install --no-tui --claude=max20 --openai=yes --gemini=yes --copilot=no
|
|
@@ -29439,12 +29662,13 @@ Model Providers (Priority: Native > Copilot > OpenCode Zen > Z.ai > Kimi):
|
|
|
29439
29662
|
opencodeZen: options.opencodeZen,
|
|
29440
29663
|
zaiCodingPlan: options.zaiCodingPlan,
|
|
29441
29664
|
kimiForCoding: options.kimiForCoding,
|
|
29665
|
+
opencodeGo: options.opencodeGo,
|
|
29442
29666
|
skipAuth: options.skipAuth ?? false
|
|
29443
29667
|
};
|
|
29444
29668
|
const exitCode = await install(args);
|
|
29445
29669
|
process.exit(exitCode);
|
|
29446
29670
|
});
|
|
29447
|
-
program2.command("run <message>").allowUnknownOption().passThroughOptions().description("Run opencode with todo/background task completion enforcement").option("-a, --agent <name>", "Agent to use (default: from CLI/env/config, fallback: Sisyphus)").option("-d, --directory <path>", "Working directory").option("-p, --port <port>", "Server port (attaches if port already in use)", parseInt).option("--attach <url>", "Attach to existing opencode server URL").option("--on-complete <command>", "Shell command to run after completion").option("--json", "Output structured JSON result to stdout").option("--no-timestamp", "Disable timestamp prefix in run output").option("--verbose", "Show full event stream (default: messages/tools only)").option("--session-id <id>", "Resume existing session instead of creating new one").addHelpText("after", `
|
|
29671
|
+
program2.command("run <message>").allowUnknownOption().passThroughOptions().description("Run opencode with todo/background task completion enforcement").option("-a, --agent <name>", "Agent to use (default: from CLI/env/config, fallback: Sisyphus)").option("-m, --model <provider/model>", "Model override (e.g., anthropic/claude-sonnet-4)").option("-d, --directory <path>", "Working directory").option("-p, --port <port>", "Server port (attaches if port already in use)", parseInt).option("--attach <url>", "Attach to existing opencode server URL").option("--on-complete <command>", "Shell command to run after completion").option("--json", "Output structured JSON result to stdout").option("--no-timestamp", "Disable timestamp prefix in run output").option("--verbose", "Show full event stream (default: messages/tools only)").option("--session-id <id>", "Resume existing session instead of creating new one").addHelpText("after", `
|
|
29448
29672
|
Examples:
|
|
29449
29673
|
$ bunx oh-my-opencode run "Fix the bug in index.ts"
|
|
29450
29674
|
$ bunx oh-my-opencode run --agent Sisyphus "Implement feature X"
|
|
@@ -29453,6 +29677,8 @@ Examples:
|
|
|
29453
29677
|
$ bunx oh-my-opencode run --json "Fix the bug" | jq .sessionId
|
|
29454
29678
|
$ bunx oh-my-opencode run --on-complete "notify-send Done" "Fix the bug"
|
|
29455
29679
|
$ bunx oh-my-opencode run --session-id ses_abc123 "Continue the work"
|
|
29680
|
+
$ bunx oh-my-opencode run --model anthropic/claude-sonnet-4 "Fix the bug"
|
|
29681
|
+
$ bunx oh-my-opencode run --agent Sisyphus --model openai/gpt-5.4 "Implement feature X"
|
|
29456
29682
|
|
|
29457
29683
|
Agent resolution order:
|
|
29458
29684
|
1) --agent flag
|
|
@@ -29474,6 +29700,7 @@ Unlike 'opencode run', this command waits until:
|
|
|
29474
29700
|
const runOptions = {
|
|
29475
29701
|
message,
|
|
29476
29702
|
agent: options.agent,
|
|
29703
|
+
model: options.model,
|
|
29477
29704
|
directory: options.directory,
|
|
29478
29705
|
port: options.port,
|
|
29479
29706
|
attach: options.attach,
|