mirror of
https://github.com/leon-ai/leon.git
synced 2024-08-17 06:00:33 +03:00
Merge branch 'chore/clean-up' into develop
This commit is contained in:
commit
84b84453a7
@ -1,9 +0,0 @@
|
||||
__pycache__/
|
||||
**/dist/*
|
||||
**/build/
|
||||
**/node_modules/
|
||||
**/tmp/*
|
||||
**/src/.venv/*
|
||||
logs/*
|
||||
*.pyc
|
||||
.DS_Store
|
@ -18,10 +18,7 @@
|
||||
"browser": true
|
||||
},
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2021
|
||||
},
|
||||
"globals": {
|
||||
"io": true
|
||||
"ecmaVersion": "latest"
|
||||
},
|
||||
"plugins": ["@typescript-eslint", "unicorn", "import"],
|
||||
"ignorePatterns": "*.spec.js",
|
||||
|
17
.github/CONTRIBUTING.md
vendored
17
.github/CONTRIBUTING.md
vendored
@ -77,22 +77,6 @@ npm run dev:server
|
||||
npm run dev:app
|
||||
```
|
||||
|
||||
### Docker
|
||||
|
||||
```sh
|
||||
# Clone the repository
|
||||
git clone https://github.com/leon-ai/leon.git leon
|
||||
|
||||
# Go to the project root
|
||||
cd leon
|
||||
|
||||
# Build
|
||||
npm run docker:build
|
||||
|
||||
# Run the development server and the development web app
|
||||
npm run docker:dev
|
||||
```
|
||||
|
||||
## Versioning
|
||||
|
||||
- We use [Semantic Versioning](https://semver.org) for releases.
|
||||
@ -125,7 +109,6 @@ Scopes define high-level nodes of Leon.
|
||||
|
||||
- bridge/python
|
||||
- bridge/nodejs
|
||||
- docker
|
||||
- hotword
|
||||
- scripts
|
||||
- server
|
||||
|
1
.github/ISSUE_TEMPLATE/BUG.md
vendored
1
.github/ISSUE_TEMPLATE/BUG.md
vendored
@ -16,7 +16,6 @@ If the bug is related to the setup, please submit the issue at: https://github.c
|
||||
- OS (or browser) version:
|
||||
- Node.js version:
|
||||
- Complete "leon check" (or "npm run check") output:
|
||||
- (if using Docker) Complete "npm run docker:check" output:
|
||||
- (optional) Leon skill version:
|
||||
|
||||
### Expected Behavior
|
||||
|
13
.github/dependabot.yml
vendored
13
.github/dependabot.yml
vendored
@ -1,13 +0,0 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: 'npm'
|
||||
directory: '/'
|
||||
schedule:
|
||||
interval: 'weekly'
|
||||
day: 'friday'
|
||||
time: '22:00'
|
||||
commit-message:
|
||||
prefix: 'chore'
|
||||
include: 'scope'
|
||||
reviewers:
|
||||
- 'louistiti'
|
@ -6,6 +6,6 @@ if ! [ -x "$(command -v npm)" ]; then
|
||||
echo "If you use a version manager tool such as nvm and a git GUI such as GitKraken, please read: https://typicode.github.io/husky/#/?id=command-not-found" >&2
|
||||
exit 1
|
||||
else
|
||||
npx ts-node scripts/commit-msg.js
|
||||
npx tsx scripts/commit-msg.js
|
||||
fi
|
||||
|
||||
|
60
Dockerfile
60
Dockerfile
@ -1,60 +0,0 @@
|
||||
FROM ubuntu:20.04
|
||||
ENV IS_DOCKER true
|
||||
|
||||
# Replace shell with bash so we can source files
|
||||
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
|
||||
|
||||
# Set debconf to run non-interactively
|
||||
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
|
||||
|
||||
# Install base dependencies
|
||||
RUN apt-get update && apt-get install --yes -q --no-install-recommends \
|
||||
apt-transport-https \
|
||||
build-essential \
|
||||
ca-certificates \
|
||||
curl \
|
||||
git \
|
||||
wget \
|
||||
libssl-dev \
|
||||
openssl \
|
||||
libz-dev \
|
||||
zlib1g-dev \
|
||||
libbz2-dev \
|
||||
libreadline-dev \
|
||||
libsqlite3-dev \
|
||||
llvm \
|
||||
libncurses5-dev \
|
||||
xz-utils \
|
||||
tk-dev libxml2-dev \
|
||||
libxmlsec1-dev \
|
||||
libffi-dev \
|
||||
liblzma-dev \
|
||||
libgdbm-dev \
|
||||
libnss3-dev \
|
||||
libc6-dev
|
||||
|
||||
# Run the container as an unprivileged user
|
||||
RUN groupadd docker && useradd -g docker -s /bin/bash -m docker
|
||||
USER docker
|
||||
WORKDIR /home/docker
|
||||
|
||||
# Install Node.js with nvm
|
||||
ENV NVM_DIR /home/docker/.nvm
|
||||
ENV NODE_VERSION v16.18.0
|
||||
|
||||
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
|
||||
RUN /bin/bash -c "source $NVM_DIR/nvm.sh && nvm install $NODE_VERSION && nvm use --delete-prefix $NODE_VERSION"
|
||||
|
||||
ENV NODE_PATH $NVM_DIR/versions/node/$NODE_VERSION/lib/node_modules
|
||||
ENV PATH $NVM_DIR/versions/node/$NODE_VERSION/bin:$PATH
|
||||
|
||||
# Install Leon
|
||||
WORKDIR /home/docker/leon
|
||||
USER root
|
||||
RUN chown -R docker /home/docker/leon
|
||||
USER docker
|
||||
COPY --chown=docker ./ ./
|
||||
RUN npm install
|
||||
RUN npm run build
|
||||
|
||||
CMD ["npm", "start"]
|
13
README.md
13
README.md
@ -152,19 +152,6 @@ leon start
|
||||
# Hooray! Leon is running
|
||||
```
|
||||
|
||||
### Docker Installation
|
||||
|
||||
```sh
|
||||
# Install Leon
|
||||
leon create birth --docker
|
||||
|
||||
# Run
|
||||
leon start
|
||||
|
||||
# Go to http://localhost:1337
|
||||
# Hooray! Leon is running
|
||||
```
|
||||
|
||||
## 📚 Documentation
|
||||
|
||||
For full documentation, visit [docs.getleon.ai](https://docs.getleon.ai).
|
||||
|
@ -343,7 +343,9 @@ small {
|
||||
padding: 2px 8px;
|
||||
font-size: inherit;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.2s, color 0.2s;
|
||||
transition:
|
||||
background-color 0.2s,
|
||||
color 0.2s;
|
||||
}
|
||||
.suggestion:hover {
|
||||
color: var(--black-color);
|
||||
|
@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
@ -1,5 +1,3 @@
|
||||
import type React from 'react'
|
||||
|
||||
interface Props {
|
||||
children: React.ReactNode
|
||||
}
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { io } from 'socket.io-client'
|
||||
import React from 'react'
|
||||
import { createRoot } from 'react-dom/client'
|
||||
|
||||
import { Button } from './aurora/button'
|
||||
|
@ -14,11 +14,6 @@
|
||||
"exactOptionalPropertyTypes": false,
|
||||
"declaration": true
|
||||
},
|
||||
"ts-node": {
|
||||
"swc": true,
|
||||
"require": ["tsconfig-paths/register"],
|
||||
"files": true
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
||||
|
@ -1,17 +0,0 @@
|
||||
services:
|
||||
leon:
|
||||
container_name: 'leon'
|
||||
build:
|
||||
context: './'
|
||||
image: 'leon-ai/leon'
|
||||
environment:
|
||||
LEON_PORT: ${LEON_PORT:-1337}
|
||||
LEON_PY_TCP_SERVER_HOST: ${LEON_PY_TCP_SERVER_HOST:-0.0.0.0}
|
||||
LEON_PY_TCP_SERVER_PORT: ${LEON_PY_TCP_SERVER_PORT:-1342}
|
||||
stdin_open: true
|
||||
tty: true
|
||||
command: 'npm run dev:server && npm run dev:app'
|
||||
volumes:
|
||||
- './:/home/docker/leon'
|
||||
- '/home/docker/leon/node_modules'
|
||||
network_mode: 'host'
|
@ -1,14 +0,0 @@
|
||||
services:
|
||||
leon:
|
||||
container_name: 'leon'
|
||||
build:
|
||||
context: './'
|
||||
image: 'leon-ai/leon'
|
||||
environment:
|
||||
LEON_PORT: ${LEON_PORT:-1337}
|
||||
LEON_PY_TCP_SERVER_HOST: ${LEON_PY_TCP_SERVER_HOST:-0.0.0.0}
|
||||
LEON_PY_TCP_SERVER_PORT: ${LEON_PY_TCP_SERVER_PORT:-1342}
|
||||
stdin_open: true
|
||||
tty: true
|
||||
command: 'npm run start'
|
||||
network_mode: 'host'
|
@ -3,5 +3,5 @@
|
||||
"watch": ["server/src"],
|
||||
"ext": "ts,js,json",
|
||||
"ignore": [".git", "node_modules", "server/src/tmp", "server/dist"],
|
||||
"exec": "ts-node server/src/index.ts"
|
||||
"exec": "tsx server/src/index.ts"
|
||||
}
|
||||
|
143
package.json
143
package.json
@ -21,23 +21,23 @@
|
||||
"npm": ">=8.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "ts-node scripts/lint.js",
|
||||
"lint": "tsx scripts/lint.js",
|
||||
"test": "npm run test:json && npm run test:over-http && npm run test:unit && npm run test:e2e",
|
||||
"test:unit": "npm run train en && cross-env PIPENV_PIPFILE=bridges/python/src/Pipfile LEON_NODE_ENV=testing jest --forceExit --silent --projects test/unit/unit.jest.json && npm run train",
|
||||
"test:e2e": "npm run test:e2e:nlp-modules && npm run test:e2e:modules",
|
||||
"test:e2e:modules": "ts-node scripts/run-clean-test-dbs.js && npm run train en && cross-env PIPENV_PIPFILE=bridges/python/src/Pipfile LEON_NODE_ENV=testing jest --forceExit --silent --verbose --projects test/e2e/modules/e2e.modules.jest.json && ts-node scripts/run-clean-test-dbs.js && npm run train",
|
||||
"test:e2e:modules": "tsx scripts/run-clean-test-dbs.js && npm run train en && cross-env PIPENV_PIPFILE=bridges/python/src/Pipfile LEON_NODE_ENV=testing jest --forceExit --silent --verbose --projects test/e2e/modules/e2e.modules.jest.json && tsx scripts/run-clean-test-dbs.js && npm run train",
|
||||
"test:e2e:nlp-modules": "npm run train en && cross-env PIPENV_PIPFILE=bridges/python/src/Pipfile LEON_NODE_ENV=testing jest --forceExit --silent --verbose --setupTestFrameworkScriptFile=./test/paths.setup.js test/e2e/nlp-modules.spec.js && npm run train",
|
||||
"test:json": "jest --silent --projects test/json/json.jest.json",
|
||||
"test:over-http": "npm run generate:skills-endpoints && npm run train && cross-env PIPENV_PIPFILE=bridges/python/src/Pipfile LEON_NODE_ENV=testing LEON_HOST=http://localhost LEON_PORT=1338 LEON_HTTP_API_KEY=72aeb5ba324580963114481144385d7179c106fc jest --forceExit --silent --verbose --notify=false --bail --collectCoverage=false test/e2e/over-http.spec.js",
|
||||
"test:module": "ts-node scripts/test-module.js",
|
||||
"setup:offline": "ts-node scripts/setup-offline/setup-offline.js",
|
||||
"setup:offline-stt": "ts-node scripts/setup-offline/run-setup-stt.js",
|
||||
"setup:offline-tts": "ts-node scripts/setup-offline/run-setup-tts.js",
|
||||
"setup:offline-hotword": "ts-node scripts/setup-offline/run-setup-hotword.js",
|
||||
"setup:python-bridge": "ts-node scripts/setup/setup-python-dev-env.js python-bridge",
|
||||
"setup:tcp-server": "ts-node scripts/setup/setup-python-dev-env.js tcp-server",
|
||||
"test:module": "tsx scripts/test-module.js",
|
||||
"setup:offline": "tsx scripts/setup-offline/setup-offline.js",
|
||||
"setup:offline-stt": "tsx scripts/setup-offline/run-setup-stt.js",
|
||||
"setup:offline-tts": "tsx scripts/setup-offline/run-setup-tts.js",
|
||||
"setup:offline-hotword": "tsx scripts/setup-offline/run-setup-hotword.js",
|
||||
"setup:python-bridge": "tsx scripts/setup/setup-python-dev-env.js python-bridge",
|
||||
"setup:tcp-server": "tsx scripts/setup/setup-python-dev-env.js tcp-server",
|
||||
"preinstall": "node scripts/setup/preinstall.js",
|
||||
"postinstall": "ts-node scripts/setup/setup.js",
|
||||
"postinstall": "tsx scripts/setup/setup.js",
|
||||
"dev:app": "vite --config app/vite.config.js",
|
||||
"dev:server": "npm run train && npm run generate:skills-endpoints && cross-env LEON_NODE_ENV=development tsc-watch --noClear --onSuccess \"nodemon\"",
|
||||
"dev:server:no-lint": "npm run train && npm run generate:skills-endpoints && cross-env LEON_NODE_ENV=development \"nodemon\"",
|
||||
@ -45,33 +45,29 @@
|
||||
"delete-dist:server": "shx rm -rf ./server/dist",
|
||||
"clean:python-deps": "shx rm -rf ./bridges/python/src/.venv && npm run postinstall",
|
||||
"prepare": "husky install",
|
||||
"generate:skills-endpoints": "ts-node scripts/generate/run-generate-skills-endpoints.js",
|
||||
"generate:http-api-key": "ts-node scripts/generate/run-generate-http-api-key.js",
|
||||
"generate:json-schemas": "ts-node scripts/generate/run-generate-json-schemas.js",
|
||||
"generate:skills-endpoints": "tsx scripts/generate/run-generate-skills-endpoints.js",
|
||||
"generate:http-api-key": "tsx scripts/generate/run-generate-http-api-key.js",
|
||||
"generate:json-schemas": "tsx scripts/generate/run-generate-json-schemas.js",
|
||||
"build": "npm run build:app && npm run build:server",
|
||||
"build:app": "cross-env LEON_NODE_ENV=production ts-node scripts/app/run-build-app.js",
|
||||
"build:app": "cross-env LEON_NODE_ENV=production tsx scripts/app/run-build-app.js",
|
||||
"build:server": "npm run delete-dist:server && npm run train && npm run generate:skills-endpoints && tsc --project tsconfig.json && resolve-tspaths && shx rm -rf server/dist/core server/dist/package.json && shx mv -f server/dist/server/src/* server/dist && shx rm -rf server/dist/server && shx mkdir -p server/dist/tmp",
|
||||
"build:nodejs-bridge": "ts-node scripts/build-binaries.js nodejs-bridge",
|
||||
"build:python-bridge": "ts-node scripts/build-binaries.js python-bridge",
|
||||
"build:tcp-server": "ts-node scripts/build-binaries.js tcp-server",
|
||||
"build:nodejs-bridge": "tsx scripts/build-binaries.js nodejs-bridge",
|
||||
"build:python-bridge": "tsx scripts/build-binaries.js python-bridge",
|
||||
"build:tcp-server": "tsx scripts/build-binaries.js tcp-server",
|
||||
"start:tcp-server": "cross-env PIPENV_PIPFILE=tcp_server/src/Pipfile pipenv run python tcp_server/src/main.py",
|
||||
"start": "cross-env LEON_NODE_ENV=production node server/dist/pre-check.js && node server/dist/index.js",
|
||||
"python-bridge": "cross-env PIPENV_PIPFILE=bridges/python/src/Pipfile pipenv run python bridges/python/src/main.py server/src/intent-object.sample.json",
|
||||
"train": "ts-node scripts/train/run-train.js",
|
||||
"prepare-release": "ts-node scripts/release/prepare-release.js",
|
||||
"skill-package": "ts-node scripts/skill-package.js",
|
||||
"pre-release:nodejs-bridge": "ts-node scripts/release/pre-release-binaries.js nodejs-bridge",
|
||||
"pre-release:python-bridge": "ts-node scripts/release/pre-release-binaries.js python-bridge",
|
||||
"pre-release:tcp-server": "ts-node scripts/release/pre-release-binaries.js tcp-server",
|
||||
"check": "ts-node scripts/check.js",
|
||||
"docker:build": "docker build -t leon-ai/leon .",
|
||||
"docker:run": "docker compose up",
|
||||
"docker:dev": "docker compose --file=docker-compose.dev.yml up",
|
||||
"docker:check": "docker run --rm --interactive leon-ai/leon npm run check"
|
||||
"train": "tsx scripts/train/run-train.js",
|
||||
"prepare-release": "tsx scripts/release/prepare-release.js",
|
||||
"skill-package": "tsx scripts/skill-package.js",
|
||||
"pre-release:nodejs-bridge": "tsx scripts/release/pre-release-binaries.js nodejs-bridge",
|
||||
"pre-release:python-bridge": "tsx scripts/release/pre-release-binaries.js python-bridge",
|
||||
"pre-release:tcp-server": "tsx scripts/release/pre-release-binaries.js tcp-server",
|
||||
"check": "tsx scripts/check.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-polly": "3.18.0",
|
||||
"@fastify/static": "6.9.0",
|
||||
"@fastify/static": "6.12.0",
|
||||
"@ffmpeg-installer/ffmpeg": "1.1.0",
|
||||
"@ffprobe-installer/ffprobe": "1.4.1",
|
||||
"@google-cloud/speech": "4.2.0",
|
||||
@ -80,19 +76,19 @@
|
||||
"@nlpjs/core-loader": "4.22.7",
|
||||
"@nlpjs/lang-all": "4.22.12",
|
||||
"@nlpjs/nlp": "4.22.17",
|
||||
"@segment/ajv-human-errors": "2.1.2",
|
||||
"@sinclair/typebox": "0.25.8",
|
||||
"ajv": "8.11.0",
|
||||
"@segment/ajv-human-errors": "2.11.3",
|
||||
"@sinclair/typebox": "0.31.23",
|
||||
"ajv": "8.12.0",
|
||||
"ajv-formats": "2.1.1",
|
||||
"archiver": "5.3.1",
|
||||
"async": "3.2.4",
|
||||
"axios": "1.1.2",
|
||||
"archiver": "6.0.1",
|
||||
"async": "3.2.5",
|
||||
"axios": "1.6.2",
|
||||
"cross-env": "7.0.3",
|
||||
"dayjs": "1.11.5",
|
||||
"dotenv": "10.0.0",
|
||||
"execa": "5.0.0",
|
||||
"dayjs": "1.11.10",
|
||||
"dotenv": "16.3.1",
|
||||
"execa": "5.1.1",
|
||||
"extract-zip": "2.0.1",
|
||||
"fastify": "4.15.0",
|
||||
"fastify": "4.24.3",
|
||||
"fluent-ffmpeg": "2.1.2",
|
||||
"getos": "3.2.1",
|
||||
"googleapis": "67.1.1",
|
||||
@ -103,50 +99,49 @@
|
||||
"pretty-ms": "7.0.1",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"socket.io": "4.5.2",
|
||||
"socket.io-client": "4.5.2",
|
||||
"socket.io": "4.7.2",
|
||||
"socket.io-client": "4.7.2",
|
||||
"stt": "1.4.0",
|
||||
"tree-kill": "1.2.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nlpjs/utils": "4.24.1",
|
||||
"@swc/core": "1.3.14",
|
||||
"@tsconfig/node16-strictest": "1.0.4",
|
||||
"@types/archiver": "5.3.2",
|
||||
"@types/cli-spinner": "0.2.1",
|
||||
"@types/fluent-ffmpeg": "2.1.20",
|
||||
"@types/getos": "3.0.1",
|
||||
"@types/node": "18.7.13",
|
||||
"@types/node-wav": "0.0.0",
|
||||
"@types/react": "18.2.6",
|
||||
"@types/react-dom": "18.2.4",
|
||||
"@typescript-eslint/eslint-plugin": "5.55.0",
|
||||
"@typescript-eslint/parser": "5.55.0",
|
||||
"@vercel/ncc": "0.36.1",
|
||||
"@vitejs/plugin-react": "4.0.0",
|
||||
"@tsconfig/node16": "16.1.1",
|
||||
"@tsconfig/strictest": "2.0.2",
|
||||
"@types/archiver": "6.0.1",
|
||||
"@types/cli-spinner": "0.2.3",
|
||||
"@types/fluent-ffmpeg": "2.1.24",
|
||||
"@types/getos": "3.0.4",
|
||||
"@types/node": "20.9.0",
|
||||
"@types/node-wav": "0.0.2",
|
||||
"@types/react": "18.2.37",
|
||||
"@types/react-dom": "18.2.15",
|
||||
"@typescript-eslint/eslint-plugin": "6.11.0",
|
||||
"@typescript-eslint/parser": "6.11.0",
|
||||
"@vercel/ncc": "0.38.1",
|
||||
"@vitejs/plugin-react": "4.1.1",
|
||||
"cli-spinner": "0.2.10",
|
||||
"eslint": "8.22.0",
|
||||
"eslint-config-prettier": "8.5.0",
|
||||
"eslint-import-resolver-typescript": "3.5.1",
|
||||
"eslint-plugin-import": "2.26.0",
|
||||
"eslint-plugin-unicorn": "43.0.2",
|
||||
"eslint": "8.53.0",
|
||||
"eslint-config-prettier": "9.0.0",
|
||||
"eslint-import-resolver-typescript": "3.6.1",
|
||||
"eslint-plugin-import": "npm:eslint-plugin-i@2.29.0",
|
||||
"eslint-plugin-unicorn": "49.0.0",
|
||||
"git-changelog": "2.0.0",
|
||||
"husky": "7.0.0",
|
||||
"inquirer": "8.1.0",
|
||||
"husky": "8.0.3",
|
||||
"inquirer": "8.2.3",
|
||||
"jest": "27.4.7",
|
||||
"jest-canvas-mock": "2.3.1",
|
||||
"jest-extended": "2.0.0",
|
||||
"json": "10.0.0",
|
||||
"lint-staged": "13.0.3",
|
||||
"nodemon": "2.0.19",
|
||||
"prettier": "2.8.7",
|
||||
"resolve-tspaths": "0.8.8",
|
||||
"semver": "7.3.5",
|
||||
"shx": "0.3.3",
|
||||
"ts-node": "10.9.1",
|
||||
"tsc-watch": "6.0.0",
|
||||
"tsconfig-paths": "4.1.2",
|
||||
"typescript": "5.0.2",
|
||||
"vite": "4.3.5"
|
||||
"json": "11.0.0",
|
||||
"lint-staged": "15.1.0",
|
||||
"nodemon": "3.0.1",
|
||||
"prettier": "3.1.0",
|
||||
"resolve-tspaths": "0.8.17",
|
||||
"semver": "7.5.4",
|
||||
"shx": "0.3.4",
|
||||
"tsc-watch": "6.0.4",
|
||||
"tsx": "4.1.2",
|
||||
"typescript": "5.2.2",
|
||||
"vite": "4.5.0"
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ import { LogHelper } from '@/helpers/log-helper'
|
||||
'utf8'
|
||||
)
|
||||
const regex =
|
||||
'(build|BREAKING|chore|ci|docs|feat|fix|perf|refactor|style|test)(\\((web app|scripts|docker|server|hotword|tcp server|bridge\\/(python|nodejs)|skill\\/([\\w-]+)))?\\)?: .{1,50}'
|
||||
'(build|BREAKING|chore|ci|docs|feat|fix|perf|refactor|style|test)(\\((web app|scripts|server|hotword|tcp server|bridge\\/(python|nodejs)|skill\\/([\\w-]+)))?\\)?: .{1,50}'
|
||||
|
||||
if (commitMessage.match(regex) !== null) {
|
||||
LogHelper.success('Commit message validated')
|
||||
|
@ -76,10 +76,10 @@ export const PYTHON_BRIDGE_BIN_PATH = path.join(
|
||||
export const NODEJS_BRIDGE_BIN_PATH = `${path.join(
|
||||
process.cwd(),
|
||||
'node_modules',
|
||||
'ts-node',
|
||||
'tsx',
|
||||
'dist',
|
||||
'bin.js'
|
||||
)} --swc ${path.join(NODEJS_BRIDGE_DIST_PATH, 'bin', NODEJS_BRIDGE_BIN_NAME)}`
|
||||
'cli.mjs'
|
||||
)} ${path.join(NODEJS_BRIDGE_DIST_PATH, 'bin', NODEJS_BRIDGE_BIN_NAME)}`
|
||||
|
||||
export const LEON_VERSION = process.env['npm_package_version']
|
||||
|
||||
|
@ -30,7 +30,10 @@ export default class HTTPServer {
|
||||
|
||||
public httpServer = this.fastify.server
|
||||
|
||||
constructor(public readonly host: string, public readonly port: number) {
|
||||
constructor(
|
||||
public readonly host: string,
|
||||
public readonly port: number
|
||||
) {
|
||||
if (!HTTPServer.instance) {
|
||||
LogHelper.title('HTTP Server')
|
||||
LogHelper.success('New instance')
|
||||
|
@ -33,7 +33,10 @@ export default class TCPClient {
|
||||
return this.tcpSocket.readyState
|
||||
}
|
||||
|
||||
constructor(private readonly host: string, private readonly port: number) {
|
||||
constructor(
|
||||
private readonly host: string,
|
||||
private readonly port: number
|
||||
) {
|
||||
if (!TCPClient.instance) {
|
||||
LogHelper.title('TCP Client')
|
||||
LogHelper.success('New instance')
|
||||
|
@ -1,4 +1,3 @@
|
||||
import type { Stream } from 'node:stream'
|
||||
import path from 'node:path'
|
||||
import fs from 'node:fs'
|
||||
|
||||
@ -64,7 +63,7 @@ export default class WatsonTTSSynthesizer extends TTSSynthesizerBase {
|
||||
text: speech,
|
||||
accept: 'audio/wav'
|
||||
})
|
||||
const result = response.result as Stream
|
||||
const result = response.result as NodeJS.ReadableStream
|
||||
|
||||
const wStream = fs.createWriteStream(audioFilePath)
|
||||
result.pipe(wStream)
|
||||
|
@ -18,7 +18,7 @@ export class LoaderHelper {
|
||||
private static spinner = new Spinner('\x1b[95m%s\x1b[0m\r').setSpinnerString(
|
||||
18
|
||||
)
|
||||
private static interval: NodeJS.Timer | undefined
|
||||
private static interval: NodeJS.Timeout | undefined
|
||||
|
||||
/**
|
||||
* Start the loader
|
||||
|
@ -36,9 +36,7 @@ export class SkillDomainHelper {
|
||||
const skillDomains = new Map<string, SkillDomain>()
|
||||
|
||||
await Promise.all(
|
||||
(
|
||||
await fs.promises.readdir(SKILLS_PATH)
|
||||
).map(async (entity) => {
|
||||
(await fs.promises.readdir(SKILLS_PATH)).map(async (entity) => {
|
||||
const domainPath = path.join(SKILLS_PATH, entity)
|
||||
|
||||
if ((await fs.promises.stat(domainPath)).isDirectory()) {
|
||||
|
@ -48,9 +48,12 @@ import { LogHelper } from '@/helpers/log-helper'
|
||||
Telemetry.error(lastError)
|
||||
})
|
||||
|
||||
setInterval(() => {
|
||||
Telemetry.heartbeat()
|
||||
}, 1_000 * 3_600 * 6)
|
||||
setInterval(
|
||||
() => {
|
||||
Telemetry.heartbeat()
|
||||
},
|
||||
1_000 * 3_600 * 6
|
||||
)
|
||||
;[
|
||||
'exit',
|
||||
'SIGINT',
|
||||
|
@ -1,12 +1,13 @@
|
||||
{
|
||||
"extends": "@tsconfig/node16-strictest/tsconfig.json",
|
||||
"extends": ["@tsconfig/strictest/tsconfig", "@tsconfig/node16/tsconfig"],
|
||||
"compilerOptions": {
|
||||
"moduleResolution": "Node",
|
||||
"module": "CommonJS",
|
||||
"paths": {
|
||||
"@@/*": ["../*"],
|
||||
"@/*": ["../server/src/*"],
|
||||
"@bridge/*": ["../bridges/nodejs/src/*"],
|
||||
"@sdk/*": ["../bridges/nodejs/src/sdk/*"]
|
||||
},
|
||||
"ignoreDeprecations": "5.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,26 +1,22 @@
|
||||
{
|
||||
"extends": "@tsconfig/node16-strictest/tsconfig.json",
|
||||
"extends": ["@tsconfig/strictest/tsconfig", "@tsconfig/node16/tsconfig"],
|
||||
"compilerOptions": {
|
||||
"rootDir": ".",
|
||||
"outDir": "./server/dist",
|
||||
"baseUrl": ".",
|
||||
"moduleResolution": "Node",
|
||||
"module": "CommonJS",
|
||||
"paths": {
|
||||
"@@/*": ["./*"],
|
||||
"@/*": ["./server/src/*"],
|
||||
"@bridge/*": ["./bridges/nodejs/src/*"],
|
||||
"@sdk/*": ["./bridges/nodejs/src/sdk/*"]
|
||||
},
|
||||
"ignoreDeprecations": "5.0",
|
||||
"allowJs": true,
|
||||
"checkJs": false,
|
||||
"resolveJsonModule": true,
|
||||
"declaration": true
|
||||
},
|
||||
"ts-node": {
|
||||
"swc": true,
|
||||
"require": ["tsconfig-paths/register"],
|
||||
"files": true
|
||||
},
|
||||
"files": ["server/src/global.d.ts"],
|
||||
"include": ["server/src/**/*"],
|
||||
"exclude": ["node_modules", "server/dist", "bridges", "tcp_server"]
|
||||
|
Loading…
Reference in New Issue
Block a user