@letta-ai/letta-code 0.34.2 → 0.34.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.
Files changed (73) hide show
  1. package/dist/mcp-client.js +2 -2
  2. package/dist/mcp-client.js.map +1 -1
  3. package/dist/mcp-oauth.js +2 -2
  4. package/dist/mcp-oauth.js.map +1 -1
  5. package/dist/memory-constraints.js +47 -13
  6. package/dist/memory-constraints.js.map +3 -3
  7. package/dist/types/agent/memory-constraints.d.ts +2 -0
  8. package/dist/types/agent/memory-constraints.d.ts.map +1 -1
  9. package/dist/types/agent/subagents/manager.d.ts.map +1 -1
  10. package/dist/types/agent/subagents/subagent-depth.d.ts +15 -0
  11. package/dist/types/agent/subagents/subagent-depth.d.ts.map +1 -0
  12. package/dist/types/agent/subagents/subagent-launcher.d.ts.map +1 -1
  13. package/dist/types/agent/subagents/subagent-process.d.ts +7 -0
  14. package/dist/types/agent/subagents/subagent-process.d.ts.map +1 -1
  15. package/dist/types/backend/api/agent-message.d.ts.map +1 -1
  16. package/dist/types/backend/dev/local-provider-errors.d.ts.map +1 -1
  17. package/dist/types/backend/local/local-pi-credential-store.d.ts +4 -3
  18. package/dist/types/backend/local/local-pi-credential-store.d.ts.map +1 -1
  19. package/dist/types/backend/local/local-provider-auth-store.d.ts +7 -0
  20. package/dist/types/backend/local/local-provider-auth-store.d.ts.map +1 -1
  21. package/dist/types/cli/helpers/session-context.d.ts +10 -2
  22. package/dist/types/cli/helpers/session-context.d.ts.map +1 -1
  23. package/dist/types/headless-super-run-wait.d.ts.map +1 -1
  24. package/dist/types/mcp-scope.d.ts +5 -0
  25. package/dist/types/mcp-scope.d.ts.map +1 -0
  26. package/dist/types/memory-constraints.d.ts +4 -0
  27. package/dist/types/memory-constraints.d.ts.map +1 -1
  28. package/dist/types/mods/mod-engine.d.ts.map +1 -1
  29. package/dist/types/mods/turn-start-cancel.d.ts +17 -1
  30. package/dist/types/mods/turn-start-cancel.d.ts.map +1 -1
  31. package/dist/types/reminders/engine.d.ts +2 -0
  32. package/dist/types/reminders/engine.d.ts.map +1 -1
  33. package/dist/types/runtime-execution-settings.d.ts +5 -0
  34. package/dist/types/runtime-execution-settings.d.ts.map +1 -1
  35. package/dist/types/tools/impl/bash.d.ts.map +1 -1
  36. package/dist/types/tools/impl/codex-app-server.d.ts.map +1 -1
  37. package/dist/types/tools/impl/external-coding-agent.d.ts +4 -3
  38. package/dist/types/tools/impl/external-coding-agent.d.ts.map +1 -1
  39. package/dist/types/tools/impl/foreground-sleep.d.ts +13 -0
  40. package/dist/types/tools/impl/foreground-sleep.d.ts.map +1 -0
  41. package/dist/types/tools/impl/process_manager.d.ts +2 -0
  42. package/dist/types/tools/impl/process_manager.d.ts.map +1 -1
  43. package/dist/types/tools/impl/send-agent-message.d.ts.map +1 -1
  44. package/dist/types/tools/impl/shell-launchers.d.ts.map +1 -1
  45. package/dist/types/tools/impl/task-foreground.d.ts +21 -0
  46. package/dist/types/tools/impl/task-foreground.d.ts.map +1 -0
  47. package/dist/types/tools/impl/task-stop.d.ts +1 -0
  48. package/dist/types/tools/impl/task-stop.d.ts.map +1 -1
  49. package/dist/types/tools/impl/task-transcript.d.ts +5 -0
  50. package/dist/types/tools/impl/task-transcript.d.ts.map +1 -0
  51. package/dist/types/tools/impl/task.d.ts +1 -1
  52. package/dist/types/tools/impl/task.d.ts.map +1 -1
  53. package/dist/types/tools/manager.d.ts +1 -1
  54. package/dist/types/tools/manager.d.ts.map +1 -1
  55. package/dist/types/tools/secret-substitution.d.ts +7 -0
  56. package/dist/types/tools/secret-substitution.d.ts.map +1 -1
  57. package/dist/types/tools/subagent-tool-policy.d.ts +16 -0
  58. package/dist/types/tools/subagent-tool-policy.d.ts.map +1 -0
  59. package/dist/types/tools/toolset-catalog.d.ts +1 -1
  60. package/dist/types/utils/checkout-readiness.d.ts +1 -1
  61. package/dist/types/utils/checkout-readiness.d.ts.map +1 -1
  62. package/dist/types/utils/secrets-store.d.ts +2 -0
  63. package/dist/types/utils/secrets-store.d.ts.map +1 -1
  64. package/dist/types/utils/shell-context.d.ts +8 -0
  65. package/dist/types/utils/shell-context.d.ts.map +1 -1
  66. package/dist/types/utils/subagent-depth-env.d.ts +9 -0
  67. package/dist/types/utils/subagent-depth-env.d.ts.map +1 -0
  68. package/dist/types/websocket/listener/queue.d.ts.map +1 -1
  69. package/letta.js +1330 -808
  70. package/package.json +1 -1
  71. package/scripts/source-file-size-baseline.json +3 -3
  72. package/skills/creating-mods/references/events.md +2 -0
  73. package/skills/self-configuration/SKILL.md +32 -38
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letta-ai/letta-code",
3
- "version": "0.34.2",
3
+ "version": "0.34.3",
4
4
  "lettaStartupLogProtocol": 1,
5
5
  "description": "Letta Code is a CLI tool for interacting with stateful Letta agents from the terminal.",
6
6
  "type": "module",
@@ -19,12 +19,12 @@
19
19
  "src/cli/mods/local-mod-loader.test.ts": 1043,
20
20
  "src/cli/reflection-transcript.test.ts": 1084,
21
21
  "src/cli/subcommands/skills.ts": 1264,
22
- "src/headless.ts": 4780,
22
+ "src/headless.ts": 4778,
23
23
  "src/hooks/integration.test.ts": 1147,
24
24
  "src/index.ts": 2577,
25
25
  "src/mods/learning-harness.ts": 2434,
26
26
  "src/mods/mod-engine.test.ts": 2153,
27
- "src/mods/mod-engine.ts": 1838,
27
+ "src/mods/mod-engine.ts": 1836,
28
28
  "src/mods/package-installer.test.ts": 1248,
29
29
  "src/mods/package-installer.ts": 1201,
30
30
  "src/mods/package-registry.ts": 1033,
@@ -33,7 +33,7 @@
33
33
  "src/providers/chatgpt-usage-service.ts": 1112,
34
34
  "src/settings-manager.test.ts": 1635,
35
35
  "src/settings-manager.ts": 2092,
36
- "src/tools/manager.ts": 2625,
36
+ "src/tools/manager.ts": 2610,
37
37
  "src/tools/tool-execution-context.test.ts": 1092,
38
38
  "src/types/protocol_v2.ts": 2542,
39
39
  "src/websocket/listen-client-concurrency.test.ts": 2557,
@@ -226,6 +226,8 @@ letta.events.on("turn_start", (event) => {
226
226
 
227
227
  If multiple handlers cancel, the first valid cancel reason wins. A valid reason is a non-empty string after trimming. Cancellation does not synthesize an assistant response or tool result; it only tells the host not to submit this turn.
228
228
 
229
+ Don't cancel every turn because the guard's own dependency failed (for example, a missing bootstrap file); that locks the user out until they edit or remove the mod and run `/reload`. Guard the risky tool with `tool_start` instead.
230
+
229
231
  Handlers run in registration order. Later handlers see the current input after earlier mutations/returns. If a handler throws, its partial `event.input` mutation is rolled back and the error is recorded as a mod diagnostic.
230
232
 
231
233
  `turn_start` is intentionally a trusted local mod point: it can rewrite user messages, approval results, and ordering. Keep transforms focused and unsurprising.
@@ -50,8 +50,10 @@ If a broken model or prompt prevents the agent from completing a turn, recover o
50
50
  Local settings, server state, and the current process are different sources of truth. Inspect the layer you intend to change before writing it.
51
51
 
52
52
  - `letta model list [--byok | --hosted]` lists available models.
53
- - `letta model set [model_handle] [--reasoning <reasoning-option>] [--default]` changes the current conversation's model or reasoning; add `--default` only when the user asks for the agent default.
54
- - `letta model get [--default]` gets the current model configuration; `--default` gets the agent's default configuration.
53
+ - `letta model set [model_handle] [--reasoning <reasoning-option>] [--model-settings <json>] [--default]` changes the current conversation's model, reasoning, or individual `model_settings` fields; add `--default` only when the user asks for the agent default.
54
+ - `letta model get [--default]` gets the current model configuration, including the full redacted `model_settings`; `--default` gets the agent's default configuration.
55
+
56
+ `letta model` reads and writes through the active backend, so it works the same on every backend. Prefer it over the REST helper scripts for anything model-related.
55
57
 
56
58
  ### Account credits and model quota
57
59
 
@@ -77,14 +79,12 @@ Use the secret-safe local/runtime report for harness settings, permissions, and
77
79
  python3 <SKILL_DIR>/scripts/show_config.py --cwd "$PWD"
78
80
  ```
79
81
 
80
- Before changing server state, the targeted helper can also read either scope without printing full system prompts or credentials:
82
+ Read each model scope with `letta model get` before changing it:
81
83
 
82
84
  ```bash
83
- npx tsx <SKILL_DIR>/scripts/update-agent-settings.ts \
84
- --target agent --agent-id "$AGENT_ID" --show
85
-
86
- npx tsx <SKILL_DIR>/scripts/update-agent-settings.ts \
87
- --target conversation --conversation-id "$CONVERSATION_ID" --show
85
+ letta model get # current conversation (or agent if none)
86
+ letta model get --default # agent default
87
+ letta model get --conversation "$CONVERSATION_ID"
88
88
  ```
89
89
 
90
90
  Do not infer an agent default from one conversation or infer a conversation override from the agent. Report both when diagnosing model or context differences.
@@ -116,7 +116,27 @@ Do not use API system-prompt replacement for ordinary learning. That can clobber
116
116
 
117
117
  ## Server-side agent and conversation settings
118
118
 
119
- Server fields control model execution and agent metadata. Use the conversation endpoint for model changes. Use the agent endpoint only when the user asks for the agent default.
119
+ Server fields control model execution and agent metadata. Change the current conversation for model changes. Change the agent default only when the user asks for it.
120
+
121
+ ### Model and model settings
122
+
123
+ Use `letta model` for the model handle, reasoning level, and any `model_settings` field (for example the output-token limit, `temperature`, or `parallel_tool_calls`). It goes through the active backend, so it needs no extra credentials or base URL.
124
+
125
+ ```bash
126
+ letta model set "openai/gpt-5.2" # select a model (applies its defaults)
127
+ letta model set --reasoning high # change reasoning only
128
+ letta model set --model-settings '{"max_tokens":16384}' # use the key `letta model get` shows
129
+ letta model set --model-settings '{"temperature":0.2}' --default # agent default
130
+ letta model get # verify
131
+ ```
132
+
133
+ `--model-settings` takes a JSON object and shallow-merges it into the target's current `model_settings` (the conversation override when a conversation is targeted, otherwise the agent default). It keeps the model and every field you do not name. Keys are written as given, so use the field names that `letta model get` shows for the target; for example the output-token limit is stored as `max_tokens` on some backends and `max_output_tokens` on others. Nested objects such as `reasoning` are replaced as a whole, so include every nested key you want to keep. With a handle or `--reasoning`, the model selection is applied first and the given fields are merged on top. Selecting a new handle resets settings to that model's defaults, so reapply custom fields in the same command if needed.
134
+
135
+ Provider reasoning fields differ. Read [`references/model-settings.md`](references/model-settings.md) before changing reasoning or provider-specific settings.
136
+
137
+ ### REST helper for other fields
138
+
139
+ `scripts/update-agent-settings.ts` covers fields `letta model` does not: `context_window_limit`, name, description, and system prompt replacement. It talks to the REST API at `LETTA_BASE_URL` and requires `LETTA_API_KEY`, so it only works against a server that exposes the REST API; it does not work on the embedded local backend.
120
140
 
121
141
  Required environment for live API writes:
122
142
 
@@ -135,13 +155,12 @@ The scripts in this skill default to `AGENT_ID`, `CONVERSATION_ID`, and `LETTA_B
135
155
  npx tsx <SKILL_DIR>/scripts/update-agent-settings.ts --help
136
156
  ```
137
157
 
138
- Patch the current conversation for a model/settings change:
158
+ Patch the current conversation's context window limit:
139
159
 
140
160
  ```bash
141
161
  npx tsx <SKILL_DIR>/scripts/update-agent-settings.ts \
142
162
  --target conversation \
143
163
  --conversation-id "$CONVERSATION_ID" \
144
- --model "openai/gpt-5.2" \
145
164
  --context-window-limit 64000 \
146
165
  --dry-run
147
166
  ```
@@ -152,7 +171,6 @@ Patch the agent default only when the user asks for it:
152
171
  npx tsx <SKILL_DIR>/scripts/update-agent-settings.ts \
153
172
  --target agent \
154
173
  --agent-id "$AGENT_ID" \
155
- --model "openai/gpt-5.2" \
156
174
  --context-window-limit 64000
157
175
  ```
158
176
 
@@ -176,31 +194,7 @@ npx tsx <SKILL_DIR>/scripts/update-agent-settings.ts \
176
194
  --dry-run
177
195
  ```
178
196
 
179
- Do not patch `llm_config` directly. Use `model`, `context_window_limit`, and `model_settings`. For metadata, use `name` and `description`. Then read back the agent or conversation and verify the returned `llm_config.context_window`, `model_settings`, and metadata fields.
180
-
181
- ### Model settings
182
-
183
- `model_settings` is usually replacement-style. Fetch the current object first and preserve fields you still need, or pass `--merge-model-settings`. Merge dry runs fetch current state and require `LETTA_API_KEY` because they preview preserved fields, not just the local patch fragment.
184
-
185
- ```bash
186
- cat > /tmp/model-settings.json <<'JSON'
187
- {
188
- "provider_type": "openai",
189
- "parallel_tool_calls": true,
190
- "reasoning": { "reasoning_effort": "medium" }
191
- }
192
- JSON
193
-
194
- npx tsx <SKILL_DIR>/scripts/update-agent-settings.ts \
195
- --target agent \
196
- --agent-id "$AGENT_ID" \
197
- --model "openai/gpt-5.2" \
198
- --model-settings-file /tmp/model-settings.json \
199
- --merge-model-settings \
200
- --dry-run
201
- ```
202
-
203
- Provider reasoning fields differ. Read [`references/model-settings.md`](references/model-settings.md) before changing reasoning or provider-specific settings.
197
+ Do not patch `llm_config` directly. Use `letta model` for the model and `model_settings`, `context_window_limit` for the context limit, and `name`/`description` for metadata. Then read back the agent or conversation (`letta model get` for model fields) and verify the result.
204
198
 
205
199
  ### Compaction settings
206
200
 
@@ -447,7 +441,7 @@ Do not start a second listener for the same channel accounts merely to apply new
447
441
 
448
442
  | Script | Purpose |
449
443
  | --- | --- |
450
- | `scripts/update-agent-settings.ts` | Show or patch agent/conversation server settings safely |
444
+ | `scripts/update-agent-settings.ts` | Show or patch REST-only agent/conversation fields (context limit, name, description, system prompt); needs a REST server and `LETTA_API_KEY` |
451
445
  | `scripts/update-compaction-prompt.ts` | Preserve existing compaction settings while replacing the prompt |
452
446
  | `scripts/add_permission.py` | Add allow/deny/ask/alwaysAsk rules to a chosen settings scope |
453
447
  | `scripts/show_config.py` | Show runtime/local settings without dumping secret values |