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

Function readPipesDirectory

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

Source from the content-addressed store, hash-verified

114}
115
116async function readPipesDirectory({
117 spinner,
118 pipesDir
119}: {
120 spinner: Spinner;
121 pipesDir: string;
122}): Promise<string[] | null> {
123 spinner.start('Reading pipes directory');
124 try {
125 const files = await fs.readdir(pipesDir);
126 // Filter out non-json files
127 const pipes = files.filter(file => path.extname(file) === '.json');
128
129 spinner.stop(
130 `Found ${pipes.length} pipe${pipes.length !== 1 ? 's' : ''}`
131 );
132 return pipes;
133 } catch (error) {
134 handleDirectoryReadError({ spinner, dir: pipesDir, error });
135 return null;
136 }
137}
138
139async function readToolsDirectory({
140 spinner,

Callers 1

deployFunction · 0.85

Calls 2

handleDirectoryReadErrorFunction · 0.85
startMethod · 0.45

Tested by

no test coverage detected