MCPcopy Index your code
hub / github.com/tiann/hapi / runLocalRemoteSession

Function runLocalRemoteSession

cli/src/agent/loopBase.ts:6–25  ·  view source on GitHub ↗
(opts: {
    session: TSession;
    startingMode?: 'local' | 'remote';
    logTag: string;
    runLocal: LoopLauncher<TSession>;
    runRemote: LoopLauncher<TSession>;
    onSessionReady?: (session: TSession) => void;
})

Source from the content-addressed store, hash-verified

4export type LoopLauncher<TSession> = (session: TSession) => Promise<'switch' | 'exit'>;
5
6export async function runLocalRemoteSession<TSession extends AgentSessionBase<any>>(opts: {
7 session: TSession;
8 startingMode?: 'local' | 'remote';
9 logTag: string;
10 runLocal: LoopLauncher<TSession>;
11 runRemote: LoopLauncher<TSession>;
12 onSessionReady?: (session: TSession) => void;
13}): Promise<void> {
14 if (opts.onSessionReady) {
15 opts.onSessionReady(opts.session);
16 }
17
18 await runLocalRemoteLoop({
19 session: opts.session,
20 startingMode: opts.startingMode,
21 logTag: opts.logTag,
22 runLocal: opts.runLocal,
23 runRemote: opts.runRemote
24 });
25}
26
27export async function runLocalRemoteLoop<TSession extends AgentSessionBase<any>>(opts: {
28 session: TSession;

Callers 6

geminiLoopFunction · 0.90
loopFunction · 0.90
opencodeLoopFunction · 0.90
loopFunction · 0.90
loopFunction · 0.90
kimiLoopFunction · 0.90

Calls 1

runLocalRemoteLoopFunction · 0.85

Tested by

no test coverage detected