()
| 67 | const selectable = (agent: Info | undefined) => |
| 68 | agent && agent.mode !== "subagent" && !agent.hidden ? agent : undefined |
| 69 | const selectedDefault = () => { |
| 70 | const data = state.get() |
| 71 | const configured = data.default ? selectable(data.agents.get(data.default)) : undefined |
| 72 | if (configured) return configured |
| 73 | const build = selectable(data.agents.get(ID.make("build"))) |
| 74 | if (build) return build |
| 75 | for (const agent of data.agents.values()) { |
| 76 | const fallback = selectable(agent) |
| 77 | if (fallback) return fallback |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | return Service.of({ |
| 82 | transform: state.transform, |
no test coverage detected