(toolNames: string[])
| 4 | import { JSReplTool } from './JSReplTool.js' |
| 5 | |
| 6 | function 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 | |
| 42 | describe('js_repl kernel behavior', () => { |
| 43 | it('persists state across calls and resets independently of the orchestration REPL', async () => { |
no test coverage detected