feat: workspace→session picker and /model switch (v0.3.0)

Align Telegram session list with Web via apiProxy (exclude archived), resume cold sessions on bind, and allow model selection from the phone.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
owo
2026-08-14 18:46:56 +08:00
co-authored by Cursor
parent 9bae1a3702
commit ef0e7f34e3
18 changed files with 1486 additions and 108 deletions
+28
View File
@@ -0,0 +1,28 @@
import assert from 'node:assert/strict'
import test from 'node:test'
import {
visibleSessionsForWorkspace,
workspacesWithVisibleSessions,
type CatalogSnapshot,
} from '../src/catalog.ts'
test('visible sessions exclude archived blank and subagent', () => {
const catalog: CatalogSnapshot = {
archivedIds: new Set(['arch']),
sessionsById: new Map([
['ok', { sessionId: 'ok', title: 'OK', blank: false, running: true, updatedAt: 1 }],
['arch', { sessionId: 'arch', title: 'Arch', blank: false, running: false, updatedAt: 1 }],
['blank', { sessionId: 'blank', title: 'Blank', blank: true, running: false, updatedAt: 1 }],
['sub', { sessionId: 'sub', title: 'Sub', blank: false, running: false, origin: 'subagent', updatedAt: 1 }],
]),
workspaces: [{
id: 'w',
title: 'W',
path: '/w',
sessionIds: ['ok', 'arch', 'blank', 'sub', 'missing'],
}],
}
const rows = visibleSessionsForWorkspace(catalog, catalog.workspaces[0]!)
assert.deepEqual(rows.map((r) => r.sessionId), ['ok'])
assert.equal(workspacesWithVisibleSessions(catalog).length, 1)
})