├── .env.example ├── .gitignore ├── LICENSE ├── README.md ├── index.js ├── package-lock.json ├── package.json └── test.js /.env.example: -------------------------------------------------------------------------------- 1 | OPENAI_API_KEY=YOUR_OPENAI_API_KEY_GOES_HERE -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.test 74 | 75 | # parcel-bundler cache (https://parceljs.org/) 76 | .cache 77 | 78 | # Next.js build output 79 | .next 80 | 81 | # Nuxt.js build / generate output 82 | .nuxt 83 | dist 84 | 85 | # Gatsby files 86 | .cache/ 87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 88 | # https://nextjs.org/blog/next-9-1#public-directory-support 89 | # public 90 | 91 | # vuepress build output 92 | .vuepress/dist 93 | 94 | # Serverless directories 95 | .serverless/ 96 | 97 | # FuseBox cache 98 | .fusebox/ 99 | 100 | # DynamoDB Local files 101 | .dynamodb/ 102 | 103 | # TernJS port file 104 | .tern-port 105 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Dennis Baldwin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Notes 2 | 3 | Tested with Node v18.12.1 4 | 5 | Requires an OpenAPI API key 6 | 7 | Requires two network adapters so you can connect to Go1 and the ChatGPT API at the same time. 8 | 9 | # Get up and running 10 | 11 | - npm i 12 | - cp .env.example .env 13 | - Update OPENAI_API_KEY with your key 14 | - Power up Go1 15 | - Connect to Go1's wifi from your second adapter 16 | - node index.js 17 | - Ask it some cool questions! 18 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import { createInterface } from "node:readline/promises"; 2 | import { stdin as input, stdout as output, env } from "node:process"; 3 | import { Configuration, OpenAIApi } from "openai"; 4 | import * as dotenv from "dotenv" 5 | dotenv.config(); 6 | 7 | import { Go1, Go1Mode } from "@droneblocks/go1-js" 8 | 9 | const configuration = new Configuration({ apiKey: process.env.OPENAI_API_KEY }); 10 | const openai = new OpenAIApi(configuration); 11 | const readline = createInterface({ input, output }); 12 | 13 | let dog = new Go1(); 14 | dog.init(); 15 | 16 | const extractJSCode = (content) => { 17 | const regex = /```([^\n]*)\n([\s\S]*?)```/g; 18 | const match = regex.exec(content) 19 | const language = match[1].trim(); // For this example will always be "javascript" 20 | const codeBlock = match[2].trim(); 21 | return codeBlock 22 | } 23 | 24 | const chatPrompt = `You are an assistant that is helping me control the Unitree Go1 quadruped robot dog. All programming of the robot will be done with the @droneblocks/go-1js node library. 25 | 26 | I've already taken care of importing the library and created an instance of the class called dog. The method definitions for moving Go1 are defined here: 27 | 28 | goForward(speed: number, lengthOfTime: number) 29 | goBackward(speed: number, lengthOfTime: number) 30 | goLeft(speed: number, lengthOfTime: number) 31 | goRight(speed: number, lengthOfTime: number) 32 | turnLeft(speed: number, lengthOfTime: number) 33 | turnRight(speed: number, lengthOfTime: number) 34 | 35 | All methods accept two arguments the first is speed with a value from 0 to 1 where 1 is full speed. The second argument is a duration in milliseconds. 36 | 37 | Also, please keep in mind that before we can move Go1 we need to make sure to set it's mode to Go1Mode.walk. 38 | 39 | There is a wait method in cases where we want to pause between commands. It accepts a number in milliseconds: 40 | 41 | wait(lengthOfTime: number) 42 | 43 | Please make sure that all wait commands are awaited. 44 | 45 | There are also stances such as beg, which the method definition looks like this: 46 | 47 | setMode(Go1Mode.straightHand1) 48 | 49 | For the dog to lay down we use the following command: 50 | 51 | setMode(Go1Mode.standDown) 52 | 53 | and to stand up we use 54 | 55 | setMode(Go1Mode.standUp) 56 | 57 | You can also change the LEDs of the robot dog using the following: 58 | 59 | setLedColor(red: number, green: number, blue: number) 60 | 61 | Where red, green, and blue are integers between 0 and 255. 62 | 63 | There is a known issue with the robot's hardware where blinking the LED must always have a 2 second delay between colors. 64 | 65 | ` 66 | 67 | const messages = [{ role: "system", content: chatPrompt }]; 68 | let userInput = await readline.question("Welcome to the Go1 chatbot. Please feel free to ask it for code to control your robot!\n>"); 69 | let botMessage; 70 | 71 | while (userInput !== ".quit") { 72 | 73 | if (userInput == "rerun") { 74 | console.log("rerun"); 75 | break; 76 | } 77 | 78 | messages.push({ role: "user", content: userInput }); 79 | 80 | try { 81 | const response = await openai.createChatCompletion({ 82 | messages, 83 | model: "gpt-3.5-turbo", 84 | }); 85 | 86 | botMessage = response.data.choices[0].message; 87 | 88 | if (botMessage) { 89 | messages.push(botMessage) 90 | 91 | console.log(botMessage.content) 92 | 93 | // Let the user review the code before executing the program 94 | let confirmCode = await readline.question("Does the code look good to run? (y/n)") 95 | 96 | if (confirmCode == "y") { 97 | 98 | let program = await eval(extractJSCode(botMessage.content)) 99 | 100 | } else { 101 | console.log("Sorry. Please specify more details.\n") 102 | } 103 | 104 | userInput = await readline.question("\nFeel free to ask another question:\n>") 105 | 106 | } else { 107 | userInput = await readline.question("\nNo response, try asking again\n"); 108 | } 109 | } catch (error) { 110 | console.log(error.message); 111 | userInput = await readline.question( 112 | "\nSomething went wrong, try asking again\n" 113 | ); 114 | } 115 | } 116 | 117 | readline.close(); 118 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "unitree-go1-nodejs-chatgpt", 3 | "version": "1.0.0", 4 | "lockfileVersion": 2, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "unitree-go1-nodejs-chatgpt", 9 | "version": "1.0.0", 10 | "license": "ISC", 11 | "dependencies": { 12 | "@droneblocks/go1-js": "^0.1.2", 13 | "dotenv": "^16.0.3", 14 | "openai": "^3.2.1" 15 | } 16 | }, 17 | "node_modules/@droneblocks/go1-js": { 18 | "version": "0.1.2", 19 | "resolved": "https://registry.npmjs.org/@droneblocks/go1-js/-/go1-js-0.1.2.tgz", 20 | "integrity": "sha512-dhoqkJ8NhOiKjGoAqa9z8LkCFcqVqUuFh4NmSrrXAsvKdHV4OCd1PXf6PUxB6cozalXKZhUMAOo6QcQB1UjMOQ==", 21 | "dependencies": { 22 | "mqtt": "^4.3.7" 23 | } 24 | }, 25 | "node_modules/asynckit": { 26 | "version": "0.4.0", 27 | "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", 28 | "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" 29 | }, 30 | "node_modules/axios": { 31 | "version": "0.26.1", 32 | "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz", 33 | "integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==", 34 | "dependencies": { 35 | "follow-redirects": "^1.14.8" 36 | } 37 | }, 38 | "node_modules/balanced-match": { 39 | "version": "1.0.2", 40 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", 41 | "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" 42 | }, 43 | "node_modules/base64-js": { 44 | "version": "1.5.1", 45 | "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", 46 | "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", 47 | "funding": [ 48 | { 49 | "type": "github", 50 | "url": "https://github.com/sponsors/feross" 51 | }, 52 | { 53 | "type": "patreon", 54 | "url": "https://www.patreon.com/feross" 55 | }, 56 | { 57 | "type": "consulting", 58 | "url": "https://feross.org/support" 59 | } 60 | ] 61 | }, 62 | "node_modules/bl": { 63 | "version": "4.1.0", 64 | "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", 65 | "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", 66 | "dependencies": { 67 | "buffer": "^5.5.0", 68 | "inherits": "^2.0.4", 69 | "readable-stream": "^3.4.0" 70 | } 71 | }, 72 | "node_modules/brace-expansion": { 73 | "version": "1.1.11", 74 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 75 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 76 | "dependencies": { 77 | "balanced-match": "^1.0.0", 78 | "concat-map": "0.0.1" 79 | } 80 | }, 81 | "node_modules/buffer": { 82 | "version": "5.7.1", 83 | "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", 84 | "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", 85 | "funding": [ 86 | { 87 | "type": "github", 88 | "url": "https://github.com/sponsors/feross" 89 | }, 90 | { 91 | "type": "patreon", 92 | "url": "https://www.patreon.com/feross" 93 | }, 94 | { 95 | "type": "consulting", 96 | "url": "https://feross.org/support" 97 | } 98 | ], 99 | "dependencies": { 100 | "base64-js": "^1.3.1", 101 | "ieee754": "^1.1.13" 102 | } 103 | }, 104 | "node_modules/buffer-from": { 105 | "version": "1.1.2", 106 | "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", 107 | "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" 108 | }, 109 | "node_modules/combined-stream": { 110 | "version": "1.0.8", 111 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", 112 | "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", 113 | "dependencies": { 114 | "delayed-stream": "~1.0.0" 115 | }, 116 | "engines": { 117 | "node": ">= 0.8" 118 | } 119 | }, 120 | "node_modules/commist": { 121 | "version": "1.1.0", 122 | "resolved": "https://registry.npmjs.org/commist/-/commist-1.1.0.tgz", 123 | "integrity": "sha512-rraC8NXWOEjhADbZe9QBNzLAN5Q3fsTPQtBV+fEVj6xKIgDgNiEVE6ZNfHpZOqfQ21YUzfVNUXLOEZquYvQPPg==", 124 | "dependencies": { 125 | "leven": "^2.1.0", 126 | "minimist": "^1.1.0" 127 | } 128 | }, 129 | "node_modules/concat-map": { 130 | "version": "0.0.1", 131 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 132 | "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" 133 | }, 134 | "node_modules/concat-stream": { 135 | "version": "2.0.0", 136 | "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", 137 | "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", 138 | "engines": [ 139 | "node >= 6.0" 140 | ], 141 | "dependencies": { 142 | "buffer-from": "^1.0.0", 143 | "inherits": "^2.0.3", 144 | "readable-stream": "^3.0.2", 145 | "typedarray": "^0.0.6" 146 | } 147 | }, 148 | "node_modules/debug": { 149 | "version": "4.3.4", 150 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", 151 | "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", 152 | "dependencies": { 153 | "ms": "2.1.2" 154 | }, 155 | "engines": { 156 | "node": ">=6.0" 157 | }, 158 | "peerDependenciesMeta": { 159 | "supports-color": { 160 | "optional": true 161 | } 162 | } 163 | }, 164 | "node_modules/delayed-stream": { 165 | "version": "1.0.0", 166 | "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", 167 | "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", 168 | "engines": { 169 | "node": ">=0.4.0" 170 | } 171 | }, 172 | "node_modules/dotenv": { 173 | "version": "16.0.3", 174 | "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", 175 | "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==", 176 | "engines": { 177 | "node": ">=12" 178 | } 179 | }, 180 | "node_modules/duplexify": { 181 | "version": "4.1.2", 182 | "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.2.tgz", 183 | "integrity": "sha512-fz3OjcNCHmRP12MJoZMPglx8m4rrFP8rovnk4vT8Fs+aonZoCwGg10dSsQsfP/E62eZcPTMSMP6686fu9Qlqtw==", 184 | "dependencies": { 185 | "end-of-stream": "^1.4.1", 186 | "inherits": "^2.0.3", 187 | "readable-stream": "^3.1.1", 188 | "stream-shift": "^1.0.0" 189 | } 190 | }, 191 | "node_modules/end-of-stream": { 192 | "version": "1.4.4", 193 | "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", 194 | "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", 195 | "dependencies": { 196 | "once": "^1.4.0" 197 | } 198 | }, 199 | "node_modules/follow-redirects": { 200 | "version": "1.15.2", 201 | "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", 202 | "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", 203 | "funding": [ 204 | { 205 | "type": "individual", 206 | "url": "https://github.com/sponsors/RubenVerborgh" 207 | } 208 | ], 209 | "engines": { 210 | "node": ">=4.0" 211 | }, 212 | "peerDependenciesMeta": { 213 | "debug": { 214 | "optional": true 215 | } 216 | } 217 | }, 218 | "node_modules/form-data": { 219 | "version": "4.0.0", 220 | "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", 221 | "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", 222 | "dependencies": { 223 | "asynckit": "^0.4.0", 224 | "combined-stream": "^1.0.8", 225 | "mime-types": "^2.1.12" 226 | }, 227 | "engines": { 228 | "node": ">= 6" 229 | } 230 | }, 231 | "node_modules/fs.realpath": { 232 | "version": "1.0.0", 233 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 234 | "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" 235 | }, 236 | "node_modules/glob": { 237 | "version": "7.2.3", 238 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", 239 | "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", 240 | "dependencies": { 241 | "fs.realpath": "^1.0.0", 242 | "inflight": "^1.0.4", 243 | "inherits": "2", 244 | "minimatch": "^3.1.1", 245 | "once": "^1.3.0", 246 | "path-is-absolute": "^1.0.0" 247 | }, 248 | "engines": { 249 | "node": "*" 250 | }, 251 | "funding": { 252 | "url": "https://github.com/sponsors/isaacs" 253 | } 254 | }, 255 | "node_modules/help-me": { 256 | "version": "3.0.0", 257 | "resolved": "https://registry.npmjs.org/help-me/-/help-me-3.0.0.tgz", 258 | "integrity": "sha512-hx73jClhyk910sidBB7ERlnhMlFsJJIBqSVMFDwPN8o2v9nmp5KgLq1Xz1Bf1fCMMZ6mPrX159iG0VLy/fPMtQ==", 259 | "dependencies": { 260 | "glob": "^7.1.6", 261 | "readable-stream": "^3.6.0" 262 | } 263 | }, 264 | "node_modules/ieee754": { 265 | "version": "1.2.1", 266 | "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", 267 | "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", 268 | "funding": [ 269 | { 270 | "type": "github", 271 | "url": "https://github.com/sponsors/feross" 272 | }, 273 | { 274 | "type": "patreon", 275 | "url": "https://www.patreon.com/feross" 276 | }, 277 | { 278 | "type": "consulting", 279 | "url": "https://feross.org/support" 280 | } 281 | ] 282 | }, 283 | "node_modules/inflight": { 284 | "version": "1.0.6", 285 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 286 | "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", 287 | "dependencies": { 288 | "once": "^1.3.0", 289 | "wrappy": "1" 290 | } 291 | }, 292 | "node_modules/inherits": { 293 | "version": "2.0.4", 294 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 295 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 296 | }, 297 | "node_modules/js-sdsl": { 298 | "version": "4.3.0", 299 | "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.3.0.tgz", 300 | "integrity": "sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==", 301 | "funding": { 302 | "type": "opencollective", 303 | "url": "https://opencollective.com/js-sdsl" 304 | } 305 | }, 306 | "node_modules/leven": { 307 | "version": "2.1.0", 308 | "resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz", 309 | "integrity": "sha512-nvVPLpIHUxCUoRLrFqTgSxXJ614d8AgQoWl7zPe/2VadE8+1dpU3LBhowRuBAcuwruWtOdD8oYC9jDNJjXDPyA==", 310 | "engines": { 311 | "node": ">=0.10.0" 312 | } 313 | }, 314 | "node_modules/lru-cache": { 315 | "version": "6.0.0", 316 | "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", 317 | "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", 318 | "dependencies": { 319 | "yallist": "^4.0.0" 320 | }, 321 | "engines": { 322 | "node": ">=10" 323 | } 324 | }, 325 | "node_modules/mime-db": { 326 | "version": "1.52.0", 327 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", 328 | "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", 329 | "engines": { 330 | "node": ">= 0.6" 331 | } 332 | }, 333 | "node_modules/mime-types": { 334 | "version": "2.1.35", 335 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", 336 | "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", 337 | "dependencies": { 338 | "mime-db": "1.52.0" 339 | }, 340 | "engines": { 341 | "node": ">= 0.6" 342 | } 343 | }, 344 | "node_modules/minimatch": { 345 | "version": "3.1.2", 346 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", 347 | "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", 348 | "dependencies": { 349 | "brace-expansion": "^1.1.7" 350 | }, 351 | "engines": { 352 | "node": "*" 353 | } 354 | }, 355 | "node_modules/minimist": { 356 | "version": "1.2.8", 357 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", 358 | "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", 359 | "funding": { 360 | "url": "https://github.com/sponsors/ljharb" 361 | } 362 | }, 363 | "node_modules/mqtt": { 364 | "version": "4.3.7", 365 | "resolved": "https://registry.npmjs.org/mqtt/-/mqtt-4.3.7.tgz", 366 | "integrity": "sha512-ew3qwG/TJRorTz47eW46vZ5oBw5MEYbQZVaEji44j5lAUSQSqIEoul7Kua/BatBW0H0kKQcC9kwUHa1qzaWHSw==", 367 | "dependencies": { 368 | "commist": "^1.0.0", 369 | "concat-stream": "^2.0.0", 370 | "debug": "^4.1.1", 371 | "duplexify": "^4.1.1", 372 | "help-me": "^3.0.0", 373 | "inherits": "^2.0.3", 374 | "lru-cache": "^6.0.0", 375 | "minimist": "^1.2.5", 376 | "mqtt-packet": "^6.8.0", 377 | "number-allocator": "^1.0.9", 378 | "pump": "^3.0.0", 379 | "readable-stream": "^3.6.0", 380 | "reinterval": "^1.1.0", 381 | "rfdc": "^1.3.0", 382 | "split2": "^3.1.0", 383 | "ws": "^7.5.5", 384 | "xtend": "^4.0.2" 385 | }, 386 | "bin": { 387 | "mqtt": "bin/mqtt.js", 388 | "mqtt_pub": "bin/pub.js", 389 | "mqtt_sub": "bin/sub.js" 390 | }, 391 | "engines": { 392 | "node": ">=10.0.0" 393 | } 394 | }, 395 | "node_modules/mqtt-packet": { 396 | "version": "6.10.0", 397 | "resolved": "https://registry.npmjs.org/mqtt-packet/-/mqtt-packet-6.10.0.tgz", 398 | "integrity": "sha512-ja8+mFKIHdB1Tpl6vac+sktqy3gA8t9Mduom1BA75cI+R9AHnZOiaBQwpGiWnaVJLDGRdNhQmFaAqd7tkKSMGA==", 399 | "dependencies": { 400 | "bl": "^4.0.2", 401 | "debug": "^4.1.1", 402 | "process-nextick-args": "^2.0.1" 403 | } 404 | }, 405 | "node_modules/ms": { 406 | "version": "2.1.2", 407 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", 408 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" 409 | }, 410 | "node_modules/number-allocator": { 411 | "version": "1.0.14", 412 | "resolved": "https://registry.npmjs.org/number-allocator/-/number-allocator-1.0.14.tgz", 413 | "integrity": "sha512-OrL44UTVAvkKdOdRQZIJpLkAdjXGTRda052sN4sO77bKEzYYqWKMBjQvrJFzqygI99gL6Z4u2xctPW1tB8ErvA==", 414 | "dependencies": { 415 | "debug": "^4.3.1", 416 | "js-sdsl": "4.3.0" 417 | } 418 | }, 419 | "node_modules/once": { 420 | "version": "1.4.0", 421 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 422 | "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", 423 | "dependencies": { 424 | "wrappy": "1" 425 | } 426 | }, 427 | "node_modules/openai": { 428 | "version": "3.2.1", 429 | "resolved": "https://registry.npmjs.org/openai/-/openai-3.2.1.tgz", 430 | "integrity": "sha512-762C9BNlJPbjjlWZi4WYK9iM2tAVAv0uUp1UmI34vb0CN5T2mjB/qM6RYBmNKMh/dN9fC+bxqPwWJZUTWW052A==", 431 | "dependencies": { 432 | "axios": "^0.26.0", 433 | "form-data": "^4.0.0" 434 | } 435 | }, 436 | "node_modules/path-is-absolute": { 437 | "version": "1.0.1", 438 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 439 | "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", 440 | "engines": { 441 | "node": ">=0.10.0" 442 | } 443 | }, 444 | "node_modules/process-nextick-args": { 445 | "version": "2.0.1", 446 | "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", 447 | "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" 448 | }, 449 | "node_modules/pump": { 450 | "version": "3.0.0", 451 | "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", 452 | "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", 453 | "dependencies": { 454 | "end-of-stream": "^1.1.0", 455 | "once": "^1.3.1" 456 | } 457 | }, 458 | "node_modules/readable-stream": { 459 | "version": "3.6.2", 460 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", 461 | "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", 462 | "dependencies": { 463 | "inherits": "^2.0.3", 464 | "string_decoder": "^1.1.1", 465 | "util-deprecate": "^1.0.1" 466 | }, 467 | "engines": { 468 | "node": ">= 6" 469 | } 470 | }, 471 | "node_modules/reinterval": { 472 | "version": "1.1.0", 473 | "resolved": "https://registry.npmjs.org/reinterval/-/reinterval-1.1.0.tgz", 474 | "integrity": "sha512-QIRet3SYrGp0HUHO88jVskiG6seqUGC5iAG7AwI/BV4ypGcuqk9Du6YQBUOUqm9c8pw1eyLoIaONifRua1lsEQ==" 475 | }, 476 | "node_modules/rfdc": { 477 | "version": "1.3.0", 478 | "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", 479 | "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==" 480 | }, 481 | "node_modules/safe-buffer": { 482 | "version": "5.2.1", 483 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 484 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", 485 | "funding": [ 486 | { 487 | "type": "github", 488 | "url": "https://github.com/sponsors/feross" 489 | }, 490 | { 491 | "type": "patreon", 492 | "url": "https://www.patreon.com/feross" 493 | }, 494 | { 495 | "type": "consulting", 496 | "url": "https://feross.org/support" 497 | } 498 | ] 499 | }, 500 | "node_modules/split2": { 501 | "version": "3.2.2", 502 | "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", 503 | "integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==", 504 | "dependencies": { 505 | "readable-stream": "^3.0.0" 506 | } 507 | }, 508 | "node_modules/stream-shift": { 509 | "version": "1.0.1", 510 | "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", 511 | "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==" 512 | }, 513 | "node_modules/string_decoder": { 514 | "version": "1.3.0", 515 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", 516 | "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", 517 | "dependencies": { 518 | "safe-buffer": "~5.2.0" 519 | } 520 | }, 521 | "node_modules/typedarray": { 522 | "version": "0.0.6", 523 | "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", 524 | "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" 525 | }, 526 | "node_modules/util-deprecate": { 527 | "version": "1.0.2", 528 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", 529 | "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" 530 | }, 531 | "node_modules/wrappy": { 532 | "version": "1.0.2", 533 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 534 | "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" 535 | }, 536 | "node_modules/ws": { 537 | "version": "7.5.9", 538 | "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", 539 | "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", 540 | "engines": { 541 | "node": ">=8.3.0" 542 | }, 543 | "peerDependencies": { 544 | "bufferutil": "^4.0.1", 545 | "utf-8-validate": "^5.0.2" 546 | }, 547 | "peerDependenciesMeta": { 548 | "bufferutil": { 549 | "optional": true 550 | }, 551 | "utf-8-validate": { 552 | "optional": true 553 | } 554 | } 555 | }, 556 | "node_modules/xtend": { 557 | "version": "4.0.2", 558 | "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", 559 | "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", 560 | "engines": { 561 | "node": ">=0.4" 562 | } 563 | }, 564 | "node_modules/yallist": { 565 | "version": "4.0.0", 566 | "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", 567 | "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" 568 | } 569 | }, 570 | "dependencies": { 571 | "@droneblocks/go1-js": { 572 | "version": "0.1.2", 573 | "resolved": "https://registry.npmjs.org/@droneblocks/go1-js/-/go1-js-0.1.2.tgz", 574 | "integrity": "sha512-dhoqkJ8NhOiKjGoAqa9z8LkCFcqVqUuFh4NmSrrXAsvKdHV4OCd1PXf6PUxB6cozalXKZhUMAOo6QcQB1UjMOQ==", 575 | "requires": { 576 | "mqtt": "^4.3.7" 577 | } 578 | }, 579 | "asynckit": { 580 | "version": "0.4.0", 581 | "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", 582 | "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" 583 | }, 584 | "axios": { 585 | "version": "0.26.1", 586 | "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz", 587 | "integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==", 588 | "requires": { 589 | "follow-redirects": "^1.14.8" 590 | } 591 | }, 592 | "balanced-match": { 593 | "version": "1.0.2", 594 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", 595 | "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" 596 | }, 597 | "base64-js": { 598 | "version": "1.5.1", 599 | "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", 600 | "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" 601 | }, 602 | "bl": { 603 | "version": "4.1.0", 604 | "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", 605 | "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", 606 | "requires": { 607 | "buffer": "^5.5.0", 608 | "inherits": "^2.0.4", 609 | "readable-stream": "^3.4.0" 610 | } 611 | }, 612 | "brace-expansion": { 613 | "version": "1.1.11", 614 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 615 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 616 | "requires": { 617 | "balanced-match": "^1.0.0", 618 | "concat-map": "0.0.1" 619 | } 620 | }, 621 | "buffer": { 622 | "version": "5.7.1", 623 | "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", 624 | "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", 625 | "requires": { 626 | "base64-js": "^1.3.1", 627 | "ieee754": "^1.1.13" 628 | } 629 | }, 630 | "buffer-from": { 631 | "version": "1.1.2", 632 | "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", 633 | "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" 634 | }, 635 | "combined-stream": { 636 | "version": "1.0.8", 637 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", 638 | "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", 639 | "requires": { 640 | "delayed-stream": "~1.0.0" 641 | } 642 | }, 643 | "commist": { 644 | "version": "1.1.0", 645 | "resolved": "https://registry.npmjs.org/commist/-/commist-1.1.0.tgz", 646 | "integrity": "sha512-rraC8NXWOEjhADbZe9QBNzLAN5Q3fsTPQtBV+fEVj6xKIgDgNiEVE6ZNfHpZOqfQ21YUzfVNUXLOEZquYvQPPg==", 647 | "requires": { 648 | "leven": "^2.1.0", 649 | "minimist": "^1.1.0" 650 | } 651 | }, 652 | "concat-map": { 653 | "version": "0.0.1", 654 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 655 | "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" 656 | }, 657 | "concat-stream": { 658 | "version": "2.0.0", 659 | "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", 660 | "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", 661 | "requires": { 662 | "buffer-from": "^1.0.0", 663 | "inherits": "^2.0.3", 664 | "readable-stream": "^3.0.2", 665 | "typedarray": "^0.0.6" 666 | } 667 | }, 668 | "debug": { 669 | "version": "4.3.4", 670 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", 671 | "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", 672 | "requires": { 673 | "ms": "2.1.2" 674 | } 675 | }, 676 | "delayed-stream": { 677 | "version": "1.0.0", 678 | "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", 679 | "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==" 680 | }, 681 | "dotenv": { 682 | "version": "16.0.3", 683 | "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", 684 | "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==" 685 | }, 686 | "duplexify": { 687 | "version": "4.1.2", 688 | "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.2.tgz", 689 | "integrity": "sha512-fz3OjcNCHmRP12MJoZMPglx8m4rrFP8rovnk4vT8Fs+aonZoCwGg10dSsQsfP/E62eZcPTMSMP6686fu9Qlqtw==", 690 | "requires": { 691 | "end-of-stream": "^1.4.1", 692 | "inherits": "^2.0.3", 693 | "readable-stream": "^3.1.1", 694 | "stream-shift": "^1.0.0" 695 | } 696 | }, 697 | "end-of-stream": { 698 | "version": "1.4.4", 699 | "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", 700 | "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", 701 | "requires": { 702 | "once": "^1.4.0" 703 | } 704 | }, 705 | "follow-redirects": { 706 | "version": "1.15.2", 707 | "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", 708 | "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==" 709 | }, 710 | "form-data": { 711 | "version": "4.0.0", 712 | "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", 713 | "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", 714 | "requires": { 715 | "asynckit": "^0.4.0", 716 | "combined-stream": "^1.0.8", 717 | "mime-types": "^2.1.12" 718 | } 719 | }, 720 | "fs.realpath": { 721 | "version": "1.0.0", 722 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 723 | "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" 724 | }, 725 | "glob": { 726 | "version": "7.2.3", 727 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", 728 | "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", 729 | "requires": { 730 | "fs.realpath": "^1.0.0", 731 | "inflight": "^1.0.4", 732 | "inherits": "2", 733 | "minimatch": "^3.1.1", 734 | "once": "^1.3.0", 735 | "path-is-absolute": "^1.0.0" 736 | } 737 | }, 738 | "help-me": { 739 | "version": "3.0.0", 740 | "resolved": "https://registry.npmjs.org/help-me/-/help-me-3.0.0.tgz", 741 | "integrity": "sha512-hx73jClhyk910sidBB7ERlnhMlFsJJIBqSVMFDwPN8o2v9nmp5KgLq1Xz1Bf1fCMMZ6mPrX159iG0VLy/fPMtQ==", 742 | "requires": { 743 | "glob": "^7.1.6", 744 | "readable-stream": "^3.6.0" 745 | } 746 | }, 747 | "ieee754": { 748 | "version": "1.2.1", 749 | "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", 750 | "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" 751 | }, 752 | "inflight": { 753 | "version": "1.0.6", 754 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 755 | "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", 756 | "requires": { 757 | "once": "^1.3.0", 758 | "wrappy": "1" 759 | } 760 | }, 761 | "inherits": { 762 | "version": "2.0.4", 763 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 764 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 765 | }, 766 | "js-sdsl": { 767 | "version": "4.3.0", 768 | "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.3.0.tgz", 769 | "integrity": "sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==" 770 | }, 771 | "leven": { 772 | "version": "2.1.0", 773 | "resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz", 774 | "integrity": "sha512-nvVPLpIHUxCUoRLrFqTgSxXJ614d8AgQoWl7zPe/2VadE8+1dpU3LBhowRuBAcuwruWtOdD8oYC9jDNJjXDPyA==" 775 | }, 776 | "lru-cache": { 777 | "version": "6.0.0", 778 | "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", 779 | "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", 780 | "requires": { 781 | "yallist": "^4.0.0" 782 | } 783 | }, 784 | "mime-db": { 785 | "version": "1.52.0", 786 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", 787 | "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" 788 | }, 789 | "mime-types": { 790 | "version": "2.1.35", 791 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", 792 | "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", 793 | "requires": { 794 | "mime-db": "1.52.0" 795 | } 796 | }, 797 | "minimatch": { 798 | "version": "3.1.2", 799 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", 800 | "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", 801 | "requires": { 802 | "brace-expansion": "^1.1.7" 803 | } 804 | }, 805 | "minimist": { 806 | "version": "1.2.8", 807 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", 808 | "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==" 809 | }, 810 | "mqtt": { 811 | "version": "4.3.7", 812 | "resolved": "https://registry.npmjs.org/mqtt/-/mqtt-4.3.7.tgz", 813 | "integrity": "sha512-ew3qwG/TJRorTz47eW46vZ5oBw5MEYbQZVaEji44j5lAUSQSqIEoul7Kua/BatBW0H0kKQcC9kwUHa1qzaWHSw==", 814 | "requires": { 815 | "commist": "^1.0.0", 816 | "concat-stream": "^2.0.0", 817 | "debug": "^4.1.1", 818 | "duplexify": "^4.1.1", 819 | "help-me": "^3.0.0", 820 | "inherits": "^2.0.3", 821 | "lru-cache": "^6.0.0", 822 | "minimist": "^1.2.5", 823 | "mqtt-packet": "^6.8.0", 824 | "number-allocator": "^1.0.9", 825 | "pump": "^3.0.0", 826 | "readable-stream": "^3.6.0", 827 | "reinterval": "^1.1.0", 828 | "rfdc": "^1.3.0", 829 | "split2": "^3.1.0", 830 | "ws": "^7.5.5", 831 | "xtend": "^4.0.2" 832 | } 833 | }, 834 | "mqtt-packet": { 835 | "version": "6.10.0", 836 | "resolved": "https://registry.npmjs.org/mqtt-packet/-/mqtt-packet-6.10.0.tgz", 837 | "integrity": "sha512-ja8+mFKIHdB1Tpl6vac+sktqy3gA8t9Mduom1BA75cI+R9AHnZOiaBQwpGiWnaVJLDGRdNhQmFaAqd7tkKSMGA==", 838 | "requires": { 839 | "bl": "^4.0.2", 840 | "debug": "^4.1.1", 841 | "process-nextick-args": "^2.0.1" 842 | } 843 | }, 844 | "ms": { 845 | "version": "2.1.2", 846 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", 847 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" 848 | }, 849 | "number-allocator": { 850 | "version": "1.0.14", 851 | "resolved": "https://registry.npmjs.org/number-allocator/-/number-allocator-1.0.14.tgz", 852 | "integrity": "sha512-OrL44UTVAvkKdOdRQZIJpLkAdjXGTRda052sN4sO77bKEzYYqWKMBjQvrJFzqygI99gL6Z4u2xctPW1tB8ErvA==", 853 | "requires": { 854 | "debug": "^4.3.1", 855 | "js-sdsl": "4.3.0" 856 | } 857 | }, 858 | "once": { 859 | "version": "1.4.0", 860 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 861 | "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", 862 | "requires": { 863 | "wrappy": "1" 864 | } 865 | }, 866 | "openai": { 867 | "version": "3.2.1", 868 | "resolved": "https://registry.npmjs.org/openai/-/openai-3.2.1.tgz", 869 | "integrity": "sha512-762C9BNlJPbjjlWZi4WYK9iM2tAVAv0uUp1UmI34vb0CN5T2mjB/qM6RYBmNKMh/dN9fC+bxqPwWJZUTWW052A==", 870 | "requires": { 871 | "axios": "^0.26.0", 872 | "form-data": "^4.0.0" 873 | } 874 | }, 875 | "path-is-absolute": { 876 | "version": "1.0.1", 877 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 878 | "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" 879 | }, 880 | "process-nextick-args": { 881 | "version": "2.0.1", 882 | "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", 883 | "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" 884 | }, 885 | "pump": { 886 | "version": "3.0.0", 887 | "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", 888 | "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", 889 | "requires": { 890 | "end-of-stream": "^1.1.0", 891 | "once": "^1.3.1" 892 | } 893 | }, 894 | "readable-stream": { 895 | "version": "3.6.2", 896 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", 897 | "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", 898 | "requires": { 899 | "inherits": "^2.0.3", 900 | "string_decoder": "^1.1.1", 901 | "util-deprecate": "^1.0.1" 902 | } 903 | }, 904 | "reinterval": { 905 | "version": "1.1.0", 906 | "resolved": "https://registry.npmjs.org/reinterval/-/reinterval-1.1.0.tgz", 907 | "integrity": "sha512-QIRet3SYrGp0HUHO88jVskiG6seqUGC5iAG7AwI/BV4ypGcuqk9Du6YQBUOUqm9c8pw1eyLoIaONifRua1lsEQ==" 908 | }, 909 | "rfdc": { 910 | "version": "1.3.0", 911 | "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", 912 | "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==" 913 | }, 914 | "safe-buffer": { 915 | "version": "5.2.1", 916 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 917 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" 918 | }, 919 | "split2": { 920 | "version": "3.2.2", 921 | "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", 922 | "integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==", 923 | "requires": { 924 | "readable-stream": "^3.0.0" 925 | } 926 | }, 927 | "stream-shift": { 928 | "version": "1.0.1", 929 | "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", 930 | "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==" 931 | }, 932 | "string_decoder": { 933 | "version": "1.3.0", 934 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", 935 | "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", 936 | "requires": { 937 | "safe-buffer": "~5.2.0" 938 | } 939 | }, 940 | "typedarray": { 941 | "version": "0.0.6", 942 | "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", 943 | "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" 944 | }, 945 | "util-deprecate": { 946 | "version": "1.0.2", 947 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", 948 | "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" 949 | }, 950 | "wrappy": { 951 | "version": "1.0.2", 952 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 953 | "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" 954 | }, 955 | "ws": { 956 | "version": "7.5.9", 957 | "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", 958 | "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", 959 | "requires": {} 960 | }, 961 | "xtend": { 962 | "version": "4.0.2", 963 | "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", 964 | "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" 965 | }, 966 | "yallist": { 967 | "version": "4.0.0", 968 | "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", 969 | "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" 970 | } 971 | } 972 | } 973 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "unitree-go1-nodejs-chatgpt", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "type": "module", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "git+https://github.com/dbaldwin/Unitree-Go1-NodeJS-ChatGPT.git" 13 | }, 14 | "keywords": [], 15 | "author": "", 16 | "license": "ISC", 17 | "bugs": { 18 | "url": "https://github.com/dbaldwin/Unitree-Go1-NodeJS-ChatGPT/issues" 19 | }, 20 | "homepage": "https://github.com/dbaldwin/Unitree-Go1-NodeJS-ChatGPT#readme", 21 | "dependencies": { 22 | "@droneblocks/go1-js": "^0.1.4", 23 | "dotenv": "^16.0.3", 24 | "openai": "^3.2.1" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test.js: -------------------------------------------------------------------------------- 1 | import { Go1, Go1Mode } from "@droneblocks/go1-js" 2 | 3 | let dog = new Go1(); 4 | dog.init(); 5 | 6 | async function blinkLed() { 7 | // set the LED to blue 8 | dog.setLedColor(0, 0, 255); 9 | 10 | // blink the LED 3 times 11 | for (let i = 0; i < 3; i++) { 12 | // wait for 3 seconds 13 | await dog.wait(2000); 14 | 15 | // set the LED to green 16 | dog.setLedColor(0, 255, 0); 17 | 18 | // wait for 500 milliseconds 19 | await dog.wait(2000); 20 | 21 | // set the LED to blue 22 | dog.setLedColor(0, 0, 255); 23 | 24 | console.log(`loop ${i}`) 25 | } 26 | 27 | await dog.wait(2000); 28 | 29 | console.log('turn led off'); 30 | 31 | // set the LED to off 32 | dog.setLedColor(0, 0, 0); 33 | 34 | } 35 | 36 | // call the blinkLed function to start the blinking 37 | blinkLed(); --------------------------------------------------------------------------------