@letta-ai/letta-code 0.33.4 → 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.
- package/dist/mcp-client.js +2 -2
- package/dist/mcp-client.js.map +1 -1
- package/dist/types/agent/subagents/names.d.ts +1 -1
- package/dist/types/agent/subagents/names.d.ts.map +1 -1
- package/dist/types/tools/impl/workflow.d.ts.map +1 -1
- package/dist/types/tools/workflow/decide.d.ts +32 -0
- package/dist/types/tools/workflow/decide.d.ts.map +1 -0
- package/dist/types/tools/workflow/execution-registry.d.ts.map +1 -1
- package/dist/types/tools/workflow/journal.d.ts +15 -2
- package/dist/types/tools/workflow/journal.d.ts.map +1 -1
- package/dist/types/tools/workflow/sdk-loader.d.ts +3 -0
- package/dist/types/tools/workflow/sdk-loader.d.ts.map +1 -1
- package/dist/types/tools/workflow/sdk-spawner.d.ts +17 -0
- package/dist/types/tools/workflow/sdk-spawner.d.ts.map +1 -1
- package/dist/types/tools/workflow/types.d.ts +13 -3
- package/dist/types/tools/workflow/types.d.ts.map +1 -1
- package/dist/types/tools/workflow/workflow-engine.d.ts +1 -1
- package/dist/types/tools/workflow/workflow-engine.d.ts.map +1 -1
- package/letta.js +369 -81
- package/package.json +2 -2
- 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
|
+
"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": "
|
|
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",
|
|
@@ -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
|
-
|
|
129
|
-
excess calls queue and run as slots free up,
|
|
130
|
-
|
|
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+.
|