Dashboard › opencode › Distillation
dc8634aa-58a3-4557-a950-3373d1455704["lore_tm_v1_z4WTElcIRaT62khDz7I5tU0CvDKJ9NjfAdP0kj3AGu0"]
/home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/agent.ts imports define from @opencode/plugin/effect/plugin, Effect from effect, Agent from ../agent.js, and Permission from ../permission.js; it exports the module namespace as AgentPlugin from ./agent.js.PROMPT_EXPLORE defines a file-search specialist skilled in glob matching, regex content search, and file analysis. Its guidelines require Glob for broad patterns, Grep for regex content searches, Read for known paths, adaptation to caller-specified thoroughness, absolute file paths in final responses, no emojis, and no file creation or bash commands that modify system state.PROMPT_TITLE requires title-generation output to be one line, no more than 50 characters, with no explanations, and in the same language as the user message."Analyzing"."read tool", "bash tool", or "edit tool".the, this, my, a, and an."summarizing" or "generating"."hello", "lol", "what's up", or "hey", PROMPT_TITLE directs generation of a title reflecting tone or intent, with examples including Greeting, Quick check-in, Light chat, and Intro message.PROMPT_TITLE includes nine input-to-title examples in order: 1. "debug 500 errors in production" β Debugging production 500 errors; 2. "refactor user service" β Refactoring user service; 3. "why is app.js failing" β app.js failure investigation; 4. "implement rate limiting" β Rate limiting implementation; 5. "how do I connect postgres to my API" β Postgres API connection; 6. "best practices for React hooks" β React hooks best practices; 7. "@src/credential.ts can you add refresh token support" β Credential refresh token support; 8. "@utils/parser.ts this is broken" β Parser bug fix; 9. "look at @config.json" β Config review; 10. "@App.tsx add dark mode toggle" β Dark mode toggle in App.PROMPT_SUMMARY instructs the agent to summarize completed conversation work like a pull request description in 2β3 sentences maximum, describe changes rather than process, omit tests/builds/validation, avoid explaining the userβs request, write in first person such as "I added..." or "I fixed...", and never introduce questions."Now please run the command and paste the console output"βthe summary must always include that exact request.Plugin is defined with define({ id: "opencode.agent", effect: Effect.fn(...) }) and transforms agents through ctx.agent.transform((editor) => ...).Agent.defaultID to name Build, description "The default agent. Executes tools based on configured permissions.", mode "primary", and adds { action: "question", resource: "*", effect: "allow" }.Agent.ID.make("general") to name General, description "General-purpose agent for researching complex questions and executing multi-step tasks. Use this agent to execute multiple units of work in parallel.", mode "subagent", and denies both question and subagent actions for resource "*".Agent.ID.make("explore") to name Explore, assigns PROMPT_EXPLORE as its system prompt, and sets mode "subagent".Explore agent description calls it a fast codebase-exploration agent for file patterns such as "src/components/**/*.tsx", keyword searches such as "API endpoints", and codebase questions such as "how do API endpoints work?"; callers should specify "quick", "medium", or "very thorough" exploration.Explore permissions, the plugin preserves existing rules where rule.action === "external_directory" and rule.effect === "allow" in externalDirectories.Explore permission merge begins with deny-all { action: "*", resource: "*", effect: "deny" }, then allows grep, glob, and webfetch for resource "*"; the supplied file excerpt ends at line 120 of 156 before the full permission list is shown.