feat(tcs): bind history revisit to current persona subject
This commit is contained in:
parent
2d6436261e
commit
ab3c4e05a9
15 changed files with 523 additions and 7 deletions
|
|
@ -36,6 +36,15 @@ const server = http.createServer(async (request, response) => {
|
|||
}
|
||||
if (request.method === "GET" && url.pathname === "/v1/status") return send(response, 200, engine.status());
|
||||
if (request.method === "GET" && url.pathname === "/v1/attention") return send(response, 200, { schema: "guanghu.tcs-mother-attention/v1", current_attention: engine.status().current_attention });
|
||||
if (request.method === "POST" && url.pathname === "/v1/history/sources") {
|
||||
return send(response, 200, engine.registerHistorySource(await readBody(request)));
|
||||
}
|
||||
if (request.method === "POST" && url.pathname === "/v1/history/revisit") {
|
||||
const input = await readBody(request);
|
||||
const task = queue.then(() => engine.revisitHistory(input));
|
||||
queue = task.catch(() => undefined);
|
||||
return send(response, 200, await task);
|
||||
}
|
||||
if (request.method === "POST" && url.pathname === "/v1/events") {
|
||||
const input = await readBody(request);
|
||||
const task = queue.then(() => engine.perceive(input));
|
||||
|
|
|
|||
Loading…
Reference in a new issue