@kl-c/matrixos 0.2.9 → 0.2.10

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.9",
2166
+ version: "0.2.10",
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",
@@ -2265,7 +2265,8 @@ var init_package = __esm(() => {
2265
2265
  "typecheck:packages": "tsgo --noEmit -p packages/rules-engine/tsconfig.json && tsgo --noEmit -p packages/delegate-core/tsconfig.json && tsgo --noEmit -p packages/mcp-stdio-core/tsconfig.json && tsgo --noEmit -p packages/mcp-client-core/tsconfig.json && tsgo --noEmit -p packages/git-bash-mcp/tsconfig.json && tsgo --noEmit -p packages/lsp-core/tsconfig.json && tsgo --noEmit -p packages/utils/tsconfig.json && tsgo --noEmit -p packages/model-core/tsconfig.json && tsgo --noEmit -p packages/omo-config-core/tsconfig.json && tsgo --noEmit -p packages/prompts-core/tsconfig.json && tsgo --noEmit -p packages/comment-checker-core/tsconfig.json && tsgo --noEmit -p packages/hashline-core/tsconfig.json && tsgo --noEmit -p packages/tmux-core/tsconfig.json && tsgo --noEmit -p packages/team-core/tsconfig.json && tsgo --noEmit -p packages/matrix-gateway-core/tsconfig.json && tsgo --noEmit -p packages/boulder-state/tsconfig.json && tsgo --noEmit -p packages/learning-loop/tsconfig.json && tsgo --noEmit -p packages/telemetry-core/tsconfig.json && tsgo --noEmit -p packages/claude-code-compat-core/tsconfig.json && tsgo --noEmit -p packages/skills-loader-core/tsconfig.json && tsgo --noEmit -p packages/agents-md-core/tsconfig.json && tsgo --noEmit -p packages/task-ledger-core/tsconfig.json && tsgo --noEmit -p packages/egress-core/tsconfig.json && tsgo --noEmit -p packages/http-server-core/tsconfig.json && tsgo --noEmit -p packages/webhook-core/tsconfig.json && tsgo --noEmit -p packages/daily-brief-core/tsconfig.json && tsgo --noEmit -p packages/omo-opencode/tsconfig.json",
2266
2266
  "typecheck:script": "tsgo --noEmit -p script/tsconfig.json",
2267
2267
  test: "bun test",
2268
- "build:git-bash-mcp": "bun run --cwd packages/git-bash-mcp build"
2268
+ "build:git-bash-mcp": "bun run --cwd packages/git-bash-mcp build",
2269
+ "build:slash-commands": "rm -rf dist/cli/slash-commands && mkdir -p dist/cli/slash-commands && cp packages/omo-opencode/src/cli/slash-commands/*.md dist/cli/slash-commands/"
2269
2270
  },
2270
2271
  keywords: [
2271
2272
  "opencode",
@@ -67738,16 +67739,39 @@ var init_add_tui_plugin_to_tui_config = __esm(() => {
67738
67739
  });
67739
67740
 
67740
67741
  // packages/omo-opencode/src/cli/slash-command-installer.ts
67741
- import { existsSync as existsSync26, mkdirSync as mkdirSync9, copyFileSync as copyFileSync3, symlinkSync, readlinkSync } from "fs";
67742
- import { join as join25 } from "path";
67742
+ import {
67743
+ existsSync as existsSync26,
67744
+ mkdirSync as mkdirSync9,
67745
+ copyFileSync as copyFileSync3,
67746
+ symlinkSync,
67747
+ readlinkSync,
67748
+ readdirSync as readdirSync4,
67749
+ unlinkSync as unlinkSync5
67750
+ } from "fs";
67751
+ import { dirname as dirname9, join as join25 } from "path";
67743
67752
  import { homedir as homedir6 } from "os";
67753
+ function findSlashCommandSource() {
67754
+ const candidates = [
67755
+ join25(import.meta.dir, "slash-commands"),
67756
+ join25(import.meta.dir, "..", "slash-commands"),
67757
+ join25(import.meta.dir, "..", "..", "src", "cli", "slash-commands")
67758
+ ];
67759
+ for (const c of candidates) {
67760
+ if (existsSync26(c) && existsSync26(join25(c, "adopt.md")))
67761
+ return c;
67762
+ }
67763
+ return null;
67764
+ }
67744
67765
  function copySlashCommandsTo(dir) {
67745
67766
  try {
67746
67767
  if (!existsSync26(dir))
67747
67768
  mkdirSync9(dir, { recursive: true });
67769
+ const srcDir = findSlashCommandSource();
67770
+ if (!srcDir)
67771
+ return 0;
67748
67772
  let copied = 0;
67749
67773
  for (const name2 of SLASH_COMMAND_NAMES) {
67750
- const src = join25(import.meta.dir, "slash-commands", name2);
67774
+ const src = join25(srcDir, name2);
67751
67775
  if (!existsSync26(src))
67752
67776
  continue;
67753
67777
  copyFileSync3(src, join25(dir, name2));
@@ -67769,6 +67793,30 @@ function resolveMatrixosBin() {
67769
67793
  }
67770
67794
  return null;
67771
67795
  }
67796
+ function copyRecursive(from, to) {
67797
+ if (!existsSync26(to))
67798
+ mkdirSync9(to, { recursive: true });
67799
+ for (const entry of readdirSync4(from, { withFileTypes: true })) {
67800
+ const src = join25(from, entry.name);
67801
+ const dst = join25(to, entry.name);
67802
+ if (entry.isDirectory()) {
67803
+ copyRecursive(src, dst);
67804
+ } else {
67805
+ copyFileSync3(src, dst);
67806
+ }
67807
+ }
67808
+ }
67809
+ function installPackageTo(path7, bin) {
67810
+ const srcDir = dirname9(dirname9(bin));
67811
+ if (!existsSync26(srcDir))
67812
+ return null;
67813
+ try {
67814
+ copyRecursive(srcDir, path7);
67815
+ return join25(path7, "bin", "matrixos.js");
67816
+ } catch {
67817
+ return null;
67818
+ }
67819
+ }
67772
67820
  function installSlashCommandsAndPath() {
67773
67821
  const home = homedir6();
67774
67822
  const targets = [
@@ -67779,23 +67827,25 @@ function installSlashCommandsAndPath() {
67779
67827
  for (const t of targets)
67780
67828
  total += copySlashCommandsTo(t);
67781
67829
  let pathLinked = false;
67782
- const bin = resolveMatrixosBin();
67830
+ const liveBin = resolveMatrixosBin();
67783
67831
  const linkPath = "/usr/local/bin/matrixos";
67784
- if (bin) {
67832
+ const persistentDir = "/usr/local/lib/matrixos";
67833
+ if (liveBin) {
67785
67834
  try {
67835
+ const target = installPackageTo(persistentDir, liveBin) ?? liveBin;
67786
67836
  if (existsSync26(linkPath)) {
67787
67837
  try {
67788
67838
  const cur = readlinkSync(linkPath);
67789
- if (cur !== bin) {
67790
- symlinkSync(bin, linkPath + ".new");
67791
- copyFileSync3(bin, linkPath);
67839
+ if (cur === target) {
67840
+ pathLinked = true;
67841
+ return { commands: total, pathLinked };
67792
67842
  }
67793
- } catch {
67794
- copyFileSync3(bin, linkPath);
67795
- }
67796
- } else {
67797
- symlinkSync(bin, linkPath);
67843
+ } catch {}
67844
+ try {
67845
+ unlinkSync5(linkPath);
67846
+ } catch {}
67798
67847
  }
67848
+ symlinkSync(target, linkPath);
67799
67849
  pathLinked = true;
67800
67850
  } catch {
67801
67851
  pathLinked = false;
@@ -102691,7 +102741,7 @@ var require_Util = __commonJS((exports, module2) => {
102691
102741
  await client3.rest.patch(route, { body: updatedItems, reason });
102692
102742
  return updatedItems;
102693
102743
  }
102694
- function basename5(path7, ext) {
102744
+ function basename6(path7, ext) {
102695
102745
  const res = parse7(path7);
102696
102746
  return ext && res.ext.startsWith(ext) ? res.name : res.base.split("?")[0];
102697
102747
  }
@@ -102814,7 +102864,7 @@ var require_Util = __commonJS((exports, module2) => {
102814
102864
  resolveColor,
102815
102865
  discordSort,
102816
102866
  setPosition,
102817
- basename: basename5,
102867
+ basename: basename6,
102818
102868
  cleanContent,
102819
102869
  cleanCodeBlockContent,
102820
102870
  parseWebhookURL,
@@ -115635,7 +115685,7 @@ var require_MessagePayload = __commonJS((exports, module2) => {
115635
115685
  var { DiscordjsError, DiscordjsRangeError, ErrorCodes } = require_errors();
115636
115686
  var { resolveFile } = require_DataResolver();
115637
115687
  var MessageFlagsBitField = require_MessageFlagsBitField();
115638
- var { basename: basename5, verifyString, resolvePartialEmoji } = require_Util();
115688
+ var { basename: basename6, verifyString, resolvePartialEmoji } = require_Util();
115639
115689
  var getBaseInteraction = lazy2(() => require_BaseInteraction());
115640
115690
 
115641
115691
  class MessagePayload {
@@ -115820,10 +115870,10 @@ var require_MessagePayload = __commonJS((exports, module2) => {
115820
115870
  let name2;
115821
115871
  const findName = (thing) => {
115822
115872
  if (typeof thing === "string") {
115823
- return basename5(thing);
115873
+ return basename6(thing);
115824
115874
  }
115825
115875
  if (thing.path) {
115826
- return basename5(thing.path);
115876
+ return basename6(thing.path);
115827
115877
  }
115828
115878
  return "file.jpg";
115829
115879
  };
@@ -128201,7 +128251,7 @@ var require_EmbedBuilder = __commonJS((exports, module2) => {
128201
128251
 
128202
128252
  // node_modules/.bun/discord.js@14.27.0/node_modules/discord.js/src/structures/AttachmentBuilder.js
128203
128253
  var require_AttachmentBuilder = __commonJS((exports, module2) => {
128204
- var { basename: basename5, flatten } = require_Util();
128254
+ var { basename: basename6, flatten } = require_Util();
128205
128255
 
128206
128256
  class AttachmentBuilder {
128207
128257
  constructor(attachment, data = {}) {
@@ -128249,7 +128299,7 @@ var require_AttachmentBuilder = __commonJS((exports, module2) => {
128249
128299
  return this;
128250
128300
  }
128251
128301
  get spoiler() {
128252
- return basename5(this.name).startsWith("SPOILER_");
128302
+ return basename6(this.name).startsWith("SPOILER_");
128253
128303
  }
128254
128304
  toJSON() {
128255
128305
  return flatten(this);
@@ -129018,7 +129068,7 @@ var init_writer2 = __esm(() => {
129018
129068
 
129019
129069
  // packages/omo-config-core/src/generator/mini-os-generator.ts
129020
129070
  import { existsSync as existsSync29, mkdirSync as mkdirSync11, writeFileSync as writeFileSync8 } from "fs";
129021
- import { dirname as dirname9, join as join28 } from "path";
129071
+ import { dirname as dirname10, join as join28 } from "path";
129022
129072
  function generateMiniOS(options) {
129023
129073
  const fs6 = options.fs ?? defaultFS;
129024
129074
  const profile2 = options.profile;
@@ -129086,7 +129136,7 @@ _Skill required by the ${displayName} profile. Implementation goes here._
129086
129136
  function writeIfMissing(fs6, path7, content) {
129087
129137
  if (fs6.existsSync(path7))
129088
129138
  return;
129089
- const dir = dirname9(path7);
129139
+ const dir = dirname10(path7);
129090
129140
  if (!fs6.existsSync(dir)) {
129091
129141
  fs6.mkdirSync(dir, { recursive: true });
129092
129142
  }
@@ -129940,19 +129990,19 @@ var init_update_toasts = __esm(() => {
129940
129990
 
129941
129991
  // packages/omo-opencode/src/hooks/auto-update-checker/hook/background-update-check.ts
129942
129992
  import { existsSync as existsSync45 } from "fs";
129943
- import { dirname as dirname17, join as join40 } from "path";
129993
+ import { dirname as dirname18, join as join40 } from "path";
129944
129994
  import { fileURLToPath as fileURLToPath4 } from "url";
129945
129995
  function defaultGetModuleHostingWorkspace() {
129946
129996
  try {
129947
- const currentDir = dirname17(fileURLToPath4(import.meta.url));
129997
+ const currentDir = dirname18(fileURLToPath4(import.meta.url));
129948
129998
  const pkgJsonPath = findPackageJsonUp(currentDir);
129949
129999
  if (!pkgJsonPath)
129950
130000
  return null;
129951
- const pkgDir = dirname17(pkgJsonPath);
129952
- const nodeModulesDir = dirname17(pkgDir);
130001
+ const pkgDir = dirname18(pkgJsonPath);
130002
+ const nodeModulesDir = dirname18(pkgDir);
129953
130003
  if (nodeModulesDir.split(/[\\/]/).pop() !== "node_modules")
129954
130004
  return null;
129955
- return dirname17(nodeModulesDir);
130005
+ return dirname18(nodeModulesDir);
129956
130006
  } catch (error51) {
129957
130007
  if (error51 instanceof Error) {
129958
130008
  return null;
@@ -164925,7 +164975,7 @@ __export(exports_generate, {
164925
164975
  ProfileNotFoundError: () => ProfileNotFoundError
164926
164976
  });
164927
164977
  import { existsSync as existsSync72, readFileSync as readFileSync57, realpathSync as realpathSync10 } from "fs";
164928
- import { dirname as dirname28, isAbsolute as isAbsolute6, join as join77, resolve as resolve16 } from "path";
164978
+ import { dirname as dirname29, isAbsolute as isAbsolute6, join as join77, resolve as resolve16 } from "path";
164929
164979
  function profilesDirFor(opts) {
164930
164980
  if (opts.profilesDir)
164931
164981
  return opts.profilesDir;
@@ -165021,7 +165071,7 @@ var REPO_ROOT, defaultFS2, PROFILES_RELATIVE = "assets/profiles", ProfileNotFoun
165021
165071
  var init_generate = __esm(() => {
165022
165072
  init_src5();
165023
165073
  init_src5();
165024
- REPO_ROOT = resolve16(dirname28(new URL(import.meta.url).pathname), "..", "..", "..", "..", "..");
165074
+ REPO_ROOT = resolve16(dirname29(new URL(import.meta.url).pathname), "..", "..", "..", "..", "..");
165025
165075
  defaultFS2 = { existsSync: existsSync72, readFileSync: readFileSync57, realpathSync: realpathSync10 };
165026
165076
  ProfileNotFoundError = class ProfileNotFoundError extends Error {
165027
165077
  profileName;
@@ -165276,8 +165326,8 @@ var exports_profile_resolve = {};
165276
165326
  __export(exports_profile_resolve, {
165277
165327
  executeProfileResolveCommand: () => executeProfileResolveCommand
165278
165328
  });
165279
- import { existsSync as existsSync74, readdirSync as readdirSync15, readFileSync as readFileSync58 } from "fs";
165280
- import { join as join80, resolve as resolve17, dirname as dirname29 } from "path";
165329
+ import { existsSync as existsSync74, readdirSync as readdirSync16, readFileSync as readFileSync58 } from "fs";
165330
+ import { join as join80, resolve as resolve17, dirname as dirname30 } from "path";
165281
165331
  function executeProfileResolveCommand(args) {
165282
165332
  if (args.options.help) {
165283
165333
  return {
@@ -165309,7 +165359,7 @@ function executeProfileResolveCommand(args) {
165309
165359
  }
165310
165360
  let profileFiles;
165311
165361
  try {
165312
- profileFiles = readdirSync15(profilesDir).filter((f2) => f2.endsWith(".json"));
165362
+ profileFiles = readdirSync16(profilesDir).filter((f2) => f2.endsWith(".json"));
165313
165363
  } catch (err) {
165314
165364
  const message = err instanceof Error ? err.message : String(err);
165315
165365
  return { exitCode: 1, stdout: `error: failed to read profiles directory: ${message}
@@ -165375,7 +165425,7 @@ function executeProfileResolveCommand(args) {
165375
165425
  var REPO_ROOT2, PROFILES_RELATIVE2 = "assets/profiles";
165376
165426
  var init_profile_resolve = __esm(() => {
165377
165427
  init_src5();
165378
- REPO_ROOT2 = resolve17(dirname29(new URL(import.meta.url).pathname), "..", "..", "..", "..");
165428
+ REPO_ROOT2 = resolve17(dirname30(new URL(import.meta.url).pathname), "..", "..", "..", "..");
165379
165429
  });
165380
165430
 
165381
165431
  // packages/omo-opencode/src/cli/export.ts
@@ -165386,7 +165436,7 @@ __export(exports_export, {
165386
165436
  executeExportCommand: () => executeExportCommand
165387
165437
  });
165388
165438
  import { existsSync as existsSync75, readFileSync as readFileSync59, writeFileSync as writeFileSync26, copyFileSync as copyFileSync8, realpathSync as realpathSync11, mkdirSync as mkdirSync27 } from "fs";
165389
- import { isAbsolute as isAbsolute7, join as join81, resolve as resolve18, dirname as dirname30 } from "path";
165439
+ import { isAbsolute as isAbsolute7, join as join81, resolve as resolve18, dirname as dirname31 } from "path";
165390
165440
  import { spawnSync as spawnSync3 } from "child_process";
165391
165441
  function setShell(shell) {
165392
165442
  activeShell = shell;
@@ -165471,7 +165521,7 @@ ${packResult.stdout}
165471
165521
  if (args.options.output) {
165472
165522
  const outputPath = args.options.output;
165473
165523
  const absoluteOutput = isAbsolute7(outputPath) ? outputPath : resolve18(process.cwd(), outputPath);
165474
- const outputDir = dirname30(absoluteOutput);
165524
+ const outputDir = dirname31(absoluteOutput);
165475
165525
  if (!fs24.existsSync(outputDir)) {
165476
165526
  fs24.mkdirSync(outputDir, { recursive: true });
165477
165527
  }
@@ -165698,7 +165748,7 @@ __export(exports_project_memory, {
165698
165748
  isProjectEpisode: () => isProjectEpisode,
165699
165749
  addKbDocument: () => addKbDocument
165700
165750
  });
165701
- import { existsSync as existsSync77, mkdirSync as mkdirSync29, readFileSync as readFileSync61, readdirSync as readdirSync16, writeFileSync as writeFileSync28 } from "fs";
165751
+ import { existsSync as existsSync77, mkdirSync as mkdirSync29, readFileSync as readFileSync61, readdirSync as readdirSync17, writeFileSync as writeFileSync28 } from "fs";
165702
165752
  import { join as join83 } from "path";
165703
165753
  function tagWithProject(metadata = {}, projectSlug, cwd) {
165704
165754
  const active = projectSlug ?? getActiveProject(cwd)?.slug;
@@ -165717,7 +165767,7 @@ function listKbDocuments(projectSlug, cwd) {
165717
165767
  if (!existsSync77(kbDir))
165718
165768
  return [];
165719
165769
  const docs = [];
165720
- for (const entry of readdirSync16(kbDir, { withFileTypes: true })) {
165770
+ for (const entry of readdirSync17(kbDir, { withFileTypes: true })) {
165721
165771
  if (!entry.isFile())
165722
165772
  continue;
165723
165773
  const path29 = join83(kbDir, entry.name);
@@ -166619,7 +166669,7 @@ var init_deployment = __esm(() => {
166619
166669
  });
166620
166670
 
166621
166671
  // packages/omo-opencode/src/audit/self-audit.ts
166622
- import { existsSync as existsSync80, mkdirSync as mkdirSync30, readdirSync as readdirSync17, readFileSync as readFileSync63, writeFileSync as writeFileSync29 } from "fs";
166672
+ import { existsSync as existsSync80, mkdirSync as mkdirSync30, readdirSync as readdirSync18, readFileSync as readFileSync63, writeFileSync as writeFileSync29 } from "fs";
166623
166673
  import { join as join84 } from "path";
166624
166674
  function getAuditDir(cwd = process.cwd()) {
166625
166675
  return join84(cwd, ".matrixos", "audits");
@@ -168822,7 +168872,7 @@ var import_picocolors11 = __toESM(require_picocolors(), 1);
168822
168872
  // packages/omo-opencode/src/cli/run/opencode-binary-resolver.ts
168823
168873
  init_bun_which_shim();
168824
168874
  init_spawn_with_windows_hide();
168825
- import { delimiter as delimiter2, dirname as dirname11, posix as posix3, win32 as win324 } from "path";
168875
+ import { delimiter as delimiter2, dirname as dirname12, posix as posix3, win32 as win324 } from "path";
168826
168876
  var OPENCODE_COMMANDS = ["opencode", "opencode-desktop"];
168827
168877
  var WINDOWS_SUFFIXES = ["", ".exe", ".cmd", ".bat", ".ps1"];
168828
168878
  function getCommandCandidates(platform) {
@@ -168880,7 +168930,7 @@ async function findWorkingOpencodeBinary(pathEnv = process.env.PATH, probe2 = ca
168880
168930
  return null;
168881
168931
  }
168882
168932
  function buildPathWithBinaryFirst(pathEnv, binaryPath) {
168883
- const preferredDir = dirname11(binaryPath);
168933
+ const preferredDir = dirname12(binaryPath);
168884
168934
  const existing = (pathEnv ?? "").split(delimiter2).filter((entry) => entry.length > 0 && entry !== preferredDir);
168885
168935
  return [preferredDir, ...existing].join(delimiter2);
168886
168936
  }
@@ -169352,7 +169402,7 @@ function resolveBoulderPlanPathForWork(directory, work) {
169352
169402
  return resolveBoulderPlanPath(directory, work);
169353
169403
  }
169354
169404
  // packages/boulder-state/src/storage/plan-progress.ts
169355
- import { existsSync as existsSync34, readFileSync as readFileSync19, readdirSync as readdirSync4, statSync as statSync5 } from "fs";
169405
+ import { existsSync as existsSync34, readFileSync as readFileSync19, readdirSync as readdirSync5, statSync as statSync5 } from "fs";
169356
169406
  var TODO_HEADING_PATTERN2 = /^##\s+TODOs\b/i;
169357
169407
  var FINAL_VERIFICATION_HEADING_PATTERN2 = /^##\s+Final Verification Wave\b/i;
169358
169408
  var SECOND_LEVEL_HEADING_PATTERN2 = /^##\s+/;
@@ -169629,7 +169679,7 @@ async function isSessionInBoulderLineage(input) {
169629
169679
  // packages/omo-opencode/src/hooks/the-operator/session-last-agent.ts
169630
169680
  init_shared();
169631
169681
  init_compaction_marker();
169632
- import { readFileSync as readFileSync22, readdirSync as readdirSync5 } from "fs";
169682
+ import { readFileSync as readFileSync22, readdirSync as readdirSync6 } from "fs";
169633
169683
  import { join as join32 } from "path";
169634
169684
  var defaultSessionLastAgentDeps = {
169635
169685
  getMessageDir,
@@ -169688,7 +169738,7 @@ async function getLastAgentFromSession(sessionID, client3, deps = {}) {
169688
169738
  if (!messageDir)
169689
169739
  return null;
169690
169740
  try {
169691
- const messages = readdirSync5(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
169741
+ const messages = readdirSync6(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
169692
169742
  try {
169693
169743
  const content = readFileSync22(join32(messageDir, fileName), "utf-8");
169694
169744
  const parsed = JSON.parse(content);
@@ -169733,8 +169783,8 @@ init_agent_display_names();
169733
169783
 
169734
169784
  // packages/omo-opencode/src/hooks/ralph-loop/storage.ts
169735
169785
  init_frontmatter2();
169736
- import { existsSync as existsSync37, readFileSync as readFileSync23, writeFileSync as writeFileSync10, unlinkSync as unlinkSync5, mkdirSync as mkdirSync13 } from "fs";
169737
- import { dirname as dirname12, join as join33 } from "path";
169786
+ import { existsSync as existsSync37, readFileSync as readFileSync23, writeFileSync as writeFileSync10, unlinkSync as unlinkSync6, mkdirSync as mkdirSync13 } from "fs";
169787
+ import { dirname as dirname13, join as join33 } from "path";
169738
169788
 
169739
169789
  // packages/omo-opencode/src/hooks/ralph-loop/constants.ts
169740
169790
  var DEFAULT_STATE_FILE = ".omo/ralph-loop.local.md";
@@ -170327,7 +170377,7 @@ function createTimestampedStdoutController(stdout2 = process.stdout) {
170327
170377
  init_atomic_write();
170328
170378
  init_xdg_data_dir();
170329
170379
  import { existsSync as existsSync38, mkdirSync as mkdirSync14, readFileSync as readFileSync24 } from "fs";
170330
- import { basename as basename6, join as join34 } from "path";
170380
+ import { basename as basename7, join as join34 } from "path";
170331
170381
  var POSTHOG_ACTIVITY_STATE_FILE = "posthog-activity.json";
170332
170382
  function resolveTelemetryStateDir(product, options = {}) {
170333
170383
  const dataDir = resolveXdgDataDir(product.cacheDirName, {
@@ -170335,7 +170385,7 @@ function resolveTelemetryStateDir(product, options = {}) {
170335
170385
  osProvider: options.osProvider
170336
170386
  });
170337
170387
  const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined : join34(options.env.XDG_DATA_HOME, product.cacheDirName);
170338
- if (dataDir === xdgStateDir || xdgStateDir === undefined && basename6(dataDir) === product.cacheDirName) {
170388
+ if (dataDir === xdgStateDir || xdgStateDir === undefined && basename7(dataDir) === product.cacheDirName) {
170339
170389
  return dataDir;
170340
170390
  }
170341
170391
  return join34(dataDir, product.cacheDirName);
@@ -170454,7 +170504,7 @@ function getTelemetryDistinctId(machineIdPrefix, osProvider = getDefaultTelemetr
170454
170504
  }
170455
170505
 
170456
170506
  // node_modules/.bun/posthog-node@5.45.2/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
170457
- import { dirname as dirname13, posix as posix4, sep } from "path";
170507
+ import { dirname as dirname14, posix as posix4, sep } from "path";
170458
170508
  function createModulerModifier() {
170459
170509
  const getModuleFromFileName = createGetModuleFromFilename();
170460
170510
  return async (frames) => {
@@ -170463,7 +170513,7 @@ function createModulerModifier() {
170463
170513
  return frames;
170464
170514
  };
170465
170515
  }
170466
- function createGetModuleFromFilename(basePath = process.argv[1] ? dirname13(process.argv[1]) : process.cwd(), isWindows = sep === "\\") {
170516
+ function createGetModuleFromFilename(basePath = process.argv[1] ? dirname14(process.argv[1]) : process.cwd(), isWindows = sep === "\\") {
170467
170517
  const normalizedBase = isWindows ? normalizeWindowsPath(basePath) : basePath;
170468
170518
  return (filename) => {
170469
170519
  if (!filename)
@@ -177785,7 +177835,7 @@ init_auto_update_checker();
177785
177835
  init_package_json_locator();
177786
177836
  init_constants5();
177787
177837
  init_shared();
177788
- import { existsSync as existsSync48, readFileSync as readFileSync33, readdirSync as readdirSync7 } from "fs";
177838
+ import { existsSync as existsSync48, readFileSync as readFileSync33, readdirSync as readdirSync8 } from "fs";
177789
177839
  import { createRequire as createRequire2 } from "module";
177790
177840
  import { homedir as homedir13 } from "os";
177791
177841
  import { join as join42 } from "path";
@@ -177842,7 +177892,7 @@ function createTaggedInstallCandidates(rootDir) {
177842
177892
  if (!existsSync48(packagesDir))
177843
177893
  return [];
177844
177894
  const candidates = [];
177845
- for (const entryName of readdirSync7(packagesDir).sort()) {
177895
+ for (const entryName of readdirSync8(packagesDir).sort()) {
177846
177896
  const packageName = ACCEPTED_PACKAGE_NAMES.find((name2) => entryName.startsWith(`${name2}@`));
177847
177897
  if (packageName === undefined)
177848
177898
  continue;
@@ -178097,7 +178147,7 @@ async function checkSystem(deps = defaultDeps6) {
178097
178147
  init_src();
178098
178148
  import { readFileSync as readFileSync35 } from "fs";
178099
178149
  import { homedir as homedir14 } from "os";
178100
- import { dirname as dirname18, relative as relative5 } from "path";
178150
+ import { dirname as dirname19, relative as relative5 } from "path";
178101
178151
  init_shared();
178102
178152
  init_plugin_identity();
178103
178153
  function resolveHomeDirectory2() {
@@ -178121,7 +178171,7 @@ function discoverProjectLayersNearestFirst(directory) {
178121
178171
  const stopDirectory = containsPath(homeDirectory, directory) ? homeDirectory : directory;
178122
178172
  return findProjectOpencodePluginConfigFiles(directory, stopDirectory).map((configPath) => ({
178123
178173
  path: configPath,
178124
- configDir: dirname18(configPath)
178174
+ configDir: dirname19(configPath)
178125
178175
  }));
178126
178176
  }
178127
178177
  function shortPath(configPath) {
@@ -178145,7 +178195,7 @@ function parseLayerConfig(configPath) {
178145
178195
  if (!isPlainRecord(rawConfig)) {
178146
178196
  return {
178147
178197
  path: configPath,
178148
- configDir: dirname18(configPath),
178198
+ configDir: dirname19(configPath),
178149
178199
  config: null,
178150
178200
  messages: [`${shortPath(configPath)}: <root>: Expected object`]
178151
178201
  };
@@ -178153,7 +178203,7 @@ function parseLayerConfig(configPath) {
178153
178203
  const result = OhMyOpenCodeConfigSchema.safeParse(rawConfig);
178154
178204
  return {
178155
178205
  path: configPath,
178156
- configDir: dirname18(configPath),
178206
+ configDir: dirname19(configPath),
178157
178207
  config: result.success ? result.data : parseConfigPartially(rawConfig),
178158
178208
  messages: schemaMessages(configPath, rawConfig)
178159
178209
  };
@@ -178163,7 +178213,7 @@ function parseLayerConfig(configPath) {
178163
178213
  }
178164
178214
  return {
178165
178215
  path: configPath,
178166
- configDir: dirname18(configPath),
178216
+ configDir: dirname19(configPath),
178167
178217
  config: null,
178168
178218
  messages: [`${shortPath(configPath)}: ${error51.message}`]
178169
178219
  };
@@ -178644,7 +178694,7 @@ init_src();
178644
178694
  import { existsSync as existsSync51 } from "fs";
178645
178695
  import { createRequire as createRequire3 } from "module";
178646
178696
  import { homedir as homedir17 } from "os";
178647
- import { dirname as dirname19, join as join47 } from "path";
178697
+ import { dirname as dirname20, join as join47 } from "path";
178648
178698
 
178649
178699
  // packages/omo-opencode/src/hooks/comment-checker/downloader.ts
178650
178700
  import { join as join46 } from "path";
@@ -178741,7 +178791,7 @@ function findCommentCheckerPackageBinary(baseDirOverride, resolvePackageJsonPath
178741
178791
  const binaryName = process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
178742
178792
  const platformKey = `${process.platform}-${process.arch === "x64" ? "x64" : process.arch}`;
178743
178793
  try {
178744
- const packageDir = baseDirOverride ?? dirname19(resolvePackageJsonPath());
178794
+ const packageDir = baseDirOverride ?? dirname20(resolvePackageJsonPath());
178745
178795
  const vendorPath = join47(packageDir, "vendor", platformKey, binaryName);
178746
178796
  if (existsSync51(vendorPath))
178747
178797
  return vendorPath;
@@ -178897,7 +178947,7 @@ import { join as join48 } from "path";
178897
178947
  init_zod();
178898
178948
  init_opencode_config_dir();
178899
178949
  import { existsSync as existsSync52, readFileSync as readFileSync38 } from "fs";
178900
- import { delimiter as delimiter3, dirname as dirname20, resolve as resolve10 } from "path";
178950
+ import { delimiter as delimiter3, dirname as dirname21, resolve as resolve10 } from "path";
178901
178951
  import { fileURLToPath as fileURLToPath6 } from "url";
178902
178952
 
178903
178953
  // packages/omo-opencode/src/mcp/cli-suffix.ts
@@ -178910,7 +178960,7 @@ function hasCliSuffix(candidatePath, suffix) {
178910
178960
 
178911
178961
  // packages/omo-opencode/src/mcp/runtime-executable.ts
178912
178962
  init_bun_which_shim();
178913
- import { basename as basename7 } from "path";
178963
+ import { basename as basename8 } from "path";
178914
178964
  var NODE_EXECUTABLE_NAMES = new Set(["node", "node.exe"]);
178915
178965
  function isUnsafeCommandName2(commandName) {
178916
178966
  if (commandName.length === 0)
@@ -178926,7 +178976,7 @@ function isUnsafeCommandName2(commandName) {
178926
178976
  return false;
178927
178977
  }
178928
178978
  function isNodeExecPath(execPath) {
178929
- return NODE_EXECUTABLE_NAMES.has(basename7(execPath).toLowerCase());
178979
+ return NODE_EXECUTABLE_NAMES.has(basename8(execPath).toLowerCase());
178930
178980
  }
178931
178981
  function resolveRuntimeExecutable(commandName, options = {}) {
178932
178982
  if (isUnsafeCommandName2(commandName)) {
@@ -179028,7 +179078,7 @@ var LSP_BOOTSTRAP_SCRIPT = [
179028
179078
  ].join(";");
179029
179079
  function getModuleDirectory(moduleUrl) {
179030
179080
  try {
179031
- return dirname20(fileURLToPath6(moduleUrl));
179081
+ return dirname21(fileURLToPath6(moduleUrl));
179032
179082
  } catch (error51) {
179033
179083
  if (!(error51 instanceof Error))
179034
179084
  throw error51;
@@ -179863,13 +179913,13 @@ import {
179863
179913
  chmodSync as chmodSync6,
179864
179914
  existsSync as existsSync57,
179865
179915
  mkdirSync as mkdirSync16,
179866
- readdirSync as readdirSync8,
179916
+ readdirSync as readdirSync9,
179867
179917
  readFileSync as readFileSync44,
179868
179918
  renameSync as renameSync7,
179869
- unlinkSync as unlinkSync8,
179919
+ unlinkSync as unlinkSync9,
179870
179920
  writeFileSync as writeFileSync14
179871
179921
  } from "fs";
179872
- import { basename as basename8, dirname as dirname21, join as join52 } from "path";
179922
+ import { basename as basename9, dirname as dirname22, join as join52 } from "path";
179873
179923
 
179874
179924
  // packages/mcp-client-core/src/config-dir.ts
179875
179925
  import { existsSync as existsSync55, realpathSync as realpathSync7 } from "fs";
@@ -180053,7 +180103,7 @@ function readLegacyStore() {
180053
180103
  }
180054
180104
  function writeTokenFile(filePath, token) {
180055
180105
  try {
180056
- const dir = dirname21(filePath);
180106
+ const dir = dirname22(filePath);
180057
180107
  if (!existsSync57(dir)) {
180058
180108
  mkdirSync16(dir, { recursive: true });
180059
180109
  }
@@ -180081,7 +180131,7 @@ function deleteToken(serverHost, resource) {
180081
180131
  if (!existsSync57(filePath))
180082
180132
  return deleteLegacyToken(serverHost, resource);
180083
180133
  try {
180084
- unlinkSync8(filePath);
180134
+ unlinkSync9(filePath);
180085
180135
  return deleteTokenIndexEntry(getMcpOauthStorageDir(), getMcpOauthServerHash(serverHost, resource));
180086
180136
  } catch (deleteError) {
180087
180137
  if (!(deleteError instanceof Error))
@@ -180101,7 +180151,7 @@ function deleteLegacyToken(serverHost, resource) {
180101
180151
  try {
180102
180152
  const filePath = getLegacyStoragePath();
180103
180153
  if (existsSync57(filePath))
180104
- unlinkSync8(filePath);
180154
+ unlinkSync9(filePath);
180105
180155
  return true;
180106
180156
  } catch (deleteError) {
180107
180157
  if (!(deleteError instanceof Error))
@@ -180150,11 +180200,11 @@ function listAllTokens() {
180150
180200
  if (!existsSync57(dir))
180151
180201
  return result;
180152
180202
  const index = readTokenIndex(dir);
180153
- for (const entry of readdirSync8(dir, { withFileTypes: true })) {
180203
+ for (const entry of readdirSync9(dir, { withFileTypes: true })) {
180154
180204
  if (!entry.isFile() || !entry.name.endsWith(".json") || entry.name === "index.json")
180155
180205
  continue;
180156
180206
  const token = readTokenFile(join52(dir, entry.name));
180157
- const hash2 = basename8(entry.name, ".json");
180207
+ const hash2 = basename9(entry.name, ".json");
180158
180208
  if (token)
180159
180209
  result[index[hash2] ?? hash2] = token;
180160
180210
  }
@@ -180849,7 +180899,7 @@ function createEmbeddingPort() {
180849
180899
  // packages/learning-loop/src/codebase-scanner.ts
180850
180900
  var import_picomatch = __toESM(require_picomatch2(), 1);
180851
180901
  import { createHash as createHash5 } from "crypto";
180852
- import { readdirSync as readdirSync9, readFileSync as readFileSync46, statSync as statSync7, existsSync as existsSync59 } from "fs";
180902
+ import { readdirSync as readdirSync10, readFileSync as readFileSync46, statSync as statSync7, existsSync as existsSync59 } from "fs";
180853
180903
  import { join as join53, relative as relative6, extname as extname3 } from "path";
180854
180904
  var EXT_TO_LANG = {
180855
180905
  ts: "typescript",
@@ -180914,7 +180964,7 @@ function loadGitignore(rootDir, fs18) {
180914
180964
  function defaultFs() {
180915
180965
  return {
180916
180966
  readdir(path18) {
180917
- return readdirSync9(path18);
180967
+ return readdirSync10(path18);
180918
180968
  },
180919
180969
  readFile(path18) {
180920
180970
  return readFileSync46(path18, "utf-8");
@@ -181271,7 +181321,7 @@ function formatSearchResults(result) {
181271
181321
 
181272
181322
  // packages/learning-loop/src/improvement.ts
181273
181323
  import { existsSync as existsSync60, mkdirSync as mkdirSync18, readFileSync as readFileSync47, writeFileSync as writeFileSync16 } from "fs";
181274
- import { join as join54, basename as basename10 } from "path";
181324
+ import { join as join54, basename as basename11 } from "path";
181275
181325
  function createImprovementStore(improvementsDir) {
181276
181326
  if (!existsSync60(improvementsDir)) {
181277
181327
  mkdirSync18(improvementsDir, { recursive: true });
@@ -181292,7 +181342,7 @@ function createImprovementStore(improvementsDir) {
181292
181342
  return [];
181293
181343
  }
181294
181344
  files.sort().reverse();
181295
- return files.map((f2) => get(basename10(f2, ".json"))).filter((i3) => i3 !== null);
181345
+ return files.map((f2) => get(basename11(f2, ".json"))).filter((i3) => i3 !== null);
181296
181346
  }
181297
181347
  function get(id) {
181298
181348
  const filePath = join54(improvementsDir, `${id}.json`);
@@ -181319,8 +181369,8 @@ function createImprovementStore(improvementsDir) {
181319
181369
  }
181320
181370
  function readdirSyncSafe(dir) {
181321
181371
  try {
181322
- const { readdirSync: readdirSync10 } = __require("fs");
181323
- return readdirSync10(dir);
181372
+ const { readdirSync: readdirSync11 } = __require("fs");
181373
+ return readdirSync11(dir);
181324
181374
  } catch {
181325
181375
  return;
181326
181376
  }
@@ -182116,7 +182166,7 @@ function getClaudeConfigDir() {
182116
182166
  return join57(getHomeDirectory(), ".claude");
182117
182167
  }
182118
182168
  // packages/skills-loader-core/src/shared/opencode-command-dirs.ts
182119
- import { basename as basename11, dirname as dirname22, join as join59 } from "path";
182169
+ import { basename as basename12, dirname as dirname23, join as join59 } from "path";
182120
182170
 
182121
182171
  // packages/skills-loader-core/src/shared/opencode-config-dir.ts
182122
182172
  import { existsSync as existsSync64, realpathSync as realpathSync8 } from "fs";
@@ -182250,11 +182300,11 @@ function getOpenCodeConfigDir2(options) {
182250
182300
 
182251
182301
  // packages/skills-loader-core/src/shared/opencode-command-dirs.ts
182252
182302
  function getParentOpencodeConfigDir(configDir) {
182253
- const parentDir = dirname22(configDir);
182254
- if (basename11(parentDir) !== "profiles") {
182303
+ const parentDir = dirname23(configDir);
182304
+ if (basename12(parentDir) !== "profiles") {
182255
182305
  return null;
182256
182306
  }
182257
- return dirname22(parentDir);
182307
+ return dirname23(parentDir);
182258
182308
  }
182259
182309
  function getOpenCodeSkillDirs(options) {
182260
182310
  const configDirs = getOpenCodeConfigDirs2(options);
@@ -182272,7 +182322,7 @@ function getOpenCodeSkillDirs(options) {
182272
182322
  // packages/skills-loader-core/src/shared/project-discovery-dirs.ts
182273
182323
  import { execFileSync as execFileSync2 } from "child_process";
182274
182324
  import { existsSync as existsSync65, realpathSync as realpathSync9 } from "fs";
182275
- import { dirname as dirname23, join as join60, resolve as resolve13, win32 as win326 } from "path";
182325
+ import { dirname as dirname24, join as join60, resolve as resolve13, win32 as win326 } from "path";
182276
182326
  var worktreePathCache2 = new Map;
182277
182327
  function normalizePath2(path18) {
182278
182328
  const resolvedPath = process.platform !== "win32" && win326.isAbsolute(path18) ? path18 : resolve13(path18);
@@ -182322,7 +182372,7 @@ function findAncestorDirectories(startDirectory, targetPaths, stopDirectory) {
182322
182372
  if (stopDirectoryKey === pathKey2(currentDirectory)) {
182323
182373
  return directories;
182324
182374
  }
182325
- const parentDirectory = dirname23(currentDirectory);
182375
+ const parentDirectory = dirname24(currentDirectory);
182326
182376
  if (parentDirectory === currentDirectory) {
182327
182377
  return directories;
182328
182378
  }
@@ -182396,7 +182446,7 @@ import { join as join62 } from "path";
182396
182446
  init_src();
182397
182447
  init_src2();
182398
182448
  import * as fs19 from "fs/promises";
182399
- import { basename as basename12 } from "path";
182449
+ import { basename as basename13 } from "path";
182400
182450
 
182401
182451
  // packages/skills-loader-core/src/features/opencode-skill-loader/allowed-tools-parser.ts
182402
182452
  function parseAllowedTools(allowedTools) {
@@ -182512,7 +182562,7 @@ $ARGUMENTS
182512
182562
  }
182513
182563
  }
182514
182564
  function inferSkillNameFromFileName(filePath) {
182515
- return basename12(filePath, ".md");
182565
+ return basename13(filePath, ".md");
182516
182566
  }
182517
182567
 
182518
182568
  // packages/skills-loader-core/src/features/opencode-skill-loader/skill-directory-loader.ts
@@ -184570,9 +184620,9 @@ var gitMasterSkill = {
184570
184620
  template: GIT_MASTER_TEMPLATE
184571
184621
  };
184572
184622
  // packages/skills-loader-core/src/features/builtin-skills/skills/dev-browser.ts
184573
- import { dirname as dirname24, join as join65 } from "path";
184623
+ import { dirname as dirname25, join as join65 } from "path";
184574
184624
  import { fileURLToPath as fileURLToPath8 } from "url";
184575
- var CURRENT_DIR = dirname24(fileURLToPath8(import.meta.url));
184625
+ var CURRENT_DIR = dirname25(fileURLToPath8(import.meta.url));
184576
184626
  var devBrowserSkill = {
184577
184627
  name: "dev-browser",
184578
184628
  description: "Browser automation with persistent page state. Use when users ask to navigate websites, fill forms, take screenshots, extract web data, test web apps, or automate browser workflows. Trigger phrases include 'go to [url]', 'click on', 'fill out the form', 'take a screenshot', 'scrape', 'automate', 'test the website', 'log into', or any browser interaction request.",
@@ -185788,7 +185838,7 @@ import {
185788
185838
  copyFileSync as copyFileSync4,
185789
185839
  readFileSync as readFileSync51,
185790
185840
  writeFileSync as writeFileSync19,
185791
- readdirSync as readdirSync10,
185841
+ readdirSync as readdirSync11,
185792
185842
  statSync as statSync8,
185793
185843
  rmSync as rmSync4
185794
185844
  } from "fs";
@@ -185806,7 +185856,7 @@ async function snapshotCli(options = {}) {
185806
185856
  readFileSync: readFileSync51,
185807
185857
  writeFileSync: writeFileSync19,
185808
185858
  copyFileSync: copyFileSync4,
185809
- readdirSync: readdirSync10,
185859
+ readdirSync: readdirSync11,
185810
185860
  statSync: statSync8,
185811
185861
  rmSync: rmSync4
185812
185862
  };
@@ -185871,7 +185921,7 @@ import {
185871
185921
  copyFileSync as copyFileSync5,
185872
185922
  readFileSync as readFileSync52,
185873
185923
  writeFileSync as writeFileSync20,
185874
- readdirSync as readdirSync11,
185924
+ readdirSync as readdirSync12,
185875
185925
  statSync as statSync9,
185876
185926
  rmSync as rmSync5
185877
185927
  } from "fs";
@@ -185885,7 +185935,7 @@ async function restoreCli(options) {
185885
185935
  readFileSync: readFileSync52,
185886
185936
  writeFileSync: writeFileSync20,
185887
185937
  copyFileSync: copyFileSync5,
185888
- readdirSync: readdirSync11,
185938
+ readdirSync: readdirSync12,
185889
185939
  statSync: statSync9,
185890
185940
  rmSync: rmSync5
185891
185941
  };
@@ -185923,7 +185973,7 @@ import {
185923
185973
  copyFileSync as copyFileSync6,
185924
185974
  readFileSync as readFileSync53,
185925
185975
  writeFileSync as writeFileSync21,
185926
- readdirSync as readdirSync12,
185976
+ readdirSync as readdirSync13,
185927
185977
  statSync as statSync10,
185928
185978
  rmSync as rmSync6
185929
185979
  } from "fs";
@@ -185947,7 +185997,7 @@ async function snapshotListCli(options) {
185947
185997
  readFileSync: readFileSync53,
185948
185998
  writeFileSync: writeFileSync21,
185949
185999
  copyFileSync: copyFileSync6,
185950
- readdirSync: readdirSync12,
186000
+ readdirSync: readdirSync13,
185951
186001
  statSync: statSync10,
185952
186002
  rmSync: rmSync6
185953
186003
  };
@@ -185977,7 +186027,7 @@ import {
185977
186027
  copyFileSync as copyFileSync7,
185978
186028
  readFileSync as readFileSync54,
185979
186029
  writeFileSync as writeFileSync22,
185980
- readdirSync as readdirSync13,
186030
+ readdirSync as readdirSync14,
185981
186031
  statSync as statSync11,
185982
186032
  rmSync as rmSync7
185983
186033
  } from "fs";
@@ -185991,7 +186041,7 @@ async function snapshotPruneCli(options = {}) {
185991
186041
  readFileSync: readFileSync54,
185992
186042
  writeFileSync: writeFileSync22,
185993
186043
  copyFileSync: copyFileSync7,
185994
- readdirSync: readdirSync13,
186044
+ readdirSync: readdirSync14,
185995
186045
  statSync: statSync11,
185996
186046
  rmSync: rmSync7
185997
186047
  };