@kl-c/matrixos 0.3.14 → 0.3.16
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 +12 -18
- package/dist/cli-node/index.js +12 -18
- package/dist/index.js +1 -6
- 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.16",
|
|
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",
|
|
@@ -90578,7 +90578,6 @@ class TelegramAdapter {
|
|
|
90578
90578
|
}
|
|
90579
90579
|
async handleUpdate(ctx) {
|
|
90580
90580
|
const msg = ctx.message;
|
|
90581
|
-
console.error("[telegram-adapter] handleUpdate", msg?.from?.username, msg?.chat?.id, msg?.text?.slice(0, 30));
|
|
90582
90581
|
const sttEnabled = this.config.voice?.stt?.enabled === true && this.voice.stt;
|
|
90583
90582
|
const voice = msg?.voice ?? msg?.audio;
|
|
90584
90583
|
if (voice && sttEnabled) {
|
|
@@ -90588,16 +90587,12 @@ class TelegramAdapter {
|
|
|
90588
90587
|
const envelope = this.normalize(ctx);
|
|
90589
90588
|
if (this.config.allowedChatId) {
|
|
90590
90589
|
const chatId = envelope.recipient?.id;
|
|
90591
|
-
console.error("[telegram-adapter] allowedChatId", this.config.allowedChatId, "actual", chatId);
|
|
90592
90590
|
if (chatId !== this.config.allowedChatId) {
|
|
90593
90591
|
return;
|
|
90594
90592
|
}
|
|
90595
90593
|
}
|
|
90596
90594
|
if (this.messageHandler) {
|
|
90597
|
-
console.error("[telegram-adapter] calling messageHandler");
|
|
90598
90595
|
await this.messageHandler(envelope);
|
|
90599
|
-
} else {
|
|
90600
|
-
console.error("[telegram-adapter] no messageHandler registered");
|
|
90601
90596
|
}
|
|
90602
90597
|
}
|
|
90603
90598
|
async handleVoiceMessage(ctx, voice) {
|
|
@@ -166118,7 +166113,6 @@ async function runCliCommand(args, replyMsg) {
|
|
|
166118
166113
|
}
|
|
166119
166114
|
async function handleGatewayMessage(env5, opts = {}) {
|
|
166120
166115
|
const text = env5.content.text ?? "";
|
|
166121
|
-
console.error("[gateway-handler] received", text.slice(0, 30));
|
|
166122
166116
|
if (isReadoptCommand(env5)) {
|
|
166123
166117
|
return runCliCommand(["adopt"], "Re-adoption MaTrixOS lancee. Suis le wizard localement.");
|
|
166124
166118
|
}
|
|
@@ -166148,7 +166142,6 @@ async function handleGatewayMessage(env5, opts = {}) {
|
|
|
166148
166142
|
env: { ...process.env, ...opts.env ?? {} },
|
|
166149
166143
|
stdio: ["ignore", "pipe", "pipe"]
|
|
166150
166144
|
});
|
|
166151
|
-
console.error("[gateway-handler] spawned", command, args);
|
|
166152
166145
|
} catch (e) {
|
|
166153
166146
|
finish({
|
|
166154
166147
|
ok: false,
|
|
@@ -166185,7 +166178,6 @@ async function handleGatewayMessage(env5, opts = {}) {
|
|
|
166185
166178
|
});
|
|
166186
166179
|
child.on("close", (code) => {
|
|
166187
166180
|
clearTimeout(timer);
|
|
166188
|
-
console.error("[gateway-handler] child closed code", code, "stdout len", stdout2.length);
|
|
166189
166181
|
let reply = stdout2.trim();
|
|
166190
166182
|
const lastBrace = reply.lastIndexOf("{");
|
|
166191
166183
|
if (lastBrace >= 0) {
|
|
@@ -166315,12 +166307,19 @@ async function runGatewayStart(opts = {}) {
|
|
|
166315
166307
|
const adapter2 = opts.adapterFactory ? opts.adapterFactory(channelConfig) : new TelegramAdapter(channelConfig);
|
|
166316
166308
|
gateway2.registerAdapter(adapter2);
|
|
166317
166309
|
gateway2.setHandler(async (env6) => {
|
|
166310
|
+
let command = opts.command ?? DEFAULT_MATRIXOS_COMMAND;
|
|
166311
|
+
let fixedArgs = [];
|
|
166312
|
+
const commandParts = command.trim().split(/\s+/);
|
|
166313
|
+
if (commandParts.length > 1) {
|
|
166314
|
+
command = commandParts[0];
|
|
166315
|
+
fixedArgs = commandParts.slice(1);
|
|
166316
|
+
}
|
|
166317
|
+
const args = opts.args ? [...fixedArgs, ...opts.args] : undefined;
|
|
166318
166318
|
const r2 = await handleGatewayMessage(env6, {
|
|
166319
|
-
command
|
|
166320
|
-
args
|
|
166319
|
+
command,
|
|
166320
|
+
args,
|
|
166321
166321
|
timeoutMs: opts.timeoutMs
|
|
166322
166322
|
});
|
|
166323
|
-
console.error("[gateway-start] handler done", r2.ok, r2.reply?.slice(0, 50));
|
|
166324
166323
|
if (env6.content.text && r2.ok) {
|
|
166325
166324
|
const reply = {
|
|
166326
166325
|
id: "reply-" + env6.id,
|
|
@@ -166336,12 +166335,7 @@ async function runGatewayStart(opts = {}) {
|
|
|
166336
166335
|
};
|
|
166337
166336
|
try {
|
|
166338
166337
|
await gateway2.send(reply);
|
|
166339
|
-
|
|
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));
|
|
166338
|
+
} catch {}
|
|
166345
166339
|
}
|
|
166346
166340
|
});
|
|
166347
166341
|
await gateway2.start();
|
package/dist/cli-node/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.16",
|
|
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",
|
|
@@ -90633,7 +90633,6 @@ class TelegramAdapter {
|
|
|
90633
90633
|
}
|
|
90634
90634
|
async handleUpdate(ctx) {
|
|
90635
90635
|
const msg = ctx.message;
|
|
90636
|
-
console.error("[telegram-adapter] handleUpdate", msg?.from?.username, msg?.chat?.id, msg?.text?.slice(0, 30));
|
|
90637
90636
|
const sttEnabled = this.config.voice?.stt?.enabled === true && this.voice.stt;
|
|
90638
90637
|
const voice = msg?.voice ?? msg?.audio;
|
|
90639
90638
|
if (voice && sttEnabled) {
|
|
@@ -90643,16 +90642,12 @@ class TelegramAdapter {
|
|
|
90643
90642
|
const envelope = this.normalize(ctx);
|
|
90644
90643
|
if (this.config.allowedChatId) {
|
|
90645
90644
|
const chatId = envelope.recipient?.id;
|
|
90646
|
-
console.error("[telegram-adapter] allowedChatId", this.config.allowedChatId, "actual", chatId);
|
|
90647
90645
|
if (chatId !== this.config.allowedChatId) {
|
|
90648
90646
|
return;
|
|
90649
90647
|
}
|
|
90650
90648
|
}
|
|
90651
90649
|
if (this.messageHandler) {
|
|
90652
|
-
console.error("[telegram-adapter] calling messageHandler");
|
|
90653
90650
|
await this.messageHandler(envelope);
|
|
90654
|
-
} else {
|
|
90655
|
-
console.error("[telegram-adapter] no messageHandler registered");
|
|
90656
90651
|
}
|
|
90657
90652
|
}
|
|
90658
90653
|
async handleVoiceMessage(ctx, voice) {
|
|
@@ -166173,7 +166168,6 @@ async function runCliCommand(args, replyMsg) {
|
|
|
166173
166168
|
}
|
|
166174
166169
|
async function handleGatewayMessage(env5, opts = {}) {
|
|
166175
166170
|
const text = env5.content.text ?? "";
|
|
166176
|
-
console.error("[gateway-handler] received", text.slice(0, 30));
|
|
166177
166171
|
if (isReadoptCommand(env5)) {
|
|
166178
166172
|
return runCliCommand(["adopt"], "Re-adoption MaTrixOS lancee. Suis le wizard localement.");
|
|
166179
166173
|
}
|
|
@@ -166203,7 +166197,6 @@ async function handleGatewayMessage(env5, opts = {}) {
|
|
|
166203
166197
|
env: { ...process.env, ...opts.env ?? {} },
|
|
166204
166198
|
stdio: ["ignore", "pipe", "pipe"]
|
|
166205
166199
|
});
|
|
166206
|
-
console.error("[gateway-handler] spawned", command, args);
|
|
166207
166200
|
} catch (e) {
|
|
166208
166201
|
finish({
|
|
166209
166202
|
ok: false,
|
|
@@ -166240,7 +166233,6 @@ async function handleGatewayMessage(env5, opts = {}) {
|
|
|
166240
166233
|
});
|
|
166241
166234
|
child.on("close", (code) => {
|
|
166242
166235
|
clearTimeout(timer);
|
|
166243
|
-
console.error("[gateway-handler] child closed code", code, "stdout len", stdout2.length);
|
|
166244
166236
|
let reply = stdout2.trim();
|
|
166245
166237
|
const lastBrace = reply.lastIndexOf("{");
|
|
166246
166238
|
if (lastBrace >= 0) {
|
|
@@ -166370,12 +166362,19 @@ async function runGatewayStart(opts = {}) {
|
|
|
166370
166362
|
const adapter2 = opts.adapterFactory ? opts.adapterFactory(channelConfig) : new TelegramAdapter(channelConfig);
|
|
166371
166363
|
gateway2.registerAdapter(adapter2);
|
|
166372
166364
|
gateway2.setHandler(async (env6) => {
|
|
166365
|
+
let command = opts.command ?? DEFAULT_MATRIXOS_COMMAND;
|
|
166366
|
+
let fixedArgs = [];
|
|
166367
|
+
const commandParts = command.trim().split(/\s+/);
|
|
166368
|
+
if (commandParts.length > 1) {
|
|
166369
|
+
command = commandParts[0];
|
|
166370
|
+
fixedArgs = commandParts.slice(1);
|
|
166371
|
+
}
|
|
166372
|
+
const args = opts.args ? [...fixedArgs, ...opts.args] : undefined;
|
|
166373
166373
|
const r2 = await handleGatewayMessage(env6, {
|
|
166374
|
-
command
|
|
166375
|
-
args
|
|
166374
|
+
command,
|
|
166375
|
+
args,
|
|
166376
166376
|
timeoutMs: opts.timeoutMs
|
|
166377
166377
|
});
|
|
166378
|
-
console.error("[gateway-start] handler done", r2.ok, r2.reply?.slice(0, 50));
|
|
166379
166378
|
if (env6.content.text && r2.ok) {
|
|
166380
166379
|
const reply = {
|
|
166381
166380
|
id: "reply-" + env6.id,
|
|
@@ -166391,12 +166390,7 @@ async function runGatewayStart(opts = {}) {
|
|
|
166391
166390
|
};
|
|
166392
166391
|
try {
|
|
166393
166392
|
await gateway2.send(reply);
|
|
166394
|
-
|
|
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));
|
|
166393
|
+
} catch {}
|
|
166400
166394
|
}
|
|
166401
166395
|
});
|
|
166402
166396
|
await gateway2.start();
|
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.
|
|
368022
|
+
version: "0.3.16",
|
|
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",
|
|
@@ -443586,7 +443586,6 @@ class TelegramAdapter {
|
|
|
443586
443586
|
}
|
|
443587
443587
|
async handleUpdate(ctx) {
|
|
443588
443588
|
const msg = ctx.message;
|
|
443589
|
-
console.error("[telegram-adapter] handleUpdate", msg?.from?.username, msg?.chat?.id, msg?.text?.slice(0, 30));
|
|
443590
443589
|
const sttEnabled = this.config.voice?.stt?.enabled === true && this.voice.stt;
|
|
443591
443590
|
const voice = msg?.voice ?? msg?.audio;
|
|
443592
443591
|
if (voice && sttEnabled) {
|
|
@@ -443596,16 +443595,12 @@ class TelegramAdapter {
|
|
|
443596
443595
|
const envelope = this.normalize(ctx);
|
|
443597
443596
|
if (this.config.allowedChatId) {
|
|
443598
443597
|
const chatId = envelope.recipient?.id;
|
|
443599
|
-
console.error("[telegram-adapter] allowedChatId", this.config.allowedChatId, "actual", chatId);
|
|
443600
443598
|
if (chatId !== this.config.allowedChatId) {
|
|
443601
443599
|
return;
|
|
443602
443600
|
}
|
|
443603
443601
|
}
|
|
443604
443602
|
if (this.messageHandler) {
|
|
443605
|
-
console.error("[telegram-adapter] calling messageHandler");
|
|
443606
443603
|
await this.messageHandler(envelope);
|
|
443607
|
-
} else {
|
|
443608
|
-
console.error("[telegram-adapter] no messageHandler registered");
|
|
443609
443604
|
}
|
|
443610
443605
|
}
|
|
443611
443606
|
async handleVoiceMessage(ctx, voice) {
|
package/package.json
CHANGED