( agentsRequested: readonly string[] | undefined, templateDefaultAgents: readonly string[], allAdapterIds: readonly string[], )
| 70 | * backend-only callers (quick-chat) on the bare-`defaultAgents` set. |
| 71 | */ |
| 72 | export function resolveCreateAgents( |
| 73 | agentsRequested: readonly string[] | undefined, |
| 74 | templateDefaultAgents: readonly string[], |
| 75 | allAdapterIds: readonly string[], |
| 76 | ): readonly string[] { |
| 77 | if (agentsRequested && agentsRequested.length > 0) return agentsRequested; |
| 78 | const utility = new Set(['shell']); |
| 79 | const ordered = [...new Set([...templateDefaultAgents, ...allAdapterIds])]; |
| 80 | return [ |
| 81 | ...ordered.filter((id) => !utility.has(id)), |
| 82 | ...ordered.filter((id) => utility.has(id)), |
| 83 | ]; |
| 84 | } |
| 85 | |
| 86 | /** |
| 87 | * Creates a workspace by invoking the template's bootstrap script. |
no test coverage detected