oh-my-opencode 3.1.11 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/README.ja.md +20 -0
  2. package/README.ko.md +20 -0
  3. package/README.md +21 -1
  4. package/README.zh-cn.md +20 -0
  5. package/dist/agents/hephaestus.d.ts +6 -0
  6. package/dist/agents/index.d.ts +1 -0
  7. package/dist/agents/metis.d.ts +1 -1
  8. package/dist/agents/prometheus/behavioral-summary.d.ts +6 -0
  9. package/dist/agents/prometheus/high-accuracy-mode.d.ts +6 -0
  10. package/dist/agents/prometheus/identity-constraints.d.ts +7 -0
  11. package/dist/agents/prometheus/index.d.ts +39 -0
  12. package/dist/agents/prometheus/interview-mode.d.ts +7 -0
  13. package/dist/agents/prometheus/plan-generation.d.ts +7 -0
  14. package/dist/agents/prometheus/plan-template.d.ts +7 -0
  15. package/dist/agents/types.d.ts +1 -1
  16. package/dist/cli/doctor/checks/opencode.d.ts +5 -0
  17. package/dist/cli/index.js +165 -114
  18. package/dist/config/schema.d.ts +153 -0
  19. package/dist/features/background-agent/constants.d.ts +44 -0
  20. package/dist/features/background-agent/index.d.ts +2 -1
  21. package/dist/features/background-agent/result-handler.d.ts +15 -0
  22. package/dist/features/background-agent/spawner.d.ts +14 -0
  23. package/dist/features/background-agent/state.d.ts +35 -0
  24. package/dist/features/background-agent/types.d.ts +6 -0
  25. package/dist/features/builtin-skills/skills/dev-browser.d.ts +2 -0
  26. package/dist/features/builtin-skills/skills/frontend-ui-ux.d.ts +2 -0
  27. package/dist/features/builtin-skills/skills/git-master.d.ts +2 -0
  28. package/dist/features/builtin-skills/skills/index.d.ts +4 -0
  29. package/dist/features/builtin-skills/skills/playwright.d.ts +3 -0
  30. package/dist/features/skill-mcp-manager/manager.d.ts +2 -0
  31. package/dist/features/tmux-subagent/types.d.ts +2 -0
  32. package/dist/hooks/compaction-context-injector/index.d.ts +8 -0
  33. package/dist/hooks/compaction-context-injector/index.test.d.ts +1 -0
  34. package/dist/hooks/index.d.ts +2 -0
  35. package/dist/hooks/keyword-detector/analyze/default.d.ts +12 -0
  36. package/dist/hooks/keyword-detector/analyze/index.d.ts +1 -0
  37. package/dist/hooks/keyword-detector/constants.d.ts +7 -14
  38. package/dist/hooks/keyword-detector/detector.d.ts +2 -2
  39. package/dist/hooks/keyword-detector/search/default.d.ts +12 -0
  40. package/dist/hooks/keyword-detector/search/index.d.ts +1 -0
  41. package/dist/hooks/keyword-detector/ultrawork/default.d.ts +10 -0
  42. package/dist/hooks/keyword-detector/ultrawork/gpt5.2.d.ts +16 -0
  43. package/dist/hooks/keyword-detector/ultrawork/index.d.ts +17 -0
  44. package/dist/hooks/keyword-detector/ultrawork/planner.d.ts +6 -0
  45. package/dist/hooks/keyword-detector/ultrawork/utils.d.ts +24 -0
  46. package/dist/hooks/rules-injector/output-path.d.ts +5 -0
  47. package/dist/hooks/rules-injector/output-path.test.d.ts +1 -0
  48. package/dist/hooks/unstable-agent-babysitter/index.d.ts +50 -0
  49. package/dist/hooks/unstable-agent-babysitter/index.test.d.ts +1 -0
  50. package/dist/index.js +3681 -1955
  51. package/dist/shared/model-availability.d.ts +4 -0
  52. package/dist/shared/model-requirements.d.ts +1 -0
  53. package/dist/tools/background-task/constants.d.ts +1 -1
  54. package/dist/tools/background-task/index.d.ts +1 -0
  55. package/dist/tools/background-task/tools.d.ts +44 -4
  56. package/dist/tools/background-task/tools.test.d.ts +1 -0
  57. package/dist/tools/background-task/types.d.ts +6 -0
  58. package/dist/tools/delegate-task/categories.d.ts +17 -0
  59. package/dist/tools/delegate-task/executor.d.ts +75 -0
  60. package/dist/tools/delegate-task/helpers.d.ts +30 -0
  61. package/dist/tools/delegate-task/index.d.ts +2 -1
  62. package/dist/tools/delegate-task/prompt-builder.d.ts +6 -0
  63. package/dist/tools/delegate-task/tools.d.ts +5 -36
  64. package/dist/tools/delegate-task/types.d.ts +34 -0
  65. package/package.json +8 -8
  66. package/dist/agents/prometheus-prompt.d.ts +0 -29
package/dist/cli/index.js CHANGED
@@ -5965,9 +5965,15 @@ var init_model_requirements = __esm(() => {
5965
5965
  { providers: ["kimi-for-coding"], model: "k2p5" },
5966
5966
  { providers: ["opencode"], model: "kimi-k2.5-free" },
5967
5967
  { providers: ["zai-coding-plan"], model: "glm-4.7" },
5968
- { providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.2-codex", variant: "medium" },
5969
- { providers: ["google", "github-copilot", "opencode"], model: "gemini-3-pro" }
5970
- ]
5968
+ { providers: ["opencode"], model: "glm-4.7-free" }
5969
+ ],
5970
+ requiresAnyModel: true
5971
+ },
5972
+ hephaestus: {
5973
+ fallbackChain: [
5974
+ { providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.2-codex", variant: "medium" }
5975
+ ],
5976
+ requiresModel: "gpt-5.2-codex"
5971
5977
  },
5972
5978
  oracle: {
5973
5979
  fallbackChain: [
@@ -6353,7 +6359,7 @@ function isProviderAvailable(provider, avail) {
6353
6359
  }
6354
6360
  function transformModelForProvider(provider, model) {
6355
6361
  if (provider === "github-copilot") {
6356
- return model.replace("claude-opus-4-5", "claude-opus-4.5").replace("claude-sonnet-4-5", "claude-sonnet-4.5").replace("claude-haiku-4-5", "claude-haiku-4.5").replace("claude-sonnet-4", "claude-sonnet-4");
6362
+ return model.replace("claude-opus-4-5", "claude-opus-4.5").replace("claude-sonnet-4-5", "claude-sonnet-4.5").replace("claude-haiku-4-5", "claude-haiku-4.5").replace("claude-sonnet-4", "claude-sonnet-4").replace("gemini-3-pro", "gemini-3-pro-preview").replace("gemini-3-flash", "gemini-3-flash-preview");
6357
6363
  }
6358
6364
  return model;
6359
6365
  }
@@ -6371,17 +6377,17 @@ function resolveModelFromChain(fallbackChain, avail) {
6371
6377
  }
6372
6378
  return null;
6373
6379
  }
6374
- function getSisyphusFallbackChain(isMaxPlan) {
6375
- if (isMaxPlan) {
6376
- return AGENT_MODEL_REQUIREMENTS.sisyphus.fallbackChain;
6377
- }
6378
- return [
6379
- { providers: ["anthropic", "github-copilot", "opencode"], model: "claude-sonnet-4-5" },
6380
- { providers: ["kimi-for-coding"], model: "k2p5" },
6381
- { providers: ["opencode"], model: "kimi-k2.5-free" },
6382
- { providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.2", variant: "high" },
6383
- { providers: ["google", "github-copilot", "opencode"], model: "gemini-3-pro" }
6384
- ];
6380
+ function getSisyphusFallbackChain() {
6381
+ return AGENT_MODEL_REQUIREMENTS.sisyphus.fallbackChain;
6382
+ }
6383
+ function isAnyFallbackEntryAvailable(fallbackChain, avail) {
6384
+ return fallbackChain.some((entry) => entry.providers.some((provider) => isProviderAvailable(provider, avail)));
6385
+ }
6386
+ function isRequiredModelAvailable(requiresModel, fallbackChain, avail) {
6387
+ const matchingEntry = fallbackChain.find((entry) => entry.model === requiresModel);
6388
+ if (!matchingEntry)
6389
+ return false;
6390
+ return matchingEntry.providers.some((provider) => isProviderAvailable(provider, avail));
6385
6391
  }
6386
6392
  function generateModelConfig(config) {
6387
6393
  const avail = toProviderAvailability(config);
@@ -6389,7 +6395,7 @@ function generateModelConfig(config) {
6389
6395
  if (!hasAnyProvider) {
6390
6396
  return {
6391
6397
  $schema: SCHEMA_URL,
6392
- agents: Object.fromEntries(Object.keys(AGENT_MODEL_REQUIREMENTS).map((role) => [role, { model: ULTIMATE_FALLBACK }])),
6398
+ agents: Object.fromEntries(Object.entries(AGENT_MODEL_REQUIREMENTS).filter(([role, req]) => !(role === "sisyphus" && req.requiresAnyModel)).map(([role]) => [role, { model: ULTIMATE_FALLBACK }])),
6393
6399
  categories: Object.fromEntries(Object.keys(CATEGORY_MODEL_REQUIREMENTS).map((cat) => [cat, { model: ULTIMATE_FALLBACK }]))
6394
6400
  };
6395
6401
  }
@@ -6412,8 +6418,22 @@ function generateModelConfig(config) {
6412
6418
  }
6413
6419
  continue;
6414
6420
  }
6415
- const fallbackChain = role === "sisyphus" ? getSisyphusFallbackChain(avail.isMaxPlan) : req.fallbackChain;
6416
- const resolved = resolveModelFromChain(fallbackChain, avail);
6421
+ if (role === "sisyphus") {
6422
+ const fallbackChain = getSisyphusFallbackChain();
6423
+ if (req.requiresAnyModel && !isAnyFallbackEntryAvailable(fallbackChain, avail)) {
6424
+ continue;
6425
+ }
6426
+ const resolved2 = resolveModelFromChain(fallbackChain, avail);
6427
+ if (resolved2) {
6428
+ const variant = resolved2.variant ?? req.variant;
6429
+ agents[role] = variant ? { model: resolved2.model, variant } : { model: resolved2.model };
6430
+ }
6431
+ continue;
6432
+ }
6433
+ if (req.requiresModel && !isRequiredModelAvailable(req.requiresModel, req.fallbackChain, avail)) {
6434
+ continue;
6435
+ }
6436
+ const resolved = resolveModelFromChain(req.fallbackChain, avail);
6417
6437
  if (resolved) {
6418
6438
  const variant = resolved.variant ?? req.variant;
6419
6439
  agents[role] = variant ? { model: resolved.model, variant } : { model: resolved.model };
@@ -6423,6 +6443,9 @@ function generateModelConfig(config) {
6423
6443
  }
6424
6444
  for (const [cat, req] of Object.entries(CATEGORY_MODEL_REQUIREMENTS)) {
6425
6445
  const fallbackChain = cat === "unspecified-high" && !avail.isMaxPlan ? CATEGORY_MODEL_REQUIREMENTS["unspecified-low"].fallbackChain : req.fallbackChain;
6446
+ if (req.requiresModel && !isRequiredModelAvailable(req.requiresModel, req.fallbackChain, avail)) {
6447
+ continue;
6448
+ }
6426
6449
  const resolved = resolveModelFromChain(fallbackChain, avail);
6427
6450
  if (resolved) {
6428
6451
  const variant = resolved.variant ?? req.variant;
@@ -8137,7 +8160,7 @@ var import_picocolors2 = __toESM(require_picocolors(), 1);
8137
8160
  // package.json
8138
8161
  var package_default = {
8139
8162
  name: "oh-my-opencode",
8140
- version: "3.1.11",
8163
+ version: "3.2.1",
8141
8164
  description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
8142
8165
  main: "dist/index.js",
8143
8166
  types: "dist/index.d.ts",
@@ -8211,13 +8234,13 @@ var package_default = {
8211
8234
  typescript: "^5.7.3"
8212
8235
  },
8213
8236
  optionalDependencies: {
8214
- "oh-my-opencode-darwin-arm64": "3.1.11",
8215
- "oh-my-opencode-darwin-x64": "3.1.11",
8216
- "oh-my-opencode-linux-arm64": "3.1.11",
8217
- "oh-my-opencode-linux-arm64-musl": "3.1.11",
8218
- "oh-my-opencode-linux-x64": "3.1.11",
8219
- "oh-my-opencode-linux-x64-musl": "3.1.11",
8220
- "oh-my-opencode-windows-x64": "3.1.11"
8237
+ "oh-my-opencode-darwin-arm64": "3.2.1",
8238
+ "oh-my-opencode-darwin-x64": "3.2.1",
8239
+ "oh-my-opencode-linux-arm64": "3.2.1",
8240
+ "oh-my-opencode-linux-arm64-musl": "3.2.1",
8241
+ "oh-my-opencode-linux-x64": "3.2.1",
8242
+ "oh-my-opencode-linux-x64-musl": "3.2.1",
8243
+ "oh-my-opencode-windows-x64": "3.2.1"
8221
8244
  },
8222
8245
  trustedDependencies: [
8223
8246
  "@ast-grep/cli",
@@ -10689,6 +10712,11 @@ async function getLocalVersion(options = {}) {
10689
10712
  }
10690
10713
  }
10691
10714
 
10715
+ // src/cli/doctor/checks/opencode.ts
10716
+ import { existsSync as existsSync8 } from "fs";
10717
+ import { homedir as homedir5 } from "os";
10718
+ import { join as join10 } from "path";
10719
+
10692
10720
  // src/cli/doctor/constants.ts
10693
10721
  var import_picocolors7 = __toESM(require_picocolors(), 1);
10694
10722
  var SYMBOLS3 = {
@@ -10759,25 +10787,36 @@ var PACKAGE_NAME3 = "oh-my-opencode";
10759
10787
  var OPENCODE_BINARIES2 = ["opencode", "opencode-desktop"];
10760
10788
 
10761
10789
  // src/cli/doctor/checks/opencode.ts
10762
- var WINDOWS_EXECUTABLE_EXTS = [".exe", ".cmd", ".bat", ".ps1"];
10763
- function getBinaryLookupCommand(platform) {
10764
- return platform === "win32" ? "where" : "which";
10765
- }
10766
- function parseBinaryPaths(output) {
10767
- return output.split(/\r?\n/).map((line) => line.trim()).filter((line) => line.length > 0);
10768
- }
10769
- function selectBinaryPath(paths, platform) {
10770
- if (paths.length === 0)
10771
- return null;
10772
- if (platform !== "win32")
10773
- return paths[0];
10774
- const normalized = paths.map((path6) => path6.toLowerCase());
10775
- for (const ext of WINDOWS_EXECUTABLE_EXTS) {
10776
- const index = normalized.findIndex((path6) => path6.endsWith(ext));
10777
- if (index !== -1)
10778
- return paths[index];
10790
+ function getDesktopAppPaths(platform) {
10791
+ const home = homedir5();
10792
+ switch (platform) {
10793
+ case "darwin":
10794
+ return [
10795
+ "/Applications/OpenCode.app/Contents/MacOS/OpenCode",
10796
+ join10(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
10797
+ ];
10798
+ case "win32": {
10799
+ const programFiles = process.env.ProgramFiles;
10800
+ const localAppData = process.env.LOCALAPPDATA;
10801
+ const paths = [];
10802
+ if (programFiles) {
10803
+ paths.push(join10(programFiles, "OpenCode", "OpenCode.exe"));
10804
+ }
10805
+ if (localAppData) {
10806
+ paths.push(join10(localAppData, "OpenCode", "OpenCode.exe"));
10807
+ }
10808
+ return paths;
10809
+ }
10810
+ case "linux":
10811
+ return [
10812
+ "/usr/bin/opencode",
10813
+ "/usr/lib/opencode/opencode",
10814
+ join10(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
10815
+ join10(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
10816
+ ];
10817
+ default:
10818
+ return [];
10779
10819
  }
10780
- return paths[0];
10781
10820
  }
10782
10821
  function buildVersionCommand(binaryPath, platform) {
10783
10822
  if (platform === "win32" && binaryPath.toLowerCase().endsWith(".ps1")) {
@@ -10793,24 +10832,30 @@ function buildVersionCommand(binaryPath, platform) {
10793
10832
  }
10794
10833
  return [binaryPath, "--version"];
10795
10834
  }
10835
+ function findDesktopBinary(platform = process.platform, checkExists = existsSync8) {
10836
+ const desktopPaths = getDesktopAppPaths(platform);
10837
+ for (const desktopPath of desktopPaths) {
10838
+ if (checkExists(desktopPath)) {
10839
+ return { binary: "opencode", path: desktopPath };
10840
+ }
10841
+ }
10842
+ return null;
10843
+ }
10796
10844
  async function findOpenCodeBinary() {
10797
10845
  for (const binary2 of OPENCODE_BINARIES2) {
10798
10846
  try {
10799
- const lookupCommand = getBinaryLookupCommand(process.platform);
10800
- const proc = Bun.spawn([lookupCommand, binary2], { stdout: "pipe", stderr: "pipe" });
10801
- const output = await new Response(proc.stdout).text();
10802
- await proc.exited;
10803
- if (proc.exitCode === 0) {
10804
- const paths = parseBinaryPaths(output);
10805
- const selectedPath = selectBinaryPath(paths, process.platform);
10806
- if (selectedPath) {
10807
- return { binary: binary2, path: selectedPath };
10808
- }
10847
+ const path6 = Bun.which(binary2);
10848
+ if (path6) {
10849
+ return { binary: binary2, path: path6 };
10809
10850
  }
10810
10851
  } catch {
10811
10852
  continue;
10812
10853
  }
10813
10854
  }
10855
+ const desktopResult = findDesktopBinary();
10856
+ if (desktopResult) {
10857
+ return desktopResult;
10858
+ }
10814
10859
  return null;
10815
10860
  }
10816
10861
  async function getOpenCodeVersion2(binaryPath, platform = process.platform) {
@@ -10905,14 +10950,14 @@ function getOpenCodeCheckDefinition() {
10905
10950
  }
10906
10951
 
10907
10952
  // src/cli/doctor/checks/plugin.ts
10908
- import { existsSync as existsSync8, readFileSync as readFileSync7 } from "fs";
10953
+ import { existsSync as existsSync9, readFileSync as readFileSync7 } from "fs";
10909
10954
  init_shared();
10910
10955
  function detectConfigPath() {
10911
10956
  const paths = getOpenCodeConfigPaths({ binary: "opencode", version: null });
10912
- if (existsSync8(paths.configJsonc)) {
10957
+ if (existsSync9(paths.configJsonc)) {
10913
10958
  return { path: paths.configJsonc, format: "jsonc" };
10914
10959
  }
10915
- if (existsSync8(paths.configJson)) {
10960
+ if (existsSync9(paths.configJson)) {
10916
10961
  return { path: paths.configJson, format: "json" };
10917
10962
  }
10918
10963
  return null;
@@ -11016,8 +11061,8 @@ function getPluginCheckDefinition() {
11016
11061
  }
11017
11062
 
11018
11063
  // src/cli/doctor/checks/config.ts
11019
- import { existsSync as existsSync9, readFileSync as readFileSync8 } from "fs";
11020
- import { join as join10 } from "path";
11064
+ import { existsSync as existsSync10, readFileSync as readFileSync8 } from "fs";
11065
+ import { join as join11 } from "path";
11021
11066
  init_shared();
11022
11067
 
11023
11068
  // node_modules/zod/v4/classic/external.js
@@ -24571,6 +24616,7 @@ var AgentPermissionSchema = exports_external.object({
24571
24616
  });
24572
24617
  var BuiltinAgentNameSchema = exports_external.enum([
24573
24618
  "sisyphus",
24619
+ "hephaestus",
24574
24620
  "prometheus",
24575
24621
  "oracle",
24576
24622
  "librarian",
@@ -24590,6 +24636,7 @@ var OverridableAgentNameSchema = exports_external.enum([
24590
24636
  "build",
24591
24637
  "plan",
24592
24638
  "sisyphus",
24639
+ "hephaestus",
24593
24640
  "sisyphus-junior",
24594
24641
  "OpenCode-Builder",
24595
24642
  "prometheus",
@@ -24634,6 +24681,7 @@ var HookNameSchema = exports_external.enum([
24634
24681
  "sisyphus-junior-notepad",
24635
24682
  "start-work",
24636
24683
  "atlas",
24684
+ "unstable-agent-babysitter",
24637
24685
  "stop-continuation-guard"
24638
24686
  ]);
24639
24687
  var BuiltinCommandNameSchema = exports_external.enum([
@@ -24668,6 +24716,7 @@ var AgentOverridesSchema = exports_external.object({
24668
24716
  build: AgentOverrideConfigSchema.optional(),
24669
24717
  plan: AgentOverrideConfigSchema.optional(),
24670
24718
  sisyphus: AgentOverrideConfigSchema.optional(),
24719
+ hephaestus: AgentOverrideConfigSchema.optional(),
24671
24720
  "sisyphus-junior": AgentOverrideConfigSchema.optional(),
24672
24721
  "OpenCode-Builder": AgentOverrideConfigSchema.optional(),
24673
24722
  prometheus: AgentOverrideConfigSchema.optional(),
@@ -24809,6 +24858,9 @@ var BackgroundTaskConfigSchema = exports_external.object({
24809
24858
  var NotificationConfigSchema = exports_external.object({
24810
24859
  force_enable: exports_external.boolean().optional()
24811
24860
  });
24861
+ var BabysittingConfigSchema = exports_external.object({
24862
+ timeout_ms: exports_external.number().default(120000)
24863
+ });
24812
24864
  var GitMasterConfigSchema = exports_external.object({
24813
24865
  commit_footer: exports_external.boolean().default(true),
24814
24866
  include_co_authored_by: exports_external.boolean().default(true)
@@ -24863,6 +24915,7 @@ var OhMyOpenCodeConfigSchema = exports_external.object({
24863
24915
  ralph_loop: RalphLoopConfigSchema.optional(),
24864
24916
  background_task: BackgroundTaskConfigSchema.optional(),
24865
24917
  notification: NotificationConfigSchema.optional(),
24918
+ babysitting: BabysittingConfigSchema.optional(),
24866
24919
  git_master: GitMasterConfigSchema.optional(),
24867
24920
  browser_automation_engine: BrowserAutomationConfigSchema.optional(),
24868
24921
  tmux: TmuxConfigSchema.optional(),
@@ -24870,8 +24923,8 @@ var OhMyOpenCodeConfigSchema = exports_external.object({
24870
24923
  });
24871
24924
  // src/cli/doctor/checks/config.ts
24872
24925
  var USER_CONFIG_DIR2 = getOpenCodeConfigDir({ binary: "opencode" });
24873
- var USER_CONFIG_BASE = join10(USER_CONFIG_DIR2, `${PACKAGE_NAME3}`);
24874
- var PROJECT_CONFIG_BASE = join10(process.cwd(), ".opencode", PACKAGE_NAME3);
24926
+ var USER_CONFIG_BASE = join11(USER_CONFIG_DIR2, `${PACKAGE_NAME3}`);
24927
+ var PROJECT_CONFIG_BASE = join11(process.cwd(), ".opencode", PACKAGE_NAME3);
24875
24928
  function findConfigPath() {
24876
24929
  const projectDetected = detectConfigFile(PROJECT_CONFIG_BASE);
24877
24930
  if (projectDetected.format !== "none") {
@@ -24911,7 +24964,7 @@ function getConfigInfo() {
24911
24964
  errors: []
24912
24965
  };
24913
24966
  }
24914
- if (!existsSync9(configPath.path)) {
24967
+ if (!existsSync10(configPath.path)) {
24915
24968
  return {
24916
24969
  exists: false,
24917
24970
  path: configPath.path,
@@ -24968,20 +25021,20 @@ function getConfigCheckDefinition() {
24968
25021
  }
24969
25022
 
24970
25023
  // src/cli/doctor/checks/model-resolution.ts
24971
- import { readFileSync as readFileSync9, existsSync as existsSync10 } from "fs";
25024
+ import { readFileSync as readFileSync9, existsSync as existsSync11 } from "fs";
24972
25025
  init_shared();
24973
25026
  init_model_requirements();
24974
- import { homedir as homedir5 } from "os";
24975
- import { join as join11 } from "path";
25027
+ import { homedir as homedir6 } from "os";
25028
+ import { join as join12 } from "path";
24976
25029
  function getOpenCodeCacheDir2() {
24977
25030
  const xdgCache = process.env.XDG_CACHE_HOME;
24978
25031
  if (xdgCache)
24979
- return join11(xdgCache, "opencode");
24980
- return join11(homedir5(), ".cache", "opencode");
25032
+ return join12(xdgCache, "opencode");
25033
+ return join12(homedir6(), ".cache", "opencode");
24981
25034
  }
24982
25035
  function loadAvailableModels() {
24983
- const cacheFile = join11(getOpenCodeCacheDir2(), "models.json");
24984
- if (!existsSync10(cacheFile)) {
25036
+ const cacheFile = join12(getOpenCodeCacheDir2(), "models.json");
25037
+ if (!existsSync11(cacheFile)) {
24985
25038
  return { providers: [], modelCount: 0, cacheExists: false };
24986
25039
  }
24987
25040
  try {
@@ -25001,9 +25054,9 @@ function loadAvailableModels() {
25001
25054
  }
25002
25055
  }
25003
25056
  var PACKAGE_NAME4 = "oh-my-opencode";
25004
- var USER_CONFIG_DIR3 = join11(homedir5(), ".config", "opencode");
25005
- var USER_CONFIG_BASE2 = join11(USER_CONFIG_DIR3, PACKAGE_NAME4);
25006
- var PROJECT_CONFIG_BASE2 = join11(process.cwd(), ".opencode", PACKAGE_NAME4);
25057
+ var USER_CONFIG_DIR3 = join12(homedir6(), ".config", "opencode");
25058
+ var USER_CONFIG_BASE2 = join12(USER_CONFIG_DIR3, PACKAGE_NAME4);
25059
+ var PROJECT_CONFIG_BASE2 = join12(process.cwd(), ".opencode", PACKAGE_NAME4);
25007
25060
  function loadConfig() {
25008
25061
  const projectDetected = detectConfigFile(PROJECT_CONFIG_BASE2);
25009
25062
  if (projectDetected.format !== "none") {
@@ -25141,20 +25194,20 @@ function getModelResolutionCheckDefinition() {
25141
25194
  }
25142
25195
 
25143
25196
  // src/cli/doctor/checks/auth.ts
25144
- import { existsSync as existsSync11, readFileSync as readFileSync10 } from "fs";
25145
- import { join as join12 } from "path";
25197
+ import { existsSync as existsSync12, readFileSync as readFileSync10 } from "fs";
25198
+ import { join as join13 } from "path";
25146
25199
  init_shared();
25147
25200
  var OPENCODE_CONFIG_DIR = getOpenCodeConfigDir({ binary: "opencode" });
25148
- var OPENCODE_JSON = join12(OPENCODE_CONFIG_DIR, "opencode.json");
25149
- var OPENCODE_JSONC = join12(OPENCODE_CONFIG_DIR, "opencode.jsonc");
25201
+ var OPENCODE_JSON = join13(OPENCODE_CONFIG_DIR, "opencode.json");
25202
+ var OPENCODE_JSONC = join13(OPENCODE_CONFIG_DIR, "opencode.jsonc");
25150
25203
  var AUTH_PLUGINS = {
25151
25204
  anthropic: { plugin: "builtin", name: "Anthropic (Claude)" },
25152
25205
  openai: { plugin: "opencode-openai-codex-auth", name: "OpenAI (ChatGPT)" },
25153
25206
  google: { plugin: "opencode-antigravity-auth", name: "Google (Gemini)" }
25154
25207
  };
25155
25208
  function getOpenCodeConfig() {
25156
- const configPath = existsSync11(OPENCODE_JSONC) ? OPENCODE_JSONC : OPENCODE_JSON;
25157
- if (!existsSync11(configPath))
25209
+ const configPath = existsSync12(OPENCODE_JSONC) ? OPENCODE_JSONC : OPENCODE_JSON;
25210
+ if (!existsSync12(configPath))
25158
25211
  return null;
25159
25212
  try {
25160
25213
  const content = readFileSync10(configPath, "utf-8");
@@ -25242,11 +25295,9 @@ function getAuthCheckDefinitions() {
25242
25295
  // src/cli/doctor/checks/dependencies.ts
25243
25296
  async function checkBinaryExists(binary2) {
25244
25297
  try {
25245
- const proc = Bun.spawn(["which", binary2], { stdout: "pipe", stderr: "pipe" });
25246
- const output = await new Response(proc.stdout).text();
25247
- await proc.exited;
25248
- if (proc.exitCode === 0) {
25249
- return { exists: true, path: output.trim() };
25298
+ const path6 = Bun.which(binary2);
25299
+ if (path6) {
25300
+ return { exists: true, path: path6 };
25250
25301
  }
25251
25302
  } catch {}
25252
25303
  return { exists: false, path: null };
@@ -25297,15 +25348,15 @@ async function checkAstGrepNapi() {
25297
25348
  path: null
25298
25349
  };
25299
25350
  } catch {
25300
- const { existsSync: existsSync12 } = await import("fs");
25301
- const { join: join13 } = await import("path");
25302
- const { homedir: homedir6 } = await import("os");
25351
+ const { existsSync: existsSync13 } = await import("fs");
25352
+ const { join: join14 } = await import("path");
25353
+ const { homedir: homedir7 } = await import("os");
25303
25354
  const pathsToCheck = [
25304
- join13(homedir6(), ".config", "opencode", "node_modules", "@ast-grep", "napi"),
25305
- join13(process.cwd(), "node_modules", "@ast-grep", "napi")
25355
+ join14(homedir7(), ".config", "opencode", "node_modules", "@ast-grep", "napi"),
25356
+ join14(process.cwd(), "node_modules", "@ast-grep", "napi")
25306
25357
  ];
25307
25358
  for (const napiPath of pathsToCheck) {
25308
- if (existsSync12(napiPath)) {
25359
+ if (existsSync13(napiPath)) {
25309
25360
  return {
25310
25361
  name: "AST-Grep NAPI",
25311
25362
  required: false,
@@ -25534,15 +25585,15 @@ function getGhCliCheckDefinition() {
25534
25585
  }
25535
25586
 
25536
25587
  // src/tools/lsp/config.ts
25537
- import { existsSync as existsSync12, readFileSync as readFileSync11 } from "fs";
25538
- import { join as join13 } from "path";
25588
+ import { existsSync as existsSync13, readFileSync as readFileSync11 } from "fs";
25589
+ import { join as join14 } from "path";
25539
25590
  init_shared();
25540
25591
  function isServerInstalled(command) {
25541
25592
  if (command.length === 0)
25542
25593
  return false;
25543
25594
  const cmd = command[0];
25544
25595
  if (cmd.includes("/") || cmd.includes("\\")) {
25545
- if (existsSync12(cmd))
25596
+ if (existsSync13(cmd))
25546
25597
  return true;
25547
25598
  }
25548
25599
  const isWindows = process.platform === "win32";
@@ -25564,23 +25615,23 @@ function isServerInstalled(command) {
25564
25615
  const paths = pathEnv.split(pathSeparator);
25565
25616
  for (const p2 of paths) {
25566
25617
  for (const suffix of exts) {
25567
- if (existsSync12(join13(p2, cmd + suffix))) {
25618
+ if (existsSync13(join14(p2, cmd + suffix))) {
25568
25619
  return true;
25569
25620
  }
25570
25621
  }
25571
25622
  }
25572
25623
  const cwd = process.cwd();
25573
25624
  const configDir = getOpenCodeConfigDir({ binary: "opencode" });
25574
- const dataDir = join13(getDataDir(), "opencode");
25625
+ const dataDir = join14(getDataDir(), "opencode");
25575
25626
  const additionalBases = [
25576
- join13(cwd, "node_modules", ".bin"),
25577
- join13(configDir, "bin"),
25578
- join13(configDir, "node_modules", ".bin"),
25579
- join13(dataDir, "bin")
25627
+ join14(cwd, "node_modules", ".bin"),
25628
+ join14(configDir, "bin"),
25629
+ join14(configDir, "node_modules", ".bin"),
25630
+ join14(dataDir, "bin")
25580
25631
  ];
25581
25632
  for (const base of additionalBases) {
25582
25633
  for (const suffix of exts) {
25583
- if (existsSync12(join13(base, cmd + suffix))) {
25634
+ if (existsSync13(join14(base, cmd + suffix))) {
25584
25635
  return true;
25585
25636
  }
25586
25637
  }
@@ -25653,20 +25704,20 @@ function getLspCheckDefinition() {
25653
25704
  }
25654
25705
 
25655
25706
  // src/cli/doctor/checks/mcp.ts
25656
- import { existsSync as existsSync13, readFileSync as readFileSync12 } from "fs";
25657
- import { homedir as homedir6 } from "os";
25658
- import { join as join14 } from "path";
25707
+ import { existsSync as existsSync14, readFileSync as readFileSync12 } from "fs";
25708
+ import { homedir as homedir7 } from "os";
25709
+ import { join as join15 } from "path";
25659
25710
  init_shared();
25660
25711
  var BUILTIN_MCP_SERVERS = ["context7", "grep_app"];
25661
25712
  var MCP_CONFIG_PATHS = [
25662
- join14(homedir6(), ".claude", ".mcp.json"),
25663
- join14(process.cwd(), ".mcp.json"),
25664
- join14(process.cwd(), ".claude", ".mcp.json")
25713
+ join15(homedir7(), ".claude", ".mcp.json"),
25714
+ join15(process.cwd(), ".mcp.json"),
25715
+ join15(process.cwd(), ".claude", ".mcp.json")
25665
25716
  ];
25666
25717
  function loadUserMcpConfig() {
25667
25718
  const servers = {};
25668
25719
  for (const configPath of MCP_CONFIG_PATHS) {
25669
- if (!existsSync13(configPath))
25720
+ if (!existsSync14(configPath))
25670
25721
  continue;
25671
25722
  try {
25672
25723
  const content = readFileSync12(configPath, "utf-8");
@@ -25760,11 +25811,11 @@ function getMcpCheckDefinitions() {
25760
25811
 
25761
25812
  // src/features/mcp-oauth/storage.ts
25762
25813
  init_shared();
25763
- import { chmodSync, existsSync as existsSync14, mkdirSync as mkdirSync3, readFileSync as readFileSync13, unlinkSync, writeFileSync as writeFileSync5 } from "fs";
25764
- import { dirname as dirname2, join as join15 } from "path";
25814
+ import { chmodSync, existsSync as existsSync15, mkdirSync as mkdirSync3, readFileSync as readFileSync13, unlinkSync, writeFileSync as writeFileSync5 } from "fs";
25815
+ import { dirname as dirname2, join as join16 } from "path";
25765
25816
  var STORAGE_FILE_NAME = "mcp-oauth.json";
25766
25817
  function getMcpOauthStoragePath() {
25767
- return join15(getOpenCodeConfigDir({ binary: "opencode" }), STORAGE_FILE_NAME);
25818
+ return join16(getOpenCodeConfigDir({ binary: "opencode" }), STORAGE_FILE_NAME);
25768
25819
  }
25769
25820
  function normalizeHost(serverHost) {
25770
25821
  let host = serverHost.trim();
@@ -25801,7 +25852,7 @@ function buildKey(serverHost, resource) {
25801
25852
  }
25802
25853
  function readStore() {
25803
25854
  const filePath = getMcpOauthStoragePath();
25804
- if (!existsSync14(filePath)) {
25855
+ if (!existsSync15(filePath)) {
25805
25856
  return null;
25806
25857
  }
25807
25858
  try {
@@ -25815,7 +25866,7 @@ function writeStore(store) {
25815
25866
  const filePath = getMcpOauthStoragePath();
25816
25867
  try {
25817
25868
  const dir = dirname2(filePath);
25818
- if (!existsSync14(dir)) {
25869
+ if (!existsSync15(dir)) {
25819
25870
  mkdirSync3(dir, { recursive: true });
25820
25871
  }
25821
25872
  writeFileSync5(filePath, JSON.stringify(store, null, 2), { encoding: "utf-8", mode: 384 });
@@ -25850,7 +25901,7 @@ function deleteToken(serverHost, resource) {
25850
25901
  if (Object.keys(store).length === 0) {
25851
25902
  try {
25852
25903
  const filePath = getMcpOauthStoragePath();
25853
- if (existsSync14(filePath)) {
25904
+ if (existsSync15(filePath)) {
25854
25905
  unlinkSync(filePath);
25855
25906
  }
25856
25907
  return true;
@@ -25879,10 +25930,10 @@ function listAllTokens() {
25879
25930
  }
25880
25931
 
25881
25932
  // src/cli/doctor/checks/mcp-oauth.ts
25882
- import { existsSync as existsSync15, readFileSync as readFileSync14 } from "fs";
25933
+ import { existsSync as existsSync16, readFileSync as readFileSync14 } from "fs";
25883
25934
  function readTokenStore() {
25884
25935
  const filePath = getMcpOauthStoragePath();
25885
- if (!existsSync15(filePath)) {
25936
+ if (!existsSync16(filePath)) {
25886
25937
  return null;
25887
25938
  }
25888
25939
  try {