MCPcopy Index your code
hub / github.com/CommandCodeAI/BaseAI / getAvailablePipes

Function getAvailablePipes

packages/baseai/src/utils/get-available-pipes.ts:4–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2import path from 'path';
3
4export async function getAvailablePipes() {
5 // Construct the path containing all pipes folders.
6 const pipesPath = path.join(process.cwd(), 'baseai', 'pipes');
7
8 // Check if the baseai directory exists.
9 if (!fs.existsSync(pipesPath)) return [];
10
11 // Get all directories names in the pipe path.
12 const pipeNames = await fs.promises.readdir(pipesPath);
13
14 // Make complete paths for each pipe.
15 const slugifiedPipes = pipeNames.map(pipeName =>
16 pipeName.replace('.ts', '')
17 );
18
19 // Return the pipe names.
20 return slugifiedPipes;
21}

Callers 1

createLocalPipeFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected