@letta-ai/letta-code 0.31.4 → 0.31.6

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.
Files changed (35) hide show
  1. package/dist/agent-presets.js +201 -1
  2. package/dist/agent-presets.js.map +3 -3
  3. package/dist/mcp-client.js +2 -2
  4. package/dist/mcp-client.js.map +1 -1
  5. package/dist/types/agent/attached-repositories.d.ts +7 -0
  6. package/dist/types/agent/attached-repositories.d.ts.map +1 -0
  7. package/dist/types/agent/client-skills.d.ts +1 -1
  8. package/dist/types/agent/client-skills.d.ts.map +1 -1
  9. package/dist/types/agent/memory-constraints.d.ts +22 -0
  10. package/dist/types/agent/memory-constraints.d.ts.map +1 -0
  11. package/dist/types/agent/memory-git-hooks.d.ts +5 -5
  12. package/dist/types/agent/memory-git-hooks.d.ts.map +1 -1
  13. package/dist/types/agent/memory-git.d.ts +36 -5
  14. package/dist/types/agent/memory-git.d.ts.map +1 -1
  15. package/dist/types/agent/modify.d.ts.map +1 -1
  16. package/dist/types/agent/prompt-assets.d.ts +2 -1
  17. package/dist/types/agent/prompt-assets.d.ts.map +1 -1
  18. package/dist/types/agent/shared-memory-skills.d.ts +1 -1
  19. package/dist/types/agent/shared-memory-skills.d.ts.map +1 -1
  20. package/dist/types/agent/system-prompt-versioning.d.ts +5 -0
  21. package/dist/types/agent/system-prompt-versioning.d.ts.map +1 -1
  22. package/dist/types/backend/dev/pi-model-factory.d.ts +0 -1
  23. package/dist/types/backend/dev/pi-model-factory.d.ts.map +1 -1
  24. package/dist/types/backend/local/local-model-config.d.ts.map +1 -1
  25. package/dist/types/tools/impl/skill.d.ts +7 -1
  26. package/dist/types/tools/impl/skill.d.ts.map +1 -1
  27. package/letta.js +20153 -19752
  28. package/package.json +2 -2
  29. package/scripts/source-file-size-baseline.json +1 -1
  30. package/skills/context-doctor/ROOT_MEMORY.md +137 -0
  31. package/skills/initializing-memory/ROOT_MEMORY.md +721 -0
  32. package/skills/managing-shared-memory/SKILL.md +4 -5
  33. package/skills/self-configuration/SKILL.md +13 -8
  34. package/skills/submitting-feedback/SKILL.md +21 -0
  35. package/skills/syncing-memory-filesystem/SKILL.md +20 -10
@@ -7,7 +7,7 @@ description: Create and manage shared memory — git-tracked repositories hosted
7
7
 
8
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
- 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.
10
+ Shared memory works like your MemFS: attached repositories are real git checkouts on disk, and you read, edit, and commit with ordinary git. The harness pushes clean committed changes after each turn. 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)
@@ -23,16 +23,15 @@ ls "$MEMORY_DIR/../" # attached repositories appear here by
23
23
  cat "$MEMORY_DIR/../<repo-name>/<path>" # read like any file
24
24
  ```
25
25
 
26
- Edit files with your normal file tools, then commit and push with git the mount's origin and credentials are already configured:
26
+ Edit files with your normal file tools, then commit with git. The mount's origin and credentials are already configured:
27
27
 
28
28
  ```bash
29
29
  cd "$MEMORY_DIR/../<repo-name>"
30
30
  git add <files>
31
31
  git commit -m "describe the change"
32
- git push
33
32
  ```
34
33
 
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.
34
+ The harness pushes clean commits from read/write attached repositories after the turn. If a push collides with another agent's work, it pulls with rebase and retries once. Dirty files and conflicts are not changed automatically; the harness adds a reminder to the next turn instead.
36
35
 
37
36
  To pick up other agents' changes:
38
37
 
@@ -84,7 +83,7 @@ letta shared-memory history shared-notes --path docs/plan.md
84
83
  - **`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
84
  - **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
85
  - **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.
86
+ - **Shared-memory conflict reminder** — resolve the conflict in the named repository, finish the rebase or commit, and leave the repository clean. The harness retries the push after a future turn.
88
87
 
89
88
  ## Notes and Limits
90
89
 
@@ -88,15 +88,20 @@ If CLI behavior does not match the docs, stop and inspect `command -v letta`, `t
88
88
 
89
89
  Use memory when the user wants you to remember, prefer, learn, or change your identity/personality.
90
90
 
91
- Common files:
91
+ Inspect the projected memory tree in the system prompt before choosing paths.
92
+ Letta Code supports two layouts:
92
93
 
93
- | Path | Purpose |
94
- | --- | --- |
95
- | `$MEMORY_DIR/system/persona.md` | Identity, voice, behavioral defaults |
96
- | `$MEMORY_DIR/system/human.md` | Notes about the person you work with |
97
- | `$MEMORY_DIR/projects/` | Project-specific long-term context |
98
- | `$MEMORY_DIR/skills/` | Agent-owned reusable skills |
99
- | `$MEMORY_DIR/relationships/` | Relationship and collaboration notes |
94
+ | Purpose | Root layout | Existing layout |
95
+ | --- | --- | --- |
96
+ | Identity and voice | `$MEMORY_DIR/persona.md` or another root persona file | `$MEMORY_DIR/system/persona.md` |
97
+ | Notes about the user | `$MEMORY_DIR/human.md` or another root human file | `$MEMORY_DIR/system/human.md` |
98
+ | Core memory | Other root Markdown files indexed by `MEMORY.md` | Markdown files under `$MEMORY_DIR/system/` |
99
+ | Deferred memory | Directories with their own `MEMORY.md` | Files outside `$MEMORY_DIR/system/` |
100
+ | Agent-owned skills | `$MEMORY_DIR/skills/` | `$MEMORY_DIR/skills/` |
101
+
102
+ Use the active layout shown by the prompt and memory tools. Do not create a
103
+ `system/` directory in a root-layout repository or move existing-layout memory
104
+ to the root as part of an unrelated self-configuration request.
100
105
 
101
106
  After changing memory, inspect and commit the exact changed files. Push/sync according to the current harness reminder or the `syncing-memory-filesystem` skill; some environments sync committed memory automatically.
102
107
 
@@ -0,0 +1,21 @@
1
+ ---
2
+ name: submitting-feedback
3
+ description: Submits user-approved feedback about Letta Code or the current agent to the Letta team. Load when the user is upset, frustrated, dissatisfied, reports poor agent behavior, or asks to send feedback. Works with cloud-hosted and local agents. Ask before submitting unless the user already explicitly requested submission.
4
+ ---
5
+
6
+ # Submitting Feedback
7
+
8
+ When the user appears upset with the agent, acknowledge the problem and ask whether they want you to submit feedback to the Letta team. Do not submit merely because the user expressed frustration.
9
+
10
+ If the user says yes, or directly asks you to submit feedback:
11
+
12
+ 1. Write a short factual message in the user's voice. Include what happened, what the user expected, and any useful error or behavior detail already present in the conversation. Do not add claims the user did not make.
13
+ 2. Submit it with:
14
+
15
+ ```bash
16
+ letta feedback --message '<feedback>'
17
+ ```
18
+
19
+ 3. Tell the user whether submission succeeded. If it failed, report the safe CLI error and do not claim the team received it.
20
+
21
+ Do not include secrets, credentials, unrelated conversation content, or private file contents. The command adds the current agent and conversation identifiers so the team can find the relevant run.
@@ -15,11 +15,16 @@ MemFS is a Git repository projected onto the computer where the agent is
15
15
  running. `$MEMORY_DIR` is the repository root. There is no second `memory/`
16
16
  directory inside it.
17
17
 
18
+ The repository can use either memory layout. Inspect its current tree and the
19
+ memory rules in the system prompt before editing files:
20
+
18
21
  ```text
19
- $MEMORY_DIR/
20
- ├── .git/
21
- ├── system/ # loaded into the system prompt
22
- ├── reference/ # loaded only when read
22
+ Root layout Existing layout
23
+ $MEMORY_DIR/ $MEMORY_DIR/
24
+ ├── MEMORY.md # root index ├── system/ # in-context memory
25
+ ├── persona.md # core memory ├── reference/ # deferred memory
26
+ ├── <topic>/ └── skills/ # agent-owned skills
27
+ │ └── MEMORY.md # child index
23
28
  └── skills/ # agent-owned skills
24
29
  ```
25
30
 
@@ -32,7 +37,7 @@ on the current machine. Do not run `git push` for normal MemFS sync; let the
32
37
  harness push after the turn.
33
38
 
34
39
  Committed memory changes do not alter the current compiled prompt immediately.
35
- Use `/recompile` when the current conversation must see new `system/` content
40
+ Use `/recompile` when the current conversation must see changed core memory
36
41
  right away. Otherwise, the next prompt compilation or conversation will use
37
42
  the committed revision.
38
43
 
@@ -87,9 +92,13 @@ auth, branch tracking, and agent identity.
87
92
 
88
93
  ## Uncommitted Changes
89
94
 
90
- Raw file edits must preserve required frontmatter. Markdown files under
91
- `system/` and `reference/` need a non-empty `description`. `read_only` is
92
- protected and cannot be added, removed, or changed by the agent.
95
+ Raw file edits must preserve the active layout's rules:
96
+
97
+ - In the root layout, root and child `MEMORY.md` indexes have no frontmatter.
98
+ Every other memory Markdown file has exactly `name` and `description`.
99
+ - In the existing layout, Markdown files under `system/` and `reference/` need
100
+ a non-empty `description`. `read_only` is protected and cannot be added,
101
+ removed, or changed by the agent.
93
102
 
94
103
  ```markdown
95
104
  ---
@@ -121,7 +130,7 @@ Resolve the conflict markers without deleting required frontmatter, then stage
121
130
  the resolved files by name. Finish the operation Git reports:
122
131
 
123
132
  ```bash
124
- git -C "$MEMORY_DIR" add system/example.md
133
+ git -C "$MEMORY_DIR" add <resolved-memory-path>
125
134
 
126
135
  # If git status says a rebase is in progress:
127
136
  GIT_EDITOR=true git -C "$MEMORY_DIR" rebase --continue
@@ -163,7 +172,8 @@ MemFS synchronization.
163
172
  2. Check whether the backend is cloud-backed or local-only.
164
173
  3. Inspect `git status`, the origin URL, and the current Git operation.
165
174
  4. Use `/memfs enable` for a missing checkout and `/memfs sync` for a pull.
166
- 5. Preserve frontmatter and finish any existing merge or rebase.
175
+ 5. Preserve the active layout's indexes and frontmatter, then finish any
176
+ existing merge or rebase.
167
177
  6. Leave hosted pushes to post-turn sync once the repository is clean.
168
178
  7. If the command still fails, rerun it with `LETTA_DEBUG=1` and report the
169
179
  redacted error. Never print or copy credential-helper values.