@kl-c/matrixos 0.3.13 → 0.3.15

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 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.13",
2166
+ version: "0.3.15",
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",
@@ -166223,6 +166223,15 @@ __export(exports_gateway_start, {
166223
166223
  });
166224
166224
  import { readFileSync as readFileSync64, existsSync as existsSync78 } from "fs";
166225
166225
  import { resolve as resolve19 } from "path";
166226
+ import { execSync as execSync2 } from "child_process";
166227
+ function resolveMatrixosCommand(fallback = "matrixos") {
166228
+ try {
166229
+ const p2 = execSync2("command -v matrixos", { encoding: "utf8", timeout: 5000 }).trim();
166230
+ if (p2)
166231
+ return p2;
166232
+ } catch {}
166233
+ return fallback;
166234
+ }
166226
166235
  function loadGatewayEnv(path29 = ENV_PATH) {
166227
166236
  if (!existsSync78(path29))
166228
166237
  return {};
@@ -166306,9 +166315,17 @@ async function runGatewayStart(opts = {}) {
166306
166315
  const adapter2 = opts.adapterFactory ? opts.adapterFactory(channelConfig) : new TelegramAdapter(channelConfig);
166307
166316
  gateway2.registerAdapter(adapter2);
166308
166317
  gateway2.setHandler(async (env6) => {
166318
+ let command = opts.command ?? DEFAULT_MATRIXOS_COMMAND;
166319
+ let fixedArgs = [];
166320
+ const commandParts = command.trim().split(/\s+/);
166321
+ if (commandParts.length > 1) {
166322
+ command = commandParts[0];
166323
+ fixedArgs = commandParts.slice(1);
166324
+ }
166325
+ const args = opts.args ? [...fixedArgs, ...opts.args] : undefined;
166309
166326
  const r2 = await handleGatewayMessage(env6, {
166310
- command: opts.command,
166311
- args: opts.args,
166327
+ command,
166328
+ args,
166312
166329
  timeoutMs: opts.timeoutMs
166313
166330
  });
166314
166331
  console.error("[gateway-start] handler done", r2.ok, r2.reply?.slice(0, 50));
@@ -166346,11 +166363,12 @@ async function runGatewayStart(opts = {}) {
166346
166363
  message: `gateway started (channel=${channelType}, pid=${process.pid})`
166347
166364
  };
166348
166365
  }
166349
- var ENV_PATH;
166366
+ var ENV_PATH, DEFAULT_MATRIXOS_COMMAND;
166350
166367
  var init_gateway_start = __esm(() => {
166351
166368
  init_src4();
166352
166369
  init_gateway_handler();
166353
166370
  ENV_PATH = resolve19(process.cwd(), ".klc-gateway.env");
166371
+ DEFAULT_MATRIXOS_COMMAND = resolveMatrixosCommand();
166354
166372
  });
166355
166373
 
166356
166374
  // packages/omo-opencode/src/deployment/deployment-core.ts
@@ -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.13",
2166
+ version: "0.3.15",
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",
@@ -166278,6 +166278,15 @@ __export(exports_gateway_start, {
166278
166278
  });
166279
166279
  import { readFileSync as readFileSync64, existsSync as existsSync78 } from "fs";
166280
166280
  import { resolve as resolve19 } from "path";
166281
+ import { execSync as execSync2 } from "child_process";
166282
+ function resolveMatrixosCommand(fallback = "matrixos") {
166283
+ try {
166284
+ const p2 = execSync2("command -v matrixos", { encoding: "utf8", timeout: 5000 }).trim();
166285
+ if (p2)
166286
+ return p2;
166287
+ } catch {}
166288
+ return fallback;
166289
+ }
166281
166290
  function loadGatewayEnv(path29 = ENV_PATH) {
166282
166291
  if (!existsSync78(path29))
166283
166292
  return {};
@@ -166361,9 +166370,17 @@ async function runGatewayStart(opts = {}) {
166361
166370
  const adapter2 = opts.adapterFactory ? opts.adapterFactory(channelConfig) : new TelegramAdapter(channelConfig);
166362
166371
  gateway2.registerAdapter(adapter2);
166363
166372
  gateway2.setHandler(async (env6) => {
166373
+ let command = opts.command ?? DEFAULT_MATRIXOS_COMMAND;
166374
+ let fixedArgs = [];
166375
+ const commandParts = command.trim().split(/\s+/);
166376
+ if (commandParts.length > 1) {
166377
+ command = commandParts[0];
166378
+ fixedArgs = commandParts.slice(1);
166379
+ }
166380
+ const args = opts.args ? [...fixedArgs, ...opts.args] : undefined;
166364
166381
  const r2 = await handleGatewayMessage(env6, {
166365
- command: opts.command,
166366
- args: opts.args,
166382
+ command,
166383
+ args,
166367
166384
  timeoutMs: opts.timeoutMs
166368
166385
  });
166369
166386
  console.error("[gateway-start] handler done", r2.ok, r2.reply?.slice(0, 50));
@@ -166401,11 +166418,12 @@ async function runGatewayStart(opts = {}) {
166401
166418
  message: `gateway started (channel=${channelType}, pid=${process.pid})`
166402
166419
  };
166403
166420
  }
166404
- var ENV_PATH;
166421
+ var ENV_PATH, DEFAULT_MATRIXOS_COMMAND;
166405
166422
  var init_gateway_start = __esm(() => {
166406
166423
  init_src4();
166407
166424
  init_gateway_handler();
166408
166425
  ENV_PATH = resolve19(process.cwd(), ".klc-gateway.env");
166426
+ DEFAULT_MATRIXOS_COMMAND = resolveMatrixosCommand();
166409
166427
  });
166410
166428
 
166411
166429
  // packages/omo-opencode/src/deployment/deployment-core.ts
package/dist/index.js CHANGED
@@ -368019,7 +368019,7 @@ function getCachedVersion(options = {}) {
368019
368019
  // package.json
368020
368020
  var package_default = {
368021
368021
  name: "@kl-c/matrixos",
368022
- version: "0.3.13",
368022
+ version: "0.3.15",
368023
368023
  description: "MaTrixOS \u2014 Agentic OS for OpenCode. Personalizable, communicating, self-improving, resilient.",
368024
368024
  main: "./dist/index.js",
368025
368025
  types: "dist/index.d.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kl-c/matrixos",
3
- "version": "0.3.13",
3
+ "version": "0.3.15",
4
4
  "description": "MaTrixOS \u2014 Agentic OS for OpenCode. Personalizable, communicating, self-improving, resilient.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "dist/index.d.ts",