@letta-ai/letta-code 0.16.5 → 0.16.7
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/types/protocol.d.ts +45 -1
- package/dist/types/protocol.d.ts.map +1 -1
- package/letta.js +28224 -27305
- package/package.json +1 -1
- package/vendor/ink/build/log-update.js +11 -2
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import ansiEscapes from 'ansi-escapes';
|
|
2
2
|
import cliCursor from 'cli-cursor';
|
|
3
|
+
import stringWidth from 'string-width';
|
|
3
4
|
|
|
4
5
|
const create = (stream, { showCursor = false } = {}) => {
|
|
5
6
|
let previousLineCount = 0;
|
|
@@ -7,8 +8,17 @@ const create = (stream, { showCursor = false } = {}) => {
|
|
|
7
8
|
let hasHiddenCursor = false;
|
|
8
9
|
|
|
9
10
|
const renderWithClearedLineEnds = (output) => {
|
|
11
|
+
// On some terminals, writing to the last column leaves the cursor in a
|
|
12
|
+
// deferred-wrap state where CSI K (Erase in Line) erases the character
|
|
13
|
+
// at the final column instead of being a no-op. Skip the erase for
|
|
14
|
+
// lines that already fill the terminal width — there is nothing beyond
|
|
15
|
+
// them to clean up.
|
|
16
|
+
const cols = stream.columns || 80;
|
|
10
17
|
const lines = output.split('\n');
|
|
11
|
-
return lines.map((line) =>
|
|
18
|
+
return lines.map((line) => {
|
|
19
|
+
if (stringWidth(line) >= cols) return line;
|
|
20
|
+
return line + ansiEscapes.eraseEndLine;
|
|
21
|
+
}).join('\n');
|
|
12
22
|
};
|
|
13
23
|
|
|
14
24
|
const render = (str) => {
|
|
@@ -60,4 +70,3 @@ const create = (stream, { showCursor = false } = {}) => {
|
|
|
60
70
|
|
|
61
71
|
const logUpdate = { create };
|
|
62
72
|
export default logUpdate;
|
|
63
|
-
|