MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / getAllModes

Function getAllModes

src/shared/modes.ts:70–91  ·  view source on GitHub ↗
(customModes?: ModeConfig[])

Source from the content-addressed store, hash-verified

68
69// Get all available modes, with custom modes overriding built-in modes
70export function getAllModes(customModes?: ModeConfig[]): ModeConfig[] {
71 if (!customModes?.length) {
72 return [...modes]
73 }
74
75 // Start with built-in modes
76 const allModes = [...modes]
77
78 // Process custom modes
79 customModes.forEach((customMode) => {
80 const index = allModes.findIndex((mode) => mode.slug === customMode.slug)
81 if (index !== -1) {
82 // Override existing mode
83 allModes[index] = customMode
84 } else {
85 // Add new mode
86 allModes.push(customMode)
87 }
88 })
89
90 return allModes
91}
92
93// Check if a mode is custom or an override
94export function isCustomMode(slug: string, customModes?: ModeConfig[]): boolean {

Callers 10

getAvailableModesMethod · 0.90
ChatTextArea.tsxFile · 0.90
ChatViewComponentFunction · 0.90
ModeSelectorFunction · 0.90
SkillsSettingsFunction · 0.90
CreateRuleDialogFunction · 0.90
CreateSkillDialogFunction · 0.90
ModesViewFunction · 0.90
handlerFunction · 0.90
getAllModesWithPromptsFunction · 0.85

Calls 1

forEachMethod · 0.80

Tested by

no test coverage detected