@kl-c/matrixos 0.2.7 → 0.2.9

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.
@@ -39,6 +39,10 @@ export interface GatewayHandlerResult {
39
39
  * the subprocess).
40
40
  */
41
41
  export declare const ADOPT_COMMAND = "/adopt";
42
+ export declare const READOPT_COMMAND = "/readopt";
43
+ export declare const TELEGRAM_ADOPT_COMMAND = "/matrix-gateway-adopt-telegram";
44
+ export declare function isReadoptCommand(env: UnifiedEnvelope): boolean;
45
+ export declare function isTelegramAdoptCommand(env: UnifiedEnvelope): boolean;
42
46
  export declare function isAdoptCommand(env: UnifiedEnvelope): boolean;
43
47
  export declare function handleAdoptCommand(env: UnifiedEnvelope, opts?: GatewayHandlerOptions): Promise<GatewayHandlerResult>;
44
48
  export declare function handleGatewayMessage(env: UnifiedEnvelope, opts?: GatewayHandlerOptions): Promise<GatewayHandlerResult>;
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 homedir23 } from "os";
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(homedir23(), ".omo"));
13458
+ return expandHomeDirectory(config.base_dir ?? path14.join(homedir24(), ".omo"));
13459
13459
  }
13460
13460
  function expandHomeDirectory(directoryPath) {
13461
13461
  if (directoryPath === "~") {
13462
- return homedir23();
13462
+ return homedir24();
13463
13463
  }
13464
13464
  if (directoryPath.startsWith("~/") || directoryPath.startsWith("~\\")) {
13465
- return path14.join(homedir23(), directoryPath.slice(2));
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 ?? getConfigDir();
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 homedir16, tmpdir as tmpdir3 } from "os";
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(homedir16(), "AppData", "Local");
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(homedir16(), ".cache");
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 homedir17 } from "os";
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 || homedir17(), skipClaudeUserRules, candidates, seenRealPaths, cache);
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 homedir18 } from "os";
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 = homedir18,
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.7",
368027
+ version: "0.2.9",
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",
@@ -369200,7 +369201,7 @@ v${latestVersion} available. Restart OpenCode to apply.` : "OpenCode is now on S
369200
369201
  // packages/omo-opencode/src/hooks/codegraph-bootstrap/hook.ts
369201
369202
  init_src();
369202
369203
  import { existsSync as existsSync72 } from "fs";
369203
- import { homedir as homedir21 } from "os";
369204
+ import { homedir as homedir22 } from "os";
369204
369205
  import { join as join81 } from "path";
369205
369206
 
369206
369207
  // packages/omo-opencode/src/hooks/codegraph-bootstrap/command-runner.ts
@@ -369354,7 +369355,7 @@ function defaultSchedule(task) {
369354
369355
  timer.unref?.();
369355
369356
  }
369356
369357
  function defaultInstallDir2() {
369357
- return join81(homedir21(), ".omo", "codegraph");
369358
+ return join81(homedir22(), ".omo", "codegraph");
369358
369359
  }
369359
369360
  function provisionedBinFromInstallDir(installDir) {
369360
369361
  if (installDir === undefined)
@@ -369493,7 +369494,7 @@ function createCodegraphBootstrapHook(ctx, config, depsOverride = {}) {
369493
369494
  }
369494
369495
  // packages/omo-opencode/src/hooks/ast-grep-sg-provision/hook.ts
369495
369496
  init_src();
369496
- import { homedir as homedir22 } from "os";
369497
+ import { homedir as homedir23 } from "os";
369497
369498
  import { join as join82 } from "path";
369498
369499
  var provisionedTargets = new Set;
369499
369500
  function defaultSchedule2(task) {
@@ -369513,7 +369514,7 @@ async function runProvision(targetDir, deps) {
369513
369514
  }
369514
369515
  var defaultDeps5 = {
369515
369516
  findSgBinary: findSgBinarySync,
369516
- homeDir: homedir22,
369517
+ homeDir: homedir23,
369517
369518
  log: log2,
369518
369519
  provisionSgBinary,
369519
369520
  schedule: defaultSchedule2
@@ -377727,7 +377728,7 @@ import { basename as basename14, dirname as dirname26, join as join90 } from "pa
377727
377728
 
377728
377729
  // packages/skills-loader-core/src/shared/opencode-config-dir.ts
377729
377730
  import { existsSync as existsSync77, realpathSync as realpathSync12 } from "fs";
377730
- import { homedir as homedir24 } from "os";
377731
+ import { homedir as homedir25 } from "os";
377731
377732
  import { join as join89, posix as posix4, resolve as resolve21, win32 as win325 } from "path";
377732
377733
 
377733
377734
  // packages/skills-loader-core/src/shared/plugin-identity.ts
@@ -377761,14 +377762,14 @@ function getTauriConfigDir2(identifier) {
377761
377762
  const platform2 = process.platform;
377762
377763
  switch (platform2) {
377763
377764
  case "darwin":
377764
- return join89(homedir24(), "Library", "Application Support", identifier);
377765
+ return join89(homedir25(), "Library", "Application Support", identifier);
377765
377766
  case "win32": {
377766
- const appData = process.env.APPDATA || join89(homedir24(), "AppData", "Roaming");
377767
+ const appData = process.env.APPDATA || join89(homedir25(), "AppData", "Roaming");
377767
377768
  return win325.join(appData, identifier);
377768
377769
  }
377769
377770
  case "linux":
377770
377771
  default: {
377771
- const xdgConfig = process.env.XDG_CONFIG_HOME || join89(homedir24(), ".config");
377772
+ const xdgConfig = process.env.XDG_CONFIG_HOME || join89(homedir25(), ".config");
377772
377773
  return join89(xdgConfig, identifier);
377773
377774
  }
377774
377775
  }
@@ -377812,7 +377813,7 @@ function getWslLinuxHomeDir2(windowsConfigRoot) {
377812
377813
  function getCliDefaultConfigDir2() {
377813
377814
  const envXdgConfig = process.env.XDG_CONFIG_HOME?.trim();
377814
377815
  const shouldIgnoreWindowsXdg = envXdgConfig !== undefined && envXdgConfig.length > 0 && isWslEnvironment2() && isWindowsUserConfigRoot2(envXdgConfig);
377815
- const xdgConfig = shouldIgnoreWindowsXdg ? posix4.join(getWslLinuxHomeDir2(envXdgConfig) ?? "/home", ".config") : envXdgConfig || join89(homedir24(), ".config");
377816
+ const xdgConfig = shouldIgnoreWindowsXdg ? posix4.join(getWslLinuxHomeDir2(envXdgConfig) ?? "/home", ".config") : envXdgConfig || join89(homedir25(), ".config");
377816
377817
  const configDir = isWslEnvironment2() ? posix4.join(xdgConfig, "opencode") : join89(xdgConfig, "opencode");
377817
377818
  return resolveConfigPath2(configDir);
377818
377819
  }
@@ -378470,14 +378471,14 @@ function builtinToLoadedSkill(builtin) {
378470
378471
  init_src();
378471
378472
  import { existsSync as existsSync80, readFileSync as readFileSync51 } from "fs";
378472
378473
  import { dirname as dirname28, isAbsolute as isAbsolute13, resolve as resolve23 } from "path";
378473
- import { homedir as homedir25 } from "os";
378474
+ import { homedir as homedir26 } from "os";
378474
378475
  function resolveFilePath5(from, configDir) {
378475
378476
  let filePath = from;
378476
378477
  if (filePath.startsWith("{file:") && filePath.endsWith("}")) {
378477
378478
  filePath = filePath.slice(6, -1);
378478
378479
  }
378479
378480
  if (filePath.startsWith("~/")) {
378480
- return resolve23(homedir25(), filePath.slice(2));
378481
+ return resolve23(homedir26(), filePath.slice(2));
378481
378482
  }
378482
378483
  if (isAbsolute13(filePath)) {
378483
378484
  return filePath;
@@ -381721,7 +381722,7 @@ function isDisabledSkillName(name, disabledSkills) {
381721
381722
  init_src();
381722
381723
  var import_picomatch2 = __toESM(require_picomatch2(), 1);
381723
381724
  import * as fs20 from "fs/promises";
381724
- import { homedir as homedir26 } from "os";
381725
+ import { homedir as homedir27 } from "os";
381725
381726
  import { dirname as dirname30, extname as extname2, isAbsolute as isAbsolute14, join as join98, relative as relative12 } from "path";
381726
381727
  var MAX_RECURSIVE_DEPTH = 10;
381727
381728
  function isHttpUrl(path17) {
@@ -381729,10 +381730,10 @@ function isHttpUrl(path17) {
381729
381730
  }
381730
381731
  function toAbsolutePath(path17, configDir) {
381731
381732
  if (path17 === "~") {
381732
- return homedir26();
381733
+ return homedir27();
381733
381734
  }
381734
381735
  if (path17.startsWith("~/")) {
381735
- return join98(homedir26(), path17.slice(2));
381736
+ return join98(homedir27(), path17.slice(2));
381736
381737
  }
381737
381738
  if (isAbsolute14(path17)) {
381738
381739
  return path17;
@@ -397940,18 +397941,18 @@ import { existsSync as existsSync98, readdirSync as readdirSync23 } from "fs";
397940
397941
  import { join as join113 } from "path";
397941
397942
 
397942
397943
  // packages/claude-code-compat-core/src/shared/claude-config-dir.ts
397943
- import { homedir as homedir27 } from "os";
397944
+ import { homedir as homedir28 } from "os";
397944
397945
  import { join as join108 } from "path";
397945
397946
  function getClaudeConfigDir3() {
397946
397947
  const envConfigDir = process.env.CLAUDE_CONFIG_DIR;
397947
397948
  if (envConfigDir) {
397948
397949
  return envConfigDir;
397949
397950
  }
397950
- return join108(process.env.HOME || process.env.USERPROFILE || homedir27(), ".claude");
397951
+ return join108(process.env.HOME || process.env.USERPROFILE || homedir28(), ".claude");
397951
397952
  }
397952
397953
  // packages/claude-code-compat-core/src/shared/opencode-config-dir.ts
397953
397954
  import { existsSync as existsSync94, realpathSync as realpathSync16 } from "fs";
397954
- import { homedir as homedir28 } from "os";
397955
+ import { homedir as homedir29 } from "os";
397955
397956
  import { join as join109, posix as posix6, resolve as resolve33, win32 as win329 } from "path";
397956
397957
  var TAURI_APP_IDENTIFIER3 = "ai.opencode.desktop";
397957
397958
  var TAURI_APP_IDENTIFIER_DEV3 = "ai.opencode.desktop.dev";
@@ -397964,14 +397965,14 @@ function getTauriConfigDir3(identifier) {
397964
397965
  const platform3 = process.platform;
397965
397966
  switch (platform3) {
397966
397967
  case "darwin":
397967
- return join109(homedir28(), "Library", "Application Support", identifier);
397968
+ return join109(homedir29(), "Library", "Application Support", identifier);
397968
397969
  case "win32": {
397969
- const appData = process.env.APPDATA || join109(homedir28(), "AppData", "Roaming");
397970
+ const appData = process.env.APPDATA || join109(homedir29(), "AppData", "Roaming");
397970
397971
  return win329.join(appData, identifier);
397971
397972
  }
397972
397973
  case "linux":
397973
397974
  default: {
397974
- const xdgConfig = process.env.XDG_CONFIG_HOME || join109(homedir28(), ".config");
397975
+ const xdgConfig = process.env.XDG_CONFIG_HOME || join109(homedir29(), ".config");
397975
397976
  return join109(xdgConfig, identifier);
397976
397977
  }
397977
397978
  }
@@ -398015,7 +398016,7 @@ function getWslLinuxHomeDir3(windowsConfigRoot) {
398015
398016
  function getCliDefaultConfigDir3() {
398016
398017
  const envXdgConfig = process.env.XDG_CONFIG_HOME?.trim();
398017
398018
  const shouldIgnoreWindowsXdg = envXdgConfig !== undefined && envXdgConfig.length > 0 && isWslEnvironment3() && isWindowsUserConfigRoot3(envXdgConfig);
398018
- const xdgConfig = shouldIgnoreWindowsXdg ? posix6.join(getWslLinuxHomeDir3(envXdgConfig) ?? "/home", ".config") : envXdgConfig || join109(homedir28(), ".config");
398019
+ const xdgConfig = shouldIgnoreWindowsXdg ? posix6.join(getWslLinuxHomeDir3(envXdgConfig) ?? "/home", ".config") : envXdgConfig || join109(homedir29(), ".config");
398019
398020
  const configDir = isWslEnvironment3() ? posix6.join(xdgConfig, "opencode") : join109(xdgConfig, "opencode");
398020
398021
  return resolveConfigPath3(configDir);
398021
398022
  }
@@ -398060,11 +398061,11 @@ function getOpenCodeConfigDir3(options) {
398060
398061
  // packages/claude-code-compat-core/src/shared/jsonc-parser.ts
398061
398062
  init_src();
398062
398063
  // packages/claude-code-compat-core/src/shared/resolve-agent-definition-paths.ts
398063
- import { homedir as homedir29 } from "os";
398064
+ import { homedir as homedir30 } from "os";
398064
398065
  import { isAbsolute as isAbsolute17, join as join110, resolve as resolve34 } from "path";
398065
398066
  function resolveAgentDefinitionPaths2(paths, baseDir, containmentDir) {
398066
398067
  return paths.flatMap((p) => {
398067
- const expanded = p.startsWith("~/") ? join110(homedir29(), p.slice(2)) : p;
398068
+ const expanded = p.startsWith("~/") ? join110(homedir30(), p.slice(2)) : p;
398068
398069
  const resolved = isAbsolute17(expanded) ? expanded : resolve34(baseDir, expanded);
398069
398070
  if (containmentDir !== null && !isWithinProject(resolved, containmentDir)) {
398070
398071
  log4(`agent_definitions path rejected (outside project boundary): ${p} -> ${resolved}`);
@@ -412975,7 +412976,7 @@ import { basename as basename22, dirname as dirname42, join as join126 } from "p
412975
412976
 
412976
412977
  // packages/mcp-client-core/src/config-dir.ts
412977
412978
  import { existsSync as existsSync105, realpathSync as realpathSync18 } from "fs";
412978
- import { homedir as homedir31 } from "os";
412979
+ import { homedir as homedir32 } from "os";
412979
412980
  import { join as join124, resolve as resolve36 } from "path";
412980
412981
  function resolveConfigPath4(pathValue) {
412981
412982
  const resolvedPath = resolve36(pathValue);
@@ -412994,7 +412995,7 @@ function getOpenCodeCliConfigDir(env2 = process.env) {
412994
412995
  if (customConfigDir) {
412995
412996
  return resolveConfigPath4(customConfigDir);
412996
412997
  }
412997
- const xdgConfigDir = env2["XDG_CONFIG_HOME"]?.trim() || join124(homedir31(), ".config");
412998
+ const xdgConfigDir = env2["XDG_CONFIG_HOME"]?.trim() || join124(homedir32(), ".config");
412998
412999
  return resolveConfigPath4(join124(xdgConfigDir, "opencode"));
412999
413000
  }
413000
413001
 
@@ -418547,10 +418548,10 @@ import { dirname as dirname43 } from "path";
418547
418548
  // packages/omo-opencode/src/features/tui-sidebar/mirror-path.ts
418548
418549
  import { createHash as createHash8 } from "crypto";
418549
418550
  import { realpathSync as realpathSync19 } from "fs";
418550
- import { homedir as homedir32 } from "os";
418551
+ import { homedir as homedir33 } from "os";
418551
418552
  import { join as join127, resolve as resolve37 } from "path";
418552
418553
  function mirrorStorageDir() {
418553
- return join127(process.env.XDG_DATA_HOME ?? join127(homedir32(), ".local", "share"), "opencode", "storage", "matrixos", MIRROR_DIR_NAME);
418554
+ return join127(process.env.XDG_DATA_HOME ?? join127(homedir33(), ".local", "share"), "opencode", "storage", "matrixos", MIRROR_DIR_NAME);
418554
418555
  }
418555
418556
  function canonicalProjectDir(projectDir) {
418556
418557
  try {
@@ -421154,7 +421155,7 @@ async function createRuntimeSkillSourceServer(options, runtimeEnv = runtime6) {
421154
421155
  // packages/claude-code-compat-core/src/features/claude-code-mcp-loader/loader.ts
421155
421156
  import { existsSync as existsSync108, readFileSync as readFileSync74 } from "fs";
421156
421157
  import { join as join129 } from "path";
421157
- import { homedir as homedir33 } from "os";
421158
+ import { homedir as homedir34 } from "os";
421158
421159
  function getMcpConfigPaths() {
421159
421160
  const claudeConfigDir = getClaudeConfigDir3();
421160
421161
  const homeDir = getHomeDir();
@@ -421167,7 +421168,7 @@ function getMcpConfigPaths() {
421167
421168
  ];
421168
421169
  }
421169
421170
  function getHomeDir() {
421170
- return process.env.HOME || process.env.USERPROFILE || homedir33();
421171
+ return process.env.HOME || process.env.USERPROFILE || homedir34();
421171
421172
  }
421172
421173
  async function loadMcpConfigFile(filePath) {
421173
421174
  if (!existsSync108(filePath)) {
@@ -428387,14 +428388,14 @@ function createTankAgent(model, availableAgents, availableToolNames, availableSk
428387
428388
  createTankAgent.mode = MODE9;
428388
428389
  // packages/omo-opencode/src/agents/builtin-agents/resolve-file-uri.ts
428389
428390
  import { existsSync as existsSync109, readFileSync as readFileSync75 } from "fs";
428390
- import { homedir as homedir34 } from "os";
428391
+ import { homedir as homedir35 } from "os";
428391
428392
  import { isAbsolute as isAbsolute19, join as join130, resolve as resolve38 } from "path";
428392
428393
  init_logger2();
428393
428394
  var ALLOWED_HOME_SUBDIRS = [
428394
- join130(homedir34(), ".config", "opencode"),
428395
- join130(homedir34(), ".config", "MaTrixOS"),
428396
- join130(homedir34(), ".omo"),
428397
- join130(homedir34(), ".opencode")
428395
+ join130(homedir35(), ".config", "opencode"),
428396
+ join130(homedir35(), ".config", "MaTrixOS"),
428397
+ join130(homedir35(), ".omo"),
428398
+ join130(homedir35(), ".opencode")
428398
428399
  ];
428399
428400
  function isWithinAllowedPaths(filePath, projectRoot) {
428400
428401
  if (isWithinProject(filePath, projectRoot))
@@ -428412,7 +428413,7 @@ function resolvePromptAppend(promptAppend, configDir) {
428412
428413
  let filePath;
428413
428414
  try {
428414
428415
  const decoded = decodeURIComponent(encoded);
428415
- const expanded = decoded.startsWith("~/") ? decoded.replace(/^~\//, `${homedir34()}/`) : decoded;
428416
+ const expanded = decoded.startsWith("~/") ? decoded.replace(/^~\//, `${homedir35()}/`) : decoded;
428416
428417
  filePath = isAbsolute19(expanded) ? expanded : resolve38(configDir ?? process.cwd(), expanded);
428417
428418
  } catch (error) {
428418
428419
  if (!(error instanceof Error)) {
@@ -438662,13 +438663,34 @@ function createChatHeadersHandler(args) {
438662
438663
  // packages/omo-opencode/src/plugin/auto-adoption.ts
438663
438664
  import { existsSync as existsSync112, readFileSync as readFileSync77 } from "fs";
438664
438665
  import { join as join134 } from "path";
438665
- import { homedir as homedir35 } from "os";
438666
+ import { homedir as homedir36 } from "os";
438666
438667
  var ADOPTION_CONTEXT_RELATIVE = join134("MOS_Vault", "04-Areas", "user-context.md");
438667
438668
  function resolveUserContextPath() {
438668
- const base = process.env.MOS_VAULT_DIR ?? join134(homedir35(), "MOS_Vault");
438669
+ const base = process.env.MOS_VAULT_DIR ?? join134(homedir36(), "MOS_Vault");
438669
438670
  return join134(base, "04-Areas", "user-context.md");
438670
438671
  }
438672
+ function isAutoAdoptionEnabled() {
438673
+ const candidates = [
438674
+ join134(homedir36(), ".config", "opencode", "matrixos.json"),
438675
+ join134(homedir36(), ".config", "opencode", "matrixos.jsonc")
438676
+ ];
438677
+ for (const cfgPath of candidates) {
438678
+ try {
438679
+ if (!existsSync112(cfgPath))
438680
+ continue;
438681
+ const raw = readFileSync77(cfgPath, "utf8");
438682
+ const json2 = raw.replace(/\/\/.*$/gm, "").replace(/\/\*[^]*?\*\//g, "");
438683
+ const parsed = JSON.parse(json2);
438684
+ return parsed.autoAdoption === true;
438685
+ } catch {
438686
+ continue;
438687
+ }
438688
+ }
438689
+ return false;
438690
+ }
438671
438691
  function isAdoptionNeeded() {
438692
+ if (!isAutoAdoptionEnabled())
438693
+ return false;
438672
438694
  const path26 = resolveUserContextPath();
438673
438695
  if (!existsSync112(path26))
438674
438696
  return true;
@@ -442283,7 +442305,7 @@ function createRealProcessInfoProvider() {
442283
442305
 
442284
442306
  // packages/omo-opencode/src/plugin-config/layered-config-loader.ts
442285
442307
  import * as fs30 from "fs";
442286
- import { homedir as homedir36 } from "os";
442308
+ import { homedir as homedir37 } from "os";
442287
442309
  import * as path28 from "path";
442288
442310
 
442289
442311
  // packages/omo-opencode/src/config/schema/agent-names.ts
@@ -444343,7 +444365,7 @@ function loadConfigFromPath2(configPath, _ctx) {
444343
444365
 
444344
444366
  // packages/omo-opencode/src/plugin-config/layered-config-loader.ts
444345
444367
  function resolveHomeDirectory() {
444346
- return process.env.HOME ?? process.env.USERPROFILE ?? homedir36();
444368
+ return process.env.HOME ?? process.env.USERPROFILE ?? homedir37();
444347
444369
  }
444348
444370
  function resolveConfigPathAfterLegacyMigration(detectedPath) {
444349
444371
  if (!path28.basename(detectedPath).startsWith(LEGACY_CONFIG_BASENAME)) {
@@ -1,10 +1,12 @@
1
1
  /**
2
- * True when adoption is incomplete and the ritual should (re)run:
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 — see VPS cantabo,
7
- * where user-context.md existed but Dashboard/features were never offered).
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.7",
3
+ "version": "0.2.9",
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",
@@ -153,30 +153,30 @@
153
153
  "zod": "^4.4.3"
154
154
  },
155
155
  "devDependencies": {
156
- "@matrixos/agents-md-core": "workspace:*",
157
- "@matrixos/boulder-state": "workspace:*",
158
- "@matrixos/claude-code-compat-core": "workspace:*",
159
- "@matrixos/comment-checker-core": "workspace:*",
160
- "@matrixos/delegate-core": "workspace:*",
161
- "@matrixos/egress-core": "workspace:*",
162
- "@matrixos/git-bash-mcp": "workspace:*",
163
- "@matrixos/hashline-core": "workspace:*",
164
- "@matrixos/learning-loop": "workspace:*",
165
- "@matrixos/lsp-core": "workspace:*",
166
- "@matrixos/mcp-client-core": "workspace:*",
167
- "@matrixos/mcp-stdio-core": "workspace:*",
168
- "@matrixos/model-core": "workspace:*",
169
- "@matrixos/omo-config-core": "workspace:*",
170
- "@matrixos/matrix-gateway-core": "workspace:*",
171
- "@matrixos/prompts-core": "workspace:*",
172
- "@matrixos/rules-engine": "workspace:*",
173
- "@matrixos/rgpd-compliance-core": "workspace:*",
174
- "@matrixos/shared-skills": "workspace:*",
175
- "@matrixos/skills-loader-core": "workspace:*",
176
- "@matrixos/team-core": "workspace:*",
177
- "@matrixos/telemetry-core": "workspace:*",
178
- "@matrixos/tmux-core": "workspace:*",
179
- "@matrixos/utils": "workspace:*",
156
+ "@matrixos/agents-md-core": "0.1.27",
157
+ "@matrixos/boulder-state": "0.1.27",
158
+ "@matrixos/claude-code-compat-core": "0.1.27",
159
+ "@matrixos/comment-checker-core": "0.1.27",
160
+ "@matrixos/delegate-core": "0.1.27",
161
+ "@matrixos/egress-core": "0.1.27",
162
+ "@matrixos/git-bash-mcp": "0.0.0",
163
+ "@matrixos/hashline-core": "0.1.27",
164
+ "@matrixos/learning-loop": "0.1.27",
165
+ "@matrixos/lsp-core": "0.1.27",
166
+ "@matrixos/mcp-client-core": "0.1.27",
167
+ "@matrixos/mcp-stdio-core": "0.1.27",
168
+ "@matrixos/model-core": "0.1.27",
169
+ "@matrixos/omo-config-core": "0.1.27",
170
+ "@matrixos/matrix-gateway-core": "0.1.27",
171
+ "@matrixos/prompts-core": "0.1.27",
172
+ "@matrixos/rules-engine": "0.1.27",
173
+ "@matrixos/rgpd-compliance-core": "0.1.27",
174
+ "@matrixos/shared-skills": "0.1.27",
175
+ "@matrixos/skills-loader-core": "0.1.27",
176
+ "@matrixos/team-core": "0.1.27",
177
+ "@matrixos/telemetry-core": "0.1.27",
178
+ "@matrixos/tmux-core": "0.1.27",
179
+ "@matrixos/utils": "0.1.27",
180
180
  "@types/js-yaml": "^4.0.9",
181
181
  "@types/picomatch": "^4.0.3",
182
182
  "@typescript/native-preview": "7.0.0-dev.20260518.1",