MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / pump

Function pump

packages/kaos/test/ssh-create.test.ts:342–361  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

340 // runs out, at which point it must emit `false` to signal "no more
341 // auth methods" (but we stop as soon as we see the password entry).
342 const pump = (): void => {
343 handler([], false, (auth: string | AnyAuthMethod | false) => {
344 if (auth === false) {
345 client.emit('error', new Error('unexpected end of auth queue'));
346 return;
347 }
348 if (typeof auth !== 'object') {
349 client.emit('error', new Error(`unexpected auth: ${auth}`));
350 return;
351 }
352 yielded.push(auth.type);
353 if (auth.type === 'password') {
354 queueMicrotask(() => {
355 client.emit('ready');
356 });
357 return;
358 }
359 pump();
360 });
361 };
362 pump();
363 },
364 });

Callers 1

onConnectFunction · 0.85

Calls 3

handlerFunction · 0.50
emitMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected