@kl-c/matrixos 0.2.10 → 0.2.11

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
@@ -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.11",
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",
@@ -67691,10 +67691,12 @@ import {
67691
67691
  symlinkSync,
67692
67692
  readlinkSync,
67693
67693
  readdirSync as readdirSync4,
67694
- unlinkSync as unlinkSync5
67694
+ unlinkSync as unlinkSync5,
67695
+ readFileSync as readFileSync15
67695
67696
  } from "fs";
67696
67697
  import { dirname as dirname9, join as join25 } from "path";
67697
67698
  import { homedir as homedir6 } from "os";
67699
+ import { spawnSync as spawnSync3 } from "child_process";
67698
67700
  function findSlashCommandSource() {
67699
67701
  const candidates = [
67700
67702
  join25(import.meta.dir, "slash-commands"),
@@ -67738,6 +67740,48 @@ function resolveMatrixosBin() {
67738
67740
  }
67739
67741
  return null;
67740
67742
  }
67743
+ function npmGlobalInstallMatrixos(version) {
67744
+ try {
67745
+ const result = spawnSync3("npm", ["install", "-g", `@kl-c/matrixos@${version}`], {
67746
+ stdio: ["ignore", "pipe", "pipe"],
67747
+ shell: false,
67748
+ timeout: 120000
67749
+ });
67750
+ if (result.status !== 0)
67751
+ return null;
67752
+ const found = spawnSync3("command", ["-v", "matrixos"], {
67753
+ stdio: ["ignore", "pipe", "ignore"],
67754
+ shell: false
67755
+ });
67756
+ const bin = found.stdout?.toString().trim();
67757
+ if (bin && existsSync26(bin))
67758
+ return bin;
67759
+ for (const dir of ["/usr/local/bin", "/usr/bin"]) {
67760
+ const p = join25(dir, "matrixos");
67761
+ if (existsSync26(p))
67762
+ return p;
67763
+ }
67764
+ return null;
67765
+ } catch {
67766
+ return null;
67767
+ }
67768
+ }
67769
+ function getPackageVersion() {
67770
+ const candidates = [
67771
+ join25(import.meta.dir, "..", "..", "package.json"),
67772
+ join25(import.meta.dir, "..", "package.json")
67773
+ ];
67774
+ for (const c of candidates) {
67775
+ try {
67776
+ if (!existsSync26(c))
67777
+ continue;
67778
+ const pkg = JSON.parse(readFileSync15(c, "utf-8"));
67779
+ if (pkg.version)
67780
+ return pkg.version;
67781
+ } catch {}
67782
+ }
67783
+ return null;
67784
+ }
67741
67785
  function copyRecursive(from, to) {
67742
67786
  if (!existsSync26(to))
67743
67787
  mkdirSync9(to, { recursive: true });
@@ -67775,6 +67819,11 @@ function installSlashCommandsAndPath() {
67775
67819
  const liveBin = resolveMatrixosBin();
67776
67820
  const linkPath = "/usr/local/bin/matrixos";
67777
67821
  const persistentDir = "/usr/local/lib/matrixos";
67822
+ const version = getPackageVersion();
67823
+ const globalBin = version ? npmGlobalInstallMatrixos(version) : null;
67824
+ if (globalBin) {
67825
+ return { commands: total, pathLinked: true };
67826
+ }
67778
67827
  if (liveBin) {
67779
67828
  try {
67780
67829
  const target = installPackageTo(persistentDir, liveBin) ?? liveBin;
@@ -69649,7 +69698,7 @@ var init_dist5 = __esm(() => {
69649
69698
 
69650
69699
  // packages/omo-opencode/src/cli/config-manager/write-gateway-env.ts
69651
69700
  import { homedir as homedir8 } from "os";
69652
- import { existsSync as existsSync27, mkdirSync as mkdirSync10, readFileSync as readFileSync15, writeFileSync as writeFileSync6, chmodSync as chmodSync3 } from "fs";
69701
+ import { existsSync as existsSync27, mkdirSync as mkdirSync10, readFileSync as readFileSync16, writeFileSync as writeFileSync6, chmodSync as chmodSync3 } from "fs";
69653
69702
  import { join as join27 } from "path";
69654
69703
  function writeGatewayEnvToken(key, token) {
69655
69704
  const configDir = homedir8();
@@ -69658,7 +69707,7 @@ function writeGatewayEnvToken(key, token) {
69658
69707
  const envPath = join27(configDir, GATEWAY_ENV_FILENAME);
69659
69708
  const entries = new Map;
69660
69709
  if (existsSync27(envPath)) {
69661
- const existing = readFileSync15(envPath, "utf-8");
69710
+ const existing = readFileSync16(envPath, "utf-8");
69662
69711
  for (const rawLine of existing.split(`
69663
69712
  `)) {
69664
69713
  const line = rawLine.trim();
@@ -102686,7 +102735,7 @@ var require_Util = __commonJS((exports, module2) => {
102686
102735
  await client3.rest.patch(route, { body: updatedItems, reason });
102687
102736
  return updatedItems;
102688
102737
  }
102689
- function basename6(path7, ext) {
102738
+ function basename5(path7, ext) {
102690
102739
  const res = parse7(path7);
102691
102740
  return ext && res.ext.startsWith(ext) ? res.name : res.base.split("?")[0];
102692
102741
  }
@@ -102809,7 +102858,7 @@ var require_Util = __commonJS((exports, module2) => {
102809
102858
  resolveColor,
102810
102859
  discordSort,
102811
102860
  setPosition,
102812
- basename: basename6,
102861
+ basename: basename5,
102813
102862
  cleanContent,
102814
102863
  cleanCodeBlockContent,
102815
102864
  parseWebhookURL,
@@ -115630,7 +115679,7 @@ var require_MessagePayload = __commonJS((exports, module2) => {
115630
115679
  var { DiscordjsError, DiscordjsRangeError, ErrorCodes } = require_errors();
115631
115680
  var { resolveFile } = require_DataResolver();
115632
115681
  var MessageFlagsBitField = require_MessageFlagsBitField();
115633
- var { basename: basename6, verifyString, resolvePartialEmoji } = require_Util();
115682
+ var { basename: basename5, verifyString, resolvePartialEmoji } = require_Util();
115634
115683
  var getBaseInteraction = lazy2(() => require_BaseInteraction());
115635
115684
 
115636
115685
  class MessagePayload {
@@ -115815,10 +115864,10 @@ var require_MessagePayload = __commonJS((exports, module2) => {
115815
115864
  let name2;
115816
115865
  const findName = (thing) => {
115817
115866
  if (typeof thing === "string") {
115818
- return basename6(thing);
115867
+ return basename5(thing);
115819
115868
  }
115820
115869
  if (thing.path) {
115821
- return basename6(thing.path);
115870
+ return basename5(thing.path);
115822
115871
  }
115823
115872
  return "file.jpg";
115824
115873
  };
@@ -128196,7 +128245,7 @@ var require_EmbedBuilder = __commonJS((exports, module2) => {
128196
128245
 
128197
128246
  // node_modules/.bun/discord.js@14.27.0/node_modules/discord.js/src/structures/AttachmentBuilder.js
128198
128247
  var require_AttachmentBuilder = __commonJS((exports, module2) => {
128199
- var { basename: basename6, flatten } = require_Util();
128248
+ var { basename: basename5, flatten } = require_Util();
128200
128249
 
128201
128250
  class AttachmentBuilder {
128202
128251
  constructor(attachment, data = {}) {
@@ -128244,7 +128293,7 @@ var require_AttachmentBuilder = __commonJS((exports, module2) => {
128244
128293
  return this;
128245
128294
  }
128246
128295
  get spoiler() {
128247
- return basename6(this.name).startsWith("SPOILER_");
128296
+ return basename5(this.name).startsWith("SPOILER_");
128248
128297
  }
128249
128298
  toJSON() {
128250
128299
  return flatten(this);
@@ -154516,7 +154565,7 @@ var require_filesystem = __commonJS((exports2, module2) => {
154516
154565
  var LDD_PATH = "/usr/bin/ldd";
154517
154566
  var SELF_PATH = "/proc/self/exe";
154518
154567
  var MAX_LENGTH = 2048;
154519
- var readFileSync46 = (path18) => {
154568
+ var readFileSync47 = (path18) => {
154520
154569
  const fd = fs18.openSync(path18, "r");
154521
154570
  const buffer = Buffer.alloc(MAX_LENGTH);
154522
154571
  const bytesRead = fs18.readSync(fd, buffer, 0, MAX_LENGTH, 0);
@@ -154539,7 +154588,7 @@ var require_filesystem = __commonJS((exports2, module2) => {
154539
154588
  module2.exports = {
154540
154589
  LDD_PATH,
154541
154590
  SELF_PATH,
154542
- readFileSync: readFileSync46,
154591
+ readFileSync: readFileSync47,
154543
154592
  readFile
154544
154593
  };
154545
154594
  });
@@ -154582,7 +154631,7 @@ var require_elf = __commonJS((exports2, module2) => {
154582
154631
  var require_detect_libc = __commonJS((exports2, module2) => {
154583
154632
  var childProcess = __require("child_process");
154584
154633
  var { isLinux, getReport } = require_process();
154585
- var { LDD_PATH, SELF_PATH, readFile, readFileSync: readFileSync46 } = require_filesystem();
154634
+ var { LDD_PATH, SELF_PATH, readFile, readFileSync: readFileSync47 } = require_filesystem();
154586
154635
  var { interpreterPath } = require_elf();
154587
154636
  var cachedFamilyInterpreter;
154588
154637
  var cachedFamilyFilesystem;
@@ -154673,7 +154722,7 @@ var require_detect_libc = __commonJS((exports2, module2) => {
154673
154722
  }
154674
154723
  cachedFamilyFilesystem = null;
154675
154724
  try {
154676
- const lddContent = readFileSync46(LDD_PATH);
154725
+ const lddContent = readFileSync47(LDD_PATH);
154677
154726
  cachedFamilyFilesystem = getFamilyFromLddContent(lddContent);
154678
154727
  } catch (e) {}
154679
154728
  return cachedFamilyFilesystem;
@@ -154696,7 +154745,7 @@ var require_detect_libc = __commonJS((exports2, module2) => {
154696
154745
  }
154697
154746
  cachedFamilyInterpreter = null;
154698
154747
  try {
154699
- const selfContent = readFileSync46(SELF_PATH);
154748
+ const selfContent = readFileSync47(SELF_PATH);
154700
154749
  const path18 = interpreterPath(selfContent);
154701
154750
  cachedFamilyInterpreter = familyFromInterpreterPath(path18);
154702
154751
  } catch (e) {}
@@ -154758,7 +154807,7 @@ var require_detect_libc = __commonJS((exports2, module2) => {
154758
154807
  }
154759
154808
  cachedVersionFilesystem = null;
154760
154809
  try {
154761
- const lddContent = readFileSync46(LDD_PATH);
154810
+ const lddContent = readFileSync47(LDD_PATH);
154762
154811
  const versionMatch = lddContent.match(RE_GLIBC_VERSION);
154763
154812
  if (versionMatch) {
154764
154813
  cachedVersionFilesystem = versionMatch[1];
@@ -155060,7 +155109,7 @@ var require_libvips = __commonJS((exports2, module2) => {
155060
155109
  var fs18 = __require("fs");
155061
155110
  var os7 = __require("os");
155062
155111
  var path18 = __require("path");
155063
- var spawnSync3 = __require("child_process").spawnSync;
155112
+ var spawnSync4 = __require("child_process").spawnSync;
155064
155113
  var semverCoerce = require_coerce();
155065
155114
  var semverGreaterThanOrEqualTo = require_gte();
155066
155115
  var platform = require_platform();
@@ -155101,14 +155150,14 @@ var require_libvips = __commonJS((exports2, module2) => {
155101
155150
  };
155102
155151
  var isRosetta = function() {
155103
155152
  if (process.platform === "darwin" && process.arch === "x64") {
155104
- const translated = spawnSync3("sysctl sysctl.proc_translated", spawnSyncOptions).stdout;
155153
+ const translated = spawnSync4("sysctl sysctl.proc_translated", spawnSyncOptions).stdout;
155105
155154
  return (translated || "").trim() === "sysctl.proc_translated: 1";
155106
155155
  }
155107
155156
  return false;
155108
155157
  };
155109
155158
  var globalLibvipsVersion = function() {
155110
155159
  if (process.platform !== "win32") {
155111
- const globalLibvipsVersion2 = spawnSync3("pkg-config --modversion vips-cpp", {
155160
+ const globalLibvipsVersion2 = spawnSync4("pkg-config --modversion vips-cpp", {
155112
155161
  ...spawnSyncOptions,
155113
155162
  env: {
155114
155163
  ...env4,
@@ -155128,7 +155177,7 @@ var require_libvips = __commonJS((exports2, module2) => {
155128
155177
  };
155129
155178
  var pkgConfigPath = function() {
155130
155179
  if (process.platform !== "win32") {
155131
- const brewPkgConfigPath = spawnSync3('which brew >/dev/null 2>&1 && brew environment --plain | grep PKG_CONFIG_LIBDIR | cut -d" " -f2', spawnSyncOptions).stdout || "";
155180
+ const brewPkgConfigPath = spawnSync4('which brew >/dev/null 2>&1 && brew environment --plain | grep PKG_CONFIG_LIBDIR | cut -d" " -f2', spawnSyncOptions).stdout || "";
155132
155181
  return [
155133
155182
  brewPkgConfigPath.trim(),
155134
155183
  env4.PKG_CONFIG_PATH,
@@ -164919,7 +164968,7 @@ __export(exports_generate, {
164919
164968
  executeGenerateCommand: () => executeGenerateCommand,
164920
164969
  ProfileNotFoundError: () => ProfileNotFoundError
164921
164970
  });
164922
- import { existsSync as existsSync72, readFileSync as readFileSync57, realpathSync as realpathSync10 } from "fs";
164971
+ import { existsSync as existsSync72, readFileSync as readFileSync58, realpathSync as realpathSync10 } from "fs";
164923
164972
  import { dirname as dirname29, isAbsolute as isAbsolute6, join as join77, resolve as resolve16 } from "path";
164924
164973
  function profilesDirFor(opts) {
164925
164974
  if (opts.profilesDir)
@@ -165017,7 +165066,7 @@ var init_generate = __esm(() => {
165017
165066
  init_src5();
165018
165067
  init_src5();
165019
165068
  REPO_ROOT = resolve16(dirname29(new URL(import.meta.url).pathname), "..", "..", "..", "..", "..");
165020
- defaultFS2 = { existsSync: existsSync72, readFileSync: readFileSync57, realpathSync: realpathSync10 };
165069
+ defaultFS2 = { existsSync: existsSync72, readFileSync: readFileSync58, realpathSync: realpathSync10 };
165021
165070
  ProfileNotFoundError = class ProfileNotFoundError extends Error {
165022
165071
  profileName;
165023
165072
  constructor(profileName) {
@@ -165271,7 +165320,7 @@ var exports_profile_resolve = {};
165271
165320
  __export(exports_profile_resolve, {
165272
165321
  executeProfileResolveCommand: () => executeProfileResolveCommand
165273
165322
  });
165274
- import { existsSync as existsSync74, readdirSync as readdirSync16, readFileSync as readFileSync58 } from "fs";
165323
+ import { existsSync as existsSync74, readdirSync as readdirSync16, readFileSync as readFileSync59 } from "fs";
165275
165324
  import { join as join80, resolve as resolve17, dirname as dirname30 } from "path";
165276
165325
  function executeProfileResolveCommand(args) {
165277
165326
  if (args.options.help) {
@@ -165318,7 +165367,7 @@ function executeProfileResolveCommand(args) {
165318
165367
  for (const file3 of profileFiles) {
165319
165368
  try {
165320
165369
  const filePath = join80(profilesDir, file3);
165321
- const raw = JSON.parse(readFileSync58(filePath, "utf-8"));
165370
+ const raw = JSON.parse(readFileSync59(filePath, "utf-8"));
165322
165371
  const profile2 = ProfileSchema.parse(raw);
165323
165372
  registry2[profile2.name] = profile2;
165324
165373
  } catch {}
@@ -165380,9 +165429,9 @@ __export(exports_export, {
165380
165429
  getShell: () => getShell,
165381
165430
  executeExportCommand: () => executeExportCommand
165382
165431
  });
165383
- import { existsSync as existsSync75, readFileSync as readFileSync59, writeFileSync as writeFileSync26, copyFileSync as copyFileSync8, realpathSync as realpathSync11, mkdirSync as mkdirSync27 } from "fs";
165432
+ import { existsSync as existsSync75, readFileSync as readFileSync60, writeFileSync as writeFileSync26, copyFileSync as copyFileSync8, realpathSync as realpathSync11, mkdirSync as mkdirSync27 } from "fs";
165384
165433
  import { isAbsolute as isAbsolute7, join as join81, resolve as resolve18, dirname as dirname31 } from "path";
165385
- import { spawnSync as spawnSync3 } from "child_process";
165434
+ import { spawnSync as spawnSync4 } from "child_process";
165386
165435
  function setShell(shell) {
165387
165436
  activeShell = shell;
165388
165437
  }
@@ -165494,7 +165543,7 @@ var init_export = __esm(() => {
165494
165543
  defaultShell = {
165495
165544
  run(cmd, cwd) {
165496
165545
  const parts = cmd.split(/\s+/);
165497
- const result = spawnSync3(parts[0], parts.slice(1), { cwd, encoding: "utf-8", windowsHide: process.platform === "win32" });
165546
+ const result = spawnSync4(parts[0], parts.slice(1), { cwd, encoding: "utf-8", windowsHide: process.platform === "win32" });
165498
165547
  return {
165499
165548
  code: result.status ?? 1,
165500
165549
  stdout: (result.stdout ?? result.stderr ?? "").toString().trim()
@@ -165504,7 +165553,7 @@ var init_export = __esm(() => {
165504
165553
  activeShell = defaultShell;
165505
165554
  defaultExportFS = {
165506
165555
  existsSync: existsSync75,
165507
- readFileSync: readFileSync59,
165556
+ readFileSync: readFileSync60,
165508
165557
  writeFileSync: writeFileSync26,
165509
165558
  copyFileSync: copyFileSync8,
165510
165559
  realpathSync: realpathSync11,
@@ -165532,7 +165581,7 @@ __export(exports_project_context, {
165532
165581
  createProject: () => createProject,
165533
165582
  archiveProject: () => archiveProject
165534
165583
  });
165535
- import { existsSync as existsSync76, mkdirSync as mkdirSync28, readFileSync as readFileSync60, writeFileSync as writeFileSync27, rmSync as rmSync8 } from "fs";
165584
+ import { existsSync as existsSync76, mkdirSync as mkdirSync28, readFileSync as readFileSync61, writeFileSync as writeFileSync27, rmSync as rmSync8 } from "fs";
165536
165585
  import { join as join82 } from "path";
165537
165586
  function getMatrixOsDir(cwd = process.cwd()) {
165538
165587
  return join82(cwd, ".matrixos");
@@ -165551,7 +165600,7 @@ function loadState(cwd) {
165551
165600
  if (!existsSync76(path29))
165552
165601
  return {};
165553
165602
  try {
165554
- return JSON.parse(readFileSync60(path29, "utf-8"));
165603
+ return JSON.parse(readFileSync61(path29, "utf-8"));
165555
165604
  } catch {
165556
165605
  return {};
165557
165606
  }
@@ -165567,7 +165616,7 @@ function loadProjectMeta(slug, cwd) {
165567
165616
  if (!existsSync76(path29))
165568
165617
  return null;
165569
165618
  try {
165570
- return JSON.parse(readFileSync60(path29, "utf-8"));
165619
+ return JSON.parse(readFileSync61(path29, "utf-8"));
165571
165620
  } catch {
165572
165621
  return null;
165573
165622
  }
@@ -165693,7 +165742,7 @@ __export(exports_project_memory, {
165693
165742
  isProjectEpisode: () => isProjectEpisode,
165694
165743
  addKbDocument: () => addKbDocument
165695
165744
  });
165696
- import { existsSync as existsSync77, mkdirSync as mkdirSync29, readFileSync as readFileSync61, readdirSync as readdirSync17, writeFileSync as writeFileSync28 } from "fs";
165745
+ import { existsSync as existsSync77, mkdirSync as mkdirSync29, readFileSync as readFileSync62, readdirSync as readdirSync17, writeFileSync as writeFileSync28 } from "fs";
165697
165746
  import { join as join83 } from "path";
165698
165747
  function tagWithProject(metadata = {}, projectSlug, cwd) {
165699
165748
  const active = projectSlug ?? getActiveProject(cwd)?.slug;
@@ -165717,7 +165766,7 @@ function listKbDocuments(projectSlug, cwd) {
165717
165766
  continue;
165718
165767
  const path29 = join83(kbDir, entry.name);
165719
165768
  try {
165720
- docs.push({ path: path29, content: readFileSync61(path29, "utf-8") });
165769
+ docs.push({ path: path29, content: readFileSync62(path29, "utf-8") });
165721
165770
  } catch {}
165722
165771
  }
165723
165772
  return docs;
@@ -166139,12 +166188,12 @@ __export(exports_gateway_start, {
166139
166188
  buildTelegramConfig: () => buildTelegramConfig,
166140
166189
  buildGatewayConfig: () => buildGatewayConfig
166141
166190
  });
166142
- import { readFileSync as readFileSync62, existsSync as existsSync78 } from "fs";
166191
+ import { readFileSync as readFileSync63, existsSync as existsSync78 } from "fs";
166143
166192
  import { resolve as resolve19 } from "path";
166144
166193
  function loadGatewayEnv(path29 = ENV_PATH) {
166145
166194
  if (!existsSync78(path29))
166146
166195
  return {};
166147
- const text = readFileSync62(path29, "utf8");
166196
+ const text = readFileSync63(path29, "utf8");
166148
166197
  const out = {};
166149
166198
  for (const raw of text.split(/\r?\n/)) {
166150
166199
  const line = raw.trim();
@@ -166614,7 +166663,7 @@ var init_deployment = __esm(() => {
166614
166663
  });
166615
166664
 
166616
166665
  // packages/omo-opencode/src/audit/self-audit.ts
166617
- import { existsSync as existsSync80, mkdirSync as mkdirSync30, readdirSync as readdirSync18, readFileSync as readFileSync63, writeFileSync as writeFileSync29 } from "fs";
166666
+ import { existsSync as existsSync80, mkdirSync as mkdirSync30, readdirSync as readdirSync18, readFileSync as readFileSync64, writeFileSync as writeFileSync29 } from "fs";
166618
166667
  import { join as join84 } from "path";
166619
166668
  function getAuditDir(cwd = process.cwd()) {
166620
166669
  return join84(cwd, ".matrixos", "audits");
@@ -169268,7 +169317,7 @@ var BOULDER_STATE_PATH = `${BOULDER_DIR}/${BOULDER_FILE}`;
169268
169317
  var NOTEPAD_DIR = "notepads";
169269
169318
  var NOTEPAD_BASE_PATH = `${BOULDER_DIR}/${NOTEPAD_DIR}`;
169270
169319
  // packages/boulder-state/src/top-level-task.ts
169271
- import { existsSync as existsSync32, readFileSync as readFileSync18 } from "fs";
169320
+ import { existsSync as existsSync32, readFileSync as readFileSync19 } from "fs";
169272
169321
  var TODO_HEADING_PATTERN = /^##\s+TODOs\b/i;
169273
169322
  var FINAL_VERIFICATION_HEADING_PATTERN = /^##\s+Final Verification Wave\b/i;
169274
169323
  var SECOND_LEVEL_HEADING_PATTERN = /^##\s+/;
@@ -169295,7 +169344,7 @@ function readCurrentTopLevelTask(planPath) {
169295
169344
  return null;
169296
169345
  }
169297
169346
  try {
169298
- const content = readFileSync18(planPath, "utf-8");
169347
+ const content = readFileSync19(planPath, "utf-8");
169299
169348
  const lines = content.split(/\r?\n/);
169300
169349
  let section = "other";
169301
169350
  for (const line of lines) {
@@ -169347,7 +169396,7 @@ function resolveBoulderPlanPathForWork(directory, work) {
169347
169396
  return resolveBoulderPlanPath(directory, work);
169348
169397
  }
169349
169398
  // packages/boulder-state/src/storage/plan-progress.ts
169350
- import { existsSync as existsSync34, readFileSync as readFileSync19, readdirSync as readdirSync5, statSync as statSync5 } from "fs";
169399
+ import { existsSync as existsSync34, readFileSync as readFileSync20, readdirSync as readdirSync5, statSync as statSync5 } from "fs";
169351
169400
  var TODO_HEADING_PATTERN2 = /^##\s+TODOs\b/i;
169352
169401
  var FINAL_VERIFICATION_HEADING_PATTERN2 = /^##\s+Final Verification Wave\b/i;
169353
169402
  var SECOND_LEVEL_HEADING_PATTERN2 = /^##\s+/;
@@ -169360,7 +169409,7 @@ function getPlanProgress(planPath) {
169360
169409
  return { total: 0, completed: 0, isComplete: false };
169361
169410
  }
169362
169411
  try {
169363
- const content = readFileSync19(planPath, "utf-8");
169412
+ const content = readFileSync20(planPath, "utf-8");
169364
169413
  const lines = content.split(/\r?\n/);
169365
169414
  const hasStructuredSections = lines.some((line) => TODO_HEADING_PATTERN2.test(line) || FINAL_VERIFICATION_HEADING_PATTERN2.test(line));
169366
169415
  if (hasStructuredSections) {
@@ -169476,14 +169525,14 @@ function selectMirrorWork(state) {
169476
169525
  return sorted[0] ?? null;
169477
169526
  }
169478
169527
  // packages/boulder-state/src/storage/read-state.ts
169479
- import { existsSync as existsSync35, readFileSync as readFileSync20 } from "fs";
169528
+ import { existsSync as existsSync35, readFileSync as readFileSync21 } from "fs";
169480
169529
  function readBoulderState(directory) {
169481
169530
  const filePath = getBoulderFilePath(directory);
169482
169531
  if (!existsSync35(filePath)) {
169483
169532
  return null;
169484
169533
  }
169485
169534
  try {
169486
- const content = readFileSync20(filePath, "utf-8");
169535
+ const content = readFileSync21(filePath, "utf-8");
169487
169536
  const parsed = JSON.parse(content);
169488
169537
  if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
169489
169538
  return null;
@@ -169549,7 +169598,7 @@ init_state();
169549
169598
  // packages/omo-opencode/src/features/run-continuation-state/constants.ts
169550
169599
  var CONTINUATION_MARKER_DIR = ".omo/run-continuation";
169551
169600
  // packages/omo-opencode/src/features/run-continuation-state/storage.ts
169552
- import { existsSync as existsSync36, mkdirSync as mkdirSync12, readFileSync as readFileSync21, rmSync as rmSync2, writeFileSync as writeFileSync9 } from "fs";
169601
+ import { existsSync as existsSync36, mkdirSync as mkdirSync12, readFileSync as readFileSync22, rmSync as rmSync2, writeFileSync as writeFileSync9 } from "fs";
169553
169602
  import { join as join31 } from "path";
169554
169603
  function getMarkerPath(directory, sessionID) {
169555
169604
  return join31(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
@@ -169559,7 +169608,7 @@ function readContinuationMarker(directory, sessionID) {
169559
169608
  if (!existsSync36(markerPath))
169560
169609
  return null;
169561
169610
  try {
169562
- const raw = readFileSync21(markerPath, "utf-8");
169611
+ const raw = readFileSync22(markerPath, "utf-8");
169563
169612
  const parsed = JSON.parse(raw);
169564
169613
  if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
169565
169614
  return null;
@@ -169624,7 +169673,7 @@ async function isSessionInBoulderLineage(input) {
169624
169673
  // packages/omo-opencode/src/hooks/the-operator/session-last-agent.ts
169625
169674
  init_shared();
169626
169675
  init_compaction_marker();
169627
- import { readFileSync as readFileSync22, readdirSync as readdirSync6 } from "fs";
169676
+ import { readFileSync as readFileSync23, readdirSync as readdirSync6 } from "fs";
169628
169677
  import { join as join32 } from "path";
169629
169678
  var defaultSessionLastAgentDeps = {
169630
169679
  getMessageDir,
@@ -169685,7 +169734,7 @@ async function getLastAgentFromSession(sessionID, client3, deps = {}) {
169685
169734
  try {
169686
169735
  const messages = readdirSync6(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
169687
169736
  try {
169688
- const content = readFileSync22(join32(messageDir, fileName), "utf-8");
169737
+ const content = readFileSync23(join32(messageDir, fileName), "utf-8");
169689
169738
  const parsed = JSON.parse(content);
169690
169739
  return {
169691
169740
  fileName,
@@ -169728,7 +169777,7 @@ init_agent_display_names();
169728
169777
 
169729
169778
  // packages/omo-opencode/src/hooks/ralph-loop/storage.ts
169730
169779
  init_frontmatter2();
169731
- import { existsSync as existsSync37, readFileSync as readFileSync23, writeFileSync as writeFileSync10, unlinkSync as unlinkSync6, mkdirSync as mkdirSync13 } from "fs";
169780
+ import { existsSync as existsSync37, readFileSync as readFileSync24, writeFileSync as writeFileSync10, unlinkSync as unlinkSync6, mkdirSync as mkdirSync13 } from "fs";
169732
169781
  import { dirname as dirname13, join as join33 } from "path";
169733
169782
 
169734
169783
  // packages/omo-opencode/src/hooks/ralph-loop/constants.ts
@@ -169746,7 +169795,7 @@ function readState(directory, customPath) {
169746
169795
  return null;
169747
169796
  }
169748
169797
  try {
169749
- const content = readFileSync23(filePath, "utf-8");
169798
+ const content = readFileSync24(filePath, "utf-8");
169750
169799
  const { data, body } = parseFrontmatter(content);
169751
169800
  const active = data.active;
169752
169801
  const iteration = data.iteration;
@@ -170321,8 +170370,8 @@ function createTimestampedStdoutController(stdout2 = process.stdout) {
170321
170370
  // packages/telemetry-core/src/activity-state.ts
170322
170371
  init_atomic_write();
170323
170372
  init_xdg_data_dir();
170324
- import { existsSync as existsSync38, mkdirSync as mkdirSync14, readFileSync as readFileSync24 } from "fs";
170325
- import { basename as basename7, join as join34 } from "path";
170373
+ import { existsSync as existsSync38, mkdirSync as mkdirSync14, readFileSync as readFileSync25 } from "fs";
170374
+ import { basename as basename6, join as join34 } from "path";
170326
170375
  var POSTHOG_ACTIVITY_STATE_FILE = "posthog-activity.json";
170327
170376
  function resolveTelemetryStateDir(product, options = {}) {
170328
170377
  const dataDir = resolveXdgDataDir(product.cacheDirName, {
@@ -170330,7 +170379,7 @@ function resolveTelemetryStateDir(product, options = {}) {
170330
170379
  osProvider: options.osProvider
170331
170380
  });
170332
170381
  const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined : join34(options.env.XDG_DATA_HOME, product.cacheDirName);
170333
- if (dataDir === xdgStateDir || xdgStateDir === undefined && basename7(dataDir) === product.cacheDirName) {
170382
+ if (dataDir === xdgStateDir || xdgStateDir === undefined && basename6(dataDir) === product.cacheDirName) {
170334
170383
  return dataDir;
170335
170384
  }
170336
170385
  return join34(dataDir, product.cacheDirName);
@@ -170365,7 +170414,7 @@ function readPostHogActivityState(stateDir, diagnostics) {
170365
170414
  return {};
170366
170415
  }
170367
170416
  try {
170368
- const stateContent = readFileSync24(stateFilePath, "utf-8");
170417
+ const stateContent = readFileSync25(stateFilePath, "utf-8");
170369
170418
  const stateJson = JSON.parse(stateContent);
170370
170419
  if (!isPostHogActivityState(stateJson)) {
170371
170420
  return {};
@@ -177488,7 +177537,7 @@ init_constants5();
177488
177537
 
177489
177538
  // packages/omo-opencode/src/cli/doctor/checks/system.ts
177490
177539
  init_constants5();
177491
- import { existsSync as existsSync49, readFileSync as readFileSync34 } from "fs";
177540
+ import { existsSync as existsSync49, readFileSync as readFileSync35 } from "fs";
177492
177541
 
177493
177542
  // packages/omo-opencode/src/cli/doctor/checks/system-binary.ts
177494
177543
  init_extract_semver();
@@ -177685,7 +177734,7 @@ function compareVersions3(current, minimum) {
177685
177734
 
177686
177735
  // packages/omo-opencode/src/cli/doctor/checks/system-plugin.ts
177687
177736
  init_shared();
177688
- import { existsSync as existsSync47, readFileSync as readFileSync32 } from "fs";
177737
+ import { existsSync as existsSync47, readFileSync as readFileSync33 } from "fs";
177689
177738
  function detectConfigPath() {
177690
177739
  const paths2 = getOpenCodeConfigPaths({ binary: "opencode", version: null });
177691
177740
  if (existsSync47(paths2.configJsonc))
@@ -177736,7 +177785,7 @@ function getPluginInfo() {
177736
177785
  };
177737
177786
  }
177738
177787
  try {
177739
- const content = readFileSync32(configPath, "utf-8");
177788
+ const content = readFileSync33(configPath, "utf-8");
177740
177789
  const parsedConfig = parseJsonc(content);
177741
177790
  const pluginEntry = findPluginEntry2(parsedConfig.plugin ?? []);
177742
177791
  if (!pluginEntry) {
@@ -177780,7 +177829,7 @@ init_auto_update_checker();
177780
177829
  init_package_json_locator();
177781
177830
  init_constants5();
177782
177831
  init_shared();
177783
- import { existsSync as existsSync48, readFileSync as readFileSync33, readdirSync as readdirSync8 } from "fs";
177832
+ import { existsSync as existsSync48, readFileSync as readFileSync34, readdirSync as readdirSync8 } from "fs";
177784
177833
  import { createRequire as createRequire2 } from "module";
177785
177834
  import { homedir as homedir13 } from "os";
177786
177835
  import { join as join42 } from "path";
@@ -177811,7 +177860,7 @@ function readPackageJson(filePath) {
177811
177860
  if (!existsSync48(filePath))
177812
177861
  return null;
177813
177862
  try {
177814
- const content = readFileSync33(filePath, "utf-8");
177863
+ const content = readFileSync34(filePath, "utf-8");
177815
177864
  return parseJsonc(content);
177816
177865
  } catch (error51) {
177817
177866
  if (!(error51 instanceof Error)) {
@@ -177945,7 +177994,7 @@ var defaultDeps6 = {
177945
177994
  getLatestPluginVersion,
177946
177995
  getSuggestedInstallTag,
177947
177996
  configExists: existsSync49,
177948
- readConfigFile: (path14) => readFileSync34(path14, "utf-8"),
177997
+ readConfigFile: (path14) => readFileSync35(path14, "utf-8"),
177949
177998
  parseConfigContent: (content) => parseJsonc(content)
177950
177999
  };
177951
178000
  var BUN_POSTINSTALL_HELPER_PACKAGE_NAME = "@code-yeongyu/comment-checker";
@@ -178090,7 +178139,7 @@ async function checkSystem(deps = defaultDeps6) {
178090
178139
 
178091
178140
  // packages/omo-opencode/src/config/validate.ts
178092
178141
  init_src();
178093
- import { readFileSync as readFileSync35 } from "fs";
178142
+ import { readFileSync as readFileSync36 } from "fs";
178094
178143
  import { homedir as homedir14 } from "os";
178095
178144
  import { dirname as dirname19, relative as relative5 } from "path";
178096
178145
  init_shared();
@@ -178135,7 +178184,7 @@ function schemaMessages(configPath, rawConfig) {
178135
178184
  }
178136
178185
  function parseLayerConfig(configPath) {
178137
178186
  try {
178138
- const content = readFileSync35(configPath, "utf-8");
178187
+ const content = readFileSync36(configPath, "utf-8");
178139
178188
  const rawConfig = parseJsonc(content);
178140
178189
  if (!isPlainRecord(rawConfig)) {
178141
178190
  return {
@@ -178207,7 +178256,7 @@ init_constants5();
178207
178256
 
178208
178257
  // packages/omo-opencode/src/cli/doctor/checks/model-resolution-cache.ts
178209
178258
  init_shared();
178210
- import { existsSync as existsSync50, readFileSync as readFileSync36 } from "fs";
178259
+ import { existsSync as existsSync50, readFileSync as readFileSync37 } from "fs";
178211
178260
  import { homedir as homedir15 } from "os";
178212
178261
  import { join as join43 } from "path";
178213
178262
  function getUserConfigDir2() {
@@ -178226,7 +178275,7 @@ function loadCustomProviderNames() {
178226
178275
  if (!existsSync50(configPath))
178227
178276
  continue;
178228
178277
  try {
178229
- const content = readFileSync36(configPath, "utf-8");
178278
+ const content = readFileSync37(configPath, "utf-8");
178230
178279
  const data = parseJsonc(content);
178231
178280
  if (data?.provider && typeof data.provider === "object") {
178232
178281
  return Object.keys(data.provider);
@@ -178250,7 +178299,7 @@ function loadAvailableModelsFromCache() {
178250
178299
  return { providers: [], modelCount: 0, cacheExists: false };
178251
178300
  }
178252
178301
  try {
178253
- const content = readFileSync36(cacheFile, "utf-8");
178302
+ const content = readFileSync37(cacheFile, "utf-8");
178254
178303
  const data = parseJsonc(content);
178255
178304
  const cacheProviders = Object.keys(data);
178256
178305
  let modelCount = 0;
@@ -178278,7 +178327,7 @@ init_constants5();
178278
178327
  // packages/omo-opencode/src/cli/doctor/checks/model-resolution-config.ts
178279
178328
  init_shared();
178280
178329
  init_plugin_identity();
178281
- import { readFileSync as readFileSync37 } from "fs";
178330
+ import { readFileSync as readFileSync38 } from "fs";
178282
178331
  import { join as join44 } from "path";
178283
178332
  var PROJECT_CONFIG_DIR = join44(process.cwd(), ".opencode");
178284
178333
  function loadOmoConfig() {
@@ -178288,7 +178337,7 @@ function loadOmoConfig() {
178288
178337
  });
178289
178338
  if (projectDetected.format !== "none") {
178290
178339
  try {
178291
- const content = readFileSync37(projectDetected.path, "utf-8");
178340
+ const content = readFileSync38(projectDetected.path, "utf-8");
178292
178341
  return parseJsonc(content);
178293
178342
  } catch (error51) {
178294
178343
  if (error51 instanceof Error) {
@@ -178304,7 +178353,7 @@ function loadOmoConfig() {
178304
178353
  });
178305
178354
  if (userDetected.format !== "none") {
178306
178355
  try {
178307
- const content = readFileSync37(userDetected.path, "utf-8");
178356
+ const content = readFileSync38(userDetected.path, "utf-8");
178308
178357
  return parseJsonc(content);
178309
178358
  } catch (error51) {
178310
178359
  if (error51 instanceof Error) {
@@ -178885,13 +178934,13 @@ async function getGhCliInfo(dependencies = {}) {
178885
178934
  }
178886
178935
 
178887
178936
  // packages/omo-opencode/src/cli/doctor/checks/tools-lsp.ts
178888
- import { readFileSync as readFileSync39 } from "fs";
178937
+ import { readFileSync as readFileSync40 } from "fs";
178889
178938
  import { join as join48 } from "path";
178890
178939
 
178891
178940
  // packages/omo-opencode/src/mcp/lsp.ts
178892
178941
  init_zod();
178893
178942
  init_opencode_config_dir();
178894
- import { existsSync as existsSync52, readFileSync as readFileSync38 } from "fs";
178943
+ import { existsSync as existsSync52, readFileSync as readFileSync39 } from "fs";
178895
178944
  import { delimiter as delimiter3, dirname as dirname21, resolve as resolve10 } from "path";
178896
178945
  import { fileURLToPath as fileURLToPath6 } from "url";
178897
178946
 
@@ -178905,7 +178954,7 @@ function hasCliSuffix(candidatePath, suffix) {
178905
178954
 
178906
178955
  // packages/omo-opencode/src/mcp/runtime-executable.ts
178907
178956
  init_bun_which_shim();
178908
- import { basename as basename8 } from "path";
178957
+ import { basename as basename7 } from "path";
178909
178958
  var NODE_EXECUTABLE_NAMES = new Set(["node", "node.exe"]);
178910
178959
  function isUnsafeCommandName2(commandName) {
178911
178960
  if (commandName.length === 0)
@@ -178921,7 +178970,7 @@ function isUnsafeCommandName2(commandName) {
178921
178970
  return false;
178922
178971
  }
178923
178972
  function isNodeExecPath(execPath) {
178924
- return NODE_EXECUTABLE_NAMES.has(basename8(execPath).toLowerCase());
178973
+ return NODE_EXECUTABLE_NAMES.has(basename7(execPath).toLowerCase());
178925
178974
  }
178926
178975
  function resolveRuntimeExecutable(commandName, options = {}) {
178927
178976
  if (isUnsafeCommandName2(commandName)) {
@@ -179035,7 +179084,7 @@ function findBootstrapRoot(candidates, pathExists) {
179035
179084
  }
179036
179085
  function readDaemonPackageVersion(root) {
179037
179086
  try {
179038
- const packageJson = JSON.parse(readFileSync38(resolve10(root, PACKAGE_REL, "package.json"), "utf-8"));
179087
+ const packageJson = JSON.parse(readFileSync39(resolve10(root, PACKAGE_REL, "package.json"), "utf-8"));
179039
179088
  return DaemonPackageSchema.parse(packageJson).version;
179040
179089
  } catch (error51) {
179041
179090
  if (!(error51 instanceof Error))
@@ -179112,7 +179161,7 @@ function readOmoConfig(configDirectory) {
179112
179161
  return null;
179113
179162
  }
179114
179163
  try {
179115
- const content = readFileSync39(detected.path, "utf-8");
179164
+ const content = readFileSync40(detected.path, "utf-8");
179116
179165
  return parseJsonc(content);
179117
179166
  } catch (error51) {
179118
179167
  if (!(error51 instanceof Error)) {
@@ -179142,7 +179191,7 @@ function getInstalledLspServers(options = {}) {
179142
179191
 
179143
179192
  // packages/omo-opencode/src/cli/doctor/checks/tools-mcp.ts
179144
179193
  init_shared();
179145
- import { existsSync as existsSync53, readFileSync as readFileSync40 } from "fs";
179194
+ import { existsSync as existsSync53, readFileSync as readFileSync41 } from "fs";
179146
179195
  import { homedir as homedir18 } from "os";
179147
179196
  import { join as join49 } from "path";
179148
179197
  var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
@@ -179159,7 +179208,7 @@ function loadUserMcpConfig() {
179159
179208
  if (!existsSync53(configPath))
179160
179209
  continue;
179161
179210
  try {
179162
- const content = readFileSync40(configPath, "utf-8");
179211
+ const content = readFileSync41(configPath, "utf-8");
179163
179212
  const config5 = parseJsonc(content);
179164
179213
  if (config5.mcpServers) {
179165
179214
  Object.assign(servers, config5.mcpServers);
@@ -179294,7 +179343,7 @@ async function checkTools() {
179294
179343
  }
179295
179344
 
179296
179345
  // packages/omo-opencode/src/cli/doctor/checks/telemetry.ts
179297
- import { existsSync as existsSync54, readFileSync as readFileSync41 } from "fs";
179346
+ import { existsSync as existsSync54, readFileSync as readFileSync42 } from "fs";
179298
179347
  init_constants5();
179299
179348
  function isTelemetryState(value) {
179300
179349
  return value !== null && typeof value === "object" && !Array.isArray(value);
@@ -179305,7 +179354,7 @@ function readLastActiveDay(stateFilePath) {
179305
179354
  }
179306
179355
  let parsed;
179307
179356
  try {
179308
- parsed = JSON.parse(readFileSync41(stateFilePath, "utf-8"));
179357
+ parsed = JSON.parse(readFileSync42(stateFilePath, "utf-8"));
179309
179358
  } catch (error51) {
179310
179359
  if (error51 instanceof Error) {
179311
179360
  return "unreadable";
@@ -179381,7 +179430,7 @@ function expandHomeDirectory(directoryPath) {
179381
179430
  init_constants5();
179382
179431
  init_shared();
179383
179432
  init_plugin_identity();
179384
- import { readFileSync as readFileSync42, promises as fs15 } from "fs";
179433
+ import { readFileSync as readFileSync43, promises as fs15 } from "fs";
179385
179434
  import path15 from "path";
179386
179435
  async function checkTeamMode() {
179387
179436
  const config5 = loadTeamModeConfig();
@@ -179418,7 +179467,7 @@ function loadTeamModeConfig() {
179418
179467
  if (!configPath)
179419
179468
  return { team_mode: undefined };
179420
179469
  try {
179421
- return parseJsonc(readFileSync42(configPath, "utf-8"));
179470
+ return parseJsonc(readFileSync43(configPath, "utf-8"));
179422
179471
  } catch (error51) {
179423
179472
  if (error51 instanceof Error) {
179424
179473
  return { team_mode: undefined };
@@ -179859,12 +179908,12 @@ import {
179859
179908
  existsSync as existsSync57,
179860
179909
  mkdirSync as mkdirSync16,
179861
179910
  readdirSync as readdirSync9,
179862
- readFileSync as readFileSync44,
179911
+ readFileSync as readFileSync45,
179863
179912
  renameSync as renameSync7,
179864
179913
  unlinkSync as unlinkSync9,
179865
179914
  writeFileSync as writeFileSync14
179866
179915
  } from "fs";
179867
- import { basename as basename9, dirname as dirname22, join as join52 } from "path";
179916
+ import { basename as basename8, dirname as dirname22, join as join52 } from "path";
179868
179917
 
179869
179918
  // packages/mcp-client-core/src/config-dir.ts
179870
179919
  import { existsSync as existsSync55, realpathSync as realpathSync7 } from "fs";
@@ -179892,7 +179941,7 @@ function getOpenCodeCliConfigDir(env2 = process.env) {
179892
179941
  }
179893
179942
 
179894
179943
  // packages/mcp-client-core/src/mcp-oauth/storage-index.ts
179895
- import { chmodSync as chmodSync5, existsSync as existsSync56, readFileSync as readFileSync43, renameSync as renameSync6, writeFileSync as writeFileSync13 } from "fs";
179944
+ import { chmodSync as chmodSync5, existsSync as existsSync56, readFileSync as readFileSync44, renameSync as renameSync6, writeFileSync as writeFileSync13 } from "fs";
179896
179945
  import { join as join51 } from "path";
179897
179946
  var INDEX_FILE_NAME = "index.json";
179898
179947
  function isTokenIndex(value) {
@@ -179908,7 +179957,7 @@ function readTokenIndex(storageDir) {
179908
179957
  if (!existsSync56(indexPath))
179909
179958
  return {};
179910
179959
  try {
179911
- const parsed = JSON.parse(readFileSync43(indexPath, "utf-8"));
179960
+ const parsed = JSON.parse(readFileSync44(indexPath, "utf-8"));
179912
179961
  return isTokenIndex(parsed) ? parsed : {};
179913
179962
  } catch (readError) {
179914
179963
  if (!(readError instanceof Error))
@@ -180018,7 +180067,7 @@ function readTokenFile(filePath) {
180018
180067
  if (!existsSync57(filePath))
180019
180068
  return null;
180020
180069
  try {
180021
- const parsed = JSON.parse(readFileSync44(filePath, "utf-8"));
180070
+ const parsed = JSON.parse(readFileSync45(filePath, "utf-8"));
180022
180071
  return isOAuthTokenData(parsed) ? parsed : null;
180023
180072
  } catch (readError) {
180024
180073
  if (!(readError instanceof Error))
@@ -180031,7 +180080,7 @@ function readLegacyStore() {
180031
180080
  if (!existsSync57(filePath))
180032
180081
  return null;
180033
180082
  try {
180034
- const parsed = JSON.parse(readFileSync44(filePath, "utf-8"));
180083
+ const parsed = JSON.parse(readFileSync45(filePath, "utf-8"));
180035
180084
  if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed))
180036
180085
  return null;
180037
180086
  const result = {};
@@ -180149,7 +180198,7 @@ function listAllTokens() {
180149
180198
  if (!entry.isFile() || !entry.name.endsWith(".json") || entry.name === "index.json")
180150
180199
  continue;
180151
180200
  const token = readTokenFile(join52(dir, entry.name));
180152
- const hash2 = basename9(entry.name, ".json");
180201
+ const hash2 = basename8(entry.name, ".json");
180153
180202
  if (token)
180154
180203
  result[index[hash2] ?? hash2] = token;
180155
180204
  }
@@ -180844,7 +180893,7 @@ function createEmbeddingPort() {
180844
180893
  // packages/learning-loop/src/codebase-scanner.ts
180845
180894
  var import_picomatch = __toESM(require_picomatch2(), 1);
180846
180895
  import { createHash as createHash5 } from "crypto";
180847
- import { readdirSync as readdirSync10, readFileSync as readFileSync46, statSync as statSync7, existsSync as existsSync59 } from "fs";
180896
+ import { readdirSync as readdirSync10, readFileSync as readFileSync47, statSync as statSync7, existsSync as existsSync59 } from "fs";
180848
180897
  import { join as join53, relative as relative6, extname as extname3 } from "path";
180849
180898
  var EXT_TO_LANG = {
180850
180899
  ts: "typescript",
@@ -180912,7 +180961,7 @@ function defaultFs() {
180912
180961
  return readdirSync10(path18);
180913
180962
  },
180914
180963
  readFile(path18) {
180915
- return readFileSync46(path18, "utf-8");
180964
+ return readFileSync47(path18, "utf-8");
180916
180965
  },
180917
180966
  stat(path18) {
180918
180967
  const s = statSync7(path18);
@@ -181265,8 +181314,8 @@ function formatSearchResults(result) {
181265
181314
  }
181266
181315
 
181267
181316
  // packages/learning-loop/src/improvement.ts
181268
- import { existsSync as existsSync60, mkdirSync as mkdirSync18, readFileSync as readFileSync47, writeFileSync as writeFileSync16 } from "fs";
181269
- import { join as join54, basename as basename11 } from "path";
181317
+ import { existsSync as existsSync60, mkdirSync as mkdirSync18, readFileSync as readFileSync48, writeFileSync as writeFileSync16 } from "fs";
181318
+ import { join as join54, basename as basename10 } from "path";
181270
181319
  function createImprovementStore(improvementsDir) {
181271
181320
  if (!existsSync60(improvementsDir)) {
181272
181321
  mkdirSync18(improvementsDir, { recursive: true });
@@ -181287,12 +181336,12 @@ function createImprovementStore(improvementsDir) {
181287
181336
  return [];
181288
181337
  }
181289
181338
  files.sort().reverse();
181290
- return files.map((f2) => get(basename11(f2, ".json"))).filter((i3) => i3 !== null);
181339
+ return files.map((f2) => get(basename10(f2, ".json"))).filter((i3) => i3 !== null);
181291
181340
  }
181292
181341
  function get(id) {
181293
181342
  const filePath = join54(improvementsDir, `${id}.json`);
181294
181343
  try {
181295
- const raw = readFileSync47(filePath, "utf-8");
181344
+ const raw = readFileSync48(filePath, "utf-8");
181296
181345
  return JSON.parse(raw);
181297
181346
  } catch {
181298
181347
  return null;
@@ -182111,7 +182160,7 @@ function getClaudeConfigDir() {
182111
182160
  return join57(getHomeDirectory(), ".claude");
182112
182161
  }
182113
182162
  // packages/skills-loader-core/src/shared/opencode-command-dirs.ts
182114
- import { basename as basename12, dirname as dirname23, join as join59 } from "path";
182163
+ import { basename as basename11, dirname as dirname23, join as join59 } from "path";
182115
182164
 
182116
182165
  // packages/skills-loader-core/src/shared/opencode-config-dir.ts
182117
182166
  import { existsSync as existsSync64, realpathSync as realpathSync8 } from "fs";
@@ -182246,7 +182295,7 @@ function getOpenCodeConfigDir2(options) {
182246
182295
  // packages/skills-loader-core/src/shared/opencode-command-dirs.ts
182247
182296
  function getParentOpencodeConfigDir(configDir) {
182248
182297
  const parentDir = dirname23(configDir);
182249
- if (basename12(parentDir) !== "profiles") {
182298
+ if (basename11(parentDir) !== "profiles") {
182250
182299
  return null;
182251
182300
  }
182252
182301
  return dirname23(parentDir);
@@ -182391,7 +182440,7 @@ import { join as join62 } from "path";
182391
182440
  init_src();
182392
182441
  init_src2();
182393
182442
  import * as fs19 from "fs/promises";
182394
- import { basename as basename13 } from "path";
182443
+ import { basename as basename12 } from "path";
182395
182444
 
182396
182445
  // packages/skills-loader-core/src/features/opencode-skill-loader/allowed-tools-parser.ts
182397
182446
  function parseAllowedTools(allowedTools) {
@@ -182507,7 +182556,7 @@ $ARGUMENTS
182507
182556
  }
182508
182557
  }
182509
182558
  function inferSkillNameFromFileName(filePath) {
182510
- return basename13(filePath, ".md");
182559
+ return basename12(filePath, ".md");
182511
182560
  }
182512
182561
 
182513
182562
  // packages/skills-loader-core/src/features/opencode-skill-loader/skill-directory-loader.ts
@@ -183419,9 +183468,9 @@ playwright-cli close
183419
183468
  // packages/skills-loader-core/src/features/builtin-skills/skill-file-loader.ts
183420
183469
  init_shared_skills();
183421
183470
  init_src();
183422
- import { readFileSync as readFileSync50 } from "fs";
183471
+ import { readFileSync as readFileSync51 } from "fs";
183423
183472
  import { join as join64 } from "path";
183424
- function createSharedSkillTemplateLoader(readFile3 = readFileSync50, skillsRootPath = sharedSkillsRootPath()) {
183473
+ function createSharedSkillTemplateLoader(readFile3 = readFileSync51, skillsRootPath = sharedSkillsRootPath()) {
183425
183474
  const cache = new Map;
183426
183475
  return (skillName) => {
183427
183476
  const cached2 = cache.get(skillName);
@@ -185781,7 +185830,7 @@ import {
185781
185830
  existsSync as existsSync67,
185782
185831
  mkdirSync as mkdirSync21,
185783
185832
  copyFileSync as copyFileSync4,
185784
- readFileSync as readFileSync51,
185833
+ readFileSync as readFileSync52,
185785
185834
  writeFileSync as writeFileSync19,
185786
185835
  readdirSync as readdirSync11,
185787
185836
  statSync as statSync8,
@@ -185798,7 +185847,7 @@ async function snapshotCli(options = {}) {
185798
185847
  const realFs = {
185799
185848
  existsSync: existsSync67,
185800
185849
  mkdirSync: mkdirSync21,
185801
- readFileSync: readFileSync51,
185850
+ readFileSync: readFileSync52,
185802
185851
  writeFileSync: writeFileSync19,
185803
185852
  copyFileSync: copyFileSync4,
185804
185853
  readdirSync: readdirSync11,
@@ -185864,7 +185913,7 @@ import {
185864
185913
  existsSync as existsSync68,
185865
185914
  mkdirSync as mkdirSync22,
185866
185915
  copyFileSync as copyFileSync5,
185867
- readFileSync as readFileSync52,
185916
+ readFileSync as readFileSync53,
185868
185917
  writeFileSync as writeFileSync20,
185869
185918
  readdirSync as readdirSync12,
185870
185919
  statSync as statSync9,
@@ -185877,7 +185926,7 @@ async function restoreCli(options) {
185877
185926
  const realFs = {
185878
185927
  existsSync: existsSync68,
185879
185928
  mkdirSync: mkdirSync22,
185880
- readFileSync: readFileSync52,
185929
+ readFileSync: readFileSync53,
185881
185930
  writeFileSync: writeFileSync20,
185882
185931
  copyFileSync: copyFileSync5,
185883
185932
  readdirSync: readdirSync12,
@@ -185892,7 +185941,7 @@ async function restoreCli(options) {
185892
185941
  try {
185893
185942
  restoreSnapshot(options.state, { snapshotDir, fs: realFs });
185894
185943
  const manifestPath = path19.join(snapshotDir, options.state, "manifest.json");
185895
- const raw = readFileSync52(manifestPath).toString("utf-8");
185944
+ const raw = readFileSync53(manifestPath).toString("utf-8");
185896
185945
  const parsed = JSON.parse(raw);
185897
185946
  const fileCount = typeof parsed === "object" && parsed !== null && "files" in parsed && Array.isArray(parsed.files) ? parsed.files.length : 0;
185898
185947
  if (options.json) {
@@ -185916,7 +185965,7 @@ import {
185916
185965
  existsSync as existsSync69,
185917
185966
  mkdirSync as mkdirSync23,
185918
185967
  copyFileSync as copyFileSync6,
185919
- readFileSync as readFileSync53,
185968
+ readFileSync as readFileSync54,
185920
185969
  writeFileSync as writeFileSync21,
185921
185970
  readdirSync as readdirSync13,
185922
185971
  statSync as statSync10,
@@ -185939,7 +185988,7 @@ async function snapshotListCli(options) {
185939
185988
  const realFs = {
185940
185989
  existsSync: existsSync69,
185941
185990
  mkdirSync: mkdirSync23,
185942
- readFileSync: readFileSync53,
185991
+ readFileSync: readFileSync54,
185943
185992
  writeFileSync: writeFileSync21,
185944
185993
  copyFileSync: copyFileSync6,
185945
185994
  readdirSync: readdirSync13,
@@ -185970,7 +186019,7 @@ import {
185970
186019
  existsSync as existsSync70,
185971
186020
  mkdirSync as mkdirSync24,
185972
186021
  copyFileSync as copyFileSync7,
185973
- readFileSync as readFileSync54,
186022
+ readFileSync as readFileSync55,
185974
186023
  writeFileSync as writeFileSync22,
185975
186024
  readdirSync as readdirSync14,
185976
186025
  statSync as statSync11,
@@ -185983,7 +186032,7 @@ async function snapshotPruneCli(options = {}) {
185983
186032
  const realFs = {
185984
186033
  existsSync: existsSync70,
185985
186034
  mkdirSync: mkdirSync24,
185986
- readFileSync: readFileSync54,
186035
+ readFileSync: readFileSync55,
185987
186036
  writeFileSync: writeFileSync22,
185988
186037
  copyFileSync: copyFileSync7,
185989
186038
  readdirSync: readdirSync14,
@@ -186504,7 +186553,7 @@ async function traceCli(sessionId, options = {}) {
186504
186553
 
186505
186554
  // packages/omo-opencode/src/cli/dashboard.ts
186506
186555
  import * as path25 from "path";
186507
- import { readFileSync as readFileSync56 } from "fs";
186556
+ import { readFileSync as readFileSync57 } from "fs";
186508
186557
 
186509
186558
  // packages/omo-opencode/src/features/dashboard/data-provider.ts
186510
186559
  import * as os12 from "os";
@@ -187239,7 +187288,7 @@ function loadGatewayPassphrase() {
187239
187288
  try {
187240
187289
  const configDir = getConfigDir();
187241
187290
  const configPath = path25.join(configDir, "matrixos.jsonc");
187242
- const raw = readFileSync56(configPath, "utf-8");
187291
+ const raw = readFileSync57(configPath, "utf-8");
187243
187292
  const config5 = parseJsonc(raw);
187244
187293
  const dashboard2 = config5.dashboard;
187245
187294
  return typeof dashboard2?.gatewayPassphrase === "string" ? dashboard2.gatewayPassphrase : undefined;
@@ -187835,8 +187884,8 @@ project.command("search <query>").description("Search the active project KB and
187835
187884
  });
187836
187885
  project.command("add-doc <slug> <file>").description("Copy a document into the project KB").action(async (slug, filePath) => {
187837
187886
  const { addKbDocument: addKbDocument2 } = await Promise.resolve().then(() => (init_project_memory(), exports_project_memory));
187838
- const { readFileSync: readFileSync64 } = await import("fs");
187839
- const content = readFileSync64(filePath, "utf-8");
187887
+ const { readFileSync: readFileSync65 } = await import("fs");
187888
+ const content = readFileSync65(filePath, "utf-8");
187840
187889
  const dest = addKbDocument2(slug, filePath, content);
187841
187890
  process.stdout.write(JSON.stringify({ ok: true, dest }, null, 2) + `
187842
187891
  `);