@nanocollective/nanocoder
Version:
A local-first CLI coding agent that brings the power of agentic coding tools like Claude Code and Gemini CLI to local models or controlled APIs like OpenRouter
15 lines • 607 B
JavaScript
import { isNanocoderToolAlwaysAllowed } from '../config/nanocoder-tools-config.js';
import { getCurrentMode } from '../context/mode-context.js';
/**
* Creates a needsApproval function for file-mutation tools.
* Returns false if the tool is always-allowed or the current mode is auto-accept/scheduler.
*/
export function createFileToolApproval(toolName) {
return () => {
if (isNanocoderToolAlwaysAllowed(toolName))
return false;
const mode = getCurrentMode();
return mode !== 'auto-accept' && mode !== 'scheduler';
};
}
//# sourceMappingURL=tool-approval.js.map