feat: wire optional progress reminders to actual requests and verified readback
This commit is contained in:
@@ -241,6 +241,21 @@ return async (request, response) => {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (route === '/api/progress-reminders/settings') {
|
||||
if (method === 'GET') return json(response, { enabled: store.config.progressRemindersEnabled === true });
|
||||
if (method === 'POST') {
|
||||
const input = await body(request);
|
||||
if (!input || Object.keys(input).length !== 1 || typeof input.enabled !== 'boolean') throw new Error('进展提醒设置只接受开启或关闭。');
|
||||
store.saveConfig({ progressRemindersEnabled: input.enabled }); runtime.progressRemindersChanged();
|
||||
return json(response, { enabled: store.config.progressRemindersEnabled === true });
|
||||
}
|
||||
}
|
||||
const reminderRoute = route.match(/^\/api\/sessions\/([a-f0-9-]{36})\/progress-reminders$/i);
|
||||
if (method === 'GET' && reminderRoute) {
|
||||
const session = store.session(reminderRoute[1]), id = url.searchParams.get('run') || session.runId;
|
||||
const run = store.owned('run', id, session.id);
|
||||
return json(response, runtime.reminderManager().inspect(session, run));
|
||||
}
|
||||
if (method === 'GET' && route === '/api/operations') {
|
||||
return json(response, inspectOperations({ store, provider, runtime, server, appDirectory, version: APP_VERSION, parameters: url.searchParams }));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user