(
session:
| Pick<
Session,
'sessionId' | 'config' | 'mode' | 'workspacePath' | 'remoteConnectionId' | 'remoteSshHost'
>
| null
| undefined,
)
| 39 | } |
| 40 | |
| 41 | export 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 | |
| 66 | export function acpSlashCommandText(name: string): string { |
| 67 | return `/${name} `; |
no test coverage detected