MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / resolveCreateAgents

Function resolveCreateAgents

src/workspaces/workspace-creator.ts:72–84  ·  view source on GitHub ↗
(
  agentsRequested: readonly string[] | undefined,
  templateDefaultAgents: readonly string[],
  allAdapterIds: readonly string[],
)

Source from the content-addressed store, hash-verified

70 * backend-only callers (quick-chat) on the bare-`defaultAgents` set.
71 */
72export 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.

Callers 2

createMethod · 0.85

Calls 1

hasMethod · 0.65

Tested by

no test coverage detected