MCPcopy
hub / github.com/TanStack/ai / createCodeMode

Function createCodeMode

packages/ai-code-mode/src/create-code-mode.ts:27–45  ·  view source on GitHub ↗
(
  config: CodeModeToolConfig,
)

Source from the content-addressed store, hash-verified

25 * ```
26 */
27export function createCodeMode(
28 config: CodeModeToolConfig,
29): CreateCodeModeResult {
30 const tool = createCodeModeTool(config)
31 const systemPrompt = createCodeModeSystemPrompt(config)
32
33 const lazyTools = config.tools.filter((t) => t.lazy)
34 const discoveryTool =
35 lazyTools.length > 0
36 ? createDiscoveryTool(lazyTools, config.lazyToolsConfig)
37 : null
38
39 return {
40 tool,
41 discoveryTool,
42 tools: discoveryTool ? [tool, discoveryTool] : [tool],
43 systemPrompt,
44 }
45}

Callers 12

getCodeModeToolsFunction · 0.90
getCodeModeToolsFunction · 0.90
getCodeModeToolsFunction · 0.90
getCodeModeToolsFunction · 0.90
getCodeModeToolsFunction · 0.90
getCodeModeToolsFunction · 0.90
getCodeModeToolsFunction · 0.90
executePromptFunction · 0.90
createTriageToolsFunction · 0.90

Calls 3

createCodeModeToolFunction · 0.90
createDiscoveryToolFunction · 0.90

Tested by

no test coverage detected