@letta-ai/letta-code 0.6.1 → 0.6.3
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/README.md +11 -6
- package/letta.js +19988 -17327
- package/package.json +1 -1
- package/vendor/ink/build/components/App.js +15 -1
- package/vendor/ink-text-input/build/index.js +4 -0
package/package.json
CHANGED
|
@@ -12,6 +12,9 @@ import StdoutContext from './StdoutContext.js';
|
|
|
12
12
|
const tab = '\t';
|
|
13
13
|
const shiftTab = '\u001B[Z';
|
|
14
14
|
const escape = '\u001B';
|
|
15
|
+
// Maximum number of event listeners to allow on stdin and internal_eventEmitter.
|
|
16
|
+
const MAX_INPUT_LISTENERS = 20;
|
|
17
|
+
|
|
15
18
|
export default class App extends PureComponent {
|
|
16
19
|
static displayName = 'InternalApp';
|
|
17
20
|
static getDerivedStateFromError(error) {
|
|
@@ -24,7 +27,12 @@ export default class App extends PureComponent {
|
|
|
24
27
|
error: undefined,
|
|
25
28
|
};
|
|
26
29
|
rawModeEnabledCount = 0;
|
|
27
|
-
|
|
30
|
+
// Increase max listeners to accommodate multiple useInput hooks across components
|
|
31
|
+
internal_eventEmitter = (() => {
|
|
32
|
+
const emitter = new EventEmitter();
|
|
33
|
+
emitter.setMaxListeners(MAX_INPUT_LISTENERS);
|
|
34
|
+
return emitter;
|
|
35
|
+
})();
|
|
28
36
|
isRawModeSupported() {
|
|
29
37
|
return this.props.stdin.isTTY;
|
|
30
38
|
}
|
|
@@ -37,6 +45,10 @@ export default class App extends PureComponent {
|
|
|
37
45
|
}
|
|
38
46
|
componentDidMount() {
|
|
39
47
|
cliCursor.hide(this.props.stdout);
|
|
48
|
+
// Increase max listeners on stdin to accommodate multiple useInput hooks
|
|
49
|
+
if (this.props.stdin?.setMaxListeners) {
|
|
50
|
+
this.props.stdin.setMaxListeners(MAX_INPUT_LISTENERS);
|
|
51
|
+
}
|
|
40
52
|
}
|
|
41
53
|
componentWillUnmount() {
|
|
42
54
|
cliCursor.show(this.props.stdout);
|
|
@@ -57,6 +69,8 @@ export default class App extends PureComponent {
|
|
|
57
69
|
throw new Error('Raw mode is not supported on the stdin provided to Ink.\nRead about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported');
|
|
58
70
|
}
|
|
59
71
|
}
|
|
72
|
+
// Increase max listeners on stdin to accommodate multiple useInput hooks
|
|
73
|
+
stdin.setMaxListeners(MAX_INPUT_LISTENERS);
|
|
60
74
|
stdin.setEncoding('utf8');
|
|
61
75
|
if (isEnabled) {
|
|
62
76
|
if (this.rawModeEnabledCount === 0) {
|
|
@@ -17,6 +17,10 @@ function isControlSequence(input, key) {
|
|
|
17
17
|
// Ctrl+W (delete word) - handled by parent component
|
|
18
18
|
if (key.ctrl && (input === 'w' || input === 'W')) return true;
|
|
19
19
|
|
|
20
|
+
// Filter out other ctrl+letter combinations that aren't handled below (e.g., ctrl+o for subagent expand)
|
|
21
|
+
// The handled ones are: ctrl+a, ctrl+e, ctrl+k, ctrl+u, ctrl+y (see useInput below)
|
|
22
|
+
if (key.ctrl && input && /^[a-z]$/i.test(input) && !['a', 'e', 'k', 'u', 'y'].includes(input.toLowerCase())) return true;
|
|
23
|
+
|
|
20
24
|
// Option+Arrow escape sequences: Ink parses \x1bb as meta=true, input='b'
|
|
21
25
|
if (key.meta && (input === 'b' || input === 'B' || input === 'f' || input === 'F')) return true;
|
|
22
26
|
|