@friendlyrobot/discord-pi-agent 0.10.3 → 0.10.5
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/debug-print.test.d.ts +1 -0
- package/dist/index.js +11 -4
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.js
CHANGED
|
@@ -41,11 +41,18 @@ function createModuleLogger(moduleName) {
|
|
|
41
41
|
|
|
42
42
|
// src/debug-print.ts
|
|
43
43
|
function debugPrint(body, title) {
|
|
44
|
+
const WIDTH = 80;
|
|
44
45
|
const label = title ?? "DEBUG";
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
function centeredFence(text) {
|
|
47
|
+
const inner = ` ${text} `;
|
|
48
|
+
const padLen = Math.floor((WIDTH - inner.length) / 2);
|
|
49
|
+
const pad = "=".repeat(padLen);
|
|
50
|
+
const result = pad + inner + pad;
|
|
51
|
+
return result.length < WIDTH ? result + "=" : result;
|
|
52
|
+
}
|
|
53
|
+
console.info(centeredFence(label));
|
|
47
54
|
console.info(body);
|
|
48
|
-
console.info(
|
|
55
|
+
console.info(centeredFence("END"));
|
|
49
56
|
}
|
|
50
57
|
|
|
51
58
|
// src/markdown-table-transformer.ts
|
|
@@ -148,7 +155,7 @@ async function collectReply(session, prompt, options = {}) {
|
|
|
148
155
|
}
|
|
149
156
|
if (finalText) {
|
|
150
157
|
const transformed = await transformMarkdownTablesToCodeBlocks(finalText);
|
|
151
|
-
debugPrint(finalText, "BEFORE");
|
|
158
|
+
debugPrint(finalText, "BEFORE TRANSFORM");
|
|
152
159
|
debugPrint(transformed, "TRANSFORMED");
|
|
153
160
|
return transformed;
|
|
154
161
|
}
|