/** * Server instructions for Memory Journal MCP. * * Slim instructions are sent to MCP clients during initialization. * Detailed help is available on-demand via memory://help resources. * Instructions are dynamically generated based on enabled tool groups. */ import type { ToolGroup } from '../types/index.js'; /** * Resource definition for instruction generation */ export interface ResourceDefinition { uri: string; name: string; description?: string; } /** * Prompt definition for instruction generation */ export interface PromptDefinition { name: string; description?: string; } /** * Latest entry snapshot for initial briefing */ export interface LatestEntrySnapshot { id: number; timestamp: string; entryType: string; content: string; } /** * Generate dynamic instructions based on enabled tool groups and instruction level. * * Sections are conditionally included based on which tool groups are enabled: * * @param enabledTools - Set of enabled tool names * @param prompts - Available prompt definitions * @param latestEntry - Optional latest entry for context snapshot * @param enabledGroups - Optional pre-computed enabled groups; derived from enabledTools if omitted * @param config - Server configuration for context */ export declare function generateStandardInstructions(enabledTools: Set, prompts: PromptDefinition[], latestEntry?: LatestEntrySnapshot, enabledGroups?: Set, config?: { defaultWorkspaceId?: string; }): string; /** * Generate instructions optimized for Code Mode (consolidated API reference). */ export declare function generateCodeModeInstructions(enabledTools: Set, prompts: PromptDefinition[], latestEntry?: LatestEntrySnapshot, enabledGroups?: Set, config?: { defaultWorkspaceId?: string; }): string; /** * Static instructions for backward compatibility. * @deprecated Use generateStandardInstructions() instead for dynamic content */ export declare const SERVER_INSTRUCTIONS = "# memory-journal-mcp\n\n## Quick Access\n\n| Purpose | Action |\n| --------------- | --------------------------- |\n| Session context | `memory://briefing` |\n| Recent entries | `memory://recent` |\n| Health/time | `memory://health` |\n| Metrics/Summary | `memory://metrics/summary` |\n| Metrics/Latency | `memory://metrics/latency` |\n| Resource reads | `memory://metrics/resources`|\n| Project staleness| `memory://staleness` |\n| Report history | `memory://insights/reports` |\n| Agent context | `memory://agent-context/{+repo}` |\n\n## Help Resources\n\n- **Agent Skill:** If available in your environment, load the `memory-journal-mcp` skill for high-level workflow guidelines.\n- **Dynamic Help:** Read `memory://help` for tool group index and available help resources.\n- **Gotchas:** Read `memory://help/gotchas` for critical usage patterns, heuristics, and session summary rules.\n- **Group Reference:** Read `memory://help/{group}` for per-group tool reference (parameters, annotations, examples).\n\nOnly help resources for your enabled tool groups are registered.\n\n## Essential Behaviors\n\n1. **Briefing:** You **MUST** read the `memory://briefing/{+repo}` at the start of each chat!\n2. **Session Identity:** You MUST pass your AntiGravity Conversation ID as the `--session-id` argument for all CLI journal mutation commands.\n3. **Workspace Isolation:** The `--project` argument is STRICTLY REQUIRED for mutations when the current working directory is not mapped in `PROJECT_REGISTRY` (otherwise it auto-resolves from CWD). Find it in the briefing's Config row. If you are mid-task and need this context, NEVER re-query the briefing; ALWAYS query `memory://agent-context/{+repo}`.\n4. **Anti-Hallucination:** If confused by an API, read `memory://help/{group}` or `memory://help/gotchas` BEFORE guessing. Use `mcp-heal` if a structural hallucination persists.\n5. **Orphan Prevention:** ALWAYS link entries to previous context via `--related-to` (comma-separated entry IDs).\n\n## Essential Operations\n\n- **Creating Entries:** Use the `memory-journal-mcp entry create` CLI command via your terminal (`run_command`). CLI commands are ALWAYS available globally on the system; do NOT attempt to run them via Code Mode. ALL entries MUST define `--impact-score`, `--trust-score`, and `--validation-status`. See `memory://help/core` for criteria.\n- **Session Summaries:** Use the `memory-journal-mcp entry create` CLI command with `--type retrospective` and `--tags session-summary`. You MUST provide the markdown content via `--content \"\"` or `--file ` (or pipe to stdin). See `memory://help/templates` for the exact 4-section format required.\n- **Updating/Deleting:** Use `memory-journal-mcp entry update` (pass `--expected-version` to prevent concurrent overwrites) and use the `delete_entry` MCP tool for soft-deletes.\n- **Searching:** Use `search_entries` or `search_by_date_range`. Use `sort_by: \"importance\"` to surface structurally significant entries. Use phrase matching (e.g. `\"error handling\"`) for exact matches.\n- **Team DB:** Append the `--team` flag to your CLI commands for shared state. Use `team_*` MCP tools (or `mj.team.*` in Code Mode) for searches, deletes, relationships, analytics, and RBAC member/alias management. See `memory://help/team` for RBAC rules. Do NOT create bulk relationships between unrelated entries that happen to share tags."; /** * Help content keyed by group name. * 'gotchas' is the always-available help (memory://help/gotchas). * Other keys are feature-specific help (memory://help/{key}). */ export declare const HELP_CONTENT: ReadonlyMap; //# sourceMappingURL=server-instructions.d.ts.map