@letta-ai/letta-code 0.34.25 → 0.34.27
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/cursor-worker.js +168 -0
- package/dist/agent-presets.js +5 -68
- package/dist/agent-presets.js.map +2 -2
- package/dist/channels-slack.js +30 -24
- package/dist/channels-slack.js.map +3 -3
- package/dist/mcp-client.js +233 -75
- package/dist/mcp-client.js.map +9 -9
- package/dist/mcp-oauth.js +257 -89
- package/dist/mcp-oauth.js.map +12 -11
- package/dist/memory-confinement.js +109 -51
- package/dist/memory-confinement.js.map +9 -8
- package/dist/types/agent/mcp-originator-authority-file.d.ts +1 -0
- package/dist/types/agent/mcp-originator-authority-file.d.ts.map +1 -1
- package/dist/types/agent/memory-filesystem.d.ts +3 -3
- package/dist/types/agent/memory-filesystem.d.ts.map +1 -1
- package/dist/types/agent/memory-git.d.ts +2 -2
- package/dist/types/agent/memory-git.d.ts.map +1 -1
- package/dist/types/agent/skills.d.ts +3 -3
- package/dist/types/agent/skills.d.ts.map +1 -1
- package/dist/types/agent/subagents/index.d.ts +8 -0
- package/dist/types/agent/subagents/index.d.ts.map +1 -1
- package/dist/types/agent/subagents/manager.d.ts.map +1 -1
- package/dist/types/agent/subagents/memory-worker.d.ts +2 -8
- package/dist/types/agent/subagents/memory-worker.d.ts.map +1 -1
- package/dist/types/agent/subagents/subagent-launcher.d.ts.map +1 -1
- package/dist/types/backend/api/providers.d.ts +8 -2
- package/dist/types/backend/api/providers.d.ts.map +1 -1
- package/dist/types/backend/api/schedules.d.ts +16 -2
- package/dist/types/backend/api/schedules.d.ts.map +1 -1
- package/dist/types/backend/backend.d.ts +5 -2
- package/dist/types/backend/backend.d.ts.map +1 -1
- package/dist/types/backend/dev/fake-headless-backend.d.ts +2 -1
- package/dist/types/backend/dev/fake-headless-backend.d.ts.map +1 -1
- package/dist/types/backend/dev/pi-model-factory.d.ts.map +1 -1
- package/dist/types/backend/local/local-provider-auth-store.d.ts +2 -0
- package/dist/types/backend/local/local-provider-auth-store.d.ts.map +1 -1
- package/dist/types/backend/local/local-transcript-history.d.ts +10 -0
- package/dist/types/backend/local/local-transcript-history.d.ts.map +1 -0
- package/dist/types/backend/local/local-transcript.d.ts +6 -0
- package/dist/types/backend/local/local-transcript.d.ts.map +1 -1
- package/dist/types/channels/slack/attachment-primitives.d.ts +2 -1
- package/dist/types/channels/slack/attachment-primitives.d.ts.map +1 -1
- package/dist/types/channels/types.d.ts +1 -1
- package/dist/types/cli/helpers/chunk-log.d.ts.map +1 -1
- package/dist/types/cli/subcommands/mcp.d.ts +2 -2
- package/dist/types/cli/subcommands/mcp.d.ts.map +1 -1
- package/dist/types/cron/cron-file.d.ts.map +1 -1
- package/dist/types/cron/process-identity.d.ts.map +1 -1
- package/dist/types/cron/run-log.d.ts +1 -0
- package/dist/types/cron/run-log.d.ts.map +1 -1
- package/dist/types/headless-environment-response.d.ts +27 -0
- package/dist/types/headless-environment-response.d.ts.map +1 -1
- package/dist/types/hooks/loader.d.ts.map +1 -1
- package/dist/types/mods/paths.d.ts +3 -3
- package/dist/types/mods/paths.d.ts.map +1 -1
- package/dist/types/permissions/agent-memory-prefixes.d.ts.map +1 -1
- package/dist/types/permissions/analyzer.d.ts +1 -0
- package/dist/types/permissions/analyzer.d.ts.map +1 -1
- package/dist/types/permissions/cross-agent-guard.d.ts.map +1 -1
- package/dist/types/permissions/loader.d.ts +2 -1
- package/dist/types/permissions/loader.d.ts.map +1 -1
- package/dist/types/permissions/sandbox-policy.d.ts +9 -7
- package/dist/types/permissions/sandbox-policy.d.ts.map +1 -1
- package/dist/types/providers/byok-providers.d.ts +14 -0
- package/dist/types/providers/byok-providers.d.ts.map +1 -1
- package/dist/types/sandbox/bwrap.d.ts +2 -2
- package/dist/types/sandbox/bwrap.d.ts.map +1 -1
- package/dist/types/sandbox/policy.d.ts +20 -3
- package/dist/types/sandbox/policy.d.ts.map +1 -1
- package/dist/types/sandbox/seatbelt.d.ts +1 -1
- package/dist/types/sandbox/seatbelt.d.ts.map +1 -1
- package/dist/types/settings-manager.d.ts +4 -12
- package/dist/types/settings-manager.d.ts.map +1 -1
- package/dist/types/tools/commit-trailer.d.ts +27 -0
- package/dist/types/tools/commit-trailer.d.ts.map +1 -0
- package/dist/types/tools/impl/claude-stream-session.d.ts.map +1 -1
- package/dist/types/tools/impl/codex-app-server.d.ts +2 -0
- package/dist/types/tools/impl/codex-app-server.d.ts.map +1 -1
- package/dist/types/tools/impl/cursor-session.d.ts +28 -0
- package/dist/types/tools/impl/cursor-session.d.ts.map +1 -0
- package/dist/types/tools/impl/cursor-worker.d.ts +35 -0
- package/dist/types/tools/impl/cursor-worker.d.ts.map +1 -0
- package/dist/types/tools/impl/external-coding-agent-task.d.ts.map +1 -1
- package/dist/types/tools/impl/external-coding-agent.d.ts +1 -1
- package/dist/types/tools/impl/external-coding-agent.d.ts.map +1 -1
- package/dist/types/tools/impl/memory-task-lifecycle.d.ts +2 -2
- package/dist/types/tools/impl/memory-task-lifecycle.d.ts.map +1 -1
- package/dist/types/tools/impl/overflow.d.ts +1 -1
- package/dist/types/tools/impl/overflow.d.ts.map +1 -1
- package/dist/types/tools/impl/remote-external-coding-agent.d.ts.map +1 -1
- package/dist/types/tools/impl/ripgrep-manager.d.ts.map +1 -1
- package/dist/types/tools/impl/send-agent-message.d.ts.map +1 -1
- package/dist/types/tools/impl/shell-env.d.ts.map +1 -1
- package/dist/types/tools/impl/task.d.ts.map +1 -1
- package/dist/types/tools/impl/wake.d.ts.map +1 -1
- package/dist/types/tools/script-tool-scope.d.ts.map +1 -1
- package/dist/types/tools/tool-definitions.d.ts.map +1 -1
- package/dist/types/tools/workflow/sdk-spawner.d.ts.map +1 -1
- package/dist/types/utils/fs.d.ts +5 -1
- package/dist/types/utils/fs.d.ts.map +1 -1
- package/dist/types/utils/local-backend-paths.d.ts +1 -1
- package/dist/types/utils/local-backend-paths.d.ts.map +1 -1
- package/dist/types/utils/native-cli-env.d.ts +3 -0
- package/dist/types/utils/native-cli-env.d.ts.map +1 -0
- package/dist/types/utils/process-liveness.d.ts +9 -0
- package/dist/types/utils/process-liveness.d.ts.map +1 -1
- package/dist/types/utils/secrets.d.ts +1 -1
- package/dist/types/utils/secrets.d.ts.map +1 -1
- package/dist/types/utils/settings-path.d.ts +14 -0
- package/dist/types/utils/settings-path.d.ts.map +1 -0
- package/dist/types/utils/transcript-paths.d.ts +1 -1
- package/dist/types/websocket/listener/constants.d.ts +6 -0
- package/dist/types/websocket/listener/constants.d.ts.map +1 -1
- package/dist/types/websocket/listener/input-disposition-path.d.ts.map +1 -1
- package/dist/types/websocket/listener/interrupted-turn-storage.d.ts.map +1 -1
- package/dist/types/websocket/listener/org-credentials.d.ts.map +1 -1
- package/dist/types/websocket/listener/remote-settings.d.ts +2 -2
- package/dist/types/websocket/listener/remote-settings.d.ts.map +1 -1
- package/dist/types/websocket/listener/turn-finished-replay.d.ts +1 -0
- package/dist/types/websocket/listener/turn-finished-replay.d.ts.map +1 -1
- package/letta.js +5769 -4506
- package/npm-shrinkwrap.json +293 -115
- package/package.json +6 -3
- package/scripts/agent-watch/verify-pr-identity.test.ts +148 -0
- package/scripts/agent-watch/verify-pr-identity.ts +72 -14
- package/scripts/claude-watch/agent-watch.ts +8 -2
- package/scripts/claude-watch/release-source.test.ts +120 -0
- package/scripts/claude-watch/release-source.ts +79 -9
- package/scripts/codex-watch/agent-watch.ts +2 -2
- package/scripts/codex-watch/release-analysis.test.ts +112 -6
- package/scripts/codex-watch/release-analysis.ts +63 -6
- package/scripts/isolated-unit-tests.json +10 -0
- package/scripts/source-file-size-baseline.json +5 -4
- package/scripts/test-home-preload.ts +1 -0
- package/skills/acquiring-skills/SKILL.md +4 -4
- package/skills/creating-mods/SKILL.md +3 -3
- package/skills/creating-mods/references/analysis-mode.md +7 -5
- package/skills/creating-mods/references/architecture.md +2 -2
- package/skills/creating-mods/references/plan-mode.md +12 -11
- package/skills/creating-mods/references/providers.md +1 -1
- package/skills/creating-skills/scripts/init-skill.ts +4 -2
- package/skills/customizing-commands/SKILL.md +3 -3
- package/skills/customizing-statusline/SKILL.md +3 -3
- package/skills/customizing-statusline/references/api.md +3 -3
- package/skills/customizing-statusline/references/migration.md +2 -2
- package/skills/initializing-memory/SKILL.md +2 -2
- package/skills/managing-agent-webhooks/SKILL.md +23 -3
- package/skills/managing-agent-webhooks/scripts/manage-agent-webhooks.mjs +40 -11
- package/skills/self-configuration/SKILL.md +5 -5
- package/skills/self-configuration/scripts/add_permission.py +26 -5
- package/skills/self-configuration/scripts/show_config.py +17 -2
- package/skills/syncing-memory-filesystem/SKILL.md +2 -10
- package/skills/video-generation/SKILL.md +152 -0
- package/skills/workflow-authoring/SKILL.md +1 -1
- package/dist/types/agent/memory-worktree.d.ts +0 -83
- package/dist/types/agent/memory-worktree.d.ts.map +0 -1
package/cursor-worker.js
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
var __dispose = Symbol.dispose || /* @__PURE__ */ Symbol.for("Symbol.dispose");
|
|
2
|
+
var __asyncDispose = Symbol.asyncDispose || /* @__PURE__ */ Symbol.for("Symbol.asyncDispose");
|
|
3
|
+
var __using = (stack, value, async) => {
|
|
4
|
+
if (value != null) {
|
|
5
|
+
if (typeof value !== "object" && typeof value !== "function")
|
|
6
|
+
throw TypeError('Object expected to be assigned to "using" declaration');
|
|
7
|
+
var dispose;
|
|
8
|
+
if (async)
|
|
9
|
+
dispose = value[__asyncDispose];
|
|
10
|
+
if (dispose === undefined)
|
|
11
|
+
dispose = value[__dispose];
|
|
12
|
+
if (typeof dispose !== "function")
|
|
13
|
+
throw TypeError("Object not disposable");
|
|
14
|
+
stack.push([async, dispose, value]);
|
|
15
|
+
} else if (async) {
|
|
16
|
+
stack.push([async]);
|
|
17
|
+
}
|
|
18
|
+
return value;
|
|
19
|
+
};
|
|
20
|
+
var __callDispose = (stack, error, hasError) => {
|
|
21
|
+
var E = typeof SuppressedError === "function" ? SuppressedError : function(e, s, m, _) {
|
|
22
|
+
return _ = Error(m), _.name = "SuppressedError", _.error = e, _.suppressed = s, _;
|
|
23
|
+
}, fail = (e) => error = hasError ? new E(e, error, "An error was suppressed during disposal") : (hasError = true, e), next = (it) => {
|
|
24
|
+
while (it = stack.pop()) {
|
|
25
|
+
try {
|
|
26
|
+
var result = it[1] && it[1].call(it[2]);
|
|
27
|
+
if (it[0])
|
|
28
|
+
return Promise.resolve(result).then(next, (e) => (fail(e), next()));
|
|
29
|
+
} catch (e) {
|
|
30
|
+
fail(e);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (hasError)
|
|
34
|
+
throw error;
|
|
35
|
+
};
|
|
36
|
+
return next();
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// src/tools/impl/cursor-worker.ts
|
|
40
|
+
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
41
|
+
import { join } from "node:path";
|
|
42
|
+
import { createInterface } from "node:readline";
|
|
43
|
+
import {
|
|
44
|
+
Agent,
|
|
45
|
+
Cursor,
|
|
46
|
+
JsonlLocalAgentStore
|
|
47
|
+
} from "@cursor/sdk";
|
|
48
|
+
function emit(event) {
|
|
49
|
+
process.stdout.write(`letta-cursor:${JSON.stringify(event)}
|
|
50
|
+
`);
|
|
51
|
+
}
|
|
52
|
+
var run;
|
|
53
|
+
var cancelled = false;
|
|
54
|
+
var started = false;
|
|
55
|
+
var steering = new Set;
|
|
56
|
+
var input = createInterface({ input: process.stdin });
|
|
57
|
+
async function cancel() {
|
|
58
|
+
cancelled = true;
|
|
59
|
+
await run?.cancel();
|
|
60
|
+
}
|
|
61
|
+
async function start(command) {
|
|
62
|
+
let __stack = [];
|
|
63
|
+
try {
|
|
64
|
+
await mkdir(command.stateDir, { recursive: true, mode: 448 });
|
|
65
|
+
const configPath = join(command.stateDir, "config.json");
|
|
66
|
+
const config = command.resume ? JSON.parse(await readFile(configPath, "utf8")) : { cwd: command.cwd, model: command.model, reminder: command.reminder };
|
|
67
|
+
if (!config.model)
|
|
68
|
+
throw new Error("Cursor requires an explicit model on the first Agent call; pick an ID from `letta model list --worker cursor`.");
|
|
69
|
+
if (!command.resume) {
|
|
70
|
+
await writeFile(configPath, JSON.stringify(config), {
|
|
71
|
+
mode: 384,
|
|
72
|
+
flag: "wx"
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
const options = {
|
|
76
|
+
apiKey: process.env.CURSOR_API_KEY,
|
|
77
|
+
model: { id: command.model ?? config.model },
|
|
78
|
+
tools: [
|
|
79
|
+
"shell",
|
|
80
|
+
"read",
|
|
81
|
+
"edit",
|
|
82
|
+
"grep",
|
|
83
|
+
"glob",
|
|
84
|
+
"ls",
|
|
85
|
+
"web_search_tool_call",
|
|
86
|
+
"web_fetch_tool_call"
|
|
87
|
+
],
|
|
88
|
+
local: {
|
|
89
|
+
cwd: config.cwd,
|
|
90
|
+
store: new JsonlLocalAgentStore(join(command.stateDir, "store")),
|
|
91
|
+
settingSources: ["project"]
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
const agent = __using(__stack, command.resume ? await Agent.resume(`agent-${command.sessionId}`, options) : await Agent.create({ ...options, agentId: `agent-${command.sessionId}` }), 1);
|
|
95
|
+
if (cancelled)
|
|
96
|
+
throw new Error("Cursor startup cancelled");
|
|
97
|
+
run = await agent.send([config.reminder, command.prompt].filter(Boolean).join(`
|
|
98
|
+
|
|
99
|
+
`));
|
|
100
|
+
if (cancelled)
|
|
101
|
+
await run.cancel();
|
|
102
|
+
emit({ type: "started", sessionId: command.sessionId });
|
|
103
|
+
const seen = new Set;
|
|
104
|
+
for await (const event of run.stream()) {
|
|
105
|
+
if (event.type === "tool_call" && !seen.has(event.call_id)) {
|
|
106
|
+
seen.add(event.call_id);
|
|
107
|
+
emit({
|
|
108
|
+
type: "tool",
|
|
109
|
+
id: event.call_id,
|
|
110
|
+
name: event.name,
|
|
111
|
+
args: event.args
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
const result = await run.wait();
|
|
116
|
+
await Promise.all(steering);
|
|
117
|
+
emit({ type: "result", result });
|
|
118
|
+
} catch (_catch) {
|
|
119
|
+
var _err = _catch, _hasErr = 1;
|
|
120
|
+
} finally {
|
|
121
|
+
var _promise = __callDispose(__stack, _err, _hasErr);
|
|
122
|
+
_promise && await _promise;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
input.on("line", (line) => {
|
|
126
|
+
const command = JSON.parse(line);
|
|
127
|
+
if ((command.type === "start" || command.type === "models") && !started) {
|
|
128
|
+
started = true;
|
|
129
|
+
(command.type === "models" ? Cursor.models.list({ apiKey: process.env.CURSOR_API_KEY }).then((models) => emit({ type: "models", models })) : start(command)).catch(async (error) => {
|
|
130
|
+
await cancel().catch(() => {
|
|
131
|
+
return;
|
|
132
|
+
});
|
|
133
|
+
emit({
|
|
134
|
+
type: "error",
|
|
135
|
+
error: error instanceof Error ? error.message : String(error)
|
|
136
|
+
});
|
|
137
|
+
}).finally(() => {
|
|
138
|
+
input.close();
|
|
139
|
+
process.stdout.write("", () => process.exit(0));
|
|
140
|
+
});
|
|
141
|
+
} else if (command.type === "steer") {
|
|
142
|
+
const pending = (async () => {
|
|
143
|
+
try {
|
|
144
|
+
const outcome = await run?.steer?.(command.prompt);
|
|
145
|
+
emit({
|
|
146
|
+
type: "steer",
|
|
147
|
+
id: command.id,
|
|
148
|
+
delivered: outcome === "complete_delivered"
|
|
149
|
+
});
|
|
150
|
+
} catch (error) {
|
|
151
|
+
emit({
|
|
152
|
+
type: "steer",
|
|
153
|
+
id: command.id,
|
|
154
|
+
delivered: false,
|
|
155
|
+
error: String(error)
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
})();
|
|
159
|
+
steering.add(pending);
|
|
160
|
+
pending.finally(() => steering.delete(pending));
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
process.on("SIGINT", () => void cancel());
|
|
164
|
+
process.on("SIGTERM", () => void cancel());
|
|
165
|
+
input.on("close", () => {
|
|
166
|
+
if (!started || run?.status === "running")
|
|
167
|
+
cancel();
|
|
168
|
+
});
|
package/dist/agent-presets.js
CHANGED
|
@@ -197,27 +197,6 @@ The MemFS is a git-backed projection of your memory. Changes affect your future
|
|
|
197
197
|
|
|
198
198
|
**Editing memory does NOT change your behavior in the current turn.** The prompt governing this turn is the one compiled at the start of the conversation; a memory edit is applied on a later recompile (a new conversation, an explicit recompile, or a changed committed revision) — never instantly. You are writing for your future self: make the change, then continue acting on your decision in the present.
|
|
199
199
|
|
|
200
|
-
You can always read and search memory directly. The \`memory\` subagent's entry in the Agent tool covers when to delegate memory updates.
|
|
201
|
-
|
|
202
|
-
### Editing memory directly
|
|
203
|
-
|
|
204
|
-
When memory is the main task, inspect Git status and read the current files before editing. Memory workers edit a private worktree that the harness merges into this checkout when they finish, so your edits do not collide with theirs; if a worker you launched may still be running and memory is now the main task, wait for it: re-read its output file until it ends with \`[Task completed]\` or \`[Task failed]\`, then reread the memory files before editing what it was asked to change. Automatic conflict repair and reflection integration may also commit to this checkout while you work, so stage only the files you changed by explicit path (never \`git add -A\` or \`git add .\`) and commit them in the same shell call.
|
|
205
|
-
|
|
206
|
-
Memory Markdown files must start with YAML frontmatter containing a non-empty \`description:\` field. Preserve existing frontmatter and discovery links. The MemFS pre-commit hook validates frontmatter and prevents changes to protected \`read_only\` files. Skill \`SKILL.md\` files use their own skill frontmatter format.
|
|
207
|
-
|
|
208
|
-
Review the diff, stage only the intended files, and commit only those paths, so anything else already staged in the checkout stays out of your commit. Preserve unrelated changes and protected read-only files. Use a non-empty author name fallback if \`$AGENT_NAME\` is unavailable:
|
|
209
|
-
|
|
210
|
-
\`\`\`bash
|
|
211
|
-
cd "$MEMORY_DIR"
|
|
212
|
-
git status
|
|
213
|
-
git diff
|
|
214
|
-
git add <specific files>
|
|
215
|
-
author_name="\${AGENT_NAME:-$AGENT_ID}"
|
|
216
|
-
git commit --author="$author_name <$AGENT_ID@letta.com>" -m "<type>: <what changed>" -- <specific files>
|
|
217
|
-
\`\`\`
|
|
218
|
-
|
|
219
|
-
Verify the committed changes before claiming they are saved. Use \`git -C "$MEMORY_DIR" log --oneline\` to inspect memory history. The harness handles normal sync and prompt refresh after primary turns or background worker completion; a local commit is not confirmation of remote sync. Reflection continues independently.
|
|
220
|
-
|
|
221
200
|
## Learning from mistakes
|
|
222
201
|
|
|
223
202
|
You are a long-lived stateful agent expected to operate over a long (potentially infinite) time horizon. Because of this, it is vital that you take actions in the present to not only optimize short-term reward but also reward in the distant future.
|
|
@@ -320,7 +299,7 @@ Some skills are part of the environment (e.g. stored in \`.agents\`); others are
|
|
|
320
299
|
|
|
321
300
|
## Mods
|
|
322
301
|
|
|
323
|
-
Mods are trusted local code that customize the harness around you. They can register tools, slash commands, local model providers, lifecycle/turn events, permission overlays, panels, status values, and other UI behavior. They
|
|
302
|
+
Mods are trusted local code that customize the harness around you. They can register tools, slash commands, local model providers, lifecycle/turn events, permission overlays, panels, status values, and other UI behavior. They live under the active product config root (\`$LETTA_CONFIG_DIR/mods\` when configured, otherwise \`~/.letta/mods\`) and reload with \`/reload\`.
|
|
324
303
|
|
|
325
304
|
Treat mods as executable context-shaping affordances, not as hidden memory. Use a mod when the desired change is a local capability, approval policy, UI surface, event transform, provider integration, or deterministic runtime behavior. Use memory when the change should become part of who you are, what you know, or how you judge future situations. Use a skill when the change is reusable procedural context that should be loaded on demand.
|
|
326
305
|
|
|
@@ -399,27 +378,6 @@ The MemFS is a git-backed projection of your memory. Changes affect your future
|
|
|
399
378
|
|
|
400
379
|
**Editing memory does NOT change your behavior in the current turn.** The prompt governing this turn is the one compiled at the start of the conversation; a memory edit is applied on a later recompile (a new conversation, an explicit recompile, or a changed committed revision) — never instantly. You are writing for your future self: make the change, then continue acting on your decision in the present.
|
|
401
380
|
|
|
402
|
-
You can always read and search memory directly. The \`memory\` subagent's entry in the Agent tool covers when to delegate memory updates.
|
|
403
|
-
|
|
404
|
-
### Editing memory directly
|
|
405
|
-
|
|
406
|
-
When memory is the main task, inspect Git status and read the current files before editing. Memory workers edit a private worktree that the harness merges into this checkout when they finish, so your edits do not collide with theirs; if a worker you launched may still be running and memory is now the main task, wait for it: re-read its output file until it ends with \`[Task completed]\` or \`[Task failed]\`, then reread the memory files before editing what it was asked to change. Automatic conflict repair and reflection integration may also commit to this checkout while you work, so stage only the files you changed by explicit path (never \`git add -A\` or \`git add .\`) and commit them in the same shell call.
|
|
407
|
-
|
|
408
|
-
Memory Markdown files must start with YAML frontmatter containing a non-empty \`description:\` field. Preserve existing frontmatter and discovery links. The MemFS pre-commit hook validates frontmatter and prevents changes to protected \`read_only\` files. Skill \`SKILL.md\` files use their own skill frontmatter format.
|
|
409
|
-
|
|
410
|
-
Review the diff, stage only the intended files, and commit only those paths, so anything else already staged in the checkout stays out of your commit. Preserve unrelated changes and protected read-only files. Use a non-empty author name fallback if \`$AGENT_NAME\` is unavailable:
|
|
411
|
-
|
|
412
|
-
\`\`\`bash
|
|
413
|
-
cd "$MEMORY_DIR"
|
|
414
|
-
git status
|
|
415
|
-
git diff
|
|
416
|
-
git add <specific files>
|
|
417
|
-
author_name="\${AGENT_NAME:-$AGENT_ID}"
|
|
418
|
-
git commit --author="$author_name <$AGENT_ID@letta.com>" -m "<type>: <what changed>" -- <specific files>
|
|
419
|
-
\`\`\`
|
|
420
|
-
|
|
421
|
-
Verify the committed changes before claiming they are saved. Use \`git -C "$MEMORY_DIR" log --oneline\` to inspect memory history. The harness handles normal sync and prompt refresh after primary turns or background worker completion; a local commit is not confirmation of remote sync. Reflection continues independently.
|
|
422
|
-
|
|
423
381
|
## Learning from mistakes
|
|
424
382
|
|
|
425
383
|
You are a long-lived stateful agent expected to operate over a long (potentially infinite) time horizon. Because of this, it is vital that you take actions in the present to not only optimize short-term reward but also reward in the distant future.
|
|
@@ -522,7 +480,7 @@ Some skills are part of the environment (e.g. stored in \`.agents\`); others are
|
|
|
522
480
|
|
|
523
481
|
## Mods
|
|
524
482
|
|
|
525
|
-
Mods are trusted local code that customize the harness around you. They can register tools, slash commands, local model providers, lifecycle/turn events, permission overlays, panels, status values, and other UI behavior. They
|
|
483
|
+
Mods are trusted local code that customize the harness around you. They can register tools, slash commands, local model providers, lifecycle/turn events, permission overlays, panels, status values, and other UI behavior. They live under the active product config root (\`$LETTA_CONFIG_DIR/mods\` when configured, otherwise \`~/.letta/mods\`) and reload with \`/reload\`.
|
|
526
484
|
|
|
527
485
|
Treat mods as executable context-shaping affordances, not as hidden memory. Use a mod when the desired change is a local capability, approval policy, UI surface, event transform, provider integration, or deterministic runtime behavior. Use memory when the change should become part of who you are, what you know, or how you judge future situations. Use a skill when the change is reusable procedural context that should be loaded on demand.
|
|
528
486
|
|
|
@@ -670,7 +628,7 @@ Skills are dynamically loaded capabilities — folders of instructions, scripts,
|
|
|
670
628
|
|
|
671
629
|
# Mods
|
|
672
630
|
|
|
673
|
-
Mods are trusted local code that customize the harness around you. They can register tools, slash commands, local model providers, lifecycle/turn events, permission overlays, panels, status values, and other UI behavior. They
|
|
631
|
+
Mods are trusted local code that customize the harness around you. They can register tools, slash commands, local model providers, lifecycle/turn events, permission overlays, panels, status values, and other UI behavior. They live under the active product config root (\`$LETTA_CONFIG_DIR/mods\` when configured, otherwise \`~/.letta/mods\`) and reload with \`/reload\`.
|
|
674
632
|
|
|
675
633
|
Treat mods as executable context-shaping affordances, not as hidden memory. Use a mod when the desired change is a local capability, approval policy, UI surface, event transform, provider integration, or deterministic runtime behavior. Use memory when the change should become part of who you are, what you know, or how you judge future situations. Use a skill when the change is reusable procedural context that should be loaded on demand.
|
|
676
634
|
|
|
@@ -753,27 +711,6 @@ The MemFS is a git-backed projection of your memory. Changes affect your future
|
|
|
753
711
|
|
|
754
712
|
**Editing memory does NOT change your behavior in the current turn.** The prompt governing this turn is the one compiled at the start of the conversation; a memory edit is applied on a later recompile (a new conversation, an explicit recompile, or a changed committed revision) — never instantly. You are writing for your future self: make the change, then continue acting on your decision in the present.
|
|
755
713
|
|
|
756
|
-
You can always read and search memory directly. The \`memory\` subagent's entry in the Agent tool covers when to delegate memory updates.
|
|
757
|
-
|
|
758
|
-
### Editing memory directly
|
|
759
|
-
|
|
760
|
-
When memory is the main task, inspect Git status and read the current files before editing. Memory workers edit a private worktree that the harness merges into this checkout when they finish, so your edits do not collide with theirs; if a worker you launched may still be running and memory is now the main task, wait for it: re-read its output file until it ends with \`[Task completed]\` or \`[Task failed]\`, then reread the memory files before editing what it was asked to change. Automatic conflict repair and reflection integration may also commit to this checkout while you work, so stage only the files you changed by explicit path (never \`git add -A\` or \`git add .\`) and commit them in the same shell call.
|
|
761
|
-
|
|
762
|
-
Preserve the root layout: root and child \`MEMORY.md\` indexes have no frontmatter; other memory Markdown files require exactly \`name\` and \`description\`. Keep discovery links up to date. Skill \`SKILL.md\` files use their own skill frontmatter format. Obey the repository's validation hooks.
|
|
763
|
-
|
|
764
|
-
Review the diff, stage only the intended files, and commit only those paths, so anything else already staged in the checkout stays out of your commit. Preserve unrelated changes and protected read-only files. Use a non-empty author name fallback if \`$AGENT_NAME\` is unavailable:
|
|
765
|
-
|
|
766
|
-
\`\`\`bash
|
|
767
|
-
cd "$MEMORY_DIR"
|
|
768
|
-
git status
|
|
769
|
-
git diff
|
|
770
|
-
git add <specific files>
|
|
771
|
-
author_name="\${AGENT_NAME:-$AGENT_ID}"
|
|
772
|
-
git commit --author="$author_name <$AGENT_ID@letta.com>" -m "<type>: <what changed>" -- <specific files>
|
|
773
|
-
\`\`\`
|
|
774
|
-
|
|
775
|
-
Verify the committed changes before claiming they are saved. Use \`git -C "$MEMORY_DIR" log --oneline\` to inspect memory history. The harness handles normal sync and prompt refresh after primary turns or background worker completion; a local commit is not confirmation of remote sync. Reflection continues independently.
|
|
776
|
-
|
|
777
714
|
## Learning from mistakes
|
|
778
715
|
|
|
779
716
|
You are a long-lived stateful agent expected to operate over a long (potentially infinite) time horizon. Because of this, it is vital that you take actions in the present to not only optimize short-term reward but also reward in the distant future.
|
|
@@ -876,7 +813,7 @@ Some skills are part of the environment (e.g. stored in \`.agents\`); others are
|
|
|
876
813
|
|
|
877
814
|
## Mods
|
|
878
815
|
|
|
879
|
-
Mods are trusted local code that customize the harness around you. They can register tools, slash commands, local model providers, lifecycle/turn events, permission overlays, panels, status values, and other UI behavior. They
|
|
816
|
+
Mods are trusted local code that customize the harness around you. They can register tools, slash commands, local model providers, lifecycle/turn events, permission overlays, panels, status values, and other UI behavior. They live under the active product config root (\`$LETTA_CONFIG_DIR/mods\` when configured, otherwise \`~/.letta/mods\`) and reload with \`/reload\`.
|
|
880
817
|
|
|
881
818
|
Treat mods as executable context-shaping affordances, not as hidden memory. Use a mod when the desired change is a local capability, approval policy, UI surface, event transform, provider integration, or deterministic runtime behavior. Use memory when the change should become part of who you are, what you know, or how you judge future situations. Use a skill when the change is reusable procedural context that should be loaded on demand.
|
|
882
819
|
|
|
@@ -2590,4 +2527,4 @@ export {
|
|
|
2590
2527
|
DEFAULT_CREATED_AGENT_BASE_TOOLS
|
|
2591
2528
|
};
|
|
2592
2529
|
|
|
2593
|
-
//# debugId=
|
|
2530
|
+
//# debugId=BCA29C77D11CBDBB64756E2164756E21
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"/**\n * Pure personality preset definitions and content builders.\n *\n * This module must stay free of Node/backend imports: it is bundled into the\n * browser-safe `@letta-ai/letta-code/agent-presets` package export so that\n * other surfaces (e.g. the chat web app) can build byte-identical agent\n * creation payloads. Filesystem application of personalities lives in\n * `personality.ts`.\n */\n\nimport { parseMdxFrontmatter } from \"./memory\";\nimport { MEMORY_PROMPTS, SYSTEM_PROMPTS } from \"./prompt-assets\";\n\nexport type PersonalityAssetId = \"tutor-profile\";\n\nexport interface PersonalityDefaultMemoryFile {\n path: string;\n assetId: PersonalityAssetId;\n commitMessage: string;\n}\n\nexport interface PersonalityOption {\n id: \"blank\" | \"kawaii\" | \"codex\" | \"claude\" | \"linus\" | \"memo\" | \"tutorial\";\n label: string;\n description: string;\n /** Model ID or handle to use when no explicit model is provided. */\n defaultModel?: string;\n /** Binary files seeded into MemFS after the initial checkout. */\n defaultMemoryFiles?: readonly PersonalityDefaultMemoryFile[];\n}\n\nexport const PERSONALITY_OPTIONS: PersonalityOption[] = [\n {\n id: \"memo\",\n label: \"Letta Code\",\n description: \"The memory-first agent\",\n },\n {\n id: \"tutorial\",\n label: \"Tutor\",\n description:\n \"I help with getting started with Letta. I can answer any questions about Letta, and also help you create and configure agents.\",\n defaultMemoryFiles: [\n {\n path: \"profile.png\",\n assetId: \"tutor-profile\",\n commitMessage: \"chore: set default Tutor profile picture\",\n },\n ],\n },\n {\n id: \"blank\",\n label: \"Blank\",\n description: \"Blank starter — you provide the personality\",\n },\n {\n id: \"linus\",\n label: \"Linus\",\n description: \"Code with a stern hand\",\n },\n {\n id: \"kawaii\",\n label: \"Letta-Chan\",\n description: \"sugoi~ (◕‿◕)✨\",\n defaultModel: \"auto-chat\",\n },\n {\n id: \"claude\",\n label: \"Letta Code\",\n description: \"Vanilla Claude flavors\",\n },\n {\n id: \"codex\",\n label: \"Letta Code\",\n description: \"Vanilla Codex flavors\",\n },\n];\n\nexport type PersonalityId = PersonalityOption[\"id\"];\nexport type PersonalityEnvironment = \"cloud\" | \"local\";\n\nexport const PERSONALITY_TAG_PREFIX = \"personality:\";\n\nexport function buildPersonalityTag(personalityId: PersonalityId): string {\n return `${PERSONALITY_TAG_PREFIX}${personalityId}`;\n}\n\nexport function getPersonalityCreationTags(\n personalityId: PersonalityId,\n): string[] {\n return getPersonalityDefaultMemoryFiles(personalityId).length > 0\n ? [buildPersonalityTag(personalityId)]\n : [];\n}\n\nexport function resolvePersonalityIdFromTags(\n tags: readonly string[] | null | undefined,\n): PersonalityId | null {\n for (const tag of tags ?? []) {\n if (!tag.startsWith(PERSONALITY_TAG_PREFIX)) {\n continue;\n }\n const personalityId = resolvePersonalityId(\n tag.slice(PERSONALITY_TAG_PREFIX.length),\n );\n if (personalityId) {\n return personalityId;\n }\n }\n return null;\n}\n\nexport const DEFAULT_CREATE_AGENT_PERSONALITIES = [\n \"memo\",\n \"tutorial\",\n \"blank\",\n \"linus\",\n \"kawaii\",\n] as const;\n\nexport type DefaultCreateAgentPersonalityId =\n (typeof DEFAULT_CREATE_AGENT_PERSONALITIES)[number];\n\nconst PERSONALITY_ALIASES: Record<string, PersonalityId> = {\n \"letta-code\": \"memo\",\n lettacode: \"memo\",\n memo: \"memo\",\n};\n\nexport interface PersonalityBlockDefinition {\n value: string;\n description?: string;\n templatePromptAssetName: string;\n}\n\nexport const ONBOARDING_PERSONALITIES = [\n \"tutorial\",\n] as const satisfies readonly PersonalityId[];\n\nexport function supportsOnboardingBlock(\n personalityId: PersonalityId,\n): personalityId is (typeof ONBOARDING_PERSONALITIES)[number] {\n return (ONBOARDING_PERSONALITIES as readonly PersonalityId[]).includes(\n personalityId,\n );\n}\n\nexport const FRONTMATTER_REGEX = /^(---\\n[\\s\\S]*?\\n---)\\n*/;\nconst EDITABLE_FRONTMATTER_KEYS = [\n \"description\",\n \"limit\",\n \"read_only\",\n] as const;\n\nexport function normalizeComparableContent(content: string): string {\n return content.replace(/\\r\\n/g, \"\\n\").trim();\n}\n\nfunction ensureTrailingNewline(content: string): string {\n return `${content.trimEnd()}\\n`;\n}\n\nfunction getPromptTemplate(promptAssetName: string): {\n frontmatter: Record<string, string>;\n body: string;\n} {\n const rawPrompt = MEMORY_PROMPTS[promptAssetName];\n if (!rawPrompt) {\n throw new Error(`Missing built-in prompt content for ${promptAssetName}`);\n }\n\n return parseMdxFrontmatter(rawPrompt);\n}\n\nfunction getPromptBody(promptAssetName: string): string {\n const { body } = getPromptTemplate(promptAssetName);\n if (!body.trim()) {\n throw new Error(`${promptAssetName} has empty body content`);\n }\n\n return ensureTrailingNewline(body);\n}\n\nfunction getEditablePromptFrontmatter(\n promptAssetName: string,\n): Record<string, string> {\n const { frontmatter } = getPromptTemplate(promptAssetName);\n return Object.fromEntries(\n Object.entries(frontmatter).filter(([key]) =>\n (EDITABLE_FRONTMATTER_KEYS as readonly string[]).includes(key),\n ),\n );\n}\n\nexport function serializeFrontmatter(\n frontmatter: Record<string, string>,\n): string {\n const orderedKeys = [\n ...EDITABLE_FRONTMATTER_KEYS,\n ...Object.keys(frontmatter).filter(\n (key) => !(EDITABLE_FRONTMATTER_KEYS as readonly string[]).includes(key),\n ),\n ];\n const lines: string[] = [];\n\n for (const key of orderedKeys) {\n const value = frontmatter[key];\n if (value === undefined) {\n continue;\n }\n lines.push(`${key}: ${value}`);\n }\n\n return `---\\n${lines.join(\"\\n\")}\\n---`;\n}\n\nexport function buildDefaultMemoryFile(\n templatePromptAssetName: string,\n body: string,\n description?: string,\n): string {\n const normalizedBody = ensureTrailingNewline(body.trim());\n if (!normalizedBody.trim()) {\n throw new Error(\"Memory content cannot be empty\");\n }\n\n const frontmatter = getEditablePromptFrontmatter(templatePromptAssetName);\n if (description !== undefined) {\n frontmatter.description = description;\n }\n\n if (Object.keys(frontmatter).length === 0) {\n return normalizedBody;\n }\n\n return `${serializeFrontmatter(frontmatter)}\\n\\n${normalizedBody}`;\n}\n\nfunction getSystemPromptById(systemPromptId: string): string {\n const prompt = SYSTEM_PROMPTS.find(\n (candidate) => candidate.id === systemPromptId,\n );\n if (!prompt || !prompt.content.trim()) {\n throw new Error(`Missing built-in prompt content for ${systemPromptId}`);\n }\n return prompt.content;\n}\n\nexport function getPersonalityOption(\n personalityId: PersonalityId,\n): PersonalityOption {\n const option = PERSONALITY_OPTIONS.find(\n (candidate) => candidate.id === personalityId,\n );\n if (!option) {\n throw new Error(`Unknown personality: ${personalityId}`);\n }\n return option;\n}\n\nexport function getPersonalityDefaultMemoryFiles(\n personalityId: PersonalityId,\n): readonly PersonalityDefaultMemoryFile[] {\n return getPersonalityOption(personalityId).defaultMemoryFiles ?? [];\n}\n\nexport function resolvePersonalityId(input: string): PersonalityId | null {\n const normalized = input.trim().toLowerCase();\n if (!normalized) {\n return null;\n }\n\n const direct = PERSONALITY_OPTIONS.find(\n (candidate) => candidate.id === normalized,\n );\n if (direct) {\n return direct.id;\n }\n\n return PERSONALITY_ALIASES[normalized] ?? null;\n}\n\nexport function getPersonalityContent(personalityId: PersonalityId): string {\n if (personalityId === \"memo\") {\n return getPromptBody(\"persona_memo.mdx\");\n }\n\n if (personalityId === \"tutorial\") {\n return getPromptBody(\"persona_tutorial.mdx\");\n }\n\n if (personalityId === \"blank\") {\n return getPromptBody(\"persona_blank.mdx\");\n }\n\n if (personalityId === \"kawaii\") {\n return getPromptBody(\"persona_kawaii.mdx\");\n }\n\n if (personalityId === \"codex\") {\n return ensureTrailingNewline(getSystemPromptById(\"source-codex\"));\n }\n\n if (personalityId === \"linus\") {\n return getPromptBody(\"persona_linus.mdx\");\n }\n\n return ensureTrailingNewline(getSystemPromptById(\"source-claude\"));\n}\n\nexport function getDefaultHumanContent(): string {\n return getPromptBody(\"human.mdx\");\n}\n\nexport function getPersonalityHumanContent(\n personalityId: PersonalityId,\n): string {\n if (personalityId === \"memo\") {\n return getPromptBody(\"human_memo.mdx\");\n }\n\n if (personalityId === \"tutorial\") {\n return getPromptBody(\"human_tutorial.mdx\");\n }\n\n if (personalityId === \"linus\") {\n return getPromptBody(\"human_linus.mdx\");\n }\n\n if (personalityId === \"kawaii\") {\n return getPromptBody(\"human_kawaii.mdx\");\n }\n\n if (personalityId === \"blank\") {\n return getDefaultHumanContent();\n }\n\n return getDefaultHumanContent();\n}\n\nexport function getPersonalityBlockValues(personalityId: PersonalityId): {\n persona: string;\n human: string;\n} {\n const overrides = getPersonalityBlockDefinitions(personalityId);\n return {\n persona: overrides.persona.value,\n human: overrides.human.value,\n };\n}\n\nexport function getPersonalityBlockDefinitions(\n personalityId: PersonalityId,\n environment: PersonalityEnvironment = \"cloud\",\n): {\n persona: PersonalityBlockDefinition;\n human: PersonalityBlockDefinition;\n onboarding?: PersonalityBlockDefinition;\n} {\n const personaTemplatePromptAssetName =\n personalityId === \"memo\"\n ? \"persona_memo.mdx\"\n : personalityId === \"tutorial\"\n ? \"persona_tutorial.mdx\"\n : personalityId === \"blank\"\n ? \"persona_blank.mdx\"\n : personalityId === \"kawaii\"\n ? \"persona_kawaii.mdx\"\n : personalityId === \"linus\"\n ? \"persona_linus.mdx\"\n : \"persona.mdx\";\n const humanTemplatePromptAssetName =\n personalityId === \"memo\"\n ? \"human_memo.mdx\"\n : personalityId === \"tutorial\"\n ? \"human_tutorial.mdx\"\n : personalityId === \"kawaii\"\n ? \"human_kawaii.mdx\"\n : personalityId === \"linus\"\n ? \"human_linus.mdx\"\n : \"human.mdx\";\n const onboardingTemplatePromptAssetName =\n environment === \"local\" ? \"onboarding_local.mdx\" : \"onboarding.mdx\";\n\n return {\n persona: {\n value: getPersonalityContent(personalityId),\n description: getEditablePromptFrontmatter(personaTemplatePromptAssetName)\n .description,\n templatePromptAssetName: personaTemplatePromptAssetName,\n },\n human: {\n value: getPersonalityHumanContent(personalityId),\n description: getEditablePromptFrontmatter(humanTemplatePromptAssetName)\n .description,\n templatePromptAssetName: humanTemplatePromptAssetName,\n },\n ...(supportsOnboardingBlock(personalityId)\n ? {\n onboarding: {\n value: getPromptBody(onboardingTemplatePromptAssetName),\n description: getEditablePromptFrontmatter(\n onboardingTemplatePromptAssetName,\n ).description,\n templatePromptAssetName: onboardingTemplatePromptAssetName,\n },\n }\n : {}),\n };\n}\n\nexport interface PersonalityMemoryBlock {\n label: string;\n value: string;\n description?: string;\n}\n\n/**\n * Build the memory blocks a new agent gets for a personality: the default\n * blocks with persona/human values replaced by the personality's content,\n * plus the onboarding block for personalities that support it.\n *\n * Shared by the CLI create path (`buildCreateAgentOptionsForPersonality`) and\n * the exported wire payload builder (`buildCreateAgentRequestForPersonality`).\n */\nexport function buildPersonalityMemoryBlocks(\n personalityId: PersonalityId,\n defaultMemoryBlocks: Array<{\n label: string;\n value: string;\n description?: string | null;\n }>,\n environment: PersonalityEnvironment = \"cloud\",\n): PersonalityMemoryBlock[] {\n const blockDefinitions = getPersonalityBlockDefinitions(\n personalityId,\n environment,\n );\n\n const memoryBlocks = defaultMemoryBlocks.map((block) => {\n if (block.label === \"persona\") {\n return {\n label: block.label,\n value: blockDefinitions.persona.value,\n description:\n blockDefinitions.persona.description ??\n block.description ??\n undefined,\n };\n }\n\n if (block.label === \"human\") {\n return {\n label: block.label,\n value: blockDefinitions.human.value,\n description:\n blockDefinitions.human.description ?? block.description ?? undefined,\n };\n }\n\n return {\n label: block.label,\n value: block.value,\n description: block.description ?? undefined,\n };\n });\n\n if (blockDefinitions.onboarding) {\n memoryBlocks.push({\n label: \"onboarding\",\n value: blockDefinitions.onboarding.value,\n description: blockDefinitions.onboarding.description,\n });\n }\n\n return memoryBlocks;\n}\n",
|
|
12
12
|
"/**\n * Pure builder for the `POST /v1/agents` wire payload of a Letta Code agent.\n *\n * This is the shared creation-policy choke point for the CLI and external\n * harness surfaces. It owns the defaults that must not drift between callers:\n * agent type, prompt mode, tags, server tools, initial messages, parallel tool\n * calls, and compaction. Callers may supply either a Letta Code personality or\n * their own identity blocks without rebuilding that policy.\n *\n * Everything reachable from this module must stay free of Node/backend imports\n * so it can be bundled in the browser-safe `agent-presets` package export.\n */\n\nimport type { CreateBlock } from \"@letta-ai/letta-client/resources/blocks/blocks\";\nimport { DEFAULT_SUMMARIZATION_MODEL } from \"@/constants\";\nimport { buildCreatedAgentTags } from \"./agent-tags\";\nimport { getDefaultMemoryBlocks } from \"./memory\";\nimport { getDefaultModel, resolveModel } from \"./model-catalog\";\nimport {\n buildPersonalityMemoryBlocks,\n getPersonalityCreationTags,\n getPersonalityDefaultMemoryFiles,\n getPersonalityOption,\n type PersonalityId,\n} from \"./personality-presets\";\nimport { buildSystemPrompt, type MemoryPromptMode } from \"./prompt-assets\";\n\n/** Agent type used for all Letta Code agents. */\nexport const LETTA_CODE_AGENT_TYPE = \"letta_v1_agent\";\n\n/**\n * Server-side tools attached to created agents. Client-side tools (Read,\n * Write, Bash, etc.) are passed via client_tools at runtime instead.\n */\nexport const DEFAULT_CREATED_AGENT_BASE_TOOLS = [\"web_search\", \"fetch_webpage\"];\n\nexport type CreateAgentMemoryBlock = CreateBlock;\n\n/**\n * Root marker that makes the hosted memory repository use MemFS v2.\n * The server seeds the root `MEMORY.md` layout only when the create request\n * includes a block with this label.\n */\nexport const DEFAULT_ROOT_MEMORY_BLOCK: CreateAgentMemoryBlock = {\n label: \"MEMORY\",\n value: \"# Memory\\n\",\n description: \"Root memory index.\",\n};\n\nexport interface BuildCreateAgentRequestOptions {\n personalityId?: PersonalityId;\n name?: string;\n description?: string;\n /** Model ID or handle. Personality default, then catalog default, applies. */\n model?: string;\n /** Complete prompt override. Null delegates default selection to the server. */\n system?: string | null;\n /** Whether the target is Letta Cloud; callers determine this with their backend's cloud detection. */\n isLettaCloud?: boolean;\n memoryPromptMode?: MemoryPromptMode;\n /**\n * Caller-defined identity. With a personality, matching labels replace its\n * blocks and new labels append after the personality blocks.\n */\n memoryBlocks?: CreateAgentMemoryBlock[];\n blockIds?: string[];\n /** Extra tags appended after canonical Letta Code and personality tags. */\n extraTags?: string[];\n enableMemfs?: boolean;\n isSubagent?: boolean;\n /** Exact server-side tools. Omission uses the Letta Code web-tool defaults. */\n baseTools?: string[];\n embedding?: string;\n hidden?: boolean;\n parallelToolCalls?: boolean;\n compactionModel?: string;\n}\n\nexport interface CreateAgentRequest {\n agent_type: typeof LETTA_CODE_AGENT_TYPE;\n name?: string;\n description?: string;\n model: string;\n system: string | null;\n memory_blocks?: CreateAgentMemoryBlock[];\n block_ids?: string[];\n tags: string[];\n tools: string[];\n include_base_tools: false;\n include_base_tool_rules: false;\n initial_message_sequence: never[];\n parallel_tool_calls: boolean;\n compaction_settings: { model: string };\n embedding?: string;\n hidden?: boolean;\n}\n\nexport type CreateAgentRequestForPersonality = CreateAgentRequest & {\n name: string;\n description: string;\n memory_blocks: CreateAgentMemoryBlock[];\n profile_picture?: {\n content: string;\n };\n};\n\nfunction mergeMemoryBlocks(\n base: CreateAgentMemoryBlock[],\n overrides: CreateAgentMemoryBlock[] | undefined,\n): CreateAgentMemoryBlock[] {\n const blocks = base.map((block) => ({ ...block }));\n for (const override of overrides ?? []) {\n const index = blocks.findIndex((block) => block.label === override.label);\n if (index >= 0) {\n blocks[index] = { ...override };\n } else {\n blocks.push({ ...override });\n }\n }\n return blocks;\n}\n\nfunction ensureRootMemoryBlock(\n blocks: CreateAgentMemoryBlock[],\n): CreateAgentMemoryBlock[] {\n return blocks.some((block) => block.label === DEFAULT_ROOT_MEMORY_BLOCK.label)\n ? blocks\n : [{ ...DEFAULT_ROOT_MEMORY_BLOCK }, ...blocks];\n}\n\n/** Build the canonical Core create-agent request for a Letta Code agent. */\nexport async function buildCreateAgentRequest(\n options: BuildCreateAgentRequestOptions = {},\n): Promise<CreateAgentRequest> {\n const personality = options.personalityId\n ? getPersonalityOption(options.personalityId)\n : undefined;\n const modelIdentifier = options.model ?? personality?.defaultModel;\n const modelHandle = modelIdentifier\n ? resolveModel(modelIdentifier)\n : getDefaultModel();\n if (!modelHandle) {\n throw new Error(`Unknown model: ${modelIdentifier}`);\n }\n\n if (\n !options.isSubagent &&\n options.enableMemfs !== undefined &&\n options.memoryPromptMode !== undefined &&\n options.enableMemfs !== (options.memoryPromptMode !== \"standard\")\n ) {\n throw new Error(\n \"enableMemfs and memoryPromptMode must describe the same memory mode\",\n );\n }\n const enableMemfs = options.isSubagent\n ? false\n : (options.enableMemfs ?? options.memoryPromptMode !== \"standard\");\n const memoryPromptMode = options.isSubagent\n ? \"standard\"\n : (options.memoryPromptMode ?? (enableMemfs ? \"root-memfs\" : \"standard\"));\n const personalityTags = options.personalityId\n ? getPersonalityCreationTags(options.personalityId)\n : [];\n const personalityBlocks = options.personalityId\n ? buildPersonalityMemoryBlocks(\n options.personalityId,\n await getDefaultMemoryBlocks(),\n )\n : [];\n const hasSuppliedMemoryBlocks =\n options.personalityId !== undefined || options.memoryBlocks !== undefined;\n const suppliedMemoryBlocks = hasSuppliedMemoryBlocks\n ? mergeMemoryBlocks(personalityBlocks, options.memoryBlocks)\n : [];\n // Root-layout agents must send the MEMORY block so the server seeds a\n // MemFS v2 repository; without it the initial repo uses the legacy\n // system/ layout even when the prompt mode says otherwise.\n const memoryBlocks = options.isSubagent\n ? undefined\n : memoryPromptMode === \"root-memfs\"\n ? ensureRootMemoryBlock(suppliedMemoryBlocks)\n : hasSuppliedMemoryBlocks\n ? suppliedMemoryBlocks\n : undefined;\n const blockIds = options.isSubagent ? undefined : options.blockIds;\n\n return {\n agent_type: LETTA_CODE_AGENT_TYPE,\n ...(options.name !== undefined || personality\n ? { name: options.name ?? personality?.label }\n : {}),\n ...(options.description !== undefined || personality\n ? { description: options.description ?? personality?.description }\n : {}),\n model: modelHandle,\n system:\n options.system !== undefined\n ? options.system\n : options.isLettaCloud\n ? null\n : buildSystemPrompt(\"default\", memoryPromptMode),\n ...(memoryBlocks !== undefined ? { memory_blocks: memoryBlocks } : {}),\n ...(blockIds && blockIds.length > 0 ? { block_ids: blockIds } : {}),\n tags: buildCreatedAgentTags({\n enableMemfs,\n isSubagent: options.isSubagent,\n tags: [...personalityTags, ...(options.extraTags ?? [])],\n }),\n tools: [...(options.baseTools ?? DEFAULT_CREATED_AGENT_BASE_TOOLS)],\n include_base_tools: false,\n include_base_tool_rules: false,\n initial_message_sequence: [],\n parallel_tool_calls: options.parallelToolCalls ?? true,\n compaction_settings: {\n model: options.compactionModel ?? DEFAULT_SUMMARIZATION_MODEL,\n },\n ...(options.embedding !== undefined\n ? { embedding: options.embedding }\n : {}),\n ...(options.isSubagent\n ? { hidden: true }\n : options.hidden !== undefined\n ? { hidden: options.hidden }\n : {}),\n };\n}\n\n/** Compatibility wrapper for callers that create a personality agent. */\nexport async function buildCreateAgentRequestForPersonality(params: {\n personalityId: PersonalityId;\n name?: string;\n description?: string;\n model?: string;\n extraTags?: string[];\n /** This browser-safe wrapper defaults to Cloud; pass false for a local server. */\n isLettaCloud?: boolean;\n}): Promise<CreateAgentRequestForPersonality> {\n const request = (await buildCreateAgentRequest({\n ...params,\n isLettaCloud: params.isLettaCloud ?? true,\n })) as CreateAgentRequestForPersonality;\n const profilePicture = getPersonalityDefaultMemoryFiles(\n params.personalityId,\n ).find((file) => file.path === \"profile.png\");\n if (!profilePicture) {\n return request;\n }\n const { getPersonalityAssetBase64 } = await import(\n \"./personality-asset-content\"\n );\n return {\n ...request,\n profile_picture: {\n content: await getPersonalityAssetBase64(profilePicture.assetId),\n },\n };\n}\n"
|
|
13
13
|
],
|
|
14
|
-
"mappings": ";;;;;AAQO,IAAM,wBAAwB;AAG9B,IAAM,wBAAwB;AAG9B,IAAM,0BAA0B;AAGhC,IAAM,yBAAyB;AAW/B,SAAS,qBAAqB,CACnC,UAAwC,CAAC,GAC/B;AAAA,EACV,MAAM,OAAO,CAAC,qBAAqB;AAAA,EACnC,IAAI,QAAQ,YAAY;AAAA,IACtB,KAAK,KAAK,uBAAuB;AAAA,EACnC;AAAA,EACA,IAAI,QAAQ,aAAa;AAAA,IACvB,KAAK,KAAK,sBAAsB;AAAA,EAClC;AAAA,EACA,IAAI,QAAQ,QAAQ,MAAM,QAAQ,QAAQ,IAAI,GAAG;AAAA,IAC/C,KAAK,KAAK,GAAG,QAAQ,IAAI;AAAA,EAC3B;AAAA,EACA,OAAO,MAAM,KAAK,IAAI,IAAI,IAAI,CAAC;AAAA;;AC7B1B,IAAM,8BAA8B;AA2BpC,IAAM,sBAAsB;AAC5B,IAAM,uBAAuB,IAAI;AACjC,IAAM,wBAAwB,KAAK;AAEnC,IAAM,mBAAmB;AACzB,IAAM,oBAAoB,IAAI;AAC9B,IAAM,qBAAqB,KAAK;AAoBhC,IAAM,+BAA+B,KAAK;;;ACjE1C,IAAM,yBAAyB,CAAC,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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CAAqC,CAAC,QAQd;AAAA,EAC5C,MAAM,UAAW,MAAM,wBAAwB;AAAA,OAC1C;AAAA,IACH,cAAc,OAAO,gBAAgB;AAAA,EACvC,CAAC;AAAA,EACD,MAAM,iBAAiB,iCACrB,OAAO,aACT,EAAE,KAAK,CAAC,SAAS,KAAK,SAAS,aAAa;AAAA,EAC5C,IAAI,CAAC,gBAAgB;AAAA,IACnB,OAAO;AAAA,EACT;AAAA,EACA,QAAQ,8BAA8B,MACpC;AAAA,EAEF,OAAO;AAAA,OACF;AAAA,IACH,iBAAiB;AAAA,MACf,SAAS,MAAM,0BAA0B,eAAe,OAAO;AAAA,IACjE;AAAA,EACF;AAAA;",
|
|
15
|
+
"debugId": "BCA29C77D11CBDBB64756E2164756E21",
|
|
16
16
|
"names": []
|
|
17
17
|
}
|
package/dist/channels-slack.js
CHANGED
|
@@ -11,6 +11,21 @@ function asRecord(value) {
|
|
|
11
11
|
function isNonEmptyString(value) {
|
|
12
12
|
return typeof value === "string" && value.trim().length > 0;
|
|
13
13
|
}
|
|
14
|
+
function parseSlackMessages(value) {
|
|
15
|
+
const page = asRecord(value);
|
|
16
|
+
if (!page || !Array.isArray(page.messages))
|
|
17
|
+
return [];
|
|
18
|
+
return page.messages.map((entry) => {
|
|
19
|
+
const message = asRecord(entry);
|
|
20
|
+
if (!message || !isNonEmptyString(message.ts))
|
|
21
|
+
return null;
|
|
22
|
+
return {
|
|
23
|
+
ts: message.ts,
|
|
24
|
+
files: Array.isArray(message.files) ? message.files : undefined,
|
|
25
|
+
attachments: Array.isArray(message.attachments) ? message.attachments : undefined
|
|
26
|
+
};
|
|
27
|
+
}).filter((entry) => Boolean(entry));
|
|
28
|
+
}
|
|
14
29
|
function normalizeSlackFileLike(value) {
|
|
15
30
|
const record = asRecord(value);
|
|
16
31
|
if (!record)
|
|
@@ -64,36 +79,27 @@ function collectSlackFiles(rawEvent) {
|
|
|
64
79
|
}
|
|
65
80
|
return Array.from(deduped.values()).slice(0, MAX_SLACK_ATTACHMENTS);
|
|
66
81
|
}
|
|
67
|
-
function nextCursor(page) {
|
|
68
|
-
const value = page.response_metadata?.next_cursor;
|
|
69
|
-
return isNonEmptyString(value) ? value.trim() : undefined;
|
|
70
|
-
}
|
|
71
82
|
async function resolveSlackMessageFiles(params) {
|
|
72
83
|
if (isNonEmptyString(params.threadTs)) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
cursor = nextCursor(page2);
|
|
86
|
-
} while (cursor);
|
|
87
|
-
return null;
|
|
88
|
-
}
|
|
89
|
-
const page = await params.client.conversations.history({
|
|
84
|
+
const messages2 = parseSlackMessages(await params.client.conversations.replies({
|
|
85
|
+
channel: params.channelId,
|
|
86
|
+
ts: params.threadTs,
|
|
87
|
+
oldest: params.messageTs,
|
|
88
|
+
latest: params.messageTs,
|
|
89
|
+
inclusive: true,
|
|
90
|
+
limit: 1
|
|
91
|
+
}));
|
|
92
|
+
const message2 = messages2.find((entry) => entry.ts === params.messageTs);
|
|
93
|
+
return message2 ? collectSlackFiles(message2) : null;
|
|
94
|
+
}
|
|
95
|
+
const messages = parseSlackMessages(await params.client.conversations.history({
|
|
90
96
|
channel: params.channelId,
|
|
91
97
|
oldest: params.messageTs,
|
|
92
98
|
latest: params.messageTs,
|
|
93
99
|
inclusive: true,
|
|
94
100
|
limit: 1
|
|
95
|
-
});
|
|
96
|
-
const message =
|
|
101
|
+
}));
|
|
102
|
+
const message = messages.find((entry) => entry.ts === params.messageTs);
|
|
97
103
|
return message ? collectSlackFiles(message) : null;
|
|
98
104
|
}
|
|
99
105
|
function isAllowedSlackHostname(hostname) {
|
|
@@ -1775,4 +1781,4 @@ export {
|
|
|
1775
1781
|
SLACK_ASSISTANT_STARTUP_STATUS
|
|
1776
1782
|
};
|
|
1777
1783
|
|
|
1778
|
-
//# debugId=
|
|
1784
|
+
//# debugId=FA83CF442835DF1664756E2164756E21
|