{"version":3,"sources":["../../subagents/index.ts","../../subagents/prompts.ts"],"sourcesContent":["/**\n * Explore subagent — barrel exports\n *\n * Framework-specific adapters:\n *   import { createExploreSubagent } from '@morphllm/morphsdk/subagents/vercel';\n *   import { createExploreSubagent } from '@morphllm/morphsdk/subagents/anthropic';\n */\n\n// Types\nexport type {\n  ExploreSubagentConfig,\n  ExploreResult,\n  ExploreStep,\n  ExploreSession,\n  ExploreEvent,\n  SubagentMessage,\n  ExploreThoroughness,\n  MessageHandler,\n  StepHandler,\n} from './types.js';\n\n// Prompts (for advanced usage / customisation)\nexport { getSystemPrompt, CODEBASE_SEARCH_TOOL, SEND_MESSAGE_TOOL } from './prompts.js';\n","/**\n * System prompts and tool descriptions for Explore subagent\n */\n\nimport type { ExploreThoroughness } from './types.js';\n\nconst THOROUGHNESS_INSTRUCTIONS: Record<ExploreThoroughness, string> = {\n  quick: `Do 1-2 targeted searches. Find the most relevant file/function quickly and summarize. Don't go deep.`,\n  medium: `Do 2-4 searches. Start broad, then follow up on the most promising leads. Cover the main aspects.`,\n  thorough: `Do 4-8 searches. Explore systematically: start broad, then drill into each relevant area. Cover edge cases, related files, and the full call chain. Leave no stone unturned.`,\n};\n\nexport function getSystemPrompt(thoroughness: ExploreThoroughness = 'medium'): string {\n  return `You are a codebase exploration specialist. Your job is to search a codebase and return a concise, accurate summary of what you find.\n\n## Mode\nREAD-ONLY. You cannot modify files. You can only search and read code.\n\n## Strategy\n${THOROUGHNESS_INSTRUCTIONS[thoroughness]}\n\n- Use multiple focused searches rather than one vague search\n- Follow imports, function calls, and type references to build complete understanding\n- If a search returns no results, try alternative terms (e.g., \"auth\" vs \"authentication\" vs \"login\")\n- Look at both implementation and tests when relevant\n\n## Communication\nYou have a \\`send_message\\` tool. Use it when:\n- You hit a fork in the road and need guidance (\"Found auth in both src/middleware/ and legacy/auth/. Which should I focus on?\")\n- You need clarification on ambiguous requests (\"There are 3 auth strategies: JWT, session, OAuth. Which one?\")\n- You want to share a key finding before continuing (\"The main auth handler is in src/auth/index.ts. It delegates to strategy-specific modules. Continuing to trace JWT flow.\")\n\nDo NOT use send_message for routine status updates. Only use it when you genuinely need input or have a significant finding worth sharing before you're done.\n\n## Output\nWhen you have enough information, output your final summary. Structure it as:\n1. Direct answer to the question\n2. Key files and their roles\n3. How the pieces connect\n\nBe concise. The summary should be useful to another AI model that will use your findings to complete a task.`;\n}\n\nexport const CODEBASE_SEARCH_TOOL = {\n  name: 'codebase_search',\n  description: 'Search the codebase for relevant code. Takes a natural language search request describing what you want to find. Returns matching file contents with line numbers.',\n  input_schema: {\n    type: 'object' as const,\n    properties: {\n      searchRequest: {\n        type: 'string' as const,\n        description: 'Natural language description of what to search for in the codebase',\n      },\n    },\n    required: ['searchRequest'] as const,\n    additionalProperties: false as const,\n  },\n};\n\nexport const SEND_MESSAGE_TOOL = {\n  name: 'send_message',\n  description: 'Send a message to the orchestrating agent. Use this to ask questions, request clarification, or share important findings. The orchestrator may reply with additional context. Use sparingly — only when you genuinely need input or have a significant finding.',\n  input_schema: {\n    type: 'object' as const,\n    properties: {\n      message: {\n        type: 'string' as const,\n        description: 'The message to send to the orchestrator',\n      },\n    },\n    required: ['message'] as const,\n    additionalProperties: false as const,\n  },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACMA,IAAM,4BAAiE;AAAA,EACrE,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,UAAU;AACZ;AAEO,SAAS,gBAAgB,eAAoC,UAAkB;AACpF,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMP,0BAA0B,YAAY,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsBzC;AAEO,IAAM,uBAAuB;AAAA,EAClC,MAAM;AAAA,EACN,aAAa;AAAA,EACb,cAAc;AAAA,IACZ,MAAM;AAAA,IACN,YAAY;AAAA,MACV,eAAe;AAAA,QACb,MAAM;AAAA,QACN,aAAa;AAAA,MACf;AAAA,IACF;AAAA,IACA,UAAU,CAAC,eAAe;AAAA,IAC1B,sBAAsB;AAAA,EACxB;AACF;AAEO,IAAM,oBAAoB;AAAA,EAC/B,MAAM;AAAA,EACN,aAAa;AAAA,EACb,cAAc;AAAA,IACZ,MAAM;AAAA,IACN,YAAY;AAAA,MACV,SAAS;AAAA,QACP,MAAM;AAAA,QACN,aAAa;AAAA,MACf;AAAA,IACF;AAAA,IACA,UAAU,CAAC,SAAS;AAAA,IACpB,sBAAsB;AAAA,EACxB;AACF;","names":[]}