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

Function createToolUseContext

src/tools/TaskToolTaskListRuntime.test.ts:41–77  ·  view source on GitHub ↗
(
  tools: Array<{ name: string; userFacingName: () => string }>,
)

Source from the content-addressed store, hash-verified

39}
40
41function createToolUseContext(
42 tools: Array<{ name: string; userFacingName: () => string }>,
43) {
44 let appState = getDefaultAppState()
45
46 const setAppState = (updater: (prev: typeof appState) => typeof appState) => {
47 appState = updater(appState)
48 }
49
50 return {
51 options: {
52 commands: [],
53 debug: false,
54 mainLoopModel: '/data/models/hf/moonshotai__Kimi-K2.7-Code',
55 tools: tools as never,
56 verbose: false,
57 thinkingConfig: {} as never,
58 mcpClients: [],
59 mcpResources: {},
60 isNonInteractiveSession: true,
61 agentDefinitions: {
62 activeAgents: [],
63 allAgents: [],
64 },
65 },
66 abortController: new AbortController(),
67 readFileState: {} as never,
68 getAppState: () => appState,
69 setAppState,
70 setAppStateForTasks: setAppState,
71 setInProgressToolUseIDs: () => {},
72 setResponseLength: () => {},
73 updateFileHistoryState: () => {},
74 updateAttributionState: () => {},
75 messages: [],
76 } as never
77}
78
79async function allowWithOriginalInput<T>(_tool: unknown, input: T) {
80 return {

Callers 1

Calls 1

getDefaultAppStateFunction · 0.85

Tested by

no test coverage detected