oh-my-opencode 3.17.14 → 4.0.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.
Files changed (162) hide show
  1. package/README.ja.md +153 -113
  2. package/README.ko.md +196 -149
  3. package/README.md +53 -50
  4. package/README.ru.md +92 -70
  5. package/README.zh-cn.md +112 -71
  6. package/dist/agents/agent-skill-resolution.d.ts +1 -0
  7. package/dist/agents/builtin-agents/available-skills.d.ts +1 -1
  8. package/dist/agents/builtin-agents/general-agents.d.ts +1 -0
  9. package/dist/agents/builtin-agents.d.ts +1 -1
  10. package/dist/agents/dynamic-agent-core-sections.d.ts +1 -0
  11. package/dist/agents/dynamic-agent-prompt-builder.d.ts +1 -1
  12. package/dist/agents/hephaestus/gpt-5-5.d.ts +0 -4
  13. package/dist/agents/types.d.ts +1 -0
  14. package/dist/cli/doctor/checks/team-mode.d.ts +2 -0
  15. package/dist/cli/doctor/constants.d.ts +1 -0
  16. package/dist/cli/index.js +681 -317
  17. package/dist/config/index.d.ts +1 -1
  18. package/dist/config/schema/agent-names.d.ts +1 -0
  19. package/dist/config/schema/agent-overrides.d.ts +45 -0
  20. package/dist/config/schema/categories.d.ts +7 -1
  21. package/dist/config/schema/commands.d.ts +1 -0
  22. package/dist/config/schema/fallback-models.d.ts +5 -0
  23. package/dist/config/schema/hooks.d.ts +1 -0
  24. package/dist/config/schema/keyword-detector.d.ts +21 -0
  25. package/dist/config/schema/oh-my-opencode-config.d.ts +70 -0
  26. package/dist/config/schema/team-mode.d.ts +16 -0
  27. package/dist/config/schema.d.ts +2 -0
  28. package/dist/create-hooks.d.ts +3 -0
  29. package/dist/features/background-agent/manager.d.ts +3 -0
  30. package/dist/features/background-agent/types.d.ts +4 -0
  31. package/dist/features/boulder-state/storage.d.ts +1 -0
  32. package/dist/features/builtin-commands/commands.d.ts +1 -0
  33. package/dist/features/builtin-commands/templates/hyperplan.d.ts +1 -0
  34. package/dist/features/builtin-commands/templates/refactor.d.ts +1 -0
  35. package/dist/features/builtin-commands/templates/remove-ai-slops.d.ts +1 -0
  36. package/dist/features/builtin-commands/types.d.ts +1 -1
  37. package/dist/features/builtin-skills/skills/git-master-sections/commit-workflow.d.ts +1 -1
  38. package/dist/features/builtin-skills/skills/git-master-sections/history-search-workflow.d.ts +1 -1
  39. package/dist/features/builtin-skills/skills/git-master-sections/overview.d.ts +1 -1
  40. package/dist/features/builtin-skills/skills/git-master-sections/quick-reference.d.ts +1 -1
  41. package/dist/features/builtin-skills/skills/git-master-sections/rebase-workflow.d.ts +1 -1
  42. package/dist/features/builtin-skills/skills/index.d.ts +1 -0
  43. package/dist/features/builtin-skills/skills/team-mode.d.ts +2 -0
  44. package/dist/features/builtin-skills/skills.d.ts +1 -0
  45. package/dist/features/claude-code-plugin-loader/discovery.d.ts +1 -0
  46. package/dist/features/hook-message-injector/injector.d.ts +2 -2
  47. package/dist/features/opencode-skill-loader/loader.d.ts +2 -2
  48. package/dist/features/opencode-skill-loader/skill-resolution-options.d.ts +1 -0
  49. package/dist/features/team-mode/deps.d.ts +6 -0
  50. package/dist/features/team-mode/member-guidance.d.ts +2 -0
  51. package/dist/features/team-mode/member-parser.d.ts +16 -0
  52. package/dist/features/team-mode/member-session-resolution.d.ts +6 -0
  53. package/dist/features/team-mode/member-session-routing.d.ts +19 -0
  54. package/dist/features/team-mode/team-layout-tmux/close-team-member-pane.d.ts +4 -0
  55. package/dist/features/team-mode/team-layout-tmux/layout.d.ts +26 -6
  56. package/dist/features/team-mode/team-layout-tmux/rebalance-team-window.d.ts +9 -0
  57. package/dist/features/team-mode/team-layout-tmux/resolve-caller-tmux-session.d.ts +7 -0
  58. package/dist/features/team-mode/team-layout-tmux/sweep-stale-team-sessions.d.ts +8 -0
  59. package/dist/features/team-mode/team-mailbox/ack.d.ts +2 -0
  60. package/dist/features/team-mode/team-mailbox/inbox.d.ts +3 -0
  61. package/dist/features/team-mode/team-mailbox/index.d.ts +7 -0
  62. package/dist/features/team-mode/team-mailbox/poll.d.ts +10 -0
  63. package/dist/features/team-mode/team-mailbox/reservation.d.ts +11 -0
  64. package/dist/features/team-mode/team-mailbox/send.d.ts +27 -0
  65. package/dist/features/team-mode/team-registry/index.d.ts +3 -0
  66. package/dist/features/team-mode/team-registry/loader.d.ts +12 -0
  67. package/dist/features/team-mode/team-registry/paths.d.ts +13 -0
  68. package/dist/features/team-mode/team-registry/team-spec-input-normalizer.d.ts +6 -0
  69. package/dist/features/team-mode/team-registry/validator.d.ts +10 -0
  70. package/dist/features/team-mode/team-runtime/activate-team-layout.d.ts +4 -0
  71. package/dist/features/team-mode/team-runtime/cleanup-team-run-resources.d.ts +17 -0
  72. package/dist/features/team-mode/team-runtime/create.d.ts +25 -0
  73. package/dist/features/team-mode/team-runtime/delete-team.d.ts +16 -0
  74. package/dist/features/team-mode/team-runtime/index.d.ts +2 -0
  75. package/dist/features/team-mode/team-runtime/resolve-member-dependencies.d.ts +3 -0
  76. package/dist/features/team-mode/team-runtime/resolve-member.d.ts +17 -0
  77. package/dist/features/team-mode/team-runtime/shutdown-helpers.d.ts +11 -0
  78. package/dist/features/team-mode/team-runtime/shutdown-test-fixtures.d.ts +46 -0
  79. package/dist/features/team-mode/team-runtime/shutdown.d.ts +5 -0
  80. package/dist/features/team-mode/team-runtime/status.d.ts +36 -0
  81. package/dist/features/team-mode/team-session-registry.d.ts +11 -0
  82. package/dist/features/team-mode/team-state-store/index.d.ts +1 -0
  83. package/dist/features/team-mode/team-state-store/locks.d.ts +12 -0
  84. package/dist/features/team-mode/team-state-store/resume.d.ts +10 -0
  85. package/dist/features/team-mode/team-state-store/store.d.ts +21 -0
  86. package/dist/features/team-mode/team-tasklist/claim.d.ts +10 -0
  87. package/dist/features/team-mode/team-tasklist/dependencies.d.ts +2 -0
  88. package/dist/features/team-mode/team-tasklist/get.d.ts +3 -0
  89. package/dist/features/team-mode/team-tasklist/index.d.ts +6 -0
  90. package/dist/features/team-mode/team-tasklist/list.d.ts +8 -0
  91. package/dist/features/team-mode/team-tasklist/store.d.ts +3 -0
  92. package/dist/features/team-mode/team-tasklist/test-support.d.ts +9 -0
  93. package/dist/features/team-mode/team-tasklist/update.d.ts +9 -0
  94. package/dist/features/team-mode/tools/index.d.ts +1 -0
  95. package/dist/features/team-mode/tools/lifecycle-test-fixture.d.ts +188 -0
  96. package/dist/features/team-mode/tools/lifecycle.d.ts +37 -0
  97. package/dist/features/team-mode/tools/messaging.d.ts +31 -0
  98. package/dist/features/team-mode/tools/query.d.ts +16 -0
  99. package/dist/features/team-mode/tools/tasks.d.ts +18 -0
  100. package/dist/features/team-mode/types.d.ts +138 -6
  101. package/dist/features/tmux-subagent/action-executor-core.d.ts +1 -0
  102. package/dist/features/tmux-subagent/action-executor.d.ts +1 -0
  103. package/dist/features/tmux-subagent/attachable-session-status.d.ts +4 -0
  104. package/dist/features/tmux-subagent/manager.d.ts +32 -3
  105. package/dist/features/tmux-subagent/pane-state-querier.d.ts +10 -0
  106. package/dist/features/tmux-subagent/polling.d.ts +1 -0
  107. package/dist/hooks/atlas/atlas-hook.d.ts +1 -1
  108. package/dist/hooks/atlas/boulder-continuation-injector.d.ts +2 -3
  109. package/dist/hooks/atlas/recent-model-resolver.d.ts +9 -1
  110. package/dist/hooks/atlas/tool-execute-after.d.ts +2 -1
  111. package/dist/hooks/atlas/tool-execute-before.d.ts +1 -0
  112. package/dist/hooks/atlas/types.d.ts +8 -2
  113. package/dist/hooks/index.d.ts +3 -0
  114. package/dist/hooks/keyword-detector/constants.d.ts +6 -0
  115. package/dist/hooks/keyword-detector/detector.d.ts +5 -3
  116. package/dist/hooks/keyword-detector/hook.d.ts +2 -1
  117. package/dist/hooks/keyword-detector/hyperplan/default.d.ts +13 -0
  118. package/dist/hooks/keyword-detector/hyperplan/index.d.ts +1 -0
  119. package/dist/hooks/keyword-detector/team/default.d.ts +13 -0
  120. package/dist/hooks/keyword-detector/team/index.d.ts +1 -0
  121. package/dist/hooks/session-recovery/recover-tool-result-missing.d.ts +2 -2
  122. package/dist/hooks/team-mailbox-injector/hook.d.ts +31 -0
  123. package/dist/hooks/team-mailbox-injector/index.d.ts +2 -0
  124. package/dist/hooks/team-mode-status-injector/hook.d.ts +28 -0
  125. package/dist/hooks/team-mode-status-injector/index.d.ts +1 -0
  126. package/dist/hooks/team-session-events/team-idle-wake-hint.d.ts +38 -0
  127. package/dist/hooks/team-session-events/team-lead-orphan-handler.d.ts +12 -0
  128. package/dist/hooks/team-session-events/team-member-error-handler.d.ts +10 -0
  129. package/dist/hooks/team-session-events/team-member-status-handler.d.ts +10 -0
  130. package/dist/hooks/team-tool-gating/hook.d.ts +3 -0
  131. package/dist/hooks/team-tool-gating/index.d.ts +1 -0
  132. package/dist/hooks/write-existing-file-guard/hook.d.ts +6 -1
  133. package/dist/hooks/write-existing-file-guard/tool-execute-before-handler.d.ts +1 -0
  134. package/dist/index.js +75187 -72423
  135. package/dist/oh-my-opencode.schema.json +191 -47
  136. package/dist/plugin/hooks/create-core-hooks.d.ts +3 -0
  137. package/dist/plugin/hooks/create-tool-guard-hooks.d.ts +2 -1
  138. package/dist/plugin/hooks/create-transform-hooks.d.ts +3 -1
  139. package/dist/plugin/recent-synthetic-idles.d.ts +1 -0
  140. package/dist/plugin/tool-registry.d.ts +16 -0
  141. package/dist/shared/bun-spawn-shim.d.ts +40 -0
  142. package/dist/shared/posthog.d.ts +7 -1
  143. package/dist/shared/project-discovery-dirs.d.ts +1 -0
  144. package/dist/shared/shell-env.d.ts +1 -0
  145. package/dist/shared/tmux/constants.d.ts +1 -1
  146. package/dist/shared/tmux/index.d.ts +1 -0
  147. package/dist/shared/tmux/runner.d.ts +13 -0
  148. package/dist/shared/tmux/tmux-utils/pane-replace.d.ts +1 -1
  149. package/dist/shared/tmux/tmux-utils/pane-spawn.d.ts +13 -1
  150. package/dist/shared/tmux/tmux-utils/session-spawn.d.ts +13 -1
  151. package/dist/shared/tmux/tmux-utils/spawn-process.d.ts +1 -1
  152. package/dist/shared/tmux/tmux-utils/stale-session-sweep.d.ts +9 -2
  153. package/dist/shared/tmux/tmux-utils/window-spawn.d.ts +13 -1
  154. package/dist/shared/tmux/tmux-utils.d.ts +1 -1
  155. package/dist/tools/delegate-task/openai-categories.d.ts +1 -0
  156. package/dist/tools/delegate-task/skill-resolver.d.ts +1 -0
  157. package/dist/tools/delegate-task/subagent-resolver.d.ts +5 -1
  158. package/dist/tools/delegate-task/types.d.ts +1 -0
  159. package/dist/tools/index.d.ts +1 -0
  160. package/dist/tools/look-at/missing-file-error.d.ts +2 -0
  161. package/dist/tools/skill/types.d.ts +2 -0
  162. package/package.json +14 -13
package/dist/cli/index.js CHANGED
@@ -6653,25 +6653,129 @@ var init_external_plugin_detector = __esm(() => {
6653
6653
  init_plugin_identity();
6654
6654
  });
6655
6655
 
6656
+ // src/shared/bun-spawn-shim.ts
6657
+ import { spawn as nodeSpawn, spawnSync as nodeSpawnSync } from "child_process";
6658
+ import { Readable, Writable } from "stream";
6659
+ function emptyReadableStream() {
6660
+ return new ReadableStream({
6661
+ start(controller) {
6662
+ controller.close();
6663
+ }
6664
+ });
6665
+ }
6666
+ function toReadableStream(stream) {
6667
+ if (!stream)
6668
+ return emptyReadableStream();
6669
+ return Readable.toWeb(stream);
6670
+ }
6671
+ function emptyWritableStream() {
6672
+ return new Writable({
6673
+ write(_chunk, _encoding, callback) {
6674
+ callback();
6675
+ }
6676
+ });
6677
+ }
6678
+ function resolveCommand(cmdOrOpts, optsArg) {
6679
+ const isObj = !Array.isArray(cmdOrOpts);
6680
+ const opts = isObj ? cmdOrOpts : optsArg ?? {};
6681
+ return {
6682
+ cmd: isObj ? cmdOrOpts.cmd : cmdOrOpts,
6683
+ opts
6684
+ };
6685
+ }
6686
+ function resolveStdio(options) {
6687
+ if (options.stdio)
6688
+ return options.stdio;
6689
+ return [options.stdin ?? "ignore", options.stdout ?? "pipe", options.stderr ?? "inherit"];
6690
+ }
6691
+ function wrapNodeProcess(proc) {
6692
+ let exitCode = null;
6693
+ const exited = new Promise((resolve4, reject) => {
6694
+ proc.on("exit", (code) => {
6695
+ exitCode = code ?? 1;
6696
+ resolve4(exitCode);
6697
+ });
6698
+ proc.on("error", (error) => {
6699
+ if (exitCode === null) {
6700
+ exitCode = 1;
6701
+ reject(error);
6702
+ }
6703
+ });
6704
+ });
6705
+ return {
6706
+ get exitCode() {
6707
+ return exitCode;
6708
+ },
6709
+ exited,
6710
+ stdout: toReadableStream(proc.stdout),
6711
+ stderr: toReadableStream(proc.stderr),
6712
+ stdin: proc.stdin ?? emptyWritableStream(),
6713
+ kill(signal) {
6714
+ if (proc.killed || exitCode !== null)
6715
+ return;
6716
+ try {
6717
+ proc.kill(signal);
6718
+ } catch (error) {
6719
+ if (!String(error).includes("kill"))
6720
+ throw error;
6721
+ }
6722
+ },
6723
+ pid: proc.pid,
6724
+ ref() {
6725
+ proc.ref();
6726
+ },
6727
+ unref() {
6728
+ proc.unref();
6729
+ }
6730
+ };
6731
+ }
6732
+ function spawn(cmdOrOpts, opts) {
6733
+ if (IS_BUN)
6734
+ return runtime.Bun.spawn(cmdOrOpts, opts);
6735
+ const { cmd, opts: options } = resolveCommand(cmdOrOpts, opts);
6736
+ const [bin, ...args] = cmd;
6737
+ const proc = nodeSpawn(bin, args, {
6738
+ cwd: options.cwd,
6739
+ env: options.env,
6740
+ stdio: resolveStdio(options),
6741
+ detached: options.detached,
6742
+ signal: options.signal
6743
+ });
6744
+ return wrapNodeProcess(proc);
6745
+ }
6746
+ var runtime, IS_BUN;
6747
+ var init_bun_spawn_shim = __esm(() => {
6748
+ runtime = globalThis;
6749
+ IS_BUN = typeof runtime.Bun !== "undefined";
6750
+ });
6751
+
6656
6752
  // src/shared/archive-entry-validator.ts
6657
6753
  var init_archive_entry_validator = () => {};
6658
6754
 
6659
6755
  // src/shared/zip-entry-listing/python-zip-entry-listing.ts
6660
- var init_python_zip_entry_listing = () => {};
6756
+ var init_python_zip_entry_listing = __esm(() => {
6757
+ init_bun_spawn_shim();
6758
+ });
6661
6759
 
6662
6760
  // src/shared/zip-entry-listing/powershell-zip-entry-listing.ts
6663
- var init_powershell_zip_entry_listing = () => {};
6761
+ var init_powershell_zip_entry_listing = __esm(() => {
6762
+ init_bun_spawn_shim();
6763
+ });
6664
6764
 
6665
6765
  // src/shared/zip-entry-listing/tar-zip-entry-listing.ts
6666
6766
  var init_tar_zip_entry_listing = __esm(() => {
6767
+ init_bun_spawn_shim();
6667
6768
  init_logger();
6668
6769
  });
6669
6770
 
6670
6771
  // src/shared/zip-entry-listing/read-zip-symlink-target.ts
6671
- var init_read_zip_symlink_target = () => {};
6772
+ var init_read_zip_symlink_target = __esm(() => {
6773
+ init_bun_spawn_shim();
6774
+ });
6672
6775
 
6673
6776
  // src/shared/zip-entry-listing/zipinfo-zip-entry-listing.ts
6674
6777
  var init_zipinfo_zip_entry_listing = __esm(() => {
6778
+ init_bun_spawn_shim();
6675
6779
  init_read_zip_symlink_target();
6676
6780
  });
6677
6781
 
@@ -6685,6 +6789,7 @@ var init_zip_entry_listing = __esm(() => {
6685
6789
 
6686
6790
  // src/shared/zip-extractor.ts
6687
6791
  var init_zip_extractor = __esm(() => {
6792
+ init_bun_spawn_shim();
6688
6793
  init_archive_entry_validator();
6689
6794
  init_zip_entry_listing();
6690
6795
  });
@@ -6697,6 +6802,7 @@ function getCachedBinaryPath(cacheDir, binaryName) {
6697
6802
  return existsSync6(binaryPath) ? binaryPath : null;
6698
6803
  }
6699
6804
  var init_binary_downloader = __esm(() => {
6805
+ init_bun_spawn_shim();
6700
6806
  init_archive_entry_validator();
6701
6807
  init_zip_extractor();
6702
6808
  });
@@ -6706,7 +6812,7 @@ function stripInvisibleAgentCharacters(agentName) {
6706
6812
  return agentName.replace(INVISIBLE_AGENT_CHARACTERS_REGEX, "");
6707
6813
  }
6708
6814
  function stripAgentListSortPrefix(agentName) {
6709
- return stripInvisibleAgentCharacters(agentName);
6815
+ return stripInvisibleAgentCharacters(agentName).replace(VISIBLE_AGENT_LIST_SORT_PREFIX_REGEX, "").replace(AGENT_WRAPPER_CHARS_REGEX, "");
6710
6816
  }
6711
6817
  function getAgentDisplayName(configKey) {
6712
6818
  const exactMatch = AGENT_DISPLAY_NAMES[configKey];
@@ -6735,7 +6841,7 @@ function getAgentConfigKey(agentName) {
6735
6841
  const lower = stripAgentListSortPrefix(agentName).trim().toLowerCase();
6736
6842
  return resolveKnownAgentConfigKey(agentName) ?? lower;
6737
6843
  }
6738
- var AGENT_DISPLAY_NAMES, INVISIBLE_AGENT_CHARACTERS_REGEX, REVERSE_DISPLAY_NAMES, LEGACY_DISPLAY_NAMES;
6844
+ var AGENT_DISPLAY_NAMES, INVISIBLE_AGENT_CHARACTERS_REGEX, VISIBLE_AGENT_LIST_SORT_PREFIX_REGEX, AGENT_WRAPPER_CHARS_REGEX, REVERSE_DISPLAY_NAMES, LEGACY_DISPLAY_NAMES;
6739
6845
  var init_agent_display_names = __esm(() => {
6740
6846
  AGENT_DISPLAY_NAMES = {
6741
6847
  sisyphus: "Sisyphus - Ultraworker",
@@ -6754,6 +6860,8 @@ var init_agent_display_names = __esm(() => {
6754
6860
  "council-member": "council-member"
6755
6861
  };
6756
6862
  INVISIBLE_AGENT_CHARACTERS_REGEX = /[\u200B\u200C\u200D\uFEFF]/g;
6863
+ VISIBLE_AGENT_LIST_SORT_PREFIX_REGEX = /^\d+\|/;
6864
+ AGENT_WRAPPER_CHARS_REGEX = /^[\\/"']+|[\\/"']+$/g;
6757
6865
  REVERSE_DISPLAY_NAMES = Object.fromEntries(Object.entries(AGENT_DISPLAY_NAMES).map(([key, displayName]) => [displayName.toLowerCase(), key]));
6758
6866
  LEGACY_DISPLAY_NAMES = {
6759
6867
  "sisyphus (ultraworker)": "sisyphus",
@@ -6778,7 +6886,7 @@ var init_model_requirements = __esm(() => {
6778
6886
  model: "claude-opus-4-7",
6779
6887
  variant: "max"
6780
6888
  },
6781
- { providers: ["opencode-go", "vercel"], model: "kimi-k2.5" },
6889
+ { providers: ["opencode-go", "vercel"], model: "kimi-k2.6" },
6782
6890
  { providers: ["kimi-for-coding"], model: "k2p5" },
6783
6891
  {
6784
6892
  providers: [
@@ -6825,13 +6933,14 @@ var init_model_requirements = __esm(() => {
6825
6933
  model: "claude-opus-4-7",
6826
6934
  variant: "max"
6827
6935
  },
6828
- { providers: ["opencode-go", "vercel"], model: "glm-5" }
6936
+ { providers: ["opencode-go", "vercel"], model: "glm-5.1" }
6829
6937
  ]
6830
6938
  },
6831
6939
  librarian: {
6832
6940
  fallbackChain: [
6833
6941
  { providers: ["openai"], model: "gpt-5.4-mini-fast" },
6834
- { providers: ["opencode-go", "vercel"], model: "minimax-m2.7-highspeed" },
6942
+ { providers: ["opencode-go"], model: "qwen3.5-plus" },
6943
+ { providers: ["vercel"], model: "minimax-m2.7-highspeed" },
6835
6944
  { providers: ["opencode-go", "vercel"], model: "minimax-m2.7" },
6836
6945
  { providers: ["anthropic", "opencode", "vercel"], model: "claude-haiku-4-5" },
6837
6946
  { providers: ["openai", "opencode", "vercel"], model: "gpt-5.4-nano" }
@@ -6840,7 +6949,8 @@ var init_model_requirements = __esm(() => {
6840
6949
  explore: {
6841
6950
  fallbackChain: [
6842
6951
  { providers: ["openai"], model: "gpt-5.4-mini-fast" },
6843
- { providers: ["opencode-go", "vercel"], model: "minimax-m2.7-highspeed" },
6952
+ { providers: ["opencode-go"], model: "qwen3.5-plus" },
6953
+ { providers: ["vercel"], model: "minimax-m2.7-highspeed" },
6844
6954
  { providers: ["opencode-go", "vercel"], model: "minimax-m2.7" },
6845
6955
  { providers: ["anthropic", "opencode", "vercel"], model: "claude-haiku-4-5" },
6846
6956
  { providers: ["openai", "opencode", "vercel"], model: "gpt-5.4-nano" }
@@ -6849,7 +6959,7 @@ var init_model_requirements = __esm(() => {
6849
6959
  "multimodal-looker": {
6850
6960
  fallbackChain: [
6851
6961
  { providers: ["openai", "opencode", "vercel"], model: "gpt-5.5", variant: "medium" },
6852
- { providers: ["opencode-go", "vercel"], model: "kimi-k2.5" },
6962
+ { providers: ["opencode-go", "vercel"], model: "kimi-k2.6" },
6853
6963
  { providers: ["zai-coding-plan", "vercel"], model: "glm-4.6v" },
6854
6964
  { providers: ["openai", "github-copilot", "opencode", "vercel"], model: "gpt-5-nano" }
6855
6965
  ]
@@ -6866,7 +6976,7 @@ var init_model_requirements = __esm(() => {
6866
6976
  model: "gpt-5.5",
6867
6977
  variant: "high"
6868
6978
  },
6869
- { providers: ["opencode-go", "vercel"], model: "glm-5" },
6979
+ { providers: ["opencode-go", "vercel"], model: "glm-5.1" },
6870
6980
  {
6871
6981
  providers: ["google", "github-copilot", "opencode", "vercel"],
6872
6982
  model: "gemini-3.1-pro"
@@ -6885,7 +6995,7 @@ var init_model_requirements = __esm(() => {
6885
6995
  model: "gpt-5.5",
6886
6996
  variant: "high"
6887
6997
  },
6888
- { providers: ["opencode-go", "vercel"], model: "glm-5" },
6998
+ { providers: ["opencode-go", "vercel"], model: "glm-5.1" },
6889
6999
  { providers: ["kimi-for-coding"], model: "k2p5" }
6890
7000
  ]
6891
7001
  },
@@ -6906,13 +7016,13 @@ var init_model_requirements = __esm(() => {
6906
7016
  model: "gemini-3.1-pro",
6907
7017
  variant: "high"
6908
7018
  },
6909
- { providers: ["opencode-go", "vercel"], model: "glm-5" }
7019
+ { providers: ["opencode-go", "vercel"], model: "glm-5.1" }
6910
7020
  ]
6911
7021
  },
6912
7022
  atlas: {
6913
7023
  fallbackChain: [
6914
7024
  { providers: ["anthropic", "github-copilot", "opencode", "vercel"], model: "claude-sonnet-4-6" },
6915
- { providers: ["opencode-go", "vercel"], model: "kimi-k2.5" },
7025
+ { providers: ["opencode-go", "vercel"], model: "kimi-k2.6" },
6916
7026
  {
6917
7027
  providers: ["openai", "github-copilot", "opencode", "vercel"],
6918
7028
  model: "gpt-5.5",
@@ -6924,7 +7034,7 @@ var init_model_requirements = __esm(() => {
6924
7034
  "sisyphus-junior": {
6925
7035
  fallbackChain: [
6926
7036
  { providers: ["anthropic", "github-copilot", "opencode", "vercel"], model: "claude-sonnet-4-6" },
6927
- { providers: ["opencode-go", "vercel"], model: "kimi-k2.5" },
7037
+ { providers: ["opencode-go", "vercel"], model: "kimi-k2.6" },
6928
7038
  {
6929
7039
  providers: ["openai", "github-copilot", "opencode", "vercel"],
6930
7040
  model: "gpt-5.5",
@@ -6949,7 +7059,7 @@ var init_model_requirements = __esm(() => {
6949
7059
  model: "claude-opus-4-7",
6950
7060
  variant: "max"
6951
7061
  },
6952
- { providers: ["opencode-go", "vercel"], model: "glm-5" },
7062
+ { providers: ["opencode-go", "vercel"], model: "glm-5.1" },
6953
7063
  { providers: ["kimi-for-coding"], model: "k2p5" }
6954
7064
  ]
6955
7065
  },
@@ -6970,7 +7080,7 @@ var init_model_requirements = __esm(() => {
6970
7080
  model: "claude-opus-4-7",
6971
7081
  variant: "max"
6972
7082
  },
6973
- { providers: ["opencode-go", "vercel"], model: "glm-5" }
7083
+ { providers: ["opencode-go", "vercel"], model: "glm-5.1" }
6974
7084
  ]
6975
7085
  },
6976
7086
  deep: {
@@ -7005,8 +7115,7 @@ var init_model_requirements = __esm(() => {
7005
7115
  variant: "max"
7006
7116
  },
7007
7117
  { providers: ["openai", "github-copilot", "opencode", "vercel"], model: "gpt-5.5" }
7008
- ],
7009
- requiresModel: "gemini-3.1-pro"
7118
+ ]
7010
7119
  },
7011
7120
  quick: {
7012
7121
  fallbackChain: [
@@ -7037,7 +7146,7 @@ var init_model_requirements = __esm(() => {
7037
7146
  model: "gpt-5.3-codex",
7038
7147
  variant: "medium"
7039
7148
  },
7040
- { providers: ["opencode-go", "vercel"], model: "kimi-k2.5" },
7149
+ { providers: ["opencode-go", "vercel"], model: "kimi-k2.6" },
7041
7150
  {
7042
7151
  providers: ["google", "github-copilot", "opencode", "vercel"],
7043
7152
  model: "gemini-3-flash"
@@ -7059,7 +7168,7 @@ var init_model_requirements = __esm(() => {
7059
7168
  },
7060
7169
  { providers: ["zai-coding-plan", "opencode", "vercel"], model: "glm-5" },
7061
7170
  { providers: ["kimi-for-coding"], model: "k2p5" },
7062
- { providers: ["opencode-go", "vercel"], model: "glm-5" },
7171
+ { providers: ["opencode-go", "vercel"], model: "glm-5.1" },
7063
7172
  { providers: ["opencode", "vercel"], model: "kimi-k2.5" },
7064
7173
  {
7065
7174
  providers: [
@@ -7081,7 +7190,7 @@ var init_model_requirements = __esm(() => {
7081
7190
  providers: ["google", "github-copilot", "opencode", "vercel"],
7082
7191
  model: "gemini-3-flash"
7083
7192
  },
7084
- { providers: ["opencode-go", "vercel"], model: "kimi-k2.5" },
7193
+ { providers: ["opencode-go", "vercel"], model: "kimi-k2.6" },
7085
7194
  {
7086
7195
  providers: ["anthropic", "github-copilot", "opencode", "vercel"],
7087
7196
  model: "claude-sonnet-4-6"
@@ -49895,20 +50004,19 @@ var init_model_capabilities_generated = __esm(() => {
49895
50004
  var SUPPLEMENTAL_MODEL_CAPABILITIES;
49896
50005
  var init_supplemental_entries = __esm(() => {
49897
50006
  SUPPLEMENTAL_MODEL_CAPABILITIES = {
49898
- "gpt-5.4-mini-fast": {
49899
- id: "gpt-5.4-mini-fast",
49900
- family: "gpt-mini",
50007
+ "kimi-k2.6": {
50008
+ id: "kimi-k2.6",
50009
+ family: "kimi",
49901
50010
  reasoning: true,
49902
- temperature: false,
50011
+ temperature: true,
49903
50012
  toolCall: true,
49904
50013
  modalities: {
49905
- input: ["text", "image"],
50014
+ input: ["text", "image", "video"],
49906
50015
  output: ["text"]
49907
50016
  },
49908
50017
  limit: {
49909
- context: 400000,
49910
- input: 272000,
49911
- output: 128000
50018
+ context: 262144,
50019
+ output: 262144
49912
50020
  }
49913
50021
  },
49914
50022
  "gpt-5.5": {
@@ -49926,6 +50034,22 @@ var init_supplemental_entries = __esm(() => {
49926
50034
  input: 272000,
49927
50035
  output: 128000
49928
50036
  }
50037
+ },
50038
+ "gpt-5.4-mini-fast": {
50039
+ id: "gpt-5.4-mini-fast",
50040
+ family: "gpt-mini",
50041
+ reasoning: true,
50042
+ temperature: false,
50043
+ toolCall: true,
50044
+ modalities: {
50045
+ input: ["text", "image"],
50046
+ output: ["text"]
50047
+ },
50048
+ limit: {
50049
+ context: 400000,
50050
+ input: 272000,
50051
+ output: 128000
50052
+ }
49929
50053
  }
49930
50054
  };
49931
50055
  });
@@ -50023,8 +50147,8 @@ var init_model_capability_aliases = __esm(() => {
50023
50147
  PATTERN_ALIAS_RULES = [
50024
50148
  {
50025
50149
  ruleID: "claude-thinking-legacy-alias",
50026
- description: "Normalizes legacy Claude Opus thinking suffixes (4-6, 4-7) to the canonical snapshot ID.",
50027
- match: (normalizedModelID) => /^claude-opus-4-(?:6|7)-thinking$/.test(normalizedModelID),
50150
+ description: "Normalizes the legacy claude-opus-4-7-thinking id to the canonical snapshot ID.",
50151
+ match: (normalizedModelID) => /^claude-opus-4-7-thinking$/.test(normalizedModelID),
50028
50152
  canonicalize: () => "claude-opus-4-7"
50029
50153
  },
50030
50154
  {
@@ -50074,7 +50198,7 @@ var init_model_capability_heuristics = __esm(() => {
50074
50198
  family: "gpt-5",
50075
50199
  includes: ["gpt-5"],
50076
50200
  variants: ["low", "medium", "high", "xhigh"],
50077
- reasoningEfforts: ["none", "minimal", "low", "medium", "high", "xhigh"]
50201
+ reasoningEfforts: ["none", "minimal", "low", "medium", "high", "xhigh", "max"]
50078
50202
  },
50079
50203
  {
50080
50204
  family: "gpt-legacy",
@@ -50624,9 +50748,15 @@ var init_session_utils = __esm(() => {
50624
50748
  init_agent_display_names();
50625
50749
  });
50626
50750
  // src/shared/tmux/constants.ts
50627
- var SESSION_TIMEOUT_MS;
50751
+ var SESSION_TIMEOUT_MS, SESSION_MISSING_GRACE_MS;
50628
50752
  var init_constants2 = __esm(() => {
50629
- SESSION_TIMEOUT_MS = 10 * 60 * 1000;
50753
+ SESSION_TIMEOUT_MS = 60 * 60 * 1000;
50754
+ SESSION_MISSING_GRACE_MS = 30 * 1000;
50755
+ });
50756
+
50757
+ // src/shared/tmux/runner.ts
50758
+ var init_runner = __esm(() => {
50759
+ init_bun_spawn_shim();
50630
50760
  });
50631
50761
  // src/shared/tmux/tmux-utils/server-health.ts
50632
50762
  var SERVER_RUNNING_KEY;
@@ -50635,7 +50765,9 @@ var init_server_health = __esm(() => {
50635
50765
  });
50636
50766
 
50637
50767
  // src/tools/interactive-bash/tmux-path-resolver.ts
50638
- var init_tmux_path_resolver = () => {};
50768
+ var init_tmux_path_resolver = __esm(() => {
50769
+ init_bun_spawn_shim();
50770
+ });
50639
50771
 
50640
50772
  // src/shared/tmux/tmux-utils/pane-dimensions.ts
50641
50773
  var init_pane_dimensions = __esm(() => {
@@ -50686,6 +50818,7 @@ var init_tmux_utils = __esm(() => {
50686
50818
  // src/shared/tmux/index.ts
50687
50819
  var init_tmux = __esm(() => {
50688
50820
  init_constants2();
50821
+ init_runner();
50689
50822
  init_tmux_utils();
50690
50823
  });
50691
50824
  // src/shared/model-suggestion-retry.ts
@@ -50896,8 +51029,46 @@ var init_opencode_command_dirs = __esm(() => {
50896
51029
  });
50897
51030
 
50898
51031
  // src/shared/project-discovery-dirs.ts
51032
+ import { existsSync as existsSync11, realpathSync as realpathSync4 } from "fs";
51033
+ import { dirname as dirname3, join as join13, resolve as resolve4 } from "path";
51034
+ function normalizePath(path5) {
51035
+ const resolvedPath = resolve4(path5);
51036
+ if (!existsSync11(resolvedPath)) {
51037
+ return resolvedPath;
51038
+ }
51039
+ try {
51040
+ return realpathSync4(resolvedPath);
51041
+ } catch {
51042
+ return resolvedPath;
51043
+ }
51044
+ }
51045
+ function findProjectOpencodePluginConfigFiles(startDirectory, stopDirectory) {
51046
+ const paths = [];
51047
+ const seen = new Set;
51048
+ let currentDirectory = normalizePath(startDirectory);
51049
+ const resolvedStopDirectory = stopDirectory ? normalizePath(stopDirectory) : undefined;
51050
+ while (true) {
51051
+ const opencodeDirectory = join13(currentDirectory, ".opencode");
51052
+ if (existsSync11(opencodeDirectory)) {
51053
+ const detected = detectPluginConfigFile(opencodeDirectory);
51054
+ if (detected.format !== "none" && !seen.has(detected.path)) {
51055
+ seen.add(detected.path);
51056
+ paths.push(detected.path);
51057
+ }
51058
+ }
51059
+ if (resolvedStopDirectory === currentDirectory) {
51060
+ return paths;
51061
+ }
51062
+ const parentDirectory = dirname3(currentDirectory);
51063
+ if (parentDirectory === currentDirectory) {
51064
+ return paths;
51065
+ }
51066
+ currentDirectory = normalizePath(parentDirectory);
51067
+ }
51068
+ }
50899
51069
  var worktreePathCache;
50900
51070
  var init_project_discovery_dirs = __esm(() => {
51071
+ init_jsonc_parser();
50901
51072
  worktreePathCache = new Map;
50902
51073
  });
50903
51074
 
@@ -51249,17 +51420,17 @@ var init_plugin_name_with_version = __esm(() => {
51249
51420
  });
51250
51421
 
51251
51422
  // src/cli/config-manager/backup-config.ts
51252
- import { copyFileSync as copyFileSync2, existsSync as existsSync11, mkdirSync as mkdirSync5 } from "fs";
51253
- import { dirname as dirname3 } from "path";
51423
+ import { copyFileSync as copyFileSync2, existsSync as existsSync12, mkdirSync as mkdirSync5 } from "fs";
51424
+ import { dirname as dirname4 } from "path";
51254
51425
  function backupConfigFile(configPath) {
51255
- if (!existsSync11(configPath)) {
51426
+ if (!existsSync12(configPath)) {
51256
51427
  return { success: true };
51257
51428
  }
51258
51429
  const timestamp2 = new Date().toISOString().replace(/[:.]/g, "-");
51259
51430
  const backupPath = `${configPath}.backup-${timestamp2}`;
51260
51431
  try {
51261
- const dir = dirname3(backupPath);
51262
- if (!existsSync11(dir)) {
51432
+ const dir = dirname4(backupPath);
51433
+ if (!existsSync12(dir)) {
51263
51434
  mkdirSync5(dir, { recursive: true });
51264
51435
  }
51265
51436
  copyFileSync2(configPath, backupPath);
@@ -51274,10 +51445,10 @@ function backupConfigFile(configPath) {
51274
51445
  var init_backup_config = () => {};
51275
51446
 
51276
51447
  // src/cli/config-manager/ensure-config-directory-exists.ts
51277
- import { existsSync as existsSync12, mkdirSync as mkdirSync6 } from "fs";
51448
+ import { existsSync as existsSync13, mkdirSync as mkdirSync6 } from "fs";
51278
51449
  function ensureConfigDirectoryExists() {
51279
51450
  const configDir = getConfigDir();
51280
- if (!existsSync12(configDir)) {
51451
+ if (!existsSync13(configDir)) {
51281
51452
  mkdirSync6(configDir, { recursive: true });
51282
51453
  }
51283
51454
  }
@@ -51315,14 +51486,14 @@ function formatErrorWithSuggestion(err, context) {
51315
51486
  }
51316
51487
 
51317
51488
  // src/cli/config-manager/opencode-config-format.ts
51318
- import { existsSync as existsSync13 } from "fs";
51489
+ import { existsSync as existsSync14 } from "fs";
51319
51490
  function detectConfigFormat() {
51320
51491
  const configJsonc = getConfigJsonc();
51321
51492
  const configJson = getConfigJson();
51322
- if (existsSync13(configJsonc)) {
51493
+ if (existsSync14(configJsonc)) {
51323
51494
  return { format: "jsonc", path: configJsonc };
51324
51495
  }
51325
- if (existsSync13(configJson)) {
51496
+ if (existsSync14(configJson)) {
51326
51497
  return { format: "json", path: configJson };
51327
51498
  }
51328
51499
  return { format: "none", path: configJson };
@@ -51765,7 +51936,7 @@ function generateModelConfig(config) {
51765
51936
  if (avail.native.openai) {
51766
51937
  agentConfig = { model: "openai/gpt-5.4-mini-fast" };
51767
51938
  } else if (avail.opencodeGo) {
51768
- agentConfig = { model: "opencode-go/minimax-m2.7" };
51939
+ agentConfig = { model: "opencode-go/qwen3.5-plus" };
51769
51940
  } else if (avail.zai) {
51770
51941
  agentConfig = { model: ZAI_MODEL };
51771
51942
  } else if (avail.vercelAiGateway) {
@@ -51785,7 +51956,7 @@ function generateModelConfig(config) {
51785
51956
  } else if (avail.opencodeZen) {
51786
51957
  agentConfig = { model: "opencode/claude-haiku-4-5" };
51787
51958
  } else if (avail.opencodeGo) {
51788
- agentConfig = { model: "opencode-go/minimax-m2.7" };
51959
+ agentConfig = { model: "opencode-go/qwen3.5-plus" };
51789
51960
  } else if (avail.copilot) {
51790
51961
  agentConfig = { model: "github-copilot/gpt-5-mini" };
51791
51962
  } else if (avail.vercelAiGateway) {
@@ -51865,12 +52036,12 @@ var init_generate_omo_config = __esm(() => {
51865
52036
  });
51866
52037
 
51867
52038
  // src/shared/migrate-legacy-config-file.ts
51868
- import { existsSync as existsSync14, readFileSync as readFileSync9, renameSync as renameSync2, rmSync } from "fs";
51869
- import { join as join13, dirname as dirname4, basename as basename2 } from "path";
52039
+ import { existsSync as existsSync15, readFileSync as readFileSync9, renameSync as renameSync2, rmSync } from "fs";
52040
+ import { join as join14, dirname as dirname5, basename as basename2 } from "path";
51870
52041
  function buildCanonicalPath(legacyPath) {
51871
- const dir = dirname4(legacyPath);
52042
+ const dir = dirname5(legacyPath);
51872
52043
  const ext = basename2(legacyPath).includes(".jsonc") ? ".jsonc" : ".json";
51873
- return join13(dir, `${CONFIG_BASENAME}${ext}`);
52044
+ return join14(dir, `${CONFIG_BASENAME}${ext}`);
51874
52045
  }
51875
52046
  function archiveLegacyConfigFile(legacyPath) {
51876
52047
  const backupPath = `${legacyPath}.bak`;
@@ -51903,10 +52074,10 @@ function archiveLegacyConfigFile(legacyPath) {
51903
52074
  }
51904
52075
  function migrateLegacySidecarFile(legacyPath, canonicalPath) {
51905
52076
  const legacySidecarPath = getSidecarPath(legacyPath);
51906
- if (!existsSync14(legacySidecarPath))
52077
+ if (!existsSync15(legacySidecarPath))
51907
52078
  return true;
51908
52079
  const canonicalSidecarPath = getSidecarPath(canonicalPath);
51909
- if (existsSync14(canonicalSidecarPath))
52080
+ if (existsSync15(canonicalSidecarPath))
51910
52081
  return true;
51911
52082
  try {
51912
52083
  const content = readFileSync9(legacySidecarPath, "utf-8");
@@ -51926,12 +52097,12 @@ function migrateLegacySidecarFile(legacyPath, canonicalPath) {
51926
52097
  }
51927
52098
  }
51928
52099
  function migrateLegacyConfigFile(legacyPath) {
51929
- if (!existsSync14(legacyPath))
52100
+ if (!existsSync15(legacyPath))
51930
52101
  return false;
51931
52102
  if (!basename2(legacyPath).startsWith(LEGACY_CONFIG_BASENAME))
51932
52103
  return false;
51933
52104
  const canonicalPath = buildCanonicalPath(legacyPath);
51934
- if (existsSync14(canonicalPath))
52105
+ if (existsSync15(canonicalPath))
51935
52106
  return false;
51936
52107
  try {
51937
52108
  const content = readFileSync9(legacyPath, "utf-8");
@@ -51975,8 +52146,8 @@ function deepMergeRecord(target, source) {
51975
52146
  }
51976
52147
 
51977
52148
  // src/cli/config-manager/write-omo-config.ts
51978
- import { existsSync as existsSync15, readFileSync as readFileSync10, statSync as statSync2, writeFileSync as writeFileSync4 } from "fs";
51979
- import { basename as basename3, dirname as dirname5, extname, join as join14 } from "path";
52149
+ import { existsSync as existsSync16, readFileSync as readFileSync10, statSync as statSync2, writeFileSync as writeFileSync4 } from "fs";
52150
+ import { basename as basename3, dirname as dirname6, extname, join as join15 } from "path";
51980
52151
  function isEmptyOrWhitespace2(content) {
51981
52152
  return content.trim().length === 0;
51982
52153
  }
@@ -51991,12 +52162,12 @@ function writeOmoConfig(installConfig) {
51991
52162
  };
51992
52163
  }
51993
52164
  const detectedConfigPath = getOmoConfigPath();
51994
- const canonicalConfigPath = join14(dirname5(detectedConfigPath), `${CONFIG_BASENAME}${extname(detectedConfigPath) || ".json"}`);
52165
+ const canonicalConfigPath = join15(dirname6(detectedConfigPath), `${CONFIG_BASENAME}${extname(detectedConfigPath) || ".json"}`);
51995
52166
  const shouldMigrateLegacyPath = basename3(detectedConfigPath).startsWith(LEGACY_CONFIG_BASENAME);
51996
- const omoConfigPath = shouldMigrateLegacyPath ? migrateLegacyConfigFile(detectedConfigPath) || existsSync15(canonicalConfigPath) ? canonicalConfigPath : detectedConfigPath : detectedConfigPath;
52167
+ const omoConfigPath = shouldMigrateLegacyPath ? migrateLegacyConfigFile(detectedConfigPath) || existsSync16(canonicalConfigPath) ? canonicalConfigPath : detectedConfigPath : detectedConfigPath;
51997
52168
  try {
51998
52169
  const newConfig = generateOmoConfig(installConfig);
51999
- if (existsSync15(omoConfigPath)) {
52170
+ if (existsSync16(omoConfigPath)) {
52000
52171
  const backupResult = backupConfigFile(omoConfigPath);
52001
52172
  if (!backupResult.success) {
52002
52173
  return {
@@ -52054,20 +52225,19 @@ var init_write_omo_config = __esm(() => {
52054
52225
  });
52055
52226
 
52056
52227
  // src/shared/spawn-with-windows-hide.ts
52057
- var {spawn: bunSpawn } = globalThis.Bun;
52058
- import { spawn as nodeSpawn } from "child_process";
52059
- import { Readable } from "stream";
52060
- function toReadableStream(stream) {
52228
+ import { spawn as nodeSpawn2 } from "child_process";
52229
+ import { Readable as Readable2 } from "stream";
52230
+ function toReadableStream2(stream) {
52061
52231
  if (!stream) {
52062
52232
  return;
52063
52233
  }
52064
- return Readable.toWeb(stream);
52234
+ return Readable2.toWeb(stream);
52065
52235
  }
52066
- function wrapNodeProcess(proc) {
52236
+ function wrapNodeProcess2(proc) {
52067
52237
  let resolveExited;
52068
52238
  let exitCode = null;
52069
- const exited = new Promise((resolve4) => {
52070
- resolveExited = resolve4;
52239
+ const exited = new Promise((resolve5) => {
52240
+ resolveExited = resolve5;
52071
52241
  });
52072
52242
  proc.on("exit", (code) => {
52073
52243
  exitCode = code ?? 1;
@@ -52084,8 +52254,8 @@ function wrapNodeProcess(proc) {
52084
52254
  return exitCode;
52085
52255
  },
52086
52256
  exited,
52087
- stdout: toReadableStream(proc.stdout),
52088
- stderr: toReadableStream(proc.stderr),
52257
+ stdout: toReadableStream2(proc.stdout),
52258
+ stderr: toReadableStream2(proc.stderr),
52089
52259
  kill(signal) {
52090
52260
  try {
52091
52261
  if (!signal) {
@@ -52099,19 +52269,21 @@ function wrapNodeProcess(proc) {
52099
52269
  }
52100
52270
  function spawnWithWindowsHide(command, options) {
52101
52271
  if (process.platform !== "win32") {
52102
- return bunSpawn(command, options);
52272
+ return spawn(command, options);
52103
52273
  }
52104
52274
  const [cmd, ...args] = command;
52105
- const proc = nodeSpawn(cmd, args, {
52275
+ const proc = nodeSpawn2(cmd, args, {
52106
52276
  cwd: options.cwd,
52107
52277
  env: options.env,
52108
- stdio: [options.stdin ?? "pipe", options.stdout ?? "pipe", options.stderr ?? "pipe"],
52278
+ stdio: [options.stdin ?? "ignore", options.stdout ?? "pipe", options.stderr ?? "inherit"],
52109
52279
  windowsHide: true,
52110
52280
  shell: true
52111
52281
  });
52112
- return wrapNodeProcess(proc);
52282
+ return wrapNodeProcess2(proc);
52113
52283
  }
52114
- var init_spawn_with_windows_hide = () => {};
52284
+ var init_spawn_with_windows_hide = __esm(() => {
52285
+ init_bun_spawn_shim();
52286
+ });
52115
52287
 
52116
52288
  // src/cli/config-manager/opencode-binary.ts
52117
52289
  async function findOpenCodeBinaryWithVersion() {
@@ -52150,10 +52322,10 @@ var init_opencode_binary = __esm(() => {
52150
52322
  });
52151
52323
 
52152
52324
  // src/cli/config-manager/detect-current-config.ts
52153
- import { existsSync as existsSync16, readFileSync as readFileSync11 } from "fs";
52325
+ import { existsSync as existsSync17, readFileSync as readFileSync11 } from "fs";
52154
52326
  function detectProvidersFromOmoConfig() {
52155
52327
  const omoConfigPath = getOmoConfigPath();
52156
- if (!existsSync16(omoConfigPath)) {
52328
+ if (!existsSync17(omoConfigPath)) {
52157
52329
  return {
52158
52330
  hasOpenAI: true,
52159
52331
  hasOpencodeZen: true,
@@ -52253,10 +52425,10 @@ var init_detect_current_config = __esm(() => {
52253
52425
  });
52254
52426
 
52255
52427
  // src/cli/config-manager/bun-install.ts
52256
- import { existsSync as existsSync17 } from "fs";
52257
- import { join as join15 } from "path";
52428
+ import { existsSync as existsSync18 } from "fs";
52429
+ import { join as join16 } from "path";
52258
52430
  function getDefaultWorkspaceDir() {
52259
- return join15(getOpenCodeCacheDir(), "packages");
52431
+ return join16(getOpenCodeCacheDir(), "packages");
52260
52432
  }
52261
52433
  function readProcessOutput(stream) {
52262
52434
  if (!stream) {
@@ -52282,7 +52454,7 @@ async function runBunInstallWithDetails(options) {
52282
52454
  const outputMode = options?.outputMode ?? "pipe";
52283
52455
  const cacheDir = options?.workspaceDir ?? getDefaultWorkspaceDir();
52284
52456
  const packageJsonPath = `${cacheDir}/package.json`;
52285
- if (!existsSync17(packageJsonPath)) {
52457
+ if (!existsSync18(packageJsonPath)) {
52286
52458
  return {
52287
52459
  success: false,
52288
52460
  error: `Workspace not initialized: ${packageJsonPath} not found. OpenCode should create this on first run.`
@@ -52297,8 +52469,8 @@ async function runBunInstallWithDetails(options) {
52297
52469
  });
52298
52470
  const outputPromise = Promise.all([readProcessOutput(proc.stdout), readProcessOutput(proc.stderr)]).then(([stdout, stderr]) => ({ stdout, stderr }));
52299
52471
  let timeoutId;
52300
- const timeoutPromise = new Promise((resolve4) => {
52301
- timeoutId = setTimeout(() => resolve4("timeout"), BUN_INSTALL_TIMEOUT_MS);
52472
+ const timeoutPromise = new Promise((resolve5) => {
52473
+ timeoutId = setTimeout(() => resolve5("timeout"), BUN_INSTALL_TIMEOUT_MS);
52302
52474
  });
52303
52475
  const exitPromise = proc.exited.then(() => "completed");
52304
52476
  const result = await Promise.race([exitPromise, timeoutPromise]);
@@ -52509,12 +52681,12 @@ var require_isexe = __commonJS((exports, module) => {
52509
52681
  if (typeof Promise !== "function") {
52510
52682
  throw new TypeError("callback not provided");
52511
52683
  }
52512
- return new Promise(function(resolve4, reject) {
52684
+ return new Promise(function(resolve5, reject) {
52513
52685
  isexe(path6, options || {}, function(er, is) {
52514
52686
  if (er) {
52515
52687
  reject(er);
52516
52688
  } else {
52517
- resolve4(is);
52689
+ resolve5(is);
52518
52690
  }
52519
52691
  });
52520
52692
  });
@@ -52576,27 +52748,27 @@ var require_which = __commonJS((exports, module) => {
52576
52748
  opt = {};
52577
52749
  const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
52578
52750
  const found = [];
52579
- const step = (i2) => new Promise((resolve4, reject) => {
52751
+ const step = (i2) => new Promise((resolve5, reject) => {
52580
52752
  if (i2 === pathEnv.length)
52581
- return opt.all && found.length ? resolve4(found) : reject(getNotFoundError(cmd));
52753
+ return opt.all && found.length ? resolve5(found) : reject(getNotFoundError(cmd));
52582
52754
  const ppRaw = pathEnv[i2];
52583
52755
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
52584
52756
  const pCmd = path6.join(pathPart, cmd);
52585
52757
  const p2 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
52586
- resolve4(subStep(p2, i2, 0));
52758
+ resolve5(subStep(p2, i2, 0));
52587
52759
  });
52588
- const subStep = (p2, i2, ii) => new Promise((resolve4, reject) => {
52760
+ const subStep = (p2, i2, ii) => new Promise((resolve5, reject) => {
52589
52761
  if (ii === pathExt.length)
52590
- return resolve4(step(i2 + 1));
52762
+ return resolve5(step(i2 + 1));
52591
52763
  const ext = pathExt[ii];
52592
52764
  isexe(p2 + ext, { pathExt: pathExtExe }, (er, is) => {
52593
52765
  if (!er && is) {
52594
52766
  if (opt.all)
52595
52767
  found.push(p2 + ext);
52596
52768
  else
52597
- return resolve4(p2 + ext);
52769
+ return resolve5(p2 + ext);
52598
52770
  }
52599
- return resolve4(subStep(p2, i2, ii + 1));
52771
+ return resolve5(subStep(p2, i2, ii + 1));
52600
52772
  });
52601
52773
  });
52602
52774
  return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
@@ -52678,10 +52850,10 @@ var require_resolveCommand = __commonJS((exports, module) => {
52678
52850
  }
52679
52851
  return resolved;
52680
52852
  }
52681
- function resolveCommand(parsed) {
52853
+ function resolveCommand2(parsed) {
52682
52854
  return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
52683
52855
  }
52684
- module.exports = resolveCommand;
52856
+ module.exports = resolveCommand2;
52685
52857
  });
52686
52858
 
52687
52859
  // node_modules/cross-spawn/lib/util/escape.js
@@ -52749,19 +52921,19 @@ var require_readShebang = __commonJS((exports, module) => {
52749
52921
  // node_modules/cross-spawn/lib/parse.js
52750
52922
  var require_parse = __commonJS((exports, module) => {
52751
52923
  var path6 = __require("path");
52752
- var resolveCommand = require_resolveCommand();
52924
+ var resolveCommand2 = require_resolveCommand();
52753
52925
  var escape = require_escape();
52754
52926
  var readShebang = require_readShebang();
52755
52927
  var isWin = process.platform === "win32";
52756
52928
  var isExecutableRegExp = /\.(?:com|exe)$/i;
52757
52929
  var isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
52758
52930
  function detectShebang(parsed) {
52759
- parsed.file = resolveCommand(parsed);
52931
+ parsed.file = resolveCommand2(parsed);
52760
52932
  const shebang = parsed.file && readShebang(parsed.file);
52761
52933
  if (shebang) {
52762
52934
  parsed.args.unshift(parsed.file);
52763
52935
  parsed.command = shebang;
52764
- return resolveCommand(parsed);
52936
+ return resolveCommand2(parsed);
52765
52937
  }
52766
52938
  return parsed.file;
52767
52939
  }
@@ -52857,21 +53029,21 @@ var require_cross_spawn = __commonJS((exports, module) => {
52857
53029
  var cp = __require("child_process");
52858
53030
  var parse7 = require_parse();
52859
53031
  var enoent = require_enoent();
52860
- function spawn(command, args, options) {
53032
+ function spawn2(command, args, options) {
52861
53033
  const parsed = parse7(command, args, options);
52862
53034
  const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
52863
53035
  enoent.hookChildProcess(spawned, parsed);
52864
53036
  return spawned;
52865
53037
  }
52866
- function spawnSync(command, args, options) {
53038
+ function spawnSync2(command, args, options) {
52867
53039
  const parsed = parse7(command, args, options);
52868
53040
  const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
52869
53041
  result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
52870
53042
  return result;
52871
53043
  }
52872
- module.exports = spawn;
52873
- module.exports.spawn = spawn;
52874
- module.exports.sync = spawnSync;
53044
+ module.exports = spawn2;
53045
+ module.exports.spawn = spawn2;
53046
+ module.exports.sync = spawnSync2;
52875
53047
  module.exports._parse = parse7;
52876
53048
  module.exports._enoent = enoent;
52877
53049
  });
@@ -53450,8 +53622,8 @@ var init_update_toasts = __esm(() => {
53450
53622
  });
53451
53623
 
53452
53624
  // src/hooks/auto-update-checker/hook/background-update-check.ts
53453
- import { existsSync as existsSync29 } from "fs";
53454
- import { join as join28 } from "path";
53625
+ import { existsSync as existsSync30 } from "fs";
53626
+ import { join as join29 } from "path";
53455
53627
  function getCacheWorkspaceDir(deps) {
53456
53628
  return deps.join(deps.getOpenCodeCacheDir(), "packages");
53457
53629
  }
@@ -53569,8 +53741,8 @@ var init_background_update_check = __esm(() => {
53569
53741
  init_checker();
53570
53742
  init_update_toasts();
53571
53743
  defaultDeps = {
53572
- existsSync: existsSync29,
53573
- join: join28,
53744
+ existsSync: existsSync30,
53745
+ join: join29,
53574
53746
  runBunInstallWithDetails,
53575
53747
  log,
53576
53748
  getOpenCodeCacheDir,
@@ -53729,7 +53901,7 @@ async function showSpinnerToast(ctx, version3, message) {
53729
53901
  duration: frameInterval + 50
53730
53902
  }
53731
53903
  }).catch(() => {});
53732
- await new Promise((resolve4) => setTimeout(resolve4, frameInterval));
53904
+ await new Promise((resolve6) => setTimeout(resolve6, frameInterval));
53733
53905
  }
53734
53906
  }
53735
53907
  var SISYPHUS_SPINNER;
@@ -53882,7 +54054,7 @@ var {
53882
54054
  // package.json
53883
54055
  var package_default = {
53884
54056
  name: "oh-my-opencode",
53885
- version: "3.17.14",
54057
+ version: "4.0.0",
53886
54058
  description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
53887
54059
  main: "./dist/index.js",
53888
54060
  types: "dist/index.d.ts",
@@ -53904,7 +54076,8 @@ var package_default = {
53904
54076
  "./schema.json": "./dist/oh-my-opencode.schema.json"
53905
54077
  },
53906
54078
  scripts: {
53907
- build: "bun build src/index.ts --outdir dist --target bun --format esm --external @ast-grep/napi --external zod && tsc --emitDeclarationOnly && bun build src/cli/index.ts --outdir dist/cli --target bun --format esm --external @ast-grep/napi && bun run build:schema",
54079
+ build: "bun build src/index.ts --outdir dist --target bun --format esm --external @ast-grep/napi --external zod && bun run build:node-require-shim && tsc --emitDeclarationOnly && bun build src/cli/index.ts --outdir dist/cli --target bun --format esm --external @ast-grep/napi && bun run build:schema",
54080
+ "build:node-require-shim": "bun run script/patch-node-require-shim.ts",
53908
54081
  "build:all": "bun run build && bun run build:binaries",
53909
54082
  "build:binaries": "bun run script/build-binaries.ts",
53910
54083
  "build:schema": "bun run script/build-schema.ts",
@@ -53962,17 +54135,17 @@ var package_default = {
53962
54135
  zod: "^4.3.0"
53963
54136
  },
53964
54137
  optionalDependencies: {
53965
- "oh-my-opencode-darwin-arm64": "3.17.14",
53966
- "oh-my-opencode-darwin-x64": "3.17.14",
53967
- "oh-my-opencode-darwin-x64-baseline": "3.17.14",
53968
- "oh-my-opencode-linux-arm64": "3.17.14",
53969
- "oh-my-opencode-linux-arm64-musl": "3.17.14",
53970
- "oh-my-opencode-linux-x64": "3.17.14",
53971
- "oh-my-opencode-linux-x64-baseline": "3.17.14",
53972
- "oh-my-opencode-linux-x64-musl": "3.17.14",
53973
- "oh-my-opencode-linux-x64-musl-baseline": "3.17.14",
53974
- "oh-my-opencode-windows-x64": "3.17.14",
53975
- "oh-my-opencode-windows-x64-baseline": "3.17.14"
54138
+ "oh-my-opencode-darwin-arm64": "4.0.0",
54139
+ "oh-my-opencode-darwin-x64": "4.0.0",
54140
+ "oh-my-opencode-darwin-x64-baseline": "4.0.0",
54141
+ "oh-my-opencode-linux-arm64": "4.0.0",
54142
+ "oh-my-opencode-linux-arm64-musl": "4.0.0",
54143
+ "oh-my-opencode-linux-x64": "4.0.0",
54144
+ "oh-my-opencode-linux-x64-baseline": "4.0.0",
54145
+ "oh-my-opencode-linux-x64-musl": "4.0.0",
54146
+ "oh-my-opencode-linux-x64-musl-baseline": "4.0.0",
54147
+ "oh-my-opencode-windows-x64": "4.0.0",
54148
+ "oh-my-opencode-windows-x64-baseline": "4.0.0"
53976
54149
  },
53977
54150
  overrides: {},
53978
54151
  trustedDependencies: [
@@ -54163,13 +54336,15 @@ var CHECK_IDS = {
54163
54336
  SYSTEM: "system",
54164
54337
  CONFIG: "config",
54165
54338
  TOOLS: "tools",
54166
- MODELS: "models"
54339
+ MODELS: "models",
54340
+ TEAM_MODE: "team-mode"
54167
54341
  };
54168
54342
  var CHECK_NAMES = {
54169
54343
  [CHECK_IDS.SYSTEM]: "System",
54170
54344
  [CHECK_IDS.CONFIG]: "Configuration",
54171
54345
  [CHECK_IDS.TOOLS]: "Tools",
54172
- [CHECK_IDS.MODELS]: "Models"
54346
+ [CHECK_IDS.MODELS]: "Models",
54347
+ [CHECK_IDS.TEAM_MODE]: "Team Mode"
54173
54348
  };
54174
54349
  var EXIT_CODES = {
54175
54350
  SUCCESS: 0,
@@ -55771,6 +55946,7 @@ async function processEvents(ctx, stream, state) {
55771
55946
  }
55772
55947
  // src/plugin-config.ts
55773
55948
  import * as fs4 from "fs";
55949
+ import { homedir as homedir4 } from "os";
55774
55950
  import * as path5 from "path";
55775
55951
 
55776
55952
  // node_modules/zod/v4/classic/external.js
@@ -69326,7 +69502,8 @@ var BuiltinSkillNameSchema = exports_external.enum([
69326
69502
  "frontend-ui-ux",
69327
69503
  "git-master",
69328
69504
  "review-work",
69329
- "ai-slop-remover"
69505
+ "ai-slop-remover",
69506
+ "team-mode"
69330
69507
  ]);
69331
69508
  var OverridableAgentNameSchema = exports_external.enum([
69332
69509
  "build",
@@ -69348,7 +69525,7 @@ var OverridableAgentNameSchema = exports_external.enum([
69348
69525
  var FallbackModelObjectSchema = exports_external.object({
69349
69526
  model: exports_external.string(),
69350
69527
  variant: exports_external.string().optional(),
69351
- reasoningEffort: exports_external.enum(["none", "minimal", "low", "medium", "high", "xhigh"]).optional(),
69528
+ reasoningEffort: exports_external.enum(["none", "minimal", "low", "medium", "high", "xhigh", "max"]).optional(),
69352
69529
  temperature: exports_external.number().min(0).max(2).optional(),
69353
69530
  top_p: exports_external.number().min(0).max(1).optional(),
69354
69531
  maxTokens: exports_external.number().optional(),
@@ -69404,7 +69581,7 @@ var AgentOverrideConfigSchema = exports_external.object({
69404
69581
  type: exports_external.enum(["enabled", "disabled"]),
69405
69582
  budgetTokens: exports_external.number().optional()
69406
69583
  }).optional(),
69407
- reasoningEffort: exports_external.enum(["none", "minimal", "low", "medium", "high", "xhigh"]).optional(),
69584
+ reasoningEffort: exports_external.enum(["none", "minimal", "low", "medium", "high", "xhigh", "max"]).optional(),
69408
69585
  textVerbosity: exports_external.enum(["low", "medium", "high"]).optional(),
69409
69586
  providerOptions: exports_external.record(exports_external.string(), exports_external.unknown()).optional(),
69410
69587
  ultrawork: exports_external.object({
@@ -69480,7 +69657,7 @@ var CategoryConfigSchema = exports_external.object({
69480
69657
  type: exports_external.enum(["enabled", "disabled"]),
69481
69658
  budgetTokens: exports_external.number().optional()
69482
69659
  }).optional(),
69483
- reasoningEffort: exports_external.enum(["none", "minimal", "low", "medium", "high", "xhigh"]).optional(),
69660
+ reasoningEffort: exports_external.enum(["none", "minimal", "low", "medium", "high", "xhigh", "max"]).optional(),
69484
69661
  textVerbosity: exports_external.enum(["low", "medium", "high"]).optional(),
69485
69662
  tools: exports_external.record(exports_external.string(), exports_external.boolean()).optional(),
69486
69663
  prompt_append: exports_external.string().optional(),
@@ -69522,7 +69699,8 @@ var BuiltinCommandNameSchema = exports_external.enum([
69522
69699
  "refactor",
69523
69700
  "start-work",
69524
69701
  "stop-continuation",
69525
- "remove-ai-slops"
69702
+ "remove-ai-slops",
69703
+ "hyperplan"
69526
69704
  ]);
69527
69705
  // src/config/schema/dynamic-context-pruning.ts
69528
69706
  var DynamicContextPruningConfigSchema = exports_external.object({
@@ -69623,6 +69801,7 @@ var HookNameSchema = exports_external.enum([
69623
69801
  "delegate-task-retry",
69624
69802
  "prometheus-md-only",
69625
69803
  "sisyphus-junior-notepad",
69804
+ "team-tool-gating",
69626
69805
  "no-sisyphus-gpt",
69627
69806
  "no-hephaestus-non-gpt",
69628
69807
  "start-work",
@@ -69641,6 +69820,11 @@ var HookNameSchema = exports_external.enum([
69641
69820
  "webfetch-redirect-guard",
69642
69821
  "legacy-plugin-toast"
69643
69822
  ]);
69823
+ // src/config/schema/keyword-detector.ts
69824
+ var KeywordTypeSchema = exports_external.enum(["ultrawork", "search", "analyze", "team", "hyperplan", "hyperplan-ultrawork"]);
69825
+ var KeywordDetectorConfigSchema = exports_external.object({
69826
+ disabled_keywords: exports_external.array(KeywordTypeSchema).optional()
69827
+ });
69644
69828
  // src/config/schema/model-capabilities.ts
69645
69829
  var ModelCapabilitiesConfigSchema = exports_external.object({
69646
69830
  enabled: exports_external.boolean().optional(),
@@ -69711,6 +69895,21 @@ var RuntimeFallbackConfigSchema = exports_external.object({
69711
69895
  notify_on_fallback: exports_external.boolean().optional()
69712
69896
  });
69713
69897
 
69898
+ // src/config/schema/team-mode.ts
69899
+ var TeamModeConfigSchema = exports_external.object({
69900
+ enabled: exports_external.boolean().default(false),
69901
+ tmux_visualization: exports_external.boolean().default(false),
69902
+ max_parallel_members: exports_external.number().int().min(1).max(8).default(4),
69903
+ max_members: exports_external.number().int().min(1).max(8).default(8),
69904
+ max_messages_per_run: exports_external.number().int().min(1).default(1e4),
69905
+ max_wall_clock_minutes: exports_external.number().int().min(1).default(120),
69906
+ max_member_turns: exports_external.number().int().min(1).default(500),
69907
+ base_dir: exports_external.string().optional(),
69908
+ message_payload_max_bytes: exports_external.number().int().min(1024).default(32768),
69909
+ recipient_unread_max_bytes: exports_external.number().int().min(1024).default(262144),
69910
+ mailbox_poll_interval_ms: exports_external.number().int().min(500).default(3000)
69911
+ });
69912
+
69714
69913
  // src/config/schema/skills.ts
69715
69914
  var SkillSourceSchema = exports_external.union([
69716
69915
  exports_external.string(),
@@ -69825,6 +70024,8 @@ var OhMyOpenCodeConfigSchema = exports_external.object({
69825
70024
  notification: NotificationConfigSchema.optional(),
69826
70025
  model_capabilities: ModelCapabilitiesConfigSchema.optional(),
69827
70026
  openclaw: OpenClawConfigSchema.optional(),
70027
+ team_mode: TeamModeConfigSchema.optional(),
70028
+ keyword_detector: KeywordDetectorConfigSchema.optional(),
69828
70029
  babysitting: BabysittingConfigSchema.optional(),
69829
70030
  git_master: GitMasterConfigSchema.default({
69830
70031
  commit_footer: true,
@@ -69842,6 +70043,20 @@ var OhMyOpenCodeConfigSchema = exports_external.object({
69842
70043
  init_shared();
69843
70044
  init_migrate_legacy_config_file();
69844
70045
  init_plugin_identity();
70046
+ function resolveHomeDirectory() {
70047
+ return process.env.HOME ?? process.env.USERPROFILE ?? homedir4();
70048
+ }
70049
+ function resolveConfigPathAfterLegacyMigration(detectedPath) {
70050
+ if (!path5.basename(detectedPath).startsWith(LEGACY_CONFIG_BASENAME)) {
70051
+ return detectedPath;
70052
+ }
70053
+ const migrated = migrateLegacyConfigFile(detectedPath);
70054
+ const canonicalPath = path5.join(path5.dirname(detectedPath), `${CONFIG_BASENAME}${path5.extname(detectedPath)}`);
70055
+ if (migrated || fs4.existsSync(canonicalPath)) {
70056
+ return canonicalPath;
70057
+ }
70058
+ return detectedPath;
70059
+ }
69845
70060
  function loadExplicitGitMasterOverrides(configPath) {
69846
70061
  try {
69847
70062
  if (!fs4.existsSync(configPath)) {
@@ -69938,6 +70153,7 @@ function mergeConfigs(base, override) {
69938
70153
  ...override,
69939
70154
  agents: deepMerge(base.agents, override.agents),
69940
70155
  categories: deepMerge(base.categories, override.categories),
70156
+ team_mode: deepMerge(base.team_mode, override.team_mode),
69941
70157
  agent_definitions: [
69942
70158
  ...new Set([
69943
70159
  ...base.agent_definitions ?? [],
@@ -69999,51 +70215,63 @@ function loadPluginConfig(directory, ctx) {
69999
70215
  legacyPath: userDetected.legacyPath
70000
70216
  });
70001
70217
  }
70002
- if (userDetected.format !== "none" && path5.basename(userDetected.path).startsWith(LEGACY_CONFIG_BASENAME)) {
70003
- const migrated = migrateLegacyConfigFile(userDetected.path);
70004
- const canonicalPath = path5.join(path5.dirname(userDetected.path), `${CONFIG_BASENAME}${path5.extname(userDetected.path)}`);
70005
- if (migrated || fs4.existsSync(canonicalPath)) {
70006
- userConfigPath = canonicalPath;
70007
- }
70008
- }
70009
- const projectBasePath = path5.join(directory, ".opencode");
70010
- const projectDetected = detectPluginConfigFile(projectBasePath);
70011
- let projectConfigPath = projectDetected.format !== "none" ? projectDetected.path : path5.join(projectBasePath, `${CONFIG_BASENAME}.json`);
70012
- if (projectDetected.legacyPath) {
70013
- log("Canonical plugin config detected alongside legacy config. Remove the legacy file to avoid confusion.", {
70014
- canonicalPath: projectDetected.path,
70015
- legacyPath: projectDetected.legacyPath
70016
- });
70017
- }
70018
- if (projectDetected.format !== "none" && path5.basename(projectDetected.path).startsWith(LEGACY_CONFIG_BASENAME)) {
70019
- const projectMigrated = migrateLegacyConfigFile(projectDetected.path);
70020
- const canonicalProjectPath = path5.join(path5.dirname(projectDetected.path), `${CONFIG_BASENAME}${path5.extname(projectDetected.path)}`);
70021
- if (projectMigrated || fs4.existsSync(canonicalProjectPath)) {
70022
- projectConfigPath = canonicalProjectPath;
70218
+ if (userDetected.format !== "none") {
70219
+ userConfigPath = resolveConfigPathAfterLegacyMigration(userConfigPath);
70220
+ }
70221
+ const homeDirectory = resolveHomeDirectory();
70222
+ const stopDirectory = containsPath(homeDirectory, directory) ? homeDirectory : directory;
70223
+ const ancestorConfigPathsNearestFirst = findProjectOpencodePluginConfigFiles(directory, stopDirectory);
70224
+ log("Walked ancestor plugin configs", {
70225
+ paths: ancestorConfigPathsNearestFirst,
70226
+ count: ancestorConfigPathsNearestFirst.length,
70227
+ stopDirectory
70228
+ });
70229
+ const canonicalAncestorPathsNearestFirst = ancestorConfigPathsNearestFirst.map((ancestorPath) => {
70230
+ const opencodeDir = path5.dirname(ancestorPath);
70231
+ const ancestorDetected = detectPluginConfigFile(opencodeDir);
70232
+ if (ancestorDetected.legacyPath) {
70233
+ log("Canonical plugin config detected alongside legacy config. Remove the legacy file to avoid confusion.", {
70234
+ canonicalPath: ancestorDetected.path,
70235
+ legacyPath: ancestorDetected.legacyPath
70236
+ });
70023
70237
  }
70024
- }
70238
+ return resolveConfigPathAfterLegacyMigration(ancestorPath);
70239
+ });
70025
70240
  const userConfig = loadConfigFromPath(userConfigPath, ctx);
70026
70241
  const userGitMasterOverrides = loadExplicitGitMasterOverrides(userConfigPath);
70027
70242
  if (userConfig?.agent_definitions) {
70028
70243
  userConfig.agent_definitions = resolveAgentDefinitionPaths(userConfig.agent_definitions, configDir, null);
70029
70244
  }
70030
70245
  let config2 = userConfig ?? OhMyOpenCodeConfigSchema.parse({});
70246
+ const canonicalAncestorPathsFarthestFirst = [...canonicalAncestorPathsNearestFirst].reverse();
70031
70247
  const defaultGitMaster = OhMyOpenCodeConfigSchema.parse({}).git_master;
70032
- const projectConfig = loadConfigFromPath(projectConfigPath, ctx);
70033
- const projectGitMasterOverrides = loadExplicitGitMasterOverrides(projectConfigPath);
70034
- if (projectConfig?.agent_definitions) {
70035
- projectConfig.agent_definitions = resolveAgentDefinitionPaths(projectConfig.agent_definitions, projectBasePath, directory);
70036
- }
70037
- if (projectConfig) {
70038
- config2 = mergeConfigs(config2, projectConfig);
70248
+ const ancestorGitMasterOverridesFarthestFirst = [];
70249
+ for (const ancestorPath of canonicalAncestorPathsFarthestFirst) {
70250
+ const ancestorConfig = loadConfigFromPath(ancestorPath, ctx);
70251
+ const ancestorOverrides = loadExplicitGitMasterOverrides(ancestorPath);
70252
+ if (ancestorConfig?.agent_definitions) {
70253
+ const ancestorBasePath = path5.dirname(ancestorPath);
70254
+ const ancestorDir = path5.dirname(ancestorBasePath);
70255
+ ancestorConfig.agent_definitions = resolveAgentDefinitionPaths(ancestorConfig.agent_definitions, ancestorBasePath, ancestorDir);
70256
+ }
70257
+ if (ancestorConfig) {
70258
+ config2 = mergeConfigs(config2, ancestorConfig);
70259
+ }
70260
+ if (ancestorOverrides) {
70261
+ ancestorGitMasterOverridesFarthestFirst.push(ancestorOverrides);
70262
+ }
70039
70263
  }
70040
- if (userGitMasterOverrides || projectGitMasterOverrides) {
70264
+ if (userGitMasterOverrides || ancestorGitMasterOverridesFarthestFirst.length > 0) {
70265
+ const mergedAncestorGitMaster = {};
70266
+ for (const override of ancestorGitMasterOverridesFarthestFirst) {
70267
+ Object.assign(mergedAncestorGitMaster, override);
70268
+ }
70041
70269
  config2 = {
70042
70270
  ...config2,
70043
70271
  git_master: {
70044
70272
  ...defaultGitMaster,
70045
70273
  ...userGitMasterOverrides ?? {},
70046
- ...projectGitMasterOverrides ?? {}
70274
+ ...mergedAncestorGitMaster
70047
70275
  }
70048
70276
  };
70049
70277
  }
@@ -70063,7 +70291,7 @@ function loadPluginConfig(directory, ctx) {
70063
70291
  // node_modules/@opencode-ai/sdk/dist/gen/core/serverSentEvents.gen.js
70064
70292
  var createSseClient = ({ onSseError, onSseEvent, responseTransformer, responseValidator, sseDefaultRetryDelay, sseMaxRetryAttempts, sseMaxRetryDelay, sseSleepFn, url: url2, ...options }) => {
70065
70293
  let lastEventId;
70066
- const sleep = sseSleepFn ?? ((ms) => new Promise((resolve4) => setTimeout(resolve4, ms)));
70294
+ const sleep = sseSleepFn ?? ((ms) => new Promise((resolve5) => setTimeout(resolve5, ms)));
70067
70295
  const createStream = async function* () {
70068
70296
  let retryDelay = sseDefaultRetryDelay ?? 3000;
70069
70297
  let attempt = 0;
@@ -71449,12 +71677,12 @@ function createOpencodeClient(config2) {
71449
71677
  var import_cross_spawn = __toESM(require_cross_spawn(), 1);
71450
71678
 
71451
71679
  // node_modules/@opencode-ai/sdk/dist/process.js
71452
- import { spawnSync } from "child_process";
71680
+ import { spawnSync as spawnSync2 } from "child_process";
71453
71681
  function stop(proc) {
71454
71682
  if (proc.exitCode !== null || proc.signalCode !== null)
71455
71683
  return;
71456
71684
  if (process.platform === "win32" && proc.pid) {
71457
- const out = spawnSync("taskkill", ["/pid", String(proc.pid), "/T", "/F"], { windowsHide: true });
71685
+ const out = spawnSync2("taskkill", ["/pid", String(proc.pid), "/T", "/F"], { windowsHide: true });
71458
71686
  if (!out.error && out.status === 0)
71459
71687
  return;
71460
71688
  }
@@ -71498,7 +71726,7 @@ async function createOpencodeServer(options) {
71498
71726
  }
71499
71727
  });
71500
71728
  let clear = () => {};
71501
- const url2 = await new Promise((resolve4, reject) => {
71729
+ const url2 = await new Promise((resolve5, reject) => {
71502
71730
  const id = setTimeout(() => {
71503
71731
  clear();
71504
71732
  stop(proc);
@@ -71524,7 +71752,7 @@ async function createOpencodeServer(options) {
71524
71752
  }
71525
71753
  clearTimeout(id);
71526
71754
  resolved = true;
71527
- resolve4(match[1]);
71755
+ resolve5(match[1]);
71528
71756
  return;
71529
71757
  }
71530
71758
  }
@@ -71579,7 +71807,7 @@ var import_picocolors10 = __toESM(require_picocolors(), 1);
71579
71807
 
71580
71808
  // src/cli/run/opencode-binary-resolver.ts
71581
71809
  init_spawn_with_windows_hide();
71582
- import { delimiter, dirname as dirname7, join as join17 } from "path";
71810
+ import { delimiter, dirname as dirname8, join as join18 } from "path";
71583
71811
  var OPENCODE_COMMANDS = ["opencode", "opencode-desktop"];
71584
71812
  var WINDOWS_SUFFIXES = ["", ".exe", ".cmd", ".bat", ".ps1"];
71585
71813
  function getCommandCandidates(platform) {
@@ -71602,7 +71830,7 @@ function collectCandidateBinaryPaths(pathEnv, which = Bun.which, platform = proc
71602
71830
  }
71603
71831
  for (const entry of (pathEnv ?? "").split(delimiter).filter(Boolean)) {
71604
71832
  for (const command of commandCandidates) {
71605
- addCandidate(join17(entry, command));
71833
+ addCandidate(join18(entry, command));
71606
71834
  }
71607
71835
  }
71608
71836
  return candidates;
@@ -71629,7 +71857,7 @@ async function findWorkingOpencodeBinary(pathEnv = process.env.PATH, probe = can
71629
71857
  return null;
71630
71858
  }
71631
71859
  function buildPathWithBinaryFirst(pathEnv, binaryPath) {
71632
- const preferredDir = dirname7(binaryPath);
71860
+ const preferredDir = dirname8(binaryPath);
71633
71861
  const existing = (pathEnv ?? "").split(delimiter).filter((entry) => entry.length > 0 && entry !== preferredDir);
71634
71862
  return [preferredDir, ...existing].join(delimiter);
71635
71863
  }
@@ -71782,7 +72010,7 @@ async function resolveSession(options) {
71782
72010
  if (attempt < SESSION_CREATE_MAX_RETRIES) {
71783
72011
  const delay = SESSION_CREATE_RETRY_DELAY_MS * attempt;
71784
72012
  console.log(import_picocolors11.default.dim(` Retrying in ${delay}ms...`));
71785
- await new Promise((resolve4) => setTimeout(resolve4, delay));
72013
+ await new Promise((resolve5) => setTimeout(resolve5, delay));
71786
72014
  }
71787
72015
  continue;
71788
72016
  }
@@ -71793,7 +72021,7 @@ async function resolveSession(options) {
71793
72021
  if (attempt < SESSION_CREATE_MAX_RETRIES) {
71794
72022
  const delay = SESSION_CREATE_RETRY_DELAY_MS * attempt;
71795
72023
  console.log(import_picocolors11.default.dim(` Retrying in ${delay}ms...`));
71796
- await new Promise((resolve4) => setTimeout(resolve4, delay));
72024
+ await new Promise((resolve5) => setTimeout(resolve5, delay));
71797
72025
  }
71798
72026
  }
71799
72027
  throw new Error("Failed to create session after all retries");
@@ -72004,15 +72232,33 @@ var BOULDER_STATE_PATH = `${BOULDER_DIR}/${BOULDER_FILE}`;
72004
72232
  var NOTEPAD_DIR = "notepads";
72005
72233
  var NOTEPAD_BASE_PATH = `${BOULDER_DIR}/${NOTEPAD_DIR}`;
72006
72234
  // src/features/boulder-state/storage.ts
72007
- import { existsSync as existsSync19, readFileSync as readFileSync13, writeFileSync as writeFileSync5, mkdirSync as mkdirSync7, readdirSync as readdirSync3 } from "fs";
72008
- import { dirname as dirname8, join as join18, basename as basename5 } from "path";
72235
+ import { existsSync as existsSync20, readFileSync as readFileSync13, writeFileSync as writeFileSync5, mkdirSync as mkdirSync7, readdirSync as readdirSync3 } from "fs";
72236
+ import { basename as basename5, dirname as dirname9, isAbsolute as isAbsolute3, join as join19, relative as relative2, resolve as resolve5 } from "path";
72009
72237
  var RESERVED_KEYS = new Set(["__proto__", "prototype", "constructor"]);
72010
72238
  function getBoulderFilePath(directory) {
72011
- return join18(directory, BOULDER_DIR, BOULDER_FILE);
72239
+ return join19(directory, BOULDER_DIR, BOULDER_FILE);
72240
+ }
72241
+ function resolveTrackedPath(baseDirectory, trackedPath) {
72242
+ return isAbsolute3(trackedPath) ? resolve5(trackedPath) : resolve5(baseDirectory, trackedPath);
72243
+ }
72244
+ function resolveBoulderPlanPath(directory, state) {
72245
+ const absolutePlanPath = resolveTrackedPath(directory, state.active_plan);
72246
+ const worktreePath = state.worktree_path?.trim();
72247
+ if (!worktreePath) {
72248
+ return absolutePlanPath;
72249
+ }
72250
+ const absoluteDirectory = resolve5(directory);
72251
+ const relativePlanPath = relative2(absoluteDirectory, absolutePlanPath);
72252
+ if (relativePlanPath.length === 0 || relativePlanPath.startsWith("..") || isAbsolute3(relativePlanPath)) {
72253
+ return absolutePlanPath;
72254
+ }
72255
+ const absoluteWorktreePath = resolveTrackedPath(directory, worktreePath);
72256
+ const worktreePlanPath = resolve5(absoluteWorktreePath, relativePlanPath);
72257
+ return existsSync20(worktreePlanPath) ? worktreePlanPath : absolutePlanPath;
72012
72258
  }
72013
72259
  function readBoulderState(directory) {
72014
72260
  const filePath = getBoulderFilePath(directory);
72015
- if (!existsSync19(filePath)) {
72261
+ if (!existsSync20(filePath)) {
72016
72262
  return null;
72017
72263
  }
72018
72264
  try {
@@ -72049,7 +72295,7 @@ var CHECKED_CHECKBOX_PATTERN = /^(\s*)[-*]\s*\[[xX]\]\s*(.+)$/;
72049
72295
  var TODO_TASK_PATTERN = /^\d+\.\s+/;
72050
72296
  var FINAL_WAVE_TASK_PATTERN = /^F\d+\.\s+/i;
72051
72297
  function getPlanProgress(planPath) {
72052
- if (!existsSync19(planPath)) {
72298
+ if (!existsSync20(planPath)) {
72053
72299
  return { total: 0, completed: 0, isComplete: true };
72054
72300
  }
72055
72301
  try {
@@ -72125,14 +72371,14 @@ function getSessionAgent(sessionID) {
72125
72371
  // src/features/run-continuation-state/constants.ts
72126
72372
  var CONTINUATION_MARKER_DIR = ".sisyphus/run-continuation";
72127
72373
  // src/features/run-continuation-state/storage.ts
72128
- import { existsSync as existsSync20, mkdirSync as mkdirSync8, readFileSync as readFileSync14, rmSync as rmSync2, writeFileSync as writeFileSync6 } from "fs";
72129
- import { join as join19 } from "path";
72374
+ import { existsSync as existsSync21, mkdirSync as mkdirSync8, readFileSync as readFileSync14, rmSync as rmSync2, writeFileSync as writeFileSync6 } from "fs";
72375
+ import { join as join20 } from "path";
72130
72376
  function getMarkerPath(directory, sessionID) {
72131
- return join19(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
72377
+ return join20(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
72132
72378
  }
72133
72379
  function readContinuationMarker(directory, sessionID) {
72134
72380
  const markerPath = getMarkerPath(directory, sessionID);
72135
- if (!existsSync20(markerPath))
72381
+ if (!existsSync21(markerPath))
72136
72382
  return null;
72137
72383
  try {
72138
72384
  const raw = readFileSync14(markerPath, "utf-8");
@@ -72197,7 +72443,7 @@ async function isSessionInBoulderLineage(input) {
72197
72443
  init_shared();
72198
72444
  init_compaction_marker();
72199
72445
  import { readFileSync as readFileSync15, readdirSync as readdirSync4 } from "fs";
72200
- import { join as join20 } from "path";
72446
+ import { join as join21 } from "path";
72201
72447
  var defaultSessionLastAgentDeps = {
72202
72448
  getMessageDir,
72203
72449
  isSqliteBackend,
@@ -72245,7 +72491,7 @@ async function getLastAgentFromSession(sessionID, client3, deps = {}) {
72245
72491
  try {
72246
72492
  const messages = readdirSync4(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
72247
72493
  try {
72248
- const content = readFileSync15(join20(messageDir, fileName), "utf-8");
72494
+ const content = readFileSync15(join21(messageDir, fileName), "utf-8");
72249
72495
  const parsed = JSON.parse(content);
72250
72496
  return {
72251
72497
  fileName,
@@ -72278,8 +72524,8 @@ init_agent_display_names();
72278
72524
 
72279
72525
  // src/hooks/ralph-loop/storage.ts
72280
72526
  init_frontmatter();
72281
- import { existsSync as existsSync21, readFileSync as readFileSync16, writeFileSync as writeFileSync7, unlinkSync as unlinkSync3, mkdirSync as mkdirSync9 } from "fs";
72282
- import { dirname as dirname9, join as join21 } from "path";
72527
+ import { existsSync as existsSync22, readFileSync as readFileSync16, writeFileSync as writeFileSync7, unlinkSync as unlinkSync3, mkdirSync as mkdirSync9 } from "fs";
72528
+ import { dirname as dirname10, join as join22 } from "path";
72283
72529
 
72284
72530
  // src/hooks/ralph-loop/constants.ts
72285
72531
  var DEFAULT_STATE_FILE = ".sisyphus/ralph-loop.local.md";
@@ -72288,11 +72534,11 @@ var DEFAULT_COMPLETION_PROMISE = "DONE";
72288
72534
 
72289
72535
  // src/hooks/ralph-loop/storage.ts
72290
72536
  function getStateFilePath(directory, customPath) {
72291
- return customPath ? join21(directory, customPath) : join21(directory, DEFAULT_STATE_FILE);
72537
+ return customPath ? join22(directory, customPath) : join22(directory, DEFAULT_STATE_FILE);
72292
72538
  }
72293
72539
  function readState(directory, customPath) {
72294
72540
  const filePath = getStateFilePath(directory, customPath);
72295
- if (!existsSync21(filePath)) {
72541
+ if (!existsSync22(filePath)) {
72296
72542
  return null;
72297
72543
  }
72298
72544
  try {
@@ -72352,7 +72598,7 @@ async function hasActiveBoulderContinuation(directory, sessionID, client3) {
72352
72598
  const boulder = readBoulderState(directory);
72353
72599
  if (!boulder)
72354
72600
  return false;
72355
- const progress = getPlanProgress(boulder.active_plan);
72601
+ const progress = getPlanProgress(resolveBoulderPlanPath(directory, boulder));
72356
72602
  if (progress.isComplete)
72357
72603
  return false;
72358
72604
  if (!client3)
@@ -72510,7 +72756,7 @@ async function pollForCompletion(ctx, eventState, abortController, options = {})
72510
72756
  let secondaryTimeoutChecked = false;
72511
72757
  const pollStartTimestamp = Date.now();
72512
72758
  while (!abortController.signal.aborted) {
72513
- await new Promise((resolve4) => setTimeout(resolve4, pollIntervalMs));
72759
+ await new Promise((resolve6) => setTimeout(resolve6, pollIntervalMs));
72514
72760
  if (abortController.signal.aborted) {
72515
72761
  return 130;
72516
72762
  }
@@ -72741,7 +72987,7 @@ import os3 from "os";
72741
72987
  import { createHash } from "crypto";
72742
72988
 
72743
72989
  // node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
72744
- import { dirname as dirname10, posix, sep } from "path";
72990
+ import { dirname as dirname11, posix, sep } from "path";
72745
72991
  function createModulerModifier() {
72746
72992
  const getModuleFromFileName = createGetModuleFromFilename();
72747
72993
  return async (frames) => {
@@ -72750,7 +72996,7 @@ function createModulerModifier() {
72750
72996
  return frames;
72751
72997
  };
72752
72998
  }
72753
- function createGetModuleFromFilename(basePath = process.argv[1] ? dirname10(process.argv[1]) : process.cwd(), isWindows = sep === "\\") {
72999
+ function createGetModuleFromFilename(basePath = process.argv[1] ? dirname11(process.argv[1]) : process.cwd(), isWindows = sep === "\\") {
72754
73000
  const normalizedBase = isWindows ? normalizeWindowsPath(basePath) : basePath;
72755
73001
  return (filename) => {
72756
73002
  if (!filename)
@@ -75089,14 +75335,14 @@ async function addSourceContext(frames) {
75089
75335
  return frames;
75090
75336
  }
75091
75337
  function getContextLinesFromFile(path6, ranges, output) {
75092
- return new Promise((resolve4) => {
75338
+ return new Promise((resolve6) => {
75093
75339
  const stream = createReadStream(path6);
75094
75340
  const lineReaded = createInterface2({
75095
75341
  input: stream
75096
75342
  });
75097
75343
  function destroyStreamAndResolve() {
75098
75344
  stream.destroy();
75099
- resolve4();
75345
+ resolve6();
75100
75346
  }
75101
75347
  let lineNumber = 0;
75102
75348
  let currentRangeIndex = 0;
@@ -76336,9 +76582,9 @@ class PostHogBackendClient extends PostHogCoreStateless {
76336
76582
  if (this.disabled || this.optedOut)
76337
76583
  return;
76338
76584
  if (!this._waitUntilCycle) {
76339
- let resolve4;
76585
+ let resolve6;
76340
76586
  const promise2 = new Promise((r2) => {
76341
- resolve4 = r2;
76587
+ resolve6 = r2;
76342
76588
  });
76343
76589
  try {
76344
76590
  waitUntil(promise2);
@@ -76346,7 +76592,7 @@ class PostHogBackendClient extends PostHogCoreStateless {
76346
76592
  return;
76347
76593
  }
76348
76594
  this._waitUntilCycle = {
76349
- resolve: resolve4,
76595
+ resolve: resolve6,
76350
76596
  startedAt: Date.now(),
76351
76597
  timer: undefined
76352
76598
  };
@@ -76372,11 +76618,11 @@ class PostHogBackendClient extends PostHogCoreStateless {
76372
76618
  return cycle?.resolve;
76373
76619
  }
76374
76620
  async resolveWaitUntilFlush() {
76375
- const resolve4 = this._consumeWaitUntilCycle();
76621
+ const resolve6 = this._consumeWaitUntilCycle();
76376
76622
  try {
76377
76623
  await super.flush();
76378
76624
  } catch {} finally {
76379
- resolve4?.();
76625
+ resolve6?.();
76380
76626
  }
76381
76627
  }
76382
76628
  getPersistedProperty(key) {
@@ -76476,15 +76722,15 @@ class PostHogBackendClient extends PostHogCoreStateless {
76476
76722
  return true;
76477
76723
  if (this.featureFlagsPoller === undefined)
76478
76724
  return false;
76479
- return new Promise((resolve4) => {
76725
+ return new Promise((resolve6) => {
76480
76726
  const timeout = setTimeout(() => {
76481
76727
  cleanup();
76482
- resolve4(false);
76728
+ resolve6(false);
76483
76729
  }, timeoutMs);
76484
76730
  const cleanup = this._events.on("localEvaluationFlagsLoaded", (count) => {
76485
76731
  clearTimeout(timeout);
76486
76732
  cleanup();
76487
- resolve4(count > 0);
76733
+ resolve6(count > 0);
76488
76734
  });
76489
76735
  });
76490
76736
  }
@@ -76828,13 +77074,13 @@ class PostHogBackendClient extends PostHogCoreStateless {
76828
77074
  this.context?.enter(data, options);
76829
77075
  }
76830
77076
  async _shutdown(shutdownTimeoutMs) {
76831
- const resolve4 = this._consumeWaitUntilCycle();
77077
+ const resolve6 = this._consumeWaitUntilCycle();
76832
77078
  await this.featureFlagsPoller?.stopPoller(shutdownTimeoutMs);
76833
77079
  this.errorTracking.shutdown();
76834
77080
  try {
76835
77081
  return await super._shutdown(shutdownTimeoutMs);
76836
77082
  } finally {
76837
- resolve4?.();
77083
+ resolve6?.();
76838
77084
  }
76839
77085
  }
76840
77086
  async _requestRemoteConfigPayload(flagKey) {
@@ -77188,11 +77434,11 @@ init_data_path();
77188
77434
  init_logger();
77189
77435
  init_plugin_identity();
77190
77436
  init_write_file_atomically();
77191
- import { existsSync as existsSync22, mkdirSync as mkdirSync10, readFileSync as readFileSync17 } from "fs";
77192
- import { join as join22 } from "path";
77437
+ import { existsSync as existsSync23, mkdirSync as mkdirSync10, readFileSync as readFileSync17 } from "fs";
77438
+ import { join as join23 } from "path";
77193
77439
  var POSTHOG_ACTIVITY_STATE_FILE = "posthog-activity.json";
77194
77440
  function getPostHogActivityStateFilePath() {
77195
- return join22(getDataDir(), CACHE_DIR_NAME, POSTHOG_ACTIVITY_STATE_FILE);
77441
+ return join23(getDataDir(), CACHE_DIR_NAME, POSTHOG_ACTIVITY_STATE_FILE);
77196
77442
  }
77197
77443
  function getUtcDayString(date5) {
77198
77444
  return date5.toISOString().slice(0, 10);
@@ -77202,7 +77448,7 @@ function isPostHogActivityState(value) {
77202
77448
  }
77203
77449
  function readPostHogActivityState() {
77204
77450
  const stateFilePath = getPostHogActivityStateFilePath();
77205
- if (!existsSync22(stateFilePath)) {
77451
+ if (!existsSync23(stateFilePath)) {
77206
77452
  return {};
77207
77453
  }
77208
77454
  try {
@@ -77223,7 +77469,7 @@ function readPostHogActivityState() {
77223
77469
  function writePostHogActivityState(nextState) {
77224
77470
  const stateFilePath = getPostHogActivityStateFilePath();
77225
77471
  try {
77226
- mkdirSync10(join22(getDataDir(), CACHE_DIR_NAME), { recursive: true });
77472
+ mkdirSync10(join23(getDataDir(), CACHE_DIR_NAME), { recursive: true });
77227
77473
  writeFileAtomically(stateFilePath, `${JSON.stringify(nextState, null, 2)}
77228
77474
  `);
77229
77475
  } catch (error48) {
@@ -77251,9 +77497,13 @@ function getPostHogActivityCaptureState(now = new Date) {
77251
77497
 
77252
77498
  // src/shared/posthog.ts
77253
77499
  var activityStateProviderOverride = null;
77500
+ var osProviderOverride = null;
77254
77501
  function resolveActivityState() {
77255
77502
  return (activityStateProviderOverride ?? getPostHogActivityCaptureState)();
77256
77503
  }
77504
+ function resolveOsProvider() {
77505
+ return osProviderOverride ?? os3;
77506
+ }
77257
77507
  var DEFAULT_POSTHOG_HOST = "https://us.i.posthog.com";
77258
77508
  var DEFAULT_POSTHOG_API_KEY = "phc_CFJhj5HyvA62QPhvyaUCtaq23aUfznnijg5VaaGkNk74";
77259
77509
  var NO_OP_POSTHOG = {
@@ -77284,7 +77534,7 @@ function getPostHogHost() {
77284
77534
  }
77285
77535
  function safeCpus() {
77286
77536
  try {
77287
- const cpus = os3.cpus();
77537
+ const cpus = resolveOsProvider().cpus();
77288
77538
  return { length: cpus.length, model: cpus[0]?.model };
77289
77539
  } catch {
77290
77540
  return { length: 0, model: undefined };
@@ -77292,6 +77542,7 @@ function safeCpus() {
77292
77542
  }
77293
77543
  function getSharedProperties(source) {
77294
77544
  const cpus = safeCpus();
77545
+ const osProvider = resolveOsProvider();
77295
77546
  return {
77296
77547
  platform: "oh-my-opencode",
77297
77548
  package_name: PUBLISHED_PACKAGE_NAME,
@@ -77300,13 +77551,13 @@ function getSharedProperties(source) {
77300
77551
  runtime: "bun",
77301
77552
  runtime_version: process.versions.bun ?? process.version,
77302
77553
  source,
77303
- $os: os3.platform(),
77304
- $os_version: os3.release(),
77305
- os_arch: os3.arch(),
77306
- os_type: os3.type(),
77554
+ $os: osProvider.platform(),
77555
+ $os_version: osProvider.release(),
77556
+ os_arch: osProvider.arch(),
77557
+ os_type: osProvider.type(),
77307
77558
  cpu_count: cpus.length,
77308
77559
  cpu_model: cpus.model,
77309
- total_memory_gb: Math.round(os3.totalmem() / 1024 / 1024 / 1024),
77560
+ total_memory_gb: Math.round(osProvider.totalmem() / 1024 / 1024 / 1024),
77310
77561
  locale: Intl.DateTimeFormat().resolvedOptions().locale,
77311
77562
  timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
77312
77563
  shell: process.env.SHELL,
@@ -77349,11 +77600,14 @@ function createPostHogClient(source, options) {
77349
77600
  };
77350
77601
  }
77351
77602
  function getPostHogDistinctId() {
77352
- return createHash("sha256").update(`${PUBLISHED_PACKAGE_NAME}:${os3.hostname()}`).digest("hex");
77603
+ return createHash("sha256").update(`${PUBLISHED_PACKAGE_NAME}:${resolveOsProvider().hostname()}`).digest("hex");
77353
77604
  }
77354
77605
  function createCliPostHog() {
77355
77606
  return createPostHogClient("cli", {
77356
77607
  enableExceptionAutocapture: false,
77608
+ enableLocalEvaluation: false,
77609
+ strictLocalEvaluation: true,
77610
+ disableRemoteConfig: true,
77357
77611
  flushAt: 1,
77358
77612
  flushInterval: 0
77359
77613
  });
@@ -77364,7 +77618,7 @@ var EVENT_PROCESSOR_SHUTDOWN_TIMEOUT_MS = 2000;
77364
77618
  async function waitForEventProcessorShutdown(eventProcessor, timeoutMs = EVENT_PROCESSOR_SHUTDOWN_TIMEOUT_MS) {
77365
77619
  const completed = await Promise.race([
77366
77620
  eventProcessor.then(() => true),
77367
- new Promise((resolve4) => setTimeout(() => resolve4(false), timeoutMs))
77621
+ new Promise((resolve6) => setTimeout(() => resolve6(false), timeoutMs))
77368
77622
  ]);
77369
77623
  }
77370
77624
  async function run(options) {
@@ -77638,12 +77892,12 @@ async function getLocalVersion(options = {}) {
77638
77892
  }
77639
77893
  }
77640
77894
  // src/cli/doctor/checks/system.ts
77641
- import { existsSync as existsSync33, readFileSync as readFileSync27 } from "fs";
77895
+ import { existsSync as existsSync34, readFileSync as readFileSync27 } from "fs";
77642
77896
 
77643
77897
  // src/cli/doctor/checks/system-binary.ts
77644
- import { existsSync as existsSync30 } from "fs";
77645
- import { homedir as homedir6 } from "os";
77646
- import { join as join29 } from "path";
77898
+ import { existsSync as existsSync31 } from "fs";
77899
+ import { homedir as homedir7 } from "os";
77900
+ import { join as join30 } from "path";
77647
77901
 
77648
77902
  // src/cli/doctor/spawn-with-timeout.ts
77649
77903
  init_spawn_with_windows_hide();
@@ -77656,8 +77910,8 @@ async function spawnWithTimeout(command, options, timeoutMs = DEFAULT_SPAWN_TIME
77656
77910
  return { stdout: "", stderr: "", exitCode: 1, timedOut: false };
77657
77911
  }
77658
77912
  let timer;
77659
- const timeoutPromise = new Promise((resolve4) => {
77660
- timer = setTimeout(() => resolve4("timeout"), timeoutMs);
77913
+ const timeoutPromise = new Promise((resolve6) => {
77914
+ timer = setTimeout(() => resolve6("timeout"), timeoutMs);
77661
77915
  });
77662
77916
  const processPromise = (async () => {
77663
77917
  await proc.exited;
@@ -77677,22 +77931,22 @@ async function spawnWithTimeout(command, options, timeoutMs = DEFAULT_SPAWN_TIME
77677
77931
 
77678
77932
  // src/cli/doctor/checks/system-binary.ts
77679
77933
  function getDesktopAppPaths(platform) {
77680
- const home = homedir6();
77934
+ const home = homedir7();
77681
77935
  switch (platform) {
77682
77936
  case "darwin":
77683
77937
  return [
77684
77938
  "/Applications/OpenCode.app/Contents/MacOS/OpenCode",
77685
- join29(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
77939
+ join30(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
77686
77940
  ];
77687
77941
  case "win32": {
77688
77942
  const programFiles = process.env.ProgramFiles;
77689
77943
  const localAppData = process.env.LOCALAPPDATA;
77690
77944
  const paths = [];
77691
77945
  if (programFiles) {
77692
- paths.push(join29(programFiles, "OpenCode", "OpenCode.exe"));
77946
+ paths.push(join30(programFiles, "OpenCode", "OpenCode.exe"));
77693
77947
  }
77694
77948
  if (localAppData) {
77695
- paths.push(join29(localAppData, "OpenCode", "OpenCode.exe"));
77949
+ paths.push(join30(localAppData, "OpenCode", "OpenCode.exe"));
77696
77950
  }
77697
77951
  return paths;
77698
77952
  }
@@ -77700,8 +77954,8 @@ function getDesktopAppPaths(platform) {
77700
77954
  return [
77701
77955
  "/usr/bin/opencode",
77702
77956
  "/usr/lib/opencode/opencode",
77703
- join29(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
77704
- join29(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
77957
+ join30(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
77958
+ join30(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
77705
77959
  ];
77706
77960
  default:
77707
77961
  return [];
@@ -77713,7 +77967,7 @@ function buildVersionCommand(binaryPath, platform) {
77713
77967
  }
77714
77968
  return [binaryPath, "--version"];
77715
77969
  }
77716
- function findDesktopBinary(platform = process.platform, checkExists = existsSync30) {
77970
+ function findDesktopBinary(platform = process.platform, checkExists = existsSync31) {
77717
77971
  for (const desktopPath of getDesktopAppPaths(platform)) {
77718
77972
  if (checkExists(desktopPath)) {
77719
77973
  return { binary: "opencode", path: desktopPath };
@@ -77759,12 +78013,12 @@ function compareVersions3(current, minimum) {
77759
78013
 
77760
78014
  // src/cli/doctor/checks/system-plugin.ts
77761
78015
  init_shared();
77762
- import { existsSync as existsSync31, readFileSync as readFileSync25 } from "fs";
78016
+ import { existsSync as existsSync32, readFileSync as readFileSync25 } from "fs";
77763
78017
  function detectConfigPath() {
77764
78018
  const paths = getOpenCodeConfigPaths({ binary: "opencode", version: null });
77765
- if (existsSync31(paths.configJsonc))
78019
+ if (existsSync32(paths.configJsonc))
77766
78020
  return paths.configJsonc;
77767
- if (existsSync31(paths.configJson))
78021
+ if (existsSync32(paths.configJson))
77768
78022
  return paths.configJson;
77769
78023
  return null;
77770
78024
  }
@@ -77848,34 +78102,34 @@ function getPluginInfo() {
77848
78102
  init_file_utils();
77849
78103
  init_checker();
77850
78104
  init_auto_update_checker();
77851
- import { existsSync as existsSync32, readFileSync as readFileSync26 } from "fs";
77852
- import { homedir as homedir7 } from "os";
77853
- import { join as join30 } from "path";
78105
+ import { existsSync as existsSync33, readFileSync as readFileSync26 } from "fs";
78106
+ import { homedir as homedir8 } from "os";
78107
+ import { join as join31 } from "path";
77854
78108
  init_shared();
77855
78109
  function getPlatformDefaultCacheDir(platform = process.platform) {
77856
78110
  if (platform === "darwin")
77857
- return join30(homedir7(), "Library", "Caches");
78111
+ return join31(homedir8(), "Library", "Caches");
77858
78112
  if (platform === "win32")
77859
- return process.env.LOCALAPPDATA ?? join30(homedir7(), "AppData", "Local");
77860
- return join30(homedir7(), ".cache");
78113
+ return process.env.LOCALAPPDATA ?? join31(homedir8(), "AppData", "Local");
78114
+ return join31(homedir8(), ".cache");
77861
78115
  }
77862
78116
  function resolveOpenCodeCacheDir() {
77863
78117
  const xdgCacheHome = process.env.XDG_CACHE_HOME;
77864
78118
  if (xdgCacheHome)
77865
- return join30(xdgCacheHome, "opencode");
78119
+ return join31(xdgCacheHome, "opencode");
77866
78120
  const fromShared = getOpenCodeCacheDir();
77867
- const platformDefault = join30(getPlatformDefaultCacheDir(), "opencode");
77868
- if (existsSync32(fromShared) || !existsSync32(platformDefault))
78121
+ const platformDefault = join31(getPlatformDefaultCacheDir(), "opencode");
78122
+ if (existsSync33(fromShared) || !existsSync33(platformDefault))
77869
78123
  return fromShared;
77870
78124
  return platformDefault;
77871
78125
  }
77872
78126
  function resolveExistingDir(dirPath) {
77873
- if (!existsSync32(dirPath))
78127
+ if (!existsSync33(dirPath))
77874
78128
  return dirPath;
77875
78129
  return resolveSymlink(dirPath);
77876
78130
  }
77877
78131
  function readPackageJson(filePath) {
77878
- if (!existsSync32(filePath))
78132
+ if (!existsSync33(filePath))
77879
78133
  return null;
77880
78134
  try {
77881
78135
  const content = readFileSync26(filePath, "utf-8");
@@ -77893,11 +78147,11 @@ function normalizeVersion(value) {
77893
78147
  function createPackageCandidates(rootDir) {
77894
78148
  return ACCEPTED_PACKAGE_NAMES.map((packageName) => ({
77895
78149
  packageName,
77896
- installedPackagePath: join30(rootDir, "node_modules", packageName, "package.json")
78150
+ installedPackagePath: join31(rootDir, "node_modules", packageName, "package.json")
77897
78151
  }));
77898
78152
  }
77899
78153
  function selectInstalledPackage(candidate) {
77900
- return candidate.packageCandidates.find((packageCandidate) => existsSync32(packageCandidate.installedPackagePath)) ?? candidate.packageCandidates[0];
78154
+ return candidate.packageCandidates.find((packageCandidate) => existsSync33(packageCandidate.installedPackagePath)) ?? candidate.packageCandidates[0];
77901
78155
  }
77902
78156
  function getExpectedVersion(cachePackage, packageName) {
77903
78157
  return normalizeVersion(cachePackage?.dependencies?.[packageName]) ?? normalizeVersion(cachePackage?.dependencies?.[PACKAGE_NAME]);
@@ -77909,16 +78163,16 @@ function getLoadedPluginVersion() {
77909
78163
  const candidates = [
77910
78164
  {
77911
78165
  cacheDir: configDir,
77912
- cachePackagePath: join30(configDir, "package.json"),
78166
+ cachePackagePath: join31(configDir, "package.json"),
77913
78167
  packageCandidates: createPackageCandidates(configDir)
77914
78168
  },
77915
78169
  {
77916
78170
  cacheDir,
77917
- cachePackagePath: join30(cacheDir, "package.json"),
78171
+ cachePackagePath: join31(cacheDir, "package.json"),
77918
78172
  packageCandidates: createPackageCandidates(cacheDir)
77919
78173
  }
77920
78174
  ];
77921
- const selectedCandidate = candidates.find((candidate) => candidate.packageCandidates.some((packageCandidate) => existsSync32(packageCandidate.installedPackagePath))) ?? candidates[0];
78175
+ const selectedCandidate = candidates.find((candidate) => candidate.packageCandidates.some((packageCandidate) => existsSync33(packageCandidate.installedPackagePath))) ?? candidates[0];
77922
78176
  const { cacheDir: selectedDir, cachePackagePath } = selectedCandidate;
77923
78177
  const selectedPackage = selectInstalledPackage(selectedCandidate);
77924
78178
  const installedPackagePath = selectedPackage.installedPackagePath;
@@ -77957,7 +78211,7 @@ var defaultDeps3 = {
77957
78211
  function isConfigValid(configPath) {
77958
78212
  if (!configPath)
77959
78213
  return true;
77960
- if (!existsSync33(configPath))
78214
+ if (!existsSync34(configPath))
77961
78215
  return false;
77962
78216
  try {
77963
78217
  parseJsonc(readFileSync27(configPath, "utf-8"));
@@ -78083,28 +78337,28 @@ async function checkSystem(deps = defaultDeps3) {
78083
78337
 
78084
78338
  // src/cli/doctor/checks/config.ts
78085
78339
  import { readFileSync as readFileSync30 } from "fs";
78086
- import { join as join34 } from "path";
78340
+ import { join as join35 } from "path";
78087
78341
  init_shared();
78088
78342
 
78089
78343
  // src/cli/doctor/checks/model-resolution-cache.ts
78090
78344
  init_shared();
78091
- import { existsSync as existsSync34, readFileSync as readFileSync28 } from "fs";
78092
- import { homedir as homedir8 } from "os";
78093
- import { join as join31 } from "path";
78345
+ import { existsSync as existsSync35, readFileSync as readFileSync28 } from "fs";
78346
+ import { homedir as homedir9 } from "os";
78347
+ import { join as join32 } from "path";
78094
78348
  function getUserConfigDir2() {
78095
78349
  const xdgConfig = process.env.XDG_CONFIG_HOME;
78096
78350
  if (xdgConfig)
78097
- return join31(xdgConfig, "opencode");
78098
- return join31(homedir8(), ".config", "opencode");
78351
+ return join32(xdgConfig, "opencode");
78352
+ return join32(homedir9(), ".config", "opencode");
78099
78353
  }
78100
78354
  function loadCustomProviderNames() {
78101
78355
  const configDir = getUserConfigDir2();
78102
78356
  const candidatePaths = [
78103
- join31(configDir, "opencode.json"),
78104
- join31(configDir, "opencode.jsonc")
78357
+ join32(configDir, "opencode.json"),
78358
+ join32(configDir, "opencode.jsonc")
78105
78359
  ];
78106
78360
  for (const configPath of candidatePaths) {
78107
- if (!existsSync34(configPath))
78361
+ if (!existsSync35(configPath))
78108
78362
  continue;
78109
78363
  try {
78110
78364
  const content = readFileSync28(configPath, "utf-8");
@@ -78117,9 +78371,9 @@ function loadCustomProviderNames() {
78117
78371
  return [];
78118
78372
  }
78119
78373
  function loadAvailableModelsFromCache() {
78120
- const cacheFile = join31(getOpenCodeCacheDir(), "models.json");
78374
+ const cacheFile = join32(getOpenCodeCacheDir(), "models.json");
78121
78375
  const customProviders = loadCustomProviderNames();
78122
- if (!existsSync34(cacheFile)) {
78376
+ if (!existsSync35(cacheFile)) {
78123
78377
  if (customProviders.length > 0) {
78124
78378
  return { providers: customProviders, modelCount: 0, cacheExists: true };
78125
78379
  }
@@ -78150,8 +78404,8 @@ init_model_capabilities();
78150
78404
  // src/cli/doctor/checks/model-resolution-config.ts
78151
78405
  init_shared();
78152
78406
  import { readFileSync as readFileSync29 } from "fs";
78153
- import { join as join32 } from "path";
78154
- var PROJECT_CONFIG_DIR = join32(process.cwd(), ".opencode");
78407
+ import { join as join33 } from "path";
78408
+ var PROJECT_CONFIG_DIR = join33(process.cwd(), ".opencode");
78155
78409
  function loadOmoConfig() {
78156
78410
  const projectDetected = detectPluginConfigFile(PROJECT_CONFIG_DIR);
78157
78411
  if (projectDetected.format !== "none") {
@@ -78177,7 +78431,7 @@ function loadOmoConfig() {
78177
78431
 
78178
78432
  // src/cli/doctor/checks/model-resolution-details.ts
78179
78433
  init_shared();
78180
- import { join as join33 } from "path";
78434
+ import { join as join34 } from "path";
78181
78435
 
78182
78436
  // src/cli/doctor/checks/model-resolution-variant.ts
78183
78437
  function formatModelWithVariant(model, variant) {
@@ -78219,7 +78473,7 @@ function formatCapabilityResolutionLabel(mode) {
78219
78473
  }
78220
78474
  function buildModelResolutionDetails(options) {
78221
78475
  const details = [];
78222
- const cacheFile = join33(getOpenCodeCacheDir(), "models.json");
78476
+ const cacheFile = join34(getOpenCodeCacheDir(), "models.json");
78223
78477
  details.push("\u2550\u2550\u2550 Available Models (from cache) \u2550\u2550\u2550");
78224
78478
  details.push("");
78225
78479
  if (options.available.cacheExists) {
@@ -78374,7 +78628,7 @@ async function checkModels() {
78374
78628
  }
78375
78629
 
78376
78630
  // src/cli/doctor/checks/config.ts
78377
- var PROJECT_CONFIG_DIR2 = join34(process.cwd(), ".opencode");
78631
+ var PROJECT_CONFIG_DIR2 = join35(process.cwd(), ".opencode");
78378
78632
  function findConfigPath() {
78379
78633
  const projectConfig = detectPluginConfigFile(PROJECT_CONFIG_DIR2);
78380
78634
  if (projectConfig.format !== "none")
@@ -78494,27 +78748,27 @@ async function checkConfig() {
78494
78748
  }
78495
78749
 
78496
78750
  // src/cli/doctor/checks/dependencies.ts
78497
- import { existsSync as existsSync35 } from "fs";
78751
+ import { existsSync as existsSync36 } from "fs";
78498
78752
  import { createRequire } from "module";
78499
- import { dirname as dirname14, join as join36 } from "path";
78753
+ import { dirname as dirname15, join as join37 } from "path";
78500
78754
 
78501
78755
  // src/hooks/comment-checker/downloader.ts
78502
- import { join as join35 } from "path";
78503
- import { homedir as homedir9, tmpdir as tmpdir3 } from "os";
78756
+ import { join as join36 } from "path";
78757
+ import { homedir as homedir10, tmpdir as tmpdir3 } from "os";
78504
78758
  init_binary_downloader();
78505
78759
  init_logger();
78506
78760
  init_plugin_identity();
78507
78761
  var DEBUG = process.env.COMMENT_CHECKER_DEBUG === "1";
78508
- var DEBUG_FILE = join35(tmpdir3(), "comment-checker-debug.log");
78762
+ var DEBUG_FILE = join36(tmpdir3(), "comment-checker-debug.log");
78509
78763
  function getCacheDir2() {
78510
78764
  if (process.platform === "win32") {
78511
78765
  const localAppData = process.env.LOCALAPPDATA || process.env.APPDATA;
78512
- const base2 = localAppData || join35(homedir9(), "AppData", "Local");
78513
- return join35(base2, CACHE_DIR_NAME, "bin");
78766
+ const base2 = localAppData || join36(homedir10(), "AppData", "Local");
78767
+ return join36(base2, CACHE_DIR_NAME, "bin");
78514
78768
  }
78515
78769
  const xdgCache = process.env.XDG_CACHE_HOME;
78516
- const base = xdgCache || join35(homedir9(), ".cache");
78517
- return join35(base, CACHE_DIR_NAME, "bin");
78770
+ const base = xdgCache || join36(homedir10(), ".cache");
78771
+ return join36(base, CACHE_DIR_NAME, "bin");
78518
78772
  }
78519
78773
  function getBinaryName() {
78520
78774
  return process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
@@ -78578,15 +78832,15 @@ async function checkAstGrepNapi() {
78578
78832
  path: null
78579
78833
  };
78580
78834
  } catch {
78581
- const { existsSync: existsSync36 } = await import("fs");
78582
- const { join: join37 } = await import("path");
78583
- const { homedir: homedir10 } = await import("os");
78835
+ const { existsSync: existsSync37 } = await import("fs");
78836
+ const { join: join38 } = await import("path");
78837
+ const { homedir: homedir11 } = await import("os");
78584
78838
  const pathsToCheck = [
78585
- join37(homedir10(), ".config", "opencode", "node_modules", "@ast-grep", "napi"),
78586
- join37(process.cwd(), "node_modules", "@ast-grep", "napi")
78839
+ join38(homedir11(), ".config", "opencode", "node_modules", "@ast-grep", "napi"),
78840
+ join38(process.cwd(), "node_modules", "@ast-grep", "napi")
78587
78841
  ];
78588
78842
  for (const napiPath of pathsToCheck) {
78589
- if (existsSync36(napiPath)) {
78843
+ if (existsSync37(napiPath)) {
78590
78844
  return {
78591
78845
  name: "AST-Grep NAPI",
78592
78846
  required: false,
@@ -78611,8 +78865,8 @@ function findCommentCheckerPackageBinary() {
78611
78865
  try {
78612
78866
  const require2 = createRequire(import.meta.url);
78613
78867
  const pkgPath = require2.resolve("@code-yeongyu/comment-checker/package.json");
78614
- const binaryPath = join36(dirname14(pkgPath), "bin", binaryName);
78615
- if (existsSync35(binaryPath))
78868
+ const binaryPath = join37(dirname15(pkgPath), "bin", binaryName);
78869
+ if (existsSync36(binaryPath))
78616
78870
  return binaryPath;
78617
78871
  } catch {}
78618
78872
  return null;
@@ -78708,6 +78962,19 @@ async function getGhAuthStatus() {
78708
78962
  async function getGhCliInfo() {
78709
78963
  const binaryStatus = await checkBinaryExists2("gh");
78710
78964
  if (!binaryStatus.exists) {
78965
+ const version4 = await getGhVersion();
78966
+ if (version4) {
78967
+ const authStatus2 = await getGhAuthStatus();
78968
+ return {
78969
+ installed: true,
78970
+ version: version4,
78971
+ path: null,
78972
+ authenticated: authStatus2.authenticated,
78973
+ username: authStatus2.username,
78974
+ scopes: authStatus2.scopes,
78975
+ error: authStatus2.error
78976
+ };
78977
+ }
78711
78978
  return {
78712
78979
  installed: false,
78713
78980
  version: null,
@@ -78773,12 +79040,12 @@ var BUILTIN_SERVERS = {
78773
79040
  "kotlin-ls": { command: ["kotlin-lsp"], extensions: [".kt", ".kts"] }
78774
79041
  };
78775
79042
  // src/tools/lsp/server-config-loader.ts
78776
- import { existsSync as existsSync36, readFileSync as readFileSync31 } from "fs";
78777
- import { join as join37 } from "path";
79043
+ import { existsSync as existsSync37, readFileSync as readFileSync31 } from "fs";
79044
+ import { join as join38 } from "path";
78778
79045
  init_shared();
78779
79046
  init_jsonc_parser();
78780
79047
  function loadJsonFile(path12) {
78781
- if (!existsSync36(path12))
79048
+ if (!existsSync37(path12))
78782
79049
  return null;
78783
79050
  try {
78784
79051
  return parseJsonc(readFileSync31(path12, "utf-8"));
@@ -78790,9 +79057,9 @@ function getConfigPaths2() {
78790
79057
  const cwd = process.cwd();
78791
79058
  const configDir = getOpenCodeConfigDir({ binary: "opencode" });
78792
79059
  return {
78793
- project: detectPluginConfigFile(join37(cwd, ".opencode")).path,
79060
+ project: detectPluginConfigFile(join38(cwd, ".opencode")).path,
78794
79061
  user: detectPluginConfigFile(configDir).path,
78795
- opencode: detectConfigFile(join37(configDir, "opencode")).path
79062
+ opencode: detectConfigFile(join38(configDir, "opencode")).path
78796
79063
  };
78797
79064
  }
78798
79065
  function loadAllConfigs() {
@@ -78861,21 +79128,21 @@ function getMergedServers() {
78861
79128
  }
78862
79129
 
78863
79130
  // src/tools/lsp/server-installation.ts
78864
- import { existsSync as existsSync37 } from "fs";
78865
- import { delimiter as delimiter2, join as join39 } from "path";
79131
+ import { existsSync as existsSync38 } from "fs";
79132
+ import { delimiter as delimiter2, join as join40 } from "path";
78866
79133
 
78867
79134
  // src/tools/lsp/server-path-bases.ts
78868
79135
  init_shared();
78869
- import { join as join38 } from "path";
79136
+ import { join as join39 } from "path";
78870
79137
  function getLspServerAdditionalPathBases(workingDirectory) {
78871
79138
  const configDir = getOpenCodeConfigDir({ binary: "opencode" });
78872
- const dataDir = join38(getDataDir(), "opencode");
79139
+ const dataDir = join39(getDataDir(), "opencode");
78873
79140
  return [
78874
- join38(workingDirectory, "node_modules", ".bin"),
78875
- join38(configDir, "bin"),
78876
- join38(configDir, "node_modules", ".bin"),
78877
- join38(dataDir, "bin"),
78878
- join38(dataDir, "bin", "node_modules", ".bin")
79141
+ join39(workingDirectory, "node_modules", ".bin"),
79142
+ join39(configDir, "bin"),
79143
+ join39(configDir, "node_modules", ".bin"),
79144
+ join39(dataDir, "bin"),
79145
+ join39(dataDir, "bin", "node_modules", ".bin")
78879
79146
  ];
78880
79147
  }
78881
79148
 
@@ -78885,7 +79152,7 @@ function isServerInstalled(command) {
78885
79152
  return false;
78886
79153
  const cmd = command[0];
78887
79154
  if (cmd.includes("/") || cmd.includes("\\")) {
78888
- if (existsSync37(cmd))
79155
+ if (existsSync38(cmd))
78889
79156
  return true;
78890
79157
  }
78891
79158
  const isWindows = process.platform === "win32";
@@ -78906,14 +79173,14 @@ function isServerInstalled(command) {
78906
79173
  const paths = pathEnv.split(delimiter2);
78907
79174
  for (const p2 of paths) {
78908
79175
  for (const suffix of exts) {
78909
- if (existsSync37(join39(p2, cmd + suffix))) {
79176
+ if (existsSync38(join40(p2, cmd + suffix))) {
78910
79177
  return true;
78911
79178
  }
78912
79179
  }
78913
79180
  }
78914
79181
  for (const base of getLspServerAdditionalPathBases(process.cwd())) {
78915
79182
  for (const suffix of exts) {
78916
- if (existsSync37(join39(base, cmd + suffix))) {
79183
+ if (existsSync38(join40(base, cmd + suffix))) {
78917
79184
  return true;
78918
79185
  }
78919
79186
  }
@@ -78975,21 +79242,21 @@ function getInstalledLspServers() {
78975
79242
 
78976
79243
  // src/cli/doctor/checks/tools-mcp.ts
78977
79244
  init_shared();
78978
- import { existsSync as existsSync38, readFileSync as readFileSync32 } from "fs";
78979
- import { homedir as homedir10 } from "os";
78980
- import { join as join40 } from "path";
79245
+ import { existsSync as existsSync39, readFileSync as readFileSync32 } from "fs";
79246
+ import { homedir as homedir11 } from "os";
79247
+ import { join as join41 } from "path";
78981
79248
  var BUILTIN_MCP_SERVERS = ["context7", "grep_app"];
78982
79249
  function getMcpConfigPaths() {
78983
79250
  return [
78984
- join40(homedir10(), ".claude", ".mcp.json"),
78985
- join40(process.cwd(), ".mcp.json"),
78986
- join40(process.cwd(), ".claude", ".mcp.json")
79251
+ join41(homedir11(), ".claude", ".mcp.json"),
79252
+ join41(process.cwd(), ".mcp.json"),
79253
+ join41(process.cwd(), ".claude", ".mcp.json")
78987
79254
  ];
78988
79255
  }
78989
79256
  function loadUserMcpConfig() {
78990
79257
  const servers = {};
78991
79258
  for (const configPath of getMcpConfigPaths()) {
78992
- if (!existsSync38(configPath))
79259
+ if (!existsSync39(configPath))
78993
79260
  continue;
78994
79261
  try {
78995
79262
  const content = readFileSync32(configPath, "utf-8");
@@ -79123,6 +79390,88 @@ async function checkTools() {
79123
79390
  issues
79124
79391
  };
79125
79392
  }
79393
+
79394
+ // src/features/team-mode/deps.ts
79395
+ async function checkTeamModeDependencies(config2) {
79396
+ const tmuxAvailable = Boolean(process.env["TMUX"]) || await probeBinary("tmux", ["-V"]);
79397
+ const gitAvailable = await probeBinary("git", ["--version"]);
79398
+ if (config2.tmux_visualization && !tmuxAvailable) {
79399
+ console.warn("[team-mode] tmux_visualization=true but tmux not available; layout will be skipped at runtime");
79400
+ }
79401
+ return { tmuxAvailable, gitAvailable };
79402
+ }
79403
+ async function probeBinary(cmd, args) {
79404
+ try {
79405
+ const proc = Bun.spawn({ cmd: [cmd, ...args], stdout: "pipe", stderr: "pipe" });
79406
+ const code = await proc.exited;
79407
+ return code === 0;
79408
+ } catch {
79409
+ return false;
79410
+ }
79411
+ }
79412
+
79413
+ // src/features/team-mode/team-registry/paths.ts
79414
+ init_logger();
79415
+ import { homedir as homedir12 } from "os";
79416
+ import path12 from "path";
79417
+ function resolveBaseDir(config2) {
79418
+ return config2.base_dir ?? path12.join(homedir12(), ".omo");
79419
+ }
79420
+
79421
+ // src/cli/doctor/checks/team-mode.ts
79422
+ init_shared();
79423
+ import { readFileSync as readFileSync33, promises as fs12 } from "fs";
79424
+ import path13 from "path";
79425
+ async function checkTeamMode() {
79426
+ const config2 = loadTeamModeConfig();
79427
+ const teamModeConfig = TeamModeConfigSchema.parse(config2.team_mode ?? {});
79428
+ if (!teamModeConfig.enabled) {
79429
+ return { name: CHECK_NAMES[CHECK_IDS.TEAM_MODE], status: "skip", message: "team_mode: disabled", issues: [] };
79430
+ }
79431
+ const deps = await checkTeamModeDependencies(teamModeConfig);
79432
+ const baseDir = resolveBaseDir(teamModeConfig);
79433
+ const [baseDirExists, teamCount, runtimeCount] = await Promise.all([
79434
+ pathExists(baseDir),
79435
+ safeCount(path13.join(baseDir, "teams")),
79436
+ safeCount(path13.join(baseDir, "runtime"))
79437
+ ]);
79438
+ const baseDirMessage = baseDirExists ? `base dir: ok` : `base dir: missing (plugin init will create it on first use)`;
79439
+ return {
79440
+ name: CHECK_NAMES[CHECK_IDS.TEAM_MODE],
79441
+ status: deps.tmuxAvailable && deps.gitAvailable ? "pass" : "warn",
79442
+ message: `team_mode: enabled | tmux: ${deps.tmuxAvailable ? "ok" : "missing"} | git: ${deps.gitAvailable ? "ok" : "missing"} | ${baseDirMessage} | declared: ${teamCount} | runtime dirs: ${runtimeCount}`,
79443
+ details: undefined,
79444
+ issues: []
79445
+ };
79446
+ }
79447
+ function loadTeamModeConfig() {
79448
+ const projectConfig = detectPluginConfigFile(path13.join(process.cwd(), ".opencode"));
79449
+ const userConfig = detectPluginConfigFile(getOpenCodeConfigDir({ binary: "opencode" }));
79450
+ const configPath = projectConfig.format !== "none" ? projectConfig.path : userConfig.path;
79451
+ if (!configPath)
79452
+ return { team_mode: undefined };
79453
+ try {
79454
+ return parseJsonc(readFileSync33(configPath, "utf-8"));
79455
+ } catch {
79456
+ return { team_mode: undefined };
79457
+ }
79458
+ }
79459
+ async function safeCount(dir) {
79460
+ try {
79461
+ const entries = await fs12.readdir(dir, { withFileTypes: true });
79462
+ return entries.filter((entry) => entry.isDirectory()).length;
79463
+ } catch {
79464
+ return 0;
79465
+ }
79466
+ }
79467
+ async function pathExists(dir) {
79468
+ try {
79469
+ const stats = await fs12.stat(dir);
79470
+ return stats.isDirectory();
79471
+ } catch {
79472
+ return false;
79473
+ }
79474
+ }
79126
79475
  // src/cli/doctor/checks/index.ts
79127
79476
  function getAllCheckDefinitions() {
79128
79477
  return [
@@ -79146,6 +79495,11 @@ function getAllCheckDefinitions() {
79146
79495
  id: CHECK_IDS.MODELS,
79147
79496
  name: CHECK_NAMES[CHECK_IDS.MODELS],
79148
79497
  check: checkModels
79498
+ },
79499
+ {
79500
+ id: CHECK_IDS.TEAM_MODE,
79501
+ name: CHECK_NAMES[CHECK_IDS.TEAM_MODE],
79502
+ check: checkTeamMode
79149
79503
  }
79150
79504
  ];
79151
79505
  }
@@ -79452,8 +79806,18 @@ async function runDoctor(options) {
79452
79806
 
79453
79807
  // src/cli/doctor/index.ts
79454
79808
  async function doctor(options = { mode: "default" }) {
79455
- const result = await runDoctor(options);
79456
- return result.exitCode;
79809
+ try {
79810
+ const result = await runDoctor(options);
79811
+ return result.exitCode;
79812
+ } catch (error48) {
79813
+ const message = error48 instanceof Error ? error48.message : String(error48);
79814
+ console.error(`
79815
+ Doctor failed unexpectedly:`, message);
79816
+ console.error("This may indicate memory pressure (OOM/SIGKILL) or a corrupted installation.");
79817
+ console.error(`Try: OMO_DISABLE_POSTHOG=1 bunx oh-my-opencode doctor --verbose
79818
+ `);
79819
+ return EXIT_CODES.FAILURE;
79820
+ }
79457
79821
  }
79458
79822
 
79459
79823
  // src/cli/refresh-model-capabilities.ts
@@ -79490,11 +79854,11 @@ async function refreshModelCapabilities(options, deps = {}) {
79490
79854
 
79491
79855
  // src/features/mcp-oauth/storage.ts
79492
79856
  init_shared();
79493
- import { chmodSync as chmodSync2, existsSync as existsSync39, mkdirSync as mkdirSync12, readFileSync as readFileSync33, renameSync as renameSync4, unlinkSync as unlinkSync6, writeFileSync as writeFileSync10 } from "fs";
79494
- import { dirname as dirname15, join as join41 } from "path";
79857
+ import { chmodSync as chmodSync2, existsSync as existsSync40, mkdirSync as mkdirSync12, readFileSync as readFileSync34, renameSync as renameSync4, unlinkSync as unlinkSync6, writeFileSync as writeFileSync10 } from "fs";
79858
+ import { dirname as dirname16, join as join42 } from "path";
79495
79859
  var STORAGE_FILE_NAME = "mcp-oauth.json";
79496
79860
  function getMcpOauthStoragePath() {
79497
- return join41(getOpenCodeConfigDir({ binary: "opencode" }), STORAGE_FILE_NAME);
79861
+ return join42(getOpenCodeConfigDir({ binary: "opencode" }), STORAGE_FILE_NAME);
79498
79862
  }
79499
79863
  function normalizeHost(serverHost) {
79500
79864
  let host = serverHost.trim();
@@ -79531,11 +79895,11 @@ function buildKey(serverHost, resource) {
79531
79895
  }
79532
79896
  function readStore() {
79533
79897
  const filePath = getMcpOauthStoragePath();
79534
- if (!existsSync39(filePath)) {
79898
+ if (!existsSync40(filePath)) {
79535
79899
  return null;
79536
79900
  }
79537
79901
  try {
79538
- const content = readFileSync33(filePath, "utf-8");
79902
+ const content = readFileSync34(filePath, "utf-8");
79539
79903
  return JSON.parse(content);
79540
79904
  } catch {
79541
79905
  return null;
@@ -79544,8 +79908,8 @@ function readStore() {
79544
79908
  function writeStore(store2) {
79545
79909
  const filePath = getMcpOauthStoragePath();
79546
79910
  try {
79547
- const dir = dirname15(filePath);
79548
- if (!existsSync39(dir)) {
79911
+ const dir = dirname16(filePath);
79912
+ if (!existsSync40(dir)) {
79549
79913
  mkdirSync12(dir, { recursive: true });
79550
79914
  }
79551
79915
  const tempPath = `${filePath}.tmp.${Date.now()}`;
@@ -79582,7 +79946,7 @@ function deleteToken(serverHost, resource) {
79582
79946
  if (Object.keys(store2).length === 0) {
79583
79947
  try {
79584
79948
  const filePath = getMcpOauthStoragePath();
79585
- if (existsSync39(filePath)) {
79949
+ if (existsSync40(filePath)) {
79586
79950
  unlinkSync6(filePath);
79587
79951
  }
79588
79952
  return true;
@@ -79775,7 +80139,7 @@ async function findAvailablePort2(startPort = DEFAULT_PORT) {
79775
80139
  }
79776
80140
 
79777
80141
  // src/features/mcp-oauth/oauth-authorization-flow.ts
79778
- import { spawn } from "child_process";
80142
+ import { spawn as spawn2 } from "child_process";
79779
80143
  import { createHash as createHash2, randomBytes as randomBytes2 } from "crypto";
79780
80144
  import { createServer } from "http";
79781
80145
  function generateCodeVerifier() {
@@ -79802,7 +80166,7 @@ function buildAuthorizationUrl(authorizationEndpoint, options) {
79802
80166
  }
79803
80167
  var CALLBACK_TIMEOUT_MS = 5 * 60 * 1000;
79804
80168
  function startCallbackServer(port) {
79805
- return new Promise((resolve4, reject) => {
80169
+ return new Promise((resolve6, reject) => {
79806
80170
  let timeoutId;
79807
80171
  const server2 = createServer((request, response) => {
79808
80172
  clearTimeout(timeoutId);
@@ -79828,7 +80192,7 @@ function startCallbackServer(port) {
79828
80192
  response.writeHead(200, { "content-type": "text/html" });
79829
80193
  response.end("<html><body><h1>Authorization successful. You can close this tab.</h1></body></html>");
79830
80194
  server2.close();
79831
- resolve4({ code, state: state2 });
80195
+ resolve6({ code, state: state2 });
79832
80196
  });
79833
80197
  timeoutId = setTimeout(() => {
79834
80198
  server2.close();
@@ -79856,7 +80220,7 @@ function openBrowser(url2) {
79856
80220
  args = [url2];
79857
80221
  }
79858
80222
  try {
79859
- const child = spawn(command, args, { stdio: "ignore", detached: true });
80223
+ const child = spawn2(command, args, { stdio: "ignore", detached: true });
79860
80224
  child.on("error", () => {});
79861
80225
  child.unref();
79862
80226
  } catch {}