MCPcopy Create free account
hub / github.com/Noumena-Network/code / createToolUseContext

Function createToolUseContext

src/tools/REPLTool/JSReplTool.test.ts:6–40  ·  view source on GitHub ↗
(toolNames: string[])

Source from the content-addressed store, hash-verified

4import { JSReplTool } from './JSReplTool.js'
5
6function createToolUseContext(toolNames: string[]) {
7 let appState = getDefaultAppState()
8
9 const setAppState = (updater: (prev: typeof appState) => typeof appState) => {
10 appState = updater(appState)
11 }
12
13 return {
14 options: {
15 commands: [],
16 debug: false,
17 mainLoopModel: '/data/models/hf/moonshotai__Kimi-K2.7-Code',
18 tools: toolNames.map(name => ({ name, userFacingName: () => name })) as never,
19 verbose: false,
20 thinkingConfig: {} as never,
21 mcpClients: [],
22 mcpResources: {},
23 isNonInteractiveSession: true,
24 agentDefinitions: {
25 activeAgents: [],
26 allAgents: [],
27 },
28 },
29 abortController: new AbortController(),
30 readFileState: {} as never,
31 getAppState: () => appState,
32 setAppState,
33 setAppStateForTasks: setAppState,
34 setInProgressToolUseIDs: () => {},
35 setResponseLength: () => {},
36 updateFileHistoryState: () => {},
37 updateAttributionState: () => {},
38 messages: [],
39 } as never
40}
41
42describe('js_repl kernel behavior', () => {
43 it('persists state across calls and resets independently of the orchestration REPL', async () => {

Callers 1

JSReplTool.test.tsFile · 0.70

Calls 1

getDefaultAppStateFunction · 0.85

Tested by

no test coverage detected