2024-05-08 14:21:52 +03:00
|
|
|
import { IS_GITHUB_ACTIONS } from '@/constants'
|
2022-09-26 16:24:07 +03:00
|
|
|
import { LoaderHelper } from '@/helpers/loader-helper'
|
2022-09-26 16:29:56 +03:00
|
|
|
import { LogHelper } from '@/helpers/log-helper'
|
2019-02-10 15:26:50 +03:00
|
|
|
|
2022-06-30 17:35:54 +03:00
|
|
|
import train from '../train/train'
|
2023-04-27 15:24:16 +03:00
|
|
|
import generateHTTPAPIKey from '../generate/generate-http-api-key'
|
|
|
|
import generateJSONSchemas from '../generate/generate-json-schemas'
|
2022-09-26 19:01:03 +03:00
|
|
|
|
2019-02-10 15:26:50 +03:00
|
|
|
import setupDotenv from './setup-dotenv'
|
|
|
|
import setupCore from './setup-core'
|
2023-05-14 07:10:55 +03:00
|
|
|
import setupSkills from './setup-skills/setup-skills'
|
2024-01-28 19:20:38 +03:00
|
|
|
import setupLLM from './setup-llm'
|
2023-04-30 18:39:39 +03:00
|
|
|
import setupBinaries from './setup-binaries'
|
2024-06-18 04:02:09 +03:00
|
|
|
import setupTCPServerModels from './setup-tcp-server-models'
|
2023-04-12 19:11:23 +03:00
|
|
|
import createInstanceID from './create-instance-id'
|
2019-02-10 15:26:50 +03:00
|
|
|
|
|
|
|
// Do not load ".env" file because it is not created yet
|
|
|
|
|
|
|
|
/**
|
2022-09-04 09:25:05 +03:00
|
|
|
* Main entry to set up Leon
|
2019-02-10 15:26:50 +03:00
|
|
|
*/
|
2022-09-03 14:12:41 +03:00
|
|
|
;(async () => {
|
2019-02-10 15:26:50 +03:00
|
|
|
try {
|
|
|
|
await setupDotenv()
|
2022-09-26 16:24:07 +03:00
|
|
|
LoaderHelper.start()
|
2023-05-14 07:10:55 +03:00
|
|
|
await setupCore()
|
|
|
|
await setupSkills()
|
2022-09-26 16:24:07 +03:00
|
|
|
LoaderHelper.stop()
|
2024-05-08 14:21:52 +03:00
|
|
|
if (!IS_GITHUB_ACTIONS) {
|
|
|
|
await setupLLM()
|
|
|
|
} else {
|
|
|
|
LogHelper.info('Skipping LLM setup because it is running in CI')
|
|
|
|
}
|
|
|
|
|
2023-04-30 18:39:39 +03:00
|
|
|
await setupBinaries()
|
2024-06-18 04:02:09 +03:00
|
|
|
await setupTCPServerModels()
|
2023-04-27 15:24:16 +03:00
|
|
|
await generateHTTPAPIKey()
|
|
|
|
await generateJSONSchemas()
|
2022-09-26 16:24:07 +03:00
|
|
|
LoaderHelper.start()
|
2019-02-10 15:26:50 +03:00
|
|
|
await train()
|
2023-04-12 19:11:23 +03:00
|
|
|
await createInstanceID()
|
2019-02-10 15:26:50 +03:00
|
|
|
|
2022-09-26 16:29:56 +03:00
|
|
|
LogHelper.default('')
|
|
|
|
LogHelper.success('Hooray! Leon is installed and ready to go!')
|
2022-09-26 16:24:07 +03:00
|
|
|
LoaderHelper.stop()
|
2019-02-10 15:26:50 +03:00
|
|
|
} catch (e) {
|
2022-09-26 16:29:56 +03:00
|
|
|
LogHelper.error(e)
|
2022-09-26 16:24:07 +03:00
|
|
|
LoaderHelper.stop()
|
2019-02-10 15:26:50 +03:00
|
|
|
}
|
|
|
|
})()
|