@letta-ai/letta-code 0.34.43 → 0.34.45

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 (59) hide show
  1. package/dist/agent-presets.js +9 -26
  2. package/dist/agent-presets.js.map +5 -6
  3. package/dist/channels-public.js +1 -1
  4. package/dist/channels-public.js.map +3 -3
  5. package/dist/mcp-client.js +2 -2
  6. package/dist/mcp-client.js.map +1 -1
  7. package/dist/mcp-oauth.js +2 -2
  8. package/dist/mcp-oauth.js.map +1 -1
  9. package/dist/types/agent/create-agent-request.d.ts.map +1 -1
  10. package/dist/types/agent/memory-git-hooks.d.ts.map +1 -1
  11. package/dist/types/agent/model-catalog.d.ts +7 -0
  12. package/dist/types/agent/model-catalog.d.ts.map +1 -1
  13. package/dist/types/cli/helpers/error-formatter.d.ts +2 -0
  14. package/dist/types/cli/helpers/error-formatter.d.ts.map +1 -1
  15. package/dist/types/constants.d.ts +0 -8
  16. package/dist/types/constants.d.ts.map +1 -1
  17. package/dist/types/tools/impl/claude-stream-session.d.ts +2 -2
  18. package/dist/types/tools/impl/claude-stream-session.d.ts.map +1 -1
  19. package/dist/types/tools/impl/codex-app-server.d.ts +2 -0
  20. package/dist/types/tools/impl/codex-app-server.d.ts.map +1 -1
  21. package/dist/types/tools/impl/exec-command.d.ts +2 -0
  22. package/dist/types/tools/impl/exec-command.d.ts.map +1 -1
  23. package/dist/types/tools/impl/external-coding-agent-task.d.ts +2 -0
  24. package/dist/types/tools/impl/external-coding-agent-task.d.ts.map +1 -1
  25. package/dist/types/tools/impl/external-coding-agent.d.ts +2 -1
  26. package/dist/types/tools/impl/external-coding-agent.d.ts.map +1 -1
  27. package/dist/types/tools/impl/external-fork-context.d.ts.map +1 -1
  28. package/dist/types/tools/impl/external-llm-trace-launch.d.ts +19 -0
  29. package/dist/types/tools/impl/external-llm-trace-launch.d.ts.map +1 -0
  30. package/dist/types/tools/impl/external-llm-trace-payload.d.ts +14 -0
  31. package/dist/types/tools/impl/external-llm-trace-payload.d.ts.map +1 -0
  32. package/dist/types/tools/impl/external-llm-trace-proxy.d.ts +41 -0
  33. package/dist/types/tools/impl/external-llm-trace-proxy.d.ts.map +1 -0
  34. package/dist/types/tools/impl/external-llm-trace-session.d.ts +20 -0
  35. package/dist/types/tools/impl/external-llm-trace-session.d.ts.map +1 -0
  36. package/dist/types/tools/impl/send-agent-message.d.ts.map +1 -1
  37. package/dist/types/tools/impl/shell-runner.d.ts +1 -0
  38. package/dist/types/tools/impl/shell-runner.d.ts.map +1 -1
  39. package/dist/types/tools/impl/task-agent-selection.d.ts +9 -0
  40. package/dist/types/tools/impl/task-agent-selection.d.ts.map +1 -1
  41. package/dist/types/tools/impl/task.d.ts +1 -0
  42. package/dist/types/tools/impl/task.d.ts.map +1 -1
  43. package/dist/types/tools/impl/watch-pr.d.ts.map +1 -1
  44. package/dist/types/tools/task-tool-assets.d.ts +0 -5
  45. package/dist/types/tools/task-tool-assets.d.ts.map +1 -1
  46. package/dist/types/utils/image-resize.d.ts.map +1 -1
  47. package/dist/types/utils/secrets-store.d.ts +9 -1
  48. package/dist/types/utils/secrets-store.d.ts.map +1 -1
  49. package/docs/external-agent-traces.md +31 -0
  50. package/image-resize-worker.js +3 -4
  51. package/letta.js +1979 -1261
  52. package/npm-shrinkwrap.json +210 -787
  53. package/package.json +3 -4
  54. package/scripts/smoke-image-worker.mjs +29 -4
  55. package/scripts/source-file-size-baseline.json +3 -3
  56. package/scripts/stage-pypi-deps.mjs +0 -1
  57. package/skills/working-across-computers/SKILL.md +3 -0
  58. package/vendor/AGENTS.md +12 -0
  59. package/skills/messaging-agents/SKILL.md +0 -221
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letta-ai/letta-code",
3
- "version": "0.34.43",
3
+ "version": "0.34.45",
4
4
  "lettaStartupLogProtocol": 1,
5
5
  "lettaConfigDirProtocol": 1,
6
6
  "description": "Letta Code is a CLI tool for interacting with stateful Letta agents from the terminal.",
@@ -153,7 +153,6 @@
153
153
  "dependencies": {
154
154
  "@cursor/sdk": "1.1.0",
155
155
  "@earendil-works/pi-ai": "^0.99.1",
156
- "@janhapke/sharp-electron": "0.35.3-electron.1",
157
156
  "@letta-ai/letta-agent-sdk": "0.8.38",
158
157
  "@letta-ai/letta-client": "^1.10.2",
159
158
  "@letta-ai/trajectory": "0.2.0",
@@ -169,7 +168,7 @@
169
168
  "node-pty": "^1.1.0",
170
169
  "open": "^10.2.0",
171
170
  "react": "18.2.0",
172
- "sharp": "^0.34.5",
171
+ "sharp": "^0.35.5",
173
172
  "shiki": "^4.0.2",
174
173
  "strip-ansi": "^7.2.0",
175
174
  "ws": "^8.19.0"
@@ -278,7 +277,7 @@
278
277
  },
279
278
  "lettaLifecycleProtocol": 1,
280
279
  "lettaRuntimeGraphProtocol": 1,
281
- "lettaRuntimeGraphSha512": "sha512-OHzTPv1j75KoJFojEjv3BcG6VCLDYRMSo989KJlMJxHRMY9CW0psXZbLs34hc9UZ1eXboJjDJFKK5o+zb6JbDA==",
280
+ "lettaRuntimeGraphSha512": "sha512-WIZjjGgnUTIQDdGkiMGGmYxhKDr34pXqcEUPqh9YvmdauZnqYCj0OeYE8ltjcpPNYevvXHP32Edeo+arrylfXA==",
282
281
  "patchedDependencies": {
283
282
  "@earendil-works/pi-ai@0.99.1": "patches/@earendil-works%2Fpi-ai@0.99.1.patch"
284
283
  }
@@ -1,4 +1,4 @@
1
- // Exercise the published Node worker with a newer Sharp installation in an
1
+ // Exercise the published Node worker with a standalone Sharp installation in an
2
2
  // ancestor directory. Sharp's JS and native binding must come from the same
3
3
  // installed package, rather than mixing bundled JS with a runtime binding.
4
4
  import assert from "node:assert/strict";
@@ -20,7 +20,7 @@ try {
20
20
  "--ignore-scripts",
21
21
  "--no-audit",
22
22
  "--no-fund",
23
- "sharp@0.35.3",
23
+ "sharp@0.35.5",
24
24
  ],
25
25
  { encoding: "utf8" },
26
26
  );
@@ -33,7 +33,7 @@ try {
33
33
  );
34
34
  const require = createRequire(worker);
35
35
  const sharp = require("sharp");
36
- assert.equal(sharp.versions.sharp, "0.35.3");
36
+ assert.equal(sharp.versions.sharp, "0.35.5");
37
37
  const png = await sharp({
38
38
  create: {
39
39
  width: 2,
@@ -62,7 +62,32 @@ try {
62
62
  assert.deepEqual(Buffer.from(decoded.data, "base64"), image);
63
63
  }
64
64
 
65
- console.log("Published image worker decoded PNG and JPEG with Sharp 0.35.3");
65
+ const oversized = await sharp({
66
+ create: {
67
+ width: 2500,
68
+ height: 100,
69
+ channels: 3,
70
+ background: { r: 70, g: 100, b: 130 },
71
+ },
72
+ })
73
+ .png()
74
+ .toBuffer();
75
+ const resized = spawnSync(process.execPath, [worker, "image/png"], {
76
+ input: oversized,
77
+ encoding: "utf8",
78
+ });
79
+ assert.equal(resized.status, 0, resized.stderr || resized.error?.message);
80
+ const output = JSON.parse(resized.stdout);
81
+ assert.equal(output.resized, true);
82
+ assert.equal(output.width, 2000);
83
+ assert.equal(output.height, 80);
84
+ const metadata = await sharp(Buffer.from(output.data, "base64")).metadata();
85
+ assert.equal(metadata.width, output.width);
86
+ assert.equal(metadata.height, output.height);
87
+
88
+ console.log(
89
+ "Published image worker decoded PNG/JPEG and resized PNG with Sharp 0.35.5",
90
+ );
66
91
  } finally {
67
92
  rmSync(root, { recursive: true, force: true });
68
93
  }
@@ -4,12 +4,12 @@
4
4
  "src/backend/local-backend.test.ts": 2472,
5
5
  "src/backend/local/local-store.ts": 3258,
6
6
  "src/backend/pi-stream-adapter.test.ts": 1255,
7
- "src/cli/app/AppCoordinator.tsx": 5131,
7
+ "src/cli/app/AppCoordinator.tsx": 5129,
8
8
  "src/cli/app/AppView.tsx": 1732,
9
9
  "src/cli/app/use-approval-flow.ts": 1099,
10
10
  "src/cli/app/use-configuration-handlers.ts": 1400,
11
- "src/cli/app/use-conversation-loop.ts": 2849,
12
- "src/cli/app/use-submit-handler.ts": 3791,
11
+ "src/cli/app/use-conversation-loop.ts": 2800,
12
+ "src/cli/app/use-submit-handler.ts": 3788,
13
13
  "src/cli/components/AgentSelector.tsx": 1104,
14
14
  "src/cli/components/InputRich.tsx": 2124,
15
15
  "src/cli/components/ModelSelector.tsx": 1259,
@@ -12,7 +12,6 @@ import { dirname, join, resolve } from "node:path";
12
12
 
13
13
  const root = process.cwd();
14
14
  const app = resolve(process.argv[2]);
15
- // sharp-electron is only reachable under Electron, never our bundled Node.
16
15
  // @shikijs/langs is external in the bundle so lazily-loaded grammars
17
16
  // (LET-13149) resolve from here at runtime.
18
17
  const roots = [
@@ -102,6 +102,9 @@ letta sandbox expose <port> --expires-in <duration>
102
102
 
103
103
  Choose the lifetime explicitly with a whole-second, minute, or hour duration such as `30m`, `2h`, or `24h`. The supported range is 1 minute through 24 hours; there is no implicit default. This command works only inside the managed Cloud sandbox that owns the app. It does not accept `--agent` or `--conversation`; run it in the same sandbox as the service. The JSON result contains `{ url, port, expiresAt }`. Anyone holding the URL can access the app until the exact `expiresAt`, so share it only where the user requested.
104
104
 
105
+ An exposed app only works while its sandbox is running. The sandbox sleeps after it has been idle for a while, and the app's server process does not survive a restart.
106
+ Treat exposed apps as temporary demos. Anything meant to stay up goes on Vercel.
107
+
105
108
  To add time to the same URL and port, extend the active exposure before it expires:
106
109
 
107
110
  ```bash
@@ -0,0 +1,12 @@
1
+ # Vendored Ink Patches (Red Zone)
2
+
3
+ `vendor/ink/` and `vendor/ink-text-input/` contain patched Ink runtime
4
+ internals. `scripts/postinstall-patches.js` applies these at install time by
5
+ exact string match.
6
+
7
+ - Any PR touching `vendor/ink/build/*` or `scripts/postinstall-patches.js` is a
8
+ red zone: patches are fragile to Ink version bumps, semantically invisible to
9
+ normal review, and coordinated across multiple runtime files.
10
+ - Verify the exact matched strings still exist and the throw-on-missing guard is
11
+ preserved.
12
+ - After editing vendor files, must run build for changes to take effect.
@@ -1,221 +0,0 @@
1
- ---
2
- name: messaging-agents
3
- description: Send a message to another Letta agent, continue a thread with one, check on it, or reply to a message another agent sent you. Use when you need to ask, inform, or coordinate with another agent, or when a message from another agent arrives.
4
- ---
5
-
6
- # Messaging Agents
7
-
8
- ## What you are addressing
9
-
10
- An **agent** is a persistent identity: its memory and configuration are shared
11
- by all of its conversations. A **conversation** is one message thread on an
12
- agent. Address a conversation ID to continue a thread; address an agent ID to
13
- open a new thread with that agent. When your send identifies you as the sender,
14
- a new thread is created hidden so agent-to-agent traffic does not clutter the
15
- recipient's conversation list.
16
-
17
- ## Two backends
18
-
19
- Letta Code keeps agent state on one of two backends. The same CLI addresses
20
- agents on either; what differs is what happens after you send.
21
-
22
- **Cloud backend** (api.letta.com). Agent state lives in Cloud. Cloud can deliver
23
- messages to a *computer*: a machine running Letta Code connected to Cloud,
24
- or a Cloud sandbox. Because state and execution are
25
- separate, Cloud tracks which computers are online and where each conversation
26
- is active. That is why these exist only on this backend:
27
-
28
- - delivering your message to the harness already running the recipient's
29
- conversation, or to its saved destination (a computer or Cloud sandbox)
30
- when none is active;
31
- - a `computer` selector on sends and on the Agent tool;
32
- - teleporting a conversation (`letta teleport <computer>`): the same thread,
33
- with its history and memory, continues on a different computer. Files and
34
- working directories do not move with it.
35
-
36
- **Local backend.** Agent state lives in a store on this machine. There is no
37
- computer concept, so no `computer` selector and no teleport, and no Cloud
38
- service to deliver on your behalf: a send runs the recipient's turn inside the
39
- `letta -p` process you launched. Agent IDs on this backend start with
40
- `agent-local-`.
41
-
42
- "Local backend" describes where state is stored. It says nothing about which
43
- machine a Cloud-backed agent is executing on, and it is unrelated to subagents
44
- you launch with the Agent tool.
45
-
46
- ## How a send reaches the recipient
47
-
48
- For the Cloud CLI sends below, `letta -p` hands the message to Cloud for
49
- delivery when you pass `--conversation`, `--from-agent`, `--no-wait`, or
50
- `--computer`. These commands leave the recipient's execution settings unchanged.
51
- `SendAgentMessage` uses the same Cloud delivery endpoint.
52
-
53
- With only `--agent`, the CLI chooses the launch settings and normally creates a
54
- new conversation. It runs the turn in its own process or reuses an inherited
55
- Cloud listener. The listener path first applies those settings to the
56
- conversation, then submits its input through the same Cloud delivery endpoint.
57
- Supported local-backend CLI sends run the turn in the launched process.
58
-
59
- `--no-wait` is one of the flags that selects Cloud delivery. On that path,
60
- waiting and non-waiting sends use the same delivery mechanism, but differ in
61
- how you receive the answer and what reply instructions the recipient gets.
62
-
63
- The recipient learns who is asking only when the send identifies a sender:
64
- `--from-agent`, or for the Cloud messaging recipes below, the caller IDs from
65
- the agent's shell environment (`AGENT_ID`/`LETTA_AGENT_ID` and
66
- `CONVERSATION_ID`/`LETTA_CONVERSATION_ID`). `SendAgentMessage`
67
- always identifies you and your conversation. An identified send attaches a
68
- system reminder telling the recipient how to get its answer back to you. A
69
- `letta -p` with neither carries no sender or reply instructions; the recipient
70
- receives your text as user input, plus whatever context its harness normally
71
- adds.
72
-
73
- An explicit `--from-agent` different from the agent identified by your
74
- environment does not inherit the current conversation as its return address.
75
-
76
- ## Waiting or not
77
-
78
- - **Waiting send** (`letta -p` without `--no-wait`). The process normally returns
79
- the recipient's final message, in `result` with JSON output. When a sender is
80
- identified, the recipient is told to put its answer in that message. Works
81
- on either backend.
82
- - **Non-waiting send** (`SendAgentMessage`, or `letta -p --no-wait`). Returns
83
- a receipt once Cloud accepts the message. Ordinary assistant output is not
84
- forwarded. When a sender is identified, the reminder says so and, if a return
85
- conversation is supplied, asks the recipient to send an explicit reply there.
86
- That explicit reply becomes a new message in your conversation. Cloud backend
87
- only; acceptance does not guarantee a reply.
88
-
89
- A waiting send occupies the CLI process, not necessarily you. Run it in the
90
- background (your shell tool may already do this for long-running commands) and
91
- read its output when it finishes. That keeps you working, but it does not
92
- change the recipient's instructions: the answer still arrives as process
93
- output, not as a message to your conversation.
94
-
95
- For a managed child task with a completion notification, use the Agent tool on
96
- either backend. `SendAgentMessage` only sends input; it creates no task.
97
-
98
- ## Send and keep working (Cloud backend)
99
-
100
- ```typescript
101
- SendAgentMessage({ conversation_id: "conv-…", message: "…" }) // continue a thread
102
- SendAgentMessage({ agent_id: "agent-…", message: "…" }) // open a new hidden thread
103
- SendAgentMessage({ agent_id: "agent-…", conversation_id: "default", message: "…" }) // the agent's default thread
104
- ```
105
-
106
- Success means Cloud accepted the message (`status: "queued"`), not that the
107
- recipient has read it. Keep working; a reply sent to your return address
108
- arrives in your conversation.
109
- Omit `computer`: the conversation continues wherever it is active, and asking
110
- for a different computer is rejected rather than moving it.
111
-
112
- The CLI form behaves the same when run from your agent's environment, which
113
- supplies the return address; use it from scripts or when the tool is absent:
114
-
115
- ```bash
116
- letta -p --conversation <conversation-id> --no-wait --output-format json "message"
117
- letta -p --agent <agent-id> --no-wait --output-format json "message"
118
- ```
119
-
120
- ## Send and wait (either backend)
121
-
122
- ```bash
123
- letta -p --from-agent $LETTA_AGENT_ID --agent <agent-id> --output-format json "message"
124
- letta -p --from-agent $LETTA_AGENT_ID --conversation <conversation-id> --output-format json "follow-up"
125
- ```
126
-
127
- `result` normally holds the recipient's final message; `conversation_id` is
128
- the thread to continue. `--from-agent` names you and must be an agent on the
129
- same backend as the recipient.
130
-
131
- If your agent ID starts with `agent-local-`, add `--backend local` so the
132
- command uses the local store: `letta --backend local -p …`. The flag applies to
133
- that command only.
134
-
135
- For these Cloud messaging commands, stopping the wait does not cancel accepted
136
- work on the recipient's computer. On the local backend the recipient's turn
137
- runs inside the process you launched, so
138
- `--tools`, `--permission-mode`, and the working directory you give it apply to
139
- that turn.
140
-
141
- ## Replying to another agent
142
-
143
- When another agent identifies itself, its message arrives with a system
144
- reminder naming its agent ID and, when it had one, its conversation ID.
145
-
146
- - If the reminder says the sender will only see your final message: answer in
147
- your response. Nothing more is needed.
148
- - If the reminder asks for an explicit reply: use its return address with
149
- `SendAgentMessage({ agent_id, conversation_id, message })`, or
150
- `letta -p --agent <sender-agent-id> --conversation <sender-conversation-id> --no-wait "reply"`.
151
- Your ordinary output is not forwarded to the sender.
152
- - If it says no return conversation was supplied: your output is not forwarded
153
- and there is no thread to reply into. Answer as you normally would.
154
-
155
- A message without such a reminder carries no sender or reply instructions;
156
- respond to it as you would to any input.
157
-
158
- ## Checking on a conversation
159
-
160
- Recent messages are the quick progress check on either backend. This command
161
- requests recent messages and prints the returned messages oldest to newest (add
162
- `--backend local` in the same cases as for sends):
163
-
164
- ```bash
165
- letta messages list --conversation <conversation-id> --limit 10
166
- ```
167
-
168
- `letta messages status --conversation <id>` (Cloud only) reports whether the
169
- conversation is currently running. When `latest_super_run` is present, compare
170
- its `id` with the `super_run_id` on your receipt; a different ID belongs to a
171
- different send. Read the messages to see what was processed. Non-waiting
172
- receipts include ready-to-run `status_command` and `messages_command` values for the thread
173
- they went to. `letta messages transcript --conversation <id>` exports the
174
- thread; check `truncated` before treating it as complete.
175
- `letta messages --help` lists the options.
176
-
177
- ## Finding an agent
178
-
179
- ```bash
180
- letta agents list --query "name"
181
- letta messages search --query "topic" --all-agents # discovery; results include agent_id
182
- ```
183
-
184
- Load the `finding-agents` skill for more search options.
185
-
186
- ## Choosing a computer (Cloud backend)
187
-
188
- Only when a specific machine is required:
189
-
190
- ```bash
191
- letta computers list --online-only # connectionName and deviceId
192
- letta -p --agent <agent-id> --computer <name-or-device-id> --no-wait "message"
193
- letta -p --agent <agent-id> --computer cloud --no-wait "message" # its Cloud sandbox
194
- ```
195
-
196
- If the conversation is active on another computer the send is rejected; to
197
- move a conversation, teleport it (see the `working-across-computers` skill).
198
- An offline saved computer does not trigger a Cloud-sandbox fallback.
199
- `letta computers --help` covers the selectors.
200
-
201
- ## Gotchas
202
-
203
- - `SendAgentMessage`, `--no-wait`, `--computer`, and `messages status` fail on
204
- the local backend even when they are offered. Check your agent ID prefix.
205
- - For Cloud coordination, do not rely on `--agent` alone to select message
206
- delivery. Add `--from-agent $LETTA_AGENT_ID` to deliver and identify yourself;
207
- pass `--conversation <id>` to reach an existing thread.
208
- - The Cloud messaging recipes above reject execution flags (`--tools`,
209
- `--permission-mode`, `--model`, `--system`, and similar); the recipient keeps
210
- its own configuration. Those flags configure a launch when using the
211
- retained `--agent`-only path or local-backend execution.
212
- - `--conversation default` needs `--agent`; `default` is scoped to an agent.
213
- - A receipt means accepted, not delivered. If a send's outcome is unknown
214
- (`acceptance_unknown`, a timed-out wait), read the thread before resending.
215
-
216
- ## Related
217
-
218
- - `letta --help` and each subcommand's `--help` are the reference for flags;
219
- this skill explains the concepts and the common recipes.
220
- - `finding-agents`: locate agents by name, tags, or search.
221
- - `working-across-computers`: teleporting and moving files between computers.