mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 14:01:06 +00:00
feat(coding-agent): add resume scope toggle with async loading
- /resume and --resume now toggle between Current Folder and All sessions with Tab - SessionManager.list() and listAll() are now async with optional progress callback - Shows loading progress (e.g. Loading 5/42) while scanning sessions - SessionInfo.cwd field shows session working directory in All view - Lazy loading: All sessions only loaded when user presses Tab closes #619 Co-authored-by: Thomas Mustier <mustierthomas@gmail.com>
This commit is contained in:
parent
e8d91f2bd4
commit
302404684f
9 changed files with 263 additions and 117 deletions
|
|
@ -636,12 +636,17 @@ const { session } = await createAgentSession({
|
|||
sessionManager: SessionManager.open("/path/to/session.jsonl"),
|
||||
});
|
||||
|
||||
// List available sessions
|
||||
const sessions = SessionManager.list(process.cwd());
|
||||
// List available sessions (async with optional progress callback)
|
||||
const sessions = await SessionManager.list(process.cwd());
|
||||
for (const info of sessions) {
|
||||
console.log(`${info.id}: ${info.firstMessage} (${info.messageCount} messages)`);
|
||||
console.log(`${info.id}: ${info.firstMessage} (${info.messageCount} messages, cwd: ${info.cwd})`);
|
||||
}
|
||||
|
||||
// List all sessions across all projects
|
||||
const allSessions = await SessionManager.listAll((loaded, total) => {
|
||||
console.log(`Loading ${loaded}/${total}...`);
|
||||
});
|
||||
|
||||
// Custom session directory (no cwd encoding)
|
||||
const customDir = "/path/to/my-sessions";
|
||||
const { session } = await createAgentSession({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue