@kl-c/matrixos 0.3.10 → 0.3.12
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 +23 -27
- package/dist/cli-node/index.js +23 -27
- package/dist/index.js +6 -9
- package/dist/tui.js +0 -8
- package/package.json +26 -26
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.12",
|
|
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",
|
|
@@ -84953,14 +84953,11 @@ class MatrixGateway {
|
|
|
84953
84953
|
return adapter.send(env2);
|
|
84954
84954
|
}
|
|
84955
84955
|
async handleInbound(env2) {
|
|
84956
|
-
console.error("[gateway] handleInbound", env2.id, env2.sender.id, env2.content.text?.slice(0, 30));
|
|
84957
84956
|
if (this.seenIds.has(env2.id)) {
|
|
84958
|
-
console.error("[gateway] dedupe rejected", env2.id);
|
|
84959
84957
|
return;
|
|
84960
84958
|
}
|
|
84961
84959
|
this.seenIds.add(env2.id);
|
|
84962
84960
|
if (this.isLoop(env2)) {
|
|
84963
|
-
console.error("[gateway] loop detected");
|
|
84964
84961
|
this.audit({
|
|
84965
84962
|
timestamp: new Date().toISOString(),
|
|
84966
84963
|
type: "loop_detected",
|
|
@@ -84972,7 +84969,6 @@ class MatrixGateway {
|
|
|
84972
84969
|
return;
|
|
84973
84970
|
}
|
|
84974
84971
|
if (this.isRateLimited(env2)) {
|
|
84975
|
-
console.error("[gateway] rate limited");
|
|
84976
84972
|
this.audit({
|
|
84977
84973
|
timestamp: new Date().toISOString(),
|
|
84978
84974
|
type: "rate_limited",
|
|
@@ -84984,7 +84980,6 @@ class MatrixGateway {
|
|
|
84984
84980
|
}
|
|
84985
84981
|
const allowResult = this.isAllowed(env2);
|
|
84986
84982
|
if (!allowResult.ok) {
|
|
84987
|
-
console.error("[gateway] security denied:", allowResult.reason);
|
|
84988
84983
|
this.audit({
|
|
84989
84984
|
timestamp: new Date().toISOString(),
|
|
84990
84985
|
type: "message_denied",
|
|
@@ -84996,10 +84991,7 @@ class MatrixGateway {
|
|
|
84996
84991
|
return;
|
|
84997
84992
|
}
|
|
84998
84993
|
if (this.handler) {
|
|
84999
|
-
console.error("[gateway] invoking handler for", env2.id);
|
|
85000
84994
|
await this.handler(env2);
|
|
85001
|
-
} else {
|
|
85002
|
-
console.error("[gateway] no handler registered");
|
|
85003
84995
|
}
|
|
85004
84996
|
this.audit({
|
|
85005
84997
|
timestamp: new Date().toISOString(),
|
|
@@ -90586,6 +90578,7 @@ class TelegramAdapter {
|
|
|
90586
90578
|
}
|
|
90587
90579
|
async handleUpdate(ctx) {
|
|
90588
90580
|
const msg = ctx.message;
|
|
90581
|
+
console.error("[telegram-adapter] handleUpdate", msg?.from?.username, msg?.chat?.id, msg?.text?.slice(0, 30));
|
|
90589
90582
|
const sttEnabled = this.config.voice?.stt?.enabled === true && this.voice.stt;
|
|
90590
90583
|
const voice = msg?.voice ?? msg?.audio;
|
|
90591
90584
|
if (voice && sttEnabled) {
|
|
@@ -90595,12 +90588,16 @@ class TelegramAdapter {
|
|
|
90595
90588
|
const envelope = this.normalize(ctx);
|
|
90596
90589
|
if (this.config.allowedChatId) {
|
|
90597
90590
|
const chatId = envelope.recipient?.id;
|
|
90591
|
+
console.error("[telegram-adapter] allowedChatId", this.config.allowedChatId, "actual", chatId);
|
|
90598
90592
|
if (chatId !== this.config.allowedChatId) {
|
|
90599
90593
|
return;
|
|
90600
90594
|
}
|
|
90601
90595
|
}
|
|
90602
90596
|
if (this.messageHandler) {
|
|
90597
|
+
console.error("[telegram-adapter] calling messageHandler");
|
|
90603
90598
|
await this.messageHandler(envelope);
|
|
90599
|
+
} else {
|
|
90600
|
+
console.error("[telegram-adapter] no messageHandler registered");
|
|
90604
90601
|
}
|
|
90605
90602
|
}
|
|
90606
90603
|
async handleVoiceMessage(ctx, voice) {
|
|
@@ -166121,21 +166118,17 @@ async function runCliCommand(args, replyMsg) {
|
|
|
166121
166118
|
}
|
|
166122
166119
|
async function handleGatewayMessage(env5, opts = {}) {
|
|
166123
166120
|
const text = env5.content.text ?? "";
|
|
166124
|
-
console.error("[gateway-handler] received text:", text.slice(0, 50));
|
|
166125
166121
|
if (isReadoptCommand(env5)) {
|
|
166126
|
-
console.error("[gateway-handler] readopt command");
|
|
166127
166122
|
return runCliCommand(["adopt"], "Re-adoption MaTrixOS lancee. Suis le wizard localement.");
|
|
166128
166123
|
}
|
|
166129
166124
|
if (isTelegramAdoptCommand(env5)) {
|
|
166130
|
-
console.error("[gateway-handler] telegram-adopt command");
|
|
166131
166125
|
return runCliCommand(["gateway", "adopt", "telegram"], "Configuration Telegram lancee. Colle ton bot token quand demande (jamais par chat).");
|
|
166132
166126
|
}
|
|
166133
166127
|
const command = opts.command ?? "matrixos";
|
|
166134
|
-
const argsTemplate = opts.args ?? ["run", text];
|
|
166128
|
+
const argsTemplate = opts.args ?? ["run", "--json", "{text}"];
|
|
166135
166129
|
const args = argsTemplate.map((a2) => a2 === "{text}" ? text : a2);
|
|
166136
166130
|
const cwd = opts.cwd ?? process.cwd();
|
|
166137
|
-
const timeoutMs = opts.timeoutMs ??
|
|
166138
|
-
console.error("[gateway-handler] spawn:", command, args, "cwd:", cwd, "timeout:", timeoutMs);
|
|
166131
|
+
const timeoutMs = opts.timeoutMs ?? 120000;
|
|
166139
166132
|
const started = Date.now();
|
|
166140
166133
|
return new Promise((resolve19) => {
|
|
166141
166134
|
let stdout2 = "";
|
|
@@ -166174,14 +166167,11 @@ async function handleGatewayMessage(env5, opts = {}) {
|
|
|
166174
166167
|
}, timeoutMs);
|
|
166175
166168
|
child.stdout?.on("data", (chunk) => {
|
|
166176
166169
|
const s = chunk.toString("utf8");
|
|
166177
|
-
console.error("[gateway-handler] stdout chunk:", s.slice(0, 120).replace(/\n/g, "\\n"));
|
|
166178
166170
|
stdout2 += s;
|
|
166179
166171
|
opts.onPartial?.(s);
|
|
166180
166172
|
});
|
|
166181
166173
|
child.stderr?.on("data", (chunk) => {
|
|
166182
|
-
|
|
166183
|
-
console.error("[gateway-handler] stderr chunk:", s.slice(0, 120).replace(/\n/g, "\\n"));
|
|
166184
|
-
stderr += s;
|
|
166174
|
+
stderr += chunk.toString("utf8");
|
|
166185
166175
|
});
|
|
166186
166176
|
child.on("error", (err) => {
|
|
166187
166177
|
clearTimeout(timer);
|
|
@@ -166193,13 +166183,23 @@ async function handleGatewayMessage(env5, opts = {}) {
|
|
|
166193
166183
|
});
|
|
166194
166184
|
child.on("close", (code) => {
|
|
166195
166185
|
clearTimeout(timer);
|
|
166196
|
-
|
|
166186
|
+
let reply = stdout2.trim();
|
|
166187
|
+
const lastBrace = reply.lastIndexOf("{");
|
|
166188
|
+
if (lastBrace >= 0) {
|
|
166189
|
+
try {
|
|
166190
|
+
const json3 = JSON.parse(reply.slice(lastBrace));
|
|
166191
|
+
if (typeof json3.summary === "string")
|
|
166192
|
+
reply = json3.summary;
|
|
166193
|
+
else if (typeof json3.message === "string")
|
|
166194
|
+
reply = json3.message;
|
|
166195
|
+
} catch {}
|
|
166196
|
+
}
|
|
166197
166197
|
if (code === 0) {
|
|
166198
|
-
finish({ ok: true, reply:
|
|
166198
|
+
finish({ ok: true, reply: reply || "(empty reply)", exitCode: code });
|
|
166199
166199
|
} else {
|
|
166200
166200
|
finish({
|
|
166201
166201
|
ok: false,
|
|
166202
|
-
reply:
|
|
166202
|
+
reply: reply || `handler: exit ${code}
|
|
166203
166203
|
${maskSecrets(stderr.trim())}`,
|
|
166204
166204
|
exitCode: code
|
|
166205
166205
|
});
|
|
@@ -166308,7 +166308,6 @@ async function runGatewayStart(opts = {}) {
|
|
|
166308
166308
|
args: opts.args,
|
|
166309
166309
|
timeoutMs: opts.timeoutMs
|
|
166310
166310
|
});
|
|
166311
|
-
console.error("[gateway-start] handler result:", r2.ok, "reply len:", r2.reply.length, "duration:", r2.durationMs, "exitCode:", r2.exitCode);
|
|
166312
166311
|
if (env6.content.text && r2.ok) {
|
|
166313
166312
|
const reply = {
|
|
166314
166313
|
id: "reply-" + env6.id,
|
|
@@ -166324,10 +166323,7 @@ async function runGatewayStart(opts = {}) {
|
|
|
166324
166323
|
};
|
|
166325
166324
|
try {
|
|
166326
166325
|
await gateway2.send(reply);
|
|
166327
|
-
|
|
166328
|
-
} catch (e) {
|
|
166329
|
-
console.error("[gateway-start] reply failed:", e instanceof Error ? e.message : String(e));
|
|
166330
|
-
}
|
|
166326
|
+
} catch {}
|
|
166331
166327
|
}
|
|
166332
166328
|
});
|
|
166333
166329
|
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.12",
|
|
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",
|
|
@@ -85008,14 +85008,11 @@ class MatrixGateway {
|
|
|
85008
85008
|
return adapter.send(env2);
|
|
85009
85009
|
}
|
|
85010
85010
|
async handleInbound(env2) {
|
|
85011
|
-
console.error("[gateway] handleInbound", env2.id, env2.sender.id, env2.content.text?.slice(0, 30));
|
|
85012
85011
|
if (this.seenIds.has(env2.id)) {
|
|
85013
|
-
console.error("[gateway] dedupe rejected", env2.id);
|
|
85014
85012
|
return;
|
|
85015
85013
|
}
|
|
85016
85014
|
this.seenIds.add(env2.id);
|
|
85017
85015
|
if (this.isLoop(env2)) {
|
|
85018
|
-
console.error("[gateway] loop detected");
|
|
85019
85016
|
this.audit({
|
|
85020
85017
|
timestamp: new Date().toISOString(),
|
|
85021
85018
|
type: "loop_detected",
|
|
@@ -85027,7 +85024,6 @@ class MatrixGateway {
|
|
|
85027
85024
|
return;
|
|
85028
85025
|
}
|
|
85029
85026
|
if (this.isRateLimited(env2)) {
|
|
85030
|
-
console.error("[gateway] rate limited");
|
|
85031
85027
|
this.audit({
|
|
85032
85028
|
timestamp: new Date().toISOString(),
|
|
85033
85029
|
type: "rate_limited",
|
|
@@ -85039,7 +85035,6 @@ class MatrixGateway {
|
|
|
85039
85035
|
}
|
|
85040
85036
|
const allowResult = this.isAllowed(env2);
|
|
85041
85037
|
if (!allowResult.ok) {
|
|
85042
|
-
console.error("[gateway] security denied:", allowResult.reason);
|
|
85043
85038
|
this.audit({
|
|
85044
85039
|
timestamp: new Date().toISOString(),
|
|
85045
85040
|
type: "message_denied",
|
|
@@ -85051,10 +85046,7 @@ class MatrixGateway {
|
|
|
85051
85046
|
return;
|
|
85052
85047
|
}
|
|
85053
85048
|
if (this.handler) {
|
|
85054
|
-
console.error("[gateway] invoking handler for", env2.id);
|
|
85055
85049
|
await this.handler(env2);
|
|
85056
|
-
} else {
|
|
85057
|
-
console.error("[gateway] no handler registered");
|
|
85058
85050
|
}
|
|
85059
85051
|
this.audit({
|
|
85060
85052
|
timestamp: new Date().toISOString(),
|
|
@@ -90641,6 +90633,7 @@ class TelegramAdapter {
|
|
|
90641
90633
|
}
|
|
90642
90634
|
async handleUpdate(ctx) {
|
|
90643
90635
|
const msg = ctx.message;
|
|
90636
|
+
console.error("[telegram-adapter] handleUpdate", msg?.from?.username, msg?.chat?.id, msg?.text?.slice(0, 30));
|
|
90644
90637
|
const sttEnabled = this.config.voice?.stt?.enabled === true && this.voice.stt;
|
|
90645
90638
|
const voice = msg?.voice ?? msg?.audio;
|
|
90646
90639
|
if (voice && sttEnabled) {
|
|
@@ -90650,12 +90643,16 @@ class TelegramAdapter {
|
|
|
90650
90643
|
const envelope = this.normalize(ctx);
|
|
90651
90644
|
if (this.config.allowedChatId) {
|
|
90652
90645
|
const chatId = envelope.recipient?.id;
|
|
90646
|
+
console.error("[telegram-adapter] allowedChatId", this.config.allowedChatId, "actual", chatId);
|
|
90653
90647
|
if (chatId !== this.config.allowedChatId) {
|
|
90654
90648
|
return;
|
|
90655
90649
|
}
|
|
90656
90650
|
}
|
|
90657
90651
|
if (this.messageHandler) {
|
|
90652
|
+
console.error("[telegram-adapter] calling messageHandler");
|
|
90658
90653
|
await this.messageHandler(envelope);
|
|
90654
|
+
} else {
|
|
90655
|
+
console.error("[telegram-adapter] no messageHandler registered");
|
|
90659
90656
|
}
|
|
90660
90657
|
}
|
|
90661
90658
|
async handleVoiceMessage(ctx, voice) {
|
|
@@ -166176,21 +166173,17 @@ async function runCliCommand(args, replyMsg) {
|
|
|
166176
166173
|
}
|
|
166177
166174
|
async function handleGatewayMessage(env5, opts = {}) {
|
|
166178
166175
|
const text = env5.content.text ?? "";
|
|
166179
|
-
console.error("[gateway-handler] received text:", text.slice(0, 50));
|
|
166180
166176
|
if (isReadoptCommand(env5)) {
|
|
166181
|
-
console.error("[gateway-handler] readopt command");
|
|
166182
166177
|
return runCliCommand(["adopt"], "Re-adoption MaTrixOS lancee. Suis le wizard localement.");
|
|
166183
166178
|
}
|
|
166184
166179
|
if (isTelegramAdoptCommand(env5)) {
|
|
166185
|
-
console.error("[gateway-handler] telegram-adopt command");
|
|
166186
166180
|
return runCliCommand(["gateway", "adopt", "telegram"], "Configuration Telegram lancee. Colle ton bot token quand demande (jamais par chat).");
|
|
166187
166181
|
}
|
|
166188
166182
|
const command = opts.command ?? "matrixos";
|
|
166189
|
-
const argsTemplate = opts.args ?? ["run", text];
|
|
166183
|
+
const argsTemplate = opts.args ?? ["run", "--json", "{text}"];
|
|
166190
166184
|
const args = argsTemplate.map((a2) => a2 === "{text}" ? text : a2);
|
|
166191
166185
|
const cwd = opts.cwd ?? process.cwd();
|
|
166192
|
-
const timeoutMs = opts.timeoutMs ??
|
|
166193
|
-
console.error("[gateway-handler] spawn:", command, args, "cwd:", cwd, "timeout:", timeoutMs);
|
|
166186
|
+
const timeoutMs = opts.timeoutMs ?? 120000;
|
|
166194
166187
|
const started = Date.now();
|
|
166195
166188
|
return new Promise((resolve19) => {
|
|
166196
166189
|
let stdout2 = "";
|
|
@@ -166229,14 +166222,11 @@ async function handleGatewayMessage(env5, opts = {}) {
|
|
|
166229
166222
|
}, timeoutMs);
|
|
166230
166223
|
child.stdout?.on("data", (chunk) => {
|
|
166231
166224
|
const s = chunk.toString("utf8");
|
|
166232
|
-
console.error("[gateway-handler] stdout chunk:", s.slice(0, 120).replace(/\n/g, "\\n"));
|
|
166233
166225
|
stdout2 += s;
|
|
166234
166226
|
opts.onPartial?.(s);
|
|
166235
166227
|
});
|
|
166236
166228
|
child.stderr?.on("data", (chunk) => {
|
|
166237
|
-
|
|
166238
|
-
console.error("[gateway-handler] stderr chunk:", s.slice(0, 120).replace(/\n/g, "\\n"));
|
|
166239
|
-
stderr += s;
|
|
166229
|
+
stderr += chunk.toString("utf8");
|
|
166240
166230
|
});
|
|
166241
166231
|
child.on("error", (err) => {
|
|
166242
166232
|
clearTimeout(timer);
|
|
@@ -166248,13 +166238,23 @@ async function handleGatewayMessage(env5, opts = {}) {
|
|
|
166248
166238
|
});
|
|
166249
166239
|
child.on("close", (code) => {
|
|
166250
166240
|
clearTimeout(timer);
|
|
166251
|
-
|
|
166241
|
+
let reply = stdout2.trim();
|
|
166242
|
+
const lastBrace = reply.lastIndexOf("{");
|
|
166243
|
+
if (lastBrace >= 0) {
|
|
166244
|
+
try {
|
|
166245
|
+
const json3 = JSON.parse(reply.slice(lastBrace));
|
|
166246
|
+
if (typeof json3.summary === "string")
|
|
166247
|
+
reply = json3.summary;
|
|
166248
|
+
else if (typeof json3.message === "string")
|
|
166249
|
+
reply = json3.message;
|
|
166250
|
+
} catch {}
|
|
166251
|
+
}
|
|
166252
166252
|
if (code === 0) {
|
|
166253
|
-
finish({ ok: true, reply:
|
|
166253
|
+
finish({ ok: true, reply: reply || "(empty reply)", exitCode: code });
|
|
166254
166254
|
} else {
|
|
166255
166255
|
finish({
|
|
166256
166256
|
ok: false,
|
|
166257
|
-
reply:
|
|
166257
|
+
reply: reply || `handler: exit ${code}
|
|
166258
166258
|
${maskSecrets(stderr.trim())}`,
|
|
166259
166259
|
exitCode: code
|
|
166260
166260
|
});
|
|
@@ -166363,7 +166363,6 @@ async function runGatewayStart(opts = {}) {
|
|
|
166363
166363
|
args: opts.args,
|
|
166364
166364
|
timeoutMs: opts.timeoutMs
|
|
166365
166365
|
});
|
|
166366
|
-
console.error("[gateway-start] handler result:", r2.ok, "reply len:", r2.reply.length, "duration:", r2.durationMs, "exitCode:", r2.exitCode);
|
|
166367
166366
|
if (env6.content.text && r2.ok) {
|
|
166368
166367
|
const reply = {
|
|
166369
166368
|
id: "reply-" + env6.id,
|
|
@@ -166379,10 +166378,7 @@ async function runGatewayStart(opts = {}) {
|
|
|
166379
166378
|
};
|
|
166380
166379
|
try {
|
|
166381
166380
|
await gateway2.send(reply);
|
|
166382
|
-
|
|
166383
|
-
} catch (e) {
|
|
166384
|
-
console.error("[gateway-start] reply failed:", e instanceof Error ? e.message : String(e));
|
|
166385
|
-
}
|
|
166381
|
+
} catch {}
|
|
166386
166382
|
}
|
|
166387
166383
|
});
|
|
166388
166384
|
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.12",
|
|
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",
|
|
@@ -443312,14 +443312,11 @@ class MatrixGateway {
|
|
|
443312
443312
|
return adapter.send(env2);
|
|
443313
443313
|
}
|
|
443314
443314
|
async handleInbound(env2) {
|
|
443315
|
-
console.error("[gateway] handleInbound", env2.id, env2.sender.id, env2.content.text?.slice(0, 30));
|
|
443316
443315
|
if (this.seenIds.has(env2.id)) {
|
|
443317
|
-
console.error("[gateway] dedupe rejected", env2.id);
|
|
443318
443316
|
return;
|
|
443319
443317
|
}
|
|
443320
443318
|
this.seenIds.add(env2.id);
|
|
443321
443319
|
if (this.isLoop(env2)) {
|
|
443322
|
-
console.error("[gateway] loop detected");
|
|
443323
443320
|
this.audit({
|
|
443324
443321
|
timestamp: new Date().toISOString(),
|
|
443325
443322
|
type: "loop_detected",
|
|
@@ -443331,7 +443328,6 @@ class MatrixGateway {
|
|
|
443331
443328
|
return;
|
|
443332
443329
|
}
|
|
443333
443330
|
if (this.isRateLimited(env2)) {
|
|
443334
|
-
console.error("[gateway] rate limited");
|
|
443335
443331
|
this.audit({
|
|
443336
443332
|
timestamp: new Date().toISOString(),
|
|
443337
443333
|
type: "rate_limited",
|
|
@@ -443343,7 +443339,6 @@ class MatrixGateway {
|
|
|
443343
443339
|
}
|
|
443344
443340
|
const allowResult = this.isAllowed(env2);
|
|
443345
443341
|
if (!allowResult.ok) {
|
|
443346
|
-
console.error("[gateway] security denied:", allowResult.reason);
|
|
443347
443342
|
this.audit({
|
|
443348
443343
|
timestamp: new Date().toISOString(),
|
|
443349
443344
|
type: "message_denied",
|
|
@@ -443355,10 +443350,7 @@ class MatrixGateway {
|
|
|
443355
443350
|
return;
|
|
443356
443351
|
}
|
|
443357
443352
|
if (this.handler) {
|
|
443358
|
-
console.error("[gateway] invoking handler for", env2.id);
|
|
443359
443353
|
await this.handler(env2);
|
|
443360
|
-
} else {
|
|
443361
|
-
console.error("[gateway] no handler registered");
|
|
443362
443354
|
}
|
|
443363
443355
|
this.audit({
|
|
443364
443356
|
timestamp: new Date().toISOString(),
|
|
@@ -443594,6 +443586,7 @@ class TelegramAdapter {
|
|
|
443594
443586
|
}
|
|
443595
443587
|
async handleUpdate(ctx) {
|
|
443596
443588
|
const msg = ctx.message;
|
|
443589
|
+
console.error("[telegram-adapter] handleUpdate", msg?.from?.username, msg?.chat?.id, msg?.text?.slice(0, 30));
|
|
443597
443590
|
const sttEnabled = this.config.voice?.stt?.enabled === true && this.voice.stt;
|
|
443598
443591
|
const voice = msg?.voice ?? msg?.audio;
|
|
443599
443592
|
if (voice && sttEnabled) {
|
|
@@ -443603,12 +443596,16 @@ class TelegramAdapter {
|
|
|
443603
443596
|
const envelope = this.normalize(ctx);
|
|
443604
443597
|
if (this.config.allowedChatId) {
|
|
443605
443598
|
const chatId = envelope.recipient?.id;
|
|
443599
|
+
console.error("[telegram-adapter] allowedChatId", this.config.allowedChatId, "actual", chatId);
|
|
443606
443600
|
if (chatId !== this.config.allowedChatId) {
|
|
443607
443601
|
return;
|
|
443608
443602
|
}
|
|
443609
443603
|
}
|
|
443610
443604
|
if (this.messageHandler) {
|
|
443605
|
+
console.error("[telegram-adapter] calling messageHandler");
|
|
443611
443606
|
await this.messageHandler(envelope);
|
|
443607
|
+
} else {
|
|
443608
|
+
console.error("[telegram-adapter] no messageHandler registered");
|
|
443612
443609
|
}
|
|
443613
443610
|
}
|
|
443614
443611
|
async handleVoiceMessage(ctx, voice) {
|
package/dist/tui.js
CHANGED
|
@@ -20763,14 +20763,11 @@ class MatrixGateway {
|
|
|
20763
20763
|
return adapter.send(env2);
|
|
20764
20764
|
}
|
|
20765
20765
|
async handleInbound(env2) {
|
|
20766
|
-
console.error("[gateway] handleInbound", env2.id, env2.sender.id, env2.content.text?.slice(0, 30));
|
|
20767
20766
|
if (this.seenIds.has(env2.id)) {
|
|
20768
|
-
console.error("[gateway] dedupe rejected", env2.id);
|
|
20769
20767
|
return;
|
|
20770
20768
|
}
|
|
20771
20769
|
this.seenIds.add(env2.id);
|
|
20772
20770
|
if (this.isLoop(env2)) {
|
|
20773
|
-
console.error("[gateway] loop detected");
|
|
20774
20771
|
this.audit({
|
|
20775
20772
|
timestamp: new Date().toISOString(),
|
|
20776
20773
|
type: "loop_detected",
|
|
@@ -20782,7 +20779,6 @@ class MatrixGateway {
|
|
|
20782
20779
|
return;
|
|
20783
20780
|
}
|
|
20784
20781
|
if (this.isRateLimited(env2)) {
|
|
20785
|
-
console.error("[gateway] rate limited");
|
|
20786
20782
|
this.audit({
|
|
20787
20783
|
timestamp: new Date().toISOString(),
|
|
20788
20784
|
type: "rate_limited",
|
|
@@ -20794,7 +20790,6 @@ class MatrixGateway {
|
|
|
20794
20790
|
}
|
|
20795
20791
|
const allowResult = this.isAllowed(env2);
|
|
20796
20792
|
if (!allowResult.ok) {
|
|
20797
|
-
console.error("[gateway] security denied:", allowResult.reason);
|
|
20798
20793
|
this.audit({
|
|
20799
20794
|
timestamp: new Date().toISOString(),
|
|
20800
20795
|
type: "message_denied",
|
|
@@ -20806,10 +20801,7 @@ class MatrixGateway {
|
|
|
20806
20801
|
return;
|
|
20807
20802
|
}
|
|
20808
20803
|
if (this.handler) {
|
|
20809
|
-
console.error("[gateway] invoking handler for", env2.id);
|
|
20810
20804
|
await this.handler(env2);
|
|
20811
|
-
} else {
|
|
20812
|
-
console.error("[gateway] no handler registered");
|
|
20813
20805
|
}
|
|
20814
20806
|
this.audit({
|
|
20815
20807
|
timestamp: new Date().toISOString(),
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kl-c/matrixos",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "MaTrixOS
|
|
3
|
+
"version": "0.3.12",
|
|
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",
|
|
7
7
|
"type": "module",
|
|
@@ -154,30 +154,30 @@
|
|
|
154
154
|
"zod": "^4.4.3"
|
|
155
155
|
},
|
|
156
156
|
"devDependencies": {
|
|
157
|
-
"@matrixos/agents-md-core": "
|
|
158
|
-
"@matrixos/boulder-state": "
|
|
159
|
-
"@matrixos/claude-code-compat-core": "
|
|
160
|
-
"@matrixos/comment-checker-core": "
|
|
161
|
-
"@matrixos/delegate-core": "
|
|
162
|
-
"@matrixos/egress-core": "
|
|
163
|
-
"@matrixos/git-bash-mcp": "
|
|
164
|
-
"@matrixos/hashline-core": "
|
|
165
|
-
"@matrixos/learning-loop": "
|
|
166
|
-
"@matrixos/lsp-core": "
|
|
167
|
-
"@matrixos/mcp-client-core": "
|
|
168
|
-
"@matrixos/mcp-stdio-core": "
|
|
169
|
-
"@matrixos/model-core": "
|
|
170
|
-
"@matrixos/omo-config-core": "
|
|
171
|
-
"@matrixos/matrix-gateway-core": "
|
|
172
|
-
"@matrixos/prompts-core": "
|
|
173
|
-
"@matrixos/rules-engine": "
|
|
174
|
-
"@matrixos/rgpd-compliance-core": "
|
|
175
|
-
"@matrixos/shared-skills": "
|
|
176
|
-
"@matrixos/skills-loader-core": "
|
|
177
|
-
"@matrixos/team-core": "
|
|
178
|
-
"@matrixos/telemetry-core": "
|
|
179
|
-
"@matrixos/tmux-core": "
|
|
180
|
-
"@matrixos/utils": "
|
|
157
|
+
"@matrixos/agents-md-core": "workspace:*",
|
|
158
|
+
"@matrixos/boulder-state": "workspace:*",
|
|
159
|
+
"@matrixos/claude-code-compat-core": "workspace:*",
|
|
160
|
+
"@matrixos/comment-checker-core": "workspace:*",
|
|
161
|
+
"@matrixos/delegate-core": "workspace:*",
|
|
162
|
+
"@matrixos/egress-core": "workspace:*",
|
|
163
|
+
"@matrixos/git-bash-mcp": "workspace:*",
|
|
164
|
+
"@matrixos/hashline-core": "workspace:*",
|
|
165
|
+
"@matrixos/learning-loop": "workspace:*",
|
|
166
|
+
"@matrixos/lsp-core": "workspace:*",
|
|
167
|
+
"@matrixos/mcp-client-core": "workspace:*",
|
|
168
|
+
"@matrixos/mcp-stdio-core": "workspace:*",
|
|
169
|
+
"@matrixos/model-core": "workspace:*",
|
|
170
|
+
"@matrixos/omo-config-core": "workspace:*",
|
|
171
|
+
"@matrixos/matrix-gateway-core": "workspace:*",
|
|
172
|
+
"@matrixos/prompts-core": "workspace:*",
|
|
173
|
+
"@matrixos/rules-engine": "workspace:*",
|
|
174
|
+
"@matrixos/rgpd-compliance-core": "workspace:*",
|
|
175
|
+
"@matrixos/shared-skills": "workspace:*",
|
|
176
|
+
"@matrixos/skills-loader-core": "workspace:*",
|
|
177
|
+
"@matrixos/team-core": "workspace:*",
|
|
178
|
+
"@matrixos/telemetry-core": "workspace:*",
|
|
179
|
+
"@matrixos/tmux-core": "workspace:*",
|
|
180
|
+
"@matrixos/utils": "workspace:*",
|
|
181
181
|
"@types/js-yaml": "^4.0.9",
|
|
182
182
|
"@types/picomatch": "^4.0.3",
|
|
183
183
|
"@typescript/native-preview": "7.0.0-dev.20260518.1",
|