(allowedTools: string[])
| 16 | process.env.PATH = `${process.env.PATH || ''}:/mlstore/src/noumena/ncode/tools/buck` |
| 17 | |
| 18 | function createToolUseContext(allowedTools: string[]) { |
| 19 | const appState = { |
| 20 | toolPermissionContext: { |
| 21 | mode: 'default' as const, |
| 22 | alwaysAllowRules: { |
| 23 | command: allowedTools, |
| 24 | }, |
| 25 | alwaysDenyRules: {}, |
| 26 | alwaysAskRules: {}, |
| 27 | sessionApprovedTools: new Set(), |
| 28 | explicitDenials: [], |
| 29 | trackDenial: () => {}, |
| 30 | sessionApprovedCommands: new Set(), |
| 31 | commandFingerprintToToolName: new Map(), |
| 32 | additionalWorkingDirectories: new Map(), |
| 33 | }, |
| 34 | fastMode: false, |
| 35 | sessionHooks: new Map(), |
| 36 | mcp: { tools: [], clients: [] }, |
| 37 | effortValue: undefined, |
| 38 | advisorModel: undefined, |
| 39 | messages: [], |
| 40 | replBridgeEnabled: false, |
| 41 | mainLoopModelForSession: null, |
| 42 | mainLoopModel: null, |
| 43 | denialTracking: { |
| 44 | consecutiveDenials: 0, |
| 45 | totalDenials: 0, |
| 46 | lastDeniedAt: null, |
| 47 | classifierConsecutiveDenials: 0, |
| 48 | classifierTotalDenials: 0, |
| 49 | }, |
| 50 | } |
| 51 | |
| 52 | return { |
| 53 | abortController: new AbortController(), |
| 54 | readFileState: { get: () => undefined, set: () => {}, clear: () => {} }, |
| 55 | getAppState: () => appState, |
| 56 | setAppState: () => {}, |
| 57 | setAppStateForTasks: () => {}, |
| 58 | updateAttributionState: () => {}, |
| 59 | addNotification: () => {}, |
| 60 | options: { |
| 61 | commands: [], |
| 62 | debug: false, |
| 63 | mainLoopModel: 'test', |
| 64 | tools: [], |
| 65 | verbose: false, |
| 66 | thinkingConfig: { enabled: false }, |
| 67 | mcpClients: [], |
| 68 | mcpResources: {}, |
| 69 | isNonInteractiveSession: false, |
| 70 | agentDefinitions: { agents: [], activeAgentType: null }, |
| 71 | }, |
| 72 | } as never |
| 73 | } |
| 74 | |
| 75 | const COMMIT_ALLOWED_TOOLS = [ |
no outgoing calls
no test coverage detected