@kl-c/matrixos 0.2.8 → 0.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +522 -386
- package/dist/cli/slash-command-installer.d.ts +4 -0
- package/dist/cli/slash-commands/adopt.md +11 -0
- package/dist/cli/slash-commands/features.md +12 -0
- package/dist/cli/slash-commands/matrix-gateway-adopt-telegram.md +10 -0
- package/dist/cli/slash-commands/matrix.md +10 -0
- package/dist/cli/slash-commands/readopt.md +8 -0
- package/dist/cli-node/index.js +522 -386
- package/dist/index.js +76 -53
- package/dist/plugin/auto-adoption.d.ts +5 -3
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -13432,7 +13432,7 @@ var init_types2 = __esm(() => {
|
|
|
13432
13432
|
|
|
13433
13433
|
// packages/team-core/src/team-registry/paths.ts
|
|
13434
13434
|
import { mkdir as mkdir3, readdir as readdir2, stat as stat2, chmod as chmod3 } from "fs/promises";
|
|
13435
|
-
import { homedir as
|
|
13435
|
+
import { homedir as homedir24 } from "os";
|
|
13436
13436
|
import path14 from "path";
|
|
13437
13437
|
function getTeamDirectory(baseDir, teamName, scope, projectRoot) {
|
|
13438
13438
|
if (scope === "project") {
|
|
@@ -13455,14 +13455,14 @@ function resolveContainedPath2(baseDir, pathSegments) {
|
|
|
13455
13455
|
return resolvedPath;
|
|
13456
13456
|
}
|
|
13457
13457
|
function resolveBaseDir(config) {
|
|
13458
|
-
return expandHomeDirectory(config.base_dir ?? path14.join(
|
|
13458
|
+
return expandHomeDirectory(config.base_dir ?? path14.join(homedir24(), ".omo"));
|
|
13459
13459
|
}
|
|
13460
13460
|
function expandHomeDirectory(directoryPath) {
|
|
13461
13461
|
if (directoryPath === "~") {
|
|
13462
|
-
return
|
|
13462
|
+
return homedir24();
|
|
13463
13463
|
}
|
|
13464
13464
|
if (directoryPath.startsWith("~/") || directoryPath.startsWith("~\\")) {
|
|
13465
|
-
return path14.join(
|
|
13465
|
+
return path14.join(homedir24(), directoryPath.slice(2));
|
|
13466
13466
|
}
|
|
13467
13467
|
return directoryPath;
|
|
13468
13468
|
}
|
|
@@ -358558,10 +358558,11 @@ function ensureTuiPluginEntry(opts = {}) {
|
|
|
358558
358558
|
var GATEWAY_ENV_FILENAME = ".klc-gateway.env";
|
|
358559
358559
|
|
|
358560
358560
|
// packages/omo-opencode/src/cli/config-manager/load-gateway-env.ts
|
|
358561
|
+
import { homedir as homedir16 } from "os";
|
|
358561
358562
|
import { existsSync as existsSync37, readFileSync as readFileSync25 } from "fs";
|
|
358562
358563
|
import { join as join43 } from "path";
|
|
358563
358564
|
function loadGatewayEnvFile(configDir, force = false) {
|
|
358564
|
-
const dir = configDir ??
|
|
358565
|
+
const dir = configDir ?? homedir16();
|
|
358565
358566
|
const envPath = join43(dir, GATEWAY_ENV_FILENAME);
|
|
358566
358567
|
if (!existsSync37(envPath)) {
|
|
358567
358568
|
console.warn(`[gateway-env] env file not found at ${envPath} \u2014 skipping`);
|
|
@@ -360751,7 +360752,7 @@ async function runCommentChecker(input, options) {
|
|
|
360751
360752
|
// packages/omo-opencode/src/hooks/comment-checker/downloader.ts
|
|
360752
360753
|
import { existsSync as existsSync39, appendFileSync as appendFileSync3 } from "fs";
|
|
360753
360754
|
import { join as join46 } from "path";
|
|
360754
|
-
import { homedir as
|
|
360755
|
+
import { homedir as homedir17, tmpdir as tmpdir3 } from "os";
|
|
360755
360756
|
import { createRequire as createRequire3 } from "module";
|
|
360756
360757
|
init_logger2();
|
|
360757
360758
|
init_plugin_identity();
|
|
@@ -360775,11 +360776,11 @@ var PLATFORM_MAP = {
|
|
|
360775
360776
|
function getCacheDir2() {
|
|
360776
360777
|
if (process.platform === "win32") {
|
|
360777
360778
|
const localAppData = process.env.LOCALAPPDATA || process.env.APPDATA;
|
|
360778
|
-
const base2 = localAppData || join46(
|
|
360779
|
+
const base2 = localAppData || join46(homedir17(), "AppData", "Local");
|
|
360779
360780
|
return join46(base2, CACHE_DIR_NAME, "bin");
|
|
360780
360781
|
}
|
|
360781
360782
|
const xdgCache = process.env.XDG_CACHE_HOME;
|
|
360782
|
-
const base = xdgCache || join46(
|
|
360783
|
+
const base = xdgCache || join46(homedir17(), ".cache");
|
|
360783
360784
|
return join46(base, CACHE_DIR_NAME, "bin");
|
|
360784
360785
|
}
|
|
360785
360786
|
function getBinaryName() {
|
|
@@ -361391,7 +361392,7 @@ function isSameOrChildPath(childPath, parentPath) {
|
|
|
361391
361392
|
}
|
|
361392
361393
|
// packages/rules-engine/src/finder.ts
|
|
361393
361394
|
import { existsSync as existsSync44, statSync as statSync6 } from "fs";
|
|
361394
|
-
import { homedir as
|
|
361395
|
+
import { homedir as homedir18 } from "os";
|
|
361395
361396
|
import { dirname as dirname13, isAbsolute as isAbsolute9, join as join51, relative as relative8, resolve as resolve15 } from "path";
|
|
361396
361397
|
|
|
361397
361398
|
// packages/rules-engine/src/ordering.ts
|
|
@@ -361490,7 +361491,7 @@ function findRuleFiles(projectRoot, homeDir, currentFile, options, cache) {
|
|
|
361490
361491
|
const seenRealPaths = new Set;
|
|
361491
361492
|
addProjectRuleCandidates(effectiveProjectRoot, startDir, candidates, seenRealPaths, cache);
|
|
361492
361493
|
addProjectSingleFileCandidates(effectiveProjectRoot, candidates, seenRealPaths);
|
|
361493
|
-
addUserRuleCandidates(homeDir ||
|
|
361494
|
+
addUserRuleCandidates(homeDir || homedir18(), skipClaudeUserRules, candidates, seenRealPaths, cache);
|
|
361494
361495
|
const sorted = sortCandidates(candidates);
|
|
361495
361496
|
cache?.set(cacheKey, sorted);
|
|
361496
361497
|
return sorted;
|
|
@@ -367351,7 +367352,7 @@ function createSessionRuleScanCacheStore() {
|
|
|
367351
367352
|
}
|
|
367352
367353
|
|
|
367353
367354
|
// packages/omo-opencode/src/hooks/rules-injector/injection-processor.ts
|
|
367354
|
-
import { homedir as
|
|
367355
|
+
import { homedir as homedir19 } from "os";
|
|
367355
367356
|
// packages/omo-opencode/src/hooks/rules-injector/rule-file-finder.ts
|
|
367356
367357
|
init_logger2();
|
|
367357
367358
|
setSisyphusRuleDeprecationLogger(log2);
|
|
@@ -367497,7 +367498,7 @@ function createRuleInjectionProcessor(deps) {
|
|
|
367497
367498
|
getSessionCache: getSessionCache3,
|
|
367498
367499
|
getSessionRuleScanCache,
|
|
367499
367500
|
ruleFinderOptions,
|
|
367500
|
-
homedir: getHomeDir =
|
|
367501
|
+
homedir: getHomeDir = homedir19,
|
|
367501
367502
|
shouldApplyRule: shouldApplyRuleImpl = shouldApplyRule,
|
|
367502
367503
|
isDuplicateByRealPath: isDuplicateByRealPathImpl = isDuplicateByRealPath,
|
|
367503
367504
|
createContentHash: createContentHashImpl = createContentHash,
|
|
@@ -368023,7 +368024,7 @@ function getCachedVersion(options = {}) {
|
|
|
368023
368024
|
// package.json
|
|
368024
368025
|
var package_default = {
|
|
368025
368026
|
name: "@kl-c/matrixos",
|
|
368026
|
-
version: "0.2.
|
|
368027
|
+
version: "0.2.10",
|
|
368027
368028
|
description: "MaTrixOS \u2014 Agentic OS for OpenCode. Personalizable, communicating, self-improving, resilient.",
|
|
368028
368029
|
main: "./dist/index.js",
|
|
368029
368030
|
types: "dist/index.d.ts",
|
|
@@ -368125,7 +368126,8 @@ var package_default = {
|
|
|
368125
368126
|
"typecheck:packages": "tsgo --noEmit -p packages/rules-engine/tsconfig.json && tsgo --noEmit -p packages/delegate-core/tsconfig.json && tsgo --noEmit -p packages/mcp-stdio-core/tsconfig.json && tsgo --noEmit -p packages/mcp-client-core/tsconfig.json && tsgo --noEmit -p packages/git-bash-mcp/tsconfig.json && tsgo --noEmit -p packages/lsp-core/tsconfig.json && tsgo --noEmit -p packages/utils/tsconfig.json && tsgo --noEmit -p packages/model-core/tsconfig.json && tsgo --noEmit -p packages/omo-config-core/tsconfig.json && tsgo --noEmit -p packages/prompts-core/tsconfig.json && tsgo --noEmit -p packages/comment-checker-core/tsconfig.json && tsgo --noEmit -p packages/hashline-core/tsconfig.json && tsgo --noEmit -p packages/tmux-core/tsconfig.json && tsgo --noEmit -p packages/team-core/tsconfig.json && tsgo --noEmit -p packages/matrix-gateway-core/tsconfig.json && tsgo --noEmit -p packages/boulder-state/tsconfig.json && tsgo --noEmit -p packages/learning-loop/tsconfig.json && tsgo --noEmit -p packages/telemetry-core/tsconfig.json && tsgo --noEmit -p packages/claude-code-compat-core/tsconfig.json && tsgo --noEmit -p packages/skills-loader-core/tsconfig.json && tsgo --noEmit -p packages/agents-md-core/tsconfig.json && tsgo --noEmit -p packages/task-ledger-core/tsconfig.json && tsgo --noEmit -p packages/egress-core/tsconfig.json && tsgo --noEmit -p packages/http-server-core/tsconfig.json && tsgo --noEmit -p packages/webhook-core/tsconfig.json && tsgo --noEmit -p packages/daily-brief-core/tsconfig.json && tsgo --noEmit -p packages/omo-opencode/tsconfig.json",
|
|
368126
368127
|
"typecheck:script": "tsgo --noEmit -p script/tsconfig.json",
|
|
368127
368128
|
test: "bun test",
|
|
368128
|
-
"build:git-bash-mcp": "bun run --cwd packages/git-bash-mcp build"
|
|
368129
|
+
"build:git-bash-mcp": "bun run --cwd packages/git-bash-mcp build",
|
|
368130
|
+
"build:slash-commands": "rm -rf dist/cli/slash-commands && mkdir -p dist/cli/slash-commands && cp packages/omo-opencode/src/cli/slash-commands/*.md dist/cli/slash-commands/"
|
|
368129
368131
|
},
|
|
368130
368132
|
keywords: [
|
|
368131
368133
|
"opencode",
|
|
@@ -369200,7 +369202,7 @@ v${latestVersion} available. Restart OpenCode to apply.` : "OpenCode is now on S
|
|
|
369200
369202
|
// packages/omo-opencode/src/hooks/codegraph-bootstrap/hook.ts
|
|
369201
369203
|
init_src();
|
|
369202
369204
|
import { existsSync as existsSync72 } from "fs";
|
|
369203
|
-
import { homedir as
|
|
369205
|
+
import { homedir as homedir22 } from "os";
|
|
369204
369206
|
import { join as join81 } from "path";
|
|
369205
369207
|
|
|
369206
369208
|
// packages/omo-opencode/src/hooks/codegraph-bootstrap/command-runner.ts
|
|
@@ -369354,7 +369356,7 @@ function defaultSchedule(task) {
|
|
|
369354
369356
|
timer.unref?.();
|
|
369355
369357
|
}
|
|
369356
369358
|
function defaultInstallDir2() {
|
|
369357
|
-
return join81(
|
|
369359
|
+
return join81(homedir22(), ".omo", "codegraph");
|
|
369358
369360
|
}
|
|
369359
369361
|
function provisionedBinFromInstallDir(installDir) {
|
|
369360
369362
|
if (installDir === undefined)
|
|
@@ -369493,7 +369495,7 @@ function createCodegraphBootstrapHook(ctx, config, depsOverride = {}) {
|
|
|
369493
369495
|
}
|
|
369494
369496
|
// packages/omo-opencode/src/hooks/ast-grep-sg-provision/hook.ts
|
|
369495
369497
|
init_src();
|
|
369496
|
-
import { homedir as
|
|
369498
|
+
import { homedir as homedir23 } from "os";
|
|
369497
369499
|
import { join as join82 } from "path";
|
|
369498
369500
|
var provisionedTargets = new Set;
|
|
369499
369501
|
function defaultSchedule2(task) {
|
|
@@ -369513,7 +369515,7 @@ async function runProvision(targetDir, deps) {
|
|
|
369513
369515
|
}
|
|
369514
369516
|
var defaultDeps5 = {
|
|
369515
369517
|
findSgBinary: findSgBinarySync,
|
|
369516
|
-
homeDir:
|
|
369518
|
+
homeDir: homedir23,
|
|
369517
369519
|
log: log2,
|
|
369518
369520
|
provisionSgBinary,
|
|
369519
369521
|
schedule: defaultSchedule2
|
|
@@ -377727,7 +377729,7 @@ import { basename as basename14, dirname as dirname26, join as join90 } from "pa
|
|
|
377727
377729
|
|
|
377728
377730
|
// packages/skills-loader-core/src/shared/opencode-config-dir.ts
|
|
377729
377731
|
import { existsSync as existsSync77, realpathSync as realpathSync12 } from "fs";
|
|
377730
|
-
import { homedir as
|
|
377732
|
+
import { homedir as homedir25 } from "os";
|
|
377731
377733
|
import { join as join89, posix as posix4, resolve as resolve21, win32 as win325 } from "path";
|
|
377732
377734
|
|
|
377733
377735
|
// packages/skills-loader-core/src/shared/plugin-identity.ts
|
|
@@ -377761,14 +377763,14 @@ function getTauriConfigDir2(identifier) {
|
|
|
377761
377763
|
const platform2 = process.platform;
|
|
377762
377764
|
switch (platform2) {
|
|
377763
377765
|
case "darwin":
|
|
377764
|
-
return join89(
|
|
377766
|
+
return join89(homedir25(), "Library", "Application Support", identifier);
|
|
377765
377767
|
case "win32": {
|
|
377766
|
-
const appData = process.env.APPDATA || join89(
|
|
377768
|
+
const appData = process.env.APPDATA || join89(homedir25(), "AppData", "Roaming");
|
|
377767
377769
|
return win325.join(appData, identifier);
|
|
377768
377770
|
}
|
|
377769
377771
|
case "linux":
|
|
377770
377772
|
default: {
|
|
377771
|
-
const xdgConfig = process.env.XDG_CONFIG_HOME || join89(
|
|
377773
|
+
const xdgConfig = process.env.XDG_CONFIG_HOME || join89(homedir25(), ".config");
|
|
377772
377774
|
return join89(xdgConfig, identifier);
|
|
377773
377775
|
}
|
|
377774
377776
|
}
|
|
@@ -377812,7 +377814,7 @@ function getWslLinuxHomeDir2(windowsConfigRoot) {
|
|
|
377812
377814
|
function getCliDefaultConfigDir2() {
|
|
377813
377815
|
const envXdgConfig = process.env.XDG_CONFIG_HOME?.trim();
|
|
377814
377816
|
const shouldIgnoreWindowsXdg = envXdgConfig !== undefined && envXdgConfig.length > 0 && isWslEnvironment2() && isWindowsUserConfigRoot2(envXdgConfig);
|
|
377815
|
-
const xdgConfig = shouldIgnoreWindowsXdg ? posix4.join(getWslLinuxHomeDir2(envXdgConfig) ?? "/home", ".config") : envXdgConfig || join89(
|
|
377817
|
+
const xdgConfig = shouldIgnoreWindowsXdg ? posix4.join(getWslLinuxHomeDir2(envXdgConfig) ?? "/home", ".config") : envXdgConfig || join89(homedir25(), ".config");
|
|
377816
377818
|
const configDir = isWslEnvironment2() ? posix4.join(xdgConfig, "opencode") : join89(xdgConfig, "opencode");
|
|
377817
377819
|
return resolveConfigPath2(configDir);
|
|
377818
377820
|
}
|
|
@@ -378470,14 +378472,14 @@ function builtinToLoadedSkill(builtin) {
|
|
|
378470
378472
|
init_src();
|
|
378471
378473
|
import { existsSync as existsSync80, readFileSync as readFileSync51 } from "fs";
|
|
378472
378474
|
import { dirname as dirname28, isAbsolute as isAbsolute13, resolve as resolve23 } from "path";
|
|
378473
|
-
import { homedir as
|
|
378475
|
+
import { homedir as homedir26 } from "os";
|
|
378474
378476
|
function resolveFilePath5(from, configDir) {
|
|
378475
378477
|
let filePath = from;
|
|
378476
378478
|
if (filePath.startsWith("{file:") && filePath.endsWith("}")) {
|
|
378477
378479
|
filePath = filePath.slice(6, -1);
|
|
378478
378480
|
}
|
|
378479
378481
|
if (filePath.startsWith("~/")) {
|
|
378480
|
-
return resolve23(
|
|
378482
|
+
return resolve23(homedir26(), filePath.slice(2));
|
|
378481
378483
|
}
|
|
378482
378484
|
if (isAbsolute13(filePath)) {
|
|
378483
378485
|
return filePath;
|
|
@@ -381721,7 +381723,7 @@ function isDisabledSkillName(name, disabledSkills) {
|
|
|
381721
381723
|
init_src();
|
|
381722
381724
|
var import_picomatch2 = __toESM(require_picomatch2(), 1);
|
|
381723
381725
|
import * as fs20 from "fs/promises";
|
|
381724
|
-
import { homedir as
|
|
381726
|
+
import { homedir as homedir27 } from "os";
|
|
381725
381727
|
import { dirname as dirname30, extname as extname2, isAbsolute as isAbsolute14, join as join98, relative as relative12 } from "path";
|
|
381726
381728
|
var MAX_RECURSIVE_DEPTH = 10;
|
|
381727
381729
|
function isHttpUrl(path17) {
|
|
@@ -381729,10 +381731,10 @@ function isHttpUrl(path17) {
|
|
|
381729
381731
|
}
|
|
381730
381732
|
function toAbsolutePath(path17, configDir) {
|
|
381731
381733
|
if (path17 === "~") {
|
|
381732
|
-
return
|
|
381734
|
+
return homedir27();
|
|
381733
381735
|
}
|
|
381734
381736
|
if (path17.startsWith("~/")) {
|
|
381735
|
-
return join98(
|
|
381737
|
+
return join98(homedir27(), path17.slice(2));
|
|
381736
381738
|
}
|
|
381737
381739
|
if (isAbsolute14(path17)) {
|
|
381738
381740
|
return path17;
|
|
@@ -397940,18 +397942,18 @@ import { existsSync as existsSync98, readdirSync as readdirSync23 } from "fs";
|
|
|
397940
397942
|
import { join as join113 } from "path";
|
|
397941
397943
|
|
|
397942
397944
|
// packages/claude-code-compat-core/src/shared/claude-config-dir.ts
|
|
397943
|
-
import { homedir as
|
|
397945
|
+
import { homedir as homedir28 } from "os";
|
|
397944
397946
|
import { join as join108 } from "path";
|
|
397945
397947
|
function getClaudeConfigDir3() {
|
|
397946
397948
|
const envConfigDir = process.env.CLAUDE_CONFIG_DIR;
|
|
397947
397949
|
if (envConfigDir) {
|
|
397948
397950
|
return envConfigDir;
|
|
397949
397951
|
}
|
|
397950
|
-
return join108(process.env.HOME || process.env.USERPROFILE ||
|
|
397952
|
+
return join108(process.env.HOME || process.env.USERPROFILE || homedir28(), ".claude");
|
|
397951
397953
|
}
|
|
397952
397954
|
// packages/claude-code-compat-core/src/shared/opencode-config-dir.ts
|
|
397953
397955
|
import { existsSync as existsSync94, realpathSync as realpathSync16 } from "fs";
|
|
397954
|
-
import { homedir as
|
|
397956
|
+
import { homedir as homedir29 } from "os";
|
|
397955
397957
|
import { join as join109, posix as posix6, resolve as resolve33, win32 as win329 } from "path";
|
|
397956
397958
|
var TAURI_APP_IDENTIFIER3 = "ai.opencode.desktop";
|
|
397957
397959
|
var TAURI_APP_IDENTIFIER_DEV3 = "ai.opencode.desktop.dev";
|
|
@@ -397964,14 +397966,14 @@ function getTauriConfigDir3(identifier) {
|
|
|
397964
397966
|
const platform3 = process.platform;
|
|
397965
397967
|
switch (platform3) {
|
|
397966
397968
|
case "darwin":
|
|
397967
|
-
return join109(
|
|
397969
|
+
return join109(homedir29(), "Library", "Application Support", identifier);
|
|
397968
397970
|
case "win32": {
|
|
397969
|
-
const appData = process.env.APPDATA || join109(
|
|
397971
|
+
const appData = process.env.APPDATA || join109(homedir29(), "AppData", "Roaming");
|
|
397970
397972
|
return win329.join(appData, identifier);
|
|
397971
397973
|
}
|
|
397972
397974
|
case "linux":
|
|
397973
397975
|
default: {
|
|
397974
|
-
const xdgConfig = process.env.XDG_CONFIG_HOME || join109(
|
|
397976
|
+
const xdgConfig = process.env.XDG_CONFIG_HOME || join109(homedir29(), ".config");
|
|
397975
397977
|
return join109(xdgConfig, identifier);
|
|
397976
397978
|
}
|
|
397977
397979
|
}
|
|
@@ -398015,7 +398017,7 @@ function getWslLinuxHomeDir3(windowsConfigRoot) {
|
|
|
398015
398017
|
function getCliDefaultConfigDir3() {
|
|
398016
398018
|
const envXdgConfig = process.env.XDG_CONFIG_HOME?.trim();
|
|
398017
398019
|
const shouldIgnoreWindowsXdg = envXdgConfig !== undefined && envXdgConfig.length > 0 && isWslEnvironment3() && isWindowsUserConfigRoot3(envXdgConfig);
|
|
398018
|
-
const xdgConfig = shouldIgnoreWindowsXdg ? posix6.join(getWslLinuxHomeDir3(envXdgConfig) ?? "/home", ".config") : envXdgConfig || join109(
|
|
398020
|
+
const xdgConfig = shouldIgnoreWindowsXdg ? posix6.join(getWslLinuxHomeDir3(envXdgConfig) ?? "/home", ".config") : envXdgConfig || join109(homedir29(), ".config");
|
|
398019
398021
|
const configDir = isWslEnvironment3() ? posix6.join(xdgConfig, "opencode") : join109(xdgConfig, "opencode");
|
|
398020
398022
|
return resolveConfigPath3(configDir);
|
|
398021
398023
|
}
|
|
@@ -398060,11 +398062,11 @@ function getOpenCodeConfigDir3(options) {
|
|
|
398060
398062
|
// packages/claude-code-compat-core/src/shared/jsonc-parser.ts
|
|
398061
398063
|
init_src();
|
|
398062
398064
|
// packages/claude-code-compat-core/src/shared/resolve-agent-definition-paths.ts
|
|
398063
|
-
import { homedir as
|
|
398065
|
+
import { homedir as homedir30 } from "os";
|
|
398064
398066
|
import { isAbsolute as isAbsolute17, join as join110, resolve as resolve34 } from "path";
|
|
398065
398067
|
function resolveAgentDefinitionPaths2(paths, baseDir, containmentDir) {
|
|
398066
398068
|
return paths.flatMap((p) => {
|
|
398067
|
-
const expanded = p.startsWith("~/") ? join110(
|
|
398069
|
+
const expanded = p.startsWith("~/") ? join110(homedir30(), p.slice(2)) : p;
|
|
398068
398070
|
const resolved = isAbsolute17(expanded) ? expanded : resolve34(baseDir, expanded);
|
|
398069
398071
|
if (containmentDir !== null && !isWithinProject(resolved, containmentDir)) {
|
|
398070
398072
|
log4(`agent_definitions path rejected (outside project boundary): ${p} -> ${resolved}`);
|
|
@@ -412975,7 +412977,7 @@ import { basename as basename22, dirname as dirname42, join as join126 } from "p
|
|
|
412975
412977
|
|
|
412976
412978
|
// packages/mcp-client-core/src/config-dir.ts
|
|
412977
412979
|
import { existsSync as existsSync105, realpathSync as realpathSync18 } from "fs";
|
|
412978
|
-
import { homedir as
|
|
412980
|
+
import { homedir as homedir32 } from "os";
|
|
412979
412981
|
import { join as join124, resolve as resolve36 } from "path";
|
|
412980
412982
|
function resolveConfigPath4(pathValue) {
|
|
412981
412983
|
const resolvedPath = resolve36(pathValue);
|
|
@@ -412994,7 +412996,7 @@ function getOpenCodeCliConfigDir(env2 = process.env) {
|
|
|
412994
412996
|
if (customConfigDir) {
|
|
412995
412997
|
return resolveConfigPath4(customConfigDir);
|
|
412996
412998
|
}
|
|
412997
|
-
const xdgConfigDir = env2["XDG_CONFIG_HOME"]?.trim() || join124(
|
|
412999
|
+
const xdgConfigDir = env2["XDG_CONFIG_HOME"]?.trim() || join124(homedir32(), ".config");
|
|
412998
413000
|
return resolveConfigPath4(join124(xdgConfigDir, "opencode"));
|
|
412999
413001
|
}
|
|
413000
413002
|
|
|
@@ -418547,10 +418549,10 @@ import { dirname as dirname43 } from "path";
|
|
|
418547
418549
|
// packages/omo-opencode/src/features/tui-sidebar/mirror-path.ts
|
|
418548
418550
|
import { createHash as createHash8 } from "crypto";
|
|
418549
418551
|
import { realpathSync as realpathSync19 } from "fs";
|
|
418550
|
-
import { homedir as
|
|
418552
|
+
import { homedir as homedir33 } from "os";
|
|
418551
418553
|
import { join as join127, resolve as resolve37 } from "path";
|
|
418552
418554
|
function mirrorStorageDir() {
|
|
418553
|
-
return join127(process.env.XDG_DATA_HOME ?? join127(
|
|
418555
|
+
return join127(process.env.XDG_DATA_HOME ?? join127(homedir33(), ".local", "share"), "opencode", "storage", "matrixos", MIRROR_DIR_NAME);
|
|
418554
418556
|
}
|
|
418555
418557
|
function canonicalProjectDir(projectDir) {
|
|
418556
418558
|
try {
|
|
@@ -421154,7 +421156,7 @@ async function createRuntimeSkillSourceServer(options, runtimeEnv = runtime6) {
|
|
|
421154
421156
|
// packages/claude-code-compat-core/src/features/claude-code-mcp-loader/loader.ts
|
|
421155
421157
|
import { existsSync as existsSync108, readFileSync as readFileSync74 } from "fs";
|
|
421156
421158
|
import { join as join129 } from "path";
|
|
421157
|
-
import { homedir as
|
|
421159
|
+
import { homedir as homedir34 } from "os";
|
|
421158
421160
|
function getMcpConfigPaths() {
|
|
421159
421161
|
const claudeConfigDir = getClaudeConfigDir3();
|
|
421160
421162
|
const homeDir = getHomeDir();
|
|
@@ -421167,7 +421169,7 @@ function getMcpConfigPaths() {
|
|
|
421167
421169
|
];
|
|
421168
421170
|
}
|
|
421169
421171
|
function getHomeDir() {
|
|
421170
|
-
return process.env.HOME || process.env.USERPROFILE ||
|
|
421172
|
+
return process.env.HOME || process.env.USERPROFILE || homedir34();
|
|
421171
421173
|
}
|
|
421172
421174
|
async function loadMcpConfigFile(filePath) {
|
|
421173
421175
|
if (!existsSync108(filePath)) {
|
|
@@ -428387,14 +428389,14 @@ function createTankAgent(model, availableAgents, availableToolNames, availableSk
|
|
|
428387
428389
|
createTankAgent.mode = MODE9;
|
|
428388
428390
|
// packages/omo-opencode/src/agents/builtin-agents/resolve-file-uri.ts
|
|
428389
428391
|
import { existsSync as existsSync109, readFileSync as readFileSync75 } from "fs";
|
|
428390
|
-
import { homedir as
|
|
428392
|
+
import { homedir as homedir35 } from "os";
|
|
428391
428393
|
import { isAbsolute as isAbsolute19, join as join130, resolve as resolve38 } from "path";
|
|
428392
428394
|
init_logger2();
|
|
428393
428395
|
var ALLOWED_HOME_SUBDIRS = [
|
|
428394
|
-
join130(
|
|
428395
|
-
join130(
|
|
428396
|
-
join130(
|
|
428397
|
-
join130(
|
|
428396
|
+
join130(homedir35(), ".config", "opencode"),
|
|
428397
|
+
join130(homedir35(), ".config", "MaTrixOS"),
|
|
428398
|
+
join130(homedir35(), ".omo"),
|
|
428399
|
+
join130(homedir35(), ".opencode")
|
|
428398
428400
|
];
|
|
428399
428401
|
function isWithinAllowedPaths(filePath, projectRoot) {
|
|
428400
428402
|
if (isWithinProject(filePath, projectRoot))
|
|
@@ -428412,7 +428414,7 @@ function resolvePromptAppend(promptAppend, configDir) {
|
|
|
428412
428414
|
let filePath;
|
|
428413
428415
|
try {
|
|
428414
428416
|
const decoded = decodeURIComponent(encoded);
|
|
428415
|
-
const expanded = decoded.startsWith("~/") ? decoded.replace(/^~\//, `${
|
|
428417
|
+
const expanded = decoded.startsWith("~/") ? decoded.replace(/^~\//, `${homedir35()}/`) : decoded;
|
|
428416
428418
|
filePath = isAbsolute19(expanded) ? expanded : resolve38(configDir ?? process.cwd(), expanded);
|
|
428417
428419
|
} catch (error) {
|
|
428418
428420
|
if (!(error instanceof Error)) {
|
|
@@ -438662,13 +438664,34 @@ function createChatHeadersHandler(args) {
|
|
|
438662
438664
|
// packages/omo-opencode/src/plugin/auto-adoption.ts
|
|
438663
438665
|
import { existsSync as existsSync112, readFileSync as readFileSync77 } from "fs";
|
|
438664
438666
|
import { join as join134 } from "path";
|
|
438665
|
-
import { homedir as
|
|
438667
|
+
import { homedir as homedir36 } from "os";
|
|
438666
438668
|
var ADOPTION_CONTEXT_RELATIVE = join134("MOS_Vault", "04-Areas", "user-context.md");
|
|
438667
438669
|
function resolveUserContextPath() {
|
|
438668
|
-
const base = process.env.MOS_VAULT_DIR ?? join134(
|
|
438670
|
+
const base = process.env.MOS_VAULT_DIR ?? join134(homedir36(), "MOS_Vault");
|
|
438669
438671
|
return join134(base, "04-Areas", "user-context.md");
|
|
438670
438672
|
}
|
|
438673
|
+
function isAutoAdoptionEnabled() {
|
|
438674
|
+
const candidates = [
|
|
438675
|
+
join134(homedir36(), ".config", "opencode", "matrixos.json"),
|
|
438676
|
+
join134(homedir36(), ".config", "opencode", "matrixos.jsonc")
|
|
438677
|
+
];
|
|
438678
|
+
for (const cfgPath of candidates) {
|
|
438679
|
+
try {
|
|
438680
|
+
if (!existsSync112(cfgPath))
|
|
438681
|
+
continue;
|
|
438682
|
+
const raw = readFileSync77(cfgPath, "utf8");
|
|
438683
|
+
const json2 = raw.replace(/\/\/.*$/gm, "").replace(/\/\*[^]*?\*\//g, "");
|
|
438684
|
+
const parsed = JSON.parse(json2);
|
|
438685
|
+
return parsed.autoAdoption === true;
|
|
438686
|
+
} catch {
|
|
438687
|
+
continue;
|
|
438688
|
+
}
|
|
438689
|
+
}
|
|
438690
|
+
return false;
|
|
438691
|
+
}
|
|
438671
438692
|
function isAdoptionNeeded() {
|
|
438693
|
+
if (!isAutoAdoptionEnabled())
|
|
438694
|
+
return false;
|
|
438672
438695
|
const path26 = resolveUserContextPath();
|
|
438673
438696
|
if (!existsSync112(path26))
|
|
438674
438697
|
return true;
|
|
@@ -442283,7 +442306,7 @@ function createRealProcessInfoProvider() {
|
|
|
442283
442306
|
|
|
442284
442307
|
// packages/omo-opencode/src/plugin-config/layered-config-loader.ts
|
|
442285
442308
|
import * as fs30 from "fs";
|
|
442286
|
-
import { homedir as
|
|
442309
|
+
import { homedir as homedir37 } from "os";
|
|
442287
442310
|
import * as path28 from "path";
|
|
442288
442311
|
|
|
442289
442312
|
// packages/omo-opencode/src/config/schema/agent-names.ts
|
|
@@ -444343,7 +444366,7 @@ function loadConfigFromPath2(configPath, _ctx) {
|
|
|
444343
444366
|
|
|
444344
444367
|
// packages/omo-opencode/src/plugin-config/layered-config-loader.ts
|
|
444345
444368
|
function resolveHomeDirectory() {
|
|
444346
|
-
return process.env.HOME ?? process.env.USERPROFILE ??
|
|
444369
|
+
return process.env.HOME ?? process.env.USERPROFILE ?? homedir37();
|
|
444347
444370
|
}
|
|
444348
444371
|
function resolveConfigPathAfterLegacyMigration(detectedPath) {
|
|
444349
444372
|
if (!path28.basename(detectedPath).startsWith(LEGACY_CONFIG_BASENAME)) {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* True when adoption is incomplete
|
|
2
|
+
* True when adoption is incomplete AND auto-adoption is enabled:
|
|
3
3
|
* - no user-context.md yet, OR
|
|
4
4
|
* - user-context.md exists but the opt-in features were never presented
|
|
5
5
|
* (a user who already has context but never saw the feature checklist
|
|
6
|
-
* would otherwise treat the truncated state as truth
|
|
7
|
-
*
|
|
6
|
+
* would otherwise treat the truncated state as truth).
|
|
7
|
+
*
|
|
8
|
+
* Returns false when autoAdoption is disabled (default) — the user adopts
|
|
9
|
+
* explicitly via /adopt.
|
|
8
10
|
*/
|
|
9
11
|
export declare function isAdoptionNeeded(): boolean;
|
|
10
12
|
export declare const ADOPTION_TRIGGER_INSTRUCTION = "SYST\u00C8ME \u2014 Rituel d'adoption automatique : lance imm\u00E9diatement le rituel d'adoption comme si l'utilisateur avait tap\u00E9 /adopt. M\u00EAme si un contexte utilisateur (user-context.md) existe d\u00E9j\u00E0, tu DOIS proposer les fonctionnalit\u00E9s opt-in (especially Dashboard Mission Control sur 127.0.0.1:9123) \u2014 ne saute jamais cette \u00E9tape. Pose les 5 questions (identit\u00E9, projet, contraintes, style de collaboration, reporting), puis pr\u00E9sente la checklist des fonctionnalit\u00E9s opt-in depuis l'inventaire (OPT_IN_FEATURES). Utilise l'outil question pour les questions. Ne r\u00E9ponds pas encore \u00E0 la demande de l'utilisateur \u2014 l'adoption prime.";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kl-c/matrixos",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
4
4
|
"description": "MaTrixOS — Agentic OS for OpenCode. Personalizable, communicating, self-improving, resilient.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -102,7 +102,8 @@
|
|
|
102
102
|
"typecheck:packages": "tsgo --noEmit -p packages/rules-engine/tsconfig.json && tsgo --noEmit -p packages/delegate-core/tsconfig.json && tsgo --noEmit -p packages/mcp-stdio-core/tsconfig.json && tsgo --noEmit -p packages/mcp-client-core/tsconfig.json && tsgo --noEmit -p packages/git-bash-mcp/tsconfig.json && tsgo --noEmit -p packages/lsp-core/tsconfig.json && tsgo --noEmit -p packages/utils/tsconfig.json && tsgo --noEmit -p packages/model-core/tsconfig.json && tsgo --noEmit -p packages/omo-config-core/tsconfig.json && tsgo --noEmit -p packages/prompts-core/tsconfig.json && tsgo --noEmit -p packages/comment-checker-core/tsconfig.json && tsgo --noEmit -p packages/hashline-core/tsconfig.json && tsgo --noEmit -p packages/tmux-core/tsconfig.json && tsgo --noEmit -p packages/team-core/tsconfig.json && tsgo --noEmit -p packages/matrix-gateway-core/tsconfig.json && tsgo --noEmit -p packages/boulder-state/tsconfig.json && tsgo --noEmit -p packages/learning-loop/tsconfig.json && tsgo --noEmit -p packages/telemetry-core/tsconfig.json && tsgo --noEmit -p packages/claude-code-compat-core/tsconfig.json && tsgo --noEmit -p packages/skills-loader-core/tsconfig.json && tsgo --noEmit -p packages/agents-md-core/tsconfig.json && tsgo --noEmit -p packages/task-ledger-core/tsconfig.json && tsgo --noEmit -p packages/egress-core/tsconfig.json && tsgo --noEmit -p packages/http-server-core/tsconfig.json && tsgo --noEmit -p packages/webhook-core/tsconfig.json && tsgo --noEmit -p packages/daily-brief-core/tsconfig.json && tsgo --noEmit -p packages/omo-opencode/tsconfig.json",
|
|
103
103
|
"typecheck:script": "tsgo --noEmit -p script/tsconfig.json",
|
|
104
104
|
"test": "bun test",
|
|
105
|
-
"build:git-bash-mcp": "bun run --cwd packages/git-bash-mcp build"
|
|
105
|
+
"build:git-bash-mcp": "bun run --cwd packages/git-bash-mcp build",
|
|
106
|
+
"build:slash-commands": "rm -rf dist/cli/slash-commands && mkdir -p dist/cli/slash-commands && cp packages/omo-opencode/src/cli/slash-commands/*.md dist/cli/slash-commands/"
|
|
106
107
|
},
|
|
107
108
|
"keywords": [
|
|
108
109
|
"opencode",
|