pub(crate) const MEMORY_TOOL: &str = r#"{
"name": "Memory",
"description": "Your memory and the workspace's shared memory. Every call takes an action and a scope. scope \"personal\" (the default) is your own private memory: markdown files only you see, kept for your future self across conversations. scope \"global\" is Global Memory: entries inherited by every agent in this workspace at launch, workspace-wide shared state, so write there only what every agent should know. Global Memory belongs to the AgentMux you run in: channels that share its identity store share it, and an isolated channel (a dev or test build) keeps its own. Each entry has a reach: \"fleet\" (a new entry's default) is sent to every proven machine on the LAN and kept in step, the newest write winning, and \"machine\" stays on this machine. The entries that existed before reach was added are \"machine\"; list shows each entry's reach (read returns the text alone, so it can be written back as it is). Entries marked system are AgentMux's own Operator Config: listed so you know what is already in your context, never read, changed or removed here. Actions: list; read (filename, or id for global); write (filename and content; for global, name and content, with id to update an entry instead of creating one); reach (global only: id and reach \"fleet\" or \"machine\" set where an existing entry goes; write takes reach too, for a new entry that should stay here); remove (global only: takes the entry out of Global Memory, as the Memory pane's Remove does; the removal is kept as a version under your name, list shows it under removed, and history, diff and revert still reach it, so a revert restores it); history (every recorded version, newest first, with who or what wrote it); diff (two versions); revert (restore a version: it records a new version, history is never lost). Every write is kept as a version. What reaches you after a compaction or in a new session: your Global Memory only where your startup instructions lack it, and your Personal Memory as an index, one line per file (its description, so write a description that says when the file applies: \"when X, do Y\") that you read when it is relevant. A personal file whose frontmatter has `deliver: always` is sent in full every time, for a rule that must hold whatever you are doing: at most 5 files and 6,000 characters in all, the rest are listed in the index with the reason, never dropped.",
"inputSchema": {
"type": "object",
"properties": {
"action": { "type": "string", "enum": ["list", "read", "write", "remove", "reach", "history", "diff", "revert"], "description": "What to do" },
"scope": { "type": "string", "enum": ["personal", "global"], "description": "personal (default): your own memory; global: the workspace's Global Memory" },
"filename": { "type": "string", "description": "personal: the memory file (from list); write creates it if absent and overwrites it if present" },
"id": { "type": "string", "description": "global: the entry id (from list); for write, omit to create a new entry" },
"name": { "type": "string", "description": "global write: the entry's display name, also its heading in every agent's instructions" },
"content": { "type": "string", "description": "write: the full markdown content" },
"reach": { "type": "string", "enum": ["fleet", "machine"], "description": "global reach, or write: where the entry goes. fleet: every proven machine on the LAN, newest write wins; machine: this machine only" },
"provenance": { "type": "object", "description": "write: optional context on why you are writing this, for a human reviewing history later. Any JSON object; \"source\" (a short label, default agent_inferred) and \"detail\" (any JSON) are the two keys AgentMux reads, and any other key is kept beside detail" },
"from_version_id": { "type": "string", "description": "diff: the earlier version (from history)" },
"to_version_id": { "type": "string", "description": "diff: the later version (from history)" },
"version_id": { "type": "string", "description": "revert: the version to restore (from history)" }
},
"required": ["action"]
}
}"#;