Commit 19faa7a9 authored by Chunchi Che's avatar Chunchi Che

add Agent Container

parent 01992c4f
Pipeline #28469 passed with stages
in 9 minutes and 49 seconds
...@@ -12,6 +12,7 @@ import { Context } from "./context"; ...@@ -12,6 +12,7 @@ import { Context } from "./context";
import { Container } from "./impl"; import { Container } from "./impl";
const UI_KEY = "NEOS_UI"; const UI_KEY = "NEOS_UI";
const AGENT_KEY = "NEOS_AGENT";
export function initUIContainer(conn: WebSocketStream) { export function initUIContainer(conn: WebSocketStream) {
const context = new Context({ const context = new Context({
...@@ -35,3 +36,20 @@ export function getUIContainer(): Container { ...@@ -35,3 +36,20 @@ export function getUIContainer(): Container {
throw Error("UI Container not initialized !!"); throw Error("UI Container not initialized !!");
} }
} }
export function initAgentContainer(conn: WebSocketStream) {
const context = new Context({});
const container = new Container(context, conn);
CONTAINERS.set(AGENT_KEY, container);
}
export function getAgentContainer(): Container {
const container = CONTAINERS.get(AGENT_KEY);
if (container) {
return container;
} else {
throw Error("Agent Container not initialized !!");
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment