@kl-c/matrixos 0.3.4 → 0.3.5
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 +103 -84
- package/dist/cli/slash-commands/features.md +2 -1
- package/dist/cli-node/index.js +103 -84
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -2163,7 +2163,7 @@ var package_default;
|
|
|
2163
2163
|
var init_package = __esm(() => {
|
|
2164
2164
|
package_default = {
|
|
2165
2165
|
name: "@kl-c/matrixos",
|
|
2166
|
-
version: "0.3.
|
|
2166
|
+
version: "0.3.5",
|
|
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",
|
|
@@ -66376,8 +66376,18 @@ var init_model_fallback = __esm(() => {
|
|
|
66376
66376
|
});
|
|
66377
66377
|
|
|
66378
66378
|
// packages/omo-opencode/src/cli/config-manager/generate-omo-config.ts
|
|
66379
|
+
function randomPassphrase() {
|
|
66380
|
+
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
66381
|
+
let out = "";
|
|
66382
|
+
for (let i2 = 0;i2 < 32; i2++)
|
|
66383
|
+
out += chars.charAt(Math.floor(Math.random() * chars.length));
|
|
66384
|
+
return out;
|
|
66385
|
+
}
|
|
66379
66386
|
function generateOmoConfig(installConfig) {
|
|
66380
66387
|
const config = generateModelConfig(installConfig);
|
|
66388
|
+
config.dashboard = {
|
|
66389
|
+
gatewayPassphrase: randomPassphrase()
|
|
66390
|
+
};
|
|
66381
66391
|
if (installConfig.gatewayTelegram) {
|
|
66382
66392
|
config.gateway = {
|
|
66383
66393
|
enabled: true,
|
|
@@ -69995,6 +70005,7 @@ var init_tui_install_prompts = __esm(() => {
|
|
|
69995
70005
|
});
|
|
69996
70006
|
|
|
69997
70007
|
// packages/omo-opencode/src/cli/tui-installer.ts
|
|
70008
|
+
import { readFileSync as readFileSync17 } from "fs";
|
|
69998
70009
|
async function runTuiInstaller(args, version) {
|
|
69999
70010
|
if (!process.stdin.isTTY || !process.stdout.isTTY) {
|
|
70000
70011
|
console.error("Error: Interactive installer requires a TTY. Use --non-interactive or set environment variables directly.");
|
|
@@ -70075,6 +70086,14 @@ async function runTuiInstaller(args, version) {
|
|
|
70075
70086
|
return 1;
|
|
70076
70087
|
}
|
|
70077
70088
|
spinner2.stop(`Config written to ${import_picocolors4.default.cyan(omoResult.configPath)}`);
|
|
70089
|
+
try {
|
|
70090
|
+
const written = parseJsonc(readFileSync17(omoResult.configPath, "utf-8"));
|
|
70091
|
+
const dash = written.dashboard;
|
|
70092
|
+
if (typeof dash?.gatewayPassphrase === "string") {
|
|
70093
|
+
log4.success(`Dashboard gateway passphrase: ${import_picocolors4.default.bold(dash.gatewayPassphrase)}`);
|
|
70094
|
+
log4.info(`Save it \u2014 needed to set Telegram/Discord tokens in the dashboard at http://127.0.0.1:9123`);
|
|
70095
|
+
}
|
|
70096
|
+
} catch {}
|
|
70078
70097
|
if (config.gatewayTelegram && config.gatewayTelegramToken) {
|
|
70079
70098
|
try {
|
|
70080
70099
|
const envPath = writeGatewayEnv(config.gatewayTelegramToken);
|
|
@@ -154560,7 +154579,7 @@ var require_filesystem = __commonJS((exports2, module2) => {
|
|
|
154560
154579
|
var LDD_PATH = "/usr/bin/ldd";
|
|
154561
154580
|
var SELF_PATH = "/proc/self/exe";
|
|
154562
154581
|
var MAX_LENGTH = 2048;
|
|
154563
|
-
var
|
|
154582
|
+
var readFileSync48 = (path18) => {
|
|
154564
154583
|
const fd = fs18.openSync(path18, "r");
|
|
154565
154584
|
const buffer = Buffer.alloc(MAX_LENGTH);
|
|
154566
154585
|
const bytesRead = fs18.readSync(fd, buffer, 0, MAX_LENGTH, 0);
|
|
@@ -154583,7 +154602,7 @@ var require_filesystem = __commonJS((exports2, module2) => {
|
|
|
154583
154602
|
module2.exports = {
|
|
154584
154603
|
LDD_PATH,
|
|
154585
154604
|
SELF_PATH,
|
|
154586
|
-
readFileSync:
|
|
154605
|
+
readFileSync: readFileSync48,
|
|
154587
154606
|
readFile
|
|
154588
154607
|
};
|
|
154589
154608
|
});
|
|
@@ -154626,7 +154645,7 @@ var require_elf = __commonJS((exports2, module2) => {
|
|
|
154626
154645
|
var require_detect_libc = __commonJS((exports2, module2) => {
|
|
154627
154646
|
var childProcess = __require("child_process");
|
|
154628
154647
|
var { isLinux, getReport } = require_process();
|
|
154629
|
-
var { LDD_PATH, SELF_PATH, readFile, readFileSync:
|
|
154648
|
+
var { LDD_PATH, SELF_PATH, readFile, readFileSync: readFileSync48 } = require_filesystem();
|
|
154630
154649
|
var { interpreterPath } = require_elf();
|
|
154631
154650
|
var cachedFamilyInterpreter;
|
|
154632
154651
|
var cachedFamilyFilesystem;
|
|
@@ -154717,7 +154736,7 @@ var require_detect_libc = __commonJS((exports2, module2) => {
|
|
|
154717
154736
|
}
|
|
154718
154737
|
cachedFamilyFilesystem = null;
|
|
154719
154738
|
try {
|
|
154720
|
-
const lddContent =
|
|
154739
|
+
const lddContent = readFileSync48(LDD_PATH);
|
|
154721
154740
|
cachedFamilyFilesystem = getFamilyFromLddContent(lddContent);
|
|
154722
154741
|
} catch (e) {}
|
|
154723
154742
|
return cachedFamilyFilesystem;
|
|
@@ -154740,7 +154759,7 @@ var require_detect_libc = __commonJS((exports2, module2) => {
|
|
|
154740
154759
|
}
|
|
154741
154760
|
cachedFamilyInterpreter = null;
|
|
154742
154761
|
try {
|
|
154743
|
-
const selfContent =
|
|
154762
|
+
const selfContent = readFileSync48(SELF_PATH);
|
|
154744
154763
|
const path18 = interpreterPath(selfContent);
|
|
154745
154764
|
cachedFamilyInterpreter = familyFromInterpreterPath(path18);
|
|
154746
154765
|
} catch (e) {}
|
|
@@ -154802,7 +154821,7 @@ var require_detect_libc = __commonJS((exports2, module2) => {
|
|
|
154802
154821
|
}
|
|
154803
154822
|
cachedVersionFilesystem = null;
|
|
154804
154823
|
try {
|
|
154805
|
-
const lddContent =
|
|
154824
|
+
const lddContent = readFileSync48(LDD_PATH);
|
|
154806
154825
|
const versionMatch = lddContent.match(RE_GLIBC_VERSION);
|
|
154807
154826
|
if (versionMatch) {
|
|
154808
154827
|
cachedVersionFilesystem = versionMatch[1];
|
|
@@ -164963,7 +164982,7 @@ __export(exports_generate, {
|
|
|
164963
164982
|
executeGenerateCommand: () => executeGenerateCommand,
|
|
164964
164983
|
ProfileNotFoundError: () => ProfileNotFoundError
|
|
164965
164984
|
});
|
|
164966
|
-
import { existsSync as existsSync72, readFileSync as
|
|
164985
|
+
import { existsSync as existsSync72, readFileSync as readFileSync59, realpathSync as realpathSync10 } from "fs";
|
|
164967
164986
|
import { dirname as dirname29, isAbsolute as isAbsolute6, join as join77, resolve as resolve16 } from "path";
|
|
164968
164987
|
function profilesDirFor(opts) {
|
|
164969
164988
|
if (opts.profilesDir)
|
|
@@ -165061,7 +165080,7 @@ var init_generate = __esm(() => {
|
|
|
165061
165080
|
init_src5();
|
|
165062
165081
|
init_src5();
|
|
165063
165082
|
REPO_ROOT = resolve16(dirname29(new URL(import.meta.url).pathname), "..", "..", "..", "..", "..");
|
|
165064
|
-
defaultFS2 = { existsSync: existsSync72, readFileSync:
|
|
165083
|
+
defaultFS2 = { existsSync: existsSync72, readFileSync: readFileSync59, realpathSync: realpathSync10 };
|
|
165065
165084
|
ProfileNotFoundError = class ProfileNotFoundError extends Error {
|
|
165066
165085
|
profileName;
|
|
165067
165086
|
constructor(profileName) {
|
|
@@ -165315,7 +165334,7 @@ var exports_profile_resolve = {};
|
|
|
165315
165334
|
__export(exports_profile_resolve, {
|
|
165316
165335
|
executeProfileResolveCommand: () => executeProfileResolveCommand
|
|
165317
165336
|
});
|
|
165318
|
-
import { existsSync as existsSync74, readdirSync as readdirSync16, readFileSync as
|
|
165337
|
+
import { existsSync as existsSync74, readdirSync as readdirSync16, readFileSync as readFileSync60 } from "fs";
|
|
165319
165338
|
import { join as join80, resolve as resolve17, dirname as dirname30 } from "path";
|
|
165320
165339
|
function executeProfileResolveCommand(args) {
|
|
165321
165340
|
if (args.options.help) {
|
|
@@ -165362,7 +165381,7 @@ function executeProfileResolveCommand(args) {
|
|
|
165362
165381
|
for (const file3 of profileFiles) {
|
|
165363
165382
|
try {
|
|
165364
165383
|
const filePath = join80(profilesDir, file3);
|
|
165365
|
-
const raw = JSON.parse(
|
|
165384
|
+
const raw = JSON.parse(readFileSync60(filePath, "utf-8"));
|
|
165366
165385
|
const profile2 = ProfileSchema.parse(raw);
|
|
165367
165386
|
registry2[profile2.name] = profile2;
|
|
165368
165387
|
} catch {}
|
|
@@ -165424,7 +165443,7 @@ __export(exports_export, {
|
|
|
165424
165443
|
getShell: () => getShell,
|
|
165425
165444
|
executeExportCommand: () => executeExportCommand
|
|
165426
165445
|
});
|
|
165427
|
-
import { existsSync as existsSync75, readFileSync as
|
|
165446
|
+
import { existsSync as existsSync75, readFileSync as readFileSync61, writeFileSync as writeFileSync26, copyFileSync as copyFileSync8, realpathSync as realpathSync11, mkdirSync as mkdirSync27 } from "fs";
|
|
165428
165447
|
import { isAbsolute as isAbsolute7, join as join81, resolve as resolve18, dirname as dirname31 } from "path";
|
|
165429
165448
|
import { spawnSync as spawnSync4 } from "child_process";
|
|
165430
165449
|
function setShell(shell) {
|
|
@@ -165548,7 +165567,7 @@ var init_export = __esm(() => {
|
|
|
165548
165567
|
activeShell = defaultShell;
|
|
165549
165568
|
defaultExportFS = {
|
|
165550
165569
|
existsSync: existsSync75,
|
|
165551
|
-
readFileSync:
|
|
165570
|
+
readFileSync: readFileSync61,
|
|
165552
165571
|
writeFileSync: writeFileSync26,
|
|
165553
165572
|
copyFileSync: copyFileSync8,
|
|
165554
165573
|
realpathSync: realpathSync11,
|
|
@@ -165576,7 +165595,7 @@ __export(exports_project_context, {
|
|
|
165576
165595
|
createProject: () => createProject,
|
|
165577
165596
|
archiveProject: () => archiveProject
|
|
165578
165597
|
});
|
|
165579
|
-
import { existsSync as existsSync76, mkdirSync as mkdirSync28, readFileSync as
|
|
165598
|
+
import { existsSync as existsSync76, mkdirSync as mkdirSync28, readFileSync as readFileSync62, writeFileSync as writeFileSync27, rmSync as rmSync8 } from "fs";
|
|
165580
165599
|
import { join as join82 } from "path";
|
|
165581
165600
|
function getMatrixOsDir(cwd = process.cwd()) {
|
|
165582
165601
|
return join82(cwd, ".matrixos");
|
|
@@ -165595,7 +165614,7 @@ function loadState(cwd) {
|
|
|
165595
165614
|
if (!existsSync76(path29))
|
|
165596
165615
|
return {};
|
|
165597
165616
|
try {
|
|
165598
|
-
return JSON.parse(
|
|
165617
|
+
return JSON.parse(readFileSync62(path29, "utf-8"));
|
|
165599
165618
|
} catch {
|
|
165600
165619
|
return {};
|
|
165601
165620
|
}
|
|
@@ -165611,7 +165630,7 @@ function loadProjectMeta(slug, cwd) {
|
|
|
165611
165630
|
if (!existsSync76(path29))
|
|
165612
165631
|
return null;
|
|
165613
165632
|
try {
|
|
165614
|
-
return JSON.parse(
|
|
165633
|
+
return JSON.parse(readFileSync62(path29, "utf-8"));
|
|
165615
165634
|
} catch {
|
|
165616
165635
|
return null;
|
|
165617
165636
|
}
|
|
@@ -165737,7 +165756,7 @@ __export(exports_project_memory, {
|
|
|
165737
165756
|
isProjectEpisode: () => isProjectEpisode,
|
|
165738
165757
|
addKbDocument: () => addKbDocument
|
|
165739
165758
|
});
|
|
165740
|
-
import { existsSync as existsSync77, mkdirSync as mkdirSync29, readFileSync as
|
|
165759
|
+
import { existsSync as existsSync77, mkdirSync as mkdirSync29, readFileSync as readFileSync63, readdirSync as readdirSync17, writeFileSync as writeFileSync28 } from "fs";
|
|
165741
165760
|
import { join as join83 } from "path";
|
|
165742
165761
|
function tagWithProject(metadata = {}, projectSlug, cwd) {
|
|
165743
165762
|
const active = projectSlug ?? getActiveProject(cwd)?.slug;
|
|
@@ -165761,7 +165780,7 @@ function listKbDocuments(projectSlug, cwd) {
|
|
|
165761
165780
|
continue;
|
|
165762
165781
|
const path29 = join83(kbDir, entry.name);
|
|
165763
165782
|
try {
|
|
165764
|
-
docs.push({ path: path29, content:
|
|
165783
|
+
docs.push({ path: path29, content: readFileSync63(path29, "utf-8") });
|
|
165765
165784
|
} catch {}
|
|
165766
165785
|
}
|
|
165767
165786
|
return docs;
|
|
@@ -166183,12 +166202,12 @@ __export(exports_gateway_start, {
|
|
|
166183
166202
|
buildTelegramConfig: () => buildTelegramConfig,
|
|
166184
166203
|
buildGatewayConfig: () => buildGatewayConfig
|
|
166185
166204
|
});
|
|
166186
|
-
import { readFileSync as
|
|
166205
|
+
import { readFileSync as readFileSync64, existsSync as existsSync78 } from "fs";
|
|
166187
166206
|
import { resolve as resolve19 } from "path";
|
|
166188
166207
|
function loadGatewayEnv(path29 = ENV_PATH) {
|
|
166189
166208
|
if (!existsSync78(path29))
|
|
166190
166209
|
return {};
|
|
166191
|
-
const text =
|
|
166210
|
+
const text = readFileSync64(path29, "utf8");
|
|
166192
166211
|
const out = {};
|
|
166193
166212
|
for (const raw of text.split(/\r?\n/)) {
|
|
166194
166213
|
const line = raw.trim();
|
|
@@ -166658,7 +166677,7 @@ var init_deployment = __esm(() => {
|
|
|
166658
166677
|
});
|
|
166659
166678
|
|
|
166660
166679
|
// packages/omo-opencode/src/audit/self-audit.ts
|
|
166661
|
-
import { existsSync as existsSync80, mkdirSync as mkdirSync30, readdirSync as readdirSync18, readFileSync as
|
|
166680
|
+
import { existsSync as existsSync80, mkdirSync as mkdirSync30, readdirSync as readdirSync18, readFileSync as readFileSync65, writeFileSync as writeFileSync29 } from "fs";
|
|
166662
166681
|
import { join as join84 } from "path";
|
|
166663
166682
|
function getAuditDir(cwd = process.cwd()) {
|
|
166664
166683
|
return join84(cwd, ".matrixos", "audits");
|
|
@@ -169312,7 +169331,7 @@ var BOULDER_STATE_PATH = `${BOULDER_DIR}/${BOULDER_FILE}`;
|
|
|
169312
169331
|
var NOTEPAD_DIR = "notepads";
|
|
169313
169332
|
var NOTEPAD_BASE_PATH = `${BOULDER_DIR}/${NOTEPAD_DIR}`;
|
|
169314
169333
|
// packages/boulder-state/src/top-level-task.ts
|
|
169315
|
-
import { existsSync as existsSync32, readFileSync as
|
|
169334
|
+
import { existsSync as existsSync32, readFileSync as readFileSync20 } from "fs";
|
|
169316
169335
|
var TODO_HEADING_PATTERN = /^##\s+TODOs\b/i;
|
|
169317
169336
|
var FINAL_VERIFICATION_HEADING_PATTERN = /^##\s+Final Verification Wave\b/i;
|
|
169318
169337
|
var SECOND_LEVEL_HEADING_PATTERN = /^##\s+/;
|
|
@@ -169339,7 +169358,7 @@ function readCurrentTopLevelTask(planPath) {
|
|
|
169339
169358
|
return null;
|
|
169340
169359
|
}
|
|
169341
169360
|
try {
|
|
169342
|
-
const content =
|
|
169361
|
+
const content = readFileSync20(planPath, "utf-8");
|
|
169343
169362
|
const lines = content.split(/\r?\n/);
|
|
169344
169363
|
let section = "other";
|
|
169345
169364
|
for (const line of lines) {
|
|
@@ -169391,7 +169410,7 @@ function resolveBoulderPlanPathForWork(directory, work) {
|
|
|
169391
169410
|
return resolveBoulderPlanPath(directory, work);
|
|
169392
169411
|
}
|
|
169393
169412
|
// packages/boulder-state/src/storage/plan-progress.ts
|
|
169394
|
-
import { existsSync as existsSync34, readFileSync as
|
|
169413
|
+
import { existsSync as existsSync34, readFileSync as readFileSync21, readdirSync as readdirSync5, statSync as statSync5 } from "fs";
|
|
169395
169414
|
var TODO_HEADING_PATTERN2 = /^##\s+TODOs\b/i;
|
|
169396
169415
|
var FINAL_VERIFICATION_HEADING_PATTERN2 = /^##\s+Final Verification Wave\b/i;
|
|
169397
169416
|
var SECOND_LEVEL_HEADING_PATTERN2 = /^##\s+/;
|
|
@@ -169404,7 +169423,7 @@ function getPlanProgress(planPath) {
|
|
|
169404
169423
|
return { total: 0, completed: 0, isComplete: false };
|
|
169405
169424
|
}
|
|
169406
169425
|
try {
|
|
169407
|
-
const content =
|
|
169426
|
+
const content = readFileSync21(planPath, "utf-8");
|
|
169408
169427
|
const lines = content.split(/\r?\n/);
|
|
169409
169428
|
const hasStructuredSections = lines.some((line) => TODO_HEADING_PATTERN2.test(line) || FINAL_VERIFICATION_HEADING_PATTERN2.test(line));
|
|
169410
169429
|
if (hasStructuredSections) {
|
|
@@ -169520,14 +169539,14 @@ function selectMirrorWork(state) {
|
|
|
169520
169539
|
return sorted[0] ?? null;
|
|
169521
169540
|
}
|
|
169522
169541
|
// packages/boulder-state/src/storage/read-state.ts
|
|
169523
|
-
import { existsSync as existsSync35, readFileSync as
|
|
169542
|
+
import { existsSync as existsSync35, readFileSync as readFileSync22 } from "fs";
|
|
169524
169543
|
function readBoulderState(directory) {
|
|
169525
169544
|
const filePath = getBoulderFilePath(directory);
|
|
169526
169545
|
if (!existsSync35(filePath)) {
|
|
169527
169546
|
return null;
|
|
169528
169547
|
}
|
|
169529
169548
|
try {
|
|
169530
|
-
const content =
|
|
169549
|
+
const content = readFileSync22(filePath, "utf-8");
|
|
169531
169550
|
const parsed = JSON.parse(content);
|
|
169532
169551
|
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
169533
169552
|
return null;
|
|
@@ -169593,7 +169612,7 @@ init_state();
|
|
|
169593
169612
|
// packages/omo-opencode/src/features/run-continuation-state/constants.ts
|
|
169594
169613
|
var CONTINUATION_MARKER_DIR = ".omo/run-continuation";
|
|
169595
169614
|
// packages/omo-opencode/src/features/run-continuation-state/storage.ts
|
|
169596
|
-
import { existsSync as existsSync36, mkdirSync as mkdirSync12, readFileSync as
|
|
169615
|
+
import { existsSync as existsSync36, mkdirSync as mkdirSync12, readFileSync as readFileSync23, rmSync as rmSync2, writeFileSync as writeFileSync9 } from "fs";
|
|
169597
169616
|
import { join as join31 } from "path";
|
|
169598
169617
|
function getMarkerPath(directory, sessionID) {
|
|
169599
169618
|
return join31(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
|
|
@@ -169603,7 +169622,7 @@ function readContinuationMarker(directory, sessionID) {
|
|
|
169603
169622
|
if (!existsSync36(markerPath))
|
|
169604
169623
|
return null;
|
|
169605
169624
|
try {
|
|
169606
|
-
const raw =
|
|
169625
|
+
const raw = readFileSync23(markerPath, "utf-8");
|
|
169607
169626
|
const parsed = JSON.parse(raw);
|
|
169608
169627
|
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
|
|
169609
169628
|
return null;
|
|
@@ -169668,7 +169687,7 @@ async function isSessionInBoulderLineage(input) {
|
|
|
169668
169687
|
// packages/omo-opencode/src/hooks/the-operator/session-last-agent.ts
|
|
169669
169688
|
init_shared();
|
|
169670
169689
|
init_compaction_marker();
|
|
169671
|
-
import { readFileSync as
|
|
169690
|
+
import { readFileSync as readFileSync24, readdirSync as readdirSync6 } from "fs";
|
|
169672
169691
|
import { join as join32 } from "path";
|
|
169673
169692
|
var defaultSessionLastAgentDeps = {
|
|
169674
169693
|
getMessageDir,
|
|
@@ -169729,7 +169748,7 @@ async function getLastAgentFromSession(sessionID, client3, deps = {}) {
|
|
|
169729
169748
|
try {
|
|
169730
169749
|
const messages = readdirSync6(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
|
|
169731
169750
|
try {
|
|
169732
|
-
const content =
|
|
169751
|
+
const content = readFileSync24(join32(messageDir, fileName), "utf-8");
|
|
169733
169752
|
const parsed = JSON.parse(content);
|
|
169734
169753
|
return {
|
|
169735
169754
|
fileName,
|
|
@@ -169772,7 +169791,7 @@ init_agent_display_names();
|
|
|
169772
169791
|
|
|
169773
169792
|
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
|
|
169774
169793
|
init_frontmatter2();
|
|
169775
|
-
import { existsSync as existsSync37, readFileSync as
|
|
169794
|
+
import { existsSync as existsSync37, readFileSync as readFileSync25, writeFileSync as writeFileSync10, unlinkSync as unlinkSync6, mkdirSync as mkdirSync13 } from "fs";
|
|
169776
169795
|
import { dirname as dirname13, join as join33 } from "path";
|
|
169777
169796
|
|
|
169778
169797
|
// packages/omo-opencode/src/hooks/ralph-loop/constants.ts
|
|
@@ -169790,7 +169809,7 @@ function readState(directory, customPath) {
|
|
|
169790
169809
|
return null;
|
|
169791
169810
|
}
|
|
169792
169811
|
try {
|
|
169793
|
-
const content =
|
|
169812
|
+
const content = readFileSync25(filePath, "utf-8");
|
|
169794
169813
|
const { data, body } = parseFrontmatter(content);
|
|
169795
169814
|
const active = data.active;
|
|
169796
169815
|
const iteration = data.iteration;
|
|
@@ -170365,7 +170384,7 @@ function createTimestampedStdoutController(stdout2 = process.stdout) {
|
|
|
170365
170384
|
// packages/telemetry-core/src/activity-state.ts
|
|
170366
170385
|
init_atomic_write();
|
|
170367
170386
|
init_xdg_data_dir();
|
|
170368
|
-
import { existsSync as existsSync38, mkdirSync as mkdirSync14, readFileSync as
|
|
170387
|
+
import { existsSync as existsSync38, mkdirSync as mkdirSync14, readFileSync as readFileSync26 } from "fs";
|
|
170369
170388
|
import { basename as basename6, join as join34 } from "path";
|
|
170370
170389
|
var POSTHOG_ACTIVITY_STATE_FILE = "posthog-activity.json";
|
|
170371
170390
|
function resolveTelemetryStateDir(product, options = {}) {
|
|
@@ -170409,7 +170428,7 @@ function readPostHogActivityState(stateDir, diagnostics) {
|
|
|
170409
170428
|
return {};
|
|
170410
170429
|
}
|
|
170411
170430
|
try {
|
|
170412
|
-
const stateContent =
|
|
170431
|
+
const stateContent = readFileSync26(stateFilePath, "utf-8");
|
|
170413
170432
|
const stateJson = JSON.parse(stateContent);
|
|
170414
170433
|
if (!isPostHogActivityState(stateJson)) {
|
|
170415
170434
|
return {};
|
|
@@ -177532,7 +177551,7 @@ init_constants5();
|
|
|
177532
177551
|
|
|
177533
177552
|
// packages/omo-opencode/src/cli/doctor/checks/system.ts
|
|
177534
177553
|
init_constants5();
|
|
177535
|
-
import { existsSync as existsSync49, readFileSync as
|
|
177554
|
+
import { existsSync as existsSync49, readFileSync as readFileSync36 } from "fs";
|
|
177536
177555
|
|
|
177537
177556
|
// packages/omo-opencode/src/cli/doctor/checks/system-binary.ts
|
|
177538
177557
|
init_extract_semver();
|
|
@@ -177729,7 +177748,7 @@ function compareVersions3(current, minimum) {
|
|
|
177729
177748
|
|
|
177730
177749
|
// packages/omo-opencode/src/cli/doctor/checks/system-plugin.ts
|
|
177731
177750
|
init_shared();
|
|
177732
|
-
import { existsSync as existsSync47, readFileSync as
|
|
177751
|
+
import { existsSync as existsSync47, readFileSync as readFileSync34 } from "fs";
|
|
177733
177752
|
function detectConfigPath() {
|
|
177734
177753
|
const paths2 = getOpenCodeConfigPaths({ binary: "opencode", version: null });
|
|
177735
177754
|
if (existsSync47(paths2.configJsonc))
|
|
@@ -177780,7 +177799,7 @@ function getPluginInfo() {
|
|
|
177780
177799
|
};
|
|
177781
177800
|
}
|
|
177782
177801
|
try {
|
|
177783
|
-
const content =
|
|
177802
|
+
const content = readFileSync34(configPath, "utf-8");
|
|
177784
177803
|
const parsedConfig = parseJsonc(content);
|
|
177785
177804
|
const pluginEntry = findPluginEntry2(parsedConfig.plugin ?? []);
|
|
177786
177805
|
if (!pluginEntry) {
|
|
@@ -177824,7 +177843,7 @@ init_auto_update_checker();
|
|
|
177824
177843
|
init_package_json_locator();
|
|
177825
177844
|
init_constants5();
|
|
177826
177845
|
init_shared();
|
|
177827
|
-
import { existsSync as existsSync48, readFileSync as
|
|
177846
|
+
import { existsSync as existsSync48, readFileSync as readFileSync35, readdirSync as readdirSync8 } from "fs";
|
|
177828
177847
|
import { createRequire as createRequire2 } from "module";
|
|
177829
177848
|
import { homedir as homedir13 } from "os";
|
|
177830
177849
|
import { join as join42 } from "path";
|
|
@@ -177855,7 +177874,7 @@ function readPackageJson(filePath) {
|
|
|
177855
177874
|
if (!existsSync48(filePath))
|
|
177856
177875
|
return null;
|
|
177857
177876
|
try {
|
|
177858
|
-
const content =
|
|
177877
|
+
const content = readFileSync35(filePath, "utf-8");
|
|
177859
177878
|
return parseJsonc(content);
|
|
177860
177879
|
} catch (error51) {
|
|
177861
177880
|
if (!(error51 instanceof Error)) {
|
|
@@ -177989,7 +178008,7 @@ var defaultDeps6 = {
|
|
|
177989
178008
|
getLatestPluginVersion,
|
|
177990
178009
|
getSuggestedInstallTag,
|
|
177991
178010
|
configExists: existsSync49,
|
|
177992
|
-
readConfigFile: (path14) =>
|
|
178011
|
+
readConfigFile: (path14) => readFileSync36(path14, "utf-8"),
|
|
177993
178012
|
parseConfigContent: (content) => parseJsonc(content)
|
|
177994
178013
|
};
|
|
177995
178014
|
var BUN_POSTINSTALL_HELPER_PACKAGE_NAME = "@code-yeongyu/comment-checker";
|
|
@@ -178134,7 +178153,7 @@ async function checkSystem(deps = defaultDeps6) {
|
|
|
178134
178153
|
|
|
178135
178154
|
// packages/omo-opencode/src/config/validate.ts
|
|
178136
178155
|
init_src();
|
|
178137
|
-
import { readFileSync as
|
|
178156
|
+
import { readFileSync as readFileSync37 } from "fs";
|
|
178138
178157
|
import { homedir as homedir14 } from "os";
|
|
178139
178158
|
import { dirname as dirname19, relative as relative5 } from "path";
|
|
178140
178159
|
init_shared();
|
|
@@ -178179,7 +178198,7 @@ function schemaMessages(configPath, rawConfig) {
|
|
|
178179
178198
|
}
|
|
178180
178199
|
function parseLayerConfig(configPath) {
|
|
178181
178200
|
try {
|
|
178182
|
-
const content =
|
|
178201
|
+
const content = readFileSync37(configPath, "utf-8");
|
|
178183
178202
|
const rawConfig = parseJsonc(content);
|
|
178184
178203
|
if (!isPlainRecord(rawConfig)) {
|
|
178185
178204
|
return {
|
|
@@ -178251,7 +178270,7 @@ init_constants5();
|
|
|
178251
178270
|
|
|
178252
178271
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-cache.ts
|
|
178253
178272
|
init_shared();
|
|
178254
|
-
import { existsSync as existsSync50, readFileSync as
|
|
178273
|
+
import { existsSync as existsSync50, readFileSync as readFileSync38 } from "fs";
|
|
178255
178274
|
import { homedir as homedir15 } from "os";
|
|
178256
178275
|
import { join as join43 } from "path";
|
|
178257
178276
|
function getUserConfigDir2() {
|
|
@@ -178270,7 +178289,7 @@ function loadCustomProviderNames() {
|
|
|
178270
178289
|
if (!existsSync50(configPath))
|
|
178271
178290
|
continue;
|
|
178272
178291
|
try {
|
|
178273
|
-
const content =
|
|
178292
|
+
const content = readFileSync38(configPath, "utf-8");
|
|
178274
178293
|
const data = parseJsonc(content);
|
|
178275
178294
|
if (data?.provider && typeof data.provider === "object") {
|
|
178276
178295
|
return Object.keys(data.provider);
|
|
@@ -178294,7 +178313,7 @@ function loadAvailableModelsFromCache() {
|
|
|
178294
178313
|
return { providers: [], modelCount: 0, cacheExists: false };
|
|
178295
178314
|
}
|
|
178296
178315
|
try {
|
|
178297
|
-
const content =
|
|
178316
|
+
const content = readFileSync38(cacheFile, "utf-8");
|
|
178298
178317
|
const data = parseJsonc(content);
|
|
178299
178318
|
const cacheProviders = Object.keys(data);
|
|
178300
178319
|
let modelCount = 0;
|
|
@@ -178322,7 +178341,7 @@ init_constants5();
|
|
|
178322
178341
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-config.ts
|
|
178323
178342
|
init_shared();
|
|
178324
178343
|
init_plugin_identity();
|
|
178325
|
-
import { readFileSync as
|
|
178344
|
+
import { readFileSync as readFileSync39 } from "fs";
|
|
178326
178345
|
import { join as join44 } from "path";
|
|
178327
178346
|
var PROJECT_CONFIG_DIR = join44(process.cwd(), ".opencode");
|
|
178328
178347
|
function loadOmoConfig() {
|
|
@@ -178332,7 +178351,7 @@ function loadOmoConfig() {
|
|
|
178332
178351
|
});
|
|
178333
178352
|
if (projectDetected.format !== "none") {
|
|
178334
178353
|
try {
|
|
178335
|
-
const content =
|
|
178354
|
+
const content = readFileSync39(projectDetected.path, "utf-8");
|
|
178336
178355
|
return parseJsonc(content);
|
|
178337
178356
|
} catch (error51) {
|
|
178338
178357
|
if (error51 instanceof Error) {
|
|
@@ -178348,7 +178367,7 @@ function loadOmoConfig() {
|
|
|
178348
178367
|
});
|
|
178349
178368
|
if (userDetected.format !== "none") {
|
|
178350
178369
|
try {
|
|
178351
|
-
const content =
|
|
178370
|
+
const content = readFileSync39(userDetected.path, "utf-8");
|
|
178352
178371
|
return parseJsonc(content);
|
|
178353
178372
|
} catch (error51) {
|
|
178354
178373
|
if (error51 instanceof Error) {
|
|
@@ -178929,13 +178948,13 @@ async function getGhCliInfo(dependencies = {}) {
|
|
|
178929
178948
|
}
|
|
178930
178949
|
|
|
178931
178950
|
// packages/omo-opencode/src/cli/doctor/checks/tools-lsp.ts
|
|
178932
|
-
import { readFileSync as
|
|
178951
|
+
import { readFileSync as readFileSync41 } from "fs";
|
|
178933
178952
|
import { join as join48 } from "path";
|
|
178934
178953
|
|
|
178935
178954
|
// packages/omo-opencode/src/mcp/lsp.ts
|
|
178936
178955
|
init_zod();
|
|
178937
178956
|
init_opencode_config_dir();
|
|
178938
|
-
import { existsSync as existsSync52, readFileSync as
|
|
178957
|
+
import { existsSync as existsSync52, readFileSync as readFileSync40 } from "fs";
|
|
178939
178958
|
import { delimiter as delimiter3, dirname as dirname21, resolve as resolve10 } from "path";
|
|
178940
178959
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
178941
178960
|
|
|
@@ -179079,7 +179098,7 @@ function findBootstrapRoot(candidates, pathExists) {
|
|
|
179079
179098
|
}
|
|
179080
179099
|
function readDaemonPackageVersion(root) {
|
|
179081
179100
|
try {
|
|
179082
|
-
const packageJson = JSON.parse(
|
|
179101
|
+
const packageJson = JSON.parse(readFileSync40(resolve10(root, PACKAGE_REL, "package.json"), "utf-8"));
|
|
179083
179102
|
return DaemonPackageSchema.parse(packageJson).version;
|
|
179084
179103
|
} catch (error51) {
|
|
179085
179104
|
if (!(error51 instanceof Error))
|
|
@@ -179156,7 +179175,7 @@ function readOmoConfig(configDirectory) {
|
|
|
179156
179175
|
return null;
|
|
179157
179176
|
}
|
|
179158
179177
|
try {
|
|
179159
|
-
const content =
|
|
179178
|
+
const content = readFileSync41(detected.path, "utf-8");
|
|
179160
179179
|
return parseJsonc(content);
|
|
179161
179180
|
} catch (error51) {
|
|
179162
179181
|
if (!(error51 instanceof Error)) {
|
|
@@ -179186,7 +179205,7 @@ function getInstalledLspServers(options = {}) {
|
|
|
179186
179205
|
|
|
179187
179206
|
// packages/omo-opencode/src/cli/doctor/checks/tools-mcp.ts
|
|
179188
179207
|
init_shared();
|
|
179189
|
-
import { existsSync as existsSync53, readFileSync as
|
|
179208
|
+
import { existsSync as existsSync53, readFileSync as readFileSync42 } from "fs";
|
|
179190
179209
|
import { homedir as homedir18 } from "os";
|
|
179191
179210
|
import { join as join49 } from "path";
|
|
179192
179211
|
var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
|
|
@@ -179203,7 +179222,7 @@ function loadUserMcpConfig() {
|
|
|
179203
179222
|
if (!existsSync53(configPath))
|
|
179204
179223
|
continue;
|
|
179205
179224
|
try {
|
|
179206
|
-
const content =
|
|
179225
|
+
const content = readFileSync42(configPath, "utf-8");
|
|
179207
179226
|
const config5 = parseJsonc(content);
|
|
179208
179227
|
if (config5.mcpServers) {
|
|
179209
179228
|
Object.assign(servers, config5.mcpServers);
|
|
@@ -179338,7 +179357,7 @@ async function checkTools() {
|
|
|
179338
179357
|
}
|
|
179339
179358
|
|
|
179340
179359
|
// packages/omo-opencode/src/cli/doctor/checks/telemetry.ts
|
|
179341
|
-
import { existsSync as existsSync54, readFileSync as
|
|
179360
|
+
import { existsSync as existsSync54, readFileSync as readFileSync43 } from "fs";
|
|
179342
179361
|
init_constants5();
|
|
179343
179362
|
function isTelemetryState(value) {
|
|
179344
179363
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
@@ -179349,7 +179368,7 @@ function readLastActiveDay(stateFilePath) {
|
|
|
179349
179368
|
}
|
|
179350
179369
|
let parsed;
|
|
179351
179370
|
try {
|
|
179352
|
-
parsed = JSON.parse(
|
|
179371
|
+
parsed = JSON.parse(readFileSync43(stateFilePath, "utf-8"));
|
|
179353
179372
|
} catch (error51) {
|
|
179354
179373
|
if (error51 instanceof Error) {
|
|
179355
179374
|
return "unreadable";
|
|
@@ -179425,7 +179444,7 @@ function expandHomeDirectory(directoryPath) {
|
|
|
179425
179444
|
init_constants5();
|
|
179426
179445
|
init_shared();
|
|
179427
179446
|
init_plugin_identity();
|
|
179428
|
-
import { readFileSync as
|
|
179447
|
+
import { readFileSync as readFileSync44, promises as fs15 } from "fs";
|
|
179429
179448
|
import path15 from "path";
|
|
179430
179449
|
async function checkTeamMode() {
|
|
179431
179450
|
const config5 = loadTeamModeConfig();
|
|
@@ -179462,7 +179481,7 @@ function loadTeamModeConfig() {
|
|
|
179462
179481
|
if (!configPath)
|
|
179463
179482
|
return { team_mode: undefined };
|
|
179464
179483
|
try {
|
|
179465
|
-
return parseJsonc(
|
|
179484
|
+
return parseJsonc(readFileSync44(configPath, "utf-8"));
|
|
179466
179485
|
} catch (error51) {
|
|
179467
179486
|
if (error51 instanceof Error) {
|
|
179468
179487
|
return { team_mode: undefined };
|
|
@@ -179903,7 +179922,7 @@ import {
|
|
|
179903
179922
|
existsSync as existsSync57,
|
|
179904
179923
|
mkdirSync as mkdirSync16,
|
|
179905
179924
|
readdirSync as readdirSync9,
|
|
179906
|
-
readFileSync as
|
|
179925
|
+
readFileSync as readFileSync46,
|
|
179907
179926
|
renameSync as renameSync7,
|
|
179908
179927
|
unlinkSync as unlinkSync9,
|
|
179909
179928
|
writeFileSync as writeFileSync14
|
|
@@ -179936,7 +179955,7 @@ function getOpenCodeCliConfigDir(env2 = process.env) {
|
|
|
179936
179955
|
}
|
|
179937
179956
|
|
|
179938
179957
|
// packages/mcp-client-core/src/mcp-oauth/storage-index.ts
|
|
179939
|
-
import { chmodSync as chmodSync5, existsSync as existsSync56, readFileSync as
|
|
179958
|
+
import { chmodSync as chmodSync5, existsSync as existsSync56, readFileSync as readFileSync45, renameSync as renameSync6, writeFileSync as writeFileSync13 } from "fs";
|
|
179940
179959
|
import { join as join51 } from "path";
|
|
179941
179960
|
var INDEX_FILE_NAME = "index.json";
|
|
179942
179961
|
function isTokenIndex(value) {
|
|
@@ -179952,7 +179971,7 @@ function readTokenIndex(storageDir) {
|
|
|
179952
179971
|
if (!existsSync56(indexPath))
|
|
179953
179972
|
return {};
|
|
179954
179973
|
try {
|
|
179955
|
-
const parsed = JSON.parse(
|
|
179974
|
+
const parsed = JSON.parse(readFileSync45(indexPath, "utf-8"));
|
|
179956
179975
|
return isTokenIndex(parsed) ? parsed : {};
|
|
179957
179976
|
} catch (readError) {
|
|
179958
179977
|
if (!(readError instanceof Error))
|
|
@@ -180062,7 +180081,7 @@ function readTokenFile(filePath) {
|
|
|
180062
180081
|
if (!existsSync57(filePath))
|
|
180063
180082
|
return null;
|
|
180064
180083
|
try {
|
|
180065
|
-
const parsed = JSON.parse(
|
|
180084
|
+
const parsed = JSON.parse(readFileSync46(filePath, "utf-8"));
|
|
180066
180085
|
return isOAuthTokenData(parsed) ? parsed : null;
|
|
180067
180086
|
} catch (readError) {
|
|
180068
180087
|
if (!(readError instanceof Error))
|
|
@@ -180075,7 +180094,7 @@ function readLegacyStore() {
|
|
|
180075
180094
|
if (!existsSync57(filePath))
|
|
180076
180095
|
return null;
|
|
180077
180096
|
try {
|
|
180078
|
-
const parsed = JSON.parse(
|
|
180097
|
+
const parsed = JSON.parse(readFileSync46(filePath, "utf-8"));
|
|
180079
180098
|
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed))
|
|
180080
180099
|
return null;
|
|
180081
180100
|
const result = {};
|
|
@@ -180888,7 +180907,7 @@ function createEmbeddingPort() {
|
|
|
180888
180907
|
// packages/learning-loop/src/codebase-scanner.ts
|
|
180889
180908
|
var import_picomatch = __toESM(require_picomatch2(), 1);
|
|
180890
180909
|
import { createHash as createHash5 } from "crypto";
|
|
180891
|
-
import { readdirSync as readdirSync10, readFileSync as
|
|
180910
|
+
import { readdirSync as readdirSync10, readFileSync as readFileSync48, statSync as statSync7, existsSync as existsSync59 } from "fs";
|
|
180892
180911
|
import { join as join53, relative as relative6, extname as extname3 } from "path";
|
|
180893
180912
|
var EXT_TO_LANG = {
|
|
180894
180913
|
ts: "typescript",
|
|
@@ -180956,7 +180975,7 @@ function defaultFs() {
|
|
|
180956
180975
|
return readdirSync10(path18);
|
|
180957
180976
|
},
|
|
180958
180977
|
readFile(path18) {
|
|
180959
|
-
return
|
|
180978
|
+
return readFileSync48(path18, "utf-8");
|
|
180960
180979
|
},
|
|
180961
180980
|
stat(path18) {
|
|
180962
180981
|
const s = statSync7(path18);
|
|
@@ -181309,7 +181328,7 @@ function formatSearchResults(result) {
|
|
|
181309
181328
|
}
|
|
181310
181329
|
|
|
181311
181330
|
// packages/learning-loop/src/improvement.ts
|
|
181312
|
-
import { existsSync as existsSync60, mkdirSync as mkdirSync18, readFileSync as
|
|
181331
|
+
import { existsSync as existsSync60, mkdirSync as mkdirSync18, readFileSync as readFileSync49, writeFileSync as writeFileSync16 } from "fs";
|
|
181313
181332
|
import { join as join54, basename as basename10 } from "path";
|
|
181314
181333
|
function createImprovementStore(improvementsDir) {
|
|
181315
181334
|
if (!existsSync60(improvementsDir)) {
|
|
@@ -181336,7 +181355,7 @@ function createImprovementStore(improvementsDir) {
|
|
|
181336
181355
|
function get(id) {
|
|
181337
181356
|
const filePath = join54(improvementsDir, `${id}.json`);
|
|
181338
181357
|
try {
|
|
181339
|
-
const raw =
|
|
181358
|
+
const raw = readFileSync49(filePath, "utf-8");
|
|
181340
181359
|
return JSON.parse(raw);
|
|
181341
181360
|
} catch {
|
|
181342
181361
|
return null;
|
|
@@ -183463,9 +183482,9 @@ playwright-cli close
|
|
|
183463
183482
|
// packages/skills-loader-core/src/features/builtin-skills/skill-file-loader.ts
|
|
183464
183483
|
init_shared_skills();
|
|
183465
183484
|
init_src();
|
|
183466
|
-
import { readFileSync as
|
|
183485
|
+
import { readFileSync as readFileSync52 } from "fs";
|
|
183467
183486
|
import { join as join64 } from "path";
|
|
183468
|
-
function createSharedSkillTemplateLoader(readFile3 =
|
|
183487
|
+
function createSharedSkillTemplateLoader(readFile3 = readFileSync52, skillsRootPath = sharedSkillsRootPath()) {
|
|
183469
183488
|
const cache = new Map;
|
|
183470
183489
|
return (skillName) => {
|
|
183471
183490
|
const cached2 = cache.get(skillName);
|
|
@@ -185825,7 +185844,7 @@ import {
|
|
|
185825
185844
|
existsSync as existsSync67,
|
|
185826
185845
|
mkdirSync as mkdirSync21,
|
|
185827
185846
|
copyFileSync as copyFileSync4,
|
|
185828
|
-
readFileSync as
|
|
185847
|
+
readFileSync as readFileSync53,
|
|
185829
185848
|
writeFileSync as writeFileSync19,
|
|
185830
185849
|
readdirSync as readdirSync11,
|
|
185831
185850
|
statSync as statSync8,
|
|
@@ -185842,7 +185861,7 @@ async function snapshotCli(options = {}) {
|
|
|
185842
185861
|
const realFs = {
|
|
185843
185862
|
existsSync: existsSync67,
|
|
185844
185863
|
mkdirSync: mkdirSync21,
|
|
185845
|
-
readFileSync:
|
|
185864
|
+
readFileSync: readFileSync53,
|
|
185846
185865
|
writeFileSync: writeFileSync19,
|
|
185847
185866
|
copyFileSync: copyFileSync4,
|
|
185848
185867
|
readdirSync: readdirSync11,
|
|
@@ -185908,7 +185927,7 @@ import {
|
|
|
185908
185927
|
existsSync as existsSync68,
|
|
185909
185928
|
mkdirSync as mkdirSync22,
|
|
185910
185929
|
copyFileSync as copyFileSync5,
|
|
185911
|
-
readFileSync as
|
|
185930
|
+
readFileSync as readFileSync54,
|
|
185912
185931
|
writeFileSync as writeFileSync20,
|
|
185913
185932
|
readdirSync as readdirSync12,
|
|
185914
185933
|
statSync as statSync9,
|
|
@@ -185921,7 +185940,7 @@ async function restoreCli(options) {
|
|
|
185921
185940
|
const realFs = {
|
|
185922
185941
|
existsSync: existsSync68,
|
|
185923
185942
|
mkdirSync: mkdirSync22,
|
|
185924
|
-
readFileSync:
|
|
185943
|
+
readFileSync: readFileSync54,
|
|
185925
185944
|
writeFileSync: writeFileSync20,
|
|
185926
185945
|
copyFileSync: copyFileSync5,
|
|
185927
185946
|
readdirSync: readdirSync12,
|
|
@@ -185936,7 +185955,7 @@ async function restoreCli(options) {
|
|
|
185936
185955
|
try {
|
|
185937
185956
|
restoreSnapshot(options.state, { snapshotDir, fs: realFs });
|
|
185938
185957
|
const manifestPath = path19.join(snapshotDir, options.state, "manifest.json");
|
|
185939
|
-
const raw =
|
|
185958
|
+
const raw = readFileSync54(manifestPath).toString("utf-8");
|
|
185940
185959
|
const parsed = JSON.parse(raw);
|
|
185941
185960
|
const fileCount = typeof parsed === "object" && parsed !== null && "files" in parsed && Array.isArray(parsed.files) ? parsed.files.length : 0;
|
|
185942
185961
|
if (options.json) {
|
|
@@ -185960,7 +185979,7 @@ import {
|
|
|
185960
185979
|
existsSync as existsSync69,
|
|
185961
185980
|
mkdirSync as mkdirSync23,
|
|
185962
185981
|
copyFileSync as copyFileSync6,
|
|
185963
|
-
readFileSync as
|
|
185982
|
+
readFileSync as readFileSync55,
|
|
185964
185983
|
writeFileSync as writeFileSync21,
|
|
185965
185984
|
readdirSync as readdirSync13,
|
|
185966
185985
|
statSync as statSync10,
|
|
@@ -185983,7 +186002,7 @@ async function snapshotListCli(options) {
|
|
|
185983
186002
|
const realFs = {
|
|
185984
186003
|
existsSync: existsSync69,
|
|
185985
186004
|
mkdirSync: mkdirSync23,
|
|
185986
|
-
readFileSync:
|
|
186005
|
+
readFileSync: readFileSync55,
|
|
185987
186006
|
writeFileSync: writeFileSync21,
|
|
185988
186007
|
copyFileSync: copyFileSync6,
|
|
185989
186008
|
readdirSync: readdirSync13,
|
|
@@ -186014,7 +186033,7 @@ import {
|
|
|
186014
186033
|
existsSync as existsSync70,
|
|
186015
186034
|
mkdirSync as mkdirSync24,
|
|
186016
186035
|
copyFileSync as copyFileSync7,
|
|
186017
|
-
readFileSync as
|
|
186036
|
+
readFileSync as readFileSync56,
|
|
186018
186037
|
writeFileSync as writeFileSync22,
|
|
186019
186038
|
readdirSync as readdirSync14,
|
|
186020
186039
|
statSync as statSync11,
|
|
@@ -186027,7 +186046,7 @@ async function snapshotPruneCli(options = {}) {
|
|
|
186027
186046
|
const realFs = {
|
|
186028
186047
|
existsSync: existsSync70,
|
|
186029
186048
|
mkdirSync: mkdirSync24,
|
|
186030
|
-
readFileSync:
|
|
186049
|
+
readFileSync: readFileSync56,
|
|
186031
186050
|
writeFileSync: writeFileSync22,
|
|
186032
186051
|
copyFileSync: copyFileSync7,
|
|
186033
186052
|
readdirSync: readdirSync14,
|
|
@@ -186548,7 +186567,7 @@ async function traceCli(sessionId, options = {}) {
|
|
|
186548
186567
|
|
|
186549
186568
|
// packages/omo-opencode/src/cli/dashboard.ts
|
|
186550
186569
|
import * as path25 from "path";
|
|
186551
|
-
import { readFileSync as
|
|
186570
|
+
import { readFileSync as readFileSync58 } from "fs";
|
|
186552
186571
|
|
|
186553
186572
|
// packages/omo-opencode/src/features/dashboard/data-provider.ts
|
|
186554
186573
|
import * as os12 from "os";
|
|
@@ -187332,7 +187351,7 @@ function loadGatewayPassphrase() {
|
|
|
187332
187351
|
try {
|
|
187333
187352
|
const configDir = getConfigDir();
|
|
187334
187353
|
const configPath = path25.join(configDir, "matrixos.jsonc");
|
|
187335
|
-
const raw =
|
|
187354
|
+
const raw = readFileSync58(configPath, "utf-8");
|
|
187336
187355
|
const config5 = parseJsonc(raw);
|
|
187337
187356
|
const dashboard2 = config5.dashboard;
|
|
187338
187357
|
return typeof dashboard2?.gatewayPassphrase === "string" ? dashboard2.gatewayPassphrase : undefined;
|
|
@@ -187665,7 +187684,7 @@ function configureRuntimeCommands(program2) {
|
|
|
187665
187684
|
const exitCode = await architectRollback({ ...options, id });
|
|
187666
187685
|
process.exit(exitCode);
|
|
187667
187686
|
});
|
|
187668
|
-
program2.command("dashboard").description("Start the MaTrixOS web dashboard (port 9123)").option("-p, --port <number>", "HTTP port", "9123").option("--host <addr>", "Bind address", "
|
|
187687
|
+
program2.command("dashboard").description("Start the MaTrixOS web dashboard (port 9123)").option("-p, --port <number>", "HTTP port", "9123").option("--host <addr>", "Bind address", "127.0.0.1").option("--daemon", "Run in background (no Ctrl+C)").action(async (options) => {
|
|
187669
187688
|
const exitCode = await dashboardCli({
|
|
187670
187689
|
port: parseInt(options.port ?? "9123", 10),
|
|
187671
187690
|
host: options.host,
|
|
@@ -187928,8 +187947,8 @@ project.command("search <query>").description("Search the active project KB and
|
|
|
187928
187947
|
});
|
|
187929
187948
|
project.command("add-doc <slug> <file>").description("Copy a document into the project KB").action(async (slug, filePath) => {
|
|
187930
187949
|
const { addKbDocument: addKbDocument2 } = await Promise.resolve().then(() => (init_project_memory(), exports_project_memory));
|
|
187931
|
-
const { readFileSync:
|
|
187932
|
-
const content =
|
|
187950
|
+
const { readFileSync: readFileSync66 } = await import("fs");
|
|
187951
|
+
const content = readFileSync66(filePath, "utf-8");
|
|
187933
187952
|
const dest = addKbDocument2(slug, filePath, content);
|
|
187934
187953
|
process.stdout.write(JSON.stringify({ ok: true, dest }, null, 2) + `
|
|
187935
187954
|
`);
|