(value: string)
| 20 | } |
| 21 | |
| 22 | function normalizeSubagentKind(value: string): string { |
| 23 | const normalized = value |
| 24 | .trim() |
| 25 | .toLowerCase() |
| 26 | .replace(/[\s-]/g, "_"); |
| 27 | if (normalized.startsWith("subagent_")) { |
| 28 | return normalized.slice("subagent_".length); |
| 29 | } |
| 30 | if (normalized.startsWith("sub_agent_")) { |
| 31 | return normalized.slice("sub_agent_".length); |
| 32 | } |
| 33 | return normalized; |
| 34 | } |
| 35 | |
| 36 | function getSubagentKind(source: unknown): string | null { |
| 37 | if (typeof source === "string") { |