Core tests / core (push) Successful in 9m57s
Full verification / application (push) Failing after 5m16s
Full verification / local-brain (push) Failing after 6m15s
Realm simulation / simulated-live-world (push) Failing after 5m32s
WoW integration lab / real-worldserver (push) Canceled after 17m23s
Source branch: feature/ai-brain-router Source commit: c2a09e0460465201a58aaab56c71424e9a96405e
29 lines
929 B
TypeScript
29 lines
929 B
TypeScript
import { env } from 'cloudflare:workers';
|
|
import { D1Store } from '@/core/store';
|
|
import { rawAleEnabled } from '@/core/ale-auth';
|
|
import { recentAleEvents } from '@/core/ale-store';
|
|
import type { RuntimeConfig } from '@/core/types';
|
|
|
|
export async function GET(){
|
|
const c=env as unknown as RuntimeConfig;
|
|
try{
|
|
await new D1Store().load();
|
|
const aleEvents=await recentAleEvents(env.DB!,20);
|
|
const lastAleAt=aleEvents[0]?.at??null;
|
|
const aleActiveRecently=!!lastAleAt&&Date.now()-Date.parse(lastAleAt)<90_000;
|
|
return Response.json({
|
|
ok:true,
|
|
aleActiveRecently,
|
|
lastAleAt,
|
|
bridgeConfigured:!!(c.BRIDGE_URL&&c.BRIDGE_TOKEN),
|
|
aleConfigured:!!c.ALE_BRIDGE_TOKEN,
|
|
aleOperatorConfigured:!!c.ALE_OPERATOR_TOKEN,
|
|
aleRawEnabled:rawAleEnabled(c),
|
|
llmConfigured:!!c.LLM_URL,
|
|
soapConfigured:!!(c.SOAP_URL&&c.SOAP_USER&&c.SOAP_PASSWORD)
|
|
});
|
|
}catch{
|
|
return Response.json({ok:false},{status:503});
|
|
}
|
|
}
|