diff --git a/packages/core.gbapp/services/GBDeployer.ts b/packages/core.gbapp/services/GBDeployer.ts index 2e3bbee1..4061a3e9 100644 --- a/packages/core.gbapp/services/GBDeployer.ts +++ b/packages/core.gbapp/services/GBDeployer.ts @@ -831,9 +831,11 @@ export class GBDeployer implements IGBDeployer { express.static(urlJoin('work', gbaiName, filename, 'audios'))); GBServer.globals.server.use(`/kb/${gbaiName}/${packageName}/videos`, express.static(urlJoin('work', gbaiName, filename, 'videos'))); - - GBServer.globals.server.use(`/${botId}/cache`, + GBServer.globals.server.use(`/${botId}/cache`, express.static(urlJoin('work', gbaiName, 'cache'))); + GBServer.globals.server.use(`/${gbaiName}/${botId}.gbdata/public`, + express.static(urlJoin('work', gbaiName, `${botId}.gbdata`, 'public'))); + GBLog.info(`KB (.gbkb) assets accessible at: /kb/${botId}.gbai/${packageName}.`); diff --git a/packages/security.gbapp/services/SecService.ts b/packages/security.gbapp/services/SecService.ts index 1cb0b84e..32a494dc 100644 --- a/packages/security.gbapp/services/SecService.ts +++ b/packages/security.gbapp/services/SecService.ts @@ -193,16 +193,15 @@ export class SecService extends GBService { const list = process.env.TRANSFER_TO.split(';'); await CollectionUtil.asyncForEach(list, async item => { if ( - !(await this.isAgentSystemId(item)) && - item !== undefined && - agentSystemId === undefined && - item !== userSystemId + !(item !== undefined && + agentSystemId === undefined && + item !== userSystemId && await this.isAgentSystemId(item)) ) { // TODO: Optimize loop. agentSystemId = item; } }); - + await this.updateHumanAgent(userSystemId, instanceId, agentSystemId); return agentSystemId;