MCPcopy Create free account
hub / github.com/CommandCodeAI/BaseAI / readToolsDirectory

Function readToolsDirectory

packages/baseai/src/deploy/index.ts:139–160  ·  view source on GitHub ↗
({
	spinner,
	toolsDir
}: {
	spinner: Spinner;
	toolsDir: string;
})

Source from the content-addressed store, hash-verified

137}
138
139async function readToolsDirectory({
140 spinner,
141 toolsDir
142}: {
143 spinner: Spinner;
144 toolsDir: string;
145}): Promise<string[] | null> {
146 spinner.start('Reading tools directory');
147 try {
148 const files = await fs.readdir(toolsDir);
149 // Filter out non-json files
150 const tools = files.filter(file => path.extname(file) === '.json');
151
152 spinner.stop(
153 `Found ${tools.length} tool${tools.length !== 1 ? 's' : ''}`
154 );
155 return tools;
156 } catch (error) {
157 handleDirectoryReadError({ spinner, dir: toolsDir, error });
158 return null;
159 }
160}
161
162async function deployPipes({
163 spinner,

Callers 1

deployFunction · 0.85

Calls 2

handleDirectoryReadErrorFunction · 0.85
startMethod · 0.45

Tested by

no test coverage detected