oh-my-opencode 3.17.15 → 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 (161) 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 +541 -292
  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 +75095 -72462
  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 +1 -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/stale-session-sweep.d.ts +9 -2
  152. package/dist/shared/tmux/tmux-utils/window-spawn.d.ts +13 -1
  153. package/dist/shared/tmux/tmux-utils.d.ts +1 -1
  154. package/dist/tools/delegate-task/openai-categories.d.ts +1 -0
  155. package/dist/tools/delegate-task/skill-resolver.d.ts +1 -0
  156. package/dist/tools/delegate-task/subagent-resolver.d.ts +5 -1
  157. package/dist/tools/delegate-task/types.d.ts +1 -0
  158. package/dist/tools/index.d.ts +1 -0
  159. package/dist/tools/look-at/missing-file-error.d.ts +2 -0
  160. package/dist/tools/skill/types.d.ts +2 -0
  161. package/package.json +12 -12
package/dist/cli/index.js CHANGED
@@ -6738,7 +6738,8 @@ function spawn(cmdOrOpts, opts) {
6738
6738
  cwd: options.cwd,
6739
6739
  env: options.env,
6740
6740
  stdio: resolveStdio(options),
6741
- detached: options.detached
6741
+ detached: options.detached,
6742
+ signal: options.signal
6742
6743
  });
6743
6744
  return wrapNodeProcess(proc);
6744
6745
  }
@@ -6811,7 +6812,7 @@ function stripInvisibleAgentCharacters(agentName) {
6811
6812
  return agentName.replace(INVISIBLE_AGENT_CHARACTERS_REGEX, "");
6812
6813
  }
6813
6814
  function stripAgentListSortPrefix(agentName) {
6814
- return stripInvisibleAgentCharacters(agentName);
6815
+ return stripInvisibleAgentCharacters(agentName).replace(VISIBLE_AGENT_LIST_SORT_PREFIX_REGEX, "").replace(AGENT_WRAPPER_CHARS_REGEX, "");
6815
6816
  }
6816
6817
  function getAgentDisplayName(configKey) {
6817
6818
  const exactMatch = AGENT_DISPLAY_NAMES[configKey];
@@ -6840,7 +6841,7 @@ function getAgentConfigKey(agentName) {
6840
6841
  const lower = stripAgentListSortPrefix(agentName).trim().toLowerCase();
6841
6842
  return resolveKnownAgentConfigKey(agentName) ?? lower;
6842
6843
  }
6843
- 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;
6844
6845
  var init_agent_display_names = __esm(() => {
6845
6846
  AGENT_DISPLAY_NAMES = {
6846
6847
  sisyphus: "Sisyphus - Ultraworker",
@@ -6859,6 +6860,8 @@ var init_agent_display_names = __esm(() => {
6859
6860
  "council-member": "council-member"
6860
6861
  };
6861
6862
  INVISIBLE_AGENT_CHARACTERS_REGEX = /[\u200B\u200C\u200D\uFEFF]/g;
6863
+ VISIBLE_AGENT_LIST_SORT_PREFIX_REGEX = /^\d+\|/;
6864
+ AGENT_WRAPPER_CHARS_REGEX = /^[\\/"']+|[\\/"']+$/g;
6862
6865
  REVERSE_DISPLAY_NAMES = Object.fromEntries(Object.entries(AGENT_DISPLAY_NAMES).map(([key, displayName]) => [displayName.toLowerCase(), key]));
6863
6866
  LEGACY_DISPLAY_NAMES = {
6864
6867
  "sisyphus (ultraworker)": "sisyphus",
@@ -6883,7 +6886,7 @@ var init_model_requirements = __esm(() => {
6883
6886
  model: "claude-opus-4-7",
6884
6887
  variant: "max"
6885
6888
  },
6886
- { providers: ["opencode-go", "vercel"], model: "kimi-k2.5" },
6889
+ { providers: ["opencode-go", "vercel"], model: "kimi-k2.6" },
6887
6890
  { providers: ["kimi-for-coding"], model: "k2p5" },
6888
6891
  {
6889
6892
  providers: [
@@ -6930,13 +6933,14 @@ var init_model_requirements = __esm(() => {
6930
6933
  model: "claude-opus-4-7",
6931
6934
  variant: "max"
6932
6935
  },
6933
- { providers: ["opencode-go", "vercel"], model: "glm-5" }
6936
+ { providers: ["opencode-go", "vercel"], model: "glm-5.1" }
6934
6937
  ]
6935
6938
  },
6936
6939
  librarian: {
6937
6940
  fallbackChain: [
6938
6941
  { providers: ["openai"], model: "gpt-5.4-mini-fast" },
6939
- { 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" },
6940
6944
  { providers: ["opencode-go", "vercel"], model: "minimax-m2.7" },
6941
6945
  { providers: ["anthropic", "opencode", "vercel"], model: "claude-haiku-4-5" },
6942
6946
  { providers: ["openai", "opencode", "vercel"], model: "gpt-5.4-nano" }
@@ -6945,7 +6949,8 @@ var init_model_requirements = __esm(() => {
6945
6949
  explore: {
6946
6950
  fallbackChain: [
6947
6951
  { providers: ["openai"], model: "gpt-5.4-mini-fast" },
6948
- { 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" },
6949
6954
  { providers: ["opencode-go", "vercel"], model: "minimax-m2.7" },
6950
6955
  { providers: ["anthropic", "opencode", "vercel"], model: "claude-haiku-4-5" },
6951
6956
  { providers: ["openai", "opencode", "vercel"], model: "gpt-5.4-nano" }
@@ -6954,7 +6959,7 @@ var init_model_requirements = __esm(() => {
6954
6959
  "multimodal-looker": {
6955
6960
  fallbackChain: [
6956
6961
  { providers: ["openai", "opencode", "vercel"], model: "gpt-5.5", variant: "medium" },
6957
- { providers: ["opencode-go", "vercel"], model: "kimi-k2.5" },
6962
+ { providers: ["opencode-go", "vercel"], model: "kimi-k2.6" },
6958
6963
  { providers: ["zai-coding-plan", "vercel"], model: "glm-4.6v" },
6959
6964
  { providers: ["openai", "github-copilot", "opencode", "vercel"], model: "gpt-5-nano" }
6960
6965
  ]
@@ -6971,7 +6976,7 @@ var init_model_requirements = __esm(() => {
6971
6976
  model: "gpt-5.5",
6972
6977
  variant: "high"
6973
6978
  },
6974
- { providers: ["opencode-go", "vercel"], model: "glm-5" },
6979
+ { providers: ["opencode-go", "vercel"], model: "glm-5.1" },
6975
6980
  {
6976
6981
  providers: ["google", "github-copilot", "opencode", "vercel"],
6977
6982
  model: "gemini-3.1-pro"
@@ -6990,7 +6995,7 @@ var init_model_requirements = __esm(() => {
6990
6995
  model: "gpt-5.5",
6991
6996
  variant: "high"
6992
6997
  },
6993
- { providers: ["opencode-go", "vercel"], model: "glm-5" },
6998
+ { providers: ["opencode-go", "vercel"], model: "glm-5.1" },
6994
6999
  { providers: ["kimi-for-coding"], model: "k2p5" }
6995
7000
  ]
6996
7001
  },
@@ -7011,13 +7016,13 @@ var init_model_requirements = __esm(() => {
7011
7016
  model: "gemini-3.1-pro",
7012
7017
  variant: "high"
7013
7018
  },
7014
- { providers: ["opencode-go", "vercel"], model: "glm-5" }
7019
+ { providers: ["opencode-go", "vercel"], model: "glm-5.1" }
7015
7020
  ]
7016
7021
  },
7017
7022
  atlas: {
7018
7023
  fallbackChain: [
7019
7024
  { providers: ["anthropic", "github-copilot", "opencode", "vercel"], model: "claude-sonnet-4-6" },
7020
- { providers: ["opencode-go", "vercel"], model: "kimi-k2.5" },
7025
+ { providers: ["opencode-go", "vercel"], model: "kimi-k2.6" },
7021
7026
  {
7022
7027
  providers: ["openai", "github-copilot", "opencode", "vercel"],
7023
7028
  model: "gpt-5.5",
@@ -7029,7 +7034,7 @@ var init_model_requirements = __esm(() => {
7029
7034
  "sisyphus-junior": {
7030
7035
  fallbackChain: [
7031
7036
  { providers: ["anthropic", "github-copilot", "opencode", "vercel"], model: "claude-sonnet-4-6" },
7032
- { providers: ["opencode-go", "vercel"], model: "kimi-k2.5" },
7037
+ { providers: ["opencode-go", "vercel"], model: "kimi-k2.6" },
7033
7038
  {
7034
7039
  providers: ["openai", "github-copilot", "opencode", "vercel"],
7035
7040
  model: "gpt-5.5",
@@ -7054,7 +7059,7 @@ var init_model_requirements = __esm(() => {
7054
7059
  model: "claude-opus-4-7",
7055
7060
  variant: "max"
7056
7061
  },
7057
- { providers: ["opencode-go", "vercel"], model: "glm-5" },
7062
+ { providers: ["opencode-go", "vercel"], model: "glm-5.1" },
7058
7063
  { providers: ["kimi-for-coding"], model: "k2p5" }
7059
7064
  ]
7060
7065
  },
@@ -7075,7 +7080,7 @@ var init_model_requirements = __esm(() => {
7075
7080
  model: "claude-opus-4-7",
7076
7081
  variant: "max"
7077
7082
  },
7078
- { providers: ["opencode-go", "vercel"], model: "glm-5" }
7083
+ { providers: ["opencode-go", "vercel"], model: "glm-5.1" }
7079
7084
  ]
7080
7085
  },
7081
7086
  deep: {
@@ -7110,8 +7115,7 @@ var init_model_requirements = __esm(() => {
7110
7115
  variant: "max"
7111
7116
  },
7112
7117
  { providers: ["openai", "github-copilot", "opencode", "vercel"], model: "gpt-5.5" }
7113
- ],
7114
- requiresModel: "gemini-3.1-pro"
7118
+ ]
7115
7119
  },
7116
7120
  quick: {
7117
7121
  fallbackChain: [
@@ -7142,7 +7146,7 @@ var init_model_requirements = __esm(() => {
7142
7146
  model: "gpt-5.3-codex",
7143
7147
  variant: "medium"
7144
7148
  },
7145
- { providers: ["opencode-go", "vercel"], model: "kimi-k2.5" },
7149
+ { providers: ["opencode-go", "vercel"], model: "kimi-k2.6" },
7146
7150
  {
7147
7151
  providers: ["google", "github-copilot", "opencode", "vercel"],
7148
7152
  model: "gemini-3-flash"
@@ -7164,7 +7168,7 @@ var init_model_requirements = __esm(() => {
7164
7168
  },
7165
7169
  { providers: ["zai-coding-plan", "opencode", "vercel"], model: "glm-5" },
7166
7170
  { providers: ["kimi-for-coding"], model: "k2p5" },
7167
- { providers: ["opencode-go", "vercel"], model: "glm-5" },
7171
+ { providers: ["opencode-go", "vercel"], model: "glm-5.1" },
7168
7172
  { providers: ["opencode", "vercel"], model: "kimi-k2.5" },
7169
7173
  {
7170
7174
  providers: [
@@ -7186,7 +7190,7 @@ var init_model_requirements = __esm(() => {
7186
7190
  providers: ["google", "github-copilot", "opencode", "vercel"],
7187
7191
  model: "gemini-3-flash"
7188
7192
  },
7189
- { providers: ["opencode-go", "vercel"], model: "kimi-k2.5" },
7193
+ { providers: ["opencode-go", "vercel"], model: "kimi-k2.6" },
7190
7194
  {
7191
7195
  providers: ["anthropic", "github-copilot", "opencode", "vercel"],
7192
7196
  model: "claude-sonnet-4-6"
@@ -50000,20 +50004,19 @@ var init_model_capabilities_generated = __esm(() => {
50000
50004
  var SUPPLEMENTAL_MODEL_CAPABILITIES;
50001
50005
  var init_supplemental_entries = __esm(() => {
50002
50006
  SUPPLEMENTAL_MODEL_CAPABILITIES = {
50003
- "gpt-5.4-mini-fast": {
50004
- id: "gpt-5.4-mini-fast",
50005
- family: "gpt-mini",
50007
+ "kimi-k2.6": {
50008
+ id: "kimi-k2.6",
50009
+ family: "kimi",
50006
50010
  reasoning: true,
50007
- temperature: false,
50011
+ temperature: true,
50008
50012
  toolCall: true,
50009
50013
  modalities: {
50010
- input: ["text", "image"],
50014
+ input: ["text", "image", "video"],
50011
50015
  output: ["text"]
50012
50016
  },
50013
50017
  limit: {
50014
- context: 400000,
50015
- input: 272000,
50016
- output: 128000
50018
+ context: 262144,
50019
+ output: 262144
50017
50020
  }
50018
50021
  },
50019
50022
  "gpt-5.5": {
@@ -50031,6 +50034,22 @@ var init_supplemental_entries = __esm(() => {
50031
50034
  input: 272000,
50032
50035
  output: 128000
50033
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
+ }
50034
50053
  }
50035
50054
  };
50036
50055
  });
@@ -50128,8 +50147,8 @@ var init_model_capability_aliases = __esm(() => {
50128
50147
  PATTERN_ALIAS_RULES = [
50129
50148
  {
50130
50149
  ruleID: "claude-thinking-legacy-alias",
50131
- description: "Normalizes legacy Claude Opus thinking suffixes (4-6, 4-7) to the canonical snapshot ID.",
50132
- 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),
50133
50152
  canonicalize: () => "claude-opus-4-7"
50134
50153
  },
50135
50154
  {
@@ -50179,7 +50198,7 @@ var init_model_capability_heuristics = __esm(() => {
50179
50198
  family: "gpt-5",
50180
50199
  includes: ["gpt-5"],
50181
50200
  variants: ["low", "medium", "high", "xhigh"],
50182
- reasoningEfforts: ["none", "minimal", "low", "medium", "high", "xhigh"]
50201
+ reasoningEfforts: ["none", "minimal", "low", "medium", "high", "xhigh", "max"]
50183
50202
  },
50184
50203
  {
50185
50204
  family: "gpt-legacy",
@@ -50729,9 +50748,15 @@ var init_session_utils = __esm(() => {
50729
50748
  init_agent_display_names();
50730
50749
  });
50731
50750
  // src/shared/tmux/constants.ts
50732
- var SESSION_TIMEOUT_MS;
50751
+ var SESSION_TIMEOUT_MS, SESSION_MISSING_GRACE_MS;
50733
50752
  var init_constants2 = __esm(() => {
50734
- 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();
50735
50760
  });
50736
50761
  // src/shared/tmux/tmux-utils/server-health.ts
50737
50762
  var SERVER_RUNNING_KEY;
@@ -50746,32 +50771,27 @@ var init_tmux_path_resolver = __esm(() => {
50746
50771
 
50747
50772
  // src/shared/tmux/tmux-utils/pane-dimensions.ts
50748
50773
  var init_pane_dimensions = __esm(() => {
50749
- init_bun_spawn_shim();
50750
50774
  init_tmux_path_resolver();
50751
50775
  });
50752
50776
 
50753
50777
  // src/shared/tmux/tmux-utils/pane-spawn.ts
50754
50778
  var init_pane_spawn = __esm(() => {
50755
- init_bun_spawn_shim();
50756
50779
  init_tmux_path_resolver();
50757
50780
  init_server_health();
50758
50781
  });
50759
50782
  // src/shared/tmux/tmux-utils/pane-replace.ts
50760
50783
  var init_pane_replace = __esm(() => {
50761
- init_bun_spawn_shim();
50762
50784
  init_tmux_path_resolver();
50763
50785
  });
50764
50786
 
50765
50787
  // src/shared/tmux/tmux-utils/window-spawn.ts
50766
50788
  var init_window_spawn = __esm(() => {
50767
- init_bun_spawn_shim();
50768
50789
  init_tmux_path_resolver();
50769
50790
  init_server_health();
50770
50791
  });
50771
50792
 
50772
50793
  // src/shared/tmux/tmux-utils/session-spawn.ts
50773
50794
  var init_session_spawn = __esm(() => {
50774
- init_bun_spawn_shim();
50775
50795
  init_tmux_path_resolver();
50776
50796
  init_server_health();
50777
50797
  });
@@ -50780,7 +50800,6 @@ var init_stale_session_sweep = () => {};
50780
50800
 
50781
50801
  // src/shared/tmux/tmux-utils/layout.ts
50782
50802
  var init_layout = __esm(() => {
50783
- init_bun_spawn_shim();
50784
50803
  init_tmux_path_resolver();
50785
50804
  });
50786
50805
 
@@ -50799,6 +50818,7 @@ var init_tmux_utils = __esm(() => {
50799
50818
  // src/shared/tmux/index.ts
50800
50819
  var init_tmux = __esm(() => {
50801
50820
  init_constants2();
50821
+ init_runner();
50802
50822
  init_tmux_utils();
50803
50823
  });
50804
50824
  // src/shared/model-suggestion-retry.ts
@@ -51009,8 +51029,46 @@ var init_opencode_command_dirs = __esm(() => {
51009
51029
  });
51010
51030
 
51011
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
+ }
51012
51069
  var worktreePathCache;
51013
51070
  var init_project_discovery_dirs = __esm(() => {
51071
+ init_jsonc_parser();
51014
51072
  worktreePathCache = new Map;
51015
51073
  });
51016
51074
 
@@ -51362,17 +51420,17 @@ var init_plugin_name_with_version = __esm(() => {
51362
51420
  });
51363
51421
 
51364
51422
  // src/cli/config-manager/backup-config.ts
51365
- import { copyFileSync as copyFileSync2, existsSync as existsSync11, mkdirSync as mkdirSync5 } from "fs";
51366
- 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";
51367
51425
  function backupConfigFile(configPath) {
51368
- if (!existsSync11(configPath)) {
51426
+ if (!existsSync12(configPath)) {
51369
51427
  return { success: true };
51370
51428
  }
51371
51429
  const timestamp2 = new Date().toISOString().replace(/[:.]/g, "-");
51372
51430
  const backupPath = `${configPath}.backup-${timestamp2}`;
51373
51431
  try {
51374
- const dir = dirname3(backupPath);
51375
- if (!existsSync11(dir)) {
51432
+ const dir = dirname4(backupPath);
51433
+ if (!existsSync12(dir)) {
51376
51434
  mkdirSync5(dir, { recursive: true });
51377
51435
  }
51378
51436
  copyFileSync2(configPath, backupPath);
@@ -51387,10 +51445,10 @@ function backupConfigFile(configPath) {
51387
51445
  var init_backup_config = () => {};
51388
51446
 
51389
51447
  // src/cli/config-manager/ensure-config-directory-exists.ts
51390
- import { existsSync as existsSync12, mkdirSync as mkdirSync6 } from "fs";
51448
+ import { existsSync as existsSync13, mkdirSync as mkdirSync6 } from "fs";
51391
51449
  function ensureConfigDirectoryExists() {
51392
51450
  const configDir = getConfigDir();
51393
- if (!existsSync12(configDir)) {
51451
+ if (!existsSync13(configDir)) {
51394
51452
  mkdirSync6(configDir, { recursive: true });
51395
51453
  }
51396
51454
  }
@@ -51428,14 +51486,14 @@ function formatErrorWithSuggestion(err, context) {
51428
51486
  }
51429
51487
 
51430
51488
  // src/cli/config-manager/opencode-config-format.ts
51431
- import { existsSync as existsSync13 } from "fs";
51489
+ import { existsSync as existsSync14 } from "fs";
51432
51490
  function detectConfigFormat() {
51433
51491
  const configJsonc = getConfigJsonc();
51434
51492
  const configJson = getConfigJson();
51435
- if (existsSync13(configJsonc)) {
51493
+ if (existsSync14(configJsonc)) {
51436
51494
  return { format: "jsonc", path: configJsonc };
51437
51495
  }
51438
- if (existsSync13(configJson)) {
51496
+ if (existsSync14(configJson)) {
51439
51497
  return { format: "json", path: configJson };
51440
51498
  }
51441
51499
  return { format: "none", path: configJson };
@@ -51878,7 +51936,7 @@ function generateModelConfig(config) {
51878
51936
  if (avail.native.openai) {
51879
51937
  agentConfig = { model: "openai/gpt-5.4-mini-fast" };
51880
51938
  } else if (avail.opencodeGo) {
51881
- agentConfig = { model: "opencode-go/minimax-m2.7" };
51939
+ agentConfig = { model: "opencode-go/qwen3.5-plus" };
51882
51940
  } else if (avail.zai) {
51883
51941
  agentConfig = { model: ZAI_MODEL };
51884
51942
  } else if (avail.vercelAiGateway) {
@@ -51898,7 +51956,7 @@ function generateModelConfig(config) {
51898
51956
  } else if (avail.opencodeZen) {
51899
51957
  agentConfig = { model: "opencode/claude-haiku-4-5" };
51900
51958
  } else if (avail.opencodeGo) {
51901
- agentConfig = { model: "opencode-go/minimax-m2.7" };
51959
+ agentConfig = { model: "opencode-go/qwen3.5-plus" };
51902
51960
  } else if (avail.copilot) {
51903
51961
  agentConfig = { model: "github-copilot/gpt-5-mini" };
51904
51962
  } else if (avail.vercelAiGateway) {
@@ -51978,12 +52036,12 @@ var init_generate_omo_config = __esm(() => {
51978
52036
  });
51979
52037
 
51980
52038
  // src/shared/migrate-legacy-config-file.ts
51981
- import { existsSync as existsSync14, readFileSync as readFileSync9, renameSync as renameSync2, rmSync } from "fs";
51982
- 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";
51983
52041
  function buildCanonicalPath(legacyPath) {
51984
- const dir = dirname4(legacyPath);
52042
+ const dir = dirname5(legacyPath);
51985
52043
  const ext = basename2(legacyPath).includes(".jsonc") ? ".jsonc" : ".json";
51986
- return join13(dir, `${CONFIG_BASENAME}${ext}`);
52044
+ return join14(dir, `${CONFIG_BASENAME}${ext}`);
51987
52045
  }
51988
52046
  function archiveLegacyConfigFile(legacyPath) {
51989
52047
  const backupPath = `${legacyPath}.bak`;
@@ -52016,10 +52074,10 @@ function archiveLegacyConfigFile(legacyPath) {
52016
52074
  }
52017
52075
  function migrateLegacySidecarFile(legacyPath, canonicalPath) {
52018
52076
  const legacySidecarPath = getSidecarPath(legacyPath);
52019
- if (!existsSync14(legacySidecarPath))
52077
+ if (!existsSync15(legacySidecarPath))
52020
52078
  return true;
52021
52079
  const canonicalSidecarPath = getSidecarPath(canonicalPath);
52022
- if (existsSync14(canonicalSidecarPath))
52080
+ if (existsSync15(canonicalSidecarPath))
52023
52081
  return true;
52024
52082
  try {
52025
52083
  const content = readFileSync9(legacySidecarPath, "utf-8");
@@ -52039,12 +52097,12 @@ function migrateLegacySidecarFile(legacyPath, canonicalPath) {
52039
52097
  }
52040
52098
  }
52041
52099
  function migrateLegacyConfigFile(legacyPath) {
52042
- if (!existsSync14(legacyPath))
52100
+ if (!existsSync15(legacyPath))
52043
52101
  return false;
52044
52102
  if (!basename2(legacyPath).startsWith(LEGACY_CONFIG_BASENAME))
52045
52103
  return false;
52046
52104
  const canonicalPath = buildCanonicalPath(legacyPath);
52047
- if (existsSync14(canonicalPath))
52105
+ if (existsSync15(canonicalPath))
52048
52106
  return false;
52049
52107
  try {
52050
52108
  const content = readFileSync9(legacyPath, "utf-8");
@@ -52088,8 +52146,8 @@ function deepMergeRecord(target, source) {
52088
52146
  }
52089
52147
 
52090
52148
  // src/cli/config-manager/write-omo-config.ts
52091
- import { existsSync as existsSync15, readFileSync as readFileSync10, statSync as statSync2, writeFileSync as writeFileSync4 } from "fs";
52092
- 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";
52093
52151
  function isEmptyOrWhitespace2(content) {
52094
52152
  return content.trim().length === 0;
52095
52153
  }
@@ -52104,12 +52162,12 @@ function writeOmoConfig(installConfig) {
52104
52162
  };
52105
52163
  }
52106
52164
  const detectedConfigPath = getOmoConfigPath();
52107
- const canonicalConfigPath = join14(dirname5(detectedConfigPath), `${CONFIG_BASENAME}${extname(detectedConfigPath) || ".json"}`);
52165
+ const canonicalConfigPath = join15(dirname6(detectedConfigPath), `${CONFIG_BASENAME}${extname(detectedConfigPath) || ".json"}`);
52108
52166
  const shouldMigrateLegacyPath = basename3(detectedConfigPath).startsWith(LEGACY_CONFIG_BASENAME);
52109
- const omoConfigPath = shouldMigrateLegacyPath ? migrateLegacyConfigFile(detectedConfigPath) || existsSync15(canonicalConfigPath) ? canonicalConfigPath : detectedConfigPath : detectedConfigPath;
52167
+ const omoConfigPath = shouldMigrateLegacyPath ? migrateLegacyConfigFile(detectedConfigPath) || existsSync16(canonicalConfigPath) ? canonicalConfigPath : detectedConfigPath : detectedConfigPath;
52110
52168
  try {
52111
52169
  const newConfig = generateOmoConfig(installConfig);
52112
- if (existsSync15(omoConfigPath)) {
52170
+ if (existsSync16(omoConfigPath)) {
52113
52171
  const backupResult = backupConfigFile(omoConfigPath);
52114
52172
  if (!backupResult.success) {
52115
52173
  return {
@@ -52178,8 +52236,8 @@ function toReadableStream2(stream) {
52178
52236
  function wrapNodeProcess2(proc) {
52179
52237
  let resolveExited;
52180
52238
  let exitCode = null;
52181
- const exited = new Promise((resolve4) => {
52182
- resolveExited = resolve4;
52239
+ const exited = new Promise((resolve5) => {
52240
+ resolveExited = resolve5;
52183
52241
  });
52184
52242
  proc.on("exit", (code) => {
52185
52243
  exitCode = code ?? 1;
@@ -52264,10 +52322,10 @@ var init_opencode_binary = __esm(() => {
52264
52322
  });
52265
52323
 
52266
52324
  // src/cli/config-manager/detect-current-config.ts
52267
- import { existsSync as existsSync16, readFileSync as readFileSync11 } from "fs";
52325
+ import { existsSync as existsSync17, readFileSync as readFileSync11 } from "fs";
52268
52326
  function detectProvidersFromOmoConfig() {
52269
52327
  const omoConfigPath = getOmoConfigPath();
52270
- if (!existsSync16(omoConfigPath)) {
52328
+ if (!existsSync17(omoConfigPath)) {
52271
52329
  return {
52272
52330
  hasOpenAI: true,
52273
52331
  hasOpencodeZen: true,
@@ -52367,10 +52425,10 @@ var init_detect_current_config = __esm(() => {
52367
52425
  });
52368
52426
 
52369
52427
  // src/cli/config-manager/bun-install.ts
52370
- import { existsSync as existsSync17 } from "fs";
52371
- import { join as join15 } from "path";
52428
+ import { existsSync as existsSync18 } from "fs";
52429
+ import { join as join16 } from "path";
52372
52430
  function getDefaultWorkspaceDir() {
52373
- return join15(getOpenCodeCacheDir(), "packages");
52431
+ return join16(getOpenCodeCacheDir(), "packages");
52374
52432
  }
52375
52433
  function readProcessOutput(stream) {
52376
52434
  if (!stream) {
@@ -52396,7 +52454,7 @@ async function runBunInstallWithDetails(options) {
52396
52454
  const outputMode = options?.outputMode ?? "pipe";
52397
52455
  const cacheDir = options?.workspaceDir ?? getDefaultWorkspaceDir();
52398
52456
  const packageJsonPath = `${cacheDir}/package.json`;
52399
- if (!existsSync17(packageJsonPath)) {
52457
+ if (!existsSync18(packageJsonPath)) {
52400
52458
  return {
52401
52459
  success: false,
52402
52460
  error: `Workspace not initialized: ${packageJsonPath} not found. OpenCode should create this on first run.`
@@ -52411,8 +52469,8 @@ async function runBunInstallWithDetails(options) {
52411
52469
  });
52412
52470
  const outputPromise = Promise.all([readProcessOutput(proc.stdout), readProcessOutput(proc.stderr)]).then(([stdout, stderr]) => ({ stdout, stderr }));
52413
52471
  let timeoutId;
52414
- const timeoutPromise = new Promise((resolve4) => {
52415
- timeoutId = setTimeout(() => resolve4("timeout"), BUN_INSTALL_TIMEOUT_MS);
52472
+ const timeoutPromise = new Promise((resolve5) => {
52473
+ timeoutId = setTimeout(() => resolve5("timeout"), BUN_INSTALL_TIMEOUT_MS);
52416
52474
  });
52417
52475
  const exitPromise = proc.exited.then(() => "completed");
52418
52476
  const result = await Promise.race([exitPromise, timeoutPromise]);
@@ -52623,12 +52681,12 @@ var require_isexe = __commonJS((exports, module) => {
52623
52681
  if (typeof Promise !== "function") {
52624
52682
  throw new TypeError("callback not provided");
52625
52683
  }
52626
- return new Promise(function(resolve4, reject) {
52684
+ return new Promise(function(resolve5, reject) {
52627
52685
  isexe(path6, options || {}, function(er, is) {
52628
52686
  if (er) {
52629
52687
  reject(er);
52630
52688
  } else {
52631
- resolve4(is);
52689
+ resolve5(is);
52632
52690
  }
52633
52691
  });
52634
52692
  });
@@ -52690,27 +52748,27 @@ var require_which = __commonJS((exports, module) => {
52690
52748
  opt = {};
52691
52749
  const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
52692
52750
  const found = [];
52693
- const step = (i2) => new Promise((resolve4, reject) => {
52751
+ const step = (i2) => new Promise((resolve5, reject) => {
52694
52752
  if (i2 === pathEnv.length)
52695
- return opt.all && found.length ? resolve4(found) : reject(getNotFoundError(cmd));
52753
+ return opt.all && found.length ? resolve5(found) : reject(getNotFoundError(cmd));
52696
52754
  const ppRaw = pathEnv[i2];
52697
52755
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
52698
52756
  const pCmd = path6.join(pathPart, cmd);
52699
52757
  const p2 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
52700
- resolve4(subStep(p2, i2, 0));
52758
+ resolve5(subStep(p2, i2, 0));
52701
52759
  });
52702
- const subStep = (p2, i2, ii) => new Promise((resolve4, reject) => {
52760
+ const subStep = (p2, i2, ii) => new Promise((resolve5, reject) => {
52703
52761
  if (ii === pathExt.length)
52704
- return resolve4(step(i2 + 1));
52762
+ return resolve5(step(i2 + 1));
52705
52763
  const ext = pathExt[ii];
52706
52764
  isexe(p2 + ext, { pathExt: pathExtExe }, (er, is) => {
52707
52765
  if (!er && is) {
52708
52766
  if (opt.all)
52709
52767
  found.push(p2 + ext);
52710
52768
  else
52711
- return resolve4(p2 + ext);
52769
+ return resolve5(p2 + ext);
52712
52770
  }
52713
- return resolve4(subStep(p2, i2, ii + 1));
52771
+ return resolve5(subStep(p2, i2, ii + 1));
52714
52772
  });
52715
52773
  });
52716
52774
  return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
@@ -53564,8 +53622,8 @@ var init_update_toasts = __esm(() => {
53564
53622
  });
53565
53623
 
53566
53624
  // src/hooks/auto-update-checker/hook/background-update-check.ts
53567
- import { existsSync as existsSync29 } from "fs";
53568
- import { join as join28 } from "path";
53625
+ import { existsSync as existsSync30 } from "fs";
53626
+ import { join as join29 } from "path";
53569
53627
  function getCacheWorkspaceDir(deps) {
53570
53628
  return deps.join(deps.getOpenCodeCacheDir(), "packages");
53571
53629
  }
@@ -53683,8 +53741,8 @@ var init_background_update_check = __esm(() => {
53683
53741
  init_checker();
53684
53742
  init_update_toasts();
53685
53743
  defaultDeps = {
53686
- existsSync: existsSync29,
53687
- join: join28,
53744
+ existsSync: existsSync30,
53745
+ join: join29,
53688
53746
  runBunInstallWithDetails,
53689
53747
  log,
53690
53748
  getOpenCodeCacheDir,
@@ -53843,7 +53901,7 @@ async function showSpinnerToast(ctx, version3, message) {
53843
53901
  duration: frameInterval + 50
53844
53902
  }
53845
53903
  }).catch(() => {});
53846
- await new Promise((resolve4) => setTimeout(resolve4, frameInterval));
53904
+ await new Promise((resolve6) => setTimeout(resolve6, frameInterval));
53847
53905
  }
53848
53906
  }
53849
53907
  var SISYPHUS_SPINNER;
@@ -53996,7 +54054,7 @@ var {
53996
54054
  // package.json
53997
54055
  var package_default = {
53998
54056
  name: "oh-my-opencode",
53999
- version: "3.17.15",
54057
+ version: "4.0.0",
54000
54058
  description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
54001
54059
  main: "./dist/index.js",
54002
54060
  types: "dist/index.d.ts",
@@ -54077,17 +54135,17 @@ var package_default = {
54077
54135
  zod: "^4.3.0"
54078
54136
  },
54079
54137
  optionalDependencies: {
54080
- "oh-my-opencode-darwin-arm64": "3.17.15",
54081
- "oh-my-opencode-darwin-x64": "3.17.15",
54082
- "oh-my-opencode-darwin-x64-baseline": "3.17.15",
54083
- "oh-my-opencode-linux-arm64": "3.17.15",
54084
- "oh-my-opencode-linux-arm64-musl": "3.17.15",
54085
- "oh-my-opencode-linux-x64": "3.17.15",
54086
- "oh-my-opencode-linux-x64-baseline": "3.17.15",
54087
- "oh-my-opencode-linux-x64-musl": "3.17.15",
54088
- "oh-my-opencode-linux-x64-musl-baseline": "3.17.15",
54089
- "oh-my-opencode-windows-x64": "3.17.15",
54090
- "oh-my-opencode-windows-x64-baseline": "3.17.15"
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"
54091
54149
  },
54092
54150
  overrides: {},
54093
54151
  trustedDependencies: [
@@ -54278,13 +54336,15 @@ var CHECK_IDS = {
54278
54336
  SYSTEM: "system",
54279
54337
  CONFIG: "config",
54280
54338
  TOOLS: "tools",
54281
- MODELS: "models"
54339
+ MODELS: "models",
54340
+ TEAM_MODE: "team-mode"
54282
54341
  };
54283
54342
  var CHECK_NAMES = {
54284
54343
  [CHECK_IDS.SYSTEM]: "System",
54285
54344
  [CHECK_IDS.CONFIG]: "Configuration",
54286
54345
  [CHECK_IDS.TOOLS]: "Tools",
54287
- [CHECK_IDS.MODELS]: "Models"
54346
+ [CHECK_IDS.MODELS]: "Models",
54347
+ [CHECK_IDS.TEAM_MODE]: "Team Mode"
54288
54348
  };
54289
54349
  var EXIT_CODES = {
54290
54350
  SUCCESS: 0,
@@ -55886,6 +55946,7 @@ async function processEvents(ctx, stream, state) {
55886
55946
  }
55887
55947
  // src/plugin-config.ts
55888
55948
  import * as fs4 from "fs";
55949
+ import { homedir as homedir4 } from "os";
55889
55950
  import * as path5 from "path";
55890
55951
 
55891
55952
  // node_modules/zod/v4/classic/external.js
@@ -69441,7 +69502,8 @@ var BuiltinSkillNameSchema = exports_external.enum([
69441
69502
  "frontend-ui-ux",
69442
69503
  "git-master",
69443
69504
  "review-work",
69444
- "ai-slop-remover"
69505
+ "ai-slop-remover",
69506
+ "team-mode"
69445
69507
  ]);
69446
69508
  var OverridableAgentNameSchema = exports_external.enum([
69447
69509
  "build",
@@ -69463,7 +69525,7 @@ var OverridableAgentNameSchema = exports_external.enum([
69463
69525
  var FallbackModelObjectSchema = exports_external.object({
69464
69526
  model: exports_external.string(),
69465
69527
  variant: exports_external.string().optional(),
69466
- reasoningEffort: exports_external.enum(["none", "minimal", "low", "medium", "high", "xhigh"]).optional(),
69528
+ reasoningEffort: exports_external.enum(["none", "minimal", "low", "medium", "high", "xhigh", "max"]).optional(),
69467
69529
  temperature: exports_external.number().min(0).max(2).optional(),
69468
69530
  top_p: exports_external.number().min(0).max(1).optional(),
69469
69531
  maxTokens: exports_external.number().optional(),
@@ -69519,7 +69581,7 @@ var AgentOverrideConfigSchema = exports_external.object({
69519
69581
  type: exports_external.enum(["enabled", "disabled"]),
69520
69582
  budgetTokens: exports_external.number().optional()
69521
69583
  }).optional(),
69522
- reasoningEffort: exports_external.enum(["none", "minimal", "low", "medium", "high", "xhigh"]).optional(),
69584
+ reasoningEffort: exports_external.enum(["none", "minimal", "low", "medium", "high", "xhigh", "max"]).optional(),
69523
69585
  textVerbosity: exports_external.enum(["low", "medium", "high"]).optional(),
69524
69586
  providerOptions: exports_external.record(exports_external.string(), exports_external.unknown()).optional(),
69525
69587
  ultrawork: exports_external.object({
@@ -69595,7 +69657,7 @@ var CategoryConfigSchema = exports_external.object({
69595
69657
  type: exports_external.enum(["enabled", "disabled"]),
69596
69658
  budgetTokens: exports_external.number().optional()
69597
69659
  }).optional(),
69598
- reasoningEffort: exports_external.enum(["none", "minimal", "low", "medium", "high", "xhigh"]).optional(),
69660
+ reasoningEffort: exports_external.enum(["none", "minimal", "low", "medium", "high", "xhigh", "max"]).optional(),
69599
69661
  textVerbosity: exports_external.enum(["low", "medium", "high"]).optional(),
69600
69662
  tools: exports_external.record(exports_external.string(), exports_external.boolean()).optional(),
69601
69663
  prompt_append: exports_external.string().optional(),
@@ -69637,7 +69699,8 @@ var BuiltinCommandNameSchema = exports_external.enum([
69637
69699
  "refactor",
69638
69700
  "start-work",
69639
69701
  "stop-continuation",
69640
- "remove-ai-slops"
69702
+ "remove-ai-slops",
69703
+ "hyperplan"
69641
69704
  ]);
69642
69705
  // src/config/schema/dynamic-context-pruning.ts
69643
69706
  var DynamicContextPruningConfigSchema = exports_external.object({
@@ -69738,6 +69801,7 @@ var HookNameSchema = exports_external.enum([
69738
69801
  "delegate-task-retry",
69739
69802
  "prometheus-md-only",
69740
69803
  "sisyphus-junior-notepad",
69804
+ "team-tool-gating",
69741
69805
  "no-sisyphus-gpt",
69742
69806
  "no-hephaestus-non-gpt",
69743
69807
  "start-work",
@@ -69756,6 +69820,11 @@ var HookNameSchema = exports_external.enum([
69756
69820
  "webfetch-redirect-guard",
69757
69821
  "legacy-plugin-toast"
69758
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
+ });
69759
69828
  // src/config/schema/model-capabilities.ts
69760
69829
  var ModelCapabilitiesConfigSchema = exports_external.object({
69761
69830
  enabled: exports_external.boolean().optional(),
@@ -69826,6 +69895,21 @@ var RuntimeFallbackConfigSchema = exports_external.object({
69826
69895
  notify_on_fallback: exports_external.boolean().optional()
69827
69896
  });
69828
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
+
69829
69913
  // src/config/schema/skills.ts
69830
69914
  var SkillSourceSchema = exports_external.union([
69831
69915
  exports_external.string(),
@@ -69940,6 +70024,8 @@ var OhMyOpenCodeConfigSchema = exports_external.object({
69940
70024
  notification: NotificationConfigSchema.optional(),
69941
70025
  model_capabilities: ModelCapabilitiesConfigSchema.optional(),
69942
70026
  openclaw: OpenClawConfigSchema.optional(),
70027
+ team_mode: TeamModeConfigSchema.optional(),
70028
+ keyword_detector: KeywordDetectorConfigSchema.optional(),
69943
70029
  babysitting: BabysittingConfigSchema.optional(),
69944
70030
  git_master: GitMasterConfigSchema.default({
69945
70031
  commit_footer: true,
@@ -69957,6 +70043,20 @@ var OhMyOpenCodeConfigSchema = exports_external.object({
69957
70043
  init_shared();
69958
70044
  init_migrate_legacy_config_file();
69959
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
+ }
69960
70060
  function loadExplicitGitMasterOverrides(configPath) {
69961
70061
  try {
69962
70062
  if (!fs4.existsSync(configPath)) {
@@ -70053,6 +70153,7 @@ function mergeConfigs(base, override) {
70053
70153
  ...override,
70054
70154
  agents: deepMerge(base.agents, override.agents),
70055
70155
  categories: deepMerge(base.categories, override.categories),
70156
+ team_mode: deepMerge(base.team_mode, override.team_mode),
70056
70157
  agent_definitions: [
70057
70158
  ...new Set([
70058
70159
  ...base.agent_definitions ?? [],
@@ -70114,51 +70215,63 @@ function loadPluginConfig(directory, ctx) {
70114
70215
  legacyPath: userDetected.legacyPath
70115
70216
  });
70116
70217
  }
70117
- if (userDetected.format !== "none" && path5.basename(userDetected.path).startsWith(LEGACY_CONFIG_BASENAME)) {
70118
- const migrated = migrateLegacyConfigFile(userDetected.path);
70119
- const canonicalPath = path5.join(path5.dirname(userDetected.path), `${CONFIG_BASENAME}${path5.extname(userDetected.path)}`);
70120
- if (migrated || fs4.existsSync(canonicalPath)) {
70121
- userConfigPath = canonicalPath;
70122
- }
70123
- }
70124
- const projectBasePath = path5.join(directory, ".opencode");
70125
- const projectDetected = detectPluginConfigFile(projectBasePath);
70126
- let projectConfigPath = projectDetected.format !== "none" ? projectDetected.path : path5.join(projectBasePath, `${CONFIG_BASENAME}.json`);
70127
- if (projectDetected.legacyPath) {
70128
- log("Canonical plugin config detected alongside legacy config. Remove the legacy file to avoid confusion.", {
70129
- canonicalPath: projectDetected.path,
70130
- legacyPath: projectDetected.legacyPath
70131
- });
70132
- }
70133
- if (projectDetected.format !== "none" && path5.basename(projectDetected.path).startsWith(LEGACY_CONFIG_BASENAME)) {
70134
- const projectMigrated = migrateLegacyConfigFile(projectDetected.path);
70135
- const canonicalProjectPath = path5.join(path5.dirname(projectDetected.path), `${CONFIG_BASENAME}${path5.extname(projectDetected.path)}`);
70136
- if (projectMigrated || fs4.existsSync(canonicalProjectPath)) {
70137
- 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
+ });
70138
70237
  }
70139
- }
70238
+ return resolveConfigPathAfterLegacyMigration(ancestorPath);
70239
+ });
70140
70240
  const userConfig = loadConfigFromPath(userConfigPath, ctx);
70141
70241
  const userGitMasterOverrides = loadExplicitGitMasterOverrides(userConfigPath);
70142
70242
  if (userConfig?.agent_definitions) {
70143
70243
  userConfig.agent_definitions = resolveAgentDefinitionPaths(userConfig.agent_definitions, configDir, null);
70144
70244
  }
70145
70245
  let config2 = userConfig ?? OhMyOpenCodeConfigSchema.parse({});
70246
+ const canonicalAncestorPathsFarthestFirst = [...canonicalAncestorPathsNearestFirst].reverse();
70146
70247
  const defaultGitMaster = OhMyOpenCodeConfigSchema.parse({}).git_master;
70147
- const projectConfig = loadConfigFromPath(projectConfigPath, ctx);
70148
- const projectGitMasterOverrides = loadExplicitGitMasterOverrides(projectConfigPath);
70149
- if (projectConfig?.agent_definitions) {
70150
- projectConfig.agent_definitions = resolveAgentDefinitionPaths(projectConfig.agent_definitions, projectBasePath, directory);
70151
- }
70152
- if (projectConfig) {
70153
- 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
+ }
70154
70263
  }
70155
- if (userGitMasterOverrides || projectGitMasterOverrides) {
70264
+ if (userGitMasterOverrides || ancestorGitMasterOverridesFarthestFirst.length > 0) {
70265
+ const mergedAncestorGitMaster = {};
70266
+ for (const override of ancestorGitMasterOverridesFarthestFirst) {
70267
+ Object.assign(mergedAncestorGitMaster, override);
70268
+ }
70156
70269
  config2 = {
70157
70270
  ...config2,
70158
70271
  git_master: {
70159
70272
  ...defaultGitMaster,
70160
70273
  ...userGitMasterOverrides ?? {},
70161
- ...projectGitMasterOverrides ?? {}
70274
+ ...mergedAncestorGitMaster
70162
70275
  }
70163
70276
  };
70164
70277
  }
@@ -70178,7 +70291,7 @@ function loadPluginConfig(directory, ctx) {
70178
70291
  // node_modules/@opencode-ai/sdk/dist/gen/core/serverSentEvents.gen.js
70179
70292
  var createSseClient = ({ onSseError, onSseEvent, responseTransformer, responseValidator, sseDefaultRetryDelay, sseMaxRetryAttempts, sseMaxRetryDelay, sseSleepFn, url: url2, ...options }) => {
70180
70293
  let lastEventId;
70181
- const sleep = sseSleepFn ?? ((ms) => new Promise((resolve4) => setTimeout(resolve4, ms)));
70294
+ const sleep = sseSleepFn ?? ((ms) => new Promise((resolve5) => setTimeout(resolve5, ms)));
70182
70295
  const createStream = async function* () {
70183
70296
  let retryDelay = sseDefaultRetryDelay ?? 3000;
70184
70297
  let attempt = 0;
@@ -71613,7 +71726,7 @@ async function createOpencodeServer(options) {
71613
71726
  }
71614
71727
  });
71615
71728
  let clear = () => {};
71616
- const url2 = await new Promise((resolve4, reject) => {
71729
+ const url2 = await new Promise((resolve5, reject) => {
71617
71730
  const id = setTimeout(() => {
71618
71731
  clear();
71619
71732
  stop(proc);
@@ -71639,7 +71752,7 @@ async function createOpencodeServer(options) {
71639
71752
  }
71640
71753
  clearTimeout(id);
71641
71754
  resolved = true;
71642
- resolve4(match[1]);
71755
+ resolve5(match[1]);
71643
71756
  return;
71644
71757
  }
71645
71758
  }
@@ -71694,7 +71807,7 @@ var import_picocolors10 = __toESM(require_picocolors(), 1);
71694
71807
 
71695
71808
  // src/cli/run/opencode-binary-resolver.ts
71696
71809
  init_spawn_with_windows_hide();
71697
- import { delimiter, dirname as dirname7, join as join17 } from "path";
71810
+ import { delimiter, dirname as dirname8, join as join18 } from "path";
71698
71811
  var OPENCODE_COMMANDS = ["opencode", "opencode-desktop"];
71699
71812
  var WINDOWS_SUFFIXES = ["", ".exe", ".cmd", ".bat", ".ps1"];
71700
71813
  function getCommandCandidates(platform) {
@@ -71717,7 +71830,7 @@ function collectCandidateBinaryPaths(pathEnv, which = Bun.which, platform = proc
71717
71830
  }
71718
71831
  for (const entry of (pathEnv ?? "").split(delimiter).filter(Boolean)) {
71719
71832
  for (const command of commandCandidates) {
71720
- addCandidate(join17(entry, command));
71833
+ addCandidate(join18(entry, command));
71721
71834
  }
71722
71835
  }
71723
71836
  return candidates;
@@ -71744,7 +71857,7 @@ async function findWorkingOpencodeBinary(pathEnv = process.env.PATH, probe = can
71744
71857
  return null;
71745
71858
  }
71746
71859
  function buildPathWithBinaryFirst(pathEnv, binaryPath) {
71747
- const preferredDir = dirname7(binaryPath);
71860
+ const preferredDir = dirname8(binaryPath);
71748
71861
  const existing = (pathEnv ?? "").split(delimiter).filter((entry) => entry.length > 0 && entry !== preferredDir);
71749
71862
  return [preferredDir, ...existing].join(delimiter);
71750
71863
  }
@@ -71897,7 +72010,7 @@ async function resolveSession(options) {
71897
72010
  if (attempt < SESSION_CREATE_MAX_RETRIES) {
71898
72011
  const delay = SESSION_CREATE_RETRY_DELAY_MS * attempt;
71899
72012
  console.log(import_picocolors11.default.dim(` Retrying in ${delay}ms...`));
71900
- await new Promise((resolve4) => setTimeout(resolve4, delay));
72013
+ await new Promise((resolve5) => setTimeout(resolve5, delay));
71901
72014
  }
71902
72015
  continue;
71903
72016
  }
@@ -71908,7 +72021,7 @@ async function resolveSession(options) {
71908
72021
  if (attempt < SESSION_CREATE_MAX_RETRIES) {
71909
72022
  const delay = SESSION_CREATE_RETRY_DELAY_MS * attempt;
71910
72023
  console.log(import_picocolors11.default.dim(` Retrying in ${delay}ms...`));
71911
- await new Promise((resolve4) => setTimeout(resolve4, delay));
72024
+ await new Promise((resolve5) => setTimeout(resolve5, delay));
71912
72025
  }
71913
72026
  }
71914
72027
  throw new Error("Failed to create session after all retries");
@@ -72119,15 +72232,33 @@ var BOULDER_STATE_PATH = `${BOULDER_DIR}/${BOULDER_FILE}`;
72119
72232
  var NOTEPAD_DIR = "notepads";
72120
72233
  var NOTEPAD_BASE_PATH = `${BOULDER_DIR}/${NOTEPAD_DIR}`;
72121
72234
  // src/features/boulder-state/storage.ts
72122
- import { existsSync as existsSync19, readFileSync as readFileSync13, writeFileSync as writeFileSync5, mkdirSync as mkdirSync7, readdirSync as readdirSync3 } from "fs";
72123
- 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";
72124
72237
  var RESERVED_KEYS = new Set(["__proto__", "prototype", "constructor"]);
72125
72238
  function getBoulderFilePath(directory) {
72126
- 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;
72127
72258
  }
72128
72259
  function readBoulderState(directory) {
72129
72260
  const filePath = getBoulderFilePath(directory);
72130
- if (!existsSync19(filePath)) {
72261
+ if (!existsSync20(filePath)) {
72131
72262
  return null;
72132
72263
  }
72133
72264
  try {
@@ -72164,7 +72295,7 @@ var CHECKED_CHECKBOX_PATTERN = /^(\s*)[-*]\s*\[[xX]\]\s*(.+)$/;
72164
72295
  var TODO_TASK_PATTERN = /^\d+\.\s+/;
72165
72296
  var FINAL_WAVE_TASK_PATTERN = /^F\d+\.\s+/i;
72166
72297
  function getPlanProgress(planPath) {
72167
- if (!existsSync19(planPath)) {
72298
+ if (!existsSync20(planPath)) {
72168
72299
  return { total: 0, completed: 0, isComplete: true };
72169
72300
  }
72170
72301
  try {
@@ -72240,14 +72371,14 @@ function getSessionAgent(sessionID) {
72240
72371
  // src/features/run-continuation-state/constants.ts
72241
72372
  var CONTINUATION_MARKER_DIR = ".sisyphus/run-continuation";
72242
72373
  // src/features/run-continuation-state/storage.ts
72243
- import { existsSync as existsSync20, mkdirSync as mkdirSync8, readFileSync as readFileSync14, rmSync as rmSync2, writeFileSync as writeFileSync6 } from "fs";
72244
- 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";
72245
72376
  function getMarkerPath(directory, sessionID) {
72246
- return join19(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
72377
+ return join20(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
72247
72378
  }
72248
72379
  function readContinuationMarker(directory, sessionID) {
72249
72380
  const markerPath = getMarkerPath(directory, sessionID);
72250
- if (!existsSync20(markerPath))
72381
+ if (!existsSync21(markerPath))
72251
72382
  return null;
72252
72383
  try {
72253
72384
  const raw = readFileSync14(markerPath, "utf-8");
@@ -72312,7 +72443,7 @@ async function isSessionInBoulderLineage(input) {
72312
72443
  init_shared();
72313
72444
  init_compaction_marker();
72314
72445
  import { readFileSync as readFileSync15, readdirSync as readdirSync4 } from "fs";
72315
- import { join as join20 } from "path";
72446
+ import { join as join21 } from "path";
72316
72447
  var defaultSessionLastAgentDeps = {
72317
72448
  getMessageDir,
72318
72449
  isSqliteBackend,
@@ -72360,7 +72491,7 @@ async function getLastAgentFromSession(sessionID, client3, deps = {}) {
72360
72491
  try {
72361
72492
  const messages = readdirSync4(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
72362
72493
  try {
72363
- const content = readFileSync15(join20(messageDir, fileName), "utf-8");
72494
+ const content = readFileSync15(join21(messageDir, fileName), "utf-8");
72364
72495
  const parsed = JSON.parse(content);
72365
72496
  return {
72366
72497
  fileName,
@@ -72393,8 +72524,8 @@ init_agent_display_names();
72393
72524
 
72394
72525
  // src/hooks/ralph-loop/storage.ts
72395
72526
  init_frontmatter();
72396
- import { existsSync as existsSync21, readFileSync as readFileSync16, writeFileSync as writeFileSync7, unlinkSync as unlinkSync3, mkdirSync as mkdirSync9 } from "fs";
72397
- 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";
72398
72529
 
72399
72530
  // src/hooks/ralph-loop/constants.ts
72400
72531
  var DEFAULT_STATE_FILE = ".sisyphus/ralph-loop.local.md";
@@ -72403,11 +72534,11 @@ var DEFAULT_COMPLETION_PROMISE = "DONE";
72403
72534
 
72404
72535
  // src/hooks/ralph-loop/storage.ts
72405
72536
  function getStateFilePath(directory, customPath) {
72406
- return customPath ? join21(directory, customPath) : join21(directory, DEFAULT_STATE_FILE);
72537
+ return customPath ? join22(directory, customPath) : join22(directory, DEFAULT_STATE_FILE);
72407
72538
  }
72408
72539
  function readState(directory, customPath) {
72409
72540
  const filePath = getStateFilePath(directory, customPath);
72410
- if (!existsSync21(filePath)) {
72541
+ if (!existsSync22(filePath)) {
72411
72542
  return null;
72412
72543
  }
72413
72544
  try {
@@ -72467,7 +72598,7 @@ async function hasActiveBoulderContinuation(directory, sessionID, client3) {
72467
72598
  const boulder = readBoulderState(directory);
72468
72599
  if (!boulder)
72469
72600
  return false;
72470
- const progress = getPlanProgress(boulder.active_plan);
72601
+ const progress = getPlanProgress(resolveBoulderPlanPath(directory, boulder));
72471
72602
  if (progress.isComplete)
72472
72603
  return false;
72473
72604
  if (!client3)
@@ -72625,7 +72756,7 @@ async function pollForCompletion(ctx, eventState, abortController, options = {})
72625
72756
  let secondaryTimeoutChecked = false;
72626
72757
  const pollStartTimestamp = Date.now();
72627
72758
  while (!abortController.signal.aborted) {
72628
- await new Promise((resolve4) => setTimeout(resolve4, pollIntervalMs));
72759
+ await new Promise((resolve6) => setTimeout(resolve6, pollIntervalMs));
72629
72760
  if (abortController.signal.aborted) {
72630
72761
  return 130;
72631
72762
  }
@@ -72856,7 +72987,7 @@ import os3 from "os";
72856
72987
  import { createHash } from "crypto";
72857
72988
 
72858
72989
  // node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
72859
- import { dirname as dirname10, posix, sep } from "path";
72990
+ import { dirname as dirname11, posix, sep } from "path";
72860
72991
  function createModulerModifier() {
72861
72992
  const getModuleFromFileName = createGetModuleFromFilename();
72862
72993
  return async (frames) => {
@@ -72865,7 +72996,7 @@ function createModulerModifier() {
72865
72996
  return frames;
72866
72997
  };
72867
72998
  }
72868
- 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 === "\\") {
72869
73000
  const normalizedBase = isWindows ? normalizeWindowsPath(basePath) : basePath;
72870
73001
  return (filename) => {
72871
73002
  if (!filename)
@@ -75204,14 +75335,14 @@ async function addSourceContext(frames) {
75204
75335
  return frames;
75205
75336
  }
75206
75337
  function getContextLinesFromFile(path6, ranges, output) {
75207
- return new Promise((resolve4) => {
75338
+ return new Promise((resolve6) => {
75208
75339
  const stream = createReadStream(path6);
75209
75340
  const lineReaded = createInterface2({
75210
75341
  input: stream
75211
75342
  });
75212
75343
  function destroyStreamAndResolve() {
75213
75344
  stream.destroy();
75214
- resolve4();
75345
+ resolve6();
75215
75346
  }
75216
75347
  let lineNumber = 0;
75217
75348
  let currentRangeIndex = 0;
@@ -76451,9 +76582,9 @@ class PostHogBackendClient extends PostHogCoreStateless {
76451
76582
  if (this.disabled || this.optedOut)
76452
76583
  return;
76453
76584
  if (!this._waitUntilCycle) {
76454
- let resolve4;
76585
+ let resolve6;
76455
76586
  const promise2 = new Promise((r2) => {
76456
- resolve4 = r2;
76587
+ resolve6 = r2;
76457
76588
  });
76458
76589
  try {
76459
76590
  waitUntil(promise2);
@@ -76461,7 +76592,7 @@ class PostHogBackendClient extends PostHogCoreStateless {
76461
76592
  return;
76462
76593
  }
76463
76594
  this._waitUntilCycle = {
76464
- resolve: resolve4,
76595
+ resolve: resolve6,
76465
76596
  startedAt: Date.now(),
76466
76597
  timer: undefined
76467
76598
  };
@@ -76487,11 +76618,11 @@ class PostHogBackendClient extends PostHogCoreStateless {
76487
76618
  return cycle?.resolve;
76488
76619
  }
76489
76620
  async resolveWaitUntilFlush() {
76490
- const resolve4 = this._consumeWaitUntilCycle();
76621
+ const resolve6 = this._consumeWaitUntilCycle();
76491
76622
  try {
76492
76623
  await super.flush();
76493
76624
  } catch {} finally {
76494
- resolve4?.();
76625
+ resolve6?.();
76495
76626
  }
76496
76627
  }
76497
76628
  getPersistedProperty(key) {
@@ -76591,15 +76722,15 @@ class PostHogBackendClient extends PostHogCoreStateless {
76591
76722
  return true;
76592
76723
  if (this.featureFlagsPoller === undefined)
76593
76724
  return false;
76594
- return new Promise((resolve4) => {
76725
+ return new Promise((resolve6) => {
76595
76726
  const timeout = setTimeout(() => {
76596
76727
  cleanup();
76597
- resolve4(false);
76728
+ resolve6(false);
76598
76729
  }, timeoutMs);
76599
76730
  const cleanup = this._events.on("localEvaluationFlagsLoaded", (count) => {
76600
76731
  clearTimeout(timeout);
76601
76732
  cleanup();
76602
- resolve4(count > 0);
76733
+ resolve6(count > 0);
76603
76734
  });
76604
76735
  });
76605
76736
  }
@@ -76943,13 +77074,13 @@ class PostHogBackendClient extends PostHogCoreStateless {
76943
77074
  this.context?.enter(data, options);
76944
77075
  }
76945
77076
  async _shutdown(shutdownTimeoutMs) {
76946
- const resolve4 = this._consumeWaitUntilCycle();
77077
+ const resolve6 = this._consumeWaitUntilCycle();
76947
77078
  await this.featureFlagsPoller?.stopPoller(shutdownTimeoutMs);
76948
77079
  this.errorTracking.shutdown();
76949
77080
  try {
76950
77081
  return await super._shutdown(shutdownTimeoutMs);
76951
77082
  } finally {
76952
- resolve4?.();
77083
+ resolve6?.();
76953
77084
  }
76954
77085
  }
76955
77086
  async _requestRemoteConfigPayload(flagKey) {
@@ -77303,11 +77434,11 @@ init_data_path();
77303
77434
  init_logger();
77304
77435
  init_plugin_identity();
77305
77436
  init_write_file_atomically();
77306
- import { existsSync as existsSync22, mkdirSync as mkdirSync10, readFileSync as readFileSync17 } from "fs";
77307
- 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";
77308
77439
  var POSTHOG_ACTIVITY_STATE_FILE = "posthog-activity.json";
77309
77440
  function getPostHogActivityStateFilePath() {
77310
- return join22(getDataDir(), CACHE_DIR_NAME, POSTHOG_ACTIVITY_STATE_FILE);
77441
+ return join23(getDataDir(), CACHE_DIR_NAME, POSTHOG_ACTIVITY_STATE_FILE);
77311
77442
  }
77312
77443
  function getUtcDayString(date5) {
77313
77444
  return date5.toISOString().slice(0, 10);
@@ -77317,7 +77448,7 @@ function isPostHogActivityState(value) {
77317
77448
  }
77318
77449
  function readPostHogActivityState() {
77319
77450
  const stateFilePath = getPostHogActivityStateFilePath();
77320
- if (!existsSync22(stateFilePath)) {
77451
+ if (!existsSync23(stateFilePath)) {
77321
77452
  return {};
77322
77453
  }
77323
77454
  try {
@@ -77338,7 +77469,7 @@ function readPostHogActivityState() {
77338
77469
  function writePostHogActivityState(nextState) {
77339
77470
  const stateFilePath = getPostHogActivityStateFilePath();
77340
77471
  try {
77341
- mkdirSync10(join22(getDataDir(), CACHE_DIR_NAME), { recursive: true });
77472
+ mkdirSync10(join23(getDataDir(), CACHE_DIR_NAME), { recursive: true });
77342
77473
  writeFileAtomically(stateFilePath, `${JSON.stringify(nextState, null, 2)}
77343
77474
  `);
77344
77475
  } catch (error48) {
@@ -77366,9 +77497,13 @@ function getPostHogActivityCaptureState(now = new Date) {
77366
77497
 
77367
77498
  // src/shared/posthog.ts
77368
77499
  var activityStateProviderOverride = null;
77500
+ var osProviderOverride = null;
77369
77501
  function resolveActivityState() {
77370
77502
  return (activityStateProviderOverride ?? getPostHogActivityCaptureState)();
77371
77503
  }
77504
+ function resolveOsProvider() {
77505
+ return osProviderOverride ?? os3;
77506
+ }
77372
77507
  var DEFAULT_POSTHOG_HOST = "https://us.i.posthog.com";
77373
77508
  var DEFAULT_POSTHOG_API_KEY = "phc_CFJhj5HyvA62QPhvyaUCtaq23aUfznnijg5VaaGkNk74";
77374
77509
  var NO_OP_POSTHOG = {
@@ -77399,7 +77534,7 @@ function getPostHogHost() {
77399
77534
  }
77400
77535
  function safeCpus() {
77401
77536
  try {
77402
- const cpus = os3.cpus();
77537
+ const cpus = resolveOsProvider().cpus();
77403
77538
  return { length: cpus.length, model: cpus[0]?.model };
77404
77539
  } catch {
77405
77540
  return { length: 0, model: undefined };
@@ -77407,6 +77542,7 @@ function safeCpus() {
77407
77542
  }
77408
77543
  function getSharedProperties(source) {
77409
77544
  const cpus = safeCpus();
77545
+ const osProvider = resolveOsProvider();
77410
77546
  return {
77411
77547
  platform: "oh-my-opencode",
77412
77548
  package_name: PUBLISHED_PACKAGE_NAME,
@@ -77415,13 +77551,13 @@ function getSharedProperties(source) {
77415
77551
  runtime: "bun",
77416
77552
  runtime_version: process.versions.bun ?? process.version,
77417
77553
  source,
77418
- $os: os3.platform(),
77419
- $os_version: os3.release(),
77420
- os_arch: os3.arch(),
77421
- os_type: os3.type(),
77554
+ $os: osProvider.platform(),
77555
+ $os_version: osProvider.release(),
77556
+ os_arch: osProvider.arch(),
77557
+ os_type: osProvider.type(),
77422
77558
  cpu_count: cpus.length,
77423
77559
  cpu_model: cpus.model,
77424
- total_memory_gb: Math.round(os3.totalmem() / 1024 / 1024 / 1024),
77560
+ total_memory_gb: Math.round(osProvider.totalmem() / 1024 / 1024 / 1024),
77425
77561
  locale: Intl.DateTimeFormat().resolvedOptions().locale,
77426
77562
  timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
77427
77563
  shell: process.env.SHELL,
@@ -77464,11 +77600,14 @@ function createPostHogClient(source, options) {
77464
77600
  };
77465
77601
  }
77466
77602
  function getPostHogDistinctId() {
77467
- return createHash("sha256").update(`${PUBLISHED_PACKAGE_NAME}:${os3.hostname()}`).digest("hex");
77603
+ return createHash("sha256").update(`${PUBLISHED_PACKAGE_NAME}:${resolveOsProvider().hostname()}`).digest("hex");
77468
77604
  }
77469
77605
  function createCliPostHog() {
77470
77606
  return createPostHogClient("cli", {
77471
77607
  enableExceptionAutocapture: false,
77608
+ enableLocalEvaluation: false,
77609
+ strictLocalEvaluation: true,
77610
+ disableRemoteConfig: true,
77472
77611
  flushAt: 1,
77473
77612
  flushInterval: 0
77474
77613
  });
@@ -77479,7 +77618,7 @@ var EVENT_PROCESSOR_SHUTDOWN_TIMEOUT_MS = 2000;
77479
77618
  async function waitForEventProcessorShutdown(eventProcessor, timeoutMs = EVENT_PROCESSOR_SHUTDOWN_TIMEOUT_MS) {
77480
77619
  const completed = await Promise.race([
77481
77620
  eventProcessor.then(() => true),
77482
- new Promise((resolve4) => setTimeout(() => resolve4(false), timeoutMs))
77621
+ new Promise((resolve6) => setTimeout(() => resolve6(false), timeoutMs))
77483
77622
  ]);
77484
77623
  }
77485
77624
  async function run(options) {
@@ -77753,12 +77892,12 @@ async function getLocalVersion(options = {}) {
77753
77892
  }
77754
77893
  }
77755
77894
  // src/cli/doctor/checks/system.ts
77756
- import { existsSync as existsSync33, readFileSync as readFileSync27 } from "fs";
77895
+ import { existsSync as existsSync34, readFileSync as readFileSync27 } from "fs";
77757
77896
 
77758
77897
  // src/cli/doctor/checks/system-binary.ts
77759
- import { existsSync as existsSync30 } from "fs";
77760
- import { homedir as homedir6 } from "os";
77761
- 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";
77762
77901
 
77763
77902
  // src/cli/doctor/spawn-with-timeout.ts
77764
77903
  init_spawn_with_windows_hide();
@@ -77771,8 +77910,8 @@ async function spawnWithTimeout(command, options, timeoutMs = DEFAULT_SPAWN_TIME
77771
77910
  return { stdout: "", stderr: "", exitCode: 1, timedOut: false };
77772
77911
  }
77773
77912
  let timer;
77774
- const timeoutPromise = new Promise((resolve4) => {
77775
- timer = setTimeout(() => resolve4("timeout"), timeoutMs);
77913
+ const timeoutPromise = new Promise((resolve6) => {
77914
+ timer = setTimeout(() => resolve6("timeout"), timeoutMs);
77776
77915
  });
77777
77916
  const processPromise = (async () => {
77778
77917
  await proc.exited;
@@ -77792,22 +77931,22 @@ async function spawnWithTimeout(command, options, timeoutMs = DEFAULT_SPAWN_TIME
77792
77931
 
77793
77932
  // src/cli/doctor/checks/system-binary.ts
77794
77933
  function getDesktopAppPaths(platform) {
77795
- const home = homedir6();
77934
+ const home = homedir7();
77796
77935
  switch (platform) {
77797
77936
  case "darwin":
77798
77937
  return [
77799
77938
  "/Applications/OpenCode.app/Contents/MacOS/OpenCode",
77800
- join29(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
77939
+ join30(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
77801
77940
  ];
77802
77941
  case "win32": {
77803
77942
  const programFiles = process.env.ProgramFiles;
77804
77943
  const localAppData = process.env.LOCALAPPDATA;
77805
77944
  const paths = [];
77806
77945
  if (programFiles) {
77807
- paths.push(join29(programFiles, "OpenCode", "OpenCode.exe"));
77946
+ paths.push(join30(programFiles, "OpenCode", "OpenCode.exe"));
77808
77947
  }
77809
77948
  if (localAppData) {
77810
- paths.push(join29(localAppData, "OpenCode", "OpenCode.exe"));
77949
+ paths.push(join30(localAppData, "OpenCode", "OpenCode.exe"));
77811
77950
  }
77812
77951
  return paths;
77813
77952
  }
@@ -77815,8 +77954,8 @@ function getDesktopAppPaths(platform) {
77815
77954
  return [
77816
77955
  "/usr/bin/opencode",
77817
77956
  "/usr/lib/opencode/opencode",
77818
- join29(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
77819
- 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")
77820
77959
  ];
77821
77960
  default:
77822
77961
  return [];
@@ -77828,7 +77967,7 @@ function buildVersionCommand(binaryPath, platform) {
77828
77967
  }
77829
77968
  return [binaryPath, "--version"];
77830
77969
  }
77831
- function findDesktopBinary(platform = process.platform, checkExists = existsSync30) {
77970
+ function findDesktopBinary(platform = process.platform, checkExists = existsSync31) {
77832
77971
  for (const desktopPath of getDesktopAppPaths(platform)) {
77833
77972
  if (checkExists(desktopPath)) {
77834
77973
  return { binary: "opencode", path: desktopPath };
@@ -77874,12 +78013,12 @@ function compareVersions3(current, minimum) {
77874
78013
 
77875
78014
  // src/cli/doctor/checks/system-plugin.ts
77876
78015
  init_shared();
77877
- import { existsSync as existsSync31, readFileSync as readFileSync25 } from "fs";
78016
+ import { existsSync as existsSync32, readFileSync as readFileSync25 } from "fs";
77878
78017
  function detectConfigPath() {
77879
78018
  const paths = getOpenCodeConfigPaths({ binary: "opencode", version: null });
77880
- if (existsSync31(paths.configJsonc))
78019
+ if (existsSync32(paths.configJsonc))
77881
78020
  return paths.configJsonc;
77882
- if (existsSync31(paths.configJson))
78021
+ if (existsSync32(paths.configJson))
77883
78022
  return paths.configJson;
77884
78023
  return null;
77885
78024
  }
@@ -77963,34 +78102,34 @@ function getPluginInfo() {
77963
78102
  init_file_utils();
77964
78103
  init_checker();
77965
78104
  init_auto_update_checker();
77966
- import { existsSync as existsSync32, readFileSync as readFileSync26 } from "fs";
77967
- import { homedir as homedir7 } from "os";
77968
- 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";
77969
78108
  init_shared();
77970
78109
  function getPlatformDefaultCacheDir(platform = process.platform) {
77971
78110
  if (platform === "darwin")
77972
- return join30(homedir7(), "Library", "Caches");
78111
+ return join31(homedir8(), "Library", "Caches");
77973
78112
  if (platform === "win32")
77974
- return process.env.LOCALAPPDATA ?? join30(homedir7(), "AppData", "Local");
77975
- return join30(homedir7(), ".cache");
78113
+ return process.env.LOCALAPPDATA ?? join31(homedir8(), "AppData", "Local");
78114
+ return join31(homedir8(), ".cache");
77976
78115
  }
77977
78116
  function resolveOpenCodeCacheDir() {
77978
78117
  const xdgCacheHome = process.env.XDG_CACHE_HOME;
77979
78118
  if (xdgCacheHome)
77980
- return join30(xdgCacheHome, "opencode");
78119
+ return join31(xdgCacheHome, "opencode");
77981
78120
  const fromShared = getOpenCodeCacheDir();
77982
- const platformDefault = join30(getPlatformDefaultCacheDir(), "opencode");
77983
- if (existsSync32(fromShared) || !existsSync32(platformDefault))
78121
+ const platformDefault = join31(getPlatformDefaultCacheDir(), "opencode");
78122
+ if (existsSync33(fromShared) || !existsSync33(platformDefault))
77984
78123
  return fromShared;
77985
78124
  return platformDefault;
77986
78125
  }
77987
78126
  function resolveExistingDir(dirPath) {
77988
- if (!existsSync32(dirPath))
78127
+ if (!existsSync33(dirPath))
77989
78128
  return dirPath;
77990
78129
  return resolveSymlink(dirPath);
77991
78130
  }
77992
78131
  function readPackageJson(filePath) {
77993
- if (!existsSync32(filePath))
78132
+ if (!existsSync33(filePath))
77994
78133
  return null;
77995
78134
  try {
77996
78135
  const content = readFileSync26(filePath, "utf-8");
@@ -78008,11 +78147,11 @@ function normalizeVersion(value) {
78008
78147
  function createPackageCandidates(rootDir) {
78009
78148
  return ACCEPTED_PACKAGE_NAMES.map((packageName) => ({
78010
78149
  packageName,
78011
- installedPackagePath: join30(rootDir, "node_modules", packageName, "package.json")
78150
+ installedPackagePath: join31(rootDir, "node_modules", packageName, "package.json")
78012
78151
  }));
78013
78152
  }
78014
78153
  function selectInstalledPackage(candidate) {
78015
- return candidate.packageCandidates.find((packageCandidate) => existsSync32(packageCandidate.installedPackagePath)) ?? candidate.packageCandidates[0];
78154
+ return candidate.packageCandidates.find((packageCandidate) => existsSync33(packageCandidate.installedPackagePath)) ?? candidate.packageCandidates[0];
78016
78155
  }
78017
78156
  function getExpectedVersion(cachePackage, packageName) {
78018
78157
  return normalizeVersion(cachePackage?.dependencies?.[packageName]) ?? normalizeVersion(cachePackage?.dependencies?.[PACKAGE_NAME]);
@@ -78024,16 +78163,16 @@ function getLoadedPluginVersion() {
78024
78163
  const candidates = [
78025
78164
  {
78026
78165
  cacheDir: configDir,
78027
- cachePackagePath: join30(configDir, "package.json"),
78166
+ cachePackagePath: join31(configDir, "package.json"),
78028
78167
  packageCandidates: createPackageCandidates(configDir)
78029
78168
  },
78030
78169
  {
78031
78170
  cacheDir,
78032
- cachePackagePath: join30(cacheDir, "package.json"),
78171
+ cachePackagePath: join31(cacheDir, "package.json"),
78033
78172
  packageCandidates: createPackageCandidates(cacheDir)
78034
78173
  }
78035
78174
  ];
78036
- 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];
78037
78176
  const { cacheDir: selectedDir, cachePackagePath } = selectedCandidate;
78038
78177
  const selectedPackage = selectInstalledPackage(selectedCandidate);
78039
78178
  const installedPackagePath = selectedPackage.installedPackagePath;
@@ -78072,7 +78211,7 @@ var defaultDeps3 = {
78072
78211
  function isConfigValid(configPath) {
78073
78212
  if (!configPath)
78074
78213
  return true;
78075
- if (!existsSync33(configPath))
78214
+ if (!existsSync34(configPath))
78076
78215
  return false;
78077
78216
  try {
78078
78217
  parseJsonc(readFileSync27(configPath, "utf-8"));
@@ -78198,28 +78337,28 @@ async function checkSystem(deps = defaultDeps3) {
78198
78337
 
78199
78338
  // src/cli/doctor/checks/config.ts
78200
78339
  import { readFileSync as readFileSync30 } from "fs";
78201
- import { join as join34 } from "path";
78340
+ import { join as join35 } from "path";
78202
78341
  init_shared();
78203
78342
 
78204
78343
  // src/cli/doctor/checks/model-resolution-cache.ts
78205
78344
  init_shared();
78206
- import { existsSync as existsSync34, readFileSync as readFileSync28 } from "fs";
78207
- import { homedir as homedir8 } from "os";
78208
- 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";
78209
78348
  function getUserConfigDir2() {
78210
78349
  const xdgConfig = process.env.XDG_CONFIG_HOME;
78211
78350
  if (xdgConfig)
78212
- return join31(xdgConfig, "opencode");
78213
- return join31(homedir8(), ".config", "opencode");
78351
+ return join32(xdgConfig, "opencode");
78352
+ return join32(homedir9(), ".config", "opencode");
78214
78353
  }
78215
78354
  function loadCustomProviderNames() {
78216
78355
  const configDir = getUserConfigDir2();
78217
78356
  const candidatePaths = [
78218
- join31(configDir, "opencode.json"),
78219
- join31(configDir, "opencode.jsonc")
78357
+ join32(configDir, "opencode.json"),
78358
+ join32(configDir, "opencode.jsonc")
78220
78359
  ];
78221
78360
  for (const configPath of candidatePaths) {
78222
- if (!existsSync34(configPath))
78361
+ if (!existsSync35(configPath))
78223
78362
  continue;
78224
78363
  try {
78225
78364
  const content = readFileSync28(configPath, "utf-8");
@@ -78232,9 +78371,9 @@ function loadCustomProviderNames() {
78232
78371
  return [];
78233
78372
  }
78234
78373
  function loadAvailableModelsFromCache() {
78235
- const cacheFile = join31(getOpenCodeCacheDir(), "models.json");
78374
+ const cacheFile = join32(getOpenCodeCacheDir(), "models.json");
78236
78375
  const customProviders = loadCustomProviderNames();
78237
- if (!existsSync34(cacheFile)) {
78376
+ if (!existsSync35(cacheFile)) {
78238
78377
  if (customProviders.length > 0) {
78239
78378
  return { providers: customProviders, modelCount: 0, cacheExists: true };
78240
78379
  }
@@ -78265,8 +78404,8 @@ init_model_capabilities();
78265
78404
  // src/cli/doctor/checks/model-resolution-config.ts
78266
78405
  init_shared();
78267
78406
  import { readFileSync as readFileSync29 } from "fs";
78268
- import { join as join32 } from "path";
78269
- var PROJECT_CONFIG_DIR = join32(process.cwd(), ".opencode");
78407
+ import { join as join33 } from "path";
78408
+ var PROJECT_CONFIG_DIR = join33(process.cwd(), ".opencode");
78270
78409
  function loadOmoConfig() {
78271
78410
  const projectDetected = detectPluginConfigFile(PROJECT_CONFIG_DIR);
78272
78411
  if (projectDetected.format !== "none") {
@@ -78292,7 +78431,7 @@ function loadOmoConfig() {
78292
78431
 
78293
78432
  // src/cli/doctor/checks/model-resolution-details.ts
78294
78433
  init_shared();
78295
- import { join as join33 } from "path";
78434
+ import { join as join34 } from "path";
78296
78435
 
78297
78436
  // src/cli/doctor/checks/model-resolution-variant.ts
78298
78437
  function formatModelWithVariant(model, variant) {
@@ -78334,7 +78473,7 @@ function formatCapabilityResolutionLabel(mode) {
78334
78473
  }
78335
78474
  function buildModelResolutionDetails(options) {
78336
78475
  const details = [];
78337
- const cacheFile = join33(getOpenCodeCacheDir(), "models.json");
78476
+ const cacheFile = join34(getOpenCodeCacheDir(), "models.json");
78338
78477
  details.push("\u2550\u2550\u2550 Available Models (from cache) \u2550\u2550\u2550");
78339
78478
  details.push("");
78340
78479
  if (options.available.cacheExists) {
@@ -78489,7 +78628,7 @@ async function checkModels() {
78489
78628
  }
78490
78629
 
78491
78630
  // src/cli/doctor/checks/config.ts
78492
- var PROJECT_CONFIG_DIR2 = join34(process.cwd(), ".opencode");
78631
+ var PROJECT_CONFIG_DIR2 = join35(process.cwd(), ".opencode");
78493
78632
  function findConfigPath() {
78494
78633
  const projectConfig = detectPluginConfigFile(PROJECT_CONFIG_DIR2);
78495
78634
  if (projectConfig.format !== "none")
@@ -78609,27 +78748,27 @@ async function checkConfig() {
78609
78748
  }
78610
78749
 
78611
78750
  // src/cli/doctor/checks/dependencies.ts
78612
- import { existsSync as existsSync35 } from "fs";
78751
+ import { existsSync as existsSync36 } from "fs";
78613
78752
  import { createRequire } from "module";
78614
- import { dirname as dirname14, join as join36 } from "path";
78753
+ import { dirname as dirname15, join as join37 } from "path";
78615
78754
 
78616
78755
  // src/hooks/comment-checker/downloader.ts
78617
- import { join as join35 } from "path";
78618
- 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";
78619
78758
  init_binary_downloader();
78620
78759
  init_logger();
78621
78760
  init_plugin_identity();
78622
78761
  var DEBUG = process.env.COMMENT_CHECKER_DEBUG === "1";
78623
- var DEBUG_FILE = join35(tmpdir3(), "comment-checker-debug.log");
78762
+ var DEBUG_FILE = join36(tmpdir3(), "comment-checker-debug.log");
78624
78763
  function getCacheDir2() {
78625
78764
  if (process.platform === "win32") {
78626
78765
  const localAppData = process.env.LOCALAPPDATA || process.env.APPDATA;
78627
- const base2 = localAppData || join35(homedir9(), "AppData", "Local");
78628
- return join35(base2, CACHE_DIR_NAME, "bin");
78766
+ const base2 = localAppData || join36(homedir10(), "AppData", "Local");
78767
+ return join36(base2, CACHE_DIR_NAME, "bin");
78629
78768
  }
78630
78769
  const xdgCache = process.env.XDG_CACHE_HOME;
78631
- const base = xdgCache || join35(homedir9(), ".cache");
78632
- return join35(base, CACHE_DIR_NAME, "bin");
78770
+ const base = xdgCache || join36(homedir10(), ".cache");
78771
+ return join36(base, CACHE_DIR_NAME, "bin");
78633
78772
  }
78634
78773
  function getBinaryName() {
78635
78774
  return process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
@@ -78693,15 +78832,15 @@ async function checkAstGrepNapi() {
78693
78832
  path: null
78694
78833
  };
78695
78834
  } catch {
78696
- const { existsSync: existsSync36 } = await import("fs");
78697
- const { join: join37 } = await import("path");
78698
- 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");
78699
78838
  const pathsToCheck = [
78700
- join37(homedir10(), ".config", "opencode", "node_modules", "@ast-grep", "napi"),
78701
- 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")
78702
78841
  ];
78703
78842
  for (const napiPath of pathsToCheck) {
78704
- if (existsSync36(napiPath)) {
78843
+ if (existsSync37(napiPath)) {
78705
78844
  return {
78706
78845
  name: "AST-Grep NAPI",
78707
78846
  required: false,
@@ -78726,8 +78865,8 @@ function findCommentCheckerPackageBinary() {
78726
78865
  try {
78727
78866
  const require2 = createRequire(import.meta.url);
78728
78867
  const pkgPath = require2.resolve("@code-yeongyu/comment-checker/package.json");
78729
- const binaryPath = join36(dirname14(pkgPath), "bin", binaryName);
78730
- if (existsSync35(binaryPath))
78868
+ const binaryPath = join37(dirname15(pkgPath), "bin", binaryName);
78869
+ if (existsSync36(binaryPath))
78731
78870
  return binaryPath;
78732
78871
  } catch {}
78733
78872
  return null;
@@ -78823,6 +78962,19 @@ async function getGhAuthStatus() {
78823
78962
  async function getGhCliInfo() {
78824
78963
  const binaryStatus = await checkBinaryExists2("gh");
78825
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
+ }
78826
78978
  return {
78827
78979
  installed: false,
78828
78980
  version: null,
@@ -78888,12 +79040,12 @@ var BUILTIN_SERVERS = {
78888
79040
  "kotlin-ls": { command: ["kotlin-lsp"], extensions: [".kt", ".kts"] }
78889
79041
  };
78890
79042
  // src/tools/lsp/server-config-loader.ts
78891
- import { existsSync as existsSync36, readFileSync as readFileSync31 } from "fs";
78892
- import { join as join37 } from "path";
79043
+ import { existsSync as existsSync37, readFileSync as readFileSync31 } from "fs";
79044
+ import { join as join38 } from "path";
78893
79045
  init_shared();
78894
79046
  init_jsonc_parser();
78895
79047
  function loadJsonFile(path12) {
78896
- if (!existsSync36(path12))
79048
+ if (!existsSync37(path12))
78897
79049
  return null;
78898
79050
  try {
78899
79051
  return parseJsonc(readFileSync31(path12, "utf-8"));
@@ -78905,9 +79057,9 @@ function getConfigPaths2() {
78905
79057
  const cwd = process.cwd();
78906
79058
  const configDir = getOpenCodeConfigDir({ binary: "opencode" });
78907
79059
  return {
78908
- project: detectPluginConfigFile(join37(cwd, ".opencode")).path,
79060
+ project: detectPluginConfigFile(join38(cwd, ".opencode")).path,
78909
79061
  user: detectPluginConfigFile(configDir).path,
78910
- opencode: detectConfigFile(join37(configDir, "opencode")).path
79062
+ opencode: detectConfigFile(join38(configDir, "opencode")).path
78911
79063
  };
78912
79064
  }
78913
79065
  function loadAllConfigs() {
@@ -78976,21 +79128,21 @@ function getMergedServers() {
78976
79128
  }
78977
79129
 
78978
79130
  // src/tools/lsp/server-installation.ts
78979
- import { existsSync as existsSync37 } from "fs";
78980
- 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";
78981
79133
 
78982
79134
  // src/tools/lsp/server-path-bases.ts
78983
79135
  init_shared();
78984
- import { join as join38 } from "path";
79136
+ import { join as join39 } from "path";
78985
79137
  function getLspServerAdditionalPathBases(workingDirectory) {
78986
79138
  const configDir = getOpenCodeConfigDir({ binary: "opencode" });
78987
- const dataDir = join38(getDataDir(), "opencode");
79139
+ const dataDir = join39(getDataDir(), "opencode");
78988
79140
  return [
78989
- join38(workingDirectory, "node_modules", ".bin"),
78990
- join38(configDir, "bin"),
78991
- join38(configDir, "node_modules", ".bin"),
78992
- join38(dataDir, "bin"),
78993
- 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")
78994
79146
  ];
78995
79147
  }
78996
79148
 
@@ -79000,7 +79152,7 @@ function isServerInstalled(command) {
79000
79152
  return false;
79001
79153
  const cmd = command[0];
79002
79154
  if (cmd.includes("/") || cmd.includes("\\")) {
79003
- if (existsSync37(cmd))
79155
+ if (existsSync38(cmd))
79004
79156
  return true;
79005
79157
  }
79006
79158
  const isWindows = process.platform === "win32";
@@ -79021,14 +79173,14 @@ function isServerInstalled(command) {
79021
79173
  const paths = pathEnv.split(delimiter2);
79022
79174
  for (const p2 of paths) {
79023
79175
  for (const suffix of exts) {
79024
- if (existsSync37(join39(p2, cmd + suffix))) {
79176
+ if (existsSync38(join40(p2, cmd + suffix))) {
79025
79177
  return true;
79026
79178
  }
79027
79179
  }
79028
79180
  }
79029
79181
  for (const base of getLspServerAdditionalPathBases(process.cwd())) {
79030
79182
  for (const suffix of exts) {
79031
- if (existsSync37(join39(base, cmd + suffix))) {
79183
+ if (existsSync38(join40(base, cmd + suffix))) {
79032
79184
  return true;
79033
79185
  }
79034
79186
  }
@@ -79090,21 +79242,21 @@ function getInstalledLspServers() {
79090
79242
 
79091
79243
  // src/cli/doctor/checks/tools-mcp.ts
79092
79244
  init_shared();
79093
- import { existsSync as existsSync38, readFileSync as readFileSync32 } from "fs";
79094
- import { homedir as homedir10 } from "os";
79095
- 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";
79096
79248
  var BUILTIN_MCP_SERVERS = ["context7", "grep_app"];
79097
79249
  function getMcpConfigPaths() {
79098
79250
  return [
79099
- join40(homedir10(), ".claude", ".mcp.json"),
79100
- join40(process.cwd(), ".mcp.json"),
79101
- 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")
79102
79254
  ];
79103
79255
  }
79104
79256
  function loadUserMcpConfig() {
79105
79257
  const servers = {};
79106
79258
  for (const configPath of getMcpConfigPaths()) {
79107
- if (!existsSync38(configPath))
79259
+ if (!existsSync39(configPath))
79108
79260
  continue;
79109
79261
  try {
79110
79262
  const content = readFileSync32(configPath, "utf-8");
@@ -79238,6 +79390,88 @@ async function checkTools() {
79238
79390
  issues
79239
79391
  };
79240
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
+ }
79241
79475
  // src/cli/doctor/checks/index.ts
79242
79476
  function getAllCheckDefinitions() {
79243
79477
  return [
@@ -79261,6 +79495,11 @@ function getAllCheckDefinitions() {
79261
79495
  id: CHECK_IDS.MODELS,
79262
79496
  name: CHECK_NAMES[CHECK_IDS.MODELS],
79263
79497
  check: checkModels
79498
+ },
79499
+ {
79500
+ id: CHECK_IDS.TEAM_MODE,
79501
+ name: CHECK_NAMES[CHECK_IDS.TEAM_MODE],
79502
+ check: checkTeamMode
79264
79503
  }
79265
79504
  ];
79266
79505
  }
@@ -79567,8 +79806,18 @@ async function runDoctor(options) {
79567
79806
 
79568
79807
  // src/cli/doctor/index.ts
79569
79808
  async function doctor(options = { mode: "default" }) {
79570
- const result = await runDoctor(options);
79571
- 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
+ }
79572
79821
  }
79573
79822
 
79574
79823
  // src/cli/refresh-model-capabilities.ts
@@ -79605,11 +79854,11 @@ async function refreshModelCapabilities(options, deps = {}) {
79605
79854
 
79606
79855
  // src/features/mcp-oauth/storage.ts
79607
79856
  init_shared();
79608
- import { chmodSync as chmodSync2, existsSync as existsSync39, mkdirSync as mkdirSync12, readFileSync as readFileSync33, renameSync as renameSync4, unlinkSync as unlinkSync6, writeFileSync as writeFileSync10 } from "fs";
79609
- 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";
79610
79859
  var STORAGE_FILE_NAME = "mcp-oauth.json";
79611
79860
  function getMcpOauthStoragePath() {
79612
- return join41(getOpenCodeConfigDir({ binary: "opencode" }), STORAGE_FILE_NAME);
79861
+ return join42(getOpenCodeConfigDir({ binary: "opencode" }), STORAGE_FILE_NAME);
79613
79862
  }
79614
79863
  function normalizeHost(serverHost) {
79615
79864
  let host = serverHost.trim();
@@ -79646,11 +79895,11 @@ function buildKey(serverHost, resource) {
79646
79895
  }
79647
79896
  function readStore() {
79648
79897
  const filePath = getMcpOauthStoragePath();
79649
- if (!existsSync39(filePath)) {
79898
+ if (!existsSync40(filePath)) {
79650
79899
  return null;
79651
79900
  }
79652
79901
  try {
79653
- const content = readFileSync33(filePath, "utf-8");
79902
+ const content = readFileSync34(filePath, "utf-8");
79654
79903
  return JSON.parse(content);
79655
79904
  } catch {
79656
79905
  return null;
@@ -79659,8 +79908,8 @@ function readStore() {
79659
79908
  function writeStore(store2) {
79660
79909
  const filePath = getMcpOauthStoragePath();
79661
79910
  try {
79662
- const dir = dirname15(filePath);
79663
- if (!existsSync39(dir)) {
79911
+ const dir = dirname16(filePath);
79912
+ if (!existsSync40(dir)) {
79664
79913
  mkdirSync12(dir, { recursive: true });
79665
79914
  }
79666
79915
  const tempPath = `${filePath}.tmp.${Date.now()}`;
@@ -79697,7 +79946,7 @@ function deleteToken(serverHost, resource) {
79697
79946
  if (Object.keys(store2).length === 0) {
79698
79947
  try {
79699
79948
  const filePath = getMcpOauthStoragePath();
79700
- if (existsSync39(filePath)) {
79949
+ if (existsSync40(filePath)) {
79701
79950
  unlinkSync6(filePath);
79702
79951
  }
79703
79952
  return true;
@@ -79917,7 +80166,7 @@ function buildAuthorizationUrl(authorizationEndpoint, options) {
79917
80166
  }
79918
80167
  var CALLBACK_TIMEOUT_MS = 5 * 60 * 1000;
79919
80168
  function startCallbackServer(port) {
79920
- return new Promise((resolve4, reject) => {
80169
+ return new Promise((resolve6, reject) => {
79921
80170
  let timeoutId;
79922
80171
  const server2 = createServer((request, response) => {
79923
80172
  clearTimeout(timeoutId);
@@ -79943,7 +80192,7 @@ function startCallbackServer(port) {
79943
80192
  response.writeHead(200, { "content-type": "text/html" });
79944
80193
  response.end("<html><body><h1>Authorization successful. You can close this tab.</h1></body></html>");
79945
80194
  server2.close();
79946
- resolve4({ code, state: state2 });
80195
+ resolve6({ code, state: state2 });
79947
80196
  });
79948
80197
  timeoutId = setTimeout(() => {
79949
80198
  server2.close();