diff --git a/.github/workflows/frontend-tests.yaml b/.github/workflows/frontend-tests.yaml index f96ebfe4d..154114d1f 100644 --- a/.github/workflows/frontend-tests.yaml +++ b/.github/workflows/frontend-tests.yaml @@ -29,7 +29,7 @@ jobs: cache: "pnpm" - name: Install dependencies - run: pnpm install --frozen-lockfile --filter=testing-view --filter=ui --filter=core + run: pnpm install --frozen-lockfile --filter=testing-view --filter=flashing-view --filter=competition-view --filter=ui --filter=core - name: Build frontend run: pnpm build --filter="./frontend/**" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4413187c3..fcfc670a1 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -10,9 +10,19 @@ on: description: "Create as draft release" type: boolean default: true + include-testing: + description: "Include Testing View" + type: boolean + default: true + include-competition: + description: "Include Competition View" + type: boolean + default: true + include-flashing: + description: "Include Flashing View" + type: boolean + default: true -env: - FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true jobs: determine-version: @@ -21,12 +31,18 @@ jobs: outputs: version: ${{ steps.get_version.outputs.version }} is_draft: ${{ steps.get_version.outputs.is_draft }} + include_testing: ${{ steps.get_version.outputs.include_testing }} + include_competition: ${{ steps.get_version.outputs.include_competition }} + include_flashing: ${{ steps.get_version.outputs.include_flashing }} steps: - name: Determine version id: get_version run: | echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT echo "is_draft=${{ github.event.inputs.draft }}" >> $GITHUB_OUTPUT + echo "include_testing=${{ github.event.inputs.include-testing }}" >> $GITHUB_OUTPUT + echo "include_competition=${{ github.event.inputs.include-competition }}" >> $GITHUB_OUTPUT + echo "include_flashing=${{ github.event.inputs.include-flashing }}" >> $GITHUB_OUTPUT create-draft-release: name: Create Draft Release @@ -62,20 +78,46 @@ jobs: - uses: actions/setup-node@v4 with: - node-version: "20" + node-version: "24" - name: Install dependencies run: pnpm install --frozen-lockfile - name: Build with Turbo - run: pnpm turbo build --filter=testing-view + run: | + FILTERS="" + if [ "${{ needs.determine-version.outputs.include_testing }}" = "true" ]; then + FILTERS="$FILTERS --filter=testing-view" + fi + if [ "${{ needs.determine-version.outputs.include_competition }}" = "true" ]; then + FILTERS="$FILTERS --filter=competition-view" + fi + if [ "${{ needs.determine-version.outputs.include_flashing }}" = "true" ]; then + FILTERS="$FILTERS --filter=flashing-view" + fi + pnpm turbo build $FILTERS - uses: actions/upload-artifact@v4 + if: needs.determine-version.outputs.include_testing == 'true' with: name: frontend-dist path: frontend/testing-view/dist/** retention-days: 1 + - uses: actions/upload-artifact@v4 + if: needs.determine-version.outputs.include_competition == 'true' + with: + name: competition-dist + path: frontend/competition-view/dist/** + retention-days: 1 + + - uses: actions/upload-artifact@v4 + if: needs.determine-version.outputs.include_flashing == 'true' + with: + name: flashing-dist + path: frontend/flashing-view/dist/** + retention-days: 1 + build-backend: name: Build Backend - ${{ matrix.os }} needs: determine-version @@ -121,9 +163,86 @@ jobs: path: electron-app/binaries/${{ matrix.binary }} retention-days: 1 + build-blcu: + name: Build BLCU - ${{ matrix.os }} + needs: determine-version + runs-on: ${{ matrix.os }} + strategy: + fail-fast: true + matrix: + include: + - os: windows-latest + binary: blcu-programming-windows-amd64.exe + binary-base: blcu-programming-windows-amd64 + - os: ubuntu-latest + binary: blcu-programming-linux-amd64 + binary-base: blcu-programming-linux-amd64 + - os: macos-latest + binary: blcu-programming-darwin-arm64 + binary-base: blcu-programming-darwin-arm64 + - os: macos-15-intel + binary: blcu-programming-darwin-amd64 + binary-base: blcu-programming-darwin-amd64 + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Create virtual environment + working-directory: blcu-programming + run: python -m venv .venv-build + + - name: Install dependencies + working-directory: blcu-programming + shell: bash + run: | + if [ "${{ runner.os }}" = "Windows" ]; then + .venv-build/Scripts/pip install -r requirements-build.txt + else + .venv-build/bin/pip install -r requirements-build.txt + fi + + - name: Build with PyInstaller + working-directory: blcu-programming + shell: bash + run: | + if [ "${{ runner.os }}" = "Windows" ]; then + PYTHON=".venv-build/Scripts/python" + else + PYTHON=".venv-build/bin/python" + fi + if [ "${{ runner.os }}" = "Windows" ]; then + PATH_SEP=";" + else + PATH_SEP=":" + fi + "$PYTHON" -m PyInstaller \ + --clean \ + --noconfirm \ + --onefile \ + --name "${{ matrix.binary-base }}" \ + --distpath "../electron-app/binaries" \ + --hidden-import uvicorn.loops.auto \ + --hidden-import uvicorn.protocols.http.auto \ + --hidden-import uvicorn.protocols.websockets.auto \ + --hidden-import uvicorn.lifespan.on \ + --hidden-import multipart \ + --hidden-import multipart.multiparser \ + --paths "." \ + --add-data "BLCU-config.json${PATH_SEP}." \ + api/main.py + + - uses: actions/upload-artifact@v4 + with: + name: blcu-${{ matrix.os }} + path: electron-app/binaries/${{ matrix.binary }} + retention-days: 1 + package-and-upload: name: Package & Upload - ${{ matrix.os }} - needs: [determine-version, create-draft-release, build-frontend, build-backend] + needs: [determine-version, create-draft-release, build-frontend, build-backend, build-blcu] runs-on: ${{ matrix.os }} strategy: fail-fast: true @@ -131,12 +250,16 @@ jobs: include: - os: windows-latest binary: backend-windows-amd64.exe + blcu-binary: blcu-programming-windows-amd64.exe - os: ubuntu-latest binary: backend-linux-amd64 + blcu-binary: blcu-programming-linux-amd64 - os: macos-latest binary: backend-darwin-arm64 + blcu-binary: blcu-programming-darwin-arm64 - os: macos-15-intel binary: backend-darwin-amd64 + blcu-binary: blcu-programming-darwin-amd64 steps: - uses: actions/checkout@v4 @@ -146,23 +269,44 @@ jobs: name: backend-${{ matrix.os }} path: electron-app/binaries + - name: Download BLCU binary + uses: actions/download-artifact@v4 + with: + name: blcu-${{ matrix.os }} + path: electron-app/binaries + - name: Set executable permissions (Unix) if: runner.os != 'Windows' run: chmod +x electron-app/binaries/* - name: Download frontend dist + if: needs.determine-version.outputs.include_testing == 'true' uses: actions/download-artifact@v4 with: name: frontend-dist path: electron-app/renderer/testing-view + - name: Download competition-view dist + if: needs.determine-version.outputs.include_competition == 'true' + uses: actions/download-artifact@v4 + with: + name: competition-dist + path: electron-app/renderer/competition-view + + - name: Download flashing-view dist + if: needs.determine-version.outputs.include_flashing == 'true' + uses: actions/download-artifact@v4 + with: + name: flashing-dist + path: electron-app/renderer/flashing-view + - uses: pnpm/action-setup@v4 with: version: 10.26.0 - uses: actions/setup-node@v4 with: - node-version: "20" + node-version: "24" - name: Update version in package.json working-directory: electron-app @@ -186,7 +330,7 @@ jobs: run: | find electron-app/dist -maxdepth 1 -type f \ \( -name "*.exe" -o -name "*.AppImage" -o -name "*.deb" \ - -o -name "*.dmg" -o -name "*.zip" -o -name "*.yml" -o -name "*.blockmap" \) \ + -o -name "*.rpm" -o -name "*.dmg" -o -name "*.zip" -o -name "*.yml" -o -name "*.blockmap" \) \ | xargs gh release upload v${{ needs.determine-version.outputs.version }} --clobber env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 1d914a987..bc66fec72 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,8 @@ node_modules/ .env # Global binaries -*.exe \ No newline at end of file +*.exe + +# electron modules +electron-app/python +electron-app/logger diff --git a/README.md b/README.md index fca4c0051..ebbe5a239 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,9 @@ Before starting, ensure you have the following installed: - **PNPM** (v10.26.0+) - **Node.js** (v20+) - **Go** (for the backend) -- **Rust/Cargo** (for the packet-sender) +- **Python** (v3.11+, for the BLCU programming service) + +`pnpm install` automatically creates the Python virtual environment and installs dependencies for the BLCU programming service on Windows, macOS, and Linux. --- @@ -25,8 +27,9 @@ Our `pnpm-workspace.yaml` defines the following workspaces: | :----------------------------- | :------- | :---------------------------------------------------- | | `testing-view` | TS/React | Web interface for telemetry testing | | `competition-view` | TS/React | UI for the competition | +| `flashing-view` | TS/React | UI for flashing firmware to the BLCU board | | `backend` | Go | Data ingestion and pod communication server | -| `packet-sender` | Rust | Utility for simulating vehicle packets | +| `blcu-programming` | Python | FastAPI service that flashes firmware to the BLCU board via TFTP | | `hyperloop-control-station` | JS | The main Control Station electron desktop application | | `e2e` | TS | End-to-end tests for the whole app (Playwright) | | `@workspace/ui` | TS/React | Shared UI component library (frontend-kit) | @@ -44,7 +47,7 @@ These commands should be executed from the root directory (`/software`). #### Global Development Scripts -- `pnpm dev` – Runs both frontends, the backend (with `dev-config.toml`), and the packet-sender in a single terminal window. +- `pnpm dev` – Runs both frontends and the backend (with `dev-config.toml`) in a single terminal window. - `pnpm dev:main` – Runs frontends and the backend using the standard `config.toml`. #### Turbo Filtering @@ -69,8 +72,14 @@ All Turbo scripts support filtering to target specific workspaces: - `pnpm build:linux` – Packages the Electron app for Linux. - `pnpm build:mac` – Packages the Electron app for macOS. +#### Frontend View Scripts + +- `pnpm build:testing-view` – Builds only the Testing View frontend. +- `pnpm build:competition-view` – Builds only the Competition View frontend. +- `pnpm build:flashing-view` – Builds only the Flashing View frontend. + #### Utility Scripts - `pnpm ui:add ` - To add shadcn/ui components - > Note: don't forget to also include it in frontend-kit/ui/src/components/shadcn/index.ts to be able to access it from @workspace/ui + > Note: don't forget to also include it in frontend-kit/ui/src/components/shadcn/index.ts to be able to access it from @workspace/ui \ No newline at end of file diff --git a/backend/cmd/main.go b/backend/cmd/main.go index 3aa50883b..5ce0e5126 100644 --- a/backend/cmd/main.go +++ b/backend/cmd/main.go @@ -9,6 +9,7 @@ import ( "github.com/HyperloopUPV-H8/h9-backend/internal/flags" "github.com/HyperloopUPV-H8/h9-backend/internal/pod_data" "github.com/HyperloopUPV-H8/h9-backend/internal/update_factory" + "github.com/HyperloopUPV-H8/h9-backend/pkg/logger" tracelogger "github.com/HyperloopUPV-H8/h9-backend/pkg/logger/trace" vehicle_models "github.com/HyperloopUPV-H8/h9-backend/internal/vehicle/models" @@ -34,12 +35,6 @@ func main() { flags.Init() handleVersionFlag() - // Configure trace - traceFile := tracelogger.InitTrace(flags.TraceLevel) - if traceFile != nil { - defer traceFile.Close() - } - // Set use to all available CPUs and setup CPU profiling if enabled cleanup := setupRuntimeCPU() defer cleanup() @@ -50,12 +45,26 @@ func main() { trace.Fatal().Err(err).Msg("error unmarshaling toml file") } + // Configure BasePath before InitTrace and NewADJ so all "others" files land in the right place + if err := logger.ConfigureLogger(config.Logging.TimeUnit, config.Logging.LoggingPath, ""); err != nil { + trace.Fatal().Err(err).Msg("configuring logger") + } + + // Configure trace + traceFile := tracelogger.InitTrace(flags.TraceLevel) + if traceFile != nil { + defer traceFile.Close() + } + // <--- ADJ ---> adj, err := adj_module.NewADJ(config.Adj) if err != nil { trace.Fatal().Err(err).Msg("setting up ADJ") } + // Now that we have the commit hash, update it in the logger + logger.CommitHash = adj.Commit + // <--- pod data ---> podData, err := pod_data.NewPodData(adj.Boards, adj.Info.Units) if err != nil { @@ -75,7 +84,7 @@ func main() { updateFactory := update_factory.NewFactory(boardToPackets) // <--- logger ---> - loggerHandler, subloggers := setUpLogger(config) + loggerHandler, subloggers := setUpLogger() // <-- connections & upgrader --> connections := make(chan *websocket.Client) diff --git a/backend/cmd/orchestrator.go b/backend/cmd/orchestrator.go index e395060df..0c804356d 100644 --- a/backend/cmd/orchestrator.go +++ b/backend/cmd/orchestrator.go @@ -7,7 +7,6 @@ import ( "runtime/pprof" "strings" - "github.com/HyperloopUPV-H8/h9-backend/internal/config" "github.com/HyperloopUPV-H8/h9-backend/internal/flags" "github.com/HyperloopUPV-H8/h9-backend/internal/pod_data" "github.com/HyperloopUPV-H8/h9-backend/pkg/abstraction" @@ -15,6 +14,7 @@ import ( "github.com/HyperloopUPV-H8/h9-backend/pkg/logger" data_logger "github.com/HyperloopUPV-H8/h9-backend/pkg/logger/data" order_logger "github.com/HyperloopUPV-H8/h9-backend/pkg/logger/order" + protection_logger "github.com/HyperloopUPV-H8/h9-backend/pkg/logger/protection" trace "github.com/rs/zerolog/log" ) @@ -134,16 +134,15 @@ func createLookupTables( createBoardToPackets(podData) } -func setUpLogger(config config.Config) (*logger.Logger, abstraction.SubloggersMap) { +func setUpLogger() (*logger.Logger, abstraction.SubloggersMap) { var subloggers = abstraction.SubloggersMap{ - data_logger.Name: data_logger.NewLogger(), - order_logger.Name: order_logger.NewLogger(), + data_logger.Name: data_logger.NewLogger(), + protection_logger.Name: protection_logger.NewLogger(), + order_logger.Name: order_logger.NewLogger(), } - logger.ConfigureLogger(config.Logging.TimeUnit, config.Logging.LoggingPath) loggerHandler := logger.NewLogger(subloggers, trace.Logger) return loggerHandler, subloggers - } diff --git a/backend/package-lock.json b/backend/package-lock.json new file mode 100644 index 000000000..9837f8ec7 --- /dev/null +++ b/backend/package-lock.json @@ -0,0 +1,13 @@ +{ + "name": "backend", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "backend", + "version": "1.0.0", + "license": "MIT" + } + } +} diff --git a/backend/pkg/adj/adj.go b/backend/pkg/adj/adj.go index 81c79ce13..8a496f423 100644 --- a/backend/pkg/adj/adj.go +++ b/backend/pkg/adj/adj.go @@ -35,7 +35,7 @@ func getRepoPath() string { } func NewADJ(AdjSettings config.Adj) (ADJ, error) { - infoRaw, boardsRaw, err := downloadADJ(AdjSettings) + commitHash, infoRaw, boardsRaw, err := downloadADJ(AdjSettings) if err != nil { return ADJ{}, err } @@ -84,31 +84,38 @@ func NewADJ(AdjSettings config.Adj) (ADJ, error) { adj := ADJ{ Info: info, Boards: boards, + Commit: commitHash, } return adj, nil } -func downloadADJ(AdjSettings config.Adj) (json.RawMessage, json.RawMessage, error) { - updateRepo(AdjSettings.Branch) +func downloadADJ(AdjSettings config.Adj) (string, json.RawMessage, json.RawMessage, error) { + commitHash, err := updateRepo(AdjSettings.Branch) + if err != nil { + return "local", nil, nil, err + } + + // If not downloading use local ADJ + if commitHash == "" { + commitHash = "local" + } // After downloading adj apply adj validator if AdjSettings.Validate { - Validate() - } info, err := os.ReadFile(RepoPath + "general_info.json") if err != nil { - return nil, nil, err + return commitHash, nil, nil, err } boardsList, err := os.ReadFile(RepoPath + "boards.json") if err != nil { - return nil, nil, err + return commitHash, nil, nil, err } - return info, boardsList, nil + return commitHash, info, boardsList, nil } diff --git a/backend/pkg/adj/git.go b/backend/pkg/adj/git.go index 2feb7b6bb..ab17f1f28 100644 --- a/backend/pkg/adj/git.go +++ b/backend/pkg/adj/git.go @@ -15,14 +15,15 @@ import ( // connectivity). If the remote branch is accessible, the local repository is completely // removed and replaced with a clean, shallow clone of that branch. // If the remote is not accessible, the existing local repository is left untouched. +// returns commit an error if any operation fails, otherwise returns nil -func updateRepo(AdjBranch string) error { +func updateRepo(AdjBranch string) (string, error) { var err error - + var commitHash string if AdjBranch == "" { // Makes use of user's custom ADJ trace.Info().Msg("No ADJ branch specified. Using local ADJ.") - return nil + return "", nil } else { trace.Info().Msgf("Updating local ADJ repository to match remote branch '%s'", AdjBranch) cloneOptions := &git.CloneOptions{ @@ -37,7 +38,7 @@ func updateRepo(AdjBranch string) error { // Remove previous failed cloning attempts if err = os.RemoveAll(tempPath); err != nil { - return err + return "", err } // Try to import the ADJ to the temp directory @@ -45,30 +46,44 @@ func updateRepo(AdjBranch string) error { if err != nil { // If the clone fails, work with the local ADJ trace.Info().Msgf("Warning: Could not clone ADJ branch '%s' from remote. Working with local ADJ. Error: %v", AdjBranch, err) - return nil + + return "", nil } // If the clone is succesful, delete the temp files if err = os.RemoveAll(tempPath); err != nil { - return err + return "", err } // After checking that the repo is accessible, clone or update (overwrite) the local ADJ repo if _, err = os.Stat(RepoPath); os.IsNotExist(err) { - _, err = git.PlainClone(RepoPath, false, cloneOptions) + repo, err := git.PlainClone(RepoPath, false, cloneOptions) + if err != nil { + return "", err + } + // log the commit + ref, err := repo.Head() if err != nil { - return err + return "", err } + commitHash = ref.Hash().String() + } else { if err = os.RemoveAll(RepoPath); err != nil { - return err + return "", err + } + repo, err := git.PlainClone(RepoPath, false, cloneOptions) + if err != nil { + return "", err } - _, err = git.PlainClone(RepoPath, false, cloneOptions) + // log the commit + ref, err := repo.Head() if err != nil { - return err + return "", err } + commitHash = ref.Hash().String() } } - return nil + return commitHash, nil } diff --git a/backend/pkg/adj/models.go b/backend/pkg/adj/models.go index 53fe950fd..27c01030c 100644 --- a/backend/pkg/adj/models.go +++ b/backend/pkg/adj/models.go @@ -8,6 +8,7 @@ import ( type ADJ struct { Info Info Boards map[string]Board + Commit string } type InfoJSON struct { diff --git a/backend/pkg/adj/validator.go b/backend/pkg/adj/validator.go index 6bcec139a..3fdc42d7f 100644 --- a/backend/pkg/adj/validator.go +++ b/backend/pkg/adj/validator.go @@ -1,6 +1,7 @@ package adj import ( + "os" "os/exec" "path" "strings" @@ -62,6 +63,13 @@ func Validate() { // If none of the candidates are found, an empty string is returned, // indicating that no Python interpreter is available. func pythonCommand() string { + // Prefer bundled Python shipped with the Electron app + if bundled := os.Getenv("HYPERLOOP_PYTHON_PATH"); bundled != "" { + if _, err := os.Stat(bundled); err == nil { + return bundled + } + } + candidates := []string{"python3", "python", "py"} for _, c := range candidates { diff --git a/backend/pkg/logger/logger.go b/backend/pkg/logger/logger.go index 2f607ae07..ad411be13 100644 --- a/backend/pkg/logger/logger.go +++ b/backend/pkg/logger/logger.go @@ -2,6 +2,8 @@ package logger import ( + "encoding/json" + "os" "path" "sync" "sync/atomic" @@ -41,6 +43,12 @@ var Timestamp = time.Now() // StartAppTimestamp is the time in which the app was started var StartAppTimestamp = time.Now() +// CommitHash is the commit hash of the current version of ADJ +var CommitHash string + +// TimestampUnit is the unit of time used for the logger timestamps +var TimestampUnit TimeUnit + var BasePath = path.Join("logger", StartAppTimestamp.Format(TimestampFormat)) func (Logger) HandlerName() string { return HandlerName } @@ -93,6 +101,13 @@ func (logger *Logger) Start() error { logger.trace.Info().Msg("started") + // Write logger settings to a JSON file in the sublogger directory + err := WriteLoggerSettings(path.Join(BasePath, Timestamp.Format(TimestampFormat), "logger_settings.json")) + if err != nil { + logger.trace.Warn().Stack().Err(err).Msg("write logger settings") + return err + } + if logger.onStart != nil { logger.onStart() } @@ -127,22 +142,6 @@ func (logger *Logger) PullRecord(request abstraction.LoggerRequest) (abstraction panic("PullRecord") - // logger.trace. - // Trace(). - // Type("request", request). - // Msg("request") - - // loggerChecked, ok := logger.subloggers[request.Name()] - // if !ok { - // logger.trace. - // Warn(). - // Type("request", request). - // Str("name", string(request.Name())). - // Msg("no subloggger found for request") - - // return nil, ErrLoggerNotFound{request.Name()} - // } - // return loggerChecked.PullRecord(request) } func (logger *Logger) Stop() error { @@ -173,11 +172,56 @@ func (logger *Logger) Stop() error { } // ConfigureLogger configures the logger attributes before initializing it. -func ConfigureLogger(unit TimeUnit, basePath string) { +func ConfigureLogger(unit TimeUnit, basePath string, commitHash string) error { // Start the sublogger SetFormatTimestamp(unit) + // Set unit for logger timestamps + TimestampUnit = unit + + // Set commit hash + CommitHash = commitHash + // Update base Path BasePath = path.Join(basePath, "logger", StartAppTimestamp.Format(TimestampFormat)) + + err := WriteLoggerSettings(path.Join(BasePath, "others", "logger_settings.json")) + if err != nil { + return err + } + + return nil + +} + +/****************** +* Logger Settings * +*******************/ + +// JSON with adj commit and unit of time for logger settings +type LoggerSettings struct { + AdjCommitHash string `json:"adj_commit_hash"` + TimeUnit TimeUnit `json:"time_unit"` + Time string `json:"date"` +} + +// WriteLoggerSettings writes the logger settings to a JSON file in the logger directory +func WriteLoggerSettings(filePath string) error { + settings := LoggerSettings{ + AdjCommitHash: CommitHash, + TimeUnit: TimestampUnit, + Time: Timestamp.Format(TimestampFormat), + } + + settingsBytes, err := json.Marshal(settings) + if err != nil { + return err + } + + if err := os.MkdirAll(path.Dir(filePath), os.ModePerm); err != nil { + return err + } + + return os.WriteFile(filePath, settingsBytes, 0644) } diff --git a/backend/pkg/logger/order/logger.go b/backend/pkg/logger/order/logger.go index 06fd9a494..8330ed704 100644 --- a/backend/pkg/logger/order/logger.go +++ b/backend/pkg/logger/order/logger.go @@ -6,12 +6,11 @@ import ( "path" "time" - loggerbase "github.com/HyperloopUPV-H8/h9-backend/pkg/logger/base" - trace "github.com/rs/zerolog/log" - "github.com/HyperloopUPV-H8/h9-backend/pkg/abstraction" "github.com/HyperloopUPV-H8/h9-backend/pkg/logger" + loggerbase "github.com/HyperloopUPV-H8/h9-backend/pkg/logger/base" "github.com/HyperloopUPV-H8/h9-backend/pkg/logger/file" + trace "github.com/rs/zerolog/log" ) const ( @@ -86,12 +85,18 @@ func (sublogger *Logger) PushRecord(record abstraction.LoggerRecord) error { } } - err := sublogger.writer.Write([]string{ + // Convert the values of the packet to JSON + jsonValues, err := orderRecord.Packet.GetValuesAsJSON() + if err != nil { + return err + } + + err = sublogger.writer.Write([]string{ fmt.Sprint(logger.FormatTimestamp(orderRecord.Packet.Timestamp()) - sublogger.StartTime), orderRecord.From, orderRecord.To, fmt.Sprint(orderRecord.Packet.Id()), - fmt.Sprint(orderRecord.Packet.GetValues()), + string(jsonValues), orderRecord.Timestamp.Format(time.RFC3339), }) sublogger.writer.Flush() diff --git a/backend/pkg/logger/protection/logger.go b/backend/pkg/logger/protection/logger.go index 17b81d762..a92148515 100644 --- a/backend/pkg/logger/protection/logger.go +++ b/backend/pkg/logger/protection/logger.go @@ -19,17 +19,10 @@ const ( ) type Logger struct { - - // embed the base logger *loggerbase.BaseLogger - // An atomic boolean is used in order to use CompareAndSwap in the Start and Stop methods - fileLock *sync.Mutex - // saveFiles is a map that contains the file of each info packet + fileLock *sync.Mutex saveFiles map[abstraction.BoardId]*file.CSV - // BoardNames is a map that contains the common name of each board - boardNames map[abstraction.BoardId]string - // save the starting time of the logger in Unix microseconds in order to log relative timestamps } // Record is a struct that implements the abstraction.LoggerRecord interface @@ -43,14 +36,12 @@ type Record struct { func (*Record) Name() abstraction.LoggerName { return Name } -func NewLogger(boardMap map[abstraction.BoardId]string) *Logger { +func NewLogger() *Logger { - fmt.Print("ssfs") return &Logger{ BaseLogger: loggerbase.NewBaseLogger(Name), fileLock: &sync.Mutex{}, saveFiles: make(map[abstraction.BoardId]*file.CSV), - boardNames: boardMap, } } @@ -63,6 +54,7 @@ func (sublogger *Logger) PushRecord(record abstraction.LoggerRecord) error { } infoRecord, ok := record.(*Record) + if !ok { return logger.ErrWrongRecordType{ Name: Name, @@ -72,7 +64,7 @@ func (sublogger *Logger) PushRecord(record abstraction.LoggerRecord) error { } } - saveFile, err := sublogger.getFile(infoRecord.BoardId) + saveFile, err := sublogger.getFile(infoRecord.BoardId, infoRecord.From) if err != nil { return err } @@ -92,7 +84,7 @@ func (sublogger *Logger) PushRecord(record abstraction.LoggerRecord) error { return err } -func (sublogger *Logger) getFile(boardId abstraction.BoardId) (*file.CSV, error) { +func (sublogger *Logger) getFile(boardId abstraction.BoardId, boardName string) (*file.CSV, error) { sublogger.fileLock.Lock() defer sublogger.fileLock.Unlock() @@ -101,7 +93,7 @@ func (sublogger *Logger) getFile(boardId abstraction.BoardId) (*file.CSV, error) return valueFile, nil } - valueFileRaw, err := sublogger.createFile(boardId) + valueFileRaw, err := sublogger.createFile(boardId, boardName) sublogger.saveFiles[boardId] = file.NewCSV(valueFileRaw) return sublogger.saveFiles[boardId], err @@ -109,14 +101,9 @@ func (sublogger *Logger) getFile(boardId abstraction.BoardId) (*file.CSV, error) // override createFile from BaseLogger to add specific path // and filename structure -func (sublogger *Logger) createFile(boardId abstraction.BoardId) (*os.File, error) { - boardName, ok := sublogger.boardNames[boardId] - if !ok { - boardName = fmt.Sprint(boardId) - } +func (sublogger *Logger) createFile(boardId abstraction.BoardId, boardName string) (*os.File, error) { filename := path.Join( - "logger", logger.Timestamp.Format(logger.TimestampFormat), "protections", fmt.Sprintf("%s.csv", boardName), diff --git a/backend/pkg/transport/network/tcp/client.go b/backend/pkg/transport/network/tcp/client.go index 038d68fa9..2160da1c8 100644 --- a/backend/pkg/transport/network/tcp/client.go +++ b/backend/pkg/transport/network/tcp/client.go @@ -62,12 +62,6 @@ func (client *Client) Dial() (net.Conn, error) { client.logger.Error().Stack().Err(client.config.Context.Err()).Msg("canceled") return nil, client.config.Context.Err() } - - // If reconnection is disabled, bail out immediately on any error - if !client.config.TryReconnect { - client.logger.Error().Stack().Err(err).Msg("failed with non-retryable error") - return nil, err - } } client.logger.Debug().Int("max", client.config.MaxConnectionRetries).Msg("max connection retries exceeded") diff --git a/backend/pkg/transport/network/tcp/config.go b/backend/pkg/transport/network/tcp/config.go index 4403bd788..976b42c39 100644 --- a/backend/pkg/transport/network/tcp/config.go +++ b/backend/pkg/transport/network/tcp/config.go @@ -13,7 +13,6 @@ type ClientConfig struct { Context context.Context - TryReconnect bool ConnectionBackoffFunction backoffFunction MaxConnectionRetries int } @@ -34,7 +33,6 @@ func NewClientConfig(laddr net.Addr) ClientConfig { }, Context: context.TODO(), - TryReconnect: true, ConnectionBackoffFunction: NewExponentialBackoff(defaultBackoffMin, defaultBackoffExp, defaultBackoffMax), MaxConnectionRetries: -1, } diff --git a/backend/pkg/transport/packet/data/packet.go b/backend/pkg/transport/packet/data/packet.go index 75178e0a6..2be29288c 100644 --- a/backend/pkg/transport/packet/data/packet.go +++ b/backend/pkg/transport/packet/data/packet.go @@ -1,6 +1,7 @@ package data import ( + "encoding/json" "sync" "time" @@ -37,7 +38,6 @@ var packetPool = sync.Pool{ }, } - // NewPacketWithValues creates a new data packet with the given values func NewPacketWithValues(id abstraction.PacketId, values map[ValueName]Value, enabled map[ValueName]bool) *Packet { return &Packet{ @@ -69,6 +69,34 @@ func (packet *Packet) GetValues() map[ValueName]Value { return packet.values } +// numericValuer is implemented by NumericValue[N] for any numeric N. +type numericValuer interface { + Value() float64 +} + +// GetValuesAsJSON returns the values of the packet as a JSON object +func (packet *Packet) GetValuesAsJSON() ([]byte, error) { + out := make(map[string]any, len(packet.values)) + + for k, v := range packet.values { + switch x := v.(type) { + case BooleanValue: + out[string(k)] = x.Value() + case EnumValue: + out[string(k)] = string(x.Variant()) + default: + if nv, ok := v.(numericValuer); ok { + out[string(k)] = nv.Value() + } else { + out[string(k)] = nil + } + } + } + + return json.Marshal(out) +} + +// SetTimestamp sets the timestamp of the packet to the given time func (packet *Packet) SetTimestamp(timestamp time.Time) *Packet { packet.timestamp = timestamp return packet diff --git a/backend/pkg/transport/transport.go b/backend/pkg/transport/transport.go index 309a2b32c..8c6d947ba 100644 --- a/backend/pkg/transport/transport.go +++ b/backend/pkg/transport/transport.go @@ -55,20 +55,11 @@ func (transport *Transport) HandleClient(config tcp.ClientConfig, remote string) client := tcp.NewClient(remote, config, transport.logger) clientLogger := transport.logger.With().Str("remoteAddress", remote).Logger() defer clientLogger.Warn().Msg("abort connection") - hasConnected := false for { conn, err := client.Dial() if err != nil { clientLogger.Debug().Stack().Err(err).Msg("dial failed") - // Only return if reconnection is disabled - if !config.TryReconnect { - if hasConnected { - transport.SendFault() - } - transport.errChan <- err - return err - } // For ErrTooManyRetries, we still want to continue retrying // The client will reset its retry counter on the next Dial() call @@ -81,8 +72,6 @@ func (transport *Transport) HandleClient(config tcp.ClientConfig, remote string) continue } - hasConnected = true - err = transport.handleTCPConn(conn) if errors.Is(err, error(ErrTargetAlreadyConnected{})) { clientLogger.Warn().Stack().Err(err).Msg("multiple connections for same target") @@ -91,11 +80,6 @@ func (transport *Transport) HandleClient(config tcp.ClientConfig, remote string) } if err != nil { clientLogger.Debug().Stack().Err(err).Msg("connection lost") - if !config.TryReconnect { - transport.SendFault() - transport.errChan <- err - return err - } // Connection was lost, continue trying to reconnect continue diff --git a/backend/pkg/vehicle/notification.go b/backend/pkg/vehicle/notification.go index 4bf0d9d05..52e4a9948 100644 --- a/backend/pkg/vehicle/notification.go +++ b/backend/pkg/vehicle/notification.go @@ -82,16 +82,17 @@ func (vehicle *Vehicle) handlePacketNotification(notification transport.PacketNo } case *protection.Packet: - boardId := vehicle.ipToBoardId[strings.Split(notification.From, ":")[0]] + boardID := vehicle.ipToBoardId[strings.Split(notification.From, ":")[0]] err := vehicle.broker.Push(message_topic.Push(p, vehicle.idToBoardName[p.Id()])) if err != nil { vehicle.trace.Error().Stack().Err(err).Msg("broker push") return errors.Join(fmt.Errorf("update protection to frontend (%s protection with id %d and kind %d from %s to %s)", p.Severity(), p.Id(), p.Kind, notification.From, notification.To), err) } + // Log protection err = vehicle.logger.PushRecord(&protection_logger.Record{ Packet: p, - BoardId: boardId, + BoardId: boardID, From: notification.From, To: notification.To, Timestamp: notification.Timestamp, diff --git a/backend/protection_message.json b/backend/protection_message.json deleted file mode 100644 index f65822bdf..000000000 --- a/backend/protection_message.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "boardId": 12, - "timestamp": { - "counter": 38923221, - "second": 32, - "minute": 12, - "hour": 8, - "day": 25, - "month": 7, - "year": 2023 - }, - "name": "VCELL1", - "protection": { - "type": 4412323, - "data": { - "value": 3.3, - "boundary_1": 2.5, - "boundary_2": 3.2 - } - } -} diff --git a/blcu-programming/.gitattributes b/blcu-programming/.gitattributes new file mode 100644 index 000000000..eba1110b5 --- /dev/null +++ b/blcu-programming/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto \ No newline at end of file diff --git a/blcu-programming/.gitignore b/blcu-programming/.gitignore new file mode 100644 index 000000000..ceee592ad --- /dev/null +++ b/blcu-programming/.gitignore @@ -0,0 +1,13 @@ +/.venv +/.venv-build +build/ +dist/ +/.vscode +*.pyc +*__pycache__/ +*.pyo +*.pyd +.idea/ +containers/*/.venv +.env +*.log diff --git a/blcu-programming/BLCU-config.json b/blcu-programming/BLCU-config.json new file mode 100644 index 000000000..3b0ad0e9e --- /dev/null +++ b/blcu-programming/BLCU-config.json @@ -0,0 +1,44 @@ +{ + "blcu": { + "host": "192.168.0.27", + "port": 69, + "UDP_PORT_DESTINATION": 50420, + "TCP_PORT_SERVER": 50500 + + }, + "adj-data": { + "LVBMS": "192.168.1.11", + "HVBMS": "192.168.1.17", + "PCU": "192.168.1.5", + "LCU": "192.168.1.4", + "VCU": "192.168.1.3" + }, + "orders":{ + "Write Program": {"id":"700", "description":"Write Program to BLCU", "enum-order": [ + "VCU", + "HVBMS", + "LVBMS", + "PCU", + "LCU" + ]} + }, + "packet":{ + + "id": 1, + "general_state_machine": [ + "Connecting", + "Operational", + "Fault" + ] , + "operational_state_machine":[ + "Idle", + "Flashing" + ] + }, + "api": { + "host": "0.0.0.0", + "port": 8069, + "log_level": "info" + }, + "log_file": "tftp_server_activity.log" +} diff --git a/blcu-programming/BLCU-test-config.json b/blcu-programming/BLCU-test-config.json new file mode 100644 index 000000000..eb2ede4f6 --- /dev/null +++ b/blcu-programming/BLCU-test-config.json @@ -0,0 +1,44 @@ +{ + "blcu": { + "host": "127.0.0.27", + "port": 69, + "UDP_PORT_DESTINATION": 50400, + "TCP_PORT_SERVER": 50500 + + }, + "adj-data": { + "LVBMS": "192.168.1.11", + "HVBMS": "192.168.1.17", + "PCU": "192.168.1.5", + "LCU": "192.168.1.4", + "VCU": "192.168.1.3" + }, + "orders":{ + "Write Program": {"id":"700", "description":"Write Program to BLCU", "enum-order": [ + "VCU", + "HVBMS", + "LVBMS", + "PCU", + "LCU" + ]} + }, + "packet":{ + + "id": 134, + "general_state_machine": [ + "Connecting", + "Operational", + "Fault" + ] , + "operational_state_machine":[ + "Idle", + "Flashing" + ] + }, + "api": { + "host": "0.0.0.0", + "port": 8069, + "log_level": "info" + }, + "log_file": "tftp_server_activity.log" +} diff --git a/blcu-programming/README.md b/blcu-programming/README.md new file mode 100644 index 000000000..6e2853dea --- /dev/null +++ b/blcu-programming/README.md @@ -0,0 +1,87 @@ +# BLCU - Programming + +FastAPI service that bridges the *Flashing view* in the Control Station and the BLCU hardware board, transferring firmware files over TFTP. + +## How it works + +``` +Control Station (Electron) + | + | HTTP (port 8069) + v + api/main.py (FastAPI) + | + | TFTP (UDP port 69) + v + BLCU board @ 192.168.0.27 +``` + +## API endpoints + +| Method | Path | Description | +| :----- | :------------------ | :------------------------------------------------- | +| GET | `/api/health` | Health check | +| GET | `/api/status` | Board reachability and state machine status | +| POST | `/api/flash` | Flash a firmware file to a specific board | + +## Directory structure + +``` +blcu-programming/ +├── api/ +│ ├── main.py # Entry point, starts uvicorn +│ ├── http_server.py # FastAPI app and route handlers +│ ├── config.py # Loads BLCU-config.json +│ ├── board_pinger.py # Periodically pings boards via UDP +│ ├── tcp_client.py # Sends flash order to BLCU via TCP +│ └── udp_server.py # Receives BLCU status updates +├── scripts/ +│ ├── setup.mjs # Cross-platform venv creation and pip install +│ └── run.mjs # Cross-platform dev runner +├── BLCU-config.json # Board addresses and API settings +├── requirements.txt # Runtime Python dependencies +└── requirements-build.txt # Build-time deps (includes PyInstaller) +``` + +## Development + +Dependencies are managed via a Python virtual environment. `pnpm install` creates and populates it automatically on all platforms (Windows, macOS, Linux). + +```bash +# From the repo root — installs all workspaces including this one +pnpm install + +# Start only this service +pnpm --filter blcu-programming dev +``` + +The service starts on `http://127.0.0.1:8069` by default. Override with environment variables: + +```bash +BLCU_API_HOST=0.0.0.0 BLCU_API_PORT=9000 pnpm --filter blcu-programming dev +``` + +## Building the Electron binary + +The BLCU service is packaged as a standalone binary with PyInstaller so it can be bundled inside the Electron app without requiring Python on the end-user machine. + +```bash +# Build for the current platform (from repo root) +pnpm --filter blcu-programming build + +# Or directly via the build script +node electron-app/build.mjs --blcu-programming +``` + +PyInstaller cannot cross-compile. Run the build on the same OS you are targeting (Windows → `blcu-programming-windows-amd64.exe`, Linux → `blcu-programming-linux-amd64`, etc.). The CI workflow (`release.yaml`) builds all four platform targets in parallel. + +The resulting binary is placed in `electron-app/binaries/` and bundled as an `extraResource` by electron-builder. + +## Configuration + +`BLCU-config.json` is embedded inside the binary at build time. At runtime, environment variables take precedence over the bundled file: + +| Variable | Default | Description | +| :--------------- | :---------- | :-------------------- | +| `BLCU_API_HOST` | `127.0.0.1` | Host to bind to | +| `BLCU_API_PORT` | `8069` | Port to listen on | diff --git a/blcu-programming/TFTP_GUI_Server.py b/blcu-programming/TFTP_GUI_Server.py new file mode 100644 index 000000000..1fc4d3d9d --- /dev/null +++ b/blcu-programming/TFTP_GUI_Server.py @@ -0,0 +1,232 @@ +import sys +import os +import threading +import socket +import logging +from PyQt5 import QtWidgets, QtGui, QtCore +from tftp.TFTPServer import TftpPacketDAT, TftpPacketERR, TftpServer +from tftp.TftpClient import TftpClient +# Logging Configuration +logger = logging.getLogger('tftp_server') +logger.setLevel(logging.INFO) +file_handler = logging.FileHandler('tftp_server_activity.log') +formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s') +file_handler.setFormatter(formatter) +logger.addHandler(file_handler) + +import socket + +import psutil + +def get_ip_addresses(): + """Get the list of available IP addresses on the local machine across all interfaces.""" + ip_addresses = [] + + for interface, addresses in psutil.net_if_addrs().items(): + for address in addresses: + if address.family == socket.AF_INET: # IPv4 addresses only + ip_addresses.append(address.address) + + # Remove duplicates and return the list of IP addresses + return list(set(ip_addresses)) + +class TFTPClient(QtWidgets.QWidget): + log_signal = QtCore.pyqtSignal(str) # Signal to update log + + def __init__(self): + super().__init__() + self.setWindowTitle("TFTP Client") + self.setGeometry(500, 100, 500, 400) + + self.hardcoded_ip = "192.168.0.27" + + self.ip_input = QtWidgets.QLineEdit(self) + self.ip_input.setPlaceholderText("Enter Server IP Address") + self.ip_input.setText(self.hardcoded_ip) # Set hardcoded IP + self.ip_input.setReadOnly(True) + + # Separate inputs for upload and download + self.upload_file_input = QtWidgets.QLineEdit(self) + self.upload_file_input.setPlaceholderText("Select File to Upload") + + self.download_file_input = QtWidgets.QLineEdit(self) + self.download_file_input.setPlaceholderText("Enter File Name to Download") + + self.browse_button = QtWidgets.QPushButton("Browse Upload...", self) + self.browse_button.clicked.connect(self.browse_upload_file) + + self.download_button = QtWidgets.QPushButton("Download File", self) + self.download_button.clicked.connect(self.download_file) + + self.upload_button = QtWidgets.QPushButton("Upload File", self) + self.upload_button.clicked.connect(self.upload_file) + + self.use_folder_checkbox = QtWidgets.QCheckBox("Use selected folder for download", self) + self.use_folder_checkbox.setChecked(False) # Default unchecked + + self.default_directory_label = QtWidgets.QLabel(self) + self.default_directory_label.setText(f"Default Download Directory: {self.get_default_directory()}") + + self.status_label = QtWidgets.QLabel("Status: Waiting", self) + self.status_label.setStyleSheet("font-weight: bold;") + + self.log_output = QtWidgets.QTextEdit(self) + self.log_output.setReadOnly(True) + + layout = QtWidgets.QVBoxLayout() + layout.addWidget(QtWidgets.QLabel("Enter Server IP Address:")) + layout.addWidget(self.ip_input) + + # Upload file section + layout.addWidget(QtWidgets.QLabel("File to Upload:")) + layout.addWidget(self.upload_file_input) + layout.addWidget(self.browse_button) + + # Download file section + layout.addWidget(QtWidgets.QLabel("File to Download:")) + layout.addWidget(self.download_file_input) + layout.addWidget(self.use_folder_checkbox) # Add the checkbox here + + # Add the default directory label + layout.addWidget(self.default_directory_label) + + button_layout = QtWidgets.QHBoxLayout() + button_layout.addWidget(self.download_button) + button_layout.addWidget(self.upload_button) + button_layout.addWidget(self.status_label) + layout.addLayout(button_layout) + + layout.addWidget(QtWidgets.QLabel("Client Log:")) + layout.addWidget(self.log_output) + + self.setLayout(layout) + self.setStyleSheet("background-color: #f0f0f0; font-family: Arial;") + + self.total_size = 0 + self.downloaded_size = 0 + + # Connect the log signal to the update_log method + self.log_signal.connect(self.update_log) + + def get_default_directory(self): + """Return the default download directory.""" + return os.path.expanduser("~") # User's home directory + + def browse_upload_file(self): + options = QtWidgets.QFileDialog.Options() + file_name, _ = QtWidgets.QFileDialog.getOpenFileName(self, "Select File to Upload", "", "All Files (*);;Text Files (*.txt)", options=options) + if file_name: + self.upload_file_input.setText(file_name) # Save the full path for the selected file + + def download_file(self): + ip = self.ip_input.text() # Get the manually entered IP address + filename = self.download_file_input.text() + + if self.use_folder_checkbox.isChecked(): + # Open a dialog to select the folder for saving the downloaded file + folder = QtWidgets.QFileDialog.getExistingDirectory(self, "Select Folder to Save Downloaded File") + + if folder: # Proceed only if a folder was selected + self.status_label.setText("Status: Downloading...") + self.log_output.clear() # Clear previous logs + + # Construct the full path for the downloaded file + full_path = os.path.join(folder, filename) + + # Start a new thread for downloading to avoid blocking the UI + threading.Thread(target=self.perform_download, args=(ip, full_path), daemon=True).start() + else: + self.log_signal.emit("Download canceled: No folder selected.") + else: + # Default save path (you can modify this to your preferred default directory) + default_directory = self.get_default_directory() + full_path = os.path.join(default_directory, filename) + + self.status_label.setText("Status: Downloading...") + self.log_output.clear() # Clear previous logs + + # Start a new thread for downloading to avoid blocking the UI + threading.Thread(target=self.perform_download, args=(ip, full_path), daemon=True).start() + + def perform_download(self, ip, full_path): + try: + client = TftpClient(ip, 69) + + # Get total file size + self.total_size = client.get_file_size(os.path.basename(full_path)) + if self.total_size <= 0: + self.status_label.setText("Error: Invalid file size.") + self.log_signal.emit("Error: Invalid file size.") + return + + # Function to update progress + def update_progress(packet): + if isinstance(packet, TftpPacketERR): + self.log_signal.emit(f"Error: {packet.errmsg.decode()}") + return + + # Check for DAT packets (data packets) + if isinstance(packet, TftpPacketDAT): + self.downloaded_size += len(packet.data) + self.log_signal.emit(f"Downloaded: {self.downloaded_size} bytes") + + # Start downloading with the update_progress callback + client.download(os.path.basename(full_path), output=full_path, packethook=update_progress) + + self.status_label.setText("Status: Download Complete") + self.log_signal.emit("Download complete.") + except Exception as e: + self.status_label.setText(f"Error: {str(e)}") + self.log_signal.emit(f"Error: {str(e)}") + + def upload_file(self): + ip = self.ip_input.text() # Get the manually entered IP address + filename = self.upload_file_input.text() + self.status_label.setText("Status: Uploading...") + self.log_output.clear() # Clear previous logs + + # Start a new thread for uploading to avoid blocking the UI + threading.Thread(target=self.perform_upload, args=(ip, filename), daemon=True).start() + + def perform_upload(self, ip, filename): + try: + client = TftpClient(ip, 69) + + # Get total file size + self.total_size = os.path.getsize(filename) + self.downloaded_size = 0 # Reset downloaded size + + # Function to update progress + def update_progress(packet): + if isinstance(packet, TftpPacketERR): + self.log_signal.emit(f"Error: {packet.errmsg.decode()}") + return + + # Check for DAT packets (data packets) + if isinstance(packet, TftpPacketDAT): + self.downloaded_size += len(packet.data) + self.log_signal.emit(f"Uploaded: {self.downloaded_size} bytes") + + # Start uploading with the update_progress callback + with open(filename, 'rb') as f: + client.upload(os.path.basename(filename), input=f, packethook=update_progress) + + self.status_label.setText("Status: Upload Complete") + self.log_signal.emit("Upload complete.") + except Exception as e: + self.status_label.setText(f"Error: {str(e)}") + self.log_signal.emit(f"Error: {str(e)}") + + def update_log(self, message): + self.log_output.append(message) + self.log_output.moveCursor(QtGui.QTextCursor.End) # Scroll to the bottom + + +if __name__ == "__main__": + app = QtWidgets.QApplication(sys.argv) + client = TFTPClient() + client.setWindowTitle("TFTP Client by petrunetworking") + client.setGeometry(100, 100, 500, 400) + client.setStyleSheet("background-color: #eaeaea; font-family: Arial;") + client.show() + sys.exit(app.exec_()) diff --git a/blcu-programming/api/board_pinger.py b/blcu-programming/api/board_pinger.py new file mode 100644 index 000000000..6573ac4df --- /dev/null +++ b/blcu-programming/api/board_pinger.py @@ -0,0 +1,50 @@ +import subprocess +import threading + +from api.config import load + +_cfg = load() +_BOARDS: dict[str, str] = _cfg["adj-data"] + +_status: dict[str, bool] = {name: False for name in _BOARDS} +_lock = threading.Lock() + +PING_INTERVAL = 60 + + +def get_board_status() -> dict[str, bool]: + with _lock: + return dict(_status) + + +def _ping(ip: str) -> bool: + try: + result = subprocess.run( + ["ping", "-c", "1", "-W", "1", ip], + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL, + timeout=3, + ) + return result.returncode == 0 + except Exception: + return False + + +def _ping_all() -> None: + results = {name: _ping(ip) for name, ip in _BOARDS.items()} + with _lock: + _status.update(results) + + + +def _run(stop: threading.Event) -> None: + while not stop.is_set(): + _ping_all() + stop.wait(PING_INTERVAL) + + +def start() -> threading.Event: + stop = threading.Event() + t = threading.Thread(target=_run, args=(stop,), daemon=True, name="board-pinger") + t.start() + return stop diff --git a/blcu-programming/api/config.py b/blcu-programming/api/config.py new file mode 100644 index 000000000..0a0aeb2ad --- /dev/null +++ b/blcu-programming/api/config.py @@ -0,0 +1,10 @@ +import json +from pathlib import Path + +_ROOT = Path(__file__).parent.parent +_CONFIG_PATH = _ROOT / "BLCU-config.json" + + +def load() -> dict: + with _CONFIG_PATH.open(encoding="utf-8") as f: + return json.load(f) diff --git a/blcu-programming/api/http_server.py b/blcu-programming/api/http_server.py new file mode 100644 index 000000000..7cd86fe68 --- /dev/null +++ b/blcu-programming/api/http_server.py @@ -0,0 +1,175 @@ +import asyncio +import io +import logging +import threading +import time +from datetime import datetime, timezone +from pathlib import Path + +from fastapi import APIRouter, FastAPI, File, Form, HTTPException, Query, UploadFile +from fastapi.middleware.cors import CORSMiddleware +from pydantic import BaseModel + +from api.board_pinger import get_board_status +from api.config import load +from api.tcp_client import send_order +from api.udp_server import get_state +from tftp.TftpClient import TftpClient + +# Load config and initialise a single shared TFTP client for the process lifetime. +# A threading lock guards it because TFTP is stateful and not thread-safe. +_cfg = load() +_blcu_host: str = _cfg["blcu"]["host"] +_blcu_port: int = _cfg["blcu"]["port"] + +_client = TftpClient(_blcu_host, _blcu_port) +_lock = threading.Lock() + +app = FastAPI(title="TFTP API", version="0.1.0") +app.add_middleware( + CORSMiddleware, + allow_origins=["*"], + allow_methods=["*"], + allow_headers=["*"], +) +router = APIRouter(prefix="/api") + +LOG_FILE = Path(_cfg["log_file"]) + +logger = logging.getLogger(__name__) + + +class DownloadRequest(BaseModel): + remote_filename: str + local_path: str + + +def _utc_now() -> str: + return datetime.now(timezone.utc).isoformat() + + +@router.get("/status") +def status() -> dict: + """Return board connectivity and state-machine snapshot.""" + state = get_state() + return { + "boards": get_board_status(), + "general_state_machine": state.general, + "operational_state_machine": state.operational, + } + + +@router.get("/boards") +def boards() -> list: + """Return the list of known board names.""" + return list(get_board_status().keys()) + + +@router.get("/health") +def health() -> dict: + """Liveness probe used by the control station to confirm the API is up.""" + return { + "status": "ok", + "service": "tftp-api", + "timestamp": _utc_now(), + } + + +@router.post("/flash") +async def upload_file(file: UploadFile = File(...), board: str = Form(...)) -> dict: + """Upload a firmware file to the BLCU via TFTP, then trigger a flash. + + The entire upload is serialised with a lock because the underlying TFTP + client is not safe for concurrent use. + """ + if not file.filename: + raise HTTPException(status_code=400, detail="Missing filename") + # read the file + data = await file.read() + size_bytes = len(data) + + # TFTP upload + logger.info( + "Flash upload started: file=%s size=%d bytes", file.filename, size_bytes + ) + + def _do_upload() -> None: + with _lock: + _client.upload(file.filename, io.BytesIO(data)) + + t0 = time.monotonic() + loop = asyncio.get_running_loop() + try: + await asyncio.wait_for(loop.run_in_executor(None, _do_upload), timeout=30.0) + except TimeoutError: + logger.error("Flash upload timed out after 30 s: file=%s", file.filename) + raise HTTPException( + status_code=504, detail="TFTP upload timed out after 30 seconds" + ) + except Exception as exc: + logger.error("Flash upload failed: file=%s error=%s", file.filename, exc) + raise HTTPException(status_code=500, detail=str(exc)) from exc + + elapsed_ms = (time.monotonic() - t0) * 1000 + logger.info( + "Flash upload complete: file=%s size=%d bytes elapsed=%.1f ms", + file.filename, + size_bytes, + elapsed_ms, + ) + + # Send order to flash + try: + send_order("Write Program", board) + except ValueError as exc: + raise HTTPException(status_code=400, detail=str(exc)) from exc + except Exception as exc: + logger.error("Failed to send flash order: %s", exc) + raise HTTPException(status_code=500, detail=f"Order failed: {exc}") from exc + + return { + "ok": True, + "message": "Upload complete", + "filename": file.filename, + "size_bytes": size_bytes, + } + + +@router.post("/download") +def download_file(request: DownloadRequest) -> dict: + """Download a file from the BLCU via TFTP and save it locally.""" + # Resolve to an absolute path so the response always contains a usable location. + local_path = Path(request.local_path).expanduser().resolve() + local_path.parent.mkdir(parents=True, exist_ok=True) + + with _lock: + try: + _client.download(request.remote_filename, output=str(local_path)) + except Exception as exc: + raise HTTPException(status_code=500, detail=str(exc)) from exc + + return { + "ok": True, + "message": "Download complete", + "remote_filename": request.remote_filename, + "local_path": str(local_path), + } + + +@router.get("/logs") +def get_logs(tail: int = Query(default=200, ge=1, le=5000)) -> dict: + """Return the last `tail` lines of the application log file.""" + if not LOG_FILE.exists(): + return {"path": str(LOG_FILE), "lines": [], "line_count": 0} + + lines = LOG_FILE.read_text(encoding="utf-8", errors="replace").splitlines() + selected_lines = lines[-tail:] + + return { + "path": str(LOG_FILE.resolve()), + "lines": selected_lines, + "line_count": len(selected_lines), + } + + +app.include_router(router) diff --git a/blcu-programming/api/main.py b/blcu-programming/api/main.py new file mode 100644 index 000000000..a7d7070c5 --- /dev/null +++ b/blcu-programming/api/main.py @@ -0,0 +1,37 @@ +# BLCU Programming backend that runs behind flashing view +# - Http server to communication with the frontend +# - TFTP client to upload and download files from the BLCU +# - UDP server to receive BLCU status (ADJ) +# - TCP to send the order to the BLCU (ADJ) +# Vasyl Kilimenko, Lola Castillo & Javier Ribal del Río 11 +import os +import uvicorn + +from api.config import load +from api.http_server import app +import api.board_pinger as board_pinger +import api.tcp_client as tcp_client +import api.udp_server as udp_server + + +def main() -> None: + cfg = load()["api"] + + host = os.environ.get("BLCU_API_HOST", cfg["host"]) + port = int(os.environ.get("BLCU_API_PORT", cfg["port"])) + + udp_server.start() + board_pinger.start() + tcp_client.start() + + uvicorn.run( + app, + host=host, + port=port, + log_level=cfg["log_level"], + access_log=False, + ) + + +if __name__ == "__main__": + main() diff --git a/blcu-programming/api/tcp_client.py b/blcu-programming/api/tcp_client.py new file mode 100644 index 000000000..6c7d27240 --- /dev/null +++ b/blcu-programming/api/tcp_client.py @@ -0,0 +1,92 @@ +import logging +import socket +import struct +import threading + +from api.config import load + +log = logging.getLogger(__name__) + +_cfg = load() +_host: str = _cfg["blcu"]["host"] +_port: int = _cfg["blcu"]["TCP_PORT_SERVER"] +_ORDERS: dict[str, dict] = _cfg["orders"] + +_RECONNECT_DELAY = 5.0 + +_sock: socket.socket | None = None +_sock_lock = threading.Lock() + + +def send(data: bytes) -> None: + """Send raw bytes to the BLCU. Raises RuntimeError if not connected.""" + with _sock_lock: + if _sock is None: + raise RuntimeError("TCP connection to BLCU is not established") + _sock.sendall(data) + + +def send_order(order_name: str, board_name: str) -> None: + """Build and send an order packet to the BLCU. + + Protocol (little-endian): + [uint16 order_id] [uint8 board_enum] + where board_enum is the index of board_name in the order's enum-order list. + """ + order = _ORDERS[order_name] + order_id = int(order["id"]) + enum = order["enum-order"] + if board_name not in enum: + raise ValueError(f"Board '{board_name}' cannot be flashed with '{order_name}'. Valid boards: {', '.join(enum)}") + board_idx = enum.index(board_name) + packet = struct.pack(" None: + global _sock + + while not stop.is_set(): + log.info("Connecting to BLCU TCP at %s:%d", host, port) + try: + conn = socket.create_connection((host, port)) + except OSError as exc: + log.warning("TCP connection failed: %s — retrying in %.0f s", exc, _RECONNECT_DELAY) + stop.wait(_RECONNECT_DELAY) + continue + + log.info("TCP connection to BLCU established") + with _sock_lock: + _sock = conn + + # Wait until the connection drops or stop is requested. + conn.settimeout(1.0) + while not stop.is_set(): + try: + # Detect a closed connection without reading payload. + if not conn.recv(1, socket.MSG_PEEK): + break + except socket.timeout: + continue + except OSError: + break + + with _sock_lock: + _sock = None + conn.close() + log.info("TCP connection closed") + + if not stop.is_set(): + log.info("Reconnecting in %.0f s", _RECONNECT_DELAY) + stop.wait(_RECONNECT_DELAY) + + log.info("TCP client stopped") + + +def start() -> threading.Event: + stop = threading.Event() + threading.Thread( + target=_run, args=(_host, _port, stop), daemon=True, name="tcp-client" + ).start() + return stop diff --git a/blcu-programming/api/udp_server.py b/blcu-programming/api/udp_server.py new file mode 100644 index 000000000..1dc4617a9 --- /dev/null +++ b/blcu-programming/api/udp_server.py @@ -0,0 +1,99 @@ +import logging +import socket +import struct +import threading +from dataclasses import dataclass + +from api.config import load + +log = logging.getLogger(__name__) + +_cfg = load() +_PACKET_CFG = _cfg["packet"] + +PACKET_ID: int = _PACKET_CFG["id"] +GENERAL_SM: list[str] = _PACKET_CFG["general_state_machine"] +OPERATIONAL_SM: list[str] = _PACKET_CFG["operational_state_machine"] + +# Minimum packet size: 2 bytes ID + 1 byte each enum +_MIN_SIZE = 2 + 1 + 1 + + +@dataclass +class BLCUState: + general: str = "Unknown" + operational: str = "Unknown" + received: bool = False + + +_state = BLCUState() +_lock = threading.Lock() + + +def get_state() -> BLCUState: + with _lock: + return BLCUState(_state.general, _state.operational, _state.received) + + +def _parse(data: bytes) -> None: + if len(data) < _MIN_SIZE: + log.warning("Packet too short (%d bytes), discarding", len(data)) + return + + packet_id = struct.unpack_from(" None: + sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + sock.bind((host, port)) + sock.settimeout(1.0) + log.info("UDP server listening on %s:%d", host, port) + + while not stop.is_set(): + try: + data, _ = sock.recvfrom(1500) + _parse(data) + except socket.timeout: + continue + except Exception: + log.exception("UDP receive error") + + sock.close() + log.info("UDP server stopped") + + +def start() -> threading.Event: + host: str = "0.0.0.0" + port: int = _cfg["blcu"]["UDP_PORT_DESTINATION"] + stop = threading.Event() + t = threading.Thread( + target=_serve, args=(host, port, stop), daemon=True, name="udp-server" + ) + t.start() + return stop diff --git a/blcu-programming/original_repo_docs/LICENSE b/blcu-programming/original_repo_docs/LICENSE new file mode 100644 index 000000000..e62ec04cd --- /dev/null +++ b/blcu-programming/original_repo_docs/LICENSE @@ -0,0 +1,674 @@ +GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/blcu-programming/original_repo_docs/README.md b/blcu-programming/original_repo_docs/README.md new file mode 100644 index 000000000..b6d6720f2 --- /dev/null +++ b/blcu-programming/original_repo_docs/README.md @@ -0,0 +1,80 @@ + +# Original Repo docs + + +# TFTP Server and Client + +**TFTP Server and Client** is a comprehensive Python-based application designed to facilitate Trivial File Transfer Protocol (TFTP) operations through a user-friendly graphical interface built with PyQt5. This tool allows users to efficiently manage file transfers to and from TFTP servers, making it an essential resource for network administrators. + +## Key Features + +### TFTP Server +- **Start/Stop Server:** Easily control the TFTP server with start and stop functionalities. +- **Select IP Address:** Choose the specific IP address for the server to listen on. +- **Change Working Directory:** Modify the current working directory for file transfers with a straightforward interface. +- **View Directory Contents:** Quickly access and view files in the current working directory. +- **Logging:** Track server activity with real-time logging displayed in the application and stored in a log file. +[tftp_server](../TFTP_GUI_Server_Client/screenshot/tftp_server.png) +### TFTP Client +- **Upload Files:** Seamlessly upload files to a TFTP server using a simple interface. +- **Download Files:** Effortlessly download files from a TFTP server with progress monitoring. +- **File Browsing:** Use an integrated file dialog for easy file selection. +- **Status Updates:** Receive real-time status updates during upload and download processes. +[tftp_client](../TFTP_GUI_Server_Client/screenshot/tftp_client.png) +### Monitoring and Alerts +- Monitor TFTP server activities and transfer statuses with immediate feedback on successes or failures. +- Real-time updates ensure that users can track the progress of their operations. + +### Error Handling and Prompt Detection +- Implement robust error handling specific to TFTP operations to ensure smooth functionality. +- Dynamic prompt detection allows the application to handle varying device responses effectively. + +## Example Configurations + +### Setting Up the TFTP Server +1. Launch the application and navigate to the TFTP Server tab. +2. Select an available IP address from the dropdown menu. +3. Specify the desired port number (default is 69). +4. Click **Start Server** to begin listening for incoming TFTP requests. + +### Uploading Files +1. Navigate to the TFTP Client tab. +2. Enter the TFTP server IP address. +3. Use the **Browse Upload...** button to select the file you wish to upload. +4. Click **Upload File** and monitor the status for updates. + +### Downloading Files +1. Enter the TFTP server IP address and specify the file name for download. +2. Click **Download File** to initiate the download process. +3. Progress and status will be displayed in real time. + +## System Requirements + +To run the TFTP Server and Client application, the following system requirements must be met: + +- **Python 3.x** +- **PyQt5** +- **TFTP Library** +- **OS:** Windows 10 or Ubuntu >=20.04 (recommended) or any modern Linux distribution + +## Technologies Used + +- **Python:** The core language utilized for backend logic. +- **PyQt5:** The framework used for developing the graphical user interface. +- **TFTP Library:** Employed for implementing TFTP protocol functionalities. + +## License + +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. + +## Contributing + +Contributions are welcome! Please fork the repository and create a pull request with your enhancements. Alternatively, you can open an issue to suggest improvements or report bugs. + +## Author + +**petrunetworking** (Network Engineer) + +## Acknowledgements + +Developed using Python and inspired by the need for efficient file transfer solutions, this application aims to simplify TFTP operations for network professionals, enabling them to manage their file transfers effectively and reliably. diff --git a/blcu-programming/original_repo_docs/screenshot/tftp_client.png b/blcu-programming/original_repo_docs/screenshot/tftp_client.png new file mode 100644 index 000000000..2bd14f402 Binary files /dev/null and b/blcu-programming/original_repo_docs/screenshot/tftp_client.png differ diff --git a/blcu-programming/original_repo_docs/screenshot/tftp_server.png b/blcu-programming/original_repo_docs/screenshot/tftp_server.png new file mode 100644 index 000000000..27eb3b074 Binary files /dev/null and b/blcu-programming/original_repo_docs/screenshot/tftp_server.png differ diff --git a/blcu-programming/package-lock.json b/blcu-programming/package-lock.json new file mode 100644 index 000000000..76c28af1e --- /dev/null +++ b/blcu-programming/package-lock.json @@ -0,0 +1,13 @@ +{ + "name": "blcu-programming", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "blcu-programming", + "version": "1.0.0", + "hasInstallScript": true + } + } +} diff --git a/blcu-programming/package.json b/blcu-programming/package.json new file mode 100644 index 000000000..1f7531283 --- /dev/null +++ b/blcu-programming/package.json @@ -0,0 +1,11 @@ +{ + "name": "blcu-programming", + "version": "1.0.0", + "private": true, + "scripts": { + "postinstall": "node scripts/setup.mjs", + "dev": "node scripts/run.mjs", + "start": "node scripts/run.mjs", + "build": "node ../electron-app/build.mjs --blcu-programming" + } +} diff --git a/blcu-programming/requirements-build.txt b/blcu-programming/requirements-build.txt new file mode 100644 index 000000000..946666958 --- /dev/null +++ b/blcu-programming/requirements-build.txt @@ -0,0 +1,2 @@ +-r requirements.txt +pyinstaller==6.17.0 diff --git a/blcu-programming/requirements.txt b/blcu-programming/requirements.txt new file mode 100644 index 000000000..97c06f076 --- /dev/null +++ b/blcu-programming/requirements.txt @@ -0,0 +1,3 @@ +fastapi==0.124.2 +uvicorn==0.38.0 +python-multipart==0.0.32 diff --git a/blcu-programming/scripts/run.mjs b/blcu-programming/scripts/run.mjs new file mode 100644 index 000000000..f8256bd0b --- /dev/null +++ b/blcu-programming/scripts/run.mjs @@ -0,0 +1,7 @@ +import { execSync } from "child_process"; +import { join } from "path"; + +const binDir = process.platform === "win32" ? "Scripts" : "bin"; +const python = join(".venv", binDir, "python"); + +execSync(`${python} -m api.main`, { stdio: "inherit" }); diff --git a/blcu-programming/scripts/setup.mjs b/blcu-programming/scripts/setup.mjs new file mode 100644 index 000000000..536b5aa10 --- /dev/null +++ b/blcu-programming/scripts/setup.mjs @@ -0,0 +1,9 @@ +import { execSync } from "child_process"; +import { join } from "path"; + +const binDir = process.platform === "win32" ? "Scripts" : "bin"; +const pip = join(".venv", binDir, "pip"); +const python = join(".venv", binDir, "python"); + +execSync(`python -m venv .venv`, { stdio: "inherit" }); +execSync(`${pip} install -r requirements.txt`, { stdio: "inherit" }); diff --git a/blcu-programming/tftp/TFTPServer.py b/blcu-programming/tftp/TFTPServer.py new file mode 100644 index 000000000..ee28ddce4 --- /dev/null +++ b/blcu-programming/tftp/TFTPServer.py @@ -0,0 +1,164 @@ +import os +import select +import socket +import threading +import logging +from errno import EINTR +from .TftpShared import * +from .TftpPacketTypes import * +from .TftpPacketFactory import TftpPacketFactory +from .TftpContexts import TftpContextServer + +log = logging.getLogger('tftpy.TftpServer') +# Define the logger for TFTP server +logger = logging.getLogger('tftp_server') +logger.setLevel(logging.INFO) +file_handler = logging.FileHandler('tftp_server_activity.log') +formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s') +file_handler.setFormatter(formatter) +logger.addHandler(file_handler) + +class TftpServer(TftpSession): + def __init__(self, tftproot=None, dyn_file_func=None, upload_open=None): + super().__init__() + self.listenip = None + self.listenport = None + self.sock = None + self.root = os.path.abspath(tftproot) + self.dyn_file_func = dyn_file_func + self.upload_open = upload_open + self.sessions = {} + self.is_running = threading.Event() + self.shutdown_gracefully = False + self.shutdown_immediately = False + + # Validate the TFTP root directory + if os.path.exists(self.root): + if not os.path.isdir(self.root): + raise TftpException("The tftproot must be a directory.") + if not os.access(self.root, os.R_OK): + raise TftpException("The tftproot must be readable.") + if not os.access(self.root, os.W_OK): + logger.warning("The tftproot is not writable.") + else: + raise TftpException("The tftproot does not exist.") + + def handle_write_request(self, address, filename): + """ + Handle write requests by saving the file to Django's MEDIA_ROOT. + """ + filepath = os.path.join(self.root, filename) + try: + with open(filepath, 'wb') as file: + self.write_to_file(file) + logger.info(f"File written to {filepath}") + except Exception as e: + logger.error(f"Error writing file {filepath}: {e}") + + def listen(self, listenip="", listenport=DEF_TFTP_PORT, timeout=SOCK_TIMEOUT, retries=DEF_TIMEOUT_RETRIES): + """ + Start listening for incoming TFTP requests and handle them. + """ + tftp_factory = TftpPacketFactory() + + if not listenip: + listenip = '0.0.0.0' + logger.info("Server requested on IP %s, port %s" % (listenip, listenport)) + try: + self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + self.sock.bind((listenip, listenport)) + _, self.listenport = self.sock.getsockname() + except socket.error as err: + logger.error(f"Socket error: {err}") + raise + + self.is_running.set() + + logger.info("Starting receive loop...") + while True: + if self.shutdown_immediately: + logger.warning("Shutting down immediately. Session count: %d" % len(self.sessions)) + self.sock.close() + for key in self.sessions: + self.sessions[key].end() + self.sessions = {} + break + + elif self.shutdown_gracefully: + if not self.sessions: + logger.warning("In graceful shutdown mode and all sessions complete.") + self.sock.close() + break + + inputlist = [self.sock] + [session.sock for session in self.sessions.values()] + try: + readyinput, _, _ = select.select(inputlist, [], [], timeout) + except select.error as err: + if err[0] == EINTR: + logger.debug("Interrupted syscall, retrying") + continue + else: + logger.error(f"Select error: {err}") + raise + + deletion_list = [] + + for readysock in readyinput: + if readysock == self.sock: + buffer, (raddress, rport) = self.sock.recvfrom(MAX_BLKSIZE) + if self.shutdown_gracefully: + logger.warning("Discarding data on main port, in graceful shutdown mode") + continue + + key = "%s:%s" % (raddress, rport) + if key not in self.sessions: + self.sessions[key] = TftpContextServer(raddress, rport, timeout, self.root, self.dyn_file_func, self.upload_open, retries=retries) + try: + self.sessions[key].start(buffer) + except TftpException as err: + deletion_list.append(key) + logger.error("Fatal exception from session %s: %s" % (key, str(err))) + logger.info("Currently handling these sessions:") + for session_key, session in self.sessions.items(): + logger.info(" %s" % session) + + else: + for key in self.sessions: + if readysock == self.sessions[key].sock: + try: + self.sessions[key].cycle() + if self.sessions[key].state is None: + logger.info("Successful transfer.") + deletion_list.append(key) + except TftpException as err: + deletion_list.append(key) + logger.error("Fatal exception from session %s: %s" % (key, str(err))) + break + else: + logger.error("Can't find the owner for this packet. Discarding.") + + for key in deletion_list: + if key in self.sessions: + self.sessions[key].end() + metrics = self.sessions[key].metrics + if metrics.duration == 0: + logger.info("Duration too short, rate undetermined") + else: + logger.info("Transferred %d bytes in %.2f seconds" % (metrics.bytes, metrics.duration)) + logger.info("Average rate: %.2f kbps" % metrics.kbps) + logger.info("%.2f bytes in resent data" % metrics.resent_bytes) + logger.info("%d duplicate packets" % metrics.dupcount) + del self.sessions[key] + + self.is_running.clear() + logger.debug("Server returning from while loop") + self.shutdown_gracefully = self.shutdown_immediately = False + + def stop(self, now=False): + """ + Stop the server gracefully. Do not take any new transfers, but complete the existing ones. + """ + if now: + self.shutdown_immediately = True + else: + self.shutdown_gracefully = True diff --git a/blcu-programming/tftp/TftpClient.py b/blcu-programming/tftp/TftpClient.py new file mode 100644 index 000000000..b50b6953a --- /dev/null +++ b/blcu-programming/tftp/TftpClient.py @@ -0,0 +1,131 @@ +# vim: ts=4 sw=4 et ai: +# -*- coding: utf8 -*- +"""This module implements the TFTP Client functionality. Instantiate an +instance of the client, and then use its upload or download method. Logging is +performed via a standard logging object set in TftpShared.""" + + +import io +import types +import logging +from .TftpShared import * +from .TftpPacketTypes import * +from .TftpContexts import TftpContextClientDownload, TftpContextClientUpload + +log = logging.getLogger('tftpy.TftpClient') + +class TftpClient(TftpSession): + """This class is an implementation of a tftp client. Once instantiated, a + download can be initiated via the download() method, or an upload via the + upload() method.""" + + def __init__(self, host, port=69, options={}, localip = ""): + TftpSession.__init__(self) + self.context = None + self.host = host + self.iport = port + self.filename = None + self.options = options + self.localip = localip + if 'blksize' in self.options: + size = self.options['blksize'] + tftpassert(int == type(size), "blksize must be an int") + if size < MIN_BLKSIZE or size > MAX_BLKSIZE: + raise TftpException("Invalid blksize: %d" % size) + + def download(self, filename, output, packethook=None, timeout=SOCK_TIMEOUT, retries=DEF_TIMEOUT_RETRIES): + """This method initiates a tftp download from the configured remote + host, requesting the filename passed. It writes the file to output, + which can be a file-like object or a path to a local file. If a + packethook is provided, it must be a function that takes a single + parameter, which will be a copy of each DAT packet received in the + form of a TftpPacketDAT object. The timeout parameter may be used to + override the default SOCK_TIMEOUT setting, which is the amount of time + that the client will wait for a receive packet to arrive. + The retires paramater may be used to override the default DEF_TIMEOUT_RETRIES + settings, which is the amount of retransmission attemtpts the client will initiate + after encountering a timeout. + + Note: If output is a hyphen, stdout is used.""" + # We're downloading. + log.debug("Creating download context with the following params:") + log.debug("host = %s, port = %s, filename = %s" % (self.host, self.iport, filename)) + log.debug("options = %s, packethook = %s, timeout = %s" % (self.options, packethook, timeout)) + self.context = TftpContextClientDownload(self.host, + self.iport, + filename, + output, + self.options, + packethook, + timeout, + retries=retries, + localip=self.localip) + self.context.start() + # Download happens here + self.context.end() + + metrics = self.context.metrics + + log.info('') + log.info("Download complete.") + if metrics.duration == 0: + log.info("Duration too short, rate undetermined") + else: + log.info("Downloaded %.2f bytes in %.2f seconds" % (metrics.bytes, metrics.duration)) + log.info("Average rate: %.2f kbps" % metrics.kbps) + log.info("%.2f bytes in resent data" % metrics.resent_bytes) + log.info("Received %d duplicate packets" % metrics.dupcount) + def get_file_size(self, filename): + """Simulate a request to get the file size from the server.""" + # Create a request for the file + try: + # Here you would typically send a request to the server to check if the file exists + # Since TFTP doesn't support file size queries, we can simply perform a download in a way + # that we can track the size without saving the file, just for demonstration. + output = io.BytesIO() # Use a BytesIO object to avoid writing to disk + self.download(filename, output) + + # Get the size of the downloaded data + return output.getbuffer().nbytes + + except Exception as e: + log.error(f"Failed to get file size: {str(e)}") + return -1 # Return -1 or another sentinel value to indicate an error + def upload(self, filename, input, packethook=None, timeout=SOCK_TIMEOUT, retries=DEF_TIMEOUT_RETRIES): + """This method initiates a tftp upload to the configured remote host, + uploading the filename passed. It reads the file from input, which + can be a file-like object or a path to a local file. If a packethook + is provided, it must be a function that takes a single parameter, + which will be a copy of each DAT packet sent in the form of a + TftpPacketDAT object. The timeout parameter may be used to override + the default SOCK_TIMEOUT setting, which is the amount of time that + the client will wait for a DAT packet to be ACKd by the server. + The retires paramater may be used to override the default DEF_TIMEOUT_RETRIES + settings, which is the amount of retransmission attemtpts the client will initiate + after encountering a timeout. + + Note: If input is a hyphen, stdin is used.""" + self.context = TftpContextClientUpload(self.host, + self.iport, + filename, + input, + self.options, + packethook, + timeout, + retries=retries, + localip=self.localip) + self.context.start() + # Upload happens here + self.context.end() + + metrics = self.context.metrics + + log.info('') + log.info("Upload complete.") + if metrics.duration == 0: + log.info("Duration too short, rate undetermined") + else: + log.info("Uploaded %d bytes in %.2f seconds" % (metrics.bytes, metrics.duration)) + log.info("Average rate: %.2f kbps" % metrics.kbps) + log.info("%.2f bytes in resent data" % metrics.resent_bytes) + log.info("Resent %d packets" % metrics.dupcount) diff --git a/blcu-programming/tftp/TftpContexts.py b/blcu-programming/tftp/TftpContexts.py new file mode 100644 index 000000000..f01509eee --- /dev/null +++ b/blcu-programming/tftp/TftpContexts.py @@ -0,0 +1,437 @@ +# vim: ts=4 sw=4 et ai: +# -*- coding: utf8 -*- +"""This module implements all contexts for state handling during uploads and +downloads, the main interface to which being the TftpContext base class. + +The concept is simple. Each context object represents a single upload or +download, and the state object in the context object represents the current +state of that transfer. The state object has a handle() method that expects +the next packet in the transfer, and returns a state object until the transfer +is complete, at which point it returns None. That is, unless there is a fatal +error, in which case a TftpException is returned instead.""" + + +from .TftpShared import * +from .TftpPacketTypes import * +from .TftpPacketFactory import TftpPacketFactory +from .TftpStates import * +from . import compat +import socket +import time +import sys +import os +import logging + +log = logging.getLogger('tftpy.TftpContext') + +############################################################################### +# Utility classes +############################################################################### + +class TftpMetrics(object): + """A class representing metrics of the transfer.""" + def __init__(self): + # Bytes transferred + self.bytes = 0 + # Bytes re-sent + self.resent_bytes = 0 + # Duplicate packets received + self.dups = {} + self.dupcount = 0 + # Times + self.start_time = 0 + self.end_time = 0 + self.duration = 0 + # Rates + self.bps = 0 + self.kbps = 0 + # Generic errors + self.errors = 0 + + def compute(self): + # Compute transfer time + self.duration = self.end_time - self.start_time + if self.duration == 0: + self.duration = 1 + log.debug("TftpMetrics.compute: duration is %s", self.duration) + self.bps = (self.bytes * 8.0) / self.duration + self.kbps = self.bps / 1024.0 + log.debug("TftpMetrics.compute: kbps is %s", self.kbps) + for key in self.dups: + self.dupcount += self.dups[key] + + def add_dup(self, pkt): + """This method adds a dup for a packet to the metrics.""" + log.debug("Recording a dup of %s", pkt) + s = str(pkt) + if s in self.dups: + self.dups[s] += 1 + else: + self.dups[s] = 1 + tftpassert(self.dups[s] < MAX_DUPS, "Max duplicates reached") + +############################################################################### +# Context classes +############################################################################### + +class TftpContext(object): + """The base class of the contexts.""" + + def __init__(self, host, port, timeout, retries=DEF_TIMEOUT_RETRIES, localip = ""): + """Constructor for the base context, setting shared instance + variables.""" + self.file_to_transfer = None + self.fileobj = None + self.options = None + self.packethook = None + self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + if localip != "": + self.sock.bind((localip, 0)) + self.sock.settimeout(timeout) + self.timeout = timeout + self.retries = retries + self.state = None + self.next_block = 0 + self.factory = TftpPacketFactory() + # Note, setting the host will also set self.address, as it's a property. + self.host = host + self.port = port + # The port associated with the TID + self.tidport = None + # Metrics + self.metrics = TftpMetrics() + # Fluag when the transfer is pending completion. + self.pending_complete = False + # Time when this context last received any traffic. + # FIXME: does this belong in metrics? + self.last_update = 0 + # The last packet we sent, if applicable, to make resending easy. + self.last_pkt = None + # Count the number of retry attempts. + self.retry_count = 0 + + def getBlocksize(self): + """Fetch the current blocksize for this session.""" + return int(self.options.get('blksize', 512)) + + def __del__(self): + """Simple destructor to try to call housekeeping in the end method if + not called explicitely. Leaking file descriptors is not a good + thing.""" + self.end() + + def checkTimeout(self, now): + """Compare current time with last_update time, and raise an exception + if we're over the timeout time.""" + log.debug("checking for timeout on session %s", self) + if now - self.last_update > self.timeout: + raise TftpTimeout("Timeout waiting for traffic") + + def start(self): + raise NotImplementedError("Abstract method") + + def end(self, close_fileobj=True): + """Perform session cleanup, since the end method should always be + called explicitely by the calling code, this works better than the + destructor. + Set close_fileobj to False so fileobj can be returned open.""" + log.debug("in TftpContext.end - closing socket") + self.sock.close() + if close_fileobj and self.fileobj is not None and not self.fileobj.closed: + log.debug("self.fileobj is open - closing") + self.fileobj.close() + + def gethost(self): + "Simple getter method for use in a property." + return self.__host + + def sethost(self, host): + """Setter method that also sets the address property as a result + of the host that is set.""" + self.__host = host + self.address = socket.gethostbyname(host) + + host = property(gethost, sethost) + + def setNextBlock(self, block): + if block >= 2 ** 16: + log.debug("Block number rollover to 0 again") + block = 0 + self.__eblock = block + + def getNextBlock(self): + return self.__eblock + + next_block = property(getNextBlock, setNextBlock) + + def cycle(self): + """Here we wait for a response from the server after sending it + something, and dispatch appropriate action to that response.""" + try: + (buffer, (raddress, rport)) = self.sock.recvfrom(MAX_BLKSIZE) + except socket.timeout: + log.warning("Timeout waiting for traffic, retrying...") + raise TftpTimeout("Timed-out waiting for traffic") + + # Ok, we've received a packet. Log it. + log.debug("Received %d bytes from %s:%s", + len(buffer), raddress, rport) + # And update our last updated time. + self.last_update = time.time() + + # Decode it. + recvpkt = self.factory.parse(buffer) + + # Check for known "connection". + if raddress != self.address: + log.warning("Received traffic from %s, expected host %s. Discarding" + % (raddress, self.host)) + + if self.tidport and self.tidport != rport: + log.warning("Received traffic from %s:%s but we're " + "connected to %s:%s. Discarding." + % (raddress, rport, + self.host, self.tidport)) + + # If there is a packethook defined, call it. We unconditionally + # pass all packets, it's up to the client to screen out different + # kinds of packets. This way, the client is privy to things like + # negotiated options. + if self.packethook: + self.packethook(recvpkt) + + # And handle it, possibly changing state. + self.state = self.state.handle(recvpkt, raddress, rport) + # If we didn't throw any exceptions here, reset the retry_count to + # zero. + self.retry_count = 0 + +class TftpContextServer(TftpContext): + """The context for the server.""" + def __init__(self, + host, + port, + timeout, + root, + dyn_file_func=None, + upload_open=None, + retries=DEF_TIMEOUT_RETRIES): + TftpContext.__init__(self, + host, + port, + timeout, + retries + ) + # At this point we have no idea if this is a download or an upload. We + # need to let the start state determine that. + self.state = TftpStateServerStart(self) + + self.root = root + self.dyn_file_func = dyn_file_func + self.upload_open = upload_open + + def __str__(self): + return "%s:%s %s" % (self.host, self.port, self.state) + + def start(self, buffer): + """Start the state cycle. Note that the server context receives an + initial packet in its start method. Also note that the server does not + loop on cycle(), as it expects the TftpServer object to manage + that.""" + log.debug("In TftpContextServer.start") + self.metrics.start_time = time.time() + log.debug("Set metrics.start_time to %s", self.metrics.start_time) + # And update our last updated time. + self.last_update = time.time() + + pkt = self.factory.parse(buffer) + log.debug("TftpContextServer.start() - factory returned a %s", pkt) + + # Call handle once with the initial packet. This should put us into + # the download or the upload state. + self.state = self.state.handle(pkt, + self.host, + self.port) + + def end(self): + """Finish up the context.""" + TftpContext.end(self) + self.metrics.end_time = time.time() + log.debug("Set metrics.end_time to %s", self.metrics.end_time) + self.metrics.compute() + +class TftpContextClientUpload(TftpContext): + """The upload context for the client during an upload. + Note: If input is a hyphen, then we will use stdin.""" + def __init__(self, + host, + port, + filename, + input, + options, + packethook, + timeout, + retries=DEF_TIMEOUT_RETRIES, + localip = ""): + TftpContext.__init__(self, + host, + port, + timeout, + retries, + localip) + self.file_to_transfer = filename + self.options = options + self.packethook = packethook + # If the input object has a read() function, + # assume it is file-like. + if hasattr(input, 'read'): + self.fileobj = input + elif input == '-': + self.fileobj = compat.binary_stdin() + else: + self.fileobj = open(input, "rb") + + log.debug("TftpContextClientUpload.__init__()") + log.debug("file_to_transfer = %s, options = %s" % + (self.file_to_transfer, self.options)) + + def __str__(self): + return "%s:%s %s" % (self.host, self.port, self.state) + + def start(self): + log.info("Sending tftp upload request to %s" % self.host) + log.info(" filename -> %s" % self.file_to_transfer) + log.info(" options -> %s" % self.options) + + self.metrics.start_time = time.time() + log.debug("Set metrics.start_time to %s" % self.metrics.start_time) + + # FIXME: put this in a sendWRQ method? + pkt = TftpPacketWRQ() + pkt.filename = self.file_to_transfer + pkt.mode = "octet" # FIXME - shouldn't hardcode this + pkt.options = self.options + self.sock.sendto(pkt.encode().buffer, (self.host, self.port)) + self.next_block = 1 + self.last_pkt = pkt + # FIXME: should we centralize sendto operations so we can refactor all + # saving of the packet to the last_pkt field? + + self.state = TftpStateSentWRQ(self) + + while self.state: + try: + log.debug("State is %s" % self.state) + self.cycle() + except TftpTimeout as err: + log.error(str(err)) + self.retry_count += 1 + if self.retry_count >= self.retries: + log.debug("hit max retries, giving up") + raise + else: + log.warning("resending last packet") + self.state.resendLast() + + def end(self): + """Finish up the context.""" + TftpContext.end(self) + self.metrics.end_time = time.time() + log.debug("Set metrics.end_time to %s" % self.metrics.end_time) + self.metrics.compute() + + +class TftpContextClientDownload(TftpContext): + """The download context for the client during a download. + Note: If output is a hyphen, then the output will be sent to stdout.""" + def __init__(self, + host, + port, + filename, + output, + options, + packethook, + timeout, + retries=DEF_TIMEOUT_RETRIES, + localip = ""): + TftpContext.__init__(self, + host, + port, + timeout, + retries, + localip) + # FIXME: should we refactor setting of these params? + self.file_to_transfer = filename + self.options = options + self.packethook = packethook + self.filelike_fileobj = False + # If the output object has a write() function, + # assume it is file-like. + if hasattr(output, 'write'): + self.fileobj = output + self.filelike_fileobj = True + # If the output filename is -, then use stdout + elif output == '-': + self.fileobj = sys.stdout + self.filelike_fileobj = True + else: + self.fileobj = open(output, "wb") + + log.debug("TftpContextClientDownload.__init__()") + log.debug("file_to_transfer = %s, options = %s" % + (self.file_to_transfer, self.options)) + + def __str__(self): + return "%s:%s %s" % (self.host, self.port, self.state) + + def start(self): + """Initiate the download.""" + log.info("Sending tftp download request to %s" % self.host) + log.info(" filename -> %s" % self.file_to_transfer) + log.info(" options -> %s" % self.options) + + self.metrics.start_time = time.time() + log.debug("Set metrics.start_time to %s" % self.metrics.start_time) + + # FIXME: put this in a sendRRQ method? + pkt = TftpPacketRRQ() + pkt.filename = self.file_to_transfer + pkt.mode = "octet" # FIXME - shouldn't hardcode this + pkt.options = self.options + self.sock.sendto(pkt.encode().buffer, (self.host, self.port)) + self.next_block = 1 + self.last_pkt = pkt + + self.state = TftpStateSentRRQ(self) + + while self.state: + try: + log.debug("State is %s" % self.state) + self.cycle() + except TftpTimeout as err: + log.error(str(err)) + self.retry_count += 1 + if self.retry_count >= self.retries: + log.debug("hit max retries, giving up") + raise + else: + log.warning("resending last packet") + self.state.resendLast() + except TftpFileNotFoundError as err: + # If we received file not found, then we should not save the open + # output file or we'll be left with a size zero file. Delete it, + # if it exists. + log.error("Received File not found error") + if self.fileobj is not None and not self.filelike_fileobj: + if os.path.exists(self.fileobj.name): + log.debug("unlinking output file of %s", self.fileobj.name) + os.unlink(self.fileobj.name) + + raise + + def end(self): + """Finish up the context.""" + TftpContext.end(self, not self.filelike_fileobj) + self.metrics.end_time = time.time() + log.debug("Set metrics.end_time to %s" % self.metrics.end_time) + self.metrics.compute() diff --git a/blcu-programming/tftp/TftpPacketFactory.py b/blcu-programming/tftp/TftpPacketFactory.py new file mode 100644 index 000000000..41f39a9e2 --- /dev/null +++ b/blcu-programming/tftp/TftpPacketFactory.py @@ -0,0 +1,47 @@ +# vim: ts=4 sw=4 et ai: +# -*- coding: utf8 -*- +"""This module implements the TftpPacketFactory class, which can take a binary +buffer, and return the appropriate TftpPacket object to represent it, via the +parse() method.""" + + +from .TftpShared import * +from .TftpPacketTypes import * +import logging + +log = logging.getLogger('tftpy.TftpPacketFactory') + +class TftpPacketFactory(object): + """This class generates TftpPacket objects. It is responsible for parsing + raw buffers off of the wire and returning objects representing them, via + the parse() method.""" + def __init__(self): + self.classes = { + 1: TftpPacketRRQ, + 2: TftpPacketWRQ, + 3: TftpPacketDAT, + 4: TftpPacketACK, + 5: TftpPacketERR, + 6: TftpPacketOACK + } + + def parse(self, buffer): + """This method is used to parse an existing datagram into its + corresponding TftpPacket object. The buffer is the raw bytes off of + the network.""" + log.debug("parsing a %d byte packet" % len(buffer)) + (opcode,) = struct.unpack(str("!H"), buffer[:2]) + log.debug("opcode is %d" % opcode) + packet = self.__create(opcode) + packet.buffer = buffer + return packet.decode() + + def __create(self, opcode): + """This method returns the appropriate class object corresponding to + the passed opcode.""" + tftpassert(opcode in self.classes, + "Unsupported opcode: %d" % opcode) + + packet = self.classes[opcode]() + + return packet diff --git a/blcu-programming/tftp/TftpPacketTypes.py b/blcu-programming/tftp/TftpPacketTypes.py new file mode 100644 index 000000000..3d3bdf83c --- /dev/null +++ b/blcu-programming/tftp/TftpPacketTypes.py @@ -0,0 +1,494 @@ +# vim: ts=4 sw=4 et ai: +# -*- coding: utf8 -*- +"""This module implements the packet types of TFTP itself, and the +corresponding encode and decode methods for them.""" + + +import struct +import sys +import logging +from .TftpShared import * + +log = logging.getLogger('tftpy.TftpPacketTypes') + +class TftpSession(object): + """This class is the base class for the tftp client and server. Any shared + code should be in this class.""" + # FIXME: do we need this anymore? + pass + +class TftpPacketWithOptions(object): + """This class exists to permit some TftpPacket subclasses to share code + regarding options handling. It does not inherit from TftpPacket, as the + goal is just to share code here, and not cause diamond inheritance.""" + + def __init__(self): + self.options = {} + + # Always use unicode strings, except at the encode/decode barrier. + # Simpler to keep things clear. + def setoptions(self, options): + log.debug("in TftpPacketWithOptions.setoptions") + log.debug("options: %s", options) + myoptions = {} + for key in options: + newkey = key + if isinstance(key, bytes): + newkey = newkey.decode('ascii') + newval = options[key] + if isinstance(newval, bytes): + newval = newval.decode('ascii') + myoptions[newkey] = newval + log.debug("populated myoptions with %s = %s", newkey, myoptions[newkey]) + + log.debug("setting options hash to: %s", myoptions) + self._options = myoptions + + def getoptions(self): + log.debug("in TftpPacketWithOptions.getoptions") + return self._options + + # Set up getter and setter on options to ensure that they are the proper + # type. They should always be strings, but we don't need to force the + # client to necessarily enter strings if we can avoid it. + options = property(getoptions, setoptions) + + def decode_options(self, buffer): + """This method decodes the section of the buffer that contains an + unknown number of options. It returns a dictionary of option names and + values.""" + fmt = b"!" + options = {} + + log.debug("decode_options: buffer is: %s", repr(buffer)) + log.debug("size of buffer is %d bytes", len(buffer)) + if len(buffer) == 0: + log.debug("size of buffer is zero, returning empty hash") + return {} + + # Count the nulls in the buffer. Each one terminates a string. + log.debug("about to iterate options buffer counting nulls") + length = 0 + for i in range(len(buffer)): + if ord(buffer[i:i+1]) == 0: + log.debug("found a null at length %d", length) + if length > 0: + fmt += b"%dsx" % length + length = -1 + else: + raise TftpException("Invalid options in buffer") + length += 1 + + log.debug("about to unpack, fmt is: %s", fmt) + mystruct = struct.unpack(fmt, buffer) + + tftpassert(len(mystruct) % 2 == 0, + "packet with odd number of option/value pairs") + + for i in range(0, len(mystruct), 2): + key = mystruct[i].decode('ascii') + val = mystruct[i+1].decode('ascii') + log.debug("setting option %s to %s", key, val) + log.debug("types are %s and %s", type(key), type(val)) + options[key] = val + + return options + +class TftpPacket(object): + """This class is the parent class of all tftp packet classes. It is an + abstract class, providing an interface, and should not be instantiated + directly.""" + def __init__(self): + self.opcode = 0 + self.buffer = None + + def encode(self): + """The encode method of a TftpPacket takes keyword arguments specific + to the type of packet, and packs an appropriate buffer in network-byte + order suitable for sending over the wire. + + This is an abstract method.""" + raise NotImplementedError("Abstract method") + + def decode(self): + """The decode method of a TftpPacket takes a buffer off of the wire in + network-byte order, and decodes it, populating internal properties as + appropriate. This can only be done once the first 2-byte opcode has + already been decoded, but the data section does include the entire + datagram. + + This is an abstract method.""" + raise NotImplementedError("Abstract method") + +class TftpPacketInitial(TftpPacket, TftpPacketWithOptions): + """This class is a common parent class for the RRQ and WRQ packets, as + they share quite a bit of code.""" + def __init__(self): + TftpPacket.__init__(self) + TftpPacketWithOptions.__init__(self) + self.filename = None + self.mode = None + + def encode(self): + """Encode the packet's buffer from the instance variables.""" + tftpassert(self.filename, "filename required in initial packet") + tftpassert(self.mode, "mode required in initial packet") + # Make sure filename and mode are bytestrings. + filename = self.filename + mode = self.mode + if not isinstance(filename, bytes): + filename = filename.encode('ascii') + if not isinstance(self.mode, bytes): + mode = mode.encode('ascii') + + ptype = None + if self.opcode == 1: ptype = "RRQ" + else: ptype = "WRQ" + log.debug("Encoding %s packet, filename = %s, mode = %s", + ptype, filename, mode) + for key in self.options: + log.debug(" Option %s = %s", key, self.options[key]) + + fmt = b"!H" + fmt += b"%dsx" % len(filename) + if mode == b"octet": + fmt += b"5sx" + else: + raise AssertionError("Unsupported mode: %s" % mode) + # Add options. Note that the options list must be bytes. + options_list = [] + if len(list(self.options.keys())) > 0: + log.debug("there are options to encode") + for key in self.options: + # Populate the option name + name = key + if not isinstance(name, bytes): + name = name.encode('ascii') + options_list.append(name) + fmt += b"%dsx" % len(name) + # Populate the option value + value = self.options[key] + # Work with all strings. + if isinstance(value, int): + value = str(value) + if not isinstance(value, bytes): + value = value.encode('ascii') + options_list.append(value) + fmt += b"%dsx" % len(value) + + log.debug("fmt is %s", fmt) + log.debug("options_list is %s", options_list) + log.debug("size of struct is %d", struct.calcsize(fmt)) + + self.buffer = struct.pack(fmt, + self.opcode, + filename, + mode, + *options_list) + + log.debug("buffer is %s", repr(self.buffer)) + return self + + def decode(self): + tftpassert(self.buffer, "Can't decode, buffer is empty") + + # FIXME - this shares a lot of code with decode_options + nulls = 0 + fmt = b"" + nulls = length = tlength = 0 + log.debug("in decode: about to iterate buffer counting nulls") + subbuf = self.buffer[2:] + for i in range(len(subbuf)): + if ord(subbuf[i:i+1]) == 0: + nulls += 1 + log.debug("found a null at length %d, now have %d", length, nulls) + fmt += b"%dsx" % length + length = -1 + # At 2 nulls, we want to mark that position for decoding. + if nulls == 2: + break + length += 1 + tlength += 1 + + log.debug("hopefully found end of mode at length %d", tlength) + # length should now be the end of the mode. + tftpassert(nulls == 2, "malformed packet") + shortbuf = subbuf[:tlength+1] + log.debug("about to unpack buffer with fmt: %s", fmt) + log.debug("unpacking buffer: %s", repr(shortbuf)) + mystruct = struct.unpack(fmt, shortbuf) + + tftpassert(len(mystruct) == 2, "malformed packet") + self.filename = mystruct[0].decode('ascii') + self.mode = mystruct[1].decode('ascii').lower() # force lc - bug 17 + log.debug("set filename to %s", self.filename) + log.debug("set mode to %s", self.mode) + + self.options = self.decode_options(subbuf[tlength+1:]) + log.debug("options dict is now %s", self.options) + return self + +class TftpPacketRRQ(TftpPacketInitial): + """ +:: + + 2 bytes string 1 byte string 1 byte + ----------------------------------------------- + RRQ/ | 01/02 | Filename | 0 | Mode | 0 | + WRQ ----------------------------------------------- + """ + def __init__(self): + TftpPacketInitial.__init__(self) + self.opcode = 1 + + def __str__(self): + s = 'RRQ packet: filename = %s' % self.filename + s += ' mode = %s' % self.mode + if self.options: + s += '\n options = %s' % self.options + return s + +class TftpPacketWRQ(TftpPacketInitial): + """ +:: + + 2 bytes string 1 byte string 1 byte + ----------------------------------------------- + RRQ/ | 01/02 | Filename | 0 | Mode | 0 | + WRQ ----------------------------------------------- + """ + def __init__(self): + TftpPacketInitial.__init__(self) + self.opcode = 2 + + def __str__(self): + s = 'WRQ packet: filename = %s' % self.filename + s += ' mode = %s' % self.mode + if self.options: + s += '\n options = %s' % self.options + return s + +class TftpPacketDAT(TftpPacket): + """ +:: + + 2 bytes 2 bytes n bytes + --------------------------------- + DATA | 03 | Block # | Data | + --------------------------------- + """ + def __init__(self): + TftpPacket.__init__(self) + self.opcode = 3 + self.blocknumber = 0 + self.data = None + + def __str__(self): + s = 'DAT packet: block %s' % self.blocknumber + if self.data: + s += '\n data: %d bytes' % len(self.data) + return s + + def encode(self): + """Encode the DAT packet. This method populates self.buffer, and + returns self for easy method chaining.""" + if len(self.data) == 0: + log.debug("Encoding an empty DAT packet") + data = self.data + if not isinstance(self.data, bytes): + data = self.data.encode('ascii') + fmt = b"!HH%ds" % len(data) + self.buffer = struct.pack(fmt, + self.opcode, + self.blocknumber, + data) + return self + + def decode(self): + """Decode self.buffer into instance variables. It returns self for + easy method chaining.""" + # We know the first 2 bytes are the opcode. The second two are the + # block number. + (self.blocknumber,) = struct.unpack(str("!H"), self.buffer[2:4]) + log.debug("decoding DAT packet, block number %d", self.blocknumber) + log.debug("should be %d bytes in the packet total", len(self.buffer)) + # Everything else is data. + self.data = self.buffer[4:] + log.debug("found %d bytes of data", len(self.data)) + return self + +class TftpPacketACK(TftpPacket): + """ +:: + + 2 bytes 2 bytes + ------------------- + ACK | 04 | Block # | + -------------------- + """ + def __init__(self): + TftpPacket.__init__(self) + self.opcode = 4 + self.blocknumber = 0 + + def __str__(self): + return 'ACK packet: block %d' % self.blocknumber + + def encode(self): + log.debug("encoding ACK: opcode = %d, block = %d", + self.opcode, self.blocknumber) + self.buffer = struct.pack(str("!HH"), self.opcode, self.blocknumber) + return self + + def decode(self): + if len(self.buffer) > 4: + log.debug("detected TFTP ACK but request is too large, will truncate") + log.debug("buffer was: %s", repr(self.buffer)) + self.buffer = self.buffer[0:4] + self.opcode, self.blocknumber = struct.unpack(str("!HH"), self.buffer) + log.debug("decoded ACK packet: opcode = %d, block = %d", + self.opcode, self.blocknumber) + return self + +class TftpPacketERR(TftpPacket): + """ +:: + + 2 bytes 2 bytes string 1 byte + ---------------------------------------- + ERROR | 05 | ErrorCode | ErrMsg | 0 | + ---------------------------------------- + + Error Codes + + Value Meaning + + 0 Not defined, see error message (if any). + 1 File not found. + 2 Access violation. + 3 Disk full or allocation exceeded. + 4 Illegal TFTP operation. + 5 Unknown transfer ID. + 6 File already exists. + 7 No such user. + 8 Failed to negotiate options + """ + def __init__(self): + TftpPacket.__init__(self) + self.opcode = 5 + self.errorcode = 0 + # FIXME: We don't encode the errmsg... + self.errmsg = None + # FIXME - integrate in TftpErrors references? + self.errmsgs = { + 1: b"File not found", + 2: b"Access violation", + 3: b"Disk full or allocation exceeded", + 4: b"Illegal TFTP operation", + 5: b"Unknown transfer ID", + 6: b"File already exists", + 7: b"No such user", + 8: b"Failed to negotiate options" + } + + def __str__(self): + s = 'ERR packet: errorcode = %d' % self.errorcode + s += '\n msg = %s' % self.errmsgs.get(self.errorcode, '') + return s + + def encode(self): + """Encode the DAT packet based on instance variables, populating + self.buffer, returning self.""" + fmt = b"!HH%dsx" % len(self.errmsgs[self.errorcode]) + log.debug("encoding ERR packet with fmt %s", fmt) + self.buffer = struct.pack(fmt, + self.opcode, + self.errorcode, + self.errmsgs[self.errorcode]) + return self + + def decode(self): + "Decode self.buffer, populating instance variables and return self." + buflen = len(self.buffer) + tftpassert(buflen >= 4, "malformed ERR packet, too short") + log.debug("Decoding ERR packet, length %s bytes", buflen) + if buflen == 4: + log.debug("Allowing this affront to the RFC of a 4-byte packet") + fmt = b"!HH" + log.debug("Decoding ERR packet with fmt: %s", fmt) + self.opcode, self.errorcode = struct.unpack(fmt, + self.buffer) + else: + log.debug("Good ERR packet > 4 bytes") + fmt = b"!HH%dsx" % (len(self.buffer) - 5) + log.debug("Decoding ERR packet with fmt: %s", fmt) + self.opcode, self.errorcode, self.errmsg = struct.unpack(fmt, + self.buffer) + log.error("ERR packet - errorcode: %d, message: %s" + % (self.errorcode, self.errmsg)) + return self + +class TftpPacketOACK(TftpPacket, TftpPacketWithOptions): + """ +:: + + +-------+---~~---+---+---~~---+---+---~~---+---+---~~---+---+ + | opc | opt1 | 0 | value1 | 0 | optN | 0 | valueN | 0 | + +-------+---~~---+---+---~~---+---+---~~---+---+---~~---+---+ + """ + def __init__(self): + TftpPacket.__init__(self) + TftpPacketWithOptions.__init__(self) + self.opcode = 6 + + def __str__(self): + return 'OACK packet:\n options = %s' % self.options + + def encode(self): + fmt = b"!H" # opcode + options_list = [] + log.debug("in TftpPacketOACK.encode") + for key in self.options: + value = self.options[key] + if isinstance(value, int): + value = str(value) + if not isinstance(key, bytes): + key = key.encode('ascii') + if not isinstance(value, bytes): + value = value.encode('ascii') + log.debug("looping on option key %s", key) + log.debug("value is %s", value) + fmt += b"%dsx" % len(key) + fmt += b"%dsx" % len(value) + options_list.append(key) + options_list.append(value) + self.buffer = struct.pack(fmt, self.opcode, *options_list) + return self + + def decode(self): + self.options = self.decode_options(self.buffer[2:]) + return self + + def match_options(self, options): + """This method takes a set of options, and tries to match them with + its own. It can accept some changes in those options from the server as + part of a negotiation. Changed or unchanged, it will return a dict of + the options so that the session can update itself to the negotiated + options.""" + for name in self.options: + if name in options: + if name == 'blksize': + # We can accept anything between the min and max values. + size = int(self.options[name]) + if size >= MIN_BLKSIZE and size <= MAX_BLKSIZE: + log.debug("negotiated blksize of %d bytes", size) + options['blksize'] = size + else: + raise TftpException("blksize %s option outside allowed range" % size) + elif name == 'tsize': + size = int(self.options[name]) + if size < 0: + raise TftpException("Negative file sizes not supported") + else: + raise TftpException("Unsupported option: %s" % name) + return True diff --git a/blcu-programming/tftp/TftpShared.py b/blcu-programming/tftp/TftpShared.py new file mode 100644 index 000000000..ab37bde0a --- /dev/null +++ b/blcu-programming/tftp/TftpShared.py @@ -0,0 +1,52 @@ +# vim: ts=4 sw=4 et ai: +# -*- coding: utf8 -*- +"""This module holds all objects shared by all other modules in tftpy.""" + + + +MIN_BLKSIZE = 8 +DEF_BLKSIZE = 512 +MAX_BLKSIZE = 65536 +SOCK_TIMEOUT = 50 +MAX_DUPS = 20 +DEF_TIMEOUT_RETRIES = 3 +DEF_TFTP_PORT = 69 + +# A hook for deliberately introducing delay in testing. +DELAY_BLOCK = 0 + +def tftpassert(condition, msg): + """This function is a simple utility that will check the condition + passed for a false state. If it finds one, it throws a TftpException + with the message passed. This just makes the code throughout cleaner + by refactoring.""" + if not condition: + raise TftpException(msg) + +class TftpErrors(object): + """This class is a convenience for defining the common tftp error codes, + and making them more readable in the code.""" + NotDefined = 0 + FileNotFound = 1 + AccessViolation = 2 + DiskFull = 3 + IllegalTftpOp = 4 + UnknownTID = 5 + FileAlreadyExists = 6 + NoSuchUser = 7 + FailedNegotiation = 8 + +class TftpException(Exception): + """This class is the parent class of all exceptions regarding the handling + of the TFTP protocol.""" + pass + +class TftpTimeout(TftpException): + """This class represents a timeout error waiting for a response from the + other end.""" + pass + +class TftpFileNotFoundError(TftpException): + """This class represents an error condition where we received a file + not found error.""" + pass diff --git a/blcu-programming/tftp/TftpStates.py b/blcu-programming/tftp/TftpStates.py new file mode 100644 index 000000000..231b1ce6b --- /dev/null +++ b/blcu-programming/tftp/TftpStates.py @@ -0,0 +1,611 @@ +# vim: ts=4 sw=4 et ai: +# -*- coding: utf8 -*- +"""This module implements all state handling during uploads and downloads, the +main interface to which being the TftpState base class. + +The concept is simple. Each context object represents a single upload or +download, and the state object in the context object represents the current +state of that transfer. The state object has a handle() method that expects +the next packet in the transfer, and returns a state object until the transfer +is complete, at which point it returns None. That is, unless there is a fatal +error, in which case a TftpException is returned instead.""" + + +from .TftpShared import * +from .TftpPacketTypes import * +import os +import logging + +log = logging.getLogger('tftpy.TftpStates') + +############################################################################### +# State classes +############################################################################### + +class TftpState(object): + """The base class for the states.""" + + def __init__(self, context): + """Constructor for setting up common instance variables. The involved + file object is required, since in tftp there's always a file + involved.""" + self.context = context + + def handle(self, pkt, raddress, rport): + """An abstract method for handling a packet. It is expected to return + a TftpState object, either itself or a new state.""" + raise NotImplementedError("Abstract method") + + def handleOACK(self, pkt): + """This method handles an OACK from the server, syncing any accepted + options.""" + if len(pkt.options.keys()) > 0: + if pkt.match_options(self.context.options): + log.info("Successful negotiation of options") + # Set options to OACK options + self.context.options = pkt.options + for key in self.context.options: + log.info(" %s = %s" % (key, self.context.options[key])) + else: + log.error("Failed to negotiate options") + raise TftpException("Failed to negotiate options") + else: + raise TftpException("No options found in OACK") + + def returnSupportedOptions(self, options): + """This method takes a requested options list from a client, and + returns the ones that are supported.""" + # We support the options blksize and tsize right now. + # FIXME - put this somewhere else? + accepted_options = {} + for option in options: + if option == 'blksize': + # Make sure it's valid. + if int(options[option]) > MAX_BLKSIZE: + log.info("Client requested blksize greater than %d " + "setting to maximum" % MAX_BLKSIZE) + accepted_options[option] = MAX_BLKSIZE + elif int(options[option]) < MIN_BLKSIZE: + log.info("Client requested blksize less than %d " + "setting to minimum" % MIN_BLKSIZE) + accepted_options[option] = MIN_BLKSIZE + else: + accepted_options[option] = options[option] + elif option == 'tsize': + log.debug("tsize option is set") + accepted_options['tsize'] = 0 + else: + log.info("Dropping unsupported option '%s'" % option) + log.debug("Returning these accepted options: %s", accepted_options) + return accepted_options + + def sendDAT(self): + """This method sends the next DAT packet based on the data in the + context. It returns a boolean indicating whether the transfer is + finished.""" + finished = False + blocknumber = self.context.next_block + # Test hook + if DELAY_BLOCK and DELAY_BLOCK == blocknumber: + import time + log.debug("Deliberately delaying 10 seconds...") + time.sleep(10) + dat = None + blksize = self.context.getBlocksize() + buffer = self.context.fileobj.read(blksize) + log.debug("Read %d bytes into buffer", len(buffer)) + if len(buffer) < blksize: + log.info("Reached EOF on file %s" + % self.context.file_to_transfer) + finished = True + dat = TftpPacketDAT() + dat.data = buffer + dat.blocknumber = blocknumber + self.context.metrics.bytes += len(dat.data) + log.debug("Sending DAT packet %d", dat.blocknumber) + self.context.sock.sendto(dat.encode().buffer, + (self.context.host, self.context.tidport)) + if self.context.packethook: + self.context.packethook(dat) + self.context.last_pkt = dat + return finished + + def sendACK(self, blocknumber=None): + """This method sends an ack packet to the block number specified. If + none is specified, it defaults to the next_block property in the + parent context.""" + log.debug("In sendACK, passed blocknumber is %s", blocknumber) + if blocknumber is None: + blocknumber = self.context.next_block + log.info("Sending ack to block %d" % blocknumber) + ackpkt = TftpPacketACK() + ackpkt.blocknumber = blocknumber + self.context.sock.sendto(ackpkt.encode().buffer, + (self.context.host, + self.context.tidport)) + self.context.last_pkt = ackpkt + + def sendError(self, errorcode): + """This method uses the socket passed, and uses the errorcode to + compose and send an error packet.""" + log.debug("In sendError, being asked to send error %d", errorcode) + errpkt = TftpPacketERR() + errpkt.errorcode = errorcode + if self.context.tidport == None: + log.debug("Error packet received outside session. Discarding") + else: + self.context.sock.sendto(errpkt.encode().buffer, + (self.context.host, + self.context.tidport)) + self.context.last_pkt = errpkt + + def sendOACK(self): + """This method sends an OACK packet with the options from the current + context.""" + log.debug("In sendOACK with options %s", self.context.options) + pkt = TftpPacketOACK() + pkt.options = self.context.options + self.context.sock.sendto(pkt.encode().buffer, + (self.context.host, + self.context.tidport)) + self.context.last_pkt = pkt + + def resendLast(self): + "Resend the last sent packet due to a timeout." + log.warning("Resending packet %s on sessions %s" + % (self.context.last_pkt, self)) + self.context.metrics.resent_bytes += len(self.context.last_pkt.buffer) + self.context.metrics.add_dup(self.context.last_pkt) + sendto_port = self.context.tidport + if not sendto_port: + # If the tidport wasn't set, then the remote end hasn't even + # started talking to us yet. That's not good. Maybe it's not + # there. + sendto_port = self.context.port + self.context.sock.sendto(self.context.last_pkt.encode().buffer, + (self.context.host, sendto_port)) + if self.context.packethook: + self.context.packethook(self.context.last_pkt) + + def handleDat(self, pkt): + """This method handles a DAT packet during a client download, or a + server upload.""" + log.info("Handling DAT packet - block %d" % pkt.blocknumber) + log.debug("Expecting block %s", self.context.next_block) + if pkt.blocknumber == self.context.next_block: + log.debug("Good, received block %d in sequence", pkt.blocknumber) + + self.sendACK() + self.context.next_block += 1 + + log.debug("Writing %d bytes to output file", len(pkt.data)) + self.context.fileobj.write(pkt.data) + self.context.metrics.bytes += len(pkt.data) + # Check for end-of-file, any less than full data packet. + if len(pkt.data) < self.context.getBlocksize(): + log.info("End of file detected") + return None + + elif pkt.blocknumber < self.context.next_block: + if pkt.blocknumber == 0: + log.warning("There is no block zero!") + self.sendError(TftpErrors.IllegalTftpOp) + raise TftpException("There is no block zero!") + log.warning("Dropping duplicate block %d" % pkt.blocknumber) + self.context.metrics.add_dup(pkt) + log.debug("ACKing block %d again, just in case", pkt.blocknumber) + self.sendACK(pkt.blocknumber) + + else: + # FIXME: should we be more tolerant and just discard instead? + msg = "Whoa! Received future block %d but expected %d" \ + % (pkt.blocknumber, self.context.next_block) + log.error(msg) + raise TftpException(msg) + + # Default is to ack + return TftpStateExpectDAT(self.context) + +class TftpServerState(TftpState): + """The base class for server states.""" + + def __init__(self, context): + TftpState.__init__(self, context) + + # This variable is used to store the absolute path to the file being + # managed. + self.full_path = None + + def serverInitial(self, pkt, raddress, rport): + """This method performs initial setup for a server context transfer, + put here to refactor code out of the TftpStateServerRecvRRQ and + TftpStateServerRecvWRQ classes, since their initial setup is + identical. The method returns a boolean, sendoack, to indicate whether + it is required to send an OACK to the client.""" + options = pkt.options + sendoack = False + if not self.context.tidport: + self.context.tidport = rport + log.info("Setting tidport to %s" % rport) + + log.debug("Setting default options, blksize") + self.context.options = { 'blksize': DEF_BLKSIZE } + + if options: + log.debug("Options requested: %s", options) + supported_options = self.returnSupportedOptions(options) + self.context.options.update(supported_options) + sendoack = True + + # FIXME - only octet mode is supported at this time. + if pkt.mode != 'octet': + #self.sendError(TftpErrors.IllegalTftpOp) + #raise TftpException("Only octet transfers are supported at this time.") + log.warning("Received non-octet mode request. I'll reply with binary data.") + + # test host/port of client end + if self.context.host != raddress or self.context.port != rport: + self.sendError(TftpErrors.UnknownTID) + log.error("Expected traffic from %s:%s but received it " + "from %s:%s instead." + % (self.context.host, + self.context.port, + raddress, + rport)) + # FIXME: increment an error count? + # Return same state, we're still waiting for valid traffic. + return self + + log.debug("Requested filename is %s", pkt.filename) + + # Build the filename on this server and ensure it is contained + # in the specified root directory. + # + # Filenames that begin with server root are accepted. It's + # assumed the client and server are tightly connected and this + # provides backwards compatibility. + # + # Filenames otherwise are relative to the server root. If they + # begin with a '/' strip it off as otherwise os.path.join will + # treat it as absolute (regardless of whether it is ntpath or + # posixpath module + if pkt.filename.startswith(self.context.root): + full_path = pkt.filename + else: + full_path = os.path.join(self.context.root, pkt.filename.lstrip('/')) + + # Use abspath to eliminate any remaining relative elements + # (e.g. '..') and ensure that is still within the server's + # root directory + self.full_path = os.path.abspath(full_path) + log.debug("full_path is %s", full_path) + if self.full_path.startswith(os.path.normpath(self.context.root) + os.sep): + log.info("requested file is in the server root - good") + else: + log.warning("requested file is not within the server root - bad") + self.sendError(TftpErrors.IllegalTftpOp) + raise TftpException("bad file path") + + self.context.file_to_transfer = pkt.filename + + return sendoack + + +class TftpStateServerRecvRRQ(TftpServerState): + """This class represents the state of the TFTP server when it has just + received an RRQ packet.""" + def handle(self, pkt, raddress, rport): + "Handle an initial RRQ packet as a server." + log.debug("In TftpStateServerRecvRRQ.handle") + sendoack = self.serverInitial(pkt, raddress, rport) + path = self.full_path + log.info("Opening file %s for reading" % path) + if os.path.exists(path): + # Note: Open in binary mode for win32 portability, since win32 + # blows. + self.context.fileobj = open(path, "rb") + elif self.context.dyn_file_func: + log.debug("No such file %s but using dyn_file_func", path) + self.context.fileobj = \ + self.context.dyn_file_func(self.context.file_to_transfer, raddress=raddress, rport=rport) + + if self.context.fileobj is None: + log.debug("dyn_file_func returned 'None', treating as " + "FileNotFound") + self.sendError(TftpErrors.FileNotFound) + raise TftpException("File not found: %s" % path) + else: + log.warning("File not found: %s", path) + self.sendError(TftpErrors.FileNotFound) + raise TftpException("File not found: {}".format(path)) + + # Options negotiation. + if sendoack and 'tsize' in self.context.options: + # getting the file size for the tsize option. As we handle + # file-like objects and not only real files, we use this seeking + # method instead of asking the OS + self.context.fileobj.seek(0, os.SEEK_END) + tsize = str(self.context.fileobj.tell()) + self.context.fileobj.seek(0, 0) + self.context.options['tsize'] = tsize + + if sendoack: + # Note, next_block is 0 here since that's the proper + # acknowledgement to an OACK. + # FIXME: perhaps we do need a TftpStateExpectOACK class... + self.sendOACK() + # Note, self.context.next_block is already 0. + else: + self.context.next_block = 1 + log.debug("No requested options, starting send...") + self.context.pending_complete = self.sendDAT() + # Note, we expect an ack regardless of whether we sent a DAT or an + # OACK. + return TftpStateExpectACK(self.context) + + # Note, we don't have to check any other states in this method, that's + # up to the caller. + +class TftpStateServerRecvWRQ(TftpServerState): + """This class represents the state of the TFTP server when it has just + received a WRQ packet.""" + def make_subdirs(self): + """The purpose of this method is to, if necessary, create all of the + subdirectories leading up to the file to the written.""" + # Pull off everything below the root. + subpath = self.full_path[len(self.context.root):] + log.debug("make_subdirs: subpath is %s", subpath) + # Split on directory separators, but drop the last one, as it should + # be the filename. + dirs = subpath.split(os.sep)[:-1] + log.debug("dirs is %s", dirs) + current = self.context.root + for dir in dirs: + if dir: + current = os.path.join(current, dir) + if os.path.isdir(current): + log.debug("%s is already an existing directory", current) + else: + os.mkdir(current, 0o700) + + def handle(self, pkt, raddress, rport): + "Handle an initial WRQ packet as a server." + log.debug("In TftpStateServerRecvWRQ.handle") + sendoack = self.serverInitial(pkt, raddress, rport) + path = self.full_path + if self.context.upload_open: + f = self.context.upload_open(path, self.context) + if f is None: + self.sendError(TftpErrors.AccessViolation) + raise TftpException("Dynamic path %s not permitted" % path) + else: + self.context.fileobj = f + else: + log.debug("Opening file %s for writing" % path) + if os.path.exists(path): + # FIXME: correct behavior? + log.debug("File %s exists already, overwriting..." % ( + self.context.file_to_transfer)) + # FIXME: I think we should upload to a temp file and not overwrite + # the existing file until the file is successfully uploaded. + self.make_subdirs() + self.context.fileobj = open(path, "wb") + + # Options negotiation. + if sendoack: + log.debug("Sending OACK to client") + self.sendOACK() + else: + log.debug("No requested options, expecting transfer to begin...") + self.sendACK() + # Whether we're sending an oack or not, we're expecting a DAT for + # block 1 + self.context.next_block = 1 + # We may have sent an OACK, but we're expecting a DAT as the response + # to either the OACK or an ACK, so lets unconditionally use the + # TftpStateExpectDAT state. + return TftpStateExpectDAT(self.context) + + # Note, we don't have to check any other states in this method, that's + # up to the caller. + +class TftpStateServerStart(TftpState): + """The start state for the server. This is a transitory state since at + this point we don't know if we're handling an upload or a download. We + will commit to one of them once we interpret the initial packet.""" + def handle(self, pkt, raddress, rport): + """Handle a packet we just received.""" + log.debug("In TftpStateServerStart.handle") + if isinstance(pkt, TftpPacketRRQ): + log.debug("Handling an RRQ packet") + return TftpStateServerRecvRRQ(self.context).handle(pkt, + raddress, + rport) + elif isinstance(pkt, TftpPacketWRQ): + log.debug("Handling a WRQ packet") + return TftpStateServerRecvWRQ(self.context).handle(pkt, + raddress, + rport) + else: + self.sendError(TftpErrors.IllegalTftpOp) + raise TftpException("Invalid packet to begin up/download: %s" % pkt) + +class TftpStateExpectACK(TftpState): + """This class represents the state of the transfer when a DAT was just + sent, and we are waiting for an ACK from the server. This class is the + same one used by the client during the upload, and the server during the + download.""" + def handle(self, pkt, raddress, rport): + "Handle a packet, hopefully an ACK since we just sent a DAT." + if isinstance(pkt, TftpPacketACK): + log.debug("Received ACK for packet %d" % pkt.blocknumber) + # Is this an ack to the one we just sent? + if self.context.next_block == pkt.blocknumber: + if self.context.pending_complete: + log.info("Received ACK to final DAT, we're done.") + return None + else: + log.debug("Good ACK, sending next DAT") + self.context.next_block += 1 + log.debug("Incremented next_block to %d", + self.context.next_block) + self.context.pending_complete = self.sendDAT() + + elif pkt.blocknumber < self.context.next_block: + log.warning("Received duplicate ACK for block %d" + % pkt.blocknumber) + self.context.metrics.add_dup(pkt) + + else: + log.warning("Oooh, time warp. Received ACK to packet we " + "didn't send yet. Discarding.") + self.context.metrics.errors += 1 + return self + elif isinstance(pkt, TftpPacketERR): + log.error("Received ERR packet from peer: %s" % str(pkt)) + raise TftpException("Received ERR packet from peer: %s" % str(pkt)) + else: + log.warning("Discarding unsupported packet: %s" % str(pkt)) + return self + +class TftpStateExpectDAT(TftpState): + """Just sent an ACK packet. Waiting for DAT.""" + def handle(self, pkt, raddress, rport): + """Handle the packet in response to an ACK, which should be a DAT.""" + if isinstance(pkt, TftpPacketDAT): + return self.handleDat(pkt) + + # Every other packet type is a problem. + elif isinstance(pkt, TftpPacketACK): + # Umm, we ACK, you don't. + self.sendError(TftpErrors.IllegalTftpOp) + raise TftpException("Received ACK from peer when expecting DAT") + + elif isinstance(pkt, TftpPacketWRQ): + self.sendError(TftpErrors.IllegalTftpOp) + raise TftpException("Received WRQ from peer when expecting DAT") + + elif isinstance(pkt, TftpPacketERR): + self.sendError(TftpErrors.IllegalTftpOp) + raise TftpException("Received ERR from peer: " + str(pkt)) + + else: + self.sendError(TftpErrors.IllegalTftpOp) + raise TftpException("Received unknown packet type from peer: " + str(pkt)) + +class TftpStateSentWRQ(TftpState): + """Just sent an WRQ packet for an upload.""" + def handle(self, pkt, raddress, rport): + """Handle a packet we just received.""" + if not self.context.tidport: + self.context.tidport = rport + log.debug("Set remote port for session to %s", rport) + + # If we're going to successfully transfer the file, then we should see + # either an OACK for accepted options, or an ACK to ignore options. + if isinstance(pkt, TftpPacketOACK): + log.info("Received OACK from server") + try: + self.handleOACK(pkt) + except TftpException: + log.error("Failed to negotiate options") + self.sendError(TftpErrors.FailedNegotiation) + raise + else: + log.debug("Sending first DAT packet") + self.context.pending_complete = self.sendDAT() + log.debug("Changing state to TftpStateExpectACK") + return TftpStateExpectACK(self.context) + + elif isinstance(pkt, TftpPacketACK): + log.info("Received ACK from server") + log.debug("Apparently the server ignored our options") + # The block number should be zero. + if pkt.blocknumber == 0: + log.debug("Ack blocknumber is zero as expected") + log.debug("Sending first DAT packet") + self.context.pending_complete = self.sendDAT() + log.debug("Changing state to TftpStateExpectACK") + return TftpStateExpectACK(self.context) + else: + log.warning("Discarding ACK to block %s" % pkt.blocknumber) + log.debug("Still waiting for valid response from server") + return self + + elif isinstance(pkt, TftpPacketERR): + self.sendError(TftpErrors.IllegalTftpOp) + raise TftpException("Received ERR from server: %s" % pkt) + + elif isinstance(pkt, TftpPacketRRQ): + self.sendError(TftpErrors.IllegalTftpOp) + raise TftpException("Received RRQ from server while in upload") + + elif isinstance(pkt, TftpPacketDAT): + self.sendError(TftpErrors.IllegalTftpOp) + raise TftpException("Received DAT from server while in upload") + + else: + self.sendError(TftpErrors.IllegalTftpOp) + raise TftpException("Received unknown packet type from server: %s" % pkt) + + # By default, no state change. + return self + +class TftpStateSentRRQ(TftpState): + """Just sent an RRQ packet.""" + def handle(self, pkt, raddress, rport): + """Handle the packet in response to an RRQ to the server.""" + if not self.context.tidport: + self.context.tidport = rport + log.info("Set remote port for session to %s" % rport) + + # Now check the packet type and dispatch it properly. + if isinstance(pkt, TftpPacketOACK): + log.info("Received OACK from server") + try: + self.handleOACK(pkt) + except TftpException as err: + log.error("Failed to negotiate options: %s" % str(err)) + self.sendError(TftpErrors.FailedNegotiation) + raise + else: + log.debug("Sending ACK to OACK") + + self.sendACK(blocknumber=0) + + log.debug("Changing state to TftpStateExpectDAT") + return TftpStateExpectDAT(self.context) + + elif isinstance(pkt, TftpPacketDAT): + # If there are any options set, then the server didn't honour any + # of them. + log.info("Received DAT from server") + if self.context.options: + log.info("Server ignored options, falling back to defaults") + self.context.options = { 'blksize': DEF_BLKSIZE } + return self.handleDat(pkt) + + # Every other packet type is a problem. + elif isinstance(pkt, TftpPacketACK): + # Umm, we ACK, the server doesn't. + self.sendError(TftpErrors.IllegalTftpOp) + raise TftpException("Received ACK from server while in download") + + elif isinstance(pkt, TftpPacketWRQ): + self.sendError(TftpErrors.IllegalTftpOp) + raise TftpException("Received WRQ from server while in download") + + elif isinstance(pkt, TftpPacketERR): + self.sendError(TftpErrors.IllegalTftpOp) + log.debug("Received ERR packet: %s", pkt) + if pkt.errorcode == TftpErrors.FileNotFound: + raise TftpFileNotFoundError("File not found") + else: + raise TftpException("Received ERR from server: {}".format(pkt)) + + else: + self.sendError(TftpErrors.IllegalTftpOp) + raise TftpException("Received unknown packet type from server: %s" % pkt) + + # By default, no state change. + return self diff --git a/blcu-programming/tftp/__init__.py b/blcu-programming/tftp/__init__.py new file mode 100644 index 000000000..88a7f5d83 --- /dev/null +++ b/blcu-programming/tftp/__init__.py @@ -0,0 +1,13 @@ +# vim: ts=4 sw=4 et ai: +# -*- coding: utf8 -*- +""" +This library implements the tftp protocol, based on rfc 1350. +http://www.faqs.org/rfcs/rfc1350.html +At the moment it implements only a client class, but will include a server, +with support for variable block sizes. + +As a client of tftpy, this is the only module that you should need to import +directly. The TftpClient and TftpServer classes can be reached through it. +""" + + diff --git a/blcu-programming/tftp/compat.py b/blcu-programming/tftp/compat.py new file mode 100644 index 000000000..00493963c --- /dev/null +++ b/blcu-programming/tftp/compat.py @@ -0,0 +1,15 @@ +import sys + +def binary_stdin(): + """ + Get a file object for reading binary bytes from stdin instead of text. + Compatible with Py2/3, POSIX & win32. + Credits: https://stackoverflow.com/a/38939320/531179 (CC BY-SA 3.0) + """ + if hasattr(sys.stdin, 'buffer'): # Py3+ + return sys.stdin.buffer + else: + if sys.platform == 'win32': + import os, msvcrt + msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY) + return sys.stdin diff --git a/common-front/public/pod_simplified.glb b/common-front/public/pod_simplified.glb deleted file mode 100644 index 13522147e..000000000 Binary files a/common-front/public/pod_simplified.glb and /dev/null differ diff --git a/control-station/public/pod_simplified.glb b/control-station/public/pod_simplified.glb deleted file mode 100644 index 13522147e..000000000 Binary files a/control-station/public/pod_simplified.glb and /dev/null differ diff --git a/control-station/src/App.tsx b/control-station/src/App.tsx index 74615819d..ed837c7ac 100644 --- a/control-station/src/App.tsx +++ b/control-station/src/App.tsx @@ -11,6 +11,12 @@ import { ReactComponent as Batteries } from 'assets/svg/battery-filled.svg' import { SplashScreen, WsHandlerProvider, useLoadBackend } from 'common'; import { useEffect } from 'react'; +const FlashIcon = () => ( + + + +); + export const App = () => { const isProduction = import.meta.env.PROD; const loadBackend = useLoadBackend(isProduction); @@ -29,7 +35,8 @@ export const App = () => { { path: '/vehicle', icon: }, { path: '/booster', icon: }, { path: '/batteries', icon: }, - { path: '/cameras', icon: } + { path: '/cameras', icon: }, + { path: '/flash', icon: } ]} /> diff --git a/control-station/src/main.tsx b/control-station/src/main.tsx index 38e9fdcb3..26a076444 100644 --- a/control-station/src/main.tsx +++ b/control-station/src/main.tsx @@ -9,6 +9,7 @@ import { mainPageRoute } from "pages/VehiclePage/MainPage/mainPageRoute"; import { camerasRoute } from "pages/CamerasPage/camerasRoute"; import { batteriesRoute } from "pages/VehiclePage/BatteriesPage/batteriesRoute"; import { boosterRoute } from "pages/VehiclePage/BoosterPage/boosterRoute"; +import { flashRoute } from "pages/FlashPage/flashRoute"; import { ConfigProvider, GlobalTicker } from "common"; const router = createHashRouter([ @@ -21,6 +22,7 @@ const router = createHashRouter([ boosterRoute, batteriesRoute, camerasRoute, + flashRoute, ], }, ]); diff --git a/control-station/src/pages/FlashPage/FlashPage.tsx b/control-station/src/pages/FlashPage/FlashPage.tsx new file mode 100644 index 000000000..8e22cde2f --- /dev/null +++ b/control-station/src/pages/FlashPage/FlashPage.tsx @@ -0,0 +1,22 @@ +import { useEffect } from 'react'; + +export const FlashPage = () => { + useEffect(() => { + if ((window as any).electronAPI?.switchView) { + (window as any).electronAPI.switchView('flashing-view'); + } + }, []); + + return ( +
+

Opening flashing view...

+
+ ); +}; diff --git a/control-station/src/pages/FlashPage/flashRoute.tsx b/control-station/src/pages/FlashPage/flashRoute.tsx new file mode 100644 index 000000000..759b18ca5 --- /dev/null +++ b/control-station/src/pages/FlashPage/flashRoute.tsx @@ -0,0 +1,6 @@ +import { FlashPage } from "./FlashPage"; + +export const flashRoute = { + path: "/flash", + element: +}; diff --git a/electron-app/.gitignore b/electron-app/.gitignore index ce4204b7b..a931cbac6 100644 --- a/electron-app/.gitignore +++ b/electron-app/.gitignore @@ -7,6 +7,13 @@ dist-ssr build binaries renderer +!renderer/ +renderer/testing-view/ +renderer/flashing-view/ +renderer/competition-view/ +# include mode-selector in the build output +!renderer/mode-selector/ +!renderer/mode-selector/** out *.local diff --git a/electron-app/BUILD.md b/electron-app/BUILD.md index e001a1397..eac002bf7 100644 --- a/electron-app/BUILD.md +++ b/electron-app/BUILD.md @@ -1,18 +1,19 @@ # Hyperloop Control Station Build System -The project uses a unified, modular build script (`electron-app/build.mjs`) to handle building the backend (Go), and frontends (React/Vite) for the Electron application. +The project uses a unified, modular build script (`electron-app/build.mjs`) to handle building the backend (Go), the BLCU programming API (Python/PyInstaller), and frontends (React/Vite) for the Electron application. ## Prerequisites - **Node.js** & **pnpm** - **Go** (1.21+) +- **Python 3** (for building the BLCU programming API executable) ## Basic Usage Run the build script from the `electron-app` directory (or via npm scripts). ```sh -# Build EVERYTHING (Backend, Frontends) +# Build EVERYTHING (Backend, BLCU API, Frontends) pnpm build # OR @@ -31,8 +32,17 @@ You can build individual components by passing their flag. # Build only the Backend node build.mjs --backend +# Build only the BLCU programming API executable +node build.mjs --blcu-programming + # Build only the Testing View node build.mjs --testing-view + +# Build only the Competition View +node build.mjs --competition-view + +# Build only the Flashing View +node build.mjs --flashing-view ``` ## Platform Targeting @@ -43,10 +53,15 @@ By default, the script builds for all defined platforms (Windows, Linux, macOS). # Build backend for Windows only node build.mjs --backend --win +# Build BLCU API for the current Windows host +node build.mjs --blcu-programming --win + # Build everything for Linux node build.mjs --linux ``` +The BLCU programming API is packaged with PyInstaller and cannot be cross-compiled. Build it on the same OS as the Electron release target. + ## Advanced: Overwriting Commands The build script allows you to override configuration properties on the fly. This is useful for CI pipelines where you might want to use different build commands or flags. diff --git a/electron-app/README.md b/electron-app/README.md index d4e30bf0d..a2b9d108e 100644 --- a/electron-app/README.md +++ b/electron-app/README.md @@ -4,7 +4,7 @@ The main Electron application that provides the control interface for the Hyperl ## Overview -Desktop application built with Electron that manages the Hyperloop pod control system. Handles backend process management, configuration, and provides multiple frontend views for competition and testing. +Desktop application built with Electron that manages the Hyperloop pod control system. Handles backend process management, BLCU programming API process management, configuration, and provides multiple frontend views for competition and testing. ## Project Structure @@ -22,9 +22,9 @@ When running in development mode (unpackaged), the application creates temporary - `config.toml.backup-{timestamp}` - Automatic backup files created when importing a configuration. These timestamped backups help recover previous configurations if needed. -- `binaries/` - Directory containing compiled backend executables for your platform. These are generated during the build process, when running `pnpm run build`. +- `binaries/` - Directory containing compiled backend and BLCU programming executables for your platform. These are generated during the build process, when running `pnpm run build`. -- `renderer/` - Directory containing built frontend views (control-station, ethernet-view). These are generated during the build process, when running `pnpm run build`. +- `renderer/` - Directory containing built frontend views (testing-view, competition-view, flashing-view). These are generated during the build process, when running `pnpm run build`. All its content is ignored, except `mode-selector` - `dist/` - Build output directory containing compiled and packaged application files. Generated during build and distribution processes, when running `pnpm run dist`. @@ -56,7 +56,7 @@ Typical locations: # Install dependencies pnpm install -# Build backend and frontends +# Build backend, BLCU programming API, and frontends pnpm run build # Run in development mode (you MUST run `pnpm run build` BEFORE!) @@ -86,6 +86,9 @@ sudo ifconfig lo0 alias 127.0.0.9 up ``` - `pnpm run build` - Build all frontend views and backend +- `pnpm run build:testing` - Build only the Testing View (and copy to renderer/) +- `pnpm run build:competition` - Build only the Competition View (and copy to renderer/) +- `pnpm run build:flashing` - Build only the Flashing View (and copy to renderer/) - `pnpm start` - Run application in development mode - `pnpm run dist` - Build production executable - `pnpm test` - Run tests @@ -99,9 +102,11 @@ sudo ifconfig lo0 alias 127.0.0.9 up ## Architecture - **Backend Process**: Go backend for data processing -- **Packet Sender**: Tool for sending test packets +- **BLCU Programming Process**: Packaged FastAPI/TFTP API for firmware transfers - **Configuration**: TOML-based config management -- **Views**: Multiple frontend interfaces (Competition/Testing) +- **Views**: Multiple frontend interfaces (Competition, Testing & Flashing) + +- **Mode Selector**: html5 file to chose the mode of the app: testing, competition or flashing. Placed at `renderer/mode-selector` ## Dependencies diff --git a/electron-app/build.mjs b/electron-app/build.mjs index a15f0a4c5..eca478f46 100644 --- a/electron-app/build.mjs +++ b/electron-app/build.mjs @@ -53,43 +53,15 @@ const CONFIG = { }, ], }, - // "packet-sender": { - // type: "go", - // path: join(ROOT, "packet-sender"), - // output: join(__dirname, "binaries"), - // entry: ".", - // commands: ["pnpm run build:ci"], - // platforms: [ - // { - // id: "win64", - // goos: "windows", - // goarch: "amd64", - // ext: ".exe", - // tags: ["win", "windows"], - // }, - // { - // id: "linux64", - // goos: "linux", - // goarch: "amd64", - // ext: "", - // tags: ["linux"], - // }, - // { - // id: "mac64", - // goos: "darwin", - // goarch: "amd64", - // ext: "", - // tags: ["mac", "macos"], - // }, - // { - // id: "macArm", - // goos: "darwin", - // goarch: "arm64", - // ext: "", - // tags: ["mac", "macos"], - // }, - // ], - // }, + "blcu-programming": { + type: "python", + path: join(ROOT, "blcu-programming"), + output: join(__dirname, "binaries"), + entry: join(ROOT, "blcu-programming", "api", "main.py"), + requirements: join(ROOT, "blcu-programming", "requirements-build.txt"), + venv: join(ROOT, "blcu-programming", ".venv-build"), + addData: [{ src: "BLCU-config.json", dest: "." }], + }, "testing-view": { type: "frontend", path: join(ROOT, "frontend/testing-view"), @@ -109,6 +81,15 @@ const CONFIG = { ], optional: true, }, + "flashing-view": { + type: "frontend", + path: join(ROOT, "frontend/flashing-view"), + dest: join(__dirname, "renderer/flashing-view"), + commands: [ + "pnpm --filter flashing-view install --frozen-lockfile", + "pnpm run build", + ], + }, }; // --- Helpers --- @@ -164,6 +145,120 @@ const buildGo = (name, config, requestedPlatforms, extraArgs = "") => { return success; }; +const getVenvPython = (venvPath) => { + const binDir = process.platform === "win32" ? "Scripts" : "bin"; + const executable = process.platform === "win32" ? "python.exe" : "python"; + return join(venvPath, binDir, executable); +}; + +const createPythonVenv = (venvPath, cwd) => { + if (existsSync(getVenvPython(venvPath))) return true; + + const python = process.env.PYTHON || "python"; + + logger.step(`Creating Python build venv with ${python}...`); + return run(`${python} -m venv "${venvPath}"`, cwd); +}; + +const getPythonTarget = () => { + const goos = + { win32: "windows", darwin: "darwin", linux: "linux" }[process.platform] || + process.platform; + const goarch = { x64: "amd64", arm64: "arm64" }[process.arch] || process.arch; + const platformTag = + { win32: "win", darwin: "mac", linux: "linux" }[process.platform] || + process.platform; + + return { + binarySuffix: `${goos}-${goarch}${process.platform === "win32" ? ".exe" : ""}`, + label: `${goos}/${goarch}`, + platformTag, + }; +}; + +const buildPython = (name, config, requestedPlatforms) => { + const target = getPythonTarget(); + const targetRequested = + requestedPlatforms.length === 0 || + requestedPlatforms.includes("all") || + requestedPlatforms.includes(target.platformTag); + + if (!targetRequested) { + logger.error( + `${name} must be built on the target OS because PyInstaller cannot cross-compile. Current host is ${target.label}.`, + ); + return false; + } + + logger.info(`Building ${name} (Python/PyInstaller)...`); + mkdirSync(config.output, { recursive: true }); + + if (!createPythonVenv(config.venv, config.path)) return false; + + const pythonBin = getVenvPython(config.venv); + + if ( + !run( + `"${pythonBin}" -m pip install -r "${config.requirements}"`, + config.path, + ) + ) { + return false; + } + + const binaryName = `${name}-${target.binarySuffix}`; + const binaryBaseName = binaryName.replace(/\.exe$/, ""); + const binaryPath = join(config.output, binaryName); + const pyinstallerWorkPath = join(config.path, "build", "pyinstaller"); + const pyinstallerSpecPath = join(config.path, "build"); + + if (existsSync(binaryPath)) { + try { + rmSync(binaryPath, { force: true }); + } catch (error) { + if (error.code === "EPERM" || error.code === "EACCES") { + logger.error( + `Could not replace ${binaryPath}. Stop Electron or the running BLCU programming process, then build again.`, + ); + return false; + } + + throw error; + } + } + + const pathSep = process.platform === "win32" ? ";" : ":"; + const addDataFlags = (config.addData || []) + .map(({ src, dest }) => { + const absSrc = join(config.path, src); + return `--add-data "${absSrc}${pathSep}${dest}"`; + }) + .join(" "); + + return run( + [ + `"${pythonBin}" -m PyInstaller`, + "--clean", + "--noconfirm", + "--onefile", + `--name "${binaryBaseName}"`, + `--distpath "${config.output}"`, + `--workpath "${pyinstallerWorkPath}"`, + `--specpath "${pyinstallerSpecPath}"`, + "--hidden-import uvicorn.loops.auto", + "--hidden-import uvicorn.protocols.http.auto", + "--hidden-import uvicorn.protocols.websockets.auto", + "--hidden-import uvicorn.lifespan.on", + "--hidden-import multipart", + "--hidden-import multipart.multiparser", + `--paths "${config.path}"`, + addDataFlags, + `"${config.entry}"`, + ].filter(Boolean).join(" "), + config.path, + ); +}; + const buildFrontend = (name, config, extraArgs = "") => { if (config.optional && !existsSync(join(config.path, "package.json"))) { logger.warning(`Skipping ${name} (not initialized)`); @@ -249,6 +344,8 @@ logger.header("Hyperloop Control Station Build"); if (config.type === "go") { success = buildGo(key, config, requestedPlatforms, extraArgs); + } else if (config.type === "python") { + success = buildPython(key, config, requestedPlatforms); } else if (config.type === "frontend") { success = buildFrontend(key, config, extraArgs); if (success && !config.optional) frontendBuilt = true; diff --git a/electron-app/main.js b/electron-app/main.js index 39ff4fb6f..6ce31fd17 100644 --- a/electron-app/main.js +++ b/electron-app/main.js @@ -1,114 +1,91 @@ /** * @module main * @description Main entry point for the Electron application. - * Handles application lifecycle, initialization, and cleanup of processes and windows. + * + * Orchestrates application lifecycle and initialization through modular components: + * - initialization: Config, IPC, and process cleanup + * - modeSelector: Mode selection UI and main window creation + * - updater: Auto-update functionality + * - lifecycle: App lifecycle event handling */ -import { app, BrowserWindow, dialog, screen } from "electron"; -import pkg from "electron-updater"; -import { getConfigManager } from "./src/config/configInstance.js"; -import { setupIpcHandlers } from "./src/ipc/handlers.js"; -import { startBackend, stopBackend } from "./src/processes/backend.js"; -import { stopPacketSender } from "./src/processes/packetSender.js"; +import { app, BrowserWindow, screen } from "electron"; +import { + handleSelectorFallback, + initializeApp, + setTransitionMode, + setupLifecycleHandlers, + setupUpdater, + showModeSelector, +} from "./src/app/index.js"; +import { stopBackend } from "./src/processes/backend.js"; +import { stopBlcuProgramming } from "./src/processes/blcuProgramming.js"; import { logger } from "./src/utils/logger.js"; -import { createLogWindow } from "./src/windows/logWindow.js"; -import { createWindow } from "./src/windows/mainWindow.js"; -const { autoUpdater } = pkg; - -// Setup IPC handlers for renderer process communication -setupIpcHandlers(); - -// App lifecycle: wait for Electron to be ready +/** + * Initializes the application when Electron is ready. + * Orchestrates startup sequence: + * 1. Initialize config and IPC + * 2. Show mode selector + * 3. Setup auto-updater + * 4. Setup lifecycle handlers + */ app.whenReady().then(async () => { - // Get the screen width and height - // Only can be used inside app.whenReady() - const { width: screenWidth, height: screenHeight } = - screen.getPrimaryDisplay().workAreaSize; - - // Initialize ConfigManager and ensure config exists BEFORE starting backend - logger.electron.header("Initializing configuration..."); - // Get ConfigManager instance (creates config from template if needed) - await getConfigManager(); - logger.electron.header("Configuration ready"); - - const logWindow = createLogWindow(screenWidth, screenHeight); - - // Start backend process try { - await startBackend(logWindow); - logger.electron.header("Backend process spawned"); - } catch (error) { - // Start backend already shows these errors - } - - // Create main application window - const mainWindow = createWindow(screenWidth, screenHeight); - mainWindow.maximize(); - - logger.electron.header("Main application window created"); - - // Updater setup - if (!app.isPackaged) { - autoUpdater.forceDevUpdateConfig = true; - } - - autoUpdater.logger = { - info: (message) => logger.electron.info(message), - error: (message) => logger.electron.error(message), - warn: (message) => logger.electron.warning(message), - debug: (message) => logger.electron.debug(message), - }; - - // Check for updates - autoUpdater.checkForUpdates(); - - // Handle update downloaded event - autoUpdater.on("update-downloaded", (info) => { - dialog - .showMessageBox({ - type: "info", - title: "Update Ready", - message: `Version ${info.version} has been downloaded. Restart now to install?`, - buttons: ["Restart", "Later"], - }) - .then((result) => { - if (result.response === 0) { - autoUpdater.quitAndInstall(); - } - }); - }); - - // Handle macOS app activation (reopen window when dock icon clicked) - app.on("activate", () => { - // Only create window if no windows exist - if (BrowserWindow.getAllWindows().length === 0) { - createWindow(); + // Initialize configuration, IPC, and cleanup + await initializeApp(); + + // Get screen dimensions for window creation + const { width: screenWidth, height: screenHeight } = screen.getPrimaryDisplay().workAreaSize; + + // Register return-to-selector handler before starting the app. + app.on("return-to-selector", async () => { + try { + // Set transition mode to prevent window-all-closed from quitting + setTransitionMode(true); + + logger.electron.info("Returning to selector mode..."); + await Promise.all([stopBackend(), stopBlcuProgramming()]); + + // Give ports time to be released (increased to 3s for TCP TIME_WAIT state) + await new Promise((resolve) => setTimeout(resolve, 3000)); + + const existingWindows = BrowserWindow.getAllWindows().filter((window) => !window.isDestroyed()); + existingWindows.forEach((window) => window.hide()); + + const { width: selectorWidth, height: selectorHeight } = screen.getPrimaryDisplay().workAreaSize; + await showModeSelector(selectorWidth, selectorHeight); + + existingWindows.forEach((window) => { + if (!window.isDestroyed()) { + window.removeAllListeners("close"); + window.close(); + } + }); + + // Exit transition mode once selector is shown + setTransitionMode(false); + } catch (error) { + logger.electron.error("Failed to return to selector:", error); + setTransitionMode(false); + } + }); + + // Show mode selector and get user choice + try { + await showModeSelector(screenWidth, screenHeight); + } catch (error) { + logger.electron.error("Mode selector failed:", error); + await handleSelectorFallback(screenWidth, screenHeight); } - }); -}); -// Handle window close behavior -app.on("window-all-closed", () => { - // On macOS, keep app running even when all windows are closed - if (process.platform !== "darwin") { - // Quit app on other platforms when all windows are closed + // Setup auto-updater + setupUpdater(); + + // Setup application lifecycle handlers (window-all-closed, before-quit, activate, exceptions) + setupLifecycleHandlers(); + } catch (error) { + logger.electron.error("Failed to initialize application:", error); app.quit(); } }); - -// Cleanup before app quits -app.on("before-quit", (e) => { - e.preventDefault(); - Promise.all([stopBackend(), stopPacketSender()]) - .catch((error) => logger.electron.error("Error during shutdown:", error)) - .finally(() => app.exit()); -}); - -// Handle uncaught exceptions globally -process.on("uncaughtException", (error) => { - // Log error to console - logger.electron.error("Uncaught exception:", error); - // Show error dialog to user - dialog.showErrorBox("Error", error.message); -}); diff --git a/electron-app/package-lock.json b/electron-app/package-lock.json index c20f3f945..3439627e2 100644 --- a/electron-app/package-lock.json +++ b/electron-app/package-lock.json @@ -10,14 +10,17 @@ "license": "MIT", "dependencies": { "@iarna/toml": "^2.2.5", - "electron-store": "^8.1.0" + "ansi-to-html": "^0.7.2", + "electron-store": "^11.0.2", + "electron-updater": "^6.7.3", + "picocolors": "^1.1.1" }, "devDependencies": { - "@vitest/coverage-v8": "^4.0.14", + "@vitest/coverage-v8": "^4.0.18", "asar": "^3.2.0", - "electron": "^28.0.0", - "electron-builder": "^24.9.1", - "vitest": "^4.0.14" + "electron": "^40.1.0", + "electron-builder": "^26.7.0", + "vitest": "^4.0.18" } }, "node_modules/@babel/helper-string-parser": { @@ -41,13 +44,13 @@ } }, "node_modules/@babel/parser": { - "version": "7.28.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.28.5.tgz", - "integrity": "sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==", + "version": "7.29.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.3.tgz", + "integrity": "sha512-b3ctpQwp+PROvU/cttc4OYl4MzfJUWy6FZg+PMXfzmt/+39iHVF0sDfqay8TQM3JA2EUOyKcFZt75jWriQijsA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.28.5" + "@babel/types": "^7.29.0" }, "bin": { "parser": "bin/babel-parser.js" @@ -57,9 +60,9 @@ } }, "node_modules/@babel/types": { - "version": "7.28.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.28.5.tgz", - "integrity": "sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==", + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz", + "integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==", "dev": true, "license": "MIT", "dependencies": { @@ -85,6 +88,7 @@ "resolved": "https://registry.npmjs.org/@develar/schema-utils/-/schema-utils-2.6.5.tgz", "integrity": "sha512-0cp4PsWQ/9avqTVMCtZ+GirikIA36ikvjtHweU4/j8yLtgObI0+JUPhYFScgwlteveGB1rt3Cm8UhN04XayDig==", "dev": true, + "license": "MIT", "dependencies": { "ajv": "^6.12.0", "ajv-keywords": "^3.4.1" @@ -102,6 +106,7 @@ "resolved": "https://registry.npmjs.org/@electron/asar/-/asar-3.4.1.tgz", "integrity": "sha512-i4/rNPRS84t0vSRa2HorerGRXWyF4vThfHesw0dmcWHp+cspK743UanA0suA5Q5y8kzY2y6YKrvbIUn69BCAiA==", "dev": true, + "license": "MIT", "dependencies": { "commander": "^5.0.0", "glob": "^7.1.6", @@ -115,20 +120,22 @@ } }, "node_modules/@electron/asar/node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.14.tgz", + "integrity": "sha512-MWPGfDxnyzKU7rNOW9SP/c50vi3xrmrua/+6hfPbCS2ABNWfx24vPidzvC7krjU/RTo235sV776ymlsMtGKj8g==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "node_modules/@electron/asar/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -136,6 +143,60 @@ "node": "*" } }, + "node_modules/@electron/fuses": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@electron/fuses/-/fuses-1.8.0.tgz", + "integrity": "sha512-zx0EIq78WlY/lBb1uXlziZmDZI4ubcCXIMJ4uGjXzZW0nS19TjSPeXPAjzzTmKQlJUZm0SbmZhPKP7tuQ1SsEw==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.1", + "fs-extra": "^9.0.1", + "minimist": "^1.2.5" + }, + "bin": { + "electron-fuses": "dist/bin.js" + } + }, + "node_modules/@electron/fuses/node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@electron/fuses/node_modules/jsonfile": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.1.tgz", + "integrity": "sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/@electron/fuses/node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, "node_modules/@electron/get": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@electron/get/-/get-2.0.3.tgz", @@ -158,10 +219,11 @@ } }, "node_modules/@electron/notarize": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@electron/notarize/-/notarize-2.2.1.tgz", - "integrity": "sha512-aL+bFMIkpR0cmmj5Zgy0LMKEpgy43/hw5zadEArgmAMWWlKc5buwFvFT9G/o/YJkvXAJm5q3iuTuLaiaXW39sg==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@electron/notarize/-/notarize-2.5.0.tgz", + "integrity": "sha512-jNT8nwH1f9X5GEITXaQ8IF/KdskvIkOFfB2CvwumsveVidzpSc+mvhhTMdAGSYF3O+Nq49lJ7y+ssODRXu06+A==", "dev": true, + "license": "MIT", "dependencies": { "debug": "^4.1.1", "fs-extra": "^9.0.1", @@ -176,6 +238,7 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", "dev": true, + "license": "MIT", "dependencies": { "at-least-node": "^1.0.0", "graceful-fs": "^4.2.0", @@ -187,10 +250,11 @@ } }, "node_modules/@electron/notarize/node_modules/jsonfile": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", - "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.1.tgz", + "integrity": "sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==", "dev": true, + "license": "MIT", "dependencies": { "universalify": "^2.0.0" }, @@ -203,15 +267,17 @@ "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "dev": true, + "license": "MIT", "engines": { "node": ">= 10.0.0" } }, "node_modules/@electron/osx-sign": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@electron/osx-sign/-/osx-sign-1.0.5.tgz", - "integrity": "sha512-k9ZzUQtamSoweGQDV2jILiRIHUu7lYlJ3c6IEmjv1hC17rclE+eb9U+f6UFlOOETo0JzY1HNlXy4YOlCvl+Lww==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@electron/osx-sign/-/osx-sign-1.3.3.tgz", + "integrity": "sha512-KZ8mhXvWv2rIEgMbWZ4y33bDHyUKMXnx4M0sTyPNK/vcB81ImdeY9Ggdqy0SWbMDgmbqyQ+phgejh6V3R2QuSg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "compare-version": "^0.1.2", "debug": "^4.3.4", @@ -233,6 +299,7 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", "dev": true, + "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -247,6 +314,7 @@ "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.10.tgz", "integrity": "sha512-iHrqe5shvBUcFbmZq9zOQHBoeOhZJu6RQGrDpBgenUm/Am+F3JM2MgQj+rK3Z601fzrL5gLZWtAPH2OBaSVcyw==", "dev": true, + "license": "MIT", "engines": { "node": ">= 8.0.0" }, @@ -255,10 +323,11 @@ } }, "node_modules/@electron/osx-sign/node_modules/jsonfile": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", - "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.1.tgz", + "integrity": "sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==", "dev": true, + "license": "MIT", "dependencies": { "universalify": "^2.0.0" }, @@ -271,58 +340,82 @@ "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "dev": true, + "license": "MIT", "engines": { "node": ">= 10.0.0" } }, + "node_modules/@electron/rebuild": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@electron/rebuild/-/rebuild-4.0.4.tgz", + "integrity": "sha512-Rzc39XPdk/+/wBG8MfwAHohXflep0ITUfulb6Rgz3R0NeSB1noE+E9/M/cb8ftCAiyDD9PPhLuuWgE1GaInbKg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@malept/cross-spawn-promise": "^2.0.0", + "debug": "^4.1.1", + "node-abi": "^4.2.0", + "node-api-version": "^0.2.1", + "node-gyp": "^12.2.0", + "read-binary-file-arch": "^1.0.6" + }, + "bin": { + "electron-rebuild": "lib/cli.js" + }, + "engines": { + "node": ">=22.12.0" + } + }, "node_modules/@electron/universal": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/@electron/universal/-/universal-1.5.1.tgz", - "integrity": "sha512-kbgXxyEauPJiQQUNG2VgUeyfQNFk6hBF11ISN2PNI6agUgPl55pv4eQmaqHzTAzchBvqZ2tQuRVaPStGf0mxGw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@electron/universal/-/universal-2.0.3.tgz", + "integrity": "sha512-Wn9sPYIVFRFl5HmwMJkARCCf7rqK/EurkfQ/rJZ14mHP3iYTjZSIOSVonEAnhWeAXwtw7zOekGRlc6yTtZ0t+g==", "dev": true, + "license": "MIT", "dependencies": { - "@electron/asar": "^3.2.1", - "@malept/cross-spawn-promise": "^1.1.0", + "@electron/asar": "^3.3.1", + "@malept/cross-spawn-promise": "^2.0.0", "debug": "^4.3.1", - "dir-compare": "^3.0.0", - "fs-extra": "^9.0.1", - "minimatch": "^3.0.4", - "plist": "^3.0.4" + "dir-compare": "^4.2.0", + "fs-extra": "^11.1.1", + "minimatch": "^9.0.3", + "plist": "^3.1.0" }, "engines": { - "node": ">=8.6" + "node": ">=16.4" } }, "node_modules/@electron/universal/node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.0.tgz", + "integrity": "sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w==", "dev": true, + "license": "MIT", "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "balanced-match": "^1.0.0" } }, "node_modules/@electron/universal/node_modules/fs-extra": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", - "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "version": "11.3.5", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.5.tgz", + "integrity": "sha512-eKpRKAovdpZtR1WopLHxlBWvAgPny3c4gX1G5Jhwmmw4XJj0ifSD5qB5TOo8hmA0wlRKDAOAhEE1yVPgs6Fgcg==", "dev": true, + "license": "MIT", "dependencies": { - "at-least-node": "^1.0.0", "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" }, "engines": { - "node": ">=10" + "node": ">=14.14" } }, "node_modules/@electron/universal/node_modules/jsonfile": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", - "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.1.tgz", + "integrity": "sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==", "dev": true, + "license": "MIT", "dependencies": { "universalify": "^2.0.0" }, @@ -331,568 +424,148 @@ } }, "node_modules/@electron/universal/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", + "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", "dev": true, + "license": "ISC", "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.2" }, "engines": { - "node": "*" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/@electron/universal/node_modules/universalify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", - "dev": true, - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/@esbuild/aix-ppc64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz", - "integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.12.tgz", - "integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz", - "integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.12.tgz", - "integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz", - "integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz", - "integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz", - "integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz", - "integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz", - "integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz", - "integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz", - "integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz", - "integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz", - "integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==", - "cpu": [ - "mips64el" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz", - "integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz", - "integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz", - "integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz", - "integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz", - "integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz", - "integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz", - "integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz", - "integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openharmony-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz", - "integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openharmony" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz", - "integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz", - "integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "license": "MIT", "engines": { - "node": ">=18" + "node": ">= 10.0.0" } }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz", - "integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==", - "cpu": [ - "ia32" - ], + "node_modules/@electron/windows-sign": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@electron/windows-sign/-/windows-sign-1.2.2.tgz", + "integrity": "sha512-dfZeox66AvdPtb2lD8OsIIQh12Tp0GNCRUDfBHIKGpbmopZto2/A8nSpYYLoedPIHpqkeblZ/k8OV0Gy7PYuyQ==", "dev": true, - "license": "MIT", + "license": "BSD-2-Clause", "optional": true, - "os": [ - "win32" - ], + "peer": true, + "dependencies": { + "cross-dirname": "^0.1.0", + "debug": "^4.3.4", + "fs-extra": "^11.1.1", + "minimist": "^1.2.8", + "postject": "^1.0.0-alpha.6" + }, + "bin": { + "electron-windows-sign": "bin/electron-windows-sign.js" + }, "engines": { - "node": ">=18" + "node": ">=14.14" } }, - "node_modules/@esbuild/win32-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz", - "integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==", - "cpu": [ - "x64" - ], + "node_modules/@electron/windows-sign/node_modules/fs-extra": { + "version": "11.3.5", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.5.tgz", + "integrity": "sha512-eKpRKAovdpZtR1WopLHxlBWvAgPny3c4gX1G5Jhwmmw4XJj0ifSD5qB5TOo8hmA0wlRKDAOAhEE1yVPgs6Fgcg==", "dev": true, "license": "MIT", "optional": true, - "os": [ - "win32" - ], + "peer": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, "engines": { - "node": ">=18" + "node": ">=14.14" } }, - "node_modules/@iarna/toml": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/@iarna/toml/-/toml-2.2.5.tgz", - "integrity": "sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==", - "license": "ISC" - }, - "node_modules/@isaacs/cliui": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", - "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "node_modules/@electron/windows-sign/node_modules/jsonfile": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.1.tgz", + "integrity": "sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==", "dev": true, + "license": "MIT", + "optional": true, + "peer": true, "dependencies": { - "string-width": "^5.1.2", - "string-width-cjs": "npm:string-width@^4.2.0", - "strip-ansi": "^7.0.1", - "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", - "wrap-ansi": "^8.1.0", - "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + "universalify": "^2.0.0" }, - "engines": { - "node": ">=12" + "optionalDependencies": { + "graceful-fs": "^4.1.6" } }, - "node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", - "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "node_modules/@electron/windows-sign/node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "dev": true, + "license": "MIT", + "optional": true, + "peer": true, "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" + "node": ">= 10.0.0" } }, - "node_modules/@isaacs/cliui/node_modules/ansi-styles": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", - "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "node_modules/@emnapi/core": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.10.0.tgz", + "integrity": "sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw==", "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/wasi-threads": "1.2.1", + "tslib": "^2.4.0" } }, - "node_modules/@isaacs/cliui/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true - }, - "node_modules/@isaacs/cliui/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "node_modules/@emnapi/runtime": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.10.0.tgz", + "integrity": "sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==", "dev": true, + "license": "MIT", + "optional": true, "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "tslib": "^2.4.0" } }, - "node_modules/@isaacs/cliui/node_modules/strip-ansi": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", - "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "node_modules/@emnapi/wasi-threads": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz", + "integrity": "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==", "dev": true, + "license": "MIT", + "optional": true, "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" + "tslib": "^2.4.0" } }, - "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "node_modules/@iarna/toml": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/@iarna/toml/-/toml-2.2.5.tgz", + "integrity": "sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==", + "license": "ISC" + }, + "node_modules/@isaacs/fs-minipass": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz", + "integrity": "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==", "dev": true, + "license": "ISC", "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" + "minipass": "^7.0.4" }, "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + "node": ">=18.0.0" } }, "node_modules/@jridgewell/resolve-uri": { @@ -924,9 +597,9 @@ } }, "node_modules/@malept/cross-spawn-promise": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@malept/cross-spawn-promise/-/cross-spawn-promise-1.1.1.tgz", - "integrity": "sha512-RTBGWL5FWQcg9orDOCcp4LvItNzUPcyEU9bwaeJX0rJ1IQxzucC48Y0/sQLp/g6t99IQgAlGIaesJS+gTn7tVQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@malept/cross-spawn-promise/-/cross-spawn-promise-2.0.0.tgz", + "integrity": "sha512-1DpKU0Z5ThltBwjNySMC14g0CkbyhCaz9FkhxqNsZI6uAPJXFS8cMXlBKo26FJ8ZuW6S9GCMcR9IO5k2X5/9Fg==", "dev": true, "funding": [ { @@ -938,11 +611,12 @@ "url": "https://tidelift.com/subscription/pkg/npm-.malept-cross-spawn-promise?utm_medium=referral&utm_source=npm_fund" } ], + "license": "Apache-2.0", "dependencies": { "cross-spawn": "^7.0.1" }, "engines": { - "node": ">= 10" + "node": ">= 12.13.0" } }, "node_modules/@malept/flatpak-bundler": { @@ -950,6 +624,7 @@ "resolved": "https://registry.npmjs.org/@malept/flatpak-bundler/-/flatpak-bundler-0.4.0.tgz", "integrity": "sha512-9QOtNffcOF/c1seMCDnjckb3R9WHcG34tky+FHpNKKCW0wc/scYLwMtO+ptyGUfMW0/b/n4qRiALlaFHc9Oj7Q==", "dev": true, + "license": "MIT", "dependencies": { "debug": "^4.1.1", "fs-extra": "^9.0.0", @@ -965,6 +640,7 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", "dev": true, + "license": "MIT", "dependencies": { "at-least-node": "^1.0.0", "graceful-fs": "^4.2.0", @@ -976,10 +652,11 @@ } }, "node_modules/@malept/flatpak-bundler/node_modules/jsonfile": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", - "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.1.tgz", + "integrity": "sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==", "dev": true, + "license": "MIT", "dependencies": { "universalify": "^2.0.0" }, @@ -992,38 +669,44 @@ "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "dev": true, + "license": "MIT", "engines": { "node": ">= 10.0.0" } }, - "node_modules/@pkgjs/parseargs": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", - "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "node_modules/@napi-rs/wasm-runtime": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.4.tgz", + "integrity": "sha512-3NQNNgA1YSlJb/kMH1ildASP9HW7/7kYnRI2szWJaofaS1hWmbGI4H+d3+22aGzXXN9IJ+n+GiFVcGipJP18ow==", "dev": true, + "license": "MIT", "optional": true, - "engines": { - "node": ">=14" + "dependencies": { + "@tybys/wasm-util": "^0.10.1" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "peerDependencies": { + "@emnapi/core": "^1.7.1", + "@emnapi/runtime": "^1.7.1" } }, - "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.53.3.tgz", - "integrity": "sha512-mRSi+4cBjrRLoaal2PnqH82Wqyb+d3HsPUN/W+WslCXsZsyHa9ZeQQX/pQsZaVIWDkPcpV6jJ+3KLbTbgnwv8w==", - "cpu": [ - "arm" - ], + "node_modules/@oxc-project/types": { + "version": "0.128.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.128.0.tgz", + "integrity": "sha512-huv1Y/LzBJkBVHt3OlC7u0zHBW9qXf1FdD7sGmc1rXc2P1mTwHssYv7jyGx5KAACSCH+9B3Bhn6Z9luHRvf7pQ==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "android" - ] + "funding": { + "url": "https://github.com/sponsors/Boshen" + } }, - "node_modules/@rollup/rollup-android-arm64": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.53.3.tgz", - "integrity": "sha512-CbDGaMpdE9sh7sCmTrTUyllhrg65t6SwhjlMJsLr+J8YjFuPmCEjbBSx4Z/e4SmDyH3aB5hGaJUP2ltV/vcs4w==", + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.0.0-rc.18", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.0.0-rc.18.tgz", + "integrity": "sha512-lIDyUAfD7U3+BWKzdxMbJcsYHuqXqmGz40aeRqvuAm3y5TkJSYTBW2RDrn65DJFPQqVjUAUqq5uz8urzQ8aBdQ==", "cpu": [ "arm64" ], @@ -1032,12 +715,15 @@ "optional": true, "os": [ "android" - ] + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.53.3.tgz", - "integrity": "sha512-Nr7SlQeqIBpOV6BHHGZgYBuSdanCXuw09hon14MGOLGmXAFYjx1wNvquVPmpZnl0tLjg25dEdr4IQ6GgyToCUA==", + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.0.0-rc.18", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.0.0-rc.18.tgz", + "integrity": "sha512-apJq2ktnGp27nSInMR5Vcj8kY6xJzDAvfdIFlpDcAK/w4cDO58qVoi1YQsES/SKiFNge/6e4CUzgjfHduYqWpQ==", "cpu": [ "arm64" ], @@ -1046,12 +732,15 @@ "optional": true, "os": [ "darwin" - ] + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.53.3.tgz", - "integrity": "sha512-DZ8N4CSNfl965CmPktJ8oBnfYr3F8dTTNBQkRlffnUarJ2ohudQD17sZBa097J8xhQ26AwhHJ5mvUyQW8ddTsQ==", + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.0.0-rc.18", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.0.0-rc.18.tgz", + "integrity": "sha512-5Ofot8xbs+pxRHJqm9/9N/4sTQOvdrwEsmPE9pdLEEoAbdZtG6F2LMDfO1sp6ZAtXJuJV/21ew2srq3W8NXB5g==", "cpu": [ "x64" ], @@ -1060,26 +749,15 @@ "optional": true, "os": [ "darwin" - ] - }, - "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.53.3.tgz", - "integrity": "sha512-yMTrCrK92aGyi7GuDNtGn2sNW+Gdb4vErx4t3Gv/Tr+1zRb8ax4z8GWVRfr3Jw8zJWvpGHNpss3vVlbF58DZ4w==", - "cpu": [ - "arm64" ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ] + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.53.3.tgz", - "integrity": "sha512-lMfF8X7QhdQzseM6XaX0vbno2m3hlyZFhwcndRMw8fbAGUGL3WFMBdK0hbUBIUYcEcMhVLr1SIamDeuLBnXS+Q==", + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.0.0-rc.18", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.0.0-rc.18.tgz", + "integrity": "sha512-7h8eeOTT1eyqJyx64BFCnWZpNm486hGWt2sqeLLgDxA0xI1oGZ9H7gK1S85uNGmBhkdPwa/6reTxfFFKvIsebw==", "cpu": [ "x64" ], @@ -1088,26 +766,15 @@ "optional": true, "os": [ "freebsd" - ] - }, - "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.53.3.tgz", - "integrity": "sha512-k9oD15soC/Ln6d2Wv/JOFPzZXIAIFLp6B+i14KhxAfnq76ajt0EhYc5YPeX6W1xJkAdItcVT+JhKl1QZh44/qw==", - "cpu": [ - "arm" ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.53.3.tgz", - "integrity": "sha512-vTNlKq+N6CK/8UktsrFuc+/7NlEYVxgaEgRXVUVK258Z5ymho29skzW1sutgYjqNnquGwVUObAaxae8rZ6YMhg==", + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.0.0-rc.18", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.0.0-rc.18.tgz", + "integrity": "sha512-eRcm/HVt9U/JFu5RKAEKwGQYtDCKWLiaH6wOnsSEp6NMBb/3Os8LgHZlNyzMpFVNmiiMFlfb2zEnebfzJrHFmg==", "cpu": [ "arm" ], @@ -1116,138 +783,135 @@ "optional": true, "os": [ "linux" - ] + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.53.3.tgz", - "integrity": "sha512-RGrFLWgMhSxRs/EWJMIFM1O5Mzuz3Xy3/mnxJp/5cVhZ2XoCAxJnmNsEyeMJtpK+wu0FJFWz+QF4mjCA7AUQ3w==", + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.0.0-rc.18", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.0.0-rc.18.tgz", + "integrity": "sha512-SOrT/cT4ukTmgnrEz/Hg3m7LBnuCLW9psDeMKrimRWY4I8DmnO7Lco8W2vtqPmMkbVu8iJ+g4GFLVLLOVjJ9DQ==", "cpu": [ "arm64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ "linux" - ] + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.53.3.tgz", - "integrity": "sha512-kASyvfBEWYPEwe0Qv4nfu6pNkITLTb32p4yTgzFCocHnJLAHs+9LjUu9ONIhvfT/5lv4YS5muBHyuV84epBo/A==", + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.0.0-rc.18", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.0.0-rc.18.tgz", + "integrity": "sha512-QWjdxN1HJCpBTAcZ5N5F7wju3gVPzRzSpmGzx7na0c/1qpN9CFil+xt+l9lV/1M6/gqHSNXCiqPfwhVJPeLnug==", "cpu": [ "arm64" ], "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-loong64-gnu": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.53.3.tgz", - "integrity": "sha512-JiuKcp2teLJwQ7vkJ95EwESWkNRFJD7TQgYmCnrPtlu50b4XvT5MOmurWNrCj3IFdyjBQ5p9vnrX4JM6I8OE7g==", - "cpu": [ - "loong64" + "libc": [ + "musl" ], - "dev": true, "license": "MIT", "optional": true, "os": [ "linux" - ] + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-linux-ppc64-gnu": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.53.3.tgz", - "integrity": "sha512-EoGSa8nd6d3T7zLuqdojxC20oBfNT8nexBbB/rkxgKj5T5vhpAQKKnD+h3UkoMuTyXkP5jTjK/ccNRmQrPNDuw==", + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.0.0-rc.18", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.0.0-rc.18.tgz", + "integrity": "sha512-ugCOyj7a4d9h3q9B+wXmf6g3a68UsjGh6dob5DHevHGMwDUbhsYNbSPxJsENcIttJZ9jv7qGM2UesLw5jqIhdg==", "cpu": [ "ppc64" ], "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.53.3.tgz", - "integrity": "sha512-4s+Wped2IHXHPnAEbIB0YWBv7SDohqxobiiPA1FIWZpX+w9o2i4LezzH/NkFUl8LRci/8udci6cLq+jJQlh+0g==", - "cpu": [ - "riscv64" + "libc": [ + "glibc" ], - "dev": true, "license": "MIT", "optional": true, "os": [ "linux" - ] - }, - "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.53.3.tgz", - "integrity": "sha512-68k2g7+0vs2u9CxDt5ktXTngsxOQkSEV/xBbwlqYcUrAVh6P9EgMZvFsnHy4SEiUl46Xf0IObWVbMvPrr2gw8A==", - "cpu": [ - "riscv64" ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.53.3.tgz", - "integrity": "sha512-VYsFMpULAz87ZW6BVYw3I6sWesGpsP9OPcyKe8ofdg9LHxSbRMd7zrVrr5xi/3kMZtpWL/wC+UIJWJYVX5uTKg==", + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.0.0-rc.18", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.0.0-rc.18.tgz", + "integrity": "sha512-kKWRhbsotpXkGbcd5dllUWg5gEXcDAa8u5YnP9AV5DYNbvJHGzzuwv7dpmhc8NqKMJldl0a+x76IHbspEpEmdA==", "cpu": [ "s390x" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ "linux" - ] + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.53.3.tgz", - "integrity": "sha512-3EhFi1FU6YL8HTUJZ51imGJWEX//ajQPfqWLI3BQq4TlvHy4X0MOr5q3D2Zof/ka0d5FNdPwZXm3Yyib/UEd+w==", + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.0.0-rc.18", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.0.0-rc.18.tgz", + "integrity": "sha512-uCo8ElcCIAMyYAZyuIZ81oFkhTSIllNvUCHCAlbhlN4ji3uC28h7IIdlXyIvGO7HsuqnV9p3rD/bpH7XhIyhRw==", "cpu": [ "x64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ "linux" - ] + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.53.3.tgz", - "integrity": "sha512-eoROhjcc6HbZCJr+tvVT8X4fW3/5g/WkGvvmwz/88sDtSJzO7r/blvoBDgISDiCjDRZmHpwud7h+6Q9JxFwq1Q==", + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.0.0-rc.18", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.0.0-rc.18.tgz", + "integrity": "sha512-XNOQZtuE6yUIvx4rwGemwh8kpL1xvU41FXy/s9K7T/3JVcqGzo3NfKM2HrbrGgfPYGFW42f07Wk++aOC6B9NWA==", "cpu": [ "x64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ "linux" - ] + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-openharmony-arm64": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.53.3.tgz", - "integrity": "sha512-OueLAWgrNSPGAdUdIjSWXw+u/02BRTcnfw9PN41D2vq/JSEPnJnVuBgw18VkN8wcd4fjUs+jFHVM4t9+kBSNLw==", + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.0.0-rc.18", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.0.0-rc.18.tgz", + "integrity": "sha512-tSn/kzrfa7tNOXr7sEacDBN4YsIqTyLqh45IO0nHDwtpKIDNDJr+VFojt+4klSpChxB29JLyduSsE0MKEwa65A==", "cpu": [ "arm64" ], @@ -1256,40 +920,51 @@ "optional": true, "os": [ "openharmony" - ] + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.53.3.tgz", - "integrity": "sha512-GOFuKpsxR/whszbF/bzydebLiXIHSgsEUp6M0JI8dWvi+fFa1TD6YQa4aSZHtpmh2/uAlj/Dy+nmby3TJ3pkTw==", + "node_modules/@rolldown/binding-wasm32-wasi": { + "version": "1.0.0-rc.18", + "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.0.0-rc.18.tgz", + "integrity": "sha512-+J9YGmc+czgqlhYmwun3S3O0FIZhsH8ep2456xwjAdIOmuJxM7xz4P4PtrxU+Bz17a/5bqPA8o3HAAoX0teUdg==", "cpu": [ - "arm64" + "wasm32" ], "dev": true, "license": "MIT", "optional": true, - "os": [ - "win32" - ] + "dependencies": { + "@emnapi/core": "1.10.0", + "@emnapi/runtime": "1.10.0", + "@napi-rs/wasm-runtime": "^1.1.4" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.53.3.tgz", - "integrity": "sha512-iah+THLcBJdpfZ1TstDFbKNznlzoxa8fmnFYK4V67HvmuNYkVdAywJSoteUszvBQ9/HqN2+9AZghbajMsFT+oA==", + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.0.0-rc.18", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.0.0-rc.18.tgz", + "integrity": "sha512-zsu47DgU0FQzSwi6sU9dZoEdUv7pc1AptSEz/Z8HBg54sV0Pbs3N0+CrIbTsgiu6EyoaNN9CHboqbLaz9lhOyQ==", "cpu": [ - "ia32" + "arm64" ], "dev": true, "license": "MIT", "optional": true, "os": [ "win32" - ] + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-win32-x64-gnu": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.53.3.tgz", - "integrity": "sha512-J9QDiOIZlZLdcot5NXEepDkstocktoVjkaKUtqzgzpt2yWjGlbYiKyp05rWwk4nypbYUNoFAztEgixoLaSETkg==", + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.0.0-rc.18", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.0.0-rc.18.tgz", + "integrity": "sha512-7H+3yqGgmnlDTRRhw/xpYY9J1kf4GC681nVc4GqKhExZTDrVVrV2tsOR9kso0fvgBdcTCcQShx4SLLoHgaLwhg==", "cpu": [ "x64" ], @@ -1298,21 +973,17 @@ "optional": true, "os": [ "win32" - ] - }, - "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.53.3.tgz", - "integrity": "sha512-UhTd8u31dXadv0MopwGgNOBpUVROFKWVQgAg5N1ESyCz8AuBcMqm4AuTjrwgQKGDfoFuz02EuMRHQIw/frmYKQ==", - "cpu": [ - "x64" ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.0-rc.18", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.18.tgz", + "integrity": "sha512-CUY5Mnhe64xQBGZEEXQ5WyZwsc1JU3vAZLIxtrsBt3LO6UOb+C8GunVKqe9sT8NeWb4lqSaoJtp2xo6GxT1MNw==", "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] + "license": "MIT" }, "node_modules/@sindresorhus/is": { "version": "4.6.0", @@ -1327,9 +998,9 @@ } }, "node_modules/@standard-schema/spec": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.0.0.tgz", - "integrity": "sha512-m2bOd0f2RT9k8QJx1JN85cZYyH1RqFBdlwtkSlf4tBDYLCiiZnv1fIIwacK6cqwXavOydf0NPToMQgpKq+dVlA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz", + "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", "dev": true, "license": "MIT" }, @@ -1345,13 +1016,15 @@ "node": ">=10" } }, - "node_modules/@tootallnate/once": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", - "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "node_modules/@tybys/wasm-util": { + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.2.tgz", + "integrity": "sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg==", "dev": true, - "engines": { - "node": ">= 10" + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" } }, "node_modules/@types/cacheable-request": { @@ -1378,10 +1051,11 @@ } }, "node_modules/@types/debug": { - "version": "4.1.12", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", - "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", + "version": "4.1.13", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.13.tgz", + "integrity": "sha512-KSVgmQmzMwPlmtljOomayoR89W4FynCAi3E8PPs7vmDVPe84hT+vGPKkJfThkmXs0x0jAaa9U8uW8bbfyS2fWw==", "dev": true, + "license": "MIT", "dependencies": { "@types/ms": "*" } @@ -1394,9 +1068,9 @@ "license": "MIT" }, "node_modules/@types/estree": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", - "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", "dev": true, "license": "MIT" }, @@ -1405,6 +1079,7 @@ "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.13.tgz", "integrity": "sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==", "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*" } @@ -1448,7 +1123,8 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/node": { "version": "24.10.1", @@ -1465,6 +1141,7 @@ "resolved": "https://registry.npmjs.org/@types/plist/-/plist-3.0.5.tgz", "integrity": "sha512-E6OCaRmAe4WDmWNsL/9RMqdkkzDCY1etutkflWk4c+AcjDU07Pcz1fQwTX0TQz+Pxqn9i4L1TU3UFpjnrcDgxA==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "@types/node": "*", @@ -1485,6 +1162,7 @@ "resolved": "https://registry.npmjs.org/@types/verror/-/verror-1.10.11.tgz", "integrity": "sha512-RlDm9K7+o5stv0Co8i8ZRGxDbrTxhJtgjqjFyVh/tXQyl/rYtTKlnTvZ88oSTeYREWurwx20Js4kTuKCsFkUtg==", "dev": true, + "license": "MIT", "optional": true }, "node_modules/@types/yauzl": { @@ -1498,30 +1176,29 @@ } }, "node_modules/@vitest/coverage-v8": { - "version": "4.0.14", - "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-4.0.14.tgz", - "integrity": "sha512-EYHLqN/BY6b47qHH7gtMxAg++saoGmsjWmAq9MlXxAz4M0NcHh9iOyKhBZyU4yxZqOd8Xnqp80/5saeitz4Cng==", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-4.1.5.tgz", + "integrity": "sha512-38C0/Ddb7HcRG0Z4/DUem8x57d2p9jYgp18mkaYswEOQBGsI1CG4f/hjm0ZCeaJfWhSZ4k7jgs29V1Zom7Ki9A==", "dev": true, "license": "MIT", "dependencies": { "@bcoe/v8-coverage": "^1.0.2", - "@vitest/utils": "4.0.14", - "ast-v8-to-istanbul": "^0.3.8", + "@vitest/utils": "4.1.5", + "ast-v8-to-istanbul": "^1.0.0", "istanbul-lib-coverage": "^3.2.2", "istanbul-lib-report": "^3.0.1", - "istanbul-lib-source-maps": "^5.0.6", "istanbul-reports": "^3.2.0", - "magicast": "^0.5.1", + "magicast": "^0.5.2", "obug": "^2.1.1", - "std-env": "^3.10.0", - "tinyrainbow": "^3.0.3" + "std-env": "^4.0.0-rc.1", + "tinyrainbow": "^3.1.0" }, "funding": { "url": "https://opencollective.com/vitest" }, "peerDependencies": { - "@vitest/browser": "4.0.14", - "vitest": "4.0.14" + "@vitest/browser": "4.1.5", + "vitest": "4.1.5" }, "peerDependenciesMeta": { "@vitest/browser": { @@ -1530,31 +1207,31 @@ } }, "node_modules/@vitest/expect": { - "version": "4.0.14", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.0.14.tgz", - "integrity": "sha512-RHk63V3zvRiYOWAV0rGEBRO820ce17hz7cI2kDmEdfQsBjT2luEKB5tCOc91u1oSQoUOZkSv3ZyzkdkSLD7lKw==", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.1.5.tgz", + "integrity": "sha512-PWBaRY5JoKuRnHlUHfpV/KohFylaDZTupcXN1H9vYryNLOnitSw60Mw9IAE2r67NbwwzBw/Cc/8q9BK3kIX8Kw==", "dev": true, "license": "MIT", "dependencies": { - "@standard-schema/spec": "^1.0.0", + "@standard-schema/spec": "^1.1.0", "@types/chai": "^5.2.2", - "@vitest/spy": "4.0.14", - "@vitest/utils": "4.0.14", - "chai": "^6.2.1", - "tinyrainbow": "^3.0.3" + "@vitest/spy": "4.1.5", + "@vitest/utils": "4.1.5", + "chai": "^6.2.2", + "tinyrainbow": "^3.1.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/mocker": { - "version": "4.0.14", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.0.14.tgz", - "integrity": "sha512-RzS5NujlCzeRPF1MK7MXLiEFpkIXeMdQ+rN3Kk3tDI9j0mtbr7Nmuq67tpkOJQpgyClbOltCXMjLZicJHsH5Cg==", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.1.5.tgz", + "integrity": "sha512-/x2EmFC4mT4NNzqvC3fmesuV97w5FC903KPmey4gsnJiMQ3Be1IlDKVaDaG8iqaLFHqJ2FVEkxZk5VmeLjIItw==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/spy": "4.0.14", + "@vitest/spy": "4.1.5", "estree-walker": "^3.0.3", "magic-string": "^0.30.21" }, @@ -1563,7 +1240,7 @@ }, "peerDependencies": { "msw": "^2.4.9", - "vite": "^6.0.0 || ^7.0.0-0" + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "msw": { @@ -1575,26 +1252,26 @@ } }, "node_modules/@vitest/pretty-format": { - "version": "4.0.14", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-4.0.14.tgz", - "integrity": "sha512-SOYPgujB6TITcJxgd3wmsLl+wZv+fy3av2PpiPpsWPZ6J1ySUYfScfpIt2Yv56ShJXR2MOA6q2KjKHN4EpdyRQ==", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-4.1.5.tgz", + "integrity": "sha512-7I3q6l5qr03dVfMX2wCo9FxwSJbPdwKjy2uu/YPpU3wfHvIL4QHwVRp57OfGrDFeUJ8/8QdfBKIV12FTtLn00g==", "dev": true, "license": "MIT", "dependencies": { - "tinyrainbow": "^3.0.3" + "tinyrainbow": "^3.1.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/runner": { - "version": "4.0.14", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-4.0.14.tgz", - "integrity": "sha512-BsAIk3FAqxICqREbX8SetIteT8PiaUL/tgJjmhxJhCsigmzzH8xeadtp7LRnTpCVzvf0ib9BgAfKJHuhNllKLw==", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-4.1.5.tgz", + "integrity": "sha512-2D+o7Pr82IEO46YPpoA/YU0neeyr6FTerQb5Ro7BUnBuv6NQtT/kmVnczngiMEBhzgqz2UZYl5gArejsyERDSQ==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/utils": "4.0.14", + "@vitest/utils": "4.1.5", "pathe": "^2.0.3" }, "funding": { @@ -1602,13 +1279,14 @@ } }, "node_modules/@vitest/snapshot": { - "version": "4.0.14", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-4.0.14.tgz", - "integrity": "sha512-aQVBfT1PMzDSA16Y3Fp45a0q8nKexx6N5Amw3MX55BeTeZpoC08fGqEZqVmPcqN0ueZsuUQ9rriPMhZ3Mu19Ag==", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-4.1.5.tgz", + "integrity": "sha512-zypXEt4KH/XgKGPUz4eC2AvErYx0My5hfL8oDb1HzGFpEk1P62bxSohdyOmvz+d9UJwanI68MKwr2EquOaOgMQ==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "4.0.14", + "@vitest/pretty-format": "4.1.5", + "@vitest/utils": "4.1.5", "magic-string": "^0.30.21", "pathe": "^2.0.3" }, @@ -1617,9 +1295,9 @@ } }, "node_modules/@vitest/spy": { - "version": "4.0.14", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-4.0.14.tgz", - "integrity": "sha512-JmAZT1UtZooO0tpY3GRyiC/8W7dCs05UOq9rfsUUgEZEdq+DuHLmWhPsrTt0TiW7WYeL/hXpaE07AZ2RCk44hg==", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-4.1.5.tgz", + "integrity": "sha512-2lNOsh6+R2Idnf1TCZqSwYlKN2E/iDlD8sgU59kYVl+OMDmvldO1VDk39smRfpUNwYpNRVn3w4YfuC7KfbBnkQ==", "dev": true, "license": "MIT", "funding": { @@ -1627,24 +1305,26 @@ } }, "node_modules/@vitest/utils": { - "version": "4.0.14", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.0.14.tgz", - "integrity": "sha512-hLqXZKAWNg8pI+SQXyXxWCTOpA3MvsqcbVeNgSi8x/CSN2wi26dSzn1wrOhmCmFjEvN9p8/kLFRHa6PI8jHazw==", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.1.5.tgz", + "integrity": "sha512-76wdkrmfXfqGjueGgnb45ITPyUi1ycZ4IHgC2bhPDUfWHklY/q3MdLOAB+TF1e6xfl8NxNY0ZYaPCFNWSsw3Ug==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "4.0.14", - "tinyrainbow": "^3.0.3" + "@vitest/pretty-format": "4.1.5", + "convert-source-map": "^2.0.0", + "tinyrainbow": "^3.1.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@xmldom/xmldom": { - "version": "0.8.11", - "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.11.tgz", - "integrity": "sha512-cQzWCtO6C8TQiYl1ruKNn2U6Ao4o4WBBcbL61yJl84x+j5sOWWFU9X7DpND8XZG3daDppSsigMdfAIl2upQBRw==", + "version": "0.8.13", + "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.13.tgz", + "integrity": "sha512-KRYzxepc14G/CEpEGc3Yn+JKaAeT63smlDr+vjB8jRfgTBBI9wRj/nkQEO+ucV8p8I9bfKLWp37uHgFrbntPvw==", "dev": true, + "license": "MIT", "engines": { "node": ">=10.0.0" } @@ -1653,26 +1333,35 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/7zip-bin/-/7zip-bin-5.2.0.tgz", "integrity": "sha512-ukTPVhqG4jNzMro2qA9HSCSSVJN3aN7tlb+hfqYCt3ER0yWroeA2VR38MNrOHLQ/cVj+DaIMad0kFCtWWowh/A==", - "dev": true + "dev": true, + "license": "MIT" + }, + "node_modules/abbrev": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-4.0.0.tgz", + "integrity": "sha512-a1wflyaL0tHtJSmLSOVybYhy22vRih4eduhhrkcjgrWGnRfrZtovJ2FRjxuTtkkj47O/baf0R86QU5OuYpz8fA==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^20.17.0 || >=22.9.0" + } }, "node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", "dev": true, - "dependencies": { - "debug": "4" - }, + "license": "MIT", "engines": { - "node": ">= 6.0.0" + "node": ">= 14" } }, "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz", + "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==", "dev": true, - "peer": true, + "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -1685,9 +1374,10 @@ } }, "node_modules/ajv-formats": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", - "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", + "license": "MIT", "dependencies": { "ajv": "^8.0.0" }, @@ -1701,9 +1391,10 @@ } }, "node_modules/ajv-formats/node_modules/ajv": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", - "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", + "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", + "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", @@ -1718,13 +1409,15 @@ "node_modules/ajv-formats/node_modules/json-schema-traverse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "license": "MIT" }, "node_modules/ajv-keywords": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", "dev": true, + "license": "MIT", "peerDependencies": { "ajv": "^6.9.1" } @@ -1753,175 +1446,199 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/ansi-to-html": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/ansi-to-html/-/ansi-to-html-0.7.2.tgz", + "integrity": "sha512-v6MqmEpNlxF+POuyhKkidusCHWWkaLcGRURzivcU3I9tv7k4JVhFcnukrM5Rlk2rUywdZuzYAZ+kbZqWCnfN3g==", + "license": "MIT", + "dependencies": { + "entities": "^2.2.0" + }, + "bin": { + "ansi-to-html": "bin/ansi-to-html" + }, + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/app-builder-bin": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/app-builder-bin/-/app-builder-bin-4.0.0.tgz", - "integrity": "sha512-xwdG0FJPQMe0M0UA4Tz0zEB8rBJTRA5a476ZawAqiBkMv16GRK5xpXThOjMaEOFnZ6zabejjG4J3da0SXG63KA==", - "dev": true + "version": "5.0.0-alpha.12", + "resolved": "https://registry.npmjs.org/app-builder-bin/-/app-builder-bin-5.0.0-alpha.12.tgz", + "integrity": "sha512-j87o0j6LqPL3QRr8yid6c+Tt5gC7xNfYo6uQIQkorAC6MpeayVMZrEDzKmJJ/Hlv7EnOQpaRm53k6ktDYZyB6w==", + "dev": true, + "license": "MIT" }, "node_modules/app-builder-lib": { - "version": "24.13.3", - "resolved": "https://registry.npmjs.org/app-builder-lib/-/app-builder-lib-24.13.3.tgz", - "integrity": "sha512-FAzX6IBit2POXYGnTCT8YHFO/lr5AapAII6zzhQO3Rw4cEDOgK+t1xhLc5tNcKlicTHlo9zxIwnYCX9X2DLkig==", + "version": "26.8.1", + "resolved": "https://registry.npmjs.org/app-builder-lib/-/app-builder-lib-26.8.1.tgz", + "integrity": "sha512-p0Im/Dx5C4tmz8QEE1Yn4MkuPC8PrnlRneMhWJj7BBXQfNTJUshM/bp3lusdEsDbvvfJZpXWnYesgSLvwtM2Zw==", "dev": true, + "license": "MIT", "dependencies": { "@develar/schema-utils": "~2.6.5", - "@electron/notarize": "2.2.1", - "@electron/osx-sign": "1.0.5", - "@electron/universal": "1.5.1", + "@electron/asar": "3.4.1", + "@electron/fuses": "^1.8.0", + "@electron/get": "^3.0.0", + "@electron/notarize": "2.5.0", + "@electron/osx-sign": "1.3.3", + "@electron/rebuild": "^4.0.3", + "@electron/universal": "2.0.3", "@malept/flatpak-bundler": "^0.4.0", "@types/fs-extra": "9.0.13", "async-exit-hook": "^2.0.1", - "bluebird-lst": "^1.0.9", - "builder-util": "24.13.1", - "builder-util-runtime": "9.2.4", + "builder-util": "26.8.1", + "builder-util-runtime": "9.5.1", "chromium-pickle-js": "^0.2.0", + "ci-info": "4.3.1", "debug": "^4.3.4", + "dotenv": "^16.4.5", + "dotenv-expand": "^11.0.6", "ejs": "^3.1.8", - "electron-publish": "24.13.1", - "form-data": "^4.0.0", + "electron-publish": "26.8.1", "fs-extra": "^10.1.0", "hosted-git-info": "^4.1.0", - "is-ci": "^3.0.0", "isbinaryfile": "^5.0.0", + "jiti": "^2.4.2", "js-yaml": "^4.1.0", + "json5": "^2.2.3", "lazy-val": "^1.0.5", - "minimatch": "^5.1.1", - "read-config-file": "6.3.2", - "sanitize-filename": "^1.6.3", - "semver": "^7.3.8", - "tar": "^6.1.12", - "temp-file": "^3.4.0" + "minimatch": "^10.0.3", + "plist": "3.1.0", + "proper-lockfile": "^4.1.2", + "resedit": "^1.7.0", + "semver": "~7.7.3", + "tar": "^7.5.7", + "temp-file": "^3.4.0", + "tiny-async-pool": "1.3.0", + "which": "^5.0.0" }, "engines": { "node": ">=14.0.0" }, "peerDependencies": { - "dmg-builder": "24.13.3", - "electron-builder-squirrel-windows": "24.13.3" + "dmg-builder": "26.8.1", + "electron-builder-squirrel-windows": "26.8.1" } }, - "node_modules/app-builder-lib/node_modules/fs-extra": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", - "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "node_modules/app-builder-lib/node_modules/@electron/get": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@electron/get/-/get-3.1.0.tgz", + "integrity": "sha512-F+nKc0xW+kVbBRhFzaMgPy3KwmuNTYX1fx6+FxxoSnNgwYX6LD7AKBTWkU0MQ6IBoe7dz069CNkR673sPAgkCQ==", "dev": true, + "license": "MIT", "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" + "debug": "^4.1.1", + "env-paths": "^2.2.0", + "fs-extra": "^8.1.0", + "got": "^11.8.5", + "progress": "^2.0.3", + "semver": "^6.2.0", + "sumchecker": "^3.0.1" }, "engines": { - "node": ">=12" + "node": ">=14" + }, + "optionalDependencies": { + "global-agent": "^3.0.0" } }, - "node_modules/app-builder-lib/node_modules/jsonfile": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", - "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", + "node_modules/app-builder-lib/node_modules/@electron/get/node_modules/fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", "dev": true, + "license": "MIT", "dependencies": { - "universalify": "^2.0.0" + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" + "engines": { + "node": ">=6 <7 || >=8" } }, - "node_modules/app-builder-lib/node_modules/semver": { - "version": "7.7.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", - "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "node_modules/app-builder-lib/node_modules/@electron/get/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" } }, - "node_modules/app-builder-lib/node_modules/universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "node_modules/app-builder-lib/node_modules/ci-info": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.3.1.tgz", + "integrity": "sha512-Wdy2Igu8OcBpI2pZePZ5oWjPC38tmDVx5WKUXKwlLYkA0ozo85sLsLvkBbBn/sZaSCMFOGZJ14fvW9t5/d7kdA==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", "engines": { - "node": ">= 10.0.0" + "node": ">=8" } }, - "node_modules/archiver": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/archiver/-/archiver-5.3.2.tgz", - "integrity": "sha512-+25nxyyznAXF7Nef3y0EbBeqmGZgeN/BxHX29Rs39djAfaFalmQ89SE6CWyDCHzGL0yt/ycBtNOmGTW0FyGWNw==", + "node_modules/app-builder-lib/node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", "dev": true, + "license": "MIT", "dependencies": { - "archiver-utils": "^2.1.0", - "async": "^3.2.4", - "buffer-crc32": "^0.2.1", - "readable-stream": "^3.6.0", - "readdir-glob": "^1.1.2", - "tar-stream": "^2.2.0", - "zip-stream": "^4.1.0" + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" }, "engines": { - "node": ">= 10" + "node": ">=12" } }, - "node_modules/archiver-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-2.1.0.tgz", - "integrity": "sha512-bEL/yUb/fNNiNTuUz979Z0Yg5L+LzLxGJz8x79lYmR54fmTIb6ob/hNQgkQnIUDWIFjZVQwl9Xs356I6BAMHfw==", + "node_modules/app-builder-lib/node_modules/fs-extra/node_modules/jsonfile": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.1.tgz", + "integrity": "sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==", "dev": true, + "license": "MIT", "dependencies": { - "glob": "^7.1.4", - "graceful-fs": "^4.2.0", - "lazystream": "^1.0.0", - "lodash.defaults": "^4.2.0", - "lodash.difference": "^4.5.0", - "lodash.flatten": "^4.4.0", - "lodash.isplainobject": "^4.0.6", - "lodash.union": "^4.6.0", - "normalize-path": "^3.0.0", - "readable-stream": "^2.0.0" + "universalify": "^2.0.0" }, - "engines": { - "node": ">= 6" + "optionalDependencies": { + "graceful-fs": "^4.1.6" } }, - "node_modules/archiver-utils/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "node_modules/app-builder-lib/node_modules/fs-extra/node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "license": "MIT", + "engines": { + "node": ">= 10.0.0" } }, - "node_modules/archiver-utils/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "node_modules/archiver-utils/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "node_modules/app-builder-lib/node_modules/semver": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" } }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true + "license": "Python-2.0" }, "node_modules/asar": { "version": "3.2.0", @@ -1975,6 +1692,7 @@ "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", "dev": true, + "license": "MIT", "optional": true, "engines": { "node": ">=0.8" @@ -1991,15 +1709,15 @@ } }, "node_modules/ast-v8-to-istanbul": { - "version": "0.3.8", - "resolved": "https://registry.npmjs.org/ast-v8-to-istanbul/-/ast-v8-to-istanbul-0.3.8.tgz", - "integrity": "sha512-szgSZqUxI5T8mLKvS7WTjF9is+MVbOeLADU73IseOcrqhxr/VAvy6wfoVE39KnKzA7JRhjF5eUagNlHwvZPlKQ==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/ast-v8-to-istanbul/-/ast-v8-to-istanbul-1.0.0.tgz", + "integrity": "sha512-1fSfIwuDICFA4LKkCzRPO7F0hzFf0B7+Xqrl27ynQaa+Rh0e1Es0v6kWHPott3lU10AyAr7oKHa65OppjLn3Rg==", "dev": true, "license": "MIT", "dependencies": { "@jridgewell/trace-mapping": "^0.3.31", "estree-walker": "^3.0.3", - "js-tokens": "^9.0.1" + "js-tokens": "^10.0.0" } }, "node_modules/astral-regex": { @@ -2007,6 +1725,7 @@ "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", "dev": true, + "license": "MIT", "optional": true, "engines": { "node": ">=8" @@ -2016,13 +1735,15 @@ "version": "3.2.6", "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/async-exit-hook": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/async-exit-hook/-/async-exit-hook-2.0.1.tgz", "integrity": "sha512-NW2cX8m1Q7KPA7a5M2ULQeZ2wR5qI5PAbw5L0UOMxdioVk9PMZ0h1TmyZEkPYrCvYjDlFICusOu1dlEKAAeXBw==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.12.0" } @@ -2031,23 +1752,27 @@ "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/at-least-node": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", "dev": true, + "license": "ISC", "engines": { "node": ">= 4.0.0" } }, "node_modules/atomically": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/atomically/-/atomically-1.7.0.tgz", - "integrity": "sha512-Xcz9l0z7y9yQ9rdDaxlmaI4uJHf/T8g9hOEzJcsEqX2SjCj4J20uK7+ldkDHMbpJDK76wF7xEIgxc/vSlsfw5w==", - "engines": { - "node": ">=10.12.0" + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/atomically/-/atomically-2.1.1.tgz", + "integrity": "sha512-P4w9o2dqARji6P7MHprklbfiArZAWvo07yW7qs3pdljb3BWr12FIB7W+p0zJiuiVsUpRO0iZn1kFFcpPegg0tQ==", + "license": "MIT", + "dependencies": { + "stubborn-fs": "^2.0.0", + "when-exit": "^2.1.4" } }, "node_modules/balanced-match": { @@ -2074,33 +1799,8 @@ "type": "consulting", "url": "https://feross.org/support" } - ] - }, - "node_modules/bl": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", - "dev": true, - "dependencies": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } - }, - "node_modules/bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", - "dev": true - }, - "node_modules/bluebird-lst": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/bluebird-lst/-/bluebird-lst-1.0.9.tgz", - "integrity": "sha512-7B1Rtx82hjnSD4PGLAjVWeYH3tHAcVUmChh85a3lltKQm6FresXh9ErQo6oAv6CqxttczC3/kEg8SY5NluPuUw==", - "dev": true, - "dependencies": { - "bluebird": "^3.5.5" - } + ], + "license": "MIT" }, "node_modules/boolean": { "version": "3.2.0", @@ -2111,12 +1811,26 @@ "optional": true }, "node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz", + "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==", "dev": true, + "license": "MIT", "dependencies": { - "balanced-match": "^1.0.0" + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/brace-expansion/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" } }, "node_modules/buffer": { @@ -2138,6 +1852,8 @@ "url": "https://feross.org/support" } ], + "license": "MIT", + "optional": true, "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" @@ -2152,53 +1868,43 @@ "node": "*" } }, - "node_modules/buffer-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-1.0.1.tgz", - "integrity": "sha512-QoV3ptgEaQpvVwbXdSO39iqPQTCxSF7A5U99AxbHYqUdCizL/lH2Z0A2y6nbZucxMEOtNyZfG2s6gsVugGpKkg==", - "dev": true, - "engines": { - "node": ">=0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/builder-util": { - "version": "24.13.1", - "resolved": "https://registry.npmjs.org/builder-util/-/builder-util-24.13.1.tgz", - "integrity": "sha512-NhbCSIntruNDTOVI9fdXz0dihaqX2YuE1D6zZMrwiErzH4ELZHE6mdiB40wEgZNprDia+FghRFgKoAqMZRRjSA==", + "version": "26.8.1", + "resolved": "https://registry.npmjs.org/builder-util/-/builder-util-26.8.1.tgz", + "integrity": "sha512-pm1lTYbGyc90DHgCDO7eo8Rl4EqKLciayNbZqGziqnH9jrlKe8ZANGdityLZU+pJh16dfzjAx2xQq9McuIPEtw==", "dev": true, + "license": "MIT", "dependencies": { "@types/debug": "^4.1.6", "7zip-bin": "~5.2.0", - "app-builder-bin": "4.0.0", - "bluebird-lst": "^1.0.9", - "builder-util-runtime": "9.2.4", + "app-builder-bin": "5.0.0-alpha.12", + "builder-util-runtime": "9.5.1", "chalk": "^4.1.2", - "cross-spawn": "^7.0.3", + "cross-spawn": "^7.0.6", "debug": "^4.3.4", "fs-extra": "^10.1.0", - "http-proxy-agent": "^5.0.0", - "https-proxy-agent": "^5.0.1", - "is-ci": "^3.0.0", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.0", "js-yaml": "^4.1.0", + "sanitize-filename": "^1.6.3", "source-map-support": "^0.5.19", "stat-mode": "^1.0.0", - "temp-file": "^3.4.0" + "temp-file": "^3.4.0", + "tiny-async-pool": "1.3.0" } }, "node_modules/builder-util-runtime": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-9.2.4.tgz", - "integrity": "sha512-upp+biKpN/XZMLim7aguUyW8s0FUpDvOtK6sbanMFDAMBzpHDqdhgVYm6zc9HJ6nWo7u2Lxk60i2M6Jd3aiNrA==", - "dev": true, + "version": "9.5.1", + "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-9.5.1.tgz", + "integrity": "sha512-qt41tMfgHTllhResqM5DcnHyDIWNgzHvuY2jDcYP9iaGpkWxTUzV6GQjDeLnlR1/DtdlcsWQbA7sByMpmJFTLQ==", + "license": "MIT", "dependencies": { "debug": "^4.3.4", "sax": "^1.2.4" @@ -2212,6 +1918,7 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", "dev": true, + "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -2222,10 +1929,11 @@ } }, "node_modules/builder-util/node_modules/jsonfile": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", - "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.1.tgz", + "integrity": "sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==", "dev": true, + "license": "MIT", "dependencies": { "universalify": "^2.0.0" }, @@ -2238,6 +1946,7 @@ "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "dev": true, + "license": "MIT", "engines": { "node": ">= 10.0.0" } @@ -2274,6 +1983,7 @@ "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", "dev": true, + "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" @@ -2283,9 +1993,9 @@ } }, "node_modules/chai": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/chai/-/chai-6.2.1.tgz", - "integrity": "sha512-p4Z49OGG5W/WBCPSS/dH3jQ73kD6tiMmUM+bckNK6Jr5JHMG3k9bg/BvKR8lKmtVBKmOiuVaV2ws8s9oSbwysg==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/chai/-/chai-6.2.2.tgz", + "integrity": "sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==", "dev": true, "license": "MIT", "engines": { @@ -2297,6 +2007,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -2309,12 +2020,13 @@ } }, "node_modules/chownr": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz", + "integrity": "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==", "dev": true, + "license": "BlueOak-1.0.0", "engines": { - "node": ">=10" + "node": ">=18" } }, "node_modules/chromium-pickle-js": { @@ -2324,9 +2036,9 @@ "dev": true }, "node_modules/ci-info": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", - "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.4.0.tgz", + "integrity": "sha512-77PSwercCZU2Fc4sX94eF8k8Pxte6JAwL4/ICZLFjJLqegs7kCuAsqqj/70NQF6TvDpgFjkubQB2FW2ZZddvQg==", "dev": true, "funding": [ { @@ -2334,6 +2046,7 @@ "url": "https://github.com/sponsors/sibiraj-s" } ], + "license": "MIT", "engines": { "node": ">=8" } @@ -2343,6 +2056,7 @@ "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz", "integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "slice-ansi": "^3.0.0", @@ -2404,6 +2118,7 @@ "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, + "license": "MIT", "dependencies": { "delayed-stream": "~1.0.0" }, @@ -2425,25 +2140,11 @@ "resolved": "https://registry.npmjs.org/compare-version/-/compare-version-0.1.2.tgz", "integrity": "sha512-pJDh5/4wrEnXX/VWRZvruAGHkzKdr46z11OlTPN+VrATlWWhSKewNCJ1futCO5C7eJB3nPMFZA1LeYtcFboZ2A==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, - "node_modules/compress-commons": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-4.1.2.tgz", - "integrity": "sha512-D3uMHtGc/fcO1Gt1/L7i1e33VOvD4A9hfQLP+6ewd+BvG/gQ84Yh4oftEhAdjSMgBgwGL+jsppT7JYNpo6MHHg==", - "dev": true, - "dependencies": { - "buffer-crc32": "^0.2.13", - "crc32-stream": "^4.0.2", - "normalize-path": "^3.0.0", - "readable-stream": "^3.6.0" - }, - "engines": { - "node": ">= 10" - } - }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -2451,32 +2152,33 @@ "dev": true }, "node_modules/conf": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/conf/-/conf-10.2.0.tgz", - "integrity": "sha512-8fLl9F04EJqjSqH+QjITQfJF8BrOVaYr1jewVgSRAEWePfxT0sku4w2hrGQ60BC/TNLGQ2pgxNlTbWQmMPFvXg==", - "dependencies": { - "ajv": "^8.6.3", - "ajv-formats": "^2.1.1", - "atomically": "^1.7.0", - "debounce-fn": "^4.0.0", - "dot-prop": "^6.0.1", - "env-paths": "^2.2.1", - "json-schema-typed": "^7.0.3", - "onetime": "^5.1.2", - "pkg-up": "^3.1.0", - "semver": "^7.3.5" + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/conf/-/conf-15.1.0.tgz", + "integrity": "sha512-Uy5YN9KEu0WWDaZAVJ5FAmZoaJt9rdK6kH+utItPyGsCqCgaTKkrmZx3zoE0/3q6S3bcp3Ihkk+ZqPxWxFK5og==", + "license": "MIT", + "dependencies": { + "ajv": "^8.17.1", + "ajv-formats": "^3.0.1", + "atomically": "^2.0.3", + "debounce-fn": "^6.0.0", + "dot-prop": "^10.0.0", + "env-paths": "^3.0.0", + "json-schema-typed": "^8.0.1", + "semver": "^7.7.2", + "uint8array-extras": "^1.5.0" }, "engines": { - "node": ">=12" + "node": ">=20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/conf/node_modules/ajv": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", - "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", + "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", + "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", @@ -2484,126 +2186,81 @@ "require-from-string": "^2.0.2" }, "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/conf/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - }, - "node_modules/conf/node_modules/semver": { - "version": "7.7.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", - "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/config-file-ts": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/config-file-ts/-/config-file-ts-0.2.6.tgz", - "integrity": "sha512-6boGVaglwblBgJqGyxm4+xCmEGcWgnWHSWHY5jad58awQhB6gftq0G8HbzU39YqCIYHMLAiL1yjwiZ36m/CL8w==", - "dev": true, - "dependencies": { - "glob": "^10.3.10", - "typescript": "^5.3.3" - } - }, - "node_modules/config-file-ts/node_modules/glob": { - "version": "10.4.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", - "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", - "dev": true, - "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^3.1.2", - "minimatch": "^9.0.4", - "minipass": "^7.1.2", - "package-json-from-dist": "^1.0.0", - "path-scurry": "^1.11.1" - }, - "bin": { - "glob": "dist/esm/bin.mjs" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/config-file-ts/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, + "node_modules/conf/node_modules/env-paths": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-3.0.0.tgz", + "integrity": "sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A==", + "license": "MIT", "engines": { - "node": ">=16 || 14 >=14.17" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/config-file-ts/node_modules/minipass": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "dev": true, + "node_modules/conf/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "license": "MIT" + }, + "node_modules/conf/node_modules/semver": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.0.tgz", + "integrity": "sha512-AcM7dV/5ul4EekoQ29Agm5vri8JNqRyj39o0qpX6vDF2GZrtutZl5RwgD1XnZjiTAfncsJhMI48QQH3sN87YNA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": ">=10" } }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, "node_modules/core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", - "dev": true + "dev": true, + "license": "MIT", + "optional": true }, "node_modules/crc": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/crc/-/crc-3.8.0.tgz", "integrity": "sha512-iX3mfgcTMIq3ZKLIsVFAbv7+Mc10kxabAGQb8HvjA1o3T1PIYprbakQ65d3I+2HGHt6nSKkM9PYjgoJO2KcFBQ==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "buffer": "^5.1.0" } }, - "node_modules/crc-32": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", - "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", - "dev": true, - "bin": { - "crc32": "bin/crc32.njs" - }, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/crc32-stream": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-4.0.3.tgz", - "integrity": "sha512-NT7w2JVU7DFroFdYkeq8cywxrgjPHWkdX1wjpRQXPX5Asews3tA+Ght6lddQO5Mkumffp3X7GEqku3epj2toIw==", + "node_modules/cross-dirname": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/cross-dirname/-/cross-dirname-0.1.0.tgz", + "integrity": "sha512-+R08/oI0nl3vfPcqftZRpytksBXDzOUveBq/NBVx0sUp1axwzPQrKinNx5yd5sxPu8j1wIy8AfnVQ+5eFdha6Q==", "dev": true, - "dependencies": { - "crc-32": "^1.2.0", - "readable-stream": "^3.4.0" - }, - "engines": { - "node": ">= 10" - } + "license": "MIT", + "optional": true, + "peer": true }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, + "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -2613,15 +2270,39 @@ "node": ">= 8" } }, + "node_modules/cross-spawn/node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/cross-spawn/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/debounce-fn": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/debounce-fn/-/debounce-fn-4.0.0.tgz", - "integrity": "sha512-8pYCQiL9Xdcg0UPSD3d+0KMlOjp+KGU5EPwYddgzQ7DATsg4fuUDjQtsYLmWjnk2obnNHgV3vE2Y4jejSOJVBQ==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/debounce-fn/-/debounce-fn-6.0.0.tgz", + "integrity": "sha512-rBMW+F2TXryBwB54Q0d8drNEI+TfoS9JpNTAoVpukbWEhjXQq4rySFYLaqXMFXwdv61Zb2OHtj5bviSoimqxRQ==", + "license": "MIT", "dependencies": { - "mimic-fn": "^3.0.0" + "mimic-function": "^5.0.0" }, "engines": { - "node": ">=10" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -2631,7 +2312,6 @@ "version": "4.4.3", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dev": true, "dependencies": { "ms": "^2.1.3" }, @@ -2721,10 +2401,21 @@ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.4.0" } }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, "node_modules/detect-node": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz", @@ -2733,30 +2424,33 @@ "optional": true }, "node_modules/dir-compare": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/dir-compare/-/dir-compare-3.3.0.tgz", - "integrity": "sha512-J7/et3WlGUCxjdnD3HAAzQ6nsnc0WL6DD7WcwJb7c39iH1+AWfg+9OqzJNaI6PkBwBvm1mhZNL9iY/nRiZXlPg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/dir-compare/-/dir-compare-4.2.0.tgz", + "integrity": "sha512-2xMCmOoMrdQIPHdsTawECdNPwlVFB9zGcz3kuhmBO6U3oU+UQjsue0i8ayLKpgBcm+hcXPMVSGUN9d+pvJ6+VQ==", "dev": true, + "license": "MIT", "dependencies": { - "buffer-equal": "^1.0.0", - "minimatch": "^3.0.4" + "minimatch": "^3.0.5", + "p-limit": "^3.1.0 " } }, "node_modules/dir-compare/node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.14.tgz", + "integrity": "sha512-MWPGfDxnyzKU7rNOW9SP/c50vi3xrmrua/+6hfPbCS2ABNWfx24vPidzvC7krjU/RTo235sV776ymlsMtGKj8g==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "node_modules/dir-compare/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -2765,15 +2459,14 @@ } }, "node_modules/dmg-builder": { - "version": "24.13.3", - "resolved": "https://registry.npmjs.org/dmg-builder/-/dmg-builder-24.13.3.tgz", - "integrity": "sha512-rcJUkMfnJpfCboZoOOPf4L29TRtEieHNOeAbYPWPxlaBw/Z1RKrRA86dOI9rwaI4tQSc/RD82zTNHprfUHXsoQ==", + "version": "26.8.1", + "resolved": "https://registry.npmjs.org/dmg-builder/-/dmg-builder-26.8.1.tgz", + "integrity": "sha512-glMJgnTreo8CFINujtAhCgN96QAqApDMZ8Vl1r8f0QT8QprvC1UCltV4CcWj20YoIyLZx6IUskaJZ0NV8fokcg==", "dev": true, - "peer": true, + "license": "MIT", "dependencies": { - "app-builder-lib": "24.13.3", - "builder-util": "24.13.1", - "builder-util-runtime": "9.2.4", + "app-builder-lib": "26.8.1", + "builder-util": "26.8.1", "fs-extra": "^10.1.0", "iconv-lite": "^0.6.2", "js-yaml": "^4.1.0" @@ -2787,6 +2480,7 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", "dev": true, + "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -2797,10 +2491,11 @@ } }, "node_modules/dmg-builder/node_modules/jsonfile": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", - "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.1.tgz", + "integrity": "sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==", "dev": true, + "license": "MIT", "dependencies": { "universalify": "^2.0.0" }, @@ -2813,6 +2508,7 @@ "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "dev": true, + "license": "MIT", "engines": { "node": ">= 10.0.0" } @@ -2822,6 +2518,7 @@ "resolved": "https://registry.npmjs.org/dmg-license/-/dmg-license-1.0.11.tgz", "integrity": "sha512-ZdzmqwKmECOWJpqefloC5OJy1+WZBBse5+MR88z9g9Zn4VY+WYUkAyojmhzJckH5YbbZGcYIuGAkY5/Ys5OM2Q==", "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -2844,39 +2541,55 @@ } }, "node_modules/dot-prop": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz", - "integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==", + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-10.1.0.tgz", + "integrity": "sha512-MVUtAugQMOff5RnBy2d9N31iG0lNwg1qAoAOn7pOK5wf94WIaE3My2p3uwTQuvS2AcqchkcR3bHByjaM0mmi7Q==", + "license": "MIT", "dependencies": { - "is-obj": "^2.0.0" + "type-fest": "^5.0.0" }, "engines": { - "node": ">=10" + "node": ">=20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/dotenv": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-9.0.2.tgz", - "integrity": "sha512-I9OvvrHp4pIARv4+x9iuewrWycX6CcZtoAu1XrzPxc5UygMJXJZYmBsynku8IkrJwgypE5DGNjDPmPRhDCptUg==", + "version": "16.6.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz", + "integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==", "dev": true, + "license": "BSD-2-Clause", "engines": { - "node": ">=10" + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" } }, "node_modules/dotenv-expand": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-5.1.0.tgz", - "integrity": "sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA==", - "dev": true + "version": "11.0.7", + "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-11.0.7.tgz", + "integrity": "sha512-zIHwmZPRshsCdpMDyVsqGmgyP0yT8GAgXUnkdAoJisxvf33k7yO6OuoKmcTGuXPWSsm8Oh88nZicRLA9Y0rUeA==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "dotenv": "^16.4.5" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } }, "node_modules/dunder-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", "dev": true, + "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.1", "es-errors": "^1.3.0", @@ -2886,17 +2599,12 @@ "node": ">= 0.4" } }, - "node_modules/eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true - }, "node_modules/ejs": { "version": "3.1.10", "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", "dev": true, + "license": "Apache-2.0", "dependencies": { "jake": "^10.8.5" }, @@ -2908,14 +2616,15 @@ } }, "node_modules/electron": { - "version": "28.3.3", - "resolved": "https://registry.npmjs.org/electron/-/electron-28.3.3.tgz", - "integrity": "sha512-ObKMLSPNhomtCOBAxFS8P2DW/4umkh72ouZUlUKzXGtYuPzgr1SYhskhFWgzAsPtUzhL2CzyV2sfbHcEW4CXqw==", + "version": "40.9.3", + "resolved": "https://registry.npmjs.org/electron/-/electron-40.9.3.tgz", + "integrity": "sha512-rDcJOT6BBE689Ada+4jD3rVr05pMv9MZOgT0x/rIMVDF9c4ttx4RTb6lVARTyxZC7uqpirttCtcli1eg1DX5qg==", "dev": true, "hasInstallScript": true, + "license": "MIT", "dependencies": { "@electron/get": "^2.0.0", - "@types/node": "^18.11.18", + "@types/node": "^24.9.0", "extract-zip": "^2.0.1" }, "bin": { @@ -2926,20 +2635,20 @@ } }, "node_modules/electron-builder": { - "version": "24.13.3", - "resolved": "https://registry.npmjs.org/electron-builder/-/electron-builder-24.13.3.tgz", - "integrity": "sha512-yZSgVHft5dNVlo31qmJAe4BVKQfFdwpRw7sFp1iQglDRCDD6r22zfRJuZlhtB5gp9FHUxCMEoWGq10SkCnMAIg==", + "version": "26.8.1", + "resolved": "https://registry.npmjs.org/electron-builder/-/electron-builder-26.8.1.tgz", + "integrity": "sha512-uWhx1r74NGpCagG0ULs/P9Nqv2nsoo+7eo4fLUOB8L8MdWltq9odW/uuLXMFCDGnPafknYLZgjNX0ZIFRzOQAw==", "dev": true, + "license": "MIT", "dependencies": { - "app-builder-lib": "24.13.3", - "builder-util": "24.13.1", - "builder-util-runtime": "9.2.4", + "app-builder-lib": "26.8.1", + "builder-util": "26.8.1", + "builder-util-runtime": "9.5.1", "chalk": "^4.1.2", - "dmg-builder": "24.13.3", + "ci-info": "^4.2.0", + "dmg-builder": "26.8.1", "fs-extra": "^10.1.0", - "is-ci": "^3.0.0", "lazy-val": "^1.0.5", - "read-config-file": "6.3.2", "simple-update-notifier": "2.0.0", "yargs": "^17.6.2" }, @@ -2952,18 +2661,19 @@ } }, "node_modules/electron-builder-squirrel-windows": { - "version": "24.13.3", - "resolved": "https://registry.npmjs.org/electron-builder-squirrel-windows/-/electron-builder-squirrel-windows-24.13.3.tgz", - "integrity": "sha512-oHkV0iogWfyK+ah9ZIvMDpei1m9ZRpdXcvde1wTpra2U8AFDNNpqJdnin5z+PM1GbQ5BoaKCWas2HSjtR0HwMg==", + "version": "26.8.1", + "resolved": "https://registry.npmjs.org/electron-builder-squirrel-windows/-/electron-builder-squirrel-windows-26.8.1.tgz", + "integrity": "sha512-o288fIdgPLHA76eDrFADHPoo7VyGkDCYbLV1GzndaMSAVBoZrGvM9m2IehdcVMzdAZJ2eV9bgyissQXHv5tGzA==", "dev": true, + "license": "MIT", + "peer": true, "dependencies": { - "app-builder-lib": "24.13.3", - "archiver": "^5.3.1", - "builder-util": "24.13.1", - "fs-extra": "^10.1.0" + "app-builder-lib": "26.8.1", + "builder-util": "26.8.1", + "electron-winstaller": "5.4.0" } }, - "node_modules/electron-builder-squirrel-windows/node_modules/fs-extra": { + "node_modules/electron-builder/node_modules/fs-extra": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", @@ -2977,7 +2687,7 @@ "node": ">=12" } }, - "node_modules/electron-builder-squirrel-windows/node_modules/jsonfile": { + "node_modules/electron-builder/node_modules/jsonfile": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", @@ -2989,7 +2699,7 @@ "graceful-fs": "^4.1.6" } }, - "node_modules/electron-builder-squirrel-windows/node_modules/universalify": { + "node_modules/electron-builder/node_modules/universalify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", @@ -2998,11 +2708,29 @@ "node": ">= 10.0.0" } }, - "node_modules/electron-builder/node_modules/fs-extra": { + "node_modules/electron-publish": { + "version": "26.8.1", + "resolved": "https://registry.npmjs.org/electron-publish/-/electron-publish-26.8.1.tgz", + "integrity": "sha512-q+jrSTIh/Cv4eGZa7oVR+grEJo/FoLMYBAnSL5GCtqwUpr1T+VgKB/dn1pnzxIxqD8S/jP1yilT9VrwCqINR4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/fs-extra": "^9.0.11", + "builder-util": "26.8.1", + "builder-util-runtime": "9.5.1", + "chalk": "^4.1.2", + "form-data": "^4.0.5", + "fs-extra": "^10.1.0", + "lazy-val": "^1.0.5", + "mime": "^2.5.2" + } + }, + "node_modules/electron-publish/node_modules/fs-extra": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", "dev": true, + "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -3012,11 +2740,12 @@ "node": ">=12" } }, - "node_modules/electron-builder/node_modules/jsonfile": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", - "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", + "node_modules/electron-publish/node_modules/jsonfile": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.1.tgz", + "integrity": "sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==", "dev": true, + "license": "MIT", "dependencies": { "universalify": "^2.0.0" }, @@ -3024,35 +2753,53 @@ "graceful-fs": "^4.1.6" } }, - "node_modules/electron-builder/node_modules/universalify": { + "node_modules/electron-publish/node_modules/universalify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "dev": true, + "license": "MIT", "engines": { "node": ">= 10.0.0" } }, - "node_modules/electron-publish": { - "version": "24.13.1", - "resolved": "https://registry.npmjs.org/electron-publish/-/electron-publish-24.13.1.tgz", - "integrity": "sha512-2ZgdEqJ8e9D17Hwp5LEq5mLQPjqU3lv/IALvgp+4W8VeNhryfGhYEQC/PgDPMrnWUp+l60Ou5SJLsu+k4mhQ8A==", - "dev": true, + "node_modules/electron-store": { + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/electron-store/-/electron-store-11.0.2.tgz", + "integrity": "sha512-4VkNRdN+BImL2KcCi41WvAYbh6zLX5AUTi4so68yPqiItjbgTjqpEnGAqasgnG+lB6GuAyUltKwVopp6Uv+gwQ==", + "license": "MIT", "dependencies": { - "@types/fs-extra": "^9.0.11", - "builder-util": "24.13.1", - "builder-util-runtime": "9.2.4", - "chalk": "^4.1.2", + "conf": "^15.0.2", + "type-fest": "^5.0.1" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/electron-updater": { + "version": "6.8.3", + "resolved": "https://registry.npmjs.org/electron-updater/-/electron-updater-6.8.3.tgz", + "integrity": "sha512-Z6sgw3jgbikWKXei1ENdqFOxBP0WlXg3TtKfz0rgw2vIZFJUyI4pD7ZN7jrkm7EoMK+tcm/qTnPUdqfZukBlBQ==", + "license": "MIT", + "dependencies": { + "builder-util-runtime": "9.5.1", "fs-extra": "^10.1.0", + "js-yaml": "^4.1.0", "lazy-val": "^1.0.5", - "mime": "^2.5.2" + "lodash.escaperegexp": "^4.1.2", + "lodash.isequal": "^4.5.0", + "semver": "~7.7.3", + "tiny-typed-emitter": "^2.1.0" } }, - "node_modules/electron-publish/node_modules/fs-extra": { + "node_modules/electron-updater/node_modules/fs-extra": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", - "dev": true, + "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -3062,11 +2809,11 @@ "node": ">=12" } }, - "node_modules/electron-publish/node_modules/jsonfile": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", - "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", - "dev": true, + "node_modules/electron-updater/node_modules/jsonfile": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.1.tgz", + "integrity": "sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==", + "license": "MIT", "dependencies": { "universalify": "^2.0.0" }, @@ -3074,44 +2821,65 @@ "graceful-fs": "^4.1.6" } }, - "node_modules/electron-publish/node_modules/universalify": { + "node_modules/electron-updater/node_modules/semver": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/electron-updater/node_modules/universalify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", - "dev": true, + "license": "MIT", "engines": { "node": ">= 10.0.0" } }, - "node_modules/electron-store": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/electron-store/-/electron-store-8.2.0.tgz", - "integrity": "sha512-ukLL5Bevdil6oieAOXz3CMy+OgaItMiVBg701MNlG6W5RaC0AHN7rvlqTCmeb6O7jP0Qa1KKYTE0xV0xbhF4Hw==", + "node_modules/electron-winstaller": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/electron-winstaller/-/electron-winstaller-5.4.0.tgz", + "integrity": "sha512-bO3y10YikuUwUuDUQRM4KfwNkKhnpVO7IPdbsrejwN9/AABJzzTQ4GeHwyzNSrVO+tEH3/Np255a3sVZpZDjvg==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "peer": true, "dependencies": { - "conf": "^10.2.0", - "type-fest": "^2.17.0" + "@electron/asar": "^3.2.1", + "debug": "^4.1.1", + "fs-extra": "^7.0.1", + "lodash": "^4.17.21", + "temp": "^0.9.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": ">=8.0.0" + }, + "optionalDependencies": { + "@electron/windows-sign": "^1.1.2" } }, - "node_modules/electron/node_modules/@types/node": { - "version": "18.19.130", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.130.tgz", - "integrity": "sha512-GRaXQx6jGfL8sKfaIDD6OupbIHBr9jv7Jnaml9tB7l4v068PAOXqfcujMMo5PhbIs6ggR1XODELqahT2R8v0fg==", + "node_modules/electron-winstaller/node_modules/fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { - "undici-types": "~5.26.4" + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" } }, - "node_modules/electron/node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "dev": true, - "license": "MIT" - }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -3127,10 +2895,20 @@ "once": "^1.4.0" } }, + "node_modules/entities": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", + "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", + "license": "BSD-2-Clause", + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/env-paths": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "dev": true, "engines": { "node": ">=6" } @@ -3139,7 +2917,8 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/es-define-property": { "version": "1.0.1", @@ -3160,9 +2939,9 @@ } }, "node_modules/es-module-lexer": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz", - "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.1.0.tgz", + "integrity": "sha512-n27zTYMjYu1aj4MjCWzSP7G9r75utsaoc8m61weK+W8JMBGGQybd43GstCXZ3WNmSFtGT9wi59qQTW6mhTR5LQ==", "dev": true, "license": "MIT" }, @@ -3171,6 +2950,7 @@ "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", "dev": true, + "license": "MIT", "dependencies": { "es-errors": "^1.3.0" }, @@ -3183,6 +2963,7 @@ "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", "dev": true, + "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "get-intrinsic": "^1.2.6", @@ -3200,48 +2981,6 @@ "dev": true, "optional": true }, - "node_modules/esbuild": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz", - "integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=18" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.25.12", - "@esbuild/android-arm": "0.25.12", - "@esbuild/android-arm64": "0.25.12", - "@esbuild/android-x64": "0.25.12", - "@esbuild/darwin-arm64": "0.25.12", - "@esbuild/darwin-x64": "0.25.12", - "@esbuild/freebsd-arm64": "0.25.12", - "@esbuild/freebsd-x64": "0.25.12", - "@esbuild/linux-arm": "0.25.12", - "@esbuild/linux-arm64": "0.25.12", - "@esbuild/linux-ia32": "0.25.12", - "@esbuild/linux-loong64": "0.25.12", - "@esbuild/linux-mips64el": "0.25.12", - "@esbuild/linux-ppc64": "0.25.12", - "@esbuild/linux-riscv64": "0.25.12", - "@esbuild/linux-s390x": "0.25.12", - "@esbuild/linux-x64": "0.25.12", - "@esbuild/netbsd-arm64": "0.25.12", - "@esbuild/netbsd-x64": "0.25.12", - "@esbuild/openbsd-arm64": "0.25.12", - "@esbuild/openbsd-x64": "0.25.12", - "@esbuild/openharmony-arm64": "0.25.12", - "@esbuild/sunos-x64": "0.25.12", - "@esbuild/win32-arm64": "0.25.12", - "@esbuild/win32-ia32": "0.25.12", - "@esbuild/win32-x64": "0.25.12" - } - }, "node_modules/escalade": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", @@ -3275,15 +3014,22 @@ } }, "node_modules/expect-type": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.2.2.tgz", - "integrity": "sha512-JhFGDVJ7tmDJItKhYgJCGLOWjuK9vPxiXoUFLwLDc99NlmklilbiQJwoctZtt13+xMw91MCk/REan6MWHqDjyA==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.3.0.tgz", + "integrity": "sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==", "dev": true, "license": "Apache-2.0", "engines": { "node": ">=12.0.0" } }, + "node_modules/exponential-backoff": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/exponential-backoff/-/exponential-backoff-3.1.3.tgz", + "integrity": "sha512-ZgEeZXj30q+I0EN+CbSSpIyPaJ5HVQD18Z1m+u1FXbAeT94mr1zw50q4q6jiiC447Nl/YTcIYSAftiGqetwXCA==", + "dev": true, + "license": "Apache-2.0" + }, "node_modules/extract-zip": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", @@ -3312,23 +3058,26 @@ "engines": [ "node >=0.6.0" ], + "license": "MIT", "optional": true }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "license": "MIT" }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fast-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz", - "integrity": "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.2.tgz", + "integrity": "sha512-rVjf7ArG3LTk+FS6Yw81V1DLuZl1bRbNrev6Tmd/9RaroeeRRJhAt7jg/6YFxbvAQXUCavSoZhPPj6oOx+5KjQ==", "funding": [ { "type": "github", @@ -3338,7 +3087,8 @@ "type": "opencollective", "url": "https://opencollective.com/fastify" } - ] + ], + "license": "BSD-3-Clause" }, "node_modules/fd-slicer": { "version": "1.1.0", @@ -3368,46 +3118,44 @@ } }, "node_modules/filelist": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", - "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.6.tgz", + "integrity": "sha512-5giy2PkLYY1cP39p17Ech+2xlpTRL9HLspOfEgm0L6CwBXBTgsK5ou0JtzYuepxkaQ/tvhCFIJ5uXo0OrM2DxA==", "dev": true, + "license": "Apache-2.0", "dependencies": { "minimatch": "^5.0.1" } }, - "node_modules/find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "node_modules/filelist/node_modules/brace-expansion": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.0.tgz", + "integrity": "sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w==", + "dev": true, + "license": "MIT", "dependencies": { - "locate-path": "^3.0.0" - }, - "engines": { - "node": ">=6" + "balanced-match": "^1.0.0" } }, - "node_modules/foreground-child": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", - "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "node_modules/filelist/node_modules/minimatch": { + "version": "5.1.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.9.tgz", + "integrity": "sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==", "dev": true, + "license": "ISC", "dependencies": { - "cross-spawn": "^7.0.6", - "signal-exit": "^4.0.1" + "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": ">=10" } }, "node_modules/form-data": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz", - "integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz", + "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==", "dev": true, + "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -3419,12 +3167,6 @@ "node": ">= 6" } }, - "node_modules/fs-constants": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", - "dev": true - }, "node_modules/fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", @@ -3439,30 +3181,6 @@ "node": ">=6 <7 || >=8" } }, - "node_modules/fs-minipass": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", - "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", - "dev": true, - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/fs-minipass/node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -3489,6 +3207,7 @@ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "dev": true, + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -3507,6 +3226,7 @@ "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", "dev": true, + "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", @@ -3531,6 +3251,7 @@ "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", "dev": true, + "license": "MIT", "dependencies": { "dunder-proto": "^1.0.1", "es-object-atoms": "^1.0.0" @@ -3685,8 +3406,7 @@ "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" }, "node_modules/has-flag": { "version": "4.0.0", @@ -3715,6 +3435,7 @@ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -3727,6 +3448,7 @@ "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", "dev": true, + "license": "MIT", "dependencies": { "has-symbols": "^1.0.3" }, @@ -3738,10 +3460,11 @@ } }, "node_modules/hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.3.tgz", + "integrity": "sha512-ej4AhfhfL2Q2zpMmLo7U1Uv9+PyhIZpgQLGT1F9miIGmiCJIoCgSmczFdrc97mWT4kVY72KA+WnnhJ5pghSvSg==", "dev": true, + "license": "MIT", "dependencies": { "function-bind": "^1.1.2" }, @@ -3754,6 +3477,7 @@ "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", "dev": true, + "license": "ISC", "dependencies": { "lru-cache": "^6.0.0" }, @@ -3775,17 +3499,17 @@ "dev": true }, "node_modules/http-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", - "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", "dev": true, + "license": "MIT", "dependencies": { - "@tootallnate/once": "2", - "agent-base": "6", - "debug": "4" + "agent-base": "^7.1.0", + "debug": "^4.3.4" }, "engines": { - "node": ">= 6" + "node": ">= 14" } }, "node_modules/http2-wrapper": { @@ -3802,16 +3526,17 @@ } }, "node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", "dev": true, + "license": "MIT", "dependencies": { - "agent-base": "6", + "agent-base": "^7.1.2", "debug": "4" }, "engines": { - "node": ">= 6" + "node": ">= 14" } }, "node_modules/iconv-corefoundation": { @@ -3819,6 +3544,7 @@ "resolved": "https://registry.npmjs.org/iconv-corefoundation/-/iconv-corefoundation-1.1.7.tgz", "integrity": "sha512-T10qvkw0zz4wnm560lOEg0PovVqUXuOFhhHAkixw8/sycy7TJt7v/RrkEKEQnAw2viPSJu6iAkErxnzR0g8PpQ==", "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -3836,6 +3562,7 @@ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", "dev": true, + "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" }, @@ -3861,7 +3588,9 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "BSD-3-Clause", + "optional": true }, "node_modules/inflight": { "version": "1.0.6", @@ -3880,18 +3609,6 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, - "node_modules/is-ci": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz", - "integrity": "sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==", - "dev": true, - "dependencies": { - "ci-info": "^3.2.0" - }, - "bin": { - "is-ci": "bin.js" - } - }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -3901,25 +3618,12 @@ "node": ">=8" } }, - "node_modules/is-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", - "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", - "engines": { - "node": ">=8" - } - }, - "node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true - }, "node_modules/isbinaryfile": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-5.0.6.tgz", - "integrity": "sha512-I+NmIfBHUl+r2wcDd6JwE9yWje/PIVY/R5/CmV8dXLZd5K+L9X2klAOwfAHNnondLXkbHyTAleQAWonpTJBTtw==", + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-5.0.7.tgz", + "integrity": "sha512-gnWD14Jh3FzS3CPhF0AxNOJ8CxqeblPTADzI38r0wt8ZyQl5edpy75myt08EG2oKvpyiqSqsx+Wkz9vtkbTqYQ==", "dev": true, + "license": "MIT", "engines": { "node": ">= 18.0.0" }, @@ -3928,10 +3632,14 @@ } }, "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.5.tgz", + "integrity": "sha512-6B3tLtFqtQS4ekarvLVMZ+X+VlvQekbe4taUkf/rhVO3d/h0M2rfARm/pXLcPEsjjMsFgrFgSrhQIxcSVrBz8w==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=18" + } }, "node_modules/istanbul-lib-coverage": { "version": "3.2.2", @@ -3958,21 +3666,6 @@ "node": ">=10" } }, - "node_modules/istanbul-lib-source-maps": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-5.0.6.tgz", - "integrity": "sha512-yg2d+Em4KizZC5niWhQaIomgf5WlL4vOOjZ5xGCmF8SnPE/mDWWXgvRExdcpCgh9lLRRa1/fSYp2ymmbJ1pI+A==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@jridgewell/trace-mapping": "^0.3.23", - "debug": "^4.1.1", - "istanbul-lib-coverage": "^3.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/istanbul-reports": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.2.0.tgz", @@ -3987,26 +3680,12 @@ "node": ">=8" } }, - "node_modules/jackspeak": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", - "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", - "dev": true, - "dependencies": { - "@isaacs/cliui": "^8.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "optionalDependencies": { - "@pkgjs/parseargs": "^0.11.0" - } - }, "node_modules/jake": { "version": "10.9.4", "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.4.tgz", "integrity": "sha512-wpHYzhxiVQL+IV05BLE2Xn34zW1S223hvjtqk0+gsPrwd/8JNLXJgZZM/iPFsYc1xyphF+6M6EvdE5E9MBGkDA==", "dev": true, + "license": "Apache-2.0", "dependencies": { "async": "^3.2.6", "filelist": "^1.0.4", @@ -4019,18 +3698,28 @@ "node": ">=10" } }, + "node_modules/jiti": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.7.0.tgz", + "integrity": "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==", + "dev": true, + "license": "MIT", + "bin": { + "jiti": "lib/jiti-cli.mjs" + } + }, "node_modules/js-tokens": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.1.tgz", - "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-10.0.0.tgz", + "integrity": "sha512-lM/UBzQmfJRo9ABXbPWemivdCW8V2G8FHaHdypQaIy523snUjog0W71ayWXTjiR+ixeMyVHN2XcpnTd/liPg/Q==", "dev": true, "license": "MIT" }, "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", + "license": "MIT", "dependencies": { "argparse": "^2.0.1" }, @@ -4048,12 +3737,14 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/json-schema-typed": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/json-schema-typed/-/json-schema-typed-7.0.3.tgz", - "integrity": "sha512-7DE8mpG+/fVw+dTpjbxnx47TaMnDfOI1jwft9g1VybltZCduyRQPJPvc+zzKY9WPHxhPWczyFuYa6I8Mw4iU5A==" + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/json-schema-typed/-/json-schema-typed-8.0.2.tgz", + "integrity": "sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA==", + "license": "BSD-2-Clause" }, "node_modules/json-stringify-safe": { "version": "5.0.1", @@ -4067,6 +3758,7 @@ "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, + "license": "MIT", "bin": { "json5": "lib/cli.js" }, @@ -4096,97 +3788,300 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/lazy-val/-/lazy-val-1.0.5.tgz", "integrity": "sha512-0/BnGCCfyUMkBpeDgWihanIAF9JmZhHBgUhEqzvf+adhNGLoP6TaiI5oF8oyb3I45P+PcnrqihSf01M0l0G5+Q==", - "dev": true + "license": "MIT" }, - "node_modules/lazystream": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz", - "integrity": "sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==", + "node_modules/lightningcss": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.32.0.tgz", + "integrity": "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==", "dev": true, + "license": "MPL-2.0", "dependencies": { - "readable-stream": "^2.0.5" + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.32.0", + "lightningcss-darwin-arm64": "1.32.0", + "lightningcss-darwin-x64": "1.32.0", + "lightningcss-freebsd-x64": "1.32.0", + "lightningcss-linux-arm-gnueabihf": "1.32.0", + "lightningcss-linux-arm64-gnu": "1.32.0", + "lightningcss-linux-arm64-musl": "1.32.0", + "lightningcss-linux-x64-gnu": "1.32.0", + "lightningcss-linux-x64-musl": "1.32.0", + "lightningcss-win32-arm64-msvc": "1.32.0", + "lightningcss-win32-x64-msvc": "1.32.0" + } + }, + "node_modules/lightningcss-android-arm64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.32.0.tgz", + "integrity": "sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-arm64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.32.0.tgz", + "integrity": "sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">= 0.6.3" + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/lazystream/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "node_modules/lightningcss-darwin-x64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.32.0.tgz", + "integrity": "sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/lazystream/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "node_modules/lightningcss-freebsd-x64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.32.0.tgz", + "integrity": "sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } }, - "node_modules/lazystream/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.32.0.tgz", + "integrity": "sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.32.0.tgz", + "integrity": "sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.32.0.tgz", + "integrity": "sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.32.0.tgz", + "integrity": "sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.32.0.tgz", + "integrity": "sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.32.0.tgz", + "integrity": "sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dependencies": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - }, + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.32.0.tgz", + "integrity": "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": ">=6" + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz", + "integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==", + "dev": true, + "license": "MIT" }, - "node_modules/lodash.defaults": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", - "integrity": "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==", - "dev": true + "node_modules/lodash.escaperegexp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz", + "integrity": "sha512-TM9YBvyC84ZxE3rgfefxUWiQKLilstD6k7PTGt6wfbtXF8ixIJLOL3VYyV/z+ZiPLsVxAsKAFVwWlWeb2Y8Yyw==", + "license": "MIT" }, - "node_modules/lodash.difference": { + "node_modules/lodash.isequal": { "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.difference/-/lodash.difference-4.5.0.tgz", - "integrity": "sha512-dS2j+W26TQ7taQBGN8Lbbq04ssV3emRw4NY58WErlTO29pIqS0HmoT5aJ9+TUQ1N3G+JOZSji4eugsWwGp9yPA==", - "dev": true - }, - "node_modules/lodash.flatten": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", - "integrity": "sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g==", - "dev": true - }, - "node_modules/lodash.isplainobject": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", - "dev": true - }, - "node_modules/lodash.union": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.6.0.tgz", - "integrity": "sha512-c4pB2CdGrGdjMKYLA+XiRDO7Y0PRQbm/Gzg8qMj+QH+pFVAoTp5sBpO0odL3FjoPCGjK96p6qsP+yQoiLoOBcw==", - "dev": true + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==", + "deprecated": "This package is deprecated. Use require('node:util').isDeepStrictEqual instead.", + "license": "MIT" }, "node_modules/lowercase-keys": { "version": "2.0.0", @@ -4202,6 +4097,7 @@ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, + "license": "ISC", "dependencies": { "yallist": "^4.0.0" }, @@ -4220,14 +4116,14 @@ } }, "node_modules/magicast": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.5.1.tgz", - "integrity": "sha512-xrHS24IxaLrvuo613F719wvOIv9xPHFWQHuvGUBmPnCA/3MQxKI3b+r7n1jAoDHmsbC5bRhTZYR77invLAxVnw==", + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.5.2.tgz", + "integrity": "sha512-E3ZJh4J3S9KfwdjZhe2afj6R9lGIN5Pher1pF39UGrXRqq/VDaGVIGN13BjHd2u8B61hArAGOnso7nBOouW3TQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/parser": "^7.28.5", - "@babel/types": "^7.28.5", + "@babel/parser": "^7.29.0", + "@babel/types": "^7.29.0", "source-map-js": "^1.2.1" } }, @@ -4278,6 +4174,7 @@ "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" } @@ -4287,6 +4184,7 @@ "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", "dev": true, + "license": "MIT", "bin": { "mime": "cli.js" }, @@ -4299,6 +4197,7 @@ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -4308,6 +4207,7 @@ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dev": true, + "license": "MIT", "dependencies": { "mime-db": "1.52.0" }, @@ -4315,12 +4215,16 @@ "node": ">= 0.6" } }, - "node_modules/mimic-fn": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-3.1.0.tgz", - "integrity": "sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ==", + "node_modules/mimic-function": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", + "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==", + "license": "MIT", "engines": { - "node": ">=8" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/mimic-response": { @@ -4333,15 +4237,19 @@ } }, "node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "version": "10.2.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", + "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", "dev": true, + "license": "BlueOak-1.0.0", "dependencies": { - "brace-expansion": "^2.0.1" + "brace-expansion": "^5.0.5" }, "engines": { - "node": ">=10" + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/minimist": { @@ -4349,66 +4257,57 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true, + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/minipass": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", - "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", + "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", "dev": true, + "license": "BlueOak-1.0.0", "engines": { - "node": ">=8" + "node": ">=16 || 14 >=14.17" } }, "node_modules/minizlib": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", - "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.1.0.tgz", + "integrity": "sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==", "dev": true, + "license": "MIT", "dependencies": { - "minipass": "^3.0.0", - "yallist": "^4.0.0" + "minipass": "^7.1.2" }, "engines": { - "node": ">= 8" + "node": ">= 18" } }, - "node_modules/minizlib/node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", "dev": true, + "license": "MIT", + "peer": true, "dependencies": { - "yallist": "^4.0.0" + "minimist": "^1.2.6" }, - "engines": { - "node": ">=8" - } - }, - "node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "dev": true, "bin": { "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" } }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "node_modules/nanoid": { - "version": "3.3.11", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", - "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "version": "3.3.12", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.12.tgz", + "integrity": "sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==", "dev": true, "funding": [ { @@ -4424,20 +4323,141 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/node-abi": { + "version": "4.31.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-4.31.0.tgz", + "integrity": "sha512-Erq5w/t3syw3s4sDsUaX4QttIdBPsGKTT1DTRsCkTonGggczhlDKm/wDX3o+HPJpQ41EjXCbcmXf0tgr5YZJXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.6.3" + }, + "engines": { + "node": ">=22.12.0" + } + }, + "node_modules/node-abi/node_modules/semver": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.0.tgz", + "integrity": "sha512-AcM7dV/5ul4EekoQ29Agm5vri8JNqRyj39o0qpX6vDF2GZrtutZl5RwgD1XnZjiTAfncsJhMI48QQH3sN87YNA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/node-addon-api": { "version": "1.7.2", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-1.7.2.tgz", "integrity": "sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg==", "dev": true, + "license": "MIT", "optional": true }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "node_modules/node-api-version": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/node-api-version/-/node-api-version-0.2.1.tgz", + "integrity": "sha512-2xP/IGGMmmSQpI1+O/k72jF/ykvZ89JeuKX3TLJAYPDVLUalrshrLHkeVcCCZqG/eEa635cr8IBYzgnDvM2O8Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.3.5" + } + }, + "node_modules/node-api-version/node_modules/semver": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.0.tgz", + "integrity": "sha512-AcM7dV/5ul4EekoQ29Agm5vri8JNqRyj39o0qpX6vDF2GZrtutZl5RwgD1XnZjiTAfncsJhMI48QQH3sN87YNA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-gyp": { + "version": "12.3.0", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-12.3.0.tgz", + "integrity": "sha512-QNcUWM+HgJplcPzBvFBZ9VXacyGZ4+VTOb80PwWR+TlVzoHbRKULNEzpRsnaoxG3Wzr7Qh7BYxGDU3CbKib2Yg==", "dev": true, + "license": "MIT", + "dependencies": { + "env-paths": "^2.2.0", + "exponential-backoff": "^3.1.1", + "graceful-fs": "^4.2.6", + "nopt": "^9.0.0", + "proc-log": "^6.0.0", + "semver": "^7.3.5", + "tar": "^7.5.4", + "tinyglobby": "^0.2.12", + "undici": "^6.25.0", + "which": "^6.0.0" + }, + "bin": { + "node-gyp": "bin/node-gyp.js" + }, "engines": { - "node": ">=0.10.0" + "node": "^20.17.0 || >=22.9.0" + } + }, + "node_modules/node-gyp/node_modules/isexe": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-4.0.0.tgz", + "integrity": "sha512-FFUtZMpoZ8RqHS3XeXEmHWLA4thH+ZxCv2lOiPIn1Xc7CxrqhWzNSDzD+/chS/zbYezmiwWLdQC09JdQKmthOw==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=20" + } + }, + "node_modules/node-gyp/node_modules/semver": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.0.tgz", + "integrity": "sha512-AcM7dV/5ul4EekoQ29Agm5vri8JNqRyj39o0qpX6vDF2GZrtutZl5RwgD1XnZjiTAfncsJhMI48QQH3sN87YNA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-gyp/node_modules/which": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/which/-/which-6.0.1.tgz", + "integrity": "sha512-oGLe46MIrCRqX7ytPUf66EAYvdeMIZYn3WaocqqKZAxrBpkqHfL/qvTyJ/bTk5+AqHCjXmrv3CEWgy368zhRUg==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^4.0.0" + }, + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + } + }, + "node_modules/nopt": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-9.0.0.tgz", + "integrity": "sha512-Zhq3a+yFKrYwSBluL4H9XP3m3y5uvQkB/09CwDruCiRmR/UJYnn9W4R48ry0uGC70aeTPKLynBtscP9efFFcPw==", + "dev": true, + "license": "ISC", + "dependencies": { + "abbrev": "^4.0.0" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" } }, "node_modules/normalize-url": { @@ -4482,28 +4502,6 @@ "wrappy": "1" } }, - "node_modules/onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dependencies": { - "mimic-fn": "^2.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/onetime/node_modules/mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "engines": { - "node": ">=6" - } - }, "node_modules/p-cancelable": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz", @@ -4514,52 +4512,21 @@ } }, "node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", "dependencies": { - "p-try": "^2.0.0" + "yocto-queue": "^0.1.0" }, "engines": { - "node": ">=6" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dependencies": { - "p-limit": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "engines": { - "node": ">=6" - } - }, - "node_modules/package-json-from-dist": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", - "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", - "dev": true - }, - "node_modules/path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", - "engines": { - "node": ">=4" - } - }, "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -4574,32 +4541,11 @@ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, - "node_modules/path-scurry": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", - "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", - "dev": true, - "dependencies": { - "lru-cache": "^10.2.0", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" - }, - "engines": { - "node": ">=16 || 14 >=14.18" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/path-scurry/node_modules/lru-cache": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", - "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", - "dev": true - }, "node_modules/pathe": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", @@ -4607,6 +4553,21 @@ "dev": true, "license": "MIT" }, + "node_modules/pe-library": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/pe-library/-/pe-library-0.4.1.tgz", + "integrity": "sha512-eRWB5LBz7PpDu4PUlwT0PhnQfTQJlDDdPa35urV4Osrm0t0AqQFGn+UIkU3klZvwJ8KPO3VbBFsXquA6p6kqZw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12", + "npm": ">=6" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/jet2jet" + } + }, "node_modules/pend": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", @@ -4616,16 +4577,14 @@ "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", - "dev": true + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==" }, "node_modules/picomatch": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", - "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", + "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -4633,22 +4592,12 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/pkg-up": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-3.1.0.tgz", - "integrity": "sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA==", - "dependencies": { - "find-up": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/plist": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/plist/-/plist-3.1.0.tgz", "integrity": "sha512-uysumyrvkUX0rX/dEVqt8gC3sTBzd4zoWfLeS29nb53imdaXVvLINYXTI2GNqzaMuvacNx4uJQ8+b3zXR0pkgQ==", "dev": true, + "license": "MIT", "dependencies": { "@xmldom/xmldom": "^0.8.8", "base64-js": "^1.5.1", @@ -4659,9 +4608,9 @@ } }, "node_modules/postcss": { - "version": "8.5.6", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", - "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==", + "version": "8.5.14", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.14.tgz", + "integrity": "sha512-SoSL4+OSEtR99LHFZQiJLkT59C5B1amGO1NzTwj7TT1qCUgUO6hxOvzkOYxD+vMrXBM3XJIKzokoERdqQq/Zmg==", "dev": true, "funding": [ { @@ -4687,11 +4636,45 @@ "node": "^10 || ^12 || >=14" } }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true + "node_modules/postject": { + "version": "1.0.0-alpha.6", + "resolved": "https://registry.npmjs.org/postject/-/postject-1.0.0-alpha.6.tgz", + "integrity": "sha512-b9Eb8h2eVqNE8edvKdwqkrY6O7kAwmI8kcnBv1NScolYJbo59XUF0noFq+lxbC1yN20bmC0WBEbDC5H/7ASb0A==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "commander": "^9.4.0" + }, + "bin": { + "postject": "dist/cli.js" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/postject/node_modules/commander": { + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", + "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "engines": { + "node": "^12.20.0 || >=14" + } + }, + "node_modules/proc-log": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-6.1.0.tgz", + "integrity": "sha512-iG+GYldRf2BQ0UDUAd6JQ/RwzaQy6mXmsk/IzlYyal4A4SNFw54MeH4/tLkF4I5WoWG9SQwuqWzS99jaFQHBuQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^20.17.0 || >=22.9.0" + } }, "node_modules/progress": { "version": "2.0.3", @@ -4707,6 +4690,7 @@ "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", "dev": true, + "license": "MIT", "dependencies": { "err-code": "^2.0.2", "retry": "^0.12.0" @@ -4715,6 +4699,18 @@ "node": ">=10" } }, + "node_modules/proper-lockfile": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/proper-lockfile/-/proper-lockfile-4.1.2.tgz", + "integrity": "sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.4", + "retry": "^0.12.0", + "signal-exit": "^3.0.2" + } + }, "node_modules/pump": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.3.tgz", @@ -4730,6 +4726,7 @@ "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -4746,44 +4743,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/read-config-file": { - "version": "6.3.2", - "resolved": "https://registry.npmjs.org/read-config-file/-/read-config-file-6.3.2.tgz", - "integrity": "sha512-M80lpCjnE6Wt6zb98DoW8WHR09nzMSpu8XHtPkiTHrJ5Az9CybfeQhTJ8D7saeBHpGhLPIVyA8lcL6ZmdKwY6Q==", - "dev": true, - "dependencies": { - "config-file-ts": "^0.2.4", - "dotenv": "^9.0.2", - "dotenv-expand": "^5.1.0", - "js-yaml": "^4.1.0", - "json5": "^2.2.0", - "lazy-val": "^1.0.4" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "node_modules/read-binary-file-arch": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/read-binary-file-arch/-/read-binary-file-arch-1.0.6.tgz", + "integrity": "sha512-BNg9EN3DD3GsDXX7Aa8O4p92sryjkmzYYgmgTAc6CA4uGLEDzFfxOxugu21akOxpcXHiEgsYkC6nPsQvLLLmEg==", "dev": true, + "license": "MIT", "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" + "debug": "^4.3.4" }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/readdir-glob": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/readdir-glob/-/readdir-glob-1.1.3.tgz", - "integrity": "sha512-v05I2k7xN8zXvPD9N+z/uhXPaj0sUFCe2rcWZIpBsqxfP7xXFQ0tipAd/wjj1YxWyWtUS5IDJpOG82JKt2EAVA==", - "dev": true, - "dependencies": { - "minimatch": "^5.1.0" + "bin": { + "read-binary-file-arch": "cli.js" } }, "node_modules/require-directory": { @@ -4799,10 +4769,29 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "license": "MIT", "engines": { "node": ">=0.10.0" } }, + "node_modules/resedit": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/resedit/-/resedit-1.7.2.tgz", + "integrity": "sha512-vHjcY2MlAITJhC0eRD/Vv8Vlgmu9Sd3LX9zZvtGzU5ZImdTN3+d6e/4mnTyV8vEbyf1sgNIrWxhWlrys52OkEA==", + "dev": true, + "license": "MIT", + "dependencies": { + "pe-library": "^0.4.1" + }, + "engines": { + "node": ">=12", + "npm": ">=6" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/jet2jet" + } + }, "node_modules/resolve-alpn": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", @@ -4826,10 +4815,26 @@ "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", "dev": true, + "license": "MIT", "engines": { "node": ">= 4" } }, + "node_modules/rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, "node_modules/roarr": { "version": "2.15.4", "resolved": "https://registry.npmjs.org/roarr/-/roarr-2.15.4.tgz", @@ -4848,88 +4853,65 @@ "node": ">=8.0" } }, - "node_modules/rollup": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.53.3.tgz", - "integrity": "sha512-w8GmOxZfBmKknvdXU1sdM9NHcoQejwF/4mNgj2JuEEdRaHwwF12K7e9eXn1nLZ07ad+du76mkVsyeb2rKGllsA==", + "node_modules/rolldown": { + "version": "1.0.0-rc.18", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.0-rc.18.tgz", + "integrity": "sha512-phmyKBpuBdRYDf4hgyynGAYn/rDDe+iZXKVJ7WX5b1zQzpLkP5oJRPGsfJuHdzPMlyyEO/4sPW6yfSx2gf7lVg==", "dev": true, "license": "MIT", "dependencies": { - "@types/estree": "1.0.8" + "@oxc-project/types": "=0.128.0", + "@rolldown/pluginutils": "1.0.0-rc.18" }, "bin": { - "rollup": "dist/bin/rollup" + "rolldown": "bin/cli.mjs" }, "engines": { - "node": ">=18.0.0", - "npm": ">=8.0.0" + "node": "^20.19.0 || >=22.12.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.53.3", - "@rollup/rollup-android-arm64": "4.53.3", - "@rollup/rollup-darwin-arm64": "4.53.3", - "@rollup/rollup-darwin-x64": "4.53.3", - "@rollup/rollup-freebsd-arm64": "4.53.3", - "@rollup/rollup-freebsd-x64": "4.53.3", - "@rollup/rollup-linux-arm-gnueabihf": "4.53.3", - "@rollup/rollup-linux-arm-musleabihf": "4.53.3", - "@rollup/rollup-linux-arm64-gnu": "4.53.3", - "@rollup/rollup-linux-arm64-musl": "4.53.3", - "@rollup/rollup-linux-loong64-gnu": "4.53.3", - "@rollup/rollup-linux-ppc64-gnu": "4.53.3", - "@rollup/rollup-linux-riscv64-gnu": "4.53.3", - "@rollup/rollup-linux-riscv64-musl": "4.53.3", - "@rollup/rollup-linux-s390x-gnu": "4.53.3", - "@rollup/rollup-linux-x64-gnu": "4.53.3", - "@rollup/rollup-linux-x64-musl": "4.53.3", - "@rollup/rollup-openharmony-arm64": "4.53.3", - "@rollup/rollup-win32-arm64-msvc": "4.53.3", - "@rollup/rollup-win32-ia32-msvc": "4.53.3", - "@rollup/rollup-win32-x64-gnu": "4.53.3", - "@rollup/rollup-win32-x64-msvc": "4.53.3", - "fsevents": "~2.3.2" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] + "@rolldown/binding-android-arm64": "1.0.0-rc.18", + "@rolldown/binding-darwin-arm64": "1.0.0-rc.18", + "@rolldown/binding-darwin-x64": "1.0.0-rc.18", + "@rolldown/binding-freebsd-x64": "1.0.0-rc.18", + "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-rc.18", + "@rolldown/binding-linux-arm64-gnu": "1.0.0-rc.18", + "@rolldown/binding-linux-arm64-musl": "1.0.0-rc.18", + "@rolldown/binding-linux-ppc64-gnu": "1.0.0-rc.18", + "@rolldown/binding-linux-s390x-gnu": "1.0.0-rc.18", + "@rolldown/binding-linux-x64-gnu": "1.0.0-rc.18", + "@rolldown/binding-linux-x64-musl": "1.0.0-rc.18", + "@rolldown/binding-openharmony-arm64": "1.0.0-rc.18", + "@rolldown/binding-wasm32-wasi": "1.0.0-rc.18", + "@rolldown/binding-win32-arm64-msvc": "1.0.0-rc.18", + "@rolldown/binding-win32-x64-msvc": "1.0.0-rc.18" + } }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/sanitize-filename": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/sanitize-filename/-/sanitize-filename-1.6.3.tgz", - "integrity": "sha512-y/52Mcy7aw3gRm7IrcGDFx/bCk4AhRh2eI9luHOQM86nZsqwiRkkq2GekHXBBD+SmPidc8i2PqtYZl+pWJ8Oeg==", + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/sanitize-filename/-/sanitize-filename-1.6.4.tgz", + "integrity": "sha512-9ZyI08PsvdQl2r/bBIGubpVdR3RR9sY6RDiWFPreA21C/EFlQhmgo20UZlNjZMMZNubusLhAQozkA0Od5J21Eg==", "dev": true, + "license": "WTFPL OR ISC", "dependencies": { "truncate-utf8-bytes": "^1.0.0" } }, "node_modules/sax": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz", - "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==", - "dev": true + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.6.0.tgz", + "integrity": "sha512-6R3J5M4AcbtLUdZmRv2SygeVaM7IhrLXu9BmnOGmmACak8fiUtOsYNWUS4uK7upbmHIBbLBeFeI//477BKLBzA==", + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=11.0.0" + } }, "node_modules/semver": { "version": "6.3.1", @@ -4981,6 +4963,7 @@ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, + "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" }, @@ -4993,6 +4976,7 @@ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -5005,16 +4989,11 @@ "license": "ISC" }, "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==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } + "license": "ISC" }, "node_modules/simple-update-notifier": { "version": "2.0.0", @@ -5045,6 +5024,7 @@ "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz", "integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "ansi-styles": "^4.0.0", @@ -5060,6 +5040,7 @@ "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", "dev": true, + "license": "MIT", "optional": true, "engines": { "node": ">= 6.0.0", @@ -5071,6 +5052,7 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } @@ -5090,6 +5072,7 @@ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", "dev": true, + "license": "MIT", "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -5114,26 +5097,18 @@ "resolved": "https://registry.npmjs.org/stat-mode/-/stat-mode-1.0.0.tgz", "integrity": "sha512-jH9EhtKIjuXZ2cWxmXS8ZP80XyC3iasQxMDV8jzhNJpfDb7VbQLVW4Wvsxz9QZvzV+G4YoSfBUVKDOyxLzi/sg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 6" } }, "node_modules/std-env": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.10.0.tgz", - "integrity": "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.1.0.tgz", + "integrity": "sha512-Rq7ybcX2RuC55r9oaPVEW7/xu3tj8u4GeBYHBWCychFtzMIr86A7e3PPEBPT37sHStKX3+TiX/Fr/ACmJLVlLQ==", "dev": true, "license": "MIT" }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -5148,21 +5123,6 @@ "node": ">=8" } }, - "node_modules/string-width-cjs": { - "name": "string-width", - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -5175,19 +5135,21 @@ "node": ">=8" } }, - "node_modules/strip-ansi-cjs": { - "name": "strip-ansi", - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, + "node_modules/stubborn-fs": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/stubborn-fs/-/stubborn-fs-2.0.0.tgz", + "integrity": "sha512-Y0AvSwDw8y+nlSNFXMm2g6L51rBGdAQT20J3YSOqxC53Lo3bjWRtr2BKcfYoAf352WYpsZSTURrA0tqhfgudPA==", + "license": "MIT", "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" + "stubborn-utils": "^1.0.1" } }, + "node_modules/stubborn-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/stubborn-utils/-/stubborn-utils-1.0.2.tgz", + "integrity": "sha512-zOh9jPYI+xrNOyisSelgym4tolKTJCQd5GBhK0+0xJvcYDcwlOoxF/rnFKQ2KRZknXSG9jWAp66fwP6AxN9STg==", + "license": "MIT" + }, "node_modules/sumchecker": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/sumchecker/-/sumchecker-3.0.1.tgz", @@ -5212,37 +5174,58 @@ "node": ">=8" } }, + "node_modules/tagged-tag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/tagged-tag/-/tagged-tag-1.0.0.tgz", + "integrity": "sha512-yEFYrVhod+hdNyx7g5Bnkkb0G6si8HJurOoOEgC8B/O0uXLHlaey/65KRv6cuWBNhBgHKAROVpc7QyYqE5gFng==", + "license": "MIT", + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/tar": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", - "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", + "version": "7.5.15", + "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.15.tgz", + "integrity": "sha512-dzGK0boVlC4W5QFuQN1EFSl3bIDYsk7Tj40U6eIBnK2k/8ml7TZ5agbI5j5+qnoVcAA+rNtBml8SEiLxZpNqRQ==", "dev": true, + "license": "BlueOak-1.0.0", "dependencies": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^5.0.0", - "minizlib": "^2.1.1", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" + "@isaacs/fs-minipass": "^4.0.0", + "chownr": "^3.0.0", + "minipass": "^7.1.2", + "minizlib": "^3.1.0", + "yallist": "^5.0.0" }, "engines": { - "node": ">=10" + "node": ">=18" } }, - "node_modules/tar-stream": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", - "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "node_modules/tar/node_modules/yallist": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz", + "integrity": "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=18" + } + }, + "node_modules/temp": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/temp/-/temp-0.9.4.tgz", + "integrity": "sha512-yYrrsWnrXMcdsnu/7YMYAofM1ktpL5By7vZhf15CrXijWWrEYZks5AXBudalfSWJLlnen/QUJUB5aoB0kqZUGA==", "dev": true, + "license": "MIT", + "peer": true, "dependencies": { - "bl": "^4.0.3", - "end-of-stream": "^1.4.1", - "fs-constants": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1" + "mkdirp": "^0.5.1", + "rimraf": "~2.6.2" }, "engines": { - "node": ">=6" + "node": ">=6.0.0" } }, "node_modules/temp-file": { @@ -5250,6 +5233,7 @@ "resolved": "https://registry.npmjs.org/temp-file/-/temp-file-3.4.0.tgz", "integrity": "sha512-C5tjlC/HCtVUOi3KWVokd4vHVViOmGjtLwIh4MuzPo/nMYTV/p1urt3RnMz2IWXDdKEGJH3k5+KPxtqRsUYGtg==", "dev": true, + "license": "MIT", "dependencies": { "async-exit-hook": "^2.0.1", "fs-extra": "^10.0.0" @@ -5260,6 +5244,7 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", "dev": true, + "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -5270,10 +5255,11 @@ } }, "node_modules/temp-file/node_modules/jsonfile": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", - "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.1.tgz", + "integrity": "sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==", "dev": true, + "license": "MIT", "dependencies": { "universalify": "^2.0.0" }, @@ -5286,10 +5272,37 @@ "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "dev": true, + "license": "MIT", "engines": { "node": ">= 10.0.0" } }, + "node_modules/tiny-async-pool": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/tiny-async-pool/-/tiny-async-pool-1.3.0.tgz", + "integrity": "sha512-01EAw5EDrcVrdgyCLgoSPvqznC0sVxDSVeiOz09FUpjh71G79VCqneOr+xvt7T1r76CF6ZZfPjHorN2+d+3mqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^5.5.0" + } + }, + "node_modules/tiny-async-pool/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/tiny-typed-emitter": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tiny-typed-emitter/-/tiny-typed-emitter-2.1.0.tgz", + "integrity": "sha512-qVtvMxeXbVej0cQWKqVSSAHmKZEHAvxdF8HEUBFWts8h+xEo5m/lEiPakuyZ3BnCBjOD8i24kzNOiOLLgsSxhA==", + "license": "MIT" + }, "node_modules/tinybench": { "version": "2.9.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", @@ -5298,21 +5311,24 @@ "license": "MIT" }, "node_modules/tinyexec": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", - "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.1.2.tgz", + "integrity": "sha512-dAqSqE/RabpBKI8+h26GfLq6Vb3JVXs30XYQjdMjaj/c2tS8IYYMbIzP599KtRj7c57/wYApb3QjgRgXmrCukA==", "dev": true, - "license": "MIT" + "license": "MIT", + "engines": { + "node": ">=18" + } }, "node_modules/tinyglobby": { - "version": "0.2.15", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", - "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "version": "0.2.16", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.16.tgz", + "integrity": "sha512-pn99VhoACYR8nFHhxqix+uvsbXineAasWm5ojXoN8xEwK5Kd3/TrhNn1wByuD52UxWRLy8pu+kRMniEi6Eq9Zg==", "dev": true, "license": "MIT", "dependencies": { "fdir": "^6.5.0", - "picomatch": "^4.0.3" + "picomatch": "^4.0.4" }, "engines": { "node": ">=12.0.0" @@ -5322,9 +5338,9 @@ } }, "node_modules/tinyrainbow": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-3.0.3.tgz", - "integrity": "sha512-PSkbLUoxOFRzJYjjxHJt9xro7D+iilgMX/C9lawzVuYiIdcihh9DXmVibBe8lmcFrRi/VzlPjBxbN7rH24q8/Q==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-3.1.0.tgz", + "integrity": "sha512-Bf+ILmBgretUrdJxzXM0SgXLZ3XfiaUuOj/IKQHuTXip+05Xn+uyEYdVg0kYDipTBcLrCVyUzAPz7QmArb0mmw==", "dev": true, "license": "MIT", "engines": { @@ -5336,6 +5352,7 @@ "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.5.tgz", "integrity": "sha512-voyz6MApa1rQGUxT3E+BK7/ROe8itEx7vD8/HEvt4xwXucvQ5G5oeEiHkmHZJuBO21RpOf+YYm9MOivj709jow==", "dev": true, + "license": "MIT", "engines": { "node": ">=14.14" } @@ -5345,6 +5362,7 @@ "resolved": "https://registry.npmjs.org/tmp-promise/-/tmp-promise-3.0.3.tgz", "integrity": "sha512-RwM7MoPojPxsOBYnyd2hy0bxtIlVrihNs9pj5SUvY8Zz1sQcQG2tG1hSr8PDxfgEB8RNKDhqbIlroIarSNDNsQ==", "dev": true, + "license": "MIT", "dependencies": { "tmp": "^0.2.0" } @@ -5354,32 +5372,54 @@ "resolved": "https://registry.npmjs.org/truncate-utf8-bytes/-/truncate-utf8-bytes-1.0.2.tgz", "integrity": "sha512-95Pu1QXQvruGEhv62XCMO3Mm90GscOCClvrIUwCM0PYOXK3kaF3l3sIHxx71ThJfcbM2O5Au6SO3AWCSEfW4mQ==", "dev": true, + "license": "WTFPL", "dependencies": { "utf8-byte-length": "^1.0.1" } }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD", + "optional": true + }, "node_modules/type-fest": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", - "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-5.6.0.tgz", + "integrity": "sha512-8ZiHFm91orbSAe2PSAiSVBVko18pbhbiB3U9GglSzF/zCGkR+rxpHx6sEMCUm4kxY4LjDIUGgCfUMtwfZfjfUA==", + "license": "(MIT OR CC0-1.0)", + "dependencies": { + "tagged-tag": "^1.0.0" + }, "engines": { - "node": ">=12.20" + "node": ">=20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/typescript": { - "version": "5.9.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", - "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" + "node_modules/uint8array-extras": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/uint8array-extras/-/uint8array-extras-1.5.0.tgz", + "integrity": "sha512-rvKSBiC5zqCCiDZ9kAOszZcDvdAHwwIKJG33Ykj43OKcWsnmcBRL09YTU4nOeHZ8Y2a7l1MgTd08SBe9A8Qj6A==", + "license": "MIT", + "engines": { + "node": ">=18" }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/undici": { + "version": "6.25.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.25.0.tgz", + "integrity": "sha512-ZgpWDC5gmNiuY9CnLVXEH8rl50xhRCuLNA97fAUnKi8RRuV4E6KG31pDTsLVUKnohJE0I3XDrTeEydAXRw47xg==", + "dev": true, + "license": "MIT", "engines": { - "node": ">=14.17" + "node": ">=18.17" } }, "node_modules/undici-types": { @@ -5403,6 +5443,7 @@ "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "punycode": "^2.1.0" } @@ -5411,19 +5452,15 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.5.tgz", "integrity": "sha512-Xn0w3MtiQ6zoz2vFyUVruaCL53O/DwUvkEeOvj+uulMm0BkUGYWmBYVyElqZaSLhY6ZD0ulfU3aBra2aVT4xfA==", - "dev": true - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "dev": true + "dev": true, + "license": "(WTFPL OR MIT)" }, "node_modules/verror": { "version": "1.10.1", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.1.tgz", "integrity": "sha512-veufcmxri4e3XSrT0xwfUR7kguIkaxBeosDg00yDWhk49wdwkSUrvvsm7nc75e1PUyvIeZj6nS8VQRYz2/S4Xg==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "assert-plus": "^1.0.0", @@ -5435,19 +5472,17 @@ } }, "node_modules/vite": { - "version": "7.2.4", - "resolved": "https://registry.npmjs.org/vite/-/vite-7.2.4.tgz", - "integrity": "sha512-NL8jTlbo0Tn4dUEXEsUg8KeyG/Lkmc4Fnzb8JXN/Ykm9G4HNImjtABMJgkQoVjOBN/j2WAwDTRytdqJbZsah7w==", + "version": "8.0.11", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.0.11.tgz", + "integrity": "sha512-Jz1mxtUBR5xTT65VOdJZUUeoyLtqljmFkiUXhPTLZka3RDc9vpi/xXkyrnsdRcm2lIi3l3GPMnAidTsEGIj3Ow==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { - "esbuild": "^0.25.0", - "fdir": "^6.5.0", - "picomatch": "^4.0.3", - "postcss": "^8.5.6", - "rollup": "^4.43.0", - "tinyglobby": "^0.2.15" + "lightningcss": "^1.32.0", + "picomatch": "^4.0.4", + "postcss": "^8.5.14", + "rolldown": "1.0.0-rc.18", + "tinyglobby": "^0.2.16" }, "bin": { "vite": "bin/vite.js" @@ -5463,9 +5498,10 @@ }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.1.18", + "esbuild": "^0.27.0 || ^0.28.0", "jiti": ">=1.21.0", "less": "^4.0.0", - "lightningcss": "^1.21.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", @@ -5478,13 +5514,16 @@ "@types/node": { "optional": true }, - "jiti": { + "@vitejs/devtools": { "optional": true }, - "less": { + "esbuild": { + "optional": true + }, + "jiti": { "optional": true }, - "lightningcss": { + "less": { "optional": true }, "sass": { @@ -5511,32 +5550,31 @@ } }, "node_modules/vitest": { - "version": "4.0.14", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-4.0.14.tgz", - "integrity": "sha512-d9B2J9Cm9dN9+6nxMnnNJKJCtcyKfnHj15N6YNJfaFHRLua/d3sRKU9RuKmO9mB0XdFtUizlxfz/VPbd3OxGhw==", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-4.1.5.tgz", + "integrity": "sha512-9Xx1v3/ih3m9hN+SbfkUyy0JAs72ap3r7joc87XL6jwF0jGg6mFBvQ1SrwaX+h8BlkX6Hz9shdd1uo6AF+ZGpg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { - "@vitest/expect": "4.0.14", - "@vitest/mocker": "4.0.14", - "@vitest/pretty-format": "4.0.14", - "@vitest/runner": "4.0.14", - "@vitest/snapshot": "4.0.14", - "@vitest/spy": "4.0.14", - "@vitest/utils": "4.0.14", - "es-module-lexer": "^1.7.0", - "expect-type": "^1.2.2", + "@vitest/expect": "4.1.5", + "@vitest/mocker": "4.1.5", + "@vitest/pretty-format": "4.1.5", + "@vitest/runner": "4.1.5", + "@vitest/snapshot": "4.1.5", + "@vitest/spy": "4.1.5", + "@vitest/utils": "4.1.5", + "es-module-lexer": "^2.0.0", + "expect-type": "^1.3.0", "magic-string": "^0.30.21", "obug": "^2.1.1", "pathe": "^2.0.3", "picomatch": "^4.0.3", - "std-env": "^3.10.0", + "std-env": "^4.0.0-rc.1", "tinybench": "^2.9.0", - "tinyexec": "^0.3.2", + "tinyexec": "^1.0.2", "tinyglobby": "^0.2.15", - "tinyrainbow": "^3.0.3", - "vite": "^6.0.0 || ^7.0.0", + "tinyrainbow": "^3.1.0", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0", "why-is-node-running": "^2.3.0" }, "bin": { @@ -5552,12 +5590,15 @@ "@edge-runtime/vm": "*", "@opentelemetry/api": "^1.9.0", "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0", - "@vitest/browser-playwright": "4.0.14", - "@vitest/browser-preview": "4.0.14", - "@vitest/browser-webdriverio": "4.0.14", - "@vitest/ui": "4.0.14", + "@vitest/browser-playwright": "4.1.5", + "@vitest/browser-preview": "4.1.5", + "@vitest/browser-webdriverio": "4.1.5", + "@vitest/coverage-istanbul": "4.1.5", + "@vitest/coverage-v8": "4.1.5", + "@vitest/ui": "4.1.5", "happy-dom": "*", - "jsdom": "*" + "jsdom": "*", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "@edge-runtime/vm": { @@ -5578,6 +5619,12 @@ "@vitest/browser-webdriverio": { "optional": true }, + "@vitest/coverage-istanbul": { + "optional": true + }, + "@vitest/coverage-v8": { + "optional": true + }, "@vitest/ui": { "optional": true }, @@ -5586,22 +5633,32 @@ }, "jsdom": { "optional": true + }, + "vite": { + "optional": false } } }, + "node_modules/when-exit": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/when-exit/-/when-exit-2.1.5.tgz", + "integrity": "sha512-VGkKJ564kzt6Ms1dbgPP/yuIoQCrsFAnRbptpC5wOEsDaNsbCB2bnfnaA8i/vRs5tjUSEOtIuvl9/MyVsvQZCg==", + "license": "MIT" + }, "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/which/-/which-5.0.0.tgz", + "integrity": "sha512-JEdGzHwwkrbWoGOlIHqQ5gtprKGOenpDHpxE9zVR1bWbOtYRyPPHMe9FaP6x61CmNaTThSkb0DAJte5jD+DmzQ==", "dev": true, + "license": "ISC", "dependencies": { - "isexe": "^2.0.0" + "isexe": "^3.1.1" }, "bin": { - "node-which": "bin/node-which" + "node-which": "bin/which.js" }, "engines": { - "node": ">= 8" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/why-is-node-running": { @@ -5638,24 +5695,6 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/wrap-ansi-cjs": { - "name": "wrap-ansi", - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -5667,6 +5706,7 @@ "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-15.1.1.tgz", "integrity": "sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg==", "dev": true, + "license": "MIT", "engines": { "node": ">=8.0" } @@ -5684,7 +5724,8 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/yargs": { "version": "17.7.2", @@ -5723,39 +5764,17 @@ "fd-slicer": "~1.1.0" } }, - "node_modules/zip-stream": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-4.1.1.tgz", - "integrity": "sha512-9qv4rlDiopXg4E69k+vMHjNN63YFMe9sZMrdlvKnCjlCRWeCBswPPMPUfx+ipsAWq1LXHe70RcbaHdJJpS6hyQ==", + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, - "dependencies": { - "archiver-utils": "^3.0.4", - "compress-commons": "^4.1.2", - "readable-stream": "^3.6.0" - }, + "license": "MIT", "engines": { - "node": ">= 10" - } - }, - "node_modules/zip-stream/node_modules/archiver-utils": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-3.0.4.tgz", - "integrity": "sha512-KVgf4XQVrTjhyWmx6cte4RxonPLR9onExufI1jhvw/MQ4BB6IsZD5gT8Lq+u/+pRkWna/6JoHpiQioaqFP5Rzw==", - "dev": true, - "dependencies": { - "glob": "^7.2.3", - "graceful-fs": "^4.2.0", - "lazystream": "^1.0.0", - "lodash.defaults": "^4.2.0", - "lodash.difference": "^4.5.0", - "lodash.flatten": "^4.4.0", - "lodash.isplainobject": "^4.0.6", - "lodash.union": "^4.6.0", - "normalize-path": "^3.0.0", - "readable-stream": "^3.6.0" + "node": ">=10" }, - "engines": { - "node": ">= 10" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } } } diff --git a/electron-app/package.json b/electron-app/package.json index 1f1270cec..0975ce57e 100644 --- a/electron-app/package.json +++ b/electron-app/package.json @@ -1,13 +1,20 @@ { "name": "hyperloop-control-station", - "version": "1.0.0", + "version": "11.1.0", "description": "Hyperloop UPV Control Station", "main": "main.js", "type": "module", "author": { "name": "Hyperloop UPV", - "email": "max766667@gmail.com" + "email": "partners@hyperloopupv.com" }, + "contributors": [ + { "name": "Maxim Grivennyy", "email": "max766667@gmail.com" }, + { "name": "Javier Ribal del Río", "email": "javierribaldelrio@gmail.com" }, + { "name": "Lola Castello" }, + { "name": "Alejandro González" }, + { "name": "Vasyl Klymenko" } + ], "license": "MIT", "repository": { "type": "git", @@ -30,8 +37,13 @@ "build:backend:win": "node build.mjs --backend --win", "build:backend:linux": "node build.mjs --backend --linux", "build:backend:mac": "node build.mjs --backend --mac", + "build:blcu": "node build.mjs --blcu-programming", + "build:blcu:win": "node build.mjs --blcu-programming --win", + "build:blcu:linux": "node build.mjs --blcu-programming --linux", + "build:blcu:mac": "node build.mjs --blcu-programming --mac", "build:testing": "node build.mjs --testing-view", "build:competition": "node build.mjs --competition-view", + "build:flashing": "node build.mjs --flashing-view", "asar:win": "asar list dist/win-unpacked/resources/app.asar | findstr /V node_modules", "asar:mac": "asar list dist/mac-unpacked/resources/app.asar | findstr /V node_modules", "asar:linux": "asar list dist/linux-unpacked/resources/app.asar | findstr /V node_modules" @@ -107,12 +119,15 @@ "linux": { "target": [ "AppImage", - "deb" + "deb", + "rpm" ], "icon": "icons/512x512.png", "category": "Utility", "artifactName": "${productName}-${version}-linux-${arch}.${ext}", - "executableArgs": ["--no-sandbox"] + "executableArgs": [ + "--no-sandbox" + ] } } } diff --git a/electron-app/preload.js b/electron-app/preload.js index 5fda40215..3dce66219 100644 --- a/electron-app/preload.js +++ b/electron-app/preload.js @@ -38,6 +38,21 @@ contextBridge.exposeInMainWorld("electronAPI", { selectFolder: () => ipcRenderer.invoke("select-folder"), // Open a folder path in the OS file explorer openFolder: (path) => ipcRenderer.invoke("open-folder", path), + // BLCU: open native file picker and return the selected path + blcuSelectFile: () => ipcRenderer.invoke("blcu-select-file"), + // BLCU: read a file from disk and return its contents as a Buffer + blcuReadFile: (path) => ipcRenderer.invoke("blcu-read-file", path), + // Get the application version from the main process + getAppVersion: () => ipcRenderer.invoke("get-app-version"), + // Restart the backend process and reload the renderer when ready + restartBackend: () => ipcRenderer.invoke("restart-backend"), + // Get the list of views available in this build + getAvailableViews: () => ipcRenderer.invoke("get-available-views"), + // Set initial mode (used by mode selector renderer) + setInitialMode: (mode) => { + ipcRenderer.send("mode-selected", mode); + return Promise.resolve(); + }, // Receive log message from backend onLog: (callback) => { const listener = (_event, value) => callback(value); diff --git a/electron-app/renderer/mode-selector/index.html b/electron-app/renderer/mode-selector/index.html new file mode 100644 index 000000000..b7f2bebed --- /dev/null +++ b/electron-app/renderer/mode-selector/index.html @@ -0,0 +1,272 @@ + + + + + + + Seleccione Modo + + + + +
+ Departamento + +
+

Control Station

+
+
+
+ Logo auxiliar + +
+
+ + + + \ No newline at end of file diff --git a/electron-app/renderer/mode-selector/src/Subsystem.png b/electron-app/renderer/mode-selector/src/Subsystem.png new file mode 100644 index 000000000..aed1aee91 Binary files /dev/null and b/electron-app/renderer/mode-selector/src/Subsystem.png differ diff --git a/electron-app/renderer/mode-selector/src/logo.svg b/electron-app/renderer/mode-selector/src/logo.svg new file mode 100644 index 000000000..20d20319d --- /dev/null +++ b/electron-app/renderer/mode-selector/src/logo.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/electron-app/renderer/mode-selector/src/sign.png b/electron-app/renderer/mode-selector/src/sign.png new file mode 100644 index 000000000..5771951dd Binary files /dev/null and b/electron-app/renderer/mode-selector/src/sign.png differ diff --git a/electron-app/src/app/cleanup.js b/electron-app/src/app/cleanup.js new file mode 100644 index 000000000..3cc8c8ffc --- /dev/null +++ b/electron-app/src/app/cleanup.js @@ -0,0 +1,33 @@ +/** + * @module app/cleanup + * @description Cleanup utilities for terminating leftover processes from previous sessions. + */ + +import { execSync } from "child_process"; +import { logger } from "../utils/logger.js"; + +/** + * Terminates any leftover backend processes from previous sessions. + * Prevents backend/log windows from appearing before user selects a mode. + * @returns {Promise} + */ +async function cleanupLeftoverBackendProcesses() { + try { + const out = execSync("pgrep -f backend-linux-amd64 || true").toString().trim(); + if (out) { + const pids = out.split(/\s+/).filter(Boolean); + for (const pid of pids) { + try { + process.kill(Number(pid), "SIGTERM"); + logger.electron.info(`Terminated leftover backend pid=${pid}`); + } catch (e) { + logger.electron.debug(`Failed to terminate pid ${pid}:`, e); + } + } + } + } catch (e) { + logger.electron.debug("Error checking/killing leftover backends:", e); + } +} + +export { cleanupLeftoverBackendProcesses }; diff --git a/electron-app/src/app/index.js b/electron-app/src/app/index.js new file mode 100644 index 000000000..5ae193df7 --- /dev/null +++ b/electron-app/src/app/index.js @@ -0,0 +1,11 @@ +/** + * @module app + * @description Application lifecycle and initialization exports. + */ + +export { cleanupLeftoverBackendProcesses } from "./cleanup.js"; +export { initializeApp } from "./initialization.js"; +export { setupLifecycleHandlers, setTransitionMode } from "./lifecycle.js"; +export { handleSelectorFallback, showModeSelector } from "./modeSelector.js"; +export { setupUpdater } from "./updater.js"; + diff --git a/electron-app/src/app/initialization.js b/electron-app/src/app/initialization.js new file mode 100644 index 000000000..3e6195ca0 --- /dev/null +++ b/electron-app/src/app/initialization.js @@ -0,0 +1,31 @@ +/** + * @module app/initialization + * @description Application initialization: config setup and cleanup. + */ + +import { getConfigManager } from "../config/configInstance.js"; +import { setupIpcHandlers } from "../ipc/handlers.js"; +import { logger } from "../utils/logger.js"; +import { cleanupLeftoverBackendProcesses } from "./cleanup.js"; + +/** + * Initializes the application: + * - Sets up IPC handlers + * - Initializes configuration + * - Cleans up leftover processes + * @returns {Promise} + */ +async function initializeApp() { + // Setup IPC handlers for renderer process communication + setupIpcHandlers(); + + // Initialize ConfigManager and ensure config exists + logger.electron.header("Initializing configuration..."); + await getConfigManager(); + logger.electron.header("Configuration ready"); + + // Clean up leftover processes from previous sessions + await cleanupLeftoverBackendProcesses(); +} + +export { initializeApp }; diff --git a/electron-app/src/app/lifecycle.js b/electron-app/src/app/lifecycle.js new file mode 100644 index 000000000..acad03e7b --- /dev/null +++ b/electron-app/src/app/lifecycle.js @@ -0,0 +1,67 @@ +/** + * @module app/lifecycle + * @description Application lifecycle event handlers. + */ + +import { app, BrowserWindow, dialog } from "electron"; +import { stopBackend } from "../processes/backend.js"; +import { stopBlcuProgramming } from "../processes/blcuProgramming.js"; +import { logger } from "../utils/logger.js"; +import { createWindow } from "../windows/index.js"; + +// Flag to indicate we're in a transition (e.g., returning to selector) +let isInTransition = false; + +/** + * Sets the transition flag + * @param {boolean} inTransition + */ +function setTransitionMode(inTransition) { + isInTransition = inTransition; +} + +/** + * Sets up all application lifecycle event handlers. + * @returns {void} + */ +function setupLifecycleHandlers() { + // Handle window close behavior + app.on("window-all-closed", () => { + // Don't quit if we're in a transition (returning to selector) + if (isInTransition) { + logger.electron.debug("In transition mode - skipping app quit on window-all-closed"); + return; + } + + // On macOS, keep app running even when all windows are closed + if (process.platform !== "darwin") { + // Quit app on other platforms when all windows are closed + app.quit(); + } + }); + + // Cleanup before app quits + app.on("before-quit", (e) => { + e.preventDefault(); + Promise.all([stopBackend(), stopBlcuProgramming()]) + .catch((error) => logger.electron.error("Error during shutdown:", error)) + .finally(() => app.exit()); + }); + + // Handle macOS app activation (reopen window when dock icon clicked) + app.on("activate", () => { + // Only create window if no windows exist + if (BrowserWindow.getAllWindows().length === 0) { + createWindow(); + } + }); + + // Handle uncaught exceptions globally + process.on("uncaughtException", (error) => { + logger.electron.error("Uncaught exception:", error); + dialog.showErrorBox("Error", error.message); + }); +} + +export { setTransitionMode, setupLifecycleHandlers }; + diff --git a/electron-app/src/app/modeSelector.js b/electron-app/src/app/modeSelector.js new file mode 100644 index 000000000..24c0a92c6 --- /dev/null +++ b/electron-app/src/app/modeSelector.js @@ -0,0 +1,174 @@ +/** + * @module app/modeSelector + * @description Mode selector window and logic for initial app mode selection. + */ + +import { BrowserWindow, ipcMain } from "electron"; +import fs from "fs"; +import path from "path"; +import { startBackend } from "../processes/backend.js"; +import { startBlcuProgramming } from "../processes/blcuProgramming.js"; +import { logger } from "../utils/logger.js"; +import { getAppPath } from "../utils/paths.js"; +import { createLogWindow, createWindow } from "../windows/index.js"; +import { loadView } from "../windows/mainWindow.js"; + +const VALID_MODES = { + testing: "testing-view", + flashing: "flashing-view", + competition: "competition-view", + default: "testing-view", +}; + +/** + * Creates and displays the mode selector window. + * Returns a Promise that resolves when user selects a mode. + * @param {number} screenWidth + * @param {number} screenHeight + * @returns {Promise<{mode: string, view: string, mainWindow: BrowserWindow}>} + */ +async function showModeSelector(screenWidth, screenHeight) { + return new Promise(async (resolve, reject) => { + let mainWindow = null; + + const selectorWindow = new BrowserWindow({ + width: 920, + height: 680, + useContentSize: true, + resizable: true, + modal: true, + parent: mainWindow, + show: true, + webPreferences: { + preload: path.join(getAppPath(), "preload.js"), + contextIsolation: true, + nodeIntegration: false, + }, + title: "Select Mode", + }); + + const selectorPath = path.join(getAppPath(), "renderer", "mode-selector", "index.html"); + + if (!fs.existsSync(selectorPath)) { + logger.electron.warning("Mode selector UI not found, using default testing-view"); + resolve({ mode: "default", view: VALID_MODES.default, mainWindow: null }); + return; + } + + logger.electron.info(`Mode selector found: ${selectorPath}`); + + try { + await selectorWindow.loadFile(selectorPath); + selectorWindow.show(); + selectorWindow.focus(); + } catch (err) { + logger.electron.error("Failed to load selector UI:", err); + resolve({ mode: "default", view: VALID_MODES.default, mainWindow: null }); + return; + } + + // Listen for mode selection from renderer + ipcMain.once("mode-selected", async (_event, mode) => { + try { + const view = VALID_MODES[mode] || VALID_MODES.default; + + // Create the main window without loading the view yet. + mainWindow = createWindow(screenWidth, screenHeight, null); + try { + mainWindow.maximize(); + } catch (e) {} + logger.electron.header("Main application window created"); + + // Start services and only then load the selected view. + if (view === "testing-view" || view === "flashing-view" || view === "competition-view") { + await startServices(screenWidth, screenHeight, view); + } + + loadView(view); + + // Show and focus main window + try { + mainWindow.show(); + mainWindow.focus(); + } catch (e) {} + + resolve({ mode, view, mainWindow }); + } catch (error) { + logger.electron.error("Error handling mode selection:", error); + reject(error); + } finally { + try { + selectorWindow.close(); + } catch (e) {} + } + }); + }); +} + +/** + * Starts services based on the selected view. + * - testing-view: Backend only + * - flashing-view: BLCU Programming only + * @param {number} screenWidth + * @param {number} screenHeight + * @param {string} view - The selected view mode + * @returns {Promise} + */ +async function startServices(screenWidth, screenHeight, view) { + // Start backend for testing and competition views + if (view === "testing-view" || view === "competition-view") { + const logWindow = createLogWindow(screenWidth, screenHeight); + logWindow.show(); // Show the log window + + try { + await startBackend(logWindow); + logger.electron.header("Backend process spawned"); + } catch (err) { + logger.electron.error("Failed to start backend:", err); + if (logWindow && !logWindow.isDestroyed()) { + logWindow.close(); + } + } + } + + // Start BLCU Programming only for flashing view + if (view === "flashing-view") { + try { + await startBlcuProgramming(); + logger.electron.header("BLCU programming process spawned"); + // Wait 5 seconds to ensure that BLCU programming (backend of frontend) is fully initialized + await new Promise((resolve) => setTimeout(resolve, 5000)); + } catch (err) { + logger.electron.error("Failed to start BLCU programming:", err); + } + } +} + +/** + * Handles fallback when selector is not available or fails. + * @param {number} screenWidth + * @param {number} screenHeight + * @returns {Promise<{mode: string, view: string, mainWindow: BrowserWindow}>} + */ +async function handleSelectorFallback(screenWidth, screenHeight) { + const view = VALID_MODES.default; + const mainWindow = createWindow(screenWidth, screenHeight, view); + + try { + mainWindow.maximize(); + } catch (e) {} + + logger.electron.header("Main application window created"); + + try { + mainWindow.show(); + } catch (e) {} + + // Start services by default (testing view) + await startServices(screenWidth, screenHeight, view); + + return { mode: "default", view, mainWindow }; +} + +export { handleSelectorFallback, showModeSelector }; + diff --git a/electron-app/src/app/updater.js b/electron-app/src/app/updater.js new file mode 100644 index 000000000..b41ed1b88 --- /dev/null +++ b/electron-app/src/app/updater.js @@ -0,0 +1,51 @@ +/** + * @module app/updater + * @description Auto-updater configuration and event handling. + */ + +import { app, dialog } from "electron"; +import pkg from "electron-updater"; +import { logger } from "../utils/logger.js"; + +const { autoUpdater } = pkg; + +/** + * Initializes the auto-updater with appropriate logging and event handlers. + * @returns {void} + */ +function setupUpdater() { + if (!app.isPackaged) { + autoUpdater.forceDevUpdateConfig = true; + } + + // Configure auto-updater logging + autoUpdater.logger = { + info: (message) => logger.electron.info(message), + error: (message) => logger.electron.error(message), + warn: (message) => logger.electron.warning(message), + debug: (message) => logger.electron.debug(message), + }; + + // Handle update downloaded event + autoUpdater.on("update-downloaded", (info) => { + dialog + .showMessageBox({ + type: "info", + title: "Update Ready", + message: `Version ${info.version} has been downloaded. Restart now to install?`, + buttons: ["Restart", "Later"], + }) + .then((result) => { + if (result.response === 0) { + autoUpdater.quitAndInstall(); + } + }); + }); + + // Check for updates + autoUpdater.checkForUpdates().catch((error) => { + logger.electron.error("Update check failed:", error.message); + }); +} + +export { setupUpdater }; diff --git a/electron-app/src/ipc/handlers.js b/electron-app/src/ipc/handlers.js index 269ea5235..177e9383e 100644 --- a/electron-app/src/ipc/handlers.js +++ b/electron-app/src/ipc/handlers.js @@ -7,7 +7,8 @@ * - Folder selection dialogs */ -import { dialog, ipcMain, shell } from "electron"; +import { app, dialog, ipcMain, shell } from "electron"; +import { readFile } from "fs/promises"; import fs from "fs"; import { isAbsolute, join } from "path"; import { @@ -15,13 +16,16 @@ import { readConfig, writeConfig, } from "../config/configInstance.js"; -import { getBackendWorkingDir, restartBackend } from "../processes/backend.js"; +import { + getBackendWorkingDir, + restartBackend, +} from "../processes/backend.js"; import { logger } from "../utils/logger.js"; +import { getAppPath } from "../utils/paths.js"; import { getCurrentView, getMainWindow, loadView, - reloadWindow, } from "../windows/mainWindow.js"; /** @@ -40,6 +44,36 @@ function setupIpcHandlers() { */ ipcMain.handle("get-current-view", () => getCurrentView()); + /** + * @event restart-backend + * @async + * @description Stops the backend process, restarts it, and reloads the renderer once ready. + */ + ipcMain.handle("restart-backend", async () => { + try { + await restartBackend(); + } catch (error) { + logger.electron.error("Failed to restart backend:", error); + dialog.showErrorBox("Restart Failed", `Could not restart backend:\n\n${error.message}`); + } finally { + loadView("testing-view"); + } + }); + + ipcMain.handle("get-app-version", () => app.getVersion()); + + ipcMain.handle("get-available-views", () => { + const ALL_VIEWS = [ + { mode: "testing", label: "Testing View" }, + { mode: "competition", label: "Competition View" }, + { mode: "flashing", label: "Flashing View" }, + ]; + const rendererDir = join(getAppPath(), "renderer"); + return ALL_VIEWS.filter(({ mode }) => + fs.existsSync(join(rendererDir, `${mode}-view`)) + ); + }); + /** * @event switch-view * @description Switches the main window to the specified view. @@ -52,6 +86,8 @@ function setupIpcHandlers() { return view; }); + + /** * @event save-config * @async @@ -64,10 +100,7 @@ function setupIpcHandlers() { ipcMain.handle("save-config", async (event, config) => { try { await writeConfig(config); - await restartBackend(); - - reloadWindow(); - + app.emit("return-to-selector"); return true; } catch (error) { logger.electron.error("Error saving config:", error); @@ -102,10 +135,7 @@ function setupIpcHandlers() { ipcMain.handle("import-config", async () => { try { await importConfig(); - await restartBackend(); - - reloadWindow(); - + app.emit("return-to-selector"); return true; } catch (error) { logger.electron.error("Error importing config:", error); @@ -154,12 +184,36 @@ function setupIpcHandlers() { ? folderPath : join(getBackendWorkingDir(), folderPath); const loggerPath = join(resolvedPath, "logger"); - await shell.openPath(fs.existsSync(loggerPath) ? loggerPath : resolvedPath); + await shell.openPath( + fs.existsSync(loggerPath) ? loggerPath : resolvedPath, + ); } catch (error) { logger.electron.error("Error opening folder:", error); throw error; } }); + + // BLCU — only the file picker runs through IPC; all API calls go directly + // from the renderer to http://localhost:8000. + + ipcMain.handle("blcu-select-file", async () => { + try { + const mainWindow = getMainWindow(); + const result = await dialog.showOpenDialog(mainWindow, { + title: "Select Firmware File", + properties: ["openFile"], + filters: [{ name: "Firmware", extensions: ["bin", "hex", "elf"] }], + }); + return result.canceled ? null : (result.filePaths[0] ?? null); + } catch (error) { + logger.electron.error("Error opening firmware file dialog:", error); + return null; + } + }); + + ipcMain.handle("blcu-read-file", async (_event, filePath) => { + return await readFile(filePath); + }); } export { setupIpcHandlers }; diff --git a/electron-app/src/menu/README.md b/electron-app/src/menu/README.md index 9f9e959a1..8f3b95918 100644 --- a/electron-app/src/menu/README.md +++ b/electron-app/src/menu/README.md @@ -40,7 +40,6 @@ Creates and sets the application menu bar. Takes the main window instance as par ## Dependencies -- `../processes/packetSender.js` - For starting/stopping packet sender - `../utils/paths.js` - For resolving binary paths - `electron` - For Menu, dialog, and app APIs diff --git a/electron-app/src/menu/menu.js b/electron-app/src/menu/menu.js index c2000533d..a7cdc27e7 100644 --- a/electron-app/src/menu/menu.js +++ b/electron-app/src/menu/menu.js @@ -1,22 +1,15 @@ /** * @module menu * @description Application menu creation and management for the Electron application. - * Defines menu structure with File, View, Tools, and Help sections with keyboard shortcuts and actions. + * Defines menu structure with File, Tools, and Help sections with keyboard shortcuts and actions. */ import { Menu, app, dialog } from "electron"; -import fs from "fs"; -import { - getPacketSenderProcess, - startPacketSender, - stopPacketSender, -} from "../processes/packetSender.js"; -import { getBinaryPath } from "../utils/paths.js"; -import { loadView } from "../windows/mainWindow.js"; /** - * Creates and sets the application menu with File, View, Tools, and Help sections. - * Includes menu items for reloading, exiting, switching views, toggling DevTools, and managing packet sender. + * Creates and sets the application menu with File, Tools, and Help sections. + * Includes menu items for reloading, exiting, toggling DevTools, and app information. + * View switching is no longer available since the mode is selected at startup. * @param {import("electron").BrowserWindow} mainWindow - The main browser window instance to attach menu actions to. * @returns {void} * @example @@ -36,6 +29,11 @@ function createMenu(mainWindow) { } }, }, + { + label: "Return to Selector", + accelerator: "CmdOrCtrl+Shift+S", + click: () => app.emit("return-to-selector"), + }, { type: "separator" }, { label: "Exit", @@ -45,23 +43,8 @@ function createMenu(mainWindow) { ], }, { - label: "View", + label: "Tools", submenu: [ - { - label: "Competition View", - accelerator: "CmdOrCtrl+1", - click: () => { - loadView("competition-view"); - }, - }, - { - label: "Testing View", - accelerator: "CmdOrCtrl+2", - click: () => { - loadView("testing-view"); - }, - }, - { type: "separator" }, { label: "Toggle DevTools", accelerator: "F12", @@ -73,40 +56,6 @@ function createMenu(mainWindow) { }, ], }, - { - label: "Tools", - submenu: [ - { - label: "Start Packet Sender", - click: () => { - const packetSenderBin = getBinaryPath("packet-sender"); - if (!fs.existsSync(packetSenderBin)) { - dialog.showMessageBox(mainWindow, { - type: "warning", - title: "Packet Sender Not Available", - message: "Packet sender binary not found", - detail: "This optional tool was not included in the build.", - }); - return; - } - const packetSenderProcess = getPacketSenderProcess(); - if (!packetSenderProcess || packetSenderProcess.killed) { - startPacketSender(); - } - }, - }, - { - label: "Stop Packet Sender", - click: () => { - stopPacketSender(); - const packetSenderProcess = getPacketSenderProcess(); - if (packetSenderProcess && !packetSenderProcess.killed) { - stopPacketSender(); - } - }, - }, - ], - }, { label: "Help", submenu: [ diff --git a/electron-app/src/processes/README.md b/electron-app/src/processes/README.md index 51cfe231a..8232422ab 100644 --- a/electron-app/src/processes/README.md +++ b/electron-app/src/processes/README.md @@ -1,6 +1,6 @@ # Processes (`processes/`) -Process management module for spawning and controlling external processes (backend and packet sender). +Process management module for spawning and controlling external processes (backend and BLCU programming service). ## Overview @@ -8,68 +8,63 @@ Manages the lifecycle of external binary processes spawned by the Electron appli ## Files -- `backend.js` - Backend process management -- `packetSender.js` - Packet sender utility process management +- `backend.js` - Go backend process management +- `blcuProgramming.js` - BLCU programming (Python/FastAPI) process management + +--- ## Backend Process (`backend.js`) -Manages the Go backend process that handles data processing. +Manages the Go backend binary that handles data ingestion and pod communication. ### Functions -- `startBackend()` - Spawns the backend process with config file path +- `startBackend(logWindow)` - Spawns the backend binary, piping stdout/stderr to the log window - `stopBackend()` - Stops the backend process gracefully (SIGTERM) - `restartBackend()` - Stops and restarts the backend process ### Behavior -- Validates binary exists before starting +- Validates the binary exists before starting - Sets working directory based on dev/production mode -- Logs stdout/stderr to logger +- Streams stdout/stderr to the log window via IPC - Shows error dialogs on startup failures or crashes -- Passes config file path via `--config` flag +- Passes the config file path via `--config` flag + +--- -## Packet Sender Process (`packetSender.js`) +## BLCU Programming Process (`blcuProgramming.js`) -Manages the packet sender utility tool for testing. +Manages the PyInstaller-compiled BLCU programming binary that serves the FastAPI HTTP server for the Flashing View. ### Functions -- `startPacketSender(args)` - Spawns packet sender with optional arguments -- `stopPacketSender()` - Stops the packet sender process -- `restartPacketSender()` - Restarts the packet sender process -- `getPacketSenderProcess()` - Returns the current process instance +- `startBlcuProgramming()` - Spawns the BLCU binary and resolves when the process is running +- `stopBlcuProgramming()` - Stops the BLCU process gracefully ### Behavior -- Validates binary exists before starting -- Logs stdout/stderr to logger -- Returns `null` if binary not found (optional tool) -- Defaults to `--help` flag when restarted +- Resolves the platform-specific binary name from `electron-app/binaries/` +- Sets `BLCU_API_HOST` and `BLCU_API_PORT` environment variables (defaults: `127.0.0.1:8069`) +- Logs process stdout/stderr via `logger.process()` +- Exits the Electron app if the binary cannot be found + +--- ## Dependencies -- `../utils/paths.js` - For resolving binary and config paths -- `../utils/logger.js` - For process output logging -- `child_process` - For spawning processes -- `electron` - For dialog and app APIs +- `../utils/paths.js` - Binary path resolution +- `../utils/logger.js` - Process output logging +- `child_process` - Process spawning +- `electron` - Dialog and app APIs ## Used By -- **`main.js`** - Starts backend on app ready, stops both processes on quit -- **`ipc/handlers.js`** - Restarts backend when config is saved/imported -- **`menu/menu.js`** - Provides start/stop controls for packet sender - -## Notes - -- Backend process is required and shows error dialogs if binary missing -- Packet sender is optional and silently fails if binary missing -- Processes are terminated with SIGTERM for graceful shutdown -- Process output is captured and logged via logger utility -- Backend working directory differs between dev and production modes +- **`app/modeSelector.js`** - Starts the appropriate process for the selected mode (backend for testing/competition, BLCU for flashing) +- **`main.js`** - Stops all processes on app quit ## See Also -- [../ipc/README.md](../ipc/README.md) - IPC handlers that restart backend -- [../menu/README.md](../menu/README.md) - Menu that controls packet sender +- [../ipc/README.md](../ipc/README.md) - IPC handlers - [../utils/README.md](../utils/README.md) - Utility functions (paths, logger) +- [../windows/README.md](../windows/README.md) - Window management diff --git a/electron-app/src/processes/backend.js b/electron-app/src/processes/backend.js index b021edfdc..c314a4637 100644 --- a/electron-app/src/processes/backend.js +++ b/electron-app/src/processes/backend.js @@ -32,6 +32,18 @@ let storedLogWindow = null; // Store error messages accumulated from the current process run let lastBackendError = null; +/** + * Clears the stored log window reference and closes it + */ +function clearLogWindow() { + if (storedLogWindow && !storedLogWindow.isDestroyed()) { + try { + storedLogWindow.close(); + } catch (e) {} + } + storedLogWindow = null; +} + /** * Starts the backend process by spawning the backend binary with the user configuration. * @returns {void} @@ -46,6 +58,8 @@ async function startBackend(logWindow = null) { const currentLogWindow = logWindow || storedLogWindow; return new Promise((resolve, reject) => { + let resolved = false; + // Get paths for binary and config const backendBin = getBinaryPath("backend"); const configPath = getUserConfigPath(); @@ -91,9 +105,10 @@ async function startBackend(logWindow = null) { // Resolve as soon as the HTTP server confirms it is listening. // Matches: "INF ... > http server listening localAddr=..." - if (text.includes("http server listening")) { + if (text.includes("http server listening") && !resolved) { logger.backend.info("Backend ready (HTTP server listening)"); clearTimeout(startupTimer); + resolved = true; resolve(backendProcess); } }); @@ -118,7 +133,10 @@ async function startBackend(logWindow = null) { "Backend Error", `Failed to start backend: ${error.message}`, ); - return reject(new Error(`Failed to start backend: ${error.message}`)); + if (!resolved) { + resolved = true; + return reject(new Error(`Failed to start backend: ${error.message}`)); + } }); // Handle process exit @@ -126,21 +144,39 @@ async function startBackend(logWindow = null) { logger.backend.info(`Backend process exited with code ${code}`); clearTimeout(startupTimer); - if (code !== 0 && code !== null) { - let errorMessage = `Backend exited with code ${code}`; - - if (lastBackendError) { - const stripped = lastBackendError.replace(/\x1b\[[0-9;]*m/g, ""); - const formatted = formatBackendError(stripped); - errorMessage += `\n\n${getHint(stripped, formatted)}`; - } else { - errorMessage += "\n\n(No error output captured)"; + // If the process closed without success, reject the promise + if (!resolved) { + if (code !== 0 && code !== null) { + let errorMessage = `Backend exited with code ${code}`; + + if (lastBackendError) { + const stripped = lastBackendError.replace(/\x1b\[[0-9;]*m/g, ""); + const formatted = formatBackendError(stripped); + errorMessage += `\n\n${getHint(stripped, formatted)}`; + } else { + errorMessage += "\n\n(No error output captured)"; + } + + dialog.showErrorBox("Backend Crashed", errorMessage); + lastBackendError = null; + backendProcess = null; + resolved = true; + return reject(new Error(errorMessage)); } - dialog.showErrorBox("Backend Crashed", errorMessage); - lastBackendError = null; - backendProcess = null; - return reject(new Error(errorMessage)); + if (code === null || code === 0) { + let errorMessage = "Backend process closed before initialization completed"; + if (lastBackendError) { + const stripped = lastBackendError.replace(/\x1b\[[0-9;]*m/g, ""); + errorMessage += `\n\n${stripped}`; + lastBackendError = null; + } + logger.backend.warning(errorMessage); + dialog.showErrorBox("Backend Failed to Start", errorMessage); + backendProcess = null; + resolved = true; + return reject(new Error(errorMessage)); + } } backendProcess = null; @@ -148,10 +184,13 @@ async function startBackend(logWindow = null) { // Fallback: if the ready message never appears, resolve anyway after timeout const startupTimer = setTimeout(() => { - logger.backend.warning( - "Backend ready signal not received - resolving after timeout", - ); - resolve(backendProcess); + if (!resolved) { + logger.backend.warning( + "Backend ready signal not received - resolving after timeout", + ); + resolved = true; + resolve(backendProcess); + } }, 5000); }); } @@ -176,6 +215,8 @@ async function stopBackend() { if (localBackendProcess === backendProcess) { backendProcess = null; } + // Clean up log window + clearLogWindow(); resolve(); }); @@ -194,6 +235,8 @@ async function stopBackend() { fallbackTimer.unref(); } else { logger.backend.warning("Backend process not found, skipping stop..."); + // Clean up log window even if process doesn't exist + clearLogWindow(); resolve(); } }); @@ -206,16 +249,15 @@ async function stopBackend() { * restartBackend(); */ async function restartBackend() { - // Stop current process first await stopBackend(); - - // Start a new process + // Brief pause so the OS fully releases ports before the new process binds them + await new Promise((resolve) => setTimeout(resolve, 500)); try { await startBackend(); logger.electron.info("Backend restarted successfully"); } catch (error) { logger.electron.error("Failed to restart backend:", error); - throw error; // Let the IPC handler know it failed + throw error; } } @@ -225,4 +267,4 @@ function getBackendWorkingDir() { : path.dirname(getUserConfigPath()); } -export { getBackendWorkingDir, restartBackend, startBackend, stopBackend }; +export { clearLogWindow, getBackendWorkingDir, restartBackend, startBackend, stopBackend }; diff --git a/electron-app/src/processes/blcuProgramming.js b/electron-app/src/processes/blcuProgramming.js new file mode 100644 index 000000000..885edfded --- /dev/null +++ b/electron-app/src/processes/blcuProgramming.js @@ -0,0 +1,165 @@ +import { spawn } from "child_process"; +import { app, dialog } from "electron"; +import fs from "fs"; +import path from "path"; +import { logger } from "../utils/logger.js"; +import { getAppPath, getBinaryPath } from "../utils/paths.js"; + +let blcuProgrammingProcess = null; + +function getBlcuProgrammingRepoPath() { + return path.join(getAppPath(), "..", "blcu-programming"); +} + +function getPythonExecutable(repoPath) { + if (process.platform === "win32") { + return path.join(repoPath, ".venv", "Scripts", "python.exe"); + } + + return path.join(repoPath, ".venv", "bin", "python"); +} + +function getBlcuProgrammingWorkingDir() { + if (!app.isPackaged) { + return getBlcuProgrammingRepoPath(); + } + + const workingDir = path.join(app.getPath("userData"), "blcu-programming"); + fs.mkdirSync(workingDir, { recursive: true }); + return workingDir; +} + +function getBinaryStartConfig() { + const binaryPath = getBinaryPath("blcu-programming"); + + if (!fs.existsSync(binaryPath)) { + return null; + } + + return { + command: binaryPath, + args: [], + cwd: getBlcuProgrammingWorkingDir(), + source: "binary", + }; +} + +function getPythonStartConfig() { + const repoPath = getBlcuProgrammingRepoPath(); + const pythonBin = getPythonExecutable(repoPath); + const entrypointPath = path.join(repoPath, "api", "main.py"); + + if (!fs.existsSync(entrypointPath)) { + logger.process( + "BLCU Programming", + `Entrypoint not found at ${entrypointPath}`, + ); + return null; + } + + if (!fs.existsSync(pythonBin)) { + logger.process( + "BLCU Programming", + `Python executable not found at ${pythonBin}`, + ); + return null; + } + + return { + command: pythonBin, + args: ["-m", "api.main"], + cwd: repoPath, + source: "python", + }; +} + +function getStartConfig() { + return ( + getBinaryStartConfig() || (!app.isPackaged ? getPythonStartConfig() : null) + ); +} + +async function startBlcuProgramming() { + if (blcuProgrammingProcess && !blcuProgrammingProcess.killed) { + return blcuProgrammingProcess; + } + + const startConfig = getStartConfig(); + + if (!startConfig) { + const message = + "BLCU programming executable not found. Run the Electron build before packaging the release."; + + logger.process("BLCU Programming", message); + + if (app.isPackaged) { + dialog.showErrorBox("BLCU Programming Error", message); + } + + return null; + } + + logger.process( + "BLCU Programming", + `Starting ${startConfig.source}: ${startConfig.command}`, + ); + + blcuProgrammingProcess = spawn(startConfig.command, startConfig.args, { + cwd: startConfig.cwd, + env: { + ...process.env, + BLCU_API_HOST: process.env.BLCU_API_HOST || "127.0.0.1", + BLCU_API_PORT: process.env.BLCU_API_PORT || "8069", + PYTHONUNBUFFERED: "1", + }, + }); + + blcuProgrammingProcess.stdout.on("data", (data) => { + logger.process("BLCU Programming", data.toString().trim()); + }); + + blcuProgrammingProcess.stderr.on("data", (data) => { + logger.process("BLCU Programming", data.toString().trim()); + }); + + blcuProgrammingProcess.on("error", (error) => { + logger.process( + "BLCU Programming", + `Failed to start BLCU programming: ${error.message}`, + ); + blcuProgrammingProcess = null; + }); + + blcuProgrammingProcess.on("close", (code) => { + logger.process("BLCU Programming", `Process exited with code ${code}`); + blcuProgrammingProcess = null; + }); + + return blcuProgrammingProcess; +} + +async function stopBlcuProgramming() { + return new Promise((resolve) => { + if (!blcuProgrammingProcess || blcuProgrammingProcess.killed) { + resolve(); + return; + } + + blcuProgrammingProcess.once("close", () => { + resolve(); + }); + + blcuProgrammingProcess.kill("SIGTERM"); + + const fallbackTimer = setTimeout(() => { + if (blcuProgrammingProcess && !blcuProgrammingProcess.killed) { + blcuProgrammingProcess.kill("SIGKILL"); + } + resolve(); + }, 3000); + + fallbackTimer.unref(); + }); +} + +export { startBlcuProgramming, stopBlcuProgramming }; diff --git a/electron-app/src/windows/index.js b/electron-app/src/windows/index.js new file mode 100644 index 000000000..06cd375b2 --- /dev/null +++ b/electron-app/src/windows/index.js @@ -0,0 +1,8 @@ +/** + * @module windows + * @description Window creation and management exports. + */ + +export { createLogWindow } from "./logWindow.js"; +export { createWindow } from "./mainWindow.js"; + diff --git a/electron-app/src/windows/mainWindow.js b/electron-app/src/windows/mainWindow.js index 0bf125b85..3b14d8afb 100644 --- a/electron-app/src/windows/mainWindow.js +++ b/electron-app/src/windows/mainWindow.js @@ -24,7 +24,7 @@ let currentView = "testing-view"; * @example * createWindow(); */ -function createWindow(screenWidth, screenHeight) { +function createWindow(screenWidth, screenHeight, initialView) { // Create new browser window with configuration mainWindow = new BrowserWindow({ x: 0, @@ -47,8 +47,15 @@ function createWindow(screenWidth, screenHeight) { backgroundColor: "#1a1a1a", }); - // Load ethernet view by default - loadView(currentView); + // If an initial view string is provided, load it. + // If `initialView` is explicitly null, skip loading so caller can decide later. + if (typeof initialView === "string") { + loadView(initialView); + } else if (initialView === null) { + // skip loading any view for now + } else { + loadView(currentView); + } // Create application menu const menu = createMenu(mainWindow); @@ -93,11 +100,12 @@ function loadView(view) { // Load the view HTML file mainWindow.loadFile(viewPath); // Update window title based on view type - mainWindow.setTitle( - `Hyperloop Control Station - ${ - view === "control-station" ? "Competition View" : "Testing View" - }` - ); + const titles = { + "competition-view": "Competition View", + "flashing-view": "Flashing View", + "testing-view": "Testing View", + }; + mainWindow.setTitle(`Hyperloop Control Station - ${titles[view] ?? "Testing View"}`); } else { // Log error and show dialog if view not found console.error(`View not found: ${viewPath}`); diff --git a/frontend/README.md b/frontend/README.md index 258ca1b17..1e8e97ab0 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -6,7 +6,7 @@ This directory contains the frontend workspace for the Hyperloop Control Station ## Architecture Overview -The frontend is organized as 6 workspaces out of 9 in the whole monorepo, divided into 3 main areas: +The frontend is organized as 7 workspaces out of 10 in the whole monorepo, divided into 3 main areas: ### Workspaces @@ -14,6 +14,7 @@ The frontend is organized as 6 workspaces out of 9 in the whole monorepo, divide | :----------------------------------------------------------------- | :---------------------------------------------------- | | `testing-view` | Primary telemetry testing and debugging interface | | `competition-view` | Competition-focused UI (simplified view) | +| `flashing-view` | UI for flashing firmware to the BLCU board | | `frontend-kit/ui` or `@workspace/ui` | Component library built on shadcn/ui and Radix UI | | `frontend-kit/core` or `@workspace/core` | Shared business logic, WebSocket utilities, and types | | `frontend-kit/eslint-config` or `@workspace/eslint-config` | Common ESLint configurations | @@ -156,7 +157,9 @@ frontend/ │ │ ├── mocks/ # Mocks │ │ └── lib/ # Utilities │ └── public/ # Static assets -└── competition-view/ +├── competition-view/ +│ └── src/ # Similar structure +└── flashing-view/ └── src/ # Similar structure ``` diff --git a/frontend/competition-view/eslint.config.js b/frontend/competition-view/eslint.config.js new file mode 100644 index 000000000..df360b435 --- /dev/null +++ b/frontend/competition-view/eslint.config.js @@ -0,0 +1,3 @@ +import { config } from "@workspace/eslint-config/vite"; + +export default config; diff --git a/frontend/competition-view/index.html b/frontend/competition-view/index.html new file mode 100644 index 000000000..f85c87b2c --- /dev/null +++ b/frontend/competition-view/index.html @@ -0,0 +1,12 @@ + + + + + + Hyperloop Competition View + + +
+ + + diff --git a/frontend/competition-view/package.json b/frontend/competition-view/package.json new file mode 100644 index 000000000..ed403d3bd --- /dev/null +++ b/frontend/competition-view/package.json @@ -0,0 +1,37 @@ +{ + "name": "competition-view", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "preinstall": "npx only-allow pnpm", + "dev": "vite", + "dev:main": "pnpm dev", + "build": "tsc -b && vite build", + "lint": "eslint .", + "preview": "vite preview" + }, + "dependencies": { + "@tailwindcss/vite": "^4.1.18", + "@vitejs/plugin-react-swc": "^4.2.3", + "@workspace/core": "workspace:*", + "@workspace/ui": "workspace:*", + "lucide-react": "^0.563.0", + "react": "^19.2.4", + "react-dom": "^19.2.4", + "react-router": "^7.13.0", + "tailwindcss": "^4.1.18", + "uplot": "^1.6.32", + "zustand": "^5.0.11" + }, + "devDependencies": { + "@types/react": "^19.2.11", + "@types/react-dom": "^19.2.3", + "@workspace/eslint-config": "workspace:^", + "@workspace/typescript-config": "workspace:*", + "eslint": "^9.39.2", + "globals": "^17.3.0", + "typescript": "^5.9.3", + "vite": "^7.3.1" + } +} diff --git a/frontend/competition-view/src/App.tsx b/frontend/competition-view/src/App.tsx new file mode 100644 index 000000000..e9a210de3 --- /dev/null +++ b/frontend/competition-view/src/App.tsx @@ -0,0 +1,93 @@ +import { useTopic, useWebSocket } from "@workspace/ui/hooks"; +import { useState } from "react"; +import { Route, Routes } from "react-router"; +import ErrorBoundary from "./components/ErrorBoundary"; +import KeyboardShortcutsHelp from "./components/KeyboardShortcutsHelp"; +import { + BRAKE_ORDERS, + EMERGENCY_STOP_ORDERS, + OPEN_CONTACTORS_ORDERS, +} from "./constants/orders"; +import useKeyboardShortcuts from "./hooks/useKeyboardShortcuts"; +import useSendOrder from "./hooks/useSendOrder"; +import AppLayout from "./layout/AppLayout"; +import Batteries from "./pages/Batteries"; +import Boards from "./pages/Boards"; +import Booster from "./pages/Booster"; +import Charts from "./pages/Charts"; +import Messages from "./pages/Messages"; +import Orders from "./pages/Orders"; +import Overview from "./pages/Overview"; +import { useStore } from "./store/store"; +import type { Connection } from "./types/connection"; +import type { MessagePacket } from "./types/message"; +import type { TelemetryData } from "./types/telemetry"; + +const App = () => { + const { isConnected } = useWebSocket(); + + const updateConnections = useStore((s) => s.updateConnections); + const addMessage = useStore((s) => s.addMessage); + const updateTelemetry = useStore((s) => s.updateTelemetry); + + const sendOrder = useSendOrder(); + + // Keyboard shortcuts help dialog + const [helpOpen, setHelpOpen] = useState(false); + + // Global keyboard shortcuts for competition quick-actions. + // Disabled while the help dialog is open so its keys don't accidentally fire. + const { estopArmed } = useKeyboardShortcuts({ + enabled: !helpOpen, + onBrake: () => sendOrder(BRAKE_ORDERS), + onOpenContactors: () => sendOrder(OPEN_CONTACTORS_ORDERS), + onEmergencyStop: () => sendOrder(EMERGENCY_STOP_ORDERS), + onToggleHelp: () => setHelpOpen((v) => !v), + }); + + // Board connection status + useTopic>("connection/update", updateConnections); + + // System messages / log entries + useTopic("message/update", (packet) => { + addMessage({ ...packet, id: crypto.randomUUID() }); + }); + + // High-frequency telemetry stream (throttled to 100 ms) + useTopic( + "podData/update", + updateTelemetry, + { downsample: "none", throttle: 100 }, + ); + + return ( + <> + setHelpOpen(true)} + > + + } /> + } /> + } /> + } /> + } /> + } /> + } /> + + + + {/* Keyboard shortcuts reference dialog */} + + + {/* ESTOP armed banner — pulses for 2 s after the first E press */} + {estopArmed && ( +
+ ⚠ ESTOP ARMED — Press E again to confirm +
+ )} + + ); +}; + +export default App; diff --git a/frontend/competition-view/src/assets/logo.svg b/frontend/competition-view/src/assets/logo.svg new file mode 100644 index 000000000..5ccba4eeb --- /dev/null +++ b/frontend/competition-view/src/assets/logo.svg @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/frontend/competition-view/src/components/ErrorBoundary.tsx b/frontend/competition-view/src/components/ErrorBoundary.tsx new file mode 100644 index 000000000..c343d4178 --- /dev/null +++ b/frontend/competition-view/src/components/ErrorBoundary.tsx @@ -0,0 +1,71 @@ +import { Button, Card, CardContent, CardHeader, CardTitle } from "@workspace/ui/components"; +import { AlertTriangle } from "@workspace/ui/icons"; +import { Component, type ErrorInfo, type ReactNode } from "react"; + +interface Props { + children: ReactNode; + /** Heading shown in the fallback card. Defaults to "Something went wrong". */ + title?: string; +} + +interface State { + hasError: boolean; + error: Error | null; +} + +/** + * React error boundary that catches render-time errors in its subtree and + * displays a recoverable fallback card instead of crashing the whole app. + * + * Usage: + * + * + * + */ +class ErrorBoundary extends Component { + constructor(props: Props) { + super(props); + this.state = { hasError: false, error: null }; + } + + static getDerivedStateFromError(error: Error): State { + return { hasError: true, error }; + } + + componentDidCatch(error: Error, info: ErrorInfo) { + console.error("[ErrorBoundary]", error, info.componentStack); + } + + handleReset = () => this.setState({ hasError: false, error: null }); + + render() { + if (!this.state.hasError) { + return this.props.children; + } + + return ( +
+ + + + + {this.props.title ?? "Something went wrong"} + + + + {this.state.error && ( +
+                {this.state.error.message}
+              
+ )} + +
+
+
+ ); + } +} + +export default ErrorBoundary; diff --git a/frontend/competition-view/src/components/KeyboardShortcutsHelp.tsx b/frontend/competition-view/src/components/KeyboardShortcutsHelp.tsx new file mode 100644 index 000000000..56e3200b7 --- /dev/null +++ b/frontend/competition-view/src/components/KeyboardShortcutsHelp.tsx @@ -0,0 +1,52 @@ +import { + Dialog, + DialogContent, + DialogHeader, + DialogTitle, + Separator, +} from "@workspace/ui/components"; +import { Keyboard } from "@workspace/ui/icons"; +import { SHORTCUT_DEFS } from "../hooks/useKeyboardShortcuts"; + +interface KeyboardShortcutsHelpProps { + open: boolean; + onOpenChange: (open: boolean) => void; +} + +/** + * Modal dialog listing all keyboard shortcuts. + * Opened via the header button or by pressing '?'. + */ +const KeyboardShortcutsHelp = ({ open, onOpenChange }: KeyboardShortcutsHelpProps) => ( + + + + + + Keyboard Shortcuts + + + + + +
    + {SHORTCUT_DEFS.map(({ key, label, description }) => ( +
  • + {description} + + {label} + +
  • + ))} +
+ + + +

+ Shortcuts are disabled while typing in input fields. +

+
+
+); + +export default KeyboardShortcutsHelp; diff --git a/frontend/competition-view/src/components/header/ConnectionBadge.tsx b/frontend/competition-view/src/components/header/ConnectionBadge.tsx new file mode 100644 index 000000000..88c2cb42e --- /dev/null +++ b/frontend/competition-view/src/components/header/ConnectionBadge.tsx @@ -0,0 +1,25 @@ +import { Badge } from "@workspace/ui/components"; + +interface ConnectionBadgeProps { + connected: boolean; +} + +const ConnectionBadge = ({ connected }: ConnectionBadgeProps) => ( + + + {connected ? "Connected" : "Disconnected"} + +); + +export default ConnectionBadge; diff --git a/frontend/competition-view/src/components/header/Header.tsx b/frontend/competition-view/src/components/header/Header.tsx new file mode 100644 index 000000000..74ebf2424 --- /dev/null +++ b/frontend/competition-view/src/components/header/Header.tsx @@ -0,0 +1,47 @@ +import { Button, Separator, SidebarTrigger, Tooltip, TooltipContent, TooltipTrigger } from "@workspace/ui/components"; +import { Keyboard } from "@workspace/ui/icons"; +import { useLocation } from "react-router"; +import { PAGES } from "../../constants/pages"; +import ConnectionBadge from "./ConnectionBadge"; + +interface HeaderProps { + backendConnected: boolean; + onShowShortcuts: () => void; +} + +const Header = ({ backendConnected, onShowShortcuts }: HeaderProps) => { + const location = useLocation(); + const page = PAGES[location.pathname as keyof typeof PAGES]; + const pageTitle = page?.title ?? "Competition View"; + + return ( +
+ + +

{pageTitle}

+ +
+ + + + + Keyboard shortcuts (?) + + + +
+
+ ); +}; + +export default Header; diff --git a/frontend/competition-view/src/components/sidebar/AppSidebar.tsx b/frontend/competition-view/src/components/sidebar/AppSidebar.tsx new file mode 100644 index 000000000..1e83cdf69 --- /dev/null +++ b/frontend/competition-view/src/components/sidebar/AppSidebar.tsx @@ -0,0 +1,38 @@ +import { + Sidebar, + SidebarContent, + SidebarFooter, + SidebarHeader, + SidebarRail, +} from "@workspace/ui/components"; +import { PAGES_ARRAY } from "../../constants/pages"; +import ConnectionStatusGroup from "./ConnectionStatusGroup"; +import Logo from "./Logo"; +import NavigationGroup from "./NavigationGroup"; +import ThemeToggleItem from "./ThemeToggleItem"; + +interface AppSidebarProps extends React.ComponentProps { + backendConnected: boolean; +} + +const AppSidebar = ({ backendConnected, ...props }: AppSidebarProps) => ( + + + + + + + + + + + +
+ + + + + +); + +export default AppSidebar; diff --git a/frontend/competition-view/src/components/sidebar/ConnectionStatusGroup.tsx b/frontend/competition-view/src/components/sidebar/ConnectionStatusGroup.tsx new file mode 100644 index 000000000..76fff79cb --- /dev/null +++ b/frontend/competition-view/src/components/sidebar/ConnectionStatusGroup.tsx @@ -0,0 +1,56 @@ +import { + SidebarGroup, + SidebarGroupLabel, + SidebarMenu, + SidebarMenuButton, + SidebarMenuItem, +} from "@workspace/ui/components"; +import { Plug, Unplug } from "@workspace/ui/icons"; +import useConnections from "../../hooks/useConnections"; + +interface ConnectionStatusGroupProps { + backendConnected: boolean; +} + +const ConnectionStatusGroup = ({ + backendConnected, +}: ConnectionStatusGroupProps) => { + const connections = useConnections(); + + return ( + + Connections + + {/* Backend WebSocket connection */} + + + {backendConnected ? : } + Backend + + + + {/* Per-board connections reported by the backend */} + {Object.values(connections).map((connection) => ( + + + {connection.isConnected ? : } + {connection.name} + + + ))} + + + ); +}; + +export default ConnectionStatusGroup; diff --git a/frontend/competition-view/src/components/sidebar/Logo.tsx b/frontend/competition-view/src/components/sidebar/Logo.tsx new file mode 100644 index 000000000..d17da2455 --- /dev/null +++ b/frontend/competition-view/src/components/sidebar/Logo.tsx @@ -0,0 +1,18 @@ +import { SidebarMenuButton } from "@workspace/ui/components"; +import { Link } from "react-router"; +import logo from "../../assets/logo.svg"; + +const Logo = () => ( + + + Hyperloop UPV + Competition View + + +); + +export default Logo; diff --git a/frontend/competition-view/src/components/sidebar/NavigationGroup.tsx b/frontend/competition-view/src/components/sidebar/NavigationGroup.tsx new file mode 100644 index 000000000..41da64c38 --- /dev/null +++ b/frontend/competition-view/src/components/sidebar/NavigationGroup.tsx @@ -0,0 +1,47 @@ +import { + SidebarGroup, + SidebarGroupLabel, + SidebarMenu, + SidebarMenuButton, + SidebarMenuItem, +} from "@workspace/ui/components"; +import { type LucideIcon } from "@workspace/ui/icons"; +import { Link, useLocation } from "react-router"; + +interface NavItem { + title: string; + url: string; + icon?: LucideIcon; +} + +interface NavigationGroupProps { + items: NavItem[]; +} + +const NavigationGroup = ({ items }: NavigationGroupProps) => { + const location = useLocation(); + + return ( + + Pages + + {items.map((item) => ( + + + + {item.icon && } + {item.title} + + + + ))} + + + ); +}; + +export default NavigationGroup; diff --git a/frontend/competition-view/src/components/sidebar/ThemeToggleItem.tsx b/frontend/competition-view/src/components/sidebar/ThemeToggleItem.tsx new file mode 100644 index 000000000..79867f748 --- /dev/null +++ b/frontend/competition-view/src/components/sidebar/ThemeToggleItem.tsx @@ -0,0 +1,18 @@ +import { SidebarMenuButton } from "@workspace/ui/components"; +import { SunMoon } from "@workspace/ui/icons"; +import { useStore } from "../../store/store"; + +const ThemeToggleItem = () => { + const toggleDarkMode = useStore((s) => s.toggleDarkMode); + const isDarkMode = useStore((s) => s.isDarkMode); + const label = isDarkMode ? "Enable Light Mode" : "Enable Dark Mode"; + + return ( + + + {label} + + ); +}; + +export default ThemeToggleItem; diff --git a/frontend/competition-view/src/constants/chartConfig.ts b/frontend/competition-view/src/constants/chartConfig.ts new file mode 100644 index 000000000..0707e3ed6 --- /dev/null +++ b/frontend/competition-view/src/constants/chartConfig.ts @@ -0,0 +1,20 @@ +/** Maximum number of data points kept per chart series. */ +export const CHART_MAX_POINTS = 500; + +/** Default rendered height of a chart in pixels. */ +export const CHART_HEIGHT = 220; + +/** Stroke width for chart lines. */ +export const CHART_LINE_WIDTH = 2; + +/** Diameter of the dot drawn at each data point. */ +export const CHART_POINT_SIZE = 2; + +/** Colour palette — one entry per series (competition orange first). */ +export const CHART_COLORS = [ + "#ff7f24", // primary orange + "#2563eb", // blue + "#10b981", // green + "#ef4444", // red + "#8b5cf6", // purple +] as const; diff --git a/frontend/competition-view/src/constants/measurements.ts b/frontend/competition-view/src/constants/measurements.ts new file mode 100644 index 000000000..5e63acbe5 --- /dev/null +++ b/frontend/competition-view/src/constants/measurements.ts @@ -0,0 +1,116 @@ +/** + * Backend telemetry measurement IDs. + * Centralised here so every component imports a named constant + * rather than an inline magic string. + */ +export const VCU = { + generalState: "VCU/general_state", + operationalState: "VCU/operational_state", + allReeds: "VCU/all_reeds", + highPressure: "VCU/pressure_high", + pressureBrakes: "VCU/pressure_brakes", + pressureCapsule: "VCU/pressure_capsule", +} as const; + +export const PCU = { + speed: "PCU/encoder_speed_km_h", + position: "PCU/encoder_position", + acceleration: "PCU/encoder_acceleration", + // DLIM phase currents (motor A) + motorCurrentU: "PCU/current_sensor_u_a", + motorCurrentV: "PCU/current_sensor_v_a", + motorCurrentW: "PCU/current_sensor_w_a", +} as const; + +export const PCU_BOARD = { + generalState: "PCU/general_state_machine", + operatingState: "PCU/operational_state_machine", + peakCurrent: "PCU/current_Peak", + frequency: "PCU/frequency", +} as const; + +/** BCU (Booster Control Unit) — LSM phase currents and board states. */ +export const BCU = { + averageCurrentU: "BCU/average_current_u", + averageCurrentV: "BCU/average_current_v", + averageCurrentW: "BCU/average_current_w", + generalState: "BCU/bcu_general_state", + operationalState: "BCU/bcu_operational_state", + nestedState: "BCU/bcu_nested_state", +} as const; + +/** HVBMS — high-voltage battery management system. */ +export const HVBMS = { + minimumSoc: "HVBMS/minimum_soc", + voltageReading: "HVBMS/voltage_reading", + batteriesVoltage: "HVBMS/batteries_voltage_reading", + currentReading: "HVBMS/current_reading", + tempMax: "HVBMS/temp_max", + tempMin: "HVBMS/temp_min", + voltageMax: "HVBMS/voltage_max", + voltageMin: "HVBMS/voltage_min", + imdOk: "HVBMS/imd_is_ok", + sdcStatus: "HVBMS/sdc_status", + operationalState: "HVBMS/operational_state_machine_status", +} as const; + +/** HVBMS-Cabinet — supercapacitor bank and HV bus. */ +export const HVBMS_CABINET = { + contactorsState: "HVBMS-Cabinet/HVBMS-Cabinet_contactors_state", + busVoltage: "HVBMS-Cabinet/HVBMS-Cabinet_bus_voltage", + outputCurrent: "HVBMS-Cabinet/HVBMS-Cabinet_output_current", + sdcGood: "HVBMS-Cabinet/HVBMS-Cabinet_sdc_good", + totalSupercapsVoltage: "HVBMS-Cabinet/HVBMS-Cabinet_total_supercaps_voltage", +} as const; + +/** Per-pack indices are 1-based (1–18). */ +export const hvbmsPack = (n: number) => ({ + soc: `HVBMS/battery${n}_SOC`, + temperature: `HVBMS/battery${n}_temperature1`, + voltage: `HVBMS/battery${n}_total_voltage`, + cell1: `HVBMS/battery${n}_cell1`, + cell2: `HVBMS/battery${n}_cell2`, + cell3: `HVBMS/battery${n}_cell3`, + cell4: `HVBMS/battery${n}_cell4`, + cell5: `HVBMS/battery${n}_cell5`, + cell6: `HVBMS/battery${n}_cell6`, +}); + +/** LVBMS — low-voltage battery management system. */ +export const LVBMS = { + cells: ["LVBMS/cell_1","LVBMS/cell_2","LVBMS/cell_3","LVBMS/cell_4","LVBMS/cell_5","LVBMS/cell_6"] as string[], + soc: "LVBMS/SOC", + totalVoltage: "LVBMS/total_voltage", + voltageMin: "LVBMS/voltage_min", + voltageMax: "LVBMS/voltage_max", + tempMin: "LVBMS/temp_min", + tempMax: "LVBMS/temp_max", + current: "LVBMS/current", + generalState: "LVBMS/state", +} as const; + +/** BLCU — bootloader control unit (firmware flashing). */ +export const BLCU = { + state: "BLCU/state", +} as const; + +export const LCU = { + // Airgaps — vertical (V1–V4) and horizontal (H1–H4) + verticalAirgap1: "LCU/lcu_airgap_1", + verticalAirgap2: "LCU/lcu_airgap_2", + verticalAirgap3: "LCU/lcu_airgap_3", + verticalAirgap4: "LCU/lcu_airgap_4", + horizontalAirgap1: "LCU/lcu_airgap_5", + horizontalAirgap2: "LCU/lcu_airgap_6", + horizontalAirgap3: "LCU/lcu_airgap_7", + horizontalAirgap4: "LCU/lcu_airgap_8", + // Position control outputs + positionY: "LCU/dist_control_y", + positionZ: "LCU/dist_control_z", + // Rotation control outputs + rotationPitch: "LCU/rot_control_y", + rotationRoll: "LCU/rot_control_x", + rotationYaw: "LCU/rot_control_z", + // State + generalState: "LCU/general_state", +} as const; diff --git a/frontend/competition-view/src/constants/orders.ts b/frontend/competition-view/src/constants/orders.ts new file mode 100644 index 000000000..c07eb2390 --- /dev/null +++ b/frontend/competition-view/src/constants/orders.ts @@ -0,0 +1,36 @@ +/** + * Hardcoded order IDs used during competition. + * Each ID maps to a backend command understood by the VCU/HV system. + */ + +export interface OrderFieldValue { + value: unknown; + isEnabled: boolean; + type: string; +} + +export interface Order { + id: number; + fields: Record; +} + +/** Engages the brakes. */ +export const BRAKE_ORDERS: Order[] = [ + { id: 215, fields: {} }, +]; + +/** Opens the HV contactors to cut power. */ +export const OPEN_CONTACTORS_ORDERS: Order[] = [ + { id: 902, fields: {} }, +]; + +/** + * Full emergency stop sequence: + * triggers emergency brake + disables propulsion + cuts HV power. + */ +export const EMERGENCY_STOP_ORDERS: Order[] = [ + { id: 55, fields: {} }, + { id: 1799, fields: {} }, + { id: 1698, fields: {} }, + { id: 0, fields: {} }, +]; diff --git a/frontend/competition-view/src/constants/pages.ts b/frontend/competition-view/src/constants/pages.ts new file mode 100644 index 000000000..b422cc086 --- /dev/null +++ b/frontend/competition-view/src/constants/pages.ts @@ -0,0 +1,16 @@ +import { Activity, Layout, ScrollText, Send, Terminal, Wrench } from "@workspace/ui/icons"; +import { Zap } from "lucide-react"; + +export const PAGES = { + "/": { title: "Overview", icon: Layout }, + "/charts": { title: "Charts", icon: Activity }, + "/batteries": { title: "Batteries", icon: Wrench }, + "/boards": { title: "Boards", icon: Terminal }, + "/booster": { title: "Booster", icon: Zap }, + "/orders": { title: "Orders", icon: Send }, + "/messages": { title: "Messages", icon: ScrollText }, +} as const; + +export const PAGES_ARRAY = Object.entries(PAGES).map( + ([url, { title, icon }]) => ({ title, icon, url }), +); diff --git a/frontend/competition-view/src/hooks/useConnections.ts b/frontend/competition-view/src/hooks/useConnections.ts new file mode 100644 index 000000000..3db03c7a4 --- /dev/null +++ b/frontend/competition-view/src/hooks/useConnections.ts @@ -0,0 +1,10 @@ +import { useStore } from "../store/store"; + +/** + * Returns the current board connection map from the global store. + * Components can subscribe to a specific board by selecting it by name, + * or consume the full map for a connection-status overview. + */ +const useConnections = () => useStore((s) => s.connections); + +export default useConnections; diff --git a/frontend/competition-view/src/hooks/useKeyboardShortcuts.ts b/frontend/competition-view/src/hooks/useKeyboardShortcuts.ts new file mode 100644 index 000000000..81b7274e6 --- /dev/null +++ b/frontend/competition-view/src/hooks/useKeyboardShortcuts.ts @@ -0,0 +1,112 @@ +import { useCallback, useEffect, useRef, useState } from "react"; + +/** Returns true when focus is inside a text-input element. */ +const isTypingInInput = () => { + const tag = document.activeElement?.tagName.toLowerCase(); + return tag === "input" || tag === "textarea" || tag === "select"; +}; + +export interface ShortcutDef { + key: string; + /** Human-readable label shown in the help dialog. */ + label: string; + description: string; +} + +/** All available shortcuts, in display order. */ +export const SHORTCUT_DEFS: ShortcutDef[] = [ + { key: "b", label: "B", description: "Brake" }, + { key: "o", label: "O", description: "Open Contactors" }, + { key: "e", label: "E → E", description: "Emergency Stop (press twice in 2 s)" }, + { key: "shift+/", label: "?", description: "Toggle keyboard shortcuts reference" }, +]; + +interface Options { + /** Whether shortcuts are active (disable when modal is open, etc.). */ + enabled: boolean; + onBrake: () => void; + onOpenContactors: () => void; + onEmergencyStop: () => void; + onToggleHelp: () => void; +} + +interface Result { + /** True for up to 2 s after the first E press — use to show an armed indicator. */ + estopArmed: boolean; +} + +/** + * Registers global keydown handlers for competition quick-actions. + * + * Shortcuts fire only when the user is NOT typing in a form field. + * ESTOP requires two E presses within 2 seconds to prevent accidents. + */ +const useKeyboardShortcuts = ({ + enabled, + onBrake, + onOpenContactors, + onEmergencyStop, + onToggleHelp, +}: Options): Result => { + const [estopArmed, setEstopArmed] = useState(false); + const timerRef = useRef | null>(null); + + const armEstop = useCallback(() => { + setEstopArmed(true); + if (timerRef.current) clearTimeout(timerRef.current); + timerRef.current = setTimeout(() => setEstopArmed(false), 2000); + }, []); + + const confirmEstop = useCallback(() => { + if (timerRef.current) clearTimeout(timerRef.current); + setEstopArmed(false); + onEmergencyStop(); + }, [onEmergencyStop]); + + const handleKeyDown = useCallback( + (e: KeyboardEvent) => { + if (!enabled || isTypingInInput()) return; + // Ignore anything with Ctrl/Meta/Alt to avoid clashing with OS shortcuts + if (e.ctrlKey || e.metaKey || e.altKey) return; + + switch (e.key.toLowerCase()) { + case "b": + e.preventDefault(); + onBrake(); + break; + + case "o": + e.preventDefault(); + onOpenContactors(); + break; + + case "e": + e.preventDefault(); + if (estopArmed) { + confirmEstop(); + } else { + armEstop(); + } + break; + + case "?": + e.preventDefault(); + onToggleHelp(); + break; + } + }, + [enabled, estopArmed, onBrake, onOpenContactors, armEstop, confirmEstop, onToggleHelp], + ); + + useEffect(() => { + window.addEventListener("keydown", handleKeyDown); + return () => window.removeEventListener("keydown", handleKeyDown); + }, [handleKeyDown]); + + // Clean up the arm timer on unmount + useEffect(() => () => { if (timerRef.current) clearTimeout(timerRef.current); }, []); + + return { estopArmed }; +}; + +export default useKeyboardShortcuts; diff --git a/frontend/competition-view/src/hooks/useMeasurement.ts b/frontend/competition-view/src/hooks/useMeasurement.ts new file mode 100644 index 000000000..802b839cf --- /dev/null +++ b/frontend/competition-view/src/hooks/useMeasurement.ts @@ -0,0 +1,10 @@ +import { useStore } from "../store/store"; + +/** + * Reads a single telemetry measurement from the store by its backend key + * (e.g. "VCU/general_state"). Returns `undefined` if no data has arrived yet. + */ +const useMeasurement = (key: string) => + useStore((s) => s.getMeasurement(key)); + +export default useMeasurement; diff --git a/frontend/competition-view/src/hooks/useOrdersCatalog.ts b/frontend/competition-view/src/hooks/useOrdersCatalog.ts new file mode 100644 index 000000000..a838165e4 --- /dev/null +++ b/frontend/competition-view/src/hooks/useOrdersCatalog.ts @@ -0,0 +1,48 @@ +import { useFetchConfig } from "@workspace/ui/hooks"; +import { useEffect } from "react"; +import { useStore } from "../store/store"; +import type { OrdersData } from "../types/catalog"; + +const BACKEND_URL = + (import.meta.env.VITE_BACKEND_URL as string | undefined) ?? + "http://127.0.0.1:4000/backend"; + +/** + * Fetches the orders catalog from the backend and stores it in Zustand. + * Automatically refetches whenever the WebSocket reconnects. + */ +const useOrdersCatalog = (isConnected: boolean) => { + const setCommandsCatalog = useStore((s) => s.setCommandsCatalog); + const setBoards = useStore((s) => s.setBoards); + + const { data, loading, refetch } = useFetchConfig( + BACKEND_URL, + "orderStructures", + ); + + // Refetch every time the WebSocket connects (backend may have restarted) + useEffect(() => { + if (isConnected) refetch(); + }, [isConnected, refetch]); + + // Populate the store whenever new data arrives + useEffect(() => { + if (!data) return; + + const catalog: ReturnType["commandsCatalog"] = {}; + const boardNames: string[] = []; + + for (const board of data.boards) { + if (board.orders.length === 0) continue; + catalog[board.name] = board; + boardNames.push(board.name); + } + + setCommandsCatalog(catalog); + setBoards(boardNames.sort()); + }, [data, setCommandsCatalog, setBoards]); + + return { loading }; +}; + +export default useOrdersCatalog; diff --git a/frontend/competition-view/src/hooks/useSendOrder.ts b/frontend/competition-view/src/hooks/useSendOrder.ts new file mode 100644 index 000000000..1ce0fc966 --- /dev/null +++ b/frontend/competition-view/src/hooks/useSendOrder.ts @@ -0,0 +1,20 @@ +import { logger, socketService } from "@workspace/core"; +import { useCallback } from "react"; +import type { Order } from "../constants/orders"; + +/** + * Returns a stable callback that posts one or more orders to the backend + * via the `order/send` WebSocket topic. + * + * Each order is dispatched independently in the given sequence. + * The caller is responsible for providing valid order IDs. + */ +const useSendOrder = () => + useCallback((orders: Order[]) => { + for (const order of orders) { + logger.competitionView.log("Sending order:", order.id); + socketService.post("order/send", order); + } + }, []); + +export default useSendOrder; diff --git a/frontend/competition-view/src/index.css b/frontend/competition-view/src/index.css new file mode 100644 index 000000000..e7caa9cec --- /dev/null +++ b/frontend/competition-view/src/index.css @@ -0,0 +1,14 @@ +@import "@workspace/ui/globals.css"; + +/* Ensure Tailwind v4 scans competition-view source files directly. + The @source paths in globals.css resolve via the @workspace/ui symlink + and don't correctly reach this project's source tree. */ +@source "./**/*.{ts,tsx}"; + +/* Apply base foreground color so text inherits correctly in both light and dark + mode. Without this, text falls back to the browser UA default (black), which + is invisible on the dark mode background (#181818). */ +body { + color: var(--foreground); + background-color: var(--background); +} diff --git a/frontend/competition-view/src/layout/AppLayout.tsx b/frontend/competition-view/src/layout/AppLayout.tsx new file mode 100644 index 000000000..73ad4321a --- /dev/null +++ b/frontend/competition-view/src/layout/AppLayout.tsx @@ -0,0 +1,36 @@ +import { SidebarInset, SidebarProvider } from "@workspace/ui/components"; +import { useEffect, type ReactNode } from "react"; +import Header from "../components/header/Header"; +import AppSidebar from "../components/sidebar/AppSidebar"; +import { useStore } from "../store/store"; + +interface AppLayoutProps { + children: ReactNode; + backendConnected: boolean; + onShowShortcuts: () => void; +} + +const AppLayout = ({ children, backendConnected, onShowShortcuts }: AppLayoutProps) => { + const isDarkMode = useStore((s) => s.isDarkMode); + + useEffect(() => { + const root = window.document.documentElement; + root.classList.toggle("dark", isDarkMode); + }, [isDarkMode]); + + return ( +
+ +
+ + +
+
{children}
+ +
+
+
+ ); +}; + +export default AppLayout; diff --git a/frontend/competition-view/src/main.tsx b/frontend/competition-view/src/main.tsx new file mode 100644 index 000000000..6ffe1cf7c --- /dev/null +++ b/frontend/competition-view/src/main.tsx @@ -0,0 +1,13 @@ +import { StrictMode } from "react"; +import { createRoot } from "react-dom/client"; +import { HashRouter } from "react-router"; +import App from "./App.tsx"; +import "./index.css"; + +createRoot(document.getElementById("root")!).render( + + + + + , +); diff --git a/frontend/competition-view/src/pages/Batteries.tsx b/frontend/competition-view/src/pages/Batteries.tsx new file mode 100644 index 000000000..e8cd5aec0 --- /dev/null +++ b/frontend/competition-view/src/pages/Batteries.tsx @@ -0,0 +1 @@ +export { default } from "./Batteries/Batteries"; diff --git a/frontend/competition-view/src/pages/Batteries/Batteries.tsx b/frontend/competition-view/src/pages/Batteries/Batteries.tsx new file mode 100644 index 000000000..0aea4f4f8 --- /dev/null +++ b/frontend/competition-view/src/pages/Batteries/Batteries.tsx @@ -0,0 +1,21 @@ +import { Separator } from "@workspace/ui/components"; +import HvBatterySection from "./components/HvBatterySection"; +import LvBatterySection from "./components/LvBatterySection"; + +/** + * Batteries monitoring page. + * + * Layout: + * - High-voltage section (HVSCU summary + 18 pack cards) + * - Separator + * - Low-voltage section (BMSL summary + 6 cell cards) + */ +const Batteries = () => ( +
+ + + +
+); + +export default Batteries; diff --git a/frontend/competition-view/src/pages/Batteries/components/BatteryPackCard.tsx b/frontend/competition-view/src/pages/Batteries/components/BatteryPackCard.tsx new file mode 100644 index 000000000..8137fe196 --- /dev/null +++ b/frontend/competition-view/src/pages/Batteries/components/BatteryPackCard.tsx @@ -0,0 +1,94 @@ +import { + Card, + CardContent, + CardHeader, + CardTitle, +} from "@workspace/ui/components"; +import { hvbmsPack } from "../../../constants/measurements"; +import useMeasurement from "../../../hooks/useMeasurement"; + +interface BatteryPackCardProps { + /** Pack number, 1-based (1–18). */ + packNumber: number; +} + +const fmt = (v: number | boolean | string | undefined, decimals = 1) => + typeof v === "number" ? v.toFixed(decimals) : "—"; + +const BatteryPackCard = ({ packNumber }: BatteryPackCardProps) => { + const keys = hvbmsPack(packNumber); + + const soc = useMeasurement(keys.soc); + const voltage = useMeasurement(keys.voltage); + const temp = useMeasurement(keys.temperature); + const cell1 = useMeasurement(keys.cell1); + const cell2 = useMeasurement(keys.cell2); + const cell3 = useMeasurement(keys.cell3); + const cell4 = useMeasurement(keys.cell4); + const cell5 = useMeasurement(keys.cell5); + const cell6 = useMeasurement(keys.cell6); + + const cells = [cell1, cell2, cell3, cell4, cell5, cell6]; + const cellNums = cells.filter((c): c is number => typeof c === "number"); + const cellMax = cellNums.length ? Math.max(...cellNums) : undefined; + const cellMin = cellNums.length ? Math.min(...cellNums) : undefined; + + const socNum = typeof soc === "number" ? soc : null; + const socColor = + socNum === null ? "bg-muted" : + socNum < 15 ? "bg-red-500" : + socNum < 30 ? "bg-amber-500" : + "bg-green-500"; + + return ( + + + + Pack {packNumber} + + + + + {/* SOC bar */} +
+
+
+
+ + {fmt(soc, 0)}% + +
+ + {/* Key values */} +
+ + + + +
+ + + ); +}; + +const Stat = ({ + label, + value, + unit, +}: { + label: string; + value: string; + unit: string; +}) => ( +
+ {label} + + {value} {unit} + +
+); + +export default BatteryPackCard; diff --git a/frontend/competition-view/src/pages/Batteries/components/HvBatterySection.tsx b/frontend/competition-view/src/pages/Batteries/components/HvBatterySection.tsx new file mode 100644 index 000000000..1909aabf4 --- /dev/null +++ b/frontend/competition-view/src/pages/Batteries/components/HvBatterySection.tsx @@ -0,0 +1,75 @@ +import { Separator } from "@workspace/ui/components"; +import { HVBMS, HVBMS_CABINET } from "../../../constants/measurements"; +import useMeasurement from "../../../hooks/useMeasurement"; +import BatteryPackCard from "./BatteryPackCard"; + +const PACK_COUNT = 18; +const PACK_NUMBERS = Array.from({ length: PACK_COUNT }, (_, i) => i + 1); + +const fmt = (v: number | boolean | string | undefined, decimals = 1) => + typeof v === "number" ? v.toFixed(decimals) : "—"; + +const HvBatterySection = () => { + const totalVoltage = useMeasurement(HVBMS.batteriesVoltage); + const voltageMax = useMeasurement(HVBMS.voltageMax); + const voltageMin = useMeasurement(HVBMS.voltageMin); + const tempMax = useMeasurement(HVBMS.tempMax); + const tempMin = useMeasurement(HVBMS.tempMin); + const soc = useMeasurement(HVBMS.minimumSoc); + const contactors = useMeasurement(HVBMS_CABINET.contactorsState); + + return ( +
+ {/* Section header */} +
+

+ High Voltage +

+ {contactors !== undefined && ( + + Contactors {contactors} + + )} +
+ + {/* Summary stats */} +
+ {[ + { label: "Total V", value: fmt(totalVoltage), unit: "V" }, + { label: "Min SOC", value: fmt(soc, 0), unit: "%" }, + { label: "V max", value: fmt(voltageMax, 3), unit: "V" }, + { label: "V min", value: fmt(voltageMin, 3), unit: "V" }, + { label: "T max", value: fmt(tempMax), unit: "°C" }, + { label: "T min", value: fmt(tempMin), unit: "°C" }, + ].map(({ label, value, unit }) => ( +
+ {label} + + {value} + + {unit} + + +
+ ))} +
+ + + + {/* Pack grid */} +
+ {PACK_NUMBERS.map((n) => ( + + ))} +
+
+ ); +}; + +export default HvBatterySection; diff --git a/frontend/competition-view/src/pages/Batteries/components/LvBatterySection.tsx b/frontend/competition-view/src/pages/Batteries/components/LvBatterySection.tsx new file mode 100644 index 000000000..f235dd70b --- /dev/null +++ b/frontend/competition-view/src/pages/Batteries/components/LvBatterySection.tsx @@ -0,0 +1,123 @@ +import { Separator } from "@workspace/ui/components"; +import { LVBMS } from "../../../constants/measurements"; +import useMeasurement from "../../../hooks/useMeasurement"; + +const fmt = (v: number | boolean | string | undefined, decimals = 2) => + typeof v === "number" ? v.toFixed(decimals) : "—"; + +/** + * Low-voltage battery section: BMSL summary stats + individual cell voltages. + */ +const LvBatterySection = () => { + const soc = useMeasurement(LVBMS.soc); + const totalVoltage = useMeasurement(LVBMS.totalVoltage); + const voltageMax = useMeasurement(LVBMS.voltageMax); + const voltageMin = useMeasurement(LVBMS.voltageMin); + const tempMax = useMeasurement(LVBMS.tempMax); + const tempMin = useMeasurement(LVBMS.tempMin); + const current = useMeasurement(LVBMS.current); + const state = useMeasurement(LVBMS.generalState); + + return ( +
+ {/* Section header */} +
+

+ Low Voltage (LVBMS) +

+ {state !== undefined && ( + + {String(state)} + + )} +
+ + {/* Summary stats */} +
+ {[ + { label: "SOC", value: fmt(soc, 0), unit: "%" }, + { label: "Total V", value: fmt(totalVoltage), unit: "V" }, + { label: "Current", value: fmt(current), unit: "A" }, + { label: "V max", value: fmt(voltageMax), unit: "V" }, + { label: "V min", value: fmt(voltageMin), unit: "V" }, + { label: "T max", value: fmt(tempMax, 1), unit: "°C" }, + { label: "T min", value: fmt(tempMin, 1), unit: "°C" }, + ].map(({ label, value, unit }) => ( +
+ {label} + + {value} + + {unit} + + +
+ ))} +
+ + + + {/* Individual cell voltages */} +
+ {LVBMS.cells.map((key, i) => ( + + ))} +
+
+ ); +}; + +/* ─── Sub-component ───────────────────────────────────────────────────── */ + +interface CellCardProps { + cellNumber: number; + measurementKey: string; +} + +const CELL_MIN = 3.0; +const CELL_MAX = 4.2; + +const CellCard = ({ cellNumber, measurementKey }: CellCardProps) => { + const voltage = useMeasurement(measurementKey); + const v = typeof voltage === "number" ? voltage : null; + + const isLow = v !== null && v < CELL_MIN + 0.1; + const isHigh = v !== null && v > CELL_MAX - 0.05; + + // Fill percentage within the useful range + const fill = + v !== null + ? Math.min(100, Math.max(0, ((v - CELL_MIN) / (CELL_MAX - CELL_MIN)) * 100)) + : 0; + + return ( +
+ Cell {cellNumber} + + {/* Mini bar */} +
+
+
+ + + {v !== null ? v.toFixed(3) : "—"} + V + +
+ ); +}; + +export default LvBatterySection; diff --git a/frontend/competition-view/src/pages/Boards.tsx b/frontend/competition-view/src/pages/Boards.tsx new file mode 100644 index 000000000..6c6085f94 --- /dev/null +++ b/frontend/competition-view/src/pages/Boards.tsx @@ -0,0 +1 @@ +export { default } from "./Boards/Boards"; diff --git a/frontend/competition-view/src/pages/Boards/Boards.tsx b/frontend/competition-view/src/pages/Boards/Boards.tsx new file mode 100644 index 000000000..11eb623e1 --- /dev/null +++ b/frontend/competition-view/src/pages/Boards/Boards.tsx @@ -0,0 +1,100 @@ +import { BCU, BLCU, HVBMS, HVBMS_CABINET, LCU, LVBMS, PCU_BOARD, VCU } from "../../constants/measurements"; +import BoardCard from "./components/BoardCard"; +import LcuAirgapCard from "./components/LcuAirgapCard"; + +const Boards = () => ( +
+
+

Board States

+ +
+ + + + + + + + + + + + + + + +
+
+ + {/* LCU levitation detail */} +
+

Levitation

+ +
+
+); + +export default Boards; diff --git a/frontend/competition-view/src/pages/Boards/components/BoardCard.tsx b/frontend/competition-view/src/pages/Boards/components/BoardCard.tsx new file mode 100644 index 000000000..69f8ba297 --- /dev/null +++ b/frontend/competition-view/src/pages/Boards/components/BoardCard.tsx @@ -0,0 +1,87 @@ +import { + Badge, + Card, + CardContent, + CardHeader, + CardTitle, +} from "@workspace/ui/components"; +import useMeasurement from "../../../hooks/useMeasurement"; + +interface Stat { + label: string; + measurementKey: string; + unit?: string; + decimals?: number; +} + +interface BoardCardProps { + /** Display name shown in the card header. */ + name: string; + /** Measurement key for the board's general/operational state string. */ + stateMeasurementKey: string; + /** Additional stats shown in a compact grid below the state. */ + stats?: Stat[]; +} + +/** + * Generic board status card. + * Shows a state badge and an optional grid of secondary measurements. + */ +const BoardCard = ({ name, stateMeasurementKey, stats = [] }: BoardCardProps) => { + const state = useMeasurement(stateMeasurementKey); + const hasData = state !== undefined; + + return ( + + + + {name} + + {hasData ? String(state) : "—"} + + + + + {stats.length > 0 && ( + +
+ {stats.map((s) => ( + + ))} +
+
+ )} +
+ ); +}; + +const StatRow = ({ stat }: { stat: Stat }) => { + const raw = useMeasurement(stat.measurementKey); + const display = + typeof raw === "number" + ? raw.toFixed(stat.decimals ?? 1) + : raw !== undefined + ? String(raw) + : "—"; + + return ( +
+ {stat.label} + + {display} + {raw !== undefined && stat.unit && ( + {stat.unit} + )} + +
+ ); +}; + +export default BoardCard; diff --git a/frontend/competition-view/src/pages/Boards/components/LcuAirgapCard.tsx b/frontend/competition-view/src/pages/Boards/components/LcuAirgapCard.tsx new file mode 100644 index 000000000..4104826b9 --- /dev/null +++ b/frontend/competition-view/src/pages/Boards/components/LcuAirgapCard.tsx @@ -0,0 +1,133 @@ +import { + Card, + CardContent, + CardHeader, + CardTitle, +} from "@workspace/ui/components"; +import { LCU } from "../../../constants/measurements"; +import useMeasurement from "../../../hooks/useMeasurement"; + +/** Airgap warning threshold in mm. */ +const AIRGAP_WARN_MM = 5; + +const fmt = (v: number | boolean | string | undefined, decimals = 1) => + typeof v === "number" ? v.toFixed(decimals) : "—"; + +/* ─── Shared row components ────────────────────────────────────────────── */ + +interface MeasurementRowProps { + label: string; + measurementKey: string; + unit: string; + decimals?: number; + warnBelow?: number; +} + +const MeasurementRow = ({ + label, + measurementKey, + unit, + decimals = 1, + warnBelow, +}: MeasurementRowProps) => { + const value = useMeasurement(measurementKey); + const isWarning = + warnBelow !== undefined && + typeof value === "number" && + value < warnBelow; + + return ( +
+ {label} + + {fmt(value, decimals)} + {unit} + +
+ ); +}; + +/* ─── Section components ───────────────────────────────────────────────── */ + +const SectionLabel = ({ children }: { children: React.ReactNode }) => ( +

+ {children} +

+); + +const PositionSection = () => ( +
+ Position +
+ + +
+
+); + +const RotationSection = () => ( +
+ Rotation +
+ + + +
+
+); + +const VerticalAirgapsSection = () => ( +
+ Vertical Airgaps +
+ + + + +
+
+); + +const HorizontalAirgapsSection = () => ( +
+ Horizontal Airgaps +
+ + + + +
+
+); + +/* ─── Main card ─────────────────────────────────────────────────────────── */ + +import React from "react"; + +/** + * Full levitation status card for the LCU. + * Displays position, rotation, and all 8 airgap sensors in a 4-column grid. + * Airgap values below 5 mm are highlighted in amber. + */ +const LcuAirgapCard = () => ( + + + LCU — Levitation + + + +
+ + + + +
+
+
+); + +export default LcuAirgapCard; diff --git a/frontend/competition-view/src/pages/Booster/Booster.tsx b/frontend/competition-view/src/pages/Booster/Booster.tsx new file mode 100644 index 000000000..1113fe616 --- /dev/null +++ b/frontend/competition-view/src/pages/Booster/Booster.tsx @@ -0,0 +1,63 @@ +import { BCU, HVBMS_CABINET } from "../../constants/measurements"; +import BoardCard from "../Boards/components/BoardCard"; + +/** + * Booster page — BCU (Booster Control Unit) state + HVBMS-Cabinet health. + * + * Layout: + * Section 1 — BCU state: general/operational/nested states + LSM phase currents + * Section 2 — HVBMS-Cabinet: contactors, bus voltage, output current, supercaps + */ +const Booster = () => ( +
+ {/* ── BCU ─────────────────────────────────────────────────────────── */} +
+

+ BCU — Booster Control Unit +

+ +
+ + + +
+
+ + {/* ── HVBMS-Cabinet ────────────────────────────────────────────────── */} +
+

+ HVBMS-Cabinet +

+ +
+ +
+
+
+); + +export default Booster; diff --git a/frontend/competition-view/src/pages/Booster/index.ts b/frontend/competition-view/src/pages/Booster/index.ts new file mode 100644 index 000000000..41853e9eb --- /dev/null +++ b/frontend/competition-view/src/pages/Booster/index.ts @@ -0,0 +1 @@ +export { default } from "./Booster"; diff --git a/frontend/competition-view/src/pages/Charts.tsx b/frontend/competition-view/src/pages/Charts.tsx new file mode 100644 index 000000000..de8dd5e2a --- /dev/null +++ b/frontend/competition-view/src/pages/Charts.tsx @@ -0,0 +1 @@ +export { default } from "./Charts/Charts"; diff --git a/frontend/competition-view/src/pages/Charts/Charts.tsx b/frontend/competition-view/src/pages/Charts/Charts.tsx new file mode 100644 index 000000000..b4611ec22 --- /dev/null +++ b/frontend/competition-view/src/pages/Charts/Charts.tsx @@ -0,0 +1,77 @@ +import { BCU, HVBMS, PCU, VCU } from "../../constants/measurements"; +import MultiSeriesChart, { type SeriesConfig } from "./components/MultiSeriesChart"; +import TelemetryChart from "./components/TelemetryChart"; + +/** + * Real-time telemetry charts page. + * + * Row 1 — Kinematic: Speed · Position + * Row 2 — Electrical: HV Battery SOC · Brake Pressure + * Row 3 — Motor phase: DLIM (PCU motorA U/V/W) · LSM (BCU average U/V/W) + * + * Each chart accumulates a rolling 500-point history and supports + * click-drag zoom with double-click to reset. + * + * DLIM/LSM series configs are defined at module level so the + * MultiSeriesChart's Zustand selector and uPlot init are stable. + */ + +const DLIM_SERIES: SeriesConfig[] = [ + { measurementKey: PCU.motorCurrentU, label: "U", colorIndex: 0 }, + { measurementKey: PCU.motorCurrentV, label: "V", colorIndex: 1 }, + { measurementKey: PCU.motorCurrentW, label: "W", colorIndex: 2 }, +]; + +const LSM_SERIES: SeriesConfig[] = [ + { measurementKey: BCU.averageCurrentU, label: "U", colorIndex: 0 }, + { measurementKey: BCU.averageCurrentV, label: "V", colorIndex: 1 }, + { measurementKey: BCU.averageCurrentW, label: "W", colorIndex: 2 }, +]; + +const Charts = () => ( +
+
+ {/* Row 1 — Kinematic */} + + + + {/* Row 2 — Electrical */} + + + + {/* Row 3 — Motor phase currents */} + + +
+
+); + +export default Charts; diff --git a/frontend/competition-view/src/pages/Charts/components/MultiSeriesChart.tsx b/frontend/competition-view/src/pages/Charts/components/MultiSeriesChart.tsx new file mode 100644 index 000000000..843514af7 --- /dev/null +++ b/frontend/competition-view/src/pages/Charts/components/MultiSeriesChart.tsx @@ -0,0 +1,194 @@ +import { memo, useEffect, useRef } from "react"; +import uPlot from "uplot"; +import "uplot/dist/uPlot.min.css"; +import { useShallow } from "zustand/react/shallow"; +import { + CHART_COLORS, + CHART_HEIGHT, + CHART_LINE_WIDTH, + CHART_MAX_POINTS, + CHART_POINT_SIZE, +} from "../../../constants/chartConfig"; +import { useStore } from "../../../store/store"; + +export interface SeriesConfig { + measurementKey: string; + /** Short label shown in the legend (e.g. "U", "V", "W"). */ + label: string; + /** Index into CHART_COLORS. Falls back to the series' position index. */ + colorIndex?: number; +} + +interface MultiSeriesChartProps { + title: string; + series: SeriesConfig[]; + unit?: string; +} + +/** + * Real-time chart with up to 5 simultaneous series — designed for the + * three-phase DLIM / LSM current charts. + * + * Series configs must be a stable reference (defined at module level or + * memoized) so the Zustand selector and uPlot init only run once. + * + * A compact colour-dot legend is rendered in the card header. + * Double-click resets the zoom. + */ +const MultiSeriesChart = memo(({ title, series, unit = "" }: MultiSeriesChartProps) => { + const containerRef = useRef(null); + const uplotRef = useRef(null); + const xRef = useRef([]); + // One data array per series, initialised lazily on first render. + const yRefs = useRef(series.map(() => [])); + const counterRef = useRef(0); + + // Subscribe to all series values at once; useShallow prevents re-renders + // when the values haven't actually changed. + const values = useStore( + // The selector is stable because `series` is a module-level constant. + useShallow((s) => + series.map(({ measurementKey }) => s.telemetry[measurementKey] as number | undefined), + ), + ); + + // ── Initialise uPlot ──────────────────────────────────────────────────── + useEffect(() => { + if (!containerRef.current) return; + + const getVar = (name: string) => + getComputedStyle(document.documentElement).getPropertyValue(name).trim(); + + const uplotSeries: uPlot.Series[] = [ + {}, // x-axis placeholder + ...series.map(({ label, colorIndex }, i) => { + const color = CHART_COLORS[(colorIndex ?? i) % CHART_COLORS.length]; + return { + label, + stroke: color, + width: CHART_LINE_WIDTH, + points: { show: true, size: CHART_POINT_SIZE, fill: color, width: 0 }, + }; + }), + ]; + + const opts: uPlot.Options = { + width: containerRef.current.clientWidth, + height: CHART_HEIGHT, + legend: { show: false }, + padding: [16, 8, 4, 12], + scales: { + x: { time: false }, + y: { + range: (_, min, max) => { + if (min === max) return [min - 1, max + 1]; + const span = max - min; + const buffer = span * 0.15; + return [min - buffer, max + buffer]; + }, + }, + }, + series: uplotSeries, + axes: [ + { + stroke: getVar("--muted-foreground"), + grid: { show: false }, + font: "10px Archivo", + size: 20, + }, + { + side: 1, + stroke: getVar("--muted-foreground"), + grid: { stroke: getVar("--border") }, + font: "10px Archivo", + size: unit ? 48 : 36, + label: unit, + }, + ], + cursor: { drag: { setScale: true, x: true, y: true } }, + }; + + const initialData: uPlot.AlignedData = [[], ...series.map(() => [] as number[])]; + uplotRef.current = new uPlot(opts, initialData, containerRef.current); + + const handleDblClick = () => + uplotRef.current?.setScale("x", { + min: null as unknown as number, + max: null as unknown as number, + }); + containerRef.current.addEventListener("dblclick", handleDblClick); + + return () => { + uplotRef.current?.destroy(); + uplotRef.current = null; + containerRef.current?.removeEventListener("dblclick", handleDblClick); + }; + // Intentionally runs once on mount — series config is stable. + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + + // ── Feed new data points ───────────────────────────────────────────────── + useEffect(() => { + if (!uplotRef.current) return; + // Only push a point when every series has a numeric value (all phases + // arrive in the same telemetry packet so this is normally always true). + if (!values.every((v) => typeof v === "number")) return; + + xRef.current.push(counterRef.current++); + (values as number[]).forEach((v, i) => { + yRefs.current[i].push(v); + }); + + if (xRef.current.length > CHART_MAX_POINTS) { + xRef.current = xRef.current.slice(-CHART_MAX_POINTS); + yRefs.current = yRefs.current.map((y) => y.slice(-CHART_MAX_POINTS)); + } + + uplotRef.current.setData([xRef.current, ...yRefs.current]); + }, [values]); + + // ── Resize to container ────────────────────────────────────────────────── + useEffect(() => { + if (!containerRef.current) return; + const observer = new ResizeObserver((entries) => { + for (const entry of entries) { + uplotRef.current?.setSize({ + width: entry.contentRect.width, + height: CHART_HEIGHT, + }); + } + }); + observer.observe(containerRef.current); + return () => observer.disconnect(); + }, []); + + return ( +
+
+ {/* Title + inline phase legend */} +
+ {title} + {series.map(({ label, colorIndex }, i) => { + const color = CHART_COLORS[(colorIndex ?? i) % CHART_COLORS.length]; + return ( + + + {label} + + ); + })} +
+ {unit && ( + {unit} + )} +
+
+
+ ); +}); + +MultiSeriesChart.displayName = "MultiSeriesChart"; +export default MultiSeriesChart; diff --git a/frontend/competition-view/src/pages/Charts/components/TelemetryChart.tsx b/frontend/competition-view/src/pages/Charts/components/TelemetryChart.tsx new file mode 100644 index 000000000..5f6cadc9c --- /dev/null +++ b/frontend/competition-view/src/pages/Charts/components/TelemetryChart.tsx @@ -0,0 +1,159 @@ +import { memo, useEffect, useRef } from "react"; +import uPlot from "uplot"; +import "uplot/dist/uPlot.min.css"; +import { + CHART_COLORS, + CHART_HEIGHT, + CHART_LINE_WIDTH, + CHART_MAX_POINTS, + CHART_POINT_SIZE, +} from "../../../constants/chartConfig"; +import useMeasurement from "../../../hooks/useMeasurement"; + +interface TelemetryChartProps { + /** Human-readable label shown in the card header. */ + title: string; + /** Backend telemetry key to track (e.g. "PCU/encoder_speed_km_h"). */ + measurementKey: string; + /** Unit appended to the y-axis label. */ + unit?: string; + /** Index into CHART_COLORS. Defaults to 0 (primary orange). */ + colorIndex?: number; +} + +/** + * Fixed single-series real-time chart for competition telemetry. + * + * History is accumulated in a local ref (no store involvement) so the + * component stays lightweight. The x-axis is a monotonic counter driven + * by incoming telemetry packets. Double-click resets the zoom. + */ +const TelemetryChart = memo(({ + title, + measurementKey, + unit = "", + colorIndex = 0, +}: TelemetryChartProps) => { + const containerRef = useRef(null); + const uplotRef = useRef(null); + const xRef = useRef([]); + const yRef = useRef([]); + const counterRef = useRef(0); + + const value = useMeasurement(measurementKey); + const color = CHART_COLORS[colorIndex % CHART_COLORS.length]; + + // ── Initialise uplot ──────────────────────────────────────────────────── + useEffect(() => { + if (!containerRef.current) return; + + const getVar = (name: string) => + getComputedStyle(document.documentElement).getPropertyValue(name).trim(); + + const opts: uPlot.Options = { + width: containerRef.current.clientWidth, + height: CHART_HEIGHT, + legend: { show: false }, + padding: [16, 8, 4, 12], + scales: { + x: { time: false }, + y: { + range: (_, min, max) => { + if (min === max) return [min - 1, max + 1]; + const span = max - min; + const buffer = span * 0.15; + return [min - buffer, max + buffer]; + }, + }, + }, + series: [ + {}, + { + label: measurementKey, + stroke: color, + width: CHART_LINE_WIDTH, + points: { show: true, size: CHART_POINT_SIZE, fill: color, width: 0 }, + }, + ], + axes: [ + { + stroke: getVar("--muted-foreground"), + grid: { show: false }, + font: "10px Archivo", + size: 20, + }, + { + side: 1, + stroke: getVar("--muted-foreground"), + grid: { stroke: getVar("--border") }, + font: "10px Archivo", + size: unit ? 48 : 36, + label: unit, + }, + ], + cursor: { drag: { setScale: true, x: true, y: true } }, + }; + + uplotRef.current = new uPlot(opts, [[], []], containerRef.current); + + // Pass null to reset zoom; cast needed since uplot's TS types omit null here. + const handleDblClick = () => uplotRef.current?.setScale("x", { min: null as unknown as number, max: null as unknown as number }); + containerRef.current.addEventListener("dblclick", handleDblClick); + + return () => { + uplotRef.current?.destroy(); + uplotRef.current = null; + containerRef.current?.removeEventListener("dblclick", handleDblClick); + }; + // Intentionally runs once on mount — series config is stable. + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + + // ── Feed new data points ──────────────────────────────────────────────── + useEffect(() => { + if (typeof value !== "number" || !uplotRef.current) return; + + xRef.current.push(counterRef.current++); + yRef.current.push(value); + + if (xRef.current.length > CHART_MAX_POINTS) { + xRef.current = xRef.current.slice(-CHART_MAX_POINTS); + yRef.current = yRef.current.slice(-CHART_MAX_POINTS); + } + + uplotRef.current.setData([xRef.current, yRef.current]); + }, [value]); + + // ── Resize to container ───────────────────────────────────────────────── + useEffect(() => { + if (!containerRef.current) return; + + const observer = new ResizeObserver((entries) => { + for (const entry of entries) { + uplotRef.current?.setSize({ + width: entry.contentRect.width, + height: CHART_HEIGHT, + }); + } + }); + + observer.observe(containerRef.current); + return () => observer.disconnect(); + }, []); + + return ( +
+
+ {title} + {unit && ( + {unit} + )} +
+
+
+ ); +}); + +TelemetryChart.displayName = "TelemetryChart"; + +export default TelemetryChart; diff --git a/frontend/competition-view/src/pages/Messages.tsx b/frontend/competition-view/src/pages/Messages.tsx new file mode 100644 index 000000000..2debd8c5c --- /dev/null +++ b/frontend/competition-view/src/pages/Messages.tsx @@ -0,0 +1 @@ +export { default } from "./Messages/Messages"; diff --git a/frontend/competition-view/src/pages/Messages/Messages.tsx b/frontend/competition-view/src/pages/Messages/Messages.tsx new file mode 100644 index 000000000..19ed27301 --- /dev/null +++ b/frontend/competition-view/src/pages/Messages/Messages.tsx @@ -0,0 +1,129 @@ +import { Button, Separator } from "@workspace/ui/components"; +import { ChevronUp } from "@workspace/ui/icons"; +import { useEffect, useRef, useState } from "react"; +import { useStore } from "../../store/store"; +import type { MessageKind } from "../../types/message"; +import MessageItem from "./components/MessageItem"; + +const ALL_KINDS: MessageKind[] = ["info", "warning", "error", "debug"]; + +const KIND_LABEL: Record = { + info: "Info", + warning: "Warning", + error: "Error", + debug: "Debug", +}; + +/** + * Full message log with per-kind filtering and a clear button. + * + * Messages are stored newest-first, so the top of the list is always the + * latest entry. A floating "Latest" button appears when the user scrolls + * down into older messages, and new entries auto-scroll to the top only + * while the user hasn't scrolled away. + */ +const Messages = () => { + const messages = useStore((s) => s.messages); + const clearMessages = useStore((s) => s.clearMessages); + + const [activeKinds, setActiveKinds] = useState>( + new Set(ALL_KINDS), + ); + const [scrolledAway, setScrolledAway] = useState(false); + + const scrollRef = useRef(null); + const prevLenRef = useRef(0); + + const toggleKind = (kind: MessageKind) => + setActiveKinds((prev) => { + const next = new Set(prev); + next.has(kind) ? next.delete(kind) : next.add(kind); + return next; + }); + + const filtered = messages.filter((m) => activeKinds.has(m.kind)); + + // Auto-scroll to top (latest message) when a new entry arrives, + // but only if the user hasn't scrolled down into history. + useEffect(() => { + if (filtered.length > prevLenRef.current && !scrolledAway) { + scrollRef.current?.scrollTo({ top: 0, behavior: "smooth" }); + } + prevLenRef.current = filtered.length; + }, [filtered.length, scrolledAway]); + + const handleScroll = (e: React.UIEvent) => { + setScrolledAway(e.currentTarget.scrollTop > 80); + }; + + const scrollToLatest = () => { + scrollRef.current?.scrollTo({ top: 0, behavior: "smooth" }); + }; + + return ( +
+ {/* Toolbar */} +
+ + Filter + + {ALL_KINDS.map((kind) => ( + + ))} + +
+ + {filtered.length} / {messages.length} + + + +
+
+ + {/* Message list */} +
+ {filtered.length === 0 ? ( +
+

No messages

+
+ ) : ( + filtered.map((msg) => ) + )} + + {/* Floating "scroll to latest" button */} + {scrolledAway && ( + + )} +
+
+ ); +}; + +export default Messages; diff --git a/frontend/competition-view/src/pages/Messages/components/MessageItem.tsx b/frontend/competition-view/src/pages/Messages/components/MessageItem.tsx new file mode 100644 index 000000000..8c2fd0666 --- /dev/null +++ b/frontend/competition-view/src/pages/Messages/components/MessageItem.tsx @@ -0,0 +1,47 @@ +import { Badge } from "@workspace/ui/components"; +import type { Message, MessageKind } from "../../../types/message"; + +const KIND_BADGE_CLASS: Record = { + info: "border-blue-300 bg-blue-50 text-blue-700 dark:border-blue-700 dark:bg-blue-900/20 dark:text-blue-400", + warning: "border-amber-300 bg-amber-50 text-amber-700 dark:border-amber-700 dark:bg-amber-900/20 dark:text-amber-400", + error: "border-red-300 bg-red-50 text-red-700 dark:border-red-700 dark:bg-red-900/20 dark:text-red-400", + debug: "border-border bg-muted text-muted-foreground", +}; + +const KIND_ROW_CLASS: Record = { + info: "", + warning: "bg-amber-50/40 dark:bg-amber-900/10", + error: "bg-red-50/40 dark:bg-red-900/10", + debug: "", +}; + +interface MessageItemProps { + message: Message; +} + +const MessageItem = ({ message }: MessageItemProps) => { + const time = new Date(message.timestamp).toLocaleTimeString([], { + hour: "2-digit", + minute: "2-digit", + second: "2-digit", + }); + + return ( +
+ + {time} + + + {message.kind} + + + {message.content} + +
+ ); +}; + +export default MessageItem; diff --git a/frontend/competition-view/src/pages/Orders.tsx b/frontend/competition-view/src/pages/Orders.tsx new file mode 100644 index 000000000..53b58300f --- /dev/null +++ b/frontend/competition-view/src/pages/Orders.tsx @@ -0,0 +1 @@ +export { default } from "./Orders/Orders"; diff --git a/frontend/competition-view/src/pages/Orders/Orders.tsx b/frontend/competition-view/src/pages/Orders/Orders.tsx new file mode 100644 index 000000000..56a8f6c09 --- /dev/null +++ b/frontend/competition-view/src/pages/Orders/Orders.tsx @@ -0,0 +1,70 @@ +import { InputGroup, InputGroupInput, Skeleton } from "@workspace/ui/components"; +import { useWebSocket } from "@workspace/ui/hooks"; +import { useState } from "react"; +import useOrdersCatalog from "../../hooks/useOrdersCatalog"; +import { useStore } from "../../store/store"; +import BoardSection from "./components/BoardSection"; + +/** + * Dynamic orders catalog page. + * + * Owns its own catalog fetch so loading state is scoped here. + * Layout: + * - Search input to filter across all boards and order labels/IDs + * - Skeleton while the catalog is loading + * - One collapsible BoardSection per board + * - Empty state if the catalog loaded but returned no boards + */ +const Orders = () => { + const { isConnected } = useWebSocket(); + const boards = useStore((s) => s.boards); + const commandsCatalog = useStore((s) => s.commandsCatalog); + const [filter, setFilter] = useState(""); + + // Fetch catalog here; refetches on every WS reconnect + const { loading } = useOrdersCatalog(isConnected); + + return ( +
+ {/* Search */} + + setFilter(e.target.value)} + /> + + + {/* Board sections */} + {loading ? ( + + ) : boards.length === 0 ? ( +
+

+ No orders available — check the backend connection. +

+
+ ) : ( +
+ {boards.map((boardName) => { + const board = commandsCatalog[boardName]; + if (!board) return null; + return ( + + ); + })} +
+ )} +
+ ); +}; + +const LoadingSkeleton = () => ( +
+ {Array.from({ length: 4 }).map((_, i) => ( + + ))} +
+); + +export default Orders; diff --git a/frontend/competition-view/src/pages/Orders/components/BoardSection.tsx b/frontend/competition-view/src/pages/Orders/components/BoardSection.tsx new file mode 100644 index 000000000..f556d4adb --- /dev/null +++ b/frontend/competition-view/src/pages/Orders/components/BoardSection.tsx @@ -0,0 +1,70 @@ +import { + Badge, + Collapsible, + CollapsibleContent, + CollapsibleTrigger, +} from "@workspace/ui/components"; +import { ChevronDown } from "@workspace/ui/icons"; +import { useState } from "react"; +import type { BoardOrdersData, CommandCatalogItem } from "../../../types/catalog"; +import OrderItem from "./OrderItem"; + +interface BoardSectionProps { + board: BoardOrdersData; + /** If provided, only orders whose label matches are rendered. */ + filter: string; + isConnected: boolean; +} + +const matchesFilter = (item: CommandCatalogItem, filter: string) => { + if (!filter) return true; + const q = filter.toLowerCase(); + return ( + item.name.toLowerCase().includes(q) || + String(item.id).includes(q) + ); +}; + +/** + * Collapsible section for a single board's orders. + * Starts collapsed; auto-expands when a search filter is active. + */ +const BoardSection = ({ board, filter, isConnected }: BoardSectionProps) => { + const [open, setOpen] = useState(false); + + const visibleOrders = board.orders.filter((o) => matchesFilter(o, filter)); + if (visibleOrders.length === 0) return null; + + // Auto-expand when the user is searching + const isOpen = open || filter.length > 0; + + return ( + + +
+ + {board.name} + + + {visibleOrders.length} + +
+ +
+ + +
+ {visibleOrders.map((order) => ( + + ))} +
+
+
+ ); +}; + +export default BoardSection; diff --git a/frontend/competition-view/src/pages/Orders/components/OrderItem.tsx b/frontend/competition-view/src/pages/Orders/components/OrderItem.tsx new file mode 100644 index 000000000..73ca1357f --- /dev/null +++ b/frontend/competition-view/src/pages/Orders/components/OrderItem.tsx @@ -0,0 +1,166 @@ +import { + Badge, + Button, + Collapsible, + CollapsibleContent, + CollapsibleTrigger, + Tooltip, + TooltipContent, + TooltipTrigger, +} from "@workspace/ui/components"; +import { Check, ChevronDown, Send } from "@workspace/ui/icons"; +import { useState } from "react"; +import useSendOrder from "../../../hooks/useSendOrder"; +import type { CommandCatalogItem, ParameterValues } from "../../../types/catalog"; +import type { OrderFieldValue } from "../../../constants/orders"; +import OrderParameters from "./OrderParameters"; + +interface OrderItemProps { + item: CommandCatalogItem; + isConnected: boolean; +} + +const getDefaultValues = (item: CommandCatalogItem): ParameterValues => { + const defaults: ParameterValues = {}; + for (const [key, param] of Object.entries(item.fields)) { + if (param.kind === "numeric") defaults[key] = ""; + else if (param.kind === "enum") defaults[key] = param.options[0] ?? ""; + else if (param.kind === "boolean") defaults[key] = false; + } + return defaults; +}; + +/** + * A single order row with an inline send button. + * Orders with parameters expand to show a compact form. + * + * - Send is disabled while the WS is disconnected or any required numeric field is empty/invalid. + * - After a successful dispatch the button briefly shows a checkmark. + */ +const OrderItem = ({ item, isConnected }: OrderItemProps) => { + const sendOrder = useSendOrder(); + + const [values, setValues] = useState(() => getDefaultValues(item)); + const [open, setOpen] = useState(false); + const [sent, setSent] = useState(false); + + const hasParams = Object.keys(item.fields).length > 0; + + const hasInvalidNumeric = Object.entries(item.fields).some( + ([key, param]) => + param.kind === "numeric" && + !Number.isFinite(parseFloat(String(values[key]))), + ); + + const canSend = isConnected && !hasInvalidNumeric && !sent; + + const handleSend = () => { + if (!canSend) return; + + const fields = Object.entries(item.fields).reduce>( + (acc, [key, param]) => { + acc[key] = { + value: param.kind === "numeric" ? parseFloat(String(values[key])) : values[key], + isEnabled: true, + type: param.type, + }; + return acc; + }, + {}, + ); + + sendOrder([{ id: item.id, fields }]); + + // Brief confirmation state + setSent(true); + setTimeout(() => setSent(false), 1500); + }; + + const handleParamChange = (key: string, value: string | number | boolean) => + setValues((prev) => ({ ...prev, [key]: value })); + + const sendButton = ( + + ); + + // Wrap with tooltip explaining why the button is disabled + const sendButtonWithTooltip = !isConnected ? ( + + + {sendButton} + + Not connected to backend + + ) : hasInvalidNumeric ? ( + + + {sendButton} + + Fill in all required fields first + + ) : ( + sendButton + ); + + if (!hasParams) { + return ( +
+
+ {item.name} + {item.id} +
+ {sendButtonWithTooltip} +
+ ); + } + + return ( + + +
+ {item.name} + {item.id} + + {Object.keys(item.fields).length} params + +
+
+ {sendButtonWithTooltip} + +
+
+ + +
+ +
+
+
+ ); +}; + +export default OrderItem; diff --git a/frontend/competition-view/src/pages/Orders/components/OrderParameters.tsx b/frontend/competition-view/src/pages/Orders/components/OrderParameters.tsx new file mode 100644 index 000000000..84e7d4ca5 --- /dev/null +++ b/frontend/competition-view/src/pages/Orders/components/OrderParameters.tsx @@ -0,0 +1,190 @@ +import { + Checkbox, + Input, + Label, + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "@workspace/ui/components"; +import type { + BooleanParameter, + CommandParameter, + EnumParameter, + NumericParameter, + ParameterValues, +} from "../../../types/catalog"; + +interface OrderParametersProps { + fields: Record; + values: ParameterValues; + onChange: (id: string, value: string | number | boolean) => void; +} + +/** + * Renders a form field for each command parameter. + * Numeric → Input with range hint, Enum → Select, Boolean → Checkbox. + * All input components come from @workspace/ui. + */ +const OrderParameters = ({ fields, values, onChange }: OrderParametersProps) => ( +
+ {Object.entries(fields).map(([key, param]) => ( + + ))} +
+); + +/* ─── Helpers ───────────────────────────────────────────────────────────── */ + +/** Returns false if `val` is outside the [min, max] range (null = unbounded). */ +const inRange = (val: number, range: (number | null)[]): boolean => { + const [min, max] = range; + if (min !== null && val < min) return false; + if (max !== null && val > max) return false; + return true; +}; + +const formatBound = (v: number | null, fallback: string) => + v === null ? fallback : String(v); + +/* ─── Per-type field renderers ─────────────────────────────────────────── */ + +interface FieldProps { + fieldKey: string; + param: CommandParameter; + value: ParameterValues[string]; + onChange: (id: string, value: string | number | boolean) => void; +} + +const ParameterField = ({ fieldKey, param, value, onChange }: FieldProps) => { + switch (param.kind) { + case "numeric": + return ; + case "enum": + return ; + case "boolean": + return ; + } +}; + +const NumericField = ({ + fieldKey, + param, + value, + onChange, +}: { + fieldKey: string; + param: NumericParameter; + value: string; + onChange: FieldProps["onChange"]; +}) => { + const n = parseFloat(value); + const hasValue = value !== "" && Number.isFinite(n); + const outOfSafe = hasValue && param.safeRange.length >= 2 && !inRange(n, param.safeRange); + const outOfWarning = hasValue && param.warningRange.length >= 2 && !inRange(n, param.warningRange); + + // Visual state: red > amber > default + const borderClass = outOfSafe + ? "border-red-500 focus-visible:ring-red-500" + : outOfWarning + ? "border-amber-500 focus-visible:ring-amber-500" + : ""; + + // Build hint text from safeRange when present + const hasRange = param.safeRange.length >= 2 && + (param.safeRange[0] !== null || param.safeRange[1] !== null); + const rangeHint = hasRange + ? `Range: ${formatBound(param.safeRange[0], "−∞")} – ${formatBound(param.safeRange[1], "+∞")}` + : null; + + return ( +
+ + onChange(fieldKey, e.target.value)} + className={`h-8 text-xs ${borderClass}`} + /> + {/* Range validation feedback */} + {outOfSafe && ( +

+ Value is outside the safe range ({formatBound(param.safeRange[0], "−∞")} – {formatBound(param.safeRange[1], "+∞")}) +

+ )} + {!outOfSafe && outOfWarning && ( +

+ Value is outside the recommended range ({formatBound(param.warningRange[0], "−∞")} – {formatBound(param.warningRange[1], "+∞")}) +

+ )} + {!outOfSafe && !outOfWarning && rangeHint && ( +

{rangeHint}

+ )} +
+ ); +}; + +const EnumField = ({ + fieldKey, + param, + value, + onChange, +}: { + fieldKey: string; + param: EnumParameter; + value: string; + onChange: FieldProps["onChange"]; +}) => ( +
+ + +
+); + +const BooleanField = ({ + fieldKey, + param, + value, + onChange, +}: { + fieldKey: string; + param: BooleanParameter; + value: boolean; + onChange: FieldProps["onChange"]; +}) => ( +
+ onChange(fieldKey, !!checked)} + /> + +
+); + +export default OrderParameters; diff --git a/frontend/competition-view/src/pages/Overview.tsx b/frontend/competition-view/src/pages/Overview.tsx new file mode 100644 index 000000000..bd1b4a1e1 --- /dev/null +++ b/frontend/competition-view/src/pages/Overview.tsx @@ -0,0 +1 @@ +export { default } from "./Overview/Overview"; diff --git a/frontend/competition-view/src/pages/Overview/Overview.tsx b/frontend/competition-view/src/pages/Overview/Overview.tsx new file mode 100644 index 000000000..bf986aa8c --- /dev/null +++ b/frontend/competition-view/src/pages/Overview/Overview.tsx @@ -0,0 +1,87 @@ +import { HVBMS, PCU, VCU } from "../../constants/measurements"; +import useMeasurement from "../../hooks/useMeasurement"; +import BrakeIndicator from "./components/BrakeIndicator"; +import MetricCard from "./components/MetricCard"; +import OrdersPanel from "./components/OrdersPanel"; +import RecentMessages from "./components/RecentMessages"; +import VehicleStateBanner from "./components/VehicleStateBanner"; + +/** + * Main competition dashboard. + * + * Layout: + * - Vehicle state banner (full width, colour-coded) + * - Row 1: Brake indicator + Speed + Position + SOC + * - Row 2: HV Voltage + HV Current + Pack Temp Max + Brake Pressure + * - Row 3: High Pressure + Capsule Pressure + Acceleration + * - Quick orders panel + * - Recent messages + */ +const Overview = () => { + const speed = useMeasurement(PCU.speed); + const position = useMeasurement(PCU.position); + const acceleration = useMeasurement(PCU.acceleration); + const soc = useMeasurement(HVBMS.minimumSoc); + const hvVoltage = useMeasurement(HVBMS.voltageReading); + const hvCurrent = useMeasurement(HVBMS.currentReading); + const tempMax = useMeasurement(HVBMS.tempMax); + const brakePsi = useMeasurement(VCU.pressureBrakes); + const highPsi = useMeasurement(VCU.highPressure); + const capsulePsi = useMeasurement(VCU.pressureCapsule); + + const fmt = (v: ReturnType, decimals = 1): string | undefined => { + if (v === undefined) return undefined; + if (typeof v === "number") return v.toFixed(decimals); + return String(v); + }; + + return ( +
+ {/* Vehicle state banner */} + + + {/* Row 1 — Brake indicator + kinematic metrics */} +
+
+ +
+ + + +
+ + {/* Row 2 — Electrical & thermal */} +
+ + + 55 ? "text-red-500" : ""} + /> + +
+ + {/* Row 3 — Pneumatics + acceleration */} +
+ + + +
+ + {/* Quick orders */} + + + {/* Recent messages */} + +
+ ); +}; + +export default Overview; diff --git a/frontend/competition-view/src/pages/Overview/components/BrakeIndicator.tsx b/frontend/competition-view/src/pages/Overview/components/BrakeIndicator.tsx new file mode 100644 index 000000000..5b37972b7 --- /dev/null +++ b/frontend/competition-view/src/pages/Overview/components/BrakeIndicator.tsx @@ -0,0 +1,38 @@ +import { VCU } from "../../../constants/measurements"; +import useMeasurement from "../../../hooks/useMeasurement"; + +type BrakeStatus = "braked" | "unbraked" | "unknown"; + +const STATUS_STYLES: Record = { + braked: { bg: "bg-red-500/15 border-red-500", text: "text-red-500", label: "BRAKED" }, + unbraked: { bg: "bg-blue-500/15 border-blue-500", text: "text-blue-500", label: "UNBRAKED" }, + unknown: { bg: "bg-muted border-border", text: "text-muted-foreground", label: "—" }, +}; + +/** + * Large visual indicator that mirrors the control-station BrakeState widget. + * Reads VCU/all_reeds — truthy means brakes are engaged. + */ +const BrakeIndicator = () => { + const raw = useMeasurement(VCU.allReeds); + + const status: BrakeStatus = + raw === undefined ? "unknown" : raw ? "braked" : "unbraked"; + + const { bg, text, label } = STATUS_STYLES[status]; + + return ( +
+ + Brake State + + + {label} + +
+ ); +}; + +export default BrakeIndicator; diff --git a/frontend/competition-view/src/pages/Overview/components/MetricCard.tsx b/frontend/competition-view/src/pages/Overview/components/MetricCard.tsx new file mode 100644 index 000000000..c106835f8 --- /dev/null +++ b/frontend/competition-view/src/pages/Overview/components/MetricCard.tsx @@ -0,0 +1,49 @@ +import { + Card, + CardContent, + CardHeader, + CardTitle, +} from "@workspace/ui/components"; + +interface MetricCardProps { + label: string; + value: string | number | undefined; + unit?: string; + /** Extra Tailwind classes applied to the value text. */ + valueClassName?: string; +} + +/** + * Displays a single numeric or enum telemetry measurement. + * Shows an em-dash when no data has arrived yet. + */ +const MetricCard = ({ + label, + value, + unit, + valueClassName = "", +}: MetricCardProps) => { + const display = value !== undefined ? String(value) : "—"; + + return ( + + + + {label} + + + +

+ {display} + {value !== undefined && unit && ( + + {unit} + + )} +

+
+
+ ); +}; + +export default MetricCard; diff --git a/frontend/competition-view/src/pages/Overview/components/OrdersPanel.tsx b/frontend/competition-view/src/pages/Overview/components/OrdersPanel.tsx new file mode 100644 index 000000000..27ced1db1 --- /dev/null +++ b/frontend/competition-view/src/pages/Overview/components/OrdersPanel.tsx @@ -0,0 +1,84 @@ +import { Button, Separator } from "@workspace/ui/components"; +import { useState } from "react"; +import { + BRAKE_ORDERS, + EMERGENCY_STOP_ORDERS, + OPEN_CONTACTORS_ORDERS, +} from "../../../constants/orders"; +import useSendOrder from "../../../hooks/useSendOrder"; + +/** + * Panel of hardcoded competition orders. + * + * The Emergency Stop button requires two consecutive clicks within 2 seconds + * to prevent accidental activation. All other buttons fire on single click. + */ +const OrdersPanel = () => { + const sendOrder = useSendOrder(); + + return ( +
+
+ + Quick Orders + +
+ + +
+ + + + + sendOrder(EMERGENCY_STOP_ORDERS)} /> +
+
+ ); +}; + +/** + * Emergency Stop requires two clicks within 2 s to prevent accidents. + * After the first click the button enters an "armed" state. + */ +const EmergencyStopButton = ({ onConfirm }: { onConfirm: () => void }) => { + const [armed, setArmed] = useState(false); + + const handleClick = () => { + if (armed) { + onConfirm(); + setArmed(false); + return; + } + setArmed(true); + setTimeout(() => setArmed(false), 2000); + }; + + return ( + + ); +}; + +export default OrdersPanel; diff --git a/frontend/competition-view/src/pages/Overview/components/RecentMessages.tsx b/frontend/competition-view/src/pages/Overview/components/RecentMessages.tsx new file mode 100644 index 000000000..f70e95ff1 --- /dev/null +++ b/frontend/competition-view/src/pages/Overview/components/RecentMessages.tsx @@ -0,0 +1,71 @@ +import { Badge, Separator } from "@workspace/ui/components"; +import { useStore } from "../../../store/store"; +import type { Message, MessageKind } from "../../../types/message"; + +const KIND_BADGE_CLASS: Record = { + info: "border-blue-300 text-blue-700 dark:border-blue-700 dark:text-blue-400", + warning: "border-amber-300 text-amber-700 dark:border-amber-700 dark:text-amber-400", + error: "border-red-300 text-red-700 dark:border-red-700 dark:text-red-400", + debug: "text-muted-foreground", +}; + +const MAX_VISIBLE = 6; + +interface MessageRowProps { + message: Message; +} + +const MessageRow = ({ message }: MessageRowProps) => { + const time = new Date(message.timestamp).toLocaleTimeString([], { + hour: "2-digit", + minute: "2-digit", + second: "2-digit", + }); + + return ( +
+ + {time} + + + {message.kind} + + {message.content} +
+ ); +}; + +/** + * Shows the most recent system messages in a compact panel. + * Full message history is available on the Messages page. + */ +const RecentMessages = () => { + const messages = useStore((s) => s.messages); + const recent = messages.slice(0, MAX_VISIBLE); + + return ( +
+
+ + Recent Messages + + {messages.length} total +
+ +
+ {recent.length === 0 ? ( +

+ No messages yet +

+ ) : ( + recent.map((msg) => ) + )} +
+
+ ); +}; + +export default RecentMessages; diff --git a/frontend/competition-view/src/pages/Overview/components/VehicleStateBanner.tsx b/frontend/competition-view/src/pages/Overview/components/VehicleStateBanner.tsx new file mode 100644 index 000000000..2eb42ace9 --- /dev/null +++ b/frontend/competition-view/src/pages/Overview/components/VehicleStateBanner.tsx @@ -0,0 +1,89 @@ +import { Badge } from "@workspace/ui/components"; +import { VCU } from "../../../constants/measurements"; +import useMeasurement from "../../../hooks/useMeasurement"; + +type StateCategory = "emergency" | "running" | "braking" | "idle" | "unknown"; + +const STATE_STYLES: Record< + StateCategory, + { banner: string; valueText: string; badgeClass: string } +> = { + emergency: { + banner: "border-red-500/50 bg-red-500/5", + valueText: "text-red-500 dark:text-red-400", + badgeClass:"border-red-400 text-red-600 dark:text-red-400", + }, + running: { + banner: "border-green-500/40 bg-green-500/5", + valueText: "text-green-600 dark:text-green-400", + badgeClass:"border-green-400 text-green-700 dark:text-green-400", + }, + braking: { + banner: "border-amber-500/40 bg-amber-500/5", + valueText: "text-amber-600 dark:text-amber-400", + badgeClass:"border-amber-400 text-amber-700 dark:text-amber-400", + }, + idle: { + banner: "bg-card border", + valueText: "text-muted-foreground", + badgeClass:"", + }, + unknown: { + banner: "bg-card border", + valueText: "text-foreground", + badgeClass:"", + }, +}; + +const categorise = (state: string | number | boolean | undefined): StateCategory => { + if (state === undefined) return "unknown"; + const s = String(state).toUpperCase(); + if (s.includes("EMERGENCY") || s.includes("FAULT") || s.includes("ERROR")) return "emergency"; + if (s.includes("RUN") || s.includes("NOMINAL") || s.includes("ACCELERAT")) return "running"; + if (s.includes("BRAKE") || s.includes("DECELER") || s.includes("WARN")) return "braking"; + if (s.includes("IDLE") || s.includes("READY") || s.includes("STANDBY")) return "idle"; + return "unknown"; +}; + +/** + * Full-width banner showing the vehicle's general and operational states. + * Background and text colour change based on the detected state category: + * - Emergency / Fault / Error → red + * - Running / Nominal → green + * - Braking / Decelerating → amber + * - Idle / Ready / Standby → muted + */ +const VehicleStateBanner = () => { + const generalState = useMeasurement(VCU.generalState); + const operationalState = useMeasurement(VCU.operationalState); + + const category = categorise(generalState); + const { banner, valueText, badgeClass } = STATE_STYLES[category]; + + return ( +
+
+ + Vehicle State + + + {generalState !== undefined ? String(generalState) : "—"} + +
+ +
+ + Operational State + + + {operationalState !== undefined ? String(operationalState) : "—"} + +
+
+ ); +}; + +export default VehicleStateBanner; diff --git a/frontend/competition-view/src/store/slices/appSlice.ts b/frontend/competition-view/src/store/slices/appSlice.ts new file mode 100644 index 000000000..64f51b745 --- /dev/null +++ b/frontend/competition-view/src/store/slices/appSlice.ts @@ -0,0 +1,14 @@ +import type { StateCreator } from "zustand"; +import type { Store } from "../store"; + +export interface AppSlice { + isDarkMode: boolean; + toggleDarkMode: () => void; + setIsDarkMode: (isDarkMode: boolean) => void; +} + +export const createAppSlice: StateCreator = (set) => ({ + isDarkMode: true, + toggleDarkMode: () => set((s) => ({ isDarkMode: !s.isDarkMode })), + setIsDarkMode: (isDarkMode) => set({ isDarkMode }), +}); diff --git a/frontend/competition-view/src/store/slices/catalogSlice.ts b/frontend/competition-view/src/store/slices/catalogSlice.ts new file mode 100644 index 000000000..f200e9b6d --- /dev/null +++ b/frontend/competition-view/src/store/slices/catalogSlice.ts @@ -0,0 +1,22 @@ +import type { StateCreator } from "zustand"; +import type { BoardOrdersData } from "../../types/catalog"; +import type { Store } from "../store"; + +export interface CatalogSlice { + /** Commands grouped by board name, populated on connection. */ + commandsCatalog: Record; + setCommandsCatalog: (catalog: Record) => void; + + /** Sorted list of board names that have at least one command. */ + boards: string[]; + setBoards: (boards: string[]) => void; +} + +export const createCatalogSlice: StateCreator = ( + set, +) => ({ + commandsCatalog: {}, + setCommandsCatalog: (commandsCatalog) => set({ commandsCatalog }), + boards: [], + setBoards: (boards) => set({ boards }), +}); diff --git a/frontend/competition-view/src/store/slices/connectionsSlice.ts b/frontend/competition-view/src/store/slices/connectionsSlice.ts new file mode 100644 index 000000000..f49cca3a9 --- /dev/null +++ b/frontend/competition-view/src/store/slices/connectionsSlice.ts @@ -0,0 +1,22 @@ +import type { StateCreator } from "zustand"; +import type { Connection } from "../../types/connection"; +import type { Store } from "../store"; + +export interface ConnectionsSlice { + connections: Record; + updateConnections: (incoming: Record) => void; +} + +export const createConnectionsSlice: StateCreator< + Store, + [], + [], + ConnectionsSlice +> = (set) => ({ + connections: {}, + + updateConnections: (incoming) => + set((state) => ({ + connections: { ...state.connections, ...incoming }, + })), +}); diff --git a/frontend/competition-view/src/store/slices/messagesSlice.ts b/frontend/competition-view/src/store/slices/messagesSlice.ts new file mode 100644 index 000000000..bc5e02e32 --- /dev/null +++ b/frontend/competition-view/src/store/slices/messagesSlice.ts @@ -0,0 +1,27 @@ +import type { StateCreator } from "zustand"; +import type { Message } from "../../types/message"; +import type { Store } from "../store"; + +const MAX_MESSAGES = 500; + +export interface MessagesSlice { + messages: Message[]; + addMessage: (message: Message) => void; + clearMessages: () => void; +} + +export const createMessagesSlice: StateCreator< + Store, + [], + [], + MessagesSlice +> = (set) => ({ + messages: [], + + addMessage: (message) => + set((state) => ({ + messages: [message, ...state.messages].slice(0, MAX_MESSAGES), + })), + + clearMessages: () => set({ messages: [] }), +}); diff --git a/frontend/competition-view/src/store/slices/telemetrySlice.ts b/frontend/competition-view/src/store/slices/telemetrySlice.ts new file mode 100644 index 000000000..9e2578134 --- /dev/null +++ b/frontend/competition-view/src/store/slices/telemetrySlice.ts @@ -0,0 +1,34 @@ +import type { StateCreator } from "zustand"; +import type { TelemetryData, TelemetryState } from "../../types/telemetry"; +import type { Store } from "../store"; + +export interface TelemetrySlice { + telemetry: TelemetryState; + updateTelemetry: (packet: TelemetryData) => void; + getMeasurement: (id: string) => number | boolean | string | undefined; +} + +export const createTelemetrySlice: StateCreator< + Store, + [], + [], + TelemetrySlice +> = (set, get) => ({ + telemetry: {}, + + updateTelemetry: (packet) => { + const flat: TelemetryState = {}; + + for (const [key, value] of Object.entries(packet.measurementUpdates)) { + if (typeof value === "object" && value !== null && "last" in value) { + flat[key] = value.last; + } else { + flat[key] = value as number | boolean | string; + } + } + + set((state) => ({ telemetry: { ...state.telemetry, ...flat } })); + }, + + getMeasurement: (id) => get().telemetry[id], +}); diff --git a/frontend/competition-view/src/store/store.ts b/frontend/competition-view/src/store/store.ts new file mode 100644 index 000000000..3486ac8c1 --- /dev/null +++ b/frontend/competition-view/src/store/store.ts @@ -0,0 +1,42 @@ +import { create } from "zustand"; +import { persist } from "zustand/middleware"; +import { createAppSlice, type AppSlice } from "./slices/appSlice"; +import { createCatalogSlice, type CatalogSlice } from "./slices/catalogSlice"; +import { + createConnectionsSlice, + type ConnectionsSlice, +} from "./slices/connectionsSlice"; +import { + createMessagesSlice, + type MessagesSlice, +} from "./slices/messagesSlice"; +import { + createTelemetrySlice, + type TelemetrySlice, +} from "./slices/telemetrySlice"; + +export type Store = AppSlice & + CatalogSlice & + ConnectionsSlice & + MessagesSlice & + TelemetrySlice; + +export const useStore = create()( + persist( + (...a) => ({ + ...createAppSlice(...a), + ...createCatalogSlice(...a), + ...createConnectionsSlice(...a), + ...createMessagesSlice(...a), + ...createTelemetrySlice(...a), + }), + { + name: "competition-view-storage", + version: 1, + // Only persist lightweight user-preference data, never live telemetry. + partialize: (state) => ({ + isDarkMode: state.isDarkMode, + }), + }, + ), +); diff --git a/frontend/competition-view/src/types/catalog.ts b/frontend/competition-view/src/types/catalog.ts new file mode 100644 index 000000000..188966599 --- /dev/null +++ b/frontend/competition-view/src/types/catalog.ts @@ -0,0 +1,48 @@ +/** + * Type definitions for the orders/commands catalog fetched from the backend + * endpoint `GET /backend/orderStructures`. + */ + +export type CommandParameterKind = "numeric" | "enum" | "boolean"; + +interface BaseParameter { + kind: CommandParameterKind; + id: string; + name: string; + type: string; +} + +export interface NumericParameter extends BaseParameter { + kind: "numeric"; + safeRange: (number | null)[]; + warningRange: (number | null)[]; +} + +export interface EnumParameter extends BaseParameter { + kind: "enum"; + options: string[]; +} + +export interface BooleanParameter extends BaseParameter { + kind: "boolean"; +} + +export type CommandParameter = NumericParameter | EnumParameter | BooleanParameter; + +export interface CommandCatalogItem { + id: number; + name: string; + fields: Record; +} + +export interface BoardOrdersData { + name: string; + orders: CommandCatalogItem[]; +} + +export interface OrdersData { + boards: BoardOrdersData[]; +} + +/** Values held by the parameter form for a single command. */ +export type ParameterValues = Record; diff --git a/frontend/competition-view/src/types/connection.ts b/frontend/competition-view/src/types/connection.ts new file mode 100644 index 000000000..0259f91dc --- /dev/null +++ b/frontend/competition-view/src/types/connection.ts @@ -0,0 +1,4 @@ +export interface Connection { + name: string; + isConnected: boolean; +} diff --git a/frontend/competition-view/src/types/message.ts b/frontend/competition-view/src/types/message.ts new file mode 100644 index 000000000..84e9abbb9 --- /dev/null +++ b/frontend/competition-view/src/types/message.ts @@ -0,0 +1,15 @@ +export type MessageKind = "info" | "warning" | "error" | "debug"; + +export interface Message { + id: string; + content: string; + kind: MessageKind; + timestamp: number; +} + +/** Raw packet shape sent by the backend over the WebSocket. */ +export interface MessagePacket { + content: string; + kind: MessageKind; + timestamp: number; +} diff --git a/frontend/competition-view/src/types/telemetry.ts b/frontend/competition-view/src/types/telemetry.ts new file mode 100644 index 000000000..9cbf175d0 --- /dev/null +++ b/frontend/competition-view/src/types/telemetry.ts @@ -0,0 +1,25 @@ +/** Single variable value as received from the backend. */ +export type VariableValue = + | { last: number; average: number } + | boolean + | string + | number; + +/** Map of variable names to their current values inside a packet. */ +export type Variables = Record; + +/** High-frequency telemetry packet from the backend. */ +export interface TelemetryData { + id: number; + count: number; + cycleTime: number; + hexValue: string; + measurementUpdates: Variables; +} + +/** + * Flat map from measurement ID (string) to the latest numeric value. + * The store keeps only the most recent value per measurement to avoid + * unbounded memory growth. + */ +export type TelemetryState = Record; diff --git a/frontend/competition-view/src/vite-env.d.ts b/frontend/competition-view/src/vite-env.d.ts new file mode 100644 index 000000000..11f02fe2a --- /dev/null +++ b/frontend/competition-view/src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/frontend/competition-view/tsconfig.app.json b/frontend/competition-view/tsconfig.app.json new file mode 100644 index 000000000..87fbd9630 --- /dev/null +++ b/frontend/competition-view/tsconfig.app.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", + "target": "ES2020", + "useDefineForClassFields": true, + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "module": "ESNext", + "skipLibCheck": true, + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "moduleDetection": "force", + "noEmit": true, + "jsx": "react-jsx", + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "erasableSyntaxOnly": true, + "noFallthroughCasesInSwitch": true, + "noUncheckedSideEffectImports": true + }, + "include": ["src"] +} diff --git a/frontend/competition-view/tsconfig.json b/frontend/competition-view/tsconfig.json new file mode 100644 index 000000000..a351dd46e --- /dev/null +++ b/frontend/competition-view/tsconfig.json @@ -0,0 +1,15 @@ +{ + "files": [], + "references": [ + { "path": "./tsconfig.app.json" }, + { "path": "./tsconfig.node.json" } + ], + "compilerOptions": { + "baseUrl": ".", + "paths": { + "@/*": ["./*"], + "@workspace/ui/*": ["../frontend-kit/ui/src/*"] + } + }, + "exclude": ["node_modules"] +} diff --git a/frontend/competition-view/tsconfig.node.json b/frontend/competition-view/tsconfig.node.json new file mode 100644 index 000000000..22eb7aeef --- /dev/null +++ b/frontend/competition-view/tsconfig.node.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", + "target": "ES2022", + "lib": ["ES2023"], + "module": "ESNext", + "skipLibCheck": true, + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "moduleDetection": "force", + "noEmit": true, + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "erasableSyntaxOnly": true, + "noFallthroughCasesInSwitch": true, + "noUncheckedSideEffectImports": true + }, + "include": ["vite.config.ts"] +} diff --git a/frontend/competition-view/vite.config.ts b/frontend/competition-view/vite.config.ts new file mode 100644 index 000000000..48d484ecb --- /dev/null +++ b/frontend/competition-view/vite.config.ts @@ -0,0 +1,12 @@ +import tailwindcss from "@tailwindcss/vite"; +import react from "@vitejs/plugin-react-swc"; +import { defineConfig } from "vite"; + +export default defineConfig({ + plugins: [react(), tailwindcss()], + base: "./", + server: { + port: 9001, + host: true, + }, +}); diff --git a/frontend/flashing-view/.gitignore b/frontend/flashing-view/.gitignore new file mode 100644 index 000000000..ec5eaddea --- /dev/null +++ b/frontend/flashing-view/.gitignore @@ -0,0 +1,2 @@ +./dist + diff --git a/frontend/flashing-view/eslint.config.js b/frontend/flashing-view/eslint.config.js new file mode 100644 index 000000000..df360b435 --- /dev/null +++ b/frontend/flashing-view/eslint.config.js @@ -0,0 +1,3 @@ +import { config } from "@workspace/eslint-config/vite"; + +export default config; diff --git a/frontend/flashing-view/index.html b/frontend/flashing-view/index.html new file mode 100644 index 000000000..6a2a0e3a2 --- /dev/null +++ b/frontend/flashing-view/index.html @@ -0,0 +1,13 @@ + + + + + + + Hyperloop Flashing View + + +
+ + + diff --git a/frontend/flashing-view/package.json b/frontend/flashing-view/package.json new file mode 100644 index 000000000..725224d9f --- /dev/null +++ b/frontend/flashing-view/package.json @@ -0,0 +1,31 @@ +{ + "name": "flashing-view", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "preinstall": "npx only-allow pnpm", + "dev": "vite", + "build": "tsc -b && vite build", + "lint": "eslint .", + "preview": "vite preview" + }, + "dependencies": { + "@tailwindcss/vite": "^4.1.18", + "@vitejs/plugin-react-swc": "^4.2.3", + "@workspace/ui": "workspace:*", + "lucide-react": "^0.563.0", + "react": "^19.2.4", + "react-dom": "^19.2.4", + "tailwindcss": "^4.1.18" + }, + "devDependencies": { + "@types/react": "19.2.11", + "@types/react-dom": "19.2.3", + "@workspace/eslint-config": "workspace:^", + "@workspace/typescript-config": "workspace:*", + "eslint": "^9.39.2", + "typescript": "^5.9.3", + "vite": "^7.3.1" + } +} diff --git a/frontend/flashing-view/src/App.tsx b/frontend/flashing-view/src/App.tsx new file mode 100644 index 000000000..cc7a99b3b --- /dev/null +++ b/frontend/flashing-view/src/App.tsx @@ -0,0 +1,24 @@ +import { useCallback, useEffect, useState } from "react"; +import { FlashStationView } from "./features/flash-station/flash-station-view"; + +export default function App() { + const [isDark, setIsDark] = useState(() => { + const saved = localStorage.getItem("flashing-view-dark-mode"); + return saved !== null + ? saved === "true" + : window.matchMedia("(prefers-color-scheme: dark)").matches; + }); + + useEffect(() => { + document.documentElement.classList.toggle("dark", isDark); + localStorage.setItem("flashing-view-dark-mode", String(isDark)); + }, [isDark]); + + const toggleTheme = useCallback(() => setIsDark((d) => !d), []); + + return ( +
+ +
+ ); +} diff --git a/frontend/flashing-view/src/assets/logo.svg b/frontend/flashing-view/src/assets/logo.svg new file mode 100644 index 000000000..5ccba4eeb --- /dev/null +++ b/frontend/flashing-view/src/assets/logo.svg @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/frontend/flashing-view/src/features/flash-station/components/board-card.tsx b/frontend/flashing-view/src/features/flash-station/components/board-card.tsx new file mode 100644 index 000000000..5da96b47c --- /dev/null +++ b/frontend/flashing-view/src/features/flash-station/components/board-card.tsx @@ -0,0 +1,50 @@ +import { Badge } from "@workspace/ui/components"; +import { cn } from "@workspace/ui/lib/utils"; +import type { Board } from "../types"; + +type Props = { + board: Board; + selected: boolean; + onSelect: () => void; +}; + +export function BoardCard({ board, selected, onSelect }: Props) { + return ( + + ); +} diff --git a/frontend/flashing-view/src/features/flash-station/components/section-card.tsx b/frontend/flashing-view/src/features/flash-station/components/section-card.tsx new file mode 100644 index 000000000..91d81701f --- /dev/null +++ b/frontend/flashing-view/src/features/flash-station/components/section-card.tsx @@ -0,0 +1,22 @@ +import { Card, CardContent, CardHeader, CardTitle } from "@workspace/ui/components"; +import type { ReactNode } from "react"; + +type Props = { + title: string; + children: ReactNode; + action?: ReactNode; +}; + +export function SectionCard({ title, children, action }: Props) { + return ( + + +
+ {title} + {action} +
+
+ {children} +
+ ); +} diff --git a/frontend/flashing-view/src/features/flash-station/flash-station-view.tsx b/frontend/flashing-view/src/features/flash-station/flash-station-view.tsx new file mode 100644 index 000000000..7e429e595 --- /dev/null +++ b/frontend/flashing-view/src/features/flash-station/flash-station-view.tsx @@ -0,0 +1,272 @@ +import { Badge, Button, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@workspace/ui/components"; +import { FileCode2, Loader2, SunMoon, Upload } from "@workspace/ui/icons"; +import { cn } from "@workspace/ui/lib/utils"; +import { useEffect, useRef, useState } from "react"; +import logo from "../../assets/logo.svg"; +import { BoardCard } from "./components/board-card"; +import { SectionCard } from "./components/section-card"; +import type { Board, BoardsResponse, GeneralState, OperationalState } from "./types"; + +const BLCU_URL = import.meta.env.VITE_BLCU_URL ?? "http://localhost:8069/api"; +const POLL_INTERVAL_MS = 10000; +const MAX_LOG_LINES = 20; + +const STATE_STYLES: Record = { + Connecting: "border-yellow-500/40 bg-yellow-500/15 text-yellow-600 dark:text-yellow-400", + Operational: "border-green-500/40 bg-green-500/15 text-green-600 dark:text-green-400", + Fault: "border-red-500/40 bg-red-500/15 text-red-600 dark:text-red-400", +}; + +const OPERATIONAL_STYLES: Record = { + Idle: "border-muted-foreground/30 bg-muted/50 text-muted-foreground", + Flashing: "border-blue-500/40 bg-blue-500/15 text-blue-600 dark:text-blue-400", +}; + +type LogEntry = { message: string; isError: boolean }; + +interface FlashStationViewProps { + isDark: boolean; + onToggleTheme: () => void; +} + +export function FlashStationView({ isDark, onToggleTheme }: FlashStationViewProps) { + const [boards, setBoards] = useState([]); + const [generalState, setGeneralState] = useState("Connecting"); + const [operationalState, setOperationalState] = useState("Idle"); + const [selectedBoard, setSelectedBoard] = useState(null); + const [filePath, setFilePath] = useState(null); + const [fileName, setFileName] = useState(""); + const [file, setFile] = useState(null); + const [log, setLog] = useState([]); + const [isFlashing, setIsFlashing] = useState(false); + const fileInputRef = useRef(null); + const logEndRef = useRef(null); + + useEffect(() => { + async function poll() { + try { + const res = await fetch(`${BLCU_URL}/status`); + if (!res.ok) throw new Error(`HTTP ${res.status}`); + const data: BoardsResponse = await res.json(); + + const parsed: Board[] = Object.entries(data.boards).map(([name, accessible]) => ({ + name, + accessible, + })); + + setBoards(parsed); + setGeneralState(data.general_state_machine); + setOperationalState(data.operational_state_machine as OperationalState); + setSelectedBoard((prev) => + parsed.some((b) => b.name === prev) ? prev : null, + ); + } catch { + setBoards([]); + setGeneralState("Connecting"); + setOperationalState("Idle"); + } + } + + poll(); + const id = setInterval(poll, POLL_INTERVAL_MS); + return () => clearInterval(id); + }, []); + + useEffect(() => { + logEndRef.current?.scrollIntoView({ behavior: "smooth" }); + }, [log]); + + function appendLog(message: string, isError = false) { + const timestamp = new Date().toLocaleTimeString("es-ES"); + setLog((prev) => + [...prev, { message: `[${timestamp}] ${message}`, isError }].slice(-MAX_LOG_LINES), + ); + } + + async function selectFile() { + if (window.electronAPI) { + const path = await window.electronAPI.blcuSelectFile?.(); + if (!path) return; + const name = path.split(/[/\\]/).pop() ?? path; + setFilePath(path); + setFileName(name); + const buffer = await window.electronAPI.blcuReadFile?.(path); + if (!buffer) return; + setFile(new File([buffer], name, { type: "application/octet-stream" })); + } else { + fileInputRef.current?.click(); + } + } + + function onFileInputChange(e: React.ChangeEvent) { + const picked = e.target.files?.[0]; + if (!picked) return; + setFileName(picked.name); + setFilePath(picked.name); + setFile(picked); + } + + async function flash() { + if (!filePath || !selectedBoard || !file) return; + const board = boards.find((b) => b.name === selectedBoard); + if (!board) return; + + setIsFlashing(true); + appendLog(`Flash started → ${board.name}`); + + const form = new FormData(); + form.append("file", file); + form.append("board", board.name); + + try { + const res = await fetch(`${BLCU_URL}/flash`, { + method: "POST", + body: form, + }); + + if (!res.ok) throw new Error(await res.text()); + appendLog(`Flash successful → ${board.name}`); + } catch (err) { + appendLog( + `Flash failed → ${err instanceof Error ? err.message : "Unknown error"}`, + true, + ); + } finally { + setIsFlashing(false); + } + } + + const canFlash = !!file && !!selectedBoard && !isFlashing && operationalState !== "Flashing"; + + return ( +
+
+
+ Hyperloop UPV +
+

+ Flash Station +

+

+ Choose a firmware file, select a board, and flash. +

+
+
+ + + {generalState} + + +
+ + + {operationalState} + + + + + + + + {isDark ? "Switch to light mode" : "Switch to dark mode"} + + +
+ +
+
+ + +

Accepted formats: .bin, .hex, .elf

+ +
+
+ Selected file +
+
+ {fileName || "No file selected"} +
+
+
+ + + + +
+ +
+ + {boards.length} boards + + } + > + {boards.length === 0 ? ( +

+ No boards found. Waiting for backend… +

+ ) : ( +
+ {boards.map((board) => ( + setSelectedBoard(board.name)} + /> + ))} +
+ )} +
+ + +
+ {log.length === 0 ? ( + No log entries yet. + ) : ( + log.map((entry, i) => ( +
+ {entry.message} +
+ )) + )} +
+
+ +
+
+
+ ); +} diff --git a/frontend/flashing-view/src/features/flash-station/types.ts b/frontend/flashing-view/src/features/flash-station/types.ts new file mode 100644 index 000000000..383452353 --- /dev/null +++ b/frontend/flashing-view/src/features/flash-station/types.ts @@ -0,0 +1,13 @@ +export type Board = { + name: string; + accessible: boolean; +}; + +export type GeneralState = "Connecting" | "Operational" | "Fault"; +export type OperationalState = "Idle" | "Flashing"; + +export type BoardsResponse = { + boards: Record; + general_state_machine: GeneralState; + operational_state_machine: string; +}; diff --git a/frontend/flashing-view/src/index.css b/frontend/flashing-view/src/index.css new file mode 100644 index 000000000..6824f52fb --- /dev/null +++ b/frontend/flashing-view/src/index.css @@ -0,0 +1 @@ +@import "@workspace/ui/globals.css"; diff --git a/frontend/flashing-view/src/main.tsx b/frontend/flashing-view/src/main.tsx new file mode 100644 index 000000000..ef474bf64 --- /dev/null +++ b/frontend/flashing-view/src/main.tsx @@ -0,0 +1,10 @@ +import { StrictMode } from "react"; +import { createRoot } from "react-dom/client"; +import App from "./App.tsx"; +import "./index.css"; + +createRoot(document.getElementById("root")!).render( + + + , +); diff --git a/frontend/flashing-view/src/vite-env.d.ts b/frontend/flashing-view/src/vite-env.d.ts new file mode 100644 index 000000000..38abb7c87 --- /dev/null +++ b/frontend/flashing-view/src/vite-env.d.ts @@ -0,0 +1,14 @@ +/// + +interface ElectronAPI { + blcuSelectFile?: () => Promise; + blcuReadFile?: (path: string) => Promise>; +} + +declare global { + interface Window { + electronAPI?: ElectronAPI; + } +} + +export {}; diff --git a/frontend/flashing-view/tsconfig.app.json b/frontend/flashing-view/tsconfig.app.json new file mode 100644 index 000000000..87fbd9630 --- /dev/null +++ b/frontend/flashing-view/tsconfig.app.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", + "target": "ES2020", + "useDefineForClassFields": true, + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "module": "ESNext", + "skipLibCheck": true, + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "moduleDetection": "force", + "noEmit": true, + "jsx": "react-jsx", + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "erasableSyntaxOnly": true, + "noFallthroughCasesInSwitch": true, + "noUncheckedSideEffectImports": true + }, + "include": ["src"] +} diff --git a/frontend/flashing-view/tsconfig.json b/frontend/flashing-view/tsconfig.json new file mode 100644 index 000000000..fc0aa4474 --- /dev/null +++ b/frontend/flashing-view/tsconfig.json @@ -0,0 +1,14 @@ +{ + "files": [], + "references": [ + { "path": "./tsconfig.app.json" }, + { "path": "./tsconfig.node.json" } + ], + "compilerOptions": { + "baseUrl": ".", + "paths": { + "@workspace/ui/*": ["../frontend-kit/ui/src/*"] + } + }, + "exclude": ["node_modules"] +} diff --git a/frontend/flashing-view/tsconfig.node.json b/frontend/flashing-view/tsconfig.node.json new file mode 100644 index 000000000..22eb7aeef --- /dev/null +++ b/frontend/flashing-view/tsconfig.node.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", + "target": "ES2022", + "lib": ["ES2023"], + "module": "ESNext", + "skipLibCheck": true, + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "moduleDetection": "force", + "noEmit": true, + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "erasableSyntaxOnly": true, + "noFallthroughCasesInSwitch": true, + "noUncheckedSideEffectImports": true + }, + "include": ["vite.config.ts"] +} diff --git a/frontend/flashing-view/vite.config.ts b/frontend/flashing-view/vite.config.ts new file mode 100644 index 000000000..48d484ecb --- /dev/null +++ b/frontend/flashing-view/vite.config.ts @@ -0,0 +1,12 @@ +import tailwindcss from "@tailwindcss/vite"; +import react from "@vitejs/plugin-react-swc"; +import { defineConfig } from "vite"; + +export default defineConfig({ + plugins: [react(), tailwindcss()], + base: "./", + server: { + port: 9001, + host: true, + }, +}); diff --git a/frontend/frontend-kit/ui/src/components/shadcn/index.ts b/frontend/frontend-kit/ui/src/components/shadcn/index.ts index d2e4f43b5..4e0fbe1e2 100644 --- a/frontend/frontend-kit/ui/src/components/shadcn/index.ts +++ b/frontend/frontend-kit/ui/src/components/shadcn/index.ts @@ -19,5 +19,6 @@ export * from "./sidebar"; export * from "./skeleton"; export * from "./spinner"; export * from "./tabs"; +export * from "./table"; export * from "./textarea"; export * from "./tooltip"; diff --git a/frontend/frontend-kit/ui/src/components/shadcn/table.tsx b/frontend/frontend-kit/ui/src/components/shadcn/table.tsx new file mode 100644 index 000000000..e73bb2e8e --- /dev/null +++ b/frontend/frontend-kit/ui/src/components/shadcn/table.tsx @@ -0,0 +1,111 @@ +import * as React from "react" + +import { cn } from "@workspace/ui/lib/utils" + +function Table({ className, ...props }: React.ComponentProps<"table">) { + return ( +
+ + + ) +} + +function TableHeader({ className, ...props }: React.ComponentProps<"thead">) { + return ( + + ) +} + +function TableBody({ className, ...props }: React.ComponentProps<"tbody">) { + return ( + + ) +} + +function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">) { + return ( + tr]:last:border-b-0", + className + )} + {...props} + /> + ) +} + +function TableRow({ className, ...props }: React.ComponentProps<"tr">) { + return ( + + ) +} + +function TableHead({ className, ...props }: React.ComponentProps<"th">) { + return ( +
+ ) +} + +function TableCell({ className, ...props }: React.ComponentProps<"td">) { + return ( + + ) +} + +function TableCaption({ + className, + ...props +}: React.ComponentProps<"caption">) { + return ( +
+ ) +} + +export { + Table, + TableHeader, + TableBody, + TableFooter, + TableRow, + TableHead, + TableCell, + TableCaption, +} diff --git a/frontend/frontend-kit/ui/src/icons/files.ts b/frontend/frontend-kit/ui/src/icons/files.ts index c9e221541..17d1fe070 100644 --- a/frontend/frontend-kit/ui/src/icons/files.ts +++ b/frontend/frontend-kit/ui/src/icons/files.ts @@ -1,5 +1,7 @@ export { + FileCode2, Folder, FolderOpen, Trash2, + Upload, } from "lucide-react"; diff --git a/frontend/frontend-kit/ui/src/icons/math.ts b/frontend/frontend-kit/ui/src/icons/math.ts index acc9dbdd8..583bec966 100644 --- a/frontend/frontend-kit/ui/src/icons/math.ts +++ b/frontend/frontend-kit/ui/src/icons/math.ts @@ -1 +1 @@ -export { Plus, X } from "lucide-react"; +export { Plus } from "lucide-react"; diff --git a/frontend/frontend-kit/ui/src/icons/notifications.ts b/frontend/frontend-kit/ui/src/icons/notifications.ts index 0fb56915c..0e371e227 100644 --- a/frontend/frontend-kit/ui/src/icons/notifications.ts +++ b/frontend/frontend-kit/ui/src/icons/notifications.ts @@ -4,4 +4,5 @@ export { Check, CheckCircle2, X, + XCircle, } from "lucide-react"; diff --git a/frontend/frontend-kit/ui/src/icons/shapes.ts b/frontend/frontend-kit/ui/src/icons/shapes.ts index 6045089ea..1b719d90b 100644 --- a/frontend/frontend-kit/ui/src/icons/shapes.ts +++ b/frontend/frontend-kit/ui/src/icons/shapes.ts @@ -1 +1 @@ -export { Square } from "lucide-react"; +export { Circle, Square } from "lucide-react"; diff --git a/frontend/testing-view/package.json b/frontend/testing-view/package.json index cf135f1cb..abaeca8a3 100644 --- a/frontend/testing-view/package.json +++ b/frontend/testing-view/package.json @@ -33,7 +33,8 @@ "tailwindcss": "^4.1.18", "uplot": "^1.6.32", "vitest": "^4.0.18", - "zustand": "^5.0.11" + "zustand": "^5.0.11", + "lucide-react": "^0.563.0" }, "devDependencies": { "@types/react": "^19.2.11", diff --git a/frontend/testing-view/src/components/Error.tsx b/frontend/testing-view/src/components/Error.tsx index fbec77e4b..bb800471d 100644 --- a/frontend/testing-view/src/components/Error.tsx +++ b/frontend/testing-view/src/components/Error.tsx @@ -1,9 +1,11 @@ import { Button } from "@workspace/ui"; import { RefreshCw, Terminal } from "@workspace/ui/icons"; -import { useState } from "react"; +import { useEffect, useState } from "react"; import errorGif from "../assets/error.gif"; import { useStore } from "../store/store"; +const RELOAD_COOLDOWN = 8; + interface ErrorProps { /** Optional error to display. Can be null or undefined. In this case component will show default error message */ error?: Error | null; @@ -19,11 +21,27 @@ interface ErrorProps { */ export const Error = ({ error: propError, componentStack }: ErrorProps) => { const storeError = useStore((s) => s.error); + const setRestarting = useStore((s) => s.setRestarting); const error = propError || storeError; const [showDetails, setShowDetails] = useState(false); + const [countdown, setCountdown] = useState(RELOAD_COOLDOWN); + + useEffect(() => { + if (countdown <= 0) return; + const id = setTimeout(() => setCountdown((c) => c - 1), 1000); + return () => clearTimeout(id); + }, [countdown]); const handleReload = () => { - window.location.reload(); + setCountdown(RELOAD_COOLDOWN); + if (window.electronAPI) { + setRestarting(true); + window.electronAPI.restartBackend().catch(() => { + setRestarting(false); + }); + } else { + window.location.reload(); + } }; return ( @@ -72,11 +90,12 @@ export const Error = ({ error: propError, componentStack }: ErrorProps) => {
{error?.stack && ( diff --git a/frontend/testing-view/src/features/charts/components/ChartLegend.tsx b/frontend/testing-view/src/features/charts/components/ChartLegend.tsx index eab336026..6872ff719 100644 --- a/frontend/testing-view/src/features/charts/components/ChartLegend.tsx +++ b/frontend/testing-view/src/features/charts/components/ChartLegend.tsx @@ -1,4 +1,4 @@ -import { X } from "@workspace/ui/icons"; +import { Eye, EyeOff, X } from "@workspace/ui/icons"; import { COLORS } from "../constants/chartsColors"; import type { WorkspaceChartSeries } from "../types/charts"; import { ChartSettings } from "./ChartSettings"; @@ -7,7 +7,10 @@ interface ChartLegendProps { chartId: string; series: WorkspaceChartSeries[]; disabledVariables: Set; + visibleValueLabels: Set; + valueLabelRefs: { current: Map }; onToggle: (seriesKey: string) => void; + onToggleValueLabel: (seriesKey: string) => void; onRemove: (variable: string) => void; } @@ -15,7 +18,10 @@ export const ChartLegend = ({ chartId, series, disabledVariables, + visibleValueLabels, + valueLabelRefs, onToggle, + onToggleValueLabel, onRemove, }: ChartLegendProps) => (
@@ -37,6 +43,34 @@ export const ChartLegend = ({ style={{ background: COLORS[i % COLORS.length] }} /> {p.variable} + {visibleValueLabels.has(p.variable) && ( + { + if (el) valueLabelRefs.current.set(p.variable, el); + else valueLabelRefs.current.delete(p.variable); + }} + className="text-muted-foreground text-[11px] tabular-nums normal-case" + /> + )} + +
); diff --git a/frontend/testing-view/src/features/charts/components/tooltipPlugin.ts b/frontend/testing-view/src/features/charts/plugins/tooltipPlugin.ts similarity index 100% rename from frontend/testing-view/src/features/charts/components/tooltipPlugin.ts rename to frontend/testing-view/src/features/charts/plugins/tooltipPlugin.ts diff --git a/frontend/testing-view/src/features/charts/plugins/valueLabelsPlugin.ts b/frontend/testing-view/src/features/charts/plugins/valueLabelsPlugin.ts new file mode 100644 index 000000000..15e6daf37 --- /dev/null +++ b/frontend/testing-view/src/features/charts/plugins/valueLabelsPlugin.ts @@ -0,0 +1,52 @@ +import type { WorkspaceChartSeries } from "../types/charts"; + +/** + * Writes each series' latest value into the corresponding legend element + * (registered by `ChartLegend` in `valueLabelRefs`), instead of touching + * React state on every draw. + * + * `visibleLabelsRef` is read on every draw, so toggling which series show a + * value in the legend doesn't require recreating the uPlot instance. Value + * labels are opt-in, so a series only renders one once it's in the set. + */ +export const createValueLabelsPlugin = ( + series: WorkspaceChartSeries[], + visibleLabelsRef: { current: Set }, + valueLabelRefs: { current: Map }, +) => ({ + hooks: { + draw: (u: uPlot) => { + series.forEach((p, i) => { + const el = valueLabelRefs.current.get(p.variable); + if (!el) return; + + const seriesIdx = i + 1; + const data = u.data[seriesIdx]; + + if ( + !u.series[seriesIdx]?.show || + !visibleLabelsRef.current.has(p.variable) || + !data?.length + ) { + el.textContent = ""; + return; + } + + let rawVal: number | null | undefined; + for (let j = data.length - 1; j >= 0; j--) { + if (data[j] != null) { + rawVal = data[j]; + break; + } + } + + el.textContent = + rawVal == null + ? "" + : p.enumOptions?.length + ? (p.enumOptions[Math.round(rawVal)] ?? String(rawVal)) + : rawVal.toFixed(2); + }); + }, + }, +}); diff --git a/frontend/testing-view/src/features/workspace/components/rightSidebar/tabs/telemetry/TelemetryHeader.tsx b/frontend/testing-view/src/features/workspace/components/rightSidebar/tabs/telemetry/TelemetryHeader.tsx index c9011defb..fb4edf7a2 100644 --- a/frontend/testing-view/src/features/workspace/components/rightSidebar/tabs/telemetry/TelemetryHeader.tsx +++ b/frontend/testing-view/src/features/workspace/components/rightSidebar/tabs/telemetry/TelemetryHeader.tsx @@ -104,7 +104,7 @@ export const TelemetryHeader = memo(
- {liveData.cycleTime} ms + {(liveData.cycleTime / 1_000_000).toFixed(2)} ms
)} diff --git a/frontend/testing-view/src/vite-end.d.ts b/frontend/testing-view/src/vite-end.d.ts index 28748e194..63e4a4c8f 100644 --- a/frontend/testing-view/src/vite-end.d.ts +++ b/frontend/testing-view/src/vite-end.d.ts @@ -8,6 +8,22 @@ interface ElectronAPI { importConfig: () => Promise; selectFolder: () => Promise; openFolder: (path: string) => Promise; + restartBackend: () => Promise; + blcuSelectFile?: () => Promise; + blcuUpload?: (request: { + host: string; + port: number; + remote_filename: string; + local_path: string; + }) => Promise<{ ok: boolean; message: string }>; + blcuDownload?: (request: { + host: string; + port: number; + remote_filename: string; + local_path: string; + }) => Promise<{ ok: boolean; message: string }>; + blcuHealth?: () => Promise<{ status: string }>; + blcuLogs?: (tail?: number) => Promise<{ lines: string[]; line_count: number }>; } declare global { diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index d2884ea89..000000000 --- a/package-lock.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "software", - "lockfileVersion": 3, - "requires": true, - "packages": {} -} diff --git a/package.json b/package.json index 80383d0b3..08ba820b2 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,9 @@ "dev": "turbo dev", "dev:main": "turbo dev:main", "build": "turbo build", + "build:testing-view": "turbo build --filter=testing-view", + "build:competition-view": "turbo build --filter=competition-view", + "build:flashing-view": "turbo build --filter=flashing-view", "build:win": "pnpm --filter hyperloop-control-station build:win", "build:linux": "pnpm --filter hyperloop-control-station build:linux", "build:mac": "pnpm --filter hyperloop-control-station build:mac", diff --git a/packet-sender/go.mod b/packet-sender/go.mod deleted file mode 100644 index b513866fd..000000000 --- a/packet-sender/go.mod +++ /dev/null @@ -1,34 +0,0 @@ -module packet_sender - -go 1.23.0 - -toolchain go1.24.2 - -require github.com/HyperloopUPV-H8/h9-backend v0.0.0-00010101000000-000000000000 - -require ( - dario.cat/mergo v1.0.0 // indirect - github.com/Microsoft/go-winio v0.6.1 // indirect - github.com/ProtonMail/go-crypto v1.0.0 // indirect - github.com/cloudflare/circl v1.3.7 // indirect - github.com/cyphar/filepath-securejoin v0.2.4 // indirect - github.com/emirpasic/gods v1.18.1 // indirect - github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect - github.com/go-git/go-billy/v5 v5.5.0 // indirect - github.com/go-git/go-git/v5 v5.12.0 // indirect - github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect - github.com/kevinburke/ssh_config v1.2.0 // indirect - github.com/pjbgf/sha1cd v0.3.0 // indirect - github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect - github.com/skeema/knownhosts v1.2.2 // indirect - github.com/xanzy/ssh-agent v0.3.3 // indirect - golang.org/x/crypto v0.36.0 // indirect - golang.org/x/mod v0.12.0 // indirect - golang.org/x/net v0.38.0 // indirect - golang.org/x/sys v0.31.0 // indirect - golang.org/x/tools v0.13.0 // indirect - gopkg.in/warnings.v0 v0.1.2 // indirect -) - -replace github.com/HyperloopUPV-H8/h9-backend => ../backend diff --git a/packet-sender/go.sum b/packet-sender/go.sum deleted file mode 100644 index 688732b2b..000000000 --- a/packet-sender/go.sum +++ /dev/null @@ -1,145 +0,0 @@ -dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= -dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= -github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= -github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= -github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= -github.com/ProtonMail/go-crypto v1.0.0 h1:LRuvITjQWX+WIfr930YHG2HNfjR1uOfyf5vE0kC2U78= -github.com/ProtonMail/go-crypto v1.0.0/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= -github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= -github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= -github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= -github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= -github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= -github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU= -github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= -github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= -github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= -github.com/gliderlabs/ssh v0.3.7 h1:iV3Bqi942d9huXnzEF2Mt+CY9gLu8DNM4Obd+8bODRE= -github.com/gliderlabs/ssh v0.3.7/go.mod h1:zpHEXBstFnQYtGnB8k8kQLol82umzn/2/snG7alWVD8= -github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= -github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= -github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= -github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= -github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= -github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= -github.com/go-git/go-git/v5 v5.12.0 h1:7Md+ndsjrzZxbddRDZjF14qK+NN56sy6wkqaVrjZtys= -github.com/go-git/go-git/v5 v5.12.0/go.mod h1:FTM9VKtnI2m65hNI/TenDDDnUf2Q9FHnXYjuz9i5OEY= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= -github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= -github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= -github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= -github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= -github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= -github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= -github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= -github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/skeema/knownhosts v1.2.2 h1:Iug2P4fLmDw9f41PB6thxUkNUkJzB5i+1/exaj40L3A= -github.com/skeema/knownhosts v1.2.2/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= -github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34= -golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= -golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8= -golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= -golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y= -golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= -golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= -golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= -gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/packet-sender/main.go b/packet-sender/main.go deleted file mode 100644 index f748519f3..000000000 --- a/packet-sender/main.go +++ /dev/null @@ -1,101 +0,0 @@ -package main - -import ( - "fmt" - "log" - "net" - boardpkg "packet_sender/pkg/board" - "packet_sender/pkg/listener" - "packet_sender/pkg/sender" - "strings" - - adj_module "github.com/HyperloopUPV-H8/h9-backend/pkg/adj" -) - -func main() { - adj := getADJ() - conns := getConns(adj) - - fmt.Print("[Warning] This program must start before the backend. If the backend is terminated, this program must be restarted. \n \n") - fmt.Println("[Tip] You may send and listen to packets at the same time, on different terminals.") - input := getBinaryInput("Select mode:\n1) Send packets\n2) Listen packets") - - switch input { - case "1": - input := getBinaryInput("Do you want to send random or custom packets?\n1) Random\n2) Custom") - sender.Start(conns, input) - case "2": - listener.Start(conns, adj) - } -} - -func getConns(adj adj_module.ADJ) []boardpkg.BoardConn { - conns := make([]boardpkg.BoardConn, 0) - - for _, board := range adj.Boards { - conn := getConn(board.IP, 0, adj.Info.Addresses["backend"], adj.Info.Ports["UDP"]) - conns = append(conns, boardpkg.BoardConn{ - UDPConn: conn, - Packets: []adj_module.Packet{}, - Board: board, - }) - } - - return conns -} - -func getConn(lip string, lport uint16, rip string, rport uint16) *net.UDPConn { - laddr, err := net.ResolveUDPAddr("udp", fmt.Sprintf("%s:%d", lip, lport)) - if err != nil { - log.Fatalf("resolve address: %s\n", err) - } - raddr, err := net.ResolveUDPAddr("udp", fmt.Sprintf("%s:%d", rip, rport)) - if err != nil { - log.Fatalf("resolve address: %s\n", err) - } - conn, err := net.DialUDP("udp", laddr, raddr) - - if err != nil { - log.Fatal("Error creating udp connection", err) - } - - return conn -} - -// getADJ loads the same ADJ used by backend directly from backend/cmd/adj. -func getADJ() adj_module.ADJ { - // adjPath, err := filepath.Abs(path.Join("..", "backend", "cmd", "adj")) - // if err != nil { - // log.Fatalf("Failed to resolve ADJ path: %v", err) - // } - // adj_module.RepoPath = adjPath + string(filepath.Separator) - - // Uses the same ADJ RepoPath as the backend by default - - adj, err := adj_module.NewADJ("") - if err != nil { - log.Fatalf("Failed to load ADJ: %v\n", err) - } - - return adj -} - -func getBinaryInput(msg string) string { - - fmt.Println(msg) - var input string - _, err := fmt.Scan(&input) - if err != nil { - log.Fatalf("failed to read input: %v", err) - } - - for { - input = strings.TrimSpace(input) - if input != "1" && input != "2" { - log.Fatal("invalid input: use 1 or 2") - } else { - break - } - } - return input -} diff --git a/packet-sender/main_test.go b/packet-sender/main_test.go deleted file mode 100644 index 8b9af7fa0..000000000 --- a/packet-sender/main_test.go +++ /dev/null @@ -1,206 +0,0 @@ -package main - -import ( - "encoding/binary" - boardpkg "packet_sender/pkg/board" - sender "packet_sender/pkg/sender" - "testing" - - "github.com/HyperloopUPV-H8/h9-backend/pkg/abstraction" - adj_module "github.com/HyperloopUPV-H8/h9-backend/pkg/adj" -) - -func TestGetBoardPackets_FiltersOnlyDataPackets(t *testing.T) { - board := adj_module.Board{ - Name: "VCU", - Packets: []adj_module.Packet{ - {Id: abstraction.PacketId(100), Name: "DataA", Type: "data", VariablesIds: []string{"a"}}, - {Id: abstraction.PacketId(200), Name: "OrderA", Type: "order", VariablesIds: []string{"b"}}, - {Id: abstraction.PacketId(300), Name: "StateOrderA", Type: "stateOrder", VariablesIds: []string{"c"}}, - {Id: abstraction.PacketId(400), Name: "DataB", Type: "data", VariablesIds: []string{"d"}}, - }, - } - - bc := boardpkg.BoardConn{Board: board} - boardpkg.LoadDataPackets(&bc) - - if len(bc.Packets) != 2 { - t.Fatalf("expected 2 data packets, got %d", len(bc.Packets)) - } - - if bc.Packets[0].Type != "data" || bc.Packets[1].Type != "data" { - t.Fatalf("expected all packets to be type=data, got %q and %q", bc.Packets[0].Type, bc.Packets[1].Type) - } - - if bc.Packets[0].Id != 100 || bc.Packets[1].Id != 400 { - t.Fatalf("unexpected packet IDs: got %d and %d", bc.Packets[0].Id, bc.Packets[1].Id) - } -} - -func TestGetBoardPackets_EmptyInputProducesEmptyOutput(t *testing.T) { - bc := boardpkg.BoardConn{ - Board: adj_module.Board{ - Name: "EmptyBoard", - Packets: nil, - }, - } - - boardpkg.LoadDataPackets(&bc) - - if len(bc.Packets) != 0 { - t.Fatalf("expected 0 packets, got %d", len(bc.Packets)) - } -} - -func TestCreateRandomPacket_NoPackets_ReturnsNil(t *testing.T) { - bc := boardpkg.BoardConn{Packets: nil} - got := sender.CreateRandomPacket(&bc) - if got != nil { - t.Fatalf("expected nil, got %v", got) - } -} - -func TestCreateRandomPacket_NoVariables_ReturnsNil(t *testing.T) { - bc := boardpkg.BoardConn{ - Packets: []adj_module.Packet{ - { - Id: abstraction.PacketId(42), - Type: "data", - Variables: nil, - VariablesIds: nil, - }, - }, - } - - got := sender.CreateRandomPacket(&bc) - if got != nil { - t.Fatalf("expected nil when packet has no variables, got %v", got) - } -} - -func TestCreateRandomPacket_StringMeasurement_ReturnsNil(t *testing.T) { - bc := boardpkg.BoardConn{ - Packets: []adj_module.Packet{ - { - Id: abstraction.PacketId(7), - Type: "data", - VariablesIds: []string{"s"}, - Variables: []adj_module.Measurement{ - {Id: "s", Name: "S", Type: "string"}, - }, - }, - }, - } - - got := sender.CreateRandomPacket(&bc) - if got != nil { - t.Fatalf("expected nil for string measurement, got %v", got) - } -} - -func TestCreateRandomPacket_BoolPacket_HasIDAndPayload(t *testing.T) { - bc := boardpkg.BoardConn{ - Packets: []adj_module.Packet{ - { - Id: abstraction.PacketId(513), // 0x0201 - Type: "data", - VariablesIds: []string{"b"}, - Variables: []adj_module.Measurement{ - {Id: "b", Name: "B", Type: "bool"}, - }, - }, - }, - } - - got := sender.CreateRandomPacket(&bc) - if got == nil { - t.Fatal("expected non-nil packet") - } - - // 2 bytes ID + 1 byte bool - if len(got) != 3 { - t.Fatalf("expected len=3, got %d", len(got)) - } - - id := binary.LittleEndian.Uint16(got[:2]) - if id != 513 { - t.Fatalf("expected id=513, got %d", id) - } - - if got[2] != 0 && got[2] != 1 { - t.Fatalf("expected bool payload byte 0 or 1, got %d", got[2]) - } -} - -func TestCreateRandomPacket_EnumPacket_HasIDAndEnumByte(t *testing.T) { - bc := boardpkg.BoardConn{ - Packets: []adj_module.Packet{ - { - Id: abstraction.PacketId(10), - Type: "data", - VariablesIds: []string{"mode"}, - Variables: []adj_module.Measurement{ - {Id: "mode", Name: "Mode", Type: "enum(OFF,ON,FAULT)"}, - }, - }, - }, - } - - got := sender.CreateRandomPacket(&bc) - if got == nil { - t.Fatal("expected non-nil packet") - } - - // 2 bytes ID + 1 byte enum - if len(got) != 3 { - t.Fatalf("expected len=3, got %d", len(got)) - } - - id := binary.LittleEndian.Uint16(got[:2]) - if id != 10 { - t.Fatalf("expected id=10, got %d", id) - } - - enumVal := got[2] - if enumVal > 2 { - t.Fatalf("expected enum byte in [0..2], got %d", enumVal) - } -} - -func TestCreateRandomPacket_NumericPacket_HasIDAndNumericPayload(t *testing.T) { - bc := boardpkg.BoardConn{ - Packets: []adj_module.Packet{ - { - Id: abstraction.PacketId(20), - Type: "data", - VariablesIds: []string{"rpm"}, - Variables: []adj_module.Measurement{ - { - Id: "rpm", - Name: "RPM", - Type: "uint16", - WarningRange: []*float64{}, // force fallback path - }, - }, - }, - }, - } - - got := sender.CreateRandomPacket(&bc) - if got == nil { - t.Fatal("expected non-nil packet") - } - - // 2 bytes ID + 2 bytes uint16 - if len(got) != 4 { - t.Fatalf("expected len=4, got %d", len(got)) - } - - id := binary.LittleEndian.Uint16(got[:2]) - if id != 20 { - t.Fatalf("expected id=20, got %d", id) - } - - // just ensure numeric payload exists and is parseable - _ = binary.LittleEndian.Uint16(got[2:4]) -} \ No newline at end of file diff --git a/packet-sender/package-lock.json b/packet-sender/package-lock.json new file mode 100644 index 000000000..8003597f7 --- /dev/null +++ b/packet-sender/package-lock.json @@ -0,0 +1,13 @@ +{ + "name": "packet-sender", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "packet-sender", + "version": "1.0.0", + "license": "MIT" + } + } +} diff --git a/packet-sender/package.json b/packet-sender/package.json deleted file mode 100644 index 9f0d954e5..000000000 --- a/packet-sender/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "packet-sender", - "version": "1.0.0", - "private": true, - "author": "Hyperloop UPV Team", - "license": "MIT", - "scripts": { - "build": "go build -o packet-sender main.go", - "build:ci": "go build" - } -} diff --git a/packet-sender/pkg/board/board.go b/packet-sender/pkg/board/board.go deleted file mode 100644 index 59d204850..000000000 --- a/packet-sender/pkg/board/board.go +++ /dev/null @@ -1,36 +0,0 @@ -package board - -import ( - "net" - - adj_module "github.com/HyperloopUPV-H8/h9-backend/pkg/adj" -) - -type BoardConn struct { - UDPConn *net.UDPConn - Packets []adj_module.Packet - Board adj_module.Board - - TCPListener *net.TCPListener - TCPConn net.Conn -} - -func LoadDataPackets(boardConn *BoardConn) { - packets := make([]adj_module.Packet, 0) - - for _, packet := range boardConn.Board.Packets { - if packet.Type != "data" { - continue - } - - packets = append(packets, adj_module.Packet{ - Id: packet.Id, - Name: packet.Name, - Type: packet.Type, - Variables: packet.Variables, - VariablesIds: packet.VariablesIds, - }) - } - - boardConn.Packets = packets -} diff --git a/packet-sender/pkg/listener/listener.go b/packet-sender/pkg/listener/listener.go deleted file mode 100644 index 5dd1f1a3d..000000000 --- a/packet-sender/pkg/listener/listener.go +++ /dev/null @@ -1,108 +0,0 @@ -package listener - -import ( - "encoding/binary" - "fmt" - "log" - "net" - boardpkg "packet_sender/pkg/board" - - adj_module "github.com/HyperloopUPV-H8/h9-backend/pkg/adj" -) - -func Start(conns []boardpkg.BoardConn, adj adj_module.ADJ) { - tcpPort := adj.Info.Ports["TCP_SERVER"] - for i := range conns { - if err := startTCPListener(&conns[i], tcpPort); err != nil { - log.Printf("TCP listener error: %v", err) - } - } - - defer func() { - for _, c := range conns { - if c.TCPConn != nil { - c.TCPConn.Close() - } - if c.TCPListener != nil { - c.TCPListener.Close() - } - } - }() - - // Get the list of packets for each board - for i := range conns { - boardpkg.LoadDataPackets(&conns[i]) - go startTCPConnection(&conns[i]) - } - - select {} -} - -func startTCPListener(board *boardpkg.BoardConn, backendPort uint16) error { - - addr, err := net.ResolveTCPAddr("tcp", fmt.Sprintf("%s:%d", board.Board.IP, backendPort)) - if err != nil { - return fmt.Errorf("resolve tcp addr for %s: %w", board.Board.Name, err) - } - - ln, err := net.ListenTCP("tcp", addr) - if err != nil { - return fmt.Errorf("listen tcp for %s: %w", board.Board.Name, err) - } - - board.TCPListener = ln - log.Printf("[%s] TCP listening on %s", board.Board.Name, ln.Addr().String()) - return nil -} - -func startTCPConnection(board *boardpkg.BoardConn) { - if board.TCPListener == nil { - return - } - - conn, err := board.TCPListener.AcceptTCP() - if err != nil { - log.Printf("[%s] TCP accept error: %v", board.Board.Name, err) - return - } - - board.TCPConn = conn - log.Printf("[%s] TCP connected: local=%s remote=%s", - board.Board.Name, conn.LocalAddr().String(), conn.RemoteAddr().String()) - - go readTCPPackets(board) -} - -func readTCPPackets(board *boardpkg.BoardConn) { - if board.TCPConn == nil { - return - } - - buf := make([]byte, 2048) - - // Read packets in a loop - for { - n, err := board.TCPConn.Read(buf) - if err != nil { - log.Printf("[%s] TCP read closed/error: %v", board.Board.Name, err) - return - } - if n < 2 { - log.Printf("[%s] TCP read %d bytes (too short for packet id)", board.Board.Name, n) - continue - } - - id := binary.LittleEndian.Uint16(buf[:2]) - order := findOrderByID(board, id) - log.Printf("[%s] TCP: packet_id=%d order=%s", board.Board.Name, id, order) - } -} - -func findOrderByID(board *boardpkg.BoardConn, id uint16) string { - for _, p := range board.Board.Packets { - if uint16(p.Id) == id { - return p.Name - } - } - return "unknown" -} \ No newline at end of file diff --git a/packet-sender/pkg/sender/customSender.go b/packet-sender/pkg/sender/customSender.go deleted file mode 100644 index a07386ab7..000000000 --- a/packet-sender/pkg/sender/customSender.go +++ /dev/null @@ -1,105 +0,0 @@ -package sender - -import ( - "bufio" - "bytes" - "encoding/binary" - "fmt" - "os" - boardpkg "packet_sender/pkg/board" - "strconv" - "strings" -) - -func CustomSender(conns []boardpkg.BoardConn) { - reader := bufio.NewReader(os.Stdin) - for { - // Show available boards - fmt.Println("Available boards:") - for i, c := range conns { - fmt.Printf("[%d] %s\n", i, c.Board.Name) - } - fmt.Print("Select board index: ") - boardIdxStr, _ := reader.ReadString('\n') - boardIdx, err := strconv.Atoi(strings.TrimSpace(boardIdxStr)) - if err != nil || boardIdx < 0 || boardIdx >= len(conns) { - fmt.Println("Invalid board index") - continue - } - board := &conns[boardIdx] - - // Show available packets - fmt.Println("Available packets:") - for i, p := range board.Packets { - fmt.Printf("[%d] ID: %d, Nombre: %s\n", i, p.Id, p.Name) - } - fmt.Print("Select packet index: ") - packetIdxStr, _ := reader.ReadString('\n') - packetIdx, err := strconv.Atoi(strings.TrimSpace(packetIdxStr)) - if err != nil || packetIdx < 0 || packetIdx >= len(board.Packets) { - fmt.Println("Invalid packet index") - continue - } - packet := board.Packets[packetIdx] - - // Ask values for each variable - buff := bytes.NewBuffer(make([]byte, 0)) - binary.Write(buff, binary.LittleEndian, packet.Id) - - for _, v := range packet.Variables { - fmt.Printf("Enter value for %s (%s): ", v.Name, v.Type) - valStr, _ := reader.ReadString('\n') - valStr = strings.TrimSpace(valStr) - writeUserValueAsBytes(valStr, v.Type, buff) - } - - // Send packet - _, err = board.UDPConn.Write(buff.Bytes()) - if err != nil { - fmt.Println("Error sending packet:", err) - } else { - fmt.Println("Packet sent successfully.") - } - } -} - -func writeUserValueAsBytes(valStr, typ string, buff *bytes.Buffer) { - switch typ { - case "uint8": - v, _ := strconv.ParseUint(valStr, 10, 8) - binary.Write(buff, binary.LittleEndian, uint8(v)) - case "uint16": - v, _ := strconv.ParseUint(valStr, 10, 16) - binary.Write(buff, binary.LittleEndian, uint16(v)) - case "uint32": - v, _ := strconv.ParseUint(valStr, 10, 32) - binary.Write(buff, binary.LittleEndian, uint32(v)) - case "uint64": - v, _ := strconv.ParseUint(valStr, 10, 64) - binary.Write(buff, binary.LittleEndian, uint64(v)) - case "int8": - v, _ := strconv.ParseInt(valStr, 10, 8) - binary.Write(buff, binary.LittleEndian, int8(v)) - case "int16": - v, _ := strconv.ParseInt(valStr, 10, 16) - binary.Write(buff, binary.LittleEndian, int16(v)) - case "int32": - v, _ := strconv.ParseInt(valStr, 10, 32) - binary.Write(buff, binary.LittleEndian, int32(v)) - case "int64": - v, _ := strconv.ParseInt(valStr, 10, 64) - binary.Write(buff, binary.LittleEndian, int64(v)) - case "float32": - v, _ := strconv.ParseFloat(valStr, 32) - binary.Write(buff, binary.LittleEndian, float32(v)) - case "float64": - v, _ := strconv.ParseFloat(valStr, 64) - binary.Write(buff, binary.LittleEndian, v) - case "bool": - v := valStr == "true" || valStr == "1" - binary.Write(buff, binary.LittleEndian, v) - default: - // Add extra handling for enums and other types here. - binary.Write(buff, binary.LittleEndian, uint8(0)) - } -} diff --git a/packet-sender/pkg/sender/randomSender.go b/packet-sender/pkg/sender/randomSender.go deleted file mode 100644 index 2457bee57..000000000 --- a/packet-sender/pkg/sender/randomSender.go +++ /dev/null @@ -1,179 +0,0 @@ -package sender - -import ( - "bytes" - "encoding/binary" - "fmt" - "log" - "math" - "math/rand" - "os" - "os/signal" - boardpkg "packet_sender/pkg/board" - "strings" - "time" -) - -func RandomSender(conns []boardpkg.BoardConn) { - count := make(chan struct{}, 10000) - start := time.Now() - prev := time.Now() - go func() { - ticker := time.NewTicker(10 * time.Millisecond) - defer ticker.Stop() - for range ticker.C { - // Get a random board to send the packet from - randomIndex := rand.Int63n(int64(len(conns))) - randomBoard := conns[randomIndex] - - packet := CreateRandomPacket(&randomBoard) - fmt.Println(time.Since(prev)) - prev = time.Now() - - if len(packet) < 2 { - continue - } - - fmt.Printf("Sending packet ID: %d, size: %d\n", binary.LittleEndian.Uint16(packet), len(packet)) - _, err := randomBoard.UDPConn.Write(packet) - if err != nil { - continue - } - - count <- struct{}{} - } - }() - - interrupt := make(chan os.Signal, 1) - signal.Notify(interrupt, os.Interrupt) - defer signal.Stop(interrupt) - - sent := 0 - for { - select { - case <-count: - sent++ - case <-interrupt: - fmt.Printf("Sent=%d, Elapsed=%v\n", sent, time.Since(start)) - return - } - } -} - -func CreateRandomPacket(board *boardpkg.BoardConn) []byte { - if len(board.Packets) == 0 { - return nil - } - - randomIndex := rand.Int63n(int64(len(board.Packets))) - randomPacket := board.Packets[randomIndex] - - if len(randomPacket.VariablesIds) == 0 { - log.Printf("The packet with ID %d has no measurements\n", randomPacket.Id) - return nil - } - - buff := bytes.NewBuffer(make([]byte, 0)) - - binary.Write(buff, binary.LittleEndian, randomPacket.Id) - - for _, measurement := range randomPacket.Variables { - switch { - case strings.Contains(measurement.Type, "enum"): - n := enumOptionCount(measurement.Type) - binary.Write(buff, binary.LittleEndian, uint8(rand.Intn(n))) - case measurement.Type == "bool": - binary.Write(buff, binary.LittleEndian, rand.Intn(2) == 1) - case measurement.Type == "string": - return nil - default: - var number float64 - // If warning bounds are unavailable, fall back to full type range. - if len(measurement.WarningRange) == 0 { - number = mapNumberToRange(rand.Float64(), nil, measurement.Type) - } else if measurement.WarningRange[0] != nil && measurement.WarningRange[1] != nil { - low := *measurement.WarningRange[0] * 0.8 - high := *measurement.WarningRange[1] * 1.2 - number = mapNumberToRange(rand.Float64(), []*float64{&low, &high}, measurement.Type) - } else { - number = mapNumberToRange(rand.Float64(), nil, measurement.Type) - } - writeNumberAsBytes(number, measurement.Type, buff) - } - } - return buff.Bytes() -} - -func enumOptionCount(t string) int { - trimmed := strings.TrimSuffix(strings.TrimPrefix(t, "enum("), ")") - trimmed = strings.ReplaceAll(trimmed, " ", "") - if trimmed == "" { - return 0 - } - return len(strings.Split(trimmed, ",")) -} - -func mapNumberToRange(number float64, numberRange []*float64, numberType string) float64 { - if len(numberRange) == 0 { - return number * getTypeMaxValue(numberType) - } - return (number * (*numberRange[1] - *numberRange[0])) + *numberRange[0] -} - -func getTypeMaxValue(numberType string) float64 { - switch numberType { - case "uint8": - return math.MaxUint8 - case "uint16": - return math.MaxUint16 - case "uint32": - return math.MaxUint32 - case "uint64": - return math.MaxUint64 - case "int8": - return math.MaxInt8 - case "int16": - return math.MaxInt16 - case "int32": - return math.MaxInt32 - case "int64": - return math.MaxInt64 - case "float32": - return math.MaxFloat32 - case "float64": - return math.MaxFloat64 - case "bool": - return math.MaxUint8 - default: - return math.MaxUint8 - } -} - -func writeNumberAsBytes(number float64, numberType string, buff *bytes.Buffer) { - switch numberType { - case "uint8": - binary.Write(buff, binary.LittleEndian, uint8(number)) - case "uint16": - binary.Write(buff, binary.LittleEndian, uint16(number)) - case "uint32": - binary.Write(buff, binary.LittleEndian, uint32(number)) - case "uint64": - binary.Write(buff, binary.LittleEndian, uint64(number)) - case "int8": - binary.Write(buff, binary.LittleEndian, int8(number)) - case "int16": - binary.Write(buff, binary.LittleEndian, int16(number)) - case "int32": - binary.Write(buff, binary.LittleEndian, int32(number)) - case "int64": - binary.Write(buff, binary.LittleEndian, int64(number)) - case "float32": - binary.Write(buff, binary.LittleEndian, float32(number)) - case "float64": - binary.Write(buff, binary.LittleEndian, number) - case "bool": - binary.Write(buff, binary.LittleEndian, uint8(number)) - default: - binary.Write(buff, binary.LittleEndian, uint8(number)) - } -} diff --git a/packet-sender/pkg/sender/sender.go b/packet-sender/pkg/sender/sender.go deleted file mode 100644 index b06446f43..000000000 --- a/packet-sender/pkg/sender/sender.go +++ /dev/null @@ -1,26 +0,0 @@ -package sender - -import ( - boardpkg "packet_sender/pkg/board" -) - -func Start(conns []boardpkg.BoardConn, input string) { - - // Get the list of packets for each board - for i := range conns { - boardpkg.LoadDataPackets(&conns[i]) - } - - defer func() { - for _, c := range conns { - c.UDPConn.Close() - } - }() - - switch input { - case "1": - RandomSender(conns) - case "2": - CustomSender(conns) - } -} diff --git a/packet-sender/testadj.py b/packet-sender/testadj.py deleted file mode 100644 index 82802cd34..000000000 --- a/packet-sender/testadj.py +++ /dev/null @@ -1,121 +0,0 @@ -import os -import json - - -def validate_json_structure(data): - errors = [] - - if "board_id" in data: - if not isinstance(data["board_id"], int): - errors.append(f"'board_id' debe ser un entero, pero se encontró: {type(data['board_id']).__name__}.") - - if "board_ip" in data: - if not isinstance(data["board_ip"], str): - errors.append(f"'board_ip' debe ser una cadena, pero se encontró: {type(data['board_ip']).__name__}.") - - - if "measurements" in data: - if not isinstance(data["measurements"], list): - errors.append("La clave 'measurements' debe ser una lista.") - else: - for measurement in data["measurements"]: - if isinstance(measurement, dict): - required_keys = ["id", "name", "type", "podUnits", "displayUnits"] - for key in required_keys: - if key not in measurement: - errors.append(f"Falta la clave '{key}' en un objeto de 'measurements'.") - if "id" in measurement and not isinstance(measurement["id"], str): - errors.append(f"El 'id' debe ser una cadena en: {measurement}") - if "name" in measurement and not isinstance(measurement["name"], str): - errors.append(f"El 'name' debe ser una cadena en: {measurement}") - if "type" in measurement and not isinstance(measurement["type"], str): - errors.append(f"El 'type' debe ser una cadena en: {measurement}") - if "safeRange" in measurement and not isinstance(measurement.get("safeRange", []), list): - errors.append(f"'safeRange' debe ser una lista en: {measurement}") - if "warningRange" in measurement and not isinstance(measurement.get("warningRange", []), list): - errors.append(f"'warningRange' debe ser una lista en: {measurement}") - if "displayUnits" in measurement and not isinstance(measurement["displayUnits"], str): - errors.append(f"El 'podUnits' debe ser una cadena en: {measurement}") - if "podUnits" in measurement and not isinstance(measurement["podUnits"], str): - errors.append(f"El 'podUnits' debe ser una cadena en: {measurement}") #esto se puede quitar (json 516) - elif not isinstance(measurement, str): - errors.append("Cada elemento en 'measurements' debe ser un objeto o una cadena (nombre de archivo).") - - - if "packets" in data: - if not isinstance(data["packets"], list): - errors.append("La clave 'packets' debe ser una lista.") - else: - for packet in data["packets"]: - if isinstance(packet, dict): - required_keys = ["id", "name", "type","variable"] - for key in required_keys: - if key not in packet: - errors.append(f"Falta la clave '{key}' en un objeto de 'packets'.") - if "id" in packet and not isinstance(packet["id"], str): - errors.append(f"El 'id' debe ser una cadena en: {packet}") - if "name" in packet and not isinstance(packet["name"], str): - errors.append(f"El 'name' debe ser una cadena en: {packet}") - if "type" in packet and not isinstance(packet["type"], str): - errors.append(f"El 'type' debe ser una cadena en: {packet}") - if "variables" in packet: - if not isinstance(packet["variables"], list): - errors.append(f"'variables' debe ser una lista en: {packet}") - else: - for variable in packet["variables"]: - if not isinstance(variable, dict): - errors.append(f"Cada elemento en 'variables' debe ser un objeto en: {packet}") - if "name" not in variable: - errors.append(f"Falta la clave 'name' en un objeto de 'variables' en: {packet}") - elif not isinstance(packet, str): - errors.append("Cada elemento en 'packets' debe ser un objeto o una cadena (nombre de archivo).") - - return errors - - - -def validate_json_folder(folder_path): - boards_file_path = os.path.join(folder_path, "boards.json") - - try: - with open(boards_file_path, 'r') as boards_file: - boards_data = json.load(boards_file) - boards = boards_data.get("boards", {}) - - - board_keys = list(boards.keys()) - duplicate_keys = [key for key in board_keys if board_keys.count(key) > 1] - - if duplicate_keys: - print(f"Error: El archivo boards.json contiene claves duplicadas: {', '.join(duplicate_keys)}") - return - - except json.JSONDecodeError as e: - print(f"Error al decodificar JSON en {boards_file_path}: {e}") - return - except Exception as e: - print(f"Error al procesar el archivo {boards_file_path}: {e}") - return - - - for board_name, board_file_path in boards.items(): - full_path = os.path.join(folder_path, board_file_path) - try: - with open(full_path, 'r') as board_file: - data = json.load(board_file) - errors = validate_json_structure(data) - if errors: - print(f"Errores encontrados en {full_path} para la placa '{board_name}':") - for error in errors: - print(f"- {error}") - - except json.JSONDecodeError as e: - print(f"Error al decodificar JSON en {full_path}: {e}") - except Exception as e: - print(f"Error al procesar el archivo {full_path}: {e}") - - -if os.path.exists('./adj/') == False: - print("La carpeta ./adj/ no existe") -if __name__ == "__main__": - validate_json_folder("./adj/") diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3eb9ad9ae..66a6e72f1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -29,6 +29,8 @@ importers: backend: {} + blcu-programming: {} + e2e: devDependencies: '@playwright/test': @@ -58,7 +60,7 @@ importers: devDependencies: '@vitest/coverage-v8': specifier: ^4.0.18 - version: 4.0.18(vitest@4.0.18(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.30.2)) + version: 4.0.18(vitest@4.0.18(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.32.0)(msw@2.14.6(@types/node@25.2.0)(typescript@6.0.3))) asar: specifier: ^3.2.0 version: 3.2.0 @@ -70,7 +72,114 @@ importers: version: 26.7.0(electron-builder-squirrel-windows@24.13.3) vitest: specifier: ^4.0.18 - version: 4.0.18(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.30.2) + version: 4.0.18(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.32.0)(msw@2.14.6(@types/node@25.2.0)(typescript@6.0.3)) + + frontend/competition-view: + dependencies: + '@tailwindcss/vite': + specifier: ^4.1.18 + version: 4.3.0(vite@7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.32.0)) + '@vitejs/plugin-react-swc': + specifier: ^4.2.3 + version: 4.2.3(vite@7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.32.0)) + '@workspace/core': + specifier: workspace:* + version: link:../frontend-kit/core + '@workspace/ui': + specifier: workspace:* + version: link:../frontend-kit/ui + lucide-react: + specifier: ^0.563.0 + version: 0.563.0(react@19.2.4) + react: + specifier: ^19.2.4 + version: 19.2.4 + react-dom: + specifier: ^19.2.4 + version: 19.2.4(react@19.2.4) + react-router: + specifier: ^7.13.0 + version: 7.13.0(react-dom@19.2.4(react@19.2.4))(react@19.2.4) + tailwindcss: + specifier: ^4.1.18 + version: 4.1.18 + uplot: + specifier: ^1.6.32 + version: 1.6.32 + zustand: + specifier: ^5.0.11 + version: 5.0.11(@types/react@19.2.11)(immer@11.1.0)(react@19.2.4)(use-sync-external-store@1.6.0(react@19.2.4)) + devDependencies: + '@types/react': + specifier: ^19.2.11 + version: 19.2.11 + '@types/react-dom': + specifier: ^19.2.3 + version: 19.2.3(@types/react@19.2.11) + '@workspace/eslint-config': + specifier: workspace:^ + version: link:../frontend-kit/esling-config + '@workspace/typescript-config': + specifier: workspace:* + version: link:../frontend-kit/typescript-config + eslint: + specifier: ^9.39.2 + version: 9.39.2(jiti@2.6.1) + globals: + specifier: ^17.3.0 + version: 17.3.0 + typescript: + specifier: ^5.9.3 + version: 5.9.3 + vite: + specifier: ^7.3.1 + version: 7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.32.0) + + frontend/flashing-view: + dependencies: + '@tailwindcss/vite': + specifier: ^4.1.18 + version: 4.3.0(vite@7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.32.0)) + '@vitejs/plugin-react-swc': + specifier: ^4.2.3 + version: 4.2.3(vite@7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.32.0)) + '@workspace/ui': + specifier: workspace:* + version: link:../frontend-kit/ui + lucide-react: + specifier: ^0.563.0 + version: 0.563.0(react@19.2.4) + react: + specifier: ^19.2.4 + version: 19.2.4 + react-dom: + specifier: ^19.2.4 + version: 19.2.4(react@19.2.4) + tailwindcss: + specifier: ^4.1.18 + version: 4.3.0 + devDependencies: + '@types/react': + specifier: 19.2.11 + version: 19.2.11 + '@types/react-dom': + specifier: 19.2.3 + version: 19.2.3(@types/react@19.2.11) + '@workspace/eslint-config': + specifier: workspace:^ + version: link:../frontend-kit/esling-config + '@workspace/typescript-config': + specifier: workspace:* + version: link:../frontend-kit/typescript-config + eslint: + specifier: ^9.39.2 + version: 9.39.4(jiti@2.6.1) + typescript: + specifier: ^5.9.3 + version: 5.9.3 + vite: + specifier: ^7.3.1 + version: 7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.32.0) frontend/frontend-kit/core: dependencies: @@ -263,7 +372,7 @@ importers: version: 1.2.4(@types/react@19.2.11)(react@19.2.4) '@tailwindcss/vite': specifier: ^4.1.18 - version: 4.1.18(vite@7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.30.2)) + version: 4.1.18(vite@7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.32.0)) '@tanstack/react-virtual': specifier: ^3.13.18 version: 3.13.18(react-dom@19.2.4(react@19.2.4))(react@19.2.4) @@ -272,7 +381,7 @@ importers: version: 4.17.23 '@vitejs/plugin-react-swc': specifier: ^4.2.3 - version: 4.2.3(vite@7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.30.2)) + version: 4.2.3(vite@7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.32.0)) '@workspace/core': specifier: workspace:* version: link:../frontend-kit/core @@ -282,6 +391,9 @@ importers: lodash: specifier: ^4.17.23 version: 4.17.23 + lucide-react: + specifier: ^0.563.0 + version: 0.563.0(react@19.2.4) react: specifier: ^19.2.4 version: 19.2.4 @@ -299,7 +411,7 @@ importers: version: 1.6.32 vitest: specifier: ^4.0.18 - version: 4.0.18(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.30.2) + version: 4.0.18(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.32.0)(msw@2.14.6(@types/node@25.2.0)(typescript@5.9.3)) zustand: specifier: ^5.0.11 version: 5.0.11(@types/react@19.2.11)(immer@11.1.0)(react@19.2.4)(use-sync-external-store@1.6.0(react@19.2.4)) @@ -327,9 +439,7 @@ importers: version: 5.9.3 vite: specifier: ^7.3.1 - version: 7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.30.2) - - packet-sender: {} + version: 7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.32.0) packages: @@ -688,6 +798,10 @@ packages: resolution: {integrity: sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/config-array@0.21.2': + resolution: {integrity: sha512-nJl2KGTlrf9GjLimgIru+V/mzgSK0ABCDQRvxw5BjURL7WfH5uoWmizbH7QB6MmnMBd8cIC9uceWnezL1VZWWw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/config-helpers@0.4.2': resolution: {integrity: sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -700,10 +814,18 @@ packages: resolution: {integrity: sha512-Kr+LPIUVKz2qkx1HAMH8q1q6azbqBAsXJUxBl/ODDuVPX45Z9DfwB8tPjTi6nNZ8BuM3nbJxC5zCAg5elnBUTQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/eslintrc@3.3.5': + resolution: {integrity: sha512-4IlJx0X0qftVsN5E+/vGujTRIFtwuLbNsVUe7TO6zYPDR1O6nFwvwhIKEKSrl6dZchmYBITazxKoUYOjdtjlRg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/js@9.39.2': resolution: {integrity: sha512-q1mjIoW1VX4IvSocvM/vbTiveKC4k9eLrajNEuSsmjymSDEbpGddtpfOoN7YGAqBK3NG+uqo8ia4PDTt8buCYA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/js@9.39.4': + resolution: {integrity: sha512-nE7DEIchvtiFTwBw4Lfbu59PG+kCofhjsKaCWzxTpt4lfRjRMqG6uMBzKXuEcyXhOHoUp9riAm7/aWYGhXZ9cw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/object-schema@2.1.7': resolution: {integrity: sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -758,6 +880,28 @@ packages: '@iarna/toml@2.2.5': resolution: {integrity: sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==} + '@inquirer/ansi@2.0.5': + resolution: {integrity: sha512-doc2sWgJpbFQ64UflSVd17ibMGDuxO1yKgOgLMwavzESnXjFWJqUeG8saYosqKpHp4kWiM5x1nXvEjbpx90gzw==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} + + '@inquirer/confirm@6.0.13': + resolution: {integrity: sha512-wkGPC7yJ5WJk1DJ5SX7fzk+gfj4BM8cf5dDDi71B/551xHrdsZVRJOC0WyikXd0pEsb/9cLniuE4atbsMqmFkw==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/core@11.1.10': + resolution: {integrity: sha512-a4Q5BXHQAHa9eO202sTaFCHFYVB3x5fauDuThEAdZ9gfn76pSxiKU7wWcEH0N1O0XmQvNfQNU6QXpiRxmYQx+A==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + '@inquirer/external-editor@1.0.3': resolution: {integrity: sha512-RWbSrDiYmO4LbejWY7ttpxczuwQyZLBUyygsA9Nsv95hpzUWwnNTVQmAq3xuh7vNwCp07UTmE5i11XAEExx4RA==} engines: {node: '>=18'} @@ -767,6 +911,19 @@ packages: '@types/node': optional: true + '@inquirer/figures@2.0.5': + resolution: {integrity: sha512-NsSs4kzfm12lNetHwAn3GEuH317IzpwrMCbOuMIVytpjnJ90YYHNwdRgYGuKmVxwuIqSgqk3M5qqQt1cDk0tGQ==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} + + '@inquirer/type@4.0.5': + resolution: {integrity: sha512-aetVUNeKNc/VriqXlw1NRSW0zhMBB0W4bNbWRJgzRl/3d0QNDQFfk0GO5SDdtjMZVg6o8ZKEiadd7SCCzoOn5Q==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + '@isaacs/balanced-match@4.0.1': resolution: {integrity: sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==} engines: {node: 20 || >=22} @@ -818,6 +975,10 @@ packages: resolution: {integrity: sha512-aYeETtotNichct/7lRBwTEuPDyPko/QJ+5QsnDGK9lraie7CDC4ofw1TqJxfk44BtzD+Eg/IVvHl45b20RyAHA==} hasBin: true + '@mswjs/interceptors@0.41.9': + resolution: {integrity: sha512-VVPPgHyQ6ShqnrmDWuxjmUIsO9gWyOZFmuOfLd9LfBGQJwZfy0gvv9pbHSJuoFNIYC7ZDX9aoFwowjcdSC4E8w==} + engines: {node: '>=18'} + '@nodelib/fs.scandir@2.1.5': resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -838,6 +999,18 @@ packages: resolution: {integrity: sha512-/xGlezI6xfGO9NwuJlnwz/K14qD1kCSAGtacBHnGzeAIuJGazcp45KP5NuyARXoKb7cwulAGWVsbeSxdG/cb0Q==} engines: {node: ^18.17.0 || >=20.5.0} + '@open-draft/deferred-promise@2.2.0': + resolution: {integrity: sha512-CecwLWx3rhxVQF6V4bAgPS5t+So2sTbPgAzafKkVizyi7tlwpcFpdFqq+wqF2OwNBmqFuu6tOyouTuxgpMfzmA==} + + '@open-draft/deferred-promise@3.0.0': + resolution: {integrity: sha512-XW375UK8/9SqUVNVa6M0yEy8+iTi4QN5VZ7aZuRFQmy76LRwI9wy5F4YIBU6T+eTe2/DNDo8tqu8RHlwLHM6RA==} + + '@open-draft/logger@0.3.0': + resolution: {integrity: sha512-X2g45fzhxH238HKO4xbSr7+wBS8Fvw6ixhTDuvLd5mqh6bJJCFAPwU9mPDxbcrRtfxv4u5IHCEH77BmxvXmmxQ==} + + '@open-draft/until@2.1.0': + resolution: {integrity: sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==} + '@pkgjs/parseargs@0.11.0': resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} @@ -1802,60 +1975,117 @@ packages: '@tailwindcss/node@4.1.18': resolution: {integrity: sha512-DoR7U1P7iYhw16qJ49fgXUlry1t4CpXeErJHnQ44JgTSKMaZUdf17cfn5mHchfJ4KRBZRFA/Coo+MUF5+gOaCQ==} + '@tailwindcss/node@4.3.0': + resolution: {integrity: sha512-aFb4gUhFOgdh9AXo4IzBEOzBkkAxm9VigwDJnMIYv3lcfXCJVesNfbEaBl4BNgVRyid92AmdviqwBUBRKSeY3g==} + '@tailwindcss/oxide-android-arm64@4.1.18': resolution: {integrity: sha512-dJHz7+Ugr9U/diKJA0W6N/6/cjI+ZTAoxPf9Iz9BFRF2GzEX8IvXxFIi/dZBloVJX/MZGvRuFA9rqwdiIEZQ0Q==} engines: {node: '>= 10'} cpu: [arm64] os: [android] + '@tailwindcss/oxide-android-arm64@4.3.0': + resolution: {integrity: sha512-TJPiq67tKlLuObP6RkwvVGDoxCMBVtDgKkLfa/uyj7/FyxvQwHS+UOnVrXXgbEsfUaMgiVvC4KbJnRr26ho4Ng==} + engines: {node: '>= 20'} + cpu: [arm64] + os: [android] + '@tailwindcss/oxide-darwin-arm64@4.1.18': resolution: {integrity: sha512-Gc2q4Qhs660bhjyBSKgq6BYvwDz4G+BuyJ5H1xfhmDR3D8HnHCmT/BSkvSL0vQLy/nkMLY20PQ2OoYMO15Jd0A==} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] + '@tailwindcss/oxide-darwin-arm64@4.3.0': + resolution: {integrity: sha512-oMN/WZRb+SO37BmUElEgeEWuU8E/HXRkiODxJxLe1UTHVXLrdVSgfaJV7pSlhRGMSOiXLuxTIjfsF3wYvz8cgQ==} + engines: {node: '>= 20'} + cpu: [arm64] + os: [darwin] + '@tailwindcss/oxide-darwin-x64@4.1.18': resolution: {integrity: sha512-FL5oxr2xQsFrc3X9o1fjHKBYBMD1QZNyc1Xzw/h5Qu4XnEBi3dZn96HcHm41c/euGV+GRiXFfh2hUCyKi/e+yw==} engines: {node: '>= 10'} cpu: [x64] os: [darwin] + '@tailwindcss/oxide-darwin-x64@4.3.0': + resolution: {integrity: sha512-N6CUmu4a6bKVADfw77p+iw6Yd9Q3OBhe0veaDX+QazfuVYlQsHfDgxBrsjQ/IW+zywL8mTrNd0SdJT/zgtvMdA==} + engines: {node: '>= 20'} + cpu: [x64] + os: [darwin] + '@tailwindcss/oxide-freebsd-x64@4.1.18': resolution: {integrity: sha512-Fj+RHgu5bDodmV1dM9yAxlfJwkkWvLiRjbhuO2LEtwtlYlBgiAT4x/j5wQr1tC3SANAgD+0YcmWVrj8R9trVMA==} engines: {node: '>= 10'} cpu: [x64] os: [freebsd] + '@tailwindcss/oxide-freebsd-x64@4.3.0': + resolution: {integrity: sha512-zDL5hBkQdH5C6MpqbK3gQAgP80tsMwSI26vjOzjJtNCMUo0lFgOItzHKBIupOZNQxt3ouPH7RPhvNhiTfCe5CQ==} + engines: {node: '>= 20'} + cpu: [x64] + os: [freebsd] + '@tailwindcss/oxide-linux-arm-gnueabihf@4.1.18': resolution: {integrity: sha512-Fp+Wzk/Ws4dZn+LV2Nqx3IilnhH51YZoRaYHQsVq3RQvEl+71VGKFpkfHrLM/Li+kt5c0DJe/bHXK1eHgDmdiA==} engines: {node: '>= 10'} cpu: [arm] os: [linux] + '@tailwindcss/oxide-linux-arm-gnueabihf@4.3.0': + resolution: {integrity: sha512-R06HdNi7A7OEoMsf6d4tjZ71RCWnZQPHj2mnotSFURjNLdBC+cIgXQ7l81CqeoiQftjf6OOblxXMInMgN2VzMA==} + engines: {node: '>= 20'} + cpu: [arm] + os: [linux] + '@tailwindcss/oxide-linux-arm64-gnu@4.1.18': resolution: {integrity: sha512-S0n3jboLysNbh55Vrt7pk9wgpyTTPD0fdQeh7wQfMqLPM/Hrxi+dVsLsPrycQjGKEQk85Kgbx+6+QnYNiHalnw==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] + '@tailwindcss/oxide-linux-arm64-gnu@4.3.0': + resolution: {integrity: sha512-qTJHELX8jetjhRQHCLilkVLmybpzNQAtaI/gaoVoidn/ufbNDbAo8KlK2J+yPoc8wQxvDxCmh/5lr8nC1+lTbg==} + engines: {node: '>= 20'} + cpu: [arm64] + os: [linux] + '@tailwindcss/oxide-linux-arm64-musl@4.1.18': resolution: {integrity: sha512-1px92582HkPQlaaCkdRcio71p8bc8i/ap5807tPRDK/uw953cauQBT8c5tVGkOwrHMfc2Yh6UuxaH4vtTjGvHg==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] + '@tailwindcss/oxide-linux-arm64-musl@4.3.0': + resolution: {integrity: sha512-Z6sukiQsngnWO+l39X4pPbiWT81IC+PLKF+PHxIlyZbGNb9MODfYlXEVlFvej5BOZInWX01kVyzeLvHsXhfczQ==} + engines: {node: '>= 20'} + cpu: [arm64] + os: [linux] + '@tailwindcss/oxide-linux-x64-gnu@4.1.18': resolution: {integrity: sha512-v3gyT0ivkfBLoZGF9LyHmts0Isc8jHZyVcbzio6Wpzifg/+5ZJpDiRiUhDLkcr7f/r38SWNe7ucxmGW3j3Kb/g==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + '@tailwindcss/oxide-linux-x64-gnu@4.3.0': + resolution: {integrity: sha512-DRNdQRpSGzRGfARVuVkxvM8Q12nh19l4BF/G7zGA1oe+9wcC6saFBHTISrpIcKzhiXtSrlSrluCfvMuledoCTQ==} + engines: {node: '>= 20'} + cpu: [x64] + os: [linux] + '@tailwindcss/oxide-linux-x64-musl@4.1.18': resolution: {integrity: sha512-bhJ2y2OQNlcRwwgOAGMY0xTFStt4/wyU6pvI6LSuZpRgKQwxTec0/3Scu91O8ir7qCR3AuepQKLU/kX99FouqQ==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + '@tailwindcss/oxide-linux-x64-musl@4.3.0': + resolution: {integrity: sha512-Z0IADbDo8bh6I7h2IQMx601AdXBLfFpEdUotft86evd/8ZPflZe9COPO8Q1vw+pfLWIUo9zN/JGZvwuAJqduqg==} + engines: {node: '>= 20'} + cpu: [x64] + os: [linux] + '@tailwindcss/oxide-wasm32-wasi@4.1.18': resolution: {integrity: sha512-LffYTvPjODiP6PT16oNeUQJzNVyJl1cjIebq/rWWBF+3eDst5JGEFSc5cWxyRCJ0Mxl+KyIkqRxk1XPEs9x8TA==} engines: {node: '>=14.0.0'} @@ -1868,22 +2098,50 @@ packages: - '@emnapi/wasi-threads' - tslib + '@tailwindcss/oxide-wasm32-wasi@4.3.0': + resolution: {integrity: sha512-HNZGOUxEmElksYR7S6sC5jTeNGpobAsy9u7Gu0AskJ8/20FR9GqebUyB+HBcU/ax6BHuiuJi+Oda4B+YX6H1yA==} + engines: {node: '>=14.0.0'} + cpu: [wasm32] + bundledDependencies: + - '@napi-rs/wasm-runtime' + - '@emnapi/core' + - '@emnapi/runtime' + - '@tybys/wasm-util' + - '@emnapi/wasi-threads' + - tslib + '@tailwindcss/oxide-win32-arm64-msvc@4.1.18': resolution: {integrity: sha512-HjSA7mr9HmC8fu6bdsZvZ+dhjyGCLdotjVOgLA2vEqxEBZaQo9YTX4kwgEvPCpRh8o4uWc4J/wEoFzhEmjvPbA==} engines: {node: '>= 10'} cpu: [arm64] os: [win32] + '@tailwindcss/oxide-win32-arm64-msvc@4.3.0': + resolution: {integrity: sha512-Pe+RPVTi1T+qymuuRpcdvwSVZjnll/f7n8gBxMMh3xLTctMDKqpdfGimbMyioqtLhUYZxdJ9wGNhV7MKHvgZsQ==} + engines: {node: '>= 20'} + cpu: [arm64] + os: [win32] + '@tailwindcss/oxide-win32-x64-msvc@4.1.18': resolution: {integrity: sha512-bJWbyYpUlqamC8dpR7pfjA0I7vdF6t5VpUGMWRkXVE3AXgIZjYUYAK7II1GNaxR8J1SSrSrppRar8G++JekE3Q==} engines: {node: '>= 10'} cpu: [x64] os: [win32] + '@tailwindcss/oxide-win32-x64-msvc@4.3.0': + resolution: {integrity: sha512-Mvrf2kXW/yeW/OTezZlCGOirXRcUuLIBx/5Y12BaPM7wJoryG6dfS/NJL8aBPqtTEx/Vm4T4vKzFUcKDT+TKUA==} + engines: {node: '>= 20'} + cpu: [x64] + os: [win32] + '@tailwindcss/oxide@4.1.18': resolution: {integrity: sha512-EgCR5tTS5bUSKQgzeMClT6iCY3ToqE1y+ZB0AKldj809QXk1Y+3jB0upOYZrn9aGIzPtUsP7sX4QQ4XtjBB95A==} engines: {node: '>= 10'} + '@tailwindcss/oxide@4.3.0': + resolution: {integrity: sha512-F7HZGBeN9I0/AuuJS5PwcD8xayx5ri5GhjYUDBEVYUkexyA/giwbDNjRVrxSezE3T250OU2K/wp/ltWx3UOefg==} + engines: {node: '>= 20'} + '@tailwindcss/postcss@4.1.18': resolution: {integrity: sha512-Ce0GFnzAOuPyfV5SxjXGn0CubwGcuDB0zcdaPuCSzAa/2vII24JTkH+I6jcbXLb1ctjZMZZI6OjDaLPJQL1S0g==} @@ -1892,6 +2150,11 @@ packages: peerDependencies: vite: ^5.2.0 || ^6 || ^7 + '@tailwindcss/vite@4.3.0': + resolution: {integrity: sha512-t6J3OrB5Fc0ExuhohouH0fWUGMYL6PTLhW+E7zIk/pdbnJARZDCwjBznFnkh5ynRnIRSI4YjtTH0t6USjJISrw==} + peerDependencies: + vite: ^5.2.0 || ^6 || ^7 || ^8 + '@tanstack/react-virtual@3.13.18': resolution: {integrity: sha512-dZkhyfahpvlaV0rIKnvQiVoWPyURppl6w4m9IwMDpuIjcJ1sD9YGWrt0wISvgU7ewACXx2Ct46WPgI6qAD4v6A==} peerDependencies: @@ -1991,6 +2254,12 @@ packages: '@types/responselike@1.0.3': resolution: {integrity: sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==} + '@types/set-cookie-parser@2.4.10': + resolution: {integrity: sha512-GGmQVGpQWUe5qglJozEjZV/5dyxbOOZ0LHe/lqyWssB88Y4svNfst0uqBVscdDeIKl5Jy5+aPSvy7mI9tYRguw==} + + '@types/statuses@2.0.6': + resolution: {integrity: sha512-xMAgYwceFhRA2zY+XbEA7mxYbA093wdiW8Vu6gZPGWy9cmOyU9XesH1tNcEWsKFd5Vzrqx5T3D38PWx1FIIXkA==} + '@types/through@0.0.33': resolution: {integrity: sha512-HsJ+z3QuETzP3cswwtzt2vEIiHBk/dCcHGhbmG5X3ecnwFD/lPrMpliGXxSCg03L9AhrdwA4Oz/qfspkDW+xGQ==} @@ -2109,6 +2378,7 @@ packages: '@xmldom/xmldom@0.8.11': resolution: {integrity: sha512-cQzWCtO6C8TQiYl1ruKNn2U6Ao4o4WBBcbL61yJl84x+j5sOWWFU9X7DpND8XZG3daDppSsigMdfAIl2upQBRw==} engines: {node: '>=10.0.0'} + deprecated: this version has critical issues, please update to the latest version abbrev@3.0.1: resolution: {integrity: sha512-AO2ac6pjRB3SJmGJo+v5/aK6Omggp6fsLrs6wN9bd35ulu4cCwaAU9+7ZhXjeqHVkaHThLuzH0nZr0YpCDhygg==} @@ -2156,6 +2426,9 @@ packages: ajv@6.12.6: resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} + ajv@6.15.0: + resolution: {integrity: sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==} + ajv@8.17.1: resolution: {integrity: sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==} @@ -2325,6 +2598,7 @@ packages: basic-ftp@5.1.0: resolution: {integrity: sha512-RkaJzeJKDbaDWTIPiJwubyljaEPwpVWkm9Rt5h9Nd6h7tEXTJ3VB4qxdZBioV7JO5yLUaOKwz7vDOzlncUsegw==} engines: {node: '>=10.0.0'} + deprecated: Security vulnerability fixed in 5.2.1, please upgrade bl@4.1.0: resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} @@ -2489,6 +2763,10 @@ packages: resolution: {integrity: sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==} engines: {node: '>= 10'} + cli-width@4.1.0: + resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} + engines: {node: '>= 12'} + cliui@8.0.1: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} engines: {node: '>=12'} @@ -2775,6 +3053,10 @@ packages: resolution: {integrity: sha512-phv3E1Xl4tQOShqSte26C7Fl84EwUdZsyOuSSk9qtAGyyQs2s3jJzComh+Abf4g187lUUAvH+H26omrqia2aGg==} engines: {node: '>=10.13.0'} + enhanced-resolve@5.21.3: + resolution: {integrity: sha512-QyL119InA+XXEkNLNTPCXPugSvOfhwv0JOlGNzvxs0hZaiHLNvXSpudUWsOlsXGWJh8G6ckCScEkVHfX3kw/2Q==} + engines: {node: '>=10.13.0'} + entities@2.2.0: resolution: {integrity: sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==} @@ -2904,6 +3186,16 @@ packages: jiti: optional: true + eslint@9.39.4: + resolution: {integrity: sha512-XoMjdBOwe/esVgEvLmNsD3IRHkm7fbKIUGvrleloJXUZgDHig2IPWNniv+GwjyJXzuNqVjlr5+4yVUZjycJwfQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + hasBin: true + peerDependencies: + jiti: '*' + peerDependenciesMeta: + jiti: + optional: true + espree@10.4.0: resolution: {integrity: sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -2973,9 +3265,18 @@ packages: fast-levenshtein@2.0.6: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} + fast-string-truncated-width@3.0.3: + resolution: {integrity: sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g==} + + fast-string-width@3.0.2: + resolution: {integrity: sha512-gX8LrtNEI5hq8DVUfRQMbr5lpaS4nMIWV+7XEbXk2b8kiQIizgnlr12B4dA3ZEx3308ze0O4Q1R+cHts8kyUJg==} + fast-uri@3.1.0: resolution: {integrity: sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==} + fast-wrap-ansi@0.2.0: + resolution: {integrity: sha512-rLV8JHxTyhVmFYhBJuMujcrHqOT2cnO5Zxj37qROj23CP39GXubJRBUFF0z8KFK77Uc0SukZUf7JZhsVEQ6n8w==} + fastq@1.20.1: resolution: {integrity: sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==} @@ -3171,6 +3472,10 @@ packages: resolution: {integrity: sha512-+xDOYR2fMa4QHGysTgyQsl8g16mcAKqvvsKI014qYP2XVf1SWUPlD8KhdBJPUM8AVwDUB+ls0NFkqRzAB5URkA==} engines: {node: '>=10'} + graphql@16.14.0: + resolution: {integrity: sha512-BBvQ/406p+4CZbTpCbVPSxfzrZrbnuWSP1ELYgyS6B+hNeKzgrdB4JczCa5VZUBQrDa9hUngm0KnexY6pJRN5Q==} + engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0} + handlebars@4.7.8: resolution: {integrity: sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==} engines: {node: '>=0.4.7'} @@ -3210,6 +3515,9 @@ packages: header-case@1.0.1: resolution: {integrity: sha512-i0q9mkOeSuhXw6bGgiQCCBgY/jlZuV/7dZXyZ9c6LcBrqwvT8eT719E9uxE5LiZftdl+z81Ugbg/VvXV4OJOeQ==} + headers-polyfill@5.0.1: + resolution: {integrity: sha512-1TJ6Fih/b8h5TIcv+1+Hw0PDQWJTKDKzFZzcKOiW1wJza3XoAQlkCuXLbymPYB8+ZQyw8mHvdw560e8zVFIWyA==} + hermes-estree@0.25.1: resolution: {integrity: sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw==} @@ -3390,6 +3698,9 @@ packages: resolution: {integrity: sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==} engines: {node: '>= 0.4'} + is-node-process@1.2.0: + resolution: {integrity: sha512-Vg4o6/fqPxIjtxgUH5QLJhwZ7gW5diGCVlXpuUfELC62CuxM1iHcRe51f2W1FDy04Ai4KJkagKjx3XaqyfRKXw==} + is-number-object@1.1.1: resolution: {integrity: sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==} engines: {node: '>= 0.4'} @@ -3570,70 +3881,140 @@ packages: cpu: [arm64] os: [android] + lightningcss-android-arm64@1.32.0: + resolution: {integrity: sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [android] + lightningcss-darwin-arm64@1.30.2: resolution: {integrity: sha512-ylTcDJBN3Hp21TdhRT5zBOIi73P6/W0qwvlFEk22fkdXchtNTOU4Qc37SkzV+EKYxLouZ6M4LG9NfZ1qkhhBWA==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [darwin] + lightningcss-darwin-arm64@1.32.0: + resolution: {integrity: sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [darwin] + lightningcss-darwin-x64@1.30.2: resolution: {integrity: sha512-oBZgKchomuDYxr7ilwLcyms6BCyLn0z8J0+ZZmfpjwg9fRVZIR5/GMXd7r9RH94iDhld3UmSjBM6nXWM2TfZTQ==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [darwin] + lightningcss-darwin-x64@1.32.0: + resolution: {integrity: sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [darwin] + lightningcss-freebsd-x64@1.30.2: resolution: {integrity: sha512-c2bH6xTrf4BDpK8MoGG4Bd6zAMZDAXS569UxCAGcA7IKbHNMlhGQ89eRmvpIUGfKWNVdbhSbkQaWhEoMGmGslA==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [freebsd] + lightningcss-freebsd-x64@1.32.0: + resolution: {integrity: sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [freebsd] + lightningcss-linux-arm-gnueabihf@1.30.2: resolution: {integrity: sha512-eVdpxh4wYcm0PofJIZVuYuLiqBIakQ9uFZmipf6LF/HRj5Bgm0eb3qL/mr1smyXIS1twwOxNWndd8z0E374hiA==} engines: {node: '>= 12.0.0'} cpu: [arm] os: [linux] + lightningcss-linux-arm-gnueabihf@1.32.0: + resolution: {integrity: sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==} + engines: {node: '>= 12.0.0'} + cpu: [arm] + os: [linux] + lightningcss-linux-arm64-gnu@1.30.2: resolution: {integrity: sha512-UK65WJAbwIJbiBFXpxrbTNArtfuznvxAJw4Q2ZGlU8kPeDIWEX1dg3rn2veBVUylA2Ezg89ktszWbaQnxD/e3A==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] + lightningcss-linux-arm64-gnu@1.32.0: + resolution: {integrity: sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + lightningcss-linux-arm64-musl@1.30.2: resolution: {integrity: sha512-5Vh9dGeblpTxWHpOx8iauV02popZDsCYMPIgiuw97OJ5uaDsL86cnqSFs5LZkG3ghHoX5isLgWzMs+eD1YzrnA==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] + lightningcss-linux-arm64-musl@1.32.0: + resolution: {integrity: sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + lightningcss-linux-x64-gnu@1.30.2: resolution: {integrity: sha512-Cfd46gdmj1vQ+lR6VRTTadNHu6ALuw2pKR9lYq4FnhvgBc4zWY1EtZcAc6EffShbb1MFrIPfLDXD6Xprbnni4w==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] + lightningcss-linux-x64-gnu@1.32.0: + resolution: {integrity: sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + lightningcss-linux-x64-musl@1.30.2: resolution: {integrity: sha512-XJaLUUFXb6/QG2lGIW6aIk6jKdtjtcffUT0NKvIqhSBY3hh9Ch+1LCeH80dR9q9LBjG3ewbDjnumefsLsP6aiA==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] + lightningcss-linux-x64-musl@1.32.0: + resolution: {integrity: sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + lightningcss-win32-arm64-msvc@1.30.2: resolution: {integrity: sha512-FZn+vaj7zLv//D/192WFFVA0RgHawIcHqLX9xuWiQt7P0PtdFEVaxgF9rjM/IRYHQXNnk61/H/gb2Ei+kUQ4xQ==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [win32] + lightningcss-win32-arm64-msvc@1.32.0: + resolution: {integrity: sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [win32] + lightningcss-win32-x64-msvc@1.30.2: resolution: {integrity: sha512-5g1yc73p+iAkid5phb4oVFMB45417DkRevRbt/El/gKXJk4jid+vPFF/AXbxn05Aky8PapwzZrdJShv5C0avjw==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [win32] + lightningcss-win32-x64-msvc@1.32.0: + resolution: {integrity: sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [win32] + lightningcss@1.30.2: resolution: {integrity: sha512-utfs7Pr5uJyyvDETitgsaqSyjCb2qNRAtuqUeWIAKztsOYdcACf2KtARYXg2pSvhkt+9NfoaNY7fxjl6nuMjIQ==} engines: {node: '>= 12.0.0'} + lightningcss@1.32.0: + resolution: {integrity: sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==} + engines: {node: '>= 12.0.0'} + locate-path@6.0.0: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} @@ -3783,6 +4164,9 @@ packages: minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + minimatch@3.1.5: + resolution: {integrity: sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==} + minimatch@5.1.6: resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} engines: {node: '>=10'} @@ -3850,9 +4234,23 @@ packages: ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + msw@2.14.6: + resolution: {integrity: sha512-ALe+N10S72cyx94cMcy3Zs4HhXCj35sgeAL4c+WTvKi0zWnbd8/h0lcFqv0mb2P+aSgAdD7p9HzvA0DiUPxsyg==} + engines: {node: '>=18'} + hasBin: true + peerDependencies: + typescript: '>= 4.8.x' + peerDependenciesMeta: + typescript: + optional: true + mute-stream@0.0.8: resolution: {integrity: sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==} + mute-stream@3.0.0: + resolution: {integrity: sha512-dkEJPVvun4FryqBmZ5KhDo0K9iDXAwn08tMLDinNdRBNPcYEDiWYysLcc6k3mjTMlbP9KyylvRpd4wFtwrT9rw==} + engines: {node: ^20.17.0 || >=22.9.0} + nanoid@3.3.11: resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} @@ -3974,6 +4372,9 @@ packages: resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} engines: {node: '>=0.10.0'} + outvariant@1.4.3: + resolution: {integrity: sha512-+Sl2UErvtsoajRDKCE5/dBz4DIvHXQQnAxtQTF04OJxY0+DyZXSo5P5Bb7XYWOh81syohlYL24hbDwxedPUJCA==} + own-keys@1.0.1: resolution: {integrity: sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==} engines: {node: '>= 0.4'} @@ -4041,6 +4442,9 @@ packages: resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} engines: {node: '>=16 || 14 >=14.18'} + path-to-regexp@6.3.0: + resolution: {integrity: sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==} + path-type@4.0.0: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} @@ -4347,6 +4751,9 @@ packages: resolution: {integrity: sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==} engines: {node: '>= 4'} + rettime@0.11.11: + resolution: {integrity: sha512-ILJRqVWBCTlg9r42fFgwVZx1gnFAcQF8mRoMkbgQfIrjEDf9nbBFDFx00oloOa+Q869FUtaYDXZvEfnecQSCoQ==} + reusify@1.1.0: resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} @@ -4441,6 +4848,9 @@ packages: set-cookie-parser@2.7.2: resolution: {integrity: sha512-oeM1lpU/UvhTxw+g3cIfxXHyJRc/uidd3yK1P242gzHds0udQBYzs3y8j4gCCW+ZJ7ad0yctld8RYO+bdurlvw==} + set-cookie-parser@3.1.0: + resolution: {integrity: sha512-kjnC1DXBHcxaOaOXBHBeRtltsDG2nUiUni+jP92M9gYdW12rsmx92UsfpH7o5tDRs7I1ZZPSQJQGv3UaRfCiuw==} + set-function-length@1.2.2: resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} engines: {node: '>= 0.4'} @@ -4539,6 +4949,10 @@ packages: resolution: {integrity: sha512-jH9EhtKIjuXZ2cWxmXS8ZP80XyC3iasQxMDV8jzhNJpfDb7VbQLVW4Wvsxz9QZvzV+G4YoSfBUVKDOyxLzi/sg==} engines: {node: '>= 6'} + statuses@2.0.2: + resolution: {integrity: sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==} + engines: {node: '>= 0.8'} + std-env@3.10.0: resolution: {integrity: sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==} @@ -4546,6 +4960,9 @@ packages: resolution: {integrity: sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==} engines: {node: '>= 0.4'} + strict-event-emitter@0.5.1: + resolution: {integrity: sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ==} + string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} @@ -4637,10 +5054,17 @@ packages: tailwindcss@4.1.18: resolution: {integrity: sha512-4+Z+0yiYyEtUVCScyfHCxOYP06L5Ne+JiHhY2IjR2KWMIWhJOYZKLSGZaP5HkZ8+bY0cxfzwDE5uOmzFXyIwxw==} + tailwindcss@4.3.0: + resolution: {integrity: sha512-y6nxMGB1nMW9R6k96e5gdIFzcfL/gTJRNaqGes1YvkLnPVXzWgbqFF2yLC0T8G774n24cx3Pe8XrKoniCOAH+Q==} + tapable@2.3.0: resolution: {integrity: sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==} engines: {node: '>=6'} + tapable@2.3.3: + resolution: {integrity: sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==} + engines: {node: '>=6'} + tar-stream@2.2.0: resolution: {integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==} engines: {node: '>=6'} @@ -4691,6 +5115,13 @@ packages: title-case@2.1.1: resolution: {integrity: sha512-EkJoZ2O3zdCz3zJsYCsxyq2OC5hrxR9mfdd5I+w8h/tmFfeOxJ+vvkxsKxdmN0WtS9zLdHEgfgVOiMVgv+Po4Q==} + tldts-core@7.0.30: + resolution: {integrity: sha512-uiHN8PIB1VmWyS98eZYja4xzlYqeFZVjb4OuYlJQnZAuJhMw4PbKQOKgHKhBdJR3FE/t5mUQ1Kd80++B+qhD1Q==} + + tldts@7.0.30: + resolution: {integrity: sha512-ELrFxuqsDdHUwoh0XxDbxuLD3Wnz49Z57IFvTtvWy1hJdcMZjXLIuonjilCiWHlT2GbE4Wlv1wKVTzDFnXH1aw==} + hasBin: true + tmp-promise@3.0.3: resolution: {integrity: sha512-RwM7MoPojPxsOBYnyd2hy0bxtIlVrihNs9pj5SUvY8Zz1sQcQG2tG1hSr8PDxfgEB8RNKDhqbIlroIarSNDNsQ==} @@ -4706,6 +5137,10 @@ packages: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} + tough-cookie@6.0.1: + resolution: {integrity: sha512-LktZQb3IeoUWB9lqR5EWTHgW/VTITCXg4D21M+lvybRVdylLrRMnqaIONLVb5mav8vM19m44HIcGq4qASeu2Qw==} + engines: {node: '>=16'} + truncate-utf8-bytes@1.0.2: resolution: {integrity: sha512-95Pu1QXQvruGEhv62XCMO3Mm90GscOCClvrIUwCM0PYOXK3kaF3l3sIHxx71ThJfcbM2O5Au6SO3AWCSEfW4mQ==} @@ -4788,6 +5223,10 @@ packages: resolution: {integrity: sha512-AXSAQJu79WGc79/3e9/CR77I/KQgeY1AhNvcShIH4PTcGYyC4xv6H4R4AUOwkPS5799KlVDAu8zExeCrkGquiA==} engines: {node: '>=20'} + type-fest@5.6.0: + resolution: {integrity: sha512-8ZiHFm91orbSAe2PSAiSVBVko18pbhbiB3U9GglSzF/zCGkR+rxpHx6sEMCUm4kxY4LjDIUGgCfUMtwfZfjfUA==} + engines: {node: '>=20'} + typed-array-buffer@1.0.3: resolution: {integrity: sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==} engines: {node: '>= 0.4'} @@ -4816,6 +5255,11 @@ packages: engines: {node: '>=14.17'} hasBin: true + typescript@6.0.3: + resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==} + engines: {node: '>=14.17'} + hasBin: true + uglify-js@3.19.3: resolution: {integrity: sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==} engines: {node: '>=0.8.0'} @@ -4848,6 +5292,9 @@ packages: resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==} engines: {node: '>= 10.0.0'} + until-async@3.0.2: + resolution: {integrity: sha512-IiSk4HlzAMqTUseHHe3VhIGyuFmN90zMTpD3Z3y8jeQbzLIq500MVM7Jq2vUAnTKAFPJrqwkzr6PoTcPhGcOiw==} + update-browserslist-db@1.2.3: resolution: {integrity: sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==} hasBin: true @@ -5387,7 +5834,7 @@ snapshots: debug: 4.4.3 dir-compare: 3.3.0 fs-extra: 9.1.0 - minimatch: 3.1.2 + minimatch: 3.1.5 plist: 3.1.0 transitivePeerDependencies: - supports-color @@ -5487,6 +5934,11 @@ snapshots: eslint: 9.39.2(jiti@2.6.1) eslint-visitor-keys: 3.4.3 + '@eslint-community/eslint-utils@4.9.1(eslint@9.39.4(jiti@2.6.1))': + dependencies: + eslint: 9.39.4(jiti@2.6.1) + eslint-visitor-keys: 3.4.3 + '@eslint-community/regexpp@4.12.2': {} '@eslint/config-array@0.21.1': @@ -5497,6 +5949,14 @@ snapshots: transitivePeerDependencies: - supports-color + '@eslint/config-array@0.21.2': + dependencies: + '@eslint/object-schema': 2.1.7 + debug: 4.4.3 + minimatch: 3.1.5 + transitivePeerDependencies: + - supports-color + '@eslint/config-helpers@0.4.2': dependencies: '@eslint/core': 0.17.0 @@ -5519,8 +5979,24 @@ snapshots: transitivePeerDependencies: - supports-color + '@eslint/eslintrc@3.3.5': + dependencies: + ajv: 6.15.0 + debug: 4.4.3 + espree: 10.4.0 + globals: 14.0.0 + ignore: 5.3.2 + import-fresh: 3.3.1 + js-yaml: 4.1.1 + minimatch: 3.1.5 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - supports-color + '@eslint/js@9.39.2': {} + '@eslint/js@9.39.4': {} + '@eslint/object-schema@2.1.7': {} '@eslint/plugin-kit@0.4.1': @@ -5569,9 +6045,33 @@ snapshots: '@humanwhocodes/module-importer@1.0.1': {} - '@humanwhocodes/retry@0.4.3': {} + '@humanwhocodes/retry@0.4.3': {} + + '@iarna/toml@2.2.5': {} + + '@inquirer/ansi@2.0.5': + optional: true + + '@inquirer/confirm@6.0.13(@types/node@25.2.0)': + dependencies: + '@inquirer/core': 11.1.10(@types/node@25.2.0) + '@inquirer/type': 4.0.5(@types/node@25.2.0) + optionalDependencies: + '@types/node': 25.2.0 + optional: true - '@iarna/toml@2.2.5': {} + '@inquirer/core@11.1.10(@types/node@25.2.0)': + dependencies: + '@inquirer/ansi': 2.0.5 + '@inquirer/figures': 2.0.5 + '@inquirer/type': 4.0.5(@types/node@25.2.0) + cli-width: 4.1.0 + fast-wrap-ansi: 0.2.0 + mute-stream: 3.0.0 + signal-exit: 4.1.0 + optionalDependencies: + '@types/node': 25.2.0 + optional: true '@inquirer/external-editor@1.0.3(@types/node@25.2.0)': dependencies: @@ -5580,6 +6080,14 @@ snapshots: optionalDependencies: '@types/node': 25.2.0 + '@inquirer/figures@2.0.5': + optional: true + + '@inquirer/type@4.0.5(@types/node@25.2.0)': + optionalDependencies: + '@types/node': 25.2.0 + optional: true + '@isaacs/balanced-match@4.0.1': {} '@isaacs/brace-expansion@5.0.1': @@ -5642,6 +6150,16 @@ snapshots: '@maximka76667/icons-master@1.0.3': {} + '@mswjs/interceptors@0.41.9': + dependencies: + '@open-draft/deferred-promise': 2.2.0 + '@open-draft/logger': 0.3.0 + '@open-draft/until': 2.1.0 + is-node-process: 1.2.0 + outvariant: 1.4.3 + strict-event-emitter: 0.5.1 + optional: true + '@nodelib/fs.scandir@2.1.5': dependencies: '@nodelib/fs.stat': 2.0.5 @@ -5668,6 +6186,21 @@ snapshots: dependencies: semver: 7.7.3 + '@open-draft/deferred-promise@2.2.0': + optional: true + + '@open-draft/deferred-promise@3.0.0': + optional: true + + '@open-draft/logger@0.3.0': + dependencies: + is-node-process: 1.2.0 + outvariant: 1.4.3 + optional: true + + '@open-draft/until@2.1.0': + optional: true + '@pkgjs/parseargs@0.11.0': optional: true @@ -6603,42 +7136,88 @@ snapshots: source-map-js: 1.2.1 tailwindcss: 4.1.18 + '@tailwindcss/node@4.3.0': + dependencies: + '@jridgewell/remapping': 2.3.5 + enhanced-resolve: 5.21.3 + jiti: 2.6.1 + lightningcss: 1.32.0 + magic-string: 0.30.21 + source-map-js: 1.2.1 + tailwindcss: 4.3.0 + '@tailwindcss/oxide-android-arm64@4.1.18': optional: true + '@tailwindcss/oxide-android-arm64@4.3.0': + optional: true + '@tailwindcss/oxide-darwin-arm64@4.1.18': optional: true + '@tailwindcss/oxide-darwin-arm64@4.3.0': + optional: true + '@tailwindcss/oxide-darwin-x64@4.1.18': optional: true + '@tailwindcss/oxide-darwin-x64@4.3.0': + optional: true + '@tailwindcss/oxide-freebsd-x64@4.1.18': optional: true + '@tailwindcss/oxide-freebsd-x64@4.3.0': + optional: true + '@tailwindcss/oxide-linux-arm-gnueabihf@4.1.18': optional: true + '@tailwindcss/oxide-linux-arm-gnueabihf@4.3.0': + optional: true + '@tailwindcss/oxide-linux-arm64-gnu@4.1.18': optional: true + '@tailwindcss/oxide-linux-arm64-gnu@4.3.0': + optional: true + '@tailwindcss/oxide-linux-arm64-musl@4.1.18': optional: true + '@tailwindcss/oxide-linux-arm64-musl@4.3.0': + optional: true + '@tailwindcss/oxide-linux-x64-gnu@4.1.18': optional: true + '@tailwindcss/oxide-linux-x64-gnu@4.3.0': + optional: true + '@tailwindcss/oxide-linux-x64-musl@4.1.18': optional: true + '@tailwindcss/oxide-linux-x64-musl@4.3.0': + optional: true + '@tailwindcss/oxide-wasm32-wasi@4.1.18': optional: true + '@tailwindcss/oxide-wasm32-wasi@4.3.0': + optional: true + '@tailwindcss/oxide-win32-arm64-msvc@4.1.18': optional: true + '@tailwindcss/oxide-win32-arm64-msvc@4.3.0': + optional: true + '@tailwindcss/oxide-win32-x64-msvc@4.1.18': optional: true + '@tailwindcss/oxide-win32-x64-msvc@4.3.0': + optional: true + '@tailwindcss/oxide@4.1.18': optionalDependencies: '@tailwindcss/oxide-android-arm64': 4.1.18 @@ -6654,6 +7233,21 @@ snapshots: '@tailwindcss/oxide-win32-arm64-msvc': 4.1.18 '@tailwindcss/oxide-win32-x64-msvc': 4.1.18 + '@tailwindcss/oxide@4.3.0': + optionalDependencies: + '@tailwindcss/oxide-android-arm64': 4.3.0 + '@tailwindcss/oxide-darwin-arm64': 4.3.0 + '@tailwindcss/oxide-darwin-x64': 4.3.0 + '@tailwindcss/oxide-freebsd-x64': 4.3.0 + '@tailwindcss/oxide-linux-arm-gnueabihf': 4.3.0 + '@tailwindcss/oxide-linux-arm64-gnu': 4.3.0 + '@tailwindcss/oxide-linux-arm64-musl': 4.3.0 + '@tailwindcss/oxide-linux-x64-gnu': 4.3.0 + '@tailwindcss/oxide-linux-x64-musl': 4.3.0 + '@tailwindcss/oxide-wasm32-wasi': 4.3.0 + '@tailwindcss/oxide-win32-arm64-msvc': 4.3.0 + '@tailwindcss/oxide-win32-x64-msvc': 4.3.0 + '@tailwindcss/postcss@4.1.18': dependencies: '@alloc/quick-lru': 5.2.0 @@ -6662,12 +7256,19 @@ snapshots: postcss: 8.5.6 tailwindcss: 4.1.18 - '@tailwindcss/vite@4.1.18(vite@7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.30.2))': + '@tailwindcss/vite@4.1.18(vite@7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.32.0))': dependencies: '@tailwindcss/node': 4.1.18 '@tailwindcss/oxide': 4.1.18 tailwindcss: 4.1.18 - vite: 7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.30.2) + vite: 7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.32.0) + + '@tailwindcss/vite@4.3.0(vite@7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.32.0))': + dependencies: + '@tailwindcss/node': 4.3.0 + '@tailwindcss/oxide': 4.3.0 + tailwindcss: 4.3.0 + vite: 7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.32.0) '@tanstack/react-virtual@3.13.18(react-dom@19.2.4(react@19.2.4))(react@19.2.4)': dependencies: @@ -6771,7 +7372,7 @@ snapshots: '@types/minimatch@6.0.0': dependencies: - minimatch: 3.1.2 + minimatch: 10.1.2 '@types/ms@2.1.0': {} @@ -6801,6 +7402,14 @@ snapshots: dependencies: '@types/node': 25.2.0 + '@types/set-cookie-parser@2.4.10': + dependencies: + '@types/node': 25.2.0 + optional: true + + '@types/statuses@2.0.6': + optional: true + '@types/through@0.0.33': dependencies: '@types/node': 25.2.0 @@ -6906,15 +7515,15 @@ snapshots: '@typescript-eslint/types': 8.54.0 eslint-visitor-keys: 4.2.1 - '@vitejs/plugin-react-swc@4.2.3(vite@7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.30.2))': + '@vitejs/plugin-react-swc@4.2.3(vite@7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.32.0))': dependencies: '@rolldown/pluginutils': 1.0.0-rc.2 '@swc/core': 1.15.11 - vite: 7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.30.2) + vite: 7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.32.0) transitivePeerDependencies: - '@swc/helpers' - '@vitest/coverage-v8@4.0.18(vitest@4.0.18(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.30.2))': + '@vitest/coverage-v8@4.0.18(vitest@4.0.18(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.32.0)(msw@2.14.6(@types/node@25.2.0)(typescript@6.0.3)))': dependencies: '@bcoe/v8-coverage': 1.0.2 '@vitest/utils': 4.0.18 @@ -6926,7 +7535,7 @@ snapshots: obug: 2.1.1 std-env: 3.10.0 tinyrainbow: 3.0.3 - vitest: 4.0.18(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.30.2) + vitest: 4.0.18(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.32.0)(msw@2.14.6(@types/node@25.2.0)(typescript@6.0.3)) '@vitest/expect@4.0.18': dependencies: @@ -6937,13 +7546,23 @@ snapshots: chai: 6.2.2 tinyrainbow: 3.0.3 - '@vitest/mocker@4.0.18(vite@7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.30.2))': + '@vitest/mocker@4.0.18(msw@2.14.6(@types/node@25.2.0)(typescript@5.9.3))(vite@7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.32.0))': + dependencies: + '@vitest/spy': 4.0.18 + estree-walker: 3.0.3 + magic-string: 0.30.21 + optionalDependencies: + msw: 2.14.6(@types/node@25.2.0)(typescript@5.9.3) + vite: 7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.32.0) + + '@vitest/mocker@4.0.18(msw@2.14.6(@types/node@25.2.0)(typescript@6.0.3))(vite@7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.32.0))': dependencies: '@vitest/spy': 4.0.18 estree-walker: 3.0.3 magic-string: 0.30.21 optionalDependencies: - vite: 7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.30.2) + msw: 2.14.6(@types/node@25.2.0)(typescript@6.0.3) + vite: 7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.32.0) '@vitest/pretty-format@4.0.18': dependencies: @@ -7009,6 +7628,13 @@ snapshots: json-schema-traverse: 0.4.1 uri-js: 4.4.1 + ajv@6.15.0: + dependencies: + fast-deep-equal: 3.1.3 + fast-json-stable-stringify: 2.1.0 + json-schema-traverse: 0.4.1 + uri-js: 4.4.1 + ajv@8.17.1: dependencies: fast-deep-equal: 3.1.3 @@ -7511,6 +8137,9 @@ snapshots: cli-width@3.0.0: {} + cli-width@4.1.0: + optional: true + cliui@8.0.1: dependencies: string-width: 4.2.3 @@ -7696,11 +8325,11 @@ snapshots: dir-compare@3.3.0: dependencies: buffer-equal: 1.0.1 - minimatch: 3.1.2 + minimatch: 3.1.5 dir-compare@4.2.0: dependencies: - minimatch: 3.1.2 + minimatch: 3.1.5 p-limit: 3.1.0 dir-glob@3.0.1: @@ -7724,7 +8353,7 @@ snapshots: dependencies: '@types/plist': 3.0.5 '@types/verror': 1.10.11 - ajv: 6.12.6 + ajv: 6.15.0 crc: 3.8.0 iconv-corefoundation: 1.1.7 plist: 3.1.0 @@ -7865,6 +8494,11 @@ snapshots: graceful-fs: 4.2.11 tapable: 2.3.0 + enhanced-resolve@5.21.3: + dependencies: + graceful-fs: 4.2.11 + tapable: 2.3.3 + entities@2.2.0: {} env-paths@2.2.1: {} @@ -8121,6 +8755,47 @@ snapshots: transitivePeerDependencies: - supports-color + eslint@9.39.4(jiti@2.6.1): + dependencies: + '@eslint-community/eslint-utils': 4.9.1(eslint@9.39.4(jiti@2.6.1)) + '@eslint-community/regexpp': 4.12.2 + '@eslint/config-array': 0.21.2 + '@eslint/config-helpers': 0.4.2 + '@eslint/core': 0.17.0 + '@eslint/eslintrc': 3.3.5 + '@eslint/js': 9.39.4 + '@eslint/plugin-kit': 0.4.1 + '@humanfs/node': 0.16.7 + '@humanwhocodes/module-importer': 1.0.1 + '@humanwhocodes/retry': 0.4.3 + '@types/estree': 1.0.8 + ajv: 6.15.0 + chalk: 4.1.2 + cross-spawn: 7.0.6 + debug: 4.4.3 + escape-string-regexp: 4.0.0 + eslint-scope: 8.4.0 + eslint-visitor-keys: 4.2.1 + espree: 10.4.0 + esquery: 1.7.0 + esutils: 2.0.3 + fast-deep-equal: 3.1.3 + file-entry-cache: 8.0.0 + find-up: 5.0.0 + glob-parent: 6.0.2 + ignore: 5.3.2 + imurmurhash: 0.1.4 + is-glob: 4.0.3 + json-stable-stringify-without-jsonify: 1.0.1 + lodash.merge: 4.6.2 + minimatch: 3.1.5 + natural-compare: 1.4.0 + optionator: 0.9.4 + optionalDependencies: + jiti: 2.6.1 + transitivePeerDependencies: + - supports-color + espree@10.4.0: dependencies: acorn: 8.15.0 @@ -8202,8 +8877,21 @@ snapshots: fast-levenshtein@2.0.6: {} + fast-string-truncated-width@3.0.3: + optional: true + + fast-string-width@3.0.2: + dependencies: + fast-string-truncated-width: 3.0.3 + optional: true + fast-uri@3.1.0: {} + fast-wrap-ansi@0.2.0: + dependencies: + fast-string-width: 3.0.2 + optional: true + fastq@1.20.1: dependencies: reusify: 1.1.0 @@ -8385,7 +9073,7 @@ snapshots: fs.realpath: 1.0.0 inflight: 1.0.6 inherits: 2.0.4 - minimatch: 3.1.2 + minimatch: 3.1.5 once: 1.4.0 path-is-absolute: 1.0.1 @@ -8442,6 +9130,9 @@ snapshots: chalk: 4.1.2 tinygradient: 1.1.5 + graphql@16.14.0: + optional: true + handlebars@4.7.8: dependencies: minimist: 1.2.8 @@ -8480,6 +9171,12 @@ snapshots: no-case: 2.3.2 upper-case: 1.1.3 + headers-polyfill@5.0.1: + dependencies: + '@types/set-cookie-parser': 2.4.10 + set-cookie-parser: 3.1.0 + optional: true + hermes-estree@0.25.1: {} hermes-parser@0.25.1: @@ -8693,6 +9390,9 @@ snapshots: is-negative-zero@2.0.3: {} + is-node-process@1.2.0: + optional: true + is-number-object@1.1.1: dependencies: call-bound: 1.0.4 @@ -8859,36 +9559,69 @@ snapshots: lightningcss-android-arm64@1.30.2: optional: true + lightningcss-android-arm64@1.32.0: + optional: true + lightningcss-darwin-arm64@1.30.2: optional: true + lightningcss-darwin-arm64@1.32.0: + optional: true + lightningcss-darwin-x64@1.30.2: optional: true + lightningcss-darwin-x64@1.32.0: + optional: true + lightningcss-freebsd-x64@1.30.2: optional: true + lightningcss-freebsd-x64@1.32.0: + optional: true + lightningcss-linux-arm-gnueabihf@1.30.2: optional: true + lightningcss-linux-arm-gnueabihf@1.32.0: + optional: true + lightningcss-linux-arm64-gnu@1.30.2: optional: true + lightningcss-linux-arm64-gnu@1.32.0: + optional: true + lightningcss-linux-arm64-musl@1.30.2: optional: true + lightningcss-linux-arm64-musl@1.32.0: + optional: true + lightningcss-linux-x64-gnu@1.30.2: optional: true + lightningcss-linux-x64-gnu@1.32.0: + optional: true + lightningcss-linux-x64-musl@1.30.2: optional: true + lightningcss-linux-x64-musl@1.32.0: + optional: true + lightningcss-win32-arm64-msvc@1.30.2: optional: true + lightningcss-win32-arm64-msvc@1.32.0: + optional: true + lightningcss-win32-x64-msvc@1.30.2: optional: true + lightningcss-win32-x64-msvc@1.32.0: + optional: true + lightningcss@1.30.2: dependencies: detect-libc: 2.1.2 @@ -8905,6 +9638,22 @@ snapshots: lightningcss-win32-arm64-msvc: 1.30.2 lightningcss-win32-x64-msvc: 1.30.2 + lightningcss@1.32.0: + dependencies: + detect-libc: 2.1.2 + optionalDependencies: + lightningcss-android-arm64: 1.32.0 + lightningcss-darwin-arm64: 1.32.0 + lightningcss-darwin-x64: 1.32.0 + lightningcss-freebsd-x64: 1.32.0 + lightningcss-linux-arm-gnueabihf: 1.32.0 + lightningcss-linux-arm64-gnu: 1.32.0 + lightningcss-linux-arm64-musl: 1.32.0 + lightningcss-linux-x64-gnu: 1.32.0 + lightningcss-linux-x64-musl: 1.32.0 + lightningcss-win32-arm64-msvc: 1.32.0 + lightningcss-win32-x64-msvc: 1.32.0 + locate-path@6.0.0: dependencies: p-locate: 5.0.0 @@ -9038,6 +9787,10 @@ snapshots: dependencies: brace-expansion: 1.1.12 + minimatch@3.1.5: + dependencies: + brace-expansion: 1.1.12 + minimatch@5.1.6: dependencies: brace-expansion: 2.0.2 @@ -9101,8 +9854,63 @@ snapshots: ms@2.1.3: {} + msw@2.14.6(@types/node@25.2.0)(typescript@5.9.3): + dependencies: + '@inquirer/confirm': 6.0.13(@types/node@25.2.0) + '@mswjs/interceptors': 0.41.9 + '@open-draft/deferred-promise': 3.0.0 + '@types/statuses': 2.0.6 + cookie: 1.1.1 + graphql: 16.14.0 + headers-polyfill: 5.0.1 + is-node-process: 1.2.0 + outvariant: 1.4.3 + path-to-regexp: 6.3.0 + picocolors: 1.1.1 + rettime: 0.11.11 + statuses: 2.0.2 + strict-event-emitter: 0.5.1 + tough-cookie: 6.0.1 + type-fest: 5.6.0 + until-async: 3.0.2 + yargs: 17.7.2 + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - '@types/node' + optional: true + + msw@2.14.6(@types/node@25.2.0)(typescript@6.0.3): + dependencies: + '@inquirer/confirm': 6.0.13(@types/node@25.2.0) + '@mswjs/interceptors': 0.41.9 + '@open-draft/deferred-promise': 3.0.0 + '@types/statuses': 2.0.6 + cookie: 1.1.1 + graphql: 16.14.0 + headers-polyfill: 5.0.1 + is-node-process: 1.2.0 + outvariant: 1.4.3 + path-to-regexp: 6.3.0 + picocolors: 1.1.1 + rettime: 0.11.11 + statuses: 2.0.2 + strict-event-emitter: 0.5.1 + tough-cookie: 6.0.1 + type-fest: 5.6.0 + until-async: 3.0.2 + yargs: 17.7.2 + optionalDependencies: + typescript: 6.0.3 + transitivePeerDependencies: + - '@types/node' + optional: true + mute-stream@0.0.8: {} + mute-stream@3.0.0: + optional: true + nanoid@3.3.11: {} natural-compare@1.4.0: {} @@ -9256,6 +10064,9 @@ snapshots: os-tmpdir@1.0.2: {} + outvariant@1.4.3: + optional: true + own-keys@1.0.1: dependencies: get-intrinsic: 1.3.0 @@ -9328,6 +10139,9 @@ snapshots: lru-cache: 10.4.3 minipass: 7.1.2 + path-to-regexp@6.3.0: + optional: true + path-type@4.0.0: {} pathe@2.0.3: {} @@ -9643,6 +10457,9 @@ snapshots: retry@0.12.0: {} + rettime@0.11.11: + optional: true + reusify@1.1.0: {} rimraf@3.0.2: @@ -9760,6 +10577,9 @@ snapshots: set-cookie-parser@2.7.2: {} + set-cookie-parser@3.1.0: + optional: true + set-function-length@1.2.2: dependencies: define-data-property: 1.1.4 @@ -9874,6 +10694,9 @@ snapshots: stat-mode@1.0.0: {} + statuses@2.0.2: + optional: true + std-env@3.10.0: {} stop-iteration-iterator@1.1.0: @@ -9881,6 +10704,9 @@ snapshots: es-errors: 1.3.0 internal-slot: 1.1.0 + strict-event-emitter@0.5.1: + optional: true + string-width@4.2.3: dependencies: emoji-regex: 8.0.0 @@ -9994,8 +10820,12 @@ snapshots: tailwindcss@4.1.18: {} + tailwindcss@4.3.0: {} + tapable@2.3.0: {} + tapable@2.3.3: {} + tar-stream@2.2.0: dependencies: bl: 4.1.0 @@ -10057,6 +10887,14 @@ snapshots: no-case: 2.3.2 upper-case: 1.1.3 + tldts-core@7.0.30: + optional: true + + tldts@7.0.30: + dependencies: + tldts-core: 7.0.30 + optional: true + tmp-promise@3.0.3: dependencies: tmp: 0.2.5 @@ -10071,6 +10909,11 @@ snapshots: dependencies: is-number: 7.0.0 + tough-cookie@6.0.1: + dependencies: + tldts: 7.0.30 + optional: true + truncate-utf8-bytes@1.0.2: dependencies: utf8-byte-length: 1.0.5 @@ -10145,6 +10988,11 @@ snapshots: dependencies: tagged-tag: 1.0.0 + type-fest@5.6.0: + dependencies: + tagged-tag: 1.0.0 + optional: true + typed-array-buffer@1.0.3: dependencies: call-bound: 1.0.4 @@ -10191,6 +11039,9 @@ snapshots: typescript@5.9.3: {} + typescript@6.0.3: + optional: true + uglify-js@3.19.3: optional: true @@ -10217,6 +11068,9 @@ snapshots: universalify@2.0.1: {} + until-async@3.0.2: + optional: true + update-browserslist-db@1.2.3(browserslist@4.28.1): dependencies: browserslist: 4.28.1 @@ -10276,7 +11130,7 @@ snapshots: extsprintf: 1.4.1 optional: true - vite@7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.30.2): + vite@7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.32.0): dependencies: esbuild: 0.27.2 fdir: 6.5.0(picomatch@4.0.3) @@ -10288,12 +11142,49 @@ snapshots: '@types/node': 25.2.0 fsevents: 2.3.3 jiti: 2.6.1 - lightningcss: 1.30.2 + lightningcss: 1.32.0 + + vitest@4.0.18(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.32.0)(msw@2.14.6(@types/node@25.2.0)(typescript@5.9.3)): + dependencies: + '@vitest/expect': 4.0.18 + '@vitest/mocker': 4.0.18(msw@2.14.6(@types/node@25.2.0)(typescript@5.9.3))(vite@7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.32.0)) + '@vitest/pretty-format': 4.0.18 + '@vitest/runner': 4.0.18 + '@vitest/snapshot': 4.0.18 + '@vitest/spy': 4.0.18 + '@vitest/utils': 4.0.18 + es-module-lexer: 1.7.0 + expect-type: 1.3.0 + magic-string: 0.30.21 + obug: 2.1.1 + pathe: 2.0.3 + picomatch: 4.0.3 + std-env: 3.10.0 + tinybench: 2.9.0 + tinyexec: 1.0.2 + tinyglobby: 0.2.15 + tinyrainbow: 3.0.3 + vite: 7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.32.0) + why-is-node-running: 2.3.0 + optionalDependencies: + '@types/node': 25.2.0 + transitivePeerDependencies: + - jiti + - less + - lightningcss + - msw + - sass + - sass-embedded + - stylus + - sugarss + - terser + - tsx + - yaml - vitest@4.0.18(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.30.2): + vitest@4.0.18(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.32.0)(msw@2.14.6(@types/node@25.2.0)(typescript@6.0.3)): dependencies: '@vitest/expect': 4.0.18 - '@vitest/mocker': 4.0.18(vite@7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.30.2)) + '@vitest/mocker': 4.0.18(msw@2.14.6(@types/node@25.2.0)(typescript@6.0.3))(vite@7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.32.0)) '@vitest/pretty-format': 4.0.18 '@vitest/runner': 4.0.18 '@vitest/snapshot': 4.0.18 @@ -10310,7 +11201,7 @@ snapshots: tinyexec: 1.0.2 tinyglobby: 0.2.15 tinyrainbow: 3.0.3 - vite: 7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.30.2) + vite: 7.3.1(@types/node@25.2.0)(jiti@2.6.1)(lightningcss@1.32.0) why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 25.2.0 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index f0086a994..54221d4e8 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,10 +1,15 @@ packages: - # Frontend packages - - "frontend/frontend-kit/**" - - "frontend/testing-view" - - "frontend/competition-view" + # frontend + - frontend/frontend-kit/** + - frontend/testing-view + - frontend/competition-view + - frontend/flashing-view + # Backend packages - "backend" + - "blcu-programming" + + # Electron packages - "electron-app" - - "packet-sender" - "e2e" + diff --git a/shell.nix b/shell.nix deleted file mode 100644 index a84c7c6da..000000000 --- a/shell.nix +++ /dev/null @@ -1,200 +0,0 @@ -{ pkgs ? import {} }: - -let - # Pin nixpkgs for reproducibility - pinnedPkgs = import (builtins.fetchTarball { - url = "https://github.com/NixOS/nixpkgs/archive/nixos-23.11.tar.gz"; - sha256 = "1ndiv385w1qyb3b18vw13991fzb9wg4cl21wglk89grsfsnra41k"; - }) {}; - - # Use pinned packages by default - finalPkgs = if pkgs == import {} then pinnedPkgs else pkgs; - -in finalPkgs.mkShell { - name = "hyperloop-h10-dev"; - - buildInputs = with finalPkgs; [ - # Go development - go - gotools - gopls - delve - - # Node.js development - nodejs_20 - nodePackages.npm - nodePackages.typescript - nodePackages.typescript-language-server - - # Python for testing - python3 - - # System dependencies - libpcap - pkg-config - - # Build tools - gnumake - gcc - - # Development utilities - git - ripgrep - jq - curl - wget - tmux - - # Optional productivity tools (can be removed for minimal setup) - watchman - ]; - - shellHook = '' - # Hyperloop H10 Development Environment - - # Set up environment variables - export GOPATH="$HOME/go" - export PATH="$GOPATH/bin:$PATH" - export NODE_ENV="development" - export CGO_ENABLED=1 - - # Create command functions for running services in tmux - ethernet-view() { - # Check if backend is built - if [ ! -f "backend/cmd/backend" ]; then - echo "Building backend first..." - make backend - fi - - # Kill existing session if it exists - tmux kill-session -t ethernet-view 2>/dev/null || true - - # Create new session - tmux new-session -d -s ethernet-view -n main - - # Start backend in first pane - tmux send-keys -t ethernet-view:main "cd backend/cmd && ./backend" C-m - - # Split horizontally and start ethernet-view - tmux split-window -t ethernet-view:main -h -p 50 - tmux send-keys -t ethernet-view:main.1 "cd ethernet-view && npm run dev" C-m - - # Add status pane at bottom - tmux split-window -t ethernet-view:main.0 -v -p 20 - tmux send-keys -t ethernet-view:main.2 "echo 'Logs/Status - Press Enter for shell'; read; bash" C-m - - # Configure pane titles - tmux select-pane -t ethernet-view:main.0 -T "Backend" - tmux select-pane -t ethernet-view:main.1 -T "Ethernet View (http://localhost:5174)" - tmux select-pane -t ethernet-view:main.2 -T "Logs/Shell" - tmux set-option -t ethernet-view pane-border-status top - - echo "Starting ethernet-view session..." - echo "Backend running on configured port" - echo "Ethernet View: http://localhost:5174" - - # Attach to session - tmux attach-session -t ethernet-view - } - - control-station() { - # Check if backend is built - if [ ! -f "backend/cmd/backend" ]; then - echo "Building backend first..." - make backend - fi - - # Kill existing session if it exists - tmux kill-session -t control-station 2>/dev/null || true - - # Create new session - tmux new-session -d -s control-station -n main - - # Start backend in first pane - tmux send-keys -t control-station:main "cd backend/cmd && ./backend" C-m - - # Split horizontally and start control-station - tmux split-window -t control-station:main -h -p 50 - tmux send-keys -t control-station:main.1 "cd control-station && npm run dev" C-m - - # Add status pane at bottom - tmux split-window -t control-station:main.0 -v -p 20 - tmux send-keys -t control-station:main.2 "echo 'Logs/Status - Press Enter for shell'; read; bash" C-m - - # Configure pane titles - tmux select-pane -t control-station:main.0 -T "Backend" - tmux select-pane -t control-station:main.1 -T "Control Station (http://localhost:5173)" - tmux select-pane -t control-station:main.2 -T "Logs/Shell" - tmux set-option -t control-station pane-border-status top - - echo "Starting control-station session..." - echo "Backend running on configured port" - echo "Control Station: http://localhost:5173" - - # Attach to session - tmux attach-session -t control-station - } - - # Export functions so they're available in the shell - export -f ethernet-view - export -f control-station - - # Ensure clean terminal state - clear - - # Check if dependencies need installation - check_dependencies() { - local install_needed=false - - if [ ! -d "common-front/node_modules" ]; then - echo "⚠️ Missing common-front dependencies" - install_needed=true - fi - - if [ ! -d "control-station/node_modules" ]; then - echo "⚠️ Missing control-station dependencies" - install_needed=true - fi - - if [ ! -d "ethernet-view/node_modules" ]; then - echo "⚠️ Missing ethernet-view dependencies" - install_needed=true - fi - - if [ "$install_needed" = true ]; then - echo "" - echo "Run 'make install' to install all dependencies" - fi - } - - # Display environment info - echo "Hyperloop H10 Development Environment" - echo "=====================================" - echo "" - echo "Environment:" - echo " Go version: $(go version | cut -d' ' -f3)" - echo " Node version: $(node --version)" - echo " NPM version: $(npm --version)" - echo "" - echo "Quick Start:" - echo " make install - Install all dependencies" - echo " make all - Build all components" - echo " ethernet-view - Run backend + Ethernet view in tmux" - echo " control-station - Run backend + Control station in tmux" - echo "" - echo "Individual Commands:" - echo " make backend - Build backend" - echo " make common-front - Build common frontend library" - echo " make control-station - Build control station" - echo " make ethernet-view - Build ethernet view" - echo "" - - check_dependencies - ''; - - # Prevent impurities - pure = true; - - # Additional environment variables for pure builds - NIX_ENFORCE_PURITY = 1; -} \ No newline at end of file diff --git a/turbo.json b/turbo.json index a179c9fc5..62ca67262 100644 --- a/turbo.json +++ b/turbo.json @@ -6,6 +6,10 @@ "dependsOn": ["^build"], "outputs": ["dist/**", "bin/**", "target/release/**"] }, + "blcu-programming#build": { + "dependsOn": [], + "outputs": ["../electron-app/binaries/blcu-programming-*"] + }, "dev": { "cache": false, "persistent": true,