/
Alex_Ural
/
opencode
Обзор
Документация
Войти
/
Alex_Ural
/
opencode
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
packages/app/src/context/global-sync/session-load.ts
25 строк
751 B
Adam
chore: cleanup
18 фев 2026, 20:48
Не верифицирован
18 фев 2026, 20:48
ef14f64
Код
Авторство
О чём код?
import type { RootLoadArgs } from "./types" export async function loadRootSessionsWithFallback(input: RootLoadArgs) { try { const result = await input.list({ directory: input.directory, roots: true, limit: input.limit }) return { data: result.data, limit: input.limit, limited: true, } as const } catch { const result = await input.list({ directory: input.directory, roots: true }) return { data: result.data, limit: input.limit, limited: false, } as const } } export function estimateRootSessionTotal(input: { count: number; limit: number; limited: boolean }) { if (!input.limited) return input.count if (input.count < input.limit) return input.count return input.count + 1 }