(self, plugin: PluginSource, agent: AgentSource, result: EmitResult)
| 222 | result.written.append(self.mirror_file(src, skill_dir / rel)) |
| 223 | |
| 224 | def _emit_agent(self, plugin: PluginSource, agent: AgentSource, result: EmitResult) -> None: |
| 225 | agent_id = f"{plugin.name}__{agent.name}" |
| 226 | rel = Path(".opencode") / "agents" / f"{agent_id}.md" |
| 227 | |
| 228 | model, warning = resolve_model("opencode", agent.model) |
| 229 | if warning: |
| 230 | result.warnings.append(f"agent `{agent_id}`: {warning}") |
| 231 | |
| 232 | fm: dict = { |
| 233 | "name": agent_id, |
| 234 | "description": agent.description or f"{agent.name} (from {plugin.name})", |
| 235 | "mode": "subagent", |
| 236 | "model": model, |
| 237 | } |
| 238 | |
| 239 | has_tools_field = "tools" in agent.frontmatter |
| 240 | permission = _build_permission_block(agent.tools, has_tools_field=has_tools_field) |
| 241 | if permission: |
| 242 | fm["permission"] = permission |
| 243 | |
| 244 | body = _rewrite_body_lowercase_tools(agent.body).rstrip() + "\n" |
| 245 | content = _opencode_frontmatter(fm) + "\n\n" + body |
| 246 | result.written.append(self.write(rel, content)) |
| 247 | |
| 248 | def _emit_command(self, plugin: PluginSource, cmd: CommandSource, result: EmitResult) -> None: |
| 249 | cmd_id = f"{plugin.name}__{cmd.name}" |
no test coverage detected