@kl-c/matrixos 0.3.12 → 0.3.14

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.12",
2166
+ version: "0.3.14",
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",
@@ -166118,6 +166118,7 @@ async function runCliCommand(args, replyMsg) {
166118
166118
  }
166119
166119
  async function handleGatewayMessage(env5, opts = {}) {
166120
166120
  const text = env5.content.text ?? "";
166121
+ console.error("[gateway-handler] received", text.slice(0, 30));
166121
166122
  if (isReadoptCommand(env5)) {
166122
166123
  return runCliCommand(["adopt"], "Re-adoption MaTrixOS lancee. Suis le wizard localement.");
166123
166124
  }
@@ -166147,6 +166148,7 @@ async function handleGatewayMessage(env5, opts = {}) {
166147
166148
  env: { ...process.env, ...opts.env ?? {} },
166148
166149
  stdio: ["ignore", "pipe", "pipe"]
166149
166150
  });
166151
+ console.error("[gateway-handler] spawned", command, args);
166150
166152
  } catch (e) {
166151
166153
  finish({
166152
166154
  ok: false,
@@ -166183,6 +166185,7 @@ async function handleGatewayMessage(env5, opts = {}) {
166183
166185
  });
166184
166186
  child.on("close", (code) => {
166185
166187
  clearTimeout(timer);
166188
+ console.error("[gateway-handler] child closed code", code, "stdout len", stdout2.length);
166186
166189
  let reply = stdout2.trim();
166187
166190
  const lastBrace = reply.lastIndexOf("{");
166188
166191
  if (lastBrace >= 0) {
@@ -166220,6 +166223,15 @@ __export(exports_gateway_start, {
166220
166223
  });
166221
166224
  import { readFileSync as readFileSync64, existsSync as existsSync78 } from "fs";
166222
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
+ }
166223
166235
  function loadGatewayEnv(path29 = ENV_PATH) {
166224
166236
  if (!existsSync78(path29))
166225
166237
  return {};
@@ -166304,10 +166316,11 @@ async function runGatewayStart(opts = {}) {
166304
166316
  gateway2.registerAdapter(adapter2);
166305
166317
  gateway2.setHandler(async (env6) => {
166306
166318
  const r2 = await handleGatewayMessage(env6, {
166307
- command: opts.command,
166319
+ command: opts.command ?? DEFAULT_MATRIXOS_COMMAND,
166308
166320
  args: opts.args,
166309
166321
  timeoutMs: opts.timeoutMs
166310
166322
  });
166323
+ console.error("[gateway-start] handler done", r2.ok, r2.reply?.slice(0, 50));
166311
166324
  if (env6.content.text && r2.ok) {
166312
166325
  const reply = {
166313
166326
  id: "reply-" + env6.id,
@@ -166323,7 +166336,12 @@ async function runGatewayStart(opts = {}) {
166323
166336
  };
166324
166337
  try {
166325
166338
  await gateway2.send(reply);
166326
- } catch {}
166339
+ console.error("[gateway-start] reply sent");
166340
+ } catch (e) {
166341
+ console.error("[gateway-start] reply failed:", e instanceof Error ? e.message : String(e));
166342
+ }
166343
+ } else {
166344
+ console.error("[gateway-start] no reply: r.ok", r2.ok, "text", env6.content.text?.slice(0, 30));
166327
166345
  }
166328
166346
  });
166329
166347
  await gateway2.start();
@@ -166337,11 +166355,12 @@ async function runGatewayStart(opts = {}) {
166337
166355
  message: `gateway started (channel=${channelType}, pid=${process.pid})`
166338
166356
  };
166339
166357
  }
166340
- var ENV_PATH;
166358
+ var ENV_PATH, DEFAULT_MATRIXOS_COMMAND;
166341
166359
  var init_gateway_start = __esm(() => {
166342
166360
  init_src4();
166343
166361
  init_gateway_handler();
166344
166362
  ENV_PATH = resolve19(process.cwd(), ".klc-gateway.env");
166363
+ DEFAULT_MATRIXOS_COMMAND = resolveMatrixosCommand();
166345
166364
  });
166346
166365
 
166347
166366
  // 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.12",
2166
+ version: "0.3.14",
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",
@@ -166173,6 +166173,7 @@ async function runCliCommand(args, replyMsg) {
166173
166173
  }
166174
166174
  async function handleGatewayMessage(env5, opts = {}) {
166175
166175
  const text = env5.content.text ?? "";
166176
+ console.error("[gateway-handler] received", text.slice(0, 30));
166176
166177
  if (isReadoptCommand(env5)) {
166177
166178
  return runCliCommand(["adopt"], "Re-adoption MaTrixOS lancee. Suis le wizard localement.");
166178
166179
  }
@@ -166202,6 +166203,7 @@ async function handleGatewayMessage(env5, opts = {}) {
166202
166203
  env: { ...process.env, ...opts.env ?? {} },
166203
166204
  stdio: ["ignore", "pipe", "pipe"]
166204
166205
  });
166206
+ console.error("[gateway-handler] spawned", command, args);
166205
166207
  } catch (e) {
166206
166208
  finish({
166207
166209
  ok: false,
@@ -166238,6 +166240,7 @@ async function handleGatewayMessage(env5, opts = {}) {
166238
166240
  });
166239
166241
  child.on("close", (code) => {
166240
166242
  clearTimeout(timer);
166243
+ console.error("[gateway-handler] child closed code", code, "stdout len", stdout2.length);
166241
166244
  let reply = stdout2.trim();
166242
166245
  const lastBrace = reply.lastIndexOf("{");
166243
166246
  if (lastBrace >= 0) {
@@ -166275,6 +166278,15 @@ __export(exports_gateway_start, {
166275
166278
  });
166276
166279
  import { readFileSync as readFileSync64, existsSync as existsSync78 } from "fs";
166277
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
+ }
166278
166290
  function loadGatewayEnv(path29 = ENV_PATH) {
166279
166291
  if (!existsSync78(path29))
166280
166292
  return {};
@@ -166359,10 +166371,11 @@ async function runGatewayStart(opts = {}) {
166359
166371
  gateway2.registerAdapter(adapter2);
166360
166372
  gateway2.setHandler(async (env6) => {
166361
166373
  const r2 = await handleGatewayMessage(env6, {
166362
- command: opts.command,
166374
+ command: opts.command ?? DEFAULT_MATRIXOS_COMMAND,
166363
166375
  args: opts.args,
166364
166376
  timeoutMs: opts.timeoutMs
166365
166377
  });
166378
+ console.error("[gateway-start] handler done", r2.ok, r2.reply?.slice(0, 50));
166366
166379
  if (env6.content.text && r2.ok) {
166367
166380
  const reply = {
166368
166381
  id: "reply-" + env6.id,
@@ -166378,7 +166391,12 @@ async function runGatewayStart(opts = {}) {
166378
166391
  };
166379
166392
  try {
166380
166393
  await gateway2.send(reply);
166381
- } catch {}
166394
+ console.error("[gateway-start] reply sent");
166395
+ } catch (e) {
166396
+ console.error("[gateway-start] reply failed:", e instanceof Error ? e.message : String(e));
166397
+ }
166398
+ } else {
166399
+ console.error("[gateway-start] no reply: r.ok", r2.ok, "text", env6.content.text?.slice(0, 30));
166382
166400
  }
166383
166401
  });
166384
166402
  await gateway2.start();
@@ -166392,11 +166410,12 @@ async function runGatewayStart(opts = {}) {
166392
166410
  message: `gateway started (channel=${channelType}, pid=${process.pid})`
166393
166411
  };
166394
166412
  }
166395
- var ENV_PATH;
166413
+ var ENV_PATH, DEFAULT_MATRIXOS_COMMAND;
166396
166414
  var init_gateway_start = __esm(() => {
166397
166415
  init_src4();
166398
166416
  init_gateway_handler();
166399
166417
  ENV_PATH = resolve19(process.cwd(), ".klc-gateway.env");
166418
+ DEFAULT_MATRIXOS_COMMAND = resolveMatrixosCommand();
166400
166419
  });
166401
166420
 
166402
166421
  // 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.12",
368022
+ version: "0.3.14",
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.12",
3
+ "version": "0.3.14",
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",