@letta-ai/letta-code 0.33.8 → 0.34.0
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/agent-presets.js +2 -2
- package/dist/agent-presets.js.map +1 -1
- package/dist/ask-user-question.cjs +128 -0
- package/dist/ask-user-question.cjs.map +10 -0
- package/dist/ask-user-question.js +88 -0
- package/dist/ask-user-question.js.map +10 -0
- package/dist/gateway-core.js +6 -20
- package/dist/gateway-core.js.map +5 -6
- package/dist/mcp-client.js +2 -2
- package/dist/mcp-client.js.map +1 -1
- package/dist/mcp-oauth.js +2 -2
- package/dist/mcp-oauth.js.map +1 -1
- package/dist/types/agent/client-skills.d.ts.map +1 -1
- package/dist/types/agent/skills.d.ts +0 -5
- package/dist/types/agent/skills.d.ts.map +1 -1
- package/dist/types/agent-settings.d.ts +23 -0
- package/dist/types/agent-settings.d.ts.map +1 -0
- package/dist/types/ask-user-question.d.ts +31 -0
- package/dist/types/ask-user-question.d.ts.map +1 -0
- package/dist/types/channels/gateway-core.d.ts.map +1 -1
- package/dist/types/channels/message-channel-formatting.d.ts.map +1 -1
- package/dist/types/cli/helpers/tool-name-mapping.d.ts +0 -8
- package/dist/types/cli/helpers/tool-name-mapping.d.ts.map +1 -1
- package/dist/types/permissions/checker.d.ts.map +1 -1
- package/dist/types/settings-manager.d.ts +5 -14
- package/dist/types/settings-manager.d.ts.map +1 -1
- package/dist/types/telemetry/error-reporting.d.ts +8 -0
- package/dist/types/telemetry/error-reporting.d.ts.map +1 -1
- package/dist/types/telemetry/index.d.ts +2 -7
- package/dist/types/telemetry/index.d.ts.map +1 -1
- package/dist/types/tools/client-preferences.d.ts +8 -0
- package/dist/types/tools/client-preferences.d.ts.map +1 -0
- package/dist/types/tools/impl/ask-user-question.d.ts +6 -18
- package/dist/types/tools/impl/ask-user-question.d.ts.map +1 -1
- package/dist/types/tools/impl/monitor.d.ts +0 -1
- package/dist/types/tools/impl/monitor.d.ts.map +1 -1
- package/dist/types/tools/impl/watch-pr.d.ts.map +1 -1
- package/dist/types/tools/manager.d.ts.map +1 -1
- package/dist/types/tools/tool-definitions.d.ts +1 -1
- package/dist/types/tools/toolset-catalog.d.ts +1 -1
- package/dist/types/tools/toolset-catalog.d.ts.map +1 -1
- package/dist/types/tools/toolset.d.ts.map +1 -1
- package/dist/types/types/client-preferences.d.ts +7 -0
- package/dist/types/types/client-preferences.d.ts.map +1 -0
- package/dist/types/types/protocol_v2.d.ts +4 -7
- package/dist/types/types/protocol_v2.d.ts.map +1 -1
- package/dist/types/types/teleport-protocol.d.ts +3 -0
- package/dist/types/types/teleport-protocol.d.ts.map +1 -1
- package/dist/types/utils/task-notifications.d.ts +0 -1
- package/dist/types/utils/task-notifications.d.ts.map +1 -1
- package/dist/types/websocket/listener/protocol-outbound.d.ts.map +1 -1
- package/dist/types/websocket/listener/queue.d.ts.map +1 -1
- package/dist/types/websocket/listener/runtime.d.ts.map +1 -1
- package/dist/types/websocket/listener/types.d.ts +1 -9
- package/dist/types/websocket/listener/types.d.ts.map +1 -1
- package/image-resize-worker.js +2 -6449
- package/letta.js +41025 -41253
- package/package.json +16 -2
- package/scripts/isolated-unit-tests.json +10 -0
- package/scripts/smoke-image-worker.mjs +68 -0
- package/scripts/source-file-size-baseline.json +13 -13
- package/scripts/stage-pypi-deps.mjs +1 -11
- package/scripts/unit-test-impact.test.cjs +2 -1
- package/skills/curating-memory-palace/SKILL.md +102 -60
- package/skills/initializing-memory/SKILL.md +1 -1
- package/dist/types/tools/interactive-policy.d.ts +0 -12
- package/dist/types/tools/interactive-policy.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@letta-ai/letta-code",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.0",
|
|
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",
|
|
@@ -33,6 +33,10 @@
|
|
|
33
33
|
"dist/agent-presets.js.map",
|
|
34
34
|
"dist/schedules.js",
|
|
35
35
|
"dist/schedules.js.map",
|
|
36
|
+
"dist/ask-user-question.js",
|
|
37
|
+
"dist/ask-user-question.js.map",
|
|
38
|
+
"dist/ask-user-question.cjs",
|
|
39
|
+
"dist/ask-user-question.cjs.map",
|
|
36
40
|
"dist/channels-public.js",
|
|
37
41
|
"dist/channels-public.js.map",
|
|
38
42
|
"dist/gateway-core.js",
|
|
@@ -48,6 +52,13 @@
|
|
|
48
52
|
],
|
|
49
53
|
"exports": {
|
|
50
54
|
".": "./letta.js",
|
|
55
|
+
"./ask-user-question": {
|
|
56
|
+
"types": "./dist/types/ask-user-question.d.ts",
|
|
57
|
+
"browser": "./dist/ask-user-question.js",
|
|
58
|
+
"import": "./dist/ask-user-question.js",
|
|
59
|
+
"require": "./dist/ask-user-question.cjs",
|
|
60
|
+
"default": "./dist/ask-user-question.js"
|
|
61
|
+
},
|
|
51
62
|
"./app-server-protocol": {
|
|
52
63
|
"types": "./dist/types/types/app-server-protocol.d.ts"
|
|
53
64
|
},
|
|
@@ -139,7 +150,7 @@
|
|
|
139
150
|
"dependencies": {
|
|
140
151
|
"@earendil-works/pi-ai": "^0.87.1",
|
|
141
152
|
"@janhapke/sharp-electron": "0.35.3-electron.1",
|
|
142
|
-
"@letta-ai/letta-agent-sdk": "0.8.
|
|
153
|
+
"@letta-ai/letta-agent-sdk": "0.8.24",
|
|
143
154
|
"@letta-ai/letta-client": "^1.10.2",
|
|
144
155
|
"@letta-ai/trajectory": "0.2.0",
|
|
145
156
|
"@modelcontextprotocol/sdk": "1.30.0",
|
|
@@ -214,6 +225,9 @@
|
|
|
214
225
|
},
|
|
215
226
|
"typesVersions": {
|
|
216
227
|
"*": {
|
|
228
|
+
"ask-user-question": [
|
|
229
|
+
"./dist/types/ask-user-question.d.ts"
|
|
230
|
+
],
|
|
217
231
|
"agent-presets": [
|
|
218
232
|
"./dist/types/agent-presets.d.ts"
|
|
219
233
|
],
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"tests": [
|
|
3
|
+
{
|
|
4
|
+
"path": "src/websocket/ask-user-question-async.test.ts",
|
|
5
|
+
"timeoutMs": 30000,
|
|
6
|
+
"reason": "Runs a real local App Server with isolated HOME, settings, backend, and WebSocket clients to verify nonblocking questions and later responses."
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"path": "src/websocket/listener/ask-user-question-turn.test.ts",
|
|
10
|
+
"timeoutMs": 30000,
|
|
11
|
+
"reason": "Checks per-input question tool opt-in with process-global backend, settings, and environment isolation."
|
|
12
|
+
},
|
|
3
13
|
{
|
|
4
14
|
"path": "src/websocket/listener/turn-cleanup-memory-update.e2e.test.ts",
|
|
5
15
|
"timeoutMs": 30000,
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// Exercise the published Node worker with a newer Sharp installation in an
|
|
2
|
+
// ancestor directory. Sharp's JS and native binding must come from the same
|
|
3
|
+
// installed package, rather than mixing bundled JS with a runtime binding.
|
|
4
|
+
import assert from "node:assert/strict";
|
|
5
|
+
import { spawnSync } from "node:child_process";
|
|
6
|
+
import { copyFileSync, mkdtempSync, rmSync } from "node:fs";
|
|
7
|
+
import { createRequire } from "node:module";
|
|
8
|
+
import { tmpdir } from "node:os";
|
|
9
|
+
import { join } from "node:path";
|
|
10
|
+
|
|
11
|
+
const root = mkdtempSync(join(tmpdir(), "letta-image-worker-smoke-"));
|
|
12
|
+
try {
|
|
13
|
+
const install = spawnSync(
|
|
14
|
+
process.platform === "win32" ? "npm.cmd" : "npm",
|
|
15
|
+
[
|
|
16
|
+
"install",
|
|
17
|
+
"--prefix",
|
|
18
|
+
root,
|
|
19
|
+
"--no-save",
|
|
20
|
+
"--ignore-scripts",
|
|
21
|
+
"--no-audit",
|
|
22
|
+
"--no-fund",
|
|
23
|
+
"sharp@0.35.3",
|
|
24
|
+
],
|
|
25
|
+
{ encoding: "utf8" },
|
|
26
|
+
);
|
|
27
|
+
assert.equal(install.status, 0, install.stderr || install.error?.message);
|
|
28
|
+
|
|
29
|
+
const worker = join(root, "image-resize-worker.mjs");
|
|
30
|
+
copyFileSync(
|
|
31
|
+
process.argv[2] ?? new URL("../image-resize-worker.js", import.meta.url),
|
|
32
|
+
worker,
|
|
33
|
+
);
|
|
34
|
+
const require = createRequire(worker);
|
|
35
|
+
const sharp = require("sharp");
|
|
36
|
+
assert.equal(sharp.versions.sharp, "0.35.3");
|
|
37
|
+
const png = await sharp({
|
|
38
|
+
create: {
|
|
39
|
+
width: 2,
|
|
40
|
+
height: 3,
|
|
41
|
+
channels: 3,
|
|
42
|
+
background: { r: 70, g: 100, b: 130 },
|
|
43
|
+
},
|
|
44
|
+
})
|
|
45
|
+
.png()
|
|
46
|
+
.toBuffer();
|
|
47
|
+
const jpeg = await sharp(png).jpeg().toBuffer();
|
|
48
|
+
|
|
49
|
+
for (const [mediaType, image] of [
|
|
50
|
+
["image/png", png],
|
|
51
|
+
["image/jpeg", jpeg],
|
|
52
|
+
]) {
|
|
53
|
+
const result = spawnSync(process.execPath, [worker, mediaType], {
|
|
54
|
+
input: image,
|
|
55
|
+
encoding: "utf8",
|
|
56
|
+
});
|
|
57
|
+
assert.equal(result.status, 0, result.stderr || result.error?.message);
|
|
58
|
+
const decoded = JSON.parse(result.stdout);
|
|
59
|
+
assert.equal(decoded.mediaType, mediaType);
|
|
60
|
+
assert.equal(decoded.width, 2);
|
|
61
|
+
assert.equal(decoded.height, 3);
|
|
62
|
+
assert.deepEqual(Buffer.from(decoded.data, "base64"), image);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
console.log("Published image worker decoded PNG and JPEG with Sharp 0.35.3");
|
|
66
|
+
} finally {
|
|
67
|
+
rmSync(root, { recursive: true, force: true });
|
|
68
|
+
}
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
"src/backend/local-backend.test.ts": 2472,
|
|
5
5
|
"src/backend/local/local-store.ts": 3267,
|
|
6
6
|
"src/backend/pi-stream-adapter.test.ts": 1255,
|
|
7
|
-
"src/cli/app/AppCoordinator.tsx":
|
|
8
|
-
"src/cli/app/AppView.tsx":
|
|
9
|
-
"src/cli/app/use-approval-flow.ts":
|
|
7
|
+
"src/cli/app/AppCoordinator.tsx": 5101,
|
|
8
|
+
"src/cli/app/AppView.tsx": 1729,
|
|
9
|
+
"src/cli/app/use-approval-flow.ts": 1071,
|
|
10
10
|
"src/cli/app/use-configuration-handlers.ts": 1417,
|
|
11
|
-
"src/cli/app/use-conversation-loop.ts":
|
|
12
|
-
"src/cli/app/use-submit-handler.ts":
|
|
11
|
+
"src/cli/app/use-conversation-loop.ts": 2860,
|
|
12
|
+
"src/cli/app/use-submit-handler.ts": 3801,
|
|
13
13
|
"src/cli/components/AgentSelector.tsx": 1104,
|
|
14
14
|
"src/cli/components/InputRich.tsx": 2116,
|
|
15
15
|
"src/cli/components/ModelSelector.tsx": 1259,
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"src/cli/mods/local-mod-loader.test.ts": 1043,
|
|
20
20
|
"src/cli/reflection-transcript.test.ts": 1084,
|
|
21
21
|
"src/cli/subcommands/skills.ts": 1264,
|
|
22
|
-
"src/headless.ts":
|
|
22
|
+
"src/headless.ts": 4780,
|
|
23
23
|
"src/hooks/integration.test.ts": 1147,
|
|
24
|
-
"src/index.ts":
|
|
24
|
+
"src/index.ts": 2577,
|
|
25
25
|
"src/mods/learning-harness.ts": 2434,
|
|
26
26
|
"src/mods/mod-engine.test.ts": 2153,
|
|
27
27
|
"src/mods/mod-engine.ts": 1838,
|
|
@@ -32,13 +32,13 @@
|
|
|
32
32
|
"src/permissions/read-only-shell.ts": 1969,
|
|
33
33
|
"src/providers/chatgpt-usage-service.ts": 1112,
|
|
34
34
|
"src/settings-manager.test.ts": 1635,
|
|
35
|
-
"src/settings-manager.ts":
|
|
36
|
-
"src/tools/manager.ts":
|
|
35
|
+
"src/settings-manager.ts": 2092,
|
|
36
|
+
"src/tools/manager.ts": 2647,
|
|
37
37
|
"src/tools/tool-execution-context.test.ts": 1092,
|
|
38
|
-
"src/types/protocol_v2.ts":
|
|
39
|
-
"src/websocket/listen-client-concurrency.test.ts":
|
|
40
|
-
"src/websocket/listen-client-protocol.test.ts":
|
|
38
|
+
"src/types/protocol_v2.ts": 2548,
|
|
39
|
+
"src/websocket/listen-client-concurrency.test.ts": 2557,
|
|
40
|
+
"src/websocket/listen-client-protocol.test.ts": 5707,
|
|
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":
|
|
43
|
+
"src/websocket/listener/protocol-inbound.ts": 2062
|
|
44
44
|
}
|
|
@@ -22,6 +22,7 @@ const roots = [
|
|
|
22
22
|
"grammy",
|
|
23
23
|
"@pierre/diffs",
|
|
24
24
|
"@shikijs/langs",
|
|
25
|
+
"sharp",
|
|
25
26
|
];
|
|
26
27
|
|
|
27
28
|
function locate(name, from) {
|
|
@@ -69,17 +70,6 @@ function copy(name, from, dest, ancestors = new Set()) {
|
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
72
|
for (const name of roots) copy(name, root, app);
|
|
72
|
-
// Bun bundles Sharp JS but leaves its computed @img native requires unresolved.
|
|
73
|
-
const sharp = locate("sharp", root);
|
|
74
|
-
const sharpPackage = JSON.parse(readFileSync(join(sharp, "package.json")));
|
|
75
|
-
for (const name of Object.keys(sharpPackage.optionalDependencies || {})) {
|
|
76
|
-
try {
|
|
77
|
-
locate(name, sharp);
|
|
78
|
-
} catch {
|
|
79
|
-
continue;
|
|
80
|
-
}
|
|
81
|
-
copy(name, sharp, app);
|
|
82
|
-
}
|
|
83
73
|
|
|
84
74
|
// Retain license notices for code in the JS bundle as well as external modules.
|
|
85
75
|
function licenses(dir, destination) {
|
|
@@ -323,7 +323,7 @@ describe("current repository impact graph", () => {
|
|
|
323
323
|
|
|
324
324
|
test("a direct channel dependency still selects channel tests", () => {
|
|
325
325
|
const result = planUnitTests({
|
|
326
|
-
changedFiles: [{ status: "M", path: "src/
|
|
326
|
+
changedFiles: [{ status: "M", path: "src/permissions/mode.ts" }],
|
|
327
327
|
allTestFiles: [
|
|
328
328
|
"src/channels/gateway-core.test.ts",
|
|
329
329
|
"src/tools/client-toolset.test.ts",
|
|
@@ -331,6 +331,7 @@ describe("current repository impact graph", () => {
|
|
|
331
331
|
impactIndex,
|
|
332
332
|
});
|
|
333
333
|
|
|
334
|
+
expect(result.mode).toBe("selected");
|
|
334
335
|
expect(result.selectedTests).toContain("src/channels/gateway-core.test.ts");
|
|
335
336
|
});
|
|
336
337
|
|
|
@@ -1,105 +1,147 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: curating-memory-palace
|
|
3
|
-
description:
|
|
3
|
+
description: Rules for the Memory Palace (palace/), the view on your Memory page in the Letta dashboard that shows the user where things stand, what you could do next, and how to make you more useful. Load it before creating or editing anything in palace/, when a message starts with "Palace action:" or "Palace reply on", and, when palace/ exists, whenever you notice a blocker, a decision for the user, work you could offer, or a routine that started, broke, or changed.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Curating the Memory Palace
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
The Memory Palace is the page a user opens to understand you. Someone who has not looked in a week should know within 30 seconds:
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
1. **Where things stand:** what you are working on, which routines are running or broken, and what changed recently.
|
|
11
|
+
2. **What you could do next, and why:** work you noticed you can take on or pick back up.
|
|
12
|
+
3. **How to make you better or more independent:** one click to unblock you, fill a gap, or let you handle something on your own from now on.
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
The user acts on it with buttons and replies. It is not a log, a transcript recap, or a page about the Palace itself.
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
You can update the Palace yourself, in a conversation or during reflection, or an update can run on a schedule. Either works, and both follow these rules. "You" always means the agent that owns the Palace.
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+
## Sections
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
- **During reflection:** check the Palace against what happened. Add new items, update changed ones, and remove items that are done, stale, or dismissed.
|
|
20
|
-
- **When the user asks** to set up or update the Palace: set up means build a first Palace from what you already know; update means bring every section current.
|
|
21
|
-
- **After a Palace action or reply:** update the section it came from.
|
|
20
|
+
Every Palace starts with these three sections, in this order:
|
|
22
21
|
|
|
23
|
-
|
|
22
|
+
1. **Overview** (`overview.md`): a snapshot, not a to-do list. What you are working on now; each standing routine (schedules, digests, checks) and whether it is running or broken; one line on what changed since the last update.
|
|
23
|
+
2. **Needs Attention** (`needs-attention.md`): decisions and blockers waiting on the user. Every item has a button. If nothing waits on the user, say so in one line, such as "Nothing needs you right now."
|
|
24
|
+
3. **Suggestions** (`suggestions.md`): work you noticed you can do, including unfinished work to resume and routines you could take over. Each item says what prompted it, with a date, and has a button.
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
Add up to three more sections only when they hold something the first three cannot, such as "Recently Learned". Merge or remove sections that overlap. At most six sections and three items per section. Keep the first three even when one has nothing to show, and say so in one line; delete an extra section, and its index line, when it is empty.
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
## Buttons
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
- The section title comes from the file name: `needs-attention.md` shows as "Needs Attention". Pick file names that read well as titles, and keep `name` the same as the title.
|
|
31
|
-
- Frontmatter holds exactly `name` and `description`, like every memory file. MemFS rejects any other key. The description shows under the title, so write it as the section's purpose in one short line.
|
|
32
|
-
- The body is Markdown. The date beside the title is the file's last commit.
|
|
30
|
+
A button sends its instruction to you, so offer only what you can do. Each button is one of three kinds:
|
|
33
31
|
|
|
34
|
-
|
|
32
|
+
- **Do it now:** a one-off task, such as reviewing a PR, or a standing rule you record once when the user keeps approving the same kind of decision.
|
|
33
|
+
- **Schedule:** recurring work you run without being asked, such as a weekly report or a daily check. The instruction asks you to set up the schedule. See "Offering a schedule".
|
|
34
|
+
- **Fill a gap:** something you lack, such as a tool to connect, access or a permission to grant, or a question only the user can answer.
|
|
35
|
+
|
|
36
|
+
Every blocker gets a button. When an item is a decision with real options, give each option its own button, two or three at most, so the user picks one: for example "Make it a ticket", "Assign it to Charles", and "Close it". Otherwise give the item one strong button, not several weak ones. The kinds are only for choosing buttons. Never write a kind's name, or any other caption, above a button.
|
|
37
|
+
|
|
38
|
+
When only the user can fix something (raise a quota, attach a tool, log in), the item says what the user needs to do, and the button is still something you can do, such as "Walk me through fixing this" or "I fixed it, check again". For the second, re-run the failing check and clear the item if it passes.
|
|
39
|
+
|
|
40
|
+
Offer the most reliable fix first, which usually means moving the work to Cloud. Anything that depends on the user's computer, such as a local schedule or a sign-in that lives on one machine, stops whenever that computer sleeps or Letta Code is closed. Offer to run the schedule in Cloud and to connect the account there before asking the user to keep a computer on. Suggest a fix on the user's computer only when Cloud cannot do the job, and say why.
|
|
41
|
+
|
|
42
|
+
The headline says what is going on; the button says what to do. Never repeat the button's label in the headline, and do not end the text with a "Next: ..." sentence that restates the button. Write the headline "**Grok CLI regression may still be live.**" with the button "Verify the Grok CLI regression", not the headline "**Verify the Grok CLI regression.**"
|
|
43
|
+
|
|
44
|
+
### Offering a schedule
|
|
45
|
+
|
|
46
|
+
Offer a Schedule button when the evidence shows recurring work: the user asked for the same thing on three or more days or said they want it regularly, you did the same manual check on three or more days, a deadline repeats, or something slipped that a regular check would have caught. If a routine you already run is broken, offer to fix it instead of adding another.
|
|
47
|
+
|
|
48
|
+
Do not offer one for one-off work, for work that reports when it finishes (such as CI or a deploy), for anything more often than hourly, for work that needs the user during the run, or for anything on the Dismissed list. Offer at most two at a time.
|
|
49
|
+
|
|
50
|
+
The label names the work and when it runs, with a time zone. The instruction asks you to set it up and says what to do, when, where to send results, and when to stay quiet. Set it up in Cloud unless the work truly needs one of the user's computers, record it in memory, and tell the user where it runs.
|
|
51
|
+
|
|
52
|
+
### Button format
|
|
53
|
+
|
|
54
|
+
A fenced code block with the language `palace-action` becomes a button. It holds one strict JSON object and nothing else. Put it directly under its item. A Suggestions item with a Schedule button:
|
|
35
55
|
|
|
36
56
|
````markdown
|
|
37
|
-
|
|
38
|
-
name: Needs Attention
|
|
39
|
-
description: Decisions and follow-ups that need the user.
|
|
40
|
-
---
|
|
41
|
-
**The staging deploy is blocked on a secret.** `SLACK_SIGNING_SECRET` is not in 1Password yet, so the Atlantis plan fails.
|
|
57
|
+
**The dependency report is still manual.** You asked for it on Sep 15, Sep 22, and Sep 29.
|
|
42
58
|
|
|
43
59
|
```palace-action
|
|
44
|
-
{"actionId": "
|
|
60
|
+
{"actionId": "schedule-dep-report", "label": "Send the dependency report Mondays at 9am PT", "conversationId": "new", "instruction": "Set up a Cloud schedule for Mondays at 9am PT: run the dependency report, post it to #eng-deps, and skip weeks with no changes. Record it in memory and tell me where it runs."}
|
|
45
61
|
```
|
|
46
62
|
````
|
|
47
63
|
|
|
48
|
-
|
|
64
|
+
- `actionId` (required): 1 to 64 characters, no spaces, unique within the section.
|
|
65
|
+
- `label` (required): the button text, up to 80 characters. Start it with a verb; a confirmation such as "I fixed it, check again" is the one exception.
|
|
66
|
+
- `instruction` (optional): what you do when it is clicked. An instruction over 300 characters renders as an error; aim for under 200. Name the work, where to find it, and any limits, not every detail. Count the characters with a short script rather than estimating.
|
|
67
|
+
- `conversationId` (optional): one of your real conversation ids, or `new` for a fresh conversation. Leave it out to use the main chat.
|
|
49
68
|
|
|
50
|
-
|
|
69
|
+
Any other key, or invalid JSON, renders the block as an error instead of a button.
|
|
51
70
|
|
|
52
|
-
|
|
71
|
+
## Files
|
|
72
|
+
|
|
73
|
+
- Each Markdown file directly inside `palace/` is one section, except `palace/MEMORY.md`. Nested folders and other files are not shown, so do not create them.
|
|
74
|
+
- The title comes from the file name: `needs-attention.md` shows as "Needs Attention". Keep the frontmatter `name` equal to the title.
|
|
75
|
+
- Frontmatter holds exactly two non-empty keys, `name` and `description`. MemFS rejects any other key. The description shows under the title, so write it as the section's purpose in one short line.
|
|
76
|
+
- The body is Markdown. The date beside the title is the file's last commit, so leave a file untouched when nothing in it changed.
|
|
77
|
+
- The icon comes from the title: "attention" or "blocker" gives a flag, "overview" or "summary" a house, "learned" or "insight" a lightbulb, and "suggestions" or "next steps" a bolt. Most other titles get a note.
|
|
78
|
+
|
|
79
|
+
`palace/MEMORY.md` is the index. It has no frontmatter. It lists the sections in display order, one relative link per line; the first mention of a file sets its place, and unlisted sections follow in file-name order. Keep it in sync when you add, rename, or remove a section, and keep the Feedback and Dismissed lists below the links:
|
|
53
80
|
|
|
54
81
|
```markdown
|
|
55
82
|
# Memory Palace
|
|
56
83
|
|
|
57
|
-
|
|
84
|
+
- [Overview](overview.md) - Where things stand
|
|
85
|
+
- [Needs Attention](needs-attention.md) - Decisions and blockers waiting on you
|
|
86
|
+
- [Suggestions](suggestions.md) - Work I can do next, and why
|
|
58
87
|
|
|
59
|
-
|
|
60
|
-
- [Suggestions](suggestions.md) - Next steps worth taking
|
|
61
|
-
- [Recently Learned](recently-learned.md) - What changed in my understanding
|
|
62
|
-
- [Overview](overview.md) - Who I am and what I am working on
|
|
63
|
-
```
|
|
88
|
+
## Dismissed
|
|
64
89
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
Each section gets an icon picked from its title. Titles with "attention" or "blocker" get a flag, "overview" or "summary" a house, "learned" or "insight" a lightbulb, and "suggestions" or "next steps" a bolt. Other titles get a note icon.
|
|
90
|
+
- Summaries of every Slack thread (Sep 20)
|
|
91
|
+
```
|
|
68
92
|
|
|
69
|
-
|
|
93
|
+
Example `palace/needs-attention.md`:
|
|
70
94
|
|
|
71
|
-
|
|
95
|
+
````markdown
|
|
96
|
+
---
|
|
97
|
+
name: Needs Attention
|
|
98
|
+
description: Decisions and blockers waiting on you.
|
|
99
|
+
---
|
|
100
|
+
**The nightly eval run has failed since Sep 24.** The OpenAI key is over its monthly quota. Raise the limit in the OpenAI billing settings; I can't change billing.
|
|
72
101
|
|
|
73
102
|
```palace-action
|
|
74
|
-
{"actionId": "
|
|
103
|
+
{"actionId": "recheck-evals", "label": "I fixed it, check again", "instruction": "Re-run the eval smoke test. If it passes, clear this item; if not, say what still fails."}
|
|
75
104
|
```
|
|
105
|
+
````
|
|
106
|
+
|
|
107
|
+
## Writing rules
|
|
108
|
+
|
|
109
|
+
- Lead with the point. An item is a short bold headline plus one sentence, two at most; what you need to act goes in the button's instruction.
|
|
110
|
+
- Never paste a raw URL into the text. Name the thing and link the name, such as [LET-13139](https://linear.app/...), and never use a link as the headline.
|
|
111
|
+
- Write in your own voice to the user: "I" for you, "you" for the user.
|
|
112
|
+
- Write absolute dates, with a time zone when it matters, such as "Sep 25, 5pm PT". Never write "today" or "tomorrow": the Palace is read days later.
|
|
113
|
+
- Distinguish what the user said, what you infer, and what you propose. Do not present guesses as facts or proposals as work already underway.
|
|
114
|
+
- Make continuation offers concrete: name the unfinished work and the next step.
|
|
115
|
+
- Outside Needs Attention and Suggestions, add a button only for a specific, useful action. Every section has a Reply button, so a section can exist just to show understanding.
|
|
116
|
+
- Do not repeat an item in two sections.
|
|
117
|
+
- No transcript restatements, timelines, or logs of your own work.
|
|
118
|
+
- Never write secrets, tokens, keys, or credentials. The Palace is shown in the app and sent in messages.
|
|
76
119
|
|
|
77
|
-
|
|
78
|
-
- `label` (required): the button text, up to 80 characters. Start it with a verb.
|
|
79
|
-
- `instruction` (optional): what you should do when it is clicked, up to 300 characters.
|
|
80
|
-
- `conversationId` (optional): one of your conversation ids, or `new` for a fresh conversation. Leave it out to use the main chat.
|
|
120
|
+
## Signals from the user
|
|
81
121
|
|
|
82
|
-
|
|
122
|
+
The user's reactions to the Palace are the strongest evidence of what they want.
|
|
83
123
|
|
|
84
|
-
|
|
124
|
+
- A message that starts with "Palace reply on" is a reply to a section. Apply it. A dismissal ("drop this", "I don't care about X") means remove that item and add a short line to the Dismissed list.
|
|
125
|
+
- A message that starts with "Palace action:" means the user clicked a button. The work it started shows what the user values. Clear or update the item once that work is done.
|
|
126
|
+
- `palace/MEMORY.md` may have a "Feedback" list of notes the user left on sections. Apply each note, then remove it from the list.
|
|
127
|
+
- `palace/MEMORY.md` may have a "Dismissed" list. Do not bring back anything on it unless something important has changed. Create the list the first time you need it.
|
|
85
128
|
|
|
86
|
-
##
|
|
129
|
+
## Updating the whole Palace
|
|
87
130
|
|
|
88
|
-
|
|
131
|
+
For a scheduled update, a reflection, or when the user asks for one:
|
|
89
132
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
133
|
+
1. Read `palace/MEMORY.md` and every section first. If `palace/` does not exist, create it only when the user asked for a Palace or your instructions for this run say to.
|
|
134
|
+
2. Remove items that are done, no longer true, dismissed, or past a date with nothing left to do.
|
|
135
|
+
3. Add items the evidence supports and the user would want to see.
|
|
136
|
+
4. Edit sections in place and keep what is still true. Keep the first three sections first and in order.
|
|
137
|
+
5. Check each routine's latest runs when you can, not just what memory says. For schedules, find IDs with `letta cron list --agent <agent-id>` and inspect each with `letta cron runs --id <id> --agent <agent-id>`. Report their health in the Overview even when nothing changed.
|
|
138
|
+
6. Check every button against the format above before you save, counting each instruction's characters with a script.
|
|
93
139
|
|
|
94
|
-
|
|
140
|
+
## In a conversation
|
|
95
141
|
|
|
96
|
-
|
|
142
|
+
This section applies only while you are talking with the user.
|
|
97
143
|
|
|
98
|
-
-
|
|
99
|
-
-
|
|
100
|
-
-
|
|
101
|
-
-
|
|
102
|
-
- Make continuation offers concrete: name the unfinished work and the next step, not just "I can continue."
|
|
103
|
-
- Add a button only for a useful, specific action. Understanding or correcting your state can be the whole purpose of a section; Reply is enough.
|
|
104
|
-
- Never put secrets, tokens, or keys in the Palace. It is shown in the app and sent in messages.
|
|
105
|
-
- Don't repeat an item in two sections.
|
|
144
|
+
- **Keep it current as you work.** If `palace/` exists and you notice a blocker, a decision for the user, work you could do, or a routine that changed, update the right section. Mention it in the conversation too if it matters now. Skip things that only matter inside this conversation.
|
|
145
|
+
- **Set up or update.** When the user asks you to set up the Palace, build it from what you already know, starting with the three sections above. For an update, follow "Updating the whole Palace".
|
|
146
|
+
- **A clicked button.** The app opens the button's conversation and sends one message. A hidden system reminder in it names the action, the section's path, and the section's current content. Do what the label and instruction ask, in that conversation, then update the item. A schedule you set up leaves Suggestions and joins the routines in the Overview.
|
|
147
|
+
- **A reply.** The user's note comes with a hidden system reminder that holds the section's path and content. Apply it as described in "Signals from the user", answer any question in the conversation, and update the section if the answer changes it. Then reply briefly with what you changed.
|
|
@@ -94,7 +94,7 @@ Via the installed `@letta-ai/trajectory` package, reports every coding-agent ses
|
|
|
94
94
|
Infer rather than ask: `git shortlog -sn --all | head -5`, `git log --format="%an <%ae>" | sort -u | head -10`, cross-referenced with `git config user.email`.
|
|
95
95
|
|
|
96
96
|
### 4. Ask upfront questions
|
|
97
|
-
|
|
97
|
+
Ask one bundle of questions, using AskUserQuestion when available or an ordinary message otherwise: research depth (standard or deep); other repositories you should know about; communication style; and — only if Step 2 found sessions — whether to analyze them, naming the sources detected. Say that approving means read-only subagents will read those transcripts using `deepseek/deepseek-v4.1-flash` if available, otherwise your current model, so the choice is informed. Don't ask what you can discover from files, git, or history. Wait for the user's reply; a completed question tool call is not approval.
|
|
98
98
|
|
|
99
99
|
### 5. Export and cohort the approved history
|
|
100
100
|
Only if the user approved in Step 4. Skip entirely otherwise; Step 6 still runs. These sessions are evidence of what happened, not proof of who wrote each prompt.
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export type InteractiveApprovalKind = "ask_user_question";
|
|
2
|
-
/**
|
|
3
|
-
* Tools that prompt the human for input mid-turn, as toolset names. Headless
|
|
4
|
-
* clients (SDK sessions, automation) can exclude these from the turn's
|
|
5
|
-
* toolset via `exclude_interactive_tools` on create_message payloads.
|
|
6
|
-
*/
|
|
7
|
-
export declare const INTERACTIVE_USER_INPUT_TOOL_NAMES: readonly ["AskUserQuestion"];
|
|
8
|
-
export declare function isInteractiveApprovalTool(toolName: string): boolean;
|
|
9
|
-
export declare function getInteractiveApprovalKind(toolName: string): InteractiveApprovalKind | null;
|
|
10
|
-
export declare function requiresRuntimeUserInput(toolName: string): boolean;
|
|
11
|
-
export declare function isHeadlessAutoAllowTool(toolName: string): boolean;
|
|
12
|
-
//# sourceMappingURL=interactive-policy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-policy.d.ts","sourceRoot":"","sources":["../../../src/tools/interactive-policy.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,uBAAuB,GAAG,mBAAmB,CAAC;AAE1D;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,8BAEN,CAAC;AAQzC,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEnE;AAED,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,MAAM,GACf,uBAAuB,GAAG,IAAI,CAOhC;AAED,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAElE;AAED,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEjE"}
|