@kl-c/matrixos 0.2.9 → 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 +260 -161
- package/dist/cli/slash-commands/adopt.md +11 -0
- package/dist/cli/slash-commands/features.md +12 -0
- package/dist/cli/slash-commands/matrix-gateway-adopt-telegram.md +10 -0
- package/dist/cli/slash-commands/matrix.md +10 -0
- package/dist/cli/slash-commands/readopt.md +8 -0
- package/dist/cli-node/index.js +260 -161
- package/dist/index.js +3 -2
- package/package.json +3 -2
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.
|
|
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",
|
|
@@ -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",
|
|
@@ -67683,16 +67684,41 @@ var init_add_tui_plugin_to_tui_config = __esm(() => {
|
|
|
67683
67684
|
});
|
|
67684
67685
|
|
|
67685
67686
|
// packages/omo-opencode/src/cli/slash-command-installer.ts
|
|
67686
|
-
import {
|
|
67687
|
-
|
|
67687
|
+
import {
|
|
67688
|
+
existsSync as existsSync26,
|
|
67689
|
+
mkdirSync as mkdirSync9,
|
|
67690
|
+
copyFileSync as copyFileSync3,
|
|
67691
|
+
symlinkSync,
|
|
67692
|
+
readlinkSync,
|
|
67693
|
+
readdirSync as readdirSync4,
|
|
67694
|
+
unlinkSync as unlinkSync5,
|
|
67695
|
+
readFileSync as readFileSync15
|
|
67696
|
+
} from "fs";
|
|
67697
|
+
import { dirname as dirname9, join as join25 } from "path";
|
|
67688
67698
|
import { homedir as homedir6 } from "os";
|
|
67699
|
+
import { spawnSync as spawnSync3 } from "child_process";
|
|
67700
|
+
function findSlashCommandSource() {
|
|
67701
|
+
const candidates = [
|
|
67702
|
+
join25(import.meta.dir, "slash-commands"),
|
|
67703
|
+
join25(import.meta.dir, "..", "slash-commands"),
|
|
67704
|
+
join25(import.meta.dir, "..", "..", "src", "cli", "slash-commands")
|
|
67705
|
+
];
|
|
67706
|
+
for (const c of candidates) {
|
|
67707
|
+
if (existsSync26(c) && existsSync26(join25(c, "adopt.md")))
|
|
67708
|
+
return c;
|
|
67709
|
+
}
|
|
67710
|
+
return null;
|
|
67711
|
+
}
|
|
67689
67712
|
function copySlashCommandsTo(dir) {
|
|
67690
67713
|
try {
|
|
67691
67714
|
if (!existsSync26(dir))
|
|
67692
67715
|
mkdirSync9(dir, { recursive: true });
|
|
67716
|
+
const srcDir = findSlashCommandSource();
|
|
67717
|
+
if (!srcDir)
|
|
67718
|
+
return 0;
|
|
67693
67719
|
let copied = 0;
|
|
67694
67720
|
for (const name2 of SLASH_COMMAND_NAMES) {
|
|
67695
|
-
const src = join25(
|
|
67721
|
+
const src = join25(srcDir, name2);
|
|
67696
67722
|
if (!existsSync26(src))
|
|
67697
67723
|
continue;
|
|
67698
67724
|
copyFileSync3(src, join25(dir, name2));
|
|
@@ -67714,6 +67740,72 @@ function resolveMatrixosBin() {
|
|
|
67714
67740
|
}
|
|
67715
67741
|
return null;
|
|
67716
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
|
+
}
|
|
67785
|
+
function copyRecursive(from, to) {
|
|
67786
|
+
if (!existsSync26(to))
|
|
67787
|
+
mkdirSync9(to, { recursive: true });
|
|
67788
|
+
for (const entry of readdirSync4(from, { withFileTypes: true })) {
|
|
67789
|
+
const src = join25(from, entry.name);
|
|
67790
|
+
const dst = join25(to, entry.name);
|
|
67791
|
+
if (entry.isDirectory()) {
|
|
67792
|
+
copyRecursive(src, dst);
|
|
67793
|
+
} else {
|
|
67794
|
+
copyFileSync3(src, dst);
|
|
67795
|
+
}
|
|
67796
|
+
}
|
|
67797
|
+
}
|
|
67798
|
+
function installPackageTo(path7, bin) {
|
|
67799
|
+
const srcDir = dirname9(dirname9(bin));
|
|
67800
|
+
if (!existsSync26(srcDir))
|
|
67801
|
+
return null;
|
|
67802
|
+
try {
|
|
67803
|
+
copyRecursive(srcDir, path7);
|
|
67804
|
+
return join25(path7, "bin", "matrixos.js");
|
|
67805
|
+
} catch {
|
|
67806
|
+
return null;
|
|
67807
|
+
}
|
|
67808
|
+
}
|
|
67717
67809
|
function installSlashCommandsAndPath() {
|
|
67718
67810
|
const home = homedir6();
|
|
67719
67811
|
const targets = [
|
|
@@ -67724,23 +67816,30 @@ function installSlashCommandsAndPath() {
|
|
|
67724
67816
|
for (const t of targets)
|
|
67725
67817
|
total += copySlashCommandsTo(t);
|
|
67726
67818
|
let pathLinked = false;
|
|
67727
|
-
const
|
|
67819
|
+
const liveBin = resolveMatrixosBin();
|
|
67728
67820
|
const linkPath = "/usr/local/bin/matrixos";
|
|
67729
|
-
|
|
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
|
+
}
|
|
67827
|
+
if (liveBin) {
|
|
67730
67828
|
try {
|
|
67829
|
+
const target = installPackageTo(persistentDir, liveBin) ?? liveBin;
|
|
67731
67830
|
if (existsSync26(linkPath)) {
|
|
67732
67831
|
try {
|
|
67733
67832
|
const cur = readlinkSync(linkPath);
|
|
67734
|
-
if (cur
|
|
67735
|
-
|
|
67736
|
-
|
|
67833
|
+
if (cur === target) {
|
|
67834
|
+
pathLinked = true;
|
|
67835
|
+
return { commands: total, pathLinked };
|
|
67737
67836
|
}
|
|
67738
|
-
} catch {
|
|
67739
|
-
|
|
67740
|
-
|
|
67741
|
-
|
|
67742
|
-
symlinkSync(bin, linkPath);
|
|
67837
|
+
} catch {}
|
|
67838
|
+
try {
|
|
67839
|
+
unlinkSync5(linkPath);
|
|
67840
|
+
} catch {}
|
|
67743
67841
|
}
|
|
67842
|
+
symlinkSync(target, linkPath);
|
|
67744
67843
|
pathLinked = true;
|
|
67745
67844
|
} catch {
|
|
67746
67845
|
pathLinked = false;
|
|
@@ -69599,7 +69698,7 @@ var init_dist5 = __esm(() => {
|
|
|
69599
69698
|
|
|
69600
69699
|
// packages/omo-opencode/src/cli/config-manager/write-gateway-env.ts
|
|
69601
69700
|
import { homedir as homedir8 } from "os";
|
|
69602
|
-
import { existsSync as existsSync27, mkdirSync as mkdirSync10, readFileSync as
|
|
69701
|
+
import { existsSync as existsSync27, mkdirSync as mkdirSync10, readFileSync as readFileSync16, writeFileSync as writeFileSync6, chmodSync as chmodSync3 } from "fs";
|
|
69603
69702
|
import { join as join27 } from "path";
|
|
69604
69703
|
function writeGatewayEnvToken(key, token) {
|
|
69605
69704
|
const configDir = homedir8();
|
|
@@ -69608,7 +69707,7 @@ function writeGatewayEnvToken(key, token) {
|
|
|
69608
69707
|
const envPath = join27(configDir, GATEWAY_ENV_FILENAME);
|
|
69609
69708
|
const entries = new Map;
|
|
69610
69709
|
if (existsSync27(envPath)) {
|
|
69611
|
-
const existing =
|
|
69710
|
+
const existing = readFileSync16(envPath, "utf-8");
|
|
69612
69711
|
for (const rawLine of existing.split(`
|
|
69613
69712
|
`)) {
|
|
69614
69713
|
const line = rawLine.trim();
|
|
@@ -128963,7 +129062,7 @@ var init_writer2 = __esm(() => {
|
|
|
128963
129062
|
|
|
128964
129063
|
// packages/omo-config-core/src/generator/mini-os-generator.ts
|
|
128965
129064
|
import { existsSync as existsSync29, mkdirSync as mkdirSync11, writeFileSync as writeFileSync8 } from "fs";
|
|
128966
|
-
import { dirname as
|
|
129065
|
+
import { dirname as dirname10, join as join28 } from "path";
|
|
128967
129066
|
function generateMiniOS(options) {
|
|
128968
129067
|
const fs6 = options.fs ?? defaultFS;
|
|
128969
129068
|
const profile2 = options.profile;
|
|
@@ -129031,7 +129130,7 @@ _Skill required by the ${displayName} profile. Implementation goes here._
|
|
|
129031
129130
|
function writeIfMissing(fs6, path7, content) {
|
|
129032
129131
|
if (fs6.existsSync(path7))
|
|
129033
129132
|
return;
|
|
129034
|
-
const dir =
|
|
129133
|
+
const dir = dirname10(path7);
|
|
129035
129134
|
if (!fs6.existsSync(dir)) {
|
|
129036
129135
|
fs6.mkdirSync(dir, { recursive: true });
|
|
129037
129136
|
}
|
|
@@ -129885,19 +129984,19 @@ var init_update_toasts = __esm(() => {
|
|
|
129885
129984
|
|
|
129886
129985
|
// packages/omo-opencode/src/hooks/auto-update-checker/hook/background-update-check.ts
|
|
129887
129986
|
import { existsSync as existsSync45 } from "fs";
|
|
129888
|
-
import { dirname as
|
|
129987
|
+
import { dirname as dirname18, join as join40 } from "path";
|
|
129889
129988
|
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
129890
129989
|
function defaultGetModuleHostingWorkspace() {
|
|
129891
129990
|
try {
|
|
129892
|
-
const currentDir =
|
|
129991
|
+
const currentDir = dirname18(fileURLToPath4(import.meta.url));
|
|
129893
129992
|
const pkgJsonPath = findPackageJsonUp(currentDir);
|
|
129894
129993
|
if (!pkgJsonPath)
|
|
129895
129994
|
return null;
|
|
129896
|
-
const pkgDir =
|
|
129897
|
-
const nodeModulesDir =
|
|
129995
|
+
const pkgDir = dirname18(pkgJsonPath);
|
|
129996
|
+
const nodeModulesDir = dirname18(pkgDir);
|
|
129898
129997
|
if (nodeModulesDir.split(/[\\/]/).pop() !== "node_modules")
|
|
129899
129998
|
return null;
|
|
129900
|
-
return
|
|
129999
|
+
return dirname18(nodeModulesDir);
|
|
129901
130000
|
} catch (error51) {
|
|
129902
130001
|
if (error51 instanceof Error) {
|
|
129903
130002
|
return null;
|
|
@@ -154466,7 +154565,7 @@ var require_filesystem = __commonJS((exports2, module2) => {
|
|
|
154466
154565
|
var LDD_PATH = "/usr/bin/ldd";
|
|
154467
154566
|
var SELF_PATH = "/proc/self/exe";
|
|
154468
154567
|
var MAX_LENGTH = 2048;
|
|
154469
|
-
var
|
|
154568
|
+
var readFileSync47 = (path18) => {
|
|
154470
154569
|
const fd = fs18.openSync(path18, "r");
|
|
154471
154570
|
const buffer = Buffer.alloc(MAX_LENGTH);
|
|
154472
154571
|
const bytesRead = fs18.readSync(fd, buffer, 0, MAX_LENGTH, 0);
|
|
@@ -154489,7 +154588,7 @@ var require_filesystem = __commonJS((exports2, module2) => {
|
|
|
154489
154588
|
module2.exports = {
|
|
154490
154589
|
LDD_PATH,
|
|
154491
154590
|
SELF_PATH,
|
|
154492
|
-
readFileSync:
|
|
154591
|
+
readFileSync: readFileSync47,
|
|
154493
154592
|
readFile
|
|
154494
154593
|
};
|
|
154495
154594
|
});
|
|
@@ -154532,7 +154631,7 @@ var require_elf = __commonJS((exports2, module2) => {
|
|
|
154532
154631
|
var require_detect_libc = __commonJS((exports2, module2) => {
|
|
154533
154632
|
var childProcess = __require("child_process");
|
|
154534
154633
|
var { isLinux, getReport } = require_process();
|
|
154535
|
-
var { LDD_PATH, SELF_PATH, readFile, readFileSync:
|
|
154634
|
+
var { LDD_PATH, SELF_PATH, readFile, readFileSync: readFileSync47 } = require_filesystem();
|
|
154536
154635
|
var { interpreterPath } = require_elf();
|
|
154537
154636
|
var cachedFamilyInterpreter;
|
|
154538
154637
|
var cachedFamilyFilesystem;
|
|
@@ -154623,7 +154722,7 @@ var require_detect_libc = __commonJS((exports2, module2) => {
|
|
|
154623
154722
|
}
|
|
154624
154723
|
cachedFamilyFilesystem = null;
|
|
154625
154724
|
try {
|
|
154626
|
-
const lddContent =
|
|
154725
|
+
const lddContent = readFileSync47(LDD_PATH);
|
|
154627
154726
|
cachedFamilyFilesystem = getFamilyFromLddContent(lddContent);
|
|
154628
154727
|
} catch (e) {}
|
|
154629
154728
|
return cachedFamilyFilesystem;
|
|
@@ -154646,7 +154745,7 @@ var require_detect_libc = __commonJS((exports2, module2) => {
|
|
|
154646
154745
|
}
|
|
154647
154746
|
cachedFamilyInterpreter = null;
|
|
154648
154747
|
try {
|
|
154649
|
-
const selfContent =
|
|
154748
|
+
const selfContent = readFileSync47(SELF_PATH);
|
|
154650
154749
|
const path18 = interpreterPath(selfContent);
|
|
154651
154750
|
cachedFamilyInterpreter = familyFromInterpreterPath(path18);
|
|
154652
154751
|
} catch (e) {}
|
|
@@ -154708,7 +154807,7 @@ var require_detect_libc = __commonJS((exports2, module2) => {
|
|
|
154708
154807
|
}
|
|
154709
154808
|
cachedVersionFilesystem = null;
|
|
154710
154809
|
try {
|
|
154711
|
-
const lddContent =
|
|
154810
|
+
const lddContent = readFileSync47(LDD_PATH);
|
|
154712
154811
|
const versionMatch = lddContent.match(RE_GLIBC_VERSION);
|
|
154713
154812
|
if (versionMatch) {
|
|
154714
154813
|
cachedVersionFilesystem = versionMatch[1];
|
|
@@ -155010,7 +155109,7 @@ var require_libvips = __commonJS((exports2, module2) => {
|
|
|
155010
155109
|
var fs18 = __require("fs");
|
|
155011
155110
|
var os7 = __require("os");
|
|
155012
155111
|
var path18 = __require("path");
|
|
155013
|
-
var
|
|
155112
|
+
var spawnSync4 = __require("child_process").spawnSync;
|
|
155014
155113
|
var semverCoerce = require_coerce();
|
|
155015
155114
|
var semverGreaterThanOrEqualTo = require_gte();
|
|
155016
155115
|
var platform = require_platform();
|
|
@@ -155051,14 +155150,14 @@ var require_libvips = __commonJS((exports2, module2) => {
|
|
|
155051
155150
|
};
|
|
155052
155151
|
var isRosetta = function() {
|
|
155053
155152
|
if (process.platform === "darwin" && process.arch === "x64") {
|
|
155054
|
-
const translated =
|
|
155153
|
+
const translated = spawnSync4("sysctl sysctl.proc_translated", spawnSyncOptions).stdout;
|
|
155055
155154
|
return (translated || "").trim() === "sysctl.proc_translated: 1";
|
|
155056
155155
|
}
|
|
155057
155156
|
return false;
|
|
155058
155157
|
};
|
|
155059
155158
|
var globalLibvipsVersion = function() {
|
|
155060
155159
|
if (process.platform !== "win32") {
|
|
155061
|
-
const globalLibvipsVersion2 =
|
|
155160
|
+
const globalLibvipsVersion2 = spawnSync4("pkg-config --modversion vips-cpp", {
|
|
155062
155161
|
...spawnSyncOptions,
|
|
155063
155162
|
env: {
|
|
155064
155163
|
...env4,
|
|
@@ -155078,7 +155177,7 @@ var require_libvips = __commonJS((exports2, module2) => {
|
|
|
155078
155177
|
};
|
|
155079
155178
|
var pkgConfigPath = function() {
|
|
155080
155179
|
if (process.platform !== "win32") {
|
|
155081
|
-
const brewPkgConfigPath =
|
|
155180
|
+
const brewPkgConfigPath = spawnSync4('which brew >/dev/null 2>&1 && brew environment --plain | grep PKG_CONFIG_LIBDIR | cut -d" " -f2', spawnSyncOptions).stdout || "";
|
|
155082
155181
|
return [
|
|
155083
155182
|
brewPkgConfigPath.trim(),
|
|
155084
155183
|
env4.PKG_CONFIG_PATH,
|
|
@@ -164869,8 +164968,8 @@ __export(exports_generate, {
|
|
|
164869
164968
|
executeGenerateCommand: () => executeGenerateCommand,
|
|
164870
164969
|
ProfileNotFoundError: () => ProfileNotFoundError
|
|
164871
164970
|
});
|
|
164872
|
-
import { existsSync as existsSync72, readFileSync as
|
|
164873
|
-
import { dirname as
|
|
164971
|
+
import { existsSync as existsSync72, readFileSync as readFileSync58, realpathSync as realpathSync10 } from "fs";
|
|
164972
|
+
import { dirname as dirname29, isAbsolute as isAbsolute6, join as join77, resolve as resolve16 } from "path";
|
|
164874
164973
|
function profilesDirFor(opts) {
|
|
164875
164974
|
if (opts.profilesDir)
|
|
164876
164975
|
return opts.profilesDir;
|
|
@@ -164966,8 +165065,8 @@ var REPO_ROOT, defaultFS2, PROFILES_RELATIVE = "assets/profiles", ProfileNotFoun
|
|
|
164966
165065
|
var init_generate = __esm(() => {
|
|
164967
165066
|
init_src5();
|
|
164968
165067
|
init_src5();
|
|
164969
|
-
REPO_ROOT = resolve16(
|
|
164970
|
-
defaultFS2 = { existsSync: existsSync72, readFileSync:
|
|
165068
|
+
REPO_ROOT = resolve16(dirname29(new URL(import.meta.url).pathname), "..", "..", "..", "..", "..");
|
|
165069
|
+
defaultFS2 = { existsSync: existsSync72, readFileSync: readFileSync58, realpathSync: realpathSync10 };
|
|
164971
165070
|
ProfileNotFoundError = class ProfileNotFoundError extends Error {
|
|
164972
165071
|
profileName;
|
|
164973
165072
|
constructor(profileName) {
|
|
@@ -165221,8 +165320,8 @@ var exports_profile_resolve = {};
|
|
|
165221
165320
|
__export(exports_profile_resolve, {
|
|
165222
165321
|
executeProfileResolveCommand: () => executeProfileResolveCommand
|
|
165223
165322
|
});
|
|
165224
|
-
import { existsSync as existsSync74, readdirSync as
|
|
165225
|
-
import { join as join80, resolve as resolve17, dirname as
|
|
165323
|
+
import { existsSync as existsSync74, readdirSync as readdirSync16, readFileSync as readFileSync59 } from "fs";
|
|
165324
|
+
import { join as join80, resolve as resolve17, dirname as dirname30 } from "path";
|
|
165226
165325
|
function executeProfileResolveCommand(args) {
|
|
165227
165326
|
if (args.options.help) {
|
|
165228
165327
|
return {
|
|
@@ -165254,7 +165353,7 @@ function executeProfileResolveCommand(args) {
|
|
|
165254
165353
|
}
|
|
165255
165354
|
let profileFiles;
|
|
165256
165355
|
try {
|
|
165257
|
-
profileFiles =
|
|
165356
|
+
profileFiles = readdirSync16(profilesDir).filter((f2) => f2.endsWith(".json"));
|
|
165258
165357
|
} catch (err) {
|
|
165259
165358
|
const message = err instanceof Error ? err.message : String(err);
|
|
165260
165359
|
return { exitCode: 1, stdout: `error: failed to read profiles directory: ${message}
|
|
@@ -165268,7 +165367,7 @@ function executeProfileResolveCommand(args) {
|
|
|
165268
165367
|
for (const file3 of profileFiles) {
|
|
165269
165368
|
try {
|
|
165270
165369
|
const filePath = join80(profilesDir, file3);
|
|
165271
|
-
const raw = JSON.parse(
|
|
165370
|
+
const raw = JSON.parse(readFileSync59(filePath, "utf-8"));
|
|
165272
165371
|
const profile2 = ProfileSchema.parse(raw);
|
|
165273
165372
|
registry2[profile2.name] = profile2;
|
|
165274
165373
|
} catch {}
|
|
@@ -165320,7 +165419,7 @@ function executeProfileResolveCommand(args) {
|
|
|
165320
165419
|
var REPO_ROOT2, PROFILES_RELATIVE2 = "assets/profiles";
|
|
165321
165420
|
var init_profile_resolve = __esm(() => {
|
|
165322
165421
|
init_src5();
|
|
165323
|
-
REPO_ROOT2 = resolve17(
|
|
165422
|
+
REPO_ROOT2 = resolve17(dirname30(new URL(import.meta.url).pathname), "..", "..", "..", "..");
|
|
165324
165423
|
});
|
|
165325
165424
|
|
|
165326
165425
|
// packages/omo-opencode/src/cli/export.ts
|
|
@@ -165330,9 +165429,9 @@ __export(exports_export, {
|
|
|
165330
165429
|
getShell: () => getShell,
|
|
165331
165430
|
executeExportCommand: () => executeExportCommand
|
|
165332
165431
|
});
|
|
165333
|
-
import { existsSync as existsSync75, readFileSync as
|
|
165334
|
-
import { isAbsolute as isAbsolute7, join as join81, resolve as resolve18, dirname as
|
|
165335
|
-
import { spawnSync as
|
|
165432
|
+
import { existsSync as existsSync75, readFileSync as readFileSync60, writeFileSync as writeFileSync26, copyFileSync as copyFileSync8, realpathSync as realpathSync11, mkdirSync as mkdirSync27 } from "fs";
|
|
165433
|
+
import { isAbsolute as isAbsolute7, join as join81, resolve as resolve18, dirname as dirname31 } from "path";
|
|
165434
|
+
import { spawnSync as spawnSync4 } from "child_process";
|
|
165336
165435
|
function setShell(shell) {
|
|
165337
165436
|
activeShell = shell;
|
|
165338
165437
|
}
|
|
@@ -165416,7 +165515,7 @@ ${packResult.stdout}
|
|
|
165416
165515
|
if (args.options.output) {
|
|
165417
165516
|
const outputPath = args.options.output;
|
|
165418
165517
|
const absoluteOutput = isAbsolute7(outputPath) ? outputPath : resolve18(process.cwd(), outputPath);
|
|
165419
|
-
const outputDir =
|
|
165518
|
+
const outputDir = dirname31(absoluteOutput);
|
|
165420
165519
|
if (!fs24.existsSync(outputDir)) {
|
|
165421
165520
|
fs24.mkdirSync(outputDir, { recursive: true });
|
|
165422
165521
|
}
|
|
@@ -165444,7 +165543,7 @@ var init_export = __esm(() => {
|
|
|
165444
165543
|
defaultShell = {
|
|
165445
165544
|
run(cmd, cwd) {
|
|
165446
165545
|
const parts = cmd.split(/\s+/);
|
|
165447
|
-
const result =
|
|
165546
|
+
const result = spawnSync4(parts[0], parts.slice(1), { cwd, encoding: "utf-8", windowsHide: process.platform === "win32" });
|
|
165448
165547
|
return {
|
|
165449
165548
|
code: result.status ?? 1,
|
|
165450
165549
|
stdout: (result.stdout ?? result.stderr ?? "").toString().trim()
|
|
@@ -165454,7 +165553,7 @@ var init_export = __esm(() => {
|
|
|
165454
165553
|
activeShell = defaultShell;
|
|
165455
165554
|
defaultExportFS = {
|
|
165456
165555
|
existsSync: existsSync75,
|
|
165457
|
-
readFileSync:
|
|
165556
|
+
readFileSync: readFileSync60,
|
|
165458
165557
|
writeFileSync: writeFileSync26,
|
|
165459
165558
|
copyFileSync: copyFileSync8,
|
|
165460
165559
|
realpathSync: realpathSync11,
|
|
@@ -165482,7 +165581,7 @@ __export(exports_project_context, {
|
|
|
165482
165581
|
createProject: () => createProject,
|
|
165483
165582
|
archiveProject: () => archiveProject
|
|
165484
165583
|
});
|
|
165485
|
-
import { existsSync as existsSync76, mkdirSync as mkdirSync28, readFileSync as
|
|
165584
|
+
import { existsSync as existsSync76, mkdirSync as mkdirSync28, readFileSync as readFileSync61, writeFileSync as writeFileSync27, rmSync as rmSync8 } from "fs";
|
|
165486
165585
|
import { join as join82 } from "path";
|
|
165487
165586
|
function getMatrixOsDir(cwd = process.cwd()) {
|
|
165488
165587
|
return join82(cwd, ".matrixos");
|
|
@@ -165501,7 +165600,7 @@ function loadState(cwd) {
|
|
|
165501
165600
|
if (!existsSync76(path29))
|
|
165502
165601
|
return {};
|
|
165503
165602
|
try {
|
|
165504
|
-
return JSON.parse(
|
|
165603
|
+
return JSON.parse(readFileSync61(path29, "utf-8"));
|
|
165505
165604
|
} catch {
|
|
165506
165605
|
return {};
|
|
165507
165606
|
}
|
|
@@ -165517,7 +165616,7 @@ function loadProjectMeta(slug, cwd) {
|
|
|
165517
165616
|
if (!existsSync76(path29))
|
|
165518
165617
|
return null;
|
|
165519
165618
|
try {
|
|
165520
|
-
return JSON.parse(
|
|
165619
|
+
return JSON.parse(readFileSync61(path29, "utf-8"));
|
|
165521
165620
|
} catch {
|
|
165522
165621
|
return null;
|
|
165523
165622
|
}
|
|
@@ -165643,7 +165742,7 @@ __export(exports_project_memory, {
|
|
|
165643
165742
|
isProjectEpisode: () => isProjectEpisode,
|
|
165644
165743
|
addKbDocument: () => addKbDocument
|
|
165645
165744
|
});
|
|
165646
|
-
import { existsSync as existsSync77, mkdirSync as mkdirSync29, readFileSync as
|
|
165745
|
+
import { existsSync as existsSync77, mkdirSync as mkdirSync29, readFileSync as readFileSync62, readdirSync as readdirSync17, writeFileSync as writeFileSync28 } from "fs";
|
|
165647
165746
|
import { join as join83 } from "path";
|
|
165648
165747
|
function tagWithProject(metadata = {}, projectSlug, cwd) {
|
|
165649
165748
|
const active = projectSlug ?? getActiveProject(cwd)?.slug;
|
|
@@ -165662,12 +165761,12 @@ function listKbDocuments(projectSlug, cwd) {
|
|
|
165662
165761
|
if (!existsSync77(kbDir))
|
|
165663
165762
|
return [];
|
|
165664
165763
|
const docs = [];
|
|
165665
|
-
for (const entry of
|
|
165764
|
+
for (const entry of readdirSync17(kbDir, { withFileTypes: true })) {
|
|
165666
165765
|
if (!entry.isFile())
|
|
165667
165766
|
continue;
|
|
165668
165767
|
const path29 = join83(kbDir, entry.name);
|
|
165669
165768
|
try {
|
|
165670
|
-
docs.push({ path: path29, content:
|
|
165769
|
+
docs.push({ path: path29, content: readFileSync62(path29, "utf-8") });
|
|
165671
165770
|
} catch {}
|
|
165672
165771
|
}
|
|
165673
165772
|
return docs;
|
|
@@ -166089,12 +166188,12 @@ __export(exports_gateway_start, {
|
|
|
166089
166188
|
buildTelegramConfig: () => buildTelegramConfig,
|
|
166090
166189
|
buildGatewayConfig: () => buildGatewayConfig
|
|
166091
166190
|
});
|
|
166092
|
-
import { readFileSync as
|
|
166191
|
+
import { readFileSync as readFileSync63, existsSync as existsSync78 } from "fs";
|
|
166093
166192
|
import { resolve as resolve19 } from "path";
|
|
166094
166193
|
function loadGatewayEnv(path29 = ENV_PATH) {
|
|
166095
166194
|
if (!existsSync78(path29))
|
|
166096
166195
|
return {};
|
|
166097
|
-
const text =
|
|
166196
|
+
const text = readFileSync63(path29, "utf8");
|
|
166098
166197
|
const out = {};
|
|
166099
166198
|
for (const raw of text.split(/\r?\n/)) {
|
|
166100
166199
|
const line = raw.trim();
|
|
@@ -166564,7 +166663,7 @@ var init_deployment = __esm(() => {
|
|
|
166564
166663
|
});
|
|
166565
166664
|
|
|
166566
166665
|
// packages/omo-opencode/src/audit/self-audit.ts
|
|
166567
|
-
import { existsSync as existsSync80, mkdirSync as mkdirSync30, readdirSync as
|
|
166666
|
+
import { existsSync as existsSync80, mkdirSync as mkdirSync30, readdirSync as readdirSync18, readFileSync as readFileSync64, writeFileSync as writeFileSync29 } from "fs";
|
|
166568
166667
|
import { join as join84 } from "path";
|
|
166569
166668
|
function getAuditDir(cwd = process.cwd()) {
|
|
166570
166669
|
return join84(cwd, ".matrixos", "audits");
|
|
@@ -168767,7 +168866,7 @@ var import_picocolors11 = __toESM(require_picocolors(), 1);
|
|
|
168767
168866
|
// packages/omo-opencode/src/cli/run/opencode-binary-resolver.ts
|
|
168768
168867
|
init_bun_which_shim();
|
|
168769
168868
|
init_spawn_with_windows_hide();
|
|
168770
|
-
import { delimiter as delimiter2, dirname as
|
|
168869
|
+
import { delimiter as delimiter2, dirname as dirname12, posix as posix3, win32 as win324 } from "path";
|
|
168771
168870
|
var OPENCODE_COMMANDS = ["opencode", "opencode-desktop"];
|
|
168772
168871
|
var WINDOWS_SUFFIXES = ["", ".exe", ".cmd", ".bat", ".ps1"];
|
|
168773
168872
|
function getCommandCandidates(platform) {
|
|
@@ -168825,7 +168924,7 @@ async function findWorkingOpencodeBinary(pathEnv = process.env.PATH, probe2 = ca
|
|
|
168825
168924
|
return null;
|
|
168826
168925
|
}
|
|
168827
168926
|
function buildPathWithBinaryFirst(pathEnv, binaryPath) {
|
|
168828
|
-
const preferredDir =
|
|
168927
|
+
const preferredDir = dirname12(binaryPath);
|
|
168829
168928
|
const existing = (pathEnv ?? "").split(delimiter2).filter((entry) => entry.length > 0 && entry !== preferredDir);
|
|
168830
168929
|
return [preferredDir, ...existing].join(delimiter2);
|
|
168831
168930
|
}
|
|
@@ -169218,7 +169317,7 @@ var BOULDER_STATE_PATH = `${BOULDER_DIR}/${BOULDER_FILE}`;
|
|
|
169218
169317
|
var NOTEPAD_DIR = "notepads";
|
|
169219
169318
|
var NOTEPAD_BASE_PATH = `${BOULDER_DIR}/${NOTEPAD_DIR}`;
|
|
169220
169319
|
// packages/boulder-state/src/top-level-task.ts
|
|
169221
|
-
import { existsSync as existsSync32, readFileSync as
|
|
169320
|
+
import { existsSync as existsSync32, readFileSync as readFileSync19 } from "fs";
|
|
169222
169321
|
var TODO_HEADING_PATTERN = /^##\s+TODOs\b/i;
|
|
169223
169322
|
var FINAL_VERIFICATION_HEADING_PATTERN = /^##\s+Final Verification Wave\b/i;
|
|
169224
169323
|
var SECOND_LEVEL_HEADING_PATTERN = /^##\s+/;
|
|
@@ -169245,7 +169344,7 @@ function readCurrentTopLevelTask(planPath) {
|
|
|
169245
169344
|
return null;
|
|
169246
169345
|
}
|
|
169247
169346
|
try {
|
|
169248
|
-
const content =
|
|
169347
|
+
const content = readFileSync19(planPath, "utf-8");
|
|
169249
169348
|
const lines = content.split(/\r?\n/);
|
|
169250
169349
|
let section = "other";
|
|
169251
169350
|
for (const line of lines) {
|
|
@@ -169297,7 +169396,7 @@ function resolveBoulderPlanPathForWork(directory, work) {
|
|
|
169297
169396
|
return resolveBoulderPlanPath(directory, work);
|
|
169298
169397
|
}
|
|
169299
169398
|
// packages/boulder-state/src/storage/plan-progress.ts
|
|
169300
|
-
import { existsSync as existsSync34, readFileSync as
|
|
169399
|
+
import { existsSync as existsSync34, readFileSync as readFileSync20, readdirSync as readdirSync5, statSync as statSync5 } from "fs";
|
|
169301
169400
|
var TODO_HEADING_PATTERN2 = /^##\s+TODOs\b/i;
|
|
169302
169401
|
var FINAL_VERIFICATION_HEADING_PATTERN2 = /^##\s+Final Verification Wave\b/i;
|
|
169303
169402
|
var SECOND_LEVEL_HEADING_PATTERN2 = /^##\s+/;
|
|
@@ -169310,7 +169409,7 @@ function getPlanProgress(planPath) {
|
|
|
169310
169409
|
return { total: 0, completed: 0, isComplete: false };
|
|
169311
169410
|
}
|
|
169312
169411
|
try {
|
|
169313
|
-
const content =
|
|
169412
|
+
const content = readFileSync20(planPath, "utf-8");
|
|
169314
169413
|
const lines = content.split(/\r?\n/);
|
|
169315
169414
|
const hasStructuredSections = lines.some((line) => TODO_HEADING_PATTERN2.test(line) || FINAL_VERIFICATION_HEADING_PATTERN2.test(line));
|
|
169316
169415
|
if (hasStructuredSections) {
|
|
@@ -169426,14 +169525,14 @@ function selectMirrorWork(state) {
|
|
|
169426
169525
|
return sorted[0] ?? null;
|
|
169427
169526
|
}
|
|
169428
169527
|
// packages/boulder-state/src/storage/read-state.ts
|
|
169429
|
-
import { existsSync as existsSync35, readFileSync as
|
|
169528
|
+
import { existsSync as existsSync35, readFileSync as readFileSync21 } from "fs";
|
|
169430
169529
|
function readBoulderState(directory) {
|
|
169431
169530
|
const filePath = getBoulderFilePath(directory);
|
|
169432
169531
|
if (!existsSync35(filePath)) {
|
|
169433
169532
|
return null;
|
|
169434
169533
|
}
|
|
169435
169534
|
try {
|
|
169436
|
-
const content =
|
|
169535
|
+
const content = readFileSync21(filePath, "utf-8");
|
|
169437
169536
|
const parsed = JSON.parse(content);
|
|
169438
169537
|
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
169439
169538
|
return null;
|
|
@@ -169499,7 +169598,7 @@ init_state();
|
|
|
169499
169598
|
// packages/omo-opencode/src/features/run-continuation-state/constants.ts
|
|
169500
169599
|
var CONTINUATION_MARKER_DIR = ".omo/run-continuation";
|
|
169501
169600
|
// packages/omo-opencode/src/features/run-continuation-state/storage.ts
|
|
169502
|
-
import { existsSync as existsSync36, mkdirSync as mkdirSync12, readFileSync as
|
|
169601
|
+
import { existsSync as existsSync36, mkdirSync as mkdirSync12, readFileSync as readFileSync22, rmSync as rmSync2, writeFileSync as writeFileSync9 } from "fs";
|
|
169503
169602
|
import { join as join31 } from "path";
|
|
169504
169603
|
function getMarkerPath(directory, sessionID) {
|
|
169505
169604
|
return join31(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
|
|
@@ -169509,7 +169608,7 @@ function readContinuationMarker(directory, sessionID) {
|
|
|
169509
169608
|
if (!existsSync36(markerPath))
|
|
169510
169609
|
return null;
|
|
169511
169610
|
try {
|
|
169512
|
-
const raw =
|
|
169611
|
+
const raw = readFileSync22(markerPath, "utf-8");
|
|
169513
169612
|
const parsed = JSON.parse(raw);
|
|
169514
169613
|
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
|
|
169515
169614
|
return null;
|
|
@@ -169574,7 +169673,7 @@ async function isSessionInBoulderLineage(input) {
|
|
|
169574
169673
|
// packages/omo-opencode/src/hooks/the-operator/session-last-agent.ts
|
|
169575
169674
|
init_shared();
|
|
169576
169675
|
init_compaction_marker();
|
|
169577
|
-
import { readFileSync as
|
|
169676
|
+
import { readFileSync as readFileSync23, readdirSync as readdirSync6 } from "fs";
|
|
169578
169677
|
import { join as join32 } from "path";
|
|
169579
169678
|
var defaultSessionLastAgentDeps = {
|
|
169580
169679
|
getMessageDir,
|
|
@@ -169633,9 +169732,9 @@ async function getLastAgentFromSession(sessionID, client3, deps = {}) {
|
|
|
169633
169732
|
if (!messageDir)
|
|
169634
169733
|
return null;
|
|
169635
169734
|
try {
|
|
169636
|
-
const messages =
|
|
169735
|
+
const messages = readdirSync6(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
|
|
169637
169736
|
try {
|
|
169638
|
-
const content =
|
|
169737
|
+
const content = readFileSync23(join32(messageDir, fileName), "utf-8");
|
|
169639
169738
|
const parsed = JSON.parse(content);
|
|
169640
169739
|
return {
|
|
169641
169740
|
fileName,
|
|
@@ -169678,8 +169777,8 @@ init_agent_display_names();
|
|
|
169678
169777
|
|
|
169679
169778
|
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
|
|
169680
169779
|
init_frontmatter2();
|
|
169681
|
-
import { existsSync as existsSync37, readFileSync as
|
|
169682
|
-
import { dirname as
|
|
169780
|
+
import { existsSync as existsSync37, readFileSync as readFileSync24, writeFileSync as writeFileSync10, unlinkSync as unlinkSync6, mkdirSync as mkdirSync13 } from "fs";
|
|
169781
|
+
import { dirname as dirname13, join as join33 } from "path";
|
|
169683
169782
|
|
|
169684
169783
|
// packages/omo-opencode/src/hooks/ralph-loop/constants.ts
|
|
169685
169784
|
var DEFAULT_STATE_FILE = ".omo/ralph-loop.local.md";
|
|
@@ -169696,7 +169795,7 @@ function readState(directory, customPath) {
|
|
|
169696
169795
|
return null;
|
|
169697
169796
|
}
|
|
169698
169797
|
try {
|
|
169699
|
-
const content =
|
|
169798
|
+
const content = readFileSync24(filePath, "utf-8");
|
|
169700
169799
|
const { data, body } = parseFrontmatter(content);
|
|
169701
169800
|
const active = data.active;
|
|
169702
169801
|
const iteration = data.iteration;
|
|
@@ -170271,7 +170370,7 @@ function createTimestampedStdoutController(stdout2 = process.stdout) {
|
|
|
170271
170370
|
// packages/telemetry-core/src/activity-state.ts
|
|
170272
170371
|
init_atomic_write();
|
|
170273
170372
|
init_xdg_data_dir();
|
|
170274
|
-
import { existsSync as existsSync38, mkdirSync as mkdirSync14, readFileSync as
|
|
170373
|
+
import { existsSync as existsSync38, mkdirSync as mkdirSync14, readFileSync as readFileSync25 } from "fs";
|
|
170275
170374
|
import { basename as basename6, join as join34 } from "path";
|
|
170276
170375
|
var POSTHOG_ACTIVITY_STATE_FILE = "posthog-activity.json";
|
|
170277
170376
|
function resolveTelemetryStateDir(product, options = {}) {
|
|
@@ -170315,7 +170414,7 @@ function readPostHogActivityState(stateDir, diagnostics) {
|
|
|
170315
170414
|
return {};
|
|
170316
170415
|
}
|
|
170317
170416
|
try {
|
|
170318
|
-
const stateContent =
|
|
170417
|
+
const stateContent = readFileSync25(stateFilePath, "utf-8");
|
|
170319
170418
|
const stateJson = JSON.parse(stateContent);
|
|
170320
170419
|
if (!isPostHogActivityState(stateJson)) {
|
|
170321
170420
|
return {};
|
|
@@ -170399,7 +170498,7 @@ function getTelemetryDistinctId(machineIdPrefix, osProvider = getDefaultTelemetr
|
|
|
170399
170498
|
}
|
|
170400
170499
|
|
|
170401
170500
|
// node_modules/.bun/posthog-node@5.45.2/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
170402
|
-
import { dirname as
|
|
170501
|
+
import { dirname as dirname14, posix as posix4, sep } from "path";
|
|
170403
170502
|
function createModulerModifier() {
|
|
170404
170503
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
170405
170504
|
return async (frames) => {
|
|
@@ -170408,7 +170507,7 @@ function createModulerModifier() {
|
|
|
170408
170507
|
return frames;
|
|
170409
170508
|
};
|
|
170410
170509
|
}
|
|
170411
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
170510
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname14(process.argv[1]) : process.cwd(), isWindows = sep === "\\") {
|
|
170412
170511
|
const normalizedBase = isWindows ? normalizeWindowsPath(basePath) : basePath;
|
|
170413
170512
|
return (filename) => {
|
|
170414
170513
|
if (!filename)
|
|
@@ -177438,7 +177537,7 @@ init_constants5();
|
|
|
177438
177537
|
|
|
177439
177538
|
// packages/omo-opencode/src/cli/doctor/checks/system.ts
|
|
177440
177539
|
init_constants5();
|
|
177441
|
-
import { existsSync as existsSync49, readFileSync as
|
|
177540
|
+
import { existsSync as existsSync49, readFileSync as readFileSync35 } from "fs";
|
|
177442
177541
|
|
|
177443
177542
|
// packages/omo-opencode/src/cli/doctor/checks/system-binary.ts
|
|
177444
177543
|
init_extract_semver();
|
|
@@ -177635,7 +177734,7 @@ function compareVersions3(current, minimum) {
|
|
|
177635
177734
|
|
|
177636
177735
|
// packages/omo-opencode/src/cli/doctor/checks/system-plugin.ts
|
|
177637
177736
|
init_shared();
|
|
177638
|
-
import { existsSync as existsSync47, readFileSync as
|
|
177737
|
+
import { existsSync as existsSync47, readFileSync as readFileSync33 } from "fs";
|
|
177639
177738
|
function detectConfigPath() {
|
|
177640
177739
|
const paths2 = getOpenCodeConfigPaths({ binary: "opencode", version: null });
|
|
177641
177740
|
if (existsSync47(paths2.configJsonc))
|
|
@@ -177686,7 +177785,7 @@ function getPluginInfo() {
|
|
|
177686
177785
|
};
|
|
177687
177786
|
}
|
|
177688
177787
|
try {
|
|
177689
|
-
const content =
|
|
177788
|
+
const content = readFileSync33(configPath, "utf-8");
|
|
177690
177789
|
const parsedConfig = parseJsonc(content);
|
|
177691
177790
|
const pluginEntry = findPluginEntry2(parsedConfig.plugin ?? []);
|
|
177692
177791
|
if (!pluginEntry) {
|
|
@@ -177730,7 +177829,7 @@ init_auto_update_checker();
|
|
|
177730
177829
|
init_package_json_locator();
|
|
177731
177830
|
init_constants5();
|
|
177732
177831
|
init_shared();
|
|
177733
|
-
import { existsSync as existsSync48, readFileSync as
|
|
177832
|
+
import { existsSync as existsSync48, readFileSync as readFileSync34, readdirSync as readdirSync8 } from "fs";
|
|
177734
177833
|
import { createRequire as createRequire2 } from "module";
|
|
177735
177834
|
import { homedir as homedir13 } from "os";
|
|
177736
177835
|
import { join as join42 } from "path";
|
|
@@ -177761,7 +177860,7 @@ function readPackageJson(filePath) {
|
|
|
177761
177860
|
if (!existsSync48(filePath))
|
|
177762
177861
|
return null;
|
|
177763
177862
|
try {
|
|
177764
|
-
const content =
|
|
177863
|
+
const content = readFileSync34(filePath, "utf-8");
|
|
177765
177864
|
return parseJsonc(content);
|
|
177766
177865
|
} catch (error51) {
|
|
177767
177866
|
if (!(error51 instanceof Error)) {
|
|
@@ -177787,7 +177886,7 @@ function createTaggedInstallCandidates(rootDir) {
|
|
|
177787
177886
|
if (!existsSync48(packagesDir))
|
|
177788
177887
|
return [];
|
|
177789
177888
|
const candidates = [];
|
|
177790
|
-
for (const entryName of
|
|
177889
|
+
for (const entryName of readdirSync8(packagesDir).sort()) {
|
|
177791
177890
|
const packageName = ACCEPTED_PACKAGE_NAMES.find((name2) => entryName.startsWith(`${name2}@`));
|
|
177792
177891
|
if (packageName === undefined)
|
|
177793
177892
|
continue;
|
|
@@ -177895,7 +177994,7 @@ var defaultDeps6 = {
|
|
|
177895
177994
|
getLatestPluginVersion,
|
|
177896
177995
|
getSuggestedInstallTag,
|
|
177897
177996
|
configExists: existsSync49,
|
|
177898
|
-
readConfigFile: (path14) =>
|
|
177997
|
+
readConfigFile: (path14) => readFileSync35(path14, "utf-8"),
|
|
177899
177998
|
parseConfigContent: (content) => parseJsonc(content)
|
|
177900
177999
|
};
|
|
177901
178000
|
var BUN_POSTINSTALL_HELPER_PACKAGE_NAME = "@code-yeongyu/comment-checker";
|
|
@@ -178040,9 +178139,9 @@ async function checkSystem(deps = defaultDeps6) {
|
|
|
178040
178139
|
|
|
178041
178140
|
// packages/omo-opencode/src/config/validate.ts
|
|
178042
178141
|
init_src();
|
|
178043
|
-
import { readFileSync as
|
|
178142
|
+
import { readFileSync as readFileSync36 } from "fs";
|
|
178044
178143
|
import { homedir as homedir14 } from "os";
|
|
178045
|
-
import { dirname as
|
|
178144
|
+
import { dirname as dirname19, relative as relative5 } from "path";
|
|
178046
178145
|
init_shared();
|
|
178047
178146
|
init_plugin_identity();
|
|
178048
178147
|
function resolveHomeDirectory2() {
|
|
@@ -178066,7 +178165,7 @@ function discoverProjectLayersNearestFirst(directory) {
|
|
|
178066
178165
|
const stopDirectory = containsPath(homeDirectory, directory) ? homeDirectory : directory;
|
|
178067
178166
|
return findProjectOpencodePluginConfigFiles(directory, stopDirectory).map((configPath) => ({
|
|
178068
178167
|
path: configPath,
|
|
178069
|
-
configDir:
|
|
178168
|
+
configDir: dirname19(configPath)
|
|
178070
178169
|
}));
|
|
178071
178170
|
}
|
|
178072
178171
|
function shortPath(configPath) {
|
|
@@ -178085,12 +178184,12 @@ function schemaMessages(configPath, rawConfig) {
|
|
|
178085
178184
|
}
|
|
178086
178185
|
function parseLayerConfig(configPath) {
|
|
178087
178186
|
try {
|
|
178088
|
-
const content =
|
|
178187
|
+
const content = readFileSync36(configPath, "utf-8");
|
|
178089
178188
|
const rawConfig = parseJsonc(content);
|
|
178090
178189
|
if (!isPlainRecord(rawConfig)) {
|
|
178091
178190
|
return {
|
|
178092
178191
|
path: configPath,
|
|
178093
|
-
configDir:
|
|
178192
|
+
configDir: dirname19(configPath),
|
|
178094
178193
|
config: null,
|
|
178095
178194
|
messages: [`${shortPath(configPath)}: <root>: Expected object`]
|
|
178096
178195
|
};
|
|
@@ -178098,7 +178197,7 @@ function parseLayerConfig(configPath) {
|
|
|
178098
178197
|
const result = OhMyOpenCodeConfigSchema.safeParse(rawConfig);
|
|
178099
178198
|
return {
|
|
178100
178199
|
path: configPath,
|
|
178101
|
-
configDir:
|
|
178200
|
+
configDir: dirname19(configPath),
|
|
178102
178201
|
config: result.success ? result.data : parseConfigPartially(rawConfig),
|
|
178103
178202
|
messages: schemaMessages(configPath, rawConfig)
|
|
178104
178203
|
};
|
|
@@ -178108,7 +178207,7 @@ function parseLayerConfig(configPath) {
|
|
|
178108
178207
|
}
|
|
178109
178208
|
return {
|
|
178110
178209
|
path: configPath,
|
|
178111
|
-
configDir:
|
|
178210
|
+
configDir: dirname19(configPath),
|
|
178112
178211
|
config: null,
|
|
178113
178212
|
messages: [`${shortPath(configPath)}: ${error51.message}`]
|
|
178114
178213
|
};
|
|
@@ -178157,7 +178256,7 @@ init_constants5();
|
|
|
178157
178256
|
|
|
178158
178257
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-cache.ts
|
|
178159
178258
|
init_shared();
|
|
178160
|
-
import { existsSync as existsSync50, readFileSync as
|
|
178259
|
+
import { existsSync as existsSync50, readFileSync as readFileSync37 } from "fs";
|
|
178161
178260
|
import { homedir as homedir15 } from "os";
|
|
178162
178261
|
import { join as join43 } from "path";
|
|
178163
178262
|
function getUserConfigDir2() {
|
|
@@ -178176,7 +178275,7 @@ function loadCustomProviderNames() {
|
|
|
178176
178275
|
if (!existsSync50(configPath))
|
|
178177
178276
|
continue;
|
|
178178
178277
|
try {
|
|
178179
|
-
const content =
|
|
178278
|
+
const content = readFileSync37(configPath, "utf-8");
|
|
178180
178279
|
const data = parseJsonc(content);
|
|
178181
178280
|
if (data?.provider && typeof data.provider === "object") {
|
|
178182
178281
|
return Object.keys(data.provider);
|
|
@@ -178200,7 +178299,7 @@ function loadAvailableModelsFromCache() {
|
|
|
178200
178299
|
return { providers: [], modelCount: 0, cacheExists: false };
|
|
178201
178300
|
}
|
|
178202
178301
|
try {
|
|
178203
|
-
const content =
|
|
178302
|
+
const content = readFileSync37(cacheFile, "utf-8");
|
|
178204
178303
|
const data = parseJsonc(content);
|
|
178205
178304
|
const cacheProviders = Object.keys(data);
|
|
178206
178305
|
let modelCount = 0;
|
|
@@ -178228,7 +178327,7 @@ init_constants5();
|
|
|
178228
178327
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-config.ts
|
|
178229
178328
|
init_shared();
|
|
178230
178329
|
init_plugin_identity();
|
|
178231
|
-
import { readFileSync as
|
|
178330
|
+
import { readFileSync as readFileSync38 } from "fs";
|
|
178232
178331
|
import { join as join44 } from "path";
|
|
178233
178332
|
var PROJECT_CONFIG_DIR = join44(process.cwd(), ".opencode");
|
|
178234
178333
|
function loadOmoConfig() {
|
|
@@ -178238,7 +178337,7 @@ function loadOmoConfig() {
|
|
|
178238
178337
|
});
|
|
178239
178338
|
if (projectDetected.format !== "none") {
|
|
178240
178339
|
try {
|
|
178241
|
-
const content =
|
|
178340
|
+
const content = readFileSync38(projectDetected.path, "utf-8");
|
|
178242
178341
|
return parseJsonc(content);
|
|
178243
178342
|
} catch (error51) {
|
|
178244
178343
|
if (error51 instanceof Error) {
|
|
@@ -178254,7 +178353,7 @@ function loadOmoConfig() {
|
|
|
178254
178353
|
});
|
|
178255
178354
|
if (userDetected.format !== "none") {
|
|
178256
178355
|
try {
|
|
178257
|
-
const content =
|
|
178356
|
+
const content = readFileSync38(userDetected.path, "utf-8");
|
|
178258
178357
|
return parseJsonc(content);
|
|
178259
178358
|
} catch (error51) {
|
|
178260
178359
|
if (error51 instanceof Error) {
|
|
@@ -178589,7 +178688,7 @@ init_src();
|
|
|
178589
178688
|
import { existsSync as existsSync51 } from "fs";
|
|
178590
178689
|
import { createRequire as createRequire3 } from "module";
|
|
178591
178690
|
import { homedir as homedir17 } from "os";
|
|
178592
|
-
import { dirname as
|
|
178691
|
+
import { dirname as dirname20, join as join47 } from "path";
|
|
178593
178692
|
|
|
178594
178693
|
// packages/omo-opencode/src/hooks/comment-checker/downloader.ts
|
|
178595
178694
|
import { join as join46 } from "path";
|
|
@@ -178686,7 +178785,7 @@ function findCommentCheckerPackageBinary(baseDirOverride, resolvePackageJsonPath
|
|
|
178686
178785
|
const binaryName = process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
|
|
178687
178786
|
const platformKey = `${process.platform}-${process.arch === "x64" ? "x64" : process.arch}`;
|
|
178688
178787
|
try {
|
|
178689
|
-
const packageDir = baseDirOverride ??
|
|
178788
|
+
const packageDir = baseDirOverride ?? dirname20(resolvePackageJsonPath());
|
|
178690
178789
|
const vendorPath = join47(packageDir, "vendor", platformKey, binaryName);
|
|
178691
178790
|
if (existsSync51(vendorPath))
|
|
178692
178791
|
return vendorPath;
|
|
@@ -178835,14 +178934,14 @@ async function getGhCliInfo(dependencies = {}) {
|
|
|
178835
178934
|
}
|
|
178836
178935
|
|
|
178837
178936
|
// packages/omo-opencode/src/cli/doctor/checks/tools-lsp.ts
|
|
178838
|
-
import { readFileSync as
|
|
178937
|
+
import { readFileSync as readFileSync40 } from "fs";
|
|
178839
178938
|
import { join as join48 } from "path";
|
|
178840
178939
|
|
|
178841
178940
|
// packages/omo-opencode/src/mcp/lsp.ts
|
|
178842
178941
|
init_zod();
|
|
178843
178942
|
init_opencode_config_dir();
|
|
178844
|
-
import { existsSync as existsSync52, readFileSync as
|
|
178845
|
-
import { delimiter as delimiter3, dirname as
|
|
178943
|
+
import { existsSync as existsSync52, readFileSync as readFileSync39 } from "fs";
|
|
178944
|
+
import { delimiter as delimiter3, dirname as dirname21, resolve as resolve10 } from "path";
|
|
178846
178945
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
178847
178946
|
|
|
178848
178947
|
// packages/omo-opencode/src/mcp/cli-suffix.ts
|
|
@@ -178973,7 +179072,7 @@ var LSP_BOOTSTRAP_SCRIPT = [
|
|
|
178973
179072
|
].join(";");
|
|
178974
179073
|
function getModuleDirectory(moduleUrl) {
|
|
178975
179074
|
try {
|
|
178976
|
-
return
|
|
179075
|
+
return dirname21(fileURLToPath6(moduleUrl));
|
|
178977
179076
|
} catch (error51) {
|
|
178978
179077
|
if (!(error51 instanceof Error))
|
|
178979
179078
|
throw error51;
|
|
@@ -178985,7 +179084,7 @@ function findBootstrapRoot(candidates, pathExists) {
|
|
|
178985
179084
|
}
|
|
178986
179085
|
function readDaemonPackageVersion(root) {
|
|
178987
179086
|
try {
|
|
178988
|
-
const packageJson = JSON.parse(
|
|
179087
|
+
const packageJson = JSON.parse(readFileSync39(resolve10(root, PACKAGE_REL, "package.json"), "utf-8"));
|
|
178989
179088
|
return DaemonPackageSchema.parse(packageJson).version;
|
|
178990
179089
|
} catch (error51) {
|
|
178991
179090
|
if (!(error51 instanceof Error))
|
|
@@ -179062,7 +179161,7 @@ function readOmoConfig(configDirectory) {
|
|
|
179062
179161
|
return null;
|
|
179063
179162
|
}
|
|
179064
179163
|
try {
|
|
179065
|
-
const content =
|
|
179164
|
+
const content = readFileSync40(detected.path, "utf-8");
|
|
179066
179165
|
return parseJsonc(content);
|
|
179067
179166
|
} catch (error51) {
|
|
179068
179167
|
if (!(error51 instanceof Error)) {
|
|
@@ -179092,7 +179191,7 @@ function getInstalledLspServers(options = {}) {
|
|
|
179092
179191
|
|
|
179093
179192
|
// packages/omo-opencode/src/cli/doctor/checks/tools-mcp.ts
|
|
179094
179193
|
init_shared();
|
|
179095
|
-
import { existsSync as existsSync53, readFileSync as
|
|
179194
|
+
import { existsSync as existsSync53, readFileSync as readFileSync41 } from "fs";
|
|
179096
179195
|
import { homedir as homedir18 } from "os";
|
|
179097
179196
|
import { join as join49 } from "path";
|
|
179098
179197
|
var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
|
|
@@ -179109,7 +179208,7 @@ function loadUserMcpConfig() {
|
|
|
179109
179208
|
if (!existsSync53(configPath))
|
|
179110
179209
|
continue;
|
|
179111
179210
|
try {
|
|
179112
|
-
const content =
|
|
179211
|
+
const content = readFileSync41(configPath, "utf-8");
|
|
179113
179212
|
const config5 = parseJsonc(content);
|
|
179114
179213
|
if (config5.mcpServers) {
|
|
179115
179214
|
Object.assign(servers, config5.mcpServers);
|
|
@@ -179244,7 +179343,7 @@ async function checkTools() {
|
|
|
179244
179343
|
}
|
|
179245
179344
|
|
|
179246
179345
|
// packages/omo-opencode/src/cli/doctor/checks/telemetry.ts
|
|
179247
|
-
import { existsSync as existsSync54, readFileSync as
|
|
179346
|
+
import { existsSync as existsSync54, readFileSync as readFileSync42 } from "fs";
|
|
179248
179347
|
init_constants5();
|
|
179249
179348
|
function isTelemetryState(value) {
|
|
179250
179349
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
@@ -179255,7 +179354,7 @@ function readLastActiveDay(stateFilePath) {
|
|
|
179255
179354
|
}
|
|
179256
179355
|
let parsed;
|
|
179257
179356
|
try {
|
|
179258
|
-
parsed = JSON.parse(
|
|
179357
|
+
parsed = JSON.parse(readFileSync42(stateFilePath, "utf-8"));
|
|
179259
179358
|
} catch (error51) {
|
|
179260
179359
|
if (error51 instanceof Error) {
|
|
179261
179360
|
return "unreadable";
|
|
@@ -179331,7 +179430,7 @@ function expandHomeDirectory(directoryPath) {
|
|
|
179331
179430
|
init_constants5();
|
|
179332
179431
|
init_shared();
|
|
179333
179432
|
init_plugin_identity();
|
|
179334
|
-
import { readFileSync as
|
|
179433
|
+
import { readFileSync as readFileSync43, promises as fs15 } from "fs";
|
|
179335
179434
|
import path15 from "path";
|
|
179336
179435
|
async function checkTeamMode() {
|
|
179337
179436
|
const config5 = loadTeamModeConfig();
|
|
@@ -179368,7 +179467,7 @@ function loadTeamModeConfig() {
|
|
|
179368
179467
|
if (!configPath)
|
|
179369
179468
|
return { team_mode: undefined };
|
|
179370
179469
|
try {
|
|
179371
|
-
return parseJsonc(
|
|
179470
|
+
return parseJsonc(readFileSync43(configPath, "utf-8"));
|
|
179372
179471
|
} catch (error51) {
|
|
179373
179472
|
if (error51 instanceof Error) {
|
|
179374
179473
|
return { team_mode: undefined };
|
|
@@ -179808,13 +179907,13 @@ import {
|
|
|
179808
179907
|
chmodSync as chmodSync6,
|
|
179809
179908
|
existsSync as existsSync57,
|
|
179810
179909
|
mkdirSync as mkdirSync16,
|
|
179811
|
-
readdirSync as
|
|
179812
|
-
readFileSync as
|
|
179910
|
+
readdirSync as readdirSync9,
|
|
179911
|
+
readFileSync as readFileSync45,
|
|
179813
179912
|
renameSync as renameSync7,
|
|
179814
|
-
unlinkSync as
|
|
179913
|
+
unlinkSync as unlinkSync9,
|
|
179815
179914
|
writeFileSync as writeFileSync14
|
|
179816
179915
|
} from "fs";
|
|
179817
|
-
import { basename as basename8, dirname as
|
|
179916
|
+
import { basename as basename8, dirname as dirname22, join as join52 } from "path";
|
|
179818
179917
|
|
|
179819
179918
|
// packages/mcp-client-core/src/config-dir.ts
|
|
179820
179919
|
import { existsSync as existsSync55, realpathSync as realpathSync7 } from "fs";
|
|
@@ -179842,7 +179941,7 @@ function getOpenCodeCliConfigDir(env2 = process.env) {
|
|
|
179842
179941
|
}
|
|
179843
179942
|
|
|
179844
179943
|
// packages/mcp-client-core/src/mcp-oauth/storage-index.ts
|
|
179845
|
-
import { chmodSync as chmodSync5, existsSync as existsSync56, readFileSync as
|
|
179944
|
+
import { chmodSync as chmodSync5, existsSync as existsSync56, readFileSync as readFileSync44, renameSync as renameSync6, writeFileSync as writeFileSync13 } from "fs";
|
|
179846
179945
|
import { join as join51 } from "path";
|
|
179847
179946
|
var INDEX_FILE_NAME = "index.json";
|
|
179848
179947
|
function isTokenIndex(value) {
|
|
@@ -179858,7 +179957,7 @@ function readTokenIndex(storageDir) {
|
|
|
179858
179957
|
if (!existsSync56(indexPath))
|
|
179859
179958
|
return {};
|
|
179860
179959
|
try {
|
|
179861
|
-
const parsed = JSON.parse(
|
|
179960
|
+
const parsed = JSON.parse(readFileSync44(indexPath, "utf-8"));
|
|
179862
179961
|
return isTokenIndex(parsed) ? parsed : {};
|
|
179863
179962
|
} catch (readError) {
|
|
179864
179963
|
if (!(readError instanceof Error))
|
|
@@ -179968,7 +180067,7 @@ function readTokenFile(filePath) {
|
|
|
179968
180067
|
if (!existsSync57(filePath))
|
|
179969
180068
|
return null;
|
|
179970
180069
|
try {
|
|
179971
|
-
const parsed = JSON.parse(
|
|
180070
|
+
const parsed = JSON.parse(readFileSync45(filePath, "utf-8"));
|
|
179972
180071
|
return isOAuthTokenData(parsed) ? parsed : null;
|
|
179973
180072
|
} catch (readError) {
|
|
179974
180073
|
if (!(readError instanceof Error))
|
|
@@ -179981,7 +180080,7 @@ function readLegacyStore() {
|
|
|
179981
180080
|
if (!existsSync57(filePath))
|
|
179982
180081
|
return null;
|
|
179983
180082
|
try {
|
|
179984
|
-
const parsed = JSON.parse(
|
|
180083
|
+
const parsed = JSON.parse(readFileSync45(filePath, "utf-8"));
|
|
179985
180084
|
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed))
|
|
179986
180085
|
return null;
|
|
179987
180086
|
const result = {};
|
|
@@ -179998,7 +180097,7 @@ function readLegacyStore() {
|
|
|
179998
180097
|
}
|
|
179999
180098
|
function writeTokenFile(filePath, token) {
|
|
180000
180099
|
try {
|
|
180001
|
-
const dir =
|
|
180100
|
+
const dir = dirname22(filePath);
|
|
180002
180101
|
if (!existsSync57(dir)) {
|
|
180003
180102
|
mkdirSync16(dir, { recursive: true });
|
|
180004
180103
|
}
|
|
@@ -180026,7 +180125,7 @@ function deleteToken(serverHost, resource) {
|
|
|
180026
180125
|
if (!existsSync57(filePath))
|
|
180027
180126
|
return deleteLegacyToken(serverHost, resource);
|
|
180028
180127
|
try {
|
|
180029
|
-
|
|
180128
|
+
unlinkSync9(filePath);
|
|
180030
180129
|
return deleteTokenIndexEntry(getMcpOauthStorageDir(), getMcpOauthServerHash(serverHost, resource));
|
|
180031
180130
|
} catch (deleteError) {
|
|
180032
180131
|
if (!(deleteError instanceof Error))
|
|
@@ -180046,7 +180145,7 @@ function deleteLegacyToken(serverHost, resource) {
|
|
|
180046
180145
|
try {
|
|
180047
180146
|
const filePath = getLegacyStoragePath();
|
|
180048
180147
|
if (existsSync57(filePath))
|
|
180049
|
-
|
|
180148
|
+
unlinkSync9(filePath);
|
|
180050
180149
|
return true;
|
|
180051
180150
|
} catch (deleteError) {
|
|
180052
180151
|
if (!(deleteError instanceof Error))
|
|
@@ -180095,7 +180194,7 @@ function listAllTokens() {
|
|
|
180095
180194
|
if (!existsSync57(dir))
|
|
180096
180195
|
return result;
|
|
180097
180196
|
const index = readTokenIndex(dir);
|
|
180098
|
-
for (const entry of
|
|
180197
|
+
for (const entry of readdirSync9(dir, { withFileTypes: true })) {
|
|
180099
180198
|
if (!entry.isFile() || !entry.name.endsWith(".json") || entry.name === "index.json")
|
|
180100
180199
|
continue;
|
|
180101
180200
|
const token = readTokenFile(join52(dir, entry.name));
|
|
@@ -180794,7 +180893,7 @@ function createEmbeddingPort() {
|
|
|
180794
180893
|
// packages/learning-loop/src/codebase-scanner.ts
|
|
180795
180894
|
var import_picomatch = __toESM(require_picomatch2(), 1);
|
|
180796
180895
|
import { createHash as createHash5 } from "crypto";
|
|
180797
|
-
import { readdirSync as
|
|
180896
|
+
import { readdirSync as readdirSync10, readFileSync as readFileSync47, statSync as statSync7, existsSync as existsSync59 } from "fs";
|
|
180798
180897
|
import { join as join53, relative as relative6, extname as extname3 } from "path";
|
|
180799
180898
|
var EXT_TO_LANG = {
|
|
180800
180899
|
ts: "typescript",
|
|
@@ -180859,10 +180958,10 @@ function loadGitignore(rootDir, fs18) {
|
|
|
180859
180958
|
function defaultFs() {
|
|
180860
180959
|
return {
|
|
180861
180960
|
readdir(path18) {
|
|
180862
|
-
return
|
|
180961
|
+
return readdirSync10(path18);
|
|
180863
180962
|
},
|
|
180864
180963
|
readFile(path18) {
|
|
180865
|
-
return
|
|
180964
|
+
return readFileSync47(path18, "utf-8");
|
|
180866
180965
|
},
|
|
180867
180966
|
stat(path18) {
|
|
180868
180967
|
const s = statSync7(path18);
|
|
@@ -181215,7 +181314,7 @@ function formatSearchResults(result) {
|
|
|
181215
181314
|
}
|
|
181216
181315
|
|
|
181217
181316
|
// packages/learning-loop/src/improvement.ts
|
|
181218
|
-
import { existsSync as existsSync60, mkdirSync as mkdirSync18, readFileSync as
|
|
181317
|
+
import { existsSync as existsSync60, mkdirSync as mkdirSync18, readFileSync as readFileSync48, writeFileSync as writeFileSync16 } from "fs";
|
|
181219
181318
|
import { join as join54, basename as basename10 } from "path";
|
|
181220
181319
|
function createImprovementStore(improvementsDir) {
|
|
181221
181320
|
if (!existsSync60(improvementsDir)) {
|
|
@@ -181242,7 +181341,7 @@ function createImprovementStore(improvementsDir) {
|
|
|
181242
181341
|
function get(id) {
|
|
181243
181342
|
const filePath = join54(improvementsDir, `${id}.json`);
|
|
181244
181343
|
try {
|
|
181245
|
-
const raw =
|
|
181344
|
+
const raw = readFileSync48(filePath, "utf-8");
|
|
181246
181345
|
return JSON.parse(raw);
|
|
181247
181346
|
} catch {
|
|
181248
181347
|
return null;
|
|
@@ -181264,8 +181363,8 @@ function createImprovementStore(improvementsDir) {
|
|
|
181264
181363
|
}
|
|
181265
181364
|
function readdirSyncSafe(dir) {
|
|
181266
181365
|
try {
|
|
181267
|
-
const { readdirSync:
|
|
181268
|
-
return
|
|
181366
|
+
const { readdirSync: readdirSync11 } = __require("fs");
|
|
181367
|
+
return readdirSync11(dir);
|
|
181269
181368
|
} catch {
|
|
181270
181369
|
return;
|
|
181271
181370
|
}
|
|
@@ -182061,7 +182160,7 @@ function getClaudeConfigDir() {
|
|
|
182061
182160
|
return join57(getHomeDirectory(), ".claude");
|
|
182062
182161
|
}
|
|
182063
182162
|
// packages/skills-loader-core/src/shared/opencode-command-dirs.ts
|
|
182064
|
-
import { basename as basename11, dirname as
|
|
182163
|
+
import { basename as basename11, dirname as dirname23, join as join59 } from "path";
|
|
182065
182164
|
|
|
182066
182165
|
// packages/skills-loader-core/src/shared/opencode-config-dir.ts
|
|
182067
182166
|
import { existsSync as existsSync64, realpathSync as realpathSync8 } from "fs";
|
|
@@ -182195,11 +182294,11 @@ function getOpenCodeConfigDir2(options) {
|
|
|
182195
182294
|
|
|
182196
182295
|
// packages/skills-loader-core/src/shared/opencode-command-dirs.ts
|
|
182197
182296
|
function getParentOpencodeConfigDir(configDir) {
|
|
182198
|
-
const parentDir =
|
|
182297
|
+
const parentDir = dirname23(configDir);
|
|
182199
182298
|
if (basename11(parentDir) !== "profiles") {
|
|
182200
182299
|
return null;
|
|
182201
182300
|
}
|
|
182202
|
-
return
|
|
182301
|
+
return dirname23(parentDir);
|
|
182203
182302
|
}
|
|
182204
182303
|
function getOpenCodeSkillDirs(options) {
|
|
182205
182304
|
const configDirs = getOpenCodeConfigDirs2(options);
|
|
@@ -182217,7 +182316,7 @@ function getOpenCodeSkillDirs(options) {
|
|
|
182217
182316
|
// packages/skills-loader-core/src/shared/project-discovery-dirs.ts
|
|
182218
182317
|
import { execFileSync as execFileSync2 } from "child_process";
|
|
182219
182318
|
import { existsSync as existsSync65, realpathSync as realpathSync9 } from "fs";
|
|
182220
|
-
import { dirname as
|
|
182319
|
+
import { dirname as dirname24, join as join60, resolve as resolve13, win32 as win326 } from "path";
|
|
182221
182320
|
var worktreePathCache2 = new Map;
|
|
182222
182321
|
function normalizePath2(path18) {
|
|
182223
182322
|
const resolvedPath = process.platform !== "win32" && win326.isAbsolute(path18) ? path18 : resolve13(path18);
|
|
@@ -182267,7 +182366,7 @@ function findAncestorDirectories(startDirectory, targetPaths, stopDirectory) {
|
|
|
182267
182366
|
if (stopDirectoryKey === pathKey2(currentDirectory)) {
|
|
182268
182367
|
return directories;
|
|
182269
182368
|
}
|
|
182270
|
-
const parentDirectory =
|
|
182369
|
+
const parentDirectory = dirname24(currentDirectory);
|
|
182271
182370
|
if (parentDirectory === currentDirectory) {
|
|
182272
182371
|
return directories;
|
|
182273
182372
|
}
|
|
@@ -183369,9 +183468,9 @@ playwright-cli close
|
|
|
183369
183468
|
// packages/skills-loader-core/src/features/builtin-skills/skill-file-loader.ts
|
|
183370
183469
|
init_shared_skills();
|
|
183371
183470
|
init_src();
|
|
183372
|
-
import { readFileSync as
|
|
183471
|
+
import { readFileSync as readFileSync51 } from "fs";
|
|
183373
183472
|
import { join as join64 } from "path";
|
|
183374
|
-
function createSharedSkillTemplateLoader(readFile3 =
|
|
183473
|
+
function createSharedSkillTemplateLoader(readFile3 = readFileSync51, skillsRootPath = sharedSkillsRootPath()) {
|
|
183375
183474
|
const cache = new Map;
|
|
183376
183475
|
return (skillName) => {
|
|
183377
183476
|
const cached2 = cache.get(skillName);
|
|
@@ -184515,9 +184614,9 @@ var gitMasterSkill = {
|
|
|
184515
184614
|
template: GIT_MASTER_TEMPLATE
|
|
184516
184615
|
};
|
|
184517
184616
|
// packages/skills-loader-core/src/features/builtin-skills/skills/dev-browser.ts
|
|
184518
|
-
import { dirname as
|
|
184617
|
+
import { dirname as dirname25, join as join65 } from "path";
|
|
184519
184618
|
import { fileURLToPath as fileURLToPath8 } from "url";
|
|
184520
|
-
var CURRENT_DIR =
|
|
184619
|
+
var CURRENT_DIR = dirname25(fileURLToPath8(import.meta.url));
|
|
184521
184620
|
var devBrowserSkill = {
|
|
184522
184621
|
name: "dev-browser",
|
|
184523
184622
|
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.",
|
|
@@ -185731,9 +185830,9 @@ import {
|
|
|
185731
185830
|
existsSync as existsSync67,
|
|
185732
185831
|
mkdirSync as mkdirSync21,
|
|
185733
185832
|
copyFileSync as copyFileSync4,
|
|
185734
|
-
readFileSync as
|
|
185833
|
+
readFileSync as readFileSync52,
|
|
185735
185834
|
writeFileSync as writeFileSync19,
|
|
185736
|
-
readdirSync as
|
|
185835
|
+
readdirSync as readdirSync11,
|
|
185737
185836
|
statSync as statSync8,
|
|
185738
185837
|
rmSync as rmSync4
|
|
185739
185838
|
} from "fs";
|
|
@@ -185748,10 +185847,10 @@ async function snapshotCli(options = {}) {
|
|
|
185748
185847
|
const realFs = {
|
|
185749
185848
|
existsSync: existsSync67,
|
|
185750
185849
|
mkdirSync: mkdirSync21,
|
|
185751
|
-
readFileSync:
|
|
185850
|
+
readFileSync: readFileSync52,
|
|
185752
185851
|
writeFileSync: writeFileSync19,
|
|
185753
185852
|
copyFileSync: copyFileSync4,
|
|
185754
|
-
readdirSync:
|
|
185853
|
+
readdirSync: readdirSync11,
|
|
185755
185854
|
statSync: statSync8,
|
|
185756
185855
|
rmSync: rmSync4
|
|
185757
185856
|
};
|
|
@@ -185814,9 +185913,9 @@ import {
|
|
|
185814
185913
|
existsSync as existsSync68,
|
|
185815
185914
|
mkdirSync as mkdirSync22,
|
|
185816
185915
|
copyFileSync as copyFileSync5,
|
|
185817
|
-
readFileSync as
|
|
185916
|
+
readFileSync as readFileSync53,
|
|
185818
185917
|
writeFileSync as writeFileSync20,
|
|
185819
|
-
readdirSync as
|
|
185918
|
+
readdirSync as readdirSync12,
|
|
185820
185919
|
statSync as statSync9,
|
|
185821
185920
|
rmSync as rmSync5
|
|
185822
185921
|
} from "fs";
|
|
@@ -185827,10 +185926,10 @@ async function restoreCli(options) {
|
|
|
185827
185926
|
const realFs = {
|
|
185828
185927
|
existsSync: existsSync68,
|
|
185829
185928
|
mkdirSync: mkdirSync22,
|
|
185830
|
-
readFileSync:
|
|
185929
|
+
readFileSync: readFileSync53,
|
|
185831
185930
|
writeFileSync: writeFileSync20,
|
|
185832
185931
|
copyFileSync: copyFileSync5,
|
|
185833
|
-
readdirSync:
|
|
185932
|
+
readdirSync: readdirSync12,
|
|
185834
185933
|
statSync: statSync9,
|
|
185835
185934
|
rmSync: rmSync5
|
|
185836
185935
|
};
|
|
@@ -185842,7 +185941,7 @@ async function restoreCli(options) {
|
|
|
185842
185941
|
try {
|
|
185843
185942
|
restoreSnapshot(options.state, { snapshotDir, fs: realFs });
|
|
185844
185943
|
const manifestPath = path19.join(snapshotDir, options.state, "manifest.json");
|
|
185845
|
-
const raw =
|
|
185944
|
+
const raw = readFileSync53(manifestPath).toString("utf-8");
|
|
185846
185945
|
const parsed = JSON.parse(raw);
|
|
185847
185946
|
const fileCount = typeof parsed === "object" && parsed !== null && "files" in parsed && Array.isArray(parsed.files) ? parsed.files.length : 0;
|
|
185848
185947
|
if (options.json) {
|
|
@@ -185866,9 +185965,9 @@ import {
|
|
|
185866
185965
|
existsSync as existsSync69,
|
|
185867
185966
|
mkdirSync as mkdirSync23,
|
|
185868
185967
|
copyFileSync as copyFileSync6,
|
|
185869
|
-
readFileSync as
|
|
185968
|
+
readFileSync as readFileSync54,
|
|
185870
185969
|
writeFileSync as writeFileSync21,
|
|
185871
|
-
readdirSync as
|
|
185970
|
+
readdirSync as readdirSync13,
|
|
185872
185971
|
statSync as statSync10,
|
|
185873
185972
|
rmSync as rmSync6
|
|
185874
185973
|
} from "fs";
|
|
@@ -185889,10 +185988,10 @@ async function snapshotListCli(options) {
|
|
|
185889
185988
|
const realFs = {
|
|
185890
185989
|
existsSync: existsSync69,
|
|
185891
185990
|
mkdirSync: mkdirSync23,
|
|
185892
|
-
readFileSync:
|
|
185991
|
+
readFileSync: readFileSync54,
|
|
185893
185992
|
writeFileSync: writeFileSync21,
|
|
185894
185993
|
copyFileSync: copyFileSync6,
|
|
185895
|
-
readdirSync:
|
|
185994
|
+
readdirSync: readdirSync13,
|
|
185896
185995
|
statSync: statSync10,
|
|
185897
185996
|
rmSync: rmSync6
|
|
185898
185997
|
};
|
|
@@ -185920,9 +186019,9 @@ import {
|
|
|
185920
186019
|
existsSync as existsSync70,
|
|
185921
186020
|
mkdirSync as mkdirSync24,
|
|
185922
186021
|
copyFileSync as copyFileSync7,
|
|
185923
|
-
readFileSync as
|
|
186022
|
+
readFileSync as readFileSync55,
|
|
185924
186023
|
writeFileSync as writeFileSync22,
|
|
185925
|
-
readdirSync as
|
|
186024
|
+
readdirSync as readdirSync14,
|
|
185926
186025
|
statSync as statSync11,
|
|
185927
186026
|
rmSync as rmSync7
|
|
185928
186027
|
} from "fs";
|
|
@@ -185933,10 +186032,10 @@ async function snapshotPruneCli(options = {}) {
|
|
|
185933
186032
|
const realFs = {
|
|
185934
186033
|
existsSync: existsSync70,
|
|
185935
186034
|
mkdirSync: mkdirSync24,
|
|
185936
|
-
readFileSync:
|
|
186035
|
+
readFileSync: readFileSync55,
|
|
185937
186036
|
writeFileSync: writeFileSync22,
|
|
185938
186037
|
copyFileSync: copyFileSync7,
|
|
185939
|
-
readdirSync:
|
|
186038
|
+
readdirSync: readdirSync14,
|
|
185940
186039
|
statSync: statSync11,
|
|
185941
186040
|
rmSync: rmSync7
|
|
185942
186041
|
};
|
|
@@ -186454,7 +186553,7 @@ async function traceCli(sessionId, options = {}) {
|
|
|
186454
186553
|
|
|
186455
186554
|
// packages/omo-opencode/src/cli/dashboard.ts
|
|
186456
186555
|
import * as path25 from "path";
|
|
186457
|
-
import { readFileSync as
|
|
186556
|
+
import { readFileSync as readFileSync57 } from "fs";
|
|
186458
186557
|
|
|
186459
186558
|
// packages/omo-opencode/src/features/dashboard/data-provider.ts
|
|
186460
186559
|
import * as os12 from "os";
|
|
@@ -187189,7 +187288,7 @@ function loadGatewayPassphrase() {
|
|
|
187189
187288
|
try {
|
|
187190
187289
|
const configDir = getConfigDir();
|
|
187191
187290
|
const configPath = path25.join(configDir, "matrixos.jsonc");
|
|
187192
|
-
const raw =
|
|
187291
|
+
const raw = readFileSync57(configPath, "utf-8");
|
|
187193
187292
|
const config5 = parseJsonc(raw);
|
|
187194
187293
|
const dashboard2 = config5.dashboard;
|
|
187195
187294
|
return typeof dashboard2?.gatewayPassphrase === "string" ? dashboard2.gatewayPassphrase : undefined;
|
|
@@ -187785,8 +187884,8 @@ project.command("search <query>").description("Search the active project KB and
|
|
|
187785
187884
|
});
|
|
187786
187885
|
project.command("add-doc <slug> <file>").description("Copy a document into the project KB").action(async (slug, filePath) => {
|
|
187787
187886
|
const { addKbDocument: addKbDocument2 } = await Promise.resolve().then(() => (init_project_memory(), exports_project_memory));
|
|
187788
|
-
const { readFileSync:
|
|
187789
|
-
const content =
|
|
187887
|
+
const { readFileSync: readFileSync65 } = await import("fs");
|
|
187888
|
+
const content = readFileSync65(filePath, "utf-8");
|
|
187790
187889
|
const dest = addKbDocument2(slug, filePath, content);
|
|
187791
187890
|
process.stdout.write(JSON.stringify({ ok: true, dest }, null, 2) + `
|
|
187792
187891
|
`);
|