@letta-ai/letta-code 0.30.8 → 0.30.9
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/gateway-core.js +8 -2
- package/dist/gateway-core.js.map +3 -3
- package/dist/mcp-client.js +2 -2
- package/dist/mcp-client.js.map +1 -1
- package/dist/types/agent/message.d.ts.map +1 -1
- package/dist/types/backend/local/local-store.d.ts.map +1 -1
- package/dist/types/channels/gateway-core.d.ts.map +1 -1
- package/dist/types/cli/helpers/accumulator.d.ts +1 -0
- package/dist/types/cli/helpers/accumulator.d.ts.map +1 -1
- package/dist/types/cli/helpers/stream-terminal-eof-guard.d.ts +14 -0
- package/dist/types/cli/helpers/stream-terminal-eof-guard.d.ts.map +1 -0
- package/dist/types/cli/helpers/stream.d.ts +1 -0
- package/dist/types/cli/helpers/stream.d.ts.map +1 -1
- package/dist/types/mods/mod-engine.d.ts +3 -7
- package/dist/types/mods/mod-engine.d.ts.map +1 -1
- package/dist/types/telemetry/error-reporting.d.ts +7 -0
- package/dist/types/telemetry/error-reporting.d.ts.map +1 -1
- package/dist/types/telemetry/index.d.ts +10 -0
- package/dist/types/telemetry/index.d.ts.map +1 -1
- package/dist/types/tools/impl/shell-runner.d.ts.map +1 -1
- package/dist/types/types/protocol_v2.d.ts +8 -9
- package/dist/types/types/protocol_v2.d.ts.map +1 -1
- package/dist/types/utils/secrets.d.ts.map +1 -1
- package/letta.js +342 -87
- package/package.json +1 -1
- package/scripts/dev.cjs +1 -2
- package/scripts/source-file-size-baseline.json +9 -8
- package/scripts/test-home-preload.ts +66 -0
- package/skills/creating-mods/references/ui.md +11 -1
package/package.json
CHANGED
package/scripts/dev.cjs
CHANGED
|
@@ -4,7 +4,6 @@ const { spawn } = require('node:child_process');
|
|
|
4
4
|
|
|
5
5
|
const env = { ...process.env };
|
|
6
6
|
if (!env.LETTA_DEBUG) env.LETTA_DEBUG = '1';
|
|
7
|
-
if (!env.LETTA_RESPONSES_WS) env.LETTA_RESPONSES_WS = '1';
|
|
8
7
|
|
|
9
8
|
const bunArgs = [
|
|
10
9
|
'--loader=.md:text',
|
|
@@ -32,4 +31,4 @@ child.on('exit', (code, signal) => {
|
|
|
32
31
|
return;
|
|
33
32
|
}
|
|
34
33
|
process.exit(code ?? 0);
|
|
35
|
-
});
|
|
34
|
+
});
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"src/agent/memory-git.ts": 2128,
|
|
4
4
|
"src/backend/local-backend.test.ts": 2532,
|
|
5
5
|
"src/backend/local/local-backend.ts": 1014,
|
|
6
|
-
"src/backend/local/local-store.ts":
|
|
6
|
+
"src/backend/local/local-store.ts": 3598,
|
|
7
7
|
"src/backend/pi-stream-adapter.test.ts": 1304,
|
|
8
8
|
"src/cli/app/AppCoordinator.tsx": 5188,
|
|
9
9
|
"src/cli/app/AppView.tsx": 1735,
|
|
@@ -16,17 +16,17 @@
|
|
|
16
16
|
"src/cli/components/ModelSelector.tsx": 1259,
|
|
17
17
|
"src/cli/components/ProviderSelector.tsx": 1692,
|
|
18
18
|
"src/cli/components/ToolCallMessageRich.tsx": 1109,
|
|
19
|
-
"src/cli/helpers/accumulator.ts":
|
|
19
|
+
"src/cli/helpers/accumulator.ts": 1600,
|
|
20
20
|
"src/cli/helpers/reflection-transcript.ts": 1956,
|
|
21
21
|
"src/cli/mods/local-mod-loader.test.ts": 1043,
|
|
22
22
|
"src/cli/reflection-transcript.test.ts": 1084,
|
|
23
23
|
"src/cli/subcommands/skills.ts": 1264,
|
|
24
|
-
"src/headless.ts":
|
|
24
|
+
"src/headless.ts": 5253,
|
|
25
25
|
"src/hooks/integration.test.ts": 1147,
|
|
26
26
|
"src/index.ts": 2773,
|
|
27
27
|
"src/mods/learning-harness.ts": 2434,
|
|
28
28
|
"src/mods/mod-engine.test.ts": 2153,
|
|
29
|
-
"src/mods/mod-engine.ts":
|
|
29
|
+
"src/mods/mod-engine.ts": 1841,
|
|
30
30
|
"src/mods/package-installer.test.ts": 1248,
|
|
31
31
|
"src/mods/package-installer.ts": 1201,
|
|
32
32
|
"src/mods/package-registry.ts": 1033,
|
|
@@ -39,12 +39,13 @@
|
|
|
39
39
|
"src/tools/impl/enter-worktree.ts": 1260,
|
|
40
40
|
"src/tools/manager.ts": 3080,
|
|
41
41
|
"src/tools/tool-execution-context.test.ts": 1138,
|
|
42
|
-
"src/types/protocol_v2.ts":
|
|
42
|
+
"src/types/protocol_v2.ts": 2911,
|
|
43
43
|
"src/websocket/listen-client-concurrency.test.ts": 2686,
|
|
44
|
-
"src/websocket/listen-client-protocol.test.ts":
|
|
44
|
+
"src/websocket/listen-client-protocol.test.ts": 5820,
|
|
45
45
|
"src/websocket/listener/commands/memory.ts": 1114,
|
|
46
46
|
"src/websocket/listener/file-commands.ts": 1053,
|
|
47
47
|
"src/websocket/listener/lifecycle.ts": 1051,
|
|
48
|
-
"src/websocket/listener/protocol-inbound.ts":
|
|
49
|
-
"src/websocket/listener/protocol-outbound.ts": 1085
|
|
48
|
+
"src/websocket/listener/protocol-inbound.ts": 2264,
|
|
49
|
+
"src/websocket/listener/protocol-outbound.ts": 1085,
|
|
50
|
+
"src/websocket/listener/turn.ts": 1010
|
|
50
51
|
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { afterAll } from "bun:test";
|
|
2
|
+
import { mkdtempSync, rmSync } from "node:fs";
|
|
3
|
+
import { createRequire } from "node:module";
|
|
4
|
+
import { basename, isAbsolute, join, relative, resolve } from "node:path";
|
|
5
|
+
|
|
6
|
+
const require = createRequire(import.meta.url);
|
|
7
|
+
const os = require("node:os") as typeof import("node:os");
|
|
8
|
+
const originalHome = resolve(os.homedir());
|
|
9
|
+
const configuredTestHome = process.env.LETTA_TEST_HOME?.trim();
|
|
10
|
+
const testHome = configuredTestHome
|
|
11
|
+
? resolve(configuredTestHome)
|
|
12
|
+
: mkdtempSync(join(os.tmpdir(), "letta-code-test-home-"));
|
|
13
|
+
|
|
14
|
+
if (testHome === originalHome) {
|
|
15
|
+
throw new Error("LETTA_TEST_HOME must not be the operator home directory");
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const filesystemEnvKeys = [
|
|
19
|
+
"LETTA_ARTIFACTS_DIR",
|
|
20
|
+
"LETTA_CODE_DEV_BACKEND_DIR",
|
|
21
|
+
"LETTA_DEBUG_FILE",
|
|
22
|
+
"LETTA_HOME",
|
|
23
|
+
"LETTA_LISTENER_PERF_FILE",
|
|
24
|
+
"LETTA_LOCAL_BACKEND_DIR",
|
|
25
|
+
"LETTA_MEMORY_DIR",
|
|
26
|
+
"LETTA_MODEL_CATALOG_CACHE_DIR",
|
|
27
|
+
"LETTA_TRANSCRIPT_ROOT",
|
|
28
|
+
"LETTA_TUI_PERF_FILE",
|
|
29
|
+
"MEMORY_DIR",
|
|
30
|
+
"WEZTERM_CONFIG_FILE",
|
|
31
|
+
"XDG_CONFIG_HOME",
|
|
32
|
+
] as const;
|
|
33
|
+
|
|
34
|
+
function isWithin(path: string, root: string): boolean {
|
|
35
|
+
const child = relative(root, path);
|
|
36
|
+
return child === "" || (!child.startsWith("..") && !isAbsolute(child));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
for (const key of filesystemEnvKeys) {
|
|
40
|
+
const value = process.env[key]?.trim();
|
|
41
|
+
if (!value || !isAbsolute(value)) continue;
|
|
42
|
+
const absolute = resolve(value);
|
|
43
|
+
if (!isWithin(absolute, originalHome)) continue;
|
|
44
|
+
process.env[key] = join(testHome, relative(originalHome, absolute));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
process.env.LETTA_TEST_HOME = testHome;
|
|
48
|
+
process.env.HOME = testHome;
|
|
49
|
+
process.env.USERPROFILE = testHome;
|
|
50
|
+
process.env.LETTA_TEST_SECRETS_SERVICE_PREFIX = `letta-code-test-${process.pid}-${basename(testHome)}`;
|
|
51
|
+
process.env.LETTA_CODE_TELEM ??= "0";
|
|
52
|
+
|
|
53
|
+
// Bun resolves os.homedir() before preloads run. Patch the shared built-in
|
|
54
|
+
// module so both ESM and CommonJS consumers use the disposable home. This is a
|
|
55
|
+
// direct module update rather than a Bun test mock, so mock.restore() in an
|
|
56
|
+
// unrelated suite cannot remove the filesystem boundary. Child processes use
|
|
57
|
+
// the redirected environment before their runtimes initialize.
|
|
58
|
+
os.homedir = () => testHome;
|
|
59
|
+
|
|
60
|
+
if (!configuredTestHome) {
|
|
61
|
+
const cleanup = () => {
|
|
62
|
+
rmSync(testHome, { recursive: true, force: true });
|
|
63
|
+
};
|
|
64
|
+
afterAll(cleanup);
|
|
65
|
+
process.once("exit", cleanup);
|
|
66
|
+
}
|
|
@@ -10,7 +10,17 @@ For UI that belongs to a larger command/event mod, also read `architecture.md` f
|
|
|
10
10
|
letta.capabilities.ui.panels
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
- `panels`: text
|
|
13
|
+
- `panels`: TUI-only local UI, including text panels around the input bar and persistent transcript notifications. Desktop/listener disables this capability.
|
|
14
|
+
|
|
15
|
+
## Persistent transcript notifications
|
|
16
|
+
|
|
17
|
+
Use `letta.ui.notify(message)` for a durable TUI-only event line such as a model auto-swap or background-work completion. It uses the same transcript visual as `Dreamed; no durable memory changes were needed.` and is not sent to the model or added to agent context. Guard calls with `letta.capabilities.ui.panels`; Desktop/listener cannot render them.
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
if (letta.capabilities.ui.panels) {
|
|
21
|
+
letta.ui.notify("The fallback model is now active.");
|
|
22
|
+
}
|
|
23
|
+
```
|
|
14
24
|
|
|
15
25
|
## Panels
|
|
16
26
|
|