@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-node/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",
|
|
@@ -67738,16 +67739,41 @@ 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 {
|
|
67742
|
-
|
|
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
|
+
readFileSync as readFileSync15
|
|
67751
|
+
} from "fs";
|
|
67752
|
+
import { dirname as dirname9, join as join25 } from "path";
|
|
67743
67753
|
import { homedir as homedir6 } from "os";
|
|
67754
|
+
import { spawnSync as spawnSync3 } from "child_process";
|
|
67755
|
+
function findSlashCommandSource() {
|
|
67756
|
+
const candidates = [
|
|
67757
|
+
join25(import.meta.dir, "slash-commands"),
|
|
67758
|
+
join25(import.meta.dir, "..", "slash-commands"),
|
|
67759
|
+
join25(import.meta.dir, "..", "..", "src", "cli", "slash-commands")
|
|
67760
|
+
];
|
|
67761
|
+
for (const c of candidates) {
|
|
67762
|
+
if (existsSync26(c) && existsSync26(join25(c, "adopt.md")))
|
|
67763
|
+
return c;
|
|
67764
|
+
}
|
|
67765
|
+
return null;
|
|
67766
|
+
}
|
|
67744
67767
|
function copySlashCommandsTo(dir) {
|
|
67745
67768
|
try {
|
|
67746
67769
|
if (!existsSync26(dir))
|
|
67747
67770
|
mkdirSync9(dir, { recursive: true });
|
|
67771
|
+
const srcDir = findSlashCommandSource();
|
|
67772
|
+
if (!srcDir)
|
|
67773
|
+
return 0;
|
|
67748
67774
|
let copied = 0;
|
|
67749
67775
|
for (const name2 of SLASH_COMMAND_NAMES) {
|
|
67750
|
-
const src = join25(
|
|
67776
|
+
const src = join25(srcDir, name2);
|
|
67751
67777
|
if (!existsSync26(src))
|
|
67752
67778
|
continue;
|
|
67753
67779
|
copyFileSync3(src, join25(dir, name2));
|
|
@@ -67769,6 +67795,72 @@ function resolveMatrixosBin() {
|
|
|
67769
67795
|
}
|
|
67770
67796
|
return null;
|
|
67771
67797
|
}
|
|
67798
|
+
function npmGlobalInstallMatrixos(version) {
|
|
67799
|
+
try {
|
|
67800
|
+
const result = spawnSync3("npm", ["install", "-g", `@kl-c/matrixos@${version}`], {
|
|
67801
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
67802
|
+
shell: false,
|
|
67803
|
+
timeout: 120000
|
|
67804
|
+
});
|
|
67805
|
+
if (result.status !== 0)
|
|
67806
|
+
return null;
|
|
67807
|
+
const found = spawnSync3("command", ["-v", "matrixos"], {
|
|
67808
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
67809
|
+
shell: false
|
|
67810
|
+
});
|
|
67811
|
+
const bin = found.stdout?.toString().trim();
|
|
67812
|
+
if (bin && existsSync26(bin))
|
|
67813
|
+
return bin;
|
|
67814
|
+
for (const dir of ["/usr/local/bin", "/usr/bin"]) {
|
|
67815
|
+
const p = join25(dir, "matrixos");
|
|
67816
|
+
if (existsSync26(p))
|
|
67817
|
+
return p;
|
|
67818
|
+
}
|
|
67819
|
+
return null;
|
|
67820
|
+
} catch {
|
|
67821
|
+
return null;
|
|
67822
|
+
}
|
|
67823
|
+
}
|
|
67824
|
+
function getPackageVersion() {
|
|
67825
|
+
const candidates = [
|
|
67826
|
+
join25(import.meta.dir, "..", "..", "package.json"),
|
|
67827
|
+
join25(import.meta.dir, "..", "package.json")
|
|
67828
|
+
];
|
|
67829
|
+
for (const c of candidates) {
|
|
67830
|
+
try {
|
|
67831
|
+
if (!existsSync26(c))
|
|
67832
|
+
continue;
|
|
67833
|
+
const pkg = JSON.parse(readFileSync15(c, "utf-8"));
|
|
67834
|
+
if (pkg.version)
|
|
67835
|
+
return pkg.version;
|
|
67836
|
+
} catch {}
|
|
67837
|
+
}
|
|
67838
|
+
return null;
|
|
67839
|
+
}
|
|
67840
|
+
function copyRecursive(from, to) {
|
|
67841
|
+
if (!existsSync26(to))
|
|
67842
|
+
mkdirSync9(to, { recursive: true });
|
|
67843
|
+
for (const entry of readdirSync4(from, { withFileTypes: true })) {
|
|
67844
|
+
const src = join25(from, entry.name);
|
|
67845
|
+
const dst = join25(to, entry.name);
|
|
67846
|
+
if (entry.isDirectory()) {
|
|
67847
|
+
copyRecursive(src, dst);
|
|
67848
|
+
} else {
|
|
67849
|
+
copyFileSync3(src, dst);
|
|
67850
|
+
}
|
|
67851
|
+
}
|
|
67852
|
+
}
|
|
67853
|
+
function installPackageTo(path7, bin) {
|
|
67854
|
+
const srcDir = dirname9(dirname9(bin));
|
|
67855
|
+
if (!existsSync26(srcDir))
|
|
67856
|
+
return null;
|
|
67857
|
+
try {
|
|
67858
|
+
copyRecursive(srcDir, path7);
|
|
67859
|
+
return join25(path7, "bin", "matrixos.js");
|
|
67860
|
+
} catch {
|
|
67861
|
+
return null;
|
|
67862
|
+
}
|
|
67863
|
+
}
|
|
67772
67864
|
function installSlashCommandsAndPath() {
|
|
67773
67865
|
const home = homedir6();
|
|
67774
67866
|
const targets = [
|
|
@@ -67779,23 +67871,30 @@ function installSlashCommandsAndPath() {
|
|
|
67779
67871
|
for (const t of targets)
|
|
67780
67872
|
total += copySlashCommandsTo(t);
|
|
67781
67873
|
let pathLinked = false;
|
|
67782
|
-
const
|
|
67874
|
+
const liveBin = resolveMatrixosBin();
|
|
67783
67875
|
const linkPath = "/usr/local/bin/matrixos";
|
|
67784
|
-
|
|
67876
|
+
const persistentDir = "/usr/local/lib/matrixos";
|
|
67877
|
+
const version = getPackageVersion();
|
|
67878
|
+
const globalBin = version ? npmGlobalInstallMatrixos(version) : null;
|
|
67879
|
+
if (globalBin) {
|
|
67880
|
+
return { commands: total, pathLinked: true };
|
|
67881
|
+
}
|
|
67882
|
+
if (liveBin) {
|
|
67785
67883
|
try {
|
|
67884
|
+
const target = installPackageTo(persistentDir, liveBin) ?? liveBin;
|
|
67786
67885
|
if (existsSync26(linkPath)) {
|
|
67787
67886
|
try {
|
|
67788
67887
|
const cur = readlinkSync(linkPath);
|
|
67789
|
-
if (cur
|
|
67790
|
-
|
|
67791
|
-
|
|
67888
|
+
if (cur === target) {
|
|
67889
|
+
pathLinked = true;
|
|
67890
|
+
return { commands: total, pathLinked };
|
|
67792
67891
|
}
|
|
67793
|
-
} catch {
|
|
67794
|
-
|
|
67795
|
-
|
|
67796
|
-
|
|
67797
|
-
symlinkSync(bin, linkPath);
|
|
67892
|
+
} catch {}
|
|
67893
|
+
try {
|
|
67894
|
+
unlinkSync5(linkPath);
|
|
67895
|
+
} catch {}
|
|
67798
67896
|
}
|
|
67897
|
+
symlinkSync(target, linkPath);
|
|
67799
67898
|
pathLinked = true;
|
|
67800
67899
|
} catch {
|
|
67801
67900
|
pathLinked = false;
|
|
@@ -69654,7 +69753,7 @@ var init_dist5 = __esm(() => {
|
|
|
69654
69753
|
|
|
69655
69754
|
// packages/omo-opencode/src/cli/config-manager/write-gateway-env.ts
|
|
69656
69755
|
import { homedir as homedir8 } from "os";
|
|
69657
|
-
import { existsSync as existsSync27, mkdirSync as mkdirSync10, readFileSync as
|
|
69756
|
+
import { existsSync as existsSync27, mkdirSync as mkdirSync10, readFileSync as readFileSync16, writeFileSync as writeFileSync6, chmodSync as chmodSync3 } from "fs";
|
|
69658
69757
|
import { join as join27 } from "path";
|
|
69659
69758
|
function writeGatewayEnvToken(key, token) {
|
|
69660
69759
|
const configDir = homedir8();
|
|
@@ -69663,7 +69762,7 @@ function writeGatewayEnvToken(key, token) {
|
|
|
69663
69762
|
const envPath = join27(configDir, GATEWAY_ENV_FILENAME);
|
|
69664
69763
|
const entries = new Map;
|
|
69665
69764
|
if (existsSync27(envPath)) {
|
|
69666
|
-
const existing =
|
|
69765
|
+
const existing = readFileSync16(envPath, "utf-8");
|
|
69667
69766
|
for (const rawLine of existing.split(`
|
|
69668
69767
|
`)) {
|
|
69669
69768
|
const line = rawLine.trim();
|
|
@@ -129018,7 +129117,7 @@ var init_writer2 = __esm(() => {
|
|
|
129018
129117
|
|
|
129019
129118
|
// packages/omo-config-core/src/generator/mini-os-generator.ts
|
|
129020
129119
|
import { existsSync as existsSync29, mkdirSync as mkdirSync11, writeFileSync as writeFileSync8 } from "fs";
|
|
129021
|
-
import { dirname as
|
|
129120
|
+
import { dirname as dirname10, join as join28 } from "path";
|
|
129022
129121
|
function generateMiniOS(options) {
|
|
129023
129122
|
const fs6 = options.fs ?? defaultFS;
|
|
129024
129123
|
const profile2 = options.profile;
|
|
@@ -129086,7 +129185,7 @@ _Skill required by the ${displayName} profile. Implementation goes here._
|
|
|
129086
129185
|
function writeIfMissing(fs6, path7, content) {
|
|
129087
129186
|
if (fs6.existsSync(path7))
|
|
129088
129187
|
return;
|
|
129089
|
-
const dir =
|
|
129188
|
+
const dir = dirname10(path7);
|
|
129090
129189
|
if (!fs6.existsSync(dir)) {
|
|
129091
129190
|
fs6.mkdirSync(dir, { recursive: true });
|
|
129092
129191
|
}
|
|
@@ -129940,19 +130039,19 @@ var init_update_toasts = __esm(() => {
|
|
|
129940
130039
|
|
|
129941
130040
|
// packages/omo-opencode/src/hooks/auto-update-checker/hook/background-update-check.ts
|
|
129942
130041
|
import { existsSync as existsSync45 } from "fs";
|
|
129943
|
-
import { dirname as
|
|
130042
|
+
import { dirname as dirname18, join as join40 } from "path";
|
|
129944
130043
|
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
129945
130044
|
function defaultGetModuleHostingWorkspace() {
|
|
129946
130045
|
try {
|
|
129947
|
-
const currentDir =
|
|
130046
|
+
const currentDir = dirname18(fileURLToPath4(import.meta.url));
|
|
129948
130047
|
const pkgJsonPath = findPackageJsonUp(currentDir);
|
|
129949
130048
|
if (!pkgJsonPath)
|
|
129950
130049
|
return null;
|
|
129951
|
-
const pkgDir =
|
|
129952
|
-
const nodeModulesDir =
|
|
130050
|
+
const pkgDir = dirname18(pkgJsonPath);
|
|
130051
|
+
const nodeModulesDir = dirname18(pkgDir);
|
|
129953
130052
|
if (nodeModulesDir.split(/[\\/]/).pop() !== "node_modules")
|
|
129954
130053
|
return null;
|
|
129955
|
-
return
|
|
130054
|
+
return dirname18(nodeModulesDir);
|
|
129956
130055
|
} catch (error51) {
|
|
129957
130056
|
if (error51 instanceof Error) {
|
|
129958
130057
|
return null;
|
|
@@ -154521,7 +154620,7 @@ var require_filesystem = __commonJS((exports2, module2) => {
|
|
|
154521
154620
|
var LDD_PATH = "/usr/bin/ldd";
|
|
154522
154621
|
var SELF_PATH = "/proc/self/exe";
|
|
154523
154622
|
var MAX_LENGTH = 2048;
|
|
154524
|
-
var
|
|
154623
|
+
var readFileSync47 = (path18) => {
|
|
154525
154624
|
const fd = fs18.openSync(path18, "r");
|
|
154526
154625
|
const buffer = Buffer.alloc(MAX_LENGTH);
|
|
154527
154626
|
const bytesRead = fs18.readSync(fd, buffer, 0, MAX_LENGTH, 0);
|
|
@@ -154544,7 +154643,7 @@ var require_filesystem = __commonJS((exports2, module2) => {
|
|
|
154544
154643
|
module2.exports = {
|
|
154545
154644
|
LDD_PATH,
|
|
154546
154645
|
SELF_PATH,
|
|
154547
|
-
readFileSync:
|
|
154646
|
+
readFileSync: readFileSync47,
|
|
154548
154647
|
readFile
|
|
154549
154648
|
};
|
|
154550
154649
|
});
|
|
@@ -154587,7 +154686,7 @@ var require_elf = __commonJS((exports2, module2) => {
|
|
|
154587
154686
|
var require_detect_libc = __commonJS((exports2, module2) => {
|
|
154588
154687
|
var childProcess = __require("child_process");
|
|
154589
154688
|
var { isLinux, getReport } = require_process();
|
|
154590
|
-
var { LDD_PATH, SELF_PATH, readFile, readFileSync:
|
|
154689
|
+
var { LDD_PATH, SELF_PATH, readFile, readFileSync: readFileSync47 } = require_filesystem();
|
|
154591
154690
|
var { interpreterPath } = require_elf();
|
|
154592
154691
|
var cachedFamilyInterpreter;
|
|
154593
154692
|
var cachedFamilyFilesystem;
|
|
@@ -154678,7 +154777,7 @@ var require_detect_libc = __commonJS((exports2, module2) => {
|
|
|
154678
154777
|
}
|
|
154679
154778
|
cachedFamilyFilesystem = null;
|
|
154680
154779
|
try {
|
|
154681
|
-
const lddContent =
|
|
154780
|
+
const lddContent = readFileSync47(LDD_PATH);
|
|
154682
154781
|
cachedFamilyFilesystem = getFamilyFromLddContent(lddContent);
|
|
154683
154782
|
} catch (e) {}
|
|
154684
154783
|
return cachedFamilyFilesystem;
|
|
@@ -154701,7 +154800,7 @@ var require_detect_libc = __commonJS((exports2, module2) => {
|
|
|
154701
154800
|
}
|
|
154702
154801
|
cachedFamilyInterpreter = null;
|
|
154703
154802
|
try {
|
|
154704
|
-
const selfContent =
|
|
154803
|
+
const selfContent = readFileSync47(SELF_PATH);
|
|
154705
154804
|
const path18 = interpreterPath(selfContent);
|
|
154706
154805
|
cachedFamilyInterpreter = familyFromInterpreterPath(path18);
|
|
154707
154806
|
} catch (e) {}
|
|
@@ -154763,7 +154862,7 @@ var require_detect_libc = __commonJS((exports2, module2) => {
|
|
|
154763
154862
|
}
|
|
154764
154863
|
cachedVersionFilesystem = null;
|
|
154765
154864
|
try {
|
|
154766
|
-
const lddContent =
|
|
154865
|
+
const lddContent = readFileSync47(LDD_PATH);
|
|
154767
154866
|
const versionMatch = lddContent.match(RE_GLIBC_VERSION);
|
|
154768
154867
|
if (versionMatch) {
|
|
154769
154868
|
cachedVersionFilesystem = versionMatch[1];
|
|
@@ -155065,7 +155164,7 @@ var require_libvips = __commonJS((exports2, module2) => {
|
|
|
155065
155164
|
var fs18 = __require("fs");
|
|
155066
155165
|
var os7 = __require("os");
|
|
155067
155166
|
var path18 = __require("path");
|
|
155068
|
-
var
|
|
155167
|
+
var spawnSync4 = __require("child_process").spawnSync;
|
|
155069
155168
|
var semverCoerce = require_coerce();
|
|
155070
155169
|
var semverGreaterThanOrEqualTo = require_gte();
|
|
155071
155170
|
var platform = require_platform();
|
|
@@ -155106,14 +155205,14 @@ var require_libvips = __commonJS((exports2, module2) => {
|
|
|
155106
155205
|
};
|
|
155107
155206
|
var isRosetta = function() {
|
|
155108
155207
|
if (process.platform === "darwin" && process.arch === "x64") {
|
|
155109
|
-
const translated =
|
|
155208
|
+
const translated = spawnSync4("sysctl sysctl.proc_translated", spawnSyncOptions).stdout;
|
|
155110
155209
|
return (translated || "").trim() === "sysctl.proc_translated: 1";
|
|
155111
155210
|
}
|
|
155112
155211
|
return false;
|
|
155113
155212
|
};
|
|
155114
155213
|
var globalLibvipsVersion = function() {
|
|
155115
155214
|
if (process.platform !== "win32") {
|
|
155116
|
-
const globalLibvipsVersion2 =
|
|
155215
|
+
const globalLibvipsVersion2 = spawnSync4("pkg-config --modversion vips-cpp", {
|
|
155117
155216
|
...spawnSyncOptions,
|
|
155118
155217
|
env: {
|
|
155119
155218
|
...env4,
|
|
@@ -155133,7 +155232,7 @@ var require_libvips = __commonJS((exports2, module2) => {
|
|
|
155133
155232
|
};
|
|
155134
155233
|
var pkgConfigPath = function() {
|
|
155135
155234
|
if (process.platform !== "win32") {
|
|
155136
|
-
const brewPkgConfigPath =
|
|
155235
|
+
const brewPkgConfigPath = spawnSync4('which brew >/dev/null 2>&1 && brew environment --plain | grep PKG_CONFIG_LIBDIR | cut -d" " -f2', spawnSyncOptions).stdout || "";
|
|
155137
155236
|
return [
|
|
155138
155237
|
brewPkgConfigPath.trim(),
|
|
155139
155238
|
env4.PKG_CONFIG_PATH,
|
|
@@ -164924,8 +165023,8 @@ __export(exports_generate, {
|
|
|
164924
165023
|
executeGenerateCommand: () => executeGenerateCommand,
|
|
164925
165024
|
ProfileNotFoundError: () => ProfileNotFoundError
|
|
164926
165025
|
});
|
|
164927
|
-
import { existsSync as existsSync72, readFileSync as
|
|
164928
|
-
import { dirname as
|
|
165026
|
+
import { existsSync as existsSync72, readFileSync as readFileSync58, realpathSync as realpathSync10 } from "fs";
|
|
165027
|
+
import { dirname as dirname29, isAbsolute as isAbsolute6, join as join77, resolve as resolve16 } from "path";
|
|
164929
165028
|
function profilesDirFor(opts) {
|
|
164930
165029
|
if (opts.profilesDir)
|
|
164931
165030
|
return opts.profilesDir;
|
|
@@ -165021,8 +165120,8 @@ var REPO_ROOT, defaultFS2, PROFILES_RELATIVE = "assets/profiles", ProfileNotFoun
|
|
|
165021
165120
|
var init_generate = __esm(() => {
|
|
165022
165121
|
init_src5();
|
|
165023
165122
|
init_src5();
|
|
165024
|
-
REPO_ROOT = resolve16(
|
|
165025
|
-
defaultFS2 = { existsSync: existsSync72, readFileSync:
|
|
165123
|
+
REPO_ROOT = resolve16(dirname29(new URL(import.meta.url).pathname), "..", "..", "..", "..", "..");
|
|
165124
|
+
defaultFS2 = { existsSync: existsSync72, readFileSync: readFileSync58, realpathSync: realpathSync10 };
|
|
165026
165125
|
ProfileNotFoundError = class ProfileNotFoundError extends Error {
|
|
165027
165126
|
profileName;
|
|
165028
165127
|
constructor(profileName) {
|
|
@@ -165276,8 +165375,8 @@ var exports_profile_resolve = {};
|
|
|
165276
165375
|
__export(exports_profile_resolve, {
|
|
165277
165376
|
executeProfileResolveCommand: () => executeProfileResolveCommand
|
|
165278
165377
|
});
|
|
165279
|
-
import { existsSync as existsSync74, readdirSync as
|
|
165280
|
-
import { join as join80, resolve as resolve17, dirname as
|
|
165378
|
+
import { existsSync as existsSync74, readdirSync as readdirSync16, readFileSync as readFileSync59 } from "fs";
|
|
165379
|
+
import { join as join80, resolve as resolve17, dirname as dirname30 } from "path";
|
|
165281
165380
|
function executeProfileResolveCommand(args) {
|
|
165282
165381
|
if (args.options.help) {
|
|
165283
165382
|
return {
|
|
@@ -165309,7 +165408,7 @@ function executeProfileResolveCommand(args) {
|
|
|
165309
165408
|
}
|
|
165310
165409
|
let profileFiles;
|
|
165311
165410
|
try {
|
|
165312
|
-
profileFiles =
|
|
165411
|
+
profileFiles = readdirSync16(profilesDir).filter((f2) => f2.endsWith(".json"));
|
|
165313
165412
|
} catch (err) {
|
|
165314
165413
|
const message = err instanceof Error ? err.message : String(err);
|
|
165315
165414
|
return { exitCode: 1, stdout: `error: failed to read profiles directory: ${message}
|
|
@@ -165323,7 +165422,7 @@ function executeProfileResolveCommand(args) {
|
|
|
165323
165422
|
for (const file3 of profileFiles) {
|
|
165324
165423
|
try {
|
|
165325
165424
|
const filePath = join80(profilesDir, file3);
|
|
165326
|
-
const raw = JSON.parse(
|
|
165425
|
+
const raw = JSON.parse(readFileSync59(filePath, "utf-8"));
|
|
165327
165426
|
const profile2 = ProfileSchema.parse(raw);
|
|
165328
165427
|
registry2[profile2.name] = profile2;
|
|
165329
165428
|
} catch {}
|
|
@@ -165375,7 +165474,7 @@ function executeProfileResolveCommand(args) {
|
|
|
165375
165474
|
var REPO_ROOT2, PROFILES_RELATIVE2 = "assets/profiles";
|
|
165376
165475
|
var init_profile_resolve = __esm(() => {
|
|
165377
165476
|
init_src5();
|
|
165378
|
-
REPO_ROOT2 = resolve17(
|
|
165477
|
+
REPO_ROOT2 = resolve17(dirname30(new URL(import.meta.url).pathname), "..", "..", "..", "..");
|
|
165379
165478
|
});
|
|
165380
165479
|
|
|
165381
165480
|
// packages/omo-opencode/src/cli/export.ts
|
|
@@ -165385,9 +165484,9 @@ __export(exports_export, {
|
|
|
165385
165484
|
getShell: () => getShell,
|
|
165386
165485
|
executeExportCommand: () => executeExportCommand
|
|
165387
165486
|
});
|
|
165388
|
-
import { existsSync as existsSync75, readFileSync as
|
|
165389
|
-
import { isAbsolute as isAbsolute7, join as join81, resolve as resolve18, dirname as
|
|
165390
|
-
import { spawnSync as
|
|
165487
|
+
import { existsSync as existsSync75, readFileSync as readFileSync60, writeFileSync as writeFileSync26, copyFileSync as copyFileSync8, realpathSync as realpathSync11, mkdirSync as mkdirSync27 } from "fs";
|
|
165488
|
+
import { isAbsolute as isAbsolute7, join as join81, resolve as resolve18, dirname as dirname31 } from "path";
|
|
165489
|
+
import { spawnSync as spawnSync4 } from "child_process";
|
|
165391
165490
|
function setShell(shell) {
|
|
165392
165491
|
activeShell = shell;
|
|
165393
165492
|
}
|
|
@@ -165471,7 +165570,7 @@ ${packResult.stdout}
|
|
|
165471
165570
|
if (args.options.output) {
|
|
165472
165571
|
const outputPath = args.options.output;
|
|
165473
165572
|
const absoluteOutput = isAbsolute7(outputPath) ? outputPath : resolve18(process.cwd(), outputPath);
|
|
165474
|
-
const outputDir =
|
|
165573
|
+
const outputDir = dirname31(absoluteOutput);
|
|
165475
165574
|
if (!fs24.existsSync(outputDir)) {
|
|
165476
165575
|
fs24.mkdirSync(outputDir, { recursive: true });
|
|
165477
165576
|
}
|
|
@@ -165499,7 +165598,7 @@ var init_export = __esm(() => {
|
|
|
165499
165598
|
defaultShell = {
|
|
165500
165599
|
run(cmd, cwd) {
|
|
165501
165600
|
const parts = cmd.split(/\s+/);
|
|
165502
|
-
const result =
|
|
165601
|
+
const result = spawnSync4(parts[0], parts.slice(1), { cwd, encoding: "utf-8", windowsHide: process.platform === "win32" });
|
|
165503
165602
|
return {
|
|
165504
165603
|
code: result.status ?? 1,
|
|
165505
165604
|
stdout: (result.stdout ?? result.stderr ?? "").toString().trim()
|
|
@@ -165509,7 +165608,7 @@ var init_export = __esm(() => {
|
|
|
165509
165608
|
activeShell = defaultShell;
|
|
165510
165609
|
defaultExportFS = {
|
|
165511
165610
|
existsSync: existsSync75,
|
|
165512
|
-
readFileSync:
|
|
165611
|
+
readFileSync: readFileSync60,
|
|
165513
165612
|
writeFileSync: writeFileSync26,
|
|
165514
165613
|
copyFileSync: copyFileSync8,
|
|
165515
165614
|
realpathSync: realpathSync11,
|
|
@@ -165537,7 +165636,7 @@ __export(exports_project_context, {
|
|
|
165537
165636
|
createProject: () => createProject,
|
|
165538
165637
|
archiveProject: () => archiveProject
|
|
165539
165638
|
});
|
|
165540
|
-
import { existsSync as existsSync76, mkdirSync as mkdirSync28, readFileSync as
|
|
165639
|
+
import { existsSync as existsSync76, mkdirSync as mkdirSync28, readFileSync as readFileSync61, writeFileSync as writeFileSync27, rmSync as rmSync8 } from "fs";
|
|
165541
165640
|
import { join as join82 } from "path";
|
|
165542
165641
|
function getMatrixOsDir(cwd = process.cwd()) {
|
|
165543
165642
|
return join82(cwd, ".matrixos");
|
|
@@ -165556,7 +165655,7 @@ function loadState(cwd) {
|
|
|
165556
165655
|
if (!existsSync76(path29))
|
|
165557
165656
|
return {};
|
|
165558
165657
|
try {
|
|
165559
|
-
return JSON.parse(
|
|
165658
|
+
return JSON.parse(readFileSync61(path29, "utf-8"));
|
|
165560
165659
|
} catch {
|
|
165561
165660
|
return {};
|
|
165562
165661
|
}
|
|
@@ -165572,7 +165671,7 @@ function loadProjectMeta(slug, cwd) {
|
|
|
165572
165671
|
if (!existsSync76(path29))
|
|
165573
165672
|
return null;
|
|
165574
165673
|
try {
|
|
165575
|
-
return JSON.parse(
|
|
165674
|
+
return JSON.parse(readFileSync61(path29, "utf-8"));
|
|
165576
165675
|
} catch {
|
|
165577
165676
|
return null;
|
|
165578
165677
|
}
|
|
@@ -165698,7 +165797,7 @@ __export(exports_project_memory, {
|
|
|
165698
165797
|
isProjectEpisode: () => isProjectEpisode,
|
|
165699
165798
|
addKbDocument: () => addKbDocument
|
|
165700
165799
|
});
|
|
165701
|
-
import { existsSync as existsSync77, mkdirSync as mkdirSync29, readFileSync as
|
|
165800
|
+
import { existsSync as existsSync77, mkdirSync as mkdirSync29, readFileSync as readFileSync62, readdirSync as readdirSync17, writeFileSync as writeFileSync28 } from "fs";
|
|
165702
165801
|
import { join as join83 } from "path";
|
|
165703
165802
|
function tagWithProject(metadata = {}, projectSlug, cwd) {
|
|
165704
165803
|
const active = projectSlug ?? getActiveProject(cwd)?.slug;
|
|
@@ -165717,12 +165816,12 @@ function listKbDocuments(projectSlug, cwd) {
|
|
|
165717
165816
|
if (!existsSync77(kbDir))
|
|
165718
165817
|
return [];
|
|
165719
165818
|
const docs = [];
|
|
165720
|
-
for (const entry of
|
|
165819
|
+
for (const entry of readdirSync17(kbDir, { withFileTypes: true })) {
|
|
165721
165820
|
if (!entry.isFile())
|
|
165722
165821
|
continue;
|
|
165723
165822
|
const path29 = join83(kbDir, entry.name);
|
|
165724
165823
|
try {
|
|
165725
|
-
docs.push({ path: path29, content:
|
|
165824
|
+
docs.push({ path: path29, content: readFileSync62(path29, "utf-8") });
|
|
165726
165825
|
} catch {}
|
|
165727
165826
|
}
|
|
165728
165827
|
return docs;
|
|
@@ -166144,12 +166243,12 @@ __export(exports_gateway_start, {
|
|
|
166144
166243
|
buildTelegramConfig: () => buildTelegramConfig,
|
|
166145
166244
|
buildGatewayConfig: () => buildGatewayConfig
|
|
166146
166245
|
});
|
|
166147
|
-
import { readFileSync as
|
|
166246
|
+
import { readFileSync as readFileSync63, existsSync as existsSync78 } from "fs";
|
|
166148
166247
|
import { resolve as resolve19 } from "path";
|
|
166149
166248
|
function loadGatewayEnv(path29 = ENV_PATH) {
|
|
166150
166249
|
if (!existsSync78(path29))
|
|
166151
166250
|
return {};
|
|
166152
|
-
const text =
|
|
166251
|
+
const text = readFileSync63(path29, "utf8");
|
|
166153
166252
|
const out = {};
|
|
166154
166253
|
for (const raw of text.split(/\r?\n/)) {
|
|
166155
166254
|
const line = raw.trim();
|
|
@@ -166619,7 +166718,7 @@ var init_deployment = __esm(() => {
|
|
|
166619
166718
|
});
|
|
166620
166719
|
|
|
166621
166720
|
// packages/omo-opencode/src/audit/self-audit.ts
|
|
166622
|
-
import { existsSync as existsSync80, mkdirSync as mkdirSync30, readdirSync as
|
|
166721
|
+
import { existsSync as existsSync80, mkdirSync as mkdirSync30, readdirSync as readdirSync18, readFileSync as readFileSync64, writeFileSync as writeFileSync29 } from "fs";
|
|
166623
166722
|
import { join as join84 } from "path";
|
|
166624
166723
|
function getAuditDir(cwd = process.cwd()) {
|
|
166625
166724
|
return join84(cwd, ".matrixos", "audits");
|
|
@@ -168822,7 +168921,7 @@ var import_picocolors11 = __toESM(require_picocolors(), 1);
|
|
|
168822
168921
|
// packages/omo-opencode/src/cli/run/opencode-binary-resolver.ts
|
|
168823
168922
|
init_bun_which_shim();
|
|
168824
168923
|
init_spawn_with_windows_hide();
|
|
168825
|
-
import { delimiter as delimiter2, dirname as
|
|
168924
|
+
import { delimiter as delimiter2, dirname as dirname12, posix as posix3, win32 as win324 } from "path";
|
|
168826
168925
|
var OPENCODE_COMMANDS = ["opencode", "opencode-desktop"];
|
|
168827
168926
|
var WINDOWS_SUFFIXES = ["", ".exe", ".cmd", ".bat", ".ps1"];
|
|
168828
168927
|
function getCommandCandidates(platform) {
|
|
@@ -168880,7 +168979,7 @@ async function findWorkingOpencodeBinary(pathEnv = process.env.PATH, probe2 = ca
|
|
|
168880
168979
|
return null;
|
|
168881
168980
|
}
|
|
168882
168981
|
function buildPathWithBinaryFirst(pathEnv, binaryPath) {
|
|
168883
|
-
const preferredDir =
|
|
168982
|
+
const preferredDir = dirname12(binaryPath);
|
|
168884
168983
|
const existing = (pathEnv ?? "").split(delimiter2).filter((entry) => entry.length > 0 && entry !== preferredDir);
|
|
168885
168984
|
return [preferredDir, ...existing].join(delimiter2);
|
|
168886
168985
|
}
|
|
@@ -169273,7 +169372,7 @@ var BOULDER_STATE_PATH = `${BOULDER_DIR}/${BOULDER_FILE}`;
|
|
|
169273
169372
|
var NOTEPAD_DIR = "notepads";
|
|
169274
169373
|
var NOTEPAD_BASE_PATH = `${BOULDER_DIR}/${NOTEPAD_DIR}`;
|
|
169275
169374
|
// packages/boulder-state/src/top-level-task.ts
|
|
169276
|
-
import { existsSync as existsSync32, readFileSync as
|
|
169375
|
+
import { existsSync as existsSync32, readFileSync as readFileSync19 } from "fs";
|
|
169277
169376
|
var TODO_HEADING_PATTERN = /^##\s+TODOs\b/i;
|
|
169278
169377
|
var FINAL_VERIFICATION_HEADING_PATTERN = /^##\s+Final Verification Wave\b/i;
|
|
169279
169378
|
var SECOND_LEVEL_HEADING_PATTERN = /^##\s+/;
|
|
@@ -169300,7 +169399,7 @@ function readCurrentTopLevelTask(planPath) {
|
|
|
169300
169399
|
return null;
|
|
169301
169400
|
}
|
|
169302
169401
|
try {
|
|
169303
|
-
const content =
|
|
169402
|
+
const content = readFileSync19(planPath, "utf-8");
|
|
169304
169403
|
const lines = content.split(/\r?\n/);
|
|
169305
169404
|
let section = "other";
|
|
169306
169405
|
for (const line of lines) {
|
|
@@ -169352,7 +169451,7 @@ function resolveBoulderPlanPathForWork(directory, work) {
|
|
|
169352
169451
|
return resolveBoulderPlanPath(directory, work);
|
|
169353
169452
|
}
|
|
169354
169453
|
// packages/boulder-state/src/storage/plan-progress.ts
|
|
169355
|
-
import { existsSync as existsSync34, readFileSync as
|
|
169454
|
+
import { existsSync as existsSync34, readFileSync as readFileSync20, readdirSync as readdirSync5, statSync as statSync5 } from "fs";
|
|
169356
169455
|
var TODO_HEADING_PATTERN2 = /^##\s+TODOs\b/i;
|
|
169357
169456
|
var FINAL_VERIFICATION_HEADING_PATTERN2 = /^##\s+Final Verification Wave\b/i;
|
|
169358
169457
|
var SECOND_LEVEL_HEADING_PATTERN2 = /^##\s+/;
|
|
@@ -169365,7 +169464,7 @@ function getPlanProgress(planPath) {
|
|
|
169365
169464
|
return { total: 0, completed: 0, isComplete: false };
|
|
169366
169465
|
}
|
|
169367
169466
|
try {
|
|
169368
|
-
const content =
|
|
169467
|
+
const content = readFileSync20(planPath, "utf-8");
|
|
169369
169468
|
const lines = content.split(/\r?\n/);
|
|
169370
169469
|
const hasStructuredSections = lines.some((line) => TODO_HEADING_PATTERN2.test(line) || FINAL_VERIFICATION_HEADING_PATTERN2.test(line));
|
|
169371
169470
|
if (hasStructuredSections) {
|
|
@@ -169481,14 +169580,14 @@ function selectMirrorWork(state) {
|
|
|
169481
169580
|
return sorted[0] ?? null;
|
|
169482
169581
|
}
|
|
169483
169582
|
// packages/boulder-state/src/storage/read-state.ts
|
|
169484
|
-
import { existsSync as existsSync35, readFileSync as
|
|
169583
|
+
import { existsSync as existsSync35, readFileSync as readFileSync21 } from "fs";
|
|
169485
169584
|
function readBoulderState(directory) {
|
|
169486
169585
|
const filePath = getBoulderFilePath(directory);
|
|
169487
169586
|
if (!existsSync35(filePath)) {
|
|
169488
169587
|
return null;
|
|
169489
169588
|
}
|
|
169490
169589
|
try {
|
|
169491
|
-
const content =
|
|
169590
|
+
const content = readFileSync21(filePath, "utf-8");
|
|
169492
169591
|
const parsed = JSON.parse(content);
|
|
169493
169592
|
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
169494
169593
|
return null;
|
|
@@ -169554,7 +169653,7 @@ init_state();
|
|
|
169554
169653
|
// packages/omo-opencode/src/features/run-continuation-state/constants.ts
|
|
169555
169654
|
var CONTINUATION_MARKER_DIR = ".omo/run-continuation";
|
|
169556
169655
|
// packages/omo-opencode/src/features/run-continuation-state/storage.ts
|
|
169557
|
-
import { existsSync as existsSync36, mkdirSync as mkdirSync12, readFileSync as
|
|
169656
|
+
import { existsSync as existsSync36, mkdirSync as mkdirSync12, readFileSync as readFileSync22, rmSync as rmSync2, writeFileSync as writeFileSync9 } from "fs";
|
|
169558
169657
|
import { join as join31 } from "path";
|
|
169559
169658
|
function getMarkerPath(directory, sessionID) {
|
|
169560
169659
|
return join31(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
|
|
@@ -169564,7 +169663,7 @@ function readContinuationMarker(directory, sessionID) {
|
|
|
169564
169663
|
if (!existsSync36(markerPath))
|
|
169565
169664
|
return null;
|
|
169566
169665
|
try {
|
|
169567
|
-
const raw =
|
|
169666
|
+
const raw = readFileSync22(markerPath, "utf-8");
|
|
169568
169667
|
const parsed = JSON.parse(raw);
|
|
169569
169668
|
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
|
|
169570
169669
|
return null;
|
|
@@ -169629,7 +169728,7 @@ async function isSessionInBoulderLineage(input) {
|
|
|
169629
169728
|
// packages/omo-opencode/src/hooks/the-operator/session-last-agent.ts
|
|
169630
169729
|
init_shared();
|
|
169631
169730
|
init_compaction_marker();
|
|
169632
|
-
import { readFileSync as
|
|
169731
|
+
import { readFileSync as readFileSync23, readdirSync as readdirSync6 } from "fs";
|
|
169633
169732
|
import { join as join32 } from "path";
|
|
169634
169733
|
var defaultSessionLastAgentDeps = {
|
|
169635
169734
|
getMessageDir,
|
|
@@ -169688,9 +169787,9 @@ async function getLastAgentFromSession(sessionID, client3, deps = {}) {
|
|
|
169688
169787
|
if (!messageDir)
|
|
169689
169788
|
return null;
|
|
169690
169789
|
try {
|
|
169691
|
-
const messages =
|
|
169790
|
+
const messages = readdirSync6(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
|
|
169692
169791
|
try {
|
|
169693
|
-
const content =
|
|
169792
|
+
const content = readFileSync23(join32(messageDir, fileName), "utf-8");
|
|
169694
169793
|
const parsed = JSON.parse(content);
|
|
169695
169794
|
return {
|
|
169696
169795
|
fileName,
|
|
@@ -169733,8 +169832,8 @@ init_agent_display_names();
|
|
|
169733
169832
|
|
|
169734
169833
|
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
|
|
169735
169834
|
init_frontmatter2();
|
|
169736
|
-
import { existsSync as existsSync37, readFileSync as
|
|
169737
|
-
import { dirname as
|
|
169835
|
+
import { existsSync as existsSync37, readFileSync as readFileSync24, writeFileSync as writeFileSync10, unlinkSync as unlinkSync6, mkdirSync as mkdirSync13 } from "fs";
|
|
169836
|
+
import { dirname as dirname13, join as join33 } from "path";
|
|
169738
169837
|
|
|
169739
169838
|
// packages/omo-opencode/src/hooks/ralph-loop/constants.ts
|
|
169740
169839
|
var DEFAULT_STATE_FILE = ".omo/ralph-loop.local.md";
|
|
@@ -169751,7 +169850,7 @@ function readState(directory, customPath) {
|
|
|
169751
169850
|
return null;
|
|
169752
169851
|
}
|
|
169753
169852
|
try {
|
|
169754
|
-
const content =
|
|
169853
|
+
const content = readFileSync24(filePath, "utf-8");
|
|
169755
169854
|
const { data, body } = parseFrontmatter(content);
|
|
169756
169855
|
const active = data.active;
|
|
169757
169856
|
const iteration = data.iteration;
|
|
@@ -170326,7 +170425,7 @@ function createTimestampedStdoutController(stdout2 = process.stdout) {
|
|
|
170326
170425
|
// packages/telemetry-core/src/activity-state.ts
|
|
170327
170426
|
init_atomic_write();
|
|
170328
170427
|
init_xdg_data_dir();
|
|
170329
|
-
import { existsSync as existsSync38, mkdirSync as mkdirSync14, readFileSync as
|
|
170428
|
+
import { existsSync as existsSync38, mkdirSync as mkdirSync14, readFileSync as readFileSync25 } from "fs";
|
|
170330
170429
|
import { basename as basename6, join as join34 } from "path";
|
|
170331
170430
|
var POSTHOG_ACTIVITY_STATE_FILE = "posthog-activity.json";
|
|
170332
170431
|
function resolveTelemetryStateDir(product, options = {}) {
|
|
@@ -170370,7 +170469,7 @@ function readPostHogActivityState(stateDir, diagnostics) {
|
|
|
170370
170469
|
return {};
|
|
170371
170470
|
}
|
|
170372
170471
|
try {
|
|
170373
|
-
const stateContent =
|
|
170472
|
+
const stateContent = readFileSync25(stateFilePath, "utf-8");
|
|
170374
170473
|
const stateJson = JSON.parse(stateContent);
|
|
170375
170474
|
if (!isPostHogActivityState(stateJson)) {
|
|
170376
170475
|
return {};
|
|
@@ -170454,7 +170553,7 @@ function getTelemetryDistinctId(machineIdPrefix, osProvider = getDefaultTelemetr
|
|
|
170454
170553
|
}
|
|
170455
170554
|
|
|
170456
170555
|
// node_modules/.bun/posthog-node@5.45.2/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
170457
|
-
import { dirname as
|
|
170556
|
+
import { dirname as dirname14, posix as posix4, sep } from "path";
|
|
170458
170557
|
function createModulerModifier() {
|
|
170459
170558
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
170460
170559
|
return async (frames) => {
|
|
@@ -170463,7 +170562,7 @@ function createModulerModifier() {
|
|
|
170463
170562
|
return frames;
|
|
170464
170563
|
};
|
|
170465
170564
|
}
|
|
170466
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
170565
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname14(process.argv[1]) : process.cwd(), isWindows = sep === "\\") {
|
|
170467
170566
|
const normalizedBase = isWindows ? normalizeWindowsPath(basePath) : basePath;
|
|
170468
170567
|
return (filename) => {
|
|
170469
170568
|
if (!filename)
|
|
@@ -177493,7 +177592,7 @@ init_constants5();
|
|
|
177493
177592
|
|
|
177494
177593
|
// packages/omo-opencode/src/cli/doctor/checks/system.ts
|
|
177495
177594
|
init_constants5();
|
|
177496
|
-
import { existsSync as existsSync49, readFileSync as
|
|
177595
|
+
import { existsSync as existsSync49, readFileSync as readFileSync35 } from "fs";
|
|
177497
177596
|
|
|
177498
177597
|
// packages/omo-opencode/src/cli/doctor/checks/system-binary.ts
|
|
177499
177598
|
init_extract_semver();
|
|
@@ -177690,7 +177789,7 @@ function compareVersions3(current, minimum) {
|
|
|
177690
177789
|
|
|
177691
177790
|
// packages/omo-opencode/src/cli/doctor/checks/system-plugin.ts
|
|
177692
177791
|
init_shared();
|
|
177693
|
-
import { existsSync as existsSync47, readFileSync as
|
|
177792
|
+
import { existsSync as existsSync47, readFileSync as readFileSync33 } from "fs";
|
|
177694
177793
|
function detectConfigPath() {
|
|
177695
177794
|
const paths2 = getOpenCodeConfigPaths({ binary: "opencode", version: null });
|
|
177696
177795
|
if (existsSync47(paths2.configJsonc))
|
|
@@ -177741,7 +177840,7 @@ function getPluginInfo() {
|
|
|
177741
177840
|
};
|
|
177742
177841
|
}
|
|
177743
177842
|
try {
|
|
177744
|
-
const content =
|
|
177843
|
+
const content = readFileSync33(configPath, "utf-8");
|
|
177745
177844
|
const parsedConfig = parseJsonc(content);
|
|
177746
177845
|
const pluginEntry = findPluginEntry2(parsedConfig.plugin ?? []);
|
|
177747
177846
|
if (!pluginEntry) {
|
|
@@ -177785,7 +177884,7 @@ init_auto_update_checker();
|
|
|
177785
177884
|
init_package_json_locator();
|
|
177786
177885
|
init_constants5();
|
|
177787
177886
|
init_shared();
|
|
177788
|
-
import { existsSync as existsSync48, readFileSync as
|
|
177887
|
+
import { existsSync as existsSync48, readFileSync as readFileSync34, readdirSync as readdirSync8 } from "fs";
|
|
177789
177888
|
import { createRequire as createRequire2 } from "module";
|
|
177790
177889
|
import { homedir as homedir13 } from "os";
|
|
177791
177890
|
import { join as join42 } from "path";
|
|
@@ -177816,7 +177915,7 @@ function readPackageJson(filePath) {
|
|
|
177816
177915
|
if (!existsSync48(filePath))
|
|
177817
177916
|
return null;
|
|
177818
177917
|
try {
|
|
177819
|
-
const content =
|
|
177918
|
+
const content = readFileSync34(filePath, "utf-8");
|
|
177820
177919
|
return parseJsonc(content);
|
|
177821
177920
|
} catch (error51) {
|
|
177822
177921
|
if (!(error51 instanceof Error)) {
|
|
@@ -177842,7 +177941,7 @@ function createTaggedInstallCandidates(rootDir) {
|
|
|
177842
177941
|
if (!existsSync48(packagesDir))
|
|
177843
177942
|
return [];
|
|
177844
177943
|
const candidates = [];
|
|
177845
|
-
for (const entryName of
|
|
177944
|
+
for (const entryName of readdirSync8(packagesDir).sort()) {
|
|
177846
177945
|
const packageName = ACCEPTED_PACKAGE_NAMES.find((name2) => entryName.startsWith(`${name2}@`));
|
|
177847
177946
|
if (packageName === undefined)
|
|
177848
177947
|
continue;
|
|
@@ -177950,7 +178049,7 @@ var defaultDeps6 = {
|
|
|
177950
178049
|
getLatestPluginVersion,
|
|
177951
178050
|
getSuggestedInstallTag,
|
|
177952
178051
|
configExists: existsSync49,
|
|
177953
|
-
readConfigFile: (path14) =>
|
|
178052
|
+
readConfigFile: (path14) => readFileSync35(path14, "utf-8"),
|
|
177954
178053
|
parseConfigContent: (content) => parseJsonc(content)
|
|
177955
178054
|
};
|
|
177956
178055
|
var BUN_POSTINSTALL_HELPER_PACKAGE_NAME = "@code-yeongyu/comment-checker";
|
|
@@ -178095,9 +178194,9 @@ async function checkSystem(deps = defaultDeps6) {
|
|
|
178095
178194
|
|
|
178096
178195
|
// packages/omo-opencode/src/config/validate.ts
|
|
178097
178196
|
init_src();
|
|
178098
|
-
import { readFileSync as
|
|
178197
|
+
import { readFileSync as readFileSync36 } from "fs";
|
|
178099
178198
|
import { homedir as homedir14 } from "os";
|
|
178100
|
-
import { dirname as
|
|
178199
|
+
import { dirname as dirname19, relative as relative5 } from "path";
|
|
178101
178200
|
init_shared();
|
|
178102
178201
|
init_plugin_identity();
|
|
178103
178202
|
function resolveHomeDirectory2() {
|
|
@@ -178121,7 +178220,7 @@ function discoverProjectLayersNearestFirst(directory) {
|
|
|
178121
178220
|
const stopDirectory = containsPath(homeDirectory, directory) ? homeDirectory : directory;
|
|
178122
178221
|
return findProjectOpencodePluginConfigFiles(directory, stopDirectory).map((configPath) => ({
|
|
178123
178222
|
path: configPath,
|
|
178124
|
-
configDir:
|
|
178223
|
+
configDir: dirname19(configPath)
|
|
178125
178224
|
}));
|
|
178126
178225
|
}
|
|
178127
178226
|
function shortPath(configPath) {
|
|
@@ -178140,12 +178239,12 @@ function schemaMessages(configPath, rawConfig) {
|
|
|
178140
178239
|
}
|
|
178141
178240
|
function parseLayerConfig(configPath) {
|
|
178142
178241
|
try {
|
|
178143
|
-
const content =
|
|
178242
|
+
const content = readFileSync36(configPath, "utf-8");
|
|
178144
178243
|
const rawConfig = parseJsonc(content);
|
|
178145
178244
|
if (!isPlainRecord(rawConfig)) {
|
|
178146
178245
|
return {
|
|
178147
178246
|
path: configPath,
|
|
178148
|
-
configDir:
|
|
178247
|
+
configDir: dirname19(configPath),
|
|
178149
178248
|
config: null,
|
|
178150
178249
|
messages: [`${shortPath(configPath)}: <root>: Expected object`]
|
|
178151
178250
|
};
|
|
@@ -178153,7 +178252,7 @@ function parseLayerConfig(configPath) {
|
|
|
178153
178252
|
const result = OhMyOpenCodeConfigSchema.safeParse(rawConfig);
|
|
178154
178253
|
return {
|
|
178155
178254
|
path: configPath,
|
|
178156
|
-
configDir:
|
|
178255
|
+
configDir: dirname19(configPath),
|
|
178157
178256
|
config: result.success ? result.data : parseConfigPartially(rawConfig),
|
|
178158
178257
|
messages: schemaMessages(configPath, rawConfig)
|
|
178159
178258
|
};
|
|
@@ -178163,7 +178262,7 @@ function parseLayerConfig(configPath) {
|
|
|
178163
178262
|
}
|
|
178164
178263
|
return {
|
|
178165
178264
|
path: configPath,
|
|
178166
|
-
configDir:
|
|
178265
|
+
configDir: dirname19(configPath),
|
|
178167
178266
|
config: null,
|
|
178168
178267
|
messages: [`${shortPath(configPath)}: ${error51.message}`]
|
|
178169
178268
|
};
|
|
@@ -178212,7 +178311,7 @@ init_constants5();
|
|
|
178212
178311
|
|
|
178213
178312
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-cache.ts
|
|
178214
178313
|
init_shared();
|
|
178215
|
-
import { existsSync as existsSync50, readFileSync as
|
|
178314
|
+
import { existsSync as existsSync50, readFileSync as readFileSync37 } from "fs";
|
|
178216
178315
|
import { homedir as homedir15 } from "os";
|
|
178217
178316
|
import { join as join43 } from "path";
|
|
178218
178317
|
function getUserConfigDir2() {
|
|
@@ -178231,7 +178330,7 @@ function loadCustomProviderNames() {
|
|
|
178231
178330
|
if (!existsSync50(configPath))
|
|
178232
178331
|
continue;
|
|
178233
178332
|
try {
|
|
178234
|
-
const content =
|
|
178333
|
+
const content = readFileSync37(configPath, "utf-8");
|
|
178235
178334
|
const data = parseJsonc(content);
|
|
178236
178335
|
if (data?.provider && typeof data.provider === "object") {
|
|
178237
178336
|
return Object.keys(data.provider);
|
|
@@ -178255,7 +178354,7 @@ function loadAvailableModelsFromCache() {
|
|
|
178255
178354
|
return { providers: [], modelCount: 0, cacheExists: false };
|
|
178256
178355
|
}
|
|
178257
178356
|
try {
|
|
178258
|
-
const content =
|
|
178357
|
+
const content = readFileSync37(cacheFile, "utf-8");
|
|
178259
178358
|
const data = parseJsonc(content);
|
|
178260
178359
|
const cacheProviders = Object.keys(data);
|
|
178261
178360
|
let modelCount = 0;
|
|
@@ -178283,7 +178382,7 @@ init_constants5();
|
|
|
178283
178382
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-config.ts
|
|
178284
178383
|
init_shared();
|
|
178285
178384
|
init_plugin_identity();
|
|
178286
|
-
import { readFileSync as
|
|
178385
|
+
import { readFileSync as readFileSync38 } from "fs";
|
|
178287
178386
|
import { join as join44 } from "path";
|
|
178288
178387
|
var PROJECT_CONFIG_DIR = join44(process.cwd(), ".opencode");
|
|
178289
178388
|
function loadOmoConfig() {
|
|
@@ -178293,7 +178392,7 @@ function loadOmoConfig() {
|
|
|
178293
178392
|
});
|
|
178294
178393
|
if (projectDetected.format !== "none") {
|
|
178295
178394
|
try {
|
|
178296
|
-
const content =
|
|
178395
|
+
const content = readFileSync38(projectDetected.path, "utf-8");
|
|
178297
178396
|
return parseJsonc(content);
|
|
178298
178397
|
} catch (error51) {
|
|
178299
178398
|
if (error51 instanceof Error) {
|
|
@@ -178309,7 +178408,7 @@ function loadOmoConfig() {
|
|
|
178309
178408
|
});
|
|
178310
178409
|
if (userDetected.format !== "none") {
|
|
178311
178410
|
try {
|
|
178312
|
-
const content =
|
|
178411
|
+
const content = readFileSync38(userDetected.path, "utf-8");
|
|
178313
178412
|
return parseJsonc(content);
|
|
178314
178413
|
} catch (error51) {
|
|
178315
178414
|
if (error51 instanceof Error) {
|
|
@@ -178644,7 +178743,7 @@ init_src();
|
|
|
178644
178743
|
import { existsSync as existsSync51 } from "fs";
|
|
178645
178744
|
import { createRequire as createRequire3 } from "module";
|
|
178646
178745
|
import { homedir as homedir17 } from "os";
|
|
178647
|
-
import { dirname as
|
|
178746
|
+
import { dirname as dirname20, join as join47 } from "path";
|
|
178648
178747
|
|
|
178649
178748
|
// packages/omo-opencode/src/hooks/comment-checker/downloader.ts
|
|
178650
178749
|
import { join as join46 } from "path";
|
|
@@ -178741,7 +178840,7 @@ function findCommentCheckerPackageBinary(baseDirOverride, resolvePackageJsonPath
|
|
|
178741
178840
|
const binaryName = process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
|
|
178742
178841
|
const platformKey = `${process.platform}-${process.arch === "x64" ? "x64" : process.arch}`;
|
|
178743
178842
|
try {
|
|
178744
|
-
const packageDir = baseDirOverride ??
|
|
178843
|
+
const packageDir = baseDirOverride ?? dirname20(resolvePackageJsonPath());
|
|
178745
178844
|
const vendorPath = join47(packageDir, "vendor", platformKey, binaryName);
|
|
178746
178845
|
if (existsSync51(vendorPath))
|
|
178747
178846
|
return vendorPath;
|
|
@@ -178890,14 +178989,14 @@ async function getGhCliInfo(dependencies = {}) {
|
|
|
178890
178989
|
}
|
|
178891
178990
|
|
|
178892
178991
|
// packages/omo-opencode/src/cli/doctor/checks/tools-lsp.ts
|
|
178893
|
-
import { readFileSync as
|
|
178992
|
+
import { readFileSync as readFileSync40 } from "fs";
|
|
178894
178993
|
import { join as join48 } from "path";
|
|
178895
178994
|
|
|
178896
178995
|
// packages/omo-opencode/src/mcp/lsp.ts
|
|
178897
178996
|
init_zod();
|
|
178898
178997
|
init_opencode_config_dir();
|
|
178899
|
-
import { existsSync as existsSync52, readFileSync as
|
|
178900
|
-
import { delimiter as delimiter3, dirname as
|
|
178998
|
+
import { existsSync as existsSync52, readFileSync as readFileSync39 } from "fs";
|
|
178999
|
+
import { delimiter as delimiter3, dirname as dirname21, resolve as resolve10 } from "path";
|
|
178901
179000
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
178902
179001
|
|
|
178903
179002
|
// packages/omo-opencode/src/mcp/cli-suffix.ts
|
|
@@ -179028,7 +179127,7 @@ var LSP_BOOTSTRAP_SCRIPT = [
|
|
|
179028
179127
|
].join(";");
|
|
179029
179128
|
function getModuleDirectory(moduleUrl) {
|
|
179030
179129
|
try {
|
|
179031
|
-
return
|
|
179130
|
+
return dirname21(fileURLToPath6(moduleUrl));
|
|
179032
179131
|
} catch (error51) {
|
|
179033
179132
|
if (!(error51 instanceof Error))
|
|
179034
179133
|
throw error51;
|
|
@@ -179040,7 +179139,7 @@ function findBootstrapRoot(candidates, pathExists) {
|
|
|
179040
179139
|
}
|
|
179041
179140
|
function readDaemonPackageVersion(root) {
|
|
179042
179141
|
try {
|
|
179043
|
-
const packageJson = JSON.parse(
|
|
179142
|
+
const packageJson = JSON.parse(readFileSync39(resolve10(root, PACKAGE_REL, "package.json"), "utf-8"));
|
|
179044
179143
|
return DaemonPackageSchema.parse(packageJson).version;
|
|
179045
179144
|
} catch (error51) {
|
|
179046
179145
|
if (!(error51 instanceof Error))
|
|
@@ -179117,7 +179216,7 @@ function readOmoConfig(configDirectory) {
|
|
|
179117
179216
|
return null;
|
|
179118
179217
|
}
|
|
179119
179218
|
try {
|
|
179120
|
-
const content =
|
|
179219
|
+
const content = readFileSync40(detected.path, "utf-8");
|
|
179121
179220
|
return parseJsonc(content);
|
|
179122
179221
|
} catch (error51) {
|
|
179123
179222
|
if (!(error51 instanceof Error)) {
|
|
@@ -179147,7 +179246,7 @@ function getInstalledLspServers(options = {}) {
|
|
|
179147
179246
|
|
|
179148
179247
|
// packages/omo-opencode/src/cli/doctor/checks/tools-mcp.ts
|
|
179149
179248
|
init_shared();
|
|
179150
|
-
import { existsSync as existsSync53, readFileSync as
|
|
179249
|
+
import { existsSync as existsSync53, readFileSync as readFileSync41 } from "fs";
|
|
179151
179250
|
import { homedir as homedir18 } from "os";
|
|
179152
179251
|
import { join as join49 } from "path";
|
|
179153
179252
|
var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
|
|
@@ -179164,7 +179263,7 @@ function loadUserMcpConfig() {
|
|
|
179164
179263
|
if (!existsSync53(configPath))
|
|
179165
179264
|
continue;
|
|
179166
179265
|
try {
|
|
179167
|
-
const content =
|
|
179266
|
+
const content = readFileSync41(configPath, "utf-8");
|
|
179168
179267
|
const config5 = parseJsonc(content);
|
|
179169
179268
|
if (config5.mcpServers) {
|
|
179170
179269
|
Object.assign(servers, config5.mcpServers);
|
|
@@ -179299,7 +179398,7 @@ async function checkTools() {
|
|
|
179299
179398
|
}
|
|
179300
179399
|
|
|
179301
179400
|
// packages/omo-opencode/src/cli/doctor/checks/telemetry.ts
|
|
179302
|
-
import { existsSync as existsSync54, readFileSync as
|
|
179401
|
+
import { existsSync as existsSync54, readFileSync as readFileSync42 } from "fs";
|
|
179303
179402
|
init_constants5();
|
|
179304
179403
|
function isTelemetryState(value) {
|
|
179305
179404
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
@@ -179310,7 +179409,7 @@ function readLastActiveDay(stateFilePath) {
|
|
|
179310
179409
|
}
|
|
179311
179410
|
let parsed;
|
|
179312
179411
|
try {
|
|
179313
|
-
parsed = JSON.parse(
|
|
179412
|
+
parsed = JSON.parse(readFileSync42(stateFilePath, "utf-8"));
|
|
179314
179413
|
} catch (error51) {
|
|
179315
179414
|
if (error51 instanceof Error) {
|
|
179316
179415
|
return "unreadable";
|
|
@@ -179386,7 +179485,7 @@ function expandHomeDirectory(directoryPath) {
|
|
|
179386
179485
|
init_constants5();
|
|
179387
179486
|
init_shared();
|
|
179388
179487
|
init_plugin_identity();
|
|
179389
|
-
import { readFileSync as
|
|
179488
|
+
import { readFileSync as readFileSync43, promises as fs15 } from "fs";
|
|
179390
179489
|
import path15 from "path";
|
|
179391
179490
|
async function checkTeamMode() {
|
|
179392
179491
|
const config5 = loadTeamModeConfig();
|
|
@@ -179423,7 +179522,7 @@ function loadTeamModeConfig() {
|
|
|
179423
179522
|
if (!configPath)
|
|
179424
179523
|
return { team_mode: undefined };
|
|
179425
179524
|
try {
|
|
179426
|
-
return parseJsonc(
|
|
179525
|
+
return parseJsonc(readFileSync43(configPath, "utf-8"));
|
|
179427
179526
|
} catch (error51) {
|
|
179428
179527
|
if (error51 instanceof Error) {
|
|
179429
179528
|
return { team_mode: undefined };
|
|
@@ -179863,13 +179962,13 @@ import {
|
|
|
179863
179962
|
chmodSync as chmodSync6,
|
|
179864
179963
|
existsSync as existsSync57,
|
|
179865
179964
|
mkdirSync as mkdirSync16,
|
|
179866
|
-
readdirSync as
|
|
179867
|
-
readFileSync as
|
|
179965
|
+
readdirSync as readdirSync9,
|
|
179966
|
+
readFileSync as readFileSync45,
|
|
179868
179967
|
renameSync as renameSync7,
|
|
179869
|
-
unlinkSync as
|
|
179968
|
+
unlinkSync as unlinkSync9,
|
|
179870
179969
|
writeFileSync as writeFileSync14
|
|
179871
179970
|
} from "fs";
|
|
179872
|
-
import { basename as basename8, dirname as
|
|
179971
|
+
import { basename as basename8, dirname as dirname22, join as join52 } from "path";
|
|
179873
179972
|
|
|
179874
179973
|
// packages/mcp-client-core/src/config-dir.ts
|
|
179875
179974
|
import { existsSync as existsSync55, realpathSync as realpathSync7 } from "fs";
|
|
@@ -179897,7 +179996,7 @@ function getOpenCodeCliConfigDir(env2 = process.env) {
|
|
|
179897
179996
|
}
|
|
179898
179997
|
|
|
179899
179998
|
// packages/mcp-client-core/src/mcp-oauth/storage-index.ts
|
|
179900
|
-
import { chmodSync as chmodSync5, existsSync as existsSync56, readFileSync as
|
|
179999
|
+
import { chmodSync as chmodSync5, existsSync as existsSync56, readFileSync as readFileSync44, renameSync as renameSync6, writeFileSync as writeFileSync13 } from "fs";
|
|
179901
180000
|
import { join as join51 } from "path";
|
|
179902
180001
|
var INDEX_FILE_NAME = "index.json";
|
|
179903
180002
|
function isTokenIndex(value) {
|
|
@@ -179913,7 +180012,7 @@ function readTokenIndex(storageDir) {
|
|
|
179913
180012
|
if (!existsSync56(indexPath))
|
|
179914
180013
|
return {};
|
|
179915
180014
|
try {
|
|
179916
|
-
const parsed = JSON.parse(
|
|
180015
|
+
const parsed = JSON.parse(readFileSync44(indexPath, "utf-8"));
|
|
179917
180016
|
return isTokenIndex(parsed) ? parsed : {};
|
|
179918
180017
|
} catch (readError) {
|
|
179919
180018
|
if (!(readError instanceof Error))
|
|
@@ -180023,7 +180122,7 @@ function readTokenFile(filePath) {
|
|
|
180023
180122
|
if (!existsSync57(filePath))
|
|
180024
180123
|
return null;
|
|
180025
180124
|
try {
|
|
180026
|
-
const parsed = JSON.parse(
|
|
180125
|
+
const parsed = JSON.parse(readFileSync45(filePath, "utf-8"));
|
|
180027
180126
|
return isOAuthTokenData(parsed) ? parsed : null;
|
|
180028
180127
|
} catch (readError) {
|
|
180029
180128
|
if (!(readError instanceof Error))
|
|
@@ -180036,7 +180135,7 @@ function readLegacyStore() {
|
|
|
180036
180135
|
if (!existsSync57(filePath))
|
|
180037
180136
|
return null;
|
|
180038
180137
|
try {
|
|
180039
|
-
const parsed = JSON.parse(
|
|
180138
|
+
const parsed = JSON.parse(readFileSync45(filePath, "utf-8"));
|
|
180040
180139
|
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed))
|
|
180041
180140
|
return null;
|
|
180042
180141
|
const result = {};
|
|
@@ -180053,7 +180152,7 @@ function readLegacyStore() {
|
|
|
180053
180152
|
}
|
|
180054
180153
|
function writeTokenFile(filePath, token) {
|
|
180055
180154
|
try {
|
|
180056
|
-
const dir =
|
|
180155
|
+
const dir = dirname22(filePath);
|
|
180057
180156
|
if (!existsSync57(dir)) {
|
|
180058
180157
|
mkdirSync16(dir, { recursive: true });
|
|
180059
180158
|
}
|
|
@@ -180081,7 +180180,7 @@ function deleteToken(serverHost, resource) {
|
|
|
180081
180180
|
if (!existsSync57(filePath))
|
|
180082
180181
|
return deleteLegacyToken(serverHost, resource);
|
|
180083
180182
|
try {
|
|
180084
|
-
|
|
180183
|
+
unlinkSync9(filePath);
|
|
180085
180184
|
return deleteTokenIndexEntry(getMcpOauthStorageDir(), getMcpOauthServerHash(serverHost, resource));
|
|
180086
180185
|
} catch (deleteError) {
|
|
180087
180186
|
if (!(deleteError instanceof Error))
|
|
@@ -180101,7 +180200,7 @@ function deleteLegacyToken(serverHost, resource) {
|
|
|
180101
180200
|
try {
|
|
180102
180201
|
const filePath = getLegacyStoragePath();
|
|
180103
180202
|
if (existsSync57(filePath))
|
|
180104
|
-
|
|
180203
|
+
unlinkSync9(filePath);
|
|
180105
180204
|
return true;
|
|
180106
180205
|
} catch (deleteError) {
|
|
180107
180206
|
if (!(deleteError instanceof Error))
|
|
@@ -180150,7 +180249,7 @@ function listAllTokens() {
|
|
|
180150
180249
|
if (!existsSync57(dir))
|
|
180151
180250
|
return result;
|
|
180152
180251
|
const index = readTokenIndex(dir);
|
|
180153
|
-
for (const entry of
|
|
180252
|
+
for (const entry of readdirSync9(dir, { withFileTypes: true })) {
|
|
180154
180253
|
if (!entry.isFile() || !entry.name.endsWith(".json") || entry.name === "index.json")
|
|
180155
180254
|
continue;
|
|
180156
180255
|
const token = readTokenFile(join52(dir, entry.name));
|
|
@@ -180849,7 +180948,7 @@ function createEmbeddingPort() {
|
|
|
180849
180948
|
// packages/learning-loop/src/codebase-scanner.ts
|
|
180850
180949
|
var import_picomatch = __toESM(require_picomatch2(), 1);
|
|
180851
180950
|
import { createHash as createHash5 } from "crypto";
|
|
180852
|
-
import { readdirSync as
|
|
180951
|
+
import { readdirSync as readdirSync10, readFileSync as readFileSync47, statSync as statSync7, existsSync as existsSync59 } from "fs";
|
|
180853
180952
|
import { join as join53, relative as relative6, extname as extname3 } from "path";
|
|
180854
180953
|
var EXT_TO_LANG = {
|
|
180855
180954
|
ts: "typescript",
|
|
@@ -180914,10 +181013,10 @@ function loadGitignore(rootDir, fs18) {
|
|
|
180914
181013
|
function defaultFs() {
|
|
180915
181014
|
return {
|
|
180916
181015
|
readdir(path18) {
|
|
180917
|
-
return
|
|
181016
|
+
return readdirSync10(path18);
|
|
180918
181017
|
},
|
|
180919
181018
|
readFile(path18) {
|
|
180920
|
-
return
|
|
181019
|
+
return readFileSync47(path18, "utf-8");
|
|
180921
181020
|
},
|
|
180922
181021
|
stat(path18) {
|
|
180923
181022
|
const s = statSync7(path18);
|
|
@@ -181270,7 +181369,7 @@ function formatSearchResults(result) {
|
|
|
181270
181369
|
}
|
|
181271
181370
|
|
|
181272
181371
|
// packages/learning-loop/src/improvement.ts
|
|
181273
|
-
import { existsSync as existsSync60, mkdirSync as mkdirSync18, readFileSync as
|
|
181372
|
+
import { existsSync as existsSync60, mkdirSync as mkdirSync18, readFileSync as readFileSync48, writeFileSync as writeFileSync16 } from "fs";
|
|
181274
181373
|
import { join as join54, basename as basename10 } from "path";
|
|
181275
181374
|
function createImprovementStore(improvementsDir) {
|
|
181276
181375
|
if (!existsSync60(improvementsDir)) {
|
|
@@ -181297,7 +181396,7 @@ function createImprovementStore(improvementsDir) {
|
|
|
181297
181396
|
function get(id) {
|
|
181298
181397
|
const filePath = join54(improvementsDir, `${id}.json`);
|
|
181299
181398
|
try {
|
|
181300
|
-
const raw =
|
|
181399
|
+
const raw = readFileSync48(filePath, "utf-8");
|
|
181301
181400
|
return JSON.parse(raw);
|
|
181302
181401
|
} catch {
|
|
181303
181402
|
return null;
|
|
@@ -181319,8 +181418,8 @@ function createImprovementStore(improvementsDir) {
|
|
|
181319
181418
|
}
|
|
181320
181419
|
function readdirSyncSafe(dir) {
|
|
181321
181420
|
try {
|
|
181322
|
-
const { readdirSync:
|
|
181323
|
-
return
|
|
181421
|
+
const { readdirSync: readdirSync11 } = __require("fs");
|
|
181422
|
+
return readdirSync11(dir);
|
|
181324
181423
|
} catch {
|
|
181325
181424
|
return;
|
|
181326
181425
|
}
|
|
@@ -182116,7 +182215,7 @@ function getClaudeConfigDir() {
|
|
|
182116
182215
|
return join57(getHomeDirectory(), ".claude");
|
|
182117
182216
|
}
|
|
182118
182217
|
// packages/skills-loader-core/src/shared/opencode-command-dirs.ts
|
|
182119
|
-
import { basename as basename11, dirname as
|
|
182218
|
+
import { basename as basename11, dirname as dirname23, join as join59 } from "path";
|
|
182120
182219
|
|
|
182121
182220
|
// packages/skills-loader-core/src/shared/opencode-config-dir.ts
|
|
182122
182221
|
import { existsSync as existsSync64, realpathSync as realpathSync8 } from "fs";
|
|
@@ -182250,11 +182349,11 @@ function getOpenCodeConfigDir2(options) {
|
|
|
182250
182349
|
|
|
182251
182350
|
// packages/skills-loader-core/src/shared/opencode-command-dirs.ts
|
|
182252
182351
|
function getParentOpencodeConfigDir(configDir) {
|
|
182253
|
-
const parentDir =
|
|
182352
|
+
const parentDir = dirname23(configDir);
|
|
182254
182353
|
if (basename11(parentDir) !== "profiles") {
|
|
182255
182354
|
return null;
|
|
182256
182355
|
}
|
|
182257
|
-
return
|
|
182356
|
+
return dirname23(parentDir);
|
|
182258
182357
|
}
|
|
182259
182358
|
function getOpenCodeSkillDirs(options) {
|
|
182260
182359
|
const configDirs = getOpenCodeConfigDirs2(options);
|
|
@@ -182272,7 +182371,7 @@ function getOpenCodeSkillDirs(options) {
|
|
|
182272
182371
|
// packages/skills-loader-core/src/shared/project-discovery-dirs.ts
|
|
182273
182372
|
import { execFileSync as execFileSync2 } from "child_process";
|
|
182274
182373
|
import { existsSync as existsSync65, realpathSync as realpathSync9 } from "fs";
|
|
182275
|
-
import { dirname as
|
|
182374
|
+
import { dirname as dirname24, join as join60, resolve as resolve13, win32 as win326 } from "path";
|
|
182276
182375
|
var worktreePathCache2 = new Map;
|
|
182277
182376
|
function normalizePath2(path18) {
|
|
182278
182377
|
const resolvedPath = process.platform !== "win32" && win326.isAbsolute(path18) ? path18 : resolve13(path18);
|
|
@@ -182322,7 +182421,7 @@ function findAncestorDirectories(startDirectory, targetPaths, stopDirectory) {
|
|
|
182322
182421
|
if (stopDirectoryKey === pathKey2(currentDirectory)) {
|
|
182323
182422
|
return directories;
|
|
182324
182423
|
}
|
|
182325
|
-
const parentDirectory =
|
|
182424
|
+
const parentDirectory = dirname24(currentDirectory);
|
|
182326
182425
|
if (parentDirectory === currentDirectory) {
|
|
182327
182426
|
return directories;
|
|
182328
182427
|
}
|
|
@@ -183424,9 +183523,9 @@ playwright-cli close
|
|
|
183424
183523
|
// packages/skills-loader-core/src/features/builtin-skills/skill-file-loader.ts
|
|
183425
183524
|
init_shared_skills();
|
|
183426
183525
|
init_src();
|
|
183427
|
-
import { readFileSync as
|
|
183526
|
+
import { readFileSync as readFileSync51 } from "fs";
|
|
183428
183527
|
import { join as join64 } from "path";
|
|
183429
|
-
function createSharedSkillTemplateLoader(readFile3 =
|
|
183528
|
+
function createSharedSkillTemplateLoader(readFile3 = readFileSync51, skillsRootPath = sharedSkillsRootPath()) {
|
|
183430
183529
|
const cache = new Map;
|
|
183431
183530
|
return (skillName) => {
|
|
183432
183531
|
const cached2 = cache.get(skillName);
|
|
@@ -184570,9 +184669,9 @@ var gitMasterSkill = {
|
|
|
184570
184669
|
template: GIT_MASTER_TEMPLATE
|
|
184571
184670
|
};
|
|
184572
184671
|
// packages/skills-loader-core/src/features/builtin-skills/skills/dev-browser.ts
|
|
184573
|
-
import { dirname as
|
|
184672
|
+
import { dirname as dirname25, join as join65 } from "path";
|
|
184574
184673
|
import { fileURLToPath as fileURLToPath8 } from "url";
|
|
184575
|
-
var CURRENT_DIR =
|
|
184674
|
+
var CURRENT_DIR = dirname25(fileURLToPath8(import.meta.url));
|
|
184576
184675
|
var devBrowserSkill = {
|
|
184577
184676
|
name: "dev-browser",
|
|
184578
184677
|
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.",
|
|
@@ -185786,9 +185885,9 @@ import {
|
|
|
185786
185885
|
existsSync as existsSync67,
|
|
185787
185886
|
mkdirSync as mkdirSync21,
|
|
185788
185887
|
copyFileSync as copyFileSync4,
|
|
185789
|
-
readFileSync as
|
|
185888
|
+
readFileSync as readFileSync52,
|
|
185790
185889
|
writeFileSync as writeFileSync19,
|
|
185791
|
-
readdirSync as
|
|
185890
|
+
readdirSync as readdirSync11,
|
|
185792
185891
|
statSync as statSync8,
|
|
185793
185892
|
rmSync as rmSync4
|
|
185794
185893
|
} from "fs";
|
|
@@ -185803,10 +185902,10 @@ async function snapshotCli(options = {}) {
|
|
|
185803
185902
|
const realFs = {
|
|
185804
185903
|
existsSync: existsSync67,
|
|
185805
185904
|
mkdirSync: mkdirSync21,
|
|
185806
|
-
readFileSync:
|
|
185905
|
+
readFileSync: readFileSync52,
|
|
185807
185906
|
writeFileSync: writeFileSync19,
|
|
185808
185907
|
copyFileSync: copyFileSync4,
|
|
185809
|
-
readdirSync:
|
|
185908
|
+
readdirSync: readdirSync11,
|
|
185810
185909
|
statSync: statSync8,
|
|
185811
185910
|
rmSync: rmSync4
|
|
185812
185911
|
};
|
|
@@ -185869,9 +185968,9 @@ import {
|
|
|
185869
185968
|
existsSync as existsSync68,
|
|
185870
185969
|
mkdirSync as mkdirSync22,
|
|
185871
185970
|
copyFileSync as copyFileSync5,
|
|
185872
|
-
readFileSync as
|
|
185971
|
+
readFileSync as readFileSync53,
|
|
185873
185972
|
writeFileSync as writeFileSync20,
|
|
185874
|
-
readdirSync as
|
|
185973
|
+
readdirSync as readdirSync12,
|
|
185875
185974
|
statSync as statSync9,
|
|
185876
185975
|
rmSync as rmSync5
|
|
185877
185976
|
} from "fs";
|
|
@@ -185882,10 +185981,10 @@ async function restoreCli(options) {
|
|
|
185882
185981
|
const realFs = {
|
|
185883
185982
|
existsSync: existsSync68,
|
|
185884
185983
|
mkdirSync: mkdirSync22,
|
|
185885
|
-
readFileSync:
|
|
185984
|
+
readFileSync: readFileSync53,
|
|
185886
185985
|
writeFileSync: writeFileSync20,
|
|
185887
185986
|
copyFileSync: copyFileSync5,
|
|
185888
|
-
readdirSync:
|
|
185987
|
+
readdirSync: readdirSync12,
|
|
185889
185988
|
statSync: statSync9,
|
|
185890
185989
|
rmSync: rmSync5
|
|
185891
185990
|
};
|
|
@@ -185897,7 +185996,7 @@ async function restoreCli(options) {
|
|
|
185897
185996
|
try {
|
|
185898
185997
|
restoreSnapshot(options.state, { snapshotDir, fs: realFs });
|
|
185899
185998
|
const manifestPath = path19.join(snapshotDir, options.state, "manifest.json");
|
|
185900
|
-
const raw =
|
|
185999
|
+
const raw = readFileSync53(manifestPath).toString("utf-8");
|
|
185901
186000
|
const parsed = JSON.parse(raw);
|
|
185902
186001
|
const fileCount = typeof parsed === "object" && parsed !== null && "files" in parsed && Array.isArray(parsed.files) ? parsed.files.length : 0;
|
|
185903
186002
|
if (options.json) {
|
|
@@ -185921,9 +186020,9 @@ import {
|
|
|
185921
186020
|
existsSync as existsSync69,
|
|
185922
186021
|
mkdirSync as mkdirSync23,
|
|
185923
186022
|
copyFileSync as copyFileSync6,
|
|
185924
|
-
readFileSync as
|
|
186023
|
+
readFileSync as readFileSync54,
|
|
185925
186024
|
writeFileSync as writeFileSync21,
|
|
185926
|
-
readdirSync as
|
|
186025
|
+
readdirSync as readdirSync13,
|
|
185927
186026
|
statSync as statSync10,
|
|
185928
186027
|
rmSync as rmSync6
|
|
185929
186028
|
} from "fs";
|
|
@@ -185944,10 +186043,10 @@ async function snapshotListCli(options) {
|
|
|
185944
186043
|
const realFs = {
|
|
185945
186044
|
existsSync: existsSync69,
|
|
185946
186045
|
mkdirSync: mkdirSync23,
|
|
185947
|
-
readFileSync:
|
|
186046
|
+
readFileSync: readFileSync54,
|
|
185948
186047
|
writeFileSync: writeFileSync21,
|
|
185949
186048
|
copyFileSync: copyFileSync6,
|
|
185950
|
-
readdirSync:
|
|
186049
|
+
readdirSync: readdirSync13,
|
|
185951
186050
|
statSync: statSync10,
|
|
185952
186051
|
rmSync: rmSync6
|
|
185953
186052
|
};
|
|
@@ -185975,9 +186074,9 @@ import {
|
|
|
185975
186074
|
existsSync as existsSync70,
|
|
185976
186075
|
mkdirSync as mkdirSync24,
|
|
185977
186076
|
copyFileSync as copyFileSync7,
|
|
185978
|
-
readFileSync as
|
|
186077
|
+
readFileSync as readFileSync55,
|
|
185979
186078
|
writeFileSync as writeFileSync22,
|
|
185980
|
-
readdirSync as
|
|
186079
|
+
readdirSync as readdirSync14,
|
|
185981
186080
|
statSync as statSync11,
|
|
185982
186081
|
rmSync as rmSync7
|
|
185983
186082
|
} from "fs";
|
|
@@ -185988,10 +186087,10 @@ async function snapshotPruneCli(options = {}) {
|
|
|
185988
186087
|
const realFs = {
|
|
185989
186088
|
existsSync: existsSync70,
|
|
185990
186089
|
mkdirSync: mkdirSync24,
|
|
185991
|
-
readFileSync:
|
|
186090
|
+
readFileSync: readFileSync55,
|
|
185992
186091
|
writeFileSync: writeFileSync22,
|
|
185993
186092
|
copyFileSync: copyFileSync7,
|
|
185994
|
-
readdirSync:
|
|
186093
|
+
readdirSync: readdirSync14,
|
|
185995
186094
|
statSync: statSync11,
|
|
185996
186095
|
rmSync: rmSync7
|
|
185997
186096
|
};
|
|
@@ -186509,7 +186608,7 @@ async function traceCli(sessionId, options = {}) {
|
|
|
186509
186608
|
|
|
186510
186609
|
// packages/omo-opencode/src/cli/dashboard.ts
|
|
186511
186610
|
import * as path25 from "path";
|
|
186512
|
-
import { readFileSync as
|
|
186611
|
+
import { readFileSync as readFileSync57 } from "fs";
|
|
186513
186612
|
|
|
186514
186613
|
// packages/omo-opencode/src/features/dashboard/data-provider.ts
|
|
186515
186614
|
import * as os12 from "os";
|
|
@@ -187244,7 +187343,7 @@ function loadGatewayPassphrase() {
|
|
|
187244
187343
|
try {
|
|
187245
187344
|
const configDir = getConfigDir();
|
|
187246
187345
|
const configPath = path25.join(configDir, "matrixos.jsonc");
|
|
187247
|
-
const raw =
|
|
187346
|
+
const raw = readFileSync57(configPath, "utf-8");
|
|
187248
187347
|
const config5 = parseJsonc(raw);
|
|
187249
187348
|
const dashboard2 = config5.dashboard;
|
|
187250
187349
|
return typeof dashboard2?.gatewayPassphrase === "string" ? dashboard2.gatewayPassphrase : undefined;
|
|
@@ -187840,8 +187939,8 @@ project.command("search <query>").description("Search the active project KB and
|
|
|
187840
187939
|
});
|
|
187841
187940
|
project.command("add-doc <slug> <file>").description("Copy a document into the project KB").action(async (slug, filePath) => {
|
|
187842
187941
|
const { addKbDocument: addKbDocument2 } = await Promise.resolve().then(() => (init_project_memory(), exports_project_memory));
|
|
187843
|
-
const { readFileSync:
|
|
187844
|
-
const content =
|
|
187942
|
+
const { readFileSync: readFileSync65 } = await import("fs");
|
|
187943
|
+
const content = readFileSync65(filePath, "utf-8");
|
|
187845
187944
|
const dest = addKbDocument2(slug, filePath, content);
|
|
187846
187945
|
process.stdout.write(JSON.stringify({ ok: true, dest }, null, 2) + `
|
|
187847
187946
|
`);
|