flexbiz-server 12.7.7 → 12.7.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -6
- package/server/agents/agents.js +1 -1
- package/server/agents/ai_memory_manager.js +1 -6
- package/server/agents/ceoAgent.js +1 -43
- package/server/agents/chatController.js +1 -6
- package/server/agents/cskhAgent.js +1 -43
- package/server/agents/flowAgent.js +1 -43
- package/server/agents/prompts/ceo.js +1 -2
- package/server/agents/prompts/flow.js +1 -2
- package/server/agents/staffAgent.js +1 -44
- package/server/agents/tools/financeTools.js +1 -57
- package/server/agents/tools/flowTools.js +1 -36
- package/server/agents/tools/kpiTools.js +1 -104
- package/server/agents/tools/masterDataTools.js +1 -74
- package/server/agents/tools/okrTools.js +1 -21
- package/server/agents/tools/ragTools.js +1 -21
- package/server/agents/tools/reportTools.js +1 -43
- package/server/agents/tools/staffTools.js +1 -13
- package/server/agents/tools/stockTools.js +1 -41
- package/server/agents/tools/systemTools.js +1 -52
- package/server/agents/tools/taskTools.js +1 -23
- package/server/agents/tools/utils.js +1 -57
- package/server/app.js +1 -27
- package/server/auths/authMiddleware.js +1 -3
- package/server/auths/bearer.js +1 -3
- package/server/auths/facebook.js +1 -12
- package/server/auths/google.js +1 -13
- package/server/auths/joinApp.js +1 -0
- package/server/auths/local.js +1 -67
- package/server/auths/oauthCommon.js +1 -0
- package/server/auths/rateLimiterMiddleware.js +1 -11
- package/server/cluster.js +1 -1
- package/server/controllers/controller.js +1 -129
- package/server/controllers/controllerRPT.js +1 -38
- package/server/controllers/controllerUtils.js +1 -72
- package/server/controllers/createHandler.js +1 -35
- package/server/controllers/createRouteHandler.js +1 -4
- package/server/controllers/deleteHandler.js +1 -11
- package/server/controllers/deleteManyHandler.js +1 -2
- package/server/controllers/exportHandler.js +1 -19
- package/server/controllers/findHandler.js +1 -80
- package/server/controllers/handlers.js +1 -3
- package/server/controllers/historyHandler.js +1 -8
- package/server/controllers/importFromExcelHandler.js +1 -17
- package/server/controllers/importFromGsHandler.js +1 -10
- package/server/controllers/importFromJsonHandler.js +1 -6
- package/server/controllers/importHandler.js +1 -26
- package/server/controllers/logHandler.js +1 -5
- package/server/controllers/rptCreateRouteHandler.js +1 -4
- package/server/controllers/rptExcelHandler.js +1 -45
- package/server/controllers/rptHandler.js +1 -16
- package/server/controllers/updateBookHandler.js +1 -11
- package/server/controllers/updateFieldHandler.js +1 -12
- package/server/controllers/updateHandler.js +1 -38
- package/server/controllers/updateKeyHandler.js +1 -14
- package/server/controllers/viewHandler.js +1 -13
- package/server/data/sys/listinfo.js +93 -93
- package/server/data/sys/menuinfo.js +1 -24
- package/server/data/sys/moduleinfo.js +520 -9000
- package/server/data/sys/reportinfo.js +10 -10
- package/server/flow/FlowCluster.js +1 -0
- package/server/flow/FlowEngine.js +1 -68
- package/server/flow/WebhookManager.js +1 -26
- package/server/flow/handlers.js +1 -3
- package/server/flow/nodes/aiAnalysis.js +1 -9
- package/server/flow/nodes/checkAction.js +1 -7
- package/server/flow/nodes/customer.js +1 -15
- package/server/flow/nodes/data.js +1 -17
- package/server/flow/nodes/debug.js +1 -2
- package/server/flow/nodes/delay.js +1 -3
- package/server/flow/nodes/email.js +1 -8
- package/server/flow/nodes/event.js +1 -12
- package/server/flow/nodes/facebook.js +1 -3
- package/server/flow/nodes/facebookConversations.js +1 -5
- package/server/flow/nodes/facebookCreatePost.js +1 -10
- package/server/flow/nodes/facebookSendMessage.js +1 -12
- package/server/flow/nodes/forEachItem.js +1 -8
- package/server/flow/nodes/function.js +1 -4
- package/server/flow/nodes/httprequest.js +1 -7
- package/server/flow/nodes/inject.js +1 -14
- package/server/flow/nodes/pushNotification.js +1 -5
- package/server/flow/nodes/report.js +1 -6
- package/server/flow/nodes/saveData.js +1 -2
- package/server/flow/nodes/switch.js +1 -20
- package/server/flow/nodes/userform.js +1 -28
- package/server/flow/nodes/webhook.js +1 -1
- package/server/flow/nodes/zaloSendMessage.js +1 -4
- package/server/flow/utils.js +1 -67
- package/server/global.js +1 -19
- package/server/libs/WorkerPool.js +1 -4
- package/server/libs/WorkerStaticPool.js +1 -20
- package/server/libs/WorkerStaticPool_v1.js +1 -5
- package/server/libs/WorkerStaticPool_v2.js +1 -16
- package/server/libs/WorkerStaticPool_v3.js +1 -19
- package/server/libs/WorkerStaticPool_v5.js +1 -0
- package/server/libs/assbonus.js +1 -7
- package/server/libs/asyncCompat.js +1 -10
- package/server/libs/backup.js +1 -2
- package/server/libs/blockchainconnect.js +1 -12
- package/server/libs/cdpsdiem.js +1 -5
- package/server/libs/cdpsdt.js +1 -7
- package/server/libs/cdpskh.js +1 -15
- package/server/libs/cdpskh_old.js +1 -9
- package/server/libs/cdpsnphep.js +1 -6
- package/server/libs/cdpstk.js +1 -11
- package/server/libs/ckcn.js +1 -14
- package/server/libs/ckcn_old.js +1 -11
- package/server/libs/ckdiem.js +1 -5
- package/server/libs/ckdt.js +1 -6
- package/server/libs/cknphep.js +1 -6
- package/server/libs/cktk.js +1 -4
- package/server/libs/cktt.js +1 -10
- package/server/libs/cktt_old.js +1 -9
- package/server/libs/ckvt.js +1 -14
- package/server/libs/ckvt_old.js +1 -12
- package/server/libs/ckvtcapphat.js +1 -6
- package/server/libs/ckvtnpp.js +1 -9
- package/server/libs/ckvttt.js +1 -12
- package/server/libs/createSocaitheongay.js +1 -9
- package/server/libs/ctdiem.js +1 -5
- package/server/libs/ctvt.js +1 -8
- package/server/libs/ctvtnpp.js +1 -8
- package/server/libs/ctvttt.js +1 -7
- package/server/libs/databanle.js +1 -17
- package/server/libs/databanle_old.js +1 -18
- package/server/libs/databanlenpp.js +1 -8
- package/server/libs/databanletheongay.js +1 -25
- package/server/libs/dkcn.js +1 -14
- package/server/libs/dkcn_old.js +1 -10
- package/server/libs/dkdiem.js +1 -5
- package/server/libs/dkdt.js +1 -6
- package/server/libs/dknphep.js +1 -7
- package/server/libs/dktk.js +1 -5
- package/server/libs/dktt.js +1 -10
- package/server/libs/dktt_old.js +1 -8
- package/server/libs/dkvt.js +1 -12
- package/server/libs/dkvt_old.js +1 -9
- package/server/libs/dkvtnpp.js +1 -8
- package/server/libs/dkvttt.js +1 -8
- package/server/libs/dncn.js +1 -6
- package/server/libs/dntk.js +1 -4
- package/server/libs/dntt.js +1 -6
- package/server/libs/docs.js +1 -672
- package/server/libs/dstkcn.js +1 -1
- package/server/libs/dstktt.js +1 -1
- package/server/libs/dtbanletheonpp.js +1 -17
- package/server/libs/dtbanletheosp.js +1 -16
- package/server/libs/dtbanletheospnpp.js +1 -15
- package/server/libs/email.js +1 -3
- package/server/libs/excel.js +1 -3
- package/server/libs/excelHelper.js +1 -10
- package/server/libs/executiveDashboard.js +1 -8
- package/server/libs/fifo_dk.js +1 -8
- package/server/libs/fifo_group.js +1 -4
- package/server/libs/fifo_trace_query.js +1 -12
- package/server/libs/getGiaban.js +1 -59
- package/server/libs/getGiabanAsync.js +1 -1
- package/server/libs/getGiaban_old.js +1 -70
- package/server/libs/getNotifies.js +1 -1
- package/server/libs/htmlReport.js +1 -9
- package/server/libs/initDatabase.js +1 -9
- package/server/libs/invoiceEasy.js +1 -108
- package/server/libs/invoiceViettel.js +1 -25
- package/server/libs/invoiceVnpt.js +1 -22
- package/server/libs/joinData.js +1 -44
- package/server/libs/joinData_bk.js +1 -44
- package/server/libs/kpistatus.js +1 -47
- package/server/libs/kqchamcong.js +1 -12
- package/server/libs/kqhdkd.js +1 -8
- package/server/libs/load-template.js +1 -3
- package/server/libs/logger.js +1 -3
- package/server/libs/mailmanagement.js +1 -13
- package/server/libs/mongooseDeletePost.js +1 -6
- package/server/libs/mongooseLeanId.js +1 -1
- package/server/libs/mongoosePatch.js +1 -14
- package/server/libs/mongooseSecurityPlugin.js +1 -16
- package/server/libs/onepay-payment.js +1 -4
- package/server/libs/optimizeBookkeeping.js +1 -22
- package/server/libs/optimizeBookkeeping_bk.js +1 -14
- package/server/libs/parse-template.js +1 -5
- package/server/libs/permission.js +1 -58
- package/server/libs/permission_old.js +1 -58
- package/server/libs/phanbokh.js +1 -3
- package/server/libs/post-book.js +1 -22
- package/server/libs/post-socai.js +1 -25
- package/server/libs/post-sokho.js +1 -26
- package/server/libs/prototypes.js +1 -24
- package/server/libs/psdt.js +1 -1
- package/server/libs/pskh.js +1 -1
- package/server/libs/pstk.js +1 -1
- package/server/libs/queryBuilding.js +1 -15
- package/server/libs/redis-cache.js +1 -34
- package/server/libs/restore.js +1 -1
- package/server/libs/sctcnkh.js +1 -20
- package/server/libs/sessionContext.js +2 -14
- package/server/libs/socaitk.js +1 -9
- package/server/libs/textReport.js +1 -5
- package/server/libs/thnxt.js +1 -17
- package/server/libs/thnxt_old.js +1 -9
- package/server/libs/thnxtnpp.js +1 -9
- package/server/libs/thnxttt.js +1 -9
- package/server/libs/tinhGt.js +1 -10
- package/server/libs/tinhGtCapnhatPNK.js +1 -7
- package/server/libs/tinhGtPhanboHeSo.js +1 -12
- package/server/libs/tinhGtPhanboSltp.js +1 -10
- package/server/libs/tinhGtPhanboYtcp.js +1 -11
- package/server/libs/tinhGtSltk.js +1 -9
- package/server/libs/tinhGtThcppstk.js +1 -10
- package/server/libs/tinhGtTrucTiep.js +1 -7
- package/server/libs/tinhGtXoa.js +1 -3
- package/server/libs/tinhgia1vt_fifo.js +1 -22
- package/server/libs/tinhgiafifo.js +1 -28
- package/server/libs/tinhgiatb.js +1 -30
- package/server/libs/tinhgiatb1vt.js +1 -7
- package/server/libs/tinhgiatb1vt_old.js +1 -5
- package/server/libs/tinhgiatb_old.js +1 -39
- package/server/libs/tinhhoahong.js +1 -64
- package/server/libs/tinhhoahongnpp.js +1 -46
- package/server/libs/tinhkhauhao1ts.js +1 -12
- package/server/libs/tinhkhauhaots.js +1 -8
- package/server/libs/tinhkhauhaots_old.js +1 -0
- package/server/libs/tuoinophaithu.js +1 -11
- package/server/libs/tuoinophaithu_old.js +1 -0
- package/server/libs/tuoinophaitra.js +1 -12
- package/server/libs/tuoinophaitra_old.js +1 -0
- package/server/libs/utils.js +1 -121
- package/server/libs/utils_old.js +1 -0
- package/server/libs/validate.js +1 -4
- package/server/libs/validator-acc-cust.js +1 -1
- package/server/libs/validator-account.js +1 -4
- package/server/libs/validator-vt.js +1 -2
- package/server/libs/validator.js +1 -11
- package/server/libs/vectorService.js +1 -16
- package/server/libs/viCollation.js +1 -4
- package/server/libs/vsocai.js +1 -11
- package/server/libs/vsocai_old.js +1 -7
- package/server/libs/vsocai_old2.js +1 -0
- package/server/maps-demo/participant.js +18 -0
- package/server/models/account.js +1 -7
- package/server/models/actionLog.js +1 -2
- package/server/models/afflink.js +1 -2
- package/server/models/aimemory.js +1 -1
- package/server/models/app.js +1 -16
- package/server/models/approve.js +1 -95
- package/server/models/assabcihandler.js +1 -35
- package/server/models/assbank.js +1 -19
- package/server/models/assbooking.js +1 -4
- package/server/models/assbuy.js +1 -3
- package/server/models/asscashwithdraw.js +1 -4
- package/server/models/assfindhash.js +1 -2
- package/server/models/assinvestment.js +1 -13
- package/server/models/assissue.js +1 -2
- package/server/models/asskey.js +1 -15
- package/server/models/assneedtobuy.js +1 -6
- package/server/models/assperiod.js +1 -7
- package/server/models/assproduct.js +1 -13
- package/server/models/assprofitsharing.js +1 -4
- package/server/models/assreceiver.js +1 -2
- package/server/models/assrequest.js +1 -10
- package/server/models/asssell.js +1 -7
- package/server/models/asstransaction.js +1 -3
- package/server/models/asstransfer.js +1 -4
- package/server/models/assuser_identity.js +1 -4
- package/server/models/asswithdraw.js +1 -4
- package/server/models/attend.js +1 -2
- package/server/models/banggiaban.js +1 -8
- package/server/models/bangtinhluong.js +1 -5
- package/server/models/base.js +1 -1
- package/server/models/bg1.js +1 -9
- package/server/models/bg2.js +1 -10
- package/server/models/cache.js +1 -3
- package/server/models/cacheDataReport.js +1 -2
- package/server/models/cacheSessionReport.js +1 -5
- package/server/models/calllog.js +1 -4
- package/server/models/cart.js +1 -5
- package/server/models/cddiem.js +1 -2
- package/server/models/cddt.js +1 -3
- package/server/models/cdkh.js +1 -5
- package/server/models/cdkhtheongay.js +1 -5
- package/server/models/cdnphep.js +1 -2
- package/server/models/cdtk.js +1 -3
- package/server/models/cdtktheongay.js +1 -3
- package/server/models/cdvt.js +1 -5
- package/server/models/cdvtnpp.js +1 -6
- package/server/models/cdvttheongay.js +1 -5
- package/server/models/chamcong.js +1 -7
- package/server/models/chat_message.js +1 -2
- package/server/models/chat_session.js +1 -2
- package/server/models/checkin.js +1 -4
- package/server/models/checkinactivity.js +1 -3
- package/server/models/checkinkpi.js +1 -4
- package/server/models/checkinlocation.js +1 -2
- package/server/models/chitietluongds.js +1 -12
- package/server/models/chitieukpi.js +1 -3
- package/server/models/chudethaoluan.js +1 -3
- package/server/models/ckgtluong.js +1 -2
- package/server/models/colleague.js +1 -2
- package/server/models/comment.js +1 -4
- package/server/models/congdoansx.js +1 -4
- package/server/models/congtacvien.js +1 -4
- package/server/models/congthuctinhgiaban.js +1 -8
- package/server/models/consultant.js +1 -4
- package/server/models/contract.js +1 -6
- package/server/models/counter.js +1 -2
- package/server/models/csluongtheods.js +1 -3
- package/server/models/csphucap.js +1 -2
- package/server/models/ctds.js +1 -5
- package/server/models/ctds2.js +1 -7
- package/server/models/currency.js +1 -3
- package/server/models/custom_report.js +1 -1
- package/server/models/customer.js +1 -31
- package/server/models/customer_care.js +1 -2
- package/server/models/data_list_config.js +1 -7
- package/server/models/databanle.js +1 -8
- package/server/models/datlich.js +1 -4
- package/server/models/deal.js +1 -2
- package/server/models/dh2.js +1 -20
- package/server/models/diagram.js +1 -2
- package/server/models/dinhmucsx.js +1 -8
- package/server/models/dkhoc.js +1 -6
- package/server/models/dknphep.js +1 -2
- package/server/models/dmban.js +1 -3
- package/server/models/dmbp.js +1 -12
- package/server/models/dmca.js +1 -2
- package/server/models/dmchietkhau.js +1 -8
- package/server/models/dmchietkhauhd.js +1 -19
- package/server/models/dmchinhanh.js +1 -2
- package/server/models/dmcpmh.js +1 -2
- package/server/models/dmdiemthuong.js +1 -3
- package/server/models/dmdoi.js +1 -4
- package/server/models/dmdoituongdanhgia.js +1 -2
- package/server/models/dmdt.js +1 -8
- package/server/models/dmdvt.js +1 -3
- package/server/models/dmgiaban.js +1 -9
- package/server/models/dmgiamua.js +1 -5
- package/server/models/dmgiathitruong.js +1 -5
- package/server/models/dmgiathitruong_ngay.js +1 -2
- package/server/models/dmgiathitruong_theodoi.js +1 -2
- package/server/models/dmhoahonghd.js +1 -8
- package/server/models/dmhoahongnpp.js +1 -8
- package/server/models/dmkc.js +1 -3
- package/server/models/dmkho.js +1 -7
- package/server/models/dmkhuyenmai.js +1 -9
- package/server/models/dmkhuyenmaihd.js +1 -11
- package/server/models/dmletet.js +1 -2
- package/server/models/dmlo.js +1 -4
- package/server/models/dmloaicong.js +1 -4
- package/server/models/dmloaitask.js +1 -2
- package/server/models/dmloaits.js +1 -2
- package/server/models/dmnckkm.js +1 -4
- package/server/models/dmnghiepvu.js +1 -4
- package/server/models/dmnguonvon.js +1 -2
- package/server/models/dmnhnv.js +1 -4
- package/server/models/dmnv.js +1 -17
- package/server/models/dmnvt.js +1 -10
- package/server/models/dmphi.js +1 -3
- package/server/models/dmqct.js +1 -3
- package/server/models/dmqddvt.js +1 -3
- package/server/models/dmtanggiamts.js +1 -3
- package/server/models/dmto.js +1 -4
- package/server/models/dmtt.js +1 -6
- package/server/models/dmvt.js +1 -17
- package/server/models/dmyt.js +1 -4
- package/server/models/dn0.js +1 -13
- package/server/models/dnm.js +1 -11
- package/server/models/dokho.js +1 -2
- package/server/models/domain.js +1 -2
- package/server/models/dvcs.js +1 -3
- package/server/models/ecomcategories.js +1 -3
- package/server/models/ecomcategories_cty.js +1 -3
- package/server/models/ecomproductlines.js +1 -2
- package/server/models/ecompromotion_flashsales.js +1 -2
- package/server/models/ecompromotion_freeships.js +1 -2
- package/server/models/email.js +1 -2
- package/server/models/endpoint.js +1 -1
- package/server/models/events.js +1 -3
- package/server/models/evoucher.js +1 -5
- package/server/models/experiencejourney.js +1 -2
- package/server/models/experiencejourneydata.js +1 -4
- package/server/models/experiencejourneypersona.js +1 -3
- package/server/models/experiencejourneystage.js +1 -2
- package/server/models/exportexceltemplate.js +1 -2
- package/server/models/fbconversation.js +1 -15
- package/server/models/fbmessage.js +1 -2
- package/server/models/fbpage.js +1 -2
- package/server/models/fbpost.js +1 -2
- package/server/models/fieldright.js +1 -2
- package/server/models/fifo_dk.js +1 -2
- package/server/models/fifo_lot.js +1 -3
- package/server/models/fifo_trace.js +1 -4
- package/server/models/file.js +1 -4
- package/server/models/filechunk.js +1 -2
- package/server/models/financialroadmap.js +1 -3
- package/server/models/flow.js +1 -2
- package/server/models/flowdata.js +1 -3
- package/server/models/flowpending.js +1 -2
- package/server/models/folder.js +1 -4
- package/server/models/follow.js +1 -2
- package/server/models/forminfo.js +1 -5
- package/server/models/giaoca.js +1 -3
- package/server/models/giatb.js +1 -3
- package/server/models/group.js +1 -9
- package/server/models/gt_ctgt.js +1 -4
- package/server/models/gt_hspb.js +1 -3
- package/server/models/gt_sltk.js +1 -3
- package/server/models/gt_thcppstk.js +1 -3
- package/server/models/hanmucton.js +1 -4
- package/server/models/hd1.js +1 -11
- package/server/models/hd2.js +1 -26
- package/server/models/hd3.js +1 -17
- package/server/models/hd4.js +1 -13
- package/server/models/hd7.js +1 -17
- package/server/models/hd8.js +1 -12
- package/server/models/hde.js +1 -11
- package/server/models/hmcn.js +1 -3
- package/server/models/hmcnct.js +1 -2
- package/server/models/hspbts.js +1 -4
- package/server/models/htl.js +1 -13
- package/server/models/importexceltemplate.js +1 -2
- package/server/models/introducebonus.js +1 -4
- package/server/models/introducecode.js +1 -3
- package/server/models/introducer.js +1 -4
- package/server/models/kbbtpb.js +1 -7
- package/server/models/kbmPttct.js +1 -4
- package/server/models/kbmTkgtgt.js +1 -5
- package/server/models/kbm_bcdkt_old.js +1 -4
- package/server/models/kbm_kqhdkd_old.js +1 -3
- package/server/models/kbm_lcttgt_old.js +1 -5
- package/server/models/kbm_lctttt_old.js +1 -4
- package/server/models/kbm_pttct_old.js +1 -4
- package/server/models/kbm_tkgtgt_old.js +1 -5
- package/server/models/kbmbcdkt.js +1 -4
- package/server/models/kbmbcqt.js +1 -4
- package/server/models/kbmkqhdkd.js +1 -3
- package/server/models/kbmlcttgt.js +1 -6
- package/server/models/kbmlctttt.js +1 -4
- package/server/models/kbmtmbctc.js +1 -4
- package/server/models/kehoachdtcp.js +1 -3
- package/server/models/kehoachmh.js +1 -8
- package/server/models/keyresult.js +1 -7
- package/server/models/khunghangthanhvien.js +1 -3
- package/server/models/label.js +1 -2
- package/server/models/labelinfo.js +1 -2
- package/server/models/lenhcapphat.js +1 -8
- package/server/models/lenhsx.js +1 -8
- package/server/models/lienhe.js +1 -4
- package/server/models/like_module.js +1 -2
- package/server/models/link.js +1 -2
- package/server/models/listinfo_old.js +1 -124
- package/server/models/loaidiem.js +1 -2
- package/server/models/lock.js +1 -2
- package/server/models/log.js +1 -8
- package/server/models/mailaccount.js +1 -3
- package/server/models/mailgroup.js +1 -3
- package/server/models/mailreceived.js +1 -2
- package/server/models/mailsent.js +1 -2
- package/server/models/mailtemplate.js +1 -2
- package/server/models/maudanhgia.js +1 -2
- package/server/models/menuinfo.js +1 -2
- package/server/models/message.js +1 -8
- package/server/models/message2.js +1 -4
- package/server/models/message2setting.js +1 -3
- package/server/models/moduleinfo.js +1 -4
- package/server/models/momo.js +1 -18
- package/server/models/news.js +1 -3
- package/server/models/newsfeed.js +1 -4
- package/server/models/note.js +1 -2
- package/server/models/notification.js +1 -8
- package/server/models/okr.js +1 -4
- package/server/models/okrdiagram.js +1 -3
- package/server/models/onepay.js +1 -24
- package/server/models/opportunity.js +1 -4
- package/server/models/options.js +1 -2
- package/server/models/originimportid.js +1 -1
- package/server/models/otp.js +1 -1
- package/server/models/parameter.js +1 -2
- package/server/models/participant.js +1 -21
- package/server/models/partner.js +1 -1
- package/server/models/payload.js +1 -1
- package/server/models/pbl.js +1 -16
- package/server/models/pc0.js +1 -13
- package/server/models/pc1.js +1 -14
- package/server/models/pc2.js +1 -13
- package/server/models/pc3.js +1 -13
- package/server/models/pc5.js +1 -8
- package/server/models/pc6.js +1 -14
- package/server/models/pcl.js +1 -6
- package/server/models/pdn.js +1 -9
- package/server/models/pdx.js +1 -9
- package/server/models/pgh.js +1 -5
- package/server/models/phieudanhgia.js +1 -3
- package/server/models/pht.js +1 -8
- package/server/models/phucap.js +1 -4
- package/server/models/pkc.js +1 -6
- package/server/models/pkh.js +1 -6
- package/server/models/pkk.js +1 -10
- package/server/models/pkt.js +1 -12
- package/server/models/pn1.js +1 -18
- package/server/models/pn2.js +1 -12
- package/server/models/pn3.js +1 -13
- package/server/models/pn5.js +1 -14
- package/server/models/pn6.js +1 -14
- package/server/models/pn9.js +1 -17
- package/server/models/pnc.js +1 -9
- package/server/models/pnh.js +1 -11
- package/server/models/pnk.js +1 -10
- package/server/models/po1.js +1 -19
- package/server/models/ppb.js +1 -6
- package/server/models/productcode.js +1 -2
- package/server/models/profile.js +1 -4
- package/server/models/pt1.js +1 -12
- package/server/models/pt5.js +1 -8
- package/server/models/ptl.js +1 -5
- package/server/models/ptthanhtoan.js +1 -6
- package/server/models/purchase_contract.js +1 -17
- package/server/models/pxc.js +1 -9
- package/server/models/pxh.js +1 -11
- package/server/models/pxk.js +1 -9
- package/server/models/qts.js +1 -14
- package/server/models/qts_dieuchinh.js +1 -3
- package/server/models/qts_dieuchuyen.js +1 -4
- package/server/models/quanhuyen.js +1 -2
- package/server/models/reason.js +1 -2
- package/server/models/receivedinvoice.js +1 -2
- package/server/models/reportinfo.js +1 -5
- package/server/models/right.js +1 -4
- package/server/models/rpt.js +1 -2
- package/server/models/rptform.js +1 -3
- package/server/models/rptobject.js +1 -2
- package/server/models/sale_contract.js +1 -9
- package/server/models/schedule.js +1 -18
- package/server/models/schedule_log.js +1 -2
- package/server/models/shipbook.js +1 -12
- package/server/models/shortcut.js +1 -2
- package/server/models/smsaccount.js +1 -10
- package/server/models/smssend.js +1 -2
- package/server/models/so1.js +1 -22
- package/server/models/so5.js +1 -15
- package/server/models/so9.js +1 -19
- package/server/models/socai.js +1 -28
- package/server/models/socainpp.js +1 -18
- package/server/models/socaitc.js +1 -6
- package/server/models/socaitmp.js +1 -16
- package/server/models/socaitt.js +1 -4
- package/server/models/sodiemthuong.js +1 -4
- package/server/models/sokho.js +1 -27
- package/server/models/sokhocapphat.js +1 -18
- package/server/models/sokhokhongton.js +1 -19
- package/server/models/sokhonpp.js +1 -19
- package/server/models/sokhotc.js +1 -8
- package/server/models/sokhott.js +1 -18
- package/server/models/sophanbokh.js +1 -3
- package/server/models/sosanxuat.js +1 -5
- package/server/models/sotinhkh.js +1 -2
- package/server/models/spdd_ck.js +1 -3
- package/server/models/spdd_dk.js +1 -3
- package/server/models/step.js +1 -2
- package/server/models/strategicdiagram.js +1 -3
- package/server/models/strategicgoal.js +1 -4
- package/server/models/strategickpi.js +1 -6
- package/server/models/strategicobjective.js +1 -5
- package/server/models/strategicplan.js +1 -5
- package/server/models/subscribe.js +1 -2
- package/server/models/support.js +1 -2
- package/server/models/synctime.js +1 -2
- package/server/models/sys_job_queue_book_keeping.js +1 -2
- package/server/models/sysconfig.js +1 -2
- package/server/models/sysgroup.js +1 -2
- package/server/models/tableinfo.js +1 -3
- package/server/models/task.js +1 -9
- package/server/models/tc.js +1 -2
- package/server/models/tdttco.js +1 -9
- package/server/models/tdttco_tt.js +1 -5
- package/server/models/tdttno.js +1 -9
- package/server/models/tdttno_tt.js +1 -5
- package/server/models/templaterpt.js +1 -2
- package/server/models/templatestore.js +1 -3
- package/server/models/templatevoucher.js +1 -3
- package/server/models/tinhthanh.js +1 -2
- package/server/models/tokens.js +1 -3
- package/server/models/tontucthoi.js +1 -9
- package/server/models/trangthai.js +1 -4
- package/server/models/trangthaiapp.js +1 -4
- package/server/models/transaction.js +1 -16
- package/server/models/trialinfo.js +1 -2
- package/server/models/user.js +1 -40
- package/server/models/usergroup.js +1 -7
- package/server/models/vanchuyen.js +1 -12
- package/server/models/vat.js +1 -3
- package/server/models/vatra.js +1 -6
- package/server/models/vatvao.js +1 -6
- package/server/models/versioninfo.js +1 -2
- package/server/models/vietqrbanks.js +1 -2
- package/server/models/vsocai.js +1 -6
- package/server/models/wallet.js +1 -8
- package/server/models/warranty.js +1 -3
- package/server/models/warrantyclaim.js +1 -2
- package/server/models/warrantypolicy.js +1 -1
- package/server/models/workflow.js +1 -4
- package/server/models/xaphuong.js +1 -2
- package/server/models/xhd.js +1 -10
- package/server/models/ytdd_ck.js +1 -4
- package/server/models/ytdd_dk.js +1 -4
- package/server/models/zalo.js +1 -17
- package/server/modules/bot/webhook.js +1 -0
- package/server/modules/lists/bg-cddiem.js +1 -6
- package/server/modules/lists/bg-cddt.js +1 -7
- package/server/modules/lists/bg-cdkh.js +1 -11
- package/server/modules/lists/bg-cdnphep.js +1 -6
- package/server/modules/lists/bg-cdtk.js +1 -9
- package/server/modules/lists/bg-cdvt.js +1 -8
- package/server/modules/lists/bg-cdvtnpp.js +1 -8
- package/server/modules/lists/bg-fifo_dk.js +1 -8
- package/server/modules/lists/ls-account.js +1 -4
- package/server/modules/lists/ls-afflink.js +1 -3
- package/server/modules/lists/ls-approve.js +1 -5
- package/server/modules/lists/ls-assbank.js +1 -3
- package/server/modules/lists/ls-asscashwithdraw.js +1 -8
- package/server/modules/lists/ls-assissue.js +1 -3
- package/server/modules/lists/ls-asskey.js +1 -41
- package/server/modules/lists/ls-assreceiver.js +1 -3
- package/server/modules/lists/ls-assrequest.js +1 -4
- package/server/modules/lists/ls-asstransaction.js +1 -3
- package/server/modules/lists/ls-asstransfer.js +1 -3
- package/server/modules/lists/ls-assuser_identity.js +1 -1
- package/server/modules/lists/ls-bangtinhluong.js +1 -2
- package/server/modules/lists/ls-calllog.js +1 -4
- package/server/modules/lists/ls-cart.js +1 -14
- package/server/modules/lists/ls-chamcong.js +1 -3
- package/server/modules/lists/ls-chat_session.js +1 -5
- package/server/modules/lists/ls-checkin.js +1 -24
- package/server/modules/lists/ls-checkinactivity.js +1 -8
- package/server/modules/lists/ls-checkinkpi.js +1 -3
- package/server/modules/lists/ls-checkinlocation.js +1 -1
- package/server/modules/lists/ls-chitietluongds.js +1 -4
- package/server/modules/lists/ls-chitieukpi.js +1 -1
- package/server/modules/lists/ls-chudethaoluan.js +1 -1
- package/server/modules/lists/ls-ckgtluong.js +1 -1
- package/server/modules/lists/ls-comment.js +1 -9
- package/server/modules/lists/ls-congdoansx.js +1 -3
- package/server/modules/lists/ls-congtacvien.js +1 -5
- package/server/modules/lists/ls-consultant.js +1 -2
- package/server/modules/lists/ls-contract.js +1 -7
- package/server/modules/lists/ls-csluongtheods.js +1 -1
- package/server/modules/lists/ls-csphucap.js +1 -1
- package/server/modules/lists/ls-ctds.js +1 -4
- package/server/modules/lists/ls-ctds2.js +1 -4
- package/server/modules/lists/ls-currency.js +1 -1
- package/server/modules/lists/ls-customer.js +1 -22
- package/server/modules/lists/ls-customer_care.js +1 -1
- package/server/modules/lists/ls-datlich.js +1 -9
- package/server/modules/lists/ls-dckhauhaots.js +1 -3
- package/server/modules/lists/ls-deal.js +1 -3
- package/server/modules/lists/ls-diagram.js +1 -1
- package/server/modules/lists/ls-dkhoc.js +1 -6
- package/server/modules/lists/ls-dknphep.js +1 -1
- package/server/modules/lists/ls-dmban.js +1 -4
- package/server/modules/lists/ls-dmbp.js +1 -7
- package/server/modules/lists/ls-dmca.js +1 -1
- package/server/modules/lists/ls-dmchietkhau.js +1 -19
- package/server/modules/lists/ls-dmchietkhauhd.js +1 -4
- package/server/modules/lists/ls-dmchinhanh.js +1 -1
- package/server/modules/lists/ls-dmchucvu.js +1 -2
- package/server/modules/lists/ls-dmcpmh.js +1 -1
- package/server/modules/lists/ls-dmdiemthuong.js +1 -4
- package/server/modules/lists/ls-dmdoi.js +1 -4
- package/server/modules/lists/ls-dmdoituongdanhgia.js +1 -1
- package/server/modules/lists/ls-dmdt.js +1 -11
- package/server/modules/lists/ls-dmdvt.js +1 -2
- package/server/modules/lists/ls-dmgiaban.js +1 -4
- package/server/modules/lists/ls-dmgiamua.js +1 -4
- package/server/modules/lists/ls-dmgiathitruong.js +1 -15
- package/server/modules/lists/ls-dmgiathitruong_ngay.js +1 -2
- package/server/modules/lists/ls-dmgiathitruong_theodoi.js +1 -1
- package/server/modules/lists/ls-dmhoahonghd.js +1 -1
- package/server/modules/lists/ls-dmhoahongnpp.js +1 -1
- package/server/modules/lists/ls-dmkc.js +1 -3
- package/server/modules/lists/ls-dmkho.js +1 -7
- package/server/modules/lists/ls-dmkhuyenmai.js +1 -5
- package/server/modules/lists/ls-dmkhuyenmaihd.js +1 -3
- package/server/modules/lists/ls-dmletet.js +1 -1
- package/server/modules/lists/ls-dmlo.js +1 -1
- package/server/modules/lists/ls-dmloaicong.js +1 -1
- package/server/modules/lists/ls-dmloaits.js +1 -1
- package/server/modules/lists/ls-dmnckkm.js +1 -7
- package/server/modules/lists/ls-dmnghiepvu.js +1 -1
- package/server/modules/lists/ls-dmnguonvon.js +1 -1
- package/server/modules/lists/ls-dmnhnv.js +1 -6
- package/server/modules/lists/ls-dmnhtask.js +1 -5
- package/server/modules/lists/ls-dmnkh.js +1 -6
- package/server/modules/lists/ls-dmntt.js +1 -6
- package/server/modules/lists/ls-dmnv.js +1 -14
- package/server/modules/lists/ls-dmnvt.js +1 -7
- package/server/modules/lists/ls-dmphi.js +1 -6
- package/server/modules/lists/ls-dmqct.js +1 -2
- package/server/modules/lists/ls-dmqddvt.js +1 -3
- package/server/modules/lists/ls-dmtanggiamts.js +1 -1
- package/server/modules/lists/ls-dmto.js +1 -5
- package/server/modules/lists/ls-dmtt.js +1 -7
- package/server/modules/lists/ls-dmvt.js +1 -52
- package/server/modules/lists/ls-dmyt.js +1 -1
- package/server/modules/lists/ls-dokho.js +1 -1
- package/server/modules/lists/ls-dvcs.js +1 -1
- package/server/modules/lists/ls-ecomcategories.js +1 -5
- package/server/modules/lists/ls-ecomcategories_cty.js +1 -5
- package/server/modules/lists/ls-email.js +1 -4
- package/server/modules/lists/ls-events.js +1 -3
- package/server/modules/lists/ls-evoucher.js +1 -3
- package/server/modules/lists/ls-experiencejourney.js +1 -1
- package/server/modules/lists/ls-experiencejourneydata.js +1 -3
- package/server/modules/lists/ls-experiencejourneypersona.js +1 -4
- package/server/modules/lists/ls-experiencejourneystage.js +1 -1
- package/server/modules/lists/ls-fbconversation.js +1 -2
- package/server/modules/lists/ls-fbmessage.js +1 -2
- package/server/modules/lists/ls-fbpage.js +1 -11
- package/server/modules/lists/ls-fbpost.js +1 -2
- package/server/modules/lists/ls-file.js +1 -38
- package/server/modules/lists/ls-financialroadmap.js +1 -3
- package/server/modules/lists/ls-flow.js +1 -6
- package/server/modules/lists/ls-flowdata.js +1 -1
- package/server/modules/lists/ls-flowpending.js +1 -3
- package/server/modules/lists/ls-folder.js +1 -1
- package/server/modules/lists/ls-forminfo.js +1 -1
- package/server/modules/lists/ls-giaoca.js +1 -5
- package/server/modules/lists/ls-group.js +1 -5
- package/server/modules/lists/ls-hmcn.js +1 -2
- package/server/modules/lists/ls-hspbts.js +1 -3
- package/server/modules/lists/ls-introducebonus.js +1 -4
- package/server/modules/lists/ls-introducecode.js +1 -10
- package/server/modules/lists/ls-introducer.js +1 -21
- package/server/modules/lists/ls-kbm-bcdkt.js +1 -1
- package/server/modules/lists/ls-kbm-bcqt.js +1 -5
- package/server/modules/lists/ls-kbm-kqhdkd.js +1 -1
- package/server/modules/lists/ls-kbm-lcttgt.js +1 -1
- package/server/modules/lists/ls-kbm-lctttt.js +1 -1
- package/server/modules/lists/ls-kbm-pttct.js +1 -3
- package/server/modules/lists/ls-kbm-tkgtgt.js +1 -3
- package/server/modules/lists/ls-kbm-tmbctc.js +1 -3
- package/server/modules/lists/ls-kehoachdtcp.js +1 -4
- package/server/modules/lists/ls-keyresult.js +1 -7
- package/server/modules/lists/ls-khunghangthanhvien.js +1 -1
- package/server/modules/lists/ls-label.js +1 -1
- package/server/modules/lists/ls-lienhe.js +1 -4
- package/server/modules/lists/ls-like-module.js +1 -1
- package/server/modules/lists/ls-link.js +1 -1
- package/server/modules/lists/ls-loaidiem.js +1 -1
- package/server/modules/lists/ls-lock.js +1 -1
- package/server/modules/lists/ls-log.js +1 -3
- package/server/modules/lists/ls-mailaccount.js +1 -5
- package/server/modules/lists/ls-mailreceived.js +1 -5
- package/server/modules/lists/ls-mailsent.js +1 -4
- package/server/modules/lists/ls-mailtemplate.js +1 -4
- package/server/modules/lists/ls-maudanhgia.js +1 -3
- package/server/modules/lists/ls-message2.js +1 -8
- package/server/modules/lists/ls-message2setting.js +1 -5
- package/server/modules/lists/ls-news.js +1 -7
- package/server/modules/lists/ls-newsfeed.js +1 -4
- package/server/modules/lists/ls-note.js +1 -6
- package/server/modules/lists/ls-okr.js +1 -5
- package/server/modules/lists/ls-okrdiagram.js +1 -1
- package/server/modules/lists/ls-opportunity.js +1 -5
- package/server/modules/lists/ls-options.js +1 -4
- package/server/modules/lists/ls-parameter.js +1 -3
- package/server/modules/lists/ls-participant.js +1 -12
- package/server/modules/lists/ls-phieudanhgia.js +1 -7
- package/server/modules/lists/ls-phucap.js +1 -2
- package/server/modules/lists/ls-productcode.js +1 -9
- package/server/modules/lists/ls-profile.js +1 -1
- package/server/modules/lists/ls-ptthanhtoan.js +1 -3
- package/server/modules/lists/ls-qts-dieuchinh.js +1 -2
- package/server/modules/lists/ls-qts-dieuchuyen.js +1 -8
- package/server/modules/lists/ls-reason.js +1 -1
- package/server/modules/lists/ls-rpt.js +1 -5
- package/server/modules/lists/ls-rptform.js +1 -3
- package/server/modules/lists/ls-shortcut.js +1 -1
- package/server/modules/lists/ls-smsaccount.js +1 -1
- package/server/modules/lists/ls-smssend.js +1 -3
- package/server/modules/lists/ls-sosanxuat.js +1 -4
- package/server/modules/lists/ls-step.js +1 -1
- package/server/modules/lists/ls-strategicdiagram.js +1 -1
- package/server/modules/lists/ls-strategicgoal.js +1 -3
- package/server/modules/lists/ls-strategickpi.js +1 -7
- package/server/modules/lists/ls-strategicobjective.js +1 -3
- package/server/modules/lists/ls-strategicplan.js +1 -6
- package/server/modules/lists/ls-support.js +1 -3
- package/server/modules/lists/ls-task.js +1 -28
- package/server/modules/lists/ls-tc.js +1 -1
- package/server/modules/lists/ls-templaterpt.js +1 -5
- package/server/modules/lists/ls-templatevoucher.js +1 -1
- package/server/modules/lists/ls-tontucthoi.js +1 -3
- package/server/modules/lists/ls-trangthaiapp.js +1 -3
- package/server/modules/lists/ls-transaction.js +1 -4
- package/server/modules/lists/ls-usergroup.js +1 -7
- package/server/modules/lists/ls-vat.js +1 -1
- package/server/modules/lists/ls-vatra.js +1 -5
- package/server/modules/lists/ls-vatvao.js +1 -6
- package/server/modules/lists/ls-warranty.js +1 -3
- package/server/modules/lists/ls-workflow.js +1 -1
- package/server/modules/lists/ls_hanmucton.js +1 -3
- package/server/modules/lists/ls_hspb.js +1 -4
- package/server/modules/lists/ls_spdd_ck.js +1 -3
- package/server/modules/lists/ls_spdd_dk.js +1 -3
- package/server/modules/lists/ls_ytdd_ck.js +1 -4
- package/server/modules/lists/ls_ytdd_dk.js +1 -4
- package/server/modules/lists/sys-attend.js +1 -4
- package/server/modules/lists/sys-follow.js +1 -4
- package/server/modules/lists/sys-right.js +1 -2
- package/server/modules/public/app.js +1 -4
- package/server/modules/public/approve.js +1 -37
- package/server/modules/public/callin.js +1 -7
- package/server/modules/public/comment.js +1 -5
- package/server/modules/public/dmnvt.js +1 -4
- package/server/modules/public/dmvt.js +1 -9
- package/server/modules/public/file.js +1 -11
- package/server/modules/public/forminfo.js +1 -1
- package/server/modules/public/group.js +1 -4
- package/server/modules/public/introducecode.js +1 -1
- package/server/modules/public/listinfo.js +1 -1
- package/server/modules/public/media-webhook.js +1 -1
- package/server/modules/public/partner.js +1 -1
- package/server/modules/public/paymentCallback.js +1 -32
- package/server/modules/public/province.js +1 -1
- package/server/modules/public/ptthanhtoan.js +1 -4
- package/server/modules/public/subscribe.js +1 -30
- package/server/modules/public/support.js +1 -3
- package/server/modules/public/tableinfo.js +1 -1
- package/server/modules/public/trialinfo.js +1 -4
- package/server/modules/public/versioninfo.js +1 -1
- package/server/modules/reports/calc-tinhgiafifo.js +1 -8
- package/server/modules/reports/calc-tinhgiatb.js +1 -7
- package/server/modules/reports/calc-tinhgiathanh.js +1 -7
- package/server/modules/reports/calc-tinhkhauhaots.js +1 -3
- package/server/modules/reports/calc-tinhluong.js +1 -68
- package/server/modules/reports/rp-assbonus.js +1 -4
- package/server/modules/reports/rp-asssupply.js +1 -1
- package/server/modules/reports/rp-asstransferlog.js +1 -10
- package/server/modules/reports/rp-backup.js +1 -4
- package/server/modules/reports/rp-banggiatb.js +1 -3
- package/server/modules/reports/rp-bangtinhkhauhao.js +1 -6
- package/server/modules/reports/rp-baoCaoFifoKy.js +1 -1
- package/server/modules/reports/rp-baocaokhachhang.js +1 -6
- package/server/modules/reports/rp-bcdkt.js +1 -11
- package/server/modules/reports/rp-bcintroducebonus.js +1 -4
- package/server/modules/reports/rp-bckhtiemnang.js +1 -3
- package/server/modules/reports/rp-bcqt.js +1 -85
- package/server/modules/reports/rp-bkchamcong.js +1 -5
- package/server/modules/reports/rp-bkct.js +1 -13
- package/server/modules/reports/rp-bkshipbook.js +1 -8
- package/server/modules/reports/rp-bkvanchuyen.js +1 -8
- package/server/modules/reports/rp-bkvatra.js +1 -7
- package/server/modules/reports/rp-bkvatvao.js +1 -7
- package/server/modules/reports/rp-capnhatsocaitc.js +1 -4
- package/server/modules/reports/rp-cdpsdiem.js +1 -4
- package/server/modules/reports/rp-cdpsdt.js +1 -5
- package/server/modules/reports/rp-cdpskh.js +1 -8
- package/server/modules/reports/rp-cdpsnphep.js +1 -3
- package/server/modules/reports/rp-cdpstk.js +1 -4
- package/server/modules/reports/rp-chitietchitientheohoadon.js +1 -12
- package/server/modules/reports/rp-chitiettaisan.js +1 -13
- package/server/modules/reports/rp-chitietthutientheohoadon.js +1 -13
- package/server/modules/reports/rp-ckcn.js +1 -3
- package/server/modules/reports/rp-ckdiem.js +1 -2
- package/server/modules/reports/rp-cktk.js +1 -3
- package/server/modules/reports/rp-ckvt.js +1 -10
- package/server/modules/reports/rp-ckvttheokho.js +1 -4
- package/server/modules/reports/rp-ckvttheotg.js +1 -4
- package/server/modules/reports/rp-ckvttt.js +1 -3
- package/server/modules/reports/rp-congnophaithutheotuoino.js +1 -3
- package/server/modules/reports/rp-congnophaitratheotuoino.js +1 -3
- package/server/modules/reports/rp-congnosapthu.js +1 -4
- package/server/modules/reports/rp-congnosaptra.js +1 -4
- package/server/modules/reports/rp-congviectheobp.js +1 -9
- package/server/modules/reports/rp-congviectheodt.js +1 -8
- package/server/modules/reports/rp-congviectheokh.js +1 -8
- package/server/modules/reports/rp-congviectheonv.js +1 -9
- package/server/modules/reports/rp-congviectheotimeline.js +1 -6
- package/server/modules/reports/rp-ctbanle.js +1 -15
- package/server/modules/reports/rp-ctbanle2.js +1 -20
- package/server/modules/reports/rp-ctbanlectv.js +1 -20
- package/server/modules/reports/rp-ctbanlenpp.js +1 -24
- package/server/modules/reports/rp-ctdanhgianhanvien.js +1 -8
- package/server/modules/reports/rp-cthangbanbitralai.js +1 -4
- package/server/modules/reports/rp-ctmuahang.js +1 -7
- package/server/modules/reports/rp-cttralaihang.js +1 -4
- package/server/modules/reports/rp-databanle.js +1 -10
- package/server/modules/reports/rp-diemthuong.js +1 -2
- package/server/modules/reports/rp-dkcn.js +1 -3
- package/server/modules/reports/rp-dktk.js +1 -2
- package/server/modules/reports/rp-dsnhanviencm.js +1 -9
- package/server/modules/reports/rp-dsnhanvientb.js +1 -9
- package/server/modules/reports/rp-dtbanlekempk.js +1 -12
- package/server/modules/reports/rp-dtbanletheoct.js +1 -22
- package/server/modules/reports/rp-dtbanletheoctkempk.js +1 -25
- package/server/modules/reports/rp-dtbanletheokh.js +1 -17
- package/server/modules/reports/rp-dtbanletheokhnpp.js +1 -19
- package/server/modules/reports/rp-dtbanletheokho.js +1 -15
- package/server/modules/reports/rp-dtbanletheonam.js +1 -3
- package/server/modules/reports/rp-dtbanletheongay.js +1 -1
- package/server/modules/reports/rp-dtbanletheonpp.js +1 -23
- package/server/modules/reports/rp-dtbanletheonv.js +1 -19
- package/server/modules/reports/rp-dtbanletheoquy.js +1 -3
- package/server/modules/reports/rp-dtbanletheosp.js +1 -9
- package/server/modules/reports/rp-dtbanletheospnpp.js +1 -6
- package/server/modules/reports/rp-dtbanletheothang.js +1 -3
- package/server/modules/reports/rp-dtbanletheothungan.js +1 -12
- package/server/modules/reports/rp-dtbanletheovt.js +1 -2
- package/server/modules/reports/rp-dtbanletheovtnpp.js +1 -2
- package/server/modules/reports/rp-dutoanthuchitheodt.js +1 -4
- package/server/modules/reports/rp-getPXC2PNC.js +1 -8
- package/server/modules/reports/rp-getariseofaccountsbymonth.js +1 -4
- package/server/modules/reports/rp-getbtpb.js +1 -6
- package/server/modules/reports/rp-getcashbycashier.js +1 -7
- package/server/modules/reports/rp-getcschietkhau.js +1 -5
- package/server/modules/reports/rp-getdinhmuc4lenhcp.js +1 -7
- package/server/modules/reports/rp-getdinhmuc4pxk.js +1 -9
- package/server/modules/reports/rp-getdk4pht.js +1 -8
- package/server/modules/reports/rp-getdk4pkc.js +1 -10
- package/server/modules/reports/rp-getdttheoca.js +1 -5
- package/server/modules/reports/rp-getinvoice2pay.js +1 -4
- package/server/modules/reports/rp-getinvoice2receive.js +1 -4
- package/server/modules/reports/rp-getinvoice2return.js +1 -5
- package/server/modules/reports/rp-getinvoice2return_bl.js +1 -6
- package/server/modules/reports/rp-getkehoachmh4lenhcp.js +1 -4
- package/server/modules/reports/rp-getkhauhao.js +1 -7
- package/server/modules/reports/rp-getluong.js +1 -8
- package/server/modules/reports/rp-getluongchuyen.js +1 -5
- package/server/modules/reports/rp-getpn2fee.js +1 -5
- package/server/modules/reports/rp-getpn2return.js +1 -5
- package/server/modules/reports/rp-getthanhpham4pnk.js +1 -7
- package/server/modules/reports/rp-getvc2xhd.js +1 -11
- package/server/modules/reports/rp-gt_cpnvltt.js +1 -6
- package/server/modules/reports/rp-hangbanbitralai.js +1 -5
- package/server/modules/reports/rp-hangthanhvien.js +1 -3
- package/server/modules/reports/rp-hoadonbanhangtheohantt.js +1 -5
- package/server/modules/reports/rp-hoadonmuahangtheohantt.js +1 -5
- package/server/modules/reports/rp-hoahong.js +1 -15
- package/server/modules/reports/rp-kcsns.js +1 -19
- package/server/modules/reports/rp-kgchamcong.js +1 -1
- package/server/modules/reports/rp-khoaso.js +1 -11
- package/server/modules/reports/rp-kiemtrasocaitcvssocai.js +1 -6
- package/server/modules/reports/rp-kqdanhgianhanvien.js +1 -5
- package/server/modules/reports/rp-kqhdkd.js +1 -1
- package/server/modules/reports/rp-lcttgt.js +1 -16
- package/server/modules/reports/rp-lctttt.js +1 -11
- package/server/modules/reports/rp-linkslist.js +1 -4
- package/server/modules/reports/rp-phanbochitienchohoadon.js +1 -11
- package/server/modules/reports/rp-phanbothutienchohoadon.js +1 -11
- package/server/modules/reports/rp-ptbitralai.js +1 -7
- package/server/modules/reports/rp-ptcttct.js +1 -24
- package/server/modules/reports/rp-ptdonhang.js +1 -8
- package/server/modules/reports/rp-pttct.js +1 -52
- package/server/modules/reports/rp-pttctkho.js +1 -32
- package/server/modules/reports/rp-pttctkho2.js +1 -29
- package/server/modules/reports/rp-referredusers.js +1 -5
- package/server/modules/reports/rp-sctbhxh.js +1 -4
- package/server/modules/reports/rp-sctcnkh.js +1 -11
- package/server/modules/reports/rp-sctdiem.js +1 -3
- package/server/modules/reports/rp-sctdt.js +1 -7
- package/server/modules/reports/rp-sctdtcp.js +1 -11
- package/server/modules/reports/rp-sctluong.js +1 -6
- package/server/modules/reports/rp-sctthuetncn.js +1 -4
- package/server/modules/reports/rp-scttk.js +1 -9
- package/server/modules/reports/rp-sctvt.js +1 -5
- package/server/modules/reports/rp-sctvt_sl.js +1 -5
- package/server/modules/reports/rp-sctvtnpp.js +1 -6
- package/server/modules/reports/rp-sctvttt.js +1 -5
- package/server/modules/reports/rp-search.js +1 -4
- package/server/modules/reports/rp-socai.js +1 -6
- package/server/modules/reports/rp-socaitk.js +1 -1
- package/server/modules/reports/rp-sochut.js +1 -7
- package/server/modules/reports/rp-sokho.js +1 -7
- package/server/modules/reports/rp-sokhott.js +1 -5
- package/server/modules/reports/rp-sonkbh.js +1 -5
- package/server/modules/reports/rp-sonkc.js +1 -6
- package/server/modules/reports/rp-sonkct.js +1 -5
- package/server/modules/reports/rp-sonkmh.js +1 -5
- package/server/modules/reports/rp-sonktt.js +1 -5
- package/server/modules/reports/rp-soquy.js +1 -11
- package/server/modules/reports/rp-sosanhkhvatt.js +1 -13
- package/server/modules/reports/rp-sosanhkhvatt2.js +1 -5
- package/server/modules/reports/rp-sotaisan.js +1 -13
- package/server/modules/reports/rp-sotiengui.js +1 -7
- package/server/modules/reports/rp-taodinhmuctudkhoc.js +1 -5
- package/server/modules/reports/rp-thbanhangkempk.js +1 -28
- package/server/modules/reports/rp-thdanhgianhanvien.js +1 -9
- package/server/modules/reports/rp-thgt.js +1 -6
- package/server/modules/reports/rp-thnxt.js +1 -11
- package/server/modules/reports/rp-thnxt_sl.js +1 -9
- package/server/modules/reports/rp-thnxtnpp.js +1 -10
- package/server/modules/reports/rp-thnxttt.js +1 -9
- package/server/modules/reports/rp-tkbanhangtheogioithieu.js +1 -9
- package/server/modules/reports/rp-tkgioithieukh.js +1 -4
- package/server/modules/reports/rp-tkgtgt.js +1 -76
- package/server/modules/reports/rp-tkgtgt_old.js +1 -7
- package/server/modules/reports/rp-tmbctc.js +1 -20
- package/server/modules/reports/rp-tonghopbanhang.js +1 -6
- package/server/modules/reports/rp-tonghopmuahang.js +1 -5
- package/server/modules/reports/rp-tonghoptralaihang.js +1 -5
- package/server/modules/reports/rp-tongquanbanle.js +1 -20
- package/server/modules/reports/rp-tongquanbds.js +1 -3
- package/server/modules/reports/rp-tongquancongty.js +1 -6
- package/server/modules/reports/rp-tongquanctvnpp.js +1 -12
- package/server/modules/reports/rp-tongquannvbh.js +1 -14
- package/server/modules/reports/rp-tongquannvnpp.js +1 -5
- package/server/modules/reports/rp-uoctinhnvl.js +1 -11
- package/server/modules/reports/rp-wallet.js +1 -3
- package/server/modules/reports/rpt-tkdiemtichluy.js +1 -9
- package/server/modules/systems/sys-app.js +1 -34
- package/server/modules/systems/sys-colleague.js +1 -11
- package/server/modules/systems/sys-data_list_config.js +1 -1
- package/server/modules/systems/sys-domain.js +1 -1
- package/server/modules/systems/sys-ecomproductlines.js +1 -1
- package/server/modules/systems/sys-exportexceltemplate.js +1 -1
- package/server/modules/systems/sys-fieldright.js +1 -1
- package/server/modules/systems/sys-importexceltemplate.js +1 -1
- package/server/modules/systems/sys-labelinfo.js +1 -3
- package/server/modules/systems/sys-listinfo.js +1 -10
- package/server/modules/systems/sys-menuinfo.js +1 -1
- package/server/modules/systems/sys-message.js +1 -14
- package/server/modules/systems/sys-moduleinfo.js +1 -2
- package/server/modules/systems/sys-notification.js +1 -8
- package/server/modules/systems/sys-quanhuyen.js +1 -1
- package/server/modules/systems/sys-reportinfo.js +1 -5
- package/server/modules/systems/sys-rptobject.js +1 -1
- package/server/modules/systems/sys-schedule.js +1 -10
- package/server/modules/systems/sys-sysconfig.js +1 -1
- package/server/modules/systems/sys-sysgroup.js +1 -1
- package/server/modules/systems/sys-tableinfo.js +1 -1
- package/server/modules/systems/sys-templatestore.js +1 -5
- package/server/modules/systems/sys-tinhthanh.js +1 -1
- package/server/modules/systems/sys-token.js +1 -3
- package/server/modules/systems/sys-trangthai.js +1 -3
- package/server/modules/systems/sys-trialinfo.js +1 -1
- package/server/modules/systems/sys-user.js +1 -45
- package/server/modules/systems/sys-users.js +1 -10
- package/server/modules/systems/sys-versioninfo.js +1 -1
- package/server/modules/systems/sys-vietqrbanks.js +1 -1
- package/server/modules/systems/sys-xaphuong.js +1 -1
- package/server/modules/vouchers/vo-banggiaban.js +1 -8
- package/server/modules/vouchers/vo-bc1.js +1 -34
- package/server/modules/vouchers/vo-bc5.js +1 -15
- package/server/modules/vouchers/vo-bg1.js +1 -10
- package/server/modules/vouchers/vo-bg2.js +1 -12
- package/server/modules/vouchers/vo-bn1.js +1 -36
- package/server/modules/vouchers/vo-bn5.js +1 -15
- package/server/modules/vouchers/vo-dh2.js +1 -35
- package/server/modules/vouchers/vo-dinhmucsx.js +1 -6
- package/server/modules/vouchers/vo-dkb.js +1 -21
- package/server/modules/vouchers/vo-dn0.js +1 -9
- package/server/modules/vouchers/vo-dnm.js +1 -20
- package/server/modules/vouchers/vo-hd1.js +1 -37
- package/server/modules/vouchers/vo-hd2.js +1 -108
- package/server/modules/vouchers/vo-hd3.js +1 -38
- package/server/modules/vouchers/vo-hd4.js +1 -13
- package/server/modules/vouchers/vo-hd7.js +1 -29
- package/server/modules/vouchers/vo-hd8.js +1 -29
- package/server/modules/vouchers/vo-hde.js +1 -39
- package/server/modules/vouchers/vo-htl.js +1 -11
- package/server/modules/vouchers/vo-kbbtpb.js +1 -6
- package/server/modules/vouchers/vo-kehoachmh.js +1 -11
- package/server/modules/vouchers/vo-lenhcapphat.js +1 -9
- package/server/modules/vouchers/vo-lenhsx.js +1 -12
- package/server/modules/vouchers/vo-pbl.js +1 -94
- package/server/modules/vouchers/vo-pc0.js +1 -14
- package/server/modules/vouchers/vo-pc1.js +1 -31
- package/server/modules/vouchers/vo-pc2.js +1 -25
- package/server/modules/vouchers/vo-pc3.js +1 -14
- package/server/modules/vouchers/vo-pc5.js +1 -15
- package/server/modules/vouchers/vo-pc6.js +1 -19
- package/server/modules/vouchers/vo-pcl.js +1 -7
- package/server/modules/vouchers/vo-pdn.js +1 -11
- package/server/modules/vouchers/vo-pdx.js +1 -9
- package/server/modules/vouchers/vo-pgh.js +1 -16
- package/server/modules/vouchers/vo-pht.js +1 -6
- package/server/modules/vouchers/vo-pkc.js +1 -5
- package/server/modules/vouchers/vo-pkh.js +1 -9
- package/server/modules/vouchers/vo-pkk.js +1 -12
- package/server/modules/vouchers/vo-pkt.js +1 -12
- package/server/modules/vouchers/vo-pn1.js +1 -30
- package/server/modules/vouchers/vo-pn2.js +1 -17
- package/server/modules/vouchers/vo-pn3.js +1 -18
- package/server/modules/vouchers/vo-pn5.js +1 -18
- package/server/modules/vouchers/vo-pn6.js +1 -18
- package/server/modules/vouchers/vo-pn9.js +1 -23
- package/server/modules/vouchers/vo-pnc.js +1 -19
- package/server/modules/vouchers/vo-pnh.js +1 -17
- package/server/modules/vouchers/vo-pnk.js +1 -14
- package/server/modules/vouchers/vo-pnknpp.js +1 -12
- package/server/modules/vouchers/vo-po1.js +1 -14
- package/server/modules/vouchers/vo-ppb.js +1 -8
- package/server/modules/vouchers/vo-pt1.js +1 -20
- package/server/modules/vouchers/vo-pt5.js +1 -15
- package/server/modules/vouchers/vo-ptl.js +1 -8
- package/server/modules/vouchers/vo-purchase_contract.js +1 -9
- package/server/modules/vouchers/vo-pxc.js +1 -24
- package/server/modules/vouchers/vo-pxh.js +1 -18
- package/server/modules/vouchers/vo-pxk.js +1 -15
- package/server/modules/vouchers/vo-pxknpp.js +1 -14
- package/server/modules/vouchers/vo-qts.js +1 -12
- package/server/modules/vouchers/vo-sale_contract.js +1 -11
- package/server/modules/vouchers/vo-shipbook.js +1 -17
- package/server/modules/vouchers/vo-so1.js +1 -125
- package/server/modules/vouchers/vo-so5.js +1 -57
- package/server/modules/vouchers/vo-so7.js +1 -97
- package/server/modules/vouchers/vo-so9.js +1 -119
- package/server/modules/vouchers/vo-vanchuyen.js +1 -14
- package/server/modules/vouchers/vo-xhd.js +1 -33
- package/server/route.js +1 -54
- package/server/services/invoiceFetcher.js +1 -12
- package/server/sslConfig.js +1 -2
- package/server/test/array.js +59 -0
- package/server/test/utils.js +191 -0
- package/server/tools/convertVideo.js +19 -0
- package/server/tools/create_province.js +11191 -0
- package/server/tools/redis-smoke-test.js +195 -0
- package/server/tools/resetPassword.js +45 -0
- package/server/tools/set_px_gia_dd.js +120 -0
- package/server/tools/test.js +6 -0
- package/server/tools/update copy.js +116 -0
- package/server/tools/update_system.js +47 -0
- package/server/workers/backupApp.js +1 -10
- package/server/workers/calcGrid.js +1 -9
- package/server/workers/excelParser.js +1 -10
- package/server/workers/inputWorker.js +1 -8
- package/server/workers/pushNotify.js +1 -11
- package/server/workers/reportWorker.js +1 -8
- package/server/workers/restoreApp.js +1 -10
- package/server/workers/runScript.js +1 -5
- package/server/workers/sendEmail.js +1 -14
- package/server/workers/webhook.js +1 -5
- package/server/workers/worker-utils.js +1 -5
- package/server/auths/local_old.js +0 -60
- package/server/controllers/controllerUtils_v1.js +0 -72
- package/server/controllers/controller_old.js +0 -129
- package/server/controllers/createHandler_old.js +0 -35
- package/server/controllers/deleteHandler_old.js +0 -12
- package/server/controllers/exportHandler_old.js +0 -17
- package/server/controllers/findHandler_old.js +0 -74
- package/server/controllers/importFromJsonHandler_old.js +0 -6
- package/server/controllers/importHandler_old.js +0 -41
- package/server/controllers/updateFieldHandler_old.js +0 -13
- package/server/controllers/updateHandler_old.js +0 -40
- package/server/controllers/viewHandler_old.js +0 -14
- package/server/libs/BlockchainTransactionPool.js +0 -3
- package/server/modules/lists/ls-assabcihandler.js +0 -3
- package/server/modules/lists/ls-assbooking.js +0 -20
- package/server/modules/lists/ls-assbuy.js +0 -8
- package/server/modules/lists/ls-assinvestment.js +0 -31
- package/server/modules/lists/ls-assneedtobuy.js +0 -10
- package/server/modules/lists/ls-assperiod.js +0 -19
- package/server/modules/lists/ls-assproduct.js +0 -9
- package/server/modules/lists/ls-assprofitsharing.js +0 -8
- package/server/modules/lists/ls-asssell.js +0 -13
- package/server/modules/lists/ls-asswithdraw.js +0 -12
- package/server/modules/reports/rp-analyzedata.js +0 -6
- package/server/modules/reports/rp-assinterest.js +0 -8
- package/server/modules/reports/rp-assproductowners.js +0 -3
- package/server/workers/restoreApp_bk.js +0 -23
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "flexbiz-server",
|
|
3
3
|
"main": "./server/app.js",
|
|
4
4
|
"description": "Flexible Server",
|
|
5
|
-
"version": "12.7.
|
|
5
|
+
"version": "12.7.11",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Van Truong Pham",
|
|
8
8
|
"email": "invncur@gmail.com"
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"@ai-sdk/google": "^4.0.8",
|
|
20
20
|
"@ai-sdk/openai": "^4.0.7",
|
|
21
21
|
"@ffmpeg-installer/ffmpeg": "^1.0.20",
|
|
22
|
+
"@socket.io/redis-adapter": "^8.3.0",
|
|
22
23
|
"agenda": "^4.1.3",
|
|
23
24
|
"agendash": "^2.1.1",
|
|
24
25
|
"ai": "^7.0.14",
|
|
@@ -62,7 +63,7 @@
|
|
|
62
63
|
"mongodb-backup": "^1.6.9",
|
|
63
64
|
"mongodb-restore": "^1.6.2",
|
|
64
65
|
"mongoose": "^6.13.10",
|
|
65
|
-
"mongoose-storage-usage": "^1.7.
|
|
66
|
+
"mongoose-storage-usage": "^1.7.1",
|
|
66
67
|
"morgan": "^1.10.0",
|
|
67
68
|
"multer": "^0.1.8",
|
|
68
69
|
"natives": "^1.1.6",
|
|
@@ -82,8 +83,8 @@
|
|
|
82
83
|
"pdf2json": "^4.0.3",
|
|
83
84
|
"pug": "^3.0.2",
|
|
84
85
|
"qr-image": "^3.2.0",
|
|
85
|
-
"rate-limiter-flexible": "^
|
|
86
|
-
"redis": "^
|
|
86
|
+
"rate-limiter-flexible": "^11.2.0",
|
|
87
|
+
"redis": "^6.1.0",
|
|
87
88
|
"request": "^2.88.2",
|
|
88
89
|
"rotating-file-stream": "^1.4.6",
|
|
89
90
|
"sharp": "^0.31.0",
|
|
@@ -91,7 +92,6 @@
|
|
|
91
92
|
"smtp-server": "^3.9.0",
|
|
92
93
|
"socket.io": "^4.1.2",
|
|
93
94
|
"socket.io-client": "^4.1.2",
|
|
94
|
-
"socket.io-redis": "^6.1.1",
|
|
95
95
|
"sticky-session": "^1.1.2",
|
|
96
96
|
"tesseract.js": "^7.0.0",
|
|
97
97
|
"underscore": "^1.13.1",
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
"gulp-copy": "^1.0.1",
|
|
125
125
|
"gulp-uglify-cli": "latest",
|
|
126
126
|
"gulp-uglify-es": "latest",
|
|
127
|
-
"javascript-obfuscator": "^4.
|
|
127
|
+
"javascript-obfuscator": "^5.4.3",
|
|
128
128
|
"jshint": "latest",
|
|
129
129
|
"mocha": "latest",
|
|
130
130
|
"npm-run-all": "^4.1.5",
|
package/server/agents/agents.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const runFinanceAgent=require(
|
|
1
|
+
const _0x259064=_0x3ae1;function _0x2eae(){const _0x11c24a=['nJK5z0XfzLf0','lI9JC2S','AefNzw4','s0Hbz2u','nJi0mda2u3DQCMft','mtG0nJe1Affzvgfc','mte2odiWmfzKDu1zyq','mJi3nZmXmNnjsxHdBa','mZy5mte4ofHnrNjYuW','zxHWB3i','qwDLBNq','n295vvbLBa','oti0sKn1rufv','lI9ZDge','BMfUy2u','CMTMBg8','lI9MBg8','CNvUq1m','lI9Jzw8','ywzMqwC','mtqZmZu4ogHxvhvxyW','zw50','CNvUrMK','zMzbz2u','CNvUv28'];_0x2eae=function(){return _0x11c24a;};return _0x2eae();}(function(_0x15daf9,_0x56fe05){const _0x4d50c1=_0x3ae1,_0xf3da57=_0x15daf9();while(!![]){try{const _0x230a6a=parseInt(_0x4d50c1(0xc5))/0x1*(-parseInt(_0x4d50c1(0xd1))/0x2)+parseInt(_0x4d50c1(0xcb))/0x3+parseInt(_0x4d50c1(0xc0))/0x4+parseInt(_0x4d50c1(0xca))/0x5+parseInt(_0x4d50c1(0xc9))/0x6*(-parseInt(_0x4d50c1(0xd0))/0x7)+parseInt(_0x4d50c1(0xcc))/0x8+-parseInt(_0x4d50c1(0xcd))/0x9;if(_0x230a6a===_0x56fe05)break;else _0xf3da57['push'](_0xf3da57['shift']());}catch(_0x18873d){_0xf3da57['push'](_0xf3da57['shift']());}}}(_0x2eae,0x38b79));function _0x3ae1(_0x27f147,_0x1a4e8b){_0x27f147=_0x27f147-0xb9;const _0x2eae8b=_0x2eae();let _0x3ae14f=_0x2eae8b[_0x27f147];if(_0x3ae1['AAWfZg']===undefined){var _0x695c55=function(_0x5035c3){const _0xa753ca='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x45a718='',_0xe074ed='';for(let _0xe8c9bd=0x0,_0x57a5d6,_0x547767,_0x337a3c=0x0;_0x547767=_0x5035c3['charAt'](_0x337a3c++);~_0x547767&&(_0x57a5d6=_0xe8c9bd%0x4?_0x57a5d6*0x40+_0x547767:_0x547767,_0xe8c9bd++%0x4)?_0x45a718+=String['fromCharCode'](0xff&_0x57a5d6>>(-0x2*_0xe8c9bd&0x6)):0x0){_0x547767=_0xa753ca['indexOf'](_0x547767);}for(let _0x250420=0x0,_0x4ce66b=_0x45a718['length'];_0x250420<_0x4ce66b;_0x250420++){_0xe074ed+='%'+('00'+_0x45a718['charCodeAt'](_0x250420)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xe074ed);};_0x3ae1['VOmAcH']=_0x695c55,_0x3ae1['qRoJZI']={},_0x3ae1['AAWfZg']=!![];}const _0x374340=_0x2eae8b[0x0],_0x3c42d3=_0x27f147+_0x374340,_0x34d71c=_0x3ae1['qRoJZI'][_0x3c42d3];return!_0x34d71c?(_0x3ae14f=_0x3ae1['VOmAcH'](_0x3ae14f),_0x3ae1['qRoJZI'][_0x3c42d3]=_0x3ae14f):_0x3ae14f=_0x34d71c,_0x3ae14f;}const runFinanceAgent=require(_0x259064(0xbe)+'Agent'),runStaffAgent=require(_0x259064(0xb9)+_0x259064(0xc3)+'nt'),runCSKHAgent=require(_0x259064(0xc6)+_0x259064(0xc7)+'t'),runWorkflowAgent=require(_0x259064(0xbc)+'wAgen'+'t'),_0x45a718={};_0x45a718[_0x259064(0xc2)+_0x259064(0xba)+_0x259064(0xcf)]=runFinanceAgent,_0x45a718['runSt'+_0x259064(0xbf)+_0x259064(0xc1)]=runStaffAgent,_0x45a718[_0x259064(0xbd)+_0x259064(0xc8)+'nt']=runCSKHAgent,_0x45a718[_0x259064(0xc4)+_0x259064(0xbb)+'wAgen'+'t']=runWorkflowAgent,module[_0x259064(0xce)+'ts']=_0x45a718;
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
const {generateObject}=require(
|
|
2
|
-
return $memoryPrompt_user_id$$},summarizeUserMemory=async($id_app$$,$user_id$$,$session_id$$,$model$$)=>{try{let $memory$$=await AiMemory.findOne({id_app:$id_app$$,user_id:$user_id$$});$memory$$||=new AiMemory({id_app:$id_app$$,user_id:$user_id$$,core_memories:[]});$id_app$$={id_app:$id_app$$,user_id:$user_id$$,session_id:$session_id$$};$memory$$.last_summarized_date&&($id_app$$.date_created={$gt:$memory$$.last_summarized_date});const $unsummarizedMessages$$=await ChatMessage.find($id_app$$).sort({date_created:1}).limit(20).lean();
|
|
3
|
-
if(!($unsummarizedMessages$$.length<10)){var $chatText$$=$unsummarizedMessages$$.filter($msg$$=>$msg$$.role!=="tool"&&$msg$$.content).map($msg$$=>`${$msg$$.role.toUpperCase()}: ${$msg$$.content}`).join("\n"),{object:$object$$}=await generateObject({model:$model$$,schema:z.object({extracted_facts:z.array(z.string()).describe("M\u1ea3ng c\u00e1c th\u00f4ng tin quan tr\u1ecdng, s\u1edf th\u00edch, y\u00eau c\u1ea7u ho\u1eb7c b\u1ed1i c\u1ea3nh d\u00e0i h\u1ea1n c\u1ee7a ng\u01b0\u1eddi d\u00f9ng. B\u1ecf qua c\u00e1c c\u00e2u giao ti\u1ebfp th\u00f4ng th\u01b0\u1eddng.")}),
|
|
4
|
-
prompt:`D\u01b0\u1edbi \u0111\u00e2y l\u00e0 \u0111o\u1ea1n h\u1ed9i tho\u1ea1i g\u1ea7n nh\u1ea5t. H\u00e3y tr\u00edch xu\u1ea5t c\u00e1c th\u00f4ng tin quan tr\u1ecdng m\u00e0 AI c\u1ea7n GHI NH\u1eda D\u00c0I H\u1ea0N v\u1ec1 ng\u01b0\u1eddi d\u00f9ng (V\u00ed d\u1ee5: quy \u0111\u1ecbnh l\u00e0m vi\u1ec7c, v\u1ecb tr\u00ed \u0111\u1ecba l\u00fd, th\u00f3i quen thao t\u00e1c, \u0111\u1ecbnh d\u1ea1ng b\u00e1o c\u00e1o y\u00eau th\u00edch, t\u00ean d\u1ef1 \u00e1n \u0111ang l\u00e0m...). N\u1ebfu kh\u00f4ng c\u00f3 g\u00ec quan tr\u1ecdng, tr\u1ea3 v\u1ec1 m\u1ea3ng r\u1ed7ng.\n\nH\u1ed9i tho\u1ea1i:\n${$chatText$$}`});
|
|
5
|
-
$object$$.extracted_facts&&$object$$.extracted_facts.length>0&&($memory$$.core_memories=[...$memory$$.core_memories,...$object$$.extracted_facts].slice(-50));$memory$$.last_summarized_date=$unsummarizedMessages$$[$unsummarizedMessages$$.length-1].date_created;await $memory$$.save();console.log(`[Memory Worker] \u0110\u00e3 c\u1eadp nh\u1eadt ${$object$$.extracted_facts.length} tr\u00ed nh\u1edb m\u1edbi cho user ${$user_id$$}`)}}catch($error$$){console.error("[Memory Worker Error]:",$error$$)}};
|
|
6
|
-
module.exports={summarizeUserMemory,getMemory};
|
|
1
|
+
const _0x327c63=_0x5b3a;function _0x5493(){const _0x13dca8=['BwvTB3i','BgfZDf8','AgfVihq','yxjYyxK','B3j5','BMCGBmoG','lIbc4BUpia','ihrY4BUnBG','AwrFyxa','CMTLCIa','y8oHyYb0','igTOW7rU','mtC4nZGZmNbIC2DzBW','EM9K','rmAW4BUBAsa','lsaQkG','BwvZC2e','C3vTBwe','nte0nJG5m2THqKDlvq','ndqWnJfgCvzUtfy','AsbO4BQHBG','DwvUihq','4BUlihrYW60','W6aGXjfV4BQH','Amo0BMCG','zYb0Aw4','zxjYB3i','zMfJDhm','ie5i4BUAia','DhlHUQmGDG','CML6zwq','igpHU6DHia','DgLUihe','CUg7Jw5Nla','AwvZ','igtdUw5N','z2v0tw8','quKGy+g6PW','4BUrAsbJ4BQJ','zgvS','Ccb0Amo0','lIbiW6n5','BgvHBG','Dg9VBa','AsbN4BQNBG','BYb5W6P1','AM9PBG','W6fJigpdOG','DxnLCL8','CML6zvu','C2vZC2K','zxjdyxm','W6fJlcdeKq','y29Yzv8','zYbTW6aG','y2HHDf8','4BUhyYWGDG','mJu1mdKWnvzwzLv0ua','rxjYB3i','BMGGzmoG','Cxv5imsr','zYbY4BUxBG','BgvUz3q','ihrOW61J','DwfUihq','mZq4mdKZCxPnt2zb','ig5NXRdHU50','z2v0twu','W6fVigpdOq','Bs4UlIK','w01LBw8','mZe0nJeWzu51tg5A','AcWGDmoQ','BMCGDgG','yw4GDhi','4BUbig3HUQnU','y3jLyxq','zMLUze8','zY4kcKG','XRdHU51UzY4','4BUlBMGGza','y+g6P3uGAa','nJm5mti0EfjKD3fy','igtHU6u6ia','4BUBAsbJAa','zxH0CMe','4BUlBMGGBa','zxHWB3i','zMLUza','DsbNAwe','B2jQzwm','zgvZy3i','BYb1C2u','CNKGv28','BMJHU5SGBq','ihrYW60G','zgf0zv8','CM9Szq','AwjL','Bmo9lcb0','mtrLEMnHquy','y3rLzf8','imsqW6mGyW','ihrOW7rU','tEg6O25Nia','DcbJW6fJ','ihNdQNuG','ig5O4BQLDa','BwfW','C3rYAw4','AsbKW7LU','BMFgSog7NwK','4BUzAsb0Aa','rmoassbi','CxvHigm','z8oSihf1','mtbQvMjNBLG','mtzZqxblvMO','C29YDa','imsr4BUlysa','ywLTzw0','BYb0AEg6VW','x2rHDgu','zYaOvSoT','4BQTDca','B25FAwq','y29UDgu','BIbO4BUzAq','AmoTy2GS','Bw9YEq'];_0x5493=function(){return _0x13dca8;};return _0x5493();}function _0x5b3a(_0x8a5c79,_0x2e86d5){_0x8a5c79=_0x8a5c79-0x185;const _0x54932b=_0x5493();let _0x5b3a8c=_0x54932b[_0x8a5c79];if(_0x5b3a['zCTSnX']===undefined){var _0x10e90e=function(_0x4ff4a9){const _0xdb0d1b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3951a4='',_0x4d743a='';for(let _0x3dfdb5=0x0,_0x13c428,_0x5857ae,_0x28fe1e=0x0;_0x5857ae=_0x4ff4a9['charAt'](_0x28fe1e++);~_0x5857ae&&(_0x13c428=_0x3dfdb5%0x4?_0x13c428*0x40+_0x5857ae:_0x5857ae,_0x3dfdb5++%0x4)?_0x3951a4+=String['fromCharCode'](0xff&_0x13c428>>(-0x2*_0x3dfdb5&0x6)):0x0){_0x5857ae=_0xdb0d1b['indexOf'](_0x5857ae);}for(let _0x551a79=0x0,_0xcddb3a=_0x3951a4['length'];_0x551a79<_0xcddb3a;_0x551a79++){_0x4d743a+='%'+('00'+_0x3951a4['charCodeAt'](_0x551a79)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4d743a);};_0x5b3a['hcKMlM']=_0x10e90e,_0x5b3a['IyjfXr']={},_0x5b3a['zCTSnX']=!![];}const _0x1a26b4=_0x54932b[0x0],_0x2cf4a3=_0x8a5c79+_0x1a26b4,_0x5025fa=_0x5b3a['IyjfXr'][_0x2cf4a3];return!_0x5025fa?(_0x5b3a8c=_0x5b3a['hcKMlM'](_0x5b3a8c),_0x5b3a['IyjfXr'][_0x2cf4a3]=_0x5b3a8c):_0x5b3a8c=_0x5025fa,_0x5b3a8c;}(function(_0x480e3f,_0x2973ee){const _0xf24a99=_0x5b3a,_0x48f3dc=_0x480e3f();while(!![]){try{const _0x36f6e4=-parseInt(_0xf24a99(0x1c2))/0x1+parseInt(_0xf24a99(0x1d3))/0x2+-parseInt(_0xf24a99(0x194))/0x3*(-parseInt(_0xf24a99(0x1f6))/0x4)+parseInt(_0xf24a99(0x1ba))/0x5+-parseInt(_0xf24a99(0x1c8))/0x6*(-parseInt(_0xf24a99(0x1e5))/0x7)+parseInt(_0xf24a99(0x18d))/0x8+-parseInt(_0xf24a99(0x193))/0x9*(parseInt(_0xf24a99(0x1f5))/0xa);if(_0x36f6e4===_0x2973ee)break;else _0x48f3dc['push'](_0x48f3dc['shift']());}catch(_0xa71e5b){_0x48f3dc['push'](_0x48f3dc['shift']());}}}(_0x5493,0x487a6));const {generateObject}=require('ai'),{z}=require(_0x327c63(0x18e)),ChatMessage=global[_0x327c63(0x1a5)+_0x327c63(0x1a8)](_0x327c63(0x1b8)+_0x327c63(0x191)+'ge'),AiMemory=global[_0x327c63(0x1a5)+_0x327c63(0x1a8)](_0x327c63(0x1f9)+_0x327c63(0x185)),getMemory=async(_0xcddb3a,_0x2d726e)=>{const _0x60f961=_0x327c63,_0x1eee44={};_0x1eee44[_0x60f961(0x189)+'p']=_0xcddb3a,_0x1eee44[_0x60f961(0x1b1)+'id']=_0x2d726e;const _0x423d49=await AiMemory['findO'+'ne'](_0x1eee44)['lean']();let _0x5eb541='';return _0x423d49&&_0x423d49[_0x60f961(0x1b6)+_0x60f961(0x203)+_0x60f961(0x1a3)][_0x60f961(0x1bf)+'h']>0x0&&(_0x5eb541=_0x423d49[_0x60f961(0x1b6)+_0x60f961(0x203)+_0x60f961(0x1a3)][_0x60f961(0x1ed)](_0x84d4a9=>_0x60f961(0x190)+_0x84d4a9)[_0x60f961(0x1af)]('\x0a')),_0x5eb541;},summarizeUserMemory=async(_0x2a347f,_0xdbfa1,_0x442010,_0x3648cc)=>{const _0x678ca9=_0x327c63;try{const _0x52dab0={};_0x52dab0[_0x678ca9(0x189)+'p']=_0x2a347f,_0x52dab0[_0x678ca9(0x1b1)+'id']=_0xdbfa1;let _0x491762=await AiMemory[_0x678ca9(0x1ce)+'ne'](_0x52dab0);if(!_0x491762){const _0x653687={};_0x653687['id_ap'+'p']=_0x2a347f,_0x653687[_0x678ca9(0x1b1)+'id']=_0xdbfa1,_0x653687['core_'+_0x678ca9(0x203)+'ies']=[],_0x491762=new AiMemory(_0x653687);}const _0x14f014={};_0x14f014[_0x678ca9(0x189)+'p']=_0x2a347f,_0x14f014['user_'+'id']=_0xdbfa1,_0x14f014[_0x678ca9(0x1b3)+_0x678ca9(0x1fe)]=_0x442010;const _0x582713=_0x14f014;if(_0x491762[_0x678ca9(0x204)+_0x678ca9(0x192)+'rized'+_0x678ca9(0x1fb)]){const _0x8988be={};_0x8988be['$gt']=_0x491762['last_'+_0x678ca9(0x192)+_0x678ca9(0x19f)+_0x678ca9(0x1fb)],_0x582713['date_'+_0x678ca9(0x1cd)+'ed']=_0x8988be;}const _0x4c3eb0={};_0x4c3eb0['date_'+_0x678ca9(0x1cd)+'ed']=0x1;const _0x378539=await ChatMessage[_0x678ca9(0x1d9)](_0x582713)[_0x678ca9(0x1f7)](_0x4c3eb0)['limit'](0x14)[_0x678ca9(0x1ab)]();if(_0x378539[_0x678ca9(0x1bf)+'h']<0xa)return;const _0x5518f1=_0x378539['filte'+'r'](_0x55ac97=>_0x55ac97['role']!==_0x678ca9(0x1ac)&&_0x55ac97[_0x678ca9(0x1ff)+'nt'])[_0x678ca9(0x1ed)](_0x51b1f5=>_0x51b1f5[_0x678ca9(0x1e2)]['toUpp'+_0x678ca9(0x1b4)+'e']()+':\x20'+_0x51b1f5[_0x678ca9(0x1ff)+'nt'])['join']('\x0a'),{object:_0x38ed91}=await generateObject({'model':_0x3648cc,'schema':z[_0x678ca9(0x1db)+'t']({'extracted_facts':z[_0x678ca9(0x206)](z[_0x678ca9(0x1ee)+'g']())[_0x678ca9(0x1dc)+_0x678ca9(0x1e3)](_0x678ca9(0x1e9)+_0x678ca9(0x18b)+_0x678ca9(0x199)+_0x678ca9(0x1a1)+_0x678ca9(0x1c1)+_0x678ca9(0x1a2)+'\x20sở\x20t'+_0x678ca9(0x201)+_0x678ca9(0x1eb)+_0x678ca9(0x1d2)+'oặc\x20b'+_0x678ca9(0x1a7)+_0x678ca9(0x1bc)+_0x678ca9(0x195)+_0x678ca9(0x1a0)+_0x678ca9(0x1f0)+_0x678ca9(0x1a4)+_0x678ca9(0x187)+_0x678ca9(0x1f3)+_0x678ca9(0x1b0)+_0x678ca9(0x1da)+_0x678ca9(0x1fa)+_0x678ca9(0x1a9)+_0x678ca9(0x1ca)+_0x678ca9(0x1d0))}),'prompt':_0x678ca9(0x18f)+'đây\x20l'+_0x678ca9(0x198)+_0x678ca9(0x200)+'\x20thoạ'+_0x678ca9(0x1ad)+_0x678ca9(0x1ec)+_0x678ca9(0x1aa)+'\x20tríc'+'h\x20xuấ'+_0x678ca9(0x1ea)+_0x678ca9(0x1e8)+_0x678ca9(0x19a)+'\x20quan'+_0x678ca9(0x188)+_0x678ca9(0x1b7)+_0x678ca9(0x1a6)+'n\x20GHI'+_0x678ca9(0x19d)+_0x678ca9(0x1f2)+'ẠN\x20về'+_0x678ca9(0x1c3)+_0x678ca9(0x1ef)+_0x678ca9(0x1fc)+_0x678ca9(0x1d4)+_0x678ca9(0x1bd)+_0x678ca9(0x1d7)+'àm\x20vi'+_0x678ca9(0x1b9)+_0x678ca9(0x197)+_0x678ca9(0x1f8)+_0x678ca9(0x1e4)+'hói\x20q'+_0x678ca9(0x196)+_0x678ca9(0x205)+_0x678ca9(0x1b5)+_0x678ca9(0x1d1)+'ạng\x20b'+_0x678ca9(0x1c5)+_0x678ca9(0x1ae)+_0x678ca9(0x1c0)+_0x678ca9(0x1c9)+'n\x20dự\x20'+'án\x20đa'+_0x678ca9(0x186)+_0x678ca9(0x1c6)+'.\x20Nếu'+_0x678ca9(0x18c)+'g\x20có\x20'+_0x678ca9(0x1f4)+_0x678ca9(0x1cb)+'ọng,\x20'+_0x678ca9(0x19e)+_0x678ca9(0x1cc)+_0x678ca9(0x1be)+_0x678ca9(0x1cf)+_0x678ca9(0x1f1)+'oại:\x0a'+_0x5518f1});_0x38ed91[_0x678ca9(0x1d6)+_0x678ca9(0x1e6)+'facts']&&_0x38ed91[_0x678ca9(0x1d6)+_0x678ca9(0x1e6)+_0x678ca9(0x19c)]['lengt'+'h']>0x0&&(_0x491762[_0x678ca9(0x1b6)+'memor'+'ies']=[..._0x491762['core_'+_0x678ca9(0x203)+'ies'],..._0x38ed91['extra'+'cted_'+_0x678ca9(0x19c)]]['slice'](-0x32)),_0x491762[_0x678ca9(0x204)+_0x678ca9(0x192)+'rized'+_0x678ca9(0x1fb)]=_0x378539[_0x378539[_0x678ca9(0x1bf)+'h']-0x1][_0x678ca9(0x1e1)+_0x678ca9(0x1cd)+'ed'],await _0x491762['save'](),console['log']('[Memo'+_0x678ca9(0x1de)+'rker]'+_0x678ca9(0x1e7)+'ập\x20nh'+_0x678ca9(0x1fd)+_0x38ed91[_0x678ca9(0x1d6)+_0x678ca9(0x1e6)+_0x678ca9(0x19c)][_0x678ca9(0x1bf)+'h']+(_0x678ca9(0x1e0)+_0x678ca9(0x1df)+_0x678ca9(0x1d5)+_0x678ca9(0x1dd)+'r\x20')+_0xdbfa1);}catch(_0x16998d){console[_0x678ca9(0x19b)](_0x678ca9(0x1c7)+_0x678ca9(0x1de)+_0x678ca9(0x18a)+_0x678ca9(0x1bb)+']:',_0x16998d);}},_0x551a79={};_0x551a79[_0x327c63(0x192)+_0x327c63(0x1b2)+'serMe'+_0x327c63(0x202)]=summarizeUserMemory,_0x551a79[_0x327c63(0x1c4)+_0x327c63(0x202)]=getMemory,module[_0x327c63(0x1d8)+'ts']=_0x551a79;
|
|
@@ -1,43 +1 @@
|
|
|
1
|
-
const {generateText,stepCountIs,pruneMessages}=require("ai"),chatController=require("./chatController"),{decrypt}=require("../libs/utils"),{summarizeUserMemory,getMemory}=require("./ai_memory_manager"),{createFinanceTools}=require("./tools/financeTools"),{createStockTools}=require("./tools/stockTools"),{createRagTools}=require("./tools/ragTools"),{createStaffTools}=require("./tools/staffTools"),{createSystemTools}=require("./tools/systemTools"),{createMasterDataTools}=require("./tools/masterDataTools"),
|
|
2
|
-
{createKpiTools}=require("./tools/kpiTools"),{createOkrTools}=require("./tools/okrTools"),{createTaskTools}=require("./tools/taskTools"),{createReportTools}=require("./tools/reportTools"),{createFlowTools}=require("./tools/flowTools"),tenantConfigs={},SYSTEM_PROMPT=require("./prompts/ceo"),{isValidObjectId}=require("mongoose");
|
|
3
|
-
async function runFinanceAgent($id_app$$,$user_id$$,$session_id$$,$userPrompt$$,$files_of_message$$){try{let $is_pure_file_upload$$=!1;(!$userPrompt$$||$userPrompt$$.trim()==="")&&$files_of_message$$&&$files_of_message$$.length>0&&($is_pure_file_upload$$=!0,$userPrompt$$=`Anh v\u1eeba t\u1ea3i l\u00ean ${$files_of_message$$.length} file t\u00e0i li\u1ec7u m\u00e0 ch\u01b0a ghi ch\u00fa g\u00ec. Em h\u00e3y \u0111\u1ecdc l\u01b0\u1edbt qua d\u1eef li\u1ec7u th\u00f4 c\u1ee7a file n\u00e0y, nh\u1eadn di\u1ec7n xem \u0111\u00e2y l\u00e0 lo\u1ea1i gi\u1ea5y t\u1edd g\u00ec (H\u00f3a \u0111\u01a1n, h\u1ee3p \u0111\u1ed3ng, b\u00e1o c\u00e1o...), tr\u00edch xu\u1ea5t 3 th\u00f4ng tin quan tr\u1ecdng nh\u1ea5t v\u00e0 \u0111\u01b0a ra c\u00e1c g\u1ee3i \u00fd h\u00e0nh \u0111\u1ed9ng k\u1ebf ti\u1ebfp trong h\u1ec7 th\u1ed1ng ERP \u0111\u1ec3 anh ch\u1ecdn nh\u00e9.`);
|
|
4
|
-
var $app_systemInstruction$$=await global.getModel("app").findOne({_id:$id_app$$},{ai_name:1,ai_api_key:1,ai_model:1});if(!$app_systemInstruction$$||!$app_systemInstruction$$.ai_api_key||!$app_systemInstruction$$.ai_model)throw Error("Ch\u01b0a khai b\u00e1o API Key ho\u1eb7c Model cho h\u1ec7 th\u1ed1ng.");var $gioi_tinh_isCacheStale_messagesToSend$$=tenantConfigs[$id_app$$]&&tenantConfigs[$id_app$$].modelName!==$app_systemInstruction$$.ai_model;if(!tenantConfigs[$id_app$$]||$gioi_tinh_isCacheStale_messagesToSend$$){const $api_key$$=
|
|
5
|
-
decrypt($app_systemInstruction$$.ai_api_key.replace("flexbiz::",""),!1),$aiType$$=($app_systemInstruction$$.ai_name||"GPT").toUpperCase();let $aiModelInstance$$;switch($aiType$$){case "CLAUDE":case "ANTHROPIC":const {createAnthropic:$createAnthropic$$}=require("@ai-sdk/anthropic");$aiModelInstance$$=$createAnthropic$$({apiKey:$api_key$$})($app_systemInstruction$$.ai_model);break;case "GEMINI":case "GOOGLE":const {createGoogleGenerativeAI:$createGoogleGenerativeAI$$}=require("@ai-sdk/google");$aiModelInstance$$=
|
|
6
|
-
$createGoogleGenerativeAI$$({apiKey:$api_key$$})($app_systemInstruction$$.ai_model);break;default:const {createOpenAI:$createOpenAI$$}=require("@ai-sdk/openai");$aiModelInstance$$=$createOpenAI$$({apiKey:$api_key$$})($app_systemInstruction$$.ai_model)}tenantConfigs[$id_app$$]={model:$aiModelInstance$$,modelName:$app_systemInstruction$$.ai_model};Logger.info(`[Multi-LLM] \u0110\u00e3 kh\u1edfi t\u1ea1o th\u00e0nh c\u00f4ng model ${$app_systemInstruction$$.ai_model} (${$aiType$$}) cho App: ${$id_app$$}`)}const {model:$model$$}=
|
|
7
|
-
tenantConfigs[$id_app$$];$session_id$$||=(await chatController.createSession($id_app$$,$user_id$$,$userPrompt$$.substring(0,1024)))._id.toString();const $activeTools$$={...createStaffTools($id_app$$,$user_id$$,$session_id$$),...createFinanceTools($id_app$$,$user_id$$,$session_id$$),...createStockTools($id_app$$,$user_id$$,$session_id$$),...createRagTools($id_app$$,$user_id$$,$session_id$$,$files_of_message$$),...createSystemTools($id_app$$,$user_id$$,$session_id$$),...createMasterDataTools($id_app$$,
|
|
8
|
-
$user_id$$,$session_id$$),...createKpiTools($id_app$$,$user_id$$,$session_id$$),...createOkrTools($id_app$$,$user_id$$,$session_id$$),...createTaskTools($id_app$$,$user_id$$,$session_id$$),...createReportTools($id_app$$,$user_id$$,$session_id$$),...createFlowTools($id_app$$,$user_id$$,$session_id$$)};$app_systemInstruction$$=`${SYSTEM_PROMPT}`;const [$previousMessages$$,$userInfoDoc$$,$appInfoDoc$$,$memory$$]=await Promise.all([chatController.getChatHistory($id_app$$,$session_id$$,30),global.getModel("participant").findOne({id_app:$id_app$$,
|
|
9
|
-
email:$user_id$$}).lean(),global.getModel("app").findOne({_id:$id_app$$}).lean(),getMemory($id_app$$,$user_id$$)]);$gioi_tinh_isCacheStale_messagesToSend$$=[...$previousMessages$$,{role:"user",content:$userPrompt$$}];const $optimizedMessages$$=pruneMessages({messages:$gioi_tinh_isCacheStale_messagesToSend$$,reasoning:"all",toolCalls:"before-last-message"});$appInfoDoc$$&&($app_systemInstruction$$+=`
|
|
10
|
-
\n# [TH\u00d4NG TIN DOANH NGHI\u1ec6P C\u1ee6A B\u1ea0N]
|
|
11
|
-
B\u1ea1n \u0111ang \u0111\u1ea1i di\u1ec7n v\u00e0 \u0111i\u1ec1u h\u00e0nh h\u1ec7 th\u1ed1ng cho doanh nghi\u1ec7p sau:
|
|
12
|
-
- **T\u00ean doanh nghi\u1ec7p:** ${$appInfoDoc$$.name||"H\u1ec7 th\u1ed1ng n\u1ed9i b\u1ed9"}
|
|
13
|
-
- **M\u00e3 s\u1ed1 thu\u1ebf:** ${$appInfoDoc$$.ma_so_thue||"Ch\u01b0a c\u1eadp nh\u1eadt"}
|
|
14
|
-
- **\u0110\u1ecba ch\u1ec9:** ${$appInfoDoc$$.address||$appInfoDoc$$.dia_chi||"Ch\u01b0a c\u1eadp nh\u1eadt"}
|
|
15
|
-
- **\u0110\u1ecba ch\u1ec9 xu\u1ea5t ho\u00e1 \u0111\u01a1n:** ${$appInfoDoc$$.dia_chi_xuat_hoa_don||"Ch\u01b0a c\u1eadp nh\u1eadt"}
|
|
16
|
-
- **Li\u00ean h\u1ec7:** ${$appInfoDoc$$.phone||$appInfoDoc$$.dien_thoai||""} ${$appInfoDoc$$.email?" | "+$appInfoDoc$$.email:""}
|
|
17
|
-
|
|
18
|
-
[CH\u1ec8 TH\u1eca C\u1ed0T L\u00d5I V\u1ec0 DOANH NGHI\u1ec6P]:
|
|
19
|
-
M\u1ecdi s\u1ed1 li\u1ec7u doanh thu, chi ph\u00ed, c\u00f4ng n\u1ee3 m\u00e0 b\u1ea1n ph\u00e2n t\u00edch \u0111\u1ec1u l\u00e0 t\u00e0i s\u1ea3n c\u1ee7a doanh nghi\u1ec7p n\u00e0y. Khi c\u00f3 y\u00eau c\u1ea7u so\u1ea1n th\u1ea3o v\u0103n b\u1ea3n, h\u1ee3p \u0111\u1ed3ng, email ho\u1eb7c Zalo g\u1eedi \u0111\u1ed1i t\u00e1c ngo\u00e0i, B\u1eaeT BU\u1ed8C ph\u1ea3i d\u00f9ng ch\u00ednh x\u00e1c th\u00f4ng tin \u0111\u1ecbnh danh ph\u00eda tr\u00ean \u0111\u1ec3 l\u00e0m ti\u00eau \u0111\u1ec1 ho\u1eb7c ch\u1eef k\u00fd.
|
|
20
|
-
`);if($userInfoDoc$$){const $thongtinnhanvien$$=await global.getModel("dmnv").findOne({id_app:$id_app$$,user:$user_id$$}).lean(),$fullName$$=$thongtinnhanvien$$?.ten_nv||$userInfoDoc$$.name||"S\u1ebfp",$shortName$$=$fullName$$!=="S\u1ebfp"?$fullName$$.split(" ").pop():"S\u1ebfp";$gioi_tinh_isCacheStale_messagesToSend$$=$thongtinnhanvien$$?.gioi_tinh||"Kh\u00e1c";let $chuc_vu$$,$bo_phan$$;$thongtinnhanvien$$?.chuc_vu&&isValidObjectId($thongtinnhanvien$$?.chuc_vu)&&($chuc_vu$$=(await global.getModel("group").findOne({id_app:$id_app$$,
|
|
21
|
-
_id:$thongtinnhanvien$$.chuc_vu}).lean())?.group_name);$thongtinnhanvien$$?.ma_bp&&($bo_phan$$=(await global.getModel("dmbp").findOne({id_app:$id_app$$,ma_bp:$thongtinnhanvien$$.ma_bp}).lean())?.ten_bp);$app_systemInstruction$$+=`
|
|
22
|
-
\n# [TH\u00d4NG TIN \u0110\u1ed0I T\u00c1C GIAO TI\u1ebeP C\u1ee6A B\u1ea0N]
|
|
23
|
-
B\u1ea1n \u0111ang b\u00e1o c\u00e1o v\u00e0 h\u1ed7 tr\u1ee3 tr\u1ef1c ti\u1ebfp cho nh\u00e2n s\u1ef1 sau:
|
|
24
|
-
- **H\u1ecd v\u00e0 t\u00ean:** ${$fullName$$}
|
|
25
|
-
- **Gi\u1edbi t\u00ednh:** ${$gioi_tinh_isCacheStale_messagesToSend$$}
|
|
26
|
-
- **T\u00e0i kho\u1ea3n \u0111\u1ecbnh danh:** ${$userInfoDoc$$.email||$user_id$$}
|
|
27
|
-
- **Vai tr\u00f2/Ch\u1ee9c v\u1ee5:** ${$chuc_vu$$||$userInfoDoc$$.role||$userInfoDoc$$.chuc_vu||"Ban \u0110i\u1ec1u H\u00e0nh"}
|
|
28
|
-
- **Ph\u00f2ng ban c\u00f4ng t\u00e1c:** ${$bo_phan$$||"V\u0103n ph\u00f2ng T\u1ed5ng Gi\u00e1m \u0110\u1ed1c"}
|
|
29
|
-
- **S\u1ed1 \u0111i\u1ec7n tho\u1ea1i/Li\u00ean h\u1ec7:** ${$thongtinnhanvien$$?.dien_thoai||$userInfoDoc$$.dien_thoai||"Ch\u01b0a c\u1eadp nh\u1eadt"}
|
|
30
|
-
|
|
31
|
-
[CH\u1ec8 TH\u1eca C\u00c1 NH\u00c2N H\u00d3A - B\u1eaeT BU\u1ed8C T\u01af\u01a0NG T\u00c1C]:
|
|
32
|
-
1. **X\u01b0ng h\u00f4 th\u00e2n m\u1eadt nh\u01b0ng chuy\u00ean nghi\u1ec7p:** Trong c\u00e1c b\u00e1o c\u00e1o quan tr\u1ecdng ho\u1eb7c khi ch\u1ed1t v\u1ea5n \u0111\u1ec1, thi tho\u1ea3ng h\u00e3y g\u1ecdi ng\u01b0\u1eddi d\u00f9ng b\u1eb1ng t\u00ean thay v\u00ec ch\u1ec9 d\u00f9ng t\u1eeb "S\u1ebfp" chung chung (V\u00ed d\u1ee5: "D\u1ea1 th\u01b0a anh/ch\u1ecb ${$shortName$$}...", "Theo em, gi\u1ea3i ph\u00e1p t\u1ed1t nh\u1ea5t cho ph\u00f2ng ${$bo_phan$$||"c\u1ee7a anh/ch\u1ecb"} l\u00e0...").
|
|
33
|
-
2. **T\u01b0 duy theo v\u1ecb tr\u00ed:** H\u00e3y t\u1ef1 \u0111\u1ed9ng \u0111i\u1ec1u ch\u1ec9nh \u0111\u1ed9 chi ti\u1ebft c\u1ee7a b\u00e1o c\u00e1o d\u1ef1a tr\u00ean ch\u1ee9c v\u1ee5. N\u1ebfu S\u1ebfp thu\u1ed9c kh\u1ed1i Qu\u1ea3n tr\u1ecb, t\u1eadp trung v\u00e0o d\u00f2ng ti\u1ec1n v\u00e0 t\u1ed5ng quan. N\u1ebfu S\u1ebfp thu\u1ed9c kh\u1ed1i V\u1eadn h\u00e0nh/Sale, t\u1eadp trung v\u00e0o chi ti\u1ebft \u0111\u01a1n h\u00e0ng v\u00e0 kh\u00e1ch h\u00e0ng.
|
|
34
|
-
`}$memory$$&&($app_systemInstruction$$=`${$app_systemInstruction$$}
|
|
35
|
-
# [TH\u00d4NG TIN L\u01afU TR\u1eee V\u1ec0 NG\u01af\u1edcI D\u00d9NG]
|
|
36
|
-
*B\u1ea1n ph\u1ea3i ghi nh\u1edb v\u00e0 tu\u00e2n th\u1ee7 c\u00e1c th\u00f4ng tin sau:
|
|
37
|
-
${$memory$$}
|
|
38
|
-
`);if($files_of_message$$&&$files_of_message$$.length>0){Logger.info(`[Backend Core] Ph\u00e1t hi\u1ec7n ${$files_of_message$$.length} file \u0111\u00ednh k\u00e8m. \u0110ang ti\u1ebfn h\u00e0nh nh\u1ed3i context tr\u1ef1c ti\u1ebfp...`);const $chunks$$=await global.getModel("filechunk").find({id_app:$id_app$$,file_id:{$in:$files_of_message$$}}).sort({file_id:1,chunk_index:1}).lean();if($chunks$$&&$chunks$$.length>0)if($chunks$$.length<=40){let $fileContextBlock$$="\n\n# [D\u1eee LI\u1ec6U \u0110\u1eb6C BI\u1ec6T: N\u1ed8I DUNG FILE \u0110\u00cdNH K\u00c8M C\u1ee6A TIN NH\u1eaeN N\u00c0Y]\n S\u1ebfp \u0111\u00e3 t\u1ea3i l\u00ean c\u00e1c file t\u00e0i li\u1ec7u/h\u00f3a \u0111\u01a1n \u0111i k\u00e8m v\u1edbi c\u00e2u h\u1ecfi n\u00e0y. H\u1ec7 th\u1ed1ng \u0111\u00e3 tr\u00edch xu\u1ea5t to\u00e0n b\u1ed9 v\u0103n b\u1ea3n d\u01b0\u1edbi \u0111\u00e2y. \n B\u1ea1n B\u1eaeT BU\u1ed8C ph\u1ea3i \u0111\u1ecdc n\u1ed9i dung n\u00e0y \u0111\u1ec3 tr\u1ea3 l\u1eddi S\u1ebfp NGAY L\u1eacP T\u1ee8C m\u00e0 KH\u00d4NG C\u1ea6N g\u1ecdi tool 'searchKnowledgeBaseTool':\n";
|
|
39
|
-
$chunks$$.forEach($c$$=>{$fileContextBlock$$+=`\n[M\u00e3 File: ${$c$$.file_id} | \u0110o\u1ea1n ${$c$$.chunk_index}]:\n${$c$$.content}\n`});$fileContextBlock$$+="\n[K\u1ebeT TH\u00daC V\u0102N B\u1ea2N FILE]. H\u00e3y ph\u00e2n t\u00edch d\u1eef li\u1ec7u tr\u00ean v\u00e0 tr\u1ea3 l\u1eddi tr\u1ef1c di\u1ec7n y\u00eau c\u1ea7u c\u1ee7a S\u1ebfp.";$app_systemInstruction$$+=$fileContextBlock$$;Logger.info(`[Backend Core] \u0110\u00e3 nh\u1ed3i th\u00e0nh c\u00f4ng ${$chunks$$.length} chunks v\u00e0o System Prompt.`)}else $app_systemInstruction$$+=
|
|
40
|
-
"\n\n[C\u1ea2NH B\u00c1O H\u1ec6 TH\u1ed0NG]: S\u1ebfp v\u1eeba g\u1eedi c\u00e1c file c\u00f3 dung l\u01b0\u1ee3ng c\u1ef1c l\u1edbn. B\u1ea1n B\u1eaeT BU\u1ed8C ph\u1ea3i g\u1ecdi c\u00f4ng c\u1ee5 'searchKnowledgeBaseTool' \u0111\u1ec3 qu\u00e9t d\u1eef li\u1ec7u, kh\u00f4ng \u0111\u01b0\u1ee3c t\u1ef1 \u00fd \u0111o\u00e1n m\u00f2."}$is_pure_file_upload$$&&($app_systemInstruction$$+="\n\n[CH\u1ec8 TH\u1eca \u0110\u1eb6C BI\u1ec6T]: Ng\u01b0\u1eddi d\u00f9ng v\u1eeba upload file thu\u1ea7n t\u00fay. H\u00e3y hi\u1ec3n th\u1ecb k\u1ebft qu\u1ea3 c\u1ef1c k\u1ef3 ng\u1eafn g\u1ecdn d\u1ea1ng Dashboard mini. Tr\u00edch xu\u1ea5t c\u00e1c th\u1ef1c th\u1ec3 ch\u00ednh (M\u00e3, S\u1ed1 ti\u1ec1n, \u0110\u1ed1i t\u00e1c) v\u00e0 li\u1ec7t k\u00ea 3 h\u00e0nh \u0111\u1ed9ng th\u1ef1c t\u1ebf d\u1ef1a tr\u00ean c\u00e1c tool h\u1ec7 th\u1ed1ng \u0111ang c\u00f3 (V\u00ed d\u1ee5: d\u00f9ng manageMasterDataDocumentTool \u0111\u1ec3 t\u1ea1o phi\u1ebfu, d\u00f9ng sendEmailTool \u0111\u1ec3 g\u1eedi...).");
|
|
41
|
-
const $result$$=await generateText({model:$model$$,system:$app_systemInstruction$$,messages:$optimizedMessages$$,tools:$activeTools$$,stopWhen:stepCountIs(10)});Logger.info("[ceoAgent] l\u01b0u messages v\u00e0o database..");const $msgsToSave$$=[{role:"user",content:$is_pure_file_upload$$?"":$userPrompt$$,files:$files_of_message$$},...$result$$.response.messages.map($msg$$=>({role:$msg$$.role,content:$msg$$.content?Array.isArray($msg$$.content)?$msg$$.content[0]?.text:$msg$$.content:"",tool_calls:$msg$$.tool_calls||
|
|
42
|
-
null,tool_call_id:$msg$$.tool_call_id||null,messages:[$msg$$]}))];try{await chatController.saveMessages($id_app$$,$session_id$$,$msgsToSave$$)}catch($e$$){Logger.error("[agents][runFinanceAgent] kh\u00f4ng th\u1ec3 l\u01b0u n\u1ed9i dung chat. Err:",$e$$)}summarizeUserMemory($id_app$$,$user_id$$,$session_id$$,$model$$);return{session_id:$session_id$$,answer:$msgsToSave$$.length>1?$msgsToSave$$.pop()?.content||"Kh\u00f4ng c\u00f3 ph\u1ea3n h\u1ed3i":"Kh\u00f4ng c\u00f3 k\u1ebft qu\u1ea3 ph\u1ea3n h\u1ed3i"}}catch($error$$){throw console.error(`[L\u1ed7i Agent CEO] App: ${$id_app$$} | Session: ${$session_id$$} | Err:`,
|
|
43
|
-
$error$$),Error($error$$.message);}}module.exports=runFinanceAgent;
|
|
1
|
+
const _0x1368fc=_0x4ab0;(function(_0x481e0b,_0x38799a){const _0x497967=_0x4ab0,_0x1f5007=_0x481e0b();while(!![]){try{const _0x11e514=parseInt(_0x497967(0xc6))/0x1+-parseInt(_0x497967(0x216))/0x2*(-parseInt(_0x497967(0x178))/0x3)+parseInt(_0x497967(0x29a))/0x4+-parseInt(_0x497967(0x1ed))/0x5*(-parseInt(_0x497967(0x24d))/0x6)+parseInt(_0x497967(0x115))/0x7+-parseInt(_0x497967(0x9a))/0x8+-parseInt(_0x497967(0xe2))/0x9;if(_0x11e514===_0x38799a)break;else _0x1f5007['push'](_0x1f5007['shift']());}catch(_0x1b16a5){_0x1f5007['push'](_0x1f5007['shift']());}}}(_0x22c2,0xc28b0));function _0x4ab0(_0xb14644,_0x98a13e){_0xb14644=_0xb14644-0x75;const _0x22c2bb=_0x22c2();let _0x4ab0f9=_0x22c2bb[_0xb14644];if(_0x4ab0['qmWFkw']===undefined){var _0x83a031=function(_0x17b4fb){const _0x3e3640='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0xcb4d84='',_0x376f2c='';for(let _0x26de8d=0x0,_0x374d16,_0x5f17e5,_0xd03357=0x0;_0x5f17e5=_0x17b4fb['charAt'](_0xd03357++);~_0x5f17e5&&(_0x374d16=_0x26de8d%0x4?_0x374d16*0x40+_0x5f17e5:_0x5f17e5,_0x26de8d++%0x4)?_0xcb4d84+=String['fromCharCode'](0xff&_0x374d16>>(-0x2*_0x26de8d&0x6)):0x0){_0x5f17e5=_0x3e3640['indexOf'](_0x5f17e5);}for(let _0xa4e40d=0x0,_0x30ae46=_0xcb4d84['length'];_0xa4e40d<_0x30ae46;_0xa4e40d++){_0x376f2c+='%'+('00'+_0xcb4d84['charCodeAt'](_0xa4e40d)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x376f2c);};_0x4ab0['SCpQeM']=_0x83a031,_0x4ab0['iXQyms']={},_0x4ab0['qmWFkw']=!![];}const _0x146a3d=_0x22c2bb[0x0],_0x19891c=_0xb14644+_0x146a3d,_0x1207a7=_0x4ab0['iXQyms'][_0x19891c];return!_0x1207a7?(_0x4ab0f9=_0x4ab0['SCpQeM'](_0x4ab0f9),_0x4ab0['iXQyms'][_0x19891c]=_0x4ab0f9):_0x4ab0f9=_0x1207a7,_0x4ab0f9;}function _0x22c2(){const _0x47eb2e=['Av9RzxK','XRdHU5TPimsr','cGPBq+g6OG','imsr4BUtBMC','sog6RK4GtG','CMvHC28','AEg7H24GEq','AEg7H24GDG','B2XZ','Es4Gs2G','W6aGyUg6Ow4','lcbLBwe','lcdeKog7KwK','AwWGAg8','DgvTifa','icaGifS','ihbOW60S','zs1Syxm','C3nPB24','yw5Jzue','igpdSYbW','AdOQkIa','As1mte0','Ccb0Ahu','BhmVzMK','cGPBq0G','mZq0nhHXtfbbsq','ignVBNq','ihr1W6jU','zxH0ihq','s2JdOwm','zgDLqMe','igFHU41Pia','imsrXRdHU6nJ','XjhHU5LUzYa','zgvS','W6P1imsr4BUb','tKCGveK','BYbO4BUhia','BMGGke0','q2JgSgeG','CgJdOM4G','W6fJihrO','ysdeKCAHBG','ihWGXjbV','zs4U','4BUnBMCGAa','ignOW61U','DgvUx24','yw5Oigm','z2vZihy','r0LbtYa','imsr4BUdihq','AwrFyxa','4BUzAsbI4BUz','igtHU6u6ia','W6bPigXP','ihrOAsa','igtHU68GBa','y2HPihq','iglHURfUzW','tKDDcIa','BMCGC2u','B3nL','tKGGqSob','C1DPDgG','icaYlIa','zgLHx2m','AwXZ','zw5Kiem','ihtdOwmP','4BQ/Ccb0CG','igpdSYbR','y2H1y18','Dg9VBca','igJHU5CGDa','ig5NAgK','DenVBNq','4BUrBMCGXje','zYWGySoH','Dog7Lw5Nia','zgSVB3a','W6bUiglHU5K','ignO4BUVia','kIPt4BUria','y2vV','CgHVBMu','ssbevu4','XRbHigDO','imsr4BUlBMG','oIOQieG','ksbJAg8','A2JdOwnO','iejv4BUyqW','Amo0BMCG','4BUjigtdUw4','lcbO4BUJCa','W4bzxqOG','seNHU4zqia','BhmVzMW','Aw5MBW','yxjJAeS','AgLFEhu','nte2ndm1mNjywuz4wG','BgNHU4D1ia','AsbKDw4','z2HPig4','B25NigG','kKJHU40GDG','y2H1BMS','BSoGEs4G','XjhdONKGBa','4BURysb04BQJ','Acb4DEg6Pq','y3jLyxq','zMLSzwm','CcdeKEg7K24','BMCGrvi','zg1UDG','DwfUihq','vhjVBMC','yw5Nigm','DSoSignO','4BUhDsb0CG','W6aGDmoQBG','zw1HAwW','DUg7PtOQkG','BIbO4BUtAq','z2LVAv8','ihrO4BUNia','4BUhDsb0Aa','Aog6Rxq','XjfHBMCG','yxu6cIa','DSoGimsrXRa','BwvTB3i','zYbUW6b5','ie5hqvK','zMLUze8','ySoHBYbJ','B2DSzq','DUg7Ps4GtG','zYbSXRdHU6m','vog7Lw5Nia','A3mGDSoG','kIPnW6mG','igtdUw5N','4BQJihbO4BQJ','4BUrBMCGBG','lI4UksW','vSsdBIbW','y8oHyYbM','w1riW5ro','imsrAsbR','cLTnW6mG','lcbJAgK','4BUrDcb24BQL','AwXLigm','qgfPlxm','ywDLCG','zxjYB3i','igpdOwmG','imsqyw5N','y2GGEhu','igTOB+g6OW','rsdeKmontG','y8oHyYb0','scblW4Hn','otm4nJeZnM9bsLD4uW','DsbOW6bU','AgNHU4DUia','4BUlihrYW60','C2vuB28','zYb0Aw4','BwfUywC','4BUhDs9OW7m','kIReKog7I2e','4BUnAsbZ4BUr','Aog6O24GAa','zMXLEgi','qYbcsEg7HG','ywrKCMu','wmAWBMCG','C2f1oGO','zxHWB3i','4BUiifri4BUk','igrHBMG','y+g6RxaGBG','BMCGy+g7Sq','4BUXyYb0Aq','B2nRvg8','y29UDgu','qLxHU5Hdia','ieZgR1uG','yYbS4BUBBG','4BUdignOW60','icaGiYa','Bw9KzwW','zgLLBL8','EhxHUQv0ia','tMfTzq','AEg7H3uSia','AhvUAW','ihHLBsa','4BQ/CcbJAa','C+g7Ksb0Aa','Ev9Tyw4','Cg9W','BMCGy2G','DsWGzmo5','ig3dSI4','iefWCdO','mtm4mZGZofryA2D6ua','BcdeKEg7GYa','AsdeKEg7KwK','sog7HYb0Aa','z2vcyxm','W7mGkfBdRq','ignO4BUjia','vg9VBhm','Dg9YEq','BhmVC3q','Dgv4Da','DgLUAa','Dog6RxaGDa','ywXS','rw0GAmoJ','igzPBgu','CMvZCg8','BhmVC3K','CUg7SwmGza','ysb1CgW','BCoGignO','z2vUDf0','Aw5N','AsbJAmo6','Bg8Gz+g7Rq','BMLUzW','ihtHU5f0ia','DmoTy2GG','mJq1mtaYnZzpy3j1sKe','ig5O4BUtAq','ugJdOxqG','x3rODwu','BhmVBwe','Dw5gAw4','DgHV4BQHAq','A+g6VYb0Aq','zvrVB2W','W7nHimsrXQe','4BQ/igtHU7fH','C2fNzq','ihbOW6jU','ueKGs2u','AEg7G24GDa','W6mGDhldRq','Aog7MYb2W6a','W6aGs0JdLa','ihtdOgKG','4BUCssbeW5K','y8oHyYbN','w0jHy2S','igJdOg5O','icaGlsa','l0XPW6PU','ihWGrxi','kIPhAEg7MW','Acb4W6fJ','XQfUoIOQ','yxbW','veJHU5borW','z1rVB2W','w0ZHU5DPia','rxjYoG','BMFgSog7NwK','icaTicO','kIOG','4BQ/Dsbt4BQ/','BIdeKEg7GsW','tIbet0e','q+g7KfqGta','Ag/dOsdeKq','Asbt4BQ/Ca','tYbi4BUgia','z3jVDxa','DgLUihm','BcCGXjhHU4m','W6mGDog6O2K','sog7IIbdW4e','Amo0ihrO','W6bUAcdeKq','mZmZntqWmKflEMD2Eq','zgSVyw4','BYbJW6fV','rMLSztO','Dw5Nigm','CNvUzYa','y2LWyw4','y+g7P2eGyq','AmoGBMGG','BwfFC28','q+g7PKeGqG','igDP4BQJAq','ihBdOcbS','ihf1W6L0','zw5HAq','C2f2zu0','qUg6RLqGqG','icaGica','ySoHBYbb','igHV4BQ3yW','BMrfBwe','BMCGDSoG','ignOBYa','zYb0AEg7Gq','imsq4BQ2qYa','w2fNzw4','4BUdihtHUQfV','W6bUAcbJ','4BUtAsb0Aa','xtOkica','scbor0G','AxO6oG','W60Gzog7PtO','Aog6O2KGXje','4BUllcb04BQT','ierpqu4','Ccb24BURyq','imsr4BUzBMC','z8oSicHi','AsbSW6PU','zu1HC3q','ifriW5Pd','igpHU6DHia','lcbc4BQUva','lIKU','zg9HBMG','4BQHBIb0Aa','B29SCW','jgLU','BhmVA3a','DcbXDEg6OW','BMDOAEg7HW','Asb0W61U','AEg6V3qGyW','ywXSCW','BIbI4BQJBG','qMfUimsq','r2NdOw0G','zYb2W6aG','BIbOW6bU','yxrHvg8','4BQHBIa','cLTl4BQ+va','icaGcIm','lI4VBgK','DhjPBq','yNmVDxq','imsrAEg7Gxu','ie7HUR91ia','B29Simsr','AmoYBMCG','ieJdK0eG','BMGVy2G','ie5iW4jo','lI9JAge','zYb0Aog7GW','q0JHU4GGva','y2HViha','XjdHU5fJ','BMCGDUg7QW','ihf1ysa','z2vZ','qu5usfi','lIbc4BQHBG','BwfW','CgJHUQnPia','BMDVW6bP','ihtdRwnO','AsbJW7mG','igVdQg0U','AmoPlG','BUg7MwKGza','AEg7GxuGsa','u+g6V3aGDa','4BQLDcb0BW','CLrVB2W','yurVy3u','DgLUihe','igpHU7fJia','mJy3zNDwCen1','w011Bhq','DcbUAmAW','tIbN4BUnAq','t1bjqW','igFHU61Pia','imsr4BUbDsa','AxnbCNi','ienft10','ihtHU7eGW70','zg1ICa','zmo5BMCG','4BQ/DcbXDq','igrVyw4','igZgShuG','igZdQM4G','ig7dOhKS','Agf0lIa','4BUzyYbRAa','BMJHUQv0ia','Aog7IYa','4BUNysbIW6e','Dg9VBf8','BgvHBG','u+g6V3a','yUg6O24Gza','qKNHU4zuxq','qwDLBNq','4BUgvsdeKog6TG','kIPqAmoY','B+g6T2mGAW','CM9SBgu','yxbPs2u','ihrYW7iV','4BUaie5hXQ8','oIOQia','qUg6OK4GrG','BwvZC2e','XjddOYbUAa','W6fVihBdOa','yw5Ol2m','r09pr0W','ihrP4BUbBG','vEg7MemGCa','W6PUihBdOa','DgfIyxm','BhmVCMu','DhnDw3i','xtOk','AgKGy2G','ifri4BUkia','vdOGtUg7Ma','4BUXyYb0Aa','4BUDAsbKW7K','suXfxs4','W6n5ihtHU7e','W6bUAa','CM9Szq','C3rHCNq','s2JdTg5N','BwvUDfq','A2JHU59Pia','ysbYysa','ihrY4BQJia','rYbuW4fd','icje4BQHia','BwfFyNa','AhxHU5LJia','Dg9vCha','DcaZihq','veLoie4','ywXLlca','Dmo6Es4G','igFdRc4G','cIaGica','vflHU64GvG','zog7RYbSAq','A2HHAsa','BMfTzq','ignO4BUjBG','veNHUR5qia','DxNdQM4G','qw5Oihy','icaGie0','yw5Oig4','ucdeKEg7GYa','q2JHU6LJia','igZdOc4U','icaGcIa','AsbJW6j1','Ccb0CNu','W6PUigrV','rYbusu4','zxjdyxm','iepHU6zbia','zcbTAw4','z+g7RwKUlG','yYbnB2q','igrP4BUhBG','DhldQM4G','CxvHBI4','B3jLxsa','W6P1igpHUQC','Esb04BUDia','ywLFBMe','BMCGyMe','W7rUzYbJ','tKGGtKC','lI90B28','kKlHUQfUia','xtOGu+g6VW','EsdeKEg7Jwm','x2LK','ihbOW6fW','lIiPlGO','BYbtExm','W7mGzhvU','mJCXmhPSBw1dEG','BgvUz3q','W6aGXjfP4BUb','DsbJ4BUNyq','igtHU7fHia','ihbOW61H','lsaQkLq','imsrW61UAa','y2fSBf8','ihrP4BQ/BG','ywzMvg8','DgHYB3a','AwXLihq','BYbKW7jU','t1bftKe','BIdeKEg7I24','ywLFyxa','zYb0W6fJ','jZOk','ignODw4','4BUhCcbZyq','W7rUzYa','CM9TChq','Aog7Jw4GBG','AcbO4BUhia','DgHHEsa','rog7RIbmsq','ywLFBw8','4BQGtL0kia','DgHVywK','zYbeyxm','ieZHUQXqia','ms4GkIO','y2fSBhm','CUg7OYb0CG','BIb2W6aG','A2JdTg5N','XjfP4BUhBIa','ignO4BUjoG','yw4GDhi','lsbc4BQUva','mJC2nJj1z3LQBgK','yxrFAg8','zYb04BURia','Cg9YDfq','Acb0Ahu','DSoGBYbJ','AgvVihy','yv9KB24','ihWGu2u','Aog7SwmGDa','ifTusmou','C3vIC3q','CUg6OYbS4BUD','DgJgSgeG','ielHUQfUia','CdOQkIa','DxnLCG','imsr4BUdigW','zMLSzv8','iftgR8AGtG','z2v0tw8','CUg7SwmGDa','W6bUAc9t','Dg9VBem','W7qGy+g7P2e','AwXuB28','rYbgsuW','ihtdOwmG','4BUnyYbU4BUz'];_0x22c2=function(){return _0x47eb2e;};return _0x22c2();}const {generateText,stepCountIs,pruneMessages}=require('ai'),chatController=require(_0x1368fc(0x15f)+_0x1368fc(0x280)+_0x1368fc(0x197)+'r'),{decrypt}=require(_0x1368fc(0x155)+_0x1368fc(0x157)+_0x1368fc(0x277)),{summarizeUserMemory,getMemory}=require('./ai_'+_0x1368fc(0x79)+_0x1368fc(0xc0)+_0x1368fc(0x91)),{createFinanceTools}=require(_0x1368fc(0x1e4)+_0x1368fc(0x24b)+'nance'+_0x1368fc(0xcd)),{createStockTools}=require(_0x1368fc(0x1e4)+_0x1368fc(0xcf)+_0x1368fc(0xb0)+_0x1368fc(0x23b)),{createRagTools}=require(_0x1368fc(0x1e4)+'ls/ra'+_0x1368fc(0x101)+'s'),{createStaffTools}=require('./too'+_0x1368fc(0xcf)+_0x1368fc(0x1f7)+_0x1368fc(0x23b)),{createSystemTools}=require(_0x1368fc(0x1e4)+_0x1368fc(0xd7)+'stemT'+_0x1368fc(0x144)),{createMasterDataTools}=require(_0x1368fc(0x1e4)+_0x1368fc(0xe6)+'sterD'+_0x1368fc(0x151)+_0x1368fc(0x23b)),{createKpiTools}=require(_0x1368fc(0x1e4)+_0x1368fc(0x146)+'iTool'+'s'),{createOkrTools}=require(_0x1368fc(0x1e4)+'ls/ok'+_0x1368fc(0x174)+'s'),{createTaskTools}=require(_0x1368fc(0x1e4)+'ls/ta'+'skToo'+'ls'),{createReportTools}=require(_0x1368fc(0x1e4)+_0x1368fc(0x1a6)+_0x1368fc(0x219)+'ools'),{createFlowTools}=require(_0x1368fc(0x1e4)+_0x1368fc(0x296)+'owToo'+'ls'),tenantConfigs={},SYSTEM_PROMPT=require('./pro'+'mpts/'+_0x1368fc(0x288)),{isValidObjectId}=require('mongo'+_0x1368fc(0x272));async function runFinanceAgent(_0x46becb,_0x4f6e15,_0x26a3e0,_0x2d1db7,_0x1291a3){const _0x53ff8c=_0x1368fc;try{let _0x2cc892=![];(!_0x2d1db7||_0x2d1db7[_0x53ff8c(0x156)]()==='')&&_0x1291a3&&_0x1291a3[_0x53ff8c(0x1ee)+'h']>0x0&&(_0x2cc892=!![],_0x2d1db7=_0x53ff8c(0x1ca)+_0x53ff8c(0x2a3)+_0x53ff8c(0x13c)+'\x20'+_0x1291a3['lengt'+'h']+(_0x53ff8c(0xd5)+_0x53ff8c(0xf4)+_0x53ff8c(0x29b)+_0x53ff8c(0xda)+_0x53ff8c(0x28b)+_0x53ff8c(0xdd)+_0x53ff8c(0x1c1)+_0x53ff8c(0xd4)+_0x53ff8c(0x1e7)+'\x20lướt'+_0x53ff8c(0x165)+_0x53ff8c(0x1c4)+_0x53ff8c(0x2b5)+_0x53ff8c(0x22e)+_0x53ff8c(0xd5)+_0x53ff8c(0x188)+'\x20nhận'+_0x53ff8c(0x1da)+_0x53ff8c(0xbd)+_0x53ff8c(0x2a2)+'à\x20loạ'+'i\x20giấ'+_0x53ff8c(0x1df)+_0x53ff8c(0x13b)+_0x53ff8c(0xeb)+'n,\x20hợ'+_0x53ff8c(0x2a7)+_0x53ff8c(0x282)+_0x53ff8c(0x117)+_0x53ff8c(0x87)+'\x20tríc'+_0x53ff8c(0x2a4)+_0x53ff8c(0x1bd)+_0x53ff8c(0x291)+_0x53ff8c(0x176)+_0x53ff8c(0x2aa)+'rọng\x20'+_0x53ff8c(0x18b)+_0x53ff8c(0x78)+_0x53ff8c(0x1b6)+_0x53ff8c(0xf6)+'ợi\x20ý\x20'+_0x53ff8c(0x11d)+_0x53ff8c(0x255)+_0x53ff8c(0xe9)+_0x53ff8c(0x27a)+_0x53ff8c(0x29e)+'ệ\x20thố'+_0x53ff8c(0x2a8)+_0x53ff8c(0x1cd)+_0x53ff8c(0x264)+_0x53ff8c(0x204)+_0x53ff8c(0x16f)));const _0x33ec49={};_0x33ec49[_0x53ff8c(0x1e8)]=_0x46becb;const _0x4d8cdd={};_0x4d8cdd[_0x53ff8c(0x1e0)+'me']=0x1,_0x4d8cdd[_0x53ff8c(0x1fd)+'i_key']=0x1,_0x4d8cdd['ai_mo'+_0x53ff8c(0x256)]=0x1;const _0x531acc=await global[_0x53ff8c(0x22a)+'del'](_0x53ff8c(0xff))['findO'+'ne'](_0x33ec49,_0x4d8cdd);if(!_0x531acc||!_0x531acc['ai_ap'+_0x53ff8c(0x233)]||!_0x531acc[_0x53ff8c(0x208)+_0x53ff8c(0x256)])throw new Error('Chưa\x20'+_0x53ff8c(0x1c5)+_0x53ff8c(0x127)+_0x53ff8c(0xef)+'y\x20hoặ'+_0x53ff8c(0x1d9)+'el\x20ch'+_0x53ff8c(0x259)+'thống'+'.');const _0x531644=tenantConfigs[_0x46becb]&&tenantConfigs[_0x46becb][_0x53ff8c(0xb7)+_0x53ff8c(0xba)]!==_0x531acc[_0x53ff8c(0x208)+_0x53ff8c(0x256)];if(!tenantConfigs[_0x46becb]||_0x531644){const _0x298554=_0x531acc['ai_ap'+_0x53ff8c(0x233)]&&_0x531acc[_0x53ff8c(0x1fd)+'i_key'][_0x53ff8c(0x1b2)+_0x53ff8c(0x274)](_0x53ff8c(0xa5)+_0x53ff8c(0x134))?decrypt(_0x531acc['ai_ap'+'i_key']['repla'+'ce'](_0x53ff8c(0xa5)+_0x53ff8c(0x134),''),![]):_0x531acc[_0x53ff8c(0x1fd)+'i_key'],_0xfd9efc=(_0x531acc[_0x53ff8c(0x1e0)+'me']||'GPT')[_0x53ff8c(0x1bc)+_0x53ff8c(0x1d5)+'e']();let _0x2471a9;switch(_0xfd9efc){case'CLAUD'+'E':case _0x53ff8c(0x167)+_0x53ff8c(0x17c):{const {createAnthropic:_0x5038fb}=require('@ai-s'+_0x53ff8c(0x116)+_0x53ff8c(0x1f8)+'ic'),_0x212cb0={};_0x212cb0[_0x53ff8c(0x198)+'y']=_0x298554;const _0x26f784=_0x5038fb(_0x212cb0);_0x2471a9=_0x26f784(_0x531acc[_0x53ff8c(0x208)+_0x53ff8c(0x256)]);break;}case'GEMIN'+'I':case _0x53ff8c(0x1a1)+'E':{const {createGoogleGenerativeAI:_0xec835e}=require(_0x53ff8c(0x90)+'dk/go'+_0x53ff8c(0x7e)),_0x220f67={};_0x220f67[_0x53ff8c(0x198)+'y']=_0x298554;const _0x48e57a=_0xec835e(_0x220f67);_0x2471a9=_0x48e57a(_0x531acc[_0x53ff8c(0x208)+_0x53ff8c(0x256)]);break;}case'GPT':case _0x53ff8c(0x1fb)+'I':default:{const {createOpenAI:_0x3a758c}=require(_0x53ff8c(0x90)+_0x53ff8c(0x284)+_0x53ff8c(0x123)),_0x1290b9={};_0x1290b9['apiKe'+'y']=_0x298554;const _0x4f8af9=_0x3a758c(_0x1290b9);_0x2471a9=_0x4f8af9(_0x531acc[_0x53ff8c(0x208)+_0x53ff8c(0x256)]);break;}}const _0x48b625={};_0x48b625[_0x53ff8c(0xb7)]=_0x2471a9,_0x48b625[_0x53ff8c(0xb7)+'Name']=_0x531acc[_0x53ff8c(0x208)+_0x53ff8c(0x256)],tenantConfigs[_0x46becb]=_0x48b625,Logger[_0x53ff8c(0x297)](_0x53ff8c(0x179)+_0x53ff8c(0x249)+']\x20Đã\x20'+_0x53ff8c(0x1b5)+'tạo\x20t'+'hành\x20'+'công\x20'+_0x53ff8c(0xb7)+'\x20'+_0x531acc['ai_mo'+_0x53ff8c(0x256)]+'\x20('+_0xfd9efc+(_0x53ff8c(0x28e)+_0x53ff8c(0xc5)+'\x20')+_0x46becb);}const {model:_0x4a7d83}=tenantConfigs[_0x46becb];if(!_0x26a3e0){const _0x616213=await chatController[_0x53ff8c(0x2a5)+'eSess'+'ion'](_0x46becb,_0x4f6e15,_0x2d1db7[_0x53ff8c(0x221)+'ring'](0x0,0x400));_0x26a3e0=_0x616213[_0x53ff8c(0x1e8)]['toStr'+_0x53ff8c(0xdc)]();}const _0x49d119={...createStaffTools(_0x46becb,_0x4f6e15,_0x26a3e0),...createFinanceTools(_0x46becb,_0x4f6e15,_0x26a3e0),...createStockTools(_0x46becb,_0x4f6e15,_0x26a3e0),...createRagTools(_0x46becb,_0x4f6e15,_0x26a3e0,_0x1291a3),...createSystemTools(_0x46becb,_0x4f6e15,_0x26a3e0),...createMasterDataTools(_0x46becb,_0x4f6e15,_0x26a3e0),...createKpiTools(_0x46becb,_0x4f6e15,_0x26a3e0),...createOkrTools(_0x46becb,_0x4f6e15,_0x26a3e0),...createTaskTools(_0x46becb,_0x4f6e15,_0x26a3e0),...createReportTools(_0x46becb,_0x4f6e15,_0x26a3e0),...createFlowTools(_0x46becb,_0x4f6e15,_0x26a3e0)};let _0x58eaeb=''+SYSTEM_PROMPT;const [_0xa711ac,_0xfb274,_0x2bea67,_0x4cad66]=await Promise[_0x53ff8c(0xd3)]([chatController['getCh'+'atHis'+_0x53ff8c(0xce)](_0x46becb,_0x26a3e0,0x1e),global['getMo'+_0x53ff8c(0x256)]('parti'+_0x53ff8c(0x11b)+'t')[_0x53ff8c(0x7c)+'ne']({'id_app':_0x46becb,'email':_0x4f6e15})[_0x53ff8c(0x18f)](),global[_0x53ff8c(0x22a)+_0x53ff8c(0x256)](_0x53ff8c(0xff))[_0x53ff8c(0x7c)+'ne']({'_id':_0x46becb})[_0x53ff8c(0x18f)](),getMemory(_0x46becb,_0x4f6e15)]),_0x29fad9={};_0x29fad9['role']=_0x53ff8c(0x226),_0x29fad9['conte'+'nt']=_0x2d1db7;const _0x541d92=[..._0xa711ac,_0x29fad9],_0x141576={};_0x141576['messa'+_0x53ff8c(0x166)]=_0x541d92,_0x141576[_0x53ff8c(0x238)+_0x53ff8c(0xdf)]=_0x53ff8c(0xd3),_0x141576[_0x53ff8c(0x22d)+_0x53ff8c(0x14b)]='befor'+_0x53ff8c(0x244)+'t-mes'+_0x53ff8c(0xed);const _0xb1cfe7=pruneMessages(_0x141576);_0x2bea67&&(_0x58eaeb+=_0x53ff8c(0x1c2)+'\x20\x20\x20\x20\x20'+'\x20\x20\x20\x0a#'+'\x20[THÔ'+_0x53ff8c(0x258)+_0x53ff8c(0x109)+_0x53ff8c(0x1e3)+_0x53ff8c(0x295)+'CỦA\x20B'+_0x53ff8c(0x209)+'\x20\x20\x20\x20\x20'+_0x53ff8c(0x126)+'\x20Bạn\x20'+'đang\x20'+'đại\x20d'+_0x53ff8c(0x23a)+_0x53ff8c(0x1ef)+_0x53ff8c(0x9b)+_0x53ff8c(0x205)+'thống'+_0x53ff8c(0x12b)+'doanh'+_0x53ff8c(0x27f)+_0x53ff8c(0x201)+'u:\x0a\x20\x20'+'\x20\x20\x20\x20\x20'+_0x53ff8c(0x126)+_0x53ff8c(0x1f3)+_0x53ff8c(0x1d3)+_0x53ff8c(0x1cc)+'ghiệp'+_0x53ff8c(0x19b)+(_0x2bea67[_0x53ff8c(0x1c6)]||_0x53ff8c(0xc9)+_0x53ff8c(0x86)+_0x53ff8c(0x269))+('\x0a\x20\x20\x20\x20'+_0x53ff8c(0x126)+'\x20\x20\x20-\x20'+_0x53ff8c(0x83)+_0x53ff8c(0xbf)+'uế:**'+'\x20')+(_0x2bea67[_0x53ff8c(0x11e)+_0x53ff8c(0xe5)]||_0x53ff8c(0x25b)+'cập\x20n'+_0x53ff8c(0x75))+(_0x53ff8c(0x1c2)+'\x20\x20\x20\x20\x20'+'\x20\x20\x20-\x20'+'**Địa'+_0x53ff8c(0x213)+_0x53ff8c(0x106))+(_0x2bea67[_0x53ff8c(0xa7)+'ss']||_0x2bea67[_0x53ff8c(0x276)+'hi']||'Chưa\x20'+'cập\x20n'+_0x53ff8c(0x75))+('\x0a\x20\x20\x20\x20'+_0x53ff8c(0x126)+'\x20\x20\x20-\x20'+_0x53ff8c(0xa2)+_0x53ff8c(0xcc)+_0x53ff8c(0xb9)+_0x53ff8c(0x10b)+_0x53ff8c(0xfe)+'\x20')+(_0x2bea67['dia_c'+_0x53ff8c(0x299)+_0x53ff8c(0x217)+_0x53ff8c(0x21d)]||_0x53ff8c(0x25b)+'cập\x20n'+_0x53ff8c(0x75))+(_0x53ff8c(0x1c2)+_0x53ff8c(0x126)+_0x53ff8c(0xf9)+'**Liê'+'n\x20hệ:'+_0x53ff8c(0x106))+(_0x2bea67[_0x53ff8c(0x289)]||_0x2bea67[_0x53ff8c(0xb8)+_0x53ff8c(0x20a)]||'')+'\x20'+(_0x2bea67[_0x53ff8c(0x2b0)]?'\x20|\x20'+_0x2bea67[_0x53ff8c(0x2b0)]:'')+(_0x53ff8c(0x1c2)+_0x53ff8c(0x126)+_0x53ff8c(0x1d0)+_0x53ff8c(0x126)+_0x53ff8c(0x126)+'\x20[CHỈ'+_0x53ff8c(0x1aa)+_0x53ff8c(0x10a)+'ÕI\x20VỀ'+_0x53ff8c(0x138)+_0x53ff8c(0x133)+'IỆP]:'+'\x20\x0a\x20\x20\x20'+_0x53ff8c(0x126)+_0x53ff8c(0x1cb)+_0x53ff8c(0xa3)+'\x20liệu'+_0x53ff8c(0x185)+_0x53ff8c(0x21a)+_0x53ff8c(0x8d)+_0x53ff8c(0x243)+'\x20công'+'\x20nợ\x20m'+_0x53ff8c(0x23d)+_0x53ff8c(0xee)+_0x53ff8c(0x16c)+_0x53ff8c(0x17e)+'là\x20tà'+'i\x20sản'+_0x53ff8c(0x13f)+_0x53ff8c(0x142)+_0x53ff8c(0x27f)+'ệp\x20nà'+_0x53ff8c(0x23c)+_0x53ff8c(0x16d)+'yêu\x20c'+'ầu\x20so'+_0x53ff8c(0x143)+'ảo\x20vă'+_0x53ff8c(0x14c)+_0x53ff8c(0x293)+_0x53ff8c(0x236)+_0x53ff8c(0x23e)+_0x53ff8c(0x240)+'ặc\x20Za'+_0x53ff8c(0xde)+_0x53ff8c(0xc8)+_0x53ff8c(0x231)+_0x53ff8c(0x16b)+_0x53ff8c(0x140)+'\x20BUỘC'+'\x20phải'+'\x20dùng'+_0x53ff8c(0x262)+_0x53ff8c(0xfd)+'\x20thôn'+_0x53ff8c(0x9f)+_0x53ff8c(0x28c)+_0x53ff8c(0xac)+_0x53ff8c(0x1f2)+'\x20trên'+_0x53ff8c(0x227)+'àm\x20ti'+_0x53ff8c(0x257)+_0x53ff8c(0x128)+_0x53ff8c(0x286)+'ký.\x0a\x20'+_0x53ff8c(0x126)+'\x20\x20'));if(_0xfb274){const _0x3230b2={};_0x3230b2[_0x53ff8c(0x268)+'p']=_0x46becb,_0x3230b2[_0x53ff8c(0x226)]=_0x4f6e15;const _0x12afe5=await global['getMo'+_0x53ff8c(0x256)](_0x53ff8c(0x2a9))['findO'+'ne'](_0x3230b2)[_0x53ff8c(0x18f)](),_0x3c7b68=_0x12afe5?.[_0x53ff8c(0x263)+'v']||_0xfb274[_0x53ff8c(0x1c6)]||_0x53ff8c(0x190),_0x54f788=_0x3c7b68!==_0x53ff8c(0x190)?_0x3c7b68['split']('\x20')[_0x53ff8c(0xc1)]():_0x53ff8c(0x190),_0x28508a=_0x12afe5?.[_0x53ff8c(0x2b3)+_0x53ff8c(0xd1)]||_0x53ff8c(0x251);let _0x8066af,_0x2f1148;if(_0x12afe5?.[_0x53ff8c(0x27c)+'vu']&&isValidObjectId(_0x12afe5?.[_0x53ff8c(0x27c)+'vu'])){const _0x2bf59f={};_0x2bf59f['id_ap'+'p']=_0x46becb,_0x2bf59f[_0x53ff8c(0x1e8)]=_0x12afe5[_0x53ff8c(0x27c)+'vu'];let _0x4597d9=await global[_0x53ff8c(0x22a)+_0x53ff8c(0x256)](_0x53ff8c(0x10e))[_0x53ff8c(0x7c)+'ne'](_0x2bf59f)['lean']();_0x8066af=_0x4597d9?.[_0x53ff8c(0x10e)+'_name'];}if(_0x12afe5?.['ma_bp']){const _0x13c12c={};_0x13c12c[_0x53ff8c(0x268)+'p']=_0x46becb,_0x13c12c[_0x53ff8c(0x1ba)]=_0x12afe5[_0x53ff8c(0x1ba)];let _0x3c73b7=await global[_0x53ff8c(0x22a)+_0x53ff8c(0x256)](_0x53ff8c(0x182))[_0x53ff8c(0x7c)+'ne'](_0x13c12c)['lean']();_0x2f1148=_0x3c73b7?.['ten_b'+'p'];}_0x58eaeb+=_0x53ff8c(0x1c2)+_0x53ff8c(0x126)+_0x53ff8c(0x154)+_0x53ff8c(0x220)+'NG\x20TI'+'N\x20ĐỐI'+'\x20TÁC\x20'+_0x53ff8c(0x266)+_0x53ff8c(0x1c8)+_0x53ff8c(0x11f)+'ẠN]\x0a\x20'+_0x53ff8c(0x126)+_0x53ff8c(0x126)+'\x20Bạn\x20'+_0x53ff8c(0x76)+_0x53ff8c(0x7d)+_0x53ff8c(0x19f)+_0x53ff8c(0x27e)+_0x53ff8c(0x20f)+_0x53ff8c(0xaf)+_0x53ff8c(0xbe)+'o\x20nhâ'+'n\x20sự\x20'+_0x53ff8c(0xa9)+'\x20\x20\x20\x20\x20'+_0x53ff8c(0x126)+_0x53ff8c(0x105)+_0x53ff8c(0x29f)+_0x53ff8c(0x2af)+_0x53ff8c(0x19b)+_0x3c7b68+(_0x53ff8c(0x1c2)+_0x53ff8c(0x126)+'\x20\x20\x20-\x20'+_0x53ff8c(0xfc)+_0x53ff8c(0x149)+_0x53ff8c(0x248))+_0x28508a+(_0x53ff8c(0x1c2)+_0x53ff8c(0x126)+'\x20\x20\x20-\x20'+'**Tài'+_0x53ff8c(0x96)+_0x53ff8c(0x1fc)+'h\x20dan'+'h:**\x20')+(_0xfb274[_0x53ff8c(0x2b0)]||_0x4f6e15)+(_0x53ff8c(0x1c2)+_0x53ff8c(0x126)+'\x20\x20\x20-\x20'+'**Vai'+_0x53ff8c(0x199)+_0x53ff8c(0x1ce)+_0x53ff8c(0x2b1)+'\x20')+(_0x8066af||_0xfb274['role']||_0xfb274['chuc_'+'vu']||_0x53ff8c(0x14d)+_0x53ff8c(0x171)+_0x53ff8c(0x1b0))+(_0x53ff8c(0x1c2)+_0x53ff8c(0x126)+_0x53ff8c(0xf9)+_0x53ff8c(0x195)+_0x53ff8c(0x1e1)+'n\x20côn'+_0x53ff8c(0x1fe)+_0x53ff8c(0x19b))+(_0x2f1148||_0x53ff8c(0x88)+_0x53ff8c(0x15b)+_0x53ff8c(0x81)+_0x53ff8c(0x14e)+_0x53ff8c(0x163))+(_0x53ff8c(0x1c2)+'\x20\x20\x20\x20\x20'+_0x53ff8c(0xf9)+_0x53ff8c(0x287)+_0x53ff8c(0x212)+_0x53ff8c(0xe8)+_0x53ff8c(0xfa)+'\x20hệ:*'+'*\x20')+(_0x12afe5?.[_0x53ff8c(0xb8)+_0x53ff8c(0x20a)]||_0xfb274[_0x53ff8c(0xb8)+_0x53ff8c(0x20a)]||_0x53ff8c(0x25b)+_0x53ff8c(0xad)+'hật')+('\x0a\x0a\x20\x20\x20'+_0x53ff8c(0x126)+_0x53ff8c(0x242)+_0x53ff8c(0x161)+_0x53ff8c(0x112)+_0x53ff8c(0x15e)+_0x53ff8c(0x15c)+_0x53ff8c(0x215)+_0x53ff8c(0x290)+_0x53ff8c(0x229)+_0x53ff8c(0x1b8)+_0x53ff8c(0x132)+'\x20\x20\x20\x20\x20'+'\x20\x20\x20\x20\x20'+_0x53ff8c(0x20d)+_0x53ff8c(0xa8)+_0x53ff8c(0x113)+'ân\x20mậ'+_0x53ff8c(0x17a)+_0x53ff8c(0xc2)+_0x53ff8c(0x1c9)+_0x53ff8c(0x148)+_0x53ff8c(0x225)+_0x53ff8c(0x2ab)+_0x53ff8c(0x93)+'báo\x20c'+'áo\x20qu'+_0x53ff8c(0x214)+_0x53ff8c(0x261)+_0x53ff8c(0x196)+_0x53ff8c(0x1a9)+_0x53ff8c(0x8e)+_0x53ff8c(0x108)+_0x53ff8c(0x26c)+'thoản'+'g\x20hãy'+_0x53ff8c(0x253)+_0x53ff8c(0x104)+_0x53ff8c(0x84)+_0x53ff8c(0x26f)+'\x20tên\x20'+_0x53ff8c(0x206)+_0x53ff8c(0x2ad)+_0x53ff8c(0x292)+_0x53ff8c(0x218)+'\x22Sếp\x22'+_0x53ff8c(0x200)+'g\x20chu'+'ng\x20(V'+_0x53ff8c(0x135)+_0x53ff8c(0x1b9)+_0x53ff8c(0x223)+_0x53ff8c(0x1a0)+_0x53ff8c(0x18c))+_0x54f788+('...\x22,'+'\x20\x22The'+'o\x20em,'+_0x53ff8c(0x120)+_0x53ff8c(0x1e9)+_0x53ff8c(0xe0)+'nhất\x20'+_0x53ff8c(0x162)+_0x53ff8c(0x15b))+(_0x2f1148||_0x53ff8c(0x11c)+_0x53ff8c(0x15d)+'ị')+(_0x53ff8c(0x1cf)+_0x53ff8c(0x1ea)+_0x53ff8c(0x126)+_0x53ff8c(0x126)+_0x53ff8c(0x275)+'**Tư\x20'+'duy\x20t'+_0x53ff8c(0x21c)+_0x53ff8c(0x9d)+_0x53ff8c(0x28d)+_0x53ff8c(0x1af)+_0x53ff8c(0x13a)+_0x53ff8c(0x158)+_0x53ff8c(0x1c7)+'h\x20độ\x20'+_0x53ff8c(0x26e)+_0x53ff8c(0x14a)+_0x53ff8c(0x18d)+_0x53ff8c(0x117)+_0x53ff8c(0x1f1)+_0x53ff8c(0x1db)+'chức\x20'+_0x53ff8c(0x7f)+_0x53ff8c(0x107)+_0x53ff8c(0x24a)+_0x53ff8c(0x18a)+'ối\x20Qu'+'ản\x20tr'+_0x53ff8c(0x137)+_0x53ff8c(0x1d2)+_0x53ff8c(0x12a)+_0x53ff8c(0x1fa)+_0x53ff8c(0x12c)+_0x53ff8c(0x210)+_0x53ff8c(0x283)+_0x53ff8c(0x1dc)+_0x53ff8c(0x159)+_0x53ff8c(0x172)+_0x53ff8c(0x1bb)+'khối\x20'+'Vận\x20h'+_0x53ff8c(0x22c)+_0x53ff8c(0x1bf)+_0x53ff8c(0xd2)+_0x53ff8c(0x11a)+_0x53ff8c(0x21b)+'hi\x20ti'+'ết\x20đơ'+_0x53ff8c(0x150)+_0x53ff8c(0x14f)+_0x53ff8c(0x28f)+'\x20hàng'+'.\x0a\x20\x20\x20'+_0x53ff8c(0x126));}_0x4cad66&&(_0x58eaeb=_0x58eaeb+(_0x53ff8c(0x1c2)+'\x20\x20\x20\x20\x20'+_0x53ff8c(0xb6)+_0x53ff8c(0x8a)+_0x53ff8c(0x1d4)+_0x53ff8c(0xb3)+_0x53ff8c(0x1c3)+_0x53ff8c(0x19a)+_0x53ff8c(0xf5)+_0x53ff8c(0x270)+_0x53ff8c(0x126)+_0x53ff8c(0x126)+_0x53ff8c(0x126)+_0x53ff8c(0x1e5)+_0x53ff8c(0x16a)+_0x53ff8c(0x29d)+_0x53ff8c(0xf2)+_0x53ff8c(0x24f)+_0x53ff8c(0x2b4)+_0x53ff8c(0x98)+'hông\x20'+_0x53ff8c(0x10f)+_0x53ff8c(0x77)+'\x20\x20\x20\x20\x20'+'\x20\x20\x20\x20\x20'+_0x53ff8c(0x126))+_0x4cad66+('\x0a\x20\x20\x20\x20'+'\x20\x20\x20\x20'));if(_0x1291a3&&_0x1291a3['lengt'+'h']>0x0){Logger[_0x53ff8c(0x297)](_0x53ff8c(0xf7)+_0x53ff8c(0x278)+'ore]\x20'+_0x53ff8c(0xe4)+_0x53ff8c(0x9c)+_0x1291a3['lengt'+'h']+('\x20file'+_0x53ff8c(0x1f4)+_0x53ff8c(0x16e)+_0x53ff8c(0x94)+_0x53ff8c(0x1f6)+_0x53ff8c(0xf8)+_0x53ff8c(0xe3)+_0x53ff8c(0x24e)+_0x53ff8c(0x250)+_0x53ff8c(0x22b)+'iếp..'+'.'));const _0x58f245=global[_0x53ff8c(0x22a)+_0x53ff8c(0x256)](_0x53ff8c(0x2a6)+_0x53ff8c(0xbc)),_0x4047f5={};_0x4047f5[_0x53ff8c(0x145)]=_0x1291a3;const _0xd1704c={};_0xd1704c[_0x53ff8c(0x268)+'p']=_0x46becb,_0xd1704c[_0x53ff8c(0x228)+'id']=_0x4047f5;const _0x325de3={};_0x325de3[_0x53ff8c(0x228)+'id']=0x1,_0x325de3[_0x53ff8c(0x2a0)+'_inde'+'x']=0x1;const _0x252e53=await _0x58f245['find'](_0xd1704c)['sort'](_0x325de3)[_0x53ff8c(0x18f)]();if(_0x252e53&&_0x252e53[_0x53ff8c(0x1ee)+'h']>0x0){if(_0x252e53[_0x53ff8c(0x1ee)+'h']<=0x28){let _0x2bd585='\x0a\x0a#\x20['+_0x53ff8c(0x207)+_0x53ff8c(0x194)+_0x53ff8c(0xa6)+_0x53ff8c(0x1ab)+_0x53ff8c(0x28a)+_0x53ff8c(0x230)+_0x53ff8c(0x97)+_0x53ff8c(0x99)+_0x53ff8c(0x1d6)+_0x53ff8c(0x1be)+_0x53ff8c(0x237)+_0x53ff8c(0x294)+'\x20\x20\x20\x20\x20'+'\x20\x20\x20\x20\x20'+_0x53ff8c(0x126)+'Sếp\x20đ'+_0x53ff8c(0x111)+_0x53ff8c(0x187)+_0x53ff8c(0x89)+_0x53ff8c(0x1f9)+_0x53ff8c(0x26b)+_0x53ff8c(0xa1)+_0x53ff8c(0x25e)+_0x53ff8c(0x8b)+'èm\x20vớ'+_0x53ff8c(0x1d1)+'\x20hỏi\x20'+_0x53ff8c(0x2a1)+'Hệ\x20th'+_0x53ff8c(0x281)+_0x53ff8c(0xf1)+_0x53ff8c(0x95)+_0x53ff8c(0x173)+_0x53ff8c(0x285)+'\x20văn\x20'+_0x53ff8c(0x191)+_0x53ff8c(0x234)+'ây.\x20\x0a'+_0x53ff8c(0x126)+_0x53ff8c(0x126)+_0x53ff8c(0x126)+_0x53ff8c(0x224)+_0x53ff8c(0x125)+_0x53ff8c(0x1a3)+_0x53ff8c(0x136)+_0x53ff8c(0x232)+_0x53ff8c(0x29c)+_0x53ff8c(0x7a)+_0x53ff8c(0x267)+_0x53ff8c(0x222)+_0x53ff8c(0x10c)+_0x53ff8c(0x7b)+_0x53ff8c(0x20c)+'TỨC\x20m'+_0x53ff8c(0xf3)+'NG\x20CẦ'+_0x53ff8c(0x17b)+'\x20tool'+'\x20\x27sea'+'rchKn'+'owled'+_0x53ff8c(0xca)+_0x53ff8c(0xea)+_0x53ff8c(0x1ff);_0x252e53['forEa'+'ch'](_0x1ef57f=>{const _0x4b2db7=_0x53ff8c;_0x2bd585+=_0x4b2db7(0x8c)+_0x4b2db7(0x118)+'\x20'+_0x1ef57f['file_'+'id']+(_0x4b2db7(0x25f)+_0x4b2db7(0x152))+_0x1ef57f[_0x4b2db7(0x2a0)+'_inde'+'x']+_0x4b2db7(0x1a8)+_0x1ef57f[_0x4b2db7(0xb1)+'nt']+'\x0a';}),_0x2bd585+=_0x53ff8c(0x153)+_0x53ff8c(0x13e)+'\x20VĂN\x20'+_0x53ff8c(0x19c)+_0x53ff8c(0x1ae)+'\x20Hãy\x20'+_0x53ff8c(0x25c)+_0x53ff8c(0xe1)+_0x53ff8c(0x1c4)+_0x53ff8c(0x2ae)+_0x53ff8c(0x1a4)+_0x53ff8c(0x1b7)+'lời\x20t'+_0x53ff8c(0xd8)+_0x53ff8c(0x239)+_0x53ff8c(0x1de)+_0x53ff8c(0x1f0)+'\x20Sếp.',_0x58eaeb+=_0x2bd585,Logger[_0x53ff8c(0x297)](_0x53ff8c(0xf7)+_0x53ff8c(0x278)+_0x53ff8c(0x1dd)+_0x53ff8c(0x19e)+_0x53ff8c(0x131)+_0x53ff8c(0x130)+_0x53ff8c(0x202)+_0x252e53['lengt'+'h']+(_0x53ff8c(0x200)+_0x53ff8c(0x82)+_0x53ff8c(0x1eb)+_0x53ff8c(0x241)+_0x53ff8c(0x203)+'.'));}else _0x58eaeb+=_0x53ff8c(0x235)+_0x53ff8c(0x273)+_0x53ff8c(0x10d)+_0x53ff8c(0x100)+_0x53ff8c(0x1e6)+_0x53ff8c(0x139)+_0x53ff8c(0x17d)+_0x53ff8c(0x89)+_0x53ff8c(0x8f)+_0x53ff8c(0x1ec)+_0x53ff8c(0x80)+_0x53ff8c(0xae)+_0x53ff8c(0xb4)+_0x53ff8c(0x168)+'\x20BẮT\x20'+_0x53ff8c(0xb2)+_0x53ff8c(0x16a)+'gọi\x20c'+_0x53ff8c(0x1e2)+'ụ\x20\x27se'+_0x53ff8c(0x298)+'nowle'+_0x53ff8c(0x252)+_0x53ff8c(0x9e)+_0x53ff8c(0x110)+_0x53ff8c(0x122)+_0x53ff8c(0x26d)+_0x53ff8c(0xbb)+_0x53ff8c(0x211)+_0x53ff8c(0x254)+_0x53ff8c(0x181)+'\x20đoán'+_0x53ff8c(0xc4);}}_0x2cc892&&(_0x58eaeb+=_0x53ff8c(0x24c)+_0x53ff8c(0xab)+_0x53ff8c(0x12d)+_0x53ff8c(0x192)+':\x20Ngư'+_0x53ff8c(0x1ad)+_0x53ff8c(0x164)+_0x53ff8c(0xd9)+'oad\x20f'+_0x53ff8c(0x1f9)+'huần\x20'+_0x53ff8c(0x1c0)+'Hãy\x20h'+_0x53ff8c(0xf0)+'hị\x20kế'+_0x53ff8c(0x147)+_0x53ff8c(0x177)+'kỳ\x20ng'+'ắn\x20gọ'+'n\x20dạn'+_0x53ff8c(0x20b)+'hboar'+_0x53ff8c(0x1d7)+'i.\x20Tr'+'ích\x20x'+'uất\x20c'+_0x53ff8c(0x25d)+_0x53ff8c(0x1ac)+_0x53ff8c(0xb5)+_0x53ff8c(0x25a)+'ã,\x20Số'+_0x53ff8c(0x1a2)+_0x53ff8c(0x23f)+_0x53ff8c(0x279)+_0x53ff8c(0x121)+'iệt\x20k'+'ê\x203\x20h'+_0x53ff8c(0x114)+'ộng\x20t'+_0x53ff8c(0x21f)+_0x53ff8c(0xec)+'\x20trên'+_0x53ff8c(0x93)+_0x53ff8c(0x27d)+'hệ\x20th'+_0x53ff8c(0x281)+_0x53ff8c(0x2ac)+_0x53ff8c(0xcb)+_0x53ff8c(0x26a)+_0x53ff8c(0x183)+_0x53ff8c(0xa0)+_0x53ff8c(0x13d)+'erDat'+_0x53ff8c(0x175)+_0x53ff8c(0x1b4)+_0x53ff8c(0x15a)+_0x53ff8c(0x12f)+'\x20phiế'+_0x53ff8c(0xc3)+_0x53ff8c(0x271)+_0x53ff8c(0x129)+_0x53ff8c(0x22f)+_0x53ff8c(0xc7)+_0x53ff8c(0x1d8)+_0x53ff8c(0x141));const _0x161276=await generateText({'model':_0x4a7d83,'system':_0x58eaeb,'messages':_0xb1cfe7,'tools':_0x49d119,'stopWhen':stepCountIs(0xa)});Logger['info']('[ceoA'+_0x53ff8c(0xdb)+_0x53ff8c(0x186)+_0x53ff8c(0x19d)+_0x53ff8c(0x265)+'ào\x20da'+_0x53ff8c(0x1a5)+_0x53ff8c(0x260));const _0x11de41={};_0x11de41['role']=_0x53ff8c(0x226),_0x11de41[_0x53ff8c(0xb1)+'nt']=_0x2cc892?'':_0x2d1db7,_0x11de41['files']=_0x1291a3;const _0x10dee5=[_0x11de41,..._0x161276[_0x53ff8c(0xd6)+'nse']['messa'+_0x53ff8c(0x166)][_0x53ff8c(0x169)](_0x31f979=>({'role':_0x31f979[_0x53ff8c(0x1b1)],'content':_0x31f979[_0x53ff8c(0xb1)+'nt']?Array[_0x53ff8c(0x17f)+'ay'](_0x31f979['conte'+'nt'])?_0x31f979[_0x53ff8c(0xb1)+'nt'][0x0]?.[_0x53ff8c(0xd0)]:_0x31f979[_0x53ff8c(0xb1)+'nt']:'','tool_calls':_0x31f979[_0x53ff8c(0x18e)+_0x53ff8c(0x20e)]||null,'tool_call_id':_0x31f979[_0x53ff8c(0x18e)+_0x53ff8c(0x1f5)+'id']||null,'messages':[_0x31f979]}))];try{await chatController[_0x53ff8c(0x124)+'essag'+'es'](_0x46becb,_0x26a3e0,_0x10dee5);}catch(_0x561553){Logger['error'](_0x53ff8c(0x12e)+_0x53ff8c(0x1a7)+_0x53ff8c(0xe7)+_0x53ff8c(0x246)+'gent]'+'\x20khôn'+_0x53ff8c(0x160)+_0x53ff8c(0x186)+_0x53ff8c(0x170)+_0x53ff8c(0x119)+_0x53ff8c(0x189)+_0x53ff8c(0x103),_0x561553);}return summarizeUserMemory(_0x46becb,_0x4f6e15,_0x26a3e0,_0x4a7d83),{'session_id':_0x26a3e0,'answer':_0x10dee5['lengt'+'h']>0x1?_0x10dee5[_0x53ff8c(0xc1)]()?.[_0x53ff8c(0xb1)+'nt']||_0x53ff8c(0x1b3)+_0x53ff8c(0x247)+_0x53ff8c(0xa4)+'ồi':_0x53ff8c(0x1b3)+_0x53ff8c(0x27b)+_0x53ff8c(0x184)+_0x53ff8c(0x85)+_0x53ff8c(0x2b2)};}catch(_0x10b71d){console[_0x53ff8c(0x92)](_0x53ff8c(0x102)+_0x53ff8c(0x193)+_0x53ff8c(0x180)+_0x53ff8c(0xc5)+'\x20'+_0x46becb+(_0x53ff8c(0x21e)+_0x53ff8c(0x245)+':\x20')+_0x26a3e0+(_0x53ff8c(0xfb)+'r:'),_0x10b71d);throw new Error(_0x10b71d[_0x53ff8c(0x19d)+'ge']);}}module[_0x1368fc(0xaa)+'ts']=runFinanceAgent;
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
const ChatSession=getModel(
|
|
2
|
-
chatController={createSession:async($id_app_session$$,$user_id$$,$title$$="\u0110o\u1ea1n chat m\u1edbi")=>{$id_app_session$$=new ChatSession({id_app:$id_app_session$$,user_id:$user_id$$,title:$title$$});await $id_app_session$$.save();return $id_app_session$$},getChatHistory:async($id_app$$,$session_id$$,$limit$$=30)=>{$id_app$$=await ChatMessage.find({id_app:$id_app$$,session_id:$session_id$$}).sort({date_created:-1}).limit($limit$$).lean();$id_app$$.sort(($a$$,$b$$)=>new Date($a$$.date_created)-
|
|
3
|
-
new Date($b$$.date_created));return $id_app$$.map($msg$$=>({role:$msg$$.role,content:$msg$$.content||"",tool_calls:$msg$$.tool_calls||void 0,tool_call_id:$msg$$.tool_call_id||void 0,messages:$msg$$.messages||void 0}))},getPublicChatHistory:async($id_app$$,$messages$jscomp$1_session_id$$,$limit$$=20)=>{$messages$jscomp$1_session_id$$=await ChatMessage.find({id_app:$id_app$$,session_id:$messages$jscomp$1_session_id$$,$and:[{role:{$ne:"tool"}},{content:{$ne:""}},{content:{$ne:null}}]}).sort({date_created:-1}).limit($limit$$).lean();
|
|
4
|
-
for(let $msg$$ of $messages$jscomp$1_session_id$$)$msg$$.files?.length>0&&($msg$$.files=$msg$$.files.map($f$$=>({file_id:$f$$})),await $msg$$.files.asyncJoinModel2($id_app$$,"file",{where:{file_id:"_id"},fields:{info:"file"}}));$messages$jscomp$1_session_id$$.sort(($a$$,$b$$)=>new Date($a$$.date_created)-new Date($b$$.date_created));return $messages$jscomp$1_session_id$$.map($msg$$=>({_id:$msg$$._id,role:$msg$$.role==="assistant"?"assistant":"user",content:$msg$$.content||"",messages:$msg$$.messages,
|
|
5
|
-
files:$msg$$.files}))},saveMessages:async($id_app$$,$session_id$$,$msgsToInsert_newMessages$$)=>{$msgsToInsert_newMessages$$&&$msgsToInsert_newMessages$$.length!==0&&(Logger.info("[chatController][saveMessages]..."),$msgsToInsert_newMessages$$=JSON.parse(JSON.stringify($msgsToInsert_newMessages$$)),$msgsToInsert_newMessages$$=$msgsToInsert_newMessages$$.map($msg$$=>({id_app:$id_app$$,session_id:$session_id$$,role:$msg$$.role,content:$msg$$.content,files:$msg$$.files,messages:sanitizeMongoKeys($msg$$.messages)})),
|
|
6
|
-
$msgsToInsert_newMessages$$=utils.restoreObjectIds($msgsToInsert_newMessages$$),await ChatMessage.create($msgsToInsert_newMessages$$),await ChatSession.updateOne({_id:$session_id$$},{$set:{date_updated:new Date}}))}};module.exports=chatController;
|
|
1
|
+
const _0x2ee010=_0x1066;(function(_0x1fb742,_0x24729d){const _0x496495=_0x1066,_0x3a1c6d=_0x1fb742();while(!![]){try{const _0x3e5fa6=-parseInt(_0x496495(0x11c))/0x1+-parseInt(_0x496495(0xdf))/0x2*(-parseInt(_0x496495(0xf4))/0x3)+parseInt(_0x496495(0xed))/0x4+parseInt(_0x496495(0xff))/0x5+parseInt(_0x496495(0x116))/0x6*(-parseInt(_0x496495(0xf3))/0x7)+-parseInt(_0x496495(0x114))/0x8+parseInt(_0x496495(0xe0))/0x9;if(_0x3e5fa6===_0x24729d)break;else _0x3a1c6d['push'](_0x3a1c6d['shift']());}catch(_0x5beea8){_0x3a1c6d['push'](_0x3a1c6d['shift']());}}}(_0x5eab,0x623fc));function _0x1066(_0x249957,_0x39bf93){_0x249957=_0x249957-0xdc;const _0x5eabfc=_0x5eab();let _0x10662b=_0x5eabfc[_0x249957];if(_0x1066['CssPPc']===undefined){var _0x2c748a=function(_0x42da60){const _0x521426='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x35ddef='',_0x53c4a9='';for(let _0x3bd482=0x0,_0x1d7233,_0x28e034,_0x4791ac=0x0;_0x28e034=_0x42da60['charAt'](_0x4791ac++);~_0x28e034&&(_0x1d7233=_0x3bd482%0x4?_0x1d7233*0x40+_0x28e034:_0x28e034,_0x3bd482++%0x4)?_0x35ddef+=String['fromCharCode'](0xff&_0x1d7233>>(-0x2*_0x3bd482&0x6)):0x0){_0x28e034=_0x521426['indexOf'](_0x28e034);}for(let _0x210987=0x0,_0x49a923=_0x35ddef['length'];_0x210987<_0x49a923;_0x210987++){_0x53c4a9+='%'+('00'+_0x35ddef['charCodeAt'](_0x210987)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x53c4a9);};_0x1066['wXYqCi']=_0x2c748a,_0x1066['gdlHTe']={},_0x1066['CssPPc']=!![];}const _0x3b82ee=_0x5eabfc[0x0],_0x5bf720=_0x249957+_0x3b82ee,_0x25229c=_0x1066['gdlHTe'][_0x5bf720];return!_0x25229c?(_0x10662b=_0x1066['wXYqCi'](_0x10662b),_0x1066['gdlHTe'][_0x5bf720]=_0x10662b):_0x10662b=_0x25229c,_0x10662b;}const ChatSession=getModel(_0x2ee010(0x10f)+_0x2ee010(0x117)+'on'),ChatMessage=getModel('chat_'+_0x2ee010(0xf9)+'ge'),utils=require('../li'+_0x2ee010(0xf7)+_0x2ee010(0x118)),sanitizeMongoKeys=_0x3dee5f=>{const _0x1f24bd=_0x2ee010;if(_0x3dee5f===null||typeof _0x3dee5f!==_0x1f24bd(0xf0)+'t')return _0x3dee5f;if(Array[_0x1f24bd(0x10e)+'ay'](_0x3dee5f))return _0x3dee5f['map'](sanitizeMongoKeys);const _0x1d5440={};for(const [_0x33e314,_0x33b656]of Object['entri'+'es'](_0x3dee5f)){let _0x136597=_0x33e314;_0x136597['start'+_0x1f24bd(0xdc)]('$')&&(_0x136597='_'+_0x136597),_0x136597[_0x1f24bd(0xe7)+_0x1f24bd(0x110)]('.')&&(_0x136597=_0x136597['repla'+'ce'](/\./g,'_')),_0x1d5440[_0x136597]=sanitizeMongoKeys(_0x33b656);}return _0x1d5440;},chatController={'createSession':async(_0x530722,_0xc44fe7,_0x112e0c=_0x2ee010(0xef)+_0x2ee010(0xfe)+_0x2ee010(0x104))=>{const _0xd74dcb=_0x2ee010,_0x5c81f0={};_0x5c81f0['id_ap'+'p']=_0x530722,_0x5c81f0[_0xd74dcb(0xfd)+'id']=_0xc44fe7,_0x5c81f0[_0xd74dcb(0x112)]=_0x112e0c;const _0x1309fe=new ChatSession(_0x5c81f0);return await _0x1309fe[_0xd74dcb(0xf8)](),_0x1309fe;},'getChatHistory':async(_0x657a8e,_0x53a68a,_0x433708=0x1e)=>{const _0x52055f=_0x2ee010,_0x4b03e8={};_0x4b03e8[_0x52055f(0xfb)+'p']=_0x657a8e,_0x4b03e8[_0x52055f(0x117)+_0x52055f(0xf5)]=_0x53a68a;const _0x71f88b={};_0x71f88b[_0x52055f(0xe1)+'creat'+'ed']=-0x1;let _0xf992dc=await ChatMessage['find'](_0x4b03e8)[_0x52055f(0xec)](_0x71f88b)['limit'](_0x433708)['lean']();return _0xf992dc[_0x52055f(0xec)]((_0x30725f,_0x59f6ae)=>new Date(_0x30725f[_0x52055f(0xe1)+_0x52055f(0xe4)+'ed'])-new Date(_0x59f6ae[_0x52055f(0xe1)+_0x52055f(0xe4)+'ed'])),_0xf992dc[_0x52055f(0xe2)](_0x3711df=>{const _0x154334=_0x52055f,_0x1b8ef4={};return _0x1b8ef4[_0x154334(0x100)]=_0x3711df['role'],_0x1b8ef4[_0x154334(0xe9)+'nt']=_0x3711df['conte'+'nt']||'',_0x1b8ef4['tool_'+_0x154334(0x101)]=_0x3711df['tool_'+_0x154334(0x101)]||undefined,_0x1b8ef4[_0x154334(0xf1)+'call_'+'id']=_0x3711df[_0x154334(0xf1)+_0x154334(0x115)+'id']||undefined,_0x1b8ef4[_0x154334(0xf9)+'ges']=_0x3711df[_0x154334(0xf9)+'ges']||undefined,_0x1b8ef4;});},'getPublicChatHistory':async(_0x4356f9,_0x2f7b85,_0xa34126=0x14)=>{const _0x13c842=_0x2ee010,_0x2ba870={};_0x2ba870[_0x13c842(0xdd)]=_0x13c842(0x10b);const _0x72dfd9={};_0x72dfd9[_0x13c842(0x100)]=_0x2ba870;const _0x46b70b={};_0x46b70b[_0x13c842(0xdd)]='';const _0x50e387={};_0x50e387[_0x13c842(0xe9)+'nt']=_0x46b70b;const _0x2bde92={};_0x2bde92[_0x13c842(0xdd)]=null;const _0x928927={};_0x928927[_0x13c842(0xe9)+'nt']=_0x2bde92;const _0x4b4497={};_0x4b4497[_0x13c842(0xfb)+'p']=_0x4356f9,_0x4b4497[_0x13c842(0x117)+_0x13c842(0xf5)]=_0x2f7b85,_0x4b4497['$and']=[_0x72dfd9,_0x50e387,_0x928927];const _0x1b7f84={};_0x1b7f84[_0x13c842(0xe1)+_0x13c842(0xe4)+'ed']=-0x1;let _0xe2ddcf=await ChatMessage[_0x13c842(0xfa)](_0x4b4497)[_0x13c842(0xec)](_0x1b7f84)[_0x13c842(0x103)](_0xa34126)[_0x13c842(0x105)]();for(let _0x1ceabf of _0xe2ddcf){if(_0x1ceabf[_0x13c842(0x119)]?.[_0x13c842(0xe8)+'h']>0x0){_0x1ceabf['files']=_0x1ceabf['files'][_0x13c842(0xe2)](_0x2faeee=>({'file_id':_0x2faeee}));const _0x8d26d7={};_0x8d26d7['file_'+'id']=_0x13c842(0x111);const _0x30a865={};_0x30a865[_0x13c842(0xf6)]=_0x13c842(0x108);const _0x5ad677={};_0x5ad677[_0x13c842(0xde)]=_0x8d26d7,_0x5ad677['field'+'s']=_0x30a865,await _0x1ceabf[_0x13c842(0x119)][_0x13c842(0x106)+_0x13c842(0xeb)+_0x13c842(0xe6)](_0x4356f9,_0x13c842(0x108),_0x5ad677);}}return _0xe2ddcf[_0x13c842(0xec)]((_0x5879ac,_0x25c3aa)=>new Date(_0x5879ac[_0x13c842(0xe1)+'creat'+'ed'])-new Date(_0x25c3aa[_0x13c842(0xe1)+_0x13c842(0xe4)+'ed'])),_0xe2ddcf[_0x13c842(0xe2)](_0x4f2907=>({'_id':_0x4f2907[_0x13c842(0x111)],'role':_0x4f2907[_0x13c842(0x100)]===_0x13c842(0xe5)+'tant'?'assis'+_0x13c842(0xfc):_0x13c842(0x10a),'content':_0x4f2907['conte'+'nt']||'','messages':_0x4f2907['messa'+_0x13c842(0x11a)],'files':_0x4f2907[_0x13c842(0x119)]}));},'saveMessages':async(_0x4b50f7,_0x31a531,_0x84026f)=>{const _0x43772b=_0x2ee010;if(!_0x84026f||_0x84026f['lengt'+'h']===0x0)return;Logger[_0x43772b(0xf6)]('[chat'+_0x43772b(0x11b)+_0x43772b(0x113)+_0x43772b(0xee)+_0x43772b(0x107)+'ages]'+_0x43772b(0xf2)),_0x84026f=JSON['parse'](JSON[_0x43772b(0x102)+_0x43772b(0x10c)](_0x84026f));let _0x421536=_0x84026f[_0x43772b(0xe2)](_0x288440=>({'id_app':_0x4b50f7,'session_id':_0x31a531,'role':_0x288440[_0x43772b(0x100)],'content':_0x288440[_0x43772b(0xe9)+'nt'],'files':_0x288440[_0x43772b(0x119)],'messages':sanitizeMongoKeys(_0x288440[_0x43772b(0xf9)+_0x43772b(0x11a)])}));_0x421536=utils[_0x43772b(0xe3)+'reObj'+'ectId'+'s'](_0x421536),await ChatMessage['creat'+'e'](_0x421536);const _0x26430e={};_0x26430e['_id']=_0x31a531,await ChatSession[_0x43772b(0xea)+_0x43772b(0x10d)](_0x26430e,{'$set':{'date_updated':new Date()}});}};function _0x5eab(){const _0xfe0910=['zMLSzq','zxHWB3i','DxnLCG','Dg9VBa','z2LMEq','zu9Uzq','AxnbCNi','y2HHDf8','zgvZ','x2LK','DgL0Bgu','B2XSzxi','nty2nJuYoer1DuLZva','y2fSBf8','odCWmtm4rxryvePW','C2vZC2K','AwXZ','zMLSzxm','z2vZ','q29UDhi','nZq3nJiXDurcq0vf','C1DPDgG','jg5L','D2HLCMu','mJqWmdjtsNPJzgm','ode0otuWmfDgyu9Srq','zgf0zv8','BwfW','CMvZDg8','y3jLyxq','yxnZAxm','B2rLBdi','Aw5JBhu','BgvUz3q','y29UDgu','DxbKyxq','sM9PBK0','C29YDa','mtKZmduWogvKuhvSvG','xvTZyxy','XjbV4BQHBIa','B2jQzwm','Dg9VBf8','lI4U','mJHmEuHSy0q','nJzIy0PeBhK','B25FAwq','Aw5MBW','yNmVDxq','C2f2zq','BwvZC2e','zMLUza','AwrFyxa','DgfUDa','DxnLCL8','y2HHDca','mZKZmtu0mgHisM1Wza','CM9Szq','y2fSBhm','C3rYAw4','BgLTAxq','BEg7M2K','BgvHBG','yxn5BMm','zu1LC3m'];_0x5eab=function(){return _0xfe0910;};return _0x5eab();}module[_0x2ee010(0x109)+'ts']=chatController;
|
|
@@ -1,43 +1 @@
|
|
|
1
|
-
const {generateText,stepCountIs,pruneMessages}=require("ai"),{createOpenAI}=require("@ai-sdk/openai"),chatController=require("./chatController"),{decrypt}=require("../libs/utils"),{createFinanceTools}=require("./tools/financeTools"),{createStockTools}=require("./tools/stockTools"),{createRagTools}=require("./tools/ragTools"),tenantConfigs={},SYSTEM_PROMPT=`# VAI TR\u00d2 V\u00c0 \u0110\u1ecaA V\u1eca C\u1ee6A B\u1ea0N
|
|
2
|
-
B\u1ea1n l\u00e0 Tr\u1ee3 l\u00fd AI chuy\u00ean nghi\u1ec7p thu\u1ed9c ph\u00f2ng Ch\u0103m s\u00f3c Kh\u00e1ch h\u00e0ng v\u00e0 Qu\u1ea3n tr\u1ecb Quan h\u1ec7 Kh\u00e1ch h\u00e0ng (CRM). Nhi\u1ec7m v\u1ee5 c\u1ed1t l\u00f5i c\u1ee7a b\u1ea1n l\u00e0 h\u1ed7 tr\u1ee3 nh\u00e2n vi\u00ean CSKH tra c\u1ee9u th\u00f4ng tin kh\u00e1ch h\u00e0ng, ki\u1ec3m tra tr\u1ea1ng th\u00e1i s\u1ea3n ph\u1ea9m, ch\u00ednh s\u00e1ch gi\u00e1 b\u00e1n, ch\u01b0\u01a1ng tr\u00ecnh khuy\u1ebfn m\u00e3i, gi\u1ea3i quy\u1ebft khi\u1ebfu n\u1ea1i v\u00e0 so\u1ea1n th\u1ea3o ph\u1ea3n h\u1ed3i l\u1ecbch s\u1ef1, chu \u0111\u00e1o.
|
|
3
|
-
|
|
4
|
-
# NGUY\u00caN T\u1eaeC GIAO TI\u1ebeP "KH\u00c1CH H\u00c0NG L\u00c0 TR\u1eccNG T\u00c2M"
|
|
5
|
-
1. T\u00e1c phong: Th\u1ea5u hi\u1ec3u, l\u1ecbch s\u1ef1, nhi\u1ec7t t\u00ecnh v\u00e0 lu\u00f4n h\u01b0\u1edbng t\u1edbi gi\u1ea3i ph\u00e1p. S\u1eed d\u1ee5ng ng\u00f4n t\u1eeb ti\u1ebfng Vi\u1ec7t chu\u1ea9n m\u1ef1c, chuy\u00ean nghi\u1ec7p nh\u01b0ng g\u1ea7n g\u0169i.
|
|
6
|
-
2. Tr\u00ecnh b\u00e0y scannable: Kh\u00e1ch h\u00e0ng v\u00e0 nh\u00e2n vi\u00ean CSKH c\u1ea7n th\u00f4ng tin nhanh. H\u00e3y s\u1eed d\u1ee5ng Markdown, danh s\u00e1ch g\u1ea1ch \u0111\u1ea7u d\u00f2ng v\u00e0 in \u0111\u1eadm (**bold**) c\u00e1c th\u00f4ng tin quan tr\u1ecdng nh\u01b0: M\u00e3 \u01b0u \u0111\u00e3i, t\u00ean s\u1ea3n ph\u1ea9m, ng\u00e0y h\u1eb9n, s\u1ed1 hotline...
|
|
7
|
-
3. B\u1ea3o m\u1eadt th\u00f4ng tin: Tuy\u1ec7t \u0111\u1ed1i kh\u00f4ng ti\u1ebft l\u1ed9 c\u1ea5u tr\u00fac m\u00e3 ngu\u1ed3n, ID h\u1ec7 th\u1ed1ng ("id_app"), hay c\u00e1c ghi ch\u00fa n\u1ed9i b\u1ed9 mang t\u00ednh nh\u1ea1y c\u1ea3m c\u1ee7a c\u00f4ng ty cho kh\u00e1ch h\u00e0ng.
|
|
8
|
-
|
|
9
|
-
# B\u1ea2N \u0110\u1ed2 T\u01af DUY \u0110I\u1ec0U H\u01af\u1edaNG C\u00d4NG C\u1ee4 (CRM TOOL PROTOCOL)
|
|
10
|
-
B\u1ea1n \u0111\u01b0\u1ee3c cung c\u1ea5p m\u1ed9t nh\u00f3m c\u00f4ng c\u1ee5 gi\u1edbi h\u1ea1n (Kh\u00f4ng bao g\u1ed3m t\u00e0i ch\u00ednh/k\u1ebf to\u00e1n). Khi nh\u1eadn \u0111\u01b0\u1ee3c y\u00eau c\u1ea7u, b\u1ea1n ph\u1ea3i ph\u1ed1i h\u1ee3p c\u00e1c c\u00f4ng c\u1ee5 theo quy tr\u00ecnh logic sau:
|
|
11
|
-
|
|
12
|
-
## 1. Quy tr\u00ecnh "Ch\u1ed1t m\u00e3 kh\u00e1ch h\u00e0ng & Tra c\u1ee9u H\u1ed3 s\u01a1 360 \u0111\u1ed9"
|
|
13
|
-
- Khi ng\u01b0\u1eddi d\u00f9ng ho\u1eb7c kh\u00e1ch h\u00e0ng nh\u1eafc \u0111\u1ebfn m\u1ed9t c\u00e1i t\u00ean (V\u00ed d\u1ee5: "Kh\u00e1ch h\u00e0ng Tu\u1ea5n Ph\u00e1t", "Anh Nguy\u1ec5n V\u0103n A"), b\u1ea1n KH\u00d4NG \u0110\u01af\u1ee2C t\u1ef1 \u0111o\u00e1n m\u00e3.
|
|
14
|
-
- B\u1eaeT BU\u1ed8C g\u1ecdi "lookupMasterDataTool" \u0111\u1ea7u ti\u00ean (ch\u1ecdn type: "customer" ho\u1eb7c "product") \u0111\u1ec3 l\u1ea5y ch\u00ednh x\u00e1c M\u00e3 s\u1ed1 ("ma_kh", "ma_vt"). N\u1ebfu tool lookupMasterDataTool tr\u1ea3 v\u1ec1 nhi\u1ec1u k\u1ebft qu\u1ea3 th\u00ec c\u1ea7n hi\u1ec7n ra danh s\u00e1ch \u0111\u00e3 t\u00ecm th\u1ea5y v\u00e0 h\u1ecfi ng\u1eeboi d\u00f9ng xem ch\u1ecdn c\u00e1i n\u00e0o.
|
|
15
|
-
- **X\u1eed l\u00fd chuy\u00ean s\u00e2u:** \u0110\u1ec3 xem h\u1ed3 s\u01a1 chi ti\u1ebft c\u1ee7a kh\u00e1ch h\u00e0ng ph\u1ee5c v\u1ee5 x\u1eed l\u00fd khi\u1ebfu n\u1ea1i ho\u1eb7c t\u01b0 v\u1ea5n, h\u00e3y b\u1eadt tham s\u1ed1 "include_relations: true". C\u00f4ng c\u1ee5 n\u00e0y s\u1ebd tr\u1ea3 v\u1ec1 to\u00e0n b\u1ed9: L\u1ecbch s\u1eed cu\u1ed9c g\u1ecdi t\u1ed5ng \u0111\u00e0i g\u1ea7n nh\u1ea5t, c\u00e1c h\u1ee3p \u0111\u1ed3ng \u0111\u00e3 k\u00fd, th\u00f4ng tin li\u00ean h\u1ec7 v\u00e0 c\u00e1c ghi ch\u00fa d\u1eb7n d\u00f2 tr\u01b0\u1edbc \u0111\u00f3 v\u1ec1 kh\u00e1ch h\u00e0ng n\u00e0y.
|
|
16
|
-
|
|
17
|
-
## 2. Tra c\u1ee9u Gi\u00e1 b\u00e1n & Ch\u01b0\u01a1ng tr\u00ecnh Khuy\u1ebfn m\u00e3i
|
|
18
|
-
- Khi kh\u00e1ch h\u00e0ng h\u1ecfi v\u1ec1 gi\u00e1, mu\u1ed1n nh\u1eadn b\u00e1o gi\u00e1 ho\u1eb7c h\u1ecfi v\u1ec1 c\u00e1c ch\u01b0\u01a1ng tr\u00ecnh \u01b0u \u0111\u00e3i hi\u1ec7n c\u00f3 cho m\u1ed9t m\u1eb7t h\u00e0ng $\rightarrow$ H\u00e3y g\u1ecdi c\u00f4ng c\u1ee5 "getProductPriceAndPromotionTool".
|
|
19
|
-
- *L\u01b0u \u00fd:* C\u00f4ng c\u1ee5 n\u00e0y b\u1eaft bu\u1ed9c ph\u1ea3i truy\u1ec1n v\u00e0o "ma_vt" (\u0111\u00e3 l\u1ea5y t\u1eeb b\u01b0\u1edbc tra c\u1ee9u danh m\u1ee5c). B\u1ea1n c\u00f3 th\u1ec3 truy\u1ec1n th\u00eam m\u00e3 kh\u00e1ch h\u00e0ng ho\u1eb7c s\u1ed1 l\u01b0\u1ee3ng d\u1ef1 ki\u1ebfn \u0111\u1ec3 h\u1ec7 th\u1ed1ng t\u00ednh to\u00e1n m\u1ee9c chi\u1ebft kh\u1ea5u ch\u00ednh x\u00e1c nh\u1ea5t cho kh\u00e1ch h\u00e0ng.
|
|
20
|
-
|
|
21
|
-
## 3. Ki\u1ec3m tra Tr\u1ea1ng th\u00e1i H\u00e0ng h\u00f3a (\u0110\u1ec3 t\u01b0 v\u1ea5n \u0111\u1eb7t h\u00e0ng)
|
|
22
|
-
- Khi kh\u00e1ch h\u00e0ng h\u1ecfi "S\u1ea3n ph\u1ea9m n\u00e0y c\u00f2n h\u00e0ng trong kho kh\u00f4ng?" ho\u1eb7c "Kho n\u00e0o c\u00f2n h\u00e0ng?" $\rightarrow$ G\u1ecdi c\u00f4ng c\u1ee5 "getInventorySummaryTool" \u0111\u1ec3 xem s\u1ed1 l\u01b0\u1ee3ng t\u1ed3n kho th\u1ef1c t\u1ebf, gi\u00fap ph\u1ea3n h\u1ed3i kh\u00e1ch h\u00e0ng ch\u00ednh x\u00e1c, tr\u00e1nh vi\u1ec7c b\u00e1n h\u00e0ng v\u01b0\u1ee3t qu\u00e1 s\u1ed1 l\u01b0\u1ee3ng t\u1ed3n.
|
|
23
|
-
|
|
24
|
-
## 4. Tra c\u1ee9u Tri th\u1ee9c, Quy tr\u00ecnh x\u1eed l\u00fd & L\u1ecbch s\u1eed h\u1ed7 tr\u1ee3
|
|
25
|
-
- Khi g\u1eb7p c\u00e1c c\u00e2u h\u1ecfi kh\u00f3 v\u1ec1 ch\u00ednh s\u00e1ch b\u1ea3o h\u00e0nh, quy tr\u00ecnh \u0111\u1ed5i tr\u1ea3, th\u00f4ng tin h\u1ee3p \u0111\u1ed3ng c\u0169 ho\u1eb7c t\u00e0i li\u1ec7u h\u01b0\u1edbng d\u1eabn s\u1eed d\u1ee5ng s\u1ea3n ph\u1ea9m $\rightarrow$ H\u00e3y g\u1ecdi ngay "searchKnowledgeBaseTool" (ph\u1ea1m vi "company").
|
|
26
|
-
- Khi c\u1ea7n t\u00ecm l\u1ea1i l\u1ecbch s\u1eed t\u01b0 v\u1ea5n, c\u00e1c s\u1edf th\u00edch \u0111\u1eb7c bi\u1ec7t ho\u1eb7c ghi ch\u00fa c\u0169 c\u1ee7a ch\u00ednh kh\u00e1ch h\u00e0ng n\u00e0y $\rightarrow$ G\u1ecdi "searchKnowledgeBaseTool" (ph\u1ea1m vi "personal").
|
|
27
|
-
|
|
28
|
-
## 5. So\u1ea1n th\u1ea3o v\u0103n b\u1ea3n & G\u1eedi Email Ch\u0103m s\u00f3c Kh\u00e1ch h\u00e0ng
|
|
29
|
-
- Khi nh\u00e2n vi\u00ean CSKH y\u00eau c\u1ea7u: "G\u1eedi th\u01b0 c\u1ea3m \u01a1n", "G\u1eedi b\u00e1o gi\u00e1 \u01b0u \u0111\u00e3i", ho\u1eb7c "G\u1eedi th\u01b0 xin l\u1ed7i v\u00ec s\u1ef1 c\u1ed1 s\u1ea3n ph\u1ea9m cho kh\u00e1ch h\u00e0ng X" $\rightarrow$ B\u1ea1n s\u1ebd th\u1ef1c hi\u1ec7n quy tr\u00ecnh 2 b\u01b0\u1edbc:
|
|
30
|
-
- B\u01b0\u1edbc 1: G\u1ecdi "getCompanyInfoTool" \u0111\u1ec3 l\u1ea5y c\u00e1c th\u00f4ng tin ch\u00ednh th\u1ee9c c\u1ee7a c\u00f4ng ty (T\u00ean doanh nghi\u1ec7p, hotline, \u0111\u1ecba ch\u1ec9) \u0111\u1ec3 ch\u00e8n v\u00e0o ph\u1ea7n Ch\u00e2n trang (Footer) ho\u1eb7c l\u1eddi k\u00fd t\u00ean c\u1ee7a email.
|
|
31
|
-
- B\u01b0\u1edbc 2: K\u00edch ho\u1ea1t "sendEmailTool". N\u1ed9i dung th\u01b0 (tr\u01b0\u1eddng "html") ph\u1ea3i \u0111\u01b0\u1ee3c b\u1ecdc trong c\u00e1c th\u1ebb HTML chu\u1ea9n ("<p>", "<b>", "<br/>"), tr\u00ecnh b\u00e0y trang tr\u1ecdng, c\u00f3 \u0111\u1ea7y \u0111\u1ee7 l\u1eddi ch\u00e0o m\u1edf \u0111\u1ea7u v\u00e0 l\u1eddi ch\u00fac \u1edf cu\u1ed1i th\u01b0.
|
|
32
|
-
|
|
33
|
-
# QUY TR\u00ccNH X\u1eec L\u00dd KHI KH\u00d4NG T\u00ccM TH\u1ea4Y TH\u00d4NG TIN
|
|
34
|
-
- N\u1ebfu "lookupMasterDataTool" b\u00e1o kh\u00f4ng t\u00ecm th\u1ea5y kh\u00e1ch h\u00e0ng ho\u1eb7c s\u1ea3n ph\u1ea9m, h\u00e3y h\u01b0\u1edbng d\u1eabn nh\u00e2n vi\u00ean: "Em ch\u01b0a t\u00ecm th\u1ea5y th\u00f4ng tin kh\u00e1ch h\u00e0ng/s\u1ea3n ph\u1ea9m n\u00e0y tr\u00ean danh m\u1ee5c h\u1ec7 th\u1ed1ng. Anh/Ch\u1ecb vui l\u00f2ng ki\u1ec3m tra l\u1ea1i t\u00ean ho\u1eb7c m\u00e3 s\u1ed1, ho\u1eb7c s\u1eed d\u1ee5ng t\u00ecm ki\u1ebfm tri th\u1ee9c n\u1ed9i b\u1ed9 \u0111\u1ec3 qu\u00e9t trong c\u00e1c file h\u1ee3p \u0111\u1ed3ng \u0111\u00ednh k\u00e8m."
|
|
35
|
-
- Lu\u00f4n gi\u1eef th\u00e1i \u0111\u1ed9 h\u1ed7 tr\u1ee3, kh\u00f4ng \u0111\u01b0a ra c\u00e1c th\u00f4ng b\u00e1o l\u1ed7i k\u1ef9 thu\u1eadt c\u1ee7a h\u1ec7 th\u1ed1ng (nh\u01b0 "l\u1ed7i database", "null", "undefined").
|
|
36
|
-
|
|
37
|
-
# TH\u1edcI GIAN TH\u1ef0C T\u1ebe
|
|
38
|
-
Lu\u00f4n l\u01b0u \u00fd th\u1eddi gian hi\u1ec7n t\u1ea1i c\u1ee7a h\u1ec7 th\u1ed1ng (N\u0103m ${(new Date).getFullYear}) \u0111\u1ec3 t\u00ednh to\u00e1n c\u00e1c ch\u01b0\u01a1ng tr\u00ecnh khuy\u1ebfn m\u00e3i c\u00f2n hi\u1ec7u l\u1ef1c hay \u0111\u00e3 h\u1ebft h\u1ea1n, ho\u1eb7c x\u00e1c \u0111\u1ecbnh th\u1eddi h\u1ea1n b\u1ea3o h\u00e0nh c\u1ee7a kh\u00e1ch h\u00e0ng m\u1ed9t c\u00e1ch ch\u00ednh x\u00e1c.`;
|
|
39
|
-
async function runCSKHAgent($id_app$$,$user_id$$,$session_id$$,$userPrompt$$){try{if(!tenantConfigs[$id_app$$]){const $app$$=await global.getModel("app").findOne({_id:$id_app$$},{openapi_key:1,openapi_gpt_model:1});if(!$app$$||!$app$$.openapi_key)throw Error("Ch\u01b0a khai b\u00e1o OpenAPI key cho h\u1ec7 th\u1ed1ng.");const $openapi_key$$=decrypt($app$$.openapi_key.replace("flexbiz::",""),!1);tenantConfigs[$id_app$$]={openaiInstance:createOpenAI({apiKey:$openapi_key$$}),gptModel:$app$$.openapi_gpt_model||
|
|
40
|
-
"gpt-5.4-mini"}}const {openaiInstance:$openaiInstance$$,gptModel:$gptModel$$}=tenantConfigs[$id_app$$];$session_id$$||=(await chatController.createSession($id_app$$,$user_id$$,$userPrompt$$.substring(0,1024)))._id.toString();const $messagesToSend$$=[...(await chatController.getChatHistory($id_app$$,$session_id$$,30)),{role:"user",content:$userPrompt$$}],$optimizedMessages$$=pruneMessages({messages:$messagesToSend$$,reasoning:"all",toolCalls:"before-last-message"}),{getProductPriceAndPromotionTool:$getProductPriceAndPromotionTool$$,
|
|
41
|
-
getInventorySummaryTool:$getInventorySummaryTool$$}=createStockTools($id_app$$,$user_id$$),{getDebtBalanceSummaryTool:$getDebtBalanceSummaryTool$$}=createFinanceTools($id_app$$,$user_id$$),$activeTools$$={getProductPriceAndPromotionTool:$getProductPriceAndPromotionTool$$,getInventorySummaryTool:$getInventorySummaryTool$$,getDebtBalanceSummaryTool:$getDebtBalanceSummaryTool$$,...createRagTools($id_app$$,$user_id$$)},$result$$=await generateText({model:$openaiInstance$$.chat($gptModel$$),system:SYSTEM_PROMPT,
|
|
42
|
-
messages:$optimizedMessages$$,tools:$activeTools$$,stopWhen:stepCountIs(10)});Logger.info("[ceoAgent] l\u01b0u messages v\u00e0o database..");const $msgsToSave$$=[{role:"user",content:$userPrompt$$},...$result$$.response.messages.map($msg$$=>({role:$msg$$.role,content:$msg$$.content?Array.isArray($msg$$.content)?$msg$$.content[0]?.text:$msg$$.content:"",tool_calls:$msg$$.tool_calls||null,tool_call_id:$msg$$.tool_call_id||null,messages:[$msg$$]}))];try{await chatController.saveMessages($id_app$$,$session_id$$,
|
|
43
|
-
$msgsToSave$$)}catch($e$$){Logger.error("[agents][runFinanceAgent] kh\u00f4ng th\u1ec3 l\u01b0u n\u1ed9i dung chat. Err:",$e$$)}return{session_id:$session_id$$,answer:$msgsToSave$$.length>1?$msgsToSave$$.pop()?.content||"Kh\u00f4ng c\u00f3 ph\u1ea3n h\u1ed3i":"Kh\u00f4ng c\u00f3 k\u1ebft qu\u1ea3 ph\u1ea3n h\u1ed3i"}}catch($error$$){throw console.error(`[L\u1ed7i Agent CSKH] App: ${$id_app$$} | Session: ${$session_id$$} | Err:`,$error$$),Error($error$$.message);}}module.exports=runCSKHAgent;
|
|
1
|
+
const _0x285f58=_0x5d04;function _0x5d04(_0x2d48f3,_0x5d1eb7){_0x2d48f3=_0x2d48f3-0x95;const _0x4c4b4d=_0x4c4b();let _0x5d046d=_0x4c4b4d[_0x2d48f3];if(_0x5d04['iUtYRT']===undefined){var _0x1959d1=function(_0x44a64e){const _0x125754='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x160bd6='',_0x308e2c='';for(let _0x1ac2bf=0x0,_0x2a342a,_0x144a80,_0x221cfc=0x0;_0x144a80=_0x44a64e['charAt'](_0x221cfc++);~_0x144a80&&(_0x2a342a=_0x1ac2bf%0x4?_0x2a342a*0x40+_0x144a80:_0x144a80,_0x1ac2bf++%0x4)?_0x160bd6+=String['fromCharCode'](0xff&_0x2a342a>>(-0x2*_0x1ac2bf&0x6)):0x0){_0x144a80=_0x125754['indexOf'](_0x144a80);}for(let _0xd6010d=0x0,_0x594c80=_0x160bd6['length'];_0xd6010d<_0x594c80;_0xd6010d++){_0x308e2c+='%'+('00'+_0x160bd6['charCodeAt'](_0xd6010d)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x308e2c);};_0x5d04['BOcsgR']=_0x1959d1,_0x5d04['XBSdCH']={},_0x5d04['iUtYRT']=!![];}const _0x3db226=_0x4c4b4d[0x0],_0x257b9c=_0x2d48f3+_0x3db226,_0x5d8621=_0x5d04['XBSdCH'][_0x257b9c];return!_0x5d8621?(_0x5d046d=_0x5d04['BOcsgR'](_0x5d046d),_0x5d04['XBSdCH'][_0x257b9c]=_0x5d046d):_0x5d046d=_0x5d8621,_0x5d046d;}(function(_0x5368f8,_0x40ed28){const _0xc7ec7f=_0x5d04,_0x14d3ab=_0x5368f8();while(!![]){try{const _0xc0a376=parseInt(_0xc7ec7f(0x26c))/0x1*(parseInt(_0xc7ec7f(0x187))/0x2)+-parseInt(_0xc7ec7f(0x20e))/0x3+-parseInt(_0xc7ec7f(0x1ee))/0x4*(-parseInt(_0xc7ec7f(0xac))/0x5)+-parseInt(_0xc7ec7f(0x315))/0x6+-parseInt(_0xc7ec7f(0x2c5))/0x7+-parseInt(_0xc7ec7f(0x2fc))/0x8*(-parseInt(_0xc7ec7f(0x211))/0x9)+parseInt(_0xc7ec7f(0x31c))/0xa;if(_0xc0a376===_0x40ed28)break;else _0x14d3ab['push'](_0x14d3ab['shift']());}catch(_0xd03c8a){_0x14d3ab['push'](_0x14d3ab['shift']());}}}(_0x4c4b,0x6d6dc));const {generateText,stepCountIs,pruneMessages}=require('ai'),{createOpenAI}=require('@ai-s'+_0x285f58(0x1bc)+_0x285f58(0x112)),chatController=require('./cha'+_0x285f58(0x20f)+'rolle'+'r'),{decrypt}=require(_0x285f58(0x23f)+_0x285f58(0xb6)+_0x285f58(0x335)),{createFinanceTools}=require('./too'+'ls/fi'+_0x285f58(0x2ac)+_0x285f58(0x31d)),{createStockTools}=require('./too'+'ls/st'+_0x285f58(0x202)+_0x285f58(0xd4)),{createRagTools}=require(_0x285f58(0x96)+_0x285f58(0x2da)+_0x285f58(0x280)+'s'),tenantConfigs={},SYSTEM_PROMPT='#\x20VAI'+'\x20TRÒ\x20'+_0x285f58(0x2e0)+_0x285f58(0x2b0)+_0x285f58(0x1cb)+_0x285f58(0x33a)+_0x285f58(0x229)+'\x20\x20\x20Bạ'+_0x285f58(0x1c5)+_0x285f58(0xb4)+_0x285f58(0x1c4)+_0x285f58(0x332)+_0x285f58(0xc8)+_0x285f58(0x282)+_0x285f58(0x240)+_0x285f58(0x247)+_0x285f58(0x99)+_0x285f58(0xb7)+_0x285f58(0x168)+_0x285f58(0x1b0)+_0x285f58(0x32e)+_0x285f58(0x23c)+_0x285f58(0xf4)+_0x285f58(0x1b3)+'\x20Khác'+_0x285f58(0x152)+_0x285f58(0x34a)+'M).\x20N'+_0x285f58(0x25c)+_0x285f58(0x305)+_0x285f58(0x1e0)+_0x285f58(0x272)+'bạn\x20l'+_0x285f58(0x242)+_0x285f58(0xbb)+_0x285f58(0xed)+_0x285f58(0xfb)+_0x285f58(0x1f4)+_0x285f58(0xe5)+_0x285f58(0x310)+_0x285f58(0xbc)+_0x285f58(0x1ce)+_0x285f58(0x1f0)+_0x285f58(0x26e)+_0x285f58(0x18c)+_0x285f58(0x33c)+_0x285f58(0x107)+_0x285f58(0x33e)+'ản\x20ph'+'ẩm,\x20c'+_0x285f58(0x164)+_0x285f58(0x1b5)+_0x285f58(0x12a)+_0x285f58(0x287)+_0x285f58(0x12f)+_0x285f58(0x2e6)+_0x285f58(0x226)+_0x285f58(0x312)+_0x285f58(0xd9)+_0x285f58(0x23a)+_0x285f58(0x327)+_0x285f58(0x30d)+_0x285f58(0x12d)+_0x285f58(0x1a9)+_0x285f58(0x292)+_0x285f58(0x254)+_0x285f58(0x11d)+_0x285f58(0x1df)+_0x285f58(0x1ab)+'\x20chu\x20'+_0x285f58(0x9b)+'\x0a\x20\x20\x20\x20'+_0x285f58(0x229)+'\x20#\x20NG'+_0x285f58(0x2ea)+_0x285f58(0x184)+_0x285f58(0x120)+'IẾP\x20\x22'+_0x285f58(0xb2)+_0x285f58(0xa3)+'\x20LÀ\x20T'+_0x285f58(0x263)+_0x285f58(0x10b)+_0x285f58(0x229)+_0x285f58(0x229)+_0x285f58(0x2db)+'c\x20pho'+_0x285f58(0x271)+_0x285f58(0x24a)+_0x285f58(0x1c2)+_0x285f58(0x201)+_0x285f58(0xa4)+_0x285f58(0x1dc)+_0x285f58(0x28c)+_0x285f58(0x222)+'ôn\x20hư'+'ớng\x20t'+_0x285f58(0x1ad)+'ải\x20ph'+_0x285f58(0xc5)+_0x285f58(0xf0)+'g\x20ngô'+_0x285f58(0x154)+_0x285f58(0x20c)+'\x20Việt'+_0x285f58(0x2ff)+_0x285f58(0x30a)+_0x285f58(0x2b2)+_0x285f58(0x235)+_0x285f58(0xe0)+'\x20nhưn'+'g\x20gần'+_0x285f58(0x304)+_0x285f58(0x345)+_0x285f58(0x229)+_0x285f58(0x2e9)+_0x285f58(0x1dd)+_0x285f58(0x27b)+_0x285f58(0x266)+_0x285f58(0x1ff)+_0x285f58(0x168)+_0x285f58(0x1b0)+_0x285f58(0x2ce)+_0x285f58(0xed)+'iên\x20C'+_0x285f58(0x1a2)+'ần\x20th'+_0x285f58(0x2f0)+_0x285f58(0x109)+_0x285f58(0x289)+'Hãy\x20s'+_0x285f58(0xf0)+_0x285f58(0x27d)+'kdown'+_0x285f58(0x279)+_0x285f58(0x209)+'h\x20gạc'+_0x285f58(0x153)+_0x285f58(0x9e)+_0x285f58(0x22b)+_0x285f58(0x297)+_0x285f58(0x2ba)+'old**'+')\x20các'+_0x285f58(0x10c)+_0x285f58(0x127)+'\x20quan'+_0x285f58(0x161)+'g\x20như'+':\x20Mã\x20'+'ưu\x20đã'+'i,\x20tê'+'n\x20sản'+_0x285f58(0xb0)+_0x285f58(0x1d2)+_0x285f58(0x16a)+',\x20số\x20'+_0x285f58(0x2f7)+_0x285f58(0x32c)+_0x285f58(0x345)+_0x285f58(0x229)+_0x285f58(0x1e5)+_0x285f58(0x174)+'t\x20thô'+_0x285f58(0xbc)+_0x285f58(0xba)+'yệt\x20đ'+'ối\x20kh'+_0x285f58(0x2f0)+_0x285f58(0x14b)+_0x285f58(0x1f6)+'\x20trúc'+_0x285f58(0x2f9)+'guồn,'+_0x285f58(0x18a)+_0x285f58(0xd5)+_0x285f58(0x244)+'id_ap'+_0x285f58(0x2c3)+'hay\x20c'+_0x285f58(0x138)+_0x285f58(0x2a7)+_0x285f58(0x288)+_0x285f58(0xfe)+_0x285f58(0x16d)+_0x285f58(0x19b)+_0x285f58(0x333)+_0x285f58(0xc7)+'\x20công'+_0x285f58(0x299)+_0x285f58(0x24c)+_0x285f58(0x223)+_0x285f58(0x2ed)+_0x285f58(0x345)+_0x285f58(0x229)+_0x285f58(0xc0)+'N\x20ĐỒ\x20'+_0x285f58(0x13f)+'Y\x20ĐIỀ'+_0x285f58(0x243)+('NG\x20CÔ'+_0x285f58(0x18e)+'\x20(CRM'+_0x285f58(0xcb)+_0x285f58(0x1b1)+'OCOL)'+_0x285f58(0x345)+_0x285f58(0x229)+_0x285f58(0x303)+_0x285f58(0xbf)+_0x285f58(0x207)+'cấp\x20m'+_0x285f58(0x34b)+_0x285f58(0xad)+_0x285f58(0x1eb)+'\x20giới'+_0x285f58(0x27f)+'(Khôn'+'g\x20bao'+'\x20gồm\x20'+'tài\x20c'+'hính/'+_0x285f58(0x1f9)+_0x285f58(0x10d)+_0x285f58(0x24e)+_0x285f58(0x31b)+_0x285f58(0x217)+_0x285f58(0x101)+_0x285f58(0x340)+_0x285f58(0x1c3)+_0x285f58(0x17d)+_0x285f58(0x2a4)+_0x285f58(0x180)+_0x285f58(0x158)+_0x285f58(0x1b7)+_0x285f58(0x252)+_0x285f58(0xab)+'nh\x20lo'+'gic\x20s'+_0x285f58(0x256)+_0x285f58(0x229)+_0x285f58(0x229)+'##\x201.'+_0x285f58(0x255)+_0x285f58(0x30b)+_0x285f58(0x356)+_0x285f58(0x302)+_0x285f58(0x140)+_0x285f58(0x1b0)+_0x285f58(0xae)+_0x285f58(0x1a1)+_0x285f58(0x324)+_0x285f58(0x316)+_0x285f58(0x319)+_0x285f58(0x229)+_0x285f58(0x229)+'-\x20Khi'+_0x285f58(0x275)+_0x285f58(0x1d5)+'g\x20hoặ'+'c\x20khá'+'ch\x20hà'+_0x285f58(0x191)+_0x285f58(0x2c6)+_0x285f58(0x13a)+'\x20cái\x20'+_0x285f58(0x1ac)+'Ví\x20dụ'+_0x285f58(0xdf)+_0x285f58(0x223)+_0x285f58(0x2de)+_0x285f58(0x1af)+_0x285f58(0x21e)+'\x20\x22Anh'+_0x285f58(0xe2)+_0x285f58(0x34f)+'n\x20A\x22)'+_0x285f58(0x142)+_0x285f58(0x2b8)+_0x285f58(0x146)+_0x285f58(0x212)+_0x285f58(0x2b4)+'mã.\x0a\x20'+_0x285f58(0x229)+_0x285f58(0x200)+'\x20BẮT\x20'+'BUỘC\x20'+_0x285f58(0x179)+_0x285f58(0x2a8)+'pMast'+_0x285f58(0xe8)+_0x285f58(0x27e)+_0x285f58(0x13c)+'\x20tiên'+'\x20(chọ'+_0x285f58(0x1ba)+_0x285f58(0x2a0)+'ustom'+_0x285f58(0x130)+_0x285f58(0x281)+_0x285f58(0x1de)+_0x285f58(0x2d1)+_0x285f58(0x29a)+_0x285f58(0x1d1)+_0x285f58(0xb1)+'c\x20Mã\x20'+_0x285f58(0x162)+_0x285f58(0x29b)+_0x285f58(0xc9)+'a_vt\x22'+_0x285f58(0x155)+_0x285f58(0x32d)+_0x285f58(0x2cb)+_0x285f58(0x204)+_0x285f58(0x300)+_0x285f58(0x2d6)+_0x285f58(0x313)+_0x285f58(0x11e)+_0x285f58(0x25e)+'\x20kết\x20'+'quả\x20t'+'hì\x20cầ'+_0x285f58(0x11f)+'n\x20ra\x20'+'danh\x20'+'sách\x20'+'đã\x20tì'+_0x285f58(0x234)+_0x285f58(0x307)+'hỏi\x20n'+_0x285f58(0x2d4)+_0x285f58(0x27a)+_0x285f58(0x121)+'họn\x20c'+_0x285f58(0x350)+'o.\x0a\x20\x20'+_0x285f58(0x229)+_0x285f58(0x128)+_0x285f58(0x225)+_0x285f58(0xfd)+_0x285f58(0x118)+_0x285f58(0x260)+_0x285f58(0x17c)+_0x285f58(0x198)+_0x285f58(0x330)+'chi\x20t'+_0x285f58(0x274)+_0x285f58(0x239)+'ách\x20h'+_0x285f58(0x114)+_0x285f58(0x22f)+_0x285f58(0xaa)+_0x285f58(0x237)+_0x285f58(0xce)+'ại\x20ho'+_0x285f58(0x31f)+_0x285f58(0x273)+_0x285f58(0x11b)+_0x285f58(0x2bf)+_0x285f58(0x20b)+_0x285f58(0x31a)+'clude'+_0x285f58(0x1a5)+_0x285f58(0x2c1)+_0x285f58(0x29c)+_0x285f58(0x2f3)+_0x285f58(0x258)+'ụ\x20này'+_0x285f58(0x2df)+_0x285f58(0xeb)+_0x285f58(0x25a)+_0x285f58(0x32a)+'Lịch\x20'+'sử\x20cu'+_0x285f58(0x9f)+_0x285f58(0x115)+_0x285f58(0x11a)+_0x285f58(0x2c0)+'nhất,'+'\x20các\x20'+_0x285f58(0xf3)+'ồng\x20đ'+_0x285f58(0x2ef)+_0x285f58(0x10c)+_0x285f58(0x127)+_0x285f58(0x1f1)+_0x285f58(0x2a3)+_0x285f58(0x33d)+'\x20ghi\x20'+_0x285f58(0x213)+_0x285f58(0x185)+'\x20trướ'+_0x285f58(0x2e3)+_0x285f58(0x241)+_0x285f58(0x223)+_0x285f58(0x259)+_0x285f58(0x328)+_0x285f58(0x229)+_0x285f58(0x229)+'##\x202.')+(_0x285f58(0x30f)+'cứu\x20G'+_0x285f58(0xf9)+_0x285f58(0xc1)+'hương'+'\x20trìn'+_0x285f58(0x352)+_0x285f58(0x312)+_0x285f58(0x32b)+'\x20\x20\x20\x20\x20'+_0x285f58(0x128)+_0x285f58(0x1fa)+_0x285f58(0x133)+_0x285f58(0xa6)+'hỏi\x20v'+'ề\x20giá'+_0x285f58(0x26f)+'n\x20nhậ'+_0x285f58(0x106)+_0x285f58(0x135)+'hoặc\x20'+_0x285f58(0x2c4)+'ề\x20các'+_0x285f58(0x1f8)+'ng\x20tr'+_0x285f58(0x2d2)+_0x285f58(0x2e7)+_0x285f58(0x28e)+_0x285f58(0x329)+_0x285f58(0x171)+_0x285f58(0x231)+'\x20hàng'+'\x20$\x0dig'+_0x285f58(0x1b2)+_0x285f58(0x2a5)+'ãy\x20gọ'+'i\x20côn'+_0x285f58(0x230)+_0x285f58(0x29e)+_0x285f58(0xea)+_0x285f58(0x28b)+'eAndP'+'romot'+_0x285f58(0x34c)+_0x285f58(0x1fd)+'\x20\x20\x20\x20\x20'+_0x285f58(0x229)+_0x285f58(0xf7)+_0x285f58(0x295)+_0x285f58(0x176)+_0x285f58(0x19f)+'ày\x20bắ'+_0x285f58(0x188)+_0x285f58(0x2d8)+_0x285f58(0x1ef)+_0x285f58(0x28d)+_0x285f58(0xa9)+_0x285f58(0x28a)+_0x285f58(0x149)+'lấy\x20t'+_0x285f58(0x2e4)+_0x285f58(0x113)+_0x285f58(0xc4)+_0x285f58(0x34e)+_0x285f58(0x18d)+_0x285f58(0x303)+'có\x20th'+_0x285f58(0x1a7)+_0x285f58(0x2f1)+_0x285f58(0x129)+'ã\x20khá'+_0x285f58(0x1f0)+_0x285f58(0xdb)+_0x285f58(0x159)+_0x285f58(0x298)+_0x285f58(0x117)+_0x285f58(0x13d)+_0x285f58(0x186)+'\x20thốn'+_0x285f58(0x2c8)+_0x285f58(0x2b9)+_0x285f58(0x294)+_0x285f58(0x268)+_0x285f58(0x1da)+_0x285f58(0xf2)+'nh\x20xá'+_0x285f58(0x1d8)+_0x285f58(0x147)+'\x20khác'+'h\x20hàn'+_0x285f58(0x19e)+_0x285f58(0x229)+_0x285f58(0x20d)+'#\x203.\x20'+_0x285f58(0x12c)+_0x285f58(0xa1)+_0x285f58(0x218)+_0x285f58(0xf6)+_0x285f58(0x14a)+_0x285f58(0x144)+'Để\x20tư'+'\x20vấn\x20'+'đặt\x20h'+_0x285f58(0x1a8)+_0x285f58(0x229)+_0x285f58(0x229)+_0x285f58(0x10e)+'\x20khác'+'h\x20hàn'+_0x285f58(0x1d0)+_0x285f58(0x267)+_0x285f58(0xb0)+_0x285f58(0x214)+_0x285f58(0x15b)+_0x285f58(0x1c1)+_0x285f58(0x1b4)+_0x285f58(0x2f6)+_0x285f58(0x125)+_0x285f58(0x105)+_0x285f58(0x314)+'o\x20nào'+'\x20còn\x20'+_0x285f58(0x2ab)+_0x285f58(0x2b7)+_0x285f58(0x2f5)+'row$\x20'+'Gọi\x20c'+_0x285f58(0x258)+_0x285f58(0x1bf)+'tInve'+_0x285f58(0xbe)+_0x285f58(0x24f)+_0x285f58(0x338)+_0x285f58(0x131)+'\x20xem\x20'+_0x285f58(0x183)+_0x285f58(0x251)+_0x285f58(0x2f8)+_0x285f58(0x150)+_0x285f58(0x170)+_0x285f58(0x14e)+'\x20phản'+_0x285f58(0x1ae)+_0x285f58(0x140)+_0x285f58(0x1b0)+'\x20chín'+_0x285f58(0xd7)+_0x285f58(0x102)+'nh\x20vi'+_0x285f58(0x9c)+_0x285f58(0x2f4)+_0x285f58(0x29d)+_0x285f58(0x1bb)+_0x285f58(0xb3)+_0x285f58(0x116)+'tồn.\x0a'+_0x285f58(0x345)+'\x20\x20\x20\x20\x20'+'\x20##\x204'+_0x285f58(0x347)+'\x20cứu\x20'+_0x285f58(0x1cd)+_0x285f58(0x1e1)+'Quy\x20t'+_0x285f58(0x1dd)+'xử\x20lý'+_0x285f58(0x25b)+_0x285f58(0x245)+_0x285f58(0x190)+_0x285f58(0x2b1)+_0x285f58(0x229)+_0x285f58(0x128)+_0x285f58(0xe6)+_0x285f58(0x205)+_0x285f58(0x13e)+_0x285f58(0x134)+_0x285f58(0x2ee)+_0x285f58(0x355)+_0x285f58(0xb5)+_0x285f58(0x119)+_0x285f58(0x264)+_0x285f58(0x216)+_0x285f58(0xab)+'nh\x20đổ'+_0x285f58(0x17a)+',\x20thô'+_0x285f58(0xbc)+_0x285f58(0x344)+'\x20đồng'+'\x20cũ\x20h'+_0x285f58(0x23e)+_0x285f58(0x195)+_0x285f58(0x145)+_0x285f58(0x16e)+_0x285f58(0xdd)+_0x285f58(0x278)+_0x285f58(0x2b3)+'phẩm\x20'+_0x285f58(0x339)+_0x285f58(0x261))+(_0x285f58(0x21c)+_0x285f58(0x2ad)+_0x285f58(0x309)+_0x285f58(0x189)+'rchKn'+_0x285f58(0x16c)+_0x285f58(0x20a)+_0x285f58(0x1fb)+_0x285f58(0x2fe)+_0x285f58(0x9d)+_0x285f58(0x1fc)+_0x285f58(0xf1)+_0x285f58(0x1d3)+'\x20\x20\x20\x20\x20'+_0x285f58(0x128)+_0x285f58(0xf8)+_0x285f58(0x1aa)+'m\x20lại'+_0x285f58(0x1cf)+'\x20sử\x20t'+_0x285f58(0x30e)+_0x285f58(0x182)+_0x285f58(0x173)+'hích\x20'+'đặc\x20b'+_0x285f58(0x1d4)+'oặc\x20g'+_0x285f58(0x341)+_0x285f58(0x325)+_0x285f58(0x2a9)+_0x285f58(0x164)+'khách'+_0x285f58(0x1b0)+_0x285f58(0x214)+_0x285f58(0x339)+'tarro'+_0x285f58(0x308)+'i\x20\x22se'+_0x285f58(0x199)+'nowle'+_0x285f58(0x24d)+_0x285f58(0x15e)+_0x285f58(0x27c)+_0x285f58(0x160)+_0x285f58(0x238)+'rsona'+_0x285f58(0xcc)+'\x0a\x20\x20\x20\x20'+'\x20\x20\x20\x20\x20'+_0x285f58(0x334)+_0x285f58(0x172)+'n\x20thả'+'o\x20văn'+_0x285f58(0x19a)+_0x285f58(0x1ca)+_0x285f58(0x253)+_0x285f58(0x1c7)+_0x285f58(0xff)+_0x285f58(0x34d)+_0x285f58(0x152)+_0x285f58(0x97)+'\x20\x20\x20\x20\x20'+_0x285f58(0x276)+_0x285f58(0x193)+_0x285f58(0x2a2)+_0x285f58(0x1b8)+_0x285f58(0x210)+_0x285f58(0xfc)+':\x20\x22Gử'+_0x285f58(0x269)+_0x285f58(0x346)+_0x285f58(0x311)+'\x22Gửi\x20'+'báo\x20g'+'iá\x20ưu'+_0x285f58(0x18f)+_0x285f58(0x12e)+_0x285f58(0x215)+_0x285f58(0x269)+'\x20xin\x20'+_0x285f58(0x232)+'ì\x20sự\x20'+_0x285f58(0x1be)+_0x285f58(0x23d)+'m\x20cho'+_0x285f58(0x2e5)+_0x285f58(0x152)+_0x285f58(0x167)+_0x285f58(0x339)+'tarro'+_0x285f58(0x23b)+'n\x20sẽ\x20'+'thực\x20'+'hiện\x20'+_0x285f58(0x1f7)+_0x285f58(0x1dd)+_0x285f58(0x1c0)+'c:\x0a\x20\x20'+_0x285f58(0x229)+_0x285f58(0x229)+'-\x20Bướ'+_0x285f58(0x1fe)+'Gọi\x20\x22'+_0x285f58(0x2d5)+_0x285f58(0x1e4)+_0x285f58(0x233)+_0x285f58(0x1a3)+_0x285f58(0x29a)+'y\x20các'+'\x20thôn'+_0x285f58(0x127)+'\x20chín'+_0x285f58(0x336)+_0x285f58(0x139)+_0x285f58(0x285)+_0x285f58(0x157)+_0x285f58(0x228)+'oanh\x20'+_0x285f58(0x1f2)+_0x285f58(0x296)+_0x285f58(0x318)+_0x285f58(0x13b)+_0x285f58(0x98)+_0x285f58(0x33b)+'hèn\x20v'+_0x285f58(0x126)+_0x285f58(0x270)+_0x285f58(0xd0)+'ang\x20('+_0x285f58(0x322)+_0x285f58(0x1d9)+_0x285f58(0x32f)+'i\x20ký\x20'+_0x285f58(0x24b)+_0x285f58(0x196)+_0x285f58(0x104)+_0x285f58(0x229)+_0x285f58(0x229)+'\x20\x20-\x20B'+_0x285f58(0x21d)+_0x285f58(0x2fd)+'h\x20hoạ'+_0x285f58(0x1d6)+_0x285f58(0xe3)+_0x285f58(0x1c6)+_0x285f58(0x175)+_0x285f58(0x2bd)+_0x285f58(0x2a6)+_0x285f58(0x2cd)+_0x285f58(0xa7)+_0x285f58(0x353)+_0x285f58(0x349)+_0x285f58(0x12b)+_0x285f58(0x19c)+_0x285f58(0x1b9)+_0x285f58(0x151)+_0x285f58(0x2af)+_0x285f58(0xe4)+'\x20chuẩ'+_0x285f58(0x301)+_0x285f58(0x2b5)+_0x285f58(0xa0)+_0x285f58(0xe1)+'r/>\x22)'+_0x285f58(0x17b)+_0x285f58(0x31e)+_0x285f58(0x249)+'ng\x20tr'+_0x285f58(0x166)+_0x285f58(0x351)+'y\x20đủ\x20'+_0x285f58(0x208)+_0x285f58(0x1e6)+_0x285f58(0x29f)+_0x285f58(0x2e8)+_0x285f58(0xcd)+_0x285f58(0x25d)+_0x285f58(0x2ae)+'thư.\x0a'+_0x285f58(0x345)+_0x285f58(0x229)+_0x285f58(0x21a)+'Y\x20TRÌ'+'NH\x20XỬ'+_0x285f58(0x194)+_0x285f58(0x2dc)+_0x285f58(0x2cf)+_0x285f58(0x224)+_0x285f58(0x1ea)+_0x285f58(0x2cf)+_0x285f58(0x2f2)+_0x285f58(0x229)+'\x20\x20\x20-\x20'+'Nếu\x20\x22'+_0x285f58(0x2a8)+_0x285f58(0x148)+_0x285f58(0xe8)+_0x285f58(0x27e)+'\x22\x20báo'+_0x285f58(0x2c9))+('g\x20tìm'+_0x285f58(0xb9)+_0x285f58(0x2e5)+'h\x20hàn'+_0x285f58(0x1e3)+_0x285f58(0x17f)+_0x285f58(0xb0)+_0x285f58(0x1a0)+_0x285f58(0x137)+_0x285f58(0x15a)+'\x20nhân'+_0x285f58(0x10f)+_0x285f58(0xbd)+_0x285f58(0x1e8)+_0x285f58(0x2c7)+_0x285f58(0x9a)+'thông'+_0x285f58(0x1bd)+_0x285f58(0x140)+_0x285f58(0x1b0)+'/sản\x20'+_0x285f58(0x337)+'này\x20t'+_0x285f58(0x2aa)+'anh\x20m'+_0x285f58(0xda)+_0x285f58(0xd1)+'g.\x20An'+_0x285f58(0x169)+'\x20vui\x20'+_0x285f58(0x95)+_0x285f58(0x2d7)+_0x285f58(0x177)+_0x285f58(0x123)+_0x285f58(0x30c)+_0x285f58(0x1a6)+_0x285f58(0x348)+_0x285f58(0x2b6)+'ử\x20dụn'+_0x285f58(0xaf)+_0x285f58(0x206)+'\x20tri\x20'+'thức\x20'+_0x285f58(0x14f)+_0x285f58(0x2a1)+_0x285f58(0x2cc)+'trong'+_0x285f58(0x180)+'file\x20'+'hợp\x20đ'+_0x285f58(0x14d)+_0x285f58(0x227)+_0x285f58(0x26b)+'\x20\x20\x20\x20\x20'+_0x285f58(0x229)+_0x285f58(0xf5)+_0x285f58(0xa5)+_0x285f58(0x262)+_0x285f58(0x1c9)+_0x285f58(0x18b)+_0x285f58(0xef)+_0x285f58(0x108)+_0x285f58(0x181)+_0x285f58(0xd2)+_0x285f58(0x1f5)+_0x285f58(0xd3)+_0x285f58(0x2eb)+_0x285f58(0x354)+_0x285f58(0x22c)+_0x285f58(0x143)+_0x285f58(0x2d3)+_0x285f58(0xa8)+'\x22lỗi\x20'+_0x285f58(0x2e2)+_0x285f58(0x2c2)+_0x285f58(0x33f)+_0x285f58(0x283)+_0x285f58(0xee)+_0x285f58(0x1a4)+_0x285f58(0x122)+_0x285f58(0x229)+_0x285f58(0x20d)+_0x285f58(0xe7)+_0x285f58(0xdc)+_0x285f58(0x220)+_0x285f58(0x317)+_0x285f58(0x229)+'\x20\x20\x20\x20L'+_0x285f58(0x15f)+'ưu\x20ý\x20'+_0x285f58(0x236)+_0x285f58(0x1e2)+_0x285f58(0x165)+_0x285f58(0x22a)+_0x285f58(0x286)+_0x285f58(0xd1)+_0x285f58(0x1e7)+'m\x20')+new Date()[_0x285f58(0x156)+'llYea'+'r']+(_0x285f58(0x203)+'tính\x20'+_0x285f58(0x277)+_0x285f58(0x1ec)+_0x285f58(0x12f)+_0x285f58(0x2e6)+_0x285f58(0x226)+_0x285f58(0x312)+_0x285f58(0x25f)+_0x285f58(0x11f)+_0x285f58(0x19d)+_0x285f58(0x26a)+_0x285f58(0x250)+'t\x20hạn'+_0x285f58(0x12e)+_0x285f58(0x221)+_0x285f58(0x306)+'\x20thời'+'\x20hạn\x20'+_0x285f58(0x22d)+_0x285f58(0x103)+_0x285f58(0x239)+_0x285f58(0x223)+_0x285f58(0x1b6)+'ột\x20cá'+_0x285f58(0x248)+'ính\x20x'+'ác.');function _0x4c4b(){const _0x21110f=['4BUNysbRAa','AEg6O2KGCq','DYqGqUg6Oq','DEg6O24GDa','BIbWAog6Qq','B+g6T2mGDa','lI4VBgK','AhxHU5LJia','DUg7GsbRAa','W6aGAog7LYa','vsbiXQ/HU5O','BMCGkci','y2GGC+g7Rq','AxnbCNi','CgJdSM5N','y2GGy2G','Esb0CMe','Aog6PxuGAa','DmoQBIbJ','Ag8GA2G','zgDLqMe','s2HPig4','u3vTBwe','XjhdOYbO4BQ/','4BUJBMCGDa','zw8GCxu','ievTywK','4BQJBYbWAa','iff1Esa','yxu6cGO','w2nLB0e','W7rUzYbJ','W6bUzYbU','ihrVW6bU','icyGtog7IW','AgNHU4DTia','W7PJiog7NYa','BMHP4BUbDq','W6nPigpdSG','C8oIDtOQ','DgfYCM8','ihrOW6fP','uUg7Je5hia','BYbOW6bU','ywXSCW','y2fUBMe','icjt4BQJBG','ignOAEg6VW','Asb0AmAW','igHHEsa','W6HTlIik','mJyWohLvv0XNCa','CMLUzW','BMCSigS','lcbTDEg7Kq','4BQNBIbdAa','BMC6ifq','igpHU6DHia','ihBHUQvUla','AEg6V3qGyW','ig5NXRdHU50','icaTieS','Dg/dOw4G','igtHU6vUzW','lcbKyw4','zmo5BMCG','ySoGEsbZ','BciGkha','zYbnyxi','yvrVB2W','igJHUQfUia','z1rVB2W','B+g6T2mGiG','AEg7H3aGDa','BciSici','Dg9VBf8','igpdTg5N','4BUNysbO4BUh','W6fUlcbJ','ig7HU5LPia','yw5OlIa','yv92Dci','DfbYAwm','DmoSBMGG','EEg7Gw4GDG','igHP4BUhBG','qwDLBNq','w2fNzw4','BMLUzW','4BQHBIb0Aa','CgvUqva','BIbT4BUPyW','DsddVtOQ','CcWGAg8','BIdeKEg6Rw0','igZgSog7O24','ihr5igm','XjhHU4mGBog6Pq','BwfFA2G','oIb0CNu','zYb2XRdHU6m','iMDLDfa','4BUFimsr4BQNDq','ztOGiMm','4BUzimsr4BUdia','W6jUihzP','igJHU4CGDG','AsbO4BUJCa','B3CKieG','BMCGDgG','AsbJAmo6','Bg9VA3u','y+g7P2eGyW','CSoQBIbK','AmoGBMC/','BMfUy2u','EsbN4BUnAq','y3xHU5fPia','yYb0Aog6UW','qsbw4BUkia','CUg7OWOGia','lcbJAhu','ihpHUQnUia','XjfVW6fUia','Cd4Ilca','B+g6T2mGCW','iIaKdwK','ieTiW5ro','Acb0B8oH','icGQkMi','CMvWBge','yxriAxm','4BUzAsbKDq','z2vZ','yUg6RxqGDa','igFHUQDUia','DgLVBNm','yxnLiIW','CciPlca','Aog7J2KGDG','ndq5ntG4m0nss052sW','4BQVyYdeKEg6VW','ihtdRg0G','zYb0W61U','igTOW7rU','zxjYB3i','BcbSB28','CxxdQxqG','XRaGkhrY','ihBdOcbU','W5rorYbu','Aog6O24GAa','y3qIksa','W6XUAcdgSa','Aog7Kw5Nia','z+g7Q29Pia','z2v0q28','yxrHvg8','A2NHU4nTia','yYbWAog6OW','Dg9YEq','BhmVCMe','ms4GvmoH','seKGs0G','BgvUz3q','W6bUzYbu','ihpHUR0GDa','vSoaimsq4BUk','CMvHC28','zgf0ywi','yYdeKCoZia','4BURiglgSog7MW','igTOW6fJ','ihrYW6XU','DsdeKCoJAq','ihBdOcbS','idiUifq','vvNdIK4G','4BUxAsbR4BU5','y2HHDa','W6bUzY4k','A2JdSYb2','W6mGA8o9la','W7rUzYb0','EEg7Gw4GDa','su4kica','zsiUiem','BIbOW6bU','z2H0yxi','A2HVigS','Ag90BgK','4BUtBIbRAa','ig3dOYbU','CMvZCg8','Dg9VBem','mZm1ndm2meTLAeTowq','oIblW61J','iIaOCgG','ignODEg6Qq','C3rLCKq','BIaOiJW','DcbTW6mG','ielHUQfUia','igFfQwKU','DUg7PsbJ4BUr','imsr4BUlBMG','Esb2W6aG','DYqGr+g7Jq','ig5NyxK','BIbT4BUXyW','DhldRg5O','BIbOB+g6TW','A2HP4BQ/Dq','XRaGDUg6Pw4','ifrYysa','Dsb0Amo0','XQfUiIWG','EEg6V24GBq','B2WGDhi','yYaIs2G','ndKXmta4ngjIzMvcrq','XQeGmZyW','iftHUR4kia','DgXPBMu','imsr4BUziGO','4BUricjPBG','Aog6Rw4GXje','mtm5ndeYmtbuAeDoDe8','vg9VBhm','BMGGySoG','4BQ3yYb0XRa','ihWGu2u','ignOBYa','rM9VDgu','z3b0ltu','ieJHU5mGCW','W7OGy8wPia','igZgShuG','DxNHUR90ia','W6b5lGOk','igpdSYbJ','iglHU5K6ia','W6nPcIaG','BMuUlI4','Dsb0B28','ihBdOcbr','4BQ3yYbS4BUD','4BUtihpgOsa','Aw5N','y2H1ECoQ','4BQHEsbJ4BQJ','icmJidu','AwXZ','Acb0Aog7Qq','CgJHUQLTia','CNLuB28','ja1Pz2G','4BQGtGOGia','imsr4BUdigm','CMeGDhi','W6aGy8oHyW','AmoHAsbZ','icjUDwW','DsWGyUg6Oq','AgKGy2G','Df9TB2q','CgLFz3a','BIbO4BUJCa','cIaGica','igpHUQnTia','lIbuCMe','C+g7KsWGAa','iIKGCgG','zYaOq1i','4BUzDcbUAa','Aw9Uvg8','ieTOW6fJ','zgfUAca','4BUfBIbwXim','W6fPig7dOa','y8oZimsr4BQN','AcblAhu','iMH0BwW','ihrODEg6Rq','4BUbignOW60','icjdAog7Kq','BmoYBMCG','lI90B28','zWOGica','ignO4BUjkq','ienOXinT','DgJHUQv5ia','XjhdOw8UcG','4BUhyYbIW6e','4BQHBsb2Aq','igtdSM5N','4BUzyYbN4BUn','iJXIpIi','DhjHifq','zxHWB3i','ieJdGe5h','C+g7SsWGBG','BIbNAEg7RW','AmoGBMCG','XRdHU51UzYa','kg5OXRaG','W6bVicjT','4BULihJHU60G','Esb0CSoS','nZbHwu1HqwS','W7nTigpdTa','icyGvhi','zYb0W6XT','ihbO4BQPBq','BMGGEmoH','s0JdGuni','ihpHU5eGBa','vhlHU6mGBa','BMGGC8oH','yNmVDxq','ihpdS2mG','zs4U','ihrO4BQLEq','BJOGvhu','DhlHU6mGBG','BMCGDgK','oIaIrw0','BNrVCNK','XjhgSog7O2mG','icmGqUg6OG','BIaMiem','W6bVigrH','B3bLBMe','igpHU6L1ia','W6fWlIbt','DhnDw3i','BsbJ4BUNyq','BIbUz2G','iIWGiM0','yxbPs2u','ifrpt0W','BciPlGO','4BUDAsbJAa','AEg6V3uGBG','CM9Szq','W6jUihrY','ihrO4BUrBG','y8oHyYb0','ySoHBYbS','B2XZ','4BUhihrO4BUr','yMvMB3i','Acb4W6fJ','Aw9U','W6nPlcbN','4BULyYbO4BUh','BMCGAg8','ieDjqu4','4BQRBIbZ4BUT','zxnZywC','oIaIs2G','z2HP4BUhCa','lcaIpgi','ie5NDxK','BMrfBwe','ieHutuW','CMeGy+g7Qq','s2HPigC','ifri4BUCsq','zxjeyxq','CgLFA2u','CM9KDwm','CUg6OYb24BUb','BUg7MwKGza','AmoIBIb2','Dw5Kzwy','lcbRAmo0','4BUTigtHU6vU','CgfUEsi','DsbJAmoT','Aog7O3aGXje','CUg7IYbrDq','lsbmDCo0','DgJdOwKG','lsaQtmAW','s2HPigm','ACoHigldOq','ihWGrxi','ACoQBIbd','DsbJ4BQNDq','Bmo9ignO','yUg7MsbTyq','BsbZW7nJ','ssbRzxK','W6P1igpHUQC','lcb0CSoH','W6bUAcbJ','ywLSlGO','iIbOB+g6TW','BIbIW6fV','4BQHBMCGDa','BMCGXjhgSa','Aw4GBMG','w0ZHU5DPia','vmoctsik','ihrOW7rU','W6fUks4G','lsblAgK','ihzPW6PU','4BQJihbO4BQJ','zMXLEgi','zw5HAq','yYb0CMe','W6bUzYbW','Asb04BUvBG','XRdHU6nUzYa','zYbK4BUXia','DxNdQM4G','y2GGyUg6OW','zYdeKCoGAq','igJdO3KG','BNnL','4BQJBIbO4BUt','4BQJihBHU4eG','BIbOAEg7HW','sufpifq','EgvTigm','ks4kcIa','4BQHAsb0W6O','x2LK','Amo0BMC/','W6bVihbO','zYb0Aw4','icaGlsa','AmoQBsbT','z2NdOsbI','4BQJAsdeKCAW','s2NHU4nTia','ig7HUQfPia','lcbOB+g6TW','AmAWXQfUzW','zxiIigG','BciGXjhHU4m','DxnLCG','AmoHy2GG','igJHU49Pia','igDPW6eG','yw5Jzue','igJgSog7M24','W6fJigDO','yYbJ4BUNyq','BIbT4BUzDa','lcdeKEg7I2e','iIdeKEg6P3u','A2NHUR9Uia','yYbJW6j1','vmAVierv','A2JdOwnO','igpdSYbW','lcbI4BQHBG','igJHU4CGDa','AmoZysaO','4BUhDsbOXRa','rYdeKmAV4BUI','DcbJAg8','Ce1HC3q','icJeKCoJia','smoGBMCG','AEg6V3qGBa','y29UDgu','4BUtBMCGXje','igDPW7PW','BUg7MwKGyG','BYb0Aog7Sq','BMCGy8oH','AcbOW6bU','AcdeKEg6P3u','BIb04BURia','ks4GtUg6VW','z2v0rNu','ihr5icG','y8o0BMCG','4BQ3yYbZ4BUr','zYbK4BQRBG','y8oYBIbO','C2f2zu0','yxbW','C2vuB28','DCo0BIbS','Aog6Ow0GDG','ihrY4BUnBG','C+g7KsaOiG','BwfW','AmoTBMGG','AgNHU4DUia','4BUnBMCSia','zYbyiIa','s2JdOwnO','Ac9dAog7IW','EsbO4BQ5BG','z2v0q2G','B3DSzwq','BMCGDmoT','4BUBBMCGza','BIbO4BUtAq','yYb04BQ/la','Ag8GBEg7Mq','lIbtB+g6Oq','ihpHU58GDa','4BQJBYbT4BQT','BciUie4','iepdTg5N','DhjHigW','z2v0tw8','z+g7JwKGiG','Asb0CUg6OW','lcb0CSoS','kIdeKog7GYa','AsbWAog7Kq','C3nPB24','yYbZ4BQJBG','igpdOwmG','ysbYysa','lcbJW6fJ','C+g7KsbSXRa','vog6RKmGrW','4BQ3BIbKW7i','XjhHU4mGAog7HW','mtu0A1zdzwXh','DcbIDEg7Mq','icjZzwe','ieLeigG','4BUxihrY4BUJ','AEg7G20GDa','BEg7PwmPlG','tKCGq+g7Pa','imsrW6nPiG','igJHU5CGDa','BMCGBMG','zs1Syxm','AgKGBMG','ieZdNsbl','W6bPigXP','4BUNysbLBq','4BQ/DcbXDq','EgvTigG','yxjJAeS','iglHUQnUia','BMGGBMG','4BUJyYbI4BUn','DsbS4BUXyW','zY4kcIa','igpHU6uGBG','lcbOW6n5','ysbJ4BUPDq','u0Tiigm','B29SiIa','Aw5Lzci','x3jLBge','yYbTW6mG','4BUdihrYDq','W6bUzYKk','DSoGihnV','4BQNBIb0W6W','AcbZ4BUXla','DmoQBIaO','4BUBAsbNAq','igJHU5nPia','DEg6Pw4Gua','igJdOg5N','ifbst1q','AhrHCNi','yw4GAog7HW','CM9UzYa','C8oHy2GG','W6bUzYbT','y+g7Psb0Aa','W6PUient','yYb0CM8','BIb0Exa','DcbXDCoH','zgSVB3a','ihrPBIa','y+g7KsbZ4BQJ','4BULicjNzq','mIbIXRdHU5S','W6bUzYb0','AEg7G3uSia','BIbWAog6OW','W70GquKG','BIbSW6aG','AwXuB28','BcbdAmsd','lJqTBwK','imsr4BUzigG','jIbh4BUTAq','q+g7PKeGqG','s2JdTg5N','vhjPihq','BIbRAmoH','igZHU4TJAa','zYbO4BUpAq','EsbJAmoT','lcbUz8oG','ks4kica','AEg7H3qGAa','AsbKW7LU','DcaIC2u','Dg9tDhi','yYbUAog6Pq','CIKGAg8','DcbRAog6Pq','Dgv4Da','AgNHU4D0ia','CSoSBMGG','ChjVzhu','AsbS4BUlyW','DcbSW7vP','Aog7QwmSia','z2LHBIa','zYbOB+g6TW','BxbHBNK','idmUiei','AmoGBYbT','zYaOtSsd','ignOXRbH','Aw5MBW','4BQKwsbusa','BMCGy+g7Pq','y8oHyYbJ','C3vIC3q','mti3oti0sLzrvMPQ','Asb0CNu','y2GGAmoG','igXPW6PU','BMDOAEg7HW','BwvZC2e','u0Tiihq','Amo0BMCG','4BUzigpHUQv1','Cxv5ihq','ignOXRdgOq','A+g6VYb0BW','s2HPigS','zvrVB2W','icjJB20','B2WIlGO','yYaXoIa','yMXLoIa','icaGic0','Bog7I2nOia','B2nRvg8','ksdeKEg7GYa','A3vWtwe','4BQ3CcbJW6e','igTP4BQ/Bq','y3vUzYa','Bog7NwKGyW','AcbZW6fJ','z2vcyxm','AgfTihm','DgNHUR9UzW','icaGicm','mty1odG4ouPxsLrjtG','DenVBNq','s0GGECoQ','ovfxyML1AW','qYb04BUXia','y2JdUIbK','ig7dOhKG','yYaIr+g7Rq','AcWGCxu','XRdHU6nJihK','CUg6Ow5Nia','z2vZihy','icmGuvu','q2JgSgeG','DYqGsmoJ','XRdHU5TJidi','AmoHDciS','Dc1Tzxm','ifri4BUWqW','yYb4W6fJ','DSoGigX1','W6fJAcbO','W4Xnifri','kIPy4BUTia','AcbRAhu','W61UAcbR','vmoQBIbK','icaGica','Dog6OwKGyW','ihBdOcbP','DcbJ4BUNyq','yUg6O28GAa','z2vUDf0','Aog7PwmGDG','zYbJ4BULia','DcbT4BQ3Da','Bog7L2KGDG','sw5MB1q','Bsb0Aog6Pq','ECoQBIbU','DgJHU51Pia','Bmo9igTO','AsaICgu'];_0x4c4b=function(){return _0x21110f;};return _0x4c4b();}async function runCSKHAgent(_0xd6010d,_0x594c80,_0x3a21fe,_0x1865d8){const _0xd609d3=_0x285f58;try{if(!tenantConfigs[_0xd6010d]){const _0xec520={};_0xec520['_id']=_0xd6010d;const _0x594cd9={};_0x594cd9['opena'+_0xd609d3(0xe9)+'y']=0x1,_0x594cd9[_0xd609d3(0xc3)+_0xd609d3(0x343)+_0xd609d3(0x342)+'el']=0x1;const _0x2f5745=await global[_0xd609d3(0x178)+'del'](_0xd609d3(0x15d))['findO'+'ne'](_0xec520,_0x594cd9);if(!_0x2f5745||!_0x2f5745['opena'+_0xd609d3(0xe9)+'y'])throw new Error(_0xd609d3(0x21b)+'khai\x20'+'báo\x20O'+_0xd609d3(0x293)+_0xd609d3(0x100)+_0xd609d3(0x321)+'hệ\x20th'+'ống.');const _0x3b1d3c=decrypt(_0x2f5745[_0xd609d3(0xc3)+_0xd609d3(0xe9)+'y'][_0xd609d3(0x2bb)+'ce'](_0xd609d3(0x111)+'iz::',''),![]),_0x4f90d8={};_0x4f90d8[_0xd609d3(0xca)+'y']=_0x3b1d3c,tenantConfigs[_0xd6010d]={'openaiInstance':createOpenAI(_0x4f90d8),'gptModel':_0x2f5745[_0xd609d3(0xc3)+_0xd609d3(0x343)+_0xd609d3(0x342)+'el']||_0xd609d3(0x323)+_0xd609d3(0x1c8)+'ni'};}const {openaiInstance:_0xa51b94,gptModel:_0x39b86f}=tenantConfigs[_0xd6010d];if(!_0x3a21fe){const _0x53d473=await chatController['creat'+'eSess'+_0xd609d3(0xd8)](_0xd6010d,_0x594c80,_0x1865d8[_0xd609d3(0x1ed)+_0xd609d3(0x26d)](0x0,0x400));_0x3a21fe=_0x53d473[_0xd609d3(0x124)][_0xd609d3(0x1d7)+_0xd609d3(0x331)]();}const _0x24faa4=await chatController[_0xd609d3(0x16b)+_0xd609d3(0x2bc)+_0xd609d3(0x2d9)](_0xd6010d,_0x3a21fe,0x1e),_0x42808a={};_0x42808a['role']=_0xd609d3(0x132),_0x42808a[_0xd609d3(0x14c)+'nt']=_0x1865d8;const _0x3bb6ce=[..._0x24faa4,_0x42808a],_0x4f8b64={};_0x4f8b64['messa'+_0xd609d3(0x2be)]=_0x3bb6ce,_0x4f8b64[_0xd609d3(0x2e1)+_0xd609d3(0x291)]='all',_0x4f8b64[_0xd609d3(0x2fb)+_0xd609d3(0x265)]=_0xd609d3(0xd6)+_0xd609d3(0x192)+_0xd609d3(0x21f)+'sage';const _0x5030af=pruneMessages(_0x4f8b64),{getProductPriceAndPromotionTool:_0xd2a8da,getInventorySummaryTool:_0x31a96c}=createStockTools(_0xd6010d,_0x594c80),{getDebtBalanceSummaryTool:_0x29addb}=createFinanceTools(_0xd6010d,_0x594c80),_0x4a2eb4={'getProductPriceAndPromotionTool':_0xd2a8da,'getInventorySummaryTool':_0x31a96c,'getDebtBalanceSummaryTool':_0x29addb,...createRagTools(_0xd6010d,_0x594c80)},_0x463c73=await generateText({'model':_0xa51b94[_0xd609d3(0x2ec)](_0x39b86f),'system':SYSTEM_PROMPT,'messages':_0x5030af,'tools':_0x4a2eb4,'stopWhen':stepCountIs(0xa)});Logger[_0xd609d3(0x1e9)](_0xd609d3(0x257)+_0xd609d3(0x22e)+'\x20lưu\x20'+_0xd609d3(0x1f3)+_0xd609d3(0x219)+_0xd609d3(0xc2)+'tabas'+_0xd609d3(0xb8));const _0x549e7d={};_0x549e7d[_0xd609d3(0xcf)]=_0xd609d3(0x132),_0x549e7d[_0xd609d3(0x14c)+'nt']=_0x1865d8;const _0x406a74=[_0x549e7d,..._0x463c73[_0xd609d3(0x2fa)+_0xd609d3(0x11c)][_0xd609d3(0x1f3)+_0xd609d3(0x2be)][_0xd609d3(0x163)](_0x424f2b=>({'role':_0x424f2b[_0xd609d3(0xcf)],'content':_0x424f2b[_0xd609d3(0x14c)+'nt']?Array[_0xd609d3(0x246)+'ay'](_0x424f2b[_0xd609d3(0x14c)+'nt'])?_0x424f2b[_0xd609d3(0x14c)+'nt'][0x0]?.[_0xd609d3(0x1db)]:_0x424f2b['conte'+'nt']:'','tool_calls':_0x424f2b[_0xd609d3(0x284)+'calls']||null,'tool_call_id':_0x424f2b['tool_'+'call_'+'id']||null,'messages':[_0x424f2b]}))];try{await chatController[_0xd609d3(0x15c)+_0xd609d3(0xde)+'es'](_0xd6010d,_0x3a21fe,_0x406a74);}catch(_0x44ebfe){Logger[_0xd609d3(0x2ca)](_0xd609d3(0x290)+_0xd609d3(0xc6)+'unFin'+_0xd609d3(0x136)+_0xd609d3(0x22e)+_0xd609d3(0x2c9)+'g\x20thể'+_0xd609d3(0x326)+_0xd609d3(0xec)+'ung\x20c'+'hat.\x20'+'Err:',_0x44ebfe);}return{'session_id':_0x3a21fe,'answer':_0x406a74[_0xd609d3(0x2dd)+'h']>0x1?_0x406a74['pop']()?.[_0xd609d3(0x14c)+'nt']||'Không'+_0xd609d3(0x141)+_0xd609d3(0x2d0)+'ồi':_0xd609d3(0x1cc)+'\x20có\x20k'+_0xd609d3(0x197)+_0xd609d3(0x110)+_0xd609d3(0x16f)};}catch(_0x1b877c){console[_0xd609d3(0x2ca)](_0xd609d3(0x10a)+_0xd609d3(0x28f)+'\x20CSKH'+']\x20App'+':\x20'+_0xd6010d+(_0xd609d3(0x320)+_0xd609d3(0x17e)+':\x20')+_0x3a21fe+(_0xd609d3(0xfa)+'r:'),_0x1b877c);throw new Error(_0x1b877c['messa'+'ge']);}}module[_0x285f58(0xa2)+'ts']=runCSKHAgent;
|