feat(panel): add opt-in cross-client session migration for CLI, Desktop App, and Legacy IDE

This commit is contained in:
fish
2026-11-21 23:19:15 +09:00
parent 3eb9e0e2a5
commit 0769a88796
17 changed files with 4681 additions and 5 deletions
@@ -1997,6 +1997,36 @@ export async function triggerCliStatusLineAction(action) {
return res;
}
export async function fetchSessionMigrationCatalog() {
try {
return await callSidecarApi('/api/session-migration/catalog', { method: 'GET' });
} catch {
return callSidecarApi('/api/settings', {
method: 'POST',
body: { __sessionMigrationAction: 'catalog' },
});
}
}
export async function executeSessionMigration(payload) {
let res;
try {
res = await callSidecarApi('/api/session-migration/migrate', {
method: 'POST',
body: payload || {},
});
} catch {
res = await callSidecarApi('/api/settings', {
method: 'POST',
body: { __sessionMigrationAction: 'migrate', payload: payload || {} },
});
}
if (res?.migratedCount > 0) {
void fetchTelemetry({ force: true }).catch(() => {});
}
return res;
}
export async function triggerPluginUpdate() {
const res = await callSidecarApi('/api/plugin-update', { method: 'POST', body: {} });
if (res?.ok && res?.restarting) {