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

Function addPipe

packages/baseai/src/add/index.ts:337–366  ·  view source on GitHub ↗
({ loginAndPipe }: { loginAndPipe: string })

Source from the content-addressed store, hash-verified

335 * @returns {Promise<void>} - A promise that resolves when the pipe is added.
336 */
337export async function addPipe({ loginAndPipe }: { loginAndPipe: string }) {
338 p.intro(
339 heading({
340 text: 'PIPE',
341 sub: `Adding ${color.cyan(loginAndPipe)}`
342 })
343 );
344
345 const { login, name } = extractLoginName(loginAndPipe);
346
347 if (!login || !name) {
348 p.log.error('Invalid pipe information provided');
349 return;
350 }
351
352 const spinner = p.spinner();
353
354 try {
355 const pipe = await getPipe({ login, name, spinner });
356 if (!pipe) return;
357
358 await createLocalTool(pipe);
359 await createLocalPipe(pipe);
360 } catch (error: any) {
361 spinner.stop('An unexpected error occurred');
362 p.log.error(
363 `'An unexpected error occurred': ${(error as Error).message}`
364 );
365 }
366}

Callers 1

index.tsFile · 0.90

Calls 5

headingFunction · 0.90
extractLoginNameFunction · 0.85
getPipeFunction · 0.85
createLocalToolFunction · 0.85
createLocalPipeFunction · 0.85

Tested by

no test coverage detected