MCPcopy Index your code
hub / github.com/Noumena-Network/code / clearPythonReplContext

Function clearPythonReplContext

src/tools/REPLTool/pyReplFactory.tsx:545–562  ·  view source on GitHub ↗
(
  toolUseContext: ToolUseContext,
  toolName: string,
)

Source from the content-addressed store, hash-verified

543}
544
545export async function clearPythonReplContext(
546 toolUseContext: ToolUseContext,
547 toolName: string,
548): Promise<void> {
549 const existing = toolUseContext.getAppState().pythonReplContexts?.get(toolName)
550 await existing?.reset()
551 toolUseContext.setAppState(prev => {
552 if (!prev.pythonReplContexts?.has(toolName)) {
553 return prev
554 }
555 const contexts = new Map(prev.pythonReplContexts)
556 contexts.delete(toolName)
557 return {
558 ...prev,
559 pythonReplContexts: contexts,
560 }
561 })
562}
563
564export function createPythonReplTool(config: PythonReplToolConfig) {
565 const inputSchema = buildInputSchema(config.inputSchemaDescription)

Callers 1

callFunction · 0.85

Calls 4

deleteMethod · 0.80
resetMethod · 0.65
getMethod · 0.45
hasMethod · 0.45

Tested by

no test coverage detected