MCPcopy Create free account
hub / github.com/anomalyco/opencode / isAgent

Function isAgent

packages/app/src/context/global-sync/utils.ts:7–12  ·  view source on GitHub ↗
(input: unknown)

Source from the content-addressed store, hash-verified

5export const cmp = (a: string, b: string) => (a < b ? -1 : a > b ? 1 : 0)
6
7function isAgent(input: unknown): input is Agent {
8 if (!input || typeof input !== "object") return false
9 const item = input as { name?: unknown; mode?: unknown }
10 if (typeof item.name !== "string") return false
11 return item.mode === "subagent" || item.mode === "primary" || item.mode === "all"
12}
13
14export function normalizeAgentList(input: unknown): Agent[] {
15 if (Array.isArray(input)) return input.filter(isAgent)

Callers 1

normalizeAgentListFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected