Import apps/android/src/lib/session-backend.ts
This commit is contained in:
parent
3eacd1319e
commit
5ce32906ef
|
|
@ -0,0 +1,19 @@
|
||||||
|
import type { AgentBackend } from '../types'
|
||||||
|
|
||||||
|
/** Session ids carry their backend prefix; an unprefixed id is a Harness session. */
|
||||||
|
const PREFIXES: ReadonlyArray<[string, AgentBackend]> = [
|
||||||
|
['codex:', 'codex'],
|
||||||
|
['cursor:', 'cursor'],
|
||||||
|
['antigravity:', 'antigravity'],
|
||||||
|
['pi:', 'pi'],
|
||||||
|
['opencode:', 'opencode'],
|
||||||
|
['claude:', 'claude'],
|
||||||
|
['hermes:', 'hermes'],
|
||||||
|
]
|
||||||
|
|
||||||
|
export function sessionBackendFromId(id: string): AgentBackend {
|
||||||
|
for (const [prefix, backend] of PREFIXES) {
|
||||||
|
if (id.startsWith(prefix)) return backend
|
||||||
|
}
|
||||||
|
return 'harness'
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue