oh-my-opencode 3.13.0 → 3.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/index.js CHANGED
@@ -5041,14 +5041,28 @@ var init_dynamic_truncator = __esm(() => {
5041
5041
  // src/shared/data-path.ts
5042
5042
  import * as path2 from "path";
5043
5043
  import * as os2 from "os";
5044
+ import { accessSync, constants, mkdirSync } from "fs";
5045
+ function resolveWritableDirectory(preferredDir, fallbackSuffix) {
5046
+ try {
5047
+ mkdirSync(preferredDir, { recursive: true });
5048
+ accessSync(preferredDir, constants.W_OK);
5049
+ return preferredDir;
5050
+ } catch {
5051
+ const fallbackDir = path2.join(os2.tmpdir(), fallbackSuffix);
5052
+ mkdirSync(fallbackDir, { recursive: true });
5053
+ return fallbackDir;
5054
+ }
5055
+ }
5044
5056
  function getDataDir() {
5045
- return process.env.XDG_DATA_HOME ?? path2.join(os2.homedir(), ".local", "share");
5057
+ const preferredDir = process.env.XDG_DATA_HOME ?? path2.join(os2.homedir(), ".local", "share");
5058
+ return resolveWritableDirectory(preferredDir, "opencode-data");
5046
5059
  }
5047
5060
  function getOpenCodeStorageDir() {
5048
5061
  return path2.join(getDataDir(), "opencode", "storage");
5049
5062
  }
5050
5063
  function getCacheDir() {
5051
- return process.env.XDG_CACHE_HOME ?? path2.join(os2.homedir(), ".cache");
5064
+ const preferredDir = process.env.XDG_CACHE_HOME ?? path2.join(os2.homedir(), ".cache");
5065
+ return resolveWritableDirectory(preferredDir, "opencode-cache");
5052
5066
  }
5053
5067
  function getOmoOpenCodeCacheDir() {
5054
5068
  return path2.join(getCacheDir(), "oh-my-opencode");
@@ -6662,7 +6676,7 @@ var init_system_directive = () => {};
6662
6676
  // src/shared/agent-tool-restrictions.ts
6663
6677
  var init_agent_tool_restrictions = () => {};
6664
6678
  // src/shared/connected-providers-cache.ts
6665
- import { existsSync as existsSync3, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync } from "fs";
6679
+ import { existsSync as existsSync3, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "fs";
6666
6680
  import { join as join5 } from "path";
6667
6681
  function createConnectedProvidersCacheStore(getCacheDir2 = getOmoOpenCodeCacheDir) {
6668
6682
  function getCacheFilePath(filename) {
@@ -6673,7 +6687,7 @@ function createConnectedProvidersCacheStore(getCacheDir2 = getOmoOpenCodeCacheDi
6673
6687
  function ensureCacheDir() {
6674
6688
  const cacheDir = getCacheDir2();
6675
6689
  if (!existsSync3(cacheDir)) {
6676
- mkdirSync(cacheDir, { recursive: true });
6690
+ mkdirSync2(cacheDir, { recursive: true });
6677
6691
  }
6678
6692
  }
6679
6693
  function readConnectedProvidersCache() {
@@ -7298,11 +7312,11 @@ var init_plugin_name_with_version = __esm(() => {
7298
7312
  });
7299
7313
 
7300
7314
  // src/cli/config-manager/ensure-config-directory-exists.ts
7301
- import { existsSync as existsSync5, mkdirSync as mkdirSync2 } from "fs";
7315
+ import { existsSync as existsSync5, mkdirSync as mkdirSync3 } from "fs";
7302
7316
  function ensureConfigDirectoryExists() {
7303
7317
  const configDir = getConfigDir();
7304
7318
  if (!existsSync5(configDir)) {
7305
- mkdirSync2(configDir, { recursive: true });
7319
+ mkdirSync3(configDir, { recursive: true });
7306
7320
  }
7307
7321
  }
7308
7322
  var init_ensure_config_directory_exists = __esm(() => {
@@ -8957,7 +8971,7 @@ var {
8957
8971
  // package.json
8958
8972
  var package_default = {
8959
8973
  name: "oh-my-opencode",
8960
- version: "3.13.0",
8974
+ version: "3.13.1",
8961
8975
  description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
8962
8976
  main: "dist/index.js",
8963
8977
  types: "dist/index.d.ts",
@@ -9033,17 +9047,17 @@ var package_default = {
9033
9047
  typescript: "^5.7.3"
9034
9048
  },
9035
9049
  optionalDependencies: {
9036
- "oh-my-opencode-darwin-arm64": "3.13.0",
9037
- "oh-my-opencode-darwin-x64": "3.13.0",
9038
- "oh-my-opencode-darwin-x64-baseline": "3.13.0",
9039
- "oh-my-opencode-linux-arm64": "3.13.0",
9040
- "oh-my-opencode-linux-arm64-musl": "3.13.0",
9041
- "oh-my-opencode-linux-x64": "3.13.0",
9042
- "oh-my-opencode-linux-x64-baseline": "3.13.0",
9043
- "oh-my-opencode-linux-x64-musl": "3.13.0",
9044
- "oh-my-opencode-linux-x64-musl-baseline": "3.13.0",
9045
- "oh-my-opencode-windows-x64": "3.13.0",
9046
- "oh-my-opencode-windows-x64-baseline": "3.13.0"
9050
+ "oh-my-opencode-darwin-arm64": "3.13.1",
9051
+ "oh-my-opencode-darwin-x64": "3.13.1",
9052
+ "oh-my-opencode-darwin-x64-baseline": "3.13.1",
9053
+ "oh-my-opencode-linux-arm64": "3.13.1",
9054
+ "oh-my-opencode-linux-arm64-musl": "3.13.1",
9055
+ "oh-my-opencode-linux-x64": "3.13.1",
9056
+ "oh-my-opencode-linux-x64-baseline": "3.13.1",
9057
+ "oh-my-opencode-linux-x64-musl": "3.13.1",
9058
+ "oh-my-opencode-linux-x64-musl-baseline": "3.13.1",
9059
+ "oh-my-opencode-windows-x64": "3.13.1",
9060
+ "oh-my-opencode-windows-x64-baseline": "3.13.1"
9047
9061
  },
9048
9062
  overrides: {
9049
9063
  "@opencode-ai/sdk": "^1.2.24"
@@ -26769,7 +26783,7 @@ var BOULDER_STATE_PATH = `${BOULDER_DIR}/${BOULDER_FILE}`;
26769
26783
  var NOTEPAD_DIR = "notepads";
26770
26784
  var NOTEPAD_BASE_PATH = `${BOULDER_DIR}/${NOTEPAD_DIR}`;
26771
26785
  // src/features/boulder-state/storage.ts
26772
- import { existsSync as existsSync11, readFileSync as readFileSync9, writeFileSync as writeFileSync5, mkdirSync as mkdirSync3, readdirSync } from "fs";
26786
+ import { existsSync as existsSync11, readFileSync as readFileSync9, writeFileSync as writeFileSync5, mkdirSync as mkdirSync4, readdirSync } from "fs";
26773
26787
  import { dirname as dirname2, join as join10, basename } from "path";
26774
26788
  var RESERVED_KEYS = new Set(["__proto__", "prototype", "constructor"]);
26775
26789
  function getBoulderFilePath(directory) {
@@ -26819,7 +26833,7 @@ function getPlanProgress(planPath) {
26819
26833
  // src/features/run-continuation-state/constants.ts
26820
26834
  var CONTINUATION_MARKER_DIR = ".sisyphus/run-continuation";
26821
26835
  // src/features/run-continuation-state/storage.ts
26822
- import { existsSync as existsSync12, mkdirSync as mkdirSync4, readFileSync as readFileSync10, rmSync, writeFileSync as writeFileSync6 } from "fs";
26836
+ import { existsSync as existsSync12, mkdirSync as mkdirSync5, readFileSync as readFileSync10, rmSync, writeFileSync as writeFileSync6 } from "fs";
26823
26837
  import { join as join11 } from "path";
26824
26838
  function getMarkerPath(directory, sessionID) {
26825
26839
  return join11(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
@@ -26854,7 +26868,7 @@ function getActiveContinuationMarkerReason(marker) {
26854
26868
  }
26855
26869
  // src/hooks/ralph-loop/storage.ts
26856
26870
  init_frontmatter();
26857
- import { existsSync as existsSync13, readFileSync as readFileSync11, writeFileSync as writeFileSync7, unlinkSync, mkdirSync as mkdirSync5 } from "fs";
26871
+ import { existsSync as existsSync13, readFileSync as readFileSync11, writeFileSync as writeFileSync7, unlinkSync, mkdirSync as mkdirSync6 } from "fs";
26858
26872
  import { dirname as dirname3, join as join12 } from "path";
26859
26873
 
26860
26874
  // src/hooks/ralph-loop/constants.ts
@@ -29173,7 +29187,7 @@ async function doctor(options = { mode: "default" }) {
29173
29187
 
29174
29188
  // src/features/mcp-oauth/storage.ts
29175
29189
  init_shared();
29176
- import { chmodSync, existsSync as existsSync30, mkdirSync as mkdirSync6, readFileSync as readFileSync27, unlinkSync as unlinkSync4, writeFileSync as writeFileSync10 } from "fs";
29190
+ import { chmodSync, existsSync as existsSync30, mkdirSync as mkdirSync7, readFileSync as readFileSync27, unlinkSync as unlinkSync4, writeFileSync as writeFileSync10 } from "fs";
29177
29191
  import { dirname as dirname7, join as join30 } from "path";
29178
29192
  var STORAGE_FILE_NAME = "mcp-oauth.json";
29179
29193
  function getMcpOauthStoragePath() {
@@ -29229,7 +29243,7 @@ function writeStore(store2) {
29229
29243
  try {
29230
29244
  const dir = dirname7(filePath);
29231
29245
  if (!existsSync30(dir)) {
29232
- mkdirSync6(dir, { recursive: true });
29246
+ mkdirSync7(dir, { recursive: true });
29233
29247
  }
29234
29248
  writeFileSync10(filePath, JSON.stringify(store2, null, 2), { encoding: "utf-8", mode: 384 });
29235
29249
  chmodSync(filePath, 384);
package/dist/index.js CHANGED
@@ -627,7 +627,7 @@ var require_scan = __commonJS((exports, module) => {
627
627
 
628
628
  // node_modules/picomatch/lib/parse.js
629
629
  var require_parse = __commonJS((exports, module) => {
630
- var constants3 = require_constants();
630
+ var constants4 = require_constants();
631
631
  var utils = require_utils();
632
632
  var {
633
633
  MAX_LENGTH,
@@ -635,7 +635,7 @@ var require_parse = __commonJS((exports, module) => {
635
635
  REGEX_NON_SPECIAL_CHARS,
636
636
  REGEX_SPECIAL_CHARS_BACKREF,
637
637
  REPLACEMENTS
638
- } = constants3;
638
+ } = constants4;
639
639
  var expandRange = (args, options) => {
640
640
  if (typeof options.expandRange === "function") {
641
641
  return options.expandRange(...args, options);
@@ -666,8 +666,8 @@ var require_parse = __commonJS((exports, module) => {
666
666
  const bos = { type: "bos", value: "", output: opts.prepend || "" };
667
667
  const tokens = [bos];
668
668
  const capture = opts.capture ? "" : "?:";
669
- const PLATFORM_CHARS = constants3.globChars(opts.windows);
670
- const EXTGLOB_CHARS = constants3.extglobChars(PLATFORM_CHARS);
669
+ const PLATFORM_CHARS = constants4.globChars(opts.windows);
670
+ const EXTGLOB_CHARS = constants4.extglobChars(PLATFORM_CHARS);
671
671
  const {
672
672
  DOT_LITERAL,
673
673
  PLUS_LITERAL,
@@ -1345,7 +1345,7 @@ var require_parse = __commonJS((exports, module) => {
1345
1345
  NO_DOTS_SLASH,
1346
1346
  STAR,
1347
1347
  START_ANCHOR
1348
- } = constants3.globChars(opts.windows);
1348
+ } = constants4.globChars(opts.windows);
1349
1349
  const nodot = opts.dot ? NO_DOTS : NO_DOT;
1350
1350
  const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
1351
1351
  const capture = opts.capture ? "" : "?:";
@@ -1403,7 +1403,7 @@ var require_picomatch = __commonJS((exports, module) => {
1403
1403
  var scan = require_scan();
1404
1404
  var parse7 = require_parse();
1405
1405
  var utils = require_utils();
1406
- var constants3 = require_constants();
1406
+ var constants4 = require_constants();
1407
1407
  var isObject3 = (val) => val && typeof val === "object" && !Array.isArray(val);
1408
1408
  var picomatch = (glob, options, returnState = false) => {
1409
1409
  if (Array.isArray(glob)) {
@@ -1534,7 +1534,7 @@ var require_picomatch = __commonJS((exports, module) => {
1534
1534
  return /$^/;
1535
1535
  }
1536
1536
  };
1537
- picomatch.constants = constants3;
1537
+ picomatch.constants = constants4;
1538
1538
  module.exports = picomatch;
1539
1539
  });
1540
1540
 
@@ -5778,11 +5778,11 @@ var require_codegen = __commonJS((exports) => {
5778
5778
  const rhs = this.rhs === undefined ? "" : ` = ${this.rhs}`;
5779
5779
  return `${varKind} ${this.name}${rhs};` + _n;
5780
5780
  }
5781
- optimizeNames(names, constants19) {
5781
+ optimizeNames(names, constants20) {
5782
5782
  if (!names[this.name.str])
5783
5783
  return;
5784
5784
  if (this.rhs)
5785
- this.rhs = optimizeExpr(this.rhs, names, constants19);
5785
+ this.rhs = optimizeExpr(this.rhs, names, constants20);
5786
5786
  return this;
5787
5787
  }
5788
5788
  get names() {
@@ -5800,10 +5800,10 @@ var require_codegen = __commonJS((exports) => {
5800
5800
  render({ _n }) {
5801
5801
  return `${this.lhs} = ${this.rhs};` + _n;
5802
5802
  }
5803
- optimizeNames(names, constants19) {
5803
+ optimizeNames(names, constants20) {
5804
5804
  if (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects)
5805
5805
  return;
5806
- this.rhs = optimizeExpr(this.rhs, names, constants19);
5806
+ this.rhs = optimizeExpr(this.rhs, names, constants20);
5807
5807
  return this;
5808
5808
  }
5809
5809
  get names() {
@@ -5869,8 +5869,8 @@ var require_codegen = __commonJS((exports) => {
5869
5869
  optimizeNodes() {
5870
5870
  return `${this.code}` ? this : undefined;
5871
5871
  }
5872
- optimizeNames(names, constants19) {
5873
- this.code = optimizeExpr(this.code, names, constants19);
5872
+ optimizeNames(names, constants20) {
5873
+ this.code = optimizeExpr(this.code, names, constants20);
5874
5874
  return this;
5875
5875
  }
5876
5876
  get names() {
@@ -5900,12 +5900,12 @@ var require_codegen = __commonJS((exports) => {
5900
5900
  }
5901
5901
  return nodes.length > 0 ? this : undefined;
5902
5902
  }
5903
- optimizeNames(names, constants19) {
5903
+ optimizeNames(names, constants20) {
5904
5904
  const { nodes } = this;
5905
5905
  let i2 = nodes.length;
5906
5906
  while (i2--) {
5907
5907
  const n = nodes[i2];
5908
- if (n.optimizeNames(names, constants19))
5908
+ if (n.optimizeNames(names, constants20))
5909
5909
  continue;
5910
5910
  subtractNames(names, n.names);
5911
5911
  nodes.splice(i2, 1);
@@ -5962,12 +5962,12 @@ var require_codegen = __commonJS((exports) => {
5962
5962
  return;
5963
5963
  return this;
5964
5964
  }
5965
- optimizeNames(names, constants19) {
5965
+ optimizeNames(names, constants20) {
5966
5966
  var _a2;
5967
- this.else = (_a2 = this.else) === null || _a2 === undefined ? undefined : _a2.optimizeNames(names, constants19);
5968
- if (!(super.optimizeNames(names, constants19) || this.else))
5967
+ this.else = (_a2 = this.else) === null || _a2 === undefined ? undefined : _a2.optimizeNames(names, constants20);
5968
+ if (!(super.optimizeNames(names, constants20) || this.else))
5969
5969
  return;
5970
- this.condition = optimizeExpr(this.condition, names, constants19);
5970
+ this.condition = optimizeExpr(this.condition, names, constants20);
5971
5971
  return this;
5972
5972
  }
5973
5973
  get names() {
@@ -5992,10 +5992,10 @@ var require_codegen = __commonJS((exports) => {
5992
5992
  render(opts) {
5993
5993
  return `for(${this.iteration})` + super.render(opts);
5994
5994
  }
5995
- optimizeNames(names, constants19) {
5996
- if (!super.optimizeNames(names, constants19))
5995
+ optimizeNames(names, constants20) {
5996
+ if (!super.optimizeNames(names, constants20))
5997
5997
  return;
5998
- this.iteration = optimizeExpr(this.iteration, names, constants19);
5998
+ this.iteration = optimizeExpr(this.iteration, names, constants20);
5999
5999
  return this;
6000
6000
  }
6001
6001
  get names() {
@@ -6033,10 +6033,10 @@ var require_codegen = __commonJS((exports) => {
6033
6033
  render(opts) {
6034
6034
  return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts);
6035
6035
  }
6036
- optimizeNames(names, constants19) {
6037
- if (!super.optimizeNames(names, constants19))
6036
+ optimizeNames(names, constants20) {
6037
+ if (!super.optimizeNames(names, constants20))
6038
6038
  return;
6039
- this.iterable = optimizeExpr(this.iterable, names, constants19);
6039
+ this.iterable = optimizeExpr(this.iterable, names, constants20);
6040
6040
  return this;
6041
6041
  }
6042
6042
  get names() {
@@ -6081,11 +6081,11 @@ var require_codegen = __commonJS((exports) => {
6081
6081
  (_b = this.finally) === null || _b === undefined || _b.optimizeNodes();
6082
6082
  return this;
6083
6083
  }
6084
- optimizeNames(names, constants19) {
6084
+ optimizeNames(names, constants20) {
6085
6085
  var _a2, _b;
6086
- super.optimizeNames(names, constants19);
6087
- (_a2 = this.catch) === null || _a2 === undefined || _a2.optimizeNames(names, constants19);
6088
- (_b = this.finally) === null || _b === undefined || _b.optimizeNames(names, constants19);
6086
+ super.optimizeNames(names, constants20);
6087
+ (_a2 = this.catch) === null || _a2 === undefined || _a2.optimizeNames(names, constants20);
6088
+ (_b = this.finally) === null || _b === undefined || _b.optimizeNames(names, constants20);
6089
6089
  return this;
6090
6090
  }
6091
6091
  get names() {
@@ -6359,7 +6359,7 @@ var require_codegen = __commonJS((exports) => {
6359
6359
  function addExprNames(names, from) {
6360
6360
  return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names;
6361
6361
  }
6362
- function optimizeExpr(expr, names, constants19) {
6362
+ function optimizeExpr(expr, names, constants20) {
6363
6363
  if (expr instanceof code_1.Name)
6364
6364
  return replaceName(expr);
6365
6365
  if (!canOptimize(expr))
@@ -6374,14 +6374,14 @@ var require_codegen = __commonJS((exports) => {
6374
6374
  return items;
6375
6375
  }, []));
6376
6376
  function replaceName(n) {
6377
- const c = constants19[n.str];
6377
+ const c = constants20[n.str];
6378
6378
  if (c === undefined || names[n.str] !== 1)
6379
6379
  return n;
6380
6380
  delete names[n.str];
6381
6381
  return c;
6382
6382
  }
6383
6383
  function canOptimize(e) {
6384
- return e instanceof code_1._Code && e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants19[c.str] !== undefined);
6384
+ return e instanceof code_1._Code && e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants20[c.str] !== undefined);
6385
6385
  }
6386
6386
  }
6387
6387
  function subtractNames(names, from) {
@@ -15599,14 +15599,28 @@ function createDynamicTruncator(ctx, modelCacheState) {
15599
15599
  // src/shared/data-path.ts
15600
15600
  import * as path2 from "path";
15601
15601
  import * as os2 from "os";
15602
+ import { accessSync, constants, mkdirSync } from "fs";
15603
+ function resolveWritableDirectory(preferredDir, fallbackSuffix) {
15604
+ try {
15605
+ mkdirSync(preferredDir, { recursive: true });
15606
+ accessSync(preferredDir, constants.W_OK);
15607
+ return preferredDir;
15608
+ } catch {
15609
+ const fallbackDir = path2.join(os2.tmpdir(), fallbackSuffix);
15610
+ mkdirSync(fallbackDir, { recursive: true });
15611
+ return fallbackDir;
15612
+ }
15613
+ }
15602
15614
  function getDataDir() {
15603
- return process.env.XDG_DATA_HOME ?? path2.join(os2.homedir(), ".local", "share");
15615
+ const preferredDir = process.env.XDG_DATA_HOME ?? path2.join(os2.homedir(), ".local", "share");
15616
+ return resolveWritableDirectory(preferredDir, "opencode-data");
15604
15617
  }
15605
15618
  function getOpenCodeStorageDir() {
15606
15619
  return path2.join(getDataDir(), "opencode", "storage");
15607
15620
  }
15608
15621
  function getCacheDir() {
15609
- return process.env.XDG_CACHE_HOME ?? path2.join(os2.homedir(), ".cache");
15622
+ const preferredDir = process.env.XDG_CACHE_HOME ?? path2.join(os2.homedir(), ".cache");
15623
+ return resolveWritableDirectory(preferredDir, "opencode-cache");
15610
15624
  }
15611
15625
  function getOmoOpenCodeCacheDir() {
15612
15626
  return path2.join(getCacheDir(), "oh-my-opencode");
@@ -17095,7 +17109,7 @@ async function extractZip(archivePath, destDir) {
17095
17109
  }
17096
17110
  }
17097
17111
  // src/shared/binary-downloader.ts
17098
- import { chmodSync, existsSync as existsSync7, mkdirSync, unlinkSync } from "fs";
17112
+ import { chmodSync, existsSync as existsSync7, mkdirSync as mkdirSync2, unlinkSync } from "fs";
17099
17113
  import * as path4 from "path";
17100
17114
  var {spawn: spawn3 } = globalThis.Bun;
17101
17115
  function getCachedBinaryPath(cacheDir, binaryName) {
@@ -17104,7 +17118,7 @@ function getCachedBinaryPath(cacheDir, binaryName) {
17104
17118
  }
17105
17119
  function ensureCacheDir(cacheDir) {
17106
17120
  if (!existsSync7(cacheDir)) {
17107
- mkdirSync(cacheDir, { recursive: true });
17121
+ mkdirSync2(cacheDir, { recursive: true });
17108
17122
  }
17109
17123
  }
17110
17124
  async function downloadArchive(downloadUrl, archivePath) {
@@ -17631,7 +17645,7 @@ init_logger();
17631
17645
 
17632
17646
  // src/shared/connected-providers-cache.ts
17633
17647
  init_logger();
17634
- import { existsSync as existsSync8, readFileSync as readFileSync4, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "fs";
17648
+ import { existsSync as existsSync8, readFileSync as readFileSync4, writeFileSync as writeFileSync2, mkdirSync as mkdirSync3 } from "fs";
17635
17649
  import { join as join10 } from "path";
17636
17650
  var CONNECTED_PROVIDERS_CACHE_FILE = "connected-providers.json";
17637
17651
  var PROVIDER_MODELS_CACHE_FILE = "provider-models.json";
@@ -17644,7 +17658,7 @@ function createConnectedProvidersCacheStore(getCacheDir2 = getOmoOpenCodeCacheDi
17644
17658
  function ensureCacheDir2() {
17645
17659
  const cacheDir = getCacheDir2();
17646
17660
  if (!existsSync8(cacheDir)) {
17647
- mkdirSync2(cacheDir, { recursive: true });
17661
+ mkdirSync3(cacheDir, { recursive: true });
17648
17662
  }
17649
17663
  }
17650
17664
  function readConnectedProvidersCache() {
@@ -18247,7 +18261,7 @@ function isAnyProviderConnected(providers, availableModels) {
18247
18261
  return false;
18248
18262
  }
18249
18263
  // src/features/hook-message-injector/injector.ts
18250
- import { existsSync as existsSync10, mkdirSync as mkdirSync3, readFileSync as readFileSync6, readdirSync, writeFileSync as writeFileSync3 } from "fs";
18264
+ import { existsSync as existsSync10, mkdirSync as mkdirSync4, readFileSync as readFileSync6, readdirSync, writeFileSync as writeFileSync3 } from "fs";
18251
18265
  import { randomBytes } from "crypto";
18252
18266
  import { join as join12 } from "path";
18253
18267
  init_logger();
@@ -20103,7 +20117,7 @@ var FAILURE_RESET_WINDOW_MS = 5 * 60 * 1000;
20103
20117
  // src/features/run-continuation-state/constants.ts
20104
20118
  var CONTINUATION_MARKER_DIR = ".sisyphus/run-continuation";
20105
20119
  // src/features/run-continuation-state/storage.ts
20106
- import { existsSync as existsSync18, mkdirSync as mkdirSync4, readFileSync as readFileSync13, rmSync, writeFileSync as writeFileSync4 } from "fs";
20120
+ import { existsSync as existsSync18, mkdirSync as mkdirSync5, readFileSync as readFileSync13, rmSync, writeFileSync as writeFileSync4 } from "fs";
20107
20121
  import { join as join22 } from "path";
20108
20122
  function getMarkerPath(directory, sessionID) {
20109
20123
  return join22(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
@@ -20138,7 +20152,7 @@ function setContinuationMarkerSource(directory, sessionID, source, state, reason
20138
20152
  }
20139
20153
  };
20140
20154
  const markerPath = getMarkerPath(directory, sessionID);
20141
- mkdirSync4(join22(directory, CONTINUATION_MARKER_DIR), { recursive: true });
20155
+ mkdirSync5(join22(directory, CONTINUATION_MARKER_DIR), { recursive: true });
20142
20156
  writeFileSync4(markerPath, JSON.stringify(next, null, 2), "utf-8");
20143
20157
  return next;
20144
20158
  }
@@ -21754,7 +21768,7 @@ function messageHasContent(messageID) {
21754
21768
  return parts.some(hasContent);
21755
21769
  }
21756
21770
  // src/hooks/session-recovery/storage/text-part-injector.ts
21757
- import { existsSync as existsSync21, mkdirSync as mkdirSync5, writeFileSync as writeFileSync5 } from "fs";
21771
+ import { existsSync as existsSync21, mkdirSync as mkdirSync6, writeFileSync as writeFileSync5 } from "fs";
21758
21772
  import { join as join25 } from "path";
21759
21773
  function injectTextPart(sessionID, messageID, text) {
21760
21774
  if (isSqliteBackend()) {
@@ -21763,7 +21777,7 @@ function injectTextPart(sessionID, messageID, text) {
21763
21777
  }
21764
21778
  const partDir = join25(PART_STORAGE, messageID);
21765
21779
  if (!existsSync21(partDir)) {
21766
- mkdirSync5(partDir, { recursive: true });
21780
+ mkdirSync6(partDir, { recursive: true });
21767
21781
  }
21768
21782
  const partId = generatePartId();
21769
21783
  const part = {
@@ -21940,7 +21954,7 @@ function findMessageByIndexNeedingThinking(sessionID, targetIndex) {
21940
21954
  return firstIsThinking ? null : targetMessage.id;
21941
21955
  }
21942
21956
  // src/hooks/session-recovery/storage/thinking-prepend.ts
21943
- import { existsSync as existsSync23, mkdirSync as mkdirSync6, writeFileSync as writeFileSync7 } from "fs";
21957
+ import { existsSync as existsSync23, mkdirSync as mkdirSync7, writeFileSync as writeFileSync7 } from "fs";
21944
21958
  import { join as join27 } from "path";
21945
21959
  var thinkingPrependDeps = {
21946
21960
  isSqliteBackend,
@@ -22025,7 +22039,7 @@ function prependThinkingPart(sessionID, messageID, deps = thinkingPrependDeps) {
22025
22039
  }
22026
22040
  const partDir = join27(PART_STORAGE, messageID);
22027
22041
  if (!existsSync23(partDir)) {
22028
- mkdirSync6(partDir, { recursive: true });
22042
+ mkdirSync7(partDir, { recursive: true });
22029
22043
  }
22030
22044
  try {
22031
22045
  writeFileSync7(join27(partDir, `${previousThinkingPart.id}.json`), JSON.stringify(previousThinkingPart, null, 2));
@@ -36074,16 +36088,16 @@ import { createRequire as createRequire2 } from "module";
36074
36088
  import { dirname as dirname2, join as join30 } from "path";
36075
36089
  import { existsSync as existsSync26 } from "fs";
36076
36090
  import * as fs5 from "fs";
36077
- import { tmpdir as tmpdir3 } from "os";
36091
+ import { tmpdir as tmpdir4 } from "os";
36078
36092
 
36079
36093
  // src/hooks/comment-checker/downloader.ts
36080
36094
  import { existsSync as existsSync25, appendFileSync as appendFileSync2 } from "fs";
36081
36095
  import { join as join29 } from "path";
36082
- import { homedir as homedir7, tmpdir as tmpdir2 } from "os";
36096
+ import { homedir as homedir7, tmpdir as tmpdir3 } from "os";
36083
36097
  import { createRequire } from "module";
36084
36098
  init_logger();
36085
36099
  var DEBUG = process.env.COMMENT_CHECKER_DEBUG === "1";
36086
- var DEBUG_FILE = join29(tmpdir2(), "comment-checker-debug.log");
36100
+ var DEBUG_FILE = join29(tmpdir3(), "comment-checker-debug.log");
36087
36101
  function debugLog(...args) {
36088
36102
  if (DEBUG) {
36089
36103
  const msg = `[${new Date().toISOString()}] [comment-checker:downloader] ${args.map((a) => typeof a === "object" ? JSON.stringify(a, null, 2) : String(a)).join(" ")}
@@ -36178,7 +36192,7 @@ async function ensureCommentCheckerBinary() {
36178
36192
 
36179
36193
  // src/hooks/comment-checker/cli.ts
36180
36194
  var DEBUG2 = process.env.COMMENT_CHECKER_DEBUG === "1";
36181
- var DEBUG_FILE2 = join30(tmpdir3(), "comment-checker-debug.log");
36195
+ var DEBUG_FILE2 = join30(tmpdir4(), "comment-checker-debug.log");
36182
36196
  function debugLog2(...args) {
36183
36197
  if (DEBUG2) {
36184
36198
  const msg = `[${new Date().toISOString()}] [comment-checker:cli] ${args.map((a) => typeof a === "object" ? JSON.stringify(a, null, 2) : String(a)).join(" ")}
@@ -36459,7 +36473,7 @@ function takePendingCall(callID) {
36459
36473
 
36460
36474
  // src/hooks/comment-checker/hook.ts
36461
36475
  import * as fs6 from "fs";
36462
- import { tmpdir as tmpdir4 } from "os";
36476
+ import { tmpdir as tmpdir5 } from "os";
36463
36477
  import { join as join31 } from "path";
36464
36478
  var ApplyPatchMetadataSchema = zod_default.object({
36465
36479
  files: zod_default.array(zod_default.object({
@@ -36471,7 +36485,7 @@ var ApplyPatchMetadataSchema = zod_default.object({
36471
36485
  }))
36472
36486
  });
36473
36487
  var DEBUG3 = process.env.COMMENT_CHECKER_DEBUG === "1";
36474
- var DEBUG_FILE3 = join31(tmpdir4(), "comment-checker-debug.log");
36488
+ var DEBUG_FILE3 = join31(tmpdir5(), "comment-checker-debug.log");
36475
36489
  function debugLog3(...args) {
36476
36490
  if (DEBUG3) {
36477
36491
  const msg = `[${new Date().toISOString()}] [comment-checker:hook] ${args.map((a) => typeof a === "object" ? JSON.stringify(a, null, 2) : String(a)).join(" ")}
@@ -36667,7 +36681,7 @@ function findAgentsMdUp(input) {
36667
36681
  // src/shared/session-injected-paths.ts
36668
36682
  import {
36669
36683
  existsSync as existsSync29,
36670
- mkdirSync as mkdirSync7,
36684
+ mkdirSync as mkdirSync8,
36671
36685
  readFileSync as readFileSync18,
36672
36686
  unlinkSync as unlinkSync3,
36673
36687
  writeFileSync as writeFileSync8
@@ -36689,7 +36703,7 @@ function createInjectedPathsStorage(storageDir) {
36689
36703
  };
36690
36704
  const saveInjectedPaths = (sessionID, paths) => {
36691
36705
  if (!existsSync29(storageDir)) {
36692
- mkdirSync7(storageDir, { recursive: true });
36706
+ mkdirSync8(storageDir, { recursive: true });
36693
36707
  }
36694
36708
  const data = {
36695
36709
  sessionID,
@@ -38958,11 +38972,15 @@ function getNextFallback2(sessionID) {
38958
38972
  const { fallbackChain } = state3;
38959
38973
  const providerModelsCache = readProviderModelsCache();
38960
38974
  const connectedProviders = providerModelsCache?.connected ?? readConnectedProvidersCache();
38961
- const connectedSet = connectedProviders ? new Set(connectedProviders) : null;
38975
+ const connectedSet = connectedProviders ? new Set(connectedProviders.map((provider) => provider.toLowerCase())) : null;
38962
38976
  const isReachable = (entry) => {
38963
38977
  if (!connectedSet)
38964
38978
  return true;
38965
- return entry.providers.some((p) => connectedSet.has(p));
38979
+ if (entry.providers.some((provider) => connectedSet.has(provider.toLowerCase()))) {
38980
+ return true;
38981
+ }
38982
+ const preferredProvider = state3.providerID.toLowerCase();
38983
+ return connectedSet.has(preferredProvider);
38966
38984
  };
38967
38985
  while (state3.attemptCount < fallbackChain.length) {
38968
38986
  const attemptCount = state3.attemptCount;
@@ -39357,8 +39375,8 @@ ${USER_PROMPT_SUBMIT_TAG_CLOSE}`);
39357
39375
 
39358
39376
  // src/hooks/claude-code-hooks/transcript.ts
39359
39377
  import { join as join42 } from "path";
39360
- import { mkdirSync as mkdirSync8, appendFileSync as appendFileSync5, existsSync as existsSync36, writeFileSync as writeFileSync10, unlinkSync as unlinkSync4 } from "fs";
39361
- import { tmpdir as tmpdir5 } from "os";
39378
+ import { mkdirSync as mkdirSync9, appendFileSync as appendFileSync5, existsSync as existsSync36, writeFileSync as writeFileSync10, unlinkSync as unlinkSync4 } from "fs";
39379
+ import { tmpdir as tmpdir6 } from "os";
39362
39380
  import { randomUUID } from "crypto";
39363
39381
  var TRANSCRIPT_DIR = join42(getClaudeConfigDir(), "transcripts");
39364
39382
  function getTranscriptPath(sessionId) {
@@ -39366,7 +39384,7 @@ function getTranscriptPath(sessionId) {
39366
39384
  }
39367
39385
  function ensureTranscriptDir() {
39368
39386
  if (!existsSync36(TRANSCRIPT_DIR)) {
39369
- mkdirSync8(TRANSCRIPT_DIR, { recursive: true });
39387
+ mkdirSync9(TRANSCRIPT_DIR, { recursive: true });
39370
39388
  }
39371
39389
  }
39372
39390
  function appendTranscriptEntry(sessionId, entry) {
@@ -39448,7 +39466,7 @@ async function buildTranscriptFromSession(client, sessionId, directory, currentT
39448
39466
  });
39449
39467
  }
39450
39468
  const allEntries = [...baseEntries, buildCurrentEntry(currentToolName, currentToolInput)];
39451
- const tempPath = join42(tmpdir5(), `opencode-transcript-${sessionId}-${randomUUID()}.jsonl`);
39469
+ const tempPath = join42(tmpdir6(), `opencode-transcript-${sessionId}-${randomUUID()}.jsonl`);
39452
39470
  writeFileSync10(tempPath, allEntries.join(`
39453
39471
  `) + `
39454
39472
  `);
@@ -39459,7 +39477,7 @@ async function buildTranscriptFromSession(client, sessionId, directory, currentT
39459
39477
  return tempPath;
39460
39478
  } catch {
39461
39479
  try {
39462
- const tempPath = join42(tmpdir5(), `opencode-transcript-${sessionId}-${randomUUID()}.jsonl`);
39480
+ const tempPath = join42(tmpdir6(), `opencode-transcript-${sessionId}-${randomUUID()}.jsonl`);
39463
39481
  writeFileSync10(tempPath, buildCurrentEntry(currentToolName, currentToolInput) + `
39464
39482
  `);
39465
39483
  return tempPath;
@@ -40301,7 +40319,7 @@ function getRuleInjectionFilePath(output) {
40301
40319
  // src/hooks/rules-injector/storage.ts
40302
40320
  import {
40303
40321
  existsSync as existsSync37,
40304
- mkdirSync as mkdirSync9,
40322
+ mkdirSync as mkdirSync10,
40305
40323
  readFileSync as readFileSync24,
40306
40324
  writeFileSync as writeFileSync11,
40307
40325
  unlinkSync as unlinkSync5
@@ -40353,7 +40371,7 @@ function loadInjectedRules(sessionID) {
40353
40371
  }
40354
40372
  function saveInjectedRules(sessionID, data) {
40355
40373
  if (!existsSync37(RULES_INJECTOR_STORAGE)) {
40356
- mkdirSync9(RULES_INJECTOR_STORAGE, { recursive: true });
40374
+ mkdirSync10(RULES_INJECTOR_STORAGE, { recursive: true });
40357
40375
  }
40358
40376
  const storageData = {
40359
40377
  sessionID,
@@ -41652,7 +41670,7 @@ v${latestVersion} available. Restart OpenCode to apply.` : "OpenCode is now on S
41652
41670
  // src/hooks/agent-usage-reminder/storage.ts
41653
41671
  import {
41654
41672
  existsSync as existsSync49,
41655
- mkdirSync as mkdirSync10,
41673
+ mkdirSync as mkdirSync11,
41656
41674
  readFileSync as readFileSync33,
41657
41675
  writeFileSync as writeFileSync14,
41658
41676
  unlinkSync as unlinkSync8
@@ -41722,7 +41740,7 @@ function loadAgentUsageState(sessionID) {
41722
41740
  }
41723
41741
  function saveAgentUsageState(state3) {
41724
41742
  if (!existsSync49(AGENT_USAGE_REMINDER_STORAGE)) {
41725
- mkdirSync10(AGENT_USAGE_REMINDER_STORAGE, { recursive: true });
41743
+ mkdirSync11(AGENT_USAGE_REMINDER_STORAGE, { recursive: true });
41726
41744
  }
41727
41745
  const filePath = getStoragePath2(state3.sessionID);
41728
41746
  writeFileSync14(filePath, JSON.stringify(state3, null, 2));
@@ -43004,7 +43022,7 @@ function createNonInteractiveEnvHook(_ctx) {
43004
43022
  // src/hooks/interactive-bash-session/storage.ts
43005
43023
  import {
43006
43024
  existsSync as existsSync50,
43007
- mkdirSync as mkdirSync11,
43025
+ mkdirSync as mkdirSync12,
43008
43026
  readFileSync as readFileSync34,
43009
43027
  writeFileSync as writeFileSync15,
43010
43028
  unlinkSync as unlinkSync9
@@ -43045,7 +43063,7 @@ function loadInteractiveBashSessionState(sessionID) {
43045
43063
  }
43046
43064
  function saveInteractiveBashSessionState(state3) {
43047
43065
  if (!existsSync50(INTERACTIVE_BASH_SESSION_STORAGE)) {
43048
- mkdirSync11(INTERACTIVE_BASH_SESSION_STORAGE, { recursive: true });
43066
+ mkdirSync12(INTERACTIVE_BASH_SESSION_STORAGE, { recursive: true });
43049
43067
  }
43050
43068
  const filePath = getStoragePath3(state3.sessionID);
43051
43069
  const serialized = {
@@ -43453,7 +43471,7 @@ var DEFAULT_MAX_ITERATIONS = 100;
43453
43471
  var DEFAULT_COMPLETION_PROMISE = "DONE";
43454
43472
  var ULTRAWORK_VERIFICATION_PROMISE = "VERIFIED";
43455
43473
  // src/hooks/ralph-loop/storage.ts
43456
- import { existsSync as existsSync51, readFileSync as readFileSync35, writeFileSync as writeFileSync16, unlinkSync as unlinkSync10, mkdirSync as mkdirSync12 } from "fs";
43474
+ import { existsSync as existsSync51, readFileSync as readFileSync35, writeFileSync as writeFileSync16, unlinkSync as unlinkSync10, mkdirSync as mkdirSync13 } from "fs";
43457
43475
  import { dirname as dirname11, join as join59 } from "path";
43458
43476
  function getStateFilePath(directory, customPath) {
43459
43477
  return customPath ? join59(directory, customPath) : join59(directory, DEFAULT_STATE_FILE);
@@ -43507,7 +43525,7 @@ function writeState(directory, state3, customPath) {
43507
43525
  try {
43508
43526
  const dir = dirname11(filePath);
43509
43527
  if (!existsSync51(dir)) {
43510
- mkdirSync12(dir, { recursive: true });
43528
+ mkdirSync13(dir, { recursive: true });
43511
43529
  }
43512
43530
  const sessionIdLine = state3.session_id ? `session_id: "${state3.session_id}"
43513
43531
  ` : "";
@@ -50003,7 +50021,7 @@ var NOTEPAD_DIR = "notepads";
50003
50021
  var NOTEPAD_BASE_PATH = `${BOULDER_DIR}/${NOTEPAD_DIR}`;
50004
50022
  var PROMETHEUS_PLANS_DIR = ".sisyphus/plans";
50005
50023
  // src/features/boulder-state/storage.ts
50006
- import { existsSync as existsSync55, readFileSync as readFileSync40, writeFileSync as writeFileSync17, mkdirSync as mkdirSync13, readdirSync as readdirSync16 } from "fs";
50024
+ import { existsSync as existsSync55, readFileSync as readFileSync40, writeFileSync as writeFileSync17, mkdirSync as mkdirSync14, readdirSync as readdirSync16 } from "fs";
50007
50025
  import { dirname as dirname15, join as join65, basename as basename6 } from "path";
50008
50026
  var RESERVED_KEYS = new Set(["__proto__", "prototype", "constructor"]);
50009
50027
  function getBoulderFilePath(directory) {
@@ -50036,7 +50054,7 @@ function writeBoulderState(directory, state3) {
50036
50054
  try {
50037
50055
  const dir = dirname15(filePath);
50038
50056
  if (!existsSync55(dir)) {
50039
- mkdirSync13(dir, { recursive: true });
50057
+ mkdirSync14(dir, { recursive: true });
50040
50058
  }
50041
50059
  writeFileSync17(filePath, JSON.stringify(state3, null, 2), "utf-8");
50042
50060
  return true;
@@ -55685,7 +55703,7 @@ function createWebFetchRedirectGuardHook(_ctx) {
55685
55703
  };
55686
55704
  }
55687
55705
  // src/hooks/anthropic-effort/hook.ts
55688
- var OPUS_4_6_PATTERN = /claude-opus-4[-.]6/i;
55706
+ var OPUS_PATTERN = /claude-opus/i;
55689
55707
  function isClaudeProvider(providerID, modelID) {
55690
55708
  if (["anthropic", "google-vertex-anthropic", "opencode"].includes(providerID))
55691
55709
  return true;
@@ -55693,9 +55711,18 @@ function isClaudeProvider(providerID, modelID) {
55693
55711
  return true;
55694
55712
  return false;
55695
55713
  }
55696
- function isOpus46(modelID) {
55714
+ function isOpusModel(modelID) {
55697
55715
  const normalized = normalizeModelID(modelID);
55698
- return OPUS_4_6_PATTERN.test(normalized);
55716
+ return OPUS_PATTERN.test(normalized);
55717
+ }
55718
+ var MAX_VARIANT_BY_TIER = {
55719
+ opus: "max",
55720
+ default: "high"
55721
+ };
55722
+ function clampVariant(variant, isOpus) {
55723
+ if (variant !== "max")
55724
+ return variant;
55725
+ return isOpus ? MAX_VARIANT_BY_TIER.opus : MAX_VARIANT_BY_TIER.default;
55699
55726
  }
55700
55727
  function createAnthropicEffortHook() {
55701
55728
  return {
@@ -55707,16 +55734,25 @@ function createAnthropicEffortHook() {
55707
55734
  return;
55708
55735
  if (!isClaudeProvider(model.providerID, model.modelID))
55709
55736
  return;
55710
- if (!isOpus46(model.modelID))
55711
- return;
55712
55737
  if (output.options.effort !== undefined)
55713
55738
  return;
55714
- output.options.effort = "max";
55715
- log("anthropic-effort: injected effort=max", {
55716
- sessionID: input.sessionID,
55717
- provider: model.providerID,
55718
- model: model.modelID
55719
- });
55739
+ const opus = isOpusModel(model.modelID);
55740
+ const clamped = clampVariant(message.variant, opus);
55741
+ output.options.effort = clamped;
55742
+ if (!opus) {
55743
+ message.variant = clamped;
55744
+ log("anthropic-effort: clamped variant max\u2192high for non-Opus model", {
55745
+ sessionID: input.sessionID,
55746
+ provider: model.providerID,
55747
+ model: model.modelID
55748
+ });
55749
+ } else {
55750
+ log("anthropic-effort: injected effort=max", {
55751
+ sessionID: input.sessionID,
55752
+ provider: model.providerID,
55753
+ model: model.modelID
55754
+ });
55755
+ }
55720
55756
  }
55721
55757
  };
55722
55758
  }
@@ -73724,7 +73760,7 @@ async function resolveMultimodalLookerAgentMetadata(ctx) {
73724
73760
  // src/tools/look-at/image-converter.ts
73725
73761
  import { execFileSync as execFileSync3 } from "child_process";
73726
73762
  import { existsSync as existsSync72, mkdtempSync, readFileSync as readFileSync47, rmSync as rmSync3, unlinkSync as unlinkSync11, writeFileSync as writeFileSync19 } from "fs";
73727
- import { tmpdir as tmpdir6 } from "os";
73763
+ import { tmpdir as tmpdir7 } from "os";
73728
73764
  import { dirname as dirname21, join as join78 } from "path";
73729
73765
  var SUPPORTED_FORMATS = new Set([
73730
73766
  "image/jpeg",
@@ -73766,7 +73802,7 @@ function convertImageToJpeg(inputPath, mimeType) {
73766
73802
  if (!existsSync72(inputPath)) {
73767
73803
  throw new Error(`File not found: ${inputPath}`);
73768
73804
  }
73769
- const tempDir = mkdtempSync(join78(tmpdir6(), "opencode-img-"));
73805
+ const tempDir = mkdtempSync(join78(tmpdir7(), "opencode-img-"));
73770
73806
  const outputPath = join78(tempDir, "converted.jpg");
73771
73807
  log(`[image-converter] Converting ${mimeType} to JPEG: ${inputPath}`);
73772
73808
  try {
@@ -73832,7 +73868,7 @@ function cleanupConvertedImage(filePath) {
73832
73868
  }
73833
73869
  }
73834
73870
  function convertBase64ImageToJpeg(base64Data, mimeType) {
73835
- const tempDir = mkdtempSync(join78(tmpdir6(), "opencode-b64-"));
73871
+ const tempDir = mkdtempSync(join78(tmpdir7(), "opencode-b64-"));
73836
73872
  const inputExt = mimeType.split("/")[1] || "bin";
73837
73873
  const inputPath = join78(tempDir, `input.${inputExt}`);
73838
73874
  const tempFiles = [inputPath];
@@ -75043,7 +75079,7 @@ async function sendSyncPrompt(client2, input, deps = sendSyncPromptDeps) {
75043
75079
  const promptArgs = {
75044
75080
  path: { id: input.sessionID },
75045
75081
  body: {
75046
- ...input.categoryModel ? {} : { agent: input.agentToUse },
75082
+ agent: input.agentToUse,
75047
75083
  system: input.systemContent,
75048
75084
  tools,
75049
75085
  parts: [createInternalAgentTextPart(effectivePrompt)],
@@ -75952,7 +75988,7 @@ var TaskDeleteInputSchema = exports_external.object({
75952
75988
 
75953
75989
  // src/features/claude-tasks/storage.ts
75954
75990
  import { join as join79, dirname as dirname22, basename as basename9, isAbsolute as isAbsolute8 } from "path";
75955
- import { existsSync as existsSync73, mkdirSync as mkdirSync14, readFileSync as readFileSync48, writeFileSync as writeFileSync20, renameSync as renameSync2, unlinkSync as unlinkSync12, readdirSync as readdirSync19 } from "fs";
75991
+ import { existsSync as existsSync73, mkdirSync as mkdirSync15, readFileSync as readFileSync48, writeFileSync as writeFileSync20, renameSync as renameSync2, unlinkSync as unlinkSync12, readdirSync as readdirSync19 } from "fs";
75956
75992
  import { randomUUID as randomUUID3 } from "crypto";
75957
75993
  function getTaskDir(config4 = {}) {
75958
75994
  const tasksConfig = config4.sisyphus?.tasks;
@@ -75981,7 +76017,7 @@ function resolveTaskListId(config4 = {}) {
75981
76017
  }
75982
76018
  function ensureDir(dirPath) {
75983
76019
  if (!existsSync73(dirPath)) {
75984
- mkdirSync14(dirPath, { recursive: true });
76020
+ mkdirSync15(dirPath, { recursive: true });
75985
76021
  }
75986
76022
  }
75987
76023
  function readJsonSafe(filePath, schema2) {
@@ -78851,10 +78887,14 @@ function tryFallbackRetry(args) {
78851
78887
  const providerModelsCache = readProviderModelsCache();
78852
78888
  const connectedProviders = providerModelsCache?.connected ?? readConnectedProvidersCache();
78853
78889
  const connectedSet = connectedProviders ? new Set(connectedProviders.map((p) => p.toLowerCase())) : null;
78890
+ const preferredProvider = task.model?.providerID?.toLowerCase();
78854
78891
  const isReachable = (entry) => {
78855
78892
  if (!connectedSet)
78856
78893
  return true;
78857
- return entry.providers.some((p) => connectedSet.has(p.toLowerCase()));
78894
+ if (entry.providers.some((provider) => connectedSet.has(provider.toLowerCase()))) {
78895
+ return true;
78896
+ }
78897
+ return preferredProvider ? connectedSet.has(preferredProvider) : false;
78858
78898
  };
78859
78899
  let selectedAttemptCount = attemptCount;
78860
78900
  let nextFallback;
@@ -79753,7 +79793,7 @@ class BackgroundManager {
79753
79793
  promptWithModelSuggestionRetry(this.client, {
79754
79794
  path: { id: sessionID },
79755
79795
  body: {
79756
- ...launchModel ? {} : { agent: input.agent },
79796
+ agent: input.agent,
79757
79797
  ...launchModel ? { model: launchModel } : {},
79758
79798
  ...launchVariant ? { variant: launchVariant } : {},
79759
79799
  system: input.skillContent,
@@ -79967,7 +80007,7 @@ class BackgroundManager {
79967
80007
  this.client.session.promptAsync({
79968
80008
  path: { id: existingTask.sessionID },
79969
80009
  body: {
79970
- ...resumeModel ? {} : { agent: existingTask.agent },
80010
+ agent: existingTask.agent,
79971
80011
  ...resumeModel ? { model: resumeModel } : {},
79972
80012
  ...resumeVariant ? { variant: resumeVariant } : {},
79973
80013
  tools: (() => {
@@ -84718,7 +84758,7 @@ class StreamableHTTPClientTransport {
84718
84758
  }
84719
84759
 
84720
84760
  // src/features/mcp-oauth/storage.ts
84721
- import { chmodSync as chmodSync2, existsSync as existsSync75, mkdirSync as mkdirSync15, readFileSync as readFileSync50, unlinkSync as unlinkSync13, writeFileSync as writeFileSync21 } from "fs";
84761
+ import { chmodSync as chmodSync2, existsSync as existsSync75, mkdirSync as mkdirSync16, readFileSync as readFileSync50, unlinkSync as unlinkSync13, writeFileSync as writeFileSync21 } from "fs";
84722
84762
  import { dirname as dirname23, join as join86 } from "path";
84723
84763
  var STORAGE_FILE_NAME = "mcp-oauth.json";
84724
84764
  function getMcpOauthStoragePath() {
@@ -84774,7 +84814,7 @@ function writeStore(store2) {
84774
84814
  try {
84775
84815
  const dir = dirname23(filePath);
84776
84816
  if (!existsSync75(dir)) {
84777
- mkdirSync15(dir, { recursive: true });
84817
+ mkdirSync16(dir, { recursive: true });
84778
84818
  }
84779
84819
  writeFileSync21(filePath, JSON.stringify(store2, null, 2), { encoding: "utf-8", mode: 384 });
84780
84820
  chmodSync2(filePath, 384);
@@ -96283,10 +96323,12 @@ async function buildPrometheusAgentConfig(params) {
96283
96323
  const availableModels = await fetchAvailableModels(undefined, {
96284
96324
  connectedProviders: connectedProviders ?? undefined
96285
96325
  });
96326
+ const configuredPrometheusModel = params.pluginPrometheusOverride?.model ?? categoryConfig?.model;
96286
96327
  const modelResolution = resolveModelPipeline({
96287
96328
  intent: {
96288
- uiSelectedModel: params.currentModel,
96289
- userModel: params.pluginPrometheusOverride?.model ?? categoryConfig?.model
96329
+ uiSelectedModel: configuredPrometheusModel ? undefined : params.currentModel,
96330
+ userModel: params.pluginPrometheusOverride?.model,
96331
+ categoryDefaultModel: categoryConfig?.model
96290
96332
  },
96291
96333
  constraints: { availableModels },
96292
96334
  policy: {
@@ -97363,7 +97405,9 @@ function buildChatParamsInput(raw) {
97363
97405
  agent: { name: agentName },
97364
97406
  model: { providerID, modelID },
97365
97407
  provider: { id: providerId },
97366
- message: typeof variant === "string" ? { variant } : {}
97408
+ message,
97409
+ rawMessage: message,
97410
+ ...typeof variant === "string" ? {} : {}
97367
97411
  };
97368
97412
  }
97369
97413
  function isChatParamsOutput(raw) {
@@ -14,6 +14,9 @@ export type ChatParamsInput = {
14
14
  variant?: string;
15
15
  };
16
16
  };
17
+ type ChatParamsHookInput = ChatParamsInput & {
18
+ rawMessage?: Record<string, unknown>;
19
+ };
17
20
  export type ChatParamsOutput = {
18
21
  temperature?: number;
19
22
  topP?: number;
@@ -22,6 +25,7 @@ export type ChatParamsOutput = {
22
25
  };
23
26
  export declare function createChatParamsHandler(args: {
24
27
  anthropicEffort: {
25
- "chat.params"?: (input: ChatParamsInput, output: ChatParamsOutput) => Promise<void>;
28
+ "chat.params"?: (input: ChatParamsHookInput, output: ChatParamsOutput) => Promise<void>;
26
29
  } | null;
27
30
  }): (input: unknown, output: unknown) => Promise<void>;
31
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-opencode",
3
- "version": "3.13.0",
3
+ "version": "3.13.1",
4
4
  "description": "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -76,17 +76,17 @@
76
76
  "typescript": "^5.7.3"
77
77
  },
78
78
  "optionalDependencies": {
79
- "oh-my-opencode-darwin-arm64": "3.13.0",
80
- "oh-my-opencode-darwin-x64": "3.13.0",
81
- "oh-my-opencode-darwin-x64-baseline": "3.13.0",
82
- "oh-my-opencode-linux-arm64": "3.13.0",
83
- "oh-my-opencode-linux-arm64-musl": "3.13.0",
84
- "oh-my-opencode-linux-x64": "3.13.0",
85
- "oh-my-opencode-linux-x64-baseline": "3.13.0",
86
- "oh-my-opencode-linux-x64-musl": "3.13.0",
87
- "oh-my-opencode-linux-x64-musl-baseline": "3.13.0",
88
- "oh-my-opencode-windows-x64": "3.13.0",
89
- "oh-my-opencode-windows-x64-baseline": "3.13.0"
79
+ "oh-my-opencode-darwin-arm64": "3.13.1",
80
+ "oh-my-opencode-darwin-x64": "3.13.1",
81
+ "oh-my-opencode-darwin-x64-baseline": "3.13.1",
82
+ "oh-my-opencode-linux-arm64": "3.13.1",
83
+ "oh-my-opencode-linux-arm64-musl": "3.13.1",
84
+ "oh-my-opencode-linux-x64": "3.13.1",
85
+ "oh-my-opencode-linux-x64-baseline": "3.13.1",
86
+ "oh-my-opencode-linux-x64-musl": "3.13.1",
87
+ "oh-my-opencode-linux-x64-musl-baseline": "3.13.1",
88
+ "oh-my-opencode-windows-x64": "3.13.1",
89
+ "oh-my-opencode-windows-x64-baseline": "3.13.1"
90
90
  },
91
91
  "overrides": {
92
92
  "@opencode-ai/sdk": "^1.2.24"