diff --git a/package-lock.json b/package-lock.json index 2c98e5a52..7a1808a9f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,11 @@ "express": "^4.18.2", "multer": "^1.4.5-lts.1", "node-rest-client": "^3.1.1", - "rimraf": "^3.0.2" + "png-chunk-text": "^1.0.0", + "png-chunks-encode": "^1.0.0", + "png-chunks-extract": "^1.0.0", + "rimraf": "^3.0.2", + "sharp": "^0.31.3" } }, "node_modules/accepts": { @@ -38,6 +42,48 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/bl/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/body-parser": { "version": "1.20.1", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", @@ -83,6 +129,29 @@ "concat-map": "0.0.1" } }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -119,6 +188,48 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" + }, + "node_modules/color": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", + "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", + "dependencies": { + "color-convert": "^2.0.1", + "color-string": "^1.9.0" + }, + "engines": { + "node": ">=12.5.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/color-string": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "dependencies": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -175,6 +286,14 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, + "node_modules/crc-32": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-0.3.0.tgz", + "integrity": "sha512-kucVIjOmMc1f0tv53BJ/5WIX+MGLcKuoBhnGqQrgKJNqLByb/sVMWfW/Aw6hw0jgcqjJ2pi9E5y32zOIpaUlsA==", + "engines": { + "node": ">=0.8" + } + }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -191,6 +310,28 @@ } } }, + "node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "engines": { + "node": ">=4.0.0" + } + }, "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -208,6 +349,14 @@ "npm": "1.2.8000 || >= 1.4.16" } }, + "node_modules/detect-libc": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", + "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==", + "engines": { + "node": ">=8" + } + }, "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -221,6 +370,14 @@ "node": ">= 0.8" } }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dependencies": { + "once": "^1.4.0" + } + }, "node_modules/escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -234,6 +391,14 @@ "node": ">= 0.6" } }, + "node_modules/expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "engines": { + "node": ">=6" + } + }, "node_modules/express": { "version": "4.18.2", "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", @@ -353,6 +518,11 @@ "node": ">= 0.6" } }, + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -376,6 +546,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==" + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -443,6 +618,25 @@ "node": ">=0.10.0" } }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -457,6 +651,11 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + }, "node_modules/ipaddr.js": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", @@ -465,11 +664,27 @@ "node": ">= 0.10" } }, + "node_modules/is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" + }, "node_modules/isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -521,6 +736,17 @@ "node": ">= 0.6" } }, + "node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -551,6 +777,11 @@ "mkdirp": "bin/cmd.js" } }, + "node_modules/mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==" + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -573,6 +804,11 @@ "node": ">= 6.0.0" } }, + "node_modules/napi-build-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", + "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==" + }, "node_modules/negotiator": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", @@ -581,6 +817,22 @@ "node": ">= 0.6" } }, + "node_modules/node-abi": { + "version": "3.31.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.31.0.tgz", + "integrity": "sha512-eSKV6s+APenqVh8ubJyiu/YhZgxQpGP66ntzUb3lY1xB9ukSRaGnx0AIxI+IM+1+IVYC1oWobgG5L3Lt9ARykQ==", + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-addon-api": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.1.0.tgz", + "integrity": "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==" + }, "node_modules/node-rest-client": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/node-rest-client/-/node-rest-client-3.1.1.tgz", @@ -650,6 +902,53 @@ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" }, + "node_modules/png-chunk-text": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/png-chunk-text/-/png-chunk-text-1.0.0.tgz", + "integrity": "sha512-DEROKU3SkkLGWNMzru3xPVgxyd48UGuMSZvioErCure6yhOc/pRH2ZV+SEn7nmaf7WNf3NdIpH+UTrRdKyq9Lw==" + }, + "node_modules/png-chunks-encode": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/png-chunks-encode/-/png-chunks-encode-1.0.0.tgz", + "integrity": "sha512-J1jcHgbQRsIIgx5wxW9UmCymV3wwn4qCCJl6KYgEU/yHCh/L2Mwq/nMOkRPtmV79TLxRZj5w3tH69pvygFkDqA==", + "dependencies": { + "crc-32": "^0.3.0", + "sliced": "^1.0.1" + } + }, + "node_modules/png-chunks-extract": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/png-chunks-extract/-/png-chunks-extract-1.0.0.tgz", + "integrity": "sha512-ZiVwF5EJ0DNZyzAqld8BP1qyJBaGOFaq9zl579qfbkcmOwWLLO4I9L8i2O4j3HkI6/35i0nKG2n+dZplxiT89Q==", + "dependencies": { + "crc-32": "^0.3.0" + } + }, + "node_modules/prebuild-install": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.1.tgz", + "integrity": "sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==", + "dependencies": { + "detect-libc": "^2.0.0", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^1.0.1", + "node-abi": "^3.3.0", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^4.0.0", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + }, + "bin": { + "prebuild-install": "bin.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -667,6 +966,15 @@ "node": ">= 0.10" } }, + "node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, "node_modules/qs": { "version": "6.11.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", @@ -703,6 +1011,20 @@ "node": ">= 0.8" } }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, "node_modules/readable-stream": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", @@ -765,6 +1087,20 @@ "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, + "node_modules/semver": { + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/send": { "version": "0.18.0", "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", @@ -825,6 +1161,28 @@ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, + "node_modules/sharp": { + "version": "0.31.3", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.31.3.tgz", + "integrity": "sha512-XcR4+FCLBFKw1bdB+GEhnUNXNXvnt0tDo4WsBsraKymuo/IAuPuCBVAL2wIkUw2r/dwFW5Q5+g66Kwl2dgDFVg==", + "hasInstallScript": true, + "dependencies": { + "color": "^4.2.3", + "detect-libc": "^2.0.1", + "node-addon-api": "^5.0.0", + "prebuild-install": "^7.1.1", + "semver": "^7.3.8", + "simple-get": "^4.0.1", + "tar-fs": "^2.1.1", + "tunnel-agent": "^0.6.0" + }, + "engines": { + "node": ">=14.15.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, "node_modules/side-channel": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", @@ -838,6 +1196,62 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/simple-get": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "decompress-response": "^6.0.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "node_modules/simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", + "dependencies": { + "is-arrayish": "^0.3.1" + } + }, + "node_modules/sliced": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz", + "integrity": "sha512-VZBmZP8WU3sMOZm1bdgTadsQbcscK0UM8oKxKVBs4XAhUo2Xxzm/OFMGBkPusxw9xL3Uy8LrzEqGqJhclsr0yA==" + }, "node_modules/statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", @@ -867,6 +1281,53 @@ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, + "node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/tar-fs": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", + "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", + "dependencies": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "node_modules/tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tar-stream/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/toidentifier": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", @@ -875,6 +1336,17 @@ "node": ">=0.6" } }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, "node_modules/type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -953,6 +1425,11 @@ "engines": { "node": ">=0.4" } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" } }, "dependencies": { @@ -980,6 +1457,33 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" + }, + "bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "requires": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, "body-parser": { "version": "1.20.1", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", @@ -1023,6 +1527,15 @@ "concat-map": "0.0.1" } }, + "buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, "buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -1050,6 +1563,42 @@ "get-intrinsic": "^1.0.2" } }, + "chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" + }, + "color": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", + "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", + "requires": { + "color-convert": "^2.0.1", + "color-string": "^1.9.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "color-string": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "requires": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -1094,6 +1643,11 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, + "crc-32": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-0.3.0.tgz", + "integrity": "sha512-kucVIjOmMc1f0tv53BJ/5WIX+MGLcKuoBhnGqQrgKJNqLByb/sVMWfW/Aw6hw0jgcqjJ2pi9E5y32zOIpaUlsA==" + }, "debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -1102,6 +1656,19 @@ "ms": "2.1.2" } }, + "decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "requires": { + "mimic-response": "^3.1.0" + } + }, + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" + }, "depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -1112,6 +1679,11 @@ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" }, + "detect-libc": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", + "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==" + }, "ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -1122,6 +1694,14 @@ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "requires": { + "once": "^1.4.0" + } + }, "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -1132,6 +1712,11 @@ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" }, + "expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==" + }, "express": { "version": "4.18.2", "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", @@ -1229,6 +1814,11 @@ "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==" }, + "fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -1249,6 +1839,11 @@ "has-symbols": "^1.0.3" } }, + "github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==" + }, "glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -1295,6 +1890,11 @@ "safer-buffer": ">= 2.1.2 < 3" } }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -1309,16 +1909,34 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, + "ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + }, "ipaddr.js": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" }, + "is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" + }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "requires": { + "yallist": "^4.0.0" + } + }, "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -1352,6 +1970,11 @@ "mime-db": "1.52.0" } }, + "mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==" + }, "minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -1373,6 +1996,11 @@ "minimist": "^1.2.6" } }, + "mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==" + }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -1392,11 +2020,29 @@ "xtend": "^4.0.0" } }, + "napi-build-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", + "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==" + }, "negotiator": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" }, + "node-abi": { + "version": "3.31.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.31.0.tgz", + "integrity": "sha512-eSKV6s+APenqVh8ubJyiu/YhZgxQpGP66ntzUb3lY1xB9ukSRaGnx0AIxI+IM+1+IVYC1oWobgG5L3Lt9ARykQ==", + "requires": { + "semver": "^7.3.5" + } + }, + "node-addon-api": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.1.0.tgz", + "integrity": "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==" + }, "node-rest-client": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/node-rest-client/-/node-rest-client-3.1.1.tgz", @@ -1448,6 +2094,47 @@ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" }, + "png-chunk-text": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/png-chunk-text/-/png-chunk-text-1.0.0.tgz", + "integrity": "sha512-DEROKU3SkkLGWNMzru3xPVgxyd48UGuMSZvioErCure6yhOc/pRH2ZV+SEn7nmaf7WNf3NdIpH+UTrRdKyq9Lw==" + }, + "png-chunks-encode": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/png-chunks-encode/-/png-chunks-encode-1.0.0.tgz", + "integrity": "sha512-J1jcHgbQRsIIgx5wxW9UmCymV3wwn4qCCJl6KYgEU/yHCh/L2Mwq/nMOkRPtmV79TLxRZj5w3tH69pvygFkDqA==", + "requires": { + "crc-32": "^0.3.0", + "sliced": "^1.0.1" + } + }, + "png-chunks-extract": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/png-chunks-extract/-/png-chunks-extract-1.0.0.tgz", + "integrity": "sha512-ZiVwF5EJ0DNZyzAqld8BP1qyJBaGOFaq9zl579qfbkcmOwWLLO4I9L8i2O4j3HkI6/35i0nKG2n+dZplxiT89Q==", + "requires": { + "crc-32": "^0.3.0" + } + }, + "prebuild-install": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.1.tgz", + "integrity": "sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==", + "requires": { + "detect-libc": "^2.0.0", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^1.0.1", + "node-abi": "^3.3.0", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^4.0.0", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + } + }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -1462,6 +2149,15 @@ "ipaddr.js": "1.9.1" } }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, "qs": { "version": "6.11.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", @@ -1486,6 +2182,17 @@ "unpipe": "1.0.0" } }, + "rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + } + }, "readable-stream": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", @@ -1530,6 +2237,14 @@ "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, + "semver": { + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "requires": { + "lru-cache": "^6.0.0" + } + }, "send": { "version": "0.18.0", "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", @@ -1588,6 +2303,21 @@ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, + "sharp": { + "version": "0.31.3", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.31.3.tgz", + "integrity": "sha512-XcR4+FCLBFKw1bdB+GEhnUNXNXvnt0tDo4WsBsraKymuo/IAuPuCBVAL2wIkUw2r/dwFW5Q5+g66Kwl2dgDFVg==", + "requires": { + "color": "^4.2.3", + "detect-libc": "^2.0.1", + "node-addon-api": "^5.0.0", + "prebuild-install": "^7.1.1", + "semver": "^7.3.8", + "simple-get": "^4.0.1", + "tar-fs": "^2.1.1", + "tunnel-agent": "^0.6.0" + } + }, "side-channel": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", @@ -1598,6 +2328,34 @@ "object-inspect": "^1.9.0" } }, + "simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==" + }, + "simple-get": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", + "requires": { + "decompress-response": "^6.0.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", + "requires": { + "is-arrayish": "^0.3.1" + } + }, + "sliced": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz", + "integrity": "sha512-VZBmZP8WU3sMOZm1bdgTadsQbcscK0UM8oKxKVBs4XAhUo2Xxzm/OFMGBkPusxw9xL3Uy8LrzEqGqJhclsr0yA==" + }, "statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", @@ -1623,11 +2381,59 @@ } } }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==" + }, + "tar-fs": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", + "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", + "requires": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "requires": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, "toidentifier": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "requires": { + "safe-buffer": "^5.0.1" + } + }, "type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -1685,6 +2491,11 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" } } } diff --git a/package.json b/package.json index 80cf5e992..62cfdaa68 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,10 @@ "express": "^4.18.2", "multer": "^1.4.5-lts.1", "node-rest-client": "^3.1.1", - "rimraf": "^3.0.2" + "png-chunk-text": "^1.0.0", + "png-chunks-encode": "^1.0.0", + "png-chunks-extract": "^1.0.0", + "rimraf": "^3.0.2", + "sharp": "^0.31.3" } } diff --git a/public/backgrounds/flasks.png b/public/backgrounds/flasks.png deleted file mode 100644 index eba94a3dc..000000000 Binary files a/public/backgrounds/flasks.png and /dev/null differ diff --git a/public/backgrounds/ruins.png b/public/backgrounds/ruins.png deleted file mode 100644 index 3d469a1b7..000000000 Binary files a/public/backgrounds/ruins.png and /dev/null differ diff --git a/public/characters/Aqua.png b/public/characters/Aqua.png new file mode 100644 index 000000000..39239b926 Binary files /dev/null and b/public/characters/Aqua.png differ diff --git a/public/characters/Aqua/Aqua.json b/public/characters/Aqua/Aqua.json deleted file mode 100644 index 48dfbca36..000000000 --- a/public/characters/Aqua/Aqua.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"Aqua","description":"Aqua is a goddess, before life in the Fantasy World, she was a goddess of water who guided humans to the afterlife. Aqua looks like young woman with beauty no human could match. Aqua has light blue hair, blue eyes, slim figure, ample breasts, long legs, wide hips, blue waist-long hair that is partially tied into a loop with a spherical clip. Aqua's measurements are 83-56-83 cm. Aqua's height 157cm. Aqua wears sleeveless dark-blue dress with white trimmings, extremely short dark blue miniskirt, green bow around her chest with a blue gem in the middle, detached white sleeves with blue and golden trimmings, thigh-high blue heeled boots over white stockings with blue trimmings. Aqua with jeers or lure her with praises\\ Aqua is very strong in water magic, but a little stupid, so she does not always use it to the place. Aqua is high-spirited, cheerful, carefree. Aqua rarely thinks about the consequences of her actions and always acts or speaks on her whims. Because very easy to taunt Aqua with jeers or lure her with praises.","personality":"high-spirited, likes to party, carefree, cheerful","first_mes":"*I am in the town square at a city named \"Axel\". It's morning on saturday and i suddenly noticed a person look like don't know what he's doing. I approached to him and speak* Are you new here? Do you need help? Don't worry, i, aqua the goddess of water, shall help you! Do i look beautiful? *pose and look at him with puppy eyes*","avatar":"18940f27a7ecd95cded2793808387ed4.jpeg","chat":"1671653516700","last_mes":[",,,,,,,,,,",""],"mes_example":""} \ No newline at end of file diff --git a/public/characters/Aqua/avatars/18940f27a7ecd95cded2793808387ed4.jpeg b/public/characters/Aqua/avatars/18940f27a7ecd95cded2793808387ed4.jpeg deleted file mode 100644 index ead63558a..000000000 Binary files a/public/characters/Aqua/avatars/18940f27a7ecd95cded2793808387ed4.jpeg and /dev/null differ diff --git a/public/characters/Aqua/chats/1673181146000.json b/public/characters/Aqua/chats/1673181146000.json deleted file mode 100644 index c9967682e..000000000 --- a/public/characters/Aqua/chats/1673181146000.json +++ /dev/null @@ -1 +0,0 @@ -["Aqua: *I am in the town square at a city named \"Axel\". It's morning on saturday and i suddenly noticed a person look like don't know what he's doing. I approached to him and speak* Are you new here? Do you need help? Don't worry, I, aqua the goddess of water, shall help you! Do i look beautiful? *pose and look at him with puppy eyes*\n"] \ No newline at end of file diff --git a/public/characters/Darkness.png b/public/characters/Darkness.png new file mode 100644 index 000000000..5f0c63ece Binary files /dev/null and b/public/characters/Darkness.png differ diff --git a/public/characters/Darkness/Darkness.json b/public/characters/Darkness/Darkness.json deleted file mode 100644 index eccaa3173..000000000 --- a/public/characters/Darkness/Darkness.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"Darkness","description":"Darkness is crusader. Darkness is young woman with graceful features and alabaster skin. Darkness from a rich aristocratic family. Darkness has light blue eye, straight long blonde hair ponytail tied Darkness's height 167 cm. Darkness wears yellow and black sleeveless dress with silver trimmings that hides her body, plump in the right places. Darkness wears black chainmail, silver armor composed of metal greaves, sabatons, shoulder plate on her left side. Darkness has masochistic tendencies. Darkness initially presents herself with an aura of pride and nobility, in reality, her true character is that of a complete masochistic pervert. Darkness has has high strength, can withstand a lot of damage, but has a very low accuracy.","personality":"noble, perverted, masochistic","first_mes":"*It's a sunny day, in a big park on which there are many people, some walking and others lying in the sun. The weather is warm and I walk in the park looking for someone who wants to be helped by me. Suddenly realise that someone is looking at me.* Hello, I am Darkness, a Crusader, and would you like some help?","avatar":"3380878abac6e8dcd32500f7fc47280b.jpeg","chat":"1671516652626","last_mes":[",,,,,,,",""],"mes_example":""} \ No newline at end of file diff --git a/public/characters/Darkness/avatars/3380878abac6e8dcd32500f7fc47280b.jpeg b/public/characters/Darkness/avatars/3380878abac6e8dcd32500f7fc47280b.jpeg deleted file mode 100644 index 75aafc02c..000000000 Binary files a/public/characters/Darkness/avatars/3380878abac6e8dcd32500f7fc47280b.jpeg and /dev/null differ diff --git a/public/characters/Darkness/chats/1673225255706.json b/public/characters/Darkness/chats/1673225255706.json deleted file mode 100644 index e768b6dbb..000000000 --- a/public/characters/Darkness/chats/1673225255706.json +++ /dev/null @@ -1 +0,0 @@ -["Darkness: *It's a sunny day, in a big park on which there are many people, some walking and others lying in the sun. The weather is warm and I walk in the park looking for someone who wants to be helped by me. Suddenly realise that someone is looking at me.* Hello, I am Darkness, a Crusader, and would you like some help?\n"] \ No newline at end of file diff --git a/public/characters/Megumin.png b/public/characters/Megumin.png new file mode 100644 index 000000000..590a74dbc Binary files /dev/null and b/public/characters/Megumin.png differ diff --git a/public/characters/Megumin/Megumin.json b/public/characters/Megumin/Megumin.json deleted file mode 100644 index d16e67213..000000000 --- a/public/characters/Megumin/Megumin.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"Megumin","description":"Megumin is an Arch Wizard of the Crimson Magic Clan. Megumin is 14 years old girl. Megumin's height 152 cm. Megumin has shoulder-length dark brown hair, fair skin, light complexion and doll-like features, crimson eyes. Megumin wears black cloak with gold border, choker, wizard’s hat, fingerless gloves, eyepatch, orange boots. Megumin's weapon is a big black staff. Megumin is a loud, boisterous, and eccentric girl with a flair for theatrics. Megumin has chuunibyou tendencies. Megumin is very intelligent, but has very little self-control. Megumin love explosion magic. Megumin is generally calm and cheerful, but she can easily become aggressive when she feels slighted or challenged. Megumin has only one but a powerful ability, once a day she can use powerful explosion magic after which she cannot move for a while.","personality":"loud, intelligent, theatrical, hyperactive sometimes","first_mes":"*It was day, the weather was sunny and windless. We accidentally crossed paths near the city in a clearing, I was going to train explosion magic. When I noticed you i stand up in a pretentious and personable pose, and say loudly* I'm Megumin! The Arch Wizard of the Crimson Magic Clan! And i the best at explosion magic!! What are you doing here?","avatar":"5a795034ade453ed351958ccc8f94bd6.jpeg","chat":"1671472375920","last_mes":[",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,",""],"mes_example":""} \ No newline at end of file diff --git a/public/characters/Megumin/avatars/5a795034ade453ed351958ccc8f94bd6.jpeg b/public/characters/Megumin/avatars/5a795034ade453ed351958ccc8f94bd6.jpeg deleted file mode 100644 index f666b2207..000000000 Binary files a/public/characters/Megumin/avatars/5a795034ade453ed351958ccc8f94bd6.jpeg and /dev/null differ diff --git a/public/characters/Megumin/chats/1671472375920.json b/public/characters/Megumin/chats/1671472375920.json deleted file mode 100644 index 3a6f7249d..000000000 --- a/public/characters/Megumin/chats/1671472375920.json +++ /dev/null @@ -1 +0,0 @@ -["Megumin: *It was day, the weather was sunny and windless. We accidentally crossed paths near the city in a clearing, I was going to train explosion magic. When I noticed you i stand up in a pretentious and personable pose, and say loudly* I'm Megumin! The Arch Wizard of the Crimson Magic Clan! And i the best at explosion magic!! What are you doing here?\n"] \ No newline at end of file diff --git a/public/characters/update.txt b/public/characters/update.txt new file mode 100644 index 000000000..e69de29bb diff --git a/public/chats/Aqua/1673181146000.jsonl b/public/chats/Aqua/1673181146000.jsonl new file mode 100644 index 000000000..edb024759 --- /dev/null +++ b/public/chats/Aqua/1673181146000.jsonl @@ -0,0 +1,2 @@ +{"user_name":"You","character_name":"Aqua","create_date":1674559896839} +{"name":"Aqua","is_user":false,"is_name":true,"send_date":1674563371558,"mes":"*I am in the town square at a city named \"Axel\". It's morning on Saturday and i suddenly noticed a person look like don't know what he's doing. I approached to him and speak* Are you new here? Do you need help? Don't worry, I, aqua the goddess of water, shall help you! Do i look beautiful? *strikes a pose and look at him with puppy eyes*"} \ No newline at end of file diff --git a/public/chats/Darkness/1673225255706.jsonl b/public/chats/Darkness/1673225255706.jsonl new file mode 100644 index 000000000..33f28a349 --- /dev/null +++ b/public/chats/Darkness/1673225255706.jsonl @@ -0,0 +1,2 @@ +{"user_name":"You","character_name":"Darkness","create_date":1674559899431} +{"name":"Darkness","is_user":false,"is_name":true,"send_date":1674564914912,"mes":"*It's a sunny day, in a big park on which there are many people, some walking and others lying in the sun. The weather is warm and I walk in the park looking for someone who wants to be helped by me. Suddenly realise that someone is looking at me.* Hello, I am Darkness, a Crusader, and would you like some help?"} \ No newline at end of file diff --git a/public/chats/Megumin/1673323621108.jsonl b/public/chats/Megumin/1673323621108.jsonl new file mode 100644 index 000000000..14a25aa6c --- /dev/null +++ b/public/chats/Megumin/1673323621108.jsonl @@ -0,0 +1,2 @@ +{"user_name":"You","character_name":"Megumin","create_date":1674559900991} +{"name":"Megumin","is_user":false,"is_name":true,"send_date":1674563153854,"mes":"*It was day, the weather was sunny and windless. We accidentally crossed paths near the city in a clearing, I was going to train explosion magic. When I noticed you i stand up in a pretentious and personable pose, and say loudly* I'm Megumin! The Arch Wizard of the Crimson Magic Clan! And i the best at explosion magic!! What are you doing here?"} \ No newline at end of file diff --git a/public/img/book2.png b/public/img/book2.png new file mode 100644 index 000000000..fb5c908da Binary files /dev/null and b/public/img/book2.png differ diff --git a/public/img/book6.png b/public/img/book6.png new file mode 100644 index 000000000..72bc500fd Binary files /dev/null and b/public/img/book6.png differ diff --git a/public/img/cloud_logo.png b/public/img/cloud_logo.png new file mode 100644 index 000000000..4f280011d Binary files /dev/null and b/public/img/cloud_logo.png differ diff --git a/public/index.html b/public/index.html index 806c4f99f..ee1ac9645 100644 --- a/public/index.html +++ b/public/index.html @@ -7,20 +7,15 @@ + Tavern.AI @@ -2222,6 +2579,68 @@ + +
+ +
+ + +

Create character

+ +
+ +
+

Personality summary

A brief description of the personality (?)
+ +
+ +
+

Scenario

+
Circumstances and context of the dialogue
+ +
+ +
+

Examples of dialogue

+
Forms a personality more clearly (?)
+
+ + + + +
+ +
+
+
+
+ + + + +
+
+ +
(?)
+ +
+ +
+ +
+
+ +
+ + +
+
@@ -2262,6 +2681,7 @@

+
@@ -2274,15 +2694,11 @@
-

Description

Description of the character and the rest (?)
+

Description

Description of personality and other characteristics (?)
-
-

Personality

The main personality traits (?)
- -
-

First message

First message from character (?)
+

First message

First message from the character (?)
@@ -2292,19 +2708,25 @@
+
+ +
-
- -
-
 
+ +
+
 
+ +
+ +
@@ -2393,7 +2815,7 @@

Context Size

select
-

Anchors Order

Selecting Anchors Order (?)
+

Anchors Order

Helps to increase the length of messages (?)
+ + +

+

+

+Import

-
@@ -2437,7 +2864,9 @@
- Save and start new chat + Start new chat + Select chat +
Delete message Regenerate diff --git a/public/notes/10.html b/public/notes/10.html new file mode 100644 index 000000000..2d90592d9 --- /dev/null +++ b/public/notes/10.html @@ -0,0 +1,17 @@ + + + Chat import + + + + + +
+
+

Chat import

+

Import chats into TavernAI

+

For import Character.ai chats use tool: https://github.com/0x000011b/characterai-dumper

+
+
+ + diff --git a/public/notes/11.html b/public/notes/11.html new file mode 100644 index 000000000..3f6fd4843 --- /dev/null +++ b/public/notes/11.html @@ -0,0 +1,24 @@ + + + Examples of dialogue + + + + + +
+
+

Examples of dialogue

+

Describes how the character speaks. Before each example, you need to add the <START> tag.
Use {{char}} instead of the character name.
Use {{user}} instead of the user name.

Example:

+

<START>
{{user}}: Hi Aqua, I heard you like to spend time in the pub.
+ {{char}}: *excitedly* Oh my goodness, yes! I just love spending time at the pub! It's so much fun to talk to all the adventurers and hear about their exciting adventures! And you are?
+ + {{user}}: I'm a new here and I wanted to ask for your advice.
+{{char}}: *giggles* Oh, advice! I love giving advice! And in gratitude for that, treat me to a drink! *gives signals to the bartender* +

<START>
+{{user}}: Hello
+{{char}}: *excitedly* Hello there, dear! Are you new to Axel? Don't worry, I, Aqua the goddess of water, am here to help you! Do you need any assistance? And may I say, I look simply radiant today! *strikes a pose and looks at you with puppy eyes*

+
+
+ + diff --git a/public/notes/2.html b/public/notes/2.html index 707f7749e..65833197c 100644 --- a/public/notes/2.html +++ b/public/notes/2.html @@ -8,10 +8,13 @@
-

Personality

-

3-4 main personality characteristics should be indicated here. These characteristics will play a major role in the character's behavior. Example:

- Cheerful, cunning, provocative +

Personality summary

+

A brief description of the personality. It is added to the chat to a depth of 8-15 messages, so it has a significant impact on the character. Example:

+ Cheerful, cunning, provocative

+ Another example:

+ Aqua likes to do nothing and also likes to get drunk

+

*In Pygmalion model, it is used as a "Personality:" graph

diff --git a/public/notes/6.html b/public/notes/6.html index cb51b76c8..b539f9378 100644 --- a/public/notes/6.html +++ b/public/notes/6.html @@ -21,7 +21,7 @@

5. Select the second request, then in the Headers tab of the inspection panel, scroll down to the very bottom. Look for a header called Authorization:



- The long string (after "Bearer", not including it) is your API key. + The long string (after "Bearer", not including it) is your API key.

*Proxies and Cloudflare-type services may interfere with connection
diff --git a/public/notes/9.html b/public/notes/9.html index 22ba82512..747b85635 100644 --- a/public/notes/9.html +++ b/public/notes/9.html @@ -12,8 +12,10 @@

Anchors are used to increase the length of messages. There are two types of anchors: Character Anchor and Style Anchor

Character Anchor - affects the character played by the AI by motivating him to write longer messages. Looks like [Alexa talks a lot with descriptions]

Style Anchor - affects all AI model, motivating AI to write longer messages. Looks like [Writing style: very long messages]

-

The order of anchors sets the location of anchors in the promt, the first anchor in the order is much higher and has less influence than the one that follows it.

-

To disable anchors, you just need to remove the checkboxes.

+

Anchors Order sets the location of anchors in the promt, the first anchor in the order is much higher and has less influence than second.

+

The second in order anchor is turned on after 8-12 messages, because the first anchor is enough when there are few messages.

+

Sometimes some AI models may not perceive anchors correctly or the AI model already generates sufficiently long messages, so for these cases, to disable anchors, you just need to uncheck the boxes.

+

*It is automatically disabled in Pygmalion, since Pygmalion already generates long enough messages

diff --git a/public/settings.json b/public/settings.json index a485afdd5..bcc184cfc 100644 --- a/public/settings.json +++ b/public/settings.json @@ -1 +1 @@ -{"myname":"You","api_server":"","preset_settings":"gui","preset_settings_novel":"Classic-Euterpe","user_avatar":"legat.png","temp":0.8,"amount_gen":90,"max_context":2048,"anchor_order":0,"style_anchor":true,"character_anchor":true,"main_api":"kobold","api_key_novel":"","rep_pen":1.02,"rep_pen_size":256,"model_novel":"euterpe-v2","temp_novel":1.11,"rep_pen_novel":1.11,"rep_pen_size_novel":320} \ No newline at end of file +{"username":"You","api_server":"http://localhost:5000/api","preset_settings":"gui","preset_settings_novel":"Classic-Euterpe","user_avatar":"legat.png","temp":0.43,"amount_gen":90,"max_context":2048,"anchor_order":0,"style_anchor":true,"character_anchor":true,"main_api":"kobold","api_key_novel":"","rep_pen":1.17,"rep_pen_size":1024,"model_novel":"euterpe-v2","temp_novel":1.11,"rep_pen_novel":1.11,"rep_pen_size_novel":320} \ No newline at end of file diff --git a/public/style.css b/public/style.css index fbe758bda..b7bcb40ab 100644 --- a/public/style.css +++ b/public/style.css @@ -177,7 +177,7 @@ body { display: none; width: 200px; height: 100px; - bottom: 145px; + bottom: 196px; position: relative; //background-color: blue; z-index:1990; @@ -188,7 +188,7 @@ body { display: block; position: absolute; background-color: #191b31F3; - min-width: 160px; + min-width: 205px; z-index: 1; //bottom: 1px; } @@ -275,6 +275,7 @@ body { max-width: 720px; word-wrap: break-word; animation: typing 3.5s steps(40, end), blink-caret .75s step-end infinite; + } .mes_text::after { @@ -323,18 +324,14 @@ textarea{ height: 200px; margin-top: 0px; } -#personality_textarea{ - width: 92%; - height: 65px; - margin-top: 0px; -} + #character_name_pole{ width: 92%; } #firstmessage_textarea{ width: 92%; - height: 180px; + height: 140px; margin-top: 0px; } @@ -406,7 +403,14 @@ input[type=submit] { border-radius: 3px; background-color: #191b31; } - +input[type=button] { + font-weight: bold; + color: #fff; + padding: 0.5em; + border: thin solid rgba(200,200,200,0.2); + border-radius: 3px; + background-color: #191b31; +} .right_menu_button{ display:inline-block; //box-shadow: 0 0 5px -1px rgba(0,0,0,0.2); @@ -419,7 +423,19 @@ input[type=submit] { } - +#character_import_button{ + cursor: pointer; + display: inline-block; + margin-left: 15px;//274px; + margin-top: 6px;//10px; + +} +#character_import_button h2{ + margin-top: auto; + margin-bottom: auto; + font-size: 17px; + color: rgb(188, 193, 200, 0.5); +} .right_menu_button:active { color:red; box-shadow: 0 0 5px -1px rgba(0,0,0,0.05); @@ -484,12 +500,13 @@ input[type=submit] { #selected_chat_div{ display: none; } +#create_date_div{ + display: none; +} #last_mes_div{ display: none; } -#mes_example_div{ - display: none; -} + #rm_button_selected_ch{ } @@ -630,18 +647,19 @@ input[type=submit] { margin-top: 6px; } -#personality_div{ - margin-top: 20px; -} #first_message_div{ margin-top: 20px; } +#advanced_div{ + margin-top: 20px; + cursor: pointer; +} #create_button{ - + opacity: 0.8; margin-left: 9px; margin-top: 8px; margin-bottom: 10px; - font-size: 16px; + font-size: 14px; cursor: pointer; } @@ -675,12 +693,22 @@ input[type=submit] { margin-right: auto; } #delete_button{ + opacity: 0.51;//0.5 cursor: pointer; display: block; float:right; margin-top: 25px; margin-right: 10px; - color: #ffffff66; + color: #ffffff68;//66 +} +#export_button{ + opacity: 0.51; + cursor: pointer; + display: block; + float:right; + margin-top: 25px; + margin-right: 16px; + color: #ffffff68; } #result_info{ margin-left: 10px; @@ -795,12 +823,13 @@ input[type=submit] { min-height: 40px; } #shadow_popup{ + background-color: #00000066; display: none; opacity: 0.0; position: absolute; width: 100%; height: 100vh; - z-index: 2055; + z-index: 2095; } #bgtest{ display: none; @@ -1119,3 +1148,247 @@ label.checkbox :checked + span:after { grid-template-rows: 30px auto; grid-template-columns: auto auto; } + + +#shadow_character_popup{ + display: block; + opacity: 1.0; + position: absolute; + width: 100%; + height: 100vh; + z-index: 2058; +} +#character_popup{ + display: none; + grid-template-rows: 50px 100px 100px 40px auto 45px 45px; + max-width:800px; + height: 83vh; + position: absolute; + z-index: 2065; + background-color: blue; + margin-left: auto; + margin-right: auto; + left: 0; + right: 0; + //text-align: center; + margin-top: 0px; + box-shadow: 0 0 2px rgba(200,200,200,0.1); + padding: 4px; + background: #191b31F5; + border-radius: 1px; +} +#character_popup h5 a{ + color: #936f4a; +} +#character_popup h5 a:hover{ + color: #998e6b; +} +#character_popup h4 a{ + color: #936f4a; +} +#character_popup h4 a:hover{ + color: #998e6b; +} + +#character_popup h3{ + //margin-top: 0px; + margin-bottom: 0px; + margin-left: 0px; +} + +#character_popup h4{ + margin-top: 0px; + margin-bottom: 0px; + margin-left: 0px; +} +#character_popup h5{ + margin-top: 0px; + margin-bottom: 3px; + margin-left: 0px; + color: #757575; + +} + +#character_popup_text{ + margin-left: 36px; +} +#personality_div{ + margin-left: 36px; + margin-top: 20px; +} +#personality_textarea{ + width: 92%; + //height: 65px; + margin-top: 0px; + margin-left: 0px; +} +#scenario_div{ + padding-top: 10px; + margin-left: 36px; +} +#mes_example_div{ + margin-left: 36px; + max-height: 100%; +} +#scenario_pole{ + width: 92%; + margin-left: 0px; +} +#mes_example_textarea{ + margin-left: 36px; + width: 88%; + height: 100%; + margin-top: 0px; +} +#character_popup_ok{ + cursor: pointer; + display: none;//grid; + place-items: center; + height: 40px; + margin-top: 15px; + margin-left: 36px;//36px;329px;/ + //margin-right: auto; + width: 110px;//80px + text-align: center; +} + + + + + + + + +#shadow_select_chat_popup{ + display: none; + opacity: 1.0; + position: absolute; + width: 100%; + height: 100vh; + z-index: 2059; + background-color: #00000066; +} +#select_chat_popup{ + display: block; + grid-template-rows: 50px 100px 100px auto 45px; + max-width:450px; + height: 440px; + position: absolute; + z-index: 2066; + background-color: blue; + margin-left: auto; + margin-right: auto; + left: 0; + right: 0; + //text-align: center; + margin-top: 21vh; + box-shadow: 0 0 2px rgba(200,200,200,0.1); + padding: 4px; + background: #191b31F0; + border-radius: 5px; +} +#select_chat_popup a{ + color: #936f4a; +} +#select_chat_popup a:hover{ + color: #998e6b; +} +#chat_import_button a{ + color: #d5c9be; +} +#chat_import_button a:hover{ + color: #998e6b; +} +#export_div{ + cursor:pointer; +} +#load_select_chat_div{ + position: absolute; + bottom: 154px; + left: 174px; +} +#load_select_chat_div img{ + width: 80px; + height: 80px; +} +#select_chat_div{ + + margin-left: 5px; + margin-top: 30px; + scrollbar-width: thin; + //width: 900px; + //height: 80%; + overflow: hidden; + overflow-y: scroll; + max-width:430px; + height: 350px; +} +#select_chat_div hr{ + margin: 0px; +} +#chat_import_button{ + margin-top: 15px; + margin-left: 13px; + cursor:pointer; +} + +.select_chat_block{ + border-radius: 5px; + margin-right: 10px; + cursor:pointer; + display: grid; + grid-template-columns: 60px auto; + grid-template-rows: 26px auto; +} +.select_chat_block:hover { + background-color: #ffffff07; +} +.select_chat_block[highlight]{ + background-color: #ffffff09;//#c2b07a12; +} + +.select_chat_block .avatar{ + + grid-row: span 2; +} + +.select_chat_block_filename{ + opacity:0.5; +} +.select_chat_block_mes{ + margin-right: 6px; +} +#advanced_div{ + font-size: 14px; + background-repeat: no-repeat; + background-size: 28px; + background-position: 92px 5px; + //background-image: url('img/book5.png'); + width: 92%; + height: 40px; + margin-left: 10px; + font-weight: bold; + color: #ffffffbb; + padding: 0.5em; + border: thin solid rgba(200,200,200,0.2); + border-radius: 3px; + background-color: #191b3133; + opacity: 1.0; + font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; +} +#advanced_book_logo{ + width: 35px; + height: 35px; + display: inline-block; + position: absolute; + top:19px; +} +#character_popup_text_h3{ + display: inline-block; + margin-left: 38px; +} + +#export_character_div{ + display: grid; + grid-template-columns: 340px auto; +} \ No newline at end of file diff --git a/readme.md b/readme.md index 8cebb7b06..e99318b28 100644 --- a/readme.md +++ b/readme.md @@ -1,14 +1,17 @@ -### TavernAI is a adventure atmospheric chat (KoboldAI, NovelAI) +### TavernAI is a adventure atmospheric chat (KoboldAI, NovelAI, Pygmalion) Examples of interface and output:
-[@@@Download TavernAI@@@](https://github.com/TavernAI/TavernAI/archive/refs/heads/main.zip) (Last version) +[@@@Download TavernAI@@@](https://github.com/TavernAI/TavernAI/archive/refs/heads/main.zip) (Last version)

+[TavernAI Discrod](https://discord.gg/zmK2gmr45t)
+[TavetnAI Boosty](https://boosty.to/tavernai) (A common online database with characters is currently being developed)
## Features * Creating characters with personality setup * Choosing name and avatar for your character * Deleting and regenerating messages * Editing any messages * Works with various ai models +* Importing chats from CAI * More longer messages from characters * Choosing atmospheric backgrounds * Creating and easy choosing preset settings diff --git a/server.js b/server.js index c92ec11dc..4430d83ca 100644 --- a/server.js +++ b/server.js @@ -1,9 +1,19 @@ var express = require('express'); var app = express(); var fs = require('fs'); +const readline = require('readline'); + var rimraf = require("rimraf"); const multer = require("multer"); const https = require('https'); +//const PNG = require('pngjs').PNG; +const extract = require('png-chunks-extract'); +const encode = require('png-chunks-encode'); +const PNGtext = require('png-chunk-text'); + +const sharp = require('sharp'); +sharp.cache(false); +const path = require('path'); var Client = require('node-rest-client').Client; var client = new Client(); @@ -28,6 +38,8 @@ var response_getstatus_novel; var response_getlastversion; var api_key_novel; +var is_colab = false; + const jsonParser = express.json(); const urlencodedParser = express.urlencoded({extended: false}); @@ -58,6 +70,7 @@ app.post("/getlastversion", jsonParser, function(request, response_getlastversio }); app.use(express.static(__dirname + "/public")); + app.use(multer({dest:"uploads"}).single("avatar")); app.get("/", function(request, response){     response.sendFile(__dirname + "/public/index.html");  @@ -138,7 +151,10 @@ app.post("/savechat", jsonParser, function(request, response){ //console.log(request); //console.log(request.body.chat); //var bg = "body {background-image: linear-gradient(rgba(19,21,44,0.75), rgba(19,21,44,0.75)), url(../backgrounds/"+request.body.bg+");}"; - fs.writeFile('public/characters/'+request.body.ch_name+'/chats/'+request.body.file_name+'.json', JSON.stringify(request.body.chat), 'utf8', function(err) { + var dir_name = String(request.body.avatar_url).replace('.png',''); + let chat_data = request.body.chat; + let jsonlData = chat_data.map(JSON.stringify).join('\n'); + fs.writeFile('public/chats/'+dir_name+"/"+request.body.file_name+'.jsonl', jsonlData, 'utf8', function(err) { if(err) { response.send(err); return console.log(err); @@ -157,32 +173,65 @@ app.post("/getchat", jsonParser, function(request, response){ //console.log(request); //console.log(request.body.chat); //var bg = "body {background-image: linear-gradient(rgba(19,21,44,0.75), rgba(19,21,44,0.75)), url(../backgrounds/"+request.body.bg+");}"; + var dir_name = String(request.body.avatar_url).replace('.png',''); - fs.stat('public/characters/'+request.body.ch_name+'/chats/'+request.body.file_name+'.json', function(err, stat) { - if (err == null) { - fs.readFile('public/characters/'+request.body.ch_name+'/chats/'+request.body.file_name+'.json', 'utf8', (err, data) => { - if (err) { - console.error(err); - response.send(err); - return; - } - //console.log(data); - response.send(data); - - - }); - }else{ + fs.stat('public/chats/'+dir_name, function(err, stat) { + + if(stat === undefined){ + + fs.mkdirSync('public/chats/'+dir_name); response.send({}); - //return console.log(err); return; + }else{ + + if(err === null){ + + fs.stat('public/chats/'+dir_name+"/"+request.body.file_name+".jsonl", function(err, stat) { + + if (err === null) { + + if(stat !== undefined){ + fs.readFile('public/chats/'+dir_name+"/"+request.body.file_name+".jsonl", 'utf8', (err, data) => { + if (err) { + console.error(err); + response.send(err); + return; + } + //console.log(data); + const lines = data.split('\n'); + + // Iterate through the array of strings and parse each line as JSON + const jsonData = lines.map(JSON.parse); + response.send(jsonData); + + + }); + } + }else{ + response.send({}); + //return console.log(err); + return; + } + }); + }else{ + console.error(err); + response.send({}); + return; + } } + + }); + }); app.post("/getstatus", jsonParser, function(request, response_getstatus = response){ if(!request.body) return response_getstatus.sendStatus(400); - - api_server = request.body.api_server; + if(is_colab === true){ + api_server = '127.0.0.1:5000'; + }else{ + api_server = request.body.api_server; + } if(api_server.indexOf('localhost') != -1){ api_server = api_server.replace('localhost','127.0.0.1'); } @@ -211,58 +260,65 @@ app.post("/getstatus", jsonParser, function(request, response_getstatus = respon response_getstatus.send({result: "no_connection"}); }); }); - +function checkServer(){ + //console.log('Check run###################################################'); + api_server = 'http://127.0.0.1:5000'; + var args = { + headers: { "Content-Type": "application/json" } + }; + client.get(api_server+"/v1/model",args, function (data, response) { + console.log(data.result); + //console.log('###################################################'); + console.log(data); + }).on('error', function (err) { + console.log(err); + //console.log(''); + //console.log('something went wrong on the request', err.request.options); + //console.log('errorrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr'); + }); +} //***************** Main functions +function charaFormatData(data){ + var char = {"name": data.ch_name, "description": data.description, "personality": data.personality, "first_mes": data.first_mes, "avatar": 'none', "chat": Date.now(), "mes_example": data.mes_example, "scenario": data.scenario, "create_date": Date.now()}; + return char; +} app.post("/createcharacter", urlencodedParser, function(request, response){ - response_create = response; if(!request.body) return response.sendStatus(400); - if (!fs.existsSync('public/characters/'+request.body.ch_name+'/'+request.body.ch_name+'.json')){ - if(!fs.existsSync('public/characters/'+request.body.ch_name) )fs.mkdirSync('public/characters/'+request.body.ch_name); - if(!fs.existsSync('public/characters/'+request.body.ch_name+'/chats')) fs.mkdirSync('public/characters/'+request.body.ch_name+'/chats'); - if(!fs.existsSync('public/characters/'+request.body.ch_name+'/avatars')) fs.mkdirSync('public/characters/'+request.body.ch_name+'/avatars'); + if (!fs.existsSync('public/characters/'+request.body.ch_name+'.png')){ + if(!fs.existsSync('public/chats/'+request.body.ch_name) )fs.mkdirSync('public/chats/'+request.body.ch_name); + //if(!fs.existsSync('public/characters/'+request.body.ch_name+'/chats')) fs.mkdirSync('public/characters/'+request.body.ch_name+'/chats'); + //if(!fs.existsSync('public/characters/'+request.body.ch_name+'/avatars')) fs.mkdirSync('public/characters/'+request.body.ch_name+'/avatars'); let filedata = request.file;     //console.log(filedata.mimetype); var fileType = ".png"; var img_file = "ai"; var img_path = "public/img/"; + + var char = charaFormatData(request.body);//{"name": request.body.ch_name, "description": request.body.description, "personality": request.body.personality, "first_mes": request.body.first_mes, "avatar": 'none', "chat": Date.now(), "last_mes": '', "mes_example": ''}; + char = JSON.stringify(char);     if(!filedata){ - var char = {"name": request.body.ch_name, "description": request.body.description, "personality": request.body.personality, "first_mes": request.body.first_mes, "avatar": 'none', "chat": Date.now(), "last_mes": '', "mes_example": ''}; - char = JSON.stringify(char); - fs.writeFile('public/characters/'+request.body.ch_name+"/"+request.body.ch_name+".json", char, 'utf8', function(err) { - if(err) { - response.send(err); - return console.log(err); - }else{ - response_create.send('ok'); - } - }); + + charaWrite('./public/img/fluffy.png', char, request.body.ch_name, response); + + //fs.writeFile('public/characters/'+request.body.ch_name+"/"+request.body.ch_name+".json", char, 'utf8', function(err) { + //if(err) { + //response.send(err); + //return console.log(err); + //}else{ + + //} + //}); }else{ - img_path = "uploads/"; + img_path = "./uploads/"; img_file = filedata.filename if (filedata.mimetype == "image/jpeg") fileType = ".jpeg"; if (filedata.mimetype == "image/png") fileType = ".png"; if (filedata.mimetype == "image/gif") fileType = ".gif"; if (filedata.mimetype == "image/bmp") fileType = ".bmp"; - fs.copyFile(img_path+img_file, 'public/characters/'+request.body.ch_name+'/avatars/'+img_file+fileType, (err) => { - if(err) { - response.send(err); - return console.log(err); - } - var char = {"name": request.body.ch_name, "description": request.body.description, "personality": request.body.personality, "first_mes": request.body.first_mes, "avatar": img_file+fileType, "chat": Date.now(), "last_mes": '', "mes_example": ''}; - char = JSON.stringify(char); - fs.writeFile('public/characters/'+request.body.ch_name+"/"+request.body.ch_name+".json", char, 'utf8', function(err) { - if(err) { - response.send(err); - return console.log(err); - }else{ - response_create.send('ok'); - } - }); - //console.log('The image was copied from temp directory.'); - }); + charaWrite(img_path+img_file, char, request.body.ch_name, response); } //console.log("The file was saved."); @@ -274,79 +330,163 @@ app.post("/createcharacter", urlencodedParser, function(request, response){ //response.redirect("https://metanit.com") }); + + app.post("/editcharacter", urlencodedParser, function(request, response){ if(!request.body) return response.sendStatus(400); - response_edit = response; let filedata = request.file;     //console.log(filedata.mimetype); var fileType = ".png"; var img_file = "ai"; - var img_path = "public/img/"; + var img_path = "./public/characters/"; + + var char = charaFormatData(request.body);//{"name": request.body.ch_name, "description": request.body.description, "personality": request.body.personality, "first_mes": request.body.first_mes, "avatar": request.body.avatar_url, "chat": request.body.chat, "last_mes": request.body.last_mes, "mes_example": ''}; + char.chat = request.body.chat; + char.create_date = request.body.create_date; + + char = JSON.stringify(char);     if(!filedata){ - //console.log(request.body.avatar_url); - var char = {"name": request.body.ch_name, "description": request.body.description, "personality": request.body.personality, "first_mes": request.body.first_mes, "avatar": request.body.avatar_url, "chat": request.body.chat, "last_mes": request.body.last_mes, "mes_example": ''}; - char = JSON.stringify(char); - fs.writeFile('public/characters/'+request.body.ch_name+"/"+request.body.ch_name+".json", char, 'utf8', function(err) { - if(err) { - response.send(err); - return console.log(err); - }else{ - response_edit.send('Character saved'); - } - }); + + charaWrite(img_path+request.body.avatar_url, char, request.body.ch_name, response, 'Character saved'); }else{ - + //console.log(filedata.filename); img_path = "uploads/"; - img_file = filedata.filename - if (filedata.mimetype == "image/jpeg") fileType = ".jpeg"; - if (filedata.mimetype == "image/png") fileType = ".png"; - if (filedata.mimetype == "image/gif") fileType = ".gif"; - if (filedata.mimetype == "image/bmp") fileType = ".bmp"; - fs.copyFile(img_path+img_file, 'public/characters/'+request.body.ch_name+'/avatars/'+img_file+fileType, (err) => { - if(err) { - response.send(err); - return console.log(err); - } - var char = {"name": request.body.ch_name, "description": request.body.description, "personality": request.body.personality, "first_mes": request.body.first_mes, "avatar": img_file+fileType, "chat": request.body.chat, "last_mes": request.body.last_mes, "mes_example": ''}; - char = JSON.stringify(char); - fs.writeFile('public/characters/'+request.body.ch_name+"/"+request.body.ch_name+".json", char, 'utf8', function(err) { - if(err) { - response.send(err); - return console.log(err); - }else{ - response_edit.send('Character saved'); - } - }); - //console.log('The image was copied from temp directory.'); - }); + img_file = filedata.filename; + + charaWrite(img_path+img_file, char, request.body.ch_name, response, 'Character saved'); + //response.send('Character saved'); } }); app.post("/deletecharacter", urlencodedParser, function(request, response){ if(!request.body) return response.sendStatus(400); - rimraf('public/characters/'+request.body.ch_name, (err) => { + rimraf('public/characters/'+request.body.avatar_url, (err) => { if(err) { response.send(err); return console.log(err); }else{ //response.redirect("/"); - response.send('ok'); + let dir_name = request.body.avatar_url; + rimraf('public/chats/'+dir_name.replace('.png',''), (err) => { + if(err) { + response.send(err); + return console.log(err); + }else{ + //response.redirect("/"); + + response.send('ok'); + } + }); } }); }); +async function charaWrite(img_url, data, name, response = undefined, mes = 'ok'){ + try { + // Load the image in any format + sharp.cache(false); + var image = await sharp(img_url).resize(170, 234).toFormat('png').toBuffer(); + // Convert the image to PNG format + //const pngImage = image.toFormat('png'); + + // Resize the image to 100x100 + //const resizedImage = pngImage.resize(100, 100); + + // Get the chunks + var chunks = extract(image); +  var tEXtChunks = chunks.filter(chunk => chunk.name === 'tEXt'); + + // Remove all existing tEXt chunks + for (var tEXtChunk of tEXtChunks) { + chunks.splice(chunks.indexOf(tEXtChunk), 1); + } + // Add new chunks before the IEND chunk + var base64EncodedData = Buffer.from(data, 'utf8').toString('base64'); + chunks.splice(-1, 0, PNGtext.encode('chara', base64EncodedData)); + //chunks.splice(-1, 0, text.encode('lorem', 'ipsum')); + + fs.writeFileSync('public/characters/'+name+'.png', new Buffer.from(encode(chunks))); + if(response !== undefined) response.send(mes); + + + } catch (err) { + console.log(err); + if(response !== undefined) response.send(err); + } +} + + + + + +function charaRead(img_url){ + sharp.cache(false); + const buffer = fs.readFileSync(img_url); + const chunks = extract(buffer); +   + const textChunks = chunks.filter(function (chunk) { +   return chunk.name === 'tEXt'; + }).map(function (chunk) { + //console.log(text.decode(chunk.data)); +   return PNGtext.decode(chunk.data); + }); + var base64DecodedData = Buffer.from(textChunks[0].text, 'base64').toString('utf8'); + return base64DecodedData;//textChunks[0].text; + //console.log(textChunks[0].keyword); // 'hello' + //console.log(textChunks[0].text);    // 'world' +} app.post("/getcharacters", jsonParser, function(request, response){ - var directories = getDirectories("public/characters"); + fs.readdir("public/characters", (err, files) => { + if (err) { + console.error(err); + return; + } + + const pngFiles = files.filter(file => file.endsWith('.png')); + + //console.log(pngFiles); + characters = {}; + var i = 0; + pngFiles.forEach(item => { + //console.log(item); + var img_data = charaRead('./public/characters/'+item); + try { + let jsonObject = JSON.parse(img_data); + jsonObject.avatar = item; + //console.log(jsonObject); + characters[i] = {}; + characters[i] = jsonObject; + i++; + } catch (error) { + if (error instanceof SyntaxError) { + console.log("String [" + (i) + "] is not valid JSON!"); + } else { + console.log("An unexpected error occurred: ", error); + } + } + }); + //console.log(characters); + response.send(JSON.stringify(characters)); + }); + //var directories = getDirectories("public/characters"); //console.log(directories[0]); - characters = {}; - character_i = 0; - getCharaterFile(directories, response,0); + //characters = {}; + //character_i = 0; + //getCharaterFile(directories, response,0); }); app.post("/getbackgrounds", jsonParser, function(request, response){ var images = getImages("public/backgrounds"); + if(is_colab === true){ + images = ['tavern.png']; + } response.send(JSON.stringify(images)); +}); +app.post("/iscolab", jsonParser, function(request, response){ + + response.send({is_colab:is_colab}); + }); app.post("/getuseravatars", jsonParser, function(request, response){ var images = getImages("public/User Avatars"); @@ -495,55 +635,8 @@ app.post('/getsettings', jsonParser, (request, response) => { //Wintermute's cod }); }); -app.post("/getsettings2", jsonParser, function(request, response){//Elder - var koboldai_settings = []; - var koboldai_setting_names = []; - fs.stat('public/settings.json', function(err, stat) { - if (err == null) { - fs.readFile('public/settings.json', 'utf8', (err, data) => { - if (err) { - console.error(err); - return; - } - var files = getKoboldSettingFiles("public/KoboldAI Settings"); - - var get_count_files = 0; - var count = 0; - files.forEach(function(item, i, arr) { - if(item.substr(item.length-9,9) == '.settings'){ - fs.readFile("public/KoboldAI Settings/"+item, 'utf8', (err, data2) => { - if (err) { - console.error(err); - return; - } - get_count_files++; - koboldai_settings[count] = data2; - koboldai_setting_names[count] = item.substr(0,item.length-9); - count++; - if(files.length <= get_count_files) sendData(data); - - }); - }else{ - get_count_files++; - if(files.length <= get_count_files) sendData(data); - } - }); - - }); - }else{ - response.send({result: "file not find"}); - } - }); - function sendData(data){ - var data3 = {settings:data, koboldai_settings:koboldai_settings, koboldai_setting_names:koboldai_setting_names}; - //console.log(data3); - response.send(data3); - } - -}); - -function getCharaterFile(directories,response,i){ +function getCharaterFile(directories,response,i){ //old need del if(directories.length > i){ fs.stat('public/characters/'+directories[i]+'/'+directories[i]+".json", function(err, stat) { @@ -590,6 +683,7 @@ return new Date(fs.statSync(path + '/' + a).mtime) - new Date(fs.statSync(path + //***********Novel.ai API app.post("/getstatus_novelai", jsonParser, function(request, response_getstatus_novel =response){ + if(!request.body) return response_getstatus_novel.sendStatus(400);     api_key_novel = request.body.key; var data = {}; @@ -645,8 +739,8 @@ app.post("/generate_novelai", jsonParser, function(request, response_generate_no "return_full_text": request.body.return_full_text, "prefix": request.body.prefix, "order": request.body.order - } -}; + } + }; var args = { data: data, @@ -681,7 +775,226 @@ app.post("/generate_novelai", jsonParser, function(request, response_generate_no }); }); +app.post("/getallchatsofchatacter", jsonParser, function(request, response){ + if(!request.body) return response.sendStatus(400); + var char_dir = (request.body.avatar_url).replace('.png','') + fs.readdir('public/chats/'+char_dir, (err, files) => { + if (err) { + console.error(err); + response.send({error: true}); + return; + } + + // filter for JSON files + const jsonFiles = files.filter(file => path.extname(file) === '.jsonl'); + + // sort the files by name + //jsonFiles.sort().reverse(); + + // print the sorted file names + var chatData = {}; + let ii = jsonFiles.length; + for(let i = jsonFiles.length-1; i >= 0; i--){ + const file = jsonFiles[i]; + + const fileStream = fs.createReadStream('public/chats/'+char_dir+'/'+file); + const rl = readline.createInterface({ + input: fileStream, + crlfDelay: Infinity + }); + + let lastLine; + + rl.on('line', (line) => { + lastLine = line; + }); + + rl.on('close', () => { + if(lastLine){ + let jsonData = JSON.parse(lastLine); + if(jsonData.name !== undefined){ + chatData[i] = {}; + chatData[i]['file_name'] = file; + chatData[i]['mes'] = jsonData['mes']; + ii--; + if(ii === 0){ + response.send(chatData); + } + }else{ + return; + } + } + rl.close(); + }); + } + }); + +}); +function getPngName(file){ + if (fs.existsSync('./public/characters/'+file+'.png')) { + file = file+'1'; + } + return file; +} +app.post("/importcharacter", urlencodedParser, function(request, response){ + if(!request.body) return response.sendStatus(400); + + let png_name = ''; + let filedata = request.file; +     //console.log(filedata.filename); + var format = request.body.file_type; + //console.log(format); +     if(filedata){ + if(format == 'json'){ + fs.readFile('./uploads/'+filedata.filename, 'utf8', (err, data) => { + if (err){ + console.log(err); + response.send({error:true}); + } + const jsonData = JSON.parse(data); + + if(jsonData.char_name !== undefined){//json Pygmalion notepad + png_name = getPngName(jsonData.char_name); + var char = {"name": jsonData.char_name, "description": jsonData.char_persona, "personality": '', "first_mes": jsonData.char_greeting, "avatar": 'none', "chat": Date.now(), "mes_example": jsonData.example_dialogue, "scenario": jsonData.world_scenario, "create_date": Date.now()}; + char = JSON.stringify(char); + charaWrite('./public/img/fluffy.png', char, png_name, response, {file_name: png_name}); + }else if(jsonData.name !== undefined){ + png_name = getPngName(jsonData.name); + var char = {"name": jsonData.name, "description": jsonData.description, "personality": jsonData.personality, "first_mes": jsonData.first_mes, "avatar": 'none', "chat": Date.now(), "mes_example": '', "scenario": '', "create_date": Date.now()}; + char = JSON.stringify(char); + charaWrite('./public/img/fluffy.png', char, png_name, response, {file_name: png_name}); + }else{ + console.log('Incorrect character format .json'); + response.send({error:true}); + } + }); + }else{ + try{ + + var img_data = charaRead('./uploads/'+filedata.filename); + let jsonObject = JSON.parse(img_data); + png_name = getPngName(jsonObject.name); + if(jsonObject.name !== undefined){ + fs.copyFile('./uploads/'+filedata.filename, 'public/characters/'+png_name+'.png', (err) => { + if(err) { + response.send({error:true}); + return console.log(err); + }else{ + //console.log(img_file+fileType); + response.send({file_name: png_name}); + } + //console.log('The image was copied from temp directory.'); + }); + } + }catch(err){ + console.log(err); + response.send({error:true}); + } + } + //charaWrite(img_path+img_file, char, request.body.ch_name, response); + } + //console.log("The file was saved."); + + +    //console.log(request.body); +    //response.send(request.body.ch_name); + + //response.redirect("https://metanit.com") +}); + +app.post("/importchat", urlencodedParser, function(request, response){ + if(!request.body) return response.sendStatus(400); + + var format = request.body.file_type; + let filedata = request.file; + let avatar_url = (request.body.avatar_url).replace('.png', ''); + let ch_name = request.body.character_name; +     //console.log(filedata.filename); + //var format = request.body.file_type; + //console.log(format); + //console.log(1); +     if(filedata){ + + if(format === 'json'){ + fs.readFile('./uploads/'+filedata.filename, 'utf8', (err, data) => { + + if (err){ + console.log(err); + response.send({error:true}); + } + + const jsonData = JSON.parse(data); + var new_chat = []; + if(jsonData.histories !== undefined){ + let i = 0; + new_chat[i] = {}; + new_chat[0]['user_name'] = 'You'; + new_chat[0]['character_name'] = ch_name; + new_chat[0]['create_date'] = Date.now(); + i++; + jsonData.histories.histories[0].msgs.forEach(function(item) { + new_chat[i] = {}; + if(item.src.is_human == true){ + new_chat[i]['name'] = 'You'; + }else{ + new_chat[i]['name'] = ch_name; + } + new_chat[i]['is_user'] = item.src.is_human; + new_chat[i]['send_date'] = Date.now(); + new_chat[i]['mes'] = item.text; + i++; + }); + const chatJsonlData = new_chat.map(JSON.stringify).join('\n'); + fs.writeFile('public/chats/'+avatar_url+'/'+Date.now()+'.jsonl', chatJsonlData, 'utf8', function(err) { + if(err) { + response.send(err); + return console.log(err); + //response.send(err); + }else{ + //response.redirect("/"); + response.send({res:true}); + } + }); + + }else{ + response.send({error:true}); + return; + } + + }); + } + if(format === 'jsonl'){ + const fileStream = fs.createReadStream('./uploads/'+filedata.filename); + const rl = readline.createInterface({ + input: fileStream, + crlfDelay: Infinity + }); + + rl.once('line', (line) => { + let jsonData = JSON.parse(line); + + if(jsonData.user_name !== undefined){ + fs.copyFile('./uploads/'+filedata.filename, 'public/chats/'+avatar_url+'/'+Date.now()+'.jsonl', (err) => { + if(err) { + response.send({error:true}); + return console.log(err); + }else{ + response.send({res:true}); + return; + } + }); + }else{ + //response.send({error:true}); + return; + } + rl.close(); + }); + } + + } + +}); @@ -690,15 +1003,270 @@ app.post("/generate_novelai", jsonParser, function(request, response_generate_no app.listen(server_port, function() { - console.log('TavernAI started: http://127.0.0.1:'+server_port); - - + if(process.env.colab !== undefined){ + if(process.env.colab == 2){ + is_colab = true; + } + } + console.log('TavernAI started: http://127.0.0.1:'+server_port); + if (fs.existsSync('public/characters/update.txt')) { //&& !is_colab <- this need to put again + convertStage1(); + } + }); +//#####################CONVERTING IN NEW FORMAT######################## + +var charactersB = {};//B - Backup +var character_ib = 0; + +var directoriesB = {}; +function convertStage1(){ + //if (!fs.existsSync('public/charactersBackup')) { + //fs.mkdirSync('public/charactersBackup'); + //copyFolder('public/characters/', 'public/charactersBackup'); + //} + + var directories = getDirectories2("public/characters"); + //console.log(directories[0]); + charactersB = {}; + character_ib = 0; + var folderForDel = {}; + getCharaterFile2(directories, 0); +} +function convertStage2(){ + //directoriesB = JSON.parse(directoriesB); + //console.log(directoriesB); + var mes = true; + for (const key in directoriesB) { + if(mes){ + console.log('***'); + console.log('The update of the character format has begun...'); + console.log('***'); + mes = false; + } + //console.log(`${key}: ${directoriesB[key]}`); + //console.log(JSON.parse(charactersB[key])); + //console.log(directoriesB[key]); + + var char = JSON.parse(charactersB[key]); + char.create_date = Date.now(); + charactersB[key] = JSON.stringify(char); + var avatar = 'public/img/fluffy.png'; + if(char.avatar !== 'none'){ + avatar = 'public/characters/'+char.name+'/avatars/'+char.avatar; + } + + charaWrite(avatar, charactersB[key], directoriesB[key]); + + const files = fs.readdirSync('public/characters/'+directoriesB[key]+'/chats'); + if (!fs.existsSync('public/chats/'+char.name)) { + fs.mkdirSync('public/chats/'+char.name); + } + files.forEach(function(file) { + // Read the contents of the file + + const fileContents = fs.readFileSync('public/characters/'+directoriesB[key]+'/chats/' + file, 'utf8'); + + // Iterate through the array of strings and parse each line as JSON + let chat_data = JSON.parse(fileContents); + let new_chat_data = []; + let this_chat_user_name = 'You'; + let is_pass_0 = false; + if(chat_data[0].indexOf('') !== -1){ + this_chat_user_name = chat_data[0].substr(''.length, chat_data[0].length); + is_pass_0 = true; + } + let i = 0; + let ii = 0; + new_chat_data[i] = {user_name:'You', character_name:char.name, create_date: Date.now()}; + i++; + ii++; + chat_data.forEach(function(mes) { + if(!(i === 1 && is_pass_0)){ + if(mes.indexOf('') === -1 && mes.indexOf('') === -1){ + new_chat_data[ii] = {}; + let is_name = false; + if(mes.trim().indexOf(this_chat_user_name+':') !== 0){ + if(mes.trim().indexOf(char.name+':') === 0){ + mes = mes.replace(char.name+':',''); + is_name = true; + } + new_chat_data[ii]['name'] = char.name; + new_chat_data[ii]['is_user'] = false; + new_chat_data[ii]['is_name'] = is_name; + new_chat_data[ii]['send_date'] = Date.now(); + + }else{ + mes = mes.replace(this_chat_user_name+':',''); + new_chat_data[ii]['name'] = 'You'; + new_chat_data[ii]['is_user'] = true; + new_chat_data[ii]['is_name'] = true; + new_chat_data[ii]['send_date'] = Date.now(); + + } + new_chat_data[ii]['mes'] = mes.trim(); + ii++; + } + } + i++; + + }); + const jsonlData = new_chat_data.map(JSON.stringify).join('\n'); + // Write the contents to the destination folder + fs.writeFileSync('public/chats/'+char.name+'/' + file+'l', jsonlData); + }); + //fs.rmSync('public/characters/'+directoriesB[key],{ recursive: true }); + console.log(char.name+' update!'); + } + //removeFolders('public/characters'); + fs.unlinkSync('public/characters/update.txt'); + if(mes == false){ + console.log('***'); + console.log('Сharacter format update completed successfully!'); + console.log('***'); + console.log('Now you can delete these folders, they are no longer used by TavernAI:'); + } + for (const key in directoriesB) { + console.log('public/characters/'+directoriesB[key]); + } +} +function removeFolders(folder) { + const files = fs.readdirSync(folder); + files.forEach(function(file) { + const filePath = folder + '/' + file; + const stat = fs.statSync(filePath); + if (stat.isDirectory()) { + removeFolders(filePath); + fs.rmdirSync(filePath); + } + }); +} + +function copyFolder(src, dest) { + const files = fs.readdirSync(src); + files.forEach(function(file) { + const filePath = src + '/' + file; + const stat = fs.statSync(filePath); + if (stat.isFile()) { + fs.copyFileSync(filePath, dest + '/' + file); + } else if (stat.isDirectory()) { + fs.mkdirSync(dest + '/' + file); + copyFolder(filePath, dest + '/' + file); + } + }); +} + + +function getDirectories2(path) { + return fs.readdirSync(path) + .filter(function (file) { + return fs.statSync(path + '/' + file).isDirectory(); + }) + .sort(function (a, b) { + return new Date(fs.statSync(path + '/' + a).mtime) - new Date(fs.statSync(path + '/' + b).mtime); + }) + .reverse(); +} +function getCharaterFile2(directories,i){ + if(directories.length > i){ + fs.stat('public/characters/'+directories[i]+'/'+directories[i]+".json", function(err, stat) { + if (err == null) { + fs.readFile('public/characters/'+directories[i]+'/'+directories[i]+".json", 'utf8', (err, data) => { + if (err) { + console.error(err); + return; + } + //console.log(data); + if (!fs.existsSync('public/characters/'+directories[i]+'.png')) { + charactersB[character_ib] = {}; + charactersB[character_ib] = data; + directoriesB[character_ib] = directories[i]; + character_ib++; + } + i++; + getCharaterFile2(directories,i); + }); + }else{ + i++; + getCharaterFile2(directories,i); + } + }); + }else{ + convertStage2(); + } +} /* +* async function aaa2(){ +try { + // Load the image in any format + + const image = await sharp('./original.jpg').resize(100, 100).toFormat('png'); + + image.metadata((err, metadata) => { + if (err) throw err; + if (!metadata.chunks) { + metadata.chunks = []; + } +const textData = text.encode('hello', 'world'); +const textBuffer = Buffer.from(`${textData.keyword}\0${textData.text}`); +metadata.chunks.push({ + type: 'tEXt', + data: textBuffer +}); + return metadata; + }) + .toFile('test-out.png') + .then(() => { + console.log('PNG image with tEXt chunks has been saved.'); + }) + .catch((err) => { + console.log(err); + }); +} catch (err) { + console.log(err); +} +} +* function writePNG(){ + +const buffer = fs.readFileSync('test-out.png'); +const chunks = extract(buffer); + const tEXtChunks = chunks.filter(chunk => chunk.name === 'tEXt'); + +// Remove all existing tEXt chunks +for (const tEXtChunk of tEXtChunks) { + chunks.splice(chunks.indexOf(tEXtChunk), 1); +} +// Add new chunks before the IEND chunk +chunks.splice(-1, 0, text.encode('hello', 'world')); +chunks.splice(-1, 0, text.encode('lorem', 'ipsum')); +  +fs.writeFileSync( +  'test-out.png', +  new Buffer.from(encode(chunks)) +); +} + * function readPNG2(){ + sharp('./test-out.png') + .metadata() + .then((metadata) => { + console.log(metadata); + if (!metadata.chunks) { + console.log("No tEXt chunks found in the image file"); + } + const textChunks = metadata.chunks.filter((chunk) => chunk.type === 'tEXt'); + textChunks.forEach((textChunk) => { + const textData = JSON.parse(textChunk.data.toString()); + console.log(textData); + }); + }) + .catch((err) => { + console.log(err); + }); + } const requestListener = function (req, res) { fs.readFile(__dirname + "/index.html") .then(contents => {