@letta-ai/letta-code 0.33.3 → 0.33.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.
Files changed (40) hide show
  1. package/dist/mcp-client.js +2 -2
  2. package/dist/mcp-client.js.map +1 -1
  3. package/dist/types/agent/subagent-state.d.ts +5 -1
  4. package/dist/types/agent/subagent-state.d.ts.map +1 -1
  5. package/dist/types/agent/subagents/child-send-tracking.d.ts +1 -1
  6. package/dist/types/agent/subagents/child-send-tracking.d.ts.map +1 -1
  7. package/dist/types/agent/subagents/names.d.ts +1 -1
  8. package/dist/types/agent/subagents/names.d.ts.map +1 -1
  9. package/dist/types/agent/subagents/remote-turn-wait.d.ts.map +1 -1
  10. package/dist/types/backend/api/conversation-enqueue.d.ts +10 -0
  11. package/dist/types/backend/api/conversation-enqueue.d.ts.map +1 -1
  12. package/dist/types/headless-super-run-wait.d.ts +7 -11
  13. package/dist/types/headless-super-run-wait.d.ts.map +1 -1
  14. package/dist/types/tools/impl/workflow.d.ts.map +1 -1
  15. package/dist/types/tools/workflow/decide.d.ts +32 -0
  16. package/dist/types/tools/workflow/decide.d.ts.map +1 -0
  17. package/dist/types/tools/workflow/execution-registry.d.ts.map +1 -1
  18. package/dist/types/tools/workflow/journal.d.ts +15 -2
  19. package/dist/types/tools/workflow/journal.d.ts.map +1 -1
  20. package/dist/types/tools/workflow/sdk-loader.d.ts +3 -0
  21. package/dist/types/tools/workflow/sdk-loader.d.ts.map +1 -1
  22. package/dist/types/tools/workflow/sdk-spawner.d.ts +17 -0
  23. package/dist/types/tools/workflow/sdk-spawner.d.ts.map +1 -1
  24. package/dist/types/tools/workflow/types.d.ts +13 -3
  25. package/dist/types/tools/workflow/types.d.ts.map +1 -1
  26. package/dist/types/tools/workflow/workflow-engine.d.ts +1 -1
  27. package/dist/types/tools/workflow/workflow-engine.d.ts.map +1 -1
  28. package/dist/types/types/loop-status-protocol.d.ts +31 -0
  29. package/dist/types/types/loop-status-protocol.d.ts.map +1 -1
  30. package/dist/types/types/protocol_v2.d.ts +3 -29
  31. package/dist/types/types/protocol_v2.d.ts.map +1 -1
  32. package/dist/types/websocket/listener/outbound-wire.d.ts.map +1 -1
  33. package/dist/types/websocket/listener/protocol-outbound.d.ts +0 -10
  34. package/dist/types/websocket/listener/protocol-outbound.d.ts.map +1 -1
  35. package/dist/types/websocket/listener/turn-correlation.d.ts +1 -0
  36. package/dist/types/websocket/listener/turn-correlation.d.ts.map +1 -1
  37. package/letta.js +630 -389
  38. package/package.json +2 -2
  39. package/scripts/source-file-size-baseline.json +3 -4
  40. package/skills/workflow-authoring/SKILL.md +31 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letta-ai/letta-code",
3
- "version": "0.33.3",
3
+ "version": "0.33.5",
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",
@@ -132,7 +132,7 @@
132
132
  "dependencies": {
133
133
  "@earendil-works/pi-ai": "^0.87.1",
134
134
  "@janhapke/sharp-electron": "0.35.3-electron.1",
135
- "@letta-ai/letta-agent-sdk": "^0.8.17",
135
+ "@letta-ai/letta-agent-sdk": "0.8.21",
136
136
  "@letta-ai/letta-client": "^1.10.2",
137
137
  "@letta-ai/trajectory": "0.2.0",
138
138
  "@modelcontextprotocol/sdk": "1.30.0",
@@ -35,11 +35,10 @@
35
35
  "src/settings-manager.ts": 2101,
36
36
  "src/tools/manager.ts": 2649,
37
37
  "src/tools/tool-execution-context.test.ts": 1092,
38
- "src/types/protocol_v2.ts": 2574,
39
- "src/websocket/listen-client-concurrency.test.ts": 2666,
38
+ "src/types/protocol_v2.ts": 2550,
39
+ "src/websocket/listen-client-concurrency.test.ts": 2663,
40
40
  "src/websocket/listen-client-protocol.test.ts": 5759,
41
41
  "src/websocket/listener/commands/memory.ts": 1114,
42
42
  "src/websocket/listener/file-commands.ts": 1053,
43
- "src/websocket/listener/protocol-inbound.ts": 2111,
44
- "src/websocket/listener/protocol-outbound.ts": 1022
43
+ "src/websocket/listener/protocol-inbound.ts": 2111
45
44
  }
@@ -78,7 +78,8 @@ Workflow subagents require the API backend.
78
78
  `json`, `model`, `effort` (`'low'` for mechanical stages, higher for the
79
79
  hardest verify/judge stages), `allowedTools`, `systemPrompt` (extra system
80
80
  prompt for this subagent), `timeoutMs` (default 10 minutes), `maxToolCalls`
81
- (positive safe integer; default 1000 unique tool calls for this subagent).
81
+ (positive safe integer; default 1000 unique tool calls for this subagent),
82
+ `conversationId` (resume a worker — see "Diagnosing a run").
82
83
  - `pipeline(items, stage1, stage2, ...)` → run each item through all stages
83
84
  independently, NO barrier between stages. Item A can be in stage 3 while
84
85
  item B is still in stage 1. This is the DEFAULT for multi-stage work.
@@ -95,9 +96,30 @@ Workflow subagents require the API backend.
95
96
  - `phase(title)` — start a new phase; subsequent agent() calls are grouped
96
97
  under this title in progress output.
97
98
  - `log(message)` — emit a progress message to the user.
99
+ - `decide(state, questions, opts?)` → Promise; not a subagent call. Ask a
100
+ calibrated Jev model (chosen internally — no model option) questions about
101
+ `state`. `questions` is a non-empty OBJECT keyed by question id — never an
102
+ array. Each question needs `instructions` and a `type`: `choice` (criteria
103
+ map of id → description, ≤255), `score` (criteria array of strings, unlike
104
+ `questions`), `noul` (no criteria). Returns a response whose `answers` are
105
+ keyed by the same ids and calibrated, or `null` after one retried invalid
106
+ answer — guard `if (!call)`; API errors throw.
107
+
108
+ const call = await decide(evidence, {
109
+ behavior: { type: 'choice', instructions: 'Is this behavior a bug?',
110
+ criteria: { bad: 'Wrong or harmful', not_bad: 'Expected or harmless' } },
111
+ })
112
+ const verdict = call?.answers?.behavior?.choice // 'bad' | 'not_bad'
113
+
98
114
  - `args` — the value passed as the tool's `args` input, verbatim. Pass
99
115
  arrays/objects as actual JSON values, NOT as a JSON-encoded string.
100
116
 
117
+ `decide()` sees only the `state` you pass; it cannot read files. When compact,
118
+ bounded items are already prepared, pass them via `args` and call `decide()`
119
+ on each directly — don't spawn `agent()` readers just to relay inputs. Raw
120
+ large traces don't belong in `args`: prepare bounded state that preserves the
121
+ user instruction, observed action, and outcome, and mark what was omitted.
122
+
101
123
  Scripts are plain JavaScript, NOT TypeScript — type annotations, interfaces,
102
124
  and generics fail to parse. The script body runs in an async context — use
103
125
  `await` directly and `return` the final result. Standard JS built-ins (JSON,
@@ -125,9 +147,9 @@ A barrier is NOT justified by:
125
147
  slowest takes 3× the fastest, a barrier wastes 2/3 of the fast finders'
126
148
  idle time.
127
149
 
128
- Concurrent agent() calls are capped per run (`maxConcurrent`, default 16) —
129
- excess calls queue and run as slots free up, so passing 100 items is fine.
130
- Total agent count across a run is capped at 1000 — a runaway-loop backstop.
150
+ `agent()` and `decide()` share one pool of concurrent slots per run
151
+ (`maxConcurrent`, default 16) — excess calls queue and run as slots free up,
152
+ so passing 100 items is fine. Each has its own 1000-call lifetime backstop.
131
153
  A single parallel()/pipeline() call accepts at most 4096 items.
132
154
 
133
155
  When a barrier IS correct — dedup across all findings before expensive
@@ -216,3 +238,8 @@ diagnosing why a workflow returned an empty or unexpected result, read that
216
238
  journal — it records each agent's actual return value and, for a `null`,
217
239
  which guard or error produced it. A failed run is not resumable: fix the
218
240
  script and launch it again.
241
+
242
+ The script is never replayed, but one worker can continue:
243
+ `agent(prompt, {conversationId})` re-prompts it with history and model intact,
244
+ using a journal ID and only once its last Run is terminal. Tools default to
245
+ `[]`; `schema` and `effort` are chosen per turn. Needs SDK 0.8.20+.