export declare const GUIDES_DIR: string; export declare const MEMORY_GUIDE = "# Memory Management Guide\n\n## Three-Layer Memory System\n\n1. **`CLAUDE.md`** (in cwd) \u2014 per-conversation memory. Automatically loaded each session. Update it when the user shares preferences, important context, or says \"remember this\".\n2. **`~/.brainbotbeta/global/CLAUDE.md`** \u2014 global memory shared across ALL conversations. Update it when information is useful universally (e.g. \"always format code in TypeScript\", user's name, organization details). Use `Write` or `Edit` with the `~/.brainbotbeta/global/CLAUDE.md` path.\n3. **Auto-memory** \u2014 the SDK automatically extracts patterns and preferences to a global store. You don't need to manage this.\n\n## Structured File Memory\n\nWhen you learn important information that doesn't fit in a few bullet points, create dedicated `.md` files:\n- `preferences.md` \u2014 detailed user preferences (coding style, tools, workflows)\n- `projects.md` \u2014 project descriptions, repos, tech stacks, key contacts\n- `research/.md` \u2014 research notes on specific subjects\n- Any other structure that makes sense for the information at hand\n\n## File Management Rules\n\n- **Keep `CLAUDE.md` as an index** \u2014 when you create extra files, add them to the \"File Index\" section in `CLAUDE.md` so you can find them quickly in future sessions.\n- **Split large files** \u2014 if any `.md` file grows beyond ~500 lines, split it into a subdirectory with an index file (e.g. `research/index.md` + `research/topic-a.md` + `research/topic-b.md`).\n- **Use structured markdown** \u2014 headings, bullet lists, and tables for easy scanning. Avoid long prose blocks.\n\n## Global vs. Local Memory\n\n- **Global (`~/.brainbotbeta/global/CLAUDE.md`)** \u2014 user identity (name, role, org), language preference, universal formatting rules, cross-conversation facts. Ask yourself: \"Would this be useful in a *different* conversation?\"\n- **Local (`CLAUDE.md`)** \u2014 conversation-specific context, project details discussed here, task history, decisions made in this thread.\n- When in doubt, prefer local \u2014 you can always promote to global later.\n\n## Memory Update Triggers\n\n- User says \"remember this\" or \"remember this globally\"\n- User shares preferences, constraints, or personal details\n- You discover something important during research or tool use\n- A complex decision is made that should inform future sessions\n\n## Conversation Archives\n\n- The `conversations/` subdirectory contains archived transcripts from previous sessions. Search with `Grep` or `Glob` when you need to recall past discussions.\n- The `history.md` file at the workspace root contains concise summaries of previous sessions (auto-generated on context compaction). **Read this file first** when resuming a conversation \u2014 it's more efficient than searching raw archives.\n"; export declare const SCHEDULING_GUIDE = "# Scheduled Tasks Guide\n\n## Task Types\n\n- **cron**: Run on a cron schedule (e.g., \"0 9 * * 1-5\" for weekdays at 9am)\n- **interval**: Run every N minutes (e.g., \"5\" for every 5 minutes)\n- **once**: Run once at a specific local timestamp\n\n## Timezone Rules\n\nAll schedule times use your LOCAL timezone:\n- For cron expressions, \"0 9 * * *\" means 9am local time\n- For one-time tasks, use local time without Z suffix (e.g., \"2026-02-01T15:30:00\")\n- Do NOT use UTC timestamps or timezone offsets \u2014 the system handles conversion\n\n## Available MCP Tools\n\n| Tool | Purpose |\n|------|---------|\n| `schedule_task` | Create a new scheduled task (cron, interval, or once) |\n| `list_tasks` | List all tasks for the current conversation |\n| `pause_task` | Temporarily pause an active task |\n| `resume_task` | Resume a paused task |\n| `cancel_task` | Permanently delete a task |\n| `update_task` | Update a task's prompt or schedule |\n\n## Context Modes\n\n- **conversation** (default): The task reuses the conversation's session, so it has access to the full conversation history and memory.\n- **isolated**: The task runs in a fresh session each time, with no conversation context. Use this for tasks that don't need prior context.\n\n## Best Practices\n\n- Always confirm the schedule with the user before creating a task\n- Provide the task ID to the user for future management\n- For recurring tasks, suggest a reasonable interval (avoid unnecessarily frequent runs)\n- Use `once` for reminders and one-time actions\n- Use `cron` for precise scheduling (specific times/days)\n- Use `interval` for periodic checks (e.g., monitoring)\n"; export declare const SELF_MAINTENANCE_GUIDE = "# Self-Maintenance Guide (Upgrades & Restarts)\n\nYou run **inside** the `brainbotbeta` daemon. That daemon is the process that\nrelays Teams messages to you and back. **Stopping or restarting it terminates\nyour own session mid-task.** Treat any operation that stops/restarts the daemon\n\u2014 or the machine, or the server that hosts you \u2014 as a *self-termination hazard*.\n\n## The hard rule\n\n**Never run a host stop/restart as a blocking foreground call you expect to\nreturn from.** If you run `brainbotbeta stop` (or `restart`, or kill the\ndaemon PID) and then wait for the next step, that next step never executes \u2014\nthe command killed the very process that was going to run it. The session then\nappears hung, and any retry hits a dead connection (ConnectionRefused).\n\nThis already happened once: an upgrade ran `brainbotbeta stop` in-process, the\nsession died, and it kept retrying `stop` against a dead connection while the\nuser repeatedly asked \"did you upgrade?\". The daemon never came back up.\n\n## What to do instead\n\n1. **Prefer the built-in command.** Run `brainbotbeta upgrade`. As of the\n detached-upgrade fix, this hands the stop \u2192 install \u2192 start sequence to a\n **detached background process** that survives the daemon's death and brings\n it back automatically. You can call it and return immediately; do not wait\n for the daemon to come back in the same turn.\n\n2. **If you must restart the host yourself**, delegate it to a process that is\n decoupled from your lifecycle \u2014 a detached spawn (`detached: true` +\n `child.unref()`), a scheduled task, or a separate launcher \u2014 never a\n blocking foreground `execSync`/`await` you expect to return from. This is\n the same pattern BrainServer's restart uses (an external `server.py restart`,\n not an in-process `curl /api/restart` self-kill).\n\n3. **Tell the user what will happen.** A correct host restart ends your current\n session. Say so: \"I've started the upgrade in the background \u2014 the daemon\n will stop, update, and restart on its own. This session will end; I'll be\n back on the new version.\" Then stop. Do not poll for the restart in-session.\n\n## Diagnosing a failed command \u2014 do NOT retry blindly\n\nIf a command fails with **ConnectionRefused** (or similar \"host is gone\"\nerrors), the host you depend on is probably already down. **Do not re-issue the\nsame command in a loop.** Re-running `stop` against an already-stopped daemon\ncannot succeed and wastes turns. Step back, state what is blocking, and change\ntactics \u2014 e.g. report that a manual `brainbotbeta start` is needed, or that the\ndetached upgrade is already handling the restart out-of-band.\n\n## Quick reference\n\n| Situation | Do | Don't |\n|-----------|----|----|\n| Upgrade Brain | `brainbotbeta upgrade` (detached, returns immediately) | `stop` then `install` then `start` in-process |\n| Restart the daemon | Detached spawn / scheduled task; tell user session will end | Blocking `await stopDaemon()` you expect to return from |\n| A `stop` returned ConnectionRefused | Recognize host is down; move on / report | Retry `stop` again and again |\n"; /** * Ensure the guides/ directory exists and seed all guide files. * Call from ensureWorkspaceRoot() at startup. */ export declare function ensureGuides(): void;