SYMBOL INDEX (225 symbols across 31 files) FILE: app.js function main (line 4) | async function main() { FILE: prisma/migrations/20240227161545_init/migration.sql type "User" (line 2) | CREATE TABLE "User" ( type "Room" (line 11) | CREATE TABLE "Room" ( type "Message" (line 20) | CREATE TABLE "Message" ( type "Memory" (line 32) | CREATE TABLE "Memory" ( type "ShortTermMemory" (line 45) | CREATE TABLE "ShortTermMemory" ( type "LongTermMemory" (line 59) | CREATE TABLE "LongTermMemory" ( type "_RoomMembers" (line 73) | CREATE TABLE "_RoomMembers" ( type "_RoomMembers" (line 81) | CREATE UNIQUE INDEX "_RoomMembers_AB_unique" ON "_RoomMembers"("A", "B") type "_RoomMembers" (line 84) | CREATE INDEX "_RoomMembers_B_index" ON "_RoomMembers"("B") FILE: src/index.ts type MiGPTConfig (line 8) | type MiGPTConfig = Omit & { class MiGPT (line 12) | class MiGPT { method reset (line 14) | static async reset() { method create (line 23) | static create(config: MiGPTConfig) { method constructor (line 39) | constructor(config: MiGPTConfig & { fromCreate?: boolean }) { method start (line 52) | async start() { method stop (line 61) | async stop() { FILE: src/services/bot/config.ts type IBotIndex (line 27) | interface IBotIndex { type IBotConfig (line 32) | interface IBotConfig { class _BotConfig (line 38) | class _BotConfig { method _getIndex (line 44) | private async _getIndex(): Promise { method get (line 51) | async get(): Promise { method update (line 99) | async update( FILE: src/services/bot/conversation.ts type MessageContext (line 8) | interface MessageContext extends IBotConfig { type MessageWithSender (line 11) | interface MessageWithSender class ConversationManager (line 16) | class ConversationManager { method constructor (line 18) | constructor(config: DeepPartial) { method init (line 22) | async init() { method get (line 26) | async get(): Promise> { method update (line 38) | async update(config?: DeepPartial) { method getMessages (line 42) | async getMessages(options?: { method onMessage (line 60) | async onMessage(ctx: MessageContext, msg: MessageWithSender) { FILE: src/services/bot/index.ts type MyBotConfig (line 74) | type MyBotConfig = DeepPartial & { class MyBot (line 79) | class MyBot { method constructor (line 83) | constructor(config: MyBotConfig) { method stop (line 139) | stop() { method run (line 143) | async run() { method ask (line 152) | async ask(msg: QueryMessage): Promise { method chatWithStreamResponse (line 214) | static async chatWithStreamResponse( FILE: src/services/bot/memory/index.ts class MemoryManager (line 12) | class MemoryManager { method constructor (line 21) | constructor(room: Room, owner?: User) { method getMemories (line 26) | async getMemories(options?: { take?: number }) { method getShortTermMemories (line 30) | async getShortTermMemories(options?: { take?: number }) { method getLongTermMemories (line 38) | async getLongTermMemories(options?: { take?: number }) { method getRelatedMemories (line 46) | async getRelatedMemories(limit: number): Promise { method addMessage2Memory (line 52) | async addMessage2Memory(ctx: MessageContext, message: Message) { method _onMemory (line 65) | private _onMemory(ctx: MessageContext, currentMemory: Memory) { method updateLongShortTermMemory (line 79) | async updateLongShortTermMemory( method _updateShortTermMemory (line 97) | private async _updateShortTermMemory( method _updateLongTermMemory (line 135) | private async _updateLongTermMemory( FILE: src/services/bot/memory/long-term.ts class LongTermMemoryAgent (line 51) | class LongTermMemoryAgent { method generate (line 52) | static async generate( FILE: src/services/bot/memory/short-term.ts class ShortTermMemoryAgent (line 49) | class ShortTermMemoryAgent { method generate (line 50) | static async generate( FILE: src/services/db/index.ts function runWithDB (line 11) | function runWithDB(main: () => Promise) { function getSkipWithCursor (line 23) | function getSkipWithCursor(skip: number, cursorId: any) { function getDBInfo (line 30) | function getDBInfo() { function initDB (line 43) | async function initDB(debug = false) { FILE: src/services/db/memory-long-term.ts class _LongTermMemoryCRUD (line 5) | class _LongTermMemoryCRUD { method count (line 6) | async count(options?: { cursorId?: number; room?: Room; owner?: User }) { method get (line 22) | async get(id: number) { method gets (line 29) | async gets(options?: { method addOrUpdate (line 62) | async addOrUpdate( FILE: src/services/db/memory-short-term.ts class _ShortTermMemoryCRUD (line 5) | class _ShortTermMemoryCRUD { method count (line 6) | async count(options?: { cursorId?: number; room?: Room; owner?: User }) { method get (line 22) | async get(id: number) { method gets (line 29) | async gets(options?: { method addOrUpdate (line 62) | async addOrUpdate( FILE: src/services/db/memory.ts class _MemoryCRUD (line 5) | class _MemoryCRUD { method count (line 6) | async count(options?: { cursorId?: number; room?: Room; owner?: User }) { method get (line 22) | async get( method gets (line 41) | async gets(options?: { method addOrUpdate (line 81) | async addOrUpdate( FILE: src/services/db/message.ts class _MessageCRUD (line 5) | class _MessageCRUD { method count (line 6) | async count(options?: { cursorId?: number; room?: Room; sender?: User ... method get (line 22) | async get( method gets (line 35) | async gets(options?: { method addOrUpdate (line 71) | async addOrUpdate( FILE: src/services/db/room.ts function getRoomID (line 4) | function getRoomID(users: User[]) { class _RoomCRUD (line 11) | class _RoomCRUD { method count (line 12) | async count(options?: { user?: User }) { method get (line 30) | async get( method gets (line 43) | async gets(options?: { method addOrUpdate (line 77) | async addOrUpdate( FILE: src/services/db/user.ts class _UserCRUD (line 4) | class _UserCRUD { method count (line 5) | async count() { method get (line 12) | async get( method gets (line 25) | async gets(options?: { method addOrUpdate (line 56) | async addOrUpdate( FILE: src/services/openai.ts type ChatOptions (line 14) | interface ChatOptions { class OpenAIClient (line 25) | class OpenAIClient { method _init (line 33) | private _init() { method cancel (line 49) | cancel(requestId: string) { method chat (line 57) | async chat(options: ChatOptions) { method chatStream (line 104) | async chatStream( FILE: src/services/speaker/ai.ts type AISpeakerConfig (line 10) | type AISpeakerConfig = SpeakerConfig & { type AnswerStep (line 88) | type AnswerStep = ( class AISpeaker (line 93) | class AISpeaker extends Speaker { method constructor (line 108) | constructor(config: AISpeakerConfig) { method enterKeepAlive (line 141) | async enterKeepAlive() { method exitKeepAlive (line 155) | async exitKeepAlive() { method commands (line 166) | get commands() { method askAIForAnswer (line 264) | async askAIForAnswer(msg: QueryMessage) { FILE: src/services/speaker/base.ts type TTSProvider (line 15) | type TTSProvider = "xiaoai" | "custom"; type Speaker (line 17) | type Speaker = { type ActionCommand (line 23) | type ActionCommand = [number, number]; type PropertyCommand (line 24) | type PropertyCommand = [number, number, number]; type BaseSpeakerConfig (line 26) | type BaseSpeakerConfig = MiServiceConfig & { class BaseSpeaker (line 89) | class BaseSpeaker { method constructor (line 103) | constructor(config: BaseSpeakerConfig) { method initMiServices (line 129) | async initMiServices() { method wakeUp (line 158) | wakeUp() { method unWakeUp (line 165) | async unWakeUp() { method checkIfHasNewMsg (line 183) | checkIfHasNewMsg() { method response (line 186) | async response(options: { method _response (line 290) | private async _response(options: { method switchSpeaker (line 416) | async switchSpeaker(speaker: string) { FILE: src/services/speaker/speaker.ts type QueryMessage (line 7) | interface QueryMessage { type SpeakerAnswer (line 16) | interface SpeakerAnswer { type SpeakerCommand (line 22) | interface SpeakerCommand { type SpeakerConfig (line 30) | type SpeakerConfig = BaseSpeakerConfig & { class Speaker (line 49) | class Speaker extends BaseSpeaker { method constructor (line 54) | constructor(config: SpeakerConfig) { method stop (line 69) | stop() { method run (line 73) | async run() { method activeKeepAliveMode (line 98) | async activeKeepAliveMode() { method commands (line 116) | get commands() { method addCommand (line 120) | addCommand(command: SpeakerCommand) { method onMessage (line 124) | async onMessage(msg: QueryMessage) { method enterKeepAlive (line 152) | async enterKeepAlive() { method exitKeepAlive (line 157) | async exitKeepAlive() { method exitKeepAliveIfNeeded (line 163) | async exitKeepAliveIfNeeded() { method checkIfHasNewMsg (line 181) | checkIfHasNewMsg(currentMsg?: QueryMessage) { method fetchNextMessage (line 190) | async fetchNextMessage(): Promise { method _fetchFirstMessage (line 199) | private async _fetchFirstMessage() { method _fetchNextMessage (line 207) | private async _fetchNextMessage(): Promise { method _fetchNext2Messages (line 221) | private async _fetchNext2Messages() { method _fetchNextTempMessage (line 249) | private _fetchNextTempMessage() { method _fetchNextRemainingMessages (line 255) | private async _fetchNextRemainingMessages(maxPage = 3) { method getMessages (line 285) | async getMessages(options?: { FILE: src/services/speaker/stream.ts type ResponseStatus (line 4) | type ResponseStatus = "idle" | "responding" | "finished" | "canceled"; type StreamResponseOptions (line 6) | interface StreamResponseOptions { class StreamResponse (line 21) | class StreamResponse { method createStreamResponse (line 23) | static createStreamResponse(text: string, options?: StreamResponseOpti... method constructor (line 35) | constructor(options?: StreamResponseOptions) { method cancel (line 44) | cancel() { method addResponse (line 51) | addResponse(_text: string) { method getNextResponse (line 67) | getNextResponse(): { nextSentence?: string; noMore: boolean } { method finish (line 83) | finish(finalResult?: string) { method _forceChunkText (line 93) | private _forceChunkText() { method getFinalResult (line 99) | async getFinalResult() { method _batchSubmitImmediately (line 116) | private _batchSubmitImmediately() { method _batchSubmit (line 129) | private _batchSubmit(text: string) { method _addResponse (line 147) | private _addResponse(text: string, options?: { force: boolean }) { method _findLastCutIndex (line 164) | private _findLastCutIndex(text: string): number { FILE: src/utils/base.ts function timestamp (line 4) | function timestamp() { function sleep (line 8) | async function sleep(time: number) { function println (line 12) | function println(...v: any[]) { function printJson (line 16) | function printJson(obj: any) { function firstOf (line 20) | function firstOf(datas?: T[]) { function lastOf (line 24) | function lastOf(datas?: T[]) { function randomInt (line 32) | function randomInt(min: number, max?: number) { function pickOne (line 40) | function pickOne(datas: T[]) { function range (line 44) | function range(start: number, end?: number) { function clamp (line 52) | function clamp(num: number, min: number, max: number): number { function toInt (line 56) | function toInt(str: string) { function toDouble (line 60) | function toDouble(str: string) { function toFixed (line 64) | function toFixed(n: number, fractionDigits = 2) { function toSet (line 75) | function toSet(datas: T[], byKey?: (e: T) => any) { function withDefault (line 91) | function withDefault(e: any, defaultValue: T): T { function removeEmpty (line 95) | function removeEmpty(data: T): T { function repeat (line 131) | function repeat(text: string, count: number) { FILE: src/utils/diff.ts type Difference (line 3) | interface Difference { type Options (line 8) | interface Options { function isEqual (line 15) | function isEqual(oldObj: any, newObj: any): boolean { function diff (line 29) | function diff( FILE: src/utils/is.ts function isNaN (line 1) | function isNaN(e: unknown): boolean { function isNull (line 5) | function isNull(e: unknown): boolean { function isUndefined (line 9) | function isUndefined(e: unknown): boolean { function isNullish (line 13) | function isNullish(e: unknown): boolean { function isNotNullish (line 17) | function isNotNullish(e: unknown): boolean { function isNumber (line 21) | function isNumber(e: unknown): boolean { function isString (line 25) | function isString(e: unknown): boolean { function isArray (line 29) | function isArray(e: unknown): boolean { function isObject (line 33) | function isObject(e: unknown): boolean { function isEmpty (line 37) | function isEmpty(e: any): boolean { function isNotEmpty (line 48) | function isNotEmpty(e: unknown): boolean { function isStringNumber (line 52) | function isStringNumber(e: any): boolean { function isFunction (line 56) | function isFunction(e: unknown): boolean { function isClass (line 60) | function isClass(e: any): boolean { FILE: src/utils/log.ts class _LoggerManager (line 5) | class _LoggerManager { method excludes (line 9) | excludes(tags: string[]) { method includes (line 13) | includes(tags: string[]) { method _getLogs (line 22) | private _getLogs(tag: string, ...args: any[]) { method log (line 38) | log(tag: string, args: any[] = []) { method debug (line 45) | debug(tag: string, args: any[]) { method success (line 52) | success(tag: string, args: any[]) { method error (line 59) | error(tag: string, args: any[]) { method assert (line 66) | assert(tag: string, value: any, args: any[]) { type LoggerConfig (line 77) | interface LoggerConfig { class _Logger (line 81) | class _Logger { method constructor (line 84) | constructor(config?: LoggerConfig) { method create (line 90) | create(config?: LoggerConfig) { method log (line 94) | log(...args: any[]) { method debug (line 100) | debug(...args: any[]) { method success (line 106) | success(...args: any[]) { method error (line 112) | error(...args: any[]) { method assert (line 118) | assert(value: any, ...args: any[]) { FILE: src/utils/parse.ts function cleanJsonAndDecode (line 4) | function cleanJsonAndDecode(input: string | undefined | null) { function jsonEncode (line 16) | function jsonEncode(obj: any, options?: { prettier?: boolean }) { function jsonDecode (line 25) | function jsonDecode(json: string | null | undefined) { FILE: src/utils/retry.ts method onResponse (line 6) | onResponse(resp: any) { FILE: src/utils/shell.ts type StdIO (line 6) | interface StdIO { class Shell (line 12) | class Shell { method args (line 13) | static get args() { method run (line 17) | static async run( FILE: src/utils/string.ts function toUTC8Time (line 25) | function toUTC8Time(date: Date) { function buildPrompt (line 38) | function buildPrompt( function formatMsg (line 49) | function formatMsg(msg: { function formatDateTime (line 58) | function formatDateTime(date: Date) { function removeEmojis (line 72) | function removeEmojis(text: string) { FILE: src/utils/type.ts type DeepPartial (line 1) | type DeepPartial = { type MakeOptional (line 5) | type MakeOptional = Omit & type MakeRequired (line 8) | type MakeRequired = T & Required>; FILE: tests/index.ts function main (line 5) | async function main() {