@letta-ai/letta-code 0.30.3 → 0.30.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/agent-presets.js +125 -19
- package/dist/agent-presets.js.map +3 -3
- package/dist/mcp-client.js +2 -2
- package/dist/mcp-client.js.map +1 -1
- package/dist/types/agent/create-agent-request.d.ts +55 -25
- package/dist/types/agent/create-agent-request.d.ts.map +1 -1
- package/dist/types/agent/modify.d.ts.map +1 -1
- package/dist/types/agent/subagents/index.d.ts +1 -0
- package/dist/types/agent/subagents/index.d.ts.map +1 -1
- package/dist/types/agent/subagents/manager.d.ts +1 -0
- package/dist/types/agent/subagents/manager.d.ts.map +1 -1
- package/dist/types/agent/subagents/subagent-launcher.d.ts.map +1 -1
- package/dist/types/agent-presets.d.ts +1 -1
- package/dist/types/agent-presets.d.ts.map +1 -1
- package/dist/types/channels/accounts.d.ts.map +1 -1
- package/dist/types/channels/config.d.ts.map +1 -1
- package/dist/types/channels/inbound-debounce.d.ts +4 -0
- package/dist/types/channels/inbound-debounce.d.ts.map +1 -1
- package/dist/types/channels/plugin-types.d.ts +8 -0
- package/dist/types/channels/plugin-types.d.ts.map +1 -1
- package/dist/types/channels/registry-inbound.d.ts.map +1 -1
- package/dist/types/channels/types.d.ts +11 -12
- package/dist/types/channels/types.d.ts.map +1 -1
- package/dist/types/channels/whatsapp/adapter-helpers.d.ts +21 -0
- package/dist/types/channels/whatsapp/adapter-helpers.d.ts.map +1 -0
- package/dist/types/channels/whatsapp/adapter-types.d.ts +44 -0
- package/dist/types/channels/whatsapp/adapter-types.d.ts.map +1 -0
- package/dist/types/channels/whatsapp/adapter.d.ts +5 -1
- package/dist/types/channels/whatsapp/adapter.d.ts.map +1 -1
- package/dist/types/channels/whatsapp/attachment-policy-types.d.ts +13 -0
- package/dist/types/channels/whatsapp/attachment-policy-types.d.ts.map +1 -0
- package/dist/types/channels/whatsapp/attachment-policy.d.ts +22 -0
- package/dist/types/channels/whatsapp/attachment-policy.d.ts.map +1 -0
- package/dist/types/channels/whatsapp/dedupe-claims.d.ts +8 -0
- package/dist/types/channels/whatsapp/dedupe-claims.d.ts.map +1 -0
- package/dist/types/channels/whatsapp/inbound-debounce.d.ts +28 -0
- package/dist/types/channels/whatsapp/inbound-debounce.d.ts.map +1 -0
- package/dist/types/channels/whatsapp/media.d.ts +5 -3
- package/dist/types/channels/whatsapp/media.d.ts.map +1 -1
- package/dist/types/channels/whatsapp/message-actions.d.ts.map +1 -1
- package/dist/types/channels/whatsapp/message-prefix-config-types.d.ts +5 -0
- package/dist/types/channels/whatsapp/message-prefix-config-types.d.ts.map +1 -0
- package/dist/types/channels/whatsapp/message-store.d.ts +13 -0
- package/dist/types/channels/whatsapp/message-store.d.ts.map +1 -0
- package/dist/types/channels/whatsapp/reactions.d.ts +33 -0
- package/dist/types/channels/whatsapp/reactions.d.ts.map +1 -0
- package/dist/types/channels/whatsapp/reconnect-scheduler.d.ts +16 -0
- package/dist/types/channels/whatsapp/reconnect-scheduler.d.ts.map +1 -0
- package/dist/types/channels/whatsapp/session.d.ts +6 -1
- package/dist/types/channels/whatsapp/session.d.ts.map +1 -1
- package/dist/types/channels/whatsapp/typing-controller.d.ts +28 -0
- package/dist/types/channels/whatsapp/typing-controller.d.ts.map +1 -0
- package/dist/types/channels/whatsapp/waiting-behavior-config-types.d.ts +6 -0
- package/dist/types/channels/whatsapp/waiting-behavior-config-types.d.ts.map +1 -0
- package/dist/types/cli/helpers/memory-reminder.d.ts +9 -3
- package/dist/types/cli/helpers/memory-reminder.d.ts.map +1 -1
- package/dist/types/reflection-settings.d.ts +9 -0
- package/dist/types/reflection-settings.d.ts.map +1 -0
- package/dist/types/settings-manager.d.ts +9 -10
- package/dist/types/settings-manager.d.ts.map +1 -1
- package/dist/types/telemetry/index.d.ts +15 -1
- package/dist/types/telemetry/index.d.ts.map +1 -1
- package/dist/types/tools/impl/process_manager.d.ts +1 -0
- package/dist/types/tools/impl/process_manager.d.ts.map +1 -1
- package/dist/types/tools/impl/task.d.ts +4 -0
- package/dist/types/tools/impl/task.d.ts.map +1 -1
- package/dist/types/types/protocol_v2.d.ts +13 -0
- package/dist/types/types/protocol_v2.d.ts.map +1 -1
- package/dist/types/websocket/listener/protocol-outbound.d.ts.map +1 -1
- package/dist/types/websocket/listener/types.d.ts +11 -0
- package/dist/types/websocket/listener/types.d.ts.map +1 -1
- package/letta.js +3489 -1483
- package/package.json +1 -1
- package/scripts/isolated-unit-tests.json +11 -0
- package/scripts/source-file-size-baseline.json +7 -7
- package/skills/managing-shared-memory/SKILL.md +47 -81
package/package.json
CHANGED
|
@@ -55,6 +55,17 @@
|
|
|
55
55
|
"timeoutMs": 15000,
|
|
56
56
|
"reason": "Mutates the settings singleton, keychain test overrides, HOME, and the secrets service name."
|
|
57
57
|
},
|
|
58
|
+
{
|
|
59
|
+
"path": "src/cli/reflection-worktree-completion.test.ts",
|
|
60
|
+
"timeoutMs": 15000,
|
|
61
|
+
"env": { "LETTA_CODE_TELEM": "1" },
|
|
62
|
+
"reason": "Exercises reflection worktree cleanup telemetry with real Git processes and the shared telemetry singleton."
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"path": "src/cli/helpers/reflection-launcher.test.ts",
|
|
66
|
+
"timeoutMs": 15000,
|
|
67
|
+
"reason": "Exercises reflection launch preflight with real Git processes and temporary local-backend environment overrides."
|
|
68
|
+
},
|
|
58
69
|
{
|
|
59
70
|
"path": "src/telemetry/flush-auth.test.ts",
|
|
60
71
|
"timeoutMs": 15000,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"src/backend/local/local-backend.ts": 1014,
|
|
6
6
|
"src/backend/local/local-store.ts": 3594,
|
|
7
7
|
"src/backend/pi-stream-adapter.test.ts": 1304,
|
|
8
|
-
"src/cli/app/AppCoordinator.tsx":
|
|
8
|
+
"src/cli/app/AppCoordinator.tsx": 5188,
|
|
9
9
|
"src/cli/app/AppView.tsx": 1735,
|
|
10
10
|
"src/cli/app/use-approval-flow.ts": 1163,
|
|
11
11
|
"src/cli/app/use-configuration-handlers.ts": 1433,
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"src/cli/app/use-submit-handler.ts": 4077,
|
|
14
14
|
"src/cli/components/AgentSelector.tsx": 1104,
|
|
15
15
|
"src/cli/components/InputRich.tsx": 2225,
|
|
16
|
-
"src/cli/components/ModelSelector.tsx":
|
|
16
|
+
"src/cli/components/ModelSelector.tsx": 1259,
|
|
17
17
|
"src/cli/components/ProviderSelector.tsx": 1692,
|
|
18
18
|
"src/cli/components/ToolCallMessageRich.tsx": 1109,
|
|
19
19
|
"src/cli/helpers/accumulator.ts": 1596,
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"src/cli/mods/local-mod-loader.test.ts": 1043,
|
|
23
23
|
"src/cli/reflection-transcript.test.ts": 1084,
|
|
24
24
|
"src/cli/subcommands/skills.ts": 1264,
|
|
25
|
-
"src/headless.ts":
|
|
25
|
+
"src/headless.ts": 5242,
|
|
26
26
|
"src/hooks/integration.test.ts": 1147,
|
|
27
|
-
"src/index.ts":
|
|
27
|
+
"src/index.ts": 2776,
|
|
28
28
|
"src/mods/learning-harness.ts": 2434,
|
|
29
29
|
"src/mods/mod-engine.test.ts": 2153,
|
|
30
30
|
"src/mods/mod-engine.ts": 1847,
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"src/tools/impl/enter-worktree.ts": 1260,
|
|
41
41
|
"src/tools/manager.ts": 3261,
|
|
42
42
|
"src/tools/tool-execution-context.test.ts": 1422,
|
|
43
|
-
"src/types/protocol_v2.ts":
|
|
43
|
+
"src/types/protocol_v2.ts": 2958,
|
|
44
44
|
"src/websocket/listen-client-concurrency.test.ts": 2686,
|
|
45
45
|
"src/websocket/listen-client-protocol.test.ts": 5827,
|
|
46
46
|
"src/websocket/listener/commands/memory.ts": 1114,
|
|
47
|
-
"src/websocket/listener/file-commands.ts":
|
|
47
|
+
"src/websocket/listener/file-commands.ts": 1053,
|
|
48
48
|
"src/websocket/listener/lifecycle.ts": 1052,
|
|
49
|
-
"src/websocket/listener/protocol-inbound.ts":
|
|
49
|
+
"src/websocket/listener/protocol-inbound.ts": 2315,
|
|
50
50
|
"src/websocket/listener/protocol-outbound.ts": 1085
|
|
51
51
|
}
|
|
@@ -5,123 +5,89 @@ description: Create and manage shared memory — git-tracked repositories hosted
|
|
|
5
5
|
|
|
6
6
|
# Managing Shared Memory
|
|
7
7
|
|
|
8
|
-
Shared memory is memory created independently of any single agent, designed to be dynamically attached to or detached from multiple agents. Each unit of shared memory is a **shared memory repository**: a git
|
|
8
|
+
Shared memory is memory created independently of any single agent, designed to be dynamically attached to or detached from multiple agents. Each unit of shared memory is a **shared memory repository**: a git repository hosted on Letta Cloud, owned by your organization rather than by one agent, reachable from any environment (sandboxes, remote machines, sessions).
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Shared memory works exactly like your MemFS: attached repositories are real git checkouts on disk, and you read, edit, commit, and push them with ordinary git. The only differences are that each repository has its own projection root (next to your memory directory, not inside it) and its own remote origin, and other agents may be writing to it too.
|
|
11
11
|
|
|
12
12
|
Create a shared memory repository when:
|
|
13
13
|
- You have context an agent should be able to access that doesn't belong in its own MemFS (input files, datasets, docs, working artifacts)
|
|
14
14
|
- Multiple agents need to read or write the same context
|
|
15
15
|
- You want a versioned file store that survives across environments and sessions
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
## Working with Files (the normal path)
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
When shared memory is attached to you and you're running in a cloud sandbox/environment, it is projected on disk next to your memory directory — each repository at its own projection root:
|
|
19
|
+
Attached shared memory is mounted next to your memory directory, one git checkout per repository:
|
|
22
20
|
|
|
23
21
|
```bash
|
|
24
|
-
ls "$MEMORY_DIR/../"
|
|
25
|
-
cat "$MEMORY_DIR/../<repo-name>/<path>"
|
|
22
|
+
ls "$MEMORY_DIR/../" # attached repositories appear here by name
|
|
23
|
+
cat "$MEMORY_DIR/../<repo-name>/<path>" # read like any file
|
|
26
24
|
```
|
|
27
25
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
## API Operations
|
|
31
|
-
|
|
32
|
-
Shared memory repositories are the `repositories` resource in the Letta API. All operations go through the API using `$LETTA_API_KEY` via the Bash tool. Use `https://api.letta.com` (or `$LETTA_BASE_URL` if set — e.g. when running under Letta Desktop, which proxies auth). Responses are JSON.
|
|
26
|
+
Edit files with your normal file tools, then commit and push with git — the mount's origin and credentials are already configured:
|
|
33
27
|
|
|
34
28
|
```bash
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
cd "$MEMORY_DIR/../<repo-name>"
|
|
30
|
+
git add <files>
|
|
31
|
+
git commit -m "describe the change"
|
|
32
|
+
git push
|
|
37
33
|
```
|
|
38
34
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
# Create
|
|
43
|
-
curl -sS -X POST "$BASE/v1/repositories" -H "$AUTH" -H "Content-Type: application/json" \
|
|
44
|
-
-d '{"name": "shared-inputs"}'
|
|
45
|
-
# → {"id": "repo-...", "name": "shared-inputs", "created_at": ..., "updated_at": ...}
|
|
46
|
-
|
|
47
|
-
# List (paginated)
|
|
48
|
-
curl -sS "$BASE/v1/repositories?limit=50&offset=0" -H "$AUTH"
|
|
49
|
-
# → {"repositories": [...], "has_next_page": false}
|
|
35
|
+
Unlike MemFS, the harness does not auto-push shared memory after turns — a commit you don't push is not visible to other agents or environments. Always push after committing.
|
|
50
36
|
|
|
51
|
-
|
|
52
|
-
curl -sS "$BASE/v1/repositories/{repository_id}" -H "$AUTH"
|
|
37
|
+
To pick up other agents' changes:
|
|
53
38
|
|
|
54
|
-
|
|
55
|
-
|
|
39
|
+
```bash
|
|
40
|
+
git -C "$MEMORY_DIR/../<repo-name>" pull --rebase
|
|
56
41
|
```
|
|
57
42
|
|
|
58
|
-
|
|
43
|
+
If a push is rejected (another agent pushed first), `git pull --rebase` then push again.
|
|
59
44
|
|
|
60
|
-
|
|
45
|
+
History is ordinary git history:
|
|
61
46
|
|
|
62
47
|
```bash
|
|
63
|
-
|
|
64
|
-
curl -sS "$BASE/v1/repositories/{repository_id}/files?path_prefix=docs/&depth=2" -H "$AUTH"
|
|
65
|
-
# → {"files": [{"path": "docs/a.md", "type": "file"}, ...], "ref": "<sha>"}
|
|
66
|
-
|
|
67
|
-
# Create
|
|
68
|
-
curl -sS -X POST "$BASE/v1/repositories/{repository_id}/files" -H "$AUTH" \
|
|
69
|
-
-H "Content-Type: application/json" \
|
|
70
|
-
-d '{"path": "docs/a.md", "content": "hello"}'
|
|
71
|
-
|
|
72
|
-
# Read (optional: ref for a historical version)
|
|
73
|
-
curl -sS "$BASE/v1/repositories/{repository_id}/files/content?path=docs/a.md" -H "$AUTH"
|
|
74
|
-
# → {"path": "docs/a.md", "content": "hello", "content_sha256": "...", "ref": "..."}
|
|
75
|
-
|
|
76
|
-
# Update content and/or rename. The optional precondition fails the write
|
|
77
|
-
# if the file changed since you last read it (use when multiple agents write).
|
|
78
|
-
curl -sS -X POST "$BASE/v1/repositories/{repository_id}/files/content" -H "$AUTH" \
|
|
79
|
-
-H "Content-Type: application/json" \
|
|
80
|
-
-d '{
|
|
81
|
-
"path": "docs/a.md",
|
|
82
|
-
"content": "updated",
|
|
83
|
-
"new_path": "docs/b.md",
|
|
84
|
-
"precondition": {"type": "content_sha256", "content_sha256": "<sha from last read>"}
|
|
85
|
-
}'
|
|
86
|
-
|
|
87
|
-
# Delete
|
|
88
|
-
curl -sS -X DELETE "$BASE/v1/repositories/{repository_id}/files/content" -H "$AUTH" \
|
|
89
|
-
-H "Content-Type: application/json" -d '{"path": "docs/b.md"}'
|
|
90
|
-
# → {"success": true, "commit_sha": "..."}
|
|
48
|
+
git -C "$MEMORY_DIR/../<repo-name>" log --oneline -- <path>
|
|
91
49
|
```
|
|
92
50
|
|
|
93
|
-
|
|
51
|
+
## Managing Repositories (create / attach / detach)
|
|
52
|
+
|
|
53
|
+
Use the `letta shared-memory` subcommand. It uses your harness auth (works even when `LETTA_API_KEY` is not in the shell env) and inherits the agent id from `AGENT_ID`, so `--agent` is only needed when targeting another agent.
|
|
94
54
|
|
|
95
55
|
```bash
|
|
96
|
-
# List
|
|
97
|
-
|
|
98
|
-
# → {"commits": [{"sha": "...", "message": "...", "timestamp": "...", "author_name": ...}]}
|
|
56
|
+
# List org repositories (marks which are attached to you)
|
|
57
|
+
letta shared-memory list
|
|
99
58
|
|
|
100
|
-
#
|
|
101
|
-
|
|
102
|
-
```
|
|
59
|
+
# Create a repository
|
|
60
|
+
letta shared-memory create --name shared-notes
|
|
103
61
|
|
|
104
|
-
|
|
62
|
+
# Attach to yourself: attaches via the API, clones the local mount at
|
|
63
|
+
# $MEMORY_DIR/../shared-notes, and recompiles the system prompt projection
|
|
64
|
+
letta shared-memory attach shared-notes
|
|
105
65
|
|
|
106
|
-
|
|
66
|
+
# Attach to another agent (its mount materializes in that agent's environments)
|
|
67
|
+
letta shared-memory attach shared-notes --agent agent-...
|
|
107
68
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
curl -sS "$BASE/v1/agents/{agent_id}/repositories" -H "$AUTH"
|
|
69
|
+
# Detach (leaves the local mount directory in place)
|
|
70
|
+
letta shared-memory detach shared-notes
|
|
111
71
|
|
|
112
|
-
#
|
|
113
|
-
|
|
114
|
-
|
|
72
|
+
# Repair/refresh mounts: clone or pull every attached repository. Use this when
|
|
73
|
+
# the system prompt references a repository that is missing on disk (e.g. after
|
|
74
|
+
# it was attached from another surface while this session was running).
|
|
75
|
+
letta shared-memory sync
|
|
115
76
|
|
|
116
|
-
#
|
|
117
|
-
|
|
77
|
+
# Commit history via the API (works even without a local mount)
|
|
78
|
+
letta shared-memory history shared-notes --path docs/plan.md
|
|
118
79
|
```
|
|
119
80
|
|
|
120
|
-
|
|
81
|
+
## Troubleshooting
|
|
82
|
+
|
|
83
|
+
- **Prompt lists a repository but `$MEMORY_DIR/../<name>` is missing** — the repository was attached without materializing the mount. Run `letta shared-memory sync`.
|
|
84
|
+
- **`sync` reports "mount path already exists and is not a git repository"** — a plain directory (usually created by hand before the mount existed) is occupying the mount path. Inspect it, salvage anything worth keeping, move or delete it, then re-run `letta shared-memory sync`.
|
|
85
|
+
- **Never hand-clone the repository to another location (e.g. /tmp) to work around a broken mount** — fix the mount with `letta shared-memory sync` so every session and other agents see the same checkout.
|
|
86
|
+
- **Permission denied under another agent's directory** — shared repositories mount per-agent. Only your own mount (under your agent directory) is accessible; another agent's mount of the same repository is walled off by the cross-agent guard. Run `letta shared-memory sync` to get your own mount.
|
|
87
|
+
- **Push rejected (non-fast-forward)** — another agent pushed first: `git pull --rebase`, resolve any conflicts, push again.
|
|
121
88
|
|
|
122
89
|
## Notes and Limits
|
|
123
90
|
|
|
124
|
-
- Shared memory files are **text** content; binary files are not supported via the files API.
|
|
125
|
-
- Attached shared memory is not scoped to you — another agent may edit the same files at any time. Use the `content_sha256` precondition on updates when multiple agents may write the same file; on failure, re-read and retry.
|
|
126
91
|
- Shared memory is not part of your system prompt. Writing to it does not change your in-context memory — for that, edit your memory blocks or MemFS files.
|
|
127
|
-
-
|
|
92
|
+
- Attaching is asynchronous on the server; `letta shared-memory attach` waits for the attachment to be visible before cloning.
|
|
93
|
+
- SDK/API equivalent for programmatic callers: `@letta-ai/letta-agent-sdk` exposes these operations as `client.repositories` (with `files` and `versions` helpers), and shared memory can be attached for a session's lifetime via `resources: [{ type: "repository", repositoryId }]` on cloud sessions. The REST resource is `/v1/repositories`.
|