@letta-ai/letta-code 0.34.47 → 0.34.49

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 (45) 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/types/agent/subagents/ephemeral-subagent.d.ts +56 -0
  6. package/dist/types/agent/subagents/ephemeral-subagent.d.ts.map +1 -0
  7. package/dist/types/agent/subagents/manager.d.ts +3 -3
  8. package/dist/types/agent/subagents/manager.d.ts.map +1 -1
  9. package/dist/types/agent/subagents/subagent-reminders.d.ts +9 -0
  10. package/dist/types/agent/subagents/subagent-reminders.d.ts.map +1 -0
  11. package/dist/types/backend/api/ephemeral-conversations.d.ts +4 -0
  12. package/dist/types/backend/api/ephemeral-conversations.d.ts.map +1 -1
  13. package/dist/types/image-resize-public.d.ts +3 -0
  14. package/dist/types/image-resize-public.d.ts.map +1 -0
  15. package/dist/types/mcp-scope.d.ts +5 -0
  16. package/dist/types/mcp-scope.d.ts.map +1 -1
  17. package/dist/types/tools/impl/external-llm-trace-session.d.ts +1 -0
  18. package/dist/types/tools/impl/external-llm-trace-session.d.ts.map +1 -1
  19. package/dist/types/tools/impl/shell-env.d.ts.map +1 -1
  20. package/dist/types/tools/impl/task.d.ts.map +1 -1
  21. package/dist/types/tools/impl/workflow.d.ts +1 -0
  22. package/dist/types/tools/impl/workflow.d.ts.map +1 -1
  23. package/dist/types/tools/workflow/format-stats.d.ts +4 -0
  24. package/dist/types/tools/workflow/format-stats.d.ts.map +1 -1
  25. package/dist/types/tools/workflow/sdk-spawner.d.ts +7 -0
  26. package/dist/types/tools/workflow/sdk-spawner.d.ts.map +1 -1
  27. package/dist/types/tools/workflow/types.d.ts +19 -2
  28. package/dist/types/tools/workflow/types.d.ts.map +1 -1
  29. package/dist/types/tools/workflow/workflow-engine.d.ts.map +1 -1
  30. package/dist/types/utils/image-resize.d.ts.map +1 -1
  31. package/dist/types/utils/image-resize.shared.d.ts +2 -0
  32. package/dist/types/utils/image-resize.shared.d.ts.map +1 -1
  33. package/dist/types/utils/process-liveness.d.ts +7 -1
  34. package/dist/types/utils/process-liveness.d.ts.map +1 -1
  35. package/dist/types/utils/secrets-store.d.ts +6 -0
  36. package/dist/types/utils/secrets-store.d.ts.map +1 -1
  37. package/image-resize-worker.js +8 -5
  38. package/image-resize.js +358 -0
  39. package/image-resize.js.map +13 -0
  40. package/letta.js +18438 -18180
  41. package/npm-shrinkwrap.json +5 -5
  42. package/package.json +12 -2
  43. package/scripts/smoke-image-resize-export.mjs +67 -0
  44. package/scripts/source-file-size-baseline.json +1 -1
  45. package/skills/workflow-authoring/SKILL.md +9 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letta-ai/letta-code",
3
- "version": "0.34.47",
3
+ "version": "0.34.49",
4
4
  "lockfileVersion": 3,
5
5
  "packages": {
6
6
  "node_modules/@alcalzone/ansi-tokenize": {
@@ -3411,9 +3411,9 @@
3411
3411
  "license": "ISC"
3412
3412
  },
3413
3413
  "node_modules/jose": {
3414
- "version": "6.2.16",
3415
- "resolved": "https://registry.npmjs.org/jose/-/jose-6.2.16.tgz",
3416
- "integrity": "sha512-4LSJpbuBuPdGrONCdZUy0xnxtLf8eEz+EY0SMXdHQEBU7bgUHDVblU/JAjryv3wID9/LK7/YuwFwq+AQNfMscQ==",
3414
+ "version": "6.2.17",
3415
+ "resolved": "https://registry.npmjs.org/jose/-/jose-6.2.17.tgz",
3416
+ "integrity": "sha512-wOuK9V1yujQFH5S0ZWmLcDZN7+IKh9bUCC2ZPCf2HDlol3WWHy+PPyNjEI75FXRLMp3vDKQcupP59xhVU95hcg==",
3417
3417
  "license": "MIT",
3418
3418
  "funding": {
3419
3419
  "url": "https://github.com/sponsors/panva"
@@ -5080,7 +5080,7 @@
5080
5080
  },
5081
5081
  "": {
5082
5082
  "name": "@letta-ai/letta-code",
5083
- "version": "0.34.47",
5083
+ "version": "0.34.49",
5084
5084
  "dependencies": {
5085
5085
  "@cursor/sdk": "1.1.0",
5086
5086
  "@earendil-works/pi-ai": "^0.99.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letta-ai/letta-code",
3
- "version": "0.34.47",
3
+ "version": "0.34.49",
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.",
@@ -14,6 +14,8 @@
14
14
  "README.md",
15
15
  "letta.js",
16
16
  "image-resize-worker.js",
17
+ "image-resize.js",
18
+ "image-resize.js.map",
17
19
  "cursor-worker.js",
18
20
  "npm-shrinkwrap.json",
19
21
  "assets/tutor-profile.png",
@@ -136,6 +138,11 @@
136
138
  "browser": "./dist/channels-telegram.js",
137
139
  "import": "./dist/channels-telegram.js",
138
140
  "default": "./dist/channels-telegram.js"
141
+ },
142
+ "./image-resize": {
143
+ "types": "./dist/types/image-resize-public.d.ts",
144
+ "import": "./image-resize.js",
145
+ "default": "./image-resize.js"
139
146
  }
140
147
  },
141
148
  "repository": {
@@ -270,6 +277,9 @@
270
277
  "channels/telegram": [
271
278
  "./dist/types/channels-telegram.d.ts"
272
279
  ],
280
+ "image-resize": [
281
+ "./dist/types/image-resize-public.d.ts"
282
+ ],
273
283
  "protocol": [
274
284
  "./dist/types/types/protocol.d.ts"
275
285
  ]
@@ -277,7 +287,7 @@
277
287
  },
278
288
  "lettaLifecycleProtocol": 1,
279
289
  "lettaRuntimeGraphProtocol": 1,
280
- "lettaRuntimeGraphSha512": "sha512-DMyrwe+kalQ3U0ncY7kalXtOWp1QE7bh32cJNtGoERBViCd8eeb0avXJTTyM3TSLUTzaKyZ58TXwUiZeLLGDew==",
290
+ "lettaRuntimeGraphSha512": "sha512-PelylmCwHLSQ4nNKA+M2dEtr1JsdzY5CQo8ewFdGCbwBGsYSkZRFrbSIHznoeAq3PLq98jM8R+FrPeKVr0mwsQ==",
281
291
  "patchedDependencies": {
282
292
  "@earendil-works/pi-ai@0.99.1": "patches/@earendil-works%2Fpi-ai@0.99.1.patch"
283
293
  }
@@ -0,0 +1,67 @@
1
+ // Install the packed tarball into a throwaway consumer and require() the
2
+ // public image-resize entrypoint from CommonJS, as bundled Node services do.
3
+ // Proves the entry and the worker it spawns both ship, and that the entry has
4
+ // no top-level await (which CommonJS require() of ESM rejects).
5
+ import assert from "node:assert/strict";
6
+ import { execFileSync, spawnSync } from "node:child_process";
7
+ import {
8
+ mkdirSync,
9
+ mkdtempSync,
10
+ rmSync,
11
+ symlinkSync,
12
+ writeFileSync,
13
+ } from "node:fs";
14
+ import { tmpdir } from "node:os";
15
+ import { join, resolve } from "node:path";
16
+
17
+ const repo = resolve(new URL("..", import.meta.url).pathname);
18
+ const consumer = mkdtempSync(join(tmpdir(), "letta-image-resize-export-"));
19
+ try {
20
+ const [{ filename }] = JSON.parse(
21
+ execFileSync("npm", ["pack", "--json", "--pack-destination", consumer], {
22
+ cwd: repo,
23
+ encoding: "utf8",
24
+ }),
25
+ );
26
+ const pkg = join(consumer, "node_modules/@letta-ai/letta-code");
27
+ mkdirSync(pkg, { recursive: true });
28
+ execFileSync("tar", [
29
+ "-xzf",
30
+ join(consumer, filename),
31
+ "-C",
32
+ pkg,
33
+ "--strip-components=1",
34
+ ]);
35
+ // Reuse the repo's installed Sharp instead of a network install.
36
+ for (const dep of ["sharp", "@img"]) {
37
+ symlinkSync(
38
+ join(repo, "node_modules", dep),
39
+ join(consumer, "node_modules", dep),
40
+ );
41
+ }
42
+
43
+ writeFileSync(
44
+ join(consumer, "consumer.cjs"),
45
+ `const { randomBytes } = require("node:crypto");
46
+ const sharp = require("sharp");
47
+ const { MAX_IMAGE_BYTES, resizeImageIfNeeded } = require("@letta-ai/letta-code/image-resize");
48
+ (async () => {
49
+ const width = 1300, height = 1100;
50
+ const png = await sharp(randomBytes(width * height * 3), { raw: { width, height, channels: 3 } }).png().toBuffer();
51
+ if (png.toString("base64").length <= MAX_IMAGE_BYTES) throw new Error("fixture must exceed the base64 limit");
52
+ const result = await resizeImageIfNeeded(png, "image/png");
53
+ process.stdout.write(JSON.stringify({ bytes: result.data.length, limit: MAX_IMAGE_BYTES }));
54
+ })().catch((error) => { console.error(error); process.exit(1); });
55
+ `,
56
+ );
57
+ const run = spawnSync(process.execPath, ["consumer.cjs"], {
58
+ cwd: consumer,
59
+ encoding: "utf8",
60
+ });
61
+ assert.equal(run.status, 0, run.stderr || run.error?.message);
62
+ const { bytes, limit } = JSON.parse(run.stdout);
63
+ assert.ok(bytes <= limit, `resized base64 ${bytes} exceeds ${limit}`);
64
+ console.log(`image-resize export OK (${bytes} <= ${limit} base64 bytes)`);
65
+ } finally {
66
+ rmSync(consumer, { recursive: true, force: true });
67
+ }
@@ -20,7 +20,7 @@
20
20
  "src/cli/reflection-transcript.test.ts": 1084,
21
21
  "src/cli/subcommands/mcp.ts": 1045,
22
22
  "src/cli/subcommands/skills.ts": 1243,
23
- "src/headless.ts": 4827,
23
+ "src/headless.ts": 4821,
24
24
  "src/hooks/integration.test.ts": 1147,
25
25
  "src/index.ts": 2543,
26
26
  "src/mods/learning-harness.ts": 2434,
@@ -100,6 +100,15 @@ Cloud decisions service.
100
100
  - `phase(title)` — start a new phase; subsequent agent() calls are grouped
101
101
  under this title in progress output.
102
102
  - `log(message)` — emit a progress message to the user.
103
+ - `budget` — live run cost in USD: `budget.spent`, `budget.limit`, and
104
+ `budget.remaining` (limit and remaining are `null` without a `maxCostUsd`;
105
+ spent and remaining are `null` once any usage had no cost estimate).
106
+ With a budget, reaching it stops the run: pending and new calls reject with
107
+ `code: "budget_exceeded"` and running subagents are interrupted (a model
108
+ request already in flight finishes first, so the final spend can exceed the
109
+ limit by that much). Check `budget.remaining` between stages to skip
110
+ optional work (an extra verification pass) instead of hitting the limit
111
+ mid-stage.
103
112
  - `decide(state, questions, opts?)` → Promise; not a subagent call. Ask a
104
113
  calibrated Jev model (chosen internally — no model option) questions about
105
114
  `state`. `questions` is a non-empty OBJECT keyed by question id — never an