( initialAppState?: Partial<ReturnType<typeof getDefaultAppState>>, )
| 154 | const { ConfigTool } = await import(import.meta.resolve('./ConfigTool.ts')) |
| 155 | |
| 156 | function createToolUseContext( |
| 157 | initialAppState?: Partial<ReturnType<typeof getDefaultAppState>>, |
| 158 | ) { |
| 159 | let appState = { |
| 160 | ...getDefaultAppState(), |
| 161 | ...initialAppState, |
| 162 | } |
| 163 | |
| 164 | const setAppState = (updater: (prev: typeof appState) => typeof appState) => { |
| 165 | appState = updater(appState) |
| 166 | } |
| 167 | |
| 168 | return { |
| 169 | options: { |
| 170 | commands: [], |
| 171 | debug: false, |
| 172 | mainLoopModel: '/data/models/hf/moonshotai__Kimi-K2.7-Code', |
| 173 | tools: [ConfigTool] as never, |
| 174 | verbose: false, |
| 175 | thinkingConfig: {} as never, |
| 176 | mcpClients: [], |
| 177 | mcpResources: {}, |
| 178 | isNonInteractiveSession: true, |
| 179 | agentDefinitions: { |
| 180 | activeAgents: [], |
| 181 | allAgents: [], |
| 182 | }, |
| 183 | }, |
| 184 | abortController: new AbortController(), |
| 185 | readFileState: {} as never, |
| 186 | getAppState: () => appState, |
| 187 | setAppState, |
| 188 | setAppStateForTasks: setAppState, |
| 189 | setInProgressToolUseIDs: () => {}, |
| 190 | setResponseLength: () => {}, |
| 191 | updateFileHistoryState: () => {}, |
| 192 | updateAttributionState: () => {}, |
| 193 | messages: [], |
| 194 | } as never |
| 195 | } |
| 196 | |
| 197 | beforeEach(() => { |
| 198 | analyticsEvents.length = 0 |
no test coverage detected