mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-17 19:03:50 +00:00
feat(coding-agent): add resume scope toggle
refactor(coding-agent): refine session listing helpers
This commit is contained in:
parent
f1e225d9e7
commit
e8d91f2bd4
6 changed files with 219 additions and 106 deletions
|
|
@ -7,13 +7,17 @@ import type { SessionInfo } from "../core/session-manager.js";
|
|||
import { SessionSelectorComponent } from "../modes/interactive/components/session-selector.js";
|
||||
|
||||
/** Show TUI session selector and return selected session path or null if cancelled */
|
||||
export async function selectSession(sessions: SessionInfo[]): Promise<string | null> {
|
||||
export async function selectSession(
|
||||
currentSessions: SessionInfo[],
|
||||
allSessions: SessionInfo[],
|
||||
): Promise<string | null> {
|
||||
return new Promise((resolve) => {
|
||||
const ui = new TUI(new ProcessTerminal());
|
||||
let resolved = false;
|
||||
|
||||
const selector = new SessionSelectorComponent(
|
||||
sessions,
|
||||
currentSessions,
|
||||
allSessions,
|
||||
(path: string) => {
|
||||
if (!resolved) {
|
||||
resolved = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue