(metadata: Metadata | null | undefined)
| 3 | export type CursorSessionProtocol = 'acp' | 'stream-json'; |
| 4 | |
| 5 | export function isLegacyCursorSession(metadata: Metadata | null | undefined): boolean { |
| 6 | if (metadata?.flavor !== 'cursor') { |
| 7 | return false; |
| 8 | } |
| 9 | if (metadata.cursorSessionProtocol === 'acp') { |
| 10 | return false; |
| 11 | } |
| 12 | if (metadata.cursorSessionProtocol === 'stream-json') { |
| 13 | return Boolean(metadata.cursorSessionId); |
| 14 | } |
| 15 | return Boolean(metadata.cursorSessionId); |
| 16 | } |
| 17 | |
| 18 | export function resolveCursorRemoteProtocol(metadata: Metadata | null | undefined): CursorSessionProtocol { |
| 19 | if (isLegacyCursorSession(metadata)) { |
no outgoing calls
no test coverage detected