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

Function createToolUseContext

src/tools/ConfigTool/ConfigTool.test.ts:156–195  ·  view source on GitHub ↗
(
  initialAppState?: Partial<ReturnType<typeof getDefaultAppState>>,
)

Source from the content-addressed store, hash-verified

154const { ConfigTool } = await import(import.meta.resolve('./ConfigTool.ts'))
155
156function 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
197beforeEach(() => {
198 analyticsEvents.length = 0

Callers 1

ConfigTool.test.tsFile · 0.70

Calls 1

getDefaultAppStateFunction · 0.85

Tested by

no test coverage detected