MCPcopy Create free account
hub / github.com/tiann/hapi / isLegacyCursorSession

Function isLegacyCursorSession

cli/src/cursor/utils/cursorProtocol.ts:5–16  ·  view source on GitHub ↗
(metadata: Metadata | null | undefined)

Source from the content-addressed store, hash-verified

3export type CursorSessionProtocol = 'acp' | 'stream-json';
4
5export 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
18export function resolveCursorRemoteProtocol(metadata: Metadata | null | undefined): CursorSessionProtocol {
19 if (isLegacyCursorSession(metadata)) {

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected