@letta-ai/letta-code 0.32.12 → 0.32.13
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/mcp-client.js +2 -2
- package/dist/mcp-client.js.map +1 -1
- package/dist/types/agent/subagents/manager.d.ts.map +1 -1
- package/dist/types/agent/subagents/subagent-process.d.ts +23 -0
- package/dist/types/agent/subagents/subagent-process.d.ts.map +1 -0
- package/dist/types/telemetry/index.d.ts +16 -1
- package/dist/types/telemetry/index.d.ts.map +1 -1
- package/dist/types/tools/impl/process_manager.d.ts +2 -0
- package/dist/types/tools/impl/process_manager.d.ts.map +1 -1
- package/dist/types/tools/impl/task-stop.d.ts.map +1 -1
- package/dist/types/tools/impl/task.d.ts.map +1 -1
- package/letta.js +2 -2
- package/package.json +1 -1
- package/scripts/build-pypi.py +172 -0
- package/scripts/isolated-unit-tests.json +5 -0
- package/scripts/smoke-pypi.py +236 -0
- package/scripts/source-file-size-baseline.json +1 -1
- package/scripts/stage-pypi-deps.mjs +90 -0
- package/skills/finding-agents/SKILL.md +6 -2
- package/skills/letta-guide/SKILL.md +21 -2
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// Copy the locked runtime dependency closure, preserving Node's nested versions.
|
|
2
|
+
// No dependency installation happens on the user's machine.
|
|
3
|
+
import {
|
|
4
|
+
cpSync,
|
|
5
|
+
existsSync,
|
|
6
|
+
mkdirSync,
|
|
7
|
+
readdirSync,
|
|
8
|
+
readFileSync,
|
|
9
|
+
realpathSync,
|
|
10
|
+
} from "node:fs";
|
|
11
|
+
import { dirname, join, resolve } from "node:path";
|
|
12
|
+
|
|
13
|
+
const root = process.cwd();
|
|
14
|
+
const app = resolve(process.argv[2]);
|
|
15
|
+
// sharp-electron is only reachable under Electron, never our bundled Node.
|
|
16
|
+
const roots = ["ws", "@vscode/ripgrep", "node-pty", "grammy"];
|
|
17
|
+
|
|
18
|
+
function locate(name, from) {
|
|
19
|
+
for (let dir = from; ; dir = dirname(dir)) {
|
|
20
|
+
const candidate = join(dir, "node_modules", name);
|
|
21
|
+
if (existsSync(join(candidate, "package.json")))
|
|
22
|
+
return realpathSync(candidate);
|
|
23
|
+
if (dir === dirname(dir))
|
|
24
|
+
throw new Error(`Missing locked dependency ${name} from ${from}`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function compatible(pkg) {
|
|
28
|
+
return (
|
|
29
|
+
(!pkg.os || pkg.os.includes(process.platform)) &&
|
|
30
|
+
(!pkg.cpu || pkg.cpu.includes(process.arch)) &&
|
|
31
|
+
(!pkg.libc || pkg.libc.includes("glibc"))
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
function copy(name, from, dest, ancestors = new Set()) {
|
|
35
|
+
const source = locate(name, from);
|
|
36
|
+
const pkg = JSON.parse(readFileSync(join(source, "package.json")));
|
|
37
|
+
if (!compatible(pkg)) return;
|
|
38
|
+
if (ancestors.has(source)) throw new Error(`Dependency cycle at ${source}`);
|
|
39
|
+
const target = join(dest, "node_modules", name);
|
|
40
|
+
mkdirSync(dirname(target), { recursive: true });
|
|
41
|
+
cpSync(source, target, {
|
|
42
|
+
recursive: true,
|
|
43
|
+
dereference: true,
|
|
44
|
+
filter: (path) =>
|
|
45
|
+
path === source ||
|
|
46
|
+
!["node_modules", ".git"].includes(
|
|
47
|
+
path.slice(source.length + 1).split(/[\\/]/)[0],
|
|
48
|
+
),
|
|
49
|
+
});
|
|
50
|
+
const chain = new Set([...ancestors, source]);
|
|
51
|
+
const optional = pkg.optionalDependencies || {};
|
|
52
|
+
for (const dependency of Object.keys({ ...pkg.dependencies, ...optional })) {
|
|
53
|
+
try {
|
|
54
|
+
locate(dependency, source);
|
|
55
|
+
} catch (error) {
|
|
56
|
+
if (dependency in optional) continue;
|
|
57
|
+
throw error;
|
|
58
|
+
}
|
|
59
|
+
copy(dependency, source, target, chain);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
for (const name of roots) copy(name, root, app);
|
|
63
|
+
// Bun bundles Sharp JS but leaves its computed @img native requires unresolved.
|
|
64
|
+
const sharp = locate("sharp", root);
|
|
65
|
+
const sharpPackage = JSON.parse(readFileSync(join(sharp, "package.json")));
|
|
66
|
+
for (const name of Object.keys(sharpPackage.optionalDependencies || {})) {
|
|
67
|
+
try {
|
|
68
|
+
locate(name, sharp);
|
|
69
|
+
} catch {
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
copy(name, sharp, app);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Retain license notices for code in the JS bundle as well as external modules.
|
|
76
|
+
function licenses(dir, destination) {
|
|
77
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
78
|
+
const path = join(dir, entry.name);
|
|
79
|
+
if (entry.isDirectory() && entry.name !== ".bin")
|
|
80
|
+
licenses(path, join(destination, entry.name));
|
|
81
|
+
else if (
|
|
82
|
+
entry.isFile() &&
|
|
83
|
+
/^(licen[sc]e|copying|notice)([.-]|$)/i.test(entry.name)
|
|
84
|
+
) {
|
|
85
|
+
mkdirSync(destination, { recursive: true });
|
|
86
|
+
cpSync(path, join(destination, entry.name));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
licenses(join(root, "node_modules"), join(app, "third-party-licenses"));
|
|
@@ -30,6 +30,7 @@ letta agents list [options]
|
|
|
30
30
|
| `--tags <tag1,tag2>` | Filter by tags (comma-separated) |
|
|
31
31
|
| `--match-all-tags` | Require ALL tags (default: ANY) |
|
|
32
32
|
| `--include-blocks` | Include agent.blocks in response |
|
|
33
|
+
| `--shared` | List agents shared with the current user |
|
|
33
34
|
| `--limit <n>` | Max results (default: 20) |
|
|
34
35
|
|
|
35
36
|
## Common Patterns
|
|
@@ -44,14 +45,17 @@ letta agents list --tags "origin:letta-code"
|
|
|
44
45
|
|
|
45
46
|
This is useful when the user is looking for agents they've worked with in Letta Code CLI sessions.
|
|
46
47
|
|
|
47
|
-
### Finding All Agents
|
|
48
|
+
### Finding All Accessible Agents
|
|
48
49
|
|
|
49
|
-
|
|
50
|
+
List agents owned by the current user, then list agents shared with them:
|
|
50
51
|
|
|
51
52
|
```bash
|
|
52
53
|
letta agents list
|
|
54
|
+
letta agents list --shared
|
|
53
55
|
```
|
|
54
56
|
|
|
57
|
+
Use `--query <text>` with either command to search by name.
|
|
58
|
+
|
|
55
59
|
## Examples
|
|
56
60
|
|
|
57
61
|
**List all agents (up to 20):**
|
|
@@ -34,7 +34,8 @@ helper below fetches the live index first, so you pick a URL that exists.
|
|
|
34
34
|
The helper retrieves `https://docs.letta.com/llms.txt` from the docs host,
|
|
35
35
|
verifies its ETag against the body, and prints the paths to a current local
|
|
36
36
|
copy and heading outline. Read the outline, then read the relevant index
|
|
37
|
-
lines to pick
|
|
37
|
+
lines and their applicability labels to pick a page matching the user's
|
|
38
|
+
backend and interface (see below).
|
|
38
39
|
3. **Fetch the specific page directly.** Pass the exact canonical URL from the
|
|
39
40
|
index back to the same helper, for example:
|
|
40
41
|
|
|
@@ -43,7 +44,8 @@ helper below fetches the live index first, so you pick a URL that exists.
|
|
|
43
44
|
--docs-url "https://docs.letta.com/configuration/models/index.md"
|
|
44
45
|
```
|
|
45
46
|
|
|
46
|
-
Read the returned docs path
|
|
47
|
+
Read the returned docs path, including its frontmatter, before applying its
|
|
48
|
+
instructions or running the helper for another URL. The
|
|
47
49
|
helper uses native HTTPS with a curl fallback; do not use `fetch_webpage`
|
|
48
50
|
for the normal docs route because its upstream content cache may be stale.
|
|
49
51
|
Cite the public doc URL so the user can go deeper.
|
|
@@ -53,6 +55,23 @@ helper below fetches the live index first, so you pick a URL that exists.
|
|
|
53
55
|
give your best answer, and clearly mark it as possibly out of date with a
|
|
54
56
|
link to https://docs.letta.com. Never silently fall back to memory.
|
|
55
57
|
|
|
58
|
+
## Match documentation to the user's setup
|
|
59
|
+
|
|
60
|
+
Read each page's `applies_to` frontmatter before using its instructions:
|
|
61
|
+
|
|
62
|
+
```yaml
|
|
63
|
+
applies_to:
|
|
64
|
+
backends: [cloud, local]
|
|
65
|
+
interfaces: [web, desktop, cli, sdk]
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
- **Backends describe agent state, not the computer running tools.** `cloud`
|
|
69
|
+
means Letta Cloud; `local` means a user-managed backend.
|
|
70
|
+
- **Interfaces** refer to the user's current interface: chat.letta.com (`web`,
|
|
71
|
+
cloud-only), CLI, Desktop, or SDK.
|
|
72
|
+
- Do NOT use context from files marked `status: legacy` unless providing
|
|
73
|
+
historical context.
|
|
74
|
+
|
|
56
75
|
## Inspect or change your model from the CLI
|
|
57
76
|
|
|
58
77
|
- `letta model list [--byok | --hosted]` lists available models.
|