open-agents-ai 0.53.0 → 0.54.0
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/index.js +10 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -30799,17 +30799,17 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
30799
30799
|
telegramBridge.setCommandHandler(async (input) => {
|
|
30800
30800
|
const captured = [];
|
|
30801
30801
|
const origWrite = process.stdout.write;
|
|
30802
|
-
process.stdout.write = function(chunk, ...
|
|
30802
|
+
process.stdout.write = function(chunk, ..._args) {
|
|
30803
30803
|
if (typeof chunk === "string") {
|
|
30804
|
-
|
|
30805
|
-
if (clean)
|
|
30806
|
-
captured.push(clean);
|
|
30804
|
+
captured.push(chunk);
|
|
30807
30805
|
}
|
|
30808
|
-
return
|
|
30806
|
+
return true;
|
|
30809
30807
|
};
|
|
30810
30808
|
try {
|
|
30811
30809
|
const result = await handleSlashCommand(input, commandCtx);
|
|
30812
30810
|
process.stdout.write = origWrite;
|
|
30811
|
+
if (statusBar.isActive)
|
|
30812
|
+
statusBar.handleResize();
|
|
30813
30813
|
if (result === "exit") {
|
|
30814
30814
|
return "Exit command received (ignored via Telegram).";
|
|
30815
30815
|
}
|
|
@@ -30820,7 +30820,11 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
30820
30820
|
rl.emit("line", input);
|
|
30821
30821
|
return `Skill invoked: ${result.name}`;
|
|
30822
30822
|
}
|
|
30823
|
-
|
|
30823
|
+
const raw = captured.join("");
|
|
30824
|
+
const clean = raw.replace(/\x1B\[[0-9;]*[A-Za-z]/g, "").replace(/\x1B\][^\x07]*\x07/g, "").replace(/\x1B[()][A-Z0-9]/g, "").replace(/\x1B\[?\??[0-9;]*[a-zA-Z]/g, "").replace(/\x1B/g, "").replace(/[─━│┃┌┐└┘├┤┬┴┼╔╗╚╝╠╣╦╩╬⎿⎾▕▏⏐]/g, "").replace(/\n{3,}/g, "\n\n").trim();
|
|
30825
|
+
if (!clean)
|
|
30826
|
+
return `Done: ${input}`;
|
|
30827
|
+
return clean.length > 3900 ? clean.slice(0, 3900) + "\n..." : clean;
|
|
30824
30828
|
} catch (err) {
|
|
30825
30829
|
process.stdout.write = origWrite;
|
|
30826
30830
|
throw err;
|
package/package.json
CHANGED