@letta-ai/letta-code 0.27.13 → 0.27.15
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/app-server-client.js +7 -3
- package/dist/app-server-client.js.map +3 -3
- package/dist/types/app-server-client.d.ts.map +1 -1
- package/dist/types/types/protocol_v2.d.ts +64 -39
- package/dist/types/types/protocol_v2.d.ts.map +1 -1
- package/letta.js +6153 -2909
- package/package.json +2 -2
- package/scripts/dev.cjs +35 -0
- package/skills/creating-mods/SKILL.md +24 -16
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@letta-ai/letta-code",
|
|
3
|
-
"version": "0.27.
|
|
3
|
+
"version": "0.27.15",
|
|
4
4
|
"description": "Letta Code is a CLI tool for interacting with stateful Letta agents from the terminal.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "bun@1.3.0",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"check:test-coverage": "node scripts/check-test-coverage.cjs",
|
|
93
93
|
"check:bundled-skill-scripts": "node scripts/check-bundled-skill-scripts.js",
|
|
94
94
|
"check": "bun run scripts/check.js",
|
|
95
|
-
"dev": "
|
|
95
|
+
"dev": "node scripts/dev.cjs",
|
|
96
96
|
"build": "node scripts/postinstall-patches.js && bun run build.js",
|
|
97
97
|
"test:update-chain:manual": "bun run src/test-utils/update-chain-smoke.ts --mode manual",
|
|
98
98
|
"test:update-chain:startup": "bun run src/test-utils/update-chain-smoke.ts --mode startup",
|
package/scripts/dev.cjs
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawn } = require('node:child_process');
|
|
4
|
+
|
|
5
|
+
const env = { ...process.env };
|
|
6
|
+
if (!env.LETTA_DEBUG) env.LETTA_DEBUG = '1';
|
|
7
|
+
if (!env.LETTA_RESPONSES_WS) env.LETTA_RESPONSES_WS = '1';
|
|
8
|
+
|
|
9
|
+
const bunArgs = [
|
|
10
|
+
'--loader=.md:text',
|
|
11
|
+
'--loader=.mdx:text',
|
|
12
|
+
'--loader=.txt:text',
|
|
13
|
+
'run',
|
|
14
|
+
'src/index.ts',
|
|
15
|
+
...process.argv.slice(2),
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
const child = spawn('bun', bunArgs, {
|
|
19
|
+
stdio: 'inherit',
|
|
20
|
+
env,
|
|
21
|
+
windowsHide: true,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
child.on('error', (error) => {
|
|
25
|
+
console.error('failed to launch bun for dev mode:', error.message);
|
|
26
|
+
process.exit(1);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
child.on('exit', (code, signal) => {
|
|
30
|
+
if (signal) {
|
|
31
|
+
process.kill(process.pid, signal);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
process.exit(code ?? 0);
|
|
35
|
+
});
|
|
@@ -5,15 +5,22 @@ description: Creates and edits trusted local Letta Code mods, including tools, s
|
|
|
5
5
|
|
|
6
6
|
# Creating Mods
|
|
7
7
|
|
|
8
|
-
Use this skill to create or update trusted
|
|
8
|
+
Use this skill to create or update trusted Letta Code mod files. Mods are trusted local code that add small composable capabilities through mod APIs, not by importing app internals. Dynamic agent/conversation/workspace/model state is passed as `ctx` to tool, command, event, permission, status, and statusline callbacks; do not read mutable global context for model-callable behavior. Prefer scoped handles (`ctx.conversation`, `ctx.cwd`, `ctx.agent`) and guard optional UI with `letta.capabilities`.
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
~/.letta/mods/
|
|
12
|
-
```
|
|
10
|
+
Capabilities vary by surface. TUI/headless may load tools, commands, events, UI, and providers; the desktop listener loads provider-only mods for local provider discovery. Always guard optional capabilities.
|
|
13
11
|
|
|
14
|
-
|
|
12
|
+
## Choose where the mod file lives
|
|
15
13
|
|
|
16
|
-
|
|
14
|
+
Default to a single mod file unless the user asks for something larger.
|
|
15
|
+
|
|
16
|
+
| Location | Use when |
|
|
17
|
+
| --- | --- |
|
|
18
|
+
| `~/.letta/mods/foo.ts` | The behavior should apply to local sessions on this machine. Use this by default. |
|
|
19
|
+
| `$MEMORY_DIR/mods/foo.ts` | The behavior should travel with one agent's MemFS/memory. |
|
|
20
|
+
|
|
21
|
+
Do not create project mods.
|
|
22
|
+
|
|
23
|
+
Packaging is an upgrade path, not the default authoring path. If the user asks to share, publish, distribute, or use third-party package dependencies, first build a working mod file, then use `letta mods package <mod-file> --name <package-name>`. Package install/update/download/publish details belong outside this skill.
|
|
17
24
|
|
|
18
25
|
## Choose the right capability
|
|
19
26
|
|
|
@@ -34,9 +41,10 @@ Default to a **tool** when the model should decide when to use the capability. D
|
|
|
34
41
|
|
|
35
42
|
## Workflow
|
|
36
43
|
|
|
37
|
-
1.
|
|
38
|
-
2.
|
|
39
|
-
3.
|
|
44
|
+
1. Pick the target scope: harness mod file (`~/.letta/mods/`) by default, or agent mod file (`$MEMORY_DIR/mods/`) only when the behavior should travel with this agent.
|
|
45
|
+
2. Inspect the relevant mods directory for related files.
|
|
46
|
+
3. Preserve unrelated mod code. Prefer a focused new file if merging would be messy.
|
|
47
|
+
4. Choose the mod shape and load only the needed recipe:
|
|
40
48
|
- tools: `references/tools.md`
|
|
41
49
|
- commands: `references/commands.md`
|
|
42
50
|
- local custom providers: `references/providers.md`
|
|
@@ -44,11 +52,11 @@ Default to a **tool** when the model should decide when to use the capability. D
|
|
|
44
52
|
- permissions: `references/permissions.md`
|
|
45
53
|
- panels/status/capabilities: `references/ui.md`
|
|
46
54
|
- complex plan-mode composition: `references/plan-mode.md`
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
55
|
+
5. For multi-capability or stateful mods, also read `references/architecture.md`.
|
|
56
|
+
6. Write a single-file mod unless the user asks for something larger.
|
|
57
|
+
7. Return disposers for registered providers/commands/tools/events, timers, subscriptions, and panels that should close on reload.
|
|
58
|
+
8. Do a basic review: valid names, descriptions present, schemas are object schemas, optional capabilities guarded, scoped APIs used, cleanup returned.
|
|
59
|
+
9. Tell the user the absolute file path changed and to run `/reload`. If a mod breaks startup or command handling, recover with `letta --no-mods` or `LETTA_DISABLE_MODS=1 letta`.
|
|
52
60
|
|
|
53
61
|
## Core mod shape
|
|
54
62
|
|
|
@@ -107,10 +115,10 @@ Agents can inspect local mod diagnostics at:
|
|
|
107
115
|
|
|
108
116
|
## Rules
|
|
109
117
|
|
|
110
|
-
-
|
|
118
|
+
- Do not create project mods.
|
|
111
119
|
- Custom provider mods are local-backend/local-agent only. They do not add providers for Constellation/cloud agents.
|
|
112
120
|
- Provider mods may run in a provider-only listener context; keep provider registration independent from commands/tools/UI and guard everything else.
|
|
113
|
-
-
|
|
121
|
+
- Direct mod files should not assume third-party npm packages are available. Use Node/Bun built-ins unless packaging is explicitly requested.
|
|
114
122
|
- Do not do surprising side effects on startup; mods activate on app start and `/reload`.
|
|
115
123
|
- Keep user-facing output short and intentional.
|
|
116
124
|
- Prefer Node/Bun standard APIs (`node:child_process`, `node:fs`, etc.) for local work.
|