oh-my-opencode 3.17.1 → 3.17.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/index.js CHANGED
@@ -5036,7 +5036,7 @@ var init_context_limit_resolver = () => {};
5036
5036
 
5037
5037
  // src/shared/normalize-sdk-response.ts
5038
5038
  function normalizeSDKResponse(response, fallback, options) {
5039
- if (response === null || response === undefined) {
5039
+ if (response == null) {
5040
5040
  return fallback;
5041
5041
  }
5042
5042
  if (Array.isArray(response)) {
@@ -5044,7 +5044,7 @@ function normalizeSDKResponse(response, fallback, options) {
5044
5044
  }
5045
5045
  if (typeof response === "object" && "data" in response) {
5046
5046
  const data = response.data;
5047
- if (data !== null && data !== undefined) {
5047
+ if (data != null) {
5048
5048
  return data;
5049
5049
  }
5050
5050
  if (options?.preferResponseOnMissingData === true) {
@@ -6049,20 +6049,26 @@ var init_agent_names = __esm(() => {
6049
6049
  omo: "sisyphus",
6050
6050
  OmO: "sisyphus",
6051
6051
  Sisyphus: "sisyphus",
6052
+ "Sisyphus (Ultraworker)": "sisyphus",
6052
6053
  sisyphus: "sisyphus",
6054
+ "Hephaestus (Deep Agent)": "hephaestus",
6053
6055
  "OmO-Plan": "prometheus",
6054
6056
  "omo-plan": "prometheus",
6055
6057
  "Planner-Sisyphus": "prometheus",
6056
6058
  "planner-sisyphus": "prometheus",
6057
6059
  "Prometheus - Plan Builder": "prometheus",
6060
+ "Prometheus (Plan Builder)": "prometheus",
6058
6061
  prometheus: "prometheus",
6059
6062
  "orchestrator-sisyphus": "atlas",
6060
6063
  Atlas: "atlas",
6064
+ "Atlas (Plan Executor)": "atlas",
6061
6065
  atlas: "atlas",
6062
6066
  "plan-consultant": "metis",
6063
6067
  "Metis - Plan Consultant": "metis",
6068
+ "Metis (Plan Consultant)": "metis",
6064
6069
  metis: "metis",
6065
6070
  "Momus - Plan Critic": "momus",
6071
+ "Momus (Plan Critic)": "momus",
6066
6072
  momus: "momus",
6067
6073
  "Sisyphus-Junior": "sisyphus-junior",
6068
6074
  "sisyphus-junior": "sisyphus-junior",
@@ -6160,7 +6166,7 @@ var init_model_versions = __esm(() => {
6160
6166
  var init_agent_category = () => {};
6161
6167
 
6162
6168
  // src/shared/write-file-atomically.ts
6163
- import { closeSync, fsyncSync, openSync, renameSync, writeFileSync } from "fs";
6169
+ import { closeSync, fsyncSync, openSync, renameSync, unlinkSync, writeFileSync } from "fs";
6164
6170
  function writeFileAtomically(filePath, content) {
6165
6171
  const tempPath = `${filePath}.tmp`;
6166
6172
  writeFileSync(tempPath, content, "utf-8");
@@ -6170,7 +6176,18 @@ function writeFileAtomically(filePath, content) {
6170
6176
  } finally {
6171
6177
  closeSync(tempFileDescriptor);
6172
6178
  }
6173
- renameSync(tempPath, filePath);
6179
+ try {
6180
+ renameSync(tempPath, filePath);
6181
+ } catch (error) {
6182
+ const isWindows = process.platform === "win32";
6183
+ const isPermissionError = error instanceof Error && (error.message.includes("EPERM") || error.message.includes("EACCES"));
6184
+ if (isWindows && isPermissionError) {
6185
+ unlinkSync(filePath);
6186
+ renameSync(tempPath, filePath);
6187
+ } else {
6188
+ throw error;
6189
+ }
6190
+ }
6174
6191
  }
6175
6192
  var init_write_file_atomically = () => {};
6176
6193
 
@@ -6591,6 +6608,12 @@ var init_zip_extractor = __esm(() => {
6591
6608
  });
6592
6609
 
6593
6610
  // src/shared/binary-downloader.ts
6611
+ import { chmodSync, existsSync as existsSync5, mkdirSync as mkdirSync3, unlinkSync as unlinkSync2 } from "fs";
6612
+ import * as path4 from "path";
6613
+ function getCachedBinaryPath(cacheDir, binaryName) {
6614
+ const binaryPath = path4.join(cacheDir, binaryName);
6615
+ return existsSync5(binaryPath) ? binaryPath : null;
6616
+ }
6594
6617
  var init_binary_downloader = __esm(() => {
6595
6618
  init_archive_entry_validator();
6596
6619
  init_zip_extractor();
@@ -6603,11 +6626,11 @@ var init_model_requirements = __esm(() => {
6603
6626
  sisyphus: {
6604
6627
  fallbackChain: [
6605
6628
  {
6606
- providers: ["anthropic", "github-copilot", "opencode"],
6629
+ providers: ["anthropic", "github-copilot", "opencode", "vercel"],
6607
6630
  model: "claude-opus-4-6",
6608
6631
  variant: "max"
6609
6632
  },
6610
- { providers: ["opencode-go"], model: "kimi-k2.5" },
6633
+ { providers: ["opencode-go", "vercel"], model: "kimi-k2.5" },
6611
6634
  { providers: ["kimi-for-coding"], model: "k2p5" },
6612
6635
  {
6613
6636
  providers: [
@@ -6616,12 +6639,13 @@ var init_model_requirements = __esm(() => {
6616
6639
  "moonshotai-cn",
6617
6640
  "firmware",
6618
6641
  "ollama-cloud",
6619
- "aihubmix"
6642
+ "aihubmix",
6643
+ "vercel"
6620
6644
  ],
6621
6645
  model: "kimi-k2.5"
6622
6646
  },
6623
- { providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.4", variant: "medium" },
6624
- { providers: ["zai-coding-plan", "opencode"], model: "glm-5" },
6647
+ { providers: ["openai", "github-copilot", "opencode", "vercel"], model: "gpt-5.4", variant: "medium" },
6648
+ { providers: ["zai-coding-plan", "opencode", "vercel"], model: "glm-5" },
6625
6649
  { providers: ["opencode"], model: "big-pickle" }
6626
6650
  ],
6627
6651
  requiresAnyModel: true
@@ -6629,73 +6653,73 @@ var init_model_requirements = __esm(() => {
6629
6653
  hephaestus: {
6630
6654
  fallbackChain: [
6631
6655
  {
6632
- providers: ["openai", "github-copilot", "venice", "opencode"],
6656
+ providers: ["openai", "github-copilot", "venice", "opencode", "vercel"],
6633
6657
  model: "gpt-5.4",
6634
6658
  variant: "medium"
6635
6659
  }
6636
6660
  ],
6637
- requiresProvider: ["openai", "github-copilot", "venice", "opencode"]
6661
+ requiresProvider: ["openai", "github-copilot", "venice", "opencode", "vercel"]
6638
6662
  },
6639
6663
  oracle: {
6640
6664
  fallbackChain: [
6641
6665
  {
6642
- providers: ["openai", "github-copilot", "opencode"],
6666
+ providers: ["openai", "github-copilot", "opencode", "vercel"],
6643
6667
  model: "gpt-5.4",
6644
6668
  variant: "high"
6645
6669
  },
6646
6670
  {
6647
- providers: ["google", "github-copilot", "opencode"],
6671
+ providers: ["google", "github-copilot", "opencode", "vercel"],
6648
6672
  model: "gemini-3.1-pro",
6649
6673
  variant: "high"
6650
6674
  },
6651
6675
  {
6652
- providers: ["anthropic", "github-copilot", "opencode"],
6676
+ providers: ["anthropic", "github-copilot", "opencode", "vercel"],
6653
6677
  model: "claude-opus-4-6",
6654
6678
  variant: "max"
6655
6679
  },
6656
- { providers: ["opencode-go"], model: "glm-5" }
6680
+ { providers: ["opencode-go", "vercel"], model: "glm-5" }
6657
6681
  ]
6658
6682
  },
6659
6683
  librarian: {
6660
6684
  fallbackChain: [
6661
- { providers: ["opencode-go"], model: "minimax-m2.7" },
6662
- { providers: ["opencode"], model: "minimax-m2.7-highspeed" },
6663
- { providers: ["anthropic", "opencode"], model: "claude-haiku-4-5" },
6664
- { providers: ["opencode"], model: "gpt-5-nano" }
6685
+ { providers: ["opencode-go", "vercel"], model: "minimax-m2.7" },
6686
+ { providers: ["opencode", "vercel"], model: "minimax-m2.7-highspeed" },
6687
+ { providers: ["anthropic", "opencode", "vercel"], model: "claude-haiku-4-5" },
6688
+ { providers: ["opencode", "vercel"], model: "gpt-5-nano" }
6665
6689
  ]
6666
6690
  },
6667
6691
  explore: {
6668
6692
  fallbackChain: [
6669
- { providers: ["github-copilot", "xai"], model: "grok-code-fast-1" },
6670
- { providers: ["opencode-go"], model: "minimax-m2.7-highspeed" },
6671
- { providers: ["opencode"], model: "minimax-m2.7" },
6672
- { providers: ["anthropic", "opencode"], model: "claude-haiku-4-5" },
6673
- { providers: ["opencode"], model: "gpt-5-nano" }
6693
+ { providers: ["github-copilot", "xai", "vercel"], model: "grok-code-fast-1" },
6694
+ { providers: ["opencode-go", "vercel"], model: "minimax-m2.7-highspeed" },
6695
+ { providers: ["opencode", "vercel"], model: "minimax-m2.7" },
6696
+ { providers: ["anthropic", "opencode", "vercel"], model: "claude-haiku-4-5" },
6697
+ { providers: ["opencode", "vercel"], model: "gpt-5-nano" }
6674
6698
  ]
6675
6699
  },
6676
6700
  "multimodal-looker": {
6677
6701
  fallbackChain: [
6678
- { providers: ["openai", "opencode"], model: "gpt-5.4", variant: "medium" },
6679
- { providers: ["opencode-go"], model: "kimi-k2.5" },
6680
- { providers: ["zai-coding-plan"], model: "glm-4.6v" },
6681
- { providers: ["openai", "github-copilot", "opencode"], model: "gpt-5-nano" }
6702
+ { providers: ["openai", "opencode", "vercel"], model: "gpt-5.4", variant: "medium" },
6703
+ { providers: ["opencode-go", "vercel"], model: "kimi-k2.5" },
6704
+ { providers: ["zai-coding-plan", "vercel"], model: "glm-4.6v" },
6705
+ { providers: ["openai", "github-copilot", "opencode", "vercel"], model: "gpt-5-nano" }
6682
6706
  ]
6683
6707
  },
6684
6708
  prometheus: {
6685
6709
  fallbackChain: [
6686
6710
  {
6687
- providers: ["anthropic", "github-copilot", "opencode"],
6711
+ providers: ["anthropic", "github-copilot", "opencode", "vercel"],
6688
6712
  model: "claude-opus-4-6",
6689
6713
  variant: "max"
6690
6714
  },
6691
6715
  {
6692
- providers: ["openai", "github-copilot", "opencode"],
6716
+ providers: ["openai", "github-copilot", "opencode", "vercel"],
6693
6717
  model: "gpt-5.4",
6694
6718
  variant: "high"
6695
6719
  },
6696
- { providers: ["opencode-go"], model: "glm-5" },
6720
+ { providers: ["opencode-go", "vercel"], model: "glm-5" },
6697
6721
  {
6698
- providers: ["google", "github-copilot", "opencode"],
6722
+ providers: ["google", "github-copilot", "opencode", "vercel"],
6699
6723
  model: "gemini-3.1-pro"
6700
6724
  }
6701
6725
  ]
@@ -6703,61 +6727,61 @@ var init_model_requirements = __esm(() => {
6703
6727
  metis: {
6704
6728
  fallbackChain: [
6705
6729
  {
6706
- providers: ["anthropic", "github-copilot", "opencode"],
6730
+ providers: ["anthropic", "github-copilot", "opencode", "vercel"],
6707
6731
  model: "claude-opus-4-6",
6708
6732
  variant: "max"
6709
6733
  },
6710
6734
  {
6711
- providers: ["openai", "github-copilot", "opencode"],
6735
+ providers: ["openai", "github-copilot", "opencode", "vercel"],
6712
6736
  model: "gpt-5.4",
6713
6737
  variant: "high"
6714
6738
  },
6715
- { providers: ["opencode-go"], model: "glm-5" },
6739
+ { providers: ["opencode-go", "vercel"], model: "glm-5" },
6716
6740
  { providers: ["kimi-for-coding"], model: "k2p5" }
6717
6741
  ]
6718
6742
  },
6719
6743
  momus: {
6720
6744
  fallbackChain: [
6721
6745
  {
6722
- providers: ["openai", "github-copilot", "opencode"],
6746
+ providers: ["openai", "github-copilot", "opencode", "vercel"],
6723
6747
  model: "gpt-5.4",
6724
6748
  variant: "xhigh"
6725
6749
  },
6726
6750
  {
6727
- providers: ["anthropic", "github-copilot", "opencode"],
6751
+ providers: ["anthropic", "github-copilot", "opencode", "vercel"],
6728
6752
  model: "claude-opus-4-6",
6729
6753
  variant: "max"
6730
6754
  },
6731
6755
  {
6732
- providers: ["google", "github-copilot", "opencode"],
6756
+ providers: ["google", "github-copilot", "opencode", "vercel"],
6733
6757
  model: "gemini-3.1-pro",
6734
6758
  variant: "high"
6735
6759
  },
6736
- { providers: ["opencode-go"], model: "glm-5" }
6760
+ { providers: ["opencode-go", "vercel"], model: "glm-5" }
6737
6761
  ]
6738
6762
  },
6739
6763
  atlas: {
6740
6764
  fallbackChain: [
6741
- { providers: ["anthropic", "github-copilot", "opencode"], model: "claude-sonnet-4-6" },
6742
- { providers: ["opencode-go"], model: "kimi-k2.5" },
6765
+ { providers: ["anthropic", "github-copilot", "opencode", "vercel"], model: "claude-sonnet-4-6" },
6766
+ { providers: ["opencode-go", "vercel"], model: "kimi-k2.5" },
6743
6767
  {
6744
- providers: ["openai", "github-copilot", "opencode"],
6768
+ providers: ["openai", "github-copilot", "opencode", "vercel"],
6745
6769
  model: "gpt-5.4",
6746
6770
  variant: "medium"
6747
6771
  },
6748
- { providers: ["opencode-go"], model: "minimax-m2.7" }
6772
+ { providers: ["opencode-go", "vercel"], model: "minimax-m2.7" }
6749
6773
  ]
6750
6774
  },
6751
6775
  "sisyphus-junior": {
6752
6776
  fallbackChain: [
6753
- { providers: ["anthropic", "github-copilot", "opencode"], model: "claude-sonnet-4-6" },
6754
- { providers: ["opencode-go"], model: "kimi-k2.5" },
6777
+ { providers: ["anthropic", "github-copilot", "opencode", "vercel"], model: "claude-sonnet-4-6" },
6778
+ { providers: ["opencode-go", "vercel"], model: "kimi-k2.5" },
6755
6779
  {
6756
- providers: ["openai", "github-copilot", "opencode"],
6780
+ providers: ["openai", "github-copilot", "opencode", "vercel"],
6757
6781
  model: "gpt-5.4",
6758
6782
  variant: "medium"
6759
6783
  },
6760
- { providers: ["opencode-go"], model: "minimax-m2.7" },
6784
+ { providers: ["opencode-go", "vercel"], model: "minimax-m2.7" },
6761
6785
  { providers: ["opencode"], model: "big-pickle" }
6762
6786
  ]
6763
6787
  }
@@ -6766,54 +6790,54 @@ var init_model_requirements = __esm(() => {
6766
6790
  "visual-engineering": {
6767
6791
  fallbackChain: [
6768
6792
  {
6769
- providers: ["google", "github-copilot", "opencode"],
6793
+ providers: ["google", "github-copilot", "opencode", "vercel"],
6770
6794
  model: "gemini-3.1-pro",
6771
6795
  variant: "high"
6772
6796
  },
6773
- { providers: ["zai-coding-plan", "opencode"], model: "glm-5" },
6797
+ { providers: ["zai-coding-plan", "opencode", "vercel"], model: "glm-5" },
6774
6798
  {
6775
- providers: ["anthropic", "github-copilot", "opencode"],
6799
+ providers: ["anthropic", "github-copilot", "opencode", "vercel"],
6776
6800
  model: "claude-opus-4-6",
6777
6801
  variant: "max"
6778
6802
  },
6779
- { providers: ["opencode-go"], model: "glm-5" },
6803
+ { providers: ["opencode-go", "vercel"], model: "glm-5" },
6780
6804
  { providers: ["kimi-for-coding"], model: "k2p5" }
6781
6805
  ]
6782
6806
  },
6783
6807
  ultrabrain: {
6784
6808
  fallbackChain: [
6785
6809
  {
6786
- providers: ["openai", "opencode"],
6810
+ providers: ["openai", "opencode", "vercel"],
6787
6811
  model: "gpt-5.4",
6788
6812
  variant: "xhigh"
6789
6813
  },
6790
6814
  {
6791
- providers: ["google", "github-copilot", "opencode"],
6815
+ providers: ["google", "github-copilot", "opencode", "vercel"],
6792
6816
  model: "gemini-3.1-pro",
6793
6817
  variant: "high"
6794
6818
  },
6795
6819
  {
6796
- providers: ["anthropic", "github-copilot", "opencode"],
6820
+ providers: ["anthropic", "github-copilot", "opencode", "vercel"],
6797
6821
  model: "claude-opus-4-6",
6798
6822
  variant: "max"
6799
6823
  },
6800
- { providers: ["opencode-go"], model: "glm-5" }
6824
+ { providers: ["opencode-go", "vercel"], model: "glm-5" }
6801
6825
  ]
6802
6826
  },
6803
6827
  deep: {
6804
6828
  fallbackChain: [
6805
6829
  {
6806
- providers: ["openai", "github-copilot", "venice", "opencode"],
6830
+ providers: ["openai", "github-copilot", "venice", "opencode", "vercel"],
6807
6831
  model: "gpt-5.4",
6808
6832
  variant: "medium"
6809
6833
  },
6810
6834
  {
6811
- providers: ["anthropic", "github-copilot", "opencode"],
6835
+ providers: ["anthropic", "github-copilot", "opencode", "vercel"],
6812
6836
  model: "claude-opus-4-6",
6813
6837
  variant: "max"
6814
6838
  },
6815
6839
  {
6816
- providers: ["google", "github-copilot", "opencode"],
6840
+ providers: ["google", "github-copilot", "opencode", "vercel"],
6817
6841
  model: "gemini-3.1-pro",
6818
6842
  variant: "high"
6819
6843
  }
@@ -6822,72 +6846,72 @@ var init_model_requirements = __esm(() => {
6822
6846
  artistry: {
6823
6847
  fallbackChain: [
6824
6848
  {
6825
- providers: ["google", "github-copilot", "opencode"],
6849
+ providers: ["google", "github-copilot", "opencode", "vercel"],
6826
6850
  model: "gemini-3.1-pro",
6827
6851
  variant: "high"
6828
6852
  },
6829
6853
  {
6830
- providers: ["anthropic", "github-copilot", "opencode"],
6854
+ providers: ["anthropic", "github-copilot", "opencode", "vercel"],
6831
6855
  model: "claude-opus-4-6",
6832
6856
  variant: "max"
6833
6857
  },
6834
- { providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.4" }
6858
+ { providers: ["openai", "github-copilot", "opencode", "vercel"], model: "gpt-5.4" }
6835
6859
  ],
6836
6860
  requiresModel: "gemini-3.1-pro"
6837
6861
  },
6838
6862
  quick: {
6839
6863
  fallbackChain: [
6840
6864
  {
6841
- providers: ["openai", "github-copilot", "opencode"],
6865
+ providers: ["openai", "github-copilot", "opencode", "vercel"],
6842
6866
  model: "gpt-5.4-mini"
6843
6867
  },
6844
6868
  {
6845
- providers: ["anthropic", "github-copilot", "opencode"],
6869
+ providers: ["anthropic", "github-copilot", "opencode", "vercel"],
6846
6870
  model: "claude-haiku-4-5"
6847
6871
  },
6848
6872
  {
6849
- providers: ["google", "github-copilot", "opencode"],
6873
+ providers: ["google", "github-copilot", "opencode", "vercel"],
6850
6874
  model: "gemini-3-flash"
6851
6875
  },
6852
- { providers: ["opencode-go"], model: "minimax-m2.7" },
6853
- { providers: ["opencode"], model: "gpt-5-nano" }
6876
+ { providers: ["opencode-go", "vercel"], model: "minimax-m2.7" },
6877
+ { providers: ["opencode", "vercel"], model: "gpt-5-nano" }
6854
6878
  ]
6855
6879
  },
6856
6880
  "unspecified-low": {
6857
6881
  fallbackChain: [
6858
6882
  {
6859
- providers: ["anthropic", "github-copilot", "opencode"],
6883
+ providers: ["anthropic", "github-copilot", "opencode", "vercel"],
6860
6884
  model: "claude-sonnet-4-6"
6861
6885
  },
6862
6886
  {
6863
- providers: ["openai", "opencode"],
6887
+ providers: ["openai", "opencode", "vercel"],
6864
6888
  model: "gpt-5.3-codex",
6865
6889
  variant: "medium"
6866
6890
  },
6867
- { providers: ["opencode-go"], model: "kimi-k2.5" },
6891
+ { providers: ["opencode-go", "vercel"], model: "kimi-k2.5" },
6868
6892
  {
6869
- providers: ["google", "github-copilot", "opencode"],
6893
+ providers: ["google", "github-copilot", "opencode", "vercel"],
6870
6894
  model: "gemini-3-flash"
6871
6895
  },
6872
- { providers: ["opencode-go"], model: "minimax-m2.7" }
6896
+ { providers: ["opencode-go", "vercel"], model: "minimax-m2.7" }
6873
6897
  ]
6874
6898
  },
6875
6899
  "unspecified-high": {
6876
6900
  fallbackChain: [
6877
6901
  {
6878
- providers: ["anthropic", "github-copilot", "opencode"],
6902
+ providers: ["anthropic", "github-copilot", "opencode", "vercel"],
6879
6903
  model: "claude-opus-4-6",
6880
6904
  variant: "max"
6881
6905
  },
6882
6906
  {
6883
- providers: ["openai", "github-copilot", "opencode"],
6907
+ providers: ["openai", "github-copilot", "opencode", "vercel"],
6884
6908
  model: "gpt-5.4",
6885
6909
  variant: "high"
6886
6910
  },
6887
- { providers: ["zai-coding-plan", "opencode"], model: "glm-5" },
6911
+ { providers: ["zai-coding-plan", "opencode", "vercel"], model: "glm-5" },
6888
6912
  { providers: ["kimi-for-coding"], model: "k2p5" },
6889
- { providers: ["opencode-go"], model: "glm-5" },
6890
- { providers: ["opencode"], model: "kimi-k2.5" },
6913
+ { providers: ["opencode-go", "vercel"], model: "glm-5" },
6914
+ { providers: ["opencode", "vercel"], model: "kimi-k2.5" },
6891
6915
  {
6892
6916
  providers: [
6893
6917
  "opencode",
@@ -6895,7 +6919,8 @@ var init_model_requirements = __esm(() => {
6895
6919
  "moonshotai-cn",
6896
6920
  "firmware",
6897
6921
  "ollama-cloud",
6898
- "aihubmix"
6922
+ "aihubmix",
6923
+ "vercel"
6899
6924
  ],
6900
6925
  model: "kimi-k2.5"
6901
6926
  }
@@ -6904,15 +6929,15 @@ var init_model_requirements = __esm(() => {
6904
6929
  writing: {
6905
6930
  fallbackChain: [
6906
6931
  {
6907
- providers: ["google", "github-copilot", "opencode"],
6932
+ providers: ["google", "github-copilot", "opencode", "vercel"],
6908
6933
  model: "gemini-3-flash"
6909
6934
  },
6910
- { providers: ["opencode-go"], model: "kimi-k2.5" },
6935
+ { providers: ["opencode-go", "vercel"], model: "kimi-k2.5" },
6911
6936
  {
6912
- providers: ["anthropic", "github-copilot", "opencode"],
6937
+ providers: ["anthropic", "github-copilot", "opencode", "vercel"],
6913
6938
  model: "claude-sonnet-4-6"
6914
6939
  },
6915
- { providers: ["opencode-go"], model: "minimax-m2.7" }
6940
+ { providers: ["opencode-go", "vercel"], model: "minimax-m2.7" }
6916
6941
  ]
6917
6942
  }
6918
6943
  };
@@ -6956,20 +6981,20 @@ function normalizeModelID(modelID) {
6956
6981
  }
6957
6982
 
6958
6983
  // src/shared/json-file-cache-store.ts
6959
- import { existsSync as existsSync5, mkdirSync as mkdirSync3, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "fs";
6960
- import { join as join6 } from "path";
6984
+ import { existsSync as existsSync6, mkdirSync as mkdirSync4, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "fs";
6985
+ import { join as join7 } from "path";
6961
6986
  function toLogLabel(cacheLabel) {
6962
6987
  return cacheLabel.toLowerCase();
6963
6988
  }
6964
6989
  function createJsonFileCacheStore(options) {
6965
6990
  let memoryValue;
6966
6991
  function getCacheFilePath() {
6967
- return join6(options.getCacheDir(), options.filename);
6992
+ return join7(options.getCacheDir(), options.filename);
6968
6993
  }
6969
6994
  function ensureCacheDir() {
6970
6995
  const cacheDir = options.getCacheDir();
6971
- if (!existsSync5(cacheDir)) {
6972
- mkdirSync3(cacheDir, { recursive: true });
6996
+ if (!existsSync6(cacheDir)) {
6997
+ mkdirSync4(cacheDir, { recursive: true });
6973
6998
  }
6974
6999
  }
6975
7000
  function read() {
@@ -6977,7 +7002,7 @@ function createJsonFileCacheStore(options) {
6977
7002
  return memoryValue;
6978
7003
  }
6979
7004
  const cacheFile = getCacheFilePath();
6980
- if (!existsSync5(cacheFile)) {
7005
+ if (!existsSync6(cacheFile)) {
6981
7006
  memoryValue = null;
6982
7007
  log(`[${options.logPrefix}] ${options.cacheLabel} file not found`, { cacheFile });
6983
7008
  return null;
@@ -6997,7 +7022,7 @@ function createJsonFileCacheStore(options) {
6997
7022
  }
6998
7023
  }
6999
7024
  function has() {
7000
- return existsSync5(getCacheFilePath());
7025
+ return existsSync6(getCacheFilePath());
7001
7026
  }
7002
7027
  function write(value) {
7003
7028
  ensureCacheDir();
@@ -7166,14 +7191,14 @@ var init_connected_providers_cache = __esm(() => {
7166
7191
  });
7167
7192
 
7168
7193
  // src/shared/model-availability.ts
7169
- import { existsSync as existsSync6, readFileSync as readFileSync4 } from "fs";
7170
- import { join as join7 } from "path";
7194
+ import { existsSync as existsSync7, readFileSync as readFileSync4 } from "fs";
7195
+ import { join as join8 } from "path";
7171
7196
  function isModelCacheAvailable() {
7172
7197
  if (hasProviderModelsCache()) {
7173
7198
  return true;
7174
7199
  }
7175
- const cacheFile = join7(getOpenCodeCacheDir(), "models.json");
7176
- return existsSync6(cacheFile);
7200
+ const cacheFile = join8(getOpenCodeCacheDir(), "models.json");
7201
+ return existsSync7(cacheFile);
7177
7202
  }
7178
7203
  var init_model_availability = __esm(() => {
7179
7204
  init_logger();
@@ -7182,21 +7207,14 @@ var init_model_availability = __esm(() => {
7182
7207
  });
7183
7208
 
7184
7209
  // src/shared/provider-model-id-transform.ts
7185
- function transformModelForProvider(provider, model) {
7186
- if (provider === "github-copilot") {
7187
- return model.replace("claude-opus-4-6", "claude-opus-4.6").replace("claude-sonnet-4-6", "claude-sonnet-4.6").replace("claude-sonnet-4-5", "claude-sonnet-4.5").replace("claude-haiku-4-5", "claude-haiku-4.5").replace("claude-sonnet-4", "claude-sonnet-4").replace(/gemini-3\.1-pro(?!-)/g, "gemini-3.1-pro-preview").replace(/gemini-3-flash(?!-)/g, "gemini-3-flash-preview");
7188
- }
7189
- if (provider === "google") {
7190
- return model.replace(/gemini-3\.1-pro(?!-)/g, "gemini-3.1-pro-preview").replace(/gemini-3-flash(?!-)/g, "gemini-3-flash-preview");
7191
- }
7192
- return model;
7193
- }
7210
+ var init_provider_model_id_transform = () => {};
7194
7211
 
7195
7212
  // src/shared/model-resolution-pipeline.ts
7196
7213
  var init_model_resolution_pipeline = __esm(() => {
7197
7214
  init_logger();
7198
7215
  init_connected_providers_cache();
7199
7216
  init_model_availability();
7217
+ init_provider_model_id_transform();
7200
7218
  });
7201
7219
 
7202
7220
  // src/shared/known-variants.ts
@@ -48469,19 +48487,19 @@ var init_constants = __esm(() => {
48469
48487
  });
48470
48488
 
48471
48489
  // src/shared/opencode-storage-paths.ts
48472
- import { join as join8 } from "path";
48490
+ import { join as join9 } from "path";
48473
48491
  var OPENCODE_STORAGE, MESSAGE_STORAGE, PART_STORAGE, SESSION_STORAGE;
48474
48492
  var init_opencode_storage_paths = __esm(() => {
48475
48493
  init_data_path();
48476
48494
  OPENCODE_STORAGE = getOpenCodeStorageDir();
48477
- MESSAGE_STORAGE = join8(OPENCODE_STORAGE, "message");
48478
- PART_STORAGE = join8(OPENCODE_STORAGE, "part");
48479
- SESSION_STORAGE = join8(OPENCODE_STORAGE, "session");
48495
+ MESSAGE_STORAGE = join9(OPENCODE_STORAGE, "message");
48496
+ PART_STORAGE = join9(OPENCODE_STORAGE, "part");
48497
+ SESSION_STORAGE = join9(OPENCODE_STORAGE, "session");
48480
48498
  });
48481
48499
 
48482
48500
  // src/shared/compaction-marker.ts
48483
- import { existsSync as existsSync7, readdirSync, readFileSync as readFileSync5 } from "fs";
48484
- import { join as join9 } from "path";
48501
+ import { existsSync as existsSync8, readdirSync, readFileSync as readFileSync5 } from "fs";
48502
+ import { join as join10 } from "path";
48485
48503
  function isCompactionPart(part) {
48486
48504
  return typeof part === "object" && part !== null && part.type === "compaction";
48487
48505
  }
@@ -48495,20 +48513,20 @@ function isCompactionMessage(message) {
48495
48513
  return isCompactionAgent(message.info?.agent ?? message.agent) || hasCompactionPart(message.parts);
48496
48514
  }
48497
48515
  function getCompactionPartStorageDir(messageID) {
48498
- return join9(PART_STORAGE, messageID);
48516
+ return join10(PART_STORAGE, messageID);
48499
48517
  }
48500
48518
  function hasCompactionPartInStorage(messageID) {
48501
48519
  if (!messageID) {
48502
48520
  return false;
48503
48521
  }
48504
48522
  const partDir = getCompactionPartStorageDir(messageID);
48505
- if (!existsSync7(partDir)) {
48523
+ if (!existsSync8(partDir)) {
48506
48524
  return false;
48507
48525
  }
48508
48526
  try {
48509
48527
  return readdirSync(partDir).filter((fileName) => fileName.endsWith(".json")).some((fileName) => {
48510
48528
  try {
48511
- const content = readFileSync5(join9(partDir, fileName), "utf-8");
48529
+ const content = readFileSync5(join10(partDir, fileName), "utf-8");
48512
48530
  return isCompactionPart(JSON.parse(content));
48513
48531
  } catch {
48514
48532
  return false;
@@ -48541,23 +48559,23 @@ var init_hook_message_injector = __esm(() => {
48541
48559
  });
48542
48560
 
48543
48561
  // src/shared/opencode-message-dir.ts
48544
- import { existsSync as existsSync8, readdirSync as readdirSync2 } from "fs";
48545
- import { join as join10 } from "path";
48562
+ import { existsSync as existsSync9, readdirSync as readdirSync2 } from "fs";
48563
+ import { join as join11 } from "path";
48546
48564
  function getMessageDir(sessionID) {
48547
48565
  if (!sessionID.startsWith("ses_"))
48548
48566
  return null;
48549
48567
  if (/[/\\]|\.\./.test(sessionID))
48550
48568
  return null;
48551
- if (!existsSync8(MESSAGE_STORAGE))
48569
+ if (!existsSync9(MESSAGE_STORAGE))
48552
48570
  return null;
48553
- const directPath = join10(MESSAGE_STORAGE, sessionID);
48554
- if (existsSync8(directPath)) {
48571
+ const directPath = join11(MESSAGE_STORAGE, sessionID);
48572
+ if (existsSync9(directPath)) {
48555
48573
  return directPath;
48556
48574
  }
48557
48575
  try {
48558
48576
  for (const dir of readdirSync2(MESSAGE_STORAGE)) {
48559
- const sessionPath = join10(MESSAGE_STORAGE, dir, sessionID);
48560
- if (existsSync8(sessionPath)) {
48577
+ const sessionPath = join11(MESSAGE_STORAGE, dir, sessionID);
48578
+ if (existsSync9(sessionPath)) {
48561
48579
  return sessionPath;
48562
48580
  }
48563
48581
  }
@@ -49092,18 +49110,18 @@ var init_plugin_name_with_version = __esm(() => {
49092
49110
  });
49093
49111
 
49094
49112
  // src/cli/config-manager/backup-config.ts
49095
- import { copyFileSync as copyFileSync2, existsSync as existsSync9, mkdirSync as mkdirSync4 } from "fs";
49113
+ import { copyFileSync as copyFileSync2, existsSync as existsSync10, mkdirSync as mkdirSync5 } from "fs";
49096
49114
  import { dirname as dirname2 } from "path";
49097
49115
  function backupConfigFile(configPath) {
49098
- if (!existsSync9(configPath)) {
49116
+ if (!existsSync10(configPath)) {
49099
49117
  return { success: true };
49100
49118
  }
49101
49119
  const timestamp2 = new Date().toISOString().replace(/[:.]/g, "-");
49102
49120
  const backupPath = `${configPath}.backup-${timestamp2}`;
49103
49121
  try {
49104
49122
  const dir = dirname2(backupPath);
49105
- if (!existsSync9(dir)) {
49106
- mkdirSync4(dir, { recursive: true });
49123
+ if (!existsSync10(dir)) {
49124
+ mkdirSync5(dir, { recursive: true });
49107
49125
  }
49108
49126
  copyFileSync2(configPath, backupPath);
49109
49127
  return { success: true, backupPath };
@@ -49117,11 +49135,11 @@ function backupConfigFile(configPath) {
49117
49135
  var init_backup_config = () => {};
49118
49136
 
49119
49137
  // src/cli/config-manager/ensure-config-directory-exists.ts
49120
- import { existsSync as existsSync10, mkdirSync as mkdirSync5 } from "fs";
49138
+ import { existsSync as existsSync11, mkdirSync as mkdirSync6 } from "fs";
49121
49139
  function ensureConfigDirectoryExists() {
49122
49140
  const configDir = getConfigDir();
49123
- if (!existsSync10(configDir)) {
49124
- mkdirSync5(configDir, { recursive: true });
49141
+ if (!existsSync11(configDir)) {
49142
+ mkdirSync6(configDir, { recursive: true });
49125
49143
  }
49126
49144
  }
49127
49145
  var init_ensure_config_directory_exists = __esm(() => {
@@ -49158,14 +49176,14 @@ function formatErrorWithSuggestion(err, context) {
49158
49176
  }
49159
49177
 
49160
49178
  // src/cli/config-manager/opencode-config-format.ts
49161
- import { existsSync as existsSync11 } from "fs";
49179
+ import { existsSync as existsSync12 } from "fs";
49162
49180
  function detectConfigFormat() {
49163
49181
  const configJsonc = getConfigJsonc();
49164
49182
  const configJson = getConfigJson();
49165
- if (existsSync11(configJsonc)) {
49183
+ if (existsSync12(configJsonc)) {
49166
49184
  return { format: "jsonc", path: configJsonc };
49167
49185
  }
49168
- if (existsSync11(configJson)) {
49186
+ if (existsSync12(configJson)) {
49169
49187
  return { format: "json", path: configJson };
49170
49188
  }
49171
49189
  return { format: "none", path: configJson };
@@ -49179,29 +49197,29 @@ import { readFileSync as readFileSync6, statSync } from "fs";
49179
49197
  function isEmptyOrWhitespace(content) {
49180
49198
  return content.trim().length === 0;
49181
49199
  }
49182
- function parseOpenCodeConfigFileWithError(path4) {
49200
+ function parseOpenCodeConfigFileWithError(path5) {
49183
49201
  try {
49184
- const stat = statSync(path4);
49202
+ const stat = statSync(path5);
49185
49203
  if (stat.size === 0) {
49186
- return { config: null, error: `Config file is empty: ${path4}. Delete it or add valid JSON content.` };
49204
+ return { config: null, error: `Config file is empty: ${path5}. Delete it or add valid JSON content.` };
49187
49205
  }
49188
- const content = readFileSync6(path4, "utf-8");
49206
+ const content = readFileSync6(path5, "utf-8");
49189
49207
  if (isEmptyOrWhitespace(content)) {
49190
- return { config: null, error: `Config file contains only whitespace: ${path4}. Delete it or add valid JSON content.` };
49208
+ return { config: null, error: `Config file contains only whitespace: ${path5}. Delete it or add valid JSON content.` };
49191
49209
  }
49192
49210
  const config = parseJsonc(content);
49193
- if (config === null || config === undefined) {
49194
- return { config: null, error: `Config file parsed to null/undefined: ${path4}. Ensure it contains valid JSON.` };
49211
+ if (config == null) {
49212
+ return { config: null, error: `Config file parsed to null/undefined: ${path5}. Ensure it contains valid JSON.` };
49195
49213
  }
49196
49214
  if (typeof config !== "object" || Array.isArray(config)) {
49197
49215
  return {
49198
49216
  config: null,
49199
- error: `Config file must contain a JSON object, not ${Array.isArray(config) ? "an array" : typeof config}: ${path4}`
49217
+ error: `Config file must contain a JSON object, not ${Array.isArray(config) ? "an array" : typeof config}: ${path5}`
49200
49218
  };
49201
49219
  }
49202
49220
  return { config };
49203
49221
  } catch (err) {
49204
- return { config: null, error: formatErrorWithSuggestion(err, `parse config file ${path4}`) };
49222
+ return { config: null, error: formatErrorWithSuggestion(err, `parse config file ${path5}`) };
49205
49223
  }
49206
49224
  }
49207
49225
  var init_parse_opencode_config_file = __esm(() => {
@@ -49302,20 +49320,20 @@ async function addPluginToOpenCodeConfig(currentVersion) {
49302
49320
  error: formatErrorWithSuggestion(err, "create config directory")
49303
49321
  };
49304
49322
  }
49305
- const { format: format2, path: path4 } = detectConfigFormat();
49323
+ const { format: format2, path: path5 } = detectConfigFormat();
49306
49324
  const pluginEntry = await getPluginNameWithVersion(currentVersion, PLUGIN_NAME);
49307
49325
  try {
49308
49326
  if (format2 === "none") {
49309
49327
  const config2 = { plugin: [pluginEntry] };
49310
- writeFileSync3(path4, JSON.stringify(config2, null, 2) + `
49328
+ writeFileSync3(path5, JSON.stringify(config2, null, 2) + `
49311
49329
  `);
49312
- return { success: true, configPath: path4 };
49330
+ return { success: true, configPath: path5 };
49313
49331
  }
49314
- const parseResult = parseOpenCodeConfigFileWithError(path4);
49332
+ const parseResult = parseOpenCodeConfigFileWithError(path5);
49315
49333
  if (!parseResult.config) {
49316
49334
  return {
49317
49335
  success: false,
49318
- configPath: path4,
49336
+ configPath: path5,
49319
49337
  error: parseResult.error ?? "Failed to parse config file"
49320
49338
  };
49321
49339
  }
@@ -49331,28 +49349,24 @@ async function addPluginToOpenCodeConfig(currentVersion) {
49331
49349
  if (!compatibility.canUpgrade) {
49332
49350
  return {
49333
49351
  success: false,
49334
- configPath: path4,
49352
+ configPath: path5,
49335
49353
  error: compatibility.reason ?? "Version compatibility check failed"
49336
49354
  };
49337
49355
  }
49338
- const backupResult = backupConfigFile(path4);
49356
+ const backupResult = backupConfigFile(path5);
49339
49357
  if (!backupResult.success) {
49340
49358
  return {
49341
49359
  success: false,
49342
- configPath: path4,
49360
+ configPath: path5,
49343
49361
  error: `Failed to create backup: ${backupResult.error}`
49344
49362
  };
49345
49363
  }
49346
49364
  }
49347
49365
  const normalizedPlugins = [...otherPlugins];
49348
- if (canonicalEntries.length > 0 || legacyEntries.length > 0) {
49349
- normalizedPlugins.push(pluginEntry);
49350
- } else {
49351
- normalizedPlugins.push(pluginEntry);
49352
- }
49366
+ normalizedPlugins.push(pluginEntry);
49353
49367
  config.plugin = normalizedPlugins;
49354
49368
  if (format2 === "jsonc") {
49355
- const content = readFileSync7(path4, "utf-8");
49369
+ const content = readFileSync7(path5, "utf-8");
49356
49370
  const pluginArrayRegex = /((?:"plugin"|plugin)\s*:\s*)\[([\s\S]*?)\]/;
49357
49371
  const match = content.match(pluginArrayRegex);
49358
49372
  if (match) {
@@ -49361,21 +49375,21 @@ async function addPluginToOpenCodeConfig(currentVersion) {
49361
49375
  const newContent = content.replace(pluginArrayRegex, `$1[
49362
49376
  ${formattedPlugins}
49363
49377
  ]`);
49364
- writeFileSync3(path4, newContent);
49378
+ writeFileSync3(path5, newContent);
49365
49379
  } else {
49366
49380
  const newContent = content.replace(/(\{)/, `$1
49367
49381
  "plugin": ["${pluginEntry}"],`);
49368
- writeFileSync3(path4, newContent);
49382
+ writeFileSync3(path5, newContent);
49369
49383
  }
49370
49384
  } else {
49371
- writeFileSync3(path4, JSON.stringify(config, null, 2) + `
49385
+ writeFileSync3(path5, JSON.stringify(config, null, 2) + `
49372
49386
  `);
49373
49387
  }
49374
- return { success: true, configPath: path4 };
49388
+ return { success: true, configPath: path5 };
49375
49389
  } catch (err) {
49376
49390
  return {
49377
49391
  success: false,
49378
- configPath: path4,
49392
+ configPath: path5,
49379
49393
  error: formatErrorWithSuggestion(err, "update opencode config")
49380
49394
  };
49381
49395
  }
@@ -49442,6 +49456,7 @@ function toProviderAvailability(config) {
49442
49456
  zai: config.hasZaiCodingPlan,
49443
49457
  kimiForCoding: config.hasKimiForCoding,
49444
49458
  opencodeGo: config.hasOpencodeGo,
49459
+ vercelAiGateway: config.hasVercelAiGateway,
49445
49460
  isMaxPlan: config.isMax20
49446
49461
  };
49447
49462
  }
@@ -49454,20 +49469,74 @@ function isProviderAvailable(provider, availability) {
49454
49469
  opencode: availability.opencodeZen,
49455
49470
  "zai-coding-plan": availability.zai,
49456
49471
  "kimi-for-coding": availability.kimiForCoding,
49457
- "opencode-go": availability.opencodeGo
49472
+ "opencode-go": availability.opencodeGo,
49473
+ vercel: availability.vercelAiGateway
49458
49474
  };
49459
49475
  return mapping[provider] ?? false;
49460
49476
  }
49461
49477
 
49462
49478
  // src/cli/provider-model-id-transform.ts
49463
- var init_provider_model_id_transform = () => {};
49479
+ function inferSubProvider(model) {
49480
+ if (model.startsWith("claude-"))
49481
+ return "anthropic";
49482
+ if (model.startsWith("gpt-"))
49483
+ return "openai";
49484
+ if (model.startsWith("gemini-"))
49485
+ return "google";
49486
+ if (model.startsWith("grok-"))
49487
+ return "xai";
49488
+ if (model.startsWith("minimax-"))
49489
+ return "minimax";
49490
+ if (model.startsWith("kimi-"))
49491
+ return "moonshotai";
49492
+ if (model.startsWith("glm-"))
49493
+ return "zai";
49494
+ return;
49495
+ }
49496
+ function claudeVersionDot(model) {
49497
+ return model.replace(CLAUDE_VERSION_DOT, "claude-$1-$2.$3");
49498
+ }
49499
+ function applyGatewayTransforms(model) {
49500
+ return claudeVersionDot(model).replace(GEMINI_31_PRO_PREVIEW, "gemini-3.1-pro-preview");
49501
+ }
49502
+ function transformModelForProvider2(provider, model) {
49503
+ if (provider === "vercel") {
49504
+ const slashIndex = model.indexOf("/");
49505
+ if (slashIndex !== -1) {
49506
+ const subProvider2 = model.substring(0, slashIndex);
49507
+ const subModel = model.substring(slashIndex + 1);
49508
+ return `${subProvider2}/${applyGatewayTransforms(subModel)}`;
49509
+ }
49510
+ const subProvider = inferSubProvider(model);
49511
+ if (subProvider) {
49512
+ return `${subProvider}/${applyGatewayTransforms(model)}`;
49513
+ }
49514
+ return model;
49515
+ }
49516
+ if (provider === "github-copilot") {
49517
+ return claudeVersionDot(model).replace(GEMINI_31_PRO_PREVIEW, "gemini-3.1-pro-preview").replace(GEMINI_3_FLASH_PREVIEW, "gemini-3-flash-preview");
49518
+ }
49519
+ if (provider === "google") {
49520
+ return model.replace(GEMINI_31_PRO_PREVIEW, "gemini-3.1-pro-preview").replace(GEMINI_3_FLASH_PREVIEW, "gemini-3-flash-preview");
49521
+ }
49522
+ if (provider === "anthropic") {
49523
+ return claudeVersionDot(model);
49524
+ }
49525
+ return model;
49526
+ }
49527
+ var CLAUDE_VERSION_DOT, GEMINI_31_PRO_PREVIEW, GEMINI_3_FLASH_PREVIEW;
49528
+ var init_provider_model_id_transform2 = __esm(() => {
49529
+ CLAUDE_VERSION_DOT = /claude-(\w+)-(\d+)-(\d+)/g;
49530
+ GEMINI_31_PRO_PREVIEW = /gemini-3\.1-pro(?!-)/g;
49531
+ GEMINI_3_FLASH_PREVIEW = /gemini-3-flash(?!-)/g;
49532
+ });
49464
49533
 
49465
49534
  // src/cli/fallback-chain-resolution.ts
49466
49535
  function resolveModelFromChain(fallbackChain, availability) {
49467
49536
  for (const entry of fallbackChain) {
49468
49537
  for (const provider of entry.providers) {
49469
49538
  if (isProviderAvailable(provider, availability)) {
49470
- const transformedModel = transformModelForProvider(provider, entry.model);
49539
+ const transformedModel = transformModelForProvider2(provider, entry.model);
49471
49540
  return {
49472
49541
  model: `${provider}/${transformedModel}`,
49473
49542
  variant: entry.variant
@@ -49494,13 +49563,13 @@ function isRequiredProviderAvailable(requiredProviders, availability) {
49494
49563
  }
49495
49564
  var init_fallback_chain_resolution = __esm(() => {
49496
49565
  init_model_fallback_requirements();
49497
- init_provider_model_id_transform();
49566
+ init_provider_model_id_transform2();
49498
49567
  });
49499
49568
 
49500
49569
  // src/cli/model-fallback.ts
49501
49570
  function toFallbackModelObject(entry, provider) {
49502
49571
  return {
49503
- model: `${provider}/${transformModelForProvider(provider, entry.model)}`,
49572
+ model: `${provider}/${transformModelForProvider2(provider, entry.model)}`,
49504
49573
  ...entry.variant ? { variant: entry.variant } : {},
49505
49574
  ...entry.reasoningEffort ? { reasoningEffort: entry.reasoningEffort } : {},
49506
49575
  ...entry.temperature !== undefined ? { temperature: entry.temperature } : {},
@@ -49541,7 +49610,7 @@ function attachAllFallbackModels(config, fallbackChain, availability) {
49541
49610
  }
49542
49611
  function generateModelConfig(config) {
49543
49612
  const avail = toProviderAvailability(config);
49544
- const hasAnyProvider = avail.native.claude || avail.native.openai || avail.native.gemini || avail.opencodeZen || avail.copilot || avail.zai || avail.kimiForCoding || avail.opencodeGo;
49613
+ const hasAnyProvider = avail.native.claude || avail.native.openai || avail.native.gemini || avail.opencodeZen || avail.copilot || avail.zai || avail.kimiForCoding || avail.opencodeGo || avail.vercelAiGateway;
49545
49614
  if (!hasAnyProvider) {
49546
49615
  return {
49547
49616
  $schema: SCHEMA_URL,
@@ -49558,6 +49627,8 @@ function generateModelConfig(config) {
49558
49627
  agentConfig = { model: "opencode-go/minimax-m2.7" };
49559
49628
  } else if (avail.zai) {
49560
49629
  agentConfig = { model: ZAI_MODEL };
49630
+ } else if (avail.vercelAiGateway) {
49631
+ agentConfig = { model: "vercel/minimax/minimax-m2.7" };
49561
49632
  }
49562
49633
  if (agentConfig) {
49563
49634
  agents[role] = attachAllFallbackModels(agentConfig, req.fallbackChain, avail);
@@ -49574,6 +49645,8 @@ function generateModelConfig(config) {
49574
49645
  agentConfig = { model: "opencode-go/minimax-m2.7" };
49575
49646
  } else if (avail.copilot) {
49576
49647
  agentConfig = { model: "github-copilot/gpt-5-mini" };
49648
+ } else if (avail.vercelAiGateway) {
49649
+ agentConfig = { model: "vercel/minimax/minimax-m2.7-highspeed" };
49577
49650
  } else {
49578
49651
  agentConfig = { model: "opencode/gpt-5-nano" };
49579
49652
  }
@@ -49637,7 +49710,7 @@ var init_model_fallback = __esm(() => {
49637
49710
  init_model_fallback_requirements();
49638
49711
  init_openai_only_model_catalog();
49639
49712
  init_fallback_chain_resolution();
49640
- init_provider_model_id_transform();
49713
+ init_provider_model_id_transform2();
49641
49714
  });
49642
49715
 
49643
49716
  // src/cli/config-manager/generate-omo-config.ts
@@ -49649,12 +49722,12 @@ var init_generate_omo_config = __esm(() => {
49649
49722
  });
49650
49723
 
49651
49724
  // src/shared/migrate-legacy-config-file.ts
49652
- import { existsSync as existsSync12, readFileSync as readFileSync8, renameSync as renameSync2, rmSync } from "fs";
49653
- import { join as join11, dirname as dirname3, basename } from "path";
49725
+ import { existsSync as existsSync13, readFileSync as readFileSync8, renameSync as renameSync2, rmSync } from "fs";
49726
+ import { join as join12, dirname as dirname3, basename } from "path";
49654
49727
  function buildCanonicalPath(legacyPath) {
49655
49728
  const dir = dirname3(legacyPath);
49656
49729
  const ext = basename(legacyPath).includes(".jsonc") ? ".jsonc" : ".json";
49657
- return join11(dir, `${CONFIG_BASENAME}${ext}`);
49730
+ return join12(dir, `${CONFIG_BASENAME}${ext}`);
49658
49731
  }
49659
49732
  function archiveLegacyConfigFile(legacyPath) {
49660
49733
  const backupPath = `${legacyPath}.bak`;
@@ -49686,12 +49759,12 @@ function archiveLegacyConfigFile(legacyPath) {
49686
49759
  }
49687
49760
  }
49688
49761
  function migrateLegacyConfigFile(legacyPath) {
49689
- if (!existsSync12(legacyPath))
49762
+ if (!existsSync13(legacyPath))
49690
49763
  return false;
49691
49764
  if (!basename(legacyPath).startsWith(LEGACY_CONFIG_BASENAME))
49692
49765
  return false;
49693
49766
  const canonicalPath = buildCanonicalPath(legacyPath);
49694
- if (existsSync12(canonicalPath))
49767
+ if (existsSync13(canonicalPath))
49695
49768
  return false;
49696
49769
  try {
49697
49770
  const content = readFileSync8(legacyPath, "utf-8");
@@ -49702,7 +49775,7 @@ function migrateLegacyConfigFile(legacyPath) {
49702
49775
  to: canonicalPath,
49703
49776
  archivedLegacyConfig
49704
49777
  });
49705
- return archivedLegacyConfig;
49778
+ return true;
49706
49779
  } catch (error) {
49707
49780
  log("[migrateLegacyConfigFile] Failed to migrate legacy config file", { legacyPath, error });
49708
49781
  return false;
@@ -49732,8 +49805,8 @@ function deepMergeRecord(target, source) {
49732
49805
  }
49733
49806
 
49734
49807
  // src/cli/config-manager/write-omo-config.ts
49735
- import { existsSync as existsSync13, readFileSync as readFileSync9, statSync as statSync2, writeFileSync as writeFileSync4 } from "fs";
49736
- import { basename as basename2, dirname as dirname4, extname, join as join12 } from "path";
49808
+ import { existsSync as existsSync14, readFileSync as readFileSync9, statSync as statSync2, writeFileSync as writeFileSync4 } from "fs";
49809
+ import { basename as basename2, dirname as dirname4, extname, join as join13 } from "path";
49737
49810
  function isEmptyOrWhitespace2(content) {
49738
49811
  return content.trim().length === 0;
49739
49812
  }
@@ -49748,12 +49821,12 @@ function writeOmoConfig(installConfig) {
49748
49821
  };
49749
49822
  }
49750
49823
  const detectedConfigPath = getOmoConfigPath();
49751
- const canonicalConfigPath = join12(dirname4(detectedConfigPath), `${CONFIG_BASENAME}${extname(detectedConfigPath) || ".json"}`);
49824
+ const canonicalConfigPath = join13(dirname4(detectedConfigPath), `${CONFIG_BASENAME}${extname(detectedConfigPath) || ".json"}`);
49752
49825
  const shouldMigrateLegacyPath = basename2(detectedConfigPath).startsWith(LEGACY_CONFIG_BASENAME);
49753
- const omoConfigPath = shouldMigrateLegacyPath ? migrateLegacyConfigFile(detectedConfigPath) || existsSync13(canonicalConfigPath) ? canonicalConfigPath : detectedConfigPath : detectedConfigPath;
49826
+ const omoConfigPath = shouldMigrateLegacyPath ? migrateLegacyConfigFile(detectedConfigPath) || existsSync14(canonicalConfigPath) ? canonicalConfigPath : detectedConfigPath : detectedConfigPath;
49754
49827
  try {
49755
49828
  const newConfig = generateOmoConfig(installConfig);
49756
- if (existsSync13(omoConfigPath)) {
49829
+ if (existsSync14(omoConfigPath)) {
49757
49830
  const backupResult = backupConfigFile(omoConfigPath);
49758
49831
  if (!backupResult.success) {
49759
49832
  return {
@@ -49907,16 +49980,17 @@ var init_opencode_binary = __esm(() => {
49907
49980
  });
49908
49981
 
49909
49982
  // src/cli/config-manager/detect-current-config.ts
49910
- import { existsSync as existsSync14, readFileSync as readFileSync10 } from "fs";
49983
+ import { existsSync as existsSync15, readFileSync as readFileSync10 } from "fs";
49911
49984
  function detectProvidersFromOmoConfig() {
49912
49985
  const omoConfigPath = getOmoConfigPath();
49913
- if (!existsSync14(omoConfigPath)) {
49986
+ if (!existsSync15(omoConfigPath)) {
49914
49987
  return {
49915
49988
  hasOpenAI: true,
49916
49989
  hasOpencodeZen: true,
49917
49990
  hasZaiCodingPlan: false,
49918
49991
  hasKimiForCoding: false,
49919
- hasOpencodeGo: false
49992
+ hasOpencodeGo: false,
49993
+ hasVercelAiGateway: false
49920
49994
  };
49921
49995
  }
49922
49996
  try {
@@ -49928,7 +50002,8 @@ function detectProvidersFromOmoConfig() {
49928
50002
  hasOpencodeZen: true,
49929
50003
  hasZaiCodingPlan: false,
49930
50004
  hasKimiForCoding: false,
49931
- hasOpencodeGo: false
50005
+ hasOpencodeGo: false,
50006
+ hasVercelAiGateway: false
49932
50007
  };
49933
50008
  }
49934
50009
  const configStr = JSON.stringify(omoConfig);
@@ -49937,14 +50012,16 @@ function detectProvidersFromOmoConfig() {
49937
50012
  const hasZaiCodingPlan = configStr.includes('"zai-coding-plan/');
49938
50013
  const hasKimiForCoding = configStr.includes('"kimi-for-coding/');
49939
50014
  const hasOpencodeGo = configStr.includes('"opencode-go/');
49940
- return { hasOpenAI, hasOpencodeZen, hasZaiCodingPlan, hasKimiForCoding, hasOpencodeGo };
50015
+ const hasVercelAiGateway = configStr.includes('"vercel/');
50016
+ return { hasOpenAI, hasOpencodeZen, hasZaiCodingPlan, hasKimiForCoding, hasOpencodeGo, hasVercelAiGateway };
49941
50017
  } catch {
49942
50018
  return {
49943
50019
  hasOpenAI: true,
49944
50020
  hasOpencodeZen: true,
49945
50021
  hasZaiCodingPlan: false,
49946
50022
  hasKimiForCoding: false,
49947
- hasOpencodeGo: false
50023
+ hasOpencodeGo: false,
50024
+ hasVercelAiGateway: false
49948
50025
  };
49949
50026
  }
49950
50027
  }
@@ -49966,13 +50043,14 @@ function detectCurrentConfig() {
49966
50043
  hasOpencodeZen: true,
49967
50044
  hasZaiCodingPlan: false,
49968
50045
  hasKimiForCoding: false,
49969
- hasOpencodeGo: false
50046
+ hasOpencodeGo: false,
50047
+ hasVercelAiGateway: false
49970
50048
  };
49971
- const { format: format2, path: path4 } = detectConfigFormat();
50049
+ const { format: format2, path: path5 } = detectConfigFormat();
49972
50050
  if (format2 === "none") {
49973
50051
  return result;
49974
50052
  }
49975
- const parseResult = parseOpenCodeConfigFileWithError(path4);
50053
+ const parseResult = parseOpenCodeConfigFileWithError(path5);
49976
50054
  if (!parseResult.config) {
49977
50055
  return result;
49978
50056
  }
@@ -49988,12 +50066,13 @@ function detectCurrentConfig() {
49988
50066
  }
49989
50067
  const providers = openCodeConfig.provider;
49990
50068
  result.hasGemini = providers ? "google" in providers : false;
49991
- const { hasOpenAI, hasOpencodeZen, hasZaiCodingPlan, hasKimiForCoding, hasOpencodeGo } = detectProvidersFromOmoConfig();
50069
+ const { hasOpenAI, hasOpencodeZen, hasZaiCodingPlan, hasKimiForCoding, hasOpencodeGo, hasVercelAiGateway } = detectProvidersFromOmoConfig();
49992
50070
  result.hasOpenAI = hasOpenAI;
49993
50071
  result.hasOpencodeZen = hasOpencodeZen;
49994
50072
  result.hasZaiCodingPlan = hasZaiCodingPlan;
49995
50073
  result.hasKimiForCoding = hasKimiForCoding;
49996
50074
  result.hasOpencodeGo = hasOpencodeGo;
50075
+ result.hasVercelAiGateway = hasVercelAiGateway;
49997
50076
  return result;
49998
50077
  }
49999
50078
  var init_detect_current_config = __esm(() => {
@@ -50004,10 +50083,10 @@ var init_detect_current_config = __esm(() => {
50004
50083
  });
50005
50084
 
50006
50085
  // src/cli/config-manager/bun-install.ts
50007
- import { existsSync as existsSync15 } from "fs";
50008
- import { join as join13 } from "path";
50086
+ import { existsSync as existsSync16 } from "fs";
50087
+ import { join as join14 } from "path";
50009
50088
  function getDefaultWorkspaceDir() {
50010
- return join13(getOpenCodeCacheDir(), "packages");
50089
+ return join14(getOpenCodeCacheDir(), "packages");
50011
50090
  }
50012
50091
  function readProcessOutput(stream) {
50013
50092
  if (!stream) {
@@ -50033,7 +50112,7 @@ async function runBunInstallWithDetails(options) {
50033
50112
  const outputMode = options?.outputMode ?? "pipe";
50034
50113
  const cacheDir = options?.workspaceDir ?? getDefaultWorkspaceDir();
50035
50114
  const packageJsonPath = `${cacheDir}/package.json`;
50036
- if (!existsSync15(packageJsonPath)) {
50115
+ if (!existsSync16(packageJsonPath)) {
50037
50116
  return {
50038
50117
  success: false,
50039
50118
  error: `Workspace not initialized: ${packageJsonPath} not found. OpenCode should create this on first run.`
@@ -50175,7 +50254,7 @@ var require_windows = __commonJS((exports2, module) => {
50175
50254
  module.exports = isexe;
50176
50255
  isexe.sync = sync;
50177
50256
  var fs5 = __require("fs");
50178
- function checkPathExt(path5, options) {
50257
+ function checkPathExt(path6, options) {
50179
50258
  var pathext = options.pathExt !== undefined ? options.pathExt : process.env.PATHEXT;
50180
50259
  if (!pathext) {
50181
50260
  return true;
@@ -50186,25 +50265,25 @@ var require_windows = __commonJS((exports2, module) => {
50186
50265
  }
50187
50266
  for (var i2 = 0;i2 < pathext.length; i2++) {
50188
50267
  var p2 = pathext[i2].toLowerCase();
50189
- if (p2 && path5.substr(-p2.length).toLowerCase() === p2) {
50268
+ if (p2 && path6.substr(-p2.length).toLowerCase() === p2) {
50190
50269
  return true;
50191
50270
  }
50192
50271
  }
50193
50272
  return false;
50194
50273
  }
50195
- function checkStat(stat, path5, options) {
50274
+ function checkStat(stat, path6, options) {
50196
50275
  if (!stat.isSymbolicLink() && !stat.isFile()) {
50197
50276
  return false;
50198
50277
  }
50199
- return checkPathExt(path5, options);
50278
+ return checkPathExt(path6, options);
50200
50279
  }
50201
- function isexe(path5, options, cb) {
50202
- fs5.stat(path5, function(er, stat) {
50203
- cb(er, er ? false : checkStat(stat, path5, options));
50280
+ function isexe(path6, options, cb) {
50281
+ fs5.stat(path6, function(er, stat) {
50282
+ cb(er, er ? false : checkStat(stat, path6, options));
50204
50283
  });
50205
50284
  }
50206
- function sync(path5, options) {
50207
- return checkStat(fs5.statSync(path5), path5, options);
50285
+ function sync(path6, options) {
50286
+ return checkStat(fs5.statSync(path6), path6, options);
50208
50287
  }
50209
50288
  });
50210
50289
 
@@ -50213,13 +50292,13 @@ var require_mode = __commonJS((exports2, module) => {
50213
50292
  module.exports = isexe;
50214
50293
  isexe.sync = sync;
50215
50294
  var fs5 = __require("fs");
50216
- function isexe(path5, options, cb) {
50217
- fs5.stat(path5, function(er, stat) {
50295
+ function isexe(path6, options, cb) {
50296
+ fs5.stat(path6, function(er, stat) {
50218
50297
  cb(er, er ? false : checkStat(stat, options));
50219
50298
  });
50220
50299
  }
50221
- function sync(path5, options) {
50222
- return checkStat(fs5.statSync(path5), options);
50300
+ function sync(path6, options) {
50301
+ return checkStat(fs5.statSync(path6), options);
50223
50302
  }
50224
50303
  function checkStat(stat, options) {
50225
50304
  return stat.isFile() && checkMode(stat, options);
@@ -50250,7 +50329,7 @@ var require_isexe = __commonJS((exports2, module) => {
50250
50329
  }
50251
50330
  module.exports = isexe;
50252
50331
  isexe.sync = sync;
50253
- function isexe(path5, options, cb) {
50332
+ function isexe(path6, options, cb) {
50254
50333
  if (typeof options === "function") {
50255
50334
  cb = options;
50256
50335
  options = {};
@@ -50260,7 +50339,7 @@ var require_isexe = __commonJS((exports2, module) => {
50260
50339
  throw new TypeError("callback not provided");
50261
50340
  }
50262
50341
  return new Promise(function(resolve2, reject) {
50263
- isexe(path5, options || {}, function(er, is) {
50342
+ isexe(path6, options || {}, function(er, is) {
50264
50343
  if (er) {
50265
50344
  reject(er);
50266
50345
  } else {
@@ -50269,7 +50348,7 @@ var require_isexe = __commonJS((exports2, module) => {
50269
50348
  });
50270
50349
  });
50271
50350
  }
50272
- core3(path5, options || {}, function(er, is) {
50351
+ core3(path6, options || {}, function(er, is) {
50273
50352
  if (er) {
50274
50353
  if (er.code === "EACCES" || options && options.ignoreErrors) {
50275
50354
  er = null;
@@ -50279,9 +50358,9 @@ var require_isexe = __commonJS((exports2, module) => {
50279
50358
  cb(er, is);
50280
50359
  });
50281
50360
  }
50282
- function sync(path5, options) {
50361
+ function sync(path6, options) {
50283
50362
  try {
50284
- return core3.sync(path5, options || {});
50363
+ return core3.sync(path6, options || {});
50285
50364
  } catch (er) {
50286
50365
  if (options && options.ignoreErrors || er.code === "EACCES") {
50287
50366
  return false;
@@ -50295,7 +50374,7 @@ var require_isexe = __commonJS((exports2, module) => {
50295
50374
  // node_modules/which/which.js
50296
50375
  var require_which = __commonJS((exports2, module) => {
50297
50376
  var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
50298
- var path5 = __require("path");
50377
+ var path6 = __require("path");
50299
50378
  var COLON = isWindows ? ";" : ":";
50300
50379
  var isexe = require_isexe();
50301
50380
  var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
@@ -50331,7 +50410,7 @@ var require_which = __commonJS((exports2, module) => {
50331
50410
  return opt.all && found.length ? resolve2(found) : reject(getNotFoundError(cmd));
50332
50411
  const ppRaw = pathEnv[i2];
50333
50412
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
50334
- const pCmd = path5.join(pathPart, cmd);
50413
+ const pCmd = path6.join(pathPart, cmd);
50335
50414
  const p2 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
50336
50415
  resolve2(subStep(p2, i2, 0));
50337
50416
  });
@@ -50358,7 +50437,7 @@ var require_which = __commonJS((exports2, module) => {
50358
50437
  for (let i2 = 0;i2 < pathEnv.length; i2++) {
50359
50438
  const ppRaw = pathEnv[i2];
50360
50439
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
50361
- const pCmd = path5.join(pathPart, cmd);
50440
+ const pCmd = path6.join(pathPart, cmd);
50362
50441
  const p2 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
50363
50442
  for (let j2 = 0;j2 < pathExt.length; j2++) {
50364
50443
  const cur = p2 + pathExt[j2];
@@ -50399,7 +50478,7 @@ var require_path_key = __commonJS((exports2, module) => {
50399
50478
 
50400
50479
  // node_modules/cross-spawn/lib/util/resolveCommand.js
50401
50480
  var require_resolveCommand = __commonJS((exports2, module) => {
50402
- var path5 = __require("path");
50481
+ var path6 = __require("path");
50403
50482
  var which = require_which();
50404
50483
  var getPathKey = require_path_key();
50405
50484
  function resolveCommandAttempt(parsed, withoutPathExt) {
@@ -50416,7 +50495,7 @@ var require_resolveCommand = __commonJS((exports2, module) => {
50416
50495
  try {
50417
50496
  resolved = which.sync(parsed.command, {
50418
50497
  path: env[getPathKey({ env })],
50419
- pathExt: withoutPathExt ? path5.delimiter : undefined
50498
+ pathExt: withoutPathExt ? path6.delimiter : undefined
50420
50499
  });
50421
50500
  } catch (e2) {} finally {
50422
50501
  if (shouldSwitchCwd) {
@@ -50424,7 +50503,7 @@ var require_resolveCommand = __commonJS((exports2, module) => {
50424
50503
  }
50425
50504
  }
50426
50505
  if (resolved) {
50427
- resolved = path5.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
50506
+ resolved = path6.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
50428
50507
  }
50429
50508
  return resolved;
50430
50509
  }
@@ -50469,8 +50548,8 @@ var require_shebang_command = __commonJS((exports2, module) => {
50469
50548
  if (!match) {
50470
50549
  return null;
50471
50550
  }
50472
- const [path5, argument] = match[0].replace(/#! ?/, "").split(" ");
50473
- const binary2 = path5.split("/").pop();
50551
+ const [path6, argument] = match[0].replace(/#! ?/, "").split(" ");
50552
+ const binary2 = path6.split("/").pop();
50474
50553
  if (binary2 === "env") {
50475
50554
  return argument;
50476
50555
  }
@@ -50498,7 +50577,7 @@ var require_readShebang = __commonJS((exports2, module) => {
50498
50577
 
50499
50578
  // node_modules/cross-spawn/lib/parse.js
50500
50579
  var require_parse = __commonJS((exports2, module) => {
50501
- var path5 = __require("path");
50580
+ var path6 = __require("path");
50502
50581
  var resolveCommand = require_resolveCommand();
50503
50582
  var escape = require_escape();
50504
50583
  var readShebang = require_readShebang();
@@ -50523,7 +50602,7 @@ var require_parse = __commonJS((exports2, module) => {
50523
50602
  const needsShell = !isExecutableRegExp.test(commandFile);
50524
50603
  if (parsed.options.forceShell || needsShell) {
50525
50604
  const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
50526
- parsed.command = path5.normalize(parsed.command);
50605
+ parsed.command = path6.normalize(parsed.command);
50527
50606
  parsed.command = escape.command(parsed.command);
50528
50607
  parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
50529
50608
  const shellCommand = [parsed.command].concat(parsed.args).join(" ");
@@ -50627,21 +50706,21 @@ var require_cross_spawn = __commonJS((exports2, module) => {
50627
50706
  });
50628
50707
 
50629
50708
  // src/hooks/auto-update-checker/constants.ts
50630
- import * as path5 from "path";
50709
+ import * as path6 from "path";
50631
50710
  import * as os4 from "os";
50632
50711
  function getWindowsAppdataDir() {
50633
50712
  if (process.platform !== "win32")
50634
50713
  return null;
50635
- return process.env.APPDATA ?? path5.join(os4.homedir(), "AppData", "Roaming");
50714
+ return process.env.APPDATA ?? path6.join(os4.homedir(), "AppData", "Roaming");
50636
50715
  }
50637
50716
  function getUserConfigDir() {
50638
50717
  return getOpenCodeConfigDir({ binary: "opencode" });
50639
50718
  }
50640
50719
  function getUserOpencodeConfig() {
50641
- return path5.join(getUserConfigDir(), "opencode.json");
50720
+ return path6.join(getUserConfigDir(), "opencode.json");
50642
50721
  }
50643
50722
  function getUserOpencodeConfigJsonc() {
50644
- return path5.join(getUserConfigDir(), "opencode.jsonc");
50723
+ return path6.join(getUserConfigDir(), "opencode.jsonc");
50645
50724
  }
50646
50725
  var PACKAGE_NAME2, ACCEPTED_PACKAGE_NAMES2, NPM_REGISTRY_URL, NPM_FETCH_TIMEOUT = 5000, CACHE_ROOT_DIR, CACHE_DIR, VERSION_FILE, INSTALLED_PACKAGE_JSON, INSTALLED_PACKAGE_JSON_CANDIDATES;
50647
50726
  var init_constants3 = __esm(() => {
@@ -50652,30 +50731,30 @@ var init_constants3 = __esm(() => {
50652
50731
  ACCEPTED_PACKAGE_NAMES2 = ACCEPTED_PACKAGE_NAMES;
50653
50732
  NPM_REGISTRY_URL = `https://registry.npmjs.org/-/package/${PACKAGE_NAME2}/dist-tags`;
50654
50733
  CACHE_ROOT_DIR = getOpenCodeCacheDir();
50655
- CACHE_DIR = path5.join(CACHE_ROOT_DIR, "packages");
50656
- VERSION_FILE = path5.join(CACHE_ROOT_DIR, "version");
50657
- INSTALLED_PACKAGE_JSON = path5.join(CACHE_DIR, "node_modules", PACKAGE_NAME2, "package.json");
50658
- INSTALLED_PACKAGE_JSON_CANDIDATES = ACCEPTED_PACKAGE_NAMES2.map((name) => path5.join(CACHE_DIR, "node_modules", name, "package.json"));
50734
+ CACHE_DIR = path6.join(CACHE_ROOT_DIR, "packages");
50735
+ VERSION_FILE = path6.join(CACHE_ROOT_DIR, "version");
50736
+ INSTALLED_PACKAGE_JSON = path6.join(CACHE_DIR, "node_modules", PACKAGE_NAME2, "package.json");
50737
+ INSTALLED_PACKAGE_JSON_CANDIDATES = ACCEPTED_PACKAGE_NAMES2.map((name) => path6.join(CACHE_DIR, "node_modules", name, "package.json"));
50659
50738
  });
50660
50739
 
50661
50740
  // src/hooks/auto-update-checker/checker/config-paths.ts
50662
50741
  import * as os5 from "os";
50663
- import * as path6 from "path";
50742
+ import * as path7 from "path";
50664
50743
  function getConfigPaths(directory) {
50665
50744
  const userConfigDir = getUserConfigDir();
50666
50745
  const paths = [
50667
- path6.join(directory, ".opencode", "opencode.json"),
50668
- path6.join(directory, ".opencode", "opencode.jsonc"),
50746
+ path7.join(directory, ".opencode", "opencode.json"),
50747
+ path7.join(directory, ".opencode", "opencode.jsonc"),
50669
50748
  getUserOpencodeConfig(),
50670
50749
  getUserOpencodeConfigJsonc()
50671
50750
  ];
50672
50751
  if (process.platform === "win32") {
50673
- const crossPlatformDir = path6.join(os5.homedir(), ".config");
50752
+ const crossPlatformDir = path7.join(os5.homedir(), ".config");
50674
50753
  const appdataDir = getWindowsAppdataDir();
50675
50754
  if (appdataDir) {
50676
50755
  const alternateDir = userConfigDir === crossPlatformDir ? appdataDir : crossPlatformDir;
50677
- const alternateConfig = path6.join(alternateDir, "opencode", "opencode.json");
50678
- const alternateConfigJsonc = path6.join(alternateDir, "opencode", "opencode.jsonc");
50756
+ const alternateConfig = path7.join(alternateDir, "opencode", "opencode.json");
50757
+ const alternateConfigJsonc = path7.join(alternateDir, "opencode", "opencode.jsonc");
50679
50758
  if (!paths.includes(alternateConfig)) {
50680
50759
  paths.push(alternateConfig);
50681
50760
  }
@@ -50733,13 +50812,13 @@ var init_local_dev_path = __esm(() => {
50733
50812
 
50734
50813
  // src/hooks/auto-update-checker/checker/package-json-locator.ts
50735
50814
  import * as fs6 from "fs";
50736
- import * as path7 from "path";
50815
+ import * as path8 from "path";
50737
50816
  function findPackageJsonUp(startPath) {
50738
50817
  try {
50739
50818
  const stat = fs6.statSync(startPath);
50740
- let dir = stat.isDirectory() ? startPath : path7.dirname(startPath);
50819
+ let dir = stat.isDirectory() ? startPath : path8.dirname(startPath);
50741
50820
  for (let i2 = 0;i2 < 10; i2++) {
50742
- const pkgPath = path7.join(dir, "package.json");
50821
+ const pkgPath = path8.join(dir, "package.json");
50743
50822
  if (fs6.existsSync(pkgPath)) {
50744
50823
  try {
50745
50824
  const content = fs6.readFileSync(pkgPath, "utf-8");
@@ -50748,7 +50827,7 @@ function findPackageJsonUp(startPath) {
50748
50827
  return pkgPath;
50749
50828
  } catch {}
50750
50829
  }
50751
- const parent = path7.dirname(dir);
50830
+ const parent = path8.dirname(dir);
50752
50831
  if (parent === dir)
50753
50832
  break;
50754
50833
  dir = parent;
@@ -50823,7 +50902,7 @@ var init_plugin_entry = __esm(() => {
50823
50902
 
50824
50903
  // src/hooks/auto-update-checker/checker/cached-version.ts
50825
50904
  import * as fs9 from "fs";
50826
- import * as path8 from "path";
50905
+ import * as path9 from "path";
50827
50906
  import { fileURLToPath as fileURLToPath2 } from "url";
50828
50907
  function readPackageVersion(packageJsonPath) {
50829
50908
  const content = fs9.readFileSync(packageJsonPath, "utf-8");
@@ -50839,7 +50918,7 @@ function getCachedVersion() {
50839
50918
  } catch {}
50840
50919
  }
50841
50920
  try {
50842
- const currentDir = path8.dirname(fileURLToPath2(import.meta.url));
50921
+ const currentDir = path9.dirname(fileURLToPath2(import.meta.url));
50843
50922
  const pkgPath = findPackageJsonUp(currentDir);
50844
50923
  if (pkgPath) {
50845
50924
  return readPackageVersion(pkgPath);
@@ -50848,7 +50927,7 @@ function getCachedVersion() {
50848
50927
  log("[auto-update-checker] Failed to resolve version from current directory:", err);
50849
50928
  }
50850
50929
  try {
50851
- const execDir = path8.dirname(fs9.realpathSync(process.execPath));
50930
+ const execDir = path9.dirname(fs9.realpathSync(process.execPath));
50852
50931
  const pkgPath = findPackageJsonUp(execDir);
50853
50932
  if (pkgPath) {
50854
50933
  return readPackageVersion(pkgPath);
@@ -50991,7 +51070,7 @@ var init_check_for_update = __esm(() => {
50991
51070
  // src/hooks/auto-update-checker/checker/sync-package-json.ts
50992
51071
  import * as crypto from "crypto";
50993
51072
  import * as fs10 from "fs";
50994
- import * as path9 from "path";
51073
+ import * as path10 from "path";
50995
51074
  function safeUnlink(filePath) {
50996
51075
  try {
50997
51076
  fs10.unlinkSync(filePath);
@@ -51008,7 +51087,7 @@ function getIntentVersion(pluginInfo) {
51008
51087
  function writeCachePackageJson(cachePackageJsonPath, pkgJson) {
51009
51088
  const tmpPath = `${cachePackageJsonPath}.${crypto.randomUUID()}`;
51010
51089
  try {
51011
- fs10.mkdirSync(path9.dirname(cachePackageJsonPath), { recursive: true });
51090
+ fs10.mkdirSync(path10.dirname(cachePackageJsonPath), { recursive: true });
51012
51091
  fs10.writeFileSync(tmpPath, JSON.stringify(pkgJson, null, 2));
51013
51092
  fs10.renameSync(tmpPath, cachePackageJsonPath);
51014
51093
  return { synced: true, error: null };
@@ -51019,7 +51098,7 @@ function writeCachePackageJson(cachePackageJsonPath, pkgJson) {
51019
51098
  }
51020
51099
  }
51021
51100
  function syncCachePackageJsonToIntent(pluginInfo) {
51022
- const cachePackageJsonPath = path9.join(CACHE_DIR, "package.json");
51101
+ const cachePackageJsonPath = path10.join(CACHE_DIR, "package.json");
51023
51102
  const intentVersion = getIntentVersion(pluginInfo);
51024
51103
  if (!fs10.existsSync(cachePackageJsonPath)) {
51025
51104
  log("[auto-update-checker] Cache package.json missing, creating workspace package.json", { intentVersion });
@@ -51095,7 +51174,7 @@ var init_checker = __esm(() => {
51095
51174
 
51096
51175
  // src/hooks/auto-update-checker/cache.ts
51097
51176
  import * as fs11 from "fs";
51098
- import * as path10 from "path";
51177
+ import * as path11 from "path";
51099
51178
  function stripTrailingCommas(json3) {
51100
51179
  return json3.replace(/,(\s*[}\]])/g, "$1");
51101
51180
  }
@@ -51124,8 +51203,8 @@ function deleteBinaryBunLock(lockPath) {
51124
51203
  }
51125
51204
  }
51126
51205
  function removeFromBunLock(packageName) {
51127
- const textLockPath = path10.join(CACHE_DIR, "bun.lock");
51128
- const binaryLockPath = path10.join(CACHE_DIR, "bun.lockb");
51206
+ const textLockPath = path11.join(CACHE_DIR, "bun.lock");
51207
+ const binaryLockPath = path11.join(CACHE_DIR, "bun.lockb");
51129
51208
  if (fs11.existsSync(textLockPath)) {
51130
51209
  return removeFromTextBunLock(textLockPath, packageName);
51131
51210
  }
@@ -51138,8 +51217,8 @@ function invalidatePackage(packageName = PACKAGE_NAME2) {
51138
51217
  try {
51139
51218
  const userConfigDir = getUserConfigDir();
51140
51219
  const pkgDirs = [
51141
- path10.join(userConfigDir, "node_modules", packageName),
51142
- path10.join(CACHE_DIR, "node_modules", packageName)
51220
+ path11.join(userConfigDir, "node_modules", packageName),
51221
+ path11.join(CACHE_DIR, "node_modules", packageName)
51143
51222
  ];
51144
51223
  let packageRemoved = false;
51145
51224
  let lockRemoved = false;
@@ -51199,8 +51278,8 @@ var init_update_toasts = __esm(() => {
51199
51278
  });
51200
51279
 
51201
51280
  // src/hooks/auto-update-checker/hook/background-update-check.ts
51202
- import { existsSync as existsSync27 } from "fs";
51203
- import { join as join26 } from "path";
51281
+ import { existsSync as existsSync28 } from "fs";
51282
+ import { join as join27 } from "path";
51204
51283
  function getCacheWorkspaceDir(deps) {
51205
51284
  return deps.join(deps.getOpenCodeCacheDir(), "packages");
51206
51285
  }
@@ -51318,8 +51397,8 @@ var init_background_update_check = __esm(() => {
51318
51397
  init_checker();
51319
51398
  init_update_toasts();
51320
51399
  defaultDeps = {
51321
- existsSync: existsSync27,
51322
- join: join26,
51400
+ existsSync: existsSync28,
51401
+ join: join27,
51323
51402
  runBunInstallWithDetails,
51324
51403
  log,
51325
51404
  getOpenCodeCacheDir,
@@ -51612,7 +51691,7 @@ var {
51612
51691
  // package.json
51613
51692
  var package_default = {
51614
51693
  name: "oh-my-opencode",
51615
- version: "3.17.1",
51694
+ version: "3.17.2",
51616
51695
  description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
51617
51696
  main: "./dist/index.js",
51618
51697
  types: "dist/index.d.ts",
@@ -51691,17 +51770,17 @@ var package_default = {
51691
51770
  typescript: "^5.7.3"
51692
51771
  },
51693
51772
  optionalDependencies: {
51694
- "oh-my-opencode-darwin-arm64": "3.17.1",
51695
- "oh-my-opencode-darwin-x64": "3.17.1",
51696
- "oh-my-opencode-darwin-x64-baseline": "3.17.1",
51697
- "oh-my-opencode-linux-arm64": "3.17.1",
51698
- "oh-my-opencode-linux-arm64-musl": "3.17.1",
51699
- "oh-my-opencode-linux-x64": "3.17.1",
51700
- "oh-my-opencode-linux-x64-baseline": "3.17.1",
51701
- "oh-my-opencode-linux-x64-musl": "3.17.1",
51702
- "oh-my-opencode-linux-x64-musl-baseline": "3.17.1",
51703
- "oh-my-opencode-windows-x64": "3.17.1",
51704
- "oh-my-opencode-windows-x64-baseline": "3.17.1"
51773
+ "oh-my-opencode-darwin-arm64": "3.17.2",
51774
+ "oh-my-opencode-darwin-x64": "3.17.2",
51775
+ "oh-my-opencode-darwin-x64-baseline": "3.17.2",
51776
+ "oh-my-opencode-linux-arm64": "3.17.2",
51777
+ "oh-my-opencode-linux-arm64-musl": "3.17.2",
51778
+ "oh-my-opencode-linux-x64": "3.17.2",
51779
+ "oh-my-opencode-linux-x64-baseline": "3.17.2",
51780
+ "oh-my-opencode-linux-x64-musl": "3.17.2",
51781
+ "oh-my-opencode-linux-x64-musl-baseline": "3.17.2",
51782
+ "oh-my-opencode-windows-x64": "3.17.2",
51783
+ "oh-my-opencode-windows-x64-baseline": "3.17.2"
51705
51784
  },
51706
51785
  overrides: {},
51707
51786
  trustedDependencies: [
@@ -51746,6 +51825,7 @@ function formatConfigSummary(config) {
51746
51825
  lines.push(formatProvider("OpenCode Zen", config.hasOpencodeZen, "opencode/ models"));
51747
51826
  lines.push(formatProvider("Z.ai Coding Plan", config.hasZaiCodingPlan, "Librarian/Multimodal"));
51748
51827
  lines.push(formatProvider("Kimi For Coding", config.hasKimiForCoding, "Sisyphus/Prometheus fallback"));
51828
+ lines.push(formatProvider("Vercel AI Gateway", config.hasVercelAiGateway, "universal proxy"));
51749
51829
  lines.push("");
51750
51830
  lines.push(import_picocolors.default.dim("\u2500".repeat(40)));
51751
51831
  lines.push("");
@@ -51829,6 +51909,9 @@ function validateNonTuiArgs(args) {
51829
51909
  if (args.kimiForCoding !== undefined && !["no", "yes"].includes(args.kimiForCoding)) {
51830
51910
  errors.push(`Invalid --kimi-for-coding value: ${args.kimiForCoding} (expected: no, yes)`);
51831
51911
  }
51912
+ if (args.vercelAiGateway !== undefined && !["no", "yes"].includes(args.vercelAiGateway)) {
51913
+ errors.push(`Invalid --vercel-ai-gateway value: ${args.vercelAiGateway} (expected: no, yes)`);
51914
+ }
51832
51915
  return { valid: errors.length === 0, errors };
51833
51916
  }
51834
51917
  function argsToConfig(args) {
@@ -51841,7 +51924,8 @@ function argsToConfig(args) {
51841
51924
  hasOpencodeZen: args.opencodeZen === "yes",
51842
51925
  hasZaiCodingPlan: args.zaiCodingPlan === "yes",
51843
51926
  hasKimiForCoding: args.kimiForCoding === "yes",
51844
- hasOpencodeGo: args.opencodeGo === "yes"
51927
+ hasOpencodeGo: args.opencodeGo === "yes",
51928
+ hasVercelAiGateway: args.vercelAiGateway === "yes"
51845
51929
  };
51846
51930
  }
51847
51931
  function detectedToInitialValues(detected) {
@@ -51857,7 +51941,8 @@ function detectedToInitialValues(detected) {
51857
51941
  opencodeZen: detected.hasOpencodeZen ? "yes" : "no",
51858
51942
  zaiCodingPlan: detected.hasZaiCodingPlan ? "yes" : "no",
51859
51943
  kimiForCoding: detected.hasKimiForCoding ? "yes" : "no",
51860
- opencodeGo: detected.hasOpencodeGo ? "yes" : "no"
51944
+ opencodeGo: detected.hasOpencodeGo ? "yes" : "no",
51945
+ vercelAiGateway: detected.hasVercelAiGateway ? "yes" : "no"
51861
51946
  };
51862
51947
  }
51863
51948
 
@@ -51947,8 +52032,8 @@ function createGetModuleFromFilename(basePath = process.argv[1] ? dirname5(proce
51947
52032
  return decodedFile;
51948
52033
  };
51949
52034
  }
51950
- function normalizeWindowsPath(path4) {
51951
- return path4.replace(/^[A-Z]:/, "").replace(/\\/g, "/");
52035
+ function normalizeWindowsPath(path5) {
52036
+ return path5.replace(/^[A-Z]:/, "").replace(/\\/g, "/");
51952
52037
  }
51953
52038
 
51954
52039
  // node_modules/@posthog/core/dist/featureFlagUtils.mjs
@@ -54263,9 +54348,9 @@ async function addSourceContext(frames) {
54263
54348
  LRU_FILE_CONTENTS_CACHE.reduce();
54264
54349
  return frames;
54265
54350
  }
54266
- function getContextLinesFromFile(path4, ranges, output) {
54351
+ function getContextLinesFromFile(path5, ranges, output) {
54267
54352
  return new Promise((resolve2) => {
54268
- const stream = createReadStream(path4);
54353
+ const stream = createReadStream(path5);
54269
54354
  const lineReaded = createInterface({
54270
54355
  input: stream
54271
54356
  });
@@ -54281,7 +54366,7 @@ function getContextLinesFromFile(path4, ranges, output) {
54281
54366
  let rangeStart = range[0];
54282
54367
  let rangeEnd = range[1];
54283
54368
  function onStreamError() {
54284
- LRU_FILE_CONTENTS_FS_READ_FAILED.set(path4, 1);
54369
+ LRU_FILE_CONTENTS_FS_READ_FAILED.set(path5, 1);
54285
54370
  lineReaded.close();
54286
54371
  lineReaded.removeAllListeners();
54287
54372
  destroyStreamAndResolve();
@@ -54349,8 +54434,8 @@ function clearLineContext(frame) {
54349
54434
  delete frame.context_line;
54350
54435
  delete frame.post_context;
54351
54436
  }
54352
- function shouldSkipContextLinesForFile(path4) {
54353
- return path4.startsWith("node:") || path4.endsWith(".min.js") || path4.endsWith(".min.cjs") || path4.endsWith(".min.mjs") || path4.startsWith("data:");
54437
+ function shouldSkipContextLinesForFile(path5) {
54438
+ return path5.startsWith("node:") || path5.endsWith(".min.js") || path5.endsWith(".min.cjs") || path5.endsWith(".min.mjs") || path5.startsWith("data:");
54354
54439
  }
54355
54440
  function shouldSkipContextLinesForFrame(frame) {
54356
54441
  if (frame.lineno !== undefined && frame.lineno > MAX_CONTEXTLINES_LINENO)
@@ -56363,11 +56448,11 @@ init_data_path();
56363
56448
  init_logger();
56364
56449
  init_plugin_identity();
56365
56450
  init_write_file_atomically();
56366
- import { existsSync as existsSync16, mkdirSync as mkdirSync6, readFileSync as readFileSync11 } from "fs";
56367
- import { join as join14 } from "path";
56451
+ import { existsSync as existsSync17, mkdirSync as mkdirSync7, readFileSync as readFileSync11 } from "fs";
56452
+ import { join as join15 } from "path";
56368
56453
  var POSTHOG_ACTIVITY_STATE_FILE = "posthog-activity.json";
56369
56454
  function getPostHogActivityStateFilePath() {
56370
- return join14(getDataDir(), CACHE_DIR_NAME, POSTHOG_ACTIVITY_STATE_FILE);
56455
+ return join15(getDataDir(), CACHE_DIR_NAME, POSTHOG_ACTIVITY_STATE_FILE);
56371
56456
  }
56372
56457
  function getUtcDayString(date) {
56373
56458
  return date.toISOString().slice(0, 10);
@@ -56380,7 +56465,7 @@ function isPostHogActivityState(value) {
56380
56465
  }
56381
56466
  function readPostHogActivityState() {
56382
56467
  const stateFilePath = getPostHogActivityStateFilePath();
56383
- if (!existsSync16(stateFilePath)) {
56468
+ if (!existsSync17(stateFilePath)) {
56384
56469
  return {};
56385
56470
  }
56386
56471
  try {
@@ -56401,7 +56486,7 @@ function readPostHogActivityState() {
56401
56486
  function writePostHogActivityState(nextState) {
56402
56487
  const stateFilePath = getPostHogActivityStateFilePath();
56403
56488
  try {
56404
- mkdirSync6(join14(getDataDir(), CACHE_DIR_NAME), { recursive: true });
56489
+ mkdirSync7(join15(getDataDir(), CACHE_DIR_NAME), { recursive: true });
56405
56490
  writeFileAtomically(stateFilePath, `${JSON.stringify(nextState, null, 2)}
56406
56491
  `);
56407
56492
  } catch (error) {
@@ -56493,11 +56578,16 @@ function createPostHogClient(source, options) {
56493
56578
  if (shouldDisablePostHog() || !hasPostHogApiKey()) {
56494
56579
  return NO_OP_POSTHOG;
56495
56580
  }
56496
- const configuredClient = new PostHog(getPostHogApiKey(), {
56497
- ...options,
56498
- host: getPostHogHost(),
56499
- disableGeoip: false
56500
- });
56581
+ let configuredClient;
56582
+ try {
56583
+ configuredClient = new PostHog(getPostHogApiKey(), {
56584
+ ...options,
56585
+ host: getPostHogHost(),
56586
+ disableGeoip: false
56587
+ });
56588
+ } catch {
56589
+ return NO_OP_POSTHOG;
56590
+ }
56501
56591
  const sharedProperties = getSharedProperties(source);
56502
56592
  return {
56503
56593
  capture: (message) => {
@@ -56630,7 +56720,7 @@ async function runCliInstaller(args, version2) {
56630
56720
  if (!config.hasClaude) {
56631
56721
  printInfo("Note: Sisyphus agent performs best with Claude Opus 4.5+. " + "Other models work but may have reduced orchestration quality.");
56632
56722
  }
56633
- if (!config.hasClaude && !config.hasOpenAI && !config.hasGemini && !config.hasCopilot && !config.hasOpencodeZen) {
56723
+ if (!config.hasClaude && !config.hasOpenAI && !config.hasGemini && !config.hasCopilot && !config.hasOpencodeZen && !config.hasVercelAiGateway) {
56634
56724
  printWarning("No model providers configured. Using opencode/big-pickle as fallback.");
56635
56725
  }
56636
56726
  console.log(`${SYMBOLS.star} ${import_picocolors3.default.bold(import_picocolors3.default.green(isUpdate ? "Configuration updated!" : "Installation complete!"))}`);
@@ -57357,6 +57447,16 @@ async function promptInstallConfig(detected) {
57357
57447
  });
57358
57448
  if (!opencodeGo)
57359
57449
  return null;
57450
+ const vercelAiGateway = await selectOrCancel({
57451
+ message: "Do you have a Vercel AI Gateway API key?",
57452
+ options: [
57453
+ { value: "no", label: "No", hint: "Will use other configured providers" },
57454
+ { value: "yes", label: "Yes", hint: "Universal proxy for OpenAI, Anthropic, Google, etc." }
57455
+ ],
57456
+ initialValue: initial.vercelAiGateway
57457
+ });
57458
+ if (!vercelAiGateway)
57459
+ return null;
57360
57460
  return {
57361
57461
  hasClaude: claude !== "no",
57362
57462
  isMax20: claude === "max20",
@@ -57366,7 +57466,8 @@ async function promptInstallConfig(detected) {
57366
57466
  hasOpencodeZen: opencodeZen === "yes",
57367
57467
  hasZaiCodingPlan: zaiCodingPlan === "yes",
57368
57468
  hasKimiForCoding: kimiForCoding === "yes",
57369
- hasOpencodeGo: opencodeGo === "yes"
57469
+ hasOpencodeGo: opencodeGo === "yes",
57470
+ hasVercelAiGateway: vercelAiGateway === "yes"
57370
57471
  };
57371
57472
  }
57372
57473
 
@@ -57423,7 +57524,7 @@ async function runTuiInstaller(args, version2) {
57423
57524
  M2.info(`${import_picocolors5.default.bold("Note:")} Sisyphus agent performs best with Claude Opus 4.5+.
57424
57525
  ` + `Other models work but may have reduced orchestration quality.`);
57425
57526
  }
57426
- if (!config.hasClaude && !config.hasOpenAI && !config.hasGemini && !config.hasCopilot && !config.hasOpencodeZen) {
57527
+ if (!config.hasClaude && !config.hasOpenAI && !config.hasGemini && !config.hasCopilot && !config.hasOpencodeZen && !config.hasVercelAiGateway) {
57427
57528
  M2.warn("No model providers configured. Using opencode/big-pickle as fallback.");
57428
57529
  }
57429
57530
  Me(formatConfigSummary(config), isUpdate ? "Updated Configuration" : "Installation Complete");
@@ -57649,10 +57750,10 @@ function formatToolHeader(toolName, input) {
57649
57750
  };
57650
57751
  }
57651
57752
  if (toolName === "list") {
57652
- const path4 = str2(input.path);
57753
+ const path5 = str2(input.path);
57653
57754
  return {
57654
57755
  icon: "\u2192",
57655
- title: path4 ? `List ${path4}` : "List"
57756
+ title: path5 ? `List ${path5}` : "List"
57656
57757
  };
57657
57758
  }
57658
57759
  if (toolName === "read") {
@@ -58161,7 +58262,7 @@ async function processEvents(ctx, stream, state) {
58161
58262
  }
58162
58263
  // src/plugin-config.ts
58163
58264
  import * as fs4 from "fs";
58164
- import * as path4 from "path";
58265
+ import * as path5 from "path";
58165
58266
 
58166
58267
  // node_modules/zod/v4/classic/external.js
58167
58268
  var exports_external = {};
@@ -58928,10 +59029,10 @@ function mergeDefs(...defs) {
58928
59029
  function cloneDef(schema2) {
58929
59030
  return mergeDefs(schema2._zod.def);
58930
59031
  }
58931
- function getElementAtPath(obj, path4) {
58932
- if (!path4)
59032
+ function getElementAtPath(obj, path5) {
59033
+ if (!path5)
58933
59034
  return obj;
58934
- return path4.reduce((acc, key) => acc?.[key], obj);
59035
+ return path5.reduce((acc, key) => acc?.[key], obj);
58935
59036
  }
58936
59037
  function promiseAllObject(promisesObj) {
58937
59038
  const keys = Object.keys(promisesObj);
@@ -59312,11 +59413,11 @@ function aborted(x2, startIndex = 0) {
59312
59413
  }
59313
59414
  return false;
59314
59415
  }
59315
- function prefixIssues(path4, issues) {
59416
+ function prefixIssues(path5, issues) {
59316
59417
  return issues.map((iss) => {
59317
59418
  var _a;
59318
59419
  (_a = iss).path ?? (_a.path = []);
59319
- iss.path.unshift(path4);
59420
+ iss.path.unshift(path5);
59320
59421
  return iss;
59321
59422
  });
59322
59423
  }
@@ -59499,7 +59600,7 @@ function formatError2(error, mapper = (issue2) => issue2.message) {
59499
59600
  }
59500
59601
  function treeifyError(error, mapper = (issue2) => issue2.message) {
59501
59602
  const result = { errors: [] };
59502
- const processError = (error2, path4 = []) => {
59603
+ const processError = (error2, path5 = []) => {
59503
59604
  var _a, _b;
59504
59605
  for (const issue2 of error2.issues) {
59505
59606
  if (issue2.code === "invalid_union" && issue2.errors.length) {
@@ -59509,7 +59610,7 @@ function treeifyError(error, mapper = (issue2) => issue2.message) {
59509
59610
  } else if (issue2.code === "invalid_element") {
59510
59611
  processError({ issues: issue2.issues }, issue2.path);
59511
59612
  } else {
59512
- const fullpath = [...path4, ...issue2.path];
59613
+ const fullpath = [...path5, ...issue2.path];
59513
59614
  if (fullpath.length === 0) {
59514
59615
  result.errors.push(mapper(issue2));
59515
59616
  continue;
@@ -59541,8 +59642,8 @@ function treeifyError(error, mapper = (issue2) => issue2.message) {
59541
59642
  }
59542
59643
  function toDotPath(_path) {
59543
59644
  const segs = [];
59544
- const path4 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
59545
- for (const seg of path4) {
59645
+ const path5 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
59646
+ for (const seg of path5) {
59546
59647
  if (typeof seg === "number")
59547
59648
  segs.push(`[${seg}]`);
59548
59649
  else if (typeof seg === "symbol")
@@ -71289,13 +71390,13 @@ function resolveRef(ref, ctx) {
71289
71390
  if (!ref.startsWith("#")) {
71290
71391
  throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
71291
71392
  }
71292
- const path4 = ref.slice(1).split("/").filter(Boolean);
71293
- if (path4.length === 0) {
71393
+ const path5 = ref.slice(1).split("/").filter(Boolean);
71394
+ if (path5.length === 0) {
71294
71395
  return ctx.rootSchema;
71295
71396
  }
71296
71397
  const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
71297
- if (path4[0] === defsKey) {
71298
- const key = path4[1];
71398
+ if (path5[0] === defsKey) {
71399
+ const key = path5[1];
71299
71400
  if (!key || !ctx.defs[key]) {
71300
71401
  throw new Error(`Reference not found: ${ref}`);
71301
71402
  }
@@ -72228,6 +72329,22 @@ var OhMyOpenCodeConfigSchema = exports_external.object({
72228
72329
  init_shared();
72229
72330
  init_migrate_legacy_config_file();
72230
72331
  init_plugin_identity();
72332
+ function loadExplicitGitMasterOverrides(configPath) {
72333
+ try {
72334
+ if (!fs4.existsSync(configPath)) {
72335
+ return;
72336
+ }
72337
+ const content = fs4.readFileSync(configPath, "utf-8");
72338
+ const rawConfig = parseJsonc(content);
72339
+ const gitMaster = rawConfig.git_master;
72340
+ if (gitMaster && typeof gitMaster === "object" && !Array.isArray(gitMaster)) {
72341
+ return gitMaster;
72342
+ }
72343
+ } catch {
72344
+ return;
72345
+ }
72346
+ return;
72347
+ }
72231
72348
  var PARTIAL_STRING_ARRAY_KEYS = new Set([
72232
72349
  "disabled_mcps",
72233
72350
  "disabled_agents",
@@ -72355,42 +72472,55 @@ function mergeConfigs(base, override) {
72355
72472
  function loadPluginConfig(directory, ctx) {
72356
72473
  const configDir = getOpenCodeConfigDir({ binary: "opencode" });
72357
72474
  const userDetected = detectPluginConfigFile(configDir);
72358
- let userConfigPath = userDetected.format !== "none" ? userDetected.path : path4.join(configDir, `${CONFIG_BASENAME}.json`);
72475
+ let userConfigPath = userDetected.format !== "none" ? userDetected.path : path5.join(configDir, `${CONFIG_BASENAME}.json`);
72359
72476
  if (userDetected.legacyPath) {
72360
72477
  log("Canonical plugin config detected alongside legacy config. Remove the legacy file to avoid confusion.", {
72361
72478
  canonicalPath: userDetected.path,
72362
72479
  legacyPath: userDetected.legacyPath
72363
72480
  });
72364
72481
  }
72365
- if (userDetected.format !== "none" && path4.basename(userDetected.path).startsWith(LEGACY_CONFIG_BASENAME)) {
72482
+ if (userDetected.format !== "none" && path5.basename(userDetected.path).startsWith(LEGACY_CONFIG_BASENAME)) {
72366
72483
  const migrated = migrateLegacyConfigFile(userDetected.path);
72367
- const canonicalPath = path4.join(path4.dirname(userDetected.path), `${CONFIG_BASENAME}${path4.extname(userDetected.path)}`);
72484
+ const canonicalPath = path5.join(path5.dirname(userDetected.path), `${CONFIG_BASENAME}${path5.extname(userDetected.path)}`);
72368
72485
  if (migrated || fs4.existsSync(canonicalPath)) {
72369
72486
  userConfigPath = canonicalPath;
72370
72487
  }
72371
72488
  }
72372
- const projectBasePath = path4.join(directory, ".opencode");
72489
+ const projectBasePath = path5.join(directory, ".opencode");
72373
72490
  const projectDetected = detectPluginConfigFile(projectBasePath);
72374
- let projectConfigPath = projectDetected.format !== "none" ? projectDetected.path : path4.join(projectBasePath, `${CONFIG_BASENAME}.json`);
72491
+ let projectConfigPath = projectDetected.format !== "none" ? projectDetected.path : path5.join(projectBasePath, `${CONFIG_BASENAME}.json`);
72375
72492
  if (projectDetected.legacyPath) {
72376
72493
  log("Canonical plugin config detected alongside legacy config. Remove the legacy file to avoid confusion.", {
72377
72494
  canonicalPath: projectDetected.path,
72378
72495
  legacyPath: projectDetected.legacyPath
72379
72496
  });
72380
72497
  }
72381
- if (projectDetected.format !== "none" && path4.basename(projectDetected.path).startsWith(LEGACY_CONFIG_BASENAME)) {
72498
+ if (projectDetected.format !== "none" && path5.basename(projectDetected.path).startsWith(LEGACY_CONFIG_BASENAME)) {
72382
72499
  const projectMigrated = migrateLegacyConfigFile(projectDetected.path);
72383
- const canonicalProjectPath = path4.join(path4.dirname(projectDetected.path), `${CONFIG_BASENAME}${path4.extname(projectDetected.path)}`);
72500
+ const canonicalProjectPath = path5.join(path5.dirname(projectDetected.path), `${CONFIG_BASENAME}${path5.extname(projectDetected.path)}`);
72384
72501
  if (projectMigrated || fs4.existsSync(canonicalProjectPath)) {
72385
72502
  projectConfigPath = canonicalProjectPath;
72386
72503
  }
72387
72504
  }
72388
72505
  const userConfig = loadConfigFromPath(userConfigPath, ctx);
72506
+ const userGitMasterOverrides = loadExplicitGitMasterOverrides(userConfigPath);
72389
72507
  let config2 = userConfig ?? OhMyOpenCodeConfigSchema.parse({});
72508
+ const defaultGitMaster = OhMyOpenCodeConfigSchema.parse({}).git_master;
72390
72509
  const projectConfig = loadConfigFromPath(projectConfigPath, ctx);
72510
+ const projectGitMasterOverrides = loadExplicitGitMasterOverrides(projectConfigPath);
72391
72511
  if (projectConfig) {
72392
72512
  config2 = mergeConfigs(config2, projectConfig);
72393
72513
  }
72514
+ if (userGitMasterOverrides || projectGitMasterOverrides) {
72515
+ config2 = {
72516
+ ...config2,
72517
+ git_master: {
72518
+ ...defaultGitMaster,
72519
+ ...userGitMasterOverrides ?? {},
72520
+ ...projectGitMasterOverrides ?? {}
72521
+ }
72522
+ };
72523
+ }
72394
72524
  config2 = {
72395
72525
  ...config2,
72396
72526
  mcp_env_allowlist: userConfig?.mcp_env_allowlist ?? []
@@ -72638,7 +72768,7 @@ var serializeObjectParam = ({ allowReserved, explode, name, style, value, valueO
72638
72768
 
72639
72769
  // node_modules/@opencode-ai/sdk/dist/gen/core/utils.gen.js
72640
72770
  var PATH_PARAM_RE = /\{[^{}]+\}/g;
72641
- var defaultPathSerializer = ({ path: path5, url: _url2 }) => {
72771
+ var defaultPathSerializer = ({ path: path6, url: _url2 }) => {
72642
72772
  let url2 = _url2;
72643
72773
  const matches = _url2.match(PATH_PARAM_RE);
72644
72774
  if (matches) {
@@ -72657,7 +72787,7 @@ var defaultPathSerializer = ({ path: path5, url: _url2 }) => {
72657
72787
  name = name.substring(1);
72658
72788
  style = "matrix";
72659
72789
  }
72660
- const value = path5[name];
72790
+ const value = path6[name];
72661
72791
  if (value === undefined || value === null) {
72662
72792
  continue;
72663
72793
  }
@@ -72688,11 +72818,11 @@ var defaultPathSerializer = ({ path: path5, url: _url2 }) => {
72688
72818
  }
72689
72819
  return url2;
72690
72820
  };
72691
- var getUrl = ({ baseUrl, path: path5, query, querySerializer, url: _url2 }) => {
72821
+ var getUrl = ({ baseUrl, path: path6, query, querySerializer, url: _url2 }) => {
72692
72822
  const pathUrl = _url2.startsWith("/") ? _url2 : `/${_url2}`;
72693
72823
  let url2 = (baseUrl ?? "") + pathUrl;
72694
- if (path5) {
72695
- url2 = defaultPathSerializer({ path: path5, url: url2 });
72824
+ if (path6) {
72825
+ url2 = defaultPathSerializer({ path: path6, url: url2 });
72696
72826
  }
72697
72827
  let search = query ? querySerializer(query) : "";
72698
72828
  if (search.startsWith("?")) {
@@ -73922,7 +74052,7 @@ var import_picocolors10 = __toESM(require_picocolors(), 1);
73922
74052
 
73923
74053
  // src/cli/run/opencode-binary-resolver.ts
73924
74054
  init_spawn_with_windows_hide();
73925
- import { delimiter, dirname as dirname7, join as join16 } from "path";
74055
+ import { delimiter, dirname as dirname7, join as join17 } from "path";
73926
74056
  var OPENCODE_COMMANDS = ["opencode", "opencode-desktop"];
73927
74057
  var WINDOWS_SUFFIXES = ["", ".exe", ".cmd", ".bat", ".ps1"];
73928
74058
  function getCommandCandidates(platform) {
@@ -73945,7 +74075,7 @@ function collectCandidateBinaryPaths(pathEnv, which = Bun.which, platform = proc
73945
74075
  }
73946
74076
  for (const entry of (pathEnv ?? "").split(delimiter).filter(Boolean)) {
73947
74077
  for (const command of commandCandidates) {
73948
- addCandidate(join16(entry, command));
74078
+ addCandidate(join17(entry, command));
73949
74079
  }
73950
74080
  }
73951
74081
  return candidates;
@@ -74330,15 +74460,15 @@ var BOULDER_STATE_PATH = `${BOULDER_DIR}/${BOULDER_FILE}`;
74330
74460
  var NOTEPAD_DIR = "notepads";
74331
74461
  var NOTEPAD_BASE_PATH = `${BOULDER_DIR}/${NOTEPAD_DIR}`;
74332
74462
  // src/features/boulder-state/storage.ts
74333
- import { existsSync as existsSync18, readFileSync as readFileSync13, writeFileSync as writeFileSync5, mkdirSync as mkdirSync7, readdirSync as readdirSync3 } from "fs";
74334
- import { dirname as dirname8, join as join17, basename as basename4 } from "path";
74463
+ import { existsSync as existsSync19, readFileSync as readFileSync13, writeFileSync as writeFileSync5, mkdirSync as mkdirSync8, readdirSync as readdirSync3 } from "fs";
74464
+ import { dirname as dirname8, join as join18, basename as basename4 } from "path";
74335
74465
  var RESERVED_KEYS = new Set(["__proto__", "prototype", "constructor"]);
74336
74466
  function getBoulderFilePath(directory) {
74337
- return join17(directory, BOULDER_DIR, BOULDER_FILE);
74467
+ return join18(directory, BOULDER_DIR, BOULDER_FILE);
74338
74468
  }
74339
74469
  function readBoulderState(directory) {
74340
74470
  const filePath = getBoulderFilePath(directory);
74341
- if (!existsSync18(filePath)) {
74471
+ if (!existsSync19(filePath)) {
74342
74472
  return null;
74343
74473
  }
74344
74474
  try {
@@ -74375,7 +74505,7 @@ var CHECKED_CHECKBOX_PATTERN = /^(\s*)[-*]\s*\[[xX]\]\s*(.+)$/;
74375
74505
  var TODO_TASK_PATTERN = /^\d+\.\s+/;
74376
74506
  var FINAL_WAVE_TASK_PATTERN = /^F\d+\.\s+/i;
74377
74507
  function getPlanProgress(planPath) {
74378
- if (!existsSync18(planPath)) {
74508
+ if (!existsSync19(planPath)) {
74379
74509
  return { total: 0, completed: 0, isComplete: true };
74380
74510
  }
74381
74511
  try {
@@ -74451,14 +74581,14 @@ function getSessionAgent(sessionID) {
74451
74581
  // src/features/run-continuation-state/constants.ts
74452
74582
  var CONTINUATION_MARKER_DIR = ".sisyphus/run-continuation";
74453
74583
  // src/features/run-continuation-state/storage.ts
74454
- import { existsSync as existsSync19, mkdirSync as mkdirSync8, readFileSync as readFileSync14, rmSync as rmSync2, writeFileSync as writeFileSync6 } from "fs";
74455
- import { join as join18 } from "path";
74584
+ import { existsSync as existsSync20, mkdirSync as mkdirSync9, readFileSync as readFileSync14, rmSync as rmSync2, writeFileSync as writeFileSync6 } from "fs";
74585
+ import { join as join19 } from "path";
74456
74586
  function getMarkerPath(directory, sessionID) {
74457
- return join18(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
74587
+ return join19(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
74458
74588
  }
74459
74589
  function readContinuationMarker(directory, sessionID) {
74460
74590
  const markerPath = getMarkerPath(directory, sessionID);
74461
- if (!existsSync19(markerPath))
74591
+ if (!existsSync20(markerPath))
74462
74592
  return null;
74463
74593
  try {
74464
74594
  const raw = readFileSync14(markerPath, "utf-8");
@@ -74523,7 +74653,7 @@ async function isSessionInBoulderLineage(input) {
74523
74653
  init_shared();
74524
74654
  init_compaction_marker();
74525
74655
  import { readFileSync as readFileSync15, readdirSync as readdirSync4 } from "fs";
74526
- import { join as join19 } from "path";
74656
+ import { join as join20 } from "path";
74527
74657
  var defaultSessionLastAgentDeps = {
74528
74658
  getMessageDir,
74529
74659
  isSqliteBackend,
@@ -74571,7 +74701,7 @@ async function getLastAgentFromSession(sessionID, client3, deps = {}) {
74571
74701
  try {
74572
74702
  const messages = readdirSync4(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
74573
74703
  try {
74574
- const content = readFileSync15(join19(messageDir, fileName), "utf-8");
74704
+ const content = readFileSync15(join20(messageDir, fileName), "utf-8");
74575
74705
  const parsed = JSON.parse(content);
74576
74706
  return {
74577
74707
  fileName,
@@ -74604,8 +74734,8 @@ init_agent_display_names();
74604
74734
 
74605
74735
  // src/hooks/ralph-loop/storage.ts
74606
74736
  init_frontmatter();
74607
- import { existsSync as existsSync20, readFileSync as readFileSync16, writeFileSync as writeFileSync7, unlinkSync, mkdirSync as mkdirSync9 } from "fs";
74608
- import { dirname as dirname9, join as join20 } from "path";
74737
+ import { existsSync as existsSync21, readFileSync as readFileSync16, writeFileSync as writeFileSync7, unlinkSync as unlinkSync3, mkdirSync as mkdirSync10 } from "fs";
74738
+ import { dirname as dirname9, join as join21 } from "path";
74609
74739
 
74610
74740
  // src/hooks/ralph-loop/constants.ts
74611
74741
  var DEFAULT_STATE_FILE = ".sisyphus/ralph-loop.local.md";
@@ -74614,11 +74744,11 @@ var DEFAULT_COMPLETION_PROMISE = "DONE";
74614
74744
 
74615
74745
  // src/hooks/ralph-loop/storage.ts
74616
74746
  function getStateFilePath(directory, customPath) {
74617
- return customPath ? join20(directory, customPath) : join20(directory, DEFAULT_STATE_FILE);
74747
+ return customPath ? join21(directory, customPath) : join21(directory, DEFAULT_STATE_FILE);
74618
74748
  }
74619
74749
  function readState(directory, customPath) {
74620
74750
  const filePath = getStateFilePath(directory, customPath);
74621
- if (!existsSync20(filePath)) {
74751
+ if (!existsSync21(filePath)) {
74622
74752
  return null;
74623
74753
  }
74624
74754
  try {
@@ -74938,6 +75068,9 @@ async function getMainSessionStatus(ctx) {
74938
75068
  query: { directory: ctx.directory }
74939
75069
  });
74940
75070
  const statuses = normalizeSDKResponse(statusesRes, {});
75071
+ if (!(ctx.sessionID in statuses)) {
75072
+ return "idle";
75073
+ }
74941
75074
  const status = statuses[ctx.sessionID]?.type;
74942
75075
  if (status === "idle" || status === "busy" || status === "retry") {
74943
75076
  return status;
@@ -75387,12 +75520,12 @@ async function getLocalVersion(options = {}) {
75387
75520
  }
75388
75521
  }
75389
75522
  // src/cli/doctor/checks/system.ts
75390
- import { existsSync as existsSync31, readFileSync as readFileSync26 } from "fs";
75523
+ import { existsSync as existsSync32, readFileSync as readFileSync26 } from "fs";
75391
75524
 
75392
75525
  // src/cli/doctor/checks/system-binary.ts
75393
- import { existsSync as existsSync28 } from "fs";
75526
+ import { existsSync as existsSync29 } from "fs";
75394
75527
  import { homedir as homedir5 } from "os";
75395
- import { join as join27 } from "path";
75528
+ import { join as join28 } from "path";
75396
75529
 
75397
75530
  // src/cli/doctor/spawn-with-timeout.ts
75398
75531
  init_spawn_with_windows_hide();
@@ -75431,17 +75564,17 @@ function getDesktopAppPaths(platform) {
75431
75564
  case "darwin":
75432
75565
  return [
75433
75566
  "/Applications/OpenCode.app/Contents/MacOS/OpenCode",
75434
- join27(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
75567
+ join28(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
75435
75568
  ];
75436
75569
  case "win32": {
75437
75570
  const programFiles = process.env.ProgramFiles;
75438
75571
  const localAppData = process.env.LOCALAPPDATA;
75439
75572
  const paths = [];
75440
75573
  if (programFiles) {
75441
- paths.push(join27(programFiles, "OpenCode", "OpenCode.exe"));
75574
+ paths.push(join28(programFiles, "OpenCode", "OpenCode.exe"));
75442
75575
  }
75443
75576
  if (localAppData) {
75444
- paths.push(join27(localAppData, "OpenCode", "OpenCode.exe"));
75577
+ paths.push(join28(localAppData, "OpenCode", "OpenCode.exe"));
75445
75578
  }
75446
75579
  return paths;
75447
75580
  }
@@ -75449,8 +75582,8 @@ function getDesktopAppPaths(platform) {
75449
75582
  return [
75450
75583
  "/usr/bin/opencode",
75451
75584
  "/usr/lib/opencode/opencode",
75452
- join27(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
75453
- join27(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
75585
+ join28(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
75586
+ join28(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
75454
75587
  ];
75455
75588
  default:
75456
75589
  return [];
@@ -75462,7 +75595,7 @@ function buildVersionCommand(binaryPath, platform) {
75462
75595
  }
75463
75596
  return [binaryPath, "--version"];
75464
75597
  }
75465
- function findDesktopBinary(platform = process.platform, checkExists = existsSync28) {
75598
+ function findDesktopBinary(platform = process.platform, checkExists = existsSync29) {
75466
75599
  for (const desktopPath of getDesktopAppPaths(platform)) {
75467
75600
  if (checkExists(desktopPath)) {
75468
75601
  return { binary: "opencode", path: desktopPath };
@@ -75472,9 +75605,9 @@ function findDesktopBinary(platform = process.platform, checkExists = existsSync
75472
75605
  }
75473
75606
  async function findOpenCodeBinary() {
75474
75607
  for (const binary2 of OPENCODE_BINARIES2) {
75475
- const path11 = Bun.which(binary2);
75476
- if (path11) {
75477
- return { binary: binary2, path: path11 };
75608
+ const path12 = Bun.which(binary2);
75609
+ if (path12) {
75610
+ return { binary: binary2, path: path12 };
75478
75611
  }
75479
75612
  }
75480
75613
  return findDesktopBinary();
@@ -75508,12 +75641,12 @@ function compareVersions3(current, minimum) {
75508
75641
 
75509
75642
  // src/cli/doctor/checks/system-plugin.ts
75510
75643
  init_shared();
75511
- import { existsSync as existsSync29, readFileSync as readFileSync24 } from "fs";
75644
+ import { existsSync as existsSync30, readFileSync as readFileSync24 } from "fs";
75512
75645
  function detectConfigPath() {
75513
75646
  const paths = getOpenCodeConfigPaths({ binary: "opencode", version: null });
75514
- if (existsSync29(paths.configJsonc))
75647
+ if (existsSync30(paths.configJsonc))
75515
75648
  return paths.configJsonc;
75516
- if (existsSync29(paths.configJson))
75649
+ if (existsSync30(paths.configJson))
75517
75650
  return paths.configJson;
75518
75651
  return null;
75519
75652
  }
@@ -75597,34 +75730,34 @@ function getPluginInfo() {
75597
75730
  init_file_utils();
75598
75731
  init_checker();
75599
75732
  init_auto_update_checker();
75600
- import { existsSync as existsSync30, readFileSync as readFileSync25 } from "fs";
75733
+ import { existsSync as existsSync31, readFileSync as readFileSync25 } from "fs";
75601
75734
  import { homedir as homedir6 } from "os";
75602
- import { join as join28 } from "path";
75735
+ import { join as join29 } from "path";
75603
75736
  init_shared();
75604
75737
  function getPlatformDefaultCacheDir(platform = process.platform) {
75605
75738
  if (platform === "darwin")
75606
- return join28(homedir6(), "Library", "Caches");
75739
+ return join29(homedir6(), "Library", "Caches");
75607
75740
  if (platform === "win32")
75608
- return process.env.LOCALAPPDATA ?? join28(homedir6(), "AppData", "Local");
75609
- return join28(homedir6(), ".cache");
75741
+ return process.env.LOCALAPPDATA ?? join29(homedir6(), "AppData", "Local");
75742
+ return join29(homedir6(), ".cache");
75610
75743
  }
75611
75744
  function resolveOpenCodeCacheDir() {
75612
75745
  const xdgCacheHome = process.env.XDG_CACHE_HOME;
75613
75746
  if (xdgCacheHome)
75614
- return join28(xdgCacheHome, "opencode");
75747
+ return join29(xdgCacheHome, "opencode");
75615
75748
  const fromShared = getOpenCodeCacheDir();
75616
- const platformDefault = join28(getPlatformDefaultCacheDir(), "opencode");
75617
- if (existsSync30(fromShared) || !existsSync30(platformDefault))
75749
+ const platformDefault = join29(getPlatformDefaultCacheDir(), "opencode");
75750
+ if (existsSync31(fromShared) || !existsSync31(platformDefault))
75618
75751
  return fromShared;
75619
75752
  return platformDefault;
75620
75753
  }
75621
75754
  function resolveExistingDir(dirPath) {
75622
- if (!existsSync30(dirPath))
75755
+ if (!existsSync31(dirPath))
75623
75756
  return dirPath;
75624
75757
  return resolveSymlink(dirPath);
75625
75758
  }
75626
75759
  function readPackageJson(filePath) {
75627
- if (!existsSync30(filePath))
75760
+ if (!existsSync31(filePath))
75628
75761
  return null;
75629
75762
  try {
75630
75763
  const content = readFileSync25(filePath, "utf-8");
@@ -75642,11 +75775,11 @@ function normalizeVersion(value) {
75642
75775
  function createPackageCandidates(rootDir) {
75643
75776
  return ACCEPTED_PACKAGE_NAMES.map((packageName) => ({
75644
75777
  packageName,
75645
- installedPackagePath: join28(rootDir, "node_modules", packageName, "package.json")
75778
+ installedPackagePath: join29(rootDir, "node_modules", packageName, "package.json")
75646
75779
  }));
75647
75780
  }
75648
75781
  function selectInstalledPackage(candidate) {
75649
- return candidate.packageCandidates.find((packageCandidate) => existsSync30(packageCandidate.installedPackagePath)) ?? candidate.packageCandidates[0];
75782
+ return candidate.packageCandidates.find((packageCandidate) => existsSync31(packageCandidate.installedPackagePath)) ?? candidate.packageCandidates[0];
75650
75783
  }
75651
75784
  function getExpectedVersion(cachePackage, packageName) {
75652
75785
  return normalizeVersion(cachePackage?.dependencies?.[packageName]) ?? normalizeVersion(cachePackage?.dependencies?.[PACKAGE_NAME]);
@@ -75658,16 +75791,16 @@ function getLoadedPluginVersion() {
75658
75791
  const candidates = [
75659
75792
  {
75660
75793
  cacheDir: configDir,
75661
- cachePackagePath: join28(configDir, "package.json"),
75794
+ cachePackagePath: join29(configDir, "package.json"),
75662
75795
  packageCandidates: createPackageCandidates(configDir)
75663
75796
  },
75664
75797
  {
75665
75798
  cacheDir,
75666
- cachePackagePath: join28(cacheDir, "package.json"),
75799
+ cachePackagePath: join29(cacheDir, "package.json"),
75667
75800
  packageCandidates: createPackageCandidates(cacheDir)
75668
75801
  }
75669
75802
  ];
75670
- const selectedCandidate = candidates.find((candidate) => candidate.packageCandidates.some((packageCandidate) => existsSync30(packageCandidate.installedPackagePath))) ?? candidates[0];
75803
+ const selectedCandidate = candidates.find((candidate) => candidate.packageCandidates.some((packageCandidate) => existsSync31(packageCandidate.installedPackagePath))) ?? candidates[0];
75671
75804
  const { cacheDir: selectedDir, cachePackagePath } = selectedCandidate;
75672
75805
  const selectedPackage = selectInstalledPackage(selectedCandidate);
75673
75806
  const installedPackagePath = selectedPackage.installedPackagePath;
@@ -75706,7 +75839,7 @@ var defaultDeps3 = {
75706
75839
  function isConfigValid(configPath) {
75707
75840
  if (!configPath)
75708
75841
  return true;
75709
- if (!existsSync31(configPath))
75842
+ if (!existsSync32(configPath))
75710
75843
  return false;
75711
75844
  try {
75712
75845
  parseJsonc(readFileSync26(configPath, "utf-8"));
@@ -75832,28 +75965,28 @@ async function checkSystem(deps = defaultDeps3) {
75832
75965
 
75833
75966
  // src/cli/doctor/checks/config.ts
75834
75967
  import { readFileSync as readFileSync29 } from "fs";
75835
- import { join as join32 } from "path";
75968
+ import { join as join33 } from "path";
75836
75969
  init_shared();
75837
75970
 
75838
75971
  // src/cli/doctor/checks/model-resolution-cache.ts
75839
75972
  init_shared();
75840
- import { existsSync as existsSync32, readFileSync as readFileSync27 } from "fs";
75973
+ import { existsSync as existsSync33, readFileSync as readFileSync27 } from "fs";
75841
75974
  import { homedir as homedir7 } from "os";
75842
- import { join as join29 } from "path";
75975
+ import { join as join30 } from "path";
75843
75976
  function getUserConfigDir2() {
75844
75977
  const xdgConfig = process.env.XDG_CONFIG_HOME;
75845
75978
  if (xdgConfig)
75846
- return join29(xdgConfig, "opencode");
75847
- return join29(homedir7(), ".config", "opencode");
75979
+ return join30(xdgConfig, "opencode");
75980
+ return join30(homedir7(), ".config", "opencode");
75848
75981
  }
75849
75982
  function loadCustomProviderNames() {
75850
75983
  const configDir = getUserConfigDir2();
75851
75984
  const candidatePaths = [
75852
- join29(configDir, "opencode.json"),
75853
- join29(configDir, "opencode.jsonc")
75985
+ join30(configDir, "opencode.json"),
75986
+ join30(configDir, "opencode.jsonc")
75854
75987
  ];
75855
75988
  for (const configPath of candidatePaths) {
75856
- if (!existsSync32(configPath))
75989
+ if (!existsSync33(configPath))
75857
75990
  continue;
75858
75991
  try {
75859
75992
  const content = readFileSync27(configPath, "utf-8");
@@ -75866,9 +75999,9 @@ function loadCustomProviderNames() {
75866
75999
  return [];
75867
76000
  }
75868
76001
  function loadAvailableModelsFromCache() {
75869
- const cacheFile = join29(getOpenCodeCacheDir(), "models.json");
76002
+ const cacheFile = join30(getOpenCodeCacheDir(), "models.json");
75870
76003
  const customProviders = loadCustomProviderNames();
75871
- if (!existsSync32(cacheFile)) {
76004
+ if (!existsSync33(cacheFile)) {
75872
76005
  if (customProviders.length > 0) {
75873
76006
  return { providers: customProviders, modelCount: 0, cacheExists: true };
75874
76007
  }
@@ -75899,8 +76032,8 @@ init_model_capabilities();
75899
76032
  // src/cli/doctor/checks/model-resolution-config.ts
75900
76033
  init_shared();
75901
76034
  import { readFileSync as readFileSync28 } from "fs";
75902
- import { join as join30 } from "path";
75903
- var PROJECT_CONFIG_DIR = join30(process.cwd(), ".opencode");
76035
+ import { join as join31 } from "path";
76036
+ var PROJECT_CONFIG_DIR = join31(process.cwd(), ".opencode");
75904
76037
  function loadOmoConfig() {
75905
76038
  const projectDetected = detectPluginConfigFile(PROJECT_CONFIG_DIR);
75906
76039
  if (projectDetected.format !== "none") {
@@ -75926,7 +76059,7 @@ function loadOmoConfig() {
75926
76059
 
75927
76060
  // src/cli/doctor/checks/model-resolution-details.ts
75928
76061
  init_shared();
75929
- import { join as join31 } from "path";
76062
+ import { join as join32 } from "path";
75930
76063
 
75931
76064
  // src/cli/doctor/checks/model-resolution-variant.ts
75932
76065
  function formatModelWithVariant(model, variant) {
@@ -75968,7 +76101,7 @@ function formatCapabilityResolutionLabel(mode) {
75968
76101
  }
75969
76102
  function buildModelResolutionDetails(options) {
75970
76103
  const details = [];
75971
- const cacheFile = join31(getOpenCodeCacheDir(), "models.json");
76104
+ const cacheFile = join32(getOpenCodeCacheDir(), "models.json");
75972
76105
  details.push("\u2550\u2550\u2550 Available Models (from cache) \u2550\u2550\u2550");
75973
76106
  details.push("");
75974
76107
  if (options.available.cacheExists) {
@@ -76123,7 +76256,7 @@ async function checkModels() {
76123
76256
  }
76124
76257
 
76125
76258
  // src/cli/doctor/checks/config.ts
76126
- var PROJECT_CONFIG_DIR2 = join32(process.cwd(), ".opencode");
76259
+ var PROJECT_CONFIG_DIR2 = join33(process.cwd(), ".opencode");
76127
76260
  function findConfigPath() {
76128
76261
  const projectConfig = detectPluginConfigFile(PROJECT_CONFIG_DIR2);
76129
76262
  if (projectConfig.format !== "none")
@@ -76243,14 +76376,41 @@ async function checkConfig() {
76243
76376
  }
76244
76377
 
76245
76378
  // src/cli/doctor/checks/dependencies.ts
76246
- import { existsSync as existsSync33 } from "fs";
76379
+ import { existsSync as existsSync34 } from "fs";
76247
76380
  import { createRequire } from "module";
76248
- import { dirname as dirname13, join as join33 } from "path";
76381
+ import { dirname as dirname13, join as join35 } from "path";
76382
+
76383
+ // src/hooks/comment-checker/downloader.ts
76384
+ import { join as join34 } from "path";
76385
+ import { homedir as homedir8, tmpdir as tmpdir3 } from "os";
76386
+ init_binary_downloader();
76387
+ init_logger();
76388
+ init_plugin_identity();
76389
+ var DEBUG = process.env.COMMENT_CHECKER_DEBUG === "1";
76390
+ var DEBUG_FILE = join34(tmpdir3(), "comment-checker-debug.log");
76391
+ function getCacheDir2() {
76392
+ if (process.platform === "win32") {
76393
+ const localAppData = process.env.LOCALAPPDATA || process.env.APPDATA;
76394
+ const base2 = localAppData || join34(homedir8(), "AppData", "Local");
76395
+ return join34(base2, CACHE_DIR_NAME, "bin");
76396
+ }
76397
+ const xdgCache = process.env.XDG_CACHE_HOME;
76398
+ const base = xdgCache || join34(homedir8(), ".cache");
76399
+ return join34(base, CACHE_DIR_NAME, "bin");
76400
+ }
76401
+ function getBinaryName() {
76402
+ return process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
76403
+ }
76404
+ function getCachedBinaryPath2() {
76405
+ return getCachedBinaryPath(getCacheDir2(), getBinaryName());
76406
+ }
76407
+
76408
+ // src/cli/doctor/checks/dependencies.ts
76249
76409
  async function checkBinaryExists(binary2) {
76250
76410
  try {
76251
- const path11 = Bun.which(binary2);
76252
- if (path11) {
76253
- return { exists: true, path: path11 };
76411
+ const path12 = Bun.which(binary2);
76412
+ if (path12) {
76413
+ return { exists: true, path: path12 };
76254
76414
  }
76255
76415
  } catch {}
76256
76416
  return { exists: false, path: null };
@@ -76300,15 +76460,15 @@ async function checkAstGrepNapi() {
76300
76460
  path: null
76301
76461
  };
76302
76462
  } catch {
76303
- const { existsSync: existsSync34 } = await import("fs");
76304
- const { join: join34 } = await import("path");
76305
- const { homedir: homedir8 } = await import("os");
76463
+ const { existsSync: existsSync35 } = await import("fs");
76464
+ const { join: join36 } = await import("path");
76465
+ const { homedir: homedir9 } = await import("os");
76306
76466
  const pathsToCheck = [
76307
- join34(homedir8(), ".config", "opencode", "node_modules", "@ast-grep", "napi"),
76308
- join34(process.cwd(), "node_modules", "@ast-grep", "napi")
76467
+ join36(homedir9(), ".config", "opencode", "node_modules", "@ast-grep", "napi"),
76468
+ join36(process.cwd(), "node_modules", "@ast-grep", "napi")
76309
76469
  ];
76310
76470
  for (const napiPath of pathsToCheck) {
76311
- if (existsSync34(napiPath)) {
76471
+ if (existsSync35(napiPath)) {
76312
76472
  return {
76313
76473
  name: "AST-Grep NAPI",
76314
76474
  required: false,
@@ -76333,13 +76493,24 @@ function findCommentCheckerPackageBinary() {
76333
76493
  try {
76334
76494
  const require2 = createRequire(import.meta.url);
76335
76495
  const pkgPath = require2.resolve("@code-yeongyu/comment-checker/package.json");
76336
- const binaryPath = join33(dirname13(pkgPath), "bin", binaryName);
76337
- if (existsSync33(binaryPath))
76496
+ const binaryPath = join35(dirname13(pkgPath), "bin", binaryName);
76497
+ if (existsSync34(binaryPath))
76338
76498
  return binaryPath;
76339
76499
  } catch {}
76340
76500
  return null;
76341
76501
  }
76342
76502
  async function checkCommentChecker() {
76503
+ const cachedPath = getCachedBinaryPath2();
76504
+ if (cachedPath) {
76505
+ const version4 = await getBinaryVersion(cachedPath);
76506
+ return {
76507
+ name: "Comment Checker",
76508
+ required: false,
76509
+ installed: true,
76510
+ version: version4,
76511
+ path: cachedPath
76512
+ };
76513
+ }
76343
76514
  const binaryCheck = await checkBinaryExists("comment-checker");
76344
76515
  const resolvedPath = binaryCheck.exists ? binaryCheck.path : findCommentCheckerPackageBinary();
76345
76516
  if (!resolvedPath) {
@@ -76484,15 +76655,15 @@ var BUILTIN_SERVERS = {
76484
76655
  "kotlin-ls": { command: ["kotlin-lsp"], extensions: [".kt", ".kts"] }
76485
76656
  };
76486
76657
  // src/tools/lsp/server-config-loader.ts
76487
- import { existsSync as existsSync34, readFileSync as readFileSync30 } from "fs";
76488
- import { join as join34 } from "path";
76658
+ import { existsSync as existsSync35, readFileSync as readFileSync30 } from "fs";
76659
+ import { join as join36 } from "path";
76489
76660
  init_shared();
76490
76661
  init_jsonc_parser();
76491
- function loadJsonFile(path11) {
76492
- if (!existsSync34(path11))
76662
+ function loadJsonFile(path12) {
76663
+ if (!existsSync35(path12))
76493
76664
  return null;
76494
76665
  try {
76495
- return parseJsonc(readFileSync30(path11, "utf-8"));
76666
+ return parseJsonc(readFileSync30(path12, "utf-8"));
76496
76667
  } catch {
76497
76668
  return null;
76498
76669
  }
@@ -76501,9 +76672,9 @@ function getConfigPaths2() {
76501
76672
  const cwd = process.cwd();
76502
76673
  const configDir = getOpenCodeConfigDir({ binary: "opencode" });
76503
76674
  return {
76504
- project: detectPluginConfigFile(join34(cwd, ".opencode")).path,
76675
+ project: detectPluginConfigFile(join36(cwd, ".opencode")).path,
76505
76676
  user: detectPluginConfigFile(configDir).path,
76506
- opencode: detectConfigFile(join34(configDir, "opencode")).path
76677
+ opencode: detectConfigFile(join36(configDir, "opencode")).path
76507
76678
  };
76508
76679
  }
76509
76680
  function loadAllConfigs() {
@@ -76572,21 +76743,21 @@ function getMergedServers() {
76572
76743
  }
76573
76744
 
76574
76745
  // src/tools/lsp/server-installation.ts
76575
- import { existsSync as existsSync35 } from "fs";
76576
- import { delimiter as delimiter2, join as join36 } from "path";
76746
+ import { existsSync as existsSync36 } from "fs";
76747
+ import { delimiter as delimiter2, join as join38 } from "path";
76577
76748
 
76578
76749
  // src/tools/lsp/server-path-bases.ts
76579
76750
  init_shared();
76580
- import { join as join35 } from "path";
76751
+ import { join as join37 } from "path";
76581
76752
  function getLspServerAdditionalPathBases(workingDirectory) {
76582
76753
  const configDir = getOpenCodeConfigDir({ binary: "opencode" });
76583
- const dataDir = join35(getDataDir(), "opencode");
76754
+ const dataDir = join37(getDataDir(), "opencode");
76584
76755
  return [
76585
- join35(workingDirectory, "node_modules", ".bin"),
76586
- join35(configDir, "bin"),
76587
- join35(configDir, "node_modules", ".bin"),
76588
- join35(dataDir, "bin"),
76589
- join35(dataDir, "bin", "node_modules", ".bin")
76756
+ join37(workingDirectory, "node_modules", ".bin"),
76757
+ join37(configDir, "bin"),
76758
+ join37(configDir, "node_modules", ".bin"),
76759
+ join37(dataDir, "bin"),
76760
+ join37(dataDir, "bin", "node_modules", ".bin")
76590
76761
  ];
76591
76762
  }
76592
76763
 
@@ -76596,7 +76767,7 @@ function isServerInstalled(command) {
76596
76767
  return false;
76597
76768
  const cmd = command[0];
76598
76769
  if (cmd.includes("/") || cmd.includes("\\")) {
76599
- if (existsSync35(cmd))
76770
+ if (existsSync36(cmd))
76600
76771
  return true;
76601
76772
  }
76602
76773
  const isWindows = process.platform === "win32";
@@ -76617,14 +76788,14 @@ function isServerInstalled(command) {
76617
76788
  const paths = pathEnv.split(delimiter2);
76618
76789
  for (const p2 of paths) {
76619
76790
  for (const suffix of exts) {
76620
- if (existsSync35(join36(p2, cmd + suffix))) {
76791
+ if (existsSync36(join38(p2, cmd + suffix))) {
76621
76792
  return true;
76622
76793
  }
76623
76794
  }
76624
76795
  }
76625
76796
  for (const base of getLspServerAdditionalPathBases(process.cwd())) {
76626
76797
  for (const suffix of exts) {
76627
- if (existsSync35(join36(base, cmd + suffix))) {
76798
+ if (existsSync36(join38(base, cmd + suffix))) {
76628
76799
  return true;
76629
76800
  }
76630
76801
  }
@@ -76686,21 +76857,21 @@ function getInstalledLspServers() {
76686
76857
 
76687
76858
  // src/cli/doctor/checks/tools-mcp.ts
76688
76859
  init_shared();
76689
- import { existsSync as existsSync36, readFileSync as readFileSync31 } from "fs";
76690
- import { homedir as homedir8 } from "os";
76691
- import { join as join37 } from "path";
76860
+ import { existsSync as existsSync37, readFileSync as readFileSync31 } from "fs";
76861
+ import { homedir as homedir9 } from "os";
76862
+ import { join as join39 } from "path";
76692
76863
  var BUILTIN_MCP_SERVERS = ["context7", "grep_app"];
76693
76864
  function getMcpConfigPaths() {
76694
76865
  return [
76695
- join37(homedir8(), ".claude", ".mcp.json"),
76696
- join37(process.cwd(), ".mcp.json"),
76697
- join37(process.cwd(), ".claude", ".mcp.json")
76866
+ join39(homedir9(), ".claude", ".mcp.json"),
76867
+ join39(process.cwd(), ".mcp.json"),
76868
+ join39(process.cwd(), ".claude", ".mcp.json")
76698
76869
  ];
76699
76870
  }
76700
76871
  function loadUserMcpConfig() {
76701
76872
  const servers = {};
76702
76873
  for (const configPath of getMcpConfigPaths()) {
76703
- if (!existsSync36(configPath))
76874
+ if (!existsSync37(configPath))
76704
76875
  continue;
76705
76876
  try {
76706
76877
  const content = readFileSync31(configPath, "utf-8");
@@ -77201,11 +77372,11 @@ async function refreshModelCapabilities(options, deps = {}) {
77201
77372
 
77202
77373
  // src/features/mcp-oauth/storage.ts
77203
77374
  init_shared();
77204
- import { chmodSync, existsSync as existsSync37, mkdirSync as mkdirSync11, readFileSync as readFileSync32, renameSync as renameSync4, unlinkSync as unlinkSync4, writeFileSync as writeFileSync10 } from "fs";
77205
- import { dirname as dirname14, join as join38 } from "path";
77375
+ import { chmodSync as chmodSync2, existsSync as existsSync38, mkdirSync as mkdirSync12, readFileSync as readFileSync32, renameSync as renameSync4, unlinkSync as unlinkSync6, writeFileSync as writeFileSync10 } from "fs";
77376
+ import { dirname as dirname14, join as join40 } from "path";
77206
77377
  var STORAGE_FILE_NAME = "mcp-oauth.json";
77207
77378
  function getMcpOauthStoragePath() {
77208
- return join38(getOpenCodeConfigDir({ binary: "opencode" }), STORAGE_FILE_NAME);
77379
+ return join40(getOpenCodeConfigDir({ binary: "opencode" }), STORAGE_FILE_NAME);
77209
77380
  }
77210
77381
  function normalizeHost(serverHost) {
77211
77382
  let host = serverHost.trim();
@@ -77242,7 +77413,7 @@ function buildKey(serverHost, resource) {
77242
77413
  }
77243
77414
  function readStore() {
77244
77415
  const filePath = getMcpOauthStoragePath();
77245
- if (!existsSync37(filePath)) {
77416
+ if (!existsSync38(filePath)) {
77246
77417
  return null;
77247
77418
  }
77248
77419
  try {
@@ -77256,12 +77427,12 @@ function writeStore(store2) {
77256
77427
  const filePath = getMcpOauthStoragePath();
77257
77428
  try {
77258
77429
  const dir = dirname14(filePath);
77259
- if (!existsSync37(dir)) {
77260
- mkdirSync11(dir, { recursive: true });
77430
+ if (!existsSync38(dir)) {
77431
+ mkdirSync12(dir, { recursive: true });
77261
77432
  }
77262
77433
  const tempPath = `${filePath}.tmp.${Date.now()}`;
77263
77434
  writeFileSync10(tempPath, JSON.stringify(store2, null, 2), { encoding: "utf-8", mode: 384 });
77264
- chmodSync(tempPath, 384);
77435
+ chmodSync2(tempPath, 384);
77265
77436
  renameSync4(tempPath, filePath);
77266
77437
  return true;
77267
77438
  } catch {
@@ -77293,8 +77464,8 @@ function deleteToken(serverHost, resource) {
77293
77464
  if (Object.keys(store2).length === 0) {
77294
77465
  try {
77295
77466
  const filePath = getMcpOauthStoragePath();
77296
- if (existsSync37(filePath)) {
77297
- unlinkSync4(filePath);
77467
+ if (existsSync38(filePath)) {
77468
+ unlinkSync6(filePath);
77298
77469
  }
77299
77470
  return true;
77300
77471
  } catch {
@@ -77876,20 +78047,21 @@ function createMcpOAuthCommand() {
77876
78047
  var VERSION2 = package_default.version;
77877
78048
  var program2 = new Command;
77878
78049
  program2.name("oh-my-opencode").description("The ultimate OpenCode plugin - multi-model orchestration, LSP tools, and more").version(VERSION2, "-v, --version", "Show version number").enablePositionalOptions();
77879
- program2.command("install").description("Install and configure oh-my-opencode with interactive setup").option("--no-tui", "Run in non-interactive mode (requires all options)").option("--claude <value>", "Claude subscription: no, yes, max20").option("--openai <value>", "OpenAI/ChatGPT subscription: no, yes (default: no)").option("--gemini <value>", "Gemini integration: no, yes").option("--copilot <value>", "GitHub Copilot subscription: no, yes").option("--opencode-zen <value>", "OpenCode Zen access: no, yes (default: no)").option("--zai-coding-plan <value>", "Z.ai Coding Plan subscription: no, yes (default: no)").option("--kimi-for-coding <value>", "Kimi For Coding subscription: no, yes (default: no)").option("--opencode-go <value>", "OpenCode Go subscription: no, yes (default: no)").option("--skip-auth", "Skip authentication setup hints").addHelpText("after", `
78050
+ program2.command("install").description("Install and configure oh-my-opencode with interactive setup").option("--no-tui", "Run in non-interactive mode (requires all options)").option("--claude <value>", "Claude subscription: no, yes, max20").option("--openai <value>", "OpenAI/ChatGPT subscription: no, yes (default: no)").option("--gemini <value>", "Gemini integration: no, yes").option("--copilot <value>", "GitHub Copilot subscription: no, yes").option("--opencode-zen <value>", "OpenCode Zen access: no, yes (default: no)").option("--zai-coding-plan <value>", "Z.ai Coding Plan subscription: no, yes (default: no)").option("--kimi-for-coding <value>", "Kimi For Coding subscription: no, yes (default: no)").option("--opencode-go <value>", "OpenCode Go subscription: no, yes (default: no)").option("--vercel-ai-gateway <value>", "Vercel AI Gateway: no, yes (default: no)").option("--skip-auth", "Skip authentication setup hints").addHelpText("after", `
77880
78051
  Examples:
77881
78052
  $ bunx oh-my-opencode install
77882
78053
  $ bunx oh-my-opencode install --no-tui --claude=max20 --openai=yes --gemini=yes --copilot=no
77883
78054
  $ bunx oh-my-opencode install --no-tui --claude=no --gemini=no --copilot=yes --opencode-zen=yes
77884
78055
 
77885
- Model Providers (Priority: Native > Copilot > OpenCode Zen > Z.ai > Kimi):
78056
+ Model Providers (Priority: Native > Copilot > OpenCode Zen > Z.ai > Kimi > Vercel):
77886
78057
  Claude Native anthropic/ models (Opus, Sonnet, Haiku)
77887
78058
  OpenAI Native openai/ models (GPT-5.4 for Oracle)
77888
78059
  Gemini Native google/ models (Gemini 3.1 Pro, Flash)
77889
78060
  Copilot github-copilot/ models (fallback)
77890
78061
  OpenCode Zen opencode/ models (opencode/claude-opus-4-6, etc.)
77891
- Z.ai zai-coding-plan/glm-5 (visual-engineering fallback)
78062
+ Z.ai zai-coding-plan/glm-5 (visual-engineering fallback)
77892
78063
  Kimi kimi-for-coding/k2p5 (Sisyphus/Prometheus fallback)
78064
+ Vercel vercel/ models (universal proxy, always last fallback)
77893
78065
  `).action(async (options) => {
77894
78066
  const args = {
77895
78067
  tui: options.tui !== false,
@@ -77901,6 +78073,7 @@ Model Providers (Priority: Native > Copilot > OpenCode Zen > Z.ai > Kimi):
77901
78073
  zaiCodingPlan: options.zaiCodingPlan,
77902
78074
  kimiForCoding: options.kimiForCoding,
77903
78075
  opencodeGo: options.opencodeGo,
78076
+ vercelAiGateway: options.vercelAiGateway,
77904
78077
  skipAuth: options.skipAuth ?? false
77905
78078
  };
77906
78079
  const exitCode = await install(args);