mirror of
https://github.com/lWolvesl/antigravity-usage-monitor.git
synced 2026-11-26 17:09:28 +08:00
feat(panel): add opt-in cross-client session migration for CLI, Desktop App, and Legacy IDE
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user