diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000..1b7b25bbb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,32 @@ +--- +name: Bug report +about: Report a bug with the software (this is NOT for cases of "it's not working + for me") +title: "[BUG] " +labels: bug, help wanted +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Device you are running wire-pod on (please complete the following information):** + - OS: [e.g. Debian, Windows] + - Hardware: [e.g. Raspberry Pi] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/problem-with-setup.md b/.github/ISSUE_TEMPLATE/problem-with-setup.md new file mode 100644 index 000000000..cd82d08e2 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/problem-with-setup.md @@ -0,0 +1,19 @@ +--- +name: Problem with setup +about: Please follow this template if you are having issues setting wire-pod up. I + (kercre123) will not be providing support for these. +title: "[HELP] " +labels: '' +assignees: '' + +--- + +**Describe the issue:** + +**What are you running wire-pod on?** + - [OS]: (ex. Windows, Debian) + - [Hardware]: (ex. Raspberry Pi) + +**Are you setting up a prod (regular) bot or a dev/OSKR (unlocked) bot?** + +**What steps have you tried?** diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 000000000..7c8c425c4 --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,99 @@ +name: Docker + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +on: + schedule: + - cron: '25 22 * * *' + push: + branches: [ "main" ] + # Publish semver tags as releases. + tags: [ 'v*.*.*' ] + pull_request: + branches: [ "main" ] + +env: + # Use docker.io for Docker Hub if empty + REGISTRY: ghcr.io + # github.repository as / + IMAGE_NAME: ${{ github.repository }} + + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + # This is used to complete the identity challenge + # with sigstore/fulcio when running outside of PRs. + id-token: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Install the cosign tool except on PR + # https://github.com/sigstore/cosign-installer + - name: Install cosign + if: github.event_name != 'pull_request' + uses: sigstore/cosign-installer@v3.3.0 + with: + cosign-release: 'v2.2.2' # optional + + # Set up BuildKit Docker container builder to be able to build + # multi-platform images and export cache + # https://github.com/docker/setup-buildx-action + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 + + # Login against a Docker registry except on PR + # https://github.com/docker/login-action + - name: Log into registry ${{ env.REGISTRY }} + if: github.event_name != 'pull_request' + uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # Extract metadata (tags, labels) for Docker + # https://github.com/docker/metadata-action + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + # Build and push Docker image with Buildx (don't push on PR) + # https://github.com/docker/build-push-action + - name: Build and push Docker image + id: build-and-push + uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + platforms: linux/amd64,linux/arm64 + + # Sign the resulting Docker image digest except on PRs. + # This will only write to the public Rekor transparency log when the Docker + # repository is public to avoid leaking data. If you would like to publish + # transparency data even for private images, pass --force to cosign below. + # https://github.com/sigstore/cosign + - name: Sign the published Docker image + if: ${{ github.event_name != 'pull_request' }} + env: + # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable + TAGS: ${{ steps.meta.outputs.tags }} + DIGEST: ${{ steps.build-and-push.outputs.digest }} + # This step uses the identity token to provision an ephemeral certificate + # against the sigstore community Fulcio instance. + run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST} diff --git a/.gitignore b/.gitignore index 27d278b90..ecfea84fc 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,34 @@ /chipper/armarch /chipper/processOnce /ssh_root_key +/.vscode +/chipper/botConfig.json +/chipper/.vscode +/chipper/useepod +/chipper/pico.key +/chipper/libvosk.so +/vosk +/chipper/customIntents.json +/chipper/botConfig.json +/chipper/jdocs/*.json +/chipper/nvm +/chipper/apiConfig.json +/chipper/session-certs/0* +/chipper/vbuild/vic-toolchain +/chipper/vbuild/chipper +/chipper/vbuild/botpack.tar.gz +/chipper/windows/tmp +/chipper/windows/chipper.exe +/chipper/windows/*.zip +/chipper/windows/*.exe +/chipper/vbuild/built-libs +/chipper/windows/libs +/chipper/windows/opus +/chipper/windows/ogg +/chipper/windows/.aptDone +/chipper/macos/libs +/chipper/macos/target +/chipper/plugins/*.so +/whisper.cpp +.DS_Store +/chipper/openaiChats.json diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..98273cc0c --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Kerigan Creighton + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 8a0a4b77d..5cba9062e 100755 --- a/README.md +++ b/README.md @@ -1,189 +1,28 @@ -# wire-pod - -This repo contains a custom Vector escape pod made from [chipper](https://github.com/digital-dream-labs/chipper) and [vector-cloud](https://github.com/digital-dream-labs/vector-cloud). - -## Program Descriptions - -`chipper` - Chipper is a program used on Digital Dream Lab's servers which takes in a Vector's voice stream, puts it into a speech-to-text processor, and spits out an intent. This is also likely used on the official escape pod. This repo contains an older tree of chipper which does not have the "intent graph" feature (it caused an error upon every new stream), and it now has a working voice processor. - -`vector-cloud` - Vector-cloud is the program which runs on Vector himself which uploads the mic stream to a chipper instance. This repo has an older tree of vector-cloud which also does not have the "intent graph" feature and has been modified to allow for a custom CA cert. - -## System Requirements - -A CPU with AVX support is required. Check [https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#CPUs_with_AVX](https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#CPUs_with_AVX) - -## Configuring, Building, Installing - -NOTE: This only works with OSKR-unlocked, Dev-unlocked, or Whiskey robots. - -### Linux - -(This currently only works on Arch or Debian-based Linux) - -``` -git clone https://github.com/kercre123/wire-pod.git -cd wire-pod -sudo ./setup.sh - -# You should be able to just press enter for all of the settings -``` - -Now install the files created by the script onto the bot: - -`sudo ./setup.sh scp ` - -Example: - -`sudo ./setup.sh scp 192.168.1.150 /home/wire/id_rsa_Vector-R2D2` - -If you are on my custom software (WireOS), you do not have to provide an SSH key, - -Example: - -`sudo ./setup.sh scp 192.168.1.150` - -The bot should now be configured to communicate with your server. - -To start chipper, run: - -``` -cd chipper -sudo ./start.sh -``` - -### Windows - -1. Install WSL (Windows Subsystem for Linux) - - Open Powershell - - Run `wsl --install` - - Reboot the system - - Run `wsl --install -d Ubuntu-20.04` - - Open up Ubuntu 20.04 in start menu and configure it like it says. -2. Find IP address - - Open Powershell - - Run `ipconfig` - - Find your computer's IPv4 address and note it somewhere. It usually starts with 10.0. or 192.168. -3. Install wire-pod - - Follow the Linux instructions from above - - Enter the IP you got from `ipconfig` earlier instead of the one provided by setup.sh - - Use the default port and do not enter a different one -4. Setup firewall rules - - Open Powershell - - Run `Set-ExecutionPolicy` - - When it asks, enter `Bypass` - - Download [this file](https://wire.my.to/wsl-firewall.ps1) - - Go to your Downloads folder in File Explorer and Right Click -> Run as administrator - - -After all of that, try a voice command. - -## Status - -OS Support: - -- Arch -- Debian/Ubuntu/other APT distros - -Architecture Support: - -- amd64/x86_64 -- arm64/aarch64 -- arm32/armv7l - -Things jank-escape-pod Has Worked On: - -- Raspberry Pi 4B+ 4GB RAM with Raspberry Pi OS - - Doesn't matter if it is 32-bit or 64-bit -- Raspberry Pi 4B+ 4GB RAM with Manjaro 22.04 -- Nintendo Switch with L4T Ubuntu -- Desktop with Ryzen 5 3600, 16 GB RAM with Ubuntu 22.04 -- Laptop with mobile i7 -- Android Devices - - Pixel 4, Note 4, Razer Phone, Oculus Quest 2, OnePlus 7 Pro, Moto G6, Pixel 2 - - [Termux](https://github.com/termux/termux-app) proot-distro: Use Ubuntu, make sure to use a port above 1024 and not the default 443. - - Linux Deploy: Works stock, just make sure to choose the arch that matches your device in settings. Also use a bigger image size, at least 3 GB. - -General Notes: - -- If the architecture is AMD64, the text is processed 4 times so longer phrases get processed fully. Text is only processed once on arm32/arm64 for speed and reliability. - - If you are running ARM and you feel like your system is fast enough for regular STT processing, 'sudo rm -f ./chipper/slowsys' - - If you are running AMD64 and you feel like your system is too slow for regular STT processing, `touch ./chipper/slowsys' -- If you get this error when running chipper, you are using a port that is being taken up by a program already: `panic: runtime error: invalid memory address or nil pointer dereference` - - Run `./setup.sh` with the 5th and 6th option to change the port, you will need to push files to the bot again. -- If you want to disable logging from the voice processor, recompile chipper with `debugLogging` in ./chipper/pkg/voice_processors/noop/intent.go set to `false`. -- Some weather conditions don't match the bot's internal response map, so sometimes Vector won't be able to give you the weather until I make my own response map. -- You have to speak a little slower than normal for Coqui STT to understand you. - -Known Issues: - -- ARM processing is slow until I find a good way to deal with the end of speech on (comparatively) slow hardware. - -Current Implemented Actions: - -- Good robot -- Bad robot -- Change your eye color -- Change your eye color to - - blue, purple, teal, green, yellow -- How old are you -- Start exploring ("deploring" works better) -- Go home (or "go to your charger") -- Go to sleep -- Good morning -- Good night -- What time is it -- Goodbye -- Happy new year -- Happy holidays -- Hello -- Sign in alexa -- Sign out alexa -- I love you -- Move forward -- Turn left -- Turn right -- Roll your cube -- Pop a wheelie -- Fistbump -- Blackjack (say yes/no instead of hit/stand) -- Yes (affirmative) -- No (negative) -- What's my name -- Take a photo -- Take a photo of me -- What's the weather - - Requires API setup -- What's the weather in - - Requires API setup -- Im sorry -- Back up -- Come here -- Volume down -- Be quiet -- Volume up -- Look at me -- Set the volume to - - High, medium high, medium, medium low, low -- Shut up -- My name is -- I have a question - - Placeholder text -- Set a timer for