feat: add streaming runtime router
This commit is contained in:
+20
@@ -1774,6 +1774,26 @@ api.get('/status', async (_req, res, next) => {
|
||||
return next();
|
||||
});
|
||||
|
||||
api.get('/runtime/status', async (_req, res) => {
|
||||
await userAuthReady;
|
||||
if (!tkmindProxy?.getRuntimeStatus) {
|
||||
return res.status(503).json({ ok: false, message: 'runtime router unavailable' });
|
||||
}
|
||||
try {
|
||||
const status = await tkmindProxy.getRuntimeStatus();
|
||||
return res.json({
|
||||
ok: true,
|
||||
timestamp: new Date().toISOString(),
|
||||
...status,
|
||||
});
|
||||
} catch (err) {
|
||||
return res.status(502).json({
|
||||
ok: false,
|
||||
message: err instanceof Error ? err.message : 'runtime status failed',
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
async function ensureUserMemoryCapability(req, res) {
|
||||
if (!userAuth) {
|
||||
res.status(503).json({ message: '未启用用户系统' });
|
||||
|
||||
Reference in New Issue
Block a user