From ff95ba347d2187628e22c3bc9a6622bf40e3f3e8 Mon Sep 17 00:00:00 2001 From: Gilad S Date: Thu, 8 Feb 2024 02:24:02 +0200 Subject: [PATCH 01/22] feat: get VRAM usage --- llama/CMakeLists.txt | 71 ++++++++++++++++++++++- llama/addon.cpp | 67 +++++++++++++++++++-- llama/gpuInfo/cuda-gpu-info.cu | 99 ++++++++++++++++++++++++++++++++ llama/gpuInfo/cuda-gpu-info.h | 7 +++ llama/gpuInfo/metal-gpu-info.h | 5 ++ llama/gpuInfo/metal-gpu-info.mm | 17 ++++++ package.json | 2 + src/bindings/AddonTypes.ts | 6 +- src/bindings/Llama.ts | 10 ++++ src/cli/cli.ts | 2 + src/cli/commands/DebugCommand.ts | 50 ++++++++++++++++ 11 files changed, 328 insertions(+), 8 deletions(-) create mode 100644 llama/gpuInfo/cuda-gpu-info.cu create mode 100644 llama/gpuInfo/cuda-gpu-info.h create mode 100644 llama/gpuInfo/metal-gpu-info.h create mode 100644 llama/gpuInfo/metal-gpu-info.mm create mode 100644 src/cli/commands/DebugCommand.ts diff --git a/llama/CMakeLists.txt b/llama/CMakeLists.txt index 8991cbbe..db5028d8 100644 --- a/llama/CMakeLists.txt +++ b/llama/CMakeLists.txt @@ -19,16 +19,83 @@ execute_process(COMMAND node -p "require('node-addon-api').include.slice(1,-1)" include_directories(${NODE_ADDON_API_DIR} ${CMAKE_JS_INC}) add_subdirectory("llama.cpp") +include_directories("gpuInfo") include_directories("llama.cpp") include_directories("./llama.cpp/common") -file(GLOB SOURCE_FILES "addon.cpp") +if (LLAMA_CUBLAS) + cmake_minimum_required(VERSION 3.17) -add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${CMAKE_JS_SRC}) + find_package(CUDAToolkit) + if (CUDAToolkit_FOUND) + message(STATUS "Using cuBLAS for GPU info") + + enable_language(CUDA) + + set(GPU_INFO_HEADERS ${GPU_INFO_HEADERS} gpuInfo/cuda-gpu-info.h) + set(GPU_INFO_SOURCES ${GPU_INFO_SOURCES} gpuInfo/cuda-gpu-info.cu) + + add_compile_definitions(GPU_INFO_USE_CUBLAS) + + set(GPU_INFO_EXTRA_LIBS ${GPU_INFO_EXTRA_LIBS} CUDA::cuda_driver) + else() + message(WARNING "cuBLAS not found. Not using it for GPU info") + endif() +endif() + +if (LLAMA_HIPBLAS) + list(APPEND CMAKE_PREFIX_PATH /opt/rocm) + + if (NOT ${CMAKE_C_COMPILER_ID} MATCHES "Clang") + message(WARNING "Only LLVM is supported for HIP, hint: CC=/opt/rocm/llvm/bin/clang") + endif() + if (NOT ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") + message(WARNING "Only LLVM is supported for HIP, hint: CXX=/opt/rocm/llvm/bin/clang++") + endif() + + find_package(hip) + find_package(hipblas) + find_package(rocblas) + + if (${hipblas_FOUND} AND ${hip_FOUND}) + message(STATUS "Using HIP and hipBLAS for GPU info") + add_compile_definitions(GPU_INFO_USE_HIPBLAS GPU_INFO_USE_CUBLAS) + add_library(gpu-info-rocm OBJECT gpuInfo/cuda-gpu-info.cu gpuInfo/cuda-gpu-info.h) + set_source_files_properties(gpuInfo/cuda-gpu-info.cu PROPERTIES LANGUAGE CXX) + target_link_libraries(gpu-info-rocm PRIVATE hip::device PUBLIC hip::host roc::rocblas roc::hipblas) + + set(GPU_INFO_EXTRA_LIBS ${GPU_INFO_EXTRA_LIBS} gpu-info-rocm) + else() + message(WARNING "hipBLAS or HIP not found. Try setting CMAKE_PREFIX_PATH=/opt/rocm") + endif() +endif() + +if (LLAMA_METAL) + find_library(FOUNDATION_LIBRARY Foundation REQUIRED) + find_library(METAL_FRAMEWORK Metal REQUIRED) + find_library(METALKIT_FRAMEWORK MetalKit REQUIRED) + + message(STATUS "Using Metal for GPU info") + set(GPU_INFO_HEADERS ${GPU_INFO_HEADERS} gpuInfo/metal-gpu-info.h) + set(GPU_INFO_SOURCES ${GPU_INFO_SOURCES} gpuInfo/metal-gpu-info.mm) + + add_compile_definitions(GPU_INFO_USE_METAL) + + set(GPU_INFO_EXTRA_LIBS ${GPU_INFO_EXTRA_LIBS} + ${FOUNDATION_LIBRARY} + ${METAL_FRAMEWORK} + ${METALKIT_FRAMEWORK} + ) +endif() + +file(GLOB SOURCE_FILES "addon.cpp" ${GPU_INFO_SOURCES}) + +add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${CMAKE_JS_SRC} ${GPU_INFO_HEADERS}) set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "" SUFFIX ".node") target_link_libraries(${PROJECT_NAME} ${CMAKE_JS_LIB}) target_link_libraries(${PROJECT_NAME} "llama") target_link_libraries(${PROJECT_NAME} "common") +target_link_libraries(${PROJECT_NAME} ${GPU_INFO_EXTRA_LIBS}) if(MSVC AND CMAKE_JS_NODELIB_DEF AND CMAKE_JS_NODELIB_TARGET) # Generate node.lib diff --git a/llama/addon.cpp b/llama/addon.cpp index 52dba5ad..4bd72dc9 100644 --- a/llama/addon.cpp +++ b/llama/addon.cpp @@ -9,12 +9,22 @@ #include "llama.h" #include "napi.h" +#ifdef GPU_INFO_USE_CUBLAS +# include "ggml-cuda.h" +#endif +#ifdef GPU_INFO_USE_METAL +# include "gpuInfo/metal-gpu-info.h" +#endif + + struct addon_logger_log { public: const int logLevelNumber; const std::stringstream* stringStream; }; +static void addonLlamaCppLogCallback(ggml_log_level level, const char* text, void* user_data); + using AddonThreadSafeLogCallbackFunctionContext = Napi::Reference; void addonCallJsLogCallback( Napi::Env env, Napi::Function callback, AddonThreadSafeLogCallbackFunctionContext* context, addon_logger_log* data @@ -40,6 +50,43 @@ std::string addon_model_token_to_piece(const struct llama_model* model, llama_to return std::string(result.data(), result.size()); } +#ifdef GPU_INFO_USE_CUBLAS +void lodCudaError(const char* message) { + addonLlamaCppLogCallback(GGML_LOG_LEVEL_ERROR, (std::string("CUDA error: ") + std::string(message)).c_str(), nullptr); +} +#endif + +Napi::Value getGpuVramInfo(const Napi::CallbackInfo& info) { + uint64_t total = 0; + uint64_t used = 0; + +#ifdef GPU_INFO_USE_CUBLAS + size_t cudaDeviceTotal = 0; + size_t cudaDeviceUsed = 0; + bool cudeGetInfoSuccess = gpuInfoGetTotalCudaDevicesInfo(&cudaDeviceTotal, &cudaDeviceUsed, lodCudaError); + + if (cudeGetInfoSuccess) { + total += cudaDeviceTotal; + used += cudaDeviceUsed; + } +#endif + +#ifdef GPU_INFO_USE_METAL + uint64_t metalDeviceTotal = 0; + uint64_t metalDeviceUsed = 0; + get_metal_gpu_info(&metalDeviceTotal, &metalDeviceUsed); + + total += metalDeviceTotal; + used += metalDeviceUsed; +#endif + + Napi::Object result = Napi::Object::New(info.Env()); + result.Set("total", Napi::Number::From(info.Env(), total)); + result.Set("used", Napi::Number::From(info.Env(), used)); + + return result; +} + class AddonModel : public Napi::ObjectWrap { public: llama_model_params model_params; @@ -830,12 +877,21 @@ int addonGetGgmlLogLevelNumber(ggml_log_level level) { void addonCallJsLogCallback( Napi::Env env, Napi::Function callback, AddonThreadSafeLogCallbackFunctionContext* context, addon_logger_log* data ) { + bool called = false; + if (env != nullptr && callback != nullptr) { - callback.Call({ - Napi::Number::New(env, data->logLevelNumber), - Napi::String::New(env, data->stringStream->str()), - }); - } else if (data != nullptr) { + try { + callback.Call({ + Napi::Number::New(env, data->logLevelNumber), + Napi::String::New(env, data->stringStream->str()), + }); + called = true; + } catch (const Napi::Error& e) { + called = false; + } + } + + if (!called && data != nullptr) { if (data->logLevelNumber == 2) { fputs(data->stringStream->str().c_str(), stderr); fflush(stderr); @@ -936,6 +992,7 @@ Napi::Object registerCallback(Napi::Env env, Napi::Object exports) { Napi::PropertyDescriptor::Function("systemInfo", systemInfo), Napi::PropertyDescriptor::Function("setLogger", setLogger), Napi::PropertyDescriptor::Function("setLoggerLogLevel", setLoggerLogLevel), + Napi::PropertyDescriptor::Function("getGpuVramInfo", getGpuVramInfo), }); AddonModel::init(exports); AddonGrammar::init(exports); diff --git a/llama/gpuInfo/cuda-gpu-info.cu b/llama/gpuInfo/cuda-gpu-info.cu new file mode 100644 index 00000000..2dd7d822 --- /dev/null +++ b/llama/gpuInfo/cuda-gpu-info.cu @@ -0,0 +1,99 @@ +#include + +#if defined(GPU_INFO_USE_HIPBLAS) +#include +#include +#define cudaGetDevice hipGetDevice +#define cudaGetDeviceCount hipGetDeviceCount +#define cudaGetErrorString hipGetErrorString +#define cudaMemGetInfo hipMemGetInfo +#define cudaSetDevice hipSetDevice +#define cudaSuccess hipSuccess +#else +#include +#include +#endif + + +typedef void (*gpuInfoErrorLogCallback_t)(const char* message); + +bool gpuInfoSetCudaDevice(const int device, gpuInfoErrorLogCallback_t errorLogCallback) { + int current_device; + auto getDeviceResult = cudaGetDevice(¤t_device); + + if (getDeviceResult != cudaSuccess) { + errorLogCallback(cudaGetErrorString(getDeviceResult)); + return false; + } + + if (device == current_device) { + return; + } + + const setDeviceResult = cudaSetDevice(device); + + if (setDeviceResult != cudaSuccess) { + errorLogCallback(cudaGetErrorString(setDeviceResult)); + return false; + } + + return true; +} + +bool gpuInfoGetCudaDeviceInfo(int device, size_t * total, size_t * used, gpuInfoErrorLogCallback_t errorLogCallback) { + gpuInfoSetCudaDevice(device); + + size_t freeMem; + size_t totalMem; + auto getMemInfoResult = cudaMemGetInfo(&freeMem, &totalMem); + + if (getMemInfoResult != cudaSuccess) { + errorLogCallback(cudaGetErrorString(getMemInfoResult)); + return false; + } + + *total = totalMem; + *used = totalMem - freeMem; + + return true; +} + +int gpuInfoGetCudaDeviceCount(gpuInfoErrorLogCallback_t errorLogCallback) { + int deviceCount; + auto getDeviceCountResult = cudaGetDeviceCount(&deviceCount); + + if (getDeviceCountResult != cudaSuccess) { + errorLogCallback(cudaGetErrorString(getDeviceCountResult)); + return -1; + } + + return deviceCount; +} + +bool gpuInfoGetTotalCudaDevicesInfo(size_t * total, size_t * used, gpuInfoErrorLogCallback_t errorLogCallback) { + int deviceCount = gpuInfoGetCudaDeviceCount(errorLogCallback); + + if (deviceCount < 0) { + return false; + } + + size_t usedMem = 0; + size_t totalMem = 0; + + for (int i = 0; i < deviceCount; i++) { + size_t deviceUsedMem; + size_t deviceTotalMem; + + if (!gpuInfoGetCudaDeviceInfo(i, &deviceTotalMem, &deviceUsedMem, errorLogCallback)) { + return false; + } + + usedMem += deviceUsedMem; + totalMem += deviceTotalMem; + } + + *total = totalMem; + *used = usedMem; + + return true; +} diff --git a/llama/gpuInfo/cuda-gpu-info.h b/llama/gpuInfo/cuda-gpu-info.h new file mode 100644 index 00000000..25dcd0df --- /dev/null +++ b/llama/gpuInfo/cuda-gpu-info.h @@ -0,0 +1,7 @@ +#pragma once + +#include + +typedef void (*gpuInfoErrorLogCallback_t)(const char* message); + +bool gpuInfoGetTotalCudaDevicesInfo(size_t * total, size_t * used, gpuInfoErrorLogCallback_t errorLogCallback); diff --git a/llama/gpuInfo/metal-gpu-info.h b/llama/gpuInfo/metal-gpu-info.h new file mode 100644 index 00000000..29b9d022 --- /dev/null +++ b/llama/gpuInfo/metal-gpu-info.h @@ -0,0 +1,5 @@ +#pragma once + +#include + +void get_metal_gpu_info(uint64_t * total, uint64_t * used); diff --git a/llama/gpuInfo/metal-gpu-info.mm b/llama/gpuInfo/metal-gpu-info.mm new file mode 100644 index 00000000..fd72688a --- /dev/null +++ b/llama/gpuInfo/metal-gpu-info.mm @@ -0,0 +1,17 @@ +#include +#import + +void get_metal_gpu_info(uint64_t * total, uint64_t * used) { + id device = MTLCreateSystemDefaultDevice(); + + if (device) { + *total = device.recommendedMaxWorkingSetSize; + *used = device.currentAllocatedSize; + } else { + *total = 0; + *used = 0; + } + + [device release]; + device = nil; +} diff --git a/package.json b/package.json index 3ce791de..ffd8ed0c 100644 --- a/package.json +++ b/package.json @@ -111,6 +111,7 @@ "@commitlint/cli": "^17.7.1", "@commitlint/config-conventional": "^17.7.0", "@semantic-release/exec": "^6.0.3", + "@types/bytes": "^3.1.4", "@types/cli-progress": "^3.11.0", "@types/cross-spawn": "^6.0.2", "@types/fs-extra": "^11.0.1", @@ -142,6 +143,7 @@ "zx": "^7.2.3" }, "dependencies": { + "bytes": "^3.1.2", "chalk": "^5.3.0", "chmodrp": "^1.0.2", "cli-progress": "^3.12.0", diff --git a/src/bindings/AddonTypes.ts b/src/bindings/AddonTypes.ts index 017e80fa..1474c031 100644 --- a/src/bindings/AddonTypes.ts +++ b/src/bindings/AddonTypes.ts @@ -30,7 +30,11 @@ export type BindingModule = { }, systemInfo(): string, setLogger(logger: (level: number, message: string) => void): void, - setLoggerLogLevel(level: number): void + setLoggerLogLevel(level: number): void, + getGpuVramInfo(): { + total: number, + used: number + } }; export type AddonModel = { diff --git a/src/bindings/Llama.ts b/src/bindings/Llama.ts index 32acb300..7b10cc2d 100644 --- a/src/bindings/Llama.ts +++ b/src/bindings/Llama.ts @@ -116,6 +116,16 @@ export class Llama { return this._bindings.systemInfo(); } + public getVramStatus() { + const {total, used} = this._bindings.getGpuVramInfo(); + + return { + total, + used, + free: Math.max(0, total - used) + }; + } + /** @internal */ private _onAddonLog(level: number, message: string) { const llamaLogLevel = addonLogLevelToLlamaLogLevel.get(level) ?? LlamaLogLevel.fatal; diff --git a/src/cli/cli.ts b/src/cli/cli.ts index 58212142..703197dc 100644 --- a/src/cli/cli.ts +++ b/src/cli/cli.ts @@ -13,6 +13,7 @@ import {BuildCommand} from "./commands/BuildCommand.js"; import {OnPostInstallCommand} from "./commands/OnPostInstallCommand.js"; import {ClearCommand} from "./commands/ClearCommand.js"; import {ChatCommand} from "./commands/ChatCommand.js"; +import {DebugCommand} from "./commands/DebugCommand.js"; const __dirname = path.dirname(fileURLToPath(import.meta.url)); @@ -30,6 +31,7 @@ yarg .command(ClearCommand) .command(ChatCommand) .command(OnPostInstallCommand) + .command(DebugCommand) .recommendCommands() .demandCommand(1) .strict() diff --git a/src/cli/commands/DebugCommand.ts b/src/cli/commands/DebugCommand.ts new file mode 100644 index 00000000..c6d30981 --- /dev/null +++ b/src/cli/commands/DebugCommand.ts @@ -0,0 +1,50 @@ +import os from "os"; +import {CommandModule} from "yargs"; +import bytes from "bytes"; +import chalk from "chalk"; +import {getLlama} from "../../bindings/getLlama.js"; + +const debugFunctions = ["vram"] as const; +type DebugCommand = { + function: (typeof debugFunctions)[number] +}; + +export const DebugCommand: CommandModule = { + command: "debug [function]", + describe: false, + builder(yargs) { + return yargs + .option("function", { + type: "string", + choices: debugFunctions, + demandOption: true, + description: "debug function to run" + }); + }, + async handler({function: func}: DebugCommand) { + if (func === "vram") { + await DebugVramFunction(); + } + } +}; + +async function DebugVramFunction() { + const llama = await getLlama("lastBuild"); + + const vramStatus = llama.getVramStatus(); + const totalMemory = os.totalmem(); + const freeMemory = os.freemem(); + const usedMemory = totalMemory - freeMemory; + + if (llama.metal) + console.log(`${chalk.yellow("Metal:")} enabled`); + + if (llama.cuda) + console.log(`${chalk.yellow("Metal:")} enabled`); + + console.info(`${chalk.yellow("Used VRAM:")} ${Math.ceil((vramStatus.used / vramStatus.total) * 100 * 100) / 100}% ${chalk.grey("(" + bytes(vramStatus.used) + "/" + bytes(vramStatus.total) + ")")}`); + console.info(`${chalk.yellow("Free VRAM:")} ${Math.floor((vramStatus.free / vramStatus.total) * 100 * 100) / 100}% ${chalk.grey("(" + bytes(vramStatus.free) + "/" + bytes(vramStatus.total) + ")")}`); + console.info(); + console.info(`${chalk.yellow("Used RAM:")} ${Math.ceil((usedMemory / totalMemory) * 100 * 100) / 100}% ${chalk.grey("(" + bytes(usedMemory) + "/" + bytes(totalMemory) + ")")}`); + console.info(`${chalk.yellow("Free RAM:")} ${Math.floor((freeMemory / totalMemory) * 100 * 100) / 100}% ${chalk.grey("(" + bytes(freeMemory) + "/" + bytes(totalMemory) + ")")}`); +} From 2b6aa73d0849a3da5638437b497af1becff6b72c Mon Sep 17 00:00:00 2001 From: Gilad S Date: Thu, 8 Feb 2024 02:25:23 +0200 Subject: [PATCH 02/22] chore: update modules --- package-lock.json | 1735 ++++++++++++++++++++++++++++++++++++++++----- package.json | 9 +- vitest.config.ts | 7 +- 3 files changed, 1575 insertions(+), 176 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2a41d8b2..9944381f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "0.1.0", "license": "MIT", "dependencies": { + "bytes": "^3.1.2", "chalk": "^5.3.0", "chmodrp": "^1.0.2", "cli-progress": "^3.12.0", @@ -16,7 +17,7 @@ "cross-env": "^7.0.3", "cross-spawn": "^7.0.3", "env-var": "^7.3.1", - "fs-extra": "^11.1.1", + "fs-extra": "^11.2.0", "lifecycle-utils": "^1.2.1", "log-symbols": "^5.1.0", "node-addon-api": "^7.0.0", @@ -36,9 +37,10 @@ "@commitlint/cli": "^17.7.1", "@commitlint/config-conventional": "^17.7.0", "@semantic-release/exec": "^6.0.3", + "@types/bytes": "^3.1.4", "@types/cli-progress": "^3.11.0", "@types/cross-spawn": "^6.0.2", - "@types/fs-extra": "^11.0.1", + "@types/fs-extra": "^11.0.4", "@types/node": "^20.8.4", "@types/proper-lockfile": "^4.1.4", "@types/uuid": "^9.0.2", @@ -46,7 +48,8 @@ "@types/yargs": "^17.0.24", "@typescript-eslint/eslint-plugin": "^6.3.0", "@typescript-eslint/parser": "^6.3.0", - "@vitest/coverage-v8": "^0.34.6", + "@vitest/coverage-v8": "^1.2.2", + "@vitest/ui": "^1.2.2", "eslint": "^8.46.0", "eslint-plugin-import": "^2.28.0", "eslint-plugin-jsdoc": "^46.9.0", @@ -63,7 +66,7 @@ "typedoc-vitepress-theme": "^1.0.0-next.7", "typescript": "^5.2.2", "vitepress": "1.0.0-rc.22", - "vitest": "^0.34.6", + "vitest": "^1.2.2", "zx": "^7.2.3" }, "engines": { @@ -347,6 +350,15 @@ "node": ">=4" } }, + "node_modules/@babel/helper-string-parser": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", + "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/helper-validator-identifier": { "version": "7.22.20", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", @@ -438,6 +450,20 @@ "node": ">=6.0.0" } }, + "node_modules/@babel/types": { + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.9.tgz", + "integrity": "sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.23.4", + "@babel/helper-validator-identifier": "^7.22.20", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@bcoe/v8-coverage": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", @@ -937,6 +963,22 @@ "node": ">=16" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", + "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@esbuild/android-arm": { "version": "0.18.20", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz", @@ -1939,6 +1981,181 @@ "node": ">=12" } }, + "node_modules/@polka/url": { + "version": "1.0.0-next.24", + "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.24.tgz", + "integrity": "sha512-2LuNTFBIO0m7kKIQvvPHN6UE63VjpmL9rnEEaOOaiSPbZK+zUOYIzBAWcED+3XYzhYsd/0mD57VdxAEqqV52CQ==", + "dev": true + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.9.6.tgz", + "integrity": "sha512-MVNXSSYN6QXOulbHpLMKYi60ppyO13W9my1qogeiAqtjb2yR4LSmfU2+POvDkLzhjYLXz9Rf9+9a3zFHW1Lecg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.9.6.tgz", + "integrity": "sha512-T14aNLpqJ5wzKNf5jEDpv5zgyIqcpn1MlwCrUXLrwoADr2RkWA0vOWP4XxbO9aiO3dvMCQICZdKeDrFl7UMClw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.9.6.tgz", + "integrity": "sha512-CqNNAyhRkTbo8VVZ5R85X73H3R5NX9ONnKbXuHisGWC0qRbTTxnF1U4V9NafzJbgGM0sHZpdO83pLPzq8uOZFw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.9.6.tgz", + "integrity": "sha512-zRDtdJuRvA1dc9Mp6BWYqAsU5oeLixdfUvkTHuiYOHwqYuQ4YgSmi6+/lPvSsqc/I0Omw3DdICx4Tfacdzmhog==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.9.6.tgz", + "integrity": "sha512-oNk8YXDDnNyG4qlNb6is1ojTOGL/tRhbbKeE/YuccItzerEZT68Z9gHrY3ROh7axDc974+zYAPxK5SH0j/G+QQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.9.6.tgz", + "integrity": "sha512-Z3O60yxPtuCYobrtzjo0wlmvDdx2qZfeAWTyfOjEDqd08kthDKexLpV97KfAeUXPosENKd8uyJMRDfFMxcYkDQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.9.6.tgz", + "integrity": "sha512-gpiG0qQJNdYEVad+1iAsGAbgAnZ8j07FapmnIAQgODKcOTjLEWM9sRb+MbQyVsYCnA0Im6M6QIq6ax7liws6eQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.9.6.tgz", + "integrity": "sha512-+uCOcvVmFUYvVDr27aiyun9WgZk0tXe7ThuzoUTAukZJOwS5MrGbmSlNOhx1j80GdpqbOty05XqSl5w4dQvcOA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.9.6.tgz", + "integrity": "sha512-HUNqM32dGzfBKuaDUBqFB7tP6VMN74eLZ33Q9Y1TBqRDn+qDonkAUyKWwF9BR9unV7QUzffLnz9GrnKvMqC/fw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.9.6.tgz", + "integrity": "sha512-ch7M+9Tr5R4FK40FHQk8VnML0Szi2KRujUgHXd/HjuH9ifH72GUmw6lStZBo3c3GB82vHa0ZoUfjfcM7JiiMrQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.9.6.tgz", + "integrity": "sha512-VD6qnR99dhmTQ1mJhIzXsRcTBvTjbfbGGwKAHcu+52cVl15AC/kplkhxzW/uT0Xl62Y/meBKDZvoJSJN+vTeGA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.9.6.tgz", + "integrity": "sha512-J9AFDq/xiRI58eR2NIDfyVmTYGyIZmRcvcAoJ48oDld/NTR8wyiPUu2X/v1navJ+N/FGg68LEbX3Ejd6l8B7MQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.9.6.tgz", + "integrity": "sha512-jqzNLhNDvIZOrt69Ce4UjGRpXJBzhUBzawMwnaDAwyHriki3XollsewxWzOzz+4yOFDkuJHtTsZFwMxhYJWmLQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/@semantic-release/commit-analyzer": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/@semantic-release/commit-analyzer/-/commit-analyzer-11.1.0.tgz", @@ -2806,21 +3023,12 @@ "resolved": "https://registry.npmjs.org/@types/btoa-lite/-/btoa-lite-1.0.2.tgz", "integrity": "sha512-ZYbcE2x7yrvNFJiU7xJGrpF/ihpkM7zKgw8bha3LNJSesvTtUNxbpzaT7WXBIryf6jovisrxTBvymxMeLLj1Mg==" }, - "node_modules/@types/chai": { - "version": "4.3.11", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.11.tgz", - "integrity": "sha512-qQR1dr2rGIHYlJulmr8Ioq3De0Le9E4MJ5AiaeAETJJpndT1uUNHsGFK3L/UIu+rbkQSdj8J/w2bCsBZc/Y5fQ==", + "node_modules/@types/bytes": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/@types/bytes/-/bytes-3.1.4.tgz", + "integrity": "sha512-A0uYgOj3zNc4hNjHc5lYUfJQ/HVyBXiUMKdXd7ysclaE6k9oJdavQzODHuwjpUu2/boCP8afjQYi8z/GtvNCWA==", "dev": true }, - "node_modules/@types/chai-subset": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@types/chai-subset/-/chai-subset-1.3.5.tgz", - "integrity": "sha512-c2mPnw+xHtXDoHmdtcCXGwyLMiauiAyxWMzhGpqHC4nqI/Y5G2XhTampslK2rb59kpcuHon03UH8W6iYUzw88A==", - "dev": true, - "dependencies": { - "@types/chai": "*" - } - }, "node_modules/@types/cli-progress": { "version": "3.11.5", "resolved": "https://registry.npmjs.org/@types/cli-progress/-/cli-progress-3.11.5.tgz", @@ -2839,6 +3047,12 @@ "@types/node": "*" } }, + "node_modules/@types/estree": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "dev": true + }, "node_modules/@types/fs-extra": { "version": "11.0.4", "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-11.0.4.tgz", @@ -3182,38 +3396,40 @@ "dev": true }, "node_modules/@vitest/coverage-v8": { - "version": "0.34.6", - "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-0.34.6.tgz", - "integrity": "sha512-fivy/OK2d/EsJFoEoxHFEnNGTg+MmdZBAVK9Ka4qhXR2K3J0DS08vcGVwzDtXSuUMabLv4KtPcpSKkcMXFDViw==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-1.2.2.tgz", + "integrity": "sha512-IHyKnDz18SFclIEEAHb9Y4Uxx0sPKC2VO1kdDCs1BF6Ip4S8rQprs971zIsooLUn7Afs71GRxWMWpkCGZpRMhw==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.1", "@bcoe/v8-coverage": "^0.2.3", - "istanbul-lib-coverage": "^3.2.0", + "debug": "^4.3.4", + "istanbul-lib-coverage": "^3.2.2", "istanbul-lib-report": "^3.0.1", "istanbul-lib-source-maps": "^4.0.1", - "istanbul-reports": "^3.1.5", - "magic-string": "^0.30.1", + "istanbul-reports": "^3.1.6", + "magic-string": "^0.30.5", + "magicast": "^0.3.3", "picocolors": "^1.0.0", - "std-env": "^3.3.3", + "std-env": "^3.5.0", "test-exclude": "^6.0.0", - "v8-to-istanbul": "^9.1.0" + "v8-to-istanbul": "^9.2.0" }, "funding": { "url": "https://opencollective.com/vitest" }, "peerDependencies": { - "vitest": ">=0.32.0 <1" + "vitest": "^1.0.0" } }, "node_modules/@vitest/expect": { - "version": "0.34.6", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.34.6.tgz", - "integrity": "sha512-QUzKpUQRc1qC7qdGo7rMK3AkETI7w18gTCUrsNnyjjJKYiuUB9+TQK3QnR1unhCnWRC0AbKv2omLGQDF/mIjOw==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.2.2.tgz", + "integrity": "sha512-3jpcdPAD7LwHUUiT2pZTj2U82I2Tcgg2oVPvKxhn6mDI2On6tfvPQTjAI4628GUGDZrCm4Zna9iQHm5cEexOAg==", "dev": true, "dependencies": { - "@vitest/spy": "0.34.6", - "@vitest/utils": "0.34.6", + "@vitest/spy": "1.2.2", + "@vitest/utils": "1.2.2", "chai": "^4.3.10" }, "funding": { @@ -3221,13 +3437,13 @@ } }, "node_modules/@vitest/runner": { - "version": "0.34.6", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.34.6.tgz", - "integrity": "sha512-1CUQgtJSLF47NnhN+F9X2ycxUP0kLHQ/JWvNHbeBfwW8CzEGgeskzNnHDyv1ieKTltuR6sdIHV+nmR6kPxQqzQ==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.2.2.tgz", + "integrity": "sha512-JctG7QZ4LSDXr5CsUweFgcpEvrcxOV1Gft7uHrvkQ+fsAVylmWQvnaAr/HDp3LAH1fztGMQZugIheTWjaGzYIg==", "dev": true, "dependencies": { - "@vitest/utils": "0.34.6", - "p-limit": "^4.0.0", + "@vitest/utils": "1.2.2", + "p-limit": "^5.0.0", "pathe": "^1.1.1" }, "funding": { @@ -3235,15 +3451,15 @@ } }, "node_modules/@vitest/runner/node_modules/p-limit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", - "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", + "integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==", "dev": true, "dependencies": { "yocto-queue": "^1.0.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -3262,45 +3478,76 @@ } }, "node_modules/@vitest/snapshot": { - "version": "0.34.6", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-0.34.6.tgz", - "integrity": "sha512-B3OZqYn6k4VaN011D+ve+AA4whM4QkcwcrwaKwAbyyvS/NB1hCWjFIBQxAQQSQir9/RtyAAGuq+4RJmbn2dH4w==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.2.2.tgz", + "integrity": "sha512-SmGY4saEw1+bwE1th6S/cZmPxz/Q4JWsl7LvbQIky2tKE35US4gd0Mjzqfr84/4OD0tikGWaWdMja/nWL5NIPA==", "dev": true, "dependencies": { - "magic-string": "^0.30.1", + "magic-string": "^0.30.5", "pathe": "^1.1.1", - "pretty-format": "^29.5.0" + "pretty-format": "^29.7.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/spy": { - "version": "0.34.6", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.34.6.tgz", - "integrity": "sha512-xaCvneSaeBw/cz8ySmF7ZwGvL0lBjfvqc1LpQ/vcdHEvpLn3Ff1vAvjw+CoGn0802l++5L/pxb7whwcWAw+DUQ==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.2.2.tgz", + "integrity": "sha512-k9Gcahssw8d7X3pSLq3e3XEu/0L78mUkCjivUqCQeXJm9clfXR/Td8+AP+VC1O6fKPIDLcHDTAmBOINVuv6+7g==", + "dev": true, + "dependencies": { + "tinyspy": "^2.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/ui": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-1.2.2.tgz", + "integrity": "sha512-CG+5fa8lyoBr+9i+UZGS31Qw81v33QlD10uecHxN2CLJVN+jLnqx4pGzGvFFeJ7jSnUCT0AlbmVWY6fU6NJZmw==", "dev": true, "dependencies": { - "tinyspy": "^2.1.1" + "@vitest/utils": "1.2.2", + "fast-glob": "^3.3.2", + "fflate": "^0.8.1", + "flatted": "^3.2.9", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "sirv": "^2.0.4" }, "funding": { "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "vitest": "^1.0.0" } }, "node_modules/@vitest/utils": { - "version": "0.34.6", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.34.6.tgz", - "integrity": "sha512-IG5aDD8S6zlvloDsnzHw0Ut5xczlF+kv2BOTo+iXfPr54Yhi5qbVOgGB1hZaVq4iJ4C/MZ2J0y15IlsV/ZcI0A==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.2.2.tgz", + "integrity": "sha512-WKITBHLsBHlpjnDQahr+XK6RE7MiAsgrIkr0pGhQ9ygoxBfUeG0lUG5iLlzqjmKSlBv3+j5EGsriBzh+C3Tq9g==", "dev": true, "dependencies": { - "diff-sequences": "^29.4.3", - "loupe": "^2.3.6", - "pretty-format": "^29.5.0" + "diff-sequences": "^29.6.3", + "estree-walker": "^3.0.3", + "loupe": "^2.3.7", + "pretty-format": "^29.7.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, + "node_modules/@vitest/utils/node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "dependencies": { + "@types/estree": "^1.0.0" + } + }, "node_modules/@vue/compiler-core": { "version": "3.4.15", "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.15.tgz", @@ -3605,9 +3852,9 @@ } }, "node_modules/acorn": { - "version": "8.11.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz", - "integrity": "sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==", + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -3626,9 +3873,9 @@ } }, "node_modules/acorn-walk": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.0.tgz", - "integrity": "sha512-FS7hV565M5l1R08MXqo8odwMTB02C2UqzB17RVgu9EyuYFBqJZ3/ZY97sQD5FewVu1UyDFc1yztUDrAwT0EypA==", + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", + "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", "dev": true, "engines": { "node": ">=0.4.0" @@ -4100,6 +4347,14 @@ "semver": "^7.0.0" } }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/cac": { "version": "6.7.14", "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", @@ -4181,9 +4436,9 @@ } }, "node_modules/chai": { - "version": "4.3.10", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.10.tgz", - "integrity": "sha512-0UXG04VuVbruMUYbJ6JctvH0YnC/4q3/AkT18q4NaITo91CUm0liMS9VqzT9vZhVQ/1eqPanMWjBM+Juhfb/9g==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", + "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", "dev": true, "dependencies": { "assertion-error": "^1.1.0", @@ -5922,6 +6177,12 @@ "node": "^12.20 || >= 14.13" } }, + "node_modules/fflate": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.1.tgz", + "integrity": "sha512-/exOvEuc+/iaUm105QIiOt4LpBdMTWsXxqR0HDF35vx3fmaKzw7354gTilCh5rkzEt8WYyG//ku3h3nRmd7CHQ==", + "dev": true + }, "node_modules/figures": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/figures/-/figures-6.0.1.tgz", @@ -6214,9 +6475,9 @@ } }, "node_modules/fs-extra": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.1.tgz", - "integrity": "sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==", + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", + "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -7854,10 +8115,14 @@ } }, "node_modules/local-pkg": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.4.3.tgz", - "integrity": "sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz", + "integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==", "dev": true, + "dependencies": { + "mlly": "^1.4.2", + "pkg-types": "^1.0.3" + }, "engines": { "node": ">=14" }, @@ -8052,6 +8317,17 @@ "node": ">=12" } }, + "node_modules/magicast": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.3.3.tgz", + "integrity": "sha512-ZbrP1Qxnpoes8sz47AM0z08U+jW6TyRgZzcWy3Ma3vDhJttwMwAFDMMQFobwdBxByBD46JYmxRzeF7w2+wJEuw==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.23.6", + "@babel/types": "^7.23.6", + "source-map-js": "^1.0.2" + } + }, "node_modules/make-dir": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", @@ -8334,15 +8610,15 @@ } }, "node_modules/mlly": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.4.2.tgz", - "integrity": "sha512-i/Ykufi2t1EZ6NaPLdfnZk2AX8cs0d+mTzVKuPfqPKPatxLApaBoxJQ9x1/uckXtrS/U5oisPMDkNs0yQTaBRg==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.5.0.tgz", + "integrity": "sha512-NPVQvAY1xr1QoVeG0cy8yUYC7FQcOx6evl/RjT1wL5FvzPnzOysoqB/jmx/DhssT2dYa8nxECLAaFI/+gVLhDQ==", "dev": true, "dependencies": { - "acorn": "^8.10.0", - "pathe": "^1.1.1", + "acorn": "^8.11.3", + "pathe": "^1.1.2", "pkg-types": "^1.0.3", - "ufo": "^1.3.0" + "ufo": "^1.3.2" } }, "node_modules/module-error": { @@ -8354,6 +8630,15 @@ "node": ">=10" } }, + "node_modules/mrmime": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.0.tgz", + "integrity": "sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -11959,9 +12244,9 @@ } }, "node_modules/pathe": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.1.tgz", - "integrity": "sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", "dev": true }, "node_modules/pathval": { @@ -13360,6 +13645,20 @@ "url": "https://github.com/steveukx/git-js?sponsor=1" } }, + "node_modules/sirv": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/sirv/-/sirv-2.0.4.tgz", + "integrity": "sha512-94Bdh3cC2PKrbgSOUqTiGPWVZeSiXfKOVZNJniWoqrWrRkB1CJzBU3NEbiTsPcYy1lDsANA/THzS+9WBiy5nfQ==", + "dev": true, + "dependencies": { + "@polka/url": "^1.0.0-next.24", + "mrmime": "^2.0.0", + "totalist": "^3.0.0" + }, + "engines": { + "node": ">= 10" + } + }, "node_modules/skin-tone": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/skin-tone/-/skin-tone-2.0.0.tgz", @@ -13471,9 +13770,9 @@ "dev": true }, "node_modules/std-env": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.5.0.tgz", - "integrity": "sha512-JGUEaALvL0Mf6JCfYnJOTcobY+Nc7sG/TemDRBqCA0wEr4DER7zDchaaixTlmOxAjG1uRJmX82EQcxwTQTkqVA==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", + "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==", "dev": true }, "node_modules/stdin-discarder": { @@ -13924,15 +14223,15 @@ } }, "node_modules/tinybench": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.5.1.tgz", - "integrity": "sha512-65NKvSuAVDP/n4CqH+a9w2kTlLReS9vhsAP06MWx+/89nMinJyB2icyl58RIcqCmIggpojIGeuJGhjU1aGMBSg==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz", + "integrity": "sha512-N8hW3PG/3aOoZAN5V/NSAEDz0ZixDSSt5b/a05iqtpgfLWMSVuCo7w0k2vVvEjdrIoeGqZzweX2WlyioNIHchA==", "dev": true }, "node_modules/tinypool": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.7.0.tgz", - "integrity": "sha512-zSYNUlYSMhJ6Zdou4cJwo/p7w5nmAH17GRfU/ui3ctvjXFErXXkruT4MWW6poDeXgCaIBlGLrfU6TbTXxyGMww==", + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.2.tgz", + "integrity": "sha512-SUszKYe5wgsxnNOVlBYO6IC+8VGWdVGZWAqUxp3UErNBtptZvWbwyUOyzNL59zigz2rCA92QiL3wvG+JDSdJdQ==", "dev": true, "engines": { "node": ">=14.0.0" @@ -13947,6 +14246,15 @@ "node": ">=14.0.0" } }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -13959,6 +14267,15 @@ "node": ">=8.0" } }, + "node_modules/totalist": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz", + "integrity": "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/traverse": { "version": "0.6.7", "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.7.tgz", @@ -14503,136 +14820,1212 @@ } }, "node_modules/vite-node": { - "version": "0.34.6", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.34.6.tgz", - "integrity": "sha512-nlBMJ9x6n7/Amaz6F3zJ97EBwR2FkzhBRxF5e+jE6LA3yi6Wtc2lyTij1OnDMIr34v5g/tVQtsVAzhT0jc5ygA==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.2.2.tgz", + "integrity": "sha512-1as4rDTgVWJO3n1uHmUYqq7nsFgINQ9u+mRcXpjeOMJUmviqNKjcZB7UfRZrlM7MjYXMKpuWp5oGkjaFLnjawg==", "dev": true, "dependencies": { "cac": "^6.7.14", "debug": "^4.3.4", - "mlly": "^1.4.0", "pathe": "^1.1.1", "picocolors": "^1.0.0", - "vite": "^3.0.0 || ^4.0.0 || ^5.0.0-0" + "vite": "^5.0.0" }, "bin": { "vite-node": "vite-node.mjs" }, "engines": { - "node": ">=v14.18.0" + "node": "^18.0.0 || >=20.0.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, - "node_modules/vitepress": { - "version": "1.0.0-rc.22", - "resolved": "https://registry.npmjs.org/vitepress/-/vitepress-1.0.0-rc.22.tgz", - "integrity": "sha512-n7le5iikCFgWMuX7sKfzDGJGlrsYQ5trG3S97BghNz2alOTr4Xp+GrB6ShwogUTX9gNgeNmrACjokhW55LNeBA==", + "node_modules/vite-node/node_modules/@esbuild/android-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", + "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", + "cpu": [ + "arm" + ], "dev": true, - "dependencies": { - "@docsearch/css": "^3.5.2", - "@docsearch/js": "^3.5.2", - "@types/markdown-it": "^13.0.2", - "@vue/devtools-api": "^6.5.1", - "@vueuse/core": "^10.5.0", - "@vueuse/integrations": "^10.5.0", - "focus-trap": "^7.5.4", - "mark.js": "8.11.1", - "minisearch": "^6.1.0", - "shiki": "^0.14.5", - "vite": "^4.4.11", - "vue": "^3.3.4" + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/android-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", + "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/android-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", + "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/darwin-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", + "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/darwin-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", + "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/freebsd-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", + "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/freebsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", + "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", + "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", + "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", + "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-loong64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", + "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-mips64el": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", + "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", + "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-riscv64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", + "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-s390x": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", + "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", + "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/netbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", + "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/openbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", + "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/sunos-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", + "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/win32-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", + "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/win32-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", + "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/win32-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", + "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/esbuild": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", + "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.19.12", + "@esbuild/android-arm": "0.19.12", + "@esbuild/android-arm64": "0.19.12", + "@esbuild/android-x64": "0.19.12", + "@esbuild/darwin-arm64": "0.19.12", + "@esbuild/darwin-x64": "0.19.12", + "@esbuild/freebsd-arm64": "0.19.12", + "@esbuild/freebsd-x64": "0.19.12", + "@esbuild/linux-arm": "0.19.12", + "@esbuild/linux-arm64": "0.19.12", + "@esbuild/linux-ia32": "0.19.12", + "@esbuild/linux-loong64": "0.19.12", + "@esbuild/linux-mips64el": "0.19.12", + "@esbuild/linux-ppc64": "0.19.12", + "@esbuild/linux-riscv64": "0.19.12", + "@esbuild/linux-s390x": "0.19.12", + "@esbuild/linux-x64": "0.19.12", + "@esbuild/netbsd-x64": "0.19.12", + "@esbuild/openbsd-x64": "0.19.12", + "@esbuild/sunos-x64": "0.19.12", + "@esbuild/win32-arm64": "0.19.12", + "@esbuild/win32-ia32": "0.19.12", + "@esbuild/win32-x64": "0.19.12" + } + }, + "node_modules/vite-node/node_modules/rollup": { + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.9.6.tgz", + "integrity": "sha512-05lzkCS2uASX0CiLFybYfVkwNbKZG5NFQ6Go0VWyogFTXXbR039UVsegViTntkk4OglHBdF54ccApXRRuXRbsg==", + "dev": true, + "dependencies": { + "@types/estree": "1.0.5" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.9.6", + "@rollup/rollup-android-arm64": "4.9.6", + "@rollup/rollup-darwin-arm64": "4.9.6", + "@rollup/rollup-darwin-x64": "4.9.6", + "@rollup/rollup-linux-arm-gnueabihf": "4.9.6", + "@rollup/rollup-linux-arm64-gnu": "4.9.6", + "@rollup/rollup-linux-arm64-musl": "4.9.6", + "@rollup/rollup-linux-riscv64-gnu": "4.9.6", + "@rollup/rollup-linux-x64-gnu": "4.9.6", + "@rollup/rollup-linux-x64-musl": "4.9.6", + "@rollup/rollup-win32-arm64-msvc": "4.9.6", + "@rollup/rollup-win32-ia32-msvc": "4.9.6", + "@rollup/rollup-win32-x64-msvc": "4.9.6", + "fsevents": "~2.3.2" + } + }, + "node_modules/vite-node/node_modules/vite": { + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.0.12.tgz", + "integrity": "sha512-4hsnEkG3q0N4Tzf1+t6NdN9dg/L3BM+q8SWgbSPnJvrgH2kgdyzfVJwbR1ic69/4uMJJ/3dqDZZE5/WwqW8U1w==", + "dev": true, + "dependencies": { + "esbuild": "^0.19.3", + "postcss": "^8.4.32", + "rollup": "^4.2.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vitepress": { + "version": "1.0.0-rc.22", + "resolved": "https://registry.npmjs.org/vitepress/-/vitepress-1.0.0-rc.22.tgz", + "integrity": "sha512-n7le5iikCFgWMuX7sKfzDGJGlrsYQ5trG3S97BghNz2alOTr4Xp+GrB6ShwogUTX9gNgeNmrACjokhW55LNeBA==", + "dev": true, + "dependencies": { + "@docsearch/css": "^3.5.2", + "@docsearch/js": "^3.5.2", + "@types/markdown-it": "^13.0.2", + "@vue/devtools-api": "^6.5.1", + "@vueuse/core": "^10.5.0", + "@vueuse/integrations": "^10.5.0", + "focus-trap": "^7.5.4", + "mark.js": "8.11.1", + "minisearch": "^6.1.0", + "shiki": "^0.14.5", + "vite": "^4.4.11", + "vue": "^3.3.4" + }, + "bin": { + "vitepress": "bin/vitepress.js" + }, + "peerDependencies": { + "markdown-it-mathjax3": "^4.3.2", + "postcss": "^8.4.31" + }, + "peerDependenciesMeta": { + "markdown-it-mathjax3": { + "optional": true + }, + "postcss": { + "optional": true + } + } + }, + "node_modules/vitest": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.2.2.tgz", + "integrity": "sha512-d5Ouvrnms3GD9USIK36KG8OZ5bEvKEkITFtnGv56HFaSlbItJuYr7hv2Lkn903+AvRAgSixiamozUVfORUekjw==", + "dev": true, + "dependencies": { + "@vitest/expect": "1.2.2", + "@vitest/runner": "1.2.2", + "@vitest/snapshot": "1.2.2", + "@vitest/spy": "1.2.2", + "@vitest/utils": "1.2.2", + "acorn-walk": "^8.3.2", + "cac": "^6.7.14", + "chai": "^4.3.10", + "debug": "^4.3.4", + "execa": "^8.0.1", + "local-pkg": "^0.5.0", + "magic-string": "^0.30.5", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "std-env": "^3.5.0", + "strip-literal": "^1.3.0", + "tinybench": "^2.5.1", + "tinypool": "^0.8.2", + "vite": "^5.0.0", + "vite-node": "1.2.2", + "why-is-node-running": "^2.2.2" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@types/node": "^18.0.0 || >=20.0.0", + "@vitest/browser": "^1.0.0", + "@vitest/ui": "^1.0.0", + "happy-dom": "*", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + } + } + }, + "node_modules/vitest/node_modules/@esbuild/android-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", + "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/android-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", + "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/android-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", + "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/darwin-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", + "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/darwin-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", + "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/freebsd-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", + "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/freebsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", + "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", + "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", + "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", + "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-loong64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", + "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-mips64el": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", + "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", + "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-riscv64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", + "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-s390x": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", + "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", + "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/netbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", + "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/openbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", + "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/sunos-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", + "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/win32-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", + "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/win32-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", + "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/win32-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", + "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/esbuild": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", + "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.19.12", + "@esbuild/android-arm": "0.19.12", + "@esbuild/android-arm64": "0.19.12", + "@esbuild/android-x64": "0.19.12", + "@esbuild/darwin-arm64": "0.19.12", + "@esbuild/darwin-x64": "0.19.12", + "@esbuild/freebsd-arm64": "0.19.12", + "@esbuild/freebsd-x64": "0.19.12", + "@esbuild/linux-arm": "0.19.12", + "@esbuild/linux-arm64": "0.19.12", + "@esbuild/linux-ia32": "0.19.12", + "@esbuild/linux-loong64": "0.19.12", + "@esbuild/linux-mips64el": "0.19.12", + "@esbuild/linux-ppc64": "0.19.12", + "@esbuild/linux-riscv64": "0.19.12", + "@esbuild/linux-s390x": "0.19.12", + "@esbuild/linux-x64": "0.19.12", + "@esbuild/netbsd-x64": "0.19.12", + "@esbuild/openbsd-x64": "0.19.12", + "@esbuild/sunos-x64": "0.19.12", + "@esbuild/win32-arm64": "0.19.12", + "@esbuild/win32-ia32": "0.19.12", + "@esbuild/win32-x64": "0.19.12" + } + }, + "node_modules/vitest/node_modules/execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/vitest/node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "dev": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/vitest/node_modules/human-signals": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "dev": true, + "engines": { + "node": ">=16.17.0" + } + }, + "node_modules/vitest/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/vitest/node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/vitest/node_modules/npm-run-path": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.2.0.tgz", + "integrity": "sha512-W4/tgAXFqFA0iL7fk0+uQ3g7wkL8xJmx3XdK0VGb4cHW//eZTtKGvFBBoRKVTpY7n6ze4NL9ly7rgXcHufqXKg==", + "dev": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/vitest/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/vitest/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/vitest/node_modules/rollup": { + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.9.6.tgz", + "integrity": "sha512-05lzkCS2uASX0CiLFybYfVkwNbKZG5NFQ6Go0VWyogFTXXbR039UVsegViTntkk4OglHBdF54ccApXRRuXRbsg==", + "dev": true, + "dependencies": { + "@types/estree": "1.0.5" }, "bin": { - "vitepress": "bin/vitepress.js" + "rollup": "dist/bin/rollup" }, - "peerDependencies": { - "markdown-it-mathjax3": "^4.3.2", - "postcss": "^8.4.31" + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" }, - "peerDependenciesMeta": { - "markdown-it-mathjax3": { - "optional": true - }, - "postcss": { - "optional": true - } + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.9.6", + "@rollup/rollup-android-arm64": "4.9.6", + "@rollup/rollup-darwin-arm64": "4.9.6", + "@rollup/rollup-darwin-x64": "4.9.6", + "@rollup/rollup-linux-arm-gnueabihf": "4.9.6", + "@rollup/rollup-linux-arm64-gnu": "4.9.6", + "@rollup/rollup-linux-arm64-musl": "4.9.6", + "@rollup/rollup-linux-riscv64-gnu": "4.9.6", + "@rollup/rollup-linux-x64-gnu": "4.9.6", + "@rollup/rollup-linux-x64-musl": "4.9.6", + "@rollup/rollup-win32-arm64-msvc": "4.9.6", + "@rollup/rollup-win32-ia32-msvc": "4.9.6", + "@rollup/rollup-win32-x64-msvc": "4.9.6", + "fsevents": "~2.3.2" } }, - "node_modules/vitest": { - "version": "0.34.6", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.34.6.tgz", - "integrity": "sha512-+5CALsOvbNKnS+ZHMXtuUC7nL8/7F1F2DnHGjSsszX8zCjWSSviphCb/NuS9Nzf4Q03KyyDRBAXhF/8lffME4Q==", + "node_modules/vitest/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/vitest/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/vitest/node_modules/vite": { + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.0.12.tgz", + "integrity": "sha512-4hsnEkG3q0N4Tzf1+t6NdN9dg/L3BM+q8SWgbSPnJvrgH2kgdyzfVJwbR1ic69/4uMJJ/3dqDZZE5/WwqW8U1w==", "dev": true, "dependencies": { - "@types/chai": "^4.3.5", - "@types/chai-subset": "^1.3.3", - "@types/node": "*", - "@vitest/expect": "0.34.6", - "@vitest/runner": "0.34.6", - "@vitest/snapshot": "0.34.6", - "@vitest/spy": "0.34.6", - "@vitest/utils": "0.34.6", - "acorn": "^8.9.0", - "acorn-walk": "^8.2.0", - "cac": "^6.7.14", - "chai": "^4.3.10", - "debug": "^4.3.4", - "local-pkg": "^0.4.3", - "magic-string": "^0.30.1", - "pathe": "^1.1.1", - "picocolors": "^1.0.0", - "std-env": "^3.3.3", - "strip-literal": "^1.0.1", - "tinybench": "^2.5.0", - "tinypool": "^0.7.0", - "vite": "^3.1.0 || ^4.0.0 || ^5.0.0-0", - "vite-node": "0.34.6", - "why-is-node-running": "^2.2.2" + "esbuild": "^0.19.3", + "postcss": "^8.4.32", + "rollup": "^4.2.0" }, "bin": { - "vitest": "vitest.mjs" + "vite": "bin/vite.js" }, "engines": { - "node": ">=v14.18.0" + "node": "^18.0.0 || >=20.0.0" }, "funding": { - "url": "https://opencollective.com/vitest" + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" }, "peerDependencies": { - "@edge-runtime/vm": "*", - "@vitest/browser": "*", - "@vitest/ui": "*", - "happy-dom": "*", - "jsdom": "*", - "playwright": "*", - "safaridriver": "*", - "webdriverio": "*" + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" }, "peerDependenciesMeta": { - "@edge-runtime/vm": { - "optional": true - }, - "@vitest/browser": { + "@types/node": { "optional": true }, - "@vitest/ui": { + "less": { "optional": true }, - "happy-dom": { + "lightningcss": { "optional": true }, - "jsdom": { + "sass": { "optional": true }, - "playwright": { + "stylus": { "optional": true }, - "safaridriver": { + "sugarss": { "optional": true }, - "webdriverio": { + "terser": { "optional": true } } diff --git a/package.json b/package.json index ffd8ed0c..ca153357 100644 --- a/package.json +++ b/package.json @@ -114,7 +114,7 @@ "@types/bytes": "^3.1.4", "@types/cli-progress": "^3.11.0", "@types/cross-spawn": "^6.0.2", - "@types/fs-extra": "^11.0.1", + "@types/fs-extra": "^11.0.4", "@types/node": "^20.8.4", "@types/proper-lockfile": "^4.1.4", "@types/uuid": "^9.0.2", @@ -122,7 +122,8 @@ "@types/yargs": "^17.0.24", "@typescript-eslint/eslint-plugin": "^6.3.0", "@typescript-eslint/parser": "^6.3.0", - "@vitest/coverage-v8": "^0.34.6", + "@vitest/coverage-v8": "^1.2.2", + "@vitest/ui": "^1.2.2", "eslint": "^8.46.0", "eslint-plugin-import": "^2.28.0", "eslint-plugin-jsdoc": "^46.9.0", @@ -139,7 +140,7 @@ "typedoc-vitepress-theme": "^1.0.0-next.7", "typescript": "^5.2.2", "vitepress": "1.0.0-rc.22", - "vitest": "^0.34.6", + "vitest": "^1.2.2", "zx": "^7.2.3" }, "dependencies": { @@ -151,7 +152,7 @@ "cross-env": "^7.0.3", "cross-spawn": "^7.0.3", "env-var": "^7.3.1", - "fs-extra": "^11.1.1", + "fs-extra": "^11.2.0", "lifecycle-utils": "^1.2.1", "log-symbols": "^5.1.0", "node-addon-api": "^7.0.0", diff --git a/vitest.config.ts b/vitest.config.ts index 7925dbdf..331c408c 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -2,6 +2,11 @@ import {defineConfig} from "vitest/config"; export default defineConfig({ test: { - threads: false + poolOptions: { + threads: { + minThreads: 1, + maxThreads: 1 + } + } } }); From 4c9d0a067336f8d4c29b4cf69133f090da4893a9 Mon Sep 17 00:00:00 2001 From: Gilad S Date: Thu, 8 Feb 2024 02:35:00 +0200 Subject: [PATCH 03/22] fix: update latest build on postinstall compile --- src/bindings/getLlama.ts | 10 +++++++--- src/cli/commands/OnPostInstallCommand.ts | 7 +++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/bindings/getLlama.ts b/src/bindings/getLlama.ts index 65d86449..855e9ea5 100644 --- a/src/bindings/getLlama.ts +++ b/src/bindings/getLlama.ts @@ -158,7 +158,7 @@ export async function getLlama(options?: LlamaOptions | "lastBuild", lastBuildOp return getLlamaForOptions(options ?? {}); } -async function getLlamaForOptions({ +export async function getLlamaForOptions({ metal = defaultLlamaCppMetalSupport, cuda = defaultLlamaCppCudaSupport, logLevel = defaultLlamaCppDebugLogs, @@ -169,7 +169,11 @@ async function getLlamaForOptions({ usePrebuiltBinaries = true, progressLogs = true, skipDownload = defaultSkipDownload -}: LlamaOptions): Promise { +}: LlamaOptions, { + updateLastBuildInfoOnCompile = false +}: { + updateLastBuildInfoOnCompile?: boolean +} = {}): Promise { const platform = getPlatform(); const arch = process.arch; @@ -295,7 +299,7 @@ async function getLlamaForOptions({ await compileLlamaCpp(buildOptions, { ensureLlamaCppRepoIsCloned: !skipDownload, downloadCmakeIfNeeded: true, - updateLastBuildInfo: false + updateLastBuildInfo: updateLastBuildInfoOnCompile }); const localBuildFolder = path.join(llamaLocalBuildBinsDirectory, buildFolderName.withCustomCmakeOptions); diff --git a/src/cli/commands/OnPostInstallCommand.ts b/src/cli/commands/OnPostInstallCommand.ts index 246660b2..5f4ce82f 100644 --- a/src/cli/commands/OnPostInstallCommand.ts +++ b/src/cli/commands/OnPostInstallCommand.ts @@ -1,6 +1,6 @@ import {CommandModule} from "yargs"; import {defaultSkipDownload} from "../../config.js"; -import {getLlama} from "../../bindings/getLlama.js"; +import {getLlamaForOptions} from "../../bindings/getLlama.js"; type OnPostInstallCommand = null; @@ -12,9 +12,12 @@ export const OnPostInstallCommand: CommandModule = return; try { - await getLlama({ + await getLlamaForOptions({ progressLogs: true + }, { + updateLastBuildInfoOnCompile: true }); + process.exit(0); } catch (err) { console.error(err); From cfae88189fe0b65afb935e7c0e240b37b8b36a4c Mon Sep 17 00:00:00 2001 From: Gilad S Date: Thu, 8 Feb 2024 02:37:07 +0200 Subject: [PATCH 04/22] fix(`resolveChatWrapperBasedOnModel`): use llamaChat wrapper for llama models only if there's a `chat` sub-variant --- src/chatWrappers/resolveChatWrapperBasedOnModel.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/chatWrappers/resolveChatWrapperBasedOnModel.ts b/src/chatWrappers/resolveChatWrapperBasedOnModel.ts index 43e9ee20..96b66573 100644 --- a/src/chatWrappers/resolveChatWrapperBasedOnModel.ts +++ b/src/chatWrappers/resolveChatWrapperBasedOnModel.ts @@ -32,9 +32,12 @@ export function resolveChatWrapperBasedOnModel({ const splitLowercaseSubType = lowercaseSubType?.split("-") ?? []; const firstSplitLowercaseSubType = splitLowercaseSubType[0]; - if (lowercaseName === "llama") - return LlamaChatWrapper; - else if (lowercaseName === "yarn" && firstSplitLowercaseSubType === "llama") + if (lowercaseName === "llama") { + if (splitLowercaseSubType.includes("chat")) + return LlamaChatWrapper; + + return GeneralChatWrapper; + } else if (lowercaseName === "yarn" && firstSplitLowercaseSubType === "llama") return LlamaChatWrapper; else if (lowercaseName === "orca") return ChatMLChatWrapper; From 05ca507222f26309bfe0bd5431779febe3d63ef6 Mon Sep 17 00:00:00 2001 From: Gilad S Date: Fri, 9 Feb 2024 17:19:58 +0200 Subject: [PATCH 05/22] feat: `chatWrapper` getter on a `LlamaChatSession` --- src/evaluator/LlamaChatSession/LlamaChatSession.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/evaluator/LlamaChatSession/LlamaChatSession.ts b/src/evaluator/LlamaChatSession/LlamaChatSession.ts index e48113d9..8add3531 100644 --- a/src/evaluator/LlamaChatSession/LlamaChatSession.ts +++ b/src/evaluator/LlamaChatSession/LlamaChatSession.ts @@ -200,6 +200,13 @@ export class LlamaChatSession { return this._chat == null || this._chat.disposed; } + public get chatWrapper() { + if (this._chat == null) + throw new DisposedError(); + + return this._chat.chatWrapper; + } + public get sequence() { if (this._chat == null) throw new DisposedError(); From 8417cc917f8cc6a54d3c2ab0e5e4cb1360924a9c Mon Sep 17 00:00:00 2001 From: Gilad S Date: Fri, 9 Feb 2024 19:01:22 +0200 Subject: [PATCH 06/22] chore configuring CUDA --- llama/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/llama/CMakeLists.txt b/llama/CMakeLists.txt index db5028d8..c496940b 100644 --- a/llama/CMakeLists.txt +++ b/llama/CMakeLists.txt @@ -20,7 +20,6 @@ include_directories(${NODE_ADDON_API_DIR} ${CMAKE_JS_INC}) add_subdirectory("llama.cpp") include_directories("gpuInfo") -include_directories("llama.cpp") include_directories("./llama.cpp/common") if (LLAMA_CUBLAS) @@ -38,11 +37,18 @@ if (LLAMA_CUBLAS) add_compile_definitions(GPU_INFO_USE_CUBLAS) set(GPU_INFO_EXTRA_LIBS ${GPU_INFO_EXTRA_LIBS} CUDA::cuda_driver) + + if (NOT DEFINED CMAKE_CUDA_ARCHITECTURES) + set(CMAKE_CUDA_ARCHITECTURES "") + endif() + endif() else() message(WARNING "cuBLAS not found. Not using it for GPU info") endif() endif() +include_directories("llama.cpp") + if (LLAMA_HIPBLAS) list(APPEND CMAKE_PREFIX_PATH /opt/rocm) From 146cc4ce77ad5e3440e2b3b75e7111bf53d9ef65 Mon Sep 17 00:00:00 2001 From: Gilad S Date: Fri, 9 Feb 2024 19:02:55 +0200 Subject: [PATCH 07/22] chore configuring CUDA --- llama/addon.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llama/addon.cpp b/llama/addon.cpp index 4bd72dc9..b45f1ca6 100644 --- a/llama/addon.cpp +++ b/llama/addon.cpp @@ -10,7 +10,7 @@ #include "napi.h" #ifdef GPU_INFO_USE_CUBLAS -# include "ggml-cuda.h" +# include "gpuInfo/cuda-gpu-info.h" #endif #ifdef GPU_INFO_USE_METAL # include "gpuInfo/metal-gpu-info.h" From 1209a3ba1f04b91f14af305de7ad7585a9de7cf0 Mon Sep 17 00:00:00 2001 From: Gilad S Date: Fri, 9 Feb 2024 19:04:32 +0200 Subject: [PATCH 08/22] chore configuring CUDA --- llama/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/llama/CMakeLists.txt b/llama/CMakeLists.txt index c496940b..4fc8b0b4 100644 --- a/llama/CMakeLists.txt +++ b/llama/CMakeLists.txt @@ -41,7 +41,6 @@ if (LLAMA_CUBLAS) if (NOT DEFINED CMAKE_CUDA_ARCHITECTURES) set(CMAKE_CUDA_ARCHITECTURES "") endif() - endif() else() message(WARNING "cuBLAS not found. Not using it for GPU info") endif() From 782d6b6a82c2d7eeed5cb3c3d807a897cc5f44b8 Mon Sep 17 00:00:00 2001 From: Gilad S Date: Fri, 9 Feb 2024 19:07:55 +0200 Subject: [PATCH 09/22] chore: configuring CUDA --- llama/gpuInfo/cuda-gpu-info.cu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llama/gpuInfo/cuda-gpu-info.cu b/llama/gpuInfo/cuda-gpu-info.cu index 2dd7d822..110f23d8 100644 --- a/llama/gpuInfo/cuda-gpu-info.cu +++ b/llama/gpuInfo/cuda-gpu-info.cu @@ -30,7 +30,7 @@ bool gpuInfoSetCudaDevice(const int device, gpuInfoErrorLogCallback_t errorLogCa return; } - const setDeviceResult = cudaSetDevice(device); + const auto setDeviceResult = cudaSetDevice(device); if (setDeviceResult != cudaSuccess) { errorLogCallback(cudaGetErrorString(setDeviceResult)); From 484b6f0fa4dd6e18a1e606af2669575e8e4fda93 Mon Sep 17 00:00:00 2001 From: Gilad S Date: Fri, 9 Feb 2024 19:13:46 +0200 Subject: [PATCH 10/22] chore: configuring CUDA --- llama/gpuInfo/cuda-gpu-info.cu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llama/gpuInfo/cuda-gpu-info.cu b/llama/gpuInfo/cuda-gpu-info.cu index 110f23d8..87c78f00 100644 --- a/llama/gpuInfo/cuda-gpu-info.cu +++ b/llama/gpuInfo/cuda-gpu-info.cu @@ -41,7 +41,7 @@ bool gpuInfoSetCudaDevice(const int device, gpuInfoErrorLogCallback_t errorLogCa } bool gpuInfoGetCudaDeviceInfo(int device, size_t * total, size_t * used, gpuInfoErrorLogCallback_t errorLogCallback) { - gpuInfoSetCudaDevice(device); + gpuInfoSetCudaDevice(device, errorLogCallback); size_t freeMem; size_t totalMem; From a9b72e626421c3cfea82bc02b66b3f9e4c3f17c2 Mon Sep 17 00:00:00 2001 From: Gilad S Date: Sat, 10 Feb 2024 04:31:47 +0200 Subject: [PATCH 11/22] chore: configuring CUDA --- llama/gpuInfo/cuda-gpu-info.cu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llama/gpuInfo/cuda-gpu-info.cu b/llama/gpuInfo/cuda-gpu-info.cu index 87c78f00..c0565ad6 100644 --- a/llama/gpuInfo/cuda-gpu-info.cu +++ b/llama/gpuInfo/cuda-gpu-info.cu @@ -27,7 +27,7 @@ bool gpuInfoSetCudaDevice(const int device, gpuInfoErrorLogCallback_t errorLogCa } if (device == current_device) { - return; + return true; } const auto setDeviceResult = cudaSetDevice(device); From 10722e510bfc639687ea11b81d81a5002f10d66d Mon Sep 17 00:00:00 2001 From: Gilad S Date: Sat, 10 Feb 2024 04:33:02 +0200 Subject: [PATCH 12/22] chore: configuring CUDA --- src/utils/withOra.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/utils/withOra.ts b/src/utils/withOra.ts index c6aba749..b6159789 100644 --- a/src/utils/withOra.ts +++ b/src/utils/withOra.ts @@ -1,5 +1,7 @@ import ora from "ora"; +import {isRunningInsideGoogleColab} from "../config.js"; import {getConsoleLogPrefix} from "./getConsoleLogPrefix.js"; +import withStatusLogs from "./withStatusLogs.js"; export default async function withOra( message: string | { @@ -9,6 +11,9 @@ export default async function withOra( }, callback: () => Promise ): Promise { + if (isRunningInsideGoogleColab) + return withStatusLogs(message, callback); + const spinner = ora({ prefixText: getConsoleLogPrefix(), ...( From 6b2b37e45f68970af263c1c8c2f2ab636b98a37d Mon Sep 17 00:00:00 2001 From: Gilad S Date: Sat, 10 Feb 2024 04:37:54 +0200 Subject: [PATCH 13/22] chore: configuring CUDA --- src/config.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/config.ts b/src/config.ts index 215d44f5..65164a66 100644 --- a/src/config.ts +++ b/src/config.ts @@ -36,6 +36,9 @@ export const builtinLlamaCppRelease = await getBinariesGithubRelease(); export const isCI = env.get("CI") .default("false") .asBool(); +export const isRunningInsideGoogleColab = env.get("COLAB_RELEASE_TAG") + .default("") + .asString() !== ""; export const defaultLlamaCppGitHubRepo = env.get("NODE_LLAMA_CPP_REPO") .default(builtinLlamaCppGitHubRepo) .asString(); From 121c5db482aa304aacd1a17e9ec16865d4b43f2f Mon Sep 17 00:00:00 2001 From: Gilad S Date: Sat, 10 Feb 2024 04:56:43 +0200 Subject: [PATCH 14/22] test: fix standalone tests to work with new vitest version --- .../FunctionCallGrammar.test.ts | 24 +++---- .../llamaEvaluator/LlamaGrammar.test.ts | 70 +++++++++---------- 2 files changed, 47 insertions(+), 47 deletions(-) diff --git a/test/standalone/llamaEvaluator/FunctionCallGrammar.test.ts b/test/standalone/llamaEvaluator/FunctionCallGrammar.test.ts index 45c732cf..d33f7325 100644 --- a/test/standalone/llamaEvaluator/FunctionCallGrammar.test.ts +++ b/test/standalone/llamaEvaluator/FunctionCallGrammar.test.ts @@ -41,20 +41,20 @@ describe("grammar for functions", () => { expect(grammar.grammar).toMatchInlineSnapshot( ` - "root ::= [ ]? \\"[[call: \\" rule10 \\")]]\\" [\\\\n] [\\\\n] [\\\\n] [\\\\n] [\\\\n]* - whitespace-new-lines-rule ::= [\\\\n]? [ \\\\t]* [\\\\n]? - string-rule ::= \\"\\\\\\"\\" ( [^\\"\\\\\\\\] | \\"\\\\\\\\\\" ([\\"\\\\\\\\/bfnrt] | \\"u\\" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]))* \\"\\\\\\"\\" - rule1 ::= \\"\\\\\\"good\\\\\\"\\" - rule2 ::= \\"\\\\\\"bad\\\\\\"\\" + "root ::= [ ]? "[[call: " rule10 ")]]" [\\n] [\\n] [\\n] [\\n] [\\n]* + whitespace-new-lines-rule ::= [\\n]? [ \\t]* [\\n]? + string-rule ::= "\\"" ( [^"\\\\] | "\\\\" (["\\\\/bfnrt] | "u" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]))* "\\"" + rule1 ::= "\\"good\\"" + rule2 ::= "\\"bad\\"" rule3 ::= ( rule1 | rule2 ) - fractional-number-rule ::= (\\"-\\"? ([0-9] | [1-9] [0-9]*)) (\\".\\" [0-9]+)? ([eE] [-+]? [0-9]+)? - rule0 ::= \\"{\\" whitespace-new-lines-rule \\"\\\\\\"message\\\\\\"\\" \\":\\" [ ]? string-rule \\",\\" whitespace-new-lines-rule \\"\\\\\\"feeling\\\\\\"\\" \\":\\" [ ]? rule3 \\",\\" whitespace-new-lines-rule \\"\\\\\\"words\\\\\\"\\" \\":\\" [ ]? fractional-number-rule whitespace-new-lines-rule \\"}\\" - rule5 ::= ( string-rule ) ( \\",\\" whitespace-new-lines-rule string-rule )* + fractional-number-rule ::= ("-"? ([0-9] | [1-9] [0-9]*)) ("." [0-9]+)? ([eE] [-+]? [0-9]+)? + rule0 ::= "{" whitespace-new-lines-rule "\\"message\\"" ":" [ ]? string-rule "," whitespace-new-lines-rule "\\"feeling\\"" ":" [ ]? rule3 "," whitespace-new-lines-rule "\\"words\\"" ":" [ ]? fractional-number-rule whitespace-new-lines-rule "}" + rule5 ::= ( string-rule ) ( "," whitespace-new-lines-rule string-rule )* rule6 ::= ( string-rule )? - rule4 ::= \\"[\\" whitespace-new-lines-rule ( rule5 | rule6 ) whitespace-new-lines-rule \\"]\\" - rule7 ::= \\"func1(\\" - rule8 ::= \\"func2(\\" rule0 - rule9 ::= \\"func3(\\" rule4 + rule4 ::= "[" whitespace-new-lines-rule ( rule5 | rule6 ) whitespace-new-lines-rule "]" + rule7 ::= "func1(" + rule8 ::= "func2(" rule0 + rule9 ::= "func3(" rule4 rule10 ::= ( rule7 | rule8 | rule9 )" ` ); diff --git a/test/standalone/llamaEvaluator/LlamaGrammar.test.ts b/test/standalone/llamaEvaluator/LlamaGrammar.test.ts index 7c759209..e248a5c5 100644 --- a/test/standalone/llamaEvaluator/LlamaGrammar.test.ts +++ b/test/standalone/llamaEvaluator/LlamaGrammar.test.ts @@ -106,22 +106,22 @@ describe("grammar for JSON schema", () => { }; expect(grammar.grammar).toMatchInlineSnapshot(` - "root ::= \\"{\\" whitespace-new-lines-rule \\"\\\\\\"message\\\\\\"\\" \\":\\" [ ]? rule0 \\",\\" whitespace-new-lines-rule \\"\\\\\\"numberOfWordsInMessage\\\\\\"\\" \\":\\" [ ]? integer-number-rule \\",\\" whitespace-new-lines-rule \\"\\\\\\"feelingGoodPercentage\\\\\\"\\" \\":\\" [ ]? fractional-number-rule \\",\\" whitespace-new-lines-rule \\"\\\\\\"feelingGood\\\\\\"\\" \\":\\" [ ]? boolean-rule \\",\\" whitespace-new-lines-rule \\"\\\\\\"feelingOverall\\\\\\"\\" \\":\\" [ ]? rule5 \\",\\" whitespace-new-lines-rule \\"\\\\\\"verbsInMessage\\\\\\"\\" \\":\\" [ ]? rule6 whitespace-new-lines-rule \\"}\\" [\\\\n] [\\\\n] [\\\\n] [\\\\n] [\\\\n]* - whitespace-new-lines-rule ::= [\\\\n]? [ \\\\t]* [\\\\n]? - string-rule ::= \\"\\\\\\"\\" ( [^\\"\\\\\\\\] | \\"\\\\\\\\\\" ([\\"\\\\\\\\/bfnrt] | \\"u\\" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]))* \\"\\\\\\"\\" - null-rule ::= \\"null\\" + "root ::= "{" whitespace-new-lines-rule "\\"message\\"" ":" [ ]? rule0 "," whitespace-new-lines-rule "\\"numberOfWordsInMessage\\"" ":" [ ]? integer-number-rule "," whitespace-new-lines-rule "\\"feelingGoodPercentage\\"" ":" [ ]? fractional-number-rule "," whitespace-new-lines-rule "\\"feelingGood\\"" ":" [ ]? boolean-rule "," whitespace-new-lines-rule "\\"feelingOverall\\"" ":" [ ]? rule5 "," whitespace-new-lines-rule "\\"verbsInMessage\\"" ":" [ ]? rule6 whitespace-new-lines-rule "}" [\\n] [\\n] [\\n] [\\n] [\\n]* + whitespace-new-lines-rule ::= [\\n]? [ \\t]* [\\n]? + string-rule ::= "\\"" ( [^"\\\\] | "\\\\" (["\\\\/bfnrt] | "u" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]))* "\\"" + null-rule ::= "null" rule0 ::= ( string-rule | null-rule ) - integer-number-rule ::= (\\"-\\"? ([0-9] | [1-9] [0-9]*)) - fractional-number-rule ::= (\\"-\\"? ([0-9] | [1-9] [0-9]*)) (\\".\\" [0-9]+)? ([eE] [-+]? [0-9]+)? - rule1 ::= \\"true\\" - rule2 ::= \\"false\\" + integer-number-rule ::= ("-"? ([0-9] | [1-9] [0-9]*)) + fractional-number-rule ::= ("-"? ([0-9] | [1-9] [0-9]*)) ("." [0-9]+)? ([eE] [-+]? [0-9]+)? + rule1 ::= "true" + rule2 ::= "false" boolean-rule ::= ( rule1 | rule2 ) - rule3 ::= \\"\\\\\\"good\\\\\\"\\" - rule4 ::= \\"\\\\\\"bad\\\\\\"\\" + rule3 ::= "\\"good\\"" + rule4 ::= "\\"bad\\"" rule5 ::= ( rule3 | rule4 ) - rule7 ::= ( string-rule ) ( \\",\\" whitespace-new-lines-rule string-rule )* + rule7 ::= ( string-rule ) ( "," whitespace-new-lines-rule string-rule )* rule8 ::= ( string-rule )? - rule6 ::= \\"[\\" whitespace-new-lines-rule ( rule7 | rule8 ) whitespace-new-lines-rule \\"]\\"" + rule6 ::= "[" whitespace-new-lines-rule ( rule7 | rule8 ) whitespace-new-lines-rule "]"" `); const parsedValue = grammar.parse(JSON.stringify(exampleValidValue)); @@ -210,12 +210,12 @@ describe("grammar for JSON schema", () => { }; expect(grammar.grammar).toMatchInlineSnapshot(` - "root ::= \\"[\\" whitespace-new-lines-rule ( rule2 | rule3 ) whitespace-new-lines-rule \\"]\\" [\\\\n] [\\\\n] [\\\\n] [\\\\n] [\\\\n]* - whitespace-new-lines-rule ::= [\\\\n]? [ \\\\t]* [\\\\n]? - string-rule ::= \\"\\\\\\"\\" ( [^\\"\\\\\\\\] | \\"\\\\\\\\\\" ([\\"\\\\\\\\/bfnrt] | \\"u\\" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]))* \\"\\\\\\"\\" - rule0 ::= \\"{\\" whitespace-new-lines-rule \\"\\\\\\"message\\\\\\"\\" \\":\\" [ ]? string-rule whitespace-new-lines-rule \\"}\\" + "root ::= "[" whitespace-new-lines-rule ( rule2 | rule3 ) whitespace-new-lines-rule "]" [\\n] [\\n] [\\n] [\\n] [\\n]* + whitespace-new-lines-rule ::= [\\n]? [ \\t]* [\\n]? + string-rule ::= "\\"" ( [^"\\\\] | "\\\\" (["\\\\/bfnrt] | "u" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]))* "\\"" + rule0 ::= "{" whitespace-new-lines-rule "\\"message\\"" ":" [ ]? string-rule whitespace-new-lines-rule "}" rule1 ::= ( rule0 | string-rule ) - rule2 ::= ( rule1 ) ( \\",\\" whitespace-new-lines-rule rule1 )* + rule2 ::= ( rule1 ) ( "," whitespace-new-lines-rule rule1 )* rule3 ::= ( rule1 )?" `); @@ -301,12 +301,12 @@ describe("grammar for JSON schema", () => { }; expect(grammar.grammar).toMatchInlineSnapshot(` - "root ::= \\"{\\" whitespace-new-lines-rule \\"\\\\\\"onlyPositiveText\\\\\\"\\" \\":\\" [ ]? \\"true\\" \\",\\" whitespace-new-lines-rule \\"\\\\\\"onlyNegativeText\\\\\\"\\" \\":\\" [ ]? \\"false\\" \\",\\" whitespace-new-lines-rule \\"\\\\\\"onlyVibe\\\\\\"\\" \\":\\" [ ]? rule0 \\",\\" whitespace-new-lines-rule \\"\\\\\\"onlyNumber\\\\\\"\\" \\":\\" [ ]? \\"10\\" \\",\\" whitespace-new-lines-rule \\"\\\\\\"worstThing\\\\\\"\\" \\":\\" [ ]? null-rule \\",\\" whitespace-new-lines-rule \\"\\\\\\"withNewLine\\\\\\"\\" \\":\\" [ ]? rule1 \\",\\" whitespace-new-lines-rule \\"\\\\\\"withQuotes\\\\\\"\\" \\":\\" [ ]? rule2 whitespace-new-lines-rule \\"}\\" [\\\\n] [\\\\n] [\\\\n] [\\\\n] [\\\\n]* - whitespace-new-lines-rule ::= [\\\\n]? [ \\\\t]* [\\\\n]? - rule0 ::= \\"\\\\\\"good\\\\\\"\\" - null-rule ::= \\"null\\" - rule1 ::= \\"\\\\\\"Hooray!\\\\nYes!\\\\t/\\\\\\\\\\\\\\"\\" - rule2 ::= \\"\\\\\\"The message is \\\\\\\\\\\\\\"Hi!\\\\\\\\\\\\\\".\\\\\\"\\"" + "root ::= "{" whitespace-new-lines-rule "\\"onlyPositiveText\\"" ":" [ ]? "true" "," whitespace-new-lines-rule "\\"onlyNegativeText\\"" ":" [ ]? "false" "," whitespace-new-lines-rule "\\"onlyVibe\\"" ":" [ ]? rule0 "," whitespace-new-lines-rule "\\"onlyNumber\\"" ":" [ ]? "10" "," whitespace-new-lines-rule "\\"worstThing\\"" ":" [ ]? null-rule "," whitespace-new-lines-rule "\\"withNewLine\\"" ":" [ ]? rule1 "," whitespace-new-lines-rule "\\"withQuotes\\"" ":" [ ]? rule2 whitespace-new-lines-rule "}" [\\n] [\\n] [\\n] [\\n] [\\n]* + whitespace-new-lines-rule ::= [\\n]? [ \\t]* [\\n]? + rule0 ::= "\\"good\\"" + null-rule ::= "null" + rule1 ::= "\\"Hooray!\\nYes!\\t/\\\\\\"" + rule2 ::= "\\"The message is \\\\\\"Hi!\\\\\\".\\""" `); const parsedValue = grammar.parse(JSON.stringify(exampleValidValue)); @@ -379,12 +379,12 @@ describe("grammar for JSON schema", () => { }; expect(grammar.grammar).toMatchInlineSnapshot(` - "root ::= \\"{\\" whitespace-new-lines-rule \\"\\\\\\"onlyPositiveText\\\\\\"\\" \\":\\" [ ]? \\"true\\" \\",\\" whitespace-new-lines-rule \\"\\\\\\"onlyNegativeText\\\\\\"\\" \\":\\" [ ]? \\"false\\" \\",\\" whitespace-new-lines-rule \\"\\\\\\"onlyVibe\\\\\\"\\" \\":\\" [ ]? rule0 \\",\\" whitespace-new-lines-rule \\"\\\\\\"onlyNumber\\\\\\"\\" \\":\\" [ ]? \\"10\\" \\",\\" whitespace-new-lines-rule \\"\\\\\\"worstThing\\\\\\"\\" \\":\\" [ ]? null-rule \\",\\" whitespace-new-lines-rule \\"\\\\\\"withNewLine\\\\\\"\\" \\":\\" [ ]? rule1 \\",\\" whitespace-new-lines-rule \\"\\\\\\"withQuotes\\\\\\"\\" \\":\\" [ ]? rule2 whitespace-new-lines-rule \\"}\\" [\\\\n] [\\\\n] [\\\\n] [\\\\n] [\\\\n]* - whitespace-new-lines-rule ::= [\\\\n]? [ \\\\t]* [\\\\n]? - rule0 ::= \\"\\\\\\"good\\\\\\"\\" - null-rule ::= \\"null\\" - rule1 ::= \\"\\\\\\"Hooray!\\\\nYes!\\\\t/\\\\\\\\\\\\\\"\\" - rule2 ::= \\"\\\\\\"The message is \\\\\\\\\\\\\\"Hi!\\\\\\\\\\\\\\".\\\\\\"\\"" + "root ::= "{" whitespace-new-lines-rule "\\"onlyPositiveText\\"" ":" [ ]? "true" "," whitespace-new-lines-rule "\\"onlyNegativeText\\"" ":" [ ]? "false" "," whitespace-new-lines-rule "\\"onlyVibe\\"" ":" [ ]? rule0 "," whitespace-new-lines-rule "\\"onlyNumber\\"" ":" [ ]? "10" "," whitespace-new-lines-rule "\\"worstThing\\"" ":" [ ]? null-rule "," whitespace-new-lines-rule "\\"withNewLine\\"" ":" [ ]? rule1 "," whitespace-new-lines-rule "\\"withQuotes\\"" ":" [ ]? rule2 whitespace-new-lines-rule "}" [\\n] [\\n] [\\n] [\\n] [\\n]* + whitespace-new-lines-rule ::= [\\n]? [ \\t]* [\\n]? + rule0 ::= "\\"good\\"" + null-rule ::= "null" + rule1 ::= "\\"Hooray!\\nYes!\\t/\\\\\\"" + rule2 ::= "\\"The message is \\\\\\"Hi!\\\\\\".\\""" `); const parsedValue = grammar.parse(JSON.stringify(exampleValidValue)); @@ -458,12 +458,12 @@ describe("grammar for JSON schema", () => { }; expect(grammar.grammar).toMatchInlineSnapshot(` - "root ::= \\"{\\" whitespace-new-lines-rule \\"\\\\\\"onlyPositiveText\\\\\\"\\" \\":\\" [ ]? \\"true\\" \\",\\" whitespace-new-lines-rule \\"\\\\\\"onlyNegativeText\\\\\\"\\" \\":\\" [ ]? \\"false\\" \\",\\" whitespace-new-lines-rule \\"\\\\\\"onlyVibe\\\\\\"\\" \\":\\" [ ]? rule0 \\",\\" whitespace-new-lines-rule \\"\\\\\\"onlyNumber\\\\\\"\\" \\":\\" [ ]? \\"10\\" \\",\\" whitespace-new-lines-rule \\"\\\\\\"worstThing\\\\\\"\\" \\":\\" [ ]? null-rule \\",\\" whitespace-new-lines-rule \\"\\\\\\"withNewLine\\\\\\"\\" \\":\\" [ ]? rule1 \\",\\" whitespace-new-lines-rule \\"\\\\\\"withQuotes\\\\\\"\\" \\":\\" [ ]? rule2 whitespace-new-lines-rule \\"}\\" [\\\\n] [\\\\n] [\\\\n] [\\\\n] [\\\\n]* - whitespace-new-lines-rule ::= [\\\\n]? [ \\\\t]* [\\\\n]? - rule0 ::= \\"\\\\\\"good\\\\\\"\\" - null-rule ::= \\"null\\" - rule1 ::= \\"\\\\\\"Hooray!\\\\nYes!\\\\t/\\\\\\\\\\\\\\"\\" - rule2 ::= \\"\\\\\\"The message is \\\\\\\\\\\\\\"Hi!\\\\\\\\\\\\\\".\\\\\\"\\"" + "root ::= "{" whitespace-new-lines-rule "\\"onlyPositiveText\\"" ":" [ ]? "true" "," whitespace-new-lines-rule "\\"onlyNegativeText\\"" ":" [ ]? "false" "," whitespace-new-lines-rule "\\"onlyVibe\\"" ":" [ ]? rule0 "," whitespace-new-lines-rule "\\"onlyNumber\\"" ":" [ ]? "10" "," whitespace-new-lines-rule "\\"worstThing\\"" ":" [ ]? null-rule "," whitespace-new-lines-rule "\\"withNewLine\\"" ":" [ ]? rule1 "," whitespace-new-lines-rule "\\"withQuotes\\"" ":" [ ]? rule2 whitespace-new-lines-rule "}" [\\n] [\\n] [\\n] [\\n] [\\n]* + whitespace-new-lines-rule ::= [\\n]? [ \\t]* [\\n]? + rule0 ::= "\\"good\\"" + null-rule ::= "null" + rule1 ::= "\\"Hooray!\\nYes!\\t/\\\\\\"" + rule2 ::= "\\"The message is \\\\\\"Hi!\\\\\\".\\""" `); const parsedValue = grammar.parse(JSON.stringify(exampleValidValue)); From dea6f22c255eb941c6cdcf535672808b09fa3955 Mon Sep 17 00:00:00 2001 From: Gilad S Date: Sat, 10 Feb 2024 16:53:18 +0200 Subject: [PATCH 15/22] chore: configuring CUDA --- llama/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/llama/CMakeLists.txt b/llama/CMakeLists.txt index 4fc8b0b4..a18a74bc 100644 --- a/llama/CMakeLists.txt +++ b/llama/CMakeLists.txt @@ -20,6 +20,7 @@ include_directories(${NODE_ADDON_API_DIR} ${CMAKE_JS_INC}) add_subdirectory("llama.cpp") include_directories("gpuInfo") +include_directories("llama.cpp") include_directories("./llama.cpp/common") if (LLAMA_CUBLAS) @@ -46,8 +47,6 @@ if (LLAMA_CUBLAS) endif() endif() -include_directories("llama.cpp") - if (LLAMA_HIPBLAS) list(APPEND CMAKE_PREFIX_PATH /opt/rocm) From 32f58287b94a8e4a9b0834e28bed4ecad23db061 Mon Sep 17 00:00:00 2001 From: Gilad S Date: Sat, 10 Feb 2024 17:03:47 +0200 Subject: [PATCH 16/22] refactor: rename `getVramStatus` to `getVramState` --- src/bindings/Llama.ts | 2 +- src/cli/commands/DebugCommand.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bindings/Llama.ts b/src/bindings/Llama.ts index 7b10cc2d..d4fd2d71 100644 --- a/src/bindings/Llama.ts +++ b/src/bindings/Llama.ts @@ -116,7 +116,7 @@ export class Llama { return this._bindings.systemInfo(); } - public getVramStatus() { + public getVramState() { const {total, used} = this._bindings.getGpuVramInfo(); return { diff --git a/src/cli/commands/DebugCommand.ts b/src/cli/commands/DebugCommand.ts index c6d30981..5e50ff0d 100644 --- a/src/cli/commands/DebugCommand.ts +++ b/src/cli/commands/DebugCommand.ts @@ -31,7 +31,7 @@ export const DebugCommand: CommandModule = { async function DebugVramFunction() { const llama = await getLlama("lastBuild"); - const vramStatus = llama.getVramStatus(); + const vramStatus = llama.getVramState(); const totalMemory = os.totalmem(); const freeMemory = os.freemem(); const usedMemory = totalMemory - freeMemory; From 9fbadf96496900d8d245b41403712fb0bdd8e239 Mon Sep 17 00:00:00 2001 From: Gilad S Date: Sat, 10 Feb 2024 17:23:32 +0200 Subject: [PATCH 17/22] chore: configuring CUDA --- llama/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/llama/CMakeLists.txt b/llama/CMakeLists.txt index a18a74bc..a8d10bd9 100644 --- a/llama/CMakeLists.txt +++ b/llama/CMakeLists.txt @@ -99,7 +99,10 @@ set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "" SUFFIX ".node") target_link_libraries(${PROJECT_NAME} ${CMAKE_JS_LIB}) target_link_libraries(${PROJECT_NAME} "llama") target_link_libraries(${PROJECT_NAME} "common") -target_link_libraries(${PROJECT_NAME} ${GPU_INFO_EXTRA_LIBS}) + +if (DEFINED GPU_INFO_EXTRA_LIBS) + target_link_libraries(${PROJECT_NAME} ${GPU_INFO_EXTRA_LIBS}) +endif() if(MSVC AND CMAKE_JS_NODELIB_DEF AND CMAKE_JS_NODELIB_TARGET) # Generate node.lib From cb45893114aef3b336fded697d325723718b2473 Mon Sep 17 00:00:00 2001 From: Gilad S Date: Sat, 10 Feb 2024 17:51:02 +0200 Subject: [PATCH 18/22] feat: use static linking for prebuilt CUDA binaries --- .github/workflows/build.yml | 12 +++++++-- llama/CMakeLists.txt | 6 +++++ src/cli/commands/BuildCommand.ts | 20 +++++++++++--- src/cli/commands/DebugCommand.ts | 42 +++++++++++++++++++++++------ src/cli/commands/DownloadCommand.ts | 2 +- 5 files changed, 67 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3f1a302b..7c4a0c0a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -178,11 +178,19 @@ jobs: // build binaries if (process.env.ARTIFACT_NAME === "win") { await buildBinary("x64"); - await buildBinary("x64", ["--cuda"]); + + $.env.NODE_LLAMA_CPP_CMAKE_OPTION_LLAMA_STATIC = "1"; + await buildBinary("x64", ["--cuda", "--noCustomCmakeBuildOptionsInBinaryFolderName"]); + delete $.env.NODE_LLAMA_CPP_CMAKE_OPTION_LLAMA_STATIC; + // await buildBinary("arm64", [], windowsOnArmNodeVersion); // disabled arm64 for now as compilation doesn't work } else if (process.env.ARTIFACT_NAME === "linux") { await buildBinary("x64"); - await buildBinary("x64", ["--cuda"]); + + $.env.NODE_LLAMA_CPP_CMAKE_OPTION_LLAMA_STATIC = "1"; + await buildBinary("x64", ["--cuda", "--noCustomCmakeBuildOptionsInBinaryFolderName"]); + delete $.env.NODE_LLAMA_CPP_CMAKE_OPTION_LLAMA_STATIC; + await buildBinary("arm64"); await buildBinary("armv7l"); } else if (process.env.ARTIFACT_NAME === "mac") { diff --git a/llama/CMakeLists.txt b/llama/CMakeLists.txt index a8d10bd9..35c567e6 100644 --- a/llama/CMakeLists.txt +++ b/llama/CMakeLists.txt @@ -37,6 +37,12 @@ if (LLAMA_CUBLAS) add_compile_definitions(GPU_INFO_USE_CUBLAS) + if (LLAMA_STATIC) + set(LLAMA_EXTRA_LIBS ${GPU_INFO_EXTRA_LIBS} CUDA::cudart_static) + else() + set(LLAMA_EXTRA_LIBS ${GPU_INFO_EXTRA_LIBS} CUDA::cudart) + endif() + set(GPU_INFO_EXTRA_LIBS ${GPU_INFO_EXTRA_LIBS} CUDA::cuda_driver) if (NOT DEFINED CMAKE_CUDA_ARCHITECTURES) diff --git a/src/cli/commands/BuildCommand.ts b/src/cli/commands/BuildCommand.ts index fda0e053..af96cc09 100644 --- a/src/cli/commands/BuildCommand.ts +++ b/src/cli/commands/BuildCommand.ts @@ -5,7 +5,7 @@ import {compileLlamaCpp} from "../../bindings/utils/compileLLamaCpp.js"; import withOra from "../../utils/withOra.js"; import {clearTempFolder} from "../../utils/clearTempFolder.js"; import { - builtinLlamaCppGitHubRepo, builtinLlamaCppRelease, defaultLlamaCppCudaSupport, defaultLlamaCppMetalSupport + builtinLlamaCppGitHubRepo, builtinLlamaCppRelease, defaultLlamaCppCudaSupport, defaultLlamaCppMetalSupport, isCI } from "../../config.js"; import {downloadCmakeIfNeeded} from "../../utils/cmake.js"; import withStatusLogs from "../../utils/withStatusLogs.js"; @@ -21,7 +21,10 @@ type BuildCommand = { nodeTarget?: string, metal?: boolean, cuda?: boolean, - noUsageExample?: boolean + noUsageExample?: boolean, + + /** @internal */ + noCustomCmakeBuildOptionsInBinaryFolderName?: boolean }; export const BuildCommand: CommandModule = { @@ -56,6 +59,12 @@ export const BuildCommand: CommandModule = { type: "boolean", default: false, description: "Don't print code usage example after building" + }) + .option("noCustomCmakeBuildOptionsInBinaryFolderName", { + type: "boolean", + hidden: true, // this is only for the CI to use + default: false, + description: "Don't include custom CMake build options in build folder name" }); }, handler: BuildLlamaCppCommand @@ -66,13 +75,16 @@ export async function BuildLlamaCppCommand({ nodeTarget = undefined, metal = defaultLlamaCppMetalSupport, cuda = defaultLlamaCppCudaSupport, - noUsageExample = false + noUsageExample = false, + noCustomCmakeBuildOptionsInBinaryFolderName = false }: BuildCommand) { if (!(await isLlamaCppRepoCloned())) { console.log(chalk.red('llama.cpp is not downloaded. Please run "node-llama-cpp download" first')); process.exit(1); } + const includeBuildOptionsInBinaryFolderName = !noCustomCmakeBuildOptionsInBinaryFolderName || !isCI; + const clonedLlamaCppRepoReleaseInfo = await getClonedLlamaCppRepoReleaseInfo(); const platform = getPlatform(); @@ -115,7 +127,7 @@ export async function BuildLlamaCppCommand({ updateLastBuildInfo: true, downloadCmakeIfNeeded: false, ensureLlamaCppRepoIsCloned: false, - includeBuildOptionsInBinaryFolderName: true + includeBuildOptionsInBinaryFolderName }); }); diff --git a/src/cli/commands/DebugCommand.ts b/src/cli/commands/DebugCommand.ts index 5e50ff0d..20a90649 100644 --- a/src/cli/commands/DebugCommand.ts +++ b/src/cli/commands/DebugCommand.ts @@ -3,8 +3,10 @@ import {CommandModule} from "yargs"; import bytes from "bytes"; import chalk from "chalk"; import {getLlama} from "../../bindings/getLlama.js"; +import {Llama} from "../../bindings/Llama.js"; +import {prettyPrintObject} from "../../utils/prettyPrintObject.js"; -const debugFunctions = ["vram"] as const; +const debugFunctions = ["vram", "cmakeOptions"] as const; type DebugCommand = { function: (typeof debugFunctions)[number] }; @@ -22,9 +24,12 @@ export const DebugCommand: CommandModule = { }); }, async handler({function: func}: DebugCommand) { - if (func === "vram") { + if (func === "vram") await DebugVramFunction(); - } + else if (func === "cmakeOptions") + await DebugCmakeOptionsFunction(); + else + void (func satisfies never); } }; @@ -36,11 +41,7 @@ async function DebugVramFunction() { const freeMemory = os.freemem(); const usedMemory = totalMemory - freeMemory; - if (llama.metal) - console.log(`${chalk.yellow("Metal:")} enabled`); - - if (llama.cuda) - console.log(`${chalk.yellow("Metal:")} enabled`); + logComputeLayers(llama); console.info(`${chalk.yellow("Used VRAM:")} ${Math.ceil((vramStatus.used / vramStatus.total) * 100 * 100) / 100}% ${chalk.grey("(" + bytes(vramStatus.used) + "/" + bytes(vramStatus.total) + ")")}`); console.info(`${chalk.yellow("Free VRAM:")} ${Math.floor((vramStatus.free / vramStatus.total) * 100 * 100) / 100}% ${chalk.grey("(" + bytes(vramStatus.free) + "/" + bytes(vramStatus.total) + ")")}`); @@ -48,3 +49,28 @@ async function DebugVramFunction() { console.info(`${chalk.yellow("Used RAM:")} ${Math.ceil((usedMemory / totalMemory) * 100 * 100) / 100}% ${chalk.grey("(" + bytes(usedMemory) + "/" + bytes(totalMemory) + ")")}`); console.info(`${chalk.yellow("Free RAM:")} ${Math.floor((freeMemory / totalMemory) * 100 * 100) / 100}% ${chalk.grey("(" + bytes(freeMemory) + "/" + bytes(totalMemory) + ")")}`); } + +async function DebugCmakeOptionsFunction() { + const llama = await getLlama("lastBuild"); + + logComputeLayers(llama); + + console.info(`${chalk.yellow("CMake options:")} ${prettyPrintObject(llama.cmakeOptions)}`); +} + +function logComputeLayers(llama: Llama) { + let hasEnabledLayers = false; + + if (llama.metal) { + console.info(`${chalk.yellow("Metal:")} enabled`); + hasEnabledLayers = true; + } + + if (llama.cuda) { + console.info(`${chalk.yellow("Metal:")} enabled`); + hasEnabledLayers = true; + } + + if (hasEnabledLayers) + console.info(); +} diff --git a/src/cli/commands/DownloadCommand.ts b/src/cli/commands/DownloadCommand.ts index 45158943..7ae6c004 100644 --- a/src/cli/commands/DownloadCommand.ts +++ b/src/cli/commands/DownloadCommand.ts @@ -94,7 +94,7 @@ export const DownloadCommand: CommandModule = { }) .option("updateBinariesReleaseMetadataAndSaveGitBundle", { type: "boolean", - hidden: true, // this for the CI to use + hidden: true, // this is only for the CI to use default: false, description: "Update the binariesGithubRelease.json file with the release of llama.cpp that was downloaded" }); From e0526a3be6069ba29650646cf2e167d18c4d3141 Mon Sep 17 00:00:00 2001 From: Gilad S Date: Sat, 10 Feb 2024 18:05:15 +0200 Subject: [PATCH 19/22] feat: use dynamic linking for prebuilt CUDA binaries --- .github/workflows/build.yml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7c4a0c0a..3f1a302b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -178,19 +178,11 @@ jobs: // build binaries if (process.env.ARTIFACT_NAME === "win") { await buildBinary("x64"); - - $.env.NODE_LLAMA_CPP_CMAKE_OPTION_LLAMA_STATIC = "1"; - await buildBinary("x64", ["--cuda", "--noCustomCmakeBuildOptionsInBinaryFolderName"]); - delete $.env.NODE_LLAMA_CPP_CMAKE_OPTION_LLAMA_STATIC; - + await buildBinary("x64", ["--cuda"]); // await buildBinary("arm64", [], windowsOnArmNodeVersion); // disabled arm64 for now as compilation doesn't work } else if (process.env.ARTIFACT_NAME === "linux") { await buildBinary("x64"); - - $.env.NODE_LLAMA_CPP_CMAKE_OPTION_LLAMA_STATIC = "1"; - await buildBinary("x64", ["--cuda", "--noCustomCmakeBuildOptionsInBinaryFolderName"]); - delete $.env.NODE_LLAMA_CPP_CMAKE_OPTION_LLAMA_STATIC; - + await buildBinary("x64", ["--cuda"]); await buildBinary("arm64"); await buildBinary("armv7l"); } else if (process.env.ARTIFACT_NAME === "mac") { From 0af3ade0282b69dec38700bb70199fa84b479001 Mon Sep 17 00:00:00 2001 From: Gilad S Date: Sat, 10 Feb 2024 18:14:07 +0200 Subject: [PATCH 20/22] chore: fix vitest config --- vitest.config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/vitest.config.ts b/vitest.config.ts index 331c408c..2b65d48d 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -2,6 +2,7 @@ import {defineConfig} from "vitest/config"; export default defineConfig({ test: { + pool: "typescript", poolOptions: { threads: { minThreads: 1, From 8aac9607b9fb4bc9c9e8def00199929439c4ef90 Mon Sep 17 00:00:00 2001 From: Gilad S Date: Sat, 10 Feb 2024 18:49:57 +0200 Subject: [PATCH 21/22] chore: configuring CUDA --- llama/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/llama/CMakeLists.txt b/llama/CMakeLists.txt index 35c567e6..a92404be 100644 --- a/llama/CMakeLists.txt +++ b/llama/CMakeLists.txt @@ -46,7 +46,12 @@ if (LLAMA_CUBLAS) set(GPU_INFO_EXTRA_LIBS ${GPU_INFO_EXTRA_LIBS} CUDA::cuda_driver) if (NOT DEFINED CMAKE_CUDA_ARCHITECTURES) - set(CMAKE_CUDA_ARCHITECTURES "") + # copied from llama.cpp/CMakLists.txt under "if (NOT DEFINED CMAKE_CUDA_ARCHITECTURES)" + if (LLAMA_CUDA_F16 OR LLAMA_CUDA_DMMV_F16) + set(CMAKE_CUDA_ARCHITECTURES "60;61;70") + else() + set(CMAKE_CUDA_ARCHITECTURES "52;61;70") + endif() endif() else() message(WARNING "cuBLAS not found. Not using it for GPU info") From db0db23ac49b40e158ab120f5e0212f243a3b832 Mon Sep 17 00:00:00 2001 From: Gilad S Date: Sat, 10 Feb 2024 18:59:23 +0200 Subject: [PATCH 22/22] fix: pretty object print --- src/utils/prettyPrintObject.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/utils/prettyPrintObject.ts b/src/utils/prettyPrintObject.ts index 5f281f27..d9af60d7 100644 --- a/src/utils/prettyPrintObject.ts +++ b/src/utils/prettyPrintObject.ts @@ -25,8 +25,7 @@ export function prettyPrintObject(obj: any, indent: number = 4): string { rows.push([ " ".repeat(indent), - (JSON.stringify(key) - .slice(1, -1) === key) + canStringBeKeyWithoutQuotes(key) ? chalk.red(key) : chalk.green(JSON.stringify(key)), chalk.whiteBright(": "), @@ -40,3 +39,7 @@ export function prettyPrintObject(obj: any, indent: number = 4): string { return chalk.whiteBright("{\n") + rows.join(chalk.whiteBright(",\n")) + chalk.whiteBright("\n") + chalk.whiteBright("}"); } + +function canStringBeKeyWithoutQuotes(key: string): boolean { + return JSON.stringify(key).slice(1, -1) === key && /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(key); +}