@kl-c/matrixos 0.2.10 → 0.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +160 -111
- package/dist/cli-node/index.js +160 -111
- package/dist/index.js +1 -1
- package/package.json +1 -1
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",
|
|
@@ -67746,10 +67746,12 @@ import {
|
|
|
67746
67746
|
symlinkSync,
|
|
67747
67747
|
readlinkSync,
|
|
67748
67748
|
readdirSync as readdirSync4,
|
|
67749
|
-
unlinkSync as unlinkSync5
|
|
67749
|
+
unlinkSync as unlinkSync5,
|
|
67750
|
+
readFileSync as readFileSync15
|
|
67750
67751
|
} from "fs";
|
|
67751
67752
|
import { dirname as dirname9, join as join25 } from "path";
|
|
67752
67753
|
import { homedir as homedir6 } from "os";
|
|
67754
|
+
import { spawnSync as spawnSync3 } from "child_process";
|
|
67753
67755
|
function findSlashCommandSource() {
|
|
67754
67756
|
const candidates = [
|
|
67755
67757
|
join25(import.meta.dir, "slash-commands"),
|
|
@@ -67793,6 +67795,48 @@ function resolveMatrixosBin() {
|
|
|
67793
67795
|
}
|
|
67794
67796
|
return null;
|
|
67795
67797
|
}
|
|
67798
|
+
function npmGlobalInstallMatrixos(version) {
|
|
67799
|
+
try {
|
|
67800
|
+
const result = spawnSync3("npm", ["install", "-g", `@kl-c/matrixos@${version}`], {
|
|
67801
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
67802
|
+
shell: false,
|
|
67803
|
+
timeout: 120000
|
|
67804
|
+
});
|
|
67805
|
+
if (result.status !== 0)
|
|
67806
|
+
return null;
|
|
67807
|
+
const found = spawnSync3("command", ["-v", "matrixos"], {
|
|
67808
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
67809
|
+
shell: false
|
|
67810
|
+
});
|
|
67811
|
+
const bin = found.stdout?.toString().trim();
|
|
67812
|
+
if (bin && existsSync26(bin))
|
|
67813
|
+
return bin;
|
|
67814
|
+
for (const dir of ["/usr/local/bin", "/usr/bin"]) {
|
|
67815
|
+
const p = join25(dir, "matrixos");
|
|
67816
|
+
if (existsSync26(p))
|
|
67817
|
+
return p;
|
|
67818
|
+
}
|
|
67819
|
+
return null;
|
|
67820
|
+
} catch {
|
|
67821
|
+
return null;
|
|
67822
|
+
}
|
|
67823
|
+
}
|
|
67824
|
+
function getPackageVersion() {
|
|
67825
|
+
const candidates = [
|
|
67826
|
+
join25(import.meta.dir, "..", "..", "package.json"),
|
|
67827
|
+
join25(import.meta.dir, "..", "package.json")
|
|
67828
|
+
];
|
|
67829
|
+
for (const c of candidates) {
|
|
67830
|
+
try {
|
|
67831
|
+
if (!existsSync26(c))
|
|
67832
|
+
continue;
|
|
67833
|
+
const pkg = JSON.parse(readFileSync15(c, "utf-8"));
|
|
67834
|
+
if (pkg.version)
|
|
67835
|
+
return pkg.version;
|
|
67836
|
+
} catch {}
|
|
67837
|
+
}
|
|
67838
|
+
return null;
|
|
67839
|
+
}
|
|
67796
67840
|
function copyRecursive(from, to) {
|
|
67797
67841
|
if (!existsSync26(to))
|
|
67798
67842
|
mkdirSync9(to, { recursive: true });
|
|
@@ -67830,6 +67874,11 @@ function installSlashCommandsAndPath() {
|
|
|
67830
67874
|
const liveBin = resolveMatrixosBin();
|
|
67831
67875
|
const linkPath = "/usr/local/bin/matrixos";
|
|
67832
67876
|
const persistentDir = "/usr/local/lib/matrixos";
|
|
67877
|
+
const version = getPackageVersion();
|
|
67878
|
+
const globalBin = version ? npmGlobalInstallMatrixos(version) : null;
|
|
67879
|
+
if (globalBin) {
|
|
67880
|
+
return { commands: total, pathLinked: true };
|
|
67881
|
+
}
|
|
67833
67882
|
if (liveBin) {
|
|
67834
67883
|
try {
|
|
67835
67884
|
const target = installPackageTo(persistentDir, liveBin) ?? liveBin;
|
|
@@ -69704,7 +69753,7 @@ var init_dist5 = __esm(() => {
|
|
|
69704
69753
|
|
|
69705
69754
|
// packages/omo-opencode/src/cli/config-manager/write-gateway-env.ts
|
|
69706
69755
|
import { homedir as homedir8 } from "os";
|
|
69707
|
-
import { existsSync as existsSync27, mkdirSync as mkdirSync10, readFileSync as
|
|
69756
|
+
import { existsSync as existsSync27, mkdirSync as mkdirSync10, readFileSync as readFileSync16, writeFileSync as writeFileSync6, chmodSync as chmodSync3 } from "fs";
|
|
69708
69757
|
import { join as join27 } from "path";
|
|
69709
69758
|
function writeGatewayEnvToken(key, token) {
|
|
69710
69759
|
const configDir = homedir8();
|
|
@@ -69713,7 +69762,7 @@ function writeGatewayEnvToken(key, token) {
|
|
|
69713
69762
|
const envPath = join27(configDir, GATEWAY_ENV_FILENAME);
|
|
69714
69763
|
const entries = new Map;
|
|
69715
69764
|
if (existsSync27(envPath)) {
|
|
69716
|
-
const existing =
|
|
69765
|
+
const existing = readFileSync16(envPath, "utf-8");
|
|
69717
69766
|
for (const rawLine of existing.split(`
|
|
69718
69767
|
`)) {
|
|
69719
69768
|
const line = rawLine.trim();
|
|
@@ -102741,7 +102790,7 @@ var require_Util = __commonJS((exports, module2) => {
|
|
|
102741
102790
|
await client3.rest.patch(route, { body: updatedItems, reason });
|
|
102742
102791
|
return updatedItems;
|
|
102743
102792
|
}
|
|
102744
|
-
function
|
|
102793
|
+
function basename5(path7, ext) {
|
|
102745
102794
|
const res = parse7(path7);
|
|
102746
102795
|
return ext && res.ext.startsWith(ext) ? res.name : res.base.split("?")[0];
|
|
102747
102796
|
}
|
|
@@ -102864,7 +102913,7 @@ var require_Util = __commonJS((exports, module2) => {
|
|
|
102864
102913
|
resolveColor,
|
|
102865
102914
|
discordSort,
|
|
102866
102915
|
setPosition,
|
|
102867
|
-
basename:
|
|
102916
|
+
basename: basename5,
|
|
102868
102917
|
cleanContent,
|
|
102869
102918
|
cleanCodeBlockContent,
|
|
102870
102919
|
parseWebhookURL,
|
|
@@ -115685,7 +115734,7 @@ var require_MessagePayload = __commonJS((exports, module2) => {
|
|
|
115685
115734
|
var { DiscordjsError, DiscordjsRangeError, ErrorCodes } = require_errors();
|
|
115686
115735
|
var { resolveFile } = require_DataResolver();
|
|
115687
115736
|
var MessageFlagsBitField = require_MessageFlagsBitField();
|
|
115688
|
-
var { basename:
|
|
115737
|
+
var { basename: basename5, verifyString, resolvePartialEmoji } = require_Util();
|
|
115689
115738
|
var getBaseInteraction = lazy2(() => require_BaseInteraction());
|
|
115690
115739
|
|
|
115691
115740
|
class MessagePayload {
|
|
@@ -115870,10 +115919,10 @@ var require_MessagePayload = __commonJS((exports, module2) => {
|
|
|
115870
115919
|
let name2;
|
|
115871
115920
|
const findName = (thing) => {
|
|
115872
115921
|
if (typeof thing === "string") {
|
|
115873
|
-
return
|
|
115922
|
+
return basename5(thing);
|
|
115874
115923
|
}
|
|
115875
115924
|
if (thing.path) {
|
|
115876
|
-
return
|
|
115925
|
+
return basename5(thing.path);
|
|
115877
115926
|
}
|
|
115878
115927
|
return "file.jpg";
|
|
115879
115928
|
};
|
|
@@ -128251,7 +128300,7 @@ var require_EmbedBuilder = __commonJS((exports, module2) => {
|
|
|
128251
128300
|
|
|
128252
128301
|
// node_modules/.bun/discord.js@14.27.0/node_modules/discord.js/src/structures/AttachmentBuilder.js
|
|
128253
128302
|
var require_AttachmentBuilder = __commonJS((exports, module2) => {
|
|
128254
|
-
var { basename:
|
|
128303
|
+
var { basename: basename5, flatten } = require_Util();
|
|
128255
128304
|
|
|
128256
128305
|
class AttachmentBuilder {
|
|
128257
128306
|
constructor(attachment, data = {}) {
|
|
@@ -128299,7 +128348,7 @@ var require_AttachmentBuilder = __commonJS((exports, module2) => {
|
|
|
128299
128348
|
return this;
|
|
128300
128349
|
}
|
|
128301
128350
|
get spoiler() {
|
|
128302
|
-
return
|
|
128351
|
+
return basename5(this.name).startsWith("SPOILER_");
|
|
128303
128352
|
}
|
|
128304
128353
|
toJSON() {
|
|
128305
128354
|
return flatten(this);
|
|
@@ -154571,7 +154620,7 @@ var require_filesystem = __commonJS((exports2, module2) => {
|
|
|
154571
154620
|
var LDD_PATH = "/usr/bin/ldd";
|
|
154572
154621
|
var SELF_PATH = "/proc/self/exe";
|
|
154573
154622
|
var MAX_LENGTH = 2048;
|
|
154574
|
-
var
|
|
154623
|
+
var readFileSync47 = (path18) => {
|
|
154575
154624
|
const fd = fs18.openSync(path18, "r");
|
|
154576
154625
|
const buffer = Buffer.alloc(MAX_LENGTH);
|
|
154577
154626
|
const bytesRead = fs18.readSync(fd, buffer, 0, MAX_LENGTH, 0);
|
|
@@ -154594,7 +154643,7 @@ var require_filesystem = __commonJS((exports2, module2) => {
|
|
|
154594
154643
|
module2.exports = {
|
|
154595
154644
|
LDD_PATH,
|
|
154596
154645
|
SELF_PATH,
|
|
154597
|
-
readFileSync:
|
|
154646
|
+
readFileSync: readFileSync47,
|
|
154598
154647
|
readFile
|
|
154599
154648
|
};
|
|
154600
154649
|
});
|
|
@@ -154637,7 +154686,7 @@ var require_elf = __commonJS((exports2, module2) => {
|
|
|
154637
154686
|
var require_detect_libc = __commonJS((exports2, module2) => {
|
|
154638
154687
|
var childProcess = __require("child_process");
|
|
154639
154688
|
var { isLinux, getReport } = require_process();
|
|
154640
|
-
var { LDD_PATH, SELF_PATH, readFile, readFileSync:
|
|
154689
|
+
var { LDD_PATH, SELF_PATH, readFile, readFileSync: readFileSync47 } = require_filesystem();
|
|
154641
154690
|
var { interpreterPath } = require_elf();
|
|
154642
154691
|
var cachedFamilyInterpreter;
|
|
154643
154692
|
var cachedFamilyFilesystem;
|
|
@@ -154728,7 +154777,7 @@ var require_detect_libc = __commonJS((exports2, module2) => {
|
|
|
154728
154777
|
}
|
|
154729
154778
|
cachedFamilyFilesystem = null;
|
|
154730
154779
|
try {
|
|
154731
|
-
const lddContent =
|
|
154780
|
+
const lddContent = readFileSync47(LDD_PATH);
|
|
154732
154781
|
cachedFamilyFilesystem = getFamilyFromLddContent(lddContent);
|
|
154733
154782
|
} catch (e) {}
|
|
154734
154783
|
return cachedFamilyFilesystem;
|
|
@@ -154751,7 +154800,7 @@ var require_detect_libc = __commonJS((exports2, module2) => {
|
|
|
154751
154800
|
}
|
|
154752
154801
|
cachedFamilyInterpreter = null;
|
|
154753
154802
|
try {
|
|
154754
|
-
const selfContent =
|
|
154803
|
+
const selfContent = readFileSync47(SELF_PATH);
|
|
154755
154804
|
const path18 = interpreterPath(selfContent);
|
|
154756
154805
|
cachedFamilyInterpreter = familyFromInterpreterPath(path18);
|
|
154757
154806
|
} catch (e) {}
|
|
@@ -154813,7 +154862,7 @@ var require_detect_libc = __commonJS((exports2, module2) => {
|
|
|
154813
154862
|
}
|
|
154814
154863
|
cachedVersionFilesystem = null;
|
|
154815
154864
|
try {
|
|
154816
|
-
const lddContent =
|
|
154865
|
+
const lddContent = readFileSync47(LDD_PATH);
|
|
154817
154866
|
const versionMatch = lddContent.match(RE_GLIBC_VERSION);
|
|
154818
154867
|
if (versionMatch) {
|
|
154819
154868
|
cachedVersionFilesystem = versionMatch[1];
|
|
@@ -155115,7 +155164,7 @@ var require_libvips = __commonJS((exports2, module2) => {
|
|
|
155115
155164
|
var fs18 = __require("fs");
|
|
155116
155165
|
var os7 = __require("os");
|
|
155117
155166
|
var path18 = __require("path");
|
|
155118
|
-
var
|
|
155167
|
+
var spawnSync4 = __require("child_process").spawnSync;
|
|
155119
155168
|
var semverCoerce = require_coerce();
|
|
155120
155169
|
var semverGreaterThanOrEqualTo = require_gte();
|
|
155121
155170
|
var platform = require_platform();
|
|
@@ -155156,14 +155205,14 @@ var require_libvips = __commonJS((exports2, module2) => {
|
|
|
155156
155205
|
};
|
|
155157
155206
|
var isRosetta = function() {
|
|
155158
155207
|
if (process.platform === "darwin" && process.arch === "x64") {
|
|
155159
|
-
const translated =
|
|
155208
|
+
const translated = spawnSync4("sysctl sysctl.proc_translated", spawnSyncOptions).stdout;
|
|
155160
155209
|
return (translated || "").trim() === "sysctl.proc_translated: 1";
|
|
155161
155210
|
}
|
|
155162
155211
|
return false;
|
|
155163
155212
|
};
|
|
155164
155213
|
var globalLibvipsVersion = function() {
|
|
155165
155214
|
if (process.platform !== "win32") {
|
|
155166
|
-
const globalLibvipsVersion2 =
|
|
155215
|
+
const globalLibvipsVersion2 = spawnSync4("pkg-config --modversion vips-cpp", {
|
|
155167
155216
|
...spawnSyncOptions,
|
|
155168
155217
|
env: {
|
|
155169
155218
|
...env4,
|
|
@@ -155183,7 +155232,7 @@ var require_libvips = __commonJS((exports2, module2) => {
|
|
|
155183
155232
|
};
|
|
155184
155233
|
var pkgConfigPath = function() {
|
|
155185
155234
|
if (process.platform !== "win32") {
|
|
155186
|
-
const brewPkgConfigPath =
|
|
155235
|
+
const brewPkgConfigPath = spawnSync4('which brew >/dev/null 2>&1 && brew environment --plain | grep PKG_CONFIG_LIBDIR | cut -d" " -f2', spawnSyncOptions).stdout || "";
|
|
155187
155236
|
return [
|
|
155188
155237
|
brewPkgConfigPath.trim(),
|
|
155189
155238
|
env4.PKG_CONFIG_PATH,
|
|
@@ -164974,7 +165023,7 @@ __export(exports_generate, {
|
|
|
164974
165023
|
executeGenerateCommand: () => executeGenerateCommand,
|
|
164975
165024
|
ProfileNotFoundError: () => ProfileNotFoundError
|
|
164976
165025
|
});
|
|
164977
|
-
import { existsSync as existsSync72, readFileSync as
|
|
165026
|
+
import { existsSync as existsSync72, readFileSync as readFileSync58, realpathSync as realpathSync10 } from "fs";
|
|
164978
165027
|
import { dirname as dirname29, isAbsolute as isAbsolute6, join as join77, resolve as resolve16 } from "path";
|
|
164979
165028
|
function profilesDirFor(opts) {
|
|
164980
165029
|
if (opts.profilesDir)
|
|
@@ -165072,7 +165121,7 @@ var init_generate = __esm(() => {
|
|
|
165072
165121
|
init_src5();
|
|
165073
165122
|
init_src5();
|
|
165074
165123
|
REPO_ROOT = resolve16(dirname29(new URL(import.meta.url).pathname), "..", "..", "..", "..", "..");
|
|
165075
|
-
defaultFS2 = { existsSync: existsSync72, readFileSync:
|
|
165124
|
+
defaultFS2 = { existsSync: existsSync72, readFileSync: readFileSync58, realpathSync: realpathSync10 };
|
|
165076
165125
|
ProfileNotFoundError = class ProfileNotFoundError extends Error {
|
|
165077
165126
|
profileName;
|
|
165078
165127
|
constructor(profileName) {
|
|
@@ -165326,7 +165375,7 @@ var exports_profile_resolve = {};
|
|
|
165326
165375
|
__export(exports_profile_resolve, {
|
|
165327
165376
|
executeProfileResolveCommand: () => executeProfileResolveCommand
|
|
165328
165377
|
});
|
|
165329
|
-
import { existsSync as existsSync74, readdirSync as readdirSync16, readFileSync as
|
|
165378
|
+
import { existsSync as existsSync74, readdirSync as readdirSync16, readFileSync as readFileSync59 } from "fs";
|
|
165330
165379
|
import { join as join80, resolve as resolve17, dirname as dirname30 } from "path";
|
|
165331
165380
|
function executeProfileResolveCommand(args) {
|
|
165332
165381
|
if (args.options.help) {
|
|
@@ -165373,7 +165422,7 @@ function executeProfileResolveCommand(args) {
|
|
|
165373
165422
|
for (const file3 of profileFiles) {
|
|
165374
165423
|
try {
|
|
165375
165424
|
const filePath = join80(profilesDir, file3);
|
|
165376
|
-
const raw = JSON.parse(
|
|
165425
|
+
const raw = JSON.parse(readFileSync59(filePath, "utf-8"));
|
|
165377
165426
|
const profile2 = ProfileSchema.parse(raw);
|
|
165378
165427
|
registry2[profile2.name] = profile2;
|
|
165379
165428
|
} catch {}
|
|
@@ -165435,9 +165484,9 @@ __export(exports_export, {
|
|
|
165435
165484
|
getShell: () => getShell,
|
|
165436
165485
|
executeExportCommand: () => executeExportCommand
|
|
165437
165486
|
});
|
|
165438
|
-
import { existsSync as existsSync75, readFileSync as
|
|
165487
|
+
import { existsSync as existsSync75, readFileSync as readFileSync60, writeFileSync as writeFileSync26, copyFileSync as copyFileSync8, realpathSync as realpathSync11, mkdirSync as mkdirSync27 } from "fs";
|
|
165439
165488
|
import { isAbsolute as isAbsolute7, join as join81, resolve as resolve18, dirname as dirname31 } from "path";
|
|
165440
|
-
import { spawnSync as
|
|
165489
|
+
import { spawnSync as spawnSync4 } from "child_process";
|
|
165441
165490
|
function setShell(shell) {
|
|
165442
165491
|
activeShell = shell;
|
|
165443
165492
|
}
|
|
@@ -165549,7 +165598,7 @@ var init_export = __esm(() => {
|
|
|
165549
165598
|
defaultShell = {
|
|
165550
165599
|
run(cmd, cwd) {
|
|
165551
165600
|
const parts = cmd.split(/\s+/);
|
|
165552
|
-
const result =
|
|
165601
|
+
const result = spawnSync4(parts[0], parts.slice(1), { cwd, encoding: "utf-8", windowsHide: process.platform === "win32" });
|
|
165553
165602
|
return {
|
|
165554
165603
|
code: result.status ?? 1,
|
|
165555
165604
|
stdout: (result.stdout ?? result.stderr ?? "").toString().trim()
|
|
@@ -165559,7 +165608,7 @@ var init_export = __esm(() => {
|
|
|
165559
165608
|
activeShell = defaultShell;
|
|
165560
165609
|
defaultExportFS = {
|
|
165561
165610
|
existsSync: existsSync75,
|
|
165562
|
-
readFileSync:
|
|
165611
|
+
readFileSync: readFileSync60,
|
|
165563
165612
|
writeFileSync: writeFileSync26,
|
|
165564
165613
|
copyFileSync: copyFileSync8,
|
|
165565
165614
|
realpathSync: realpathSync11,
|
|
@@ -165587,7 +165636,7 @@ __export(exports_project_context, {
|
|
|
165587
165636
|
createProject: () => createProject,
|
|
165588
165637
|
archiveProject: () => archiveProject
|
|
165589
165638
|
});
|
|
165590
|
-
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";
|
|
165591
165640
|
import { join as join82 } from "path";
|
|
165592
165641
|
function getMatrixOsDir(cwd = process.cwd()) {
|
|
165593
165642
|
return join82(cwd, ".matrixos");
|
|
@@ -165606,7 +165655,7 @@ function loadState(cwd) {
|
|
|
165606
165655
|
if (!existsSync76(path29))
|
|
165607
165656
|
return {};
|
|
165608
165657
|
try {
|
|
165609
|
-
return JSON.parse(
|
|
165658
|
+
return JSON.parse(readFileSync61(path29, "utf-8"));
|
|
165610
165659
|
} catch {
|
|
165611
165660
|
return {};
|
|
165612
165661
|
}
|
|
@@ -165622,7 +165671,7 @@ function loadProjectMeta(slug, cwd) {
|
|
|
165622
165671
|
if (!existsSync76(path29))
|
|
165623
165672
|
return null;
|
|
165624
165673
|
try {
|
|
165625
|
-
return JSON.parse(
|
|
165674
|
+
return JSON.parse(readFileSync61(path29, "utf-8"));
|
|
165626
165675
|
} catch {
|
|
165627
165676
|
return null;
|
|
165628
165677
|
}
|
|
@@ -165748,7 +165797,7 @@ __export(exports_project_memory, {
|
|
|
165748
165797
|
isProjectEpisode: () => isProjectEpisode,
|
|
165749
165798
|
addKbDocument: () => addKbDocument
|
|
165750
165799
|
});
|
|
165751
|
-
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";
|
|
165752
165801
|
import { join as join83 } from "path";
|
|
165753
165802
|
function tagWithProject(metadata = {}, projectSlug, cwd) {
|
|
165754
165803
|
const active = projectSlug ?? getActiveProject(cwd)?.slug;
|
|
@@ -165772,7 +165821,7 @@ function listKbDocuments(projectSlug, cwd) {
|
|
|
165772
165821
|
continue;
|
|
165773
165822
|
const path29 = join83(kbDir, entry.name);
|
|
165774
165823
|
try {
|
|
165775
|
-
docs.push({ path: path29, content:
|
|
165824
|
+
docs.push({ path: path29, content: readFileSync62(path29, "utf-8") });
|
|
165776
165825
|
} catch {}
|
|
165777
165826
|
}
|
|
165778
165827
|
return docs;
|
|
@@ -166194,12 +166243,12 @@ __export(exports_gateway_start, {
|
|
|
166194
166243
|
buildTelegramConfig: () => buildTelegramConfig,
|
|
166195
166244
|
buildGatewayConfig: () => buildGatewayConfig
|
|
166196
166245
|
});
|
|
166197
|
-
import { readFileSync as
|
|
166246
|
+
import { readFileSync as readFileSync63, existsSync as existsSync78 } from "fs";
|
|
166198
166247
|
import { resolve as resolve19 } from "path";
|
|
166199
166248
|
function loadGatewayEnv(path29 = ENV_PATH) {
|
|
166200
166249
|
if (!existsSync78(path29))
|
|
166201
166250
|
return {};
|
|
166202
|
-
const text =
|
|
166251
|
+
const text = readFileSync63(path29, "utf8");
|
|
166203
166252
|
const out = {};
|
|
166204
166253
|
for (const raw of text.split(/\r?\n/)) {
|
|
166205
166254
|
const line = raw.trim();
|
|
@@ -166669,7 +166718,7 @@ var init_deployment = __esm(() => {
|
|
|
166669
166718
|
});
|
|
166670
166719
|
|
|
166671
166720
|
// packages/omo-opencode/src/audit/self-audit.ts
|
|
166672
|
-
import { existsSync as existsSync80, mkdirSync as mkdirSync30, readdirSync as readdirSync18, readFileSync as
|
|
166721
|
+
import { existsSync as existsSync80, mkdirSync as mkdirSync30, readdirSync as readdirSync18, readFileSync as readFileSync64, writeFileSync as writeFileSync29 } from "fs";
|
|
166673
166722
|
import { join as join84 } from "path";
|
|
166674
166723
|
function getAuditDir(cwd = process.cwd()) {
|
|
166675
166724
|
return join84(cwd, ".matrixos", "audits");
|
|
@@ -169323,7 +169372,7 @@ var BOULDER_STATE_PATH = `${BOULDER_DIR}/${BOULDER_FILE}`;
|
|
|
169323
169372
|
var NOTEPAD_DIR = "notepads";
|
|
169324
169373
|
var NOTEPAD_BASE_PATH = `${BOULDER_DIR}/${NOTEPAD_DIR}`;
|
|
169325
169374
|
// packages/boulder-state/src/top-level-task.ts
|
|
169326
|
-
import { existsSync as existsSync32, readFileSync as
|
|
169375
|
+
import { existsSync as existsSync32, readFileSync as readFileSync19 } from "fs";
|
|
169327
169376
|
var TODO_HEADING_PATTERN = /^##\s+TODOs\b/i;
|
|
169328
169377
|
var FINAL_VERIFICATION_HEADING_PATTERN = /^##\s+Final Verification Wave\b/i;
|
|
169329
169378
|
var SECOND_LEVEL_HEADING_PATTERN = /^##\s+/;
|
|
@@ -169350,7 +169399,7 @@ function readCurrentTopLevelTask(planPath) {
|
|
|
169350
169399
|
return null;
|
|
169351
169400
|
}
|
|
169352
169401
|
try {
|
|
169353
|
-
const content =
|
|
169402
|
+
const content = readFileSync19(planPath, "utf-8");
|
|
169354
169403
|
const lines = content.split(/\r?\n/);
|
|
169355
169404
|
let section = "other";
|
|
169356
169405
|
for (const line of lines) {
|
|
@@ -169402,7 +169451,7 @@ function resolveBoulderPlanPathForWork(directory, work) {
|
|
|
169402
169451
|
return resolveBoulderPlanPath(directory, work);
|
|
169403
169452
|
}
|
|
169404
169453
|
// packages/boulder-state/src/storage/plan-progress.ts
|
|
169405
|
-
import { existsSync as existsSync34, readFileSync as
|
|
169454
|
+
import { existsSync as existsSync34, readFileSync as readFileSync20, readdirSync as readdirSync5, statSync as statSync5 } from "fs";
|
|
169406
169455
|
var TODO_HEADING_PATTERN2 = /^##\s+TODOs\b/i;
|
|
169407
169456
|
var FINAL_VERIFICATION_HEADING_PATTERN2 = /^##\s+Final Verification Wave\b/i;
|
|
169408
169457
|
var SECOND_LEVEL_HEADING_PATTERN2 = /^##\s+/;
|
|
@@ -169415,7 +169464,7 @@ function getPlanProgress(planPath) {
|
|
|
169415
169464
|
return { total: 0, completed: 0, isComplete: false };
|
|
169416
169465
|
}
|
|
169417
169466
|
try {
|
|
169418
|
-
const content =
|
|
169467
|
+
const content = readFileSync20(planPath, "utf-8");
|
|
169419
169468
|
const lines = content.split(/\r?\n/);
|
|
169420
169469
|
const hasStructuredSections = lines.some((line) => TODO_HEADING_PATTERN2.test(line) || FINAL_VERIFICATION_HEADING_PATTERN2.test(line));
|
|
169421
169470
|
if (hasStructuredSections) {
|
|
@@ -169531,14 +169580,14 @@ function selectMirrorWork(state) {
|
|
|
169531
169580
|
return sorted[0] ?? null;
|
|
169532
169581
|
}
|
|
169533
169582
|
// packages/boulder-state/src/storage/read-state.ts
|
|
169534
|
-
import { existsSync as existsSync35, readFileSync as
|
|
169583
|
+
import { existsSync as existsSync35, readFileSync as readFileSync21 } from "fs";
|
|
169535
169584
|
function readBoulderState(directory) {
|
|
169536
169585
|
const filePath = getBoulderFilePath(directory);
|
|
169537
169586
|
if (!existsSync35(filePath)) {
|
|
169538
169587
|
return null;
|
|
169539
169588
|
}
|
|
169540
169589
|
try {
|
|
169541
|
-
const content =
|
|
169590
|
+
const content = readFileSync21(filePath, "utf-8");
|
|
169542
169591
|
const parsed = JSON.parse(content);
|
|
169543
169592
|
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
169544
169593
|
return null;
|
|
@@ -169604,7 +169653,7 @@ init_state();
|
|
|
169604
169653
|
// packages/omo-opencode/src/features/run-continuation-state/constants.ts
|
|
169605
169654
|
var CONTINUATION_MARKER_DIR = ".omo/run-continuation";
|
|
169606
169655
|
// packages/omo-opencode/src/features/run-continuation-state/storage.ts
|
|
169607
|
-
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";
|
|
169608
169657
|
import { join as join31 } from "path";
|
|
169609
169658
|
function getMarkerPath(directory, sessionID) {
|
|
169610
169659
|
return join31(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
|
|
@@ -169614,7 +169663,7 @@ function readContinuationMarker(directory, sessionID) {
|
|
|
169614
169663
|
if (!existsSync36(markerPath))
|
|
169615
169664
|
return null;
|
|
169616
169665
|
try {
|
|
169617
|
-
const raw =
|
|
169666
|
+
const raw = readFileSync22(markerPath, "utf-8");
|
|
169618
169667
|
const parsed = JSON.parse(raw);
|
|
169619
169668
|
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
|
|
169620
169669
|
return null;
|
|
@@ -169679,7 +169728,7 @@ async function isSessionInBoulderLineage(input) {
|
|
|
169679
169728
|
// packages/omo-opencode/src/hooks/the-operator/session-last-agent.ts
|
|
169680
169729
|
init_shared();
|
|
169681
169730
|
init_compaction_marker();
|
|
169682
|
-
import { readFileSync as
|
|
169731
|
+
import { readFileSync as readFileSync23, readdirSync as readdirSync6 } from "fs";
|
|
169683
169732
|
import { join as join32 } from "path";
|
|
169684
169733
|
var defaultSessionLastAgentDeps = {
|
|
169685
169734
|
getMessageDir,
|
|
@@ -169740,7 +169789,7 @@ async function getLastAgentFromSession(sessionID, client3, deps = {}) {
|
|
|
169740
169789
|
try {
|
|
169741
169790
|
const messages = readdirSync6(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
|
|
169742
169791
|
try {
|
|
169743
|
-
const content =
|
|
169792
|
+
const content = readFileSync23(join32(messageDir, fileName), "utf-8");
|
|
169744
169793
|
const parsed = JSON.parse(content);
|
|
169745
169794
|
return {
|
|
169746
169795
|
fileName,
|
|
@@ -169783,7 +169832,7 @@ init_agent_display_names();
|
|
|
169783
169832
|
|
|
169784
169833
|
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
|
|
169785
169834
|
init_frontmatter2();
|
|
169786
|
-
import { existsSync as existsSync37, readFileSync as
|
|
169835
|
+
import { existsSync as existsSync37, readFileSync as readFileSync24, writeFileSync as writeFileSync10, unlinkSync as unlinkSync6, mkdirSync as mkdirSync13 } from "fs";
|
|
169787
169836
|
import { dirname as dirname13, join as join33 } from "path";
|
|
169788
169837
|
|
|
169789
169838
|
// packages/omo-opencode/src/hooks/ralph-loop/constants.ts
|
|
@@ -169801,7 +169850,7 @@ function readState(directory, customPath) {
|
|
|
169801
169850
|
return null;
|
|
169802
169851
|
}
|
|
169803
169852
|
try {
|
|
169804
|
-
const content =
|
|
169853
|
+
const content = readFileSync24(filePath, "utf-8");
|
|
169805
169854
|
const { data, body } = parseFrontmatter(content);
|
|
169806
169855
|
const active = data.active;
|
|
169807
169856
|
const iteration = data.iteration;
|
|
@@ -170376,8 +170425,8 @@ function createTimestampedStdoutController(stdout2 = process.stdout) {
|
|
|
170376
170425
|
// packages/telemetry-core/src/activity-state.ts
|
|
170377
170426
|
init_atomic_write();
|
|
170378
170427
|
init_xdg_data_dir();
|
|
170379
|
-
import { existsSync as existsSync38, mkdirSync as mkdirSync14, readFileSync as
|
|
170380
|
-
import { basename as
|
|
170428
|
+
import { existsSync as existsSync38, mkdirSync as mkdirSync14, readFileSync as readFileSync25 } from "fs";
|
|
170429
|
+
import { basename as basename6, join as join34 } from "path";
|
|
170381
170430
|
var POSTHOG_ACTIVITY_STATE_FILE = "posthog-activity.json";
|
|
170382
170431
|
function resolveTelemetryStateDir(product, options = {}) {
|
|
170383
170432
|
const dataDir = resolveXdgDataDir(product.cacheDirName, {
|
|
@@ -170385,7 +170434,7 @@ function resolveTelemetryStateDir(product, options = {}) {
|
|
|
170385
170434
|
osProvider: options.osProvider
|
|
170386
170435
|
});
|
|
170387
170436
|
const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined : join34(options.env.XDG_DATA_HOME, product.cacheDirName);
|
|
170388
|
-
if (dataDir === xdgStateDir || xdgStateDir === undefined &&
|
|
170437
|
+
if (dataDir === xdgStateDir || xdgStateDir === undefined && basename6(dataDir) === product.cacheDirName) {
|
|
170389
170438
|
return dataDir;
|
|
170390
170439
|
}
|
|
170391
170440
|
return join34(dataDir, product.cacheDirName);
|
|
@@ -170420,7 +170469,7 @@ function readPostHogActivityState(stateDir, diagnostics) {
|
|
|
170420
170469
|
return {};
|
|
170421
170470
|
}
|
|
170422
170471
|
try {
|
|
170423
|
-
const stateContent =
|
|
170472
|
+
const stateContent = readFileSync25(stateFilePath, "utf-8");
|
|
170424
170473
|
const stateJson = JSON.parse(stateContent);
|
|
170425
170474
|
if (!isPostHogActivityState(stateJson)) {
|
|
170426
170475
|
return {};
|
|
@@ -177543,7 +177592,7 @@ init_constants5();
|
|
|
177543
177592
|
|
|
177544
177593
|
// packages/omo-opencode/src/cli/doctor/checks/system.ts
|
|
177545
177594
|
init_constants5();
|
|
177546
|
-
import { existsSync as existsSync49, readFileSync as
|
|
177595
|
+
import { existsSync as existsSync49, readFileSync as readFileSync35 } from "fs";
|
|
177547
177596
|
|
|
177548
177597
|
// packages/omo-opencode/src/cli/doctor/checks/system-binary.ts
|
|
177549
177598
|
init_extract_semver();
|
|
@@ -177740,7 +177789,7 @@ function compareVersions3(current, minimum) {
|
|
|
177740
177789
|
|
|
177741
177790
|
// packages/omo-opencode/src/cli/doctor/checks/system-plugin.ts
|
|
177742
177791
|
init_shared();
|
|
177743
|
-
import { existsSync as existsSync47, readFileSync as
|
|
177792
|
+
import { existsSync as existsSync47, readFileSync as readFileSync33 } from "fs";
|
|
177744
177793
|
function detectConfigPath() {
|
|
177745
177794
|
const paths2 = getOpenCodeConfigPaths({ binary: "opencode", version: null });
|
|
177746
177795
|
if (existsSync47(paths2.configJsonc))
|
|
@@ -177791,7 +177840,7 @@ function getPluginInfo() {
|
|
|
177791
177840
|
};
|
|
177792
177841
|
}
|
|
177793
177842
|
try {
|
|
177794
|
-
const content =
|
|
177843
|
+
const content = readFileSync33(configPath, "utf-8");
|
|
177795
177844
|
const parsedConfig = parseJsonc(content);
|
|
177796
177845
|
const pluginEntry = findPluginEntry2(parsedConfig.plugin ?? []);
|
|
177797
177846
|
if (!pluginEntry) {
|
|
@@ -177835,7 +177884,7 @@ init_auto_update_checker();
|
|
|
177835
177884
|
init_package_json_locator();
|
|
177836
177885
|
init_constants5();
|
|
177837
177886
|
init_shared();
|
|
177838
|
-
import { existsSync as existsSync48, readFileSync as
|
|
177887
|
+
import { existsSync as existsSync48, readFileSync as readFileSync34, readdirSync as readdirSync8 } from "fs";
|
|
177839
177888
|
import { createRequire as createRequire2 } from "module";
|
|
177840
177889
|
import { homedir as homedir13 } from "os";
|
|
177841
177890
|
import { join as join42 } from "path";
|
|
@@ -177866,7 +177915,7 @@ function readPackageJson(filePath) {
|
|
|
177866
177915
|
if (!existsSync48(filePath))
|
|
177867
177916
|
return null;
|
|
177868
177917
|
try {
|
|
177869
|
-
const content =
|
|
177918
|
+
const content = readFileSync34(filePath, "utf-8");
|
|
177870
177919
|
return parseJsonc(content);
|
|
177871
177920
|
} catch (error51) {
|
|
177872
177921
|
if (!(error51 instanceof Error)) {
|
|
@@ -178000,7 +178049,7 @@ var defaultDeps6 = {
|
|
|
178000
178049
|
getLatestPluginVersion,
|
|
178001
178050
|
getSuggestedInstallTag,
|
|
178002
178051
|
configExists: existsSync49,
|
|
178003
|
-
readConfigFile: (path14) =>
|
|
178052
|
+
readConfigFile: (path14) => readFileSync35(path14, "utf-8"),
|
|
178004
178053
|
parseConfigContent: (content) => parseJsonc(content)
|
|
178005
178054
|
};
|
|
178006
178055
|
var BUN_POSTINSTALL_HELPER_PACKAGE_NAME = "@code-yeongyu/comment-checker";
|
|
@@ -178145,7 +178194,7 @@ async function checkSystem(deps = defaultDeps6) {
|
|
|
178145
178194
|
|
|
178146
178195
|
// packages/omo-opencode/src/config/validate.ts
|
|
178147
178196
|
init_src();
|
|
178148
|
-
import { readFileSync as
|
|
178197
|
+
import { readFileSync as readFileSync36 } from "fs";
|
|
178149
178198
|
import { homedir as homedir14 } from "os";
|
|
178150
178199
|
import { dirname as dirname19, relative as relative5 } from "path";
|
|
178151
178200
|
init_shared();
|
|
@@ -178190,7 +178239,7 @@ function schemaMessages(configPath, rawConfig) {
|
|
|
178190
178239
|
}
|
|
178191
178240
|
function parseLayerConfig(configPath) {
|
|
178192
178241
|
try {
|
|
178193
|
-
const content =
|
|
178242
|
+
const content = readFileSync36(configPath, "utf-8");
|
|
178194
178243
|
const rawConfig = parseJsonc(content);
|
|
178195
178244
|
if (!isPlainRecord(rawConfig)) {
|
|
178196
178245
|
return {
|
|
@@ -178262,7 +178311,7 @@ init_constants5();
|
|
|
178262
178311
|
|
|
178263
178312
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-cache.ts
|
|
178264
178313
|
init_shared();
|
|
178265
|
-
import { existsSync as existsSync50, readFileSync as
|
|
178314
|
+
import { existsSync as existsSync50, readFileSync as readFileSync37 } from "fs";
|
|
178266
178315
|
import { homedir as homedir15 } from "os";
|
|
178267
178316
|
import { join as join43 } from "path";
|
|
178268
178317
|
function getUserConfigDir2() {
|
|
@@ -178281,7 +178330,7 @@ function loadCustomProviderNames() {
|
|
|
178281
178330
|
if (!existsSync50(configPath))
|
|
178282
178331
|
continue;
|
|
178283
178332
|
try {
|
|
178284
|
-
const content =
|
|
178333
|
+
const content = readFileSync37(configPath, "utf-8");
|
|
178285
178334
|
const data = parseJsonc(content);
|
|
178286
178335
|
if (data?.provider && typeof data.provider === "object") {
|
|
178287
178336
|
return Object.keys(data.provider);
|
|
@@ -178305,7 +178354,7 @@ function loadAvailableModelsFromCache() {
|
|
|
178305
178354
|
return { providers: [], modelCount: 0, cacheExists: false };
|
|
178306
178355
|
}
|
|
178307
178356
|
try {
|
|
178308
|
-
const content =
|
|
178357
|
+
const content = readFileSync37(cacheFile, "utf-8");
|
|
178309
178358
|
const data = parseJsonc(content);
|
|
178310
178359
|
const cacheProviders = Object.keys(data);
|
|
178311
178360
|
let modelCount = 0;
|
|
@@ -178333,7 +178382,7 @@ init_constants5();
|
|
|
178333
178382
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-config.ts
|
|
178334
178383
|
init_shared();
|
|
178335
178384
|
init_plugin_identity();
|
|
178336
|
-
import { readFileSync as
|
|
178385
|
+
import { readFileSync as readFileSync38 } from "fs";
|
|
178337
178386
|
import { join as join44 } from "path";
|
|
178338
178387
|
var PROJECT_CONFIG_DIR = join44(process.cwd(), ".opencode");
|
|
178339
178388
|
function loadOmoConfig() {
|
|
@@ -178343,7 +178392,7 @@ function loadOmoConfig() {
|
|
|
178343
178392
|
});
|
|
178344
178393
|
if (projectDetected.format !== "none") {
|
|
178345
178394
|
try {
|
|
178346
|
-
const content =
|
|
178395
|
+
const content = readFileSync38(projectDetected.path, "utf-8");
|
|
178347
178396
|
return parseJsonc(content);
|
|
178348
178397
|
} catch (error51) {
|
|
178349
178398
|
if (error51 instanceof Error) {
|
|
@@ -178359,7 +178408,7 @@ function loadOmoConfig() {
|
|
|
178359
178408
|
});
|
|
178360
178409
|
if (userDetected.format !== "none") {
|
|
178361
178410
|
try {
|
|
178362
|
-
const content =
|
|
178411
|
+
const content = readFileSync38(userDetected.path, "utf-8");
|
|
178363
178412
|
return parseJsonc(content);
|
|
178364
178413
|
} catch (error51) {
|
|
178365
178414
|
if (error51 instanceof Error) {
|
|
@@ -178940,13 +178989,13 @@ async function getGhCliInfo(dependencies = {}) {
|
|
|
178940
178989
|
}
|
|
178941
178990
|
|
|
178942
178991
|
// packages/omo-opencode/src/cli/doctor/checks/tools-lsp.ts
|
|
178943
|
-
import { readFileSync as
|
|
178992
|
+
import { readFileSync as readFileSync40 } from "fs";
|
|
178944
178993
|
import { join as join48 } from "path";
|
|
178945
178994
|
|
|
178946
178995
|
// packages/omo-opencode/src/mcp/lsp.ts
|
|
178947
178996
|
init_zod();
|
|
178948
178997
|
init_opencode_config_dir();
|
|
178949
|
-
import { existsSync as existsSync52, readFileSync as
|
|
178998
|
+
import { existsSync as existsSync52, readFileSync as readFileSync39 } from "fs";
|
|
178950
178999
|
import { delimiter as delimiter3, dirname as dirname21, resolve as resolve10 } from "path";
|
|
178951
179000
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
178952
179001
|
|
|
@@ -178960,7 +179009,7 @@ function hasCliSuffix(candidatePath, suffix) {
|
|
|
178960
179009
|
|
|
178961
179010
|
// packages/omo-opencode/src/mcp/runtime-executable.ts
|
|
178962
179011
|
init_bun_which_shim();
|
|
178963
|
-
import { basename as
|
|
179012
|
+
import { basename as basename7 } from "path";
|
|
178964
179013
|
var NODE_EXECUTABLE_NAMES = new Set(["node", "node.exe"]);
|
|
178965
179014
|
function isUnsafeCommandName2(commandName) {
|
|
178966
179015
|
if (commandName.length === 0)
|
|
@@ -178976,7 +179025,7 @@ function isUnsafeCommandName2(commandName) {
|
|
|
178976
179025
|
return false;
|
|
178977
179026
|
}
|
|
178978
179027
|
function isNodeExecPath(execPath) {
|
|
178979
|
-
return NODE_EXECUTABLE_NAMES.has(
|
|
179028
|
+
return NODE_EXECUTABLE_NAMES.has(basename7(execPath).toLowerCase());
|
|
178980
179029
|
}
|
|
178981
179030
|
function resolveRuntimeExecutable(commandName, options = {}) {
|
|
178982
179031
|
if (isUnsafeCommandName2(commandName)) {
|
|
@@ -179090,7 +179139,7 @@ function findBootstrapRoot(candidates, pathExists) {
|
|
|
179090
179139
|
}
|
|
179091
179140
|
function readDaemonPackageVersion(root) {
|
|
179092
179141
|
try {
|
|
179093
|
-
const packageJson = JSON.parse(
|
|
179142
|
+
const packageJson = JSON.parse(readFileSync39(resolve10(root, PACKAGE_REL, "package.json"), "utf-8"));
|
|
179094
179143
|
return DaemonPackageSchema.parse(packageJson).version;
|
|
179095
179144
|
} catch (error51) {
|
|
179096
179145
|
if (!(error51 instanceof Error))
|
|
@@ -179167,7 +179216,7 @@ function readOmoConfig(configDirectory) {
|
|
|
179167
179216
|
return null;
|
|
179168
179217
|
}
|
|
179169
179218
|
try {
|
|
179170
|
-
const content =
|
|
179219
|
+
const content = readFileSync40(detected.path, "utf-8");
|
|
179171
179220
|
return parseJsonc(content);
|
|
179172
179221
|
} catch (error51) {
|
|
179173
179222
|
if (!(error51 instanceof Error)) {
|
|
@@ -179197,7 +179246,7 @@ function getInstalledLspServers(options = {}) {
|
|
|
179197
179246
|
|
|
179198
179247
|
// packages/omo-opencode/src/cli/doctor/checks/tools-mcp.ts
|
|
179199
179248
|
init_shared();
|
|
179200
|
-
import { existsSync as existsSync53, readFileSync as
|
|
179249
|
+
import { existsSync as existsSync53, readFileSync as readFileSync41 } from "fs";
|
|
179201
179250
|
import { homedir as homedir18 } from "os";
|
|
179202
179251
|
import { join as join49 } from "path";
|
|
179203
179252
|
var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
|
|
@@ -179214,7 +179263,7 @@ function loadUserMcpConfig() {
|
|
|
179214
179263
|
if (!existsSync53(configPath))
|
|
179215
179264
|
continue;
|
|
179216
179265
|
try {
|
|
179217
|
-
const content =
|
|
179266
|
+
const content = readFileSync41(configPath, "utf-8");
|
|
179218
179267
|
const config5 = parseJsonc(content);
|
|
179219
179268
|
if (config5.mcpServers) {
|
|
179220
179269
|
Object.assign(servers, config5.mcpServers);
|
|
@@ -179349,7 +179398,7 @@ async function checkTools() {
|
|
|
179349
179398
|
}
|
|
179350
179399
|
|
|
179351
179400
|
// packages/omo-opencode/src/cli/doctor/checks/telemetry.ts
|
|
179352
|
-
import { existsSync as existsSync54, readFileSync as
|
|
179401
|
+
import { existsSync as existsSync54, readFileSync as readFileSync42 } from "fs";
|
|
179353
179402
|
init_constants5();
|
|
179354
179403
|
function isTelemetryState(value) {
|
|
179355
179404
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
@@ -179360,7 +179409,7 @@ function readLastActiveDay(stateFilePath) {
|
|
|
179360
179409
|
}
|
|
179361
179410
|
let parsed;
|
|
179362
179411
|
try {
|
|
179363
|
-
parsed = JSON.parse(
|
|
179412
|
+
parsed = JSON.parse(readFileSync42(stateFilePath, "utf-8"));
|
|
179364
179413
|
} catch (error51) {
|
|
179365
179414
|
if (error51 instanceof Error) {
|
|
179366
179415
|
return "unreadable";
|
|
@@ -179436,7 +179485,7 @@ function expandHomeDirectory(directoryPath) {
|
|
|
179436
179485
|
init_constants5();
|
|
179437
179486
|
init_shared();
|
|
179438
179487
|
init_plugin_identity();
|
|
179439
|
-
import { readFileSync as
|
|
179488
|
+
import { readFileSync as readFileSync43, promises as fs15 } from "fs";
|
|
179440
179489
|
import path15 from "path";
|
|
179441
179490
|
async function checkTeamMode() {
|
|
179442
179491
|
const config5 = loadTeamModeConfig();
|
|
@@ -179473,7 +179522,7 @@ function loadTeamModeConfig() {
|
|
|
179473
179522
|
if (!configPath)
|
|
179474
179523
|
return { team_mode: undefined };
|
|
179475
179524
|
try {
|
|
179476
|
-
return parseJsonc(
|
|
179525
|
+
return parseJsonc(readFileSync43(configPath, "utf-8"));
|
|
179477
179526
|
} catch (error51) {
|
|
179478
179527
|
if (error51 instanceof Error) {
|
|
179479
179528
|
return { team_mode: undefined };
|
|
@@ -179914,12 +179963,12 @@ import {
|
|
|
179914
179963
|
existsSync as existsSync57,
|
|
179915
179964
|
mkdirSync as mkdirSync16,
|
|
179916
179965
|
readdirSync as readdirSync9,
|
|
179917
|
-
readFileSync as
|
|
179966
|
+
readFileSync as readFileSync45,
|
|
179918
179967
|
renameSync as renameSync7,
|
|
179919
179968
|
unlinkSync as unlinkSync9,
|
|
179920
179969
|
writeFileSync as writeFileSync14
|
|
179921
179970
|
} from "fs";
|
|
179922
|
-
import { basename as
|
|
179971
|
+
import { basename as basename8, dirname as dirname22, join as join52 } from "path";
|
|
179923
179972
|
|
|
179924
179973
|
// packages/mcp-client-core/src/config-dir.ts
|
|
179925
179974
|
import { existsSync as existsSync55, realpathSync as realpathSync7 } from "fs";
|
|
@@ -179947,7 +179996,7 @@ function getOpenCodeCliConfigDir(env2 = process.env) {
|
|
|
179947
179996
|
}
|
|
179948
179997
|
|
|
179949
179998
|
// packages/mcp-client-core/src/mcp-oauth/storage-index.ts
|
|
179950
|
-
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";
|
|
179951
180000
|
import { join as join51 } from "path";
|
|
179952
180001
|
var INDEX_FILE_NAME = "index.json";
|
|
179953
180002
|
function isTokenIndex(value) {
|
|
@@ -179963,7 +180012,7 @@ function readTokenIndex(storageDir) {
|
|
|
179963
180012
|
if (!existsSync56(indexPath))
|
|
179964
180013
|
return {};
|
|
179965
180014
|
try {
|
|
179966
|
-
const parsed = JSON.parse(
|
|
180015
|
+
const parsed = JSON.parse(readFileSync44(indexPath, "utf-8"));
|
|
179967
180016
|
return isTokenIndex(parsed) ? parsed : {};
|
|
179968
180017
|
} catch (readError) {
|
|
179969
180018
|
if (!(readError instanceof Error))
|
|
@@ -180073,7 +180122,7 @@ function readTokenFile(filePath) {
|
|
|
180073
180122
|
if (!existsSync57(filePath))
|
|
180074
180123
|
return null;
|
|
180075
180124
|
try {
|
|
180076
|
-
const parsed = JSON.parse(
|
|
180125
|
+
const parsed = JSON.parse(readFileSync45(filePath, "utf-8"));
|
|
180077
180126
|
return isOAuthTokenData(parsed) ? parsed : null;
|
|
180078
180127
|
} catch (readError) {
|
|
180079
180128
|
if (!(readError instanceof Error))
|
|
@@ -180086,7 +180135,7 @@ function readLegacyStore() {
|
|
|
180086
180135
|
if (!existsSync57(filePath))
|
|
180087
180136
|
return null;
|
|
180088
180137
|
try {
|
|
180089
|
-
const parsed = JSON.parse(
|
|
180138
|
+
const parsed = JSON.parse(readFileSync45(filePath, "utf-8"));
|
|
180090
180139
|
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed))
|
|
180091
180140
|
return null;
|
|
180092
180141
|
const result = {};
|
|
@@ -180204,7 +180253,7 @@ function listAllTokens() {
|
|
|
180204
180253
|
if (!entry.isFile() || !entry.name.endsWith(".json") || entry.name === "index.json")
|
|
180205
180254
|
continue;
|
|
180206
180255
|
const token = readTokenFile(join52(dir, entry.name));
|
|
180207
|
-
const hash2 =
|
|
180256
|
+
const hash2 = basename8(entry.name, ".json");
|
|
180208
180257
|
if (token)
|
|
180209
180258
|
result[index[hash2] ?? hash2] = token;
|
|
180210
180259
|
}
|
|
@@ -180899,7 +180948,7 @@ function createEmbeddingPort() {
|
|
|
180899
180948
|
// packages/learning-loop/src/codebase-scanner.ts
|
|
180900
180949
|
var import_picomatch = __toESM(require_picomatch2(), 1);
|
|
180901
180950
|
import { createHash as createHash5 } from "crypto";
|
|
180902
|
-
import { readdirSync as readdirSync10, readFileSync as
|
|
180951
|
+
import { readdirSync as readdirSync10, readFileSync as readFileSync47, statSync as statSync7, existsSync as existsSync59 } from "fs";
|
|
180903
180952
|
import { join as join53, relative as relative6, extname as extname3 } from "path";
|
|
180904
180953
|
var EXT_TO_LANG = {
|
|
180905
180954
|
ts: "typescript",
|
|
@@ -180967,7 +181016,7 @@ function defaultFs() {
|
|
|
180967
181016
|
return readdirSync10(path18);
|
|
180968
181017
|
},
|
|
180969
181018
|
readFile(path18) {
|
|
180970
|
-
return
|
|
181019
|
+
return readFileSync47(path18, "utf-8");
|
|
180971
181020
|
},
|
|
180972
181021
|
stat(path18) {
|
|
180973
181022
|
const s = statSync7(path18);
|
|
@@ -181320,8 +181369,8 @@ function formatSearchResults(result) {
|
|
|
181320
181369
|
}
|
|
181321
181370
|
|
|
181322
181371
|
// packages/learning-loop/src/improvement.ts
|
|
181323
|
-
import { existsSync as existsSync60, mkdirSync as mkdirSync18, readFileSync as
|
|
181324
|
-
import { join as join54, basename as
|
|
181372
|
+
import { existsSync as existsSync60, mkdirSync as mkdirSync18, readFileSync as readFileSync48, writeFileSync as writeFileSync16 } from "fs";
|
|
181373
|
+
import { join as join54, basename as basename10 } from "path";
|
|
181325
181374
|
function createImprovementStore(improvementsDir) {
|
|
181326
181375
|
if (!existsSync60(improvementsDir)) {
|
|
181327
181376
|
mkdirSync18(improvementsDir, { recursive: true });
|
|
@@ -181342,12 +181391,12 @@ function createImprovementStore(improvementsDir) {
|
|
|
181342
181391
|
return [];
|
|
181343
181392
|
}
|
|
181344
181393
|
files.sort().reverse();
|
|
181345
|
-
return files.map((f2) => get(
|
|
181394
|
+
return files.map((f2) => get(basename10(f2, ".json"))).filter((i3) => i3 !== null);
|
|
181346
181395
|
}
|
|
181347
181396
|
function get(id) {
|
|
181348
181397
|
const filePath = join54(improvementsDir, `${id}.json`);
|
|
181349
181398
|
try {
|
|
181350
|
-
const raw =
|
|
181399
|
+
const raw = readFileSync48(filePath, "utf-8");
|
|
181351
181400
|
return JSON.parse(raw);
|
|
181352
181401
|
} catch {
|
|
181353
181402
|
return null;
|
|
@@ -182166,7 +182215,7 @@ function getClaudeConfigDir() {
|
|
|
182166
182215
|
return join57(getHomeDirectory(), ".claude");
|
|
182167
182216
|
}
|
|
182168
182217
|
// packages/skills-loader-core/src/shared/opencode-command-dirs.ts
|
|
182169
|
-
import { basename as
|
|
182218
|
+
import { basename as basename11, dirname as dirname23, join as join59 } from "path";
|
|
182170
182219
|
|
|
182171
182220
|
// packages/skills-loader-core/src/shared/opencode-config-dir.ts
|
|
182172
182221
|
import { existsSync as existsSync64, realpathSync as realpathSync8 } from "fs";
|
|
@@ -182301,7 +182350,7 @@ function getOpenCodeConfigDir2(options) {
|
|
|
182301
182350
|
// packages/skills-loader-core/src/shared/opencode-command-dirs.ts
|
|
182302
182351
|
function getParentOpencodeConfigDir(configDir) {
|
|
182303
182352
|
const parentDir = dirname23(configDir);
|
|
182304
|
-
if (
|
|
182353
|
+
if (basename11(parentDir) !== "profiles") {
|
|
182305
182354
|
return null;
|
|
182306
182355
|
}
|
|
182307
182356
|
return dirname23(parentDir);
|
|
@@ -182446,7 +182495,7 @@ import { join as join62 } from "path";
|
|
|
182446
182495
|
init_src();
|
|
182447
182496
|
init_src2();
|
|
182448
182497
|
import * as fs19 from "fs/promises";
|
|
182449
|
-
import { basename as
|
|
182498
|
+
import { basename as basename12 } from "path";
|
|
182450
182499
|
|
|
182451
182500
|
// packages/skills-loader-core/src/features/opencode-skill-loader/allowed-tools-parser.ts
|
|
182452
182501
|
function parseAllowedTools(allowedTools) {
|
|
@@ -182562,7 +182611,7 @@ $ARGUMENTS
|
|
|
182562
182611
|
}
|
|
182563
182612
|
}
|
|
182564
182613
|
function inferSkillNameFromFileName(filePath) {
|
|
182565
|
-
return
|
|
182614
|
+
return basename12(filePath, ".md");
|
|
182566
182615
|
}
|
|
182567
182616
|
|
|
182568
182617
|
// packages/skills-loader-core/src/features/opencode-skill-loader/skill-directory-loader.ts
|
|
@@ -183474,9 +183523,9 @@ playwright-cli close
|
|
|
183474
183523
|
// packages/skills-loader-core/src/features/builtin-skills/skill-file-loader.ts
|
|
183475
183524
|
init_shared_skills();
|
|
183476
183525
|
init_src();
|
|
183477
|
-
import { readFileSync as
|
|
183526
|
+
import { readFileSync as readFileSync51 } from "fs";
|
|
183478
183527
|
import { join as join64 } from "path";
|
|
183479
|
-
function createSharedSkillTemplateLoader(readFile3 =
|
|
183528
|
+
function createSharedSkillTemplateLoader(readFile3 = readFileSync51, skillsRootPath = sharedSkillsRootPath()) {
|
|
183480
183529
|
const cache = new Map;
|
|
183481
183530
|
return (skillName) => {
|
|
183482
183531
|
const cached2 = cache.get(skillName);
|
|
@@ -185836,7 +185885,7 @@ import {
|
|
|
185836
185885
|
existsSync as existsSync67,
|
|
185837
185886
|
mkdirSync as mkdirSync21,
|
|
185838
185887
|
copyFileSync as copyFileSync4,
|
|
185839
|
-
readFileSync as
|
|
185888
|
+
readFileSync as readFileSync52,
|
|
185840
185889
|
writeFileSync as writeFileSync19,
|
|
185841
185890
|
readdirSync as readdirSync11,
|
|
185842
185891
|
statSync as statSync8,
|
|
@@ -185853,7 +185902,7 @@ async function snapshotCli(options = {}) {
|
|
|
185853
185902
|
const realFs = {
|
|
185854
185903
|
existsSync: existsSync67,
|
|
185855
185904
|
mkdirSync: mkdirSync21,
|
|
185856
|
-
readFileSync:
|
|
185905
|
+
readFileSync: readFileSync52,
|
|
185857
185906
|
writeFileSync: writeFileSync19,
|
|
185858
185907
|
copyFileSync: copyFileSync4,
|
|
185859
185908
|
readdirSync: readdirSync11,
|
|
@@ -185919,7 +185968,7 @@ import {
|
|
|
185919
185968
|
existsSync as existsSync68,
|
|
185920
185969
|
mkdirSync as mkdirSync22,
|
|
185921
185970
|
copyFileSync as copyFileSync5,
|
|
185922
|
-
readFileSync as
|
|
185971
|
+
readFileSync as readFileSync53,
|
|
185923
185972
|
writeFileSync as writeFileSync20,
|
|
185924
185973
|
readdirSync as readdirSync12,
|
|
185925
185974
|
statSync as statSync9,
|
|
@@ -185932,7 +185981,7 @@ async function restoreCli(options) {
|
|
|
185932
185981
|
const realFs = {
|
|
185933
185982
|
existsSync: existsSync68,
|
|
185934
185983
|
mkdirSync: mkdirSync22,
|
|
185935
|
-
readFileSync:
|
|
185984
|
+
readFileSync: readFileSync53,
|
|
185936
185985
|
writeFileSync: writeFileSync20,
|
|
185937
185986
|
copyFileSync: copyFileSync5,
|
|
185938
185987
|
readdirSync: readdirSync12,
|
|
@@ -185947,7 +185996,7 @@ async function restoreCli(options) {
|
|
|
185947
185996
|
try {
|
|
185948
185997
|
restoreSnapshot(options.state, { snapshotDir, fs: realFs });
|
|
185949
185998
|
const manifestPath = path19.join(snapshotDir, options.state, "manifest.json");
|
|
185950
|
-
const raw =
|
|
185999
|
+
const raw = readFileSync53(manifestPath).toString("utf-8");
|
|
185951
186000
|
const parsed = JSON.parse(raw);
|
|
185952
186001
|
const fileCount = typeof parsed === "object" && parsed !== null && "files" in parsed && Array.isArray(parsed.files) ? parsed.files.length : 0;
|
|
185953
186002
|
if (options.json) {
|
|
@@ -185971,7 +186020,7 @@ import {
|
|
|
185971
186020
|
existsSync as existsSync69,
|
|
185972
186021
|
mkdirSync as mkdirSync23,
|
|
185973
186022
|
copyFileSync as copyFileSync6,
|
|
185974
|
-
readFileSync as
|
|
186023
|
+
readFileSync as readFileSync54,
|
|
185975
186024
|
writeFileSync as writeFileSync21,
|
|
185976
186025
|
readdirSync as readdirSync13,
|
|
185977
186026
|
statSync as statSync10,
|
|
@@ -185994,7 +186043,7 @@ async function snapshotListCli(options) {
|
|
|
185994
186043
|
const realFs = {
|
|
185995
186044
|
existsSync: existsSync69,
|
|
185996
186045
|
mkdirSync: mkdirSync23,
|
|
185997
|
-
readFileSync:
|
|
186046
|
+
readFileSync: readFileSync54,
|
|
185998
186047
|
writeFileSync: writeFileSync21,
|
|
185999
186048
|
copyFileSync: copyFileSync6,
|
|
186000
186049
|
readdirSync: readdirSync13,
|
|
@@ -186025,7 +186074,7 @@ import {
|
|
|
186025
186074
|
existsSync as existsSync70,
|
|
186026
186075
|
mkdirSync as mkdirSync24,
|
|
186027
186076
|
copyFileSync as copyFileSync7,
|
|
186028
|
-
readFileSync as
|
|
186077
|
+
readFileSync as readFileSync55,
|
|
186029
186078
|
writeFileSync as writeFileSync22,
|
|
186030
186079
|
readdirSync as readdirSync14,
|
|
186031
186080
|
statSync as statSync11,
|
|
@@ -186038,7 +186087,7 @@ async function snapshotPruneCli(options = {}) {
|
|
|
186038
186087
|
const realFs = {
|
|
186039
186088
|
existsSync: existsSync70,
|
|
186040
186089
|
mkdirSync: mkdirSync24,
|
|
186041
|
-
readFileSync:
|
|
186090
|
+
readFileSync: readFileSync55,
|
|
186042
186091
|
writeFileSync: writeFileSync22,
|
|
186043
186092
|
copyFileSync: copyFileSync7,
|
|
186044
186093
|
readdirSync: readdirSync14,
|
|
@@ -186559,7 +186608,7 @@ async function traceCli(sessionId, options = {}) {
|
|
|
186559
186608
|
|
|
186560
186609
|
// packages/omo-opencode/src/cli/dashboard.ts
|
|
186561
186610
|
import * as path25 from "path";
|
|
186562
|
-
import { readFileSync as
|
|
186611
|
+
import { readFileSync as readFileSync57 } from "fs";
|
|
186563
186612
|
|
|
186564
186613
|
// packages/omo-opencode/src/features/dashboard/data-provider.ts
|
|
186565
186614
|
import * as os12 from "os";
|
|
@@ -187294,7 +187343,7 @@ function loadGatewayPassphrase() {
|
|
|
187294
187343
|
try {
|
|
187295
187344
|
const configDir = getConfigDir();
|
|
187296
187345
|
const configPath = path25.join(configDir, "matrixos.jsonc");
|
|
187297
|
-
const raw =
|
|
187346
|
+
const raw = readFileSync57(configPath, "utf-8");
|
|
187298
187347
|
const config5 = parseJsonc(raw);
|
|
187299
187348
|
const dashboard2 = config5.dashboard;
|
|
187300
187349
|
return typeof dashboard2?.gatewayPassphrase === "string" ? dashboard2.gatewayPassphrase : undefined;
|
|
@@ -187890,8 +187939,8 @@ project.command("search <query>").description("Search the active project KB and
|
|
|
187890
187939
|
});
|
|
187891
187940
|
project.command("add-doc <slug> <file>").description("Copy a document into the project KB").action(async (slug, filePath) => {
|
|
187892
187941
|
const { addKbDocument: addKbDocument2 } = await Promise.resolve().then(() => (init_project_memory(), exports_project_memory));
|
|
187893
|
-
const { readFileSync:
|
|
187894
|
-
const content =
|
|
187942
|
+
const { readFileSync: readFileSync65 } = await import("fs");
|
|
187943
|
+
const content = readFileSync65(filePath, "utf-8");
|
|
187895
187944
|
const dest = addKbDocument2(slug, filePath, content);
|
|
187896
187945
|
process.stdout.write(JSON.stringify({ ok: true, dest }, null, 2) + `
|
|
187897
187946
|
`);
|