@kl-c/matrixos 0.2.10 → 0.2.12

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.
@@ -2163,7 +2163,7 @@ var package_default;
2163
2163
  var init_package = __esm(() => {
2164
2164
  package_default = {
2165
2165
  name: "@kl-c/matrixos",
2166
- version: "0.2.10",
2166
+ version: "0.2.12",
2167
2167
  description: "MaTrixOS \u2014 Agentic OS for OpenCode. Personalizable, communicating, self-improving, resilient.",
2168
2168
  main: "./dist/index.js",
2169
2169
  types: "dist/index.d.ts",
@@ -67746,10 +67746,12 @@ import {
67746
67746
  symlinkSync,
67747
67747
  readlinkSync,
67748
67748
  readdirSync as readdirSync4,
67749
- unlinkSync as unlinkSync5
67749
+ unlinkSync as unlinkSync5,
67750
+ readFileSync as readFileSync15
67750
67751
  } from "fs";
67751
67752
  import { dirname as dirname9, join as join25 } from "path";
67752
67753
  import { homedir as homedir6 } from "os";
67754
+ import { spawnSync as spawnSync3 } from "child_process";
67753
67755
  function findSlashCommandSource() {
67754
67756
  const candidates = [
67755
67757
  join25(import.meta.dir, "slash-commands"),
@@ -67793,6 +67795,48 @@ function resolveMatrixosBin() {
67793
67795
  }
67794
67796
  return null;
67795
67797
  }
67798
+ function npmGlobalInstallMatrixos(version) {
67799
+ try {
67800
+ const result = spawnSync3("npm", ["install", "-g", `@kl-c/matrixos@${version}`], {
67801
+ stdio: ["ignore", "pipe", "pipe"],
67802
+ shell: false,
67803
+ timeout: 120000
67804
+ });
67805
+ if (result.status !== 0)
67806
+ return null;
67807
+ const found = spawnSync3("command", ["-v", "matrixos"], {
67808
+ stdio: ["ignore", "pipe", "ignore"],
67809
+ shell: false
67810
+ });
67811
+ const bin = found.stdout?.toString().trim();
67812
+ if (bin && existsSync26(bin))
67813
+ return bin;
67814
+ for (const dir of ["/usr/local/bin", "/usr/bin"]) {
67815
+ const p = join25(dir, "matrixos");
67816
+ if (existsSync26(p))
67817
+ return p;
67818
+ }
67819
+ return null;
67820
+ } catch {
67821
+ return null;
67822
+ }
67823
+ }
67824
+ function getPackageVersion() {
67825
+ const candidates = [
67826
+ join25(import.meta.dir, "..", "..", "package.json"),
67827
+ join25(import.meta.dir, "..", "package.json")
67828
+ ];
67829
+ for (const c of candidates) {
67830
+ try {
67831
+ if (!existsSync26(c))
67832
+ continue;
67833
+ const pkg = JSON.parse(readFileSync15(c, "utf-8"));
67834
+ if (pkg.version)
67835
+ return pkg.version;
67836
+ } catch {}
67837
+ }
67838
+ return null;
67839
+ }
67796
67840
  function copyRecursive(from, to) {
67797
67841
  if (!existsSync26(to))
67798
67842
  mkdirSync9(to, { recursive: true });
@@ -67830,6 +67874,11 @@ function installSlashCommandsAndPath() {
67830
67874
  const liveBin = resolveMatrixosBin();
67831
67875
  const linkPath = "/usr/local/bin/matrixos";
67832
67876
  const persistentDir = "/usr/local/lib/matrixos";
67877
+ const version = getPackageVersion();
67878
+ const globalBin = version ? npmGlobalInstallMatrixos(version) : null;
67879
+ if (globalBin) {
67880
+ return { commands: total, pathLinked: true };
67881
+ }
67833
67882
  if (liveBin) {
67834
67883
  try {
67835
67884
  const target = installPackageTo(persistentDir, liveBin) ?? liveBin;
@@ -69704,7 +69753,7 @@ var init_dist5 = __esm(() => {
69704
69753
 
69705
69754
  // packages/omo-opencode/src/cli/config-manager/write-gateway-env.ts
69706
69755
  import { homedir as homedir8 } from "os";
69707
- import { existsSync as existsSync27, mkdirSync as mkdirSync10, readFileSync as readFileSync15, writeFileSync as writeFileSync6, chmodSync as chmodSync3 } from "fs";
69756
+ import { existsSync as existsSync27, mkdirSync as mkdirSync10, readFileSync as readFileSync16, writeFileSync as writeFileSync6, chmodSync as chmodSync3 } from "fs";
69708
69757
  import { join as join27 } from "path";
69709
69758
  function writeGatewayEnvToken(key, token) {
69710
69759
  const configDir = homedir8();
@@ -69713,7 +69762,7 @@ function writeGatewayEnvToken(key, token) {
69713
69762
  const envPath = join27(configDir, GATEWAY_ENV_FILENAME);
69714
69763
  const entries = new Map;
69715
69764
  if (existsSync27(envPath)) {
69716
- const existing = readFileSync15(envPath, "utf-8");
69765
+ const existing = readFileSync16(envPath, "utf-8");
69717
69766
  for (const rawLine of existing.split(`
69718
69767
  `)) {
69719
69768
  const line = rawLine.trim();
@@ -102741,7 +102790,7 @@ var require_Util = __commonJS((exports, module2) => {
102741
102790
  await client3.rest.patch(route, { body: updatedItems, reason });
102742
102791
  return updatedItems;
102743
102792
  }
102744
- function basename6(path7, ext) {
102793
+ function basename5(path7, ext) {
102745
102794
  const res = parse7(path7);
102746
102795
  return ext && res.ext.startsWith(ext) ? res.name : res.base.split("?")[0];
102747
102796
  }
@@ -102864,7 +102913,7 @@ var require_Util = __commonJS((exports, module2) => {
102864
102913
  resolveColor,
102865
102914
  discordSort,
102866
102915
  setPosition,
102867
- basename: basename6,
102916
+ basename: basename5,
102868
102917
  cleanContent,
102869
102918
  cleanCodeBlockContent,
102870
102919
  parseWebhookURL,
@@ -115685,7 +115734,7 @@ var require_MessagePayload = __commonJS((exports, module2) => {
115685
115734
  var { DiscordjsError, DiscordjsRangeError, ErrorCodes } = require_errors();
115686
115735
  var { resolveFile } = require_DataResolver();
115687
115736
  var MessageFlagsBitField = require_MessageFlagsBitField();
115688
- var { basename: basename6, verifyString, resolvePartialEmoji } = require_Util();
115737
+ var { basename: basename5, verifyString, resolvePartialEmoji } = require_Util();
115689
115738
  var getBaseInteraction = lazy2(() => require_BaseInteraction());
115690
115739
 
115691
115740
  class MessagePayload {
@@ -115870,10 +115919,10 @@ var require_MessagePayload = __commonJS((exports, module2) => {
115870
115919
  let name2;
115871
115920
  const findName = (thing) => {
115872
115921
  if (typeof thing === "string") {
115873
- return basename6(thing);
115922
+ return basename5(thing);
115874
115923
  }
115875
115924
  if (thing.path) {
115876
- return basename6(thing.path);
115925
+ return basename5(thing.path);
115877
115926
  }
115878
115927
  return "file.jpg";
115879
115928
  };
@@ -121298,14 +121347,9 @@ var require_ClientVoiceManager = __commonJS((exports, module2) => {
121298
121347
  module2.exports = ClientVoiceManager;
121299
121348
  });
121300
121349
 
121301
- // node_modules/.bun/zlib-sync@0.1.10/node_modules/zlib-sync/build/Release/zlib_sync.node.js
121302
- var require_zlib_sync_node = __commonJS((exports, module2) => {
121303
- module2.exports = { deflateSync: (d) => d, inflateSync: (d) => d };
121304
- });
121305
-
121306
121350
  // node_modules/.bun/@discordjs+ws@1.2.3/node_modules/@discordjs/ws/dist/index.js
121307
121351
  var require_dist9 = __commonJS((exports, module2) => {
121308
- var __dirname = "/home/shiro/MaTrixOS/node_modules/.bun/@discordjs+ws@1.2.3/node_modules/@discordjs/ws/dist";
121352
+ var __dirname = "/root/Projets/MaTrixOS/node_modules/.bun/@discordjs+ws@1.2.3/node_modules/@discordjs/ws/dist";
121309
121353
  var __create2 = Object.create;
121310
121354
  var __defProp2 = Object.defineProperty;
121311
121355
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -121818,7 +121862,7 @@ var require_dist9 = __commonJS((exports, module2) => {
121818
121862
  }
121819
121863
  __name(getInitialSendRateLimitState, "getInitialSendRateLimitState");
121820
121864
  var KnownNetworkErrorCodes = /* @__PURE__ */ new Set(["ECONNRESET", "ECONNREFUSED", "ETIMEDOUT", "EAI_AGAIN"]);
121821
- var getZlibSync = (0, import_util22.lazy)(async () => Promise.resolve().then(() => __toESM(require_zlib_sync_node())).then((mod2) => mod2.default).catch(() => null));
121865
+ var getZlibSync = (0, import_util22.lazy)(async () => import("zlib-sync").then((mod2) => mod2.default).catch(() => null));
121822
121866
  var WebSocketShardEvents = /* @__PURE__ */ ((WebSocketShardEvents2) => {
121823
121867
  WebSocketShardEvents2["Closed"] = "closed";
121824
121868
  WebSocketShardEvents2["Debug"] = "debug";
@@ -123589,7 +123633,7 @@ var require_WebSocketManager = __commonJS((exports, module2) => {
123589
123633
  var zlib;
123590
123634
  var deprecationEmitted = false;
123591
123635
  try {
123592
- zlib = require_zlib_sync_node();
123636
+ zlib = (()=>{throw new Error("Cannot require module "+"zlib-sync");})();
123593
123637
  } catch {}
123594
123638
  var BeforeReadyWhitelist = [
123595
123639
  GatewayDispatchEvents.Ready,
@@ -128251,7 +128295,7 @@ var require_EmbedBuilder = __commonJS((exports, module2) => {
128251
128295
 
128252
128296
  // node_modules/.bun/discord.js@14.27.0/node_modules/discord.js/src/structures/AttachmentBuilder.js
128253
128297
  var require_AttachmentBuilder = __commonJS((exports, module2) => {
128254
- var { basename: basename6, flatten } = require_Util();
128298
+ var { basename: basename5, flatten } = require_Util();
128255
128299
 
128256
128300
  class AttachmentBuilder {
128257
128301
  constructor(attachment, data = {}) {
@@ -128299,7 +128343,7 @@ var require_AttachmentBuilder = __commonJS((exports, module2) => {
128299
128343
  return this;
128300
128344
  }
128301
128345
  get spoiler() {
128302
- return basename6(this.name).startsWith("SPOILER_");
128346
+ return basename5(this.name).startsWith("SPOILER_");
128303
128347
  }
128304
128348
  toJSON() {
128305
128349
  return flatten(this);
@@ -131007,7 +131051,7 @@ var require_dist10 = __commonJS((exports2) => {
131007
131051
 
131008
131052
  // node_modules/.bun/onnxruntime-web@1.14.0/node_modules/onnxruntime-web/dist/ort-web.node.js
131009
131053
  var require_ort_web_node = __commonJS((exports2, module2) => {
131010
- var __dirname = "/home/shiro/MaTrixOS/node_modules/.bun/onnxruntime-web@1.14.0/node_modules/onnxruntime-web/dist", __filename = "/home/shiro/MaTrixOS/node_modules/.bun/onnxruntime-web@1.14.0/node_modules/onnxruntime-web/dist/ort-web.node.js";
131054
+ var __dirname = "/root/Projets/MaTrixOS/node_modules/.bun/onnxruntime-web@1.14.0/node_modules/onnxruntime-web/dist", __filename = "/root/Projets/MaTrixOS/node_modules/.bun/onnxruntime-web@1.14.0/node_modules/onnxruntime-web/dist/ort-web.node.js";
131011
131055
  /*!
131012
131056
  * ONNX Runtime Web v1.14.0
131013
131057
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -154571,7 +154615,7 @@ var require_filesystem = __commonJS((exports2, module2) => {
154571
154615
  var LDD_PATH = "/usr/bin/ldd";
154572
154616
  var SELF_PATH = "/proc/self/exe";
154573
154617
  var MAX_LENGTH = 2048;
154574
- var readFileSync46 = (path18) => {
154618
+ var readFileSync47 = (path18) => {
154575
154619
  const fd = fs18.openSync(path18, "r");
154576
154620
  const buffer = Buffer.alloc(MAX_LENGTH);
154577
154621
  const bytesRead = fs18.readSync(fd, buffer, 0, MAX_LENGTH, 0);
@@ -154594,7 +154638,7 @@ var require_filesystem = __commonJS((exports2, module2) => {
154594
154638
  module2.exports = {
154595
154639
  LDD_PATH,
154596
154640
  SELF_PATH,
154597
- readFileSync: readFileSync46,
154641
+ readFileSync: readFileSync47,
154598
154642
  readFile
154599
154643
  };
154600
154644
  });
@@ -154637,7 +154681,7 @@ var require_elf = __commonJS((exports2, module2) => {
154637
154681
  var require_detect_libc = __commonJS((exports2, module2) => {
154638
154682
  var childProcess = __require("child_process");
154639
154683
  var { isLinux, getReport } = require_process();
154640
- var { LDD_PATH, SELF_PATH, readFile, readFileSync: readFileSync46 } = require_filesystem();
154684
+ var { LDD_PATH, SELF_PATH, readFile, readFileSync: readFileSync47 } = require_filesystem();
154641
154685
  var { interpreterPath } = require_elf();
154642
154686
  var cachedFamilyInterpreter;
154643
154687
  var cachedFamilyFilesystem;
@@ -154728,7 +154772,7 @@ var require_detect_libc = __commonJS((exports2, module2) => {
154728
154772
  }
154729
154773
  cachedFamilyFilesystem = null;
154730
154774
  try {
154731
- const lddContent = readFileSync46(LDD_PATH);
154775
+ const lddContent = readFileSync47(LDD_PATH);
154732
154776
  cachedFamilyFilesystem = getFamilyFromLddContent(lddContent);
154733
154777
  } catch (e) {}
154734
154778
  return cachedFamilyFilesystem;
@@ -154751,7 +154795,7 @@ var require_detect_libc = __commonJS((exports2, module2) => {
154751
154795
  }
154752
154796
  cachedFamilyInterpreter = null;
154753
154797
  try {
154754
- const selfContent = readFileSync46(SELF_PATH);
154798
+ const selfContent = readFileSync47(SELF_PATH);
154755
154799
  const path18 = interpreterPath(selfContent);
154756
154800
  cachedFamilyInterpreter = familyFromInterpreterPath(path18);
154757
154801
  } catch (e) {}
@@ -154813,7 +154857,7 @@ var require_detect_libc = __commonJS((exports2, module2) => {
154813
154857
  }
154814
154858
  cachedVersionFilesystem = null;
154815
154859
  try {
154816
- const lddContent = readFileSync46(LDD_PATH);
154860
+ const lddContent = readFileSync47(LDD_PATH);
154817
154861
  const versionMatch = lddContent.match(RE_GLIBC_VERSION);
154818
154862
  if (versionMatch) {
154819
154863
  cachedVersionFilesystem = versionMatch[1];
@@ -155111,11 +155155,11 @@ var require_package2 = __commonJS((exports2, module2) => {
155111
155155
 
155112
155156
  // node_modules/.bun/sharp@0.32.6/node_modules/sharp/lib/libvips.js
155113
155157
  var require_libvips = __commonJS((exports2, module2) => {
155114
- var __dirname = "/home/shiro/MaTrixOS/node_modules/.bun/sharp@0.32.6/node_modules/sharp/lib";
155158
+ var __dirname = "/root/Projets/MaTrixOS/node_modules/.bun/sharp@0.32.6/node_modules/sharp/lib";
155115
155159
  var fs18 = __require("fs");
155116
155160
  var os7 = __require("os");
155117
155161
  var path18 = __require("path");
155118
- var spawnSync3 = __require("child_process").spawnSync;
155162
+ var spawnSync4 = __require("child_process").spawnSync;
155119
155163
  var semverCoerce = require_coerce();
155120
155164
  var semverGreaterThanOrEqualTo = require_gte();
155121
155165
  var platform = require_platform();
@@ -155156,14 +155200,14 @@ var require_libvips = __commonJS((exports2, module2) => {
155156
155200
  };
155157
155201
  var isRosetta = function() {
155158
155202
  if (process.platform === "darwin" && process.arch === "x64") {
155159
- const translated = spawnSync3("sysctl sysctl.proc_translated", spawnSyncOptions).stdout;
155203
+ const translated = spawnSync4("sysctl sysctl.proc_translated", spawnSyncOptions).stdout;
155160
155204
  return (translated || "").trim() === "sysctl.proc_translated: 1";
155161
155205
  }
155162
155206
  return false;
155163
155207
  };
155164
155208
  var globalLibvipsVersion = function() {
155165
155209
  if (process.platform !== "win32") {
155166
- const globalLibvipsVersion2 = spawnSync3("pkg-config --modversion vips-cpp", {
155210
+ const globalLibvipsVersion2 = spawnSync4("pkg-config --modversion vips-cpp", {
155167
155211
  ...spawnSyncOptions,
155168
155212
  env: {
155169
155213
  ...env4,
@@ -155183,7 +155227,7 @@ var require_libvips = __commonJS((exports2, module2) => {
155183
155227
  };
155184
155228
  var pkgConfigPath = function() {
155185
155229
  if (process.platform !== "win32") {
155186
- const brewPkgConfigPath = spawnSync3('which brew >/dev/null 2>&1 && brew environment --plain | grep PKG_CONFIG_LIBDIR | cut -d" " -f2', spawnSyncOptions).stdout || "";
155230
+ const brewPkgConfigPath = spawnSync4('which brew >/dev/null 2>&1 && brew environment --plain | grep PKG_CONFIG_LIBDIR | cut -d" " -f2', spawnSyncOptions).stdout || "";
155187
155231
  return [
155188
155232
  brewPkgConfigPath.trim(),
155189
155233
  env4.PKG_CONFIG_PATH,
@@ -159115,7 +159159,7 @@ var require_output = __commonJS((exports2, module2) => {
159115
159159
 
159116
159160
  // node_modules/.bun/sharp@0.32.6/node_modules/sharp/lib/utility.js
159117
159161
  var require_utility = __commonJS((exports2, module2) => {
159118
- var __dirname = "/home/shiro/MaTrixOS/node_modules/.bun/sharp@0.32.6/node_modules/sharp/lib";
159162
+ var __dirname = "/root/Projets/MaTrixOS/node_modules/.bun/sharp@0.32.6/node_modules/sharp/lib";
159119
159163
  var fs18 = __require("fs");
159120
159164
  var path18 = __require("path");
159121
159165
  var events = __require("events");
@@ -164974,7 +165018,7 @@ __export(exports_generate, {
164974
165018
  executeGenerateCommand: () => executeGenerateCommand,
164975
165019
  ProfileNotFoundError: () => ProfileNotFoundError
164976
165020
  });
164977
- import { existsSync as existsSync72, readFileSync as readFileSync57, realpathSync as realpathSync10 } from "fs";
165021
+ import { existsSync as existsSync72, readFileSync as readFileSync58, realpathSync as realpathSync10 } from "fs";
164978
165022
  import { dirname as dirname29, isAbsolute as isAbsolute6, join as join77, resolve as resolve16 } from "path";
164979
165023
  function profilesDirFor(opts) {
164980
165024
  if (opts.profilesDir)
@@ -165072,7 +165116,7 @@ var init_generate = __esm(() => {
165072
165116
  init_src5();
165073
165117
  init_src5();
165074
165118
  REPO_ROOT = resolve16(dirname29(new URL(import.meta.url).pathname), "..", "..", "..", "..", "..");
165075
- defaultFS2 = { existsSync: existsSync72, readFileSync: readFileSync57, realpathSync: realpathSync10 };
165119
+ defaultFS2 = { existsSync: existsSync72, readFileSync: readFileSync58, realpathSync: realpathSync10 };
165076
165120
  ProfileNotFoundError = class ProfileNotFoundError extends Error {
165077
165121
  profileName;
165078
165122
  constructor(profileName) {
@@ -165326,7 +165370,7 @@ var exports_profile_resolve = {};
165326
165370
  __export(exports_profile_resolve, {
165327
165371
  executeProfileResolveCommand: () => executeProfileResolveCommand
165328
165372
  });
165329
- import { existsSync as existsSync74, readdirSync as readdirSync16, readFileSync as readFileSync58 } from "fs";
165373
+ import { existsSync as existsSync74, readdirSync as readdirSync16, readFileSync as readFileSync59 } from "fs";
165330
165374
  import { join as join80, resolve as resolve17, dirname as dirname30 } from "path";
165331
165375
  function executeProfileResolveCommand(args) {
165332
165376
  if (args.options.help) {
@@ -165373,7 +165417,7 @@ function executeProfileResolveCommand(args) {
165373
165417
  for (const file3 of profileFiles) {
165374
165418
  try {
165375
165419
  const filePath = join80(profilesDir, file3);
165376
- const raw = JSON.parse(readFileSync58(filePath, "utf-8"));
165420
+ const raw = JSON.parse(readFileSync59(filePath, "utf-8"));
165377
165421
  const profile2 = ProfileSchema.parse(raw);
165378
165422
  registry2[profile2.name] = profile2;
165379
165423
  } catch {}
@@ -165435,9 +165479,9 @@ __export(exports_export, {
165435
165479
  getShell: () => getShell,
165436
165480
  executeExportCommand: () => executeExportCommand
165437
165481
  });
165438
- import { existsSync as existsSync75, readFileSync as readFileSync59, writeFileSync as writeFileSync26, copyFileSync as copyFileSync8, realpathSync as realpathSync11, mkdirSync as mkdirSync27 } from "fs";
165482
+ import { existsSync as existsSync75, readFileSync as readFileSync60, writeFileSync as writeFileSync26, copyFileSync as copyFileSync8, realpathSync as realpathSync11, mkdirSync as mkdirSync27 } from "fs";
165439
165483
  import { isAbsolute as isAbsolute7, join as join81, resolve as resolve18, dirname as dirname31 } from "path";
165440
- import { spawnSync as spawnSync3 } from "child_process";
165484
+ import { spawnSync as spawnSync4 } from "child_process";
165441
165485
  function setShell(shell) {
165442
165486
  activeShell = shell;
165443
165487
  }
@@ -165549,7 +165593,7 @@ var init_export = __esm(() => {
165549
165593
  defaultShell = {
165550
165594
  run(cmd, cwd) {
165551
165595
  const parts = cmd.split(/\s+/);
165552
- const result = spawnSync3(parts[0], parts.slice(1), { cwd, encoding: "utf-8", windowsHide: process.platform === "win32" });
165596
+ const result = spawnSync4(parts[0], parts.slice(1), { cwd, encoding: "utf-8", windowsHide: process.platform === "win32" });
165553
165597
  return {
165554
165598
  code: result.status ?? 1,
165555
165599
  stdout: (result.stdout ?? result.stderr ?? "").toString().trim()
@@ -165559,7 +165603,7 @@ var init_export = __esm(() => {
165559
165603
  activeShell = defaultShell;
165560
165604
  defaultExportFS = {
165561
165605
  existsSync: existsSync75,
165562
- readFileSync: readFileSync59,
165606
+ readFileSync: readFileSync60,
165563
165607
  writeFileSync: writeFileSync26,
165564
165608
  copyFileSync: copyFileSync8,
165565
165609
  realpathSync: realpathSync11,
@@ -165587,7 +165631,7 @@ __export(exports_project_context, {
165587
165631
  createProject: () => createProject,
165588
165632
  archiveProject: () => archiveProject
165589
165633
  });
165590
- import { existsSync as existsSync76, mkdirSync as mkdirSync28, readFileSync as readFileSync60, writeFileSync as writeFileSync27, rmSync as rmSync8 } from "fs";
165634
+ import { existsSync as existsSync76, mkdirSync as mkdirSync28, readFileSync as readFileSync61, writeFileSync as writeFileSync27, rmSync as rmSync8 } from "fs";
165591
165635
  import { join as join82 } from "path";
165592
165636
  function getMatrixOsDir(cwd = process.cwd()) {
165593
165637
  return join82(cwd, ".matrixos");
@@ -165606,7 +165650,7 @@ function loadState(cwd) {
165606
165650
  if (!existsSync76(path29))
165607
165651
  return {};
165608
165652
  try {
165609
- return JSON.parse(readFileSync60(path29, "utf-8"));
165653
+ return JSON.parse(readFileSync61(path29, "utf-8"));
165610
165654
  } catch {
165611
165655
  return {};
165612
165656
  }
@@ -165622,7 +165666,7 @@ function loadProjectMeta(slug, cwd) {
165622
165666
  if (!existsSync76(path29))
165623
165667
  return null;
165624
165668
  try {
165625
- return JSON.parse(readFileSync60(path29, "utf-8"));
165669
+ return JSON.parse(readFileSync61(path29, "utf-8"));
165626
165670
  } catch {
165627
165671
  return null;
165628
165672
  }
@@ -165748,7 +165792,7 @@ __export(exports_project_memory, {
165748
165792
  isProjectEpisode: () => isProjectEpisode,
165749
165793
  addKbDocument: () => addKbDocument
165750
165794
  });
165751
- import { existsSync as existsSync77, mkdirSync as mkdirSync29, readFileSync as readFileSync61, readdirSync as readdirSync17, writeFileSync as writeFileSync28 } from "fs";
165795
+ import { existsSync as existsSync77, mkdirSync as mkdirSync29, readFileSync as readFileSync62, readdirSync as readdirSync17, writeFileSync as writeFileSync28 } from "fs";
165752
165796
  import { join as join83 } from "path";
165753
165797
  function tagWithProject(metadata = {}, projectSlug, cwd) {
165754
165798
  const active = projectSlug ?? getActiveProject(cwd)?.slug;
@@ -165772,7 +165816,7 @@ function listKbDocuments(projectSlug, cwd) {
165772
165816
  continue;
165773
165817
  const path29 = join83(kbDir, entry.name);
165774
165818
  try {
165775
- docs.push({ path: path29, content: readFileSync61(path29, "utf-8") });
165819
+ docs.push({ path: path29, content: readFileSync62(path29, "utf-8") });
165776
165820
  } catch {}
165777
165821
  }
165778
165822
  return docs;
@@ -166194,12 +166238,12 @@ __export(exports_gateway_start, {
166194
166238
  buildTelegramConfig: () => buildTelegramConfig,
166195
166239
  buildGatewayConfig: () => buildGatewayConfig
166196
166240
  });
166197
- import { readFileSync as readFileSync62, existsSync as existsSync78 } from "fs";
166241
+ import { readFileSync as readFileSync63, existsSync as existsSync78 } from "fs";
166198
166242
  import { resolve as resolve19 } from "path";
166199
166243
  function loadGatewayEnv(path29 = ENV_PATH) {
166200
166244
  if (!existsSync78(path29))
166201
166245
  return {};
166202
- const text = readFileSync62(path29, "utf8");
166246
+ const text = readFileSync63(path29, "utf8");
166203
166247
  const out = {};
166204
166248
  for (const raw of text.split(/\r?\n/)) {
166205
166249
  const line = raw.trim();
@@ -166669,7 +166713,7 @@ var init_deployment = __esm(() => {
166669
166713
  });
166670
166714
 
166671
166715
  // packages/omo-opencode/src/audit/self-audit.ts
166672
- import { existsSync as existsSync80, mkdirSync as mkdirSync30, readdirSync as readdirSync18, readFileSync as readFileSync63, writeFileSync as writeFileSync29 } from "fs";
166716
+ import { existsSync as existsSync80, mkdirSync as mkdirSync30, readdirSync as readdirSync18, readFileSync as readFileSync64, writeFileSync as writeFileSync29 } from "fs";
166673
166717
  import { join as join84 } from "path";
166674
166718
  function getAuditDir(cwd = process.cwd()) {
166675
166719
  return join84(cwd, ".matrixos", "audits");
@@ -169323,7 +169367,7 @@ var BOULDER_STATE_PATH = `${BOULDER_DIR}/${BOULDER_FILE}`;
169323
169367
  var NOTEPAD_DIR = "notepads";
169324
169368
  var NOTEPAD_BASE_PATH = `${BOULDER_DIR}/${NOTEPAD_DIR}`;
169325
169369
  // packages/boulder-state/src/top-level-task.ts
169326
- import { existsSync as existsSync32, readFileSync as readFileSync18 } from "fs";
169370
+ import { existsSync as existsSync32, readFileSync as readFileSync19 } from "fs";
169327
169371
  var TODO_HEADING_PATTERN = /^##\s+TODOs\b/i;
169328
169372
  var FINAL_VERIFICATION_HEADING_PATTERN = /^##\s+Final Verification Wave\b/i;
169329
169373
  var SECOND_LEVEL_HEADING_PATTERN = /^##\s+/;
@@ -169350,7 +169394,7 @@ function readCurrentTopLevelTask(planPath) {
169350
169394
  return null;
169351
169395
  }
169352
169396
  try {
169353
- const content = readFileSync18(planPath, "utf-8");
169397
+ const content = readFileSync19(planPath, "utf-8");
169354
169398
  const lines = content.split(/\r?\n/);
169355
169399
  let section = "other";
169356
169400
  for (const line of lines) {
@@ -169402,7 +169446,7 @@ function resolveBoulderPlanPathForWork(directory, work) {
169402
169446
  return resolveBoulderPlanPath(directory, work);
169403
169447
  }
169404
169448
  // packages/boulder-state/src/storage/plan-progress.ts
169405
- import { existsSync as existsSync34, readFileSync as readFileSync19, readdirSync as readdirSync5, statSync as statSync5 } from "fs";
169449
+ import { existsSync as existsSync34, readFileSync as readFileSync20, readdirSync as readdirSync5, statSync as statSync5 } from "fs";
169406
169450
  var TODO_HEADING_PATTERN2 = /^##\s+TODOs\b/i;
169407
169451
  var FINAL_VERIFICATION_HEADING_PATTERN2 = /^##\s+Final Verification Wave\b/i;
169408
169452
  var SECOND_LEVEL_HEADING_PATTERN2 = /^##\s+/;
@@ -169415,7 +169459,7 @@ function getPlanProgress(planPath) {
169415
169459
  return { total: 0, completed: 0, isComplete: false };
169416
169460
  }
169417
169461
  try {
169418
- const content = readFileSync19(planPath, "utf-8");
169462
+ const content = readFileSync20(planPath, "utf-8");
169419
169463
  const lines = content.split(/\r?\n/);
169420
169464
  const hasStructuredSections = lines.some((line) => TODO_HEADING_PATTERN2.test(line) || FINAL_VERIFICATION_HEADING_PATTERN2.test(line));
169421
169465
  if (hasStructuredSections) {
@@ -169531,14 +169575,14 @@ function selectMirrorWork(state) {
169531
169575
  return sorted[0] ?? null;
169532
169576
  }
169533
169577
  // packages/boulder-state/src/storage/read-state.ts
169534
- import { existsSync as existsSync35, readFileSync as readFileSync20 } from "fs";
169578
+ import { existsSync as existsSync35, readFileSync as readFileSync21 } from "fs";
169535
169579
  function readBoulderState(directory) {
169536
169580
  const filePath = getBoulderFilePath(directory);
169537
169581
  if (!existsSync35(filePath)) {
169538
169582
  return null;
169539
169583
  }
169540
169584
  try {
169541
- const content = readFileSync20(filePath, "utf-8");
169585
+ const content = readFileSync21(filePath, "utf-8");
169542
169586
  const parsed = JSON.parse(content);
169543
169587
  if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
169544
169588
  return null;
@@ -169604,7 +169648,7 @@ init_state();
169604
169648
  // packages/omo-opencode/src/features/run-continuation-state/constants.ts
169605
169649
  var CONTINUATION_MARKER_DIR = ".omo/run-continuation";
169606
169650
  // packages/omo-opencode/src/features/run-continuation-state/storage.ts
169607
- import { existsSync as existsSync36, mkdirSync as mkdirSync12, readFileSync as readFileSync21, rmSync as rmSync2, writeFileSync as writeFileSync9 } from "fs";
169651
+ import { existsSync as existsSync36, mkdirSync as mkdirSync12, readFileSync as readFileSync22, rmSync as rmSync2, writeFileSync as writeFileSync9 } from "fs";
169608
169652
  import { join as join31 } from "path";
169609
169653
  function getMarkerPath(directory, sessionID) {
169610
169654
  return join31(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
@@ -169614,7 +169658,7 @@ function readContinuationMarker(directory, sessionID) {
169614
169658
  if (!existsSync36(markerPath))
169615
169659
  return null;
169616
169660
  try {
169617
- const raw = readFileSync21(markerPath, "utf-8");
169661
+ const raw = readFileSync22(markerPath, "utf-8");
169618
169662
  const parsed = JSON.parse(raw);
169619
169663
  if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
169620
169664
  return null;
@@ -169679,7 +169723,7 @@ async function isSessionInBoulderLineage(input) {
169679
169723
  // packages/omo-opencode/src/hooks/the-operator/session-last-agent.ts
169680
169724
  init_shared();
169681
169725
  init_compaction_marker();
169682
- import { readFileSync as readFileSync22, readdirSync as readdirSync6 } from "fs";
169726
+ import { readFileSync as readFileSync23, readdirSync as readdirSync6 } from "fs";
169683
169727
  import { join as join32 } from "path";
169684
169728
  var defaultSessionLastAgentDeps = {
169685
169729
  getMessageDir,
@@ -169740,7 +169784,7 @@ async function getLastAgentFromSession(sessionID, client3, deps = {}) {
169740
169784
  try {
169741
169785
  const messages = readdirSync6(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
169742
169786
  try {
169743
- const content = readFileSync22(join32(messageDir, fileName), "utf-8");
169787
+ const content = readFileSync23(join32(messageDir, fileName), "utf-8");
169744
169788
  const parsed = JSON.parse(content);
169745
169789
  return {
169746
169790
  fileName,
@@ -169783,7 +169827,7 @@ init_agent_display_names();
169783
169827
 
169784
169828
  // packages/omo-opencode/src/hooks/ralph-loop/storage.ts
169785
169829
  init_frontmatter2();
169786
- import { existsSync as existsSync37, readFileSync as readFileSync23, writeFileSync as writeFileSync10, unlinkSync as unlinkSync6, mkdirSync as mkdirSync13 } from "fs";
169830
+ import { existsSync as existsSync37, readFileSync as readFileSync24, writeFileSync as writeFileSync10, unlinkSync as unlinkSync6, mkdirSync as mkdirSync13 } from "fs";
169787
169831
  import { dirname as dirname13, join as join33 } from "path";
169788
169832
 
169789
169833
  // packages/omo-opencode/src/hooks/ralph-loop/constants.ts
@@ -169801,7 +169845,7 @@ function readState(directory, customPath) {
169801
169845
  return null;
169802
169846
  }
169803
169847
  try {
169804
- const content = readFileSync23(filePath, "utf-8");
169848
+ const content = readFileSync24(filePath, "utf-8");
169805
169849
  const { data, body } = parseFrontmatter(content);
169806
169850
  const active = data.active;
169807
169851
  const iteration = data.iteration;
@@ -170376,8 +170420,8 @@ function createTimestampedStdoutController(stdout2 = process.stdout) {
170376
170420
  // packages/telemetry-core/src/activity-state.ts
170377
170421
  init_atomic_write();
170378
170422
  init_xdg_data_dir();
170379
- import { existsSync as existsSync38, mkdirSync as mkdirSync14, readFileSync as readFileSync24 } from "fs";
170380
- import { basename as basename7, join as join34 } from "path";
170423
+ import { existsSync as existsSync38, mkdirSync as mkdirSync14, readFileSync as readFileSync25 } from "fs";
170424
+ import { basename as basename6, join as join34 } from "path";
170381
170425
  var POSTHOG_ACTIVITY_STATE_FILE = "posthog-activity.json";
170382
170426
  function resolveTelemetryStateDir(product, options = {}) {
170383
170427
  const dataDir = resolveXdgDataDir(product.cacheDirName, {
@@ -170385,7 +170429,7 @@ function resolveTelemetryStateDir(product, options = {}) {
170385
170429
  osProvider: options.osProvider
170386
170430
  });
170387
170431
  const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined : join34(options.env.XDG_DATA_HOME, product.cacheDirName);
170388
- if (dataDir === xdgStateDir || xdgStateDir === undefined && basename7(dataDir) === product.cacheDirName) {
170432
+ if (dataDir === xdgStateDir || xdgStateDir === undefined && basename6(dataDir) === product.cacheDirName) {
170389
170433
  return dataDir;
170390
170434
  }
170391
170435
  return join34(dataDir, product.cacheDirName);
@@ -170420,7 +170464,7 @@ function readPostHogActivityState(stateDir, diagnostics) {
170420
170464
  return {};
170421
170465
  }
170422
170466
  try {
170423
- const stateContent = readFileSync24(stateFilePath, "utf-8");
170467
+ const stateContent = readFileSync25(stateFilePath, "utf-8");
170424
170468
  const stateJson = JSON.parse(stateContent);
170425
170469
  if (!isPostHogActivityState(stateJson)) {
170426
170470
  return {};
@@ -177543,7 +177587,7 @@ init_constants5();
177543
177587
 
177544
177588
  // packages/omo-opencode/src/cli/doctor/checks/system.ts
177545
177589
  init_constants5();
177546
- import { existsSync as existsSync49, readFileSync as readFileSync34 } from "fs";
177590
+ import { existsSync as existsSync49, readFileSync as readFileSync35 } from "fs";
177547
177591
 
177548
177592
  // packages/omo-opencode/src/cli/doctor/checks/system-binary.ts
177549
177593
  init_extract_semver();
@@ -177740,7 +177784,7 @@ function compareVersions3(current, minimum) {
177740
177784
 
177741
177785
  // packages/omo-opencode/src/cli/doctor/checks/system-plugin.ts
177742
177786
  init_shared();
177743
- import { existsSync as existsSync47, readFileSync as readFileSync32 } from "fs";
177787
+ import { existsSync as existsSync47, readFileSync as readFileSync33 } from "fs";
177744
177788
  function detectConfigPath() {
177745
177789
  const paths2 = getOpenCodeConfigPaths({ binary: "opencode", version: null });
177746
177790
  if (existsSync47(paths2.configJsonc))
@@ -177791,7 +177835,7 @@ function getPluginInfo() {
177791
177835
  };
177792
177836
  }
177793
177837
  try {
177794
- const content = readFileSync32(configPath, "utf-8");
177838
+ const content = readFileSync33(configPath, "utf-8");
177795
177839
  const parsedConfig = parseJsonc(content);
177796
177840
  const pluginEntry = findPluginEntry2(parsedConfig.plugin ?? []);
177797
177841
  if (!pluginEntry) {
@@ -177835,7 +177879,7 @@ init_auto_update_checker();
177835
177879
  init_package_json_locator();
177836
177880
  init_constants5();
177837
177881
  init_shared();
177838
- import { existsSync as existsSync48, readFileSync as readFileSync33, readdirSync as readdirSync8 } from "fs";
177882
+ import { existsSync as existsSync48, readFileSync as readFileSync34, readdirSync as readdirSync8 } from "fs";
177839
177883
  import { createRequire as createRequire2 } from "module";
177840
177884
  import { homedir as homedir13 } from "os";
177841
177885
  import { join as join42 } from "path";
@@ -177866,7 +177910,7 @@ function readPackageJson(filePath) {
177866
177910
  if (!existsSync48(filePath))
177867
177911
  return null;
177868
177912
  try {
177869
- const content = readFileSync33(filePath, "utf-8");
177913
+ const content = readFileSync34(filePath, "utf-8");
177870
177914
  return parseJsonc(content);
177871
177915
  } catch (error51) {
177872
177916
  if (!(error51 instanceof Error)) {
@@ -178000,7 +178044,7 @@ var defaultDeps6 = {
178000
178044
  getLatestPluginVersion,
178001
178045
  getSuggestedInstallTag,
178002
178046
  configExists: existsSync49,
178003
- readConfigFile: (path14) => readFileSync34(path14, "utf-8"),
178047
+ readConfigFile: (path14) => readFileSync35(path14, "utf-8"),
178004
178048
  parseConfigContent: (content) => parseJsonc(content)
178005
178049
  };
178006
178050
  var BUN_POSTINSTALL_HELPER_PACKAGE_NAME = "@code-yeongyu/comment-checker";
@@ -178145,7 +178189,7 @@ async function checkSystem(deps = defaultDeps6) {
178145
178189
 
178146
178190
  // packages/omo-opencode/src/config/validate.ts
178147
178191
  init_src();
178148
- import { readFileSync as readFileSync35 } from "fs";
178192
+ import { readFileSync as readFileSync36 } from "fs";
178149
178193
  import { homedir as homedir14 } from "os";
178150
178194
  import { dirname as dirname19, relative as relative5 } from "path";
178151
178195
  init_shared();
@@ -178190,7 +178234,7 @@ function schemaMessages(configPath, rawConfig) {
178190
178234
  }
178191
178235
  function parseLayerConfig(configPath) {
178192
178236
  try {
178193
- const content = readFileSync35(configPath, "utf-8");
178237
+ const content = readFileSync36(configPath, "utf-8");
178194
178238
  const rawConfig = parseJsonc(content);
178195
178239
  if (!isPlainRecord(rawConfig)) {
178196
178240
  return {
@@ -178262,7 +178306,7 @@ init_constants5();
178262
178306
 
178263
178307
  // packages/omo-opencode/src/cli/doctor/checks/model-resolution-cache.ts
178264
178308
  init_shared();
178265
- import { existsSync as existsSync50, readFileSync as readFileSync36 } from "fs";
178309
+ import { existsSync as existsSync50, readFileSync as readFileSync37 } from "fs";
178266
178310
  import { homedir as homedir15 } from "os";
178267
178311
  import { join as join43 } from "path";
178268
178312
  function getUserConfigDir2() {
@@ -178281,7 +178325,7 @@ function loadCustomProviderNames() {
178281
178325
  if (!existsSync50(configPath))
178282
178326
  continue;
178283
178327
  try {
178284
- const content = readFileSync36(configPath, "utf-8");
178328
+ const content = readFileSync37(configPath, "utf-8");
178285
178329
  const data = parseJsonc(content);
178286
178330
  if (data?.provider && typeof data.provider === "object") {
178287
178331
  return Object.keys(data.provider);
@@ -178305,7 +178349,7 @@ function loadAvailableModelsFromCache() {
178305
178349
  return { providers: [], modelCount: 0, cacheExists: false };
178306
178350
  }
178307
178351
  try {
178308
- const content = readFileSync36(cacheFile, "utf-8");
178352
+ const content = readFileSync37(cacheFile, "utf-8");
178309
178353
  const data = parseJsonc(content);
178310
178354
  const cacheProviders = Object.keys(data);
178311
178355
  let modelCount = 0;
@@ -178333,7 +178377,7 @@ init_constants5();
178333
178377
  // packages/omo-opencode/src/cli/doctor/checks/model-resolution-config.ts
178334
178378
  init_shared();
178335
178379
  init_plugin_identity();
178336
- import { readFileSync as readFileSync37 } from "fs";
178380
+ import { readFileSync as readFileSync38 } from "fs";
178337
178381
  import { join as join44 } from "path";
178338
178382
  var PROJECT_CONFIG_DIR = join44(process.cwd(), ".opencode");
178339
178383
  function loadOmoConfig() {
@@ -178343,7 +178387,7 @@ function loadOmoConfig() {
178343
178387
  });
178344
178388
  if (projectDetected.format !== "none") {
178345
178389
  try {
178346
- const content = readFileSync37(projectDetected.path, "utf-8");
178390
+ const content = readFileSync38(projectDetected.path, "utf-8");
178347
178391
  return parseJsonc(content);
178348
178392
  } catch (error51) {
178349
178393
  if (error51 instanceof Error) {
@@ -178359,7 +178403,7 @@ function loadOmoConfig() {
178359
178403
  });
178360
178404
  if (userDetected.format !== "none") {
178361
178405
  try {
178362
- const content = readFileSync37(userDetected.path, "utf-8");
178406
+ const content = readFileSync38(userDetected.path, "utf-8");
178363
178407
  return parseJsonc(content);
178364
178408
  } catch (error51) {
178365
178409
  if (error51 instanceof Error) {
@@ -178940,13 +178984,13 @@ async function getGhCliInfo(dependencies = {}) {
178940
178984
  }
178941
178985
 
178942
178986
  // packages/omo-opencode/src/cli/doctor/checks/tools-lsp.ts
178943
- import { readFileSync as readFileSync39 } from "fs";
178987
+ import { readFileSync as readFileSync40 } from "fs";
178944
178988
  import { join as join48 } from "path";
178945
178989
 
178946
178990
  // packages/omo-opencode/src/mcp/lsp.ts
178947
178991
  init_zod();
178948
178992
  init_opencode_config_dir();
178949
- import { existsSync as existsSync52, readFileSync as readFileSync38 } from "fs";
178993
+ import { existsSync as existsSync52, readFileSync as readFileSync39 } from "fs";
178950
178994
  import { delimiter as delimiter3, dirname as dirname21, resolve as resolve10 } from "path";
178951
178995
  import { fileURLToPath as fileURLToPath6 } from "url";
178952
178996
 
@@ -178960,7 +179004,7 @@ function hasCliSuffix(candidatePath, suffix) {
178960
179004
 
178961
179005
  // packages/omo-opencode/src/mcp/runtime-executable.ts
178962
179006
  init_bun_which_shim();
178963
- import { basename as basename8 } from "path";
179007
+ import { basename as basename7 } from "path";
178964
179008
  var NODE_EXECUTABLE_NAMES = new Set(["node", "node.exe"]);
178965
179009
  function isUnsafeCommandName2(commandName) {
178966
179010
  if (commandName.length === 0)
@@ -178976,7 +179020,7 @@ function isUnsafeCommandName2(commandName) {
178976
179020
  return false;
178977
179021
  }
178978
179022
  function isNodeExecPath(execPath) {
178979
- return NODE_EXECUTABLE_NAMES.has(basename8(execPath).toLowerCase());
179023
+ return NODE_EXECUTABLE_NAMES.has(basename7(execPath).toLowerCase());
178980
179024
  }
178981
179025
  function resolveRuntimeExecutable(commandName, options = {}) {
178982
179026
  if (isUnsafeCommandName2(commandName)) {
@@ -179090,7 +179134,7 @@ function findBootstrapRoot(candidates, pathExists) {
179090
179134
  }
179091
179135
  function readDaemonPackageVersion(root) {
179092
179136
  try {
179093
- const packageJson = JSON.parse(readFileSync38(resolve10(root, PACKAGE_REL, "package.json"), "utf-8"));
179137
+ const packageJson = JSON.parse(readFileSync39(resolve10(root, PACKAGE_REL, "package.json"), "utf-8"));
179094
179138
  return DaemonPackageSchema.parse(packageJson).version;
179095
179139
  } catch (error51) {
179096
179140
  if (!(error51 instanceof Error))
@@ -179167,7 +179211,7 @@ function readOmoConfig(configDirectory) {
179167
179211
  return null;
179168
179212
  }
179169
179213
  try {
179170
- const content = readFileSync39(detected.path, "utf-8");
179214
+ const content = readFileSync40(detected.path, "utf-8");
179171
179215
  return parseJsonc(content);
179172
179216
  } catch (error51) {
179173
179217
  if (!(error51 instanceof Error)) {
@@ -179197,7 +179241,7 @@ function getInstalledLspServers(options = {}) {
179197
179241
 
179198
179242
  // packages/omo-opencode/src/cli/doctor/checks/tools-mcp.ts
179199
179243
  init_shared();
179200
- import { existsSync as existsSync53, readFileSync as readFileSync40 } from "fs";
179244
+ import { existsSync as existsSync53, readFileSync as readFileSync41 } from "fs";
179201
179245
  import { homedir as homedir18 } from "os";
179202
179246
  import { join as join49 } from "path";
179203
179247
  var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
@@ -179214,7 +179258,7 @@ function loadUserMcpConfig() {
179214
179258
  if (!existsSync53(configPath))
179215
179259
  continue;
179216
179260
  try {
179217
- const content = readFileSync40(configPath, "utf-8");
179261
+ const content = readFileSync41(configPath, "utf-8");
179218
179262
  const config5 = parseJsonc(content);
179219
179263
  if (config5.mcpServers) {
179220
179264
  Object.assign(servers, config5.mcpServers);
@@ -179349,7 +179393,7 @@ async function checkTools() {
179349
179393
  }
179350
179394
 
179351
179395
  // packages/omo-opencode/src/cli/doctor/checks/telemetry.ts
179352
- import { existsSync as existsSync54, readFileSync as readFileSync41 } from "fs";
179396
+ import { existsSync as existsSync54, readFileSync as readFileSync42 } from "fs";
179353
179397
  init_constants5();
179354
179398
  function isTelemetryState(value) {
179355
179399
  return value !== null && typeof value === "object" && !Array.isArray(value);
@@ -179360,7 +179404,7 @@ function readLastActiveDay(stateFilePath) {
179360
179404
  }
179361
179405
  let parsed;
179362
179406
  try {
179363
- parsed = JSON.parse(readFileSync41(stateFilePath, "utf-8"));
179407
+ parsed = JSON.parse(readFileSync42(stateFilePath, "utf-8"));
179364
179408
  } catch (error51) {
179365
179409
  if (error51 instanceof Error) {
179366
179410
  return "unreadable";
@@ -179436,7 +179480,7 @@ function expandHomeDirectory(directoryPath) {
179436
179480
  init_constants5();
179437
179481
  init_shared();
179438
179482
  init_plugin_identity();
179439
- import { readFileSync as readFileSync42, promises as fs15 } from "fs";
179483
+ import { readFileSync as readFileSync43, promises as fs15 } from "fs";
179440
179484
  import path15 from "path";
179441
179485
  async function checkTeamMode() {
179442
179486
  const config5 = loadTeamModeConfig();
@@ -179473,7 +179517,7 @@ function loadTeamModeConfig() {
179473
179517
  if (!configPath)
179474
179518
  return { team_mode: undefined };
179475
179519
  try {
179476
- return parseJsonc(readFileSync42(configPath, "utf-8"));
179520
+ return parseJsonc(readFileSync43(configPath, "utf-8"));
179477
179521
  } catch (error51) {
179478
179522
  if (error51 instanceof Error) {
179479
179523
  return { team_mode: undefined };
@@ -179914,12 +179958,12 @@ import {
179914
179958
  existsSync as existsSync57,
179915
179959
  mkdirSync as mkdirSync16,
179916
179960
  readdirSync as readdirSync9,
179917
- readFileSync as readFileSync44,
179961
+ readFileSync as readFileSync45,
179918
179962
  renameSync as renameSync7,
179919
179963
  unlinkSync as unlinkSync9,
179920
179964
  writeFileSync as writeFileSync14
179921
179965
  } from "fs";
179922
- import { basename as basename9, dirname as dirname22, join as join52 } from "path";
179966
+ import { basename as basename8, dirname as dirname22, join as join52 } from "path";
179923
179967
 
179924
179968
  // packages/mcp-client-core/src/config-dir.ts
179925
179969
  import { existsSync as existsSync55, realpathSync as realpathSync7 } from "fs";
@@ -179947,7 +179991,7 @@ function getOpenCodeCliConfigDir(env2 = process.env) {
179947
179991
  }
179948
179992
 
179949
179993
  // packages/mcp-client-core/src/mcp-oauth/storage-index.ts
179950
- import { chmodSync as chmodSync5, existsSync as existsSync56, readFileSync as readFileSync43, renameSync as renameSync6, writeFileSync as writeFileSync13 } from "fs";
179994
+ import { chmodSync as chmodSync5, existsSync as existsSync56, readFileSync as readFileSync44, renameSync as renameSync6, writeFileSync as writeFileSync13 } from "fs";
179951
179995
  import { join as join51 } from "path";
179952
179996
  var INDEX_FILE_NAME = "index.json";
179953
179997
  function isTokenIndex(value) {
@@ -179963,7 +180007,7 @@ function readTokenIndex(storageDir) {
179963
180007
  if (!existsSync56(indexPath))
179964
180008
  return {};
179965
180009
  try {
179966
- const parsed = JSON.parse(readFileSync43(indexPath, "utf-8"));
180010
+ const parsed = JSON.parse(readFileSync44(indexPath, "utf-8"));
179967
180011
  return isTokenIndex(parsed) ? parsed : {};
179968
180012
  } catch (readError) {
179969
180013
  if (!(readError instanceof Error))
@@ -180073,7 +180117,7 @@ function readTokenFile(filePath) {
180073
180117
  if (!existsSync57(filePath))
180074
180118
  return null;
180075
180119
  try {
180076
- const parsed = JSON.parse(readFileSync44(filePath, "utf-8"));
180120
+ const parsed = JSON.parse(readFileSync45(filePath, "utf-8"));
180077
180121
  return isOAuthTokenData(parsed) ? parsed : null;
180078
180122
  } catch (readError) {
180079
180123
  if (!(readError instanceof Error))
@@ -180086,7 +180130,7 @@ function readLegacyStore() {
180086
180130
  if (!existsSync57(filePath))
180087
180131
  return null;
180088
180132
  try {
180089
- const parsed = JSON.parse(readFileSync44(filePath, "utf-8"));
180133
+ const parsed = JSON.parse(readFileSync45(filePath, "utf-8"));
180090
180134
  if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed))
180091
180135
  return null;
180092
180136
  const result = {};
@@ -180204,7 +180248,7 @@ function listAllTokens() {
180204
180248
  if (!entry.isFile() || !entry.name.endsWith(".json") || entry.name === "index.json")
180205
180249
  continue;
180206
180250
  const token = readTokenFile(join52(dir, entry.name));
180207
- const hash2 = basename9(entry.name, ".json");
180251
+ const hash2 = basename8(entry.name, ".json");
180208
180252
  if (token)
180209
180253
  result[index[hash2] ?? hash2] = token;
180210
180254
  }
@@ -180899,7 +180943,7 @@ function createEmbeddingPort() {
180899
180943
  // packages/learning-loop/src/codebase-scanner.ts
180900
180944
  var import_picomatch = __toESM(require_picomatch2(), 1);
180901
180945
  import { createHash as createHash5 } from "crypto";
180902
- import { readdirSync as readdirSync10, readFileSync as readFileSync46, statSync as statSync7, existsSync as existsSync59 } from "fs";
180946
+ import { readdirSync as readdirSync10, readFileSync as readFileSync47, statSync as statSync7, existsSync as existsSync59 } from "fs";
180903
180947
  import { join as join53, relative as relative6, extname as extname3 } from "path";
180904
180948
  var EXT_TO_LANG = {
180905
180949
  ts: "typescript",
@@ -180967,7 +181011,7 @@ function defaultFs() {
180967
181011
  return readdirSync10(path18);
180968
181012
  },
180969
181013
  readFile(path18) {
180970
- return readFileSync46(path18, "utf-8");
181014
+ return readFileSync47(path18, "utf-8");
180971
181015
  },
180972
181016
  stat(path18) {
180973
181017
  const s = statSync7(path18);
@@ -181320,8 +181364,8 @@ function formatSearchResults(result) {
181320
181364
  }
181321
181365
 
181322
181366
  // packages/learning-loop/src/improvement.ts
181323
- import { existsSync as existsSync60, mkdirSync as mkdirSync18, readFileSync as readFileSync47, writeFileSync as writeFileSync16 } from "fs";
181324
- import { join as join54, basename as basename11 } from "path";
181367
+ import { existsSync as existsSync60, mkdirSync as mkdirSync18, readFileSync as readFileSync48, writeFileSync as writeFileSync16 } from "fs";
181368
+ import { join as join54, basename as basename10 } from "path";
181325
181369
  function createImprovementStore(improvementsDir) {
181326
181370
  if (!existsSync60(improvementsDir)) {
181327
181371
  mkdirSync18(improvementsDir, { recursive: true });
@@ -181342,12 +181386,12 @@ function createImprovementStore(improvementsDir) {
181342
181386
  return [];
181343
181387
  }
181344
181388
  files.sort().reverse();
181345
- return files.map((f2) => get(basename11(f2, ".json"))).filter((i3) => i3 !== null);
181389
+ return files.map((f2) => get(basename10(f2, ".json"))).filter((i3) => i3 !== null);
181346
181390
  }
181347
181391
  function get(id) {
181348
181392
  const filePath = join54(improvementsDir, `${id}.json`);
181349
181393
  try {
181350
- const raw = readFileSync47(filePath, "utf-8");
181394
+ const raw = readFileSync48(filePath, "utf-8");
181351
181395
  return JSON.parse(raw);
181352
181396
  } catch {
181353
181397
  return null;
@@ -182166,7 +182210,7 @@ function getClaudeConfigDir() {
182166
182210
  return join57(getHomeDirectory(), ".claude");
182167
182211
  }
182168
182212
  // packages/skills-loader-core/src/shared/opencode-command-dirs.ts
182169
- import { basename as basename12, dirname as dirname23, join as join59 } from "path";
182213
+ import { basename as basename11, dirname as dirname23, join as join59 } from "path";
182170
182214
 
182171
182215
  // packages/skills-loader-core/src/shared/opencode-config-dir.ts
182172
182216
  import { existsSync as existsSync64, realpathSync as realpathSync8 } from "fs";
@@ -182301,7 +182345,7 @@ function getOpenCodeConfigDir2(options) {
182301
182345
  // packages/skills-loader-core/src/shared/opencode-command-dirs.ts
182302
182346
  function getParentOpencodeConfigDir(configDir) {
182303
182347
  const parentDir = dirname23(configDir);
182304
- if (basename12(parentDir) !== "profiles") {
182348
+ if (basename11(parentDir) !== "profiles") {
182305
182349
  return null;
182306
182350
  }
182307
182351
  return dirname23(parentDir);
@@ -182446,7 +182490,7 @@ import { join as join62 } from "path";
182446
182490
  init_src();
182447
182491
  init_src2();
182448
182492
  import * as fs19 from "fs/promises";
182449
- import { basename as basename13 } from "path";
182493
+ import { basename as basename12 } from "path";
182450
182494
 
182451
182495
  // packages/skills-loader-core/src/features/opencode-skill-loader/allowed-tools-parser.ts
182452
182496
  function parseAllowedTools(allowedTools) {
@@ -182562,7 +182606,7 @@ $ARGUMENTS
182562
182606
  }
182563
182607
  }
182564
182608
  function inferSkillNameFromFileName(filePath) {
182565
- return basename13(filePath, ".md");
182609
+ return basename12(filePath, ".md");
182566
182610
  }
182567
182611
 
182568
182612
  // packages/skills-loader-core/src/features/opencode-skill-loader/skill-directory-loader.ts
@@ -183474,9 +183518,9 @@ playwright-cli close
183474
183518
  // packages/skills-loader-core/src/features/builtin-skills/skill-file-loader.ts
183475
183519
  init_shared_skills();
183476
183520
  init_src();
183477
- import { readFileSync as readFileSync50 } from "fs";
183521
+ import { readFileSync as readFileSync51 } from "fs";
183478
183522
  import { join as join64 } from "path";
183479
- function createSharedSkillTemplateLoader(readFile3 = readFileSync50, skillsRootPath = sharedSkillsRootPath()) {
183523
+ function createSharedSkillTemplateLoader(readFile3 = readFileSync51, skillsRootPath = sharedSkillsRootPath()) {
183480
183524
  const cache = new Map;
183481
183525
  return (skillName) => {
183482
183526
  const cached2 = cache.get(skillName);
@@ -185836,7 +185880,7 @@ import {
185836
185880
  existsSync as existsSync67,
185837
185881
  mkdirSync as mkdirSync21,
185838
185882
  copyFileSync as copyFileSync4,
185839
- readFileSync as readFileSync51,
185883
+ readFileSync as readFileSync52,
185840
185884
  writeFileSync as writeFileSync19,
185841
185885
  readdirSync as readdirSync11,
185842
185886
  statSync as statSync8,
@@ -185853,7 +185897,7 @@ async function snapshotCli(options = {}) {
185853
185897
  const realFs = {
185854
185898
  existsSync: existsSync67,
185855
185899
  mkdirSync: mkdirSync21,
185856
- readFileSync: readFileSync51,
185900
+ readFileSync: readFileSync52,
185857
185901
  writeFileSync: writeFileSync19,
185858
185902
  copyFileSync: copyFileSync4,
185859
185903
  readdirSync: readdirSync11,
@@ -185919,7 +185963,7 @@ import {
185919
185963
  existsSync as existsSync68,
185920
185964
  mkdirSync as mkdirSync22,
185921
185965
  copyFileSync as copyFileSync5,
185922
- readFileSync as readFileSync52,
185966
+ readFileSync as readFileSync53,
185923
185967
  writeFileSync as writeFileSync20,
185924
185968
  readdirSync as readdirSync12,
185925
185969
  statSync as statSync9,
@@ -185932,7 +185976,7 @@ async function restoreCli(options) {
185932
185976
  const realFs = {
185933
185977
  existsSync: existsSync68,
185934
185978
  mkdirSync: mkdirSync22,
185935
- readFileSync: readFileSync52,
185979
+ readFileSync: readFileSync53,
185936
185980
  writeFileSync: writeFileSync20,
185937
185981
  copyFileSync: copyFileSync5,
185938
185982
  readdirSync: readdirSync12,
@@ -185947,7 +185991,7 @@ async function restoreCli(options) {
185947
185991
  try {
185948
185992
  restoreSnapshot(options.state, { snapshotDir, fs: realFs });
185949
185993
  const manifestPath = path19.join(snapshotDir, options.state, "manifest.json");
185950
- const raw = readFileSync52(manifestPath).toString("utf-8");
185994
+ const raw = readFileSync53(manifestPath).toString("utf-8");
185951
185995
  const parsed = JSON.parse(raw);
185952
185996
  const fileCount = typeof parsed === "object" && parsed !== null && "files" in parsed && Array.isArray(parsed.files) ? parsed.files.length : 0;
185953
185997
  if (options.json) {
@@ -185971,7 +186015,7 @@ import {
185971
186015
  existsSync as existsSync69,
185972
186016
  mkdirSync as mkdirSync23,
185973
186017
  copyFileSync as copyFileSync6,
185974
- readFileSync as readFileSync53,
186018
+ readFileSync as readFileSync54,
185975
186019
  writeFileSync as writeFileSync21,
185976
186020
  readdirSync as readdirSync13,
185977
186021
  statSync as statSync10,
@@ -185994,7 +186038,7 @@ async function snapshotListCli(options) {
185994
186038
  const realFs = {
185995
186039
  existsSync: existsSync69,
185996
186040
  mkdirSync: mkdirSync23,
185997
- readFileSync: readFileSync53,
186041
+ readFileSync: readFileSync54,
185998
186042
  writeFileSync: writeFileSync21,
185999
186043
  copyFileSync: copyFileSync6,
186000
186044
  readdirSync: readdirSync13,
@@ -186025,7 +186069,7 @@ import {
186025
186069
  existsSync as existsSync70,
186026
186070
  mkdirSync as mkdirSync24,
186027
186071
  copyFileSync as copyFileSync7,
186028
- readFileSync as readFileSync54,
186072
+ readFileSync as readFileSync55,
186029
186073
  writeFileSync as writeFileSync22,
186030
186074
  readdirSync as readdirSync14,
186031
186075
  statSync as statSync11,
@@ -186038,7 +186082,7 @@ async function snapshotPruneCli(options = {}) {
186038
186082
  const realFs = {
186039
186083
  existsSync: existsSync70,
186040
186084
  mkdirSync: mkdirSync24,
186041
- readFileSync: readFileSync54,
186085
+ readFileSync: readFileSync55,
186042
186086
  writeFileSync: writeFileSync22,
186043
186087
  copyFileSync: copyFileSync7,
186044
186088
  readdirSync: readdirSync14,
@@ -186559,7 +186603,7 @@ async function traceCli(sessionId, options = {}) {
186559
186603
 
186560
186604
  // packages/omo-opencode/src/cli/dashboard.ts
186561
186605
  import * as path25 from "path";
186562
- import { readFileSync as readFileSync56 } from "fs";
186606
+ import { readFileSync as readFileSync57 } from "fs";
186563
186607
 
186564
186608
  // packages/omo-opencode/src/features/dashboard/data-provider.ts
186565
186609
  import * as os12 from "os";
@@ -187294,7 +187338,7 @@ function loadGatewayPassphrase() {
187294
187338
  try {
187295
187339
  const configDir = getConfigDir();
187296
187340
  const configPath = path25.join(configDir, "matrixos.jsonc");
187297
- const raw = readFileSync56(configPath, "utf-8");
187341
+ const raw = readFileSync57(configPath, "utf-8");
187298
187342
  const config5 = parseJsonc(raw);
187299
187343
  const dashboard2 = config5.dashboard;
187300
187344
  return typeof dashboard2?.gatewayPassphrase === "string" ? dashboard2.gatewayPassphrase : undefined;
@@ -187890,8 +187934,8 @@ project.command("search <query>").description("Search the active project KB and
187890
187934
  });
187891
187935
  project.command("add-doc <slug> <file>").description("Copy a document into the project KB").action(async (slug, filePath) => {
187892
187936
  const { addKbDocument: addKbDocument2 } = await Promise.resolve().then(() => (init_project_memory(), exports_project_memory));
187893
- const { readFileSync: readFileSync64 } = await import("fs");
187894
- const content = readFileSync64(filePath, "utf-8");
187937
+ const { readFileSync: readFileSync65 } = await import("fs");
187938
+ const content = readFileSync65(filePath, "utf-8");
187895
187939
  const dest = addKbDocument2(slug, filePath, content);
187896
187940
  process.stdout.write(JSON.stringify({ ok: true, dest }, null, 2) + `
187897
187941
  `);