optimized performance

This commit is contained in:
dswbx
2025-08-14 10:05:15 +02:00
parent 70f0240da5
commit 9ac5fa03c6
28 changed files with 134 additions and 66 deletions

View File

@@ -96,6 +96,7 @@ export class App<C extends Connection = Connection, Options extends AppOptions =
private trigger_first_boot = false;
private _building: boolean = false;
private _systemController: SystemController | null = null;
constructor(
public connection: C,
@@ -172,8 +173,8 @@ export class App<C extends Connection = Connection, Options extends AppOptions =
// load system controller
guard.registerPermissions(Object.values(SystemPermissions));
const systemController = new SystemController(this);
systemController.register(this);
this._systemController = new SystemController(this);
this._systemController.register(this);
// emit built event
$console.log("App built");
@@ -205,6 +206,10 @@ export class App<C extends Connection = Connection, Options extends AppOptions =
return this.modules.ctx().em;
}
get mcp() {
return this._systemController?._mcpServer;
}
get fetch(): Hono["fetch"] {
return this.server.fetch as any;
}