MCPcopy Create free account
hub / github.com/GCWing/BitFun / acpSessionRef

Function acpSessionRef

src/web-ui/src/flow_chat/utils/acpSession.ts:41–64  ·  view source on GitHub ↗
(
  session:
    | Pick<
        Session,
        'sessionId' | 'config' | 'mode' | 'workspacePath' | 'remoteConnectionId' | 'remoteSshHost'
      >
    | null
    | undefined,
)

Source from the content-addressed store, hash-verified

39}
40
41export function acpSessionRef(
42 session:
43 | Pick<
44 Session,
45 'sessionId' | 'config' | 'mode' | 'workspacePath' | 'remoteConnectionId' | 'remoteSshHost'
46 >
47 | null
48 | undefined,
49): AcpSessionRef | null {
50 if (!session?.sessionId) return null;
51
52 const clientId =
53 acpClientIdFromAgentType(session.config?.agentType) ??
54 acpClientIdFromAgentType(session.mode);
55 if (!clientId) return null;
56
57 return {
58 sessionId: session.sessionId,
59 clientId,
60 workspacePath: session.workspacePath ?? session.config?.workspacePath,
61 remoteConnectionId: session.remoteConnectionId ?? session.config?.remoteConnectionId,
62 remoteSshHost: session.remoteSshHost,
63 };
64}
65
66export function acpSlashCommandText(name: string): string {
67 return `/${name} `;

Callers 2

ChatInputFunction · 0.90

Calls 1

acpClientIdFromAgentTypeFunction · 0.85

Tested by

no test coverage detected