From 98ba71bd15ea480ba0a032c97d9266a620466491 Mon Sep 17 00:00:00 2001 From: Royal <88779808+royalpriest@users.noreply.github.com> Date: Fri, 20 Nov 2026 23:55:06 +0000 Subject: [PATCH 1/2] Add React play screen with a live system map The frontend (Vite + React + TypeScript) has a chapter picker and a play screen: a map of the shop's system where the part in trouble glows, a step card with hints, a memory or disk gauge with alerts, and an xterm.js terminal with a logs tab. Time ticks every 4 seconds so incidents evolve while the player reads. Phones get one section at a time from a bottom dock. The API now returns the map, recent logs and the current hint. The Monitoring chapter starts with the leak already under way so the alert fires within a minute. CI also lints and builds the frontend. --- .github/workflows/ci.yml | 27 +- CLAUDE.md | 6 +- README.md | 17 +- .../controllers/api/scenarios_controller.rb | 2 +- backend/app/presenters/run_presenter.rb | 9 +- backend/lib/sim/scenario.rb | 6 +- backend/lib/sim/scenarios/linux_disk_full.rb | 1 + .../sim/scenarios/monitoring_memory_leak.rb | 7 +- backend/lib/sim/shop_world.rb | 48 + .../lib/sim/monitoring_memory_leak_test.rb | 2 +- backend/test/lib/sim/shop_map_test.rb | 34 + frontend/.gitignore | 24 + frontend/.oxlintrc.json | 8 + frontend/index.html | 17 + frontend/package-lock.json | 1783 +++++++++++++++++ frontend/package.json | 29 + frontend/public/favicon.svg | 1 + frontend/src/App.tsx | 67 + frontend/src/api.ts | 33 + frontend/src/components/ChapterPicker.tsx | 52 + frontend/src/components/MetricChart.tsx | 36 + frontend/src/components/PlayScreen.tsx | 197 ++ frontend/src/components/SystemMap.tsx | 66 + frontend/src/components/Terminal.tsx | 158 ++ frontend/src/components/icons.tsx | 22 + frontend/src/main.tsx | 10 + frontend/src/styles.css | 224 +++ frontend/src/types.ts | 64 + frontend/tsconfig.app.json | 26 + frontend/tsconfig.json | 7 + frontend/tsconfig.node.json | 23 + frontend/vite.config.ts | 13 + 32 files changed, 3004 insertions(+), 15 deletions(-) create mode 100644 backend/test/lib/sim/shop_map_test.rb create mode 100644 frontend/.gitignore create mode 100644 frontend/.oxlintrc.json create mode 100644 frontend/index.html create mode 100644 frontend/package-lock.json create mode 100644 frontend/package.json create mode 100644 frontend/public/favicon.svg create mode 100644 frontend/src/App.tsx create mode 100644 frontend/src/api.ts create mode 100644 frontend/src/components/ChapterPicker.tsx create mode 100644 frontend/src/components/MetricChart.tsx create mode 100644 frontend/src/components/PlayScreen.tsx create mode 100644 frontend/src/components/SystemMap.tsx create mode 100644 frontend/src/components/Terminal.tsx create mode 100644 frontend/src/components/icons.tsx create mode 100644 frontend/src/main.tsx create mode 100644 frontend/src/styles.css create mode 100644 frontend/src/types.ts create mode 100644 frontend/tsconfig.app.json create mode 100644 frontend/tsconfig.json create mode 100644 frontend/tsconfig.node.json create mode 100644 frontend/vite.config.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f21ff86..d337415 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,13 +5,12 @@ on: push: branches: [ main ] -defaults: - run: - working-directory: backend - jobs: backend: runs-on: ubuntu-latest + defaults: + run: + working-directory: backend steps: - uses: actions/checkout@v6 @@ -33,3 +32,23 @@ jobs: env: RAILS_ENV: test run: bin/rails db:test:prepare test + + frontend: + runs-on: ubuntu-latest + defaults: + run: + working-directory: frontend + steps: + - uses: actions/checkout@v6 + + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + cache-dependency-path: frontend/package-lock.json + + - run: npm ci + - name: Lint + run: npm run lint + - name: Type check and build + run: npm run build diff --git a/CLAUDE.md b/CLAUDE.md index 7b88183..3c9886e 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -11,8 +11,10 @@ - `backend/`: Rails 8.1 API-only app (SQLite, Action Cable). The engine lives in `backend/lib/sim/`: `world.rb` (state), `shell.rb` (command interpreter), `engine.rb` (time + objectives), `scenarios/*.rb` (one chapter each, listed in `scenarios.rb`). -- `frontend/`: React + TypeScript (Vite). -- UI follows Royal's UI style (Geist, product-mode tokens). +- `frontend/`: React + TypeScript (Vite), xterm.js terminal. Play screen is `src/components/PlayScreen.tsx`. +- UI follows Royal's UI style rules (Geist, motion, accessibility) with this app's own "System map" theme in + `frontend/src/styles.css`. Don't reuse the helpdesk look (dark sidebar + blue pill). ## Checks before opening a pull request - `cd backend && bin/rails test && bin/rubocop && bin/brakeman --no-pager` +- `cd frontend && npm run lint && npm run build` diff --git a/README.md b/README.md index 84669e6..06b7ece 100644 --- a/README.md +++ b/README.md @@ -12,21 +12,32 @@ so you can't break anything. | 1 | GitHub | Open your first PR | planned | | 2 | CI | The build is red | planned | | 3 | Deploy | Roll back a bad release| planned | -| 4 | Linux | The disk is full | playable (API) | -| 5 | Monitoring | Memory is climbing | playable (API) | +| 4 | Linux | The disk is full | playable | +| 5 | Monitoring | Memory is climbing | playable | Each chapter can be played on its own. ## Running it +In one terminal: + ```sh cd backend bundle install bin/rails db:prepare bin/rails server # API on http://localhost:3000 -bin/rails test ``` +In another: + +```sh +cd frontend +npm install +npm run dev # open http://localhost:5173 +``` + +Tests and checks: `cd backend && bin/rails test && bin/rubocop`, `cd frontend && npm run lint && npm run build`. + ## Trying the API ```sh diff --git a/backend/app/controllers/api/scenarios_controller.rb b/backend/app/controllers/api/scenarios_controller.rb index e49775e..880cb1e 100644 --- a/backend/app/controllers/api/scenarios_controller.rb +++ b/backend/app/controllers/api/scenarios_controller.rb @@ -2,7 +2,7 @@ module Api class ScenariosController < ApplicationController def index render json: Sim::Scenario.all.map { |s| - { key: s.key, title: s.title, topic: s.topic, chapter: s.chapter, summary: s.summary } + { key: s.key, title: s.title, topic: s.topic, chapter: s.chapter, summary: s.summary, focus_metric: s.focus_metric } } end end diff --git a/backend/app/presenters/run_presenter.rb b/backend/app/presenters/run_presenter.rb index 66c3b9a..f23c869 100644 --- a/backend/app/presenters/run_presenter.rb +++ b/backend/app/presenters/run_presenter.rb @@ -14,7 +14,8 @@ def full status: @run.status, scenario: { key: scenario.key, title: scenario.title, topic: scenario.topic, - chapter: scenario.chapter, summary: scenario.summary, briefing: scenario.briefing + chapter: scenario.chapter, summary: scenario.summary, briefing: scenario.briefing, + focus_metric: scenario.focus_metric } }.merge(live) end @@ -41,7 +42,11 @@ def live objectives: @engine.objectives, alerts: @world.alerts, metrics: @world.data["metrics"], - services: services + services: services, + current_host: @world.current_host, + hint: @engine.scenario.hint_for(@world), + map: @engine.scenario.map(@world), + logs: @engine.scenario.logs(@world) } end diff --git a/backend/lib/sim/scenario.rb b/backend/lib/sim/scenario.rb index 1e0fca6..d0cf33f 100644 --- a/backend/lib/sim/scenario.rb +++ b/backend/lib/sim/scenario.rb @@ -11,13 +11,17 @@ class << self def all = Scenarios::ALL.sort_by(&:chapter) def find(key) = all.find { |s| s.key == key } || raise(KeyError, "Unknown scenario #{key}") - attr_accessor :key, :title, :chapter, :topic, :summary, :briefing + attr_accessor :key, :title, :chapter, :topic, :summary, :briefing, :focus_metric end def key = self.class.key def objectives = [] + # The live picture for the play screen. Scenarios set in the shop share one. + def map(world) = ShopWorld.map(world) + def logs(world) = ShopWorld.logs(world) + def build_world raise NotImplementedError end diff --git a/backend/lib/sim/scenarios/linux_disk_full.rb b/backend/lib/sim/scenarios/linux_disk_full.rb index ae35eaa..50b9c30 100644 --- a/backend/lib/sim/scenarios/linux_disk_full.rb +++ b/backend/lib/sim/scenarios/linux_disk_full.rb @@ -9,6 +9,7 @@ class LinuxDiskFull < Scenario self.topic = "Linux" self.title = "The disk is full" self.summary = "SSH into the server, find what filled the disk, and bring the crashed app back." + self.focus_metric = "disk" self.briefing = <<~TEXT Your phone buzzes: "shop.example is showing 502 errors!" You're on call. The shop runs on a server called web-01. diff --git a/backend/lib/sim/scenarios/monitoring_memory_leak.rb b/backend/lib/sim/scenarios/monitoring_memory_leak.rb index d6ceb0f..05d8f86 100644 --- a/backend/lib/sim/scenarios/monitoring_memory_leak.rb +++ b/backend/lib/sim/scenarios/monitoring_memory_leak.rb @@ -9,6 +9,7 @@ class MonitoringMemoryLeak < Scenario self.topic = "Monitoring" self.title = "Memory is climbing" self.summary = "A memory alert fires. Use the dashboard and the server to trace the cause and fix it for good." + self.focus_metric = "memory" self.briefing = <<~TEXT It's a quiet afternoon. The site is up and the dashboard looks calm. Keep an eye on the memory graph for web-01. Monitoring will page you @@ -21,7 +22,8 @@ class MonitoringMemoryLeak < Scenario # Once paged, the leak slows down so a beginner has time to investigate # before the kernel starts killing processes. LEAK_AFTER_ALERT = 40 - LEAK_STARTS_AT = 2 + LEAK_STARTS_AT = 1 + HEAD_START_MB = 600 ALERT_AT = 85 RECOVERED_BELOW = 70 OOM_AT = 98 @@ -33,6 +35,9 @@ def build_world data["session"] = { "host" => "laptop", "user" => "dev", "cwd" => "/home/dev" } world = World.new(data) ShopWorld.boot(self, world, "postgresql", "nginx", "shop-web", WORKER) + # The leak has been going for a while before the player arrives, so + # the alert fires within a minute or so of real time. + world.service_processes(WORKER, WEB).first["mem_mb"] += HEAD_START_MB data end diff --git a/backend/lib/sim/shop_world.rb b/backend/lib/sim/shop_world.rb index 9006727..61f125a 100644 --- a/backend/lib/sim/shop_world.rb +++ b/backend/lib/sim/shop_world.rb @@ -114,6 +114,54 @@ def boot(scenario, world, *names, host: "web-01") names.each { |name| scenario.start_service(world, name, host: host) } end + MAP_NODES = [ + { "id" => "laptop", "label" => "Your laptop", "kind" => "dev", "inspect" => "cat ~/on-call.md" }, + { "id" => "nginx", "label" => "nginx", "kind" => "front door", "service" => "nginx" }, + { "id" => "shop-web", "label" => "shop-web", "kind" => "Rails app", "service" => "shop-web" }, + { "id" => "shop-worker", "label" => "shop-worker", "kind" => "background jobs", "service" => "shop-worker" }, + { "id" => "postgresql", "label" => "postgresql", "kind" => "database", "service" => "postgresql" }, + { "id" => "disk", "label" => "Disk /", "kind" => "storage", "inspect" => "df -h" } + ].freeze + MAP_EDGES = [ %w[laptop nginx], %w[nginx shop-web], %w[shop-web postgresql], %w[shop-worker postgresql], + %w[shop-web shop-worker], %w[shop-web disk] ].freeze + + # What the play screen draws: the shop's parts, how they connect, and + # which one is in trouble right now. Status comes straight from the world. + def map(world) + nodes = MAP_NODES.map do |node| + node.merge(map_status(world, node)).merge("host" => node["id"] == "laptop" ? "laptop" : "web-01") + end + { "nodes" => nodes, "edges" => MAP_EDGES } + end + + def map_status(world, node) + if node["id"] == "laptop" + on_server = world.current_host == "web-01" + return { "status" => "ok", "detail" => on_server ? "connected over ssh" : "you are here" } + end + if node["id"] == "disk" + pct = world.disk_percent("web-01") + return { "status" => pct >= 90 ? "bad" : pct >= 80 ? "warn" : "ok", "detail" => "#{pct}% used", "level" => pct } + end + + svc = world.service(node["service"], "web-01") + mem = world.service_processes(node["service"], "web-01").sum { |p| p["mem_mb"] }.round + level = (mem * 100.0 / world.host("web-01")["memory_total_mb"]).round + status, detail = + if svc["state"] != "active" then [ "bad", svc["state"] == "failed" ? "crashed" : "stopped" ] + elsif level >= 40 then [ "warn", "#{format_mb(mem)} · high memory" ] + else [ "ok", "running · #{format_mb(mem)}" ] + end + { "status" => status, "detail" => detail, "level" => level, "inspect" => "systemctl status #{node['service']}" } + end + + def format_mb(mb) = mb >= 1024 ? "#{format('%.2f', mb / 1024.0)} GB" : "#{mb} MB" + + # Recent journal lines per service, for the Logs tab. + def logs(world) + world.services("web-01").to_h { |name, svc| [ name, Array(svc["journal"]).last(40) ] } + end + # Shared HTTP behaviour: the site is up when nginx and shop-web are running. def http(world, url) return nil unless url.match?(%r{\A(https?://)?(shop\.example|localhost|127\.0\.0\.1|web-01)(:\d+)?(/.*)?\z}) diff --git a/backend/test/lib/sim/monitoring_memory_leak_test.rb b/backend/test/lib/sim/monitoring_memory_leak_test.rb index 9cbe6d3..764f8ad 100644 --- a/backend/test/lib/sim/monitoring_memory_leak_test.rb +++ b/backend/test/lib/sim/monitoring_memory_leak_test.rb @@ -19,7 +19,7 @@ def wait_for_alert start = @world.memory_percent("web-01") wait_for_alert assert_operator @world.memory_percent("web-01"), :>=, 85 - assert_operator start, :<, 60 + assert_operator start, :<, 70 assert_equal "HighMemoryUsage", @world.firing_alerts.first["id"] end diff --git a/backend/test/lib/sim/shop_map_test.rb b/backend/test/lib/sim/shop_map_test.rb new file mode 100644 index 0000000..a2e0b03 --- /dev/null +++ b/backend/test/lib/sim/shop_map_test.rb @@ -0,0 +1,34 @@ +require "test_helper" + +class Sim::ShopMapTest < ActiveSupport::TestCase + def node(engine, id) = engine.scenario.map(engine.world)["nodes"].find { |n| n["id"] == id } + + test "the linux chapter shows a crashed app and a full disk" do + engine = Sim::Engine.start("linux-disk-full") + assert_equal "bad", node(engine, "shop-web")["status"] + assert_equal "bad", node(engine, "disk")["status"] + assert_equal "ok", node(engine, "nginx")["status"] + assert_equal "systemctl status shop-web", node(engine, "shop-web")["inspect"] + end + + test "the monitoring chapter makes the worker glow as it leaks" do + engine = Sim::Engine.start("monitoring-memory-leak") + assert_equal "ok", node(engine, "shop-worker")["status"] + 10.times { engine.tick } + assert_equal "warn", node(engine, "shop-worker")["status"] + assert_match "high memory", node(engine, "shop-worker")["detail"] + end + + test "the laptop node follows the ssh session" do + engine = Sim::Engine.start("linux-disk-full") + assert_equal "you are here", node(engine, "laptop")["detail"] + engine.execute("ssh web-01") + assert_equal "connected over ssh", node(engine, "laptop")["detail"] + end + + test "every edge points at a real node" do + map = Sim::Engine.start("linux-disk-full").then { |e| e.scenario.map(e.world) } + ids = map["nodes"].map { |n| n["id"] } + assert map["edges"].flatten.all? { |id| ids.include?(id) } + end +end diff --git a/frontend/.gitignore b/frontend/.gitignore new file mode 100644 index 0000000..a547bf3 --- /dev/null +++ b/frontend/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/frontend/.oxlintrc.json b/frontend/.oxlintrc.json new file mode 100644 index 0000000..6fa991d --- /dev/null +++ b/frontend/.oxlintrc.json @@ -0,0 +1,8 @@ +{ + "$schema": "./node_modules/oxlint/configuration_schema.json", + "plugins": ["react", "typescript", "oxc"], + "rules": { + "react/rules-of-hooks": "error", + "react/only-export-components": ["warn", { "allowConstantExport": true }] + } +} diff --git a/frontend/index.html b/frontend/index.html new file mode 100644 index 0000000..14e6d4d --- /dev/null +++ b/frontend/index.html @@ -0,0 +1,17 @@ + + + + + + + + DevOps Simulator + + + + + +
+ + + diff --git a/frontend/package-lock.json b/frontend/package-lock.json new file mode 100644 index 0000000..13800c6 --- /dev/null +++ b/frontend/package-lock.json @@ -0,0 +1,1783 @@ +{ + "name": "frontend", + "version": "0.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "frontend", + "version": "0.0.0", + "dependencies": { + "@rails/actioncable": "^8.1.401", + "@xterm/addon-fit": "^0.11.0", + "@xterm/xterm": "^6.0.0", + "react": "^19.3.1", + "react-dom": "^19.3.1" + }, + "devDependencies": { + "@types/node": "^24.19.2", + "@types/rails__actioncable": "^8.0.3", + "@types/react": "^19.3.0", + "@types/react-dom": "^19.3.0", + "@vitejs/plugin-react": "^6.1.2", + "oxlint": "^1.90.0", + "typescript": "~7.0.2", + "vite": "^8.3.6" + } + }, + "node_modules/@emnapi/core": { + "version": "2.0.0-beta.2", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-2.0.0-beta.2.tgz", + "integrity": "sha512-MzCVoWtcg4Pm2B3je5mMvYMvj3MmBKw+fU7vbsJc9/iT8ip6/eYIHo/Dsm/mr+wsHB6SEyJDuxB09Yy6r/8+4A==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/wasi-threads": "2.2.0", + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/runtime": { + "version": "2.0.0-beta.2", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-2.0.0-beta.2.tgz", + "integrity": "sha512-JcrSPzPvZuNZvJqPTF9Fw25LbOJ8avzFVlaf2grmH4Cku0oGP47tRgqPZadcfj3YoZMHkFVnCYFbQM8I+i5QEw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/wasi-threads": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-2.2.0.tgz", + "integrity": "sha512-JP7OYH38Q7+pyTAe14raZHLQIK7BDKbdwji+Xi3pcd/6QkJYQH3SX4wu6EplGrGJWRepoNzedfm0G3B9Z4e9Rw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@napi-rs/wasm-runtime": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.2.6.tgz", + "integrity": "sha512-mRyDmEw9/fCDXCGfL1sbgIw/GUK0PVxRW4YwgPN61F3LQ+fSyoBFarJVzgGyhF6kRzEQZ0FejDqm4WLXSeqQmw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@tybys/wasm-util": "^0.10.3" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=23.5.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "peerDependencies": { + "@emnapi/core": "^1.7.1 || 2.0.0-beta.2", + "@emnapi/runtime": "^1.7.1 || 2.0.0-beta.2" + } + }, + "node_modules/@oxc-project/types": { + "version": "0.156.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.156.0.tgz", + "integrity": "sha512-1Duyg48TdJNdyhEB8Xn1L36bT9Pv6GUtlKjHxOys8xkaF/rQq3XJE+bAurSK/AgIz5mGFsb77cn9Pb20+WCScw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/oxc-project" + } + }, + "node_modules/@oxlint/binding-android-arm-eabi": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-android-arm-eabi/-/binding-android-arm-eabi-1.94.0.tgz", + "integrity": "sha512-730FKSBsKg/NawYnpI3gXRroXptOVqY32iYBPLUZaSx0vgYzOeiNtwojZL4gJdzo9wDvHUlstShmGRHrWcbRYg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-android-arm64": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-android-arm64/-/binding-android-arm64-1.94.0.tgz", + "integrity": "sha512-8v8TICIiZpXLot1HSq5+vsG9NEKQ5czQBYlUqJR75OVfFDr3cGOmRU/CtHDWnS4tm8nW+Z4Y357qGToSfYqFvA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-darwin-arm64": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-darwin-arm64/-/binding-darwin-arm64-1.94.0.tgz", + "integrity": "sha512-NePcRMO/ltt1Pnytohl6pl0bd/QyRX8HbpptuDz9LK7FTsFD4lKxDMBt7di9k6IFLO0J05jO2nm7wGqIh6dRHA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-darwin-x64": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-darwin-x64/-/binding-darwin-x64-1.94.0.tgz", + "integrity": "sha512-QV+m+OaEgLmYyillvP1wKXhMm6tDZEWx3vG7Wjmx9ybg15+6YMfqzvp6e+uPukC6zNywuule0vMn0fZgihZzZA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-freebsd-x64": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-freebsd-x64/-/binding-freebsd-x64-1.94.0.tgz", + "integrity": "sha512-KVZjca581nrV6P71kZ9M1otBib9LH0IMn9rr4mrnbRp18V0HiZhBHbU26gji/Ieq2G34qMacnMc3zrmKmvWqWA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-arm-gnueabihf": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.94.0.tgz", + "integrity": "sha512-AMQtgQJk8DgdIV+qaQ5sFoHAko4iKa8zo+gYqELy2grtU8hXWB08DAGB3u90aQL1YSxbd3zqHjgcODBHDFyzBQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-arm-musleabihf": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-1.94.0.tgz", + "integrity": "sha512-ZLzoGVGAmQkp9leeB5rNxAXLcvlmkmd/GY71LKd5uikk+28NEApY3S2FB3pq6MkfOCFFnFg6QgD9lJIjd07D0Q==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-arm64-gnu": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.94.0.tgz", + "integrity": "sha512-N1dW6o7cY90hLVkDsvz8nWIFOwbO+n272pvW7uLYB7u47HagJVnLChfK6QA9dWFdiPudud9zfksVUOciHc5PNA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-arm64-musl": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.94.0.tgz", + "integrity": "sha512-7tCF4OV/bGDQ2xxgb+sDI97SpmmDrUII4JxTG553voJVA9cnkbXSGSXzo78Ax73BuhEOPoQc2Qi6VrfT0cDG2A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-ppc64-gnu": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.94.0.tgz", + "integrity": "sha512-B5vUHE4wNisVEuaYxwFUn6tY+vw7A+9APxxqGKI+UmP3yKLpkhnt0qsaCrzjpX55F8rCRHBaTvIDdYo32NE36g==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-riscv64-gnu": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-1.94.0.tgz", + "integrity": "sha512-/U0b15+c4hTodo8YhEqDlQ6OjnGKvc8igjM/mh23ukqqCUBKiBCaxqUV8bcaofK9uZ+f8wCygkyXLS6LN25YSA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-riscv64-musl": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-1.94.0.tgz", + "integrity": "sha512-ba94Vwl0qOnwXIXNDR33AEbLXuX++ckM74t+9Te7CiPSPAHivhOYyeEkUAicrvOEei1pxXkWggLbFeBFFBTuHA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-s390x-gnu": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.94.0.tgz", + "integrity": "sha512-GVwwwms3O8pdgbCiPavwq2vltyB4661GkDz6kJduZ0E5nsSJUDJ0svaP+ePYpuDVYi4+K1qhCKnWa/Ec8I4LUA==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-x64-gnu": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.94.0.tgz", + "integrity": "sha512-iUfCFJN8ZIresSnpTfiIkhF3s8X+XA4I9KJ249QwR2QYTMwh0+pla1pj1xaFi+HtR9McjM4Jaemf70HzX7ilOQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-x64-musl": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-x64-musl/-/binding-linux-x64-musl-1.94.0.tgz", + "integrity": "sha512-RqWVeWpDACS4Oh0m21OBmy+CQ50CbbhuHFmNNPVS2P/4R3d188MjEuEuV7So82/tAM8UAT+UuMDtRDESd9NJ7g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-openharmony-arm64": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-openharmony-arm64/-/binding-openharmony-arm64-1.94.0.tgz", + "integrity": "sha512-K/2DHOUoypwYVqzxJMRPdMuBKjAetZEAsGPP7rHimd+2+5J1TxM+17pG8kw+ayH4+rqBXiPd+H9wgPcU+fF77A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-win32-arm64-msvc": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.94.0.tgz", + "integrity": "sha512-hYOCaOJiB4ZCGswBWKl3JQrhqu6mnC5DCUw/1UMNzRXgsHIJ0V226J43LAVICVIDGlhFUZTYShFW+wHWpt6qCQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-win32-ia32-msvc": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-1.94.0.tgz", + "integrity": "sha512-1l1FDlzbPmAeDoZ8UGspOE2dOmz1ZL6SlDsvOmRCmWSQjCdTy5LzUepS8mO/SGpAoz4D6WAt/yNZAUyHqbkmkQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-win32-x64-msvc": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.94.0.tgz", + "integrity": "sha512-I3eZdd4bemIJQDNv9XDV/FEofDxIoN32tzCv98wIgLdW05EqxZb5hF4AwPrRzHD/dQhl0n7KgPy5AQPfM0HWrA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rails/actioncable": { + "version": "8.1.401", + "resolved": "https://registry.npmjs.org/@rails/actioncable/-/actioncable-8.1.401.tgz", + "integrity": "sha512-eZdEy9UmnsaeDHr5G5nFhdgsaMo9EZVq2JMAjqtNmVDqnKWHwvTMt0Ah1CWBf7g7BDLR3WCDgHS2aOhbpjqkWw==", + "license": "MIT" + }, + "node_modules/@rolldown/binding-android-arm-eabi": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.19.tgz", + "integrity": "sha512-e+Ebe0WT+9tbXmNKPIiC8YrWAHYwug3m6i4p3rZGGulfZri1jtI4HslT+OZnFf/OIHowWF71DTlHwXBP2SiA7A==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.19.tgz", + "integrity": "sha512-hOombrTJ+szt2ciEzS7oCA78lMPBgF5UMQWCJIyNfnrI7GLl8HYoFqCnpL2gcPOaXMqryGCU5ExdQKyDDcC+yA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.19.tgz", + "integrity": "sha512-XoMA2pwCKGTQzUjPgtRwkedH4WmXhdIPKT6l6oOxd1PUbNodGI6DcBekgN7EC//+x3pfBYX/qL1gNmZAqivw5g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.19.tgz", + "integrity": "sha512-zo8EsSSwMZCY/e+fRnGaX02YGgvJD0yvhNi/9hpGPA2MJ9ZF8dPCw75UGfpI6OpQ/myR/dIYmogRvqiZD0TrXg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.19.tgz", + "integrity": "sha512-O8ISAOfI1nj7AuBPd30FSF47z7f7lzlk5poQVGgiikvQuGEBFYvW8ki+UEnT+YJPnNGjQzn304klt4O9FUE7mA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.19.tgz", + "integrity": "sha512-/lYCba5NO0yq4S0jGMH8QTBtkvQxoXjoQWzF5BcWp9MjB9jxVRD1GQDNofkVjcOj30DWyhLIN/4Oe60JKzaONw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.19.tgz", + "integrity": "sha512-pm/apFMBnSbFb3O6nG5pHO1iqHhZrjGDFEjSm+ot9J17XXPvH9L90y5h+jgfHCE+Qdlsvy8qKEcU4VKxgjD+vA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.19.tgz", + "integrity": "sha512-K1SmQp3FFichn8oqrNIwvFoZ5wcvjC7goBzpaMNvLf9FZc+QB/QvLmnpJZgAAGHiD980tP8FZZnXk2K94rvlxg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.19.tgz", + "integrity": "sha512-I0xwD57jP/3A7+5UPZin2w8Y7XHEmEM5zqpYZOcQ45MlNW6tUJUziymV3yRr7rL4vwyfEcRsRksC4a7Kc08p5Q==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.19.tgz", + "integrity": "sha512-BrtEHT24SNXj9HiXqy+s/kXiSiQGt6EKCPUlRirAoIioVxKGnbXBUEkbZASAei7iZJB0/Ynm+0JP00Ipx7AnSw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.19.tgz", + "integrity": "sha512-rm75/9DkHKeU2WnA8w4X94WGYgLlDCFCfkQC+4bguVJmC/jvDRv2B+2wLOYhyE0fVuv7//Ckk39OoOufyCu76Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.19.tgz", + "integrity": "sha512-irh/4+iYFM4GAzpluDErgjz89bj6NDtqqMAG/6O1LG38Ed3NpyebzCpcVNkFW8uhy+/3/BocUvnXDR33CXWe9A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.19.tgz", + "integrity": "sha512-+KWTWNoPt+CfSq94CiceWu3yPE+QzkaG+phPyz9G60tmZLwfQkcA4AeksafzvJAw4pvg1mcd5a1TkUqVv0s4JA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-wasm32-wasi": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.2.19.tgz", + "integrity": "sha512-7EH+skOsl5qpWnK0vzamgJFhOv1cwxQpsxm8tI883K9fur5c27p8q87fzEO6BbBPabA2/+s/zR63/pLc137iOg==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "2.0.0-beta.2", + "@emnapi/runtime": "2.0.0-beta.2", + "@napi-rs/wasm-runtime": "1.2.6" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=23.5.0" + } + }, + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.19.tgz", + "integrity": "sha512-3Q1Yg1Q7tEvBWoZf5rFvG/GKZQPgwfru+p4wBajDfJFBs0SHCpL++dfTjW9gyAKd1T7ZpIYvdaUax7Pa/IhFVQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.19.tgz", + "integrity": "sha512-y/sqRRc6d7hECzOFc5n3LSeqctmIp9mMjY1Kq4s14uLPd/LZ4z7i1zrW6fMtp2mPeuQIC4e6ULMcwQzMomqQag==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.1.1.tgz", + "integrity": "sha512-glFIJDvLNDtJhT9qrMFWLPbvS+skxgt4L0K8Ei2YtnhPysAJnsI7nyxSJxKj4ADeKX0OLjC4ntRkwpLOoS3rwA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tybys/wasm-util": { + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.5.tgz", + "integrity": "sha512-dOGOPxlaNV+G046mZzN+9C0dAcQZeSKcXiVaM0TYy/LM4ttTmgSBDxYfovcYI8Em3+eAbiAYpvWLOv8+ZVRJKA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@types/node": { + "version": "24.19.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.19.2.tgz", + "integrity": "sha512-93d49wCWJkCyN87MxLpNN6KXPCwFw7bVUg79mGUV1OS40JGWwVCr8n61DXCSqz7CV6/VfPkb7xec7uP2M+QHWQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": ">=7.24.0 <7.24.7" + } + }, + "node_modules/@types/rails__actioncable": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/@types/rails__actioncable/-/rails__actioncable-8.0.3.tgz", + "integrity": "sha512-y46MOTYorVQVwlHUyaZYbrh3nIkXsRYNuPna32lb3RngLVBlndNbIPvAUywFfhivftNhYg+vW5sZKWYCVIX2lA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/react": { + "version": "19.3.0", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.3.0.tgz", + "integrity": "sha512-N0rFCuH9YoxG9/m61l9MfpJKfmLOVU0em7ipIz6TRgSSkvReLB9vL85GB+yr8Bs5leqpvg96JSwF4ZS1s4viQg==", + "dev": true, + "license": "MIT", + "dependencies": { + "csstype": "^3.2.2" + } + }, + "node_modules/@types/react-dom": { + "version": "19.3.0", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.3.0.tgz", + "integrity": "sha512-ZI7bU42mZXXKHn/qNLEw2IrbiINU7X5+vfgdixBHkCNpYWXjKgfQ/P+uyGb5CjOLB9UcnTeg3rylQtV2hym44Q==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^19.3.0" + } + }, + "node_modules/@typescript/typescript-aix-ppc64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-aix-ppc64/-/typescript-aix-ppc64-7.0.2.tgz", + "integrity": "sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-darwin-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-arm64/-/typescript-darwin-arm64-7.0.2.tgz", + "integrity": "sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-darwin-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-x64/-/typescript-darwin-x64-7.0.2.tgz", + "integrity": "sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-freebsd-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-arm64/-/typescript-freebsd-arm64-7.0.2.tgz", + "integrity": "sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-freebsd-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-x64/-/typescript-freebsd-x64-7.0.2.tgz", + "integrity": "sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-arm": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm/-/typescript-linux-arm-7.0.2.tgz", + "integrity": "sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm64/-/typescript-linux-arm64-7.0.2.tgz", + "integrity": "sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-loong64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-loong64/-/typescript-linux-loong64-7.0.2.tgz", + "integrity": "sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-mips64el": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-mips64el/-/typescript-linux-mips64el-7.0.2.tgz", + "integrity": "sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-ppc64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-ppc64/-/typescript-linux-ppc64-7.0.2.tgz", + "integrity": "sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-riscv64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-riscv64/-/typescript-linux-riscv64-7.0.2.tgz", + "integrity": "sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-s390x": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-s390x/-/typescript-linux-s390x-7.0.2.tgz", + "integrity": "sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-x64/-/typescript-linux-x64-7.0.2.tgz", + "integrity": "sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-netbsd-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-arm64/-/typescript-netbsd-arm64-7.0.2.tgz", + "integrity": "sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-netbsd-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-x64/-/typescript-netbsd-x64-7.0.2.tgz", + "integrity": "sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-openbsd-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-arm64/-/typescript-openbsd-arm64-7.0.2.tgz", + "integrity": "sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-openbsd-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-x64/-/typescript-openbsd-x64-7.0.2.tgz", + "integrity": "sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-sunos-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-sunos-x64/-/typescript-sunos-x64-7.0.2.tgz", + "integrity": "sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-win32-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-arm64/-/typescript-win32-arm64-7.0.2.tgz", + "integrity": "sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-win32-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-x64/-/typescript-win32-x64-7.0.2.tgz", + "integrity": "sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@vitejs/plugin-react": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-6.3.0.tgz", + "integrity": "sha512-H9E955aVvD2F4zNHCw4eIZbIfF6xKldlh7MNu+hSU7xwQzh65lI/N+CJWqmfhi0PEjDXIt/H7T7J/4wU63KJiw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rolldown/pluginutils": "^1.0.1" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "peerDependencies": { + "@rolldown/plugin-babel": "^0.1.7 || ^0.2.0 || ^0.3.0", + "babel-plugin-react-compiler": "^1.0.0", + "oxc-transform-react": ">=0.152.0 <0.157.0", + "vite": "^8.0.0" + }, + "peerDependenciesMeta": { + "@rolldown/plugin-babel": { + "optional": true + }, + "babel-plugin-react-compiler": { + "optional": true + }, + "oxc-transform-react": { + "optional": true + } + } + }, + "node_modules/@xterm/addon-fit": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@xterm/addon-fit/-/addon-fit-0.11.0.tgz", + "integrity": "sha512-jYcgT6xtVYhnhgxh3QgYDnnNMYTcf8ElbxxFzX0IZo+vabQqSPAjC3c1wJrKB5E19VwQei89QCiZZP86DCPF7g==", + "license": "MIT" + }, + "node_modules/@xterm/xterm": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@xterm/xterm/-/xterm-6.0.0.tgz", + "integrity": "sha512-TQwDdQGtwwDt+2cgKDLn0IRaSxYu1tSUjgKarSDkUM0ZNiSRXFpjxEsvc/Zgc5kq5omJ+V0a8/kIM2WD3sMOYg==", + "license": "MIT", + "workspaces": [ + "addons/*" + ] + }, + "node_modules/csstype": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.4.tgz", + "integrity": "sha512-PoKaoPzQapnEoqUSnHx1u6W6ku8CVEgKsnpmmzU3m1nwkidpPBQ8V/Zq2+bWNrsOKoKLwTGdbx6xF7BXP1zLVQ==", + "dev": true, + "license": "MIT" + }, + "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/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/lightningcss": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz", + "integrity": "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.33.0", + "lightningcss-darwin-arm64": "1.33.0", + "lightningcss-darwin-x64": "1.33.0", + "lightningcss-freebsd-x64": "1.33.0", + "lightningcss-linux-arm-gnueabihf": "1.33.0", + "lightningcss-linux-arm64-gnu": "1.33.0", + "lightningcss-linux-arm64-musl": "1.33.0", + "lightningcss-linux-x64-gnu": "1.33.0", + "lightningcss-linux-x64-musl": "1.33.0", + "lightningcss-win32-arm64-msvc": "1.33.0", + "lightningcss-win32-x64-msvc": "1.33.0" + } + }, + "node_modules/lightningcss-android-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.33.0.tgz", + "integrity": "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==", + "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.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.33.0.tgz", + "integrity": "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.33.0.tgz", + "integrity": "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-freebsd-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.33.0.tgz", + "integrity": "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==", + "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/lightningcss-linux-arm-gnueabihf": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.33.0.tgz", + "integrity": "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==", + "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.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.33.0.tgz", + "integrity": "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==", + "cpu": [ + "arm64" + ], + "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-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.33.0.tgz", + "integrity": "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==", + "cpu": [ + "arm64" + ], + "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-x64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.33.0.tgz", + "integrity": "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==", + "cpu": [ + "x64" + ], + "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-x64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.33.0.tgz", + "integrity": "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==", + "cpu": [ + "x64" + ], + "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-win32-arm64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.33.0.tgz", + "integrity": "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.33.0.tgz", + "integrity": "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/nanoid": { + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/oxlint": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/oxlint/-/oxlint-1.94.0.tgz", + "integrity": "sha512-Fnt+3wSKRhtLmvgRfxgRX0excSPCoyiXRol4eWKZLtXxWMQtwQ3KjKQUYXOw5loyinfnZfGzh4RCYf7opfL0vw==", + "dev": true, + "license": "MIT", + "bin": { + "oxlint": "bin/oxlint" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/sponsors/oxc-project" + }, + "optionalDependencies": { + "@oxlint/binding-android-arm-eabi": "1.94.0", + "@oxlint/binding-android-arm64": "1.94.0", + "@oxlint/binding-darwin-arm64": "1.94.0", + "@oxlint/binding-darwin-x64": "1.94.0", + "@oxlint/binding-freebsd-x64": "1.94.0", + "@oxlint/binding-linux-arm-gnueabihf": "1.94.0", + "@oxlint/binding-linux-arm-musleabihf": "1.94.0", + "@oxlint/binding-linux-arm64-gnu": "1.94.0", + "@oxlint/binding-linux-arm64-musl": "1.94.0", + "@oxlint/binding-linux-ppc64-gnu": "1.94.0", + "@oxlint/binding-linux-riscv64-gnu": "1.94.0", + "@oxlint/binding-linux-riscv64-musl": "1.94.0", + "@oxlint/binding-linux-s390x-gnu": "1.94.0", + "@oxlint/binding-linux-x64-gnu": "1.94.0", + "@oxlint/binding-linux-x64-musl": "1.94.0", + "@oxlint/binding-openharmony-arm64": "1.94.0", + "@oxlint/binding-win32-arm64-msvc": "1.94.0", + "@oxlint/binding-win32-ia32-msvc": "1.94.0", + "@oxlint/binding-win32-x64-msvc": "1.94.0" + }, + "peerDependencies": { + "oxlint-tsgolint": ">=7.0.2007", + "vite-plus": "*" + }, + "peerDependenciesMeta": { + "oxlint-tsgolint": { + "optional": true + }, + "vite-plus": { + "optional": true + } + } + }, + "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, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.33", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.33.tgz", + "integrity": "sha512-RVHEU9/Pp1Fnjr/MpAJsZoADukCKhfIi15OunEYiGktIkYLkPVvC1sioWolGDS7XByMTx9m/IGbro0Js13zhnQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.20", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/react": { + "version": "19.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-19.3.1.tgz", + "integrity": "sha512-QNhWdt7nrgVWWQG58QuGsAR3jv3Hbe4mb4vz7w2csnHavciZJgda1CPNaldF6eVxv90ud3jUXpKlHL69gO38yw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "19.3.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.3.1.tgz", + "integrity": "sha512-Y0bARz53lhEC1NMCASs0/j+faB/zqt3R8hpvg1e8+61ZVJ4UL0UdC4cBbXfZMcIuhrfgeILTLe+ZeBCavQPtKQ==", + "license": "MIT", + "dependencies": { + "scheduler": "^0.28.0" + }, + "peerDependencies": { + "react": "^19.3.1" + } + }, + "node_modules/rolldown": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.19.tgz", + "integrity": "sha512-QIiV1J9d0pzN4jeeTH4sjPy0AZ6cAy2cG0ExeoE1+U8Rvj+hR3gYkokx0YbeUNGlZqiQJJ2utcETe0oKXwzsuA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oxc-project/types": "=0.156.0", + "@rolldown/pluginutils": "^1.0.0" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm-eabi": "1.2.19", + "@rolldown/binding-android-arm64": "1.2.19", + "@rolldown/binding-darwin-arm64": "1.2.19", + "@rolldown/binding-darwin-x64": "1.2.19", + "@rolldown/binding-freebsd-x64": "1.2.19", + "@rolldown/binding-linux-arm-gnueabihf": "1.2.19", + "@rolldown/binding-linux-arm64-gnu": "1.2.19", + "@rolldown/binding-linux-arm64-musl": "1.2.19", + "@rolldown/binding-linux-ppc64-gnu": "1.2.19", + "@rolldown/binding-linux-s390x-gnu": "1.2.19", + "@rolldown/binding-linux-x64-gnu": "1.2.19", + "@rolldown/binding-linux-x64-musl": "1.2.19", + "@rolldown/binding-openharmony-arm64": "1.2.19", + "@rolldown/binding-wasm32-wasi": "1.2.19", + "@rolldown/binding-win32-arm64-msvc": "1.2.19", + "@rolldown/binding-win32-x64-msvc": "1.2.19" + } + }, + "node_modules/scheduler": { + "version": "0.28.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.28.0.tgz", + "integrity": "sha512-juorfCmIkIw8tT+p5BXSm6PJjQF/ycEYmKyzURCIt/RaZIhL+PulbQ9Yu2z1HdOJDdqDTlxA1+xKBmHXJsczAw==", + "license": "MIT" + }, + "node_modules/source-map-js": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.4.tgz", + "integrity": "sha512-J7ZjMvHd9O1fcT/5V09QWaaSl2BbWx3F6O08spde82Namf9UB0GxRVIPiNbVsdKkoizHiSpTodo3vp2bAy91MA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tslib": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.9.1.tgz", + "integrity": "sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==", + "dev": true, + "license": "0BSD", + "optional": true + }, + "node_modules/typescript": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-7.0.2.tgz", + "integrity": "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc" + }, + "engines": { + "node": ">=16.20.0" + }, + "optionalDependencies": { + "@typescript/typescript-aix-ppc64": "7.0.2", + "@typescript/typescript-darwin-arm64": "7.0.2", + "@typescript/typescript-darwin-x64": "7.0.2", + "@typescript/typescript-freebsd-arm64": "7.0.2", + "@typescript/typescript-freebsd-x64": "7.0.2", + "@typescript/typescript-linux-arm": "7.0.2", + "@typescript/typescript-linux-arm64": "7.0.2", + "@typescript/typescript-linux-loong64": "7.0.2", + "@typescript/typescript-linux-mips64el": "7.0.2", + "@typescript/typescript-linux-ppc64": "7.0.2", + "@typescript/typescript-linux-riscv64": "7.0.2", + "@typescript/typescript-linux-s390x": "7.0.2", + "@typescript/typescript-linux-x64": "7.0.2", + "@typescript/typescript-netbsd-arm64": "7.0.2", + "@typescript/typescript-netbsd-x64": "7.0.2", + "@typescript/typescript-openbsd-arm64": "7.0.2", + "@typescript/typescript-openbsd-x64": "7.0.2", + "@typescript/typescript-sunos-x64": "7.0.2", + "@typescript/typescript-win32-arm64": "7.0.2", + "@typescript/typescript-win32-x64": "7.0.2" + } + }, + "node_modules/undici-types": { + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.24.6.tgz", + "integrity": "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==", + "dev": true, + "license": "MIT" + }, + "node_modules/vite": { + "version": "8.3.8", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.3.8.tgz", + "integrity": "sha512-LzOn3h9rG/0vhLdXrV4yJ4QFA9eEoqCl+Yx+kGJd7aB9w6nfNgVHKSYwLPZUHrz4ZGa+t+kXjV9itvcHDLQouA==", + "dev": true, + "license": "MIT", + "dependencies": { + "lightningcss": "^1.33.0", + "picomatch": "^4.0.7", + "postcss": "^8.5.32", + "rolldown": "~1.2.18", + "tinyglobby": "^0.2.17" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.7.1 || ^0.8.0", + "esbuild": "^0.27.0 || ^0.28.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "@vitejs/devtools": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + } + } +} diff --git a/frontend/package.json b/frontend/package.json new file mode 100644 index 0000000..6f733bd --- /dev/null +++ b/frontend/package.json @@ -0,0 +1,29 @@ +{ + "name": "frontend", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "tsc -b && vite build", + "lint": "oxlint", + "preview": "vite preview" + }, + "dependencies": { + "@rails/actioncable": "^8.1.401", + "@xterm/addon-fit": "^0.11.0", + "@xterm/xterm": "^6.0.0", + "react": "^19.3.1", + "react-dom": "^19.3.1" + }, + "devDependencies": { + "@types/node": "^24.19.2", + "@types/rails__actioncable": "^8.0.3", + "@types/react": "^19.3.0", + "@types/react-dom": "^19.3.0", + "@vitejs/plugin-react": "^6.1.2", + "oxlint": "^1.90.0", + "typescript": "~7.0.2", + "vite": "^8.3.6" + } +} diff --git a/frontend/public/favicon.svg b/frontend/public/favicon.svg new file mode 100644 index 0000000..ed397f0 --- /dev/null +++ b/frontend/public/favicon.svg @@ -0,0 +1 @@ + diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx new file mode 100644 index 0000000..00b052c --- /dev/null +++ b/frontend/src/App.tsx @@ -0,0 +1,67 @@ +import { useEffect, useState } from 'react' +import { api } from './api' +import { ChapterPicker } from './components/ChapterPicker' +import { Icon } from './components/icons' +import { PlayScreen } from './components/PlayScreen' +import type { Run, ScenarioSummary } from './types' + +type Theme = 'light' | 'dark' + +function initialTheme(): Theme { + const saved = localStorage.getItem('theme') + if (saved === 'light' || saved === 'dark') return saved + return window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark' +} + +// The run id lives in the URL hash (#/run/12) so a reload picks up where you were. +const runIdFromHash = () => Number(location.hash.match(/^#\/run\/(\d+)/)?.[1]) || null + +export default function App() { + const [scenarios, setScenarios] = useState([]) + const [run, setRun] = useState(null) + const [starting, setStarting] = useState(null) + const [error, setError] = useState(null) + const [theme, setTheme] = useState(initialTheme) + + useEffect(() => { + document.documentElement.dataset.theme = theme + localStorage.setItem('theme', theme) + }, [theme]) + + useEffect(() => { + api.scenarios().then(setScenarios).catch(() => setError('Could not reach the simulator API. Start it with `bin/rails server` in backend/.')) + const id = runIdFromHash() + if (id) api.run(id).then(setRun).catch(() => { location.hash = '' }) + const onHash = () => { if (!runIdFromHash()) setRun(null) } + window.addEventListener('hashchange', onHash) + return () => window.removeEventListener('hashchange', onHash) + }, []) + + const start = async (key: string) => { + setStarting(key) + try { + const next = await api.start(key) + location.hash = `#/run/${next.id}` + setRun(next) + } catch { + setError('Could not start that chapter. Is the Rails server running?') + } finally { + setStarting(null) + } + } + + const next = run && scenarios.find((s) => s.chapter > run.scenario.chapter) + + return ( + <> + + {error &&

{error}

} + {run + ? { location.hash = '' }} onNext={next ? () => void start(next.key) : undefined} /> + : void start(k)} />} + + ) +} diff --git a/frontend/src/api.ts b/frontend/src/api.ts new file mode 100644 index 0000000..3bb5fd5 --- /dev/null +++ b/frontend/src/api.ts @@ -0,0 +1,33 @@ +import { createConsumer } from '@rails/actioncable' +import type { LiveState, Run, ScenarioSummary, Step } from './types' + +async function request(path: string, body?: unknown): Promise { + const res = await fetch(`/api${path}`, { + method: body === undefined ? 'GET' : 'POST', + headers: { 'Content-Type': 'application/json', Accept: 'application/json' }, + body: body === undefined ? undefined : JSON.stringify(body), + }) + if (!res.ok) throw new Error(`${res.status} ${res.statusText}`) + return res.json() as Promise +} + +export const api = { + scenarios: () => request('/scenarios'), + start: (scenario: string) => request('/runs', { scenario }), + run: (id: number) => request(`/runs/${id}`), + command: (id: number, input: string) => request(`/runs/${id}/commands`, { input }), + tick: (id: number) => request(`/runs/${id}/tick`, { ticks: 1 }), +} + +let consumer: ReturnType | null = null + +// Live panel updates (map, metrics, alerts). Terminal output always comes from +// the HTTP response, so a missing socket never loses anything. +export function subscribeToRun(id: number, onState: (state: LiveState) => void) { + consumer ??= createConsumer('/cable') + const sub = consumer.subscriptions.create( + { channel: 'RunChannel', run_id: id }, + { received: (data: LiveState) => onState(data) }, + ) + return () => { sub.unsubscribe() } +} diff --git a/frontend/src/components/ChapterPicker.tsx b/frontend/src/components/ChapterPicker.tsx new file mode 100644 index 0000000..e1ddd5b --- /dev/null +++ b/frontend/src/components/ChapterPicker.tsx @@ -0,0 +1,52 @@ +import type { ScenarioSummary } from '../types' +import { Icon } from './icons' + +// The story has five chapters; the ones without a scenario yet show as coming soon. +const STORY = [ + { chapter: 1, topic: 'GitHub', title: 'Open your first pull request', teaser: 'Branch, commit and open a PR for a small feature.' }, + { chapter: 2, topic: 'CI', title: 'The build is red', teaser: 'Read the CI logs and fix the failing test.' }, + { chapter: 3, topic: 'Deploy', title: 'Roll back a bad release', teaser: 'A release breaks the site. Roll it back, fast.' }, + { chapter: 4, topic: 'Linux', title: 'The disk is full', teaser: '' }, + { chapter: 5, topic: 'Monitoring', title: 'Memory is climbing', teaser: '' }, +] + +interface Props { + scenarios: ScenarioSummary[] + starting: string | null + onStart: (key: string) => void +} + +export function ChapterPicker({ scenarios, starting, onStart }: Props) { + return ( +
+
+
+
    + {STORY.map((ch, i) => { + const scenario = scenarios.find((s) => s.chapter === ch.chapter) + return ( +
  1. + 0{ch.chapter} +
    + {ch.topic} +

    {scenario?.title ?? ch.title}

    +

    {scenario?.summary ?? ch.teaser}

    +
    + {scenario ? ( + + ) : ( + Coming soon + )} +
  2. + ) + })} +
+
+ ) +} diff --git a/frontend/src/components/MetricChart.tsx b/frontend/src/components/MetricChart.tsx new file mode 100644 index 0000000..5ae811e --- /dev/null +++ b/frontend/src/components/MetricChart.tsx @@ -0,0 +1,36 @@ +import type { MetricPoint } from '../types' + +interface Props { + points: MetricPoint[] + metric: 'memory' | 'disk' + threshold: number +} + +// Area chart of the last few minutes, with the alert line drawn in. +export function MetricChart({ points, metric, threshold }: Props) { + const data = points.slice(-40).map((p) => p[metric]) + if (data.length < 2) data.unshift(data[0] ?? 0) + const w = 300, h = 96 + const step = w / (data.length - 1) + const y = (v: number) => h - (v / 100) * h + const line = 'M' + data.map((v, i) => `${(i * step).toFixed(1)},${y(v).toFixed(1)}`).join(' L') + const now = data.at(-1) ?? 0 + const tone = now >= threshold ? 'var(--bad)' : now >= threshold - 10 ? 'var(--warn)' : 'var(--ok)' + + return ( + + + + + + + + {[25, 50, 75].map((v) => )} + + ALERT {threshold}% + + + + + ) +} diff --git a/frontend/src/components/PlayScreen.tsx b/frontend/src/components/PlayScreen.tsx new file mode 100644 index 0000000..91287e3 --- /dev/null +++ b/frontend/src/components/PlayScreen.tsx @@ -0,0 +1,197 @@ +import { useCallback, useEffect, useRef, useState } from 'react' +import { api, subscribeToRun } from '../api' +import type { LiveState, Notice, Run } from '../types' +import { Icon } from './icons' +import { MetricChart } from './MetricChart' +import { SystemMap } from './SystemMap' +import { Terminal, type TerminalHandle } from './Terminal' + +const TICK_MS = 4000 +type Tab = 'map' | 'terminal' | 'steps' | 'alerts' +type DrawerTab = 'terminal' | 'logs' + +interface Props { + run: Run + onExit: () => void + onNext?: () => void +} + +export function PlayScreen({ run, onExit, onNext }: Props) { + const [live, setLive] = useState(run) + const [busy, setBusy] = useState(false) + const [hintShown, setHintShown] = useState(false) + const [tab, setTab] = useState('map') + const [drawer, setDrawer] = useState('terminal') + const [logService, setLogService] = useState(null) + const [flash, setFlash] = useState(null) + const term = useRef(null) + const scenario = run.scenario + const metric = scenario.focus_metric + const threshold = metric === 'disk' ? 90 : 85 + + const showNotices = useCallback((notices: Notice[]) => { + notices.forEach((n) => term.current?.print(n.text, n.kind === 'resolved' ? 'green' : 'amber')) + }, []) + + const celebrate = (completed: { title: string }[]) => { + if (!completed.length) return + completed.forEach((c) => term.current?.print(`✓ ${c.title}`, 'green')) + setFlash(completed.at(-1)!.title) + setHintShown(false) + window.setTimeout(() => setFlash(null), 2600) + } + + useEffect(() => subscribeToRun(run.id, setLive), [run.id]) + + // Time keeps moving while the player reads, so incidents evolve. + useEffect(() => { + if (live.status === 'completed') return + const timer = window.setInterval(async () => { + if (document.hidden || busy) return + try { + const step = await api.tick(run.id) + setLive(step) + showNotices(step.notices) + celebrate(step.completed) + } catch { /* the next tick will try again */ } + }, TICK_MS) + return () => window.clearInterval(timer) + }) + + const runCommand = useCallback(async (input: string) => { + setBusy(true) + try { + const step = await api.command(run.id, input) + // The server's `clear` sends screen-reset escapes; the terminal already handled it. + // oxlint-disable-next-line no-control-regex + if (step.output && !/^\s*clear\s*$/.test(input)) term.current?.print(step.output.replace(/\x1b\[[0-9;]*[HJ]/g, '')) + showNotices(step.notices) + setLive(step) + celebrate(step.completed) + } catch { + term.current?.print('Lost connection to the simulator. Is the Rails server running?', 'red') + } finally { + setBusy(false) + } + }, [run.id, showNotices]) + + const inspect = (command: string) => { + setDrawer('terminal') + setTab('terminal') + term.current?.suggest(command) + } + + const objectives = live.objectives + const doneCount = objectives.filter((o) => o.done).length + const current = objectives.find((o) => !o.done) + const firing = live.alerts.filter((a) => a.state === 'firing') + const points = live.metrics['web-01'] ?? [] + const now = points.at(-1)?.[metric] ?? 0 + const hotService = live.map.nodes.find((n) => n.status !== 'ok' && live.logs[n.id])?.id + const shownLogs = logService ?? hotService ?? 'shop-web' + + return ( +
+
+ +
+ +
+
+ +
+ {metric === 'disk' ? 'Disk' : 'Memory'} · web-01 +
= threshold ? 'bad' : now >= threshold - 10 ? 'warn' : 'ok'}`}>{now}%
+ +
    + {live.alerts.length === 0 &&
  • No alerts yet.
  • } + {live.alerts.slice(-3).reverse().map((a) => ( +
  • + {a.id} {a.summary} +
  • + ))} +
+
+
+ + +
+ +
+
+ + + {live.prompt.replace(/[$#]$/, '')} +
+ + {drawer === 'logs' && ( +
+
+ {Object.keys(live.logs).map((name) => ( + + ))} +
+
{(live.logs[shownLogs] ?? []).slice(-30).join('\n') || 'No log lines yet.'}
+
+ )} +
+ + {flash &&
{flash}
} + + +
+ ) +} diff --git a/frontend/src/components/SystemMap.tsx b/frontend/src/components/SystemMap.tsx new file mode 100644 index 0000000..6694b35 --- /dev/null +++ b/frontend/src/components/SystemMap.tsx @@ -0,0 +1,66 @@ +import { useEffect, useState } from 'react' +import type { MapNode } from '../types' + +// Where each part of the shop sits on the map, in % of the map's box. +const WIDE: Record = { + laptop: [12, 22], nginx: [35, 22], 'shop-web': [60, 22], disk: [86, 22], 'shop-worker': [60, 66], postgresql: [86, 66], +} +const NARROW: Record = { + laptop: [26, 9], nginx: [74, 9], 'shop-web': [26, 37], 'shop-worker': [74, 64], postgresql: [26, 91], disk: [74, 37], +} + +function useNarrow(query = '(max-width: 720px)') { + const [narrow, setNarrow] = useState(() => window.matchMedia(query).matches) + useEffect(() => { + const mq = window.matchMedia(query) + const on = () => setNarrow(mq.matches) + mq.addEventListener('change', on) + return () => mq.removeEventListener('change', on) + }, [query]) + return narrow +} + +interface Props { + nodes: MapNode[] + edges: [string, string][] + onInspect: (command: string) => void +} + +export function SystemMap({ nodes, edges, onInspect }: Props) { + const layout = useNarrow() ? NARROW : WIDE + const byId = Object.fromEntries(nodes.map((n) => [n.id, n])) + + return ( +
+ + {nodes.map((node) => { + const [x, y] = layout[node.id] ?? [50, 50] + return ( + + ) + })} +

Click a box to put a command for it in the terminal. Lines show who talks to whom.

+
+ ) +} diff --git a/frontend/src/components/Terminal.tsx b/frontend/src/components/Terminal.tsx new file mode 100644 index 0000000..a1e04c1 --- /dev/null +++ b/frontend/src/components/Terminal.tsx @@ -0,0 +1,158 @@ +import { FitAddon } from '@xterm/addon-fit' +import { Terminal as XTerm } from '@xterm/xterm' +import '@xterm/xterm/css/xterm.css' +import { forwardRef, useEffect, useImperativeHandle, useRef } from 'react' + +export interface TerminalHandle { + /** Print text (with \n line breaks) above the prompt, keeping what the player is typing. */ + print: (text: string, color?: 'amber' | 'green' | 'muted' | 'red') => void + /** Put a command on the prompt line without running it, so the player can read it first. */ + suggest: (command: string) => void + focus: () => void +} + +interface Props { + prompt: string + onCommand: (input: string) => Promise + busy: boolean + /** Shown once when the terminal opens, like a message of the day. */ + intro?: string +} + +const COLORS = { amber: '\x1b[38;2;255;181;71m', green: '\x1b[38;2;75;227;161m', muted: '\x1b[38;2;142;137;176m', red: '\x1b[38;2;255;143;166m' } +const RESET = '\x1b[0m' + +// A small line editor on top of xterm.js: typing, backspace, left/right, +// history with up/down, Ctrl+C, Ctrl+L and paste. Commands go to the server. +export const Terminal = forwardRef(function Terminal({ prompt, onCommand, busy, intro }, ref) { + const host = useRef(null) + const term = useRef(null) + const state = useRef({ line: '', cursor: 0, history: [] as string[], historyIndex: -1, prompt, busy, onCommand }) + state.current.prompt = prompt + state.current.busy = busy + state.current.onCommand = onCommand + + const promptText = () => `${COLORS.green}${state.current.prompt}${RESET} ` + + const drawnRows = useRef(0) + const redrawLine = () => { + const t = term.current + if (!t) return + const s = state.current + // Long input wraps over several rows; go back to the first one before redrawing. + const up = drawnRows.current > 0 ? `\x1b[${drawnRows.current}A` : '' + t.write(up + '\r\x1b[J' + promptText() + s.line) + drawnRows.current = Math.floor((s.prompt.length + 1 + s.line.length) / Math.max(t.cols, 1)) + const back = s.line.length - s.cursor + if (back > 0) t.write(`\x1b[${back}D`) + } + + useImperativeHandle(ref, () => ({ + print(text, color) { + const t = term.current + if (!t || !text) return + const body = text.replace(/\r?\n/g, '\r\n') + const up = drawnRows.current > 0 ? `\x1b[${drawnRows.current}A` : '' + drawnRows.current = 0 + t.write(up + '\r\x1b[J' + (color ? COLORS[color] + body + RESET : body) + '\r\n') + if (!state.current.busy) redrawLine() + }, + suggest(command) { + state.current.line = command + state.current.cursor = command.length + redrawLine() + term.current?.focus() + }, + focus: () => term.current?.focus(), + })) + + useEffect(() => { + const t = new XTerm({ + fontFamily: '"Geist Mono", ui-monospace, monospace', + fontSize: 13, + lineHeight: 1.35, + cursorBlink: true, + convertEol: false, + scrollback: 2000, + theme: { + background: '#08070F', foreground: '#C8C3E6', cursor: '#EEEAFB', selectionBackground: '#3A3466', + green: '#4BE3A1', yellow: '#FFB547', red: '#FF8FA6', blue: '#8B7BFF', brightBlack: '#8E89B0', + }, + }) + const fit = new FitAddon() + t.loadAddon(fit) + t.open(host.current!) + term.current = t + // Only fit while visible: on phones the terminal is display:none on other tabs, + // and fitting to a zero-size box would rewrap the prompt into fragments. + const resize = new ResizeObserver(() => { + if (!host.current?.offsetWidth) return + const dims = fit.proposeDimensions() + if (dims && (dims.cols !== t.cols || dims.rows !== t.rows)) fit.fit() + }) + resize.observe(host.current!) + t.onResize(() => redrawLine()) + if (intro) t.write(COLORS.muted + intro.replace(/\r?\n/g, '\r\n') + RESET + '\r\n\r\n') + redrawLine() + + const submit = async () => { + const s = state.current + const input = s.line + t.write('\r\n') + drawnRows.current = 0 + s.line = '' + s.cursor = 0 + s.historyIndex = -1 + if (input.trim()) { + if (s.history[0] !== input) s.history.unshift(input) + s.history.length = Math.min(s.history.length, 100) + if (/^\s*clear\s*$/.test(input)) { t.clear(); drawnRows.current = 0 } + await s.onCommand(input) + } + redrawLine() + } + + const insert = (text: string) => { + const s = state.current + s.line = s.line.slice(0, s.cursor) + text + s.line.slice(s.cursor) + s.cursor += text.length + redrawLine() + } + + const disposable = t.onData((data) => { + const s = state.current + if (s.busy) return + switch (data) { + case '\r': void submit(); return + case '\x7f': case '\b': + if (s.cursor > 0) { s.line = s.line.slice(0, s.cursor - 1) + s.line.slice(s.cursor); s.cursor--; redrawLine() } + return + case '\x03': t.write('^C\r\n'); drawnRows.current = 0; s.line = ''; s.cursor = 0; redrawLine(); return + case '\x0c': t.clear(); drawnRows.current = 0; redrawLine(); return + case '\x1b[A': + if (s.historyIndex < s.history.length - 1) { s.historyIndex++; s.line = s.history[s.historyIndex]; s.cursor = s.line.length; redrawLine() } + return + case '\x1b[B': + if (s.historyIndex >= 0) { s.historyIndex--; s.line = s.historyIndex < 0 ? '' : s.history[s.historyIndex]; s.cursor = s.line.length; redrawLine() } + return + case '\x1b[D': if (s.cursor > 0) { s.cursor--; t.write(data) } return + case '\x1b[C': if (s.cursor < s.line.length) { s.cursor++; t.write(data) } return + case '\x1b[H': case '\x01': s.cursor = 0; redrawLine(); return + case '\x1b[F': case '\x05': s.cursor = s.line.length; redrawLine(); return + } + if (data.startsWith('\x1b')) return + // Typed characters or a paste: take the first line, run it if a newline came with it. + const [first, ...rest] = data.split(/\r\n|\r|\n/) + // oxlint-disable-next-line no-control-regex + insert(first.replace(/[\x00-\x1f]/g, '')) + if (rest.length) void submit() + }) + + return () => { disposable.dispose(); resize.disconnect(); t.dispose() } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []) + + useEffect(() => { if (!busy) redrawLine() }, [prompt, busy]) + + return
+}) diff --git a/frontend/src/components/icons.tsx b/frontend/src/components/icons.tsx new file mode 100644 index 0000000..25d47d2 --- /dev/null +++ b/frontend/src/components/icons.tsx @@ -0,0 +1,22 @@ +// Simple stroke icons (no emoji as icons). +const paths: Record = { + bulb: 'M9 18h6M10 21h4M12 3a6 6 0 0 0-3.5 10.9c.6.5 1 1.2 1 2.1h5c0-.9.4-1.6 1-2.1A6 6 0 0 0 12 3z', + term: 'M4 17l6-5-6-5M12 19h8', + list: 'M9 6h11M9 12h11M9 18h11M4 6h.01M4 12h.01M4 18h.01', + bell: 'M6 16V11a6 6 0 1 1 12 0v5l2 2H4zM10 21h4', + map: 'M7 7l4 9M17 7l-4 9M7.5 6h9M5 8.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5zM19 8.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5zM12 20.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5z', + back: 'M15 18l-6-6 6-6', + moon: 'M20 14.5A8 8 0 0 1 9.5 4a8 8 0 1 0 10.5 10.5z', + sun: 'M12 16a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4', + check: 'M5 12.5l4.5 4.5L19 7.5', + lock: 'M5 11h14v9H5zM8 11V8a4 4 0 0 1 8 0v3', + play: 'M7 5l12 7-12 7z', +} + +export function Icon({ name, size = 18 }: { name: keyof typeof paths | string; size?: number }) { + return ( + + ) +} diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx new file mode 100644 index 0000000..b45bc4e --- /dev/null +++ b/frontend/src/main.tsx @@ -0,0 +1,10 @@ +import { StrictMode } from 'react' +import { createRoot } from 'react-dom/client' +import App from './App.tsx' +import './styles.css' + +createRoot(document.getElementById('root')!).render( + + + , +) diff --git a/frontend/src/styles.css b/frontend/src/styles.css new file mode 100644 index 0000000..d4f4ce7 --- /dev/null +++ b/frontend/src/styles.css @@ -0,0 +1,224 @@ +/* DevOps Simulator: "System map" theme. + Same token names as Royal's other projects, with this app's own values. */ +:root, +[data-theme='dark'] { + --font-sans: 'Geist', system-ui, sans-serif; + --font-mono: 'Geist Mono', ui-monospace, monospace; + + --ground: #0D0B1A; + --surface: #15132A; + --ink: #EEEAFB; + --muted: #A49FC2; + --line: #2A2747; + --accent: #8B7BFF; + --accent-ink: #0D0B1A; + --accent-tint: #221D45; + --ok: #4BE3A1; + --warn: #FFB547; + --bad: #FF6B8B; + --node-bg: #0D0B1A; + --dot: rgba(164, 159, 194, .22); + --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 30px rgba(0, 0, 0, .28); + --focus: 0 0 0 3px rgba(139, 123, 255, .35); + --radius-sm: 10px; --radius: 16px; --radius-lg: 22px; + color-scheme: dark; +} +[data-theme='light'] { + --ground: #F5F3FF; + --surface: #FFFFFF; + --ink: #17142B; + --muted: #57527A; + --line: #E2DEF5; + --accent: #5B47F0; + --accent-ink: #FFFFFF; + --accent-tint: #ECE9FF; + --ok: #138A5A; + --warn: #A15C00; + --bad: #C2264B; + --node-bg: #FBFAFF; + --dot: rgba(87, 82, 122, .18); + --shadow: 0 1px 2px rgba(23, 20, 43, .04), 0 10px 26px rgba(23, 20, 43, .07); + --focus: 0 0 0 3px rgba(91, 71, 240, .25); + color-scheme: light; +} + +* { box-sizing: border-box; } +html, body { margin: 0; } +body { font: 14px/1.5 var(--font-sans); color: var(--ink); background: var(--ground); -webkit-font-smoothing: antialiased; } +h1, h2 { margin: 0; letter-spacing: -0.02em; } +p { margin: 0; } +button { font: inherit; color: inherit; } +:focus-visible { outline: none; box-shadow: var(--focus); } +.mono { font-family: var(--font-mono); } +.muted { color: var(--muted); } +.icon { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; } +.eyebrow { font: 600 11px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); } +.row { display: flex; gap: 8px; flex-wrap: wrap; } + +.logo { width: 34px; height: 34px; border-radius: 11px; background: conic-gradient(from 200deg, var(--accent), var(--ok), var(--accent)); flex: none; } +.logo.big { width: 48px; height: 48px; border-radius: 15px; } + +.btn { min-height: 44px; padding: 0 18px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; border: 1px solid var(--line); background: transparent; + transition: transform .2s cubic-bezier(.2,.7,.2,1), box-shadow .2s, background .2s; } +.btn:hover { transform: translateY(-1px); } +.btn:disabled { opacity: .6; cursor: default; transform: none; } +.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 35%, transparent); } +.icon-btn { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: transform .2s, background .2s; } +.icon-btn:hover { transform: translateY(-1px); } +.theme-toggle { position: fixed; top: 16px; right: 16px; z-index: 20; } + +.chip { font: 600 12px var(--font-sans); padding: 6px 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; } +.chip i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; } +.chip.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 15%, transparent); } +.chip.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); } +.chip.soon { color: var(--muted); background: color-mix(in srgb, var(--muted) 12%, transparent); } + +.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); } +.banner { position: fixed; left: 50%; top: 16px; transform: translateX(-50%); z-index: 30; background: var(--surface); border: 1px solid var(--bad); color: var(--ink); padding: 10px 16px; border-radius: 14px; box-shadow: var(--shadow); max-width: calc(100% - 100px); } + +.rise { animation: rise .55s cubic-bezier(.2,.7,.2,1) both; } +@keyframes rise { from { transform: translateY(8px); } to { transform: none; } } + +/* ---------- chapter picker ---------- */ +.picker { max-width: 920px; margin: 0 auto; padding: 72px 24px 64px; display: grid; gap: 36px; } +.picker-head { display: grid; gap: 14px; justify-items: start; } +.picker-head h1 { font-size: clamp(36px, 6vw, 60px); line-height: 1.02; letter-spacing: -0.035em; max-width: 16ch; } +.picker-head .lede { font-size: 17px; color: var(--muted); max-width: 52ch; } +.chapters { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; } +.chapter { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 20px 22px; transition: transform .2s, border-color .2s; } +.chapter:not(.soon):hover { transform: translateX(2px); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); } +.chapter-n { font-size: 20px; font-weight: 600; color: var(--accent); } +.chapter h2 { font-size: 19px; } +.chapter.soon h2, .chapter.soon .chapter-n { color: var(--muted); } + +/* ---------- play screen ---------- */ +.play { height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 18px; padding: 18px 28px 24px; } +.play-top { display: flex; align-items: center; gap: 14px; padding-right: 60px; } +.titles { min-width: 0; } +.titles h1 { font-size: 22px; } +.sub { color: var(--muted); font-size: 13px; } +.play-top .chip { margin-left: auto; } + +.stage { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; min-height: 0; } +.side { display: grid; gap: 14px; align-content: start; min-height: 0; overflow-y: auto; scrollbar-width: thin; } +.stage > * { min-height: 0; } +.pane-map { height: 100%; position: relative; } +.gauge { position: absolute; bottom: 40px; left: 14px; width: min(280px, 32%); z-index: 2; padding: 14px 16px; display: grid; gap: 4px; + background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(6px); } +.gauge .metric { font-size: 28px; } + +.map { position: relative; height: 100%; min-height: 360px; border-radius: var(--radius-lg); border: 1px solid var(--line); overflow: hidden; + background: radial-gradient(circle at 1px 1px, var(--dot) 1px, transparent 0) 0 0 / 22px 22px, var(--surface); } +.wires { position: absolute; inset: 0; width: 100%; height: 100%; } +.wire { stroke: var(--line); stroke-width: 1.5px; } +.wire.hot { stroke: var(--warn); stroke-width: 2px; stroke-dasharray: 3 4; animation: flow 1s linear infinite; } +@keyframes flow { to { stroke-dashoffset: -14; } } +.node { position: absolute; transform: translate(-50%, -50%); min-width: 150px; max-width: 46%; text-align: left; display: grid; gap: 3px; padding: 12px 14px; cursor: pointer; + background: var(--node-bg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); + transition: transform .2s cubic-bezier(.2,.7,.2,1), border-color .2s, box-shadow .2s; } +.node:hover { transform: translate(-50%, calc(-50% - 2px)); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); } +.node:focus-visible { box-shadow: var(--focus), var(--shadow); } +.node-kind { font: 600 10.5px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); } +.node-name { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; } +.node-status { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; color: var(--ok); } +.node-status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; } +.node.warn { border-color: var(--warn); box-shadow: 0 0 0 6px color-mix(in srgb, var(--warn) 14%, transparent), var(--shadow); animation: glow 1.8s ease-in-out infinite; } +.node.warn .node-status { color: var(--warn); } +.node.bad { border-color: var(--bad); box-shadow: 0 0 0 6px color-mix(in srgb, var(--bad) 16%, transparent), var(--shadow); animation: glow-bad 1.8s ease-in-out infinite; } +.node.bad .node-status { color: var(--bad); } +@keyframes glow { 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--warn) 6%, transparent), var(--shadow); } } +@keyframes glow-bad { 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--bad) 6%, transparent), var(--shadow); } } +.node-bar { height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 4px; } +.node-bar i { display: block; height: 100%; background: var(--warn); border-radius: 999px; transition: width .6s cubic-bezier(.2,.7,.2,1); } +.map-legend { position: absolute; right: 18px; bottom: 14px; font-size: 12px; color: var(--muted); } + +.quest { padding: 20px; display: grid; gap: 12px; border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); + background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), var(--surface) 55%); } +.quest h2 { font-size: 19px; line-height: 1.25; } +.quest .hint { background: var(--accent-tint); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13.5px; } +.dots { display: flex; gap: 6px; } +.dots i { flex: 1; height: 6px; border-radius: 999px; background: var(--line); transition: background .3s; } +.dots .done { background: var(--ok); } +.dots .current { background: var(--accent); } +.steps { list-style: none; margin: 4px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); display: grid; gap: 2px; } +.steps li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 4px; color: var(--muted); font-size: 13px; border-radius: 8px; transition: transform .2s, background .2s; } +.steps li:hover { transform: translateX(2px); } +.steps .tick { width: 20px; height: 20px; border-radius: 6px; border: 1px solid var(--line); display: grid; place-items: center; font: 600 11px var(--font-mono); flex: none; } +.steps .done { color: var(--ink); } +.steps .done .tick { background: var(--ok); border-color: var(--ok); color: var(--ground); } +.steps .done .tick .icon { stroke-width: 3; } +.steps .current { color: var(--ink); font-weight: 600; } +.steps .current .tick { border-color: var(--accent); color: var(--accent); } + +.metric { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; transition: color .3s; } +.metric.ok { color: var(--ok); } .metric.warn { color: var(--warn); } .metric.bad { color: var(--bad); } +.chart { width: 100%; height: auto; display: block; overflow: visible; } +.gridline { stroke: color-mix(in srgb, var(--muted) 18%, transparent); } +.chart-label { font: 500 10.5px var(--font-mono); } +.alerts { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; font-size: 12.5px; } +.alerts li { display: flex; gap: 8px; align-items: baseline; } +.alerts li i { width: 7px; height: 7px; border-radius: 50%; flex: none; transform: translateY(-1px); } +.alerts .firing i { background: var(--warn); } +.alerts .resolved { color: var(--muted); } +.alerts .resolved i { background: var(--ok); } + +/* terminal drawer: always dark, like a real terminal */ +.drawer { border-radius: var(--radius-lg); background: #08070F; border: 1px solid #221F3A; overflow: hidden; display: flex; flex-direction: column; } +.drawer-bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid #1A1830; } +.drawer-bar button { min-height: 32px; padding: 0 12px; border-radius: 8px; border: 0; background: transparent; color: #8E89B0; font: 500 12px var(--font-mono); cursor: pointer; transition: background .2s, color .2s; } +.drawer-bar button.on { background: #1A1830; color: #EEEAFB; } +.drawer-bar .where { margin-left: auto; color: #8E89B0; font-size: 12px; } +.drawer-body { height: clamp(200px, 30vh, 300px); padding: 10px 6px 6px 14px; } +.xterm-host { width: 100%; height: 100%; } +.xterm-host .xterm-viewport { background: transparent !important; } +.logs { height: clamp(200px, 30vh, 300px); display: grid; grid-template-rows: auto 1fr; } +.log-pick { display: flex; gap: 6px; padding: 10px 14px 0; flex-wrap: wrap; } +.log-pick button { min-height: 30px; padding: 0 10px; border-radius: 999px; border: 1px solid #221F3A; background: transparent; color: #8E89B0; font: 500 12px var(--font-mono); cursor: pointer; } +.log-pick button.on { border-color: #8B7BFF; color: #EEEAFB; } +.logs pre { margin: 0; padding: 10px 14px; overflow: auto; font: 12px/1.6 var(--font-mono); color: #C8C3E6; white-space: pre; } + +.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 40; display: flex; gap: 8px; align-items: center; padding: 12px 18px; border-radius: 999px; + background: var(--ok); color: #04140C; font-weight: 600; box-shadow: 0 12px 30px rgba(0,0,0,.3); animation: rise .4s cubic-bezier(.2,.7,.2,1) both; } +.dock { display: none; } + +/* short screens: let the page scroll instead of squeezing the map */ +@media (max-height: 760px) and (min-width: 721px) { .play { height: auto; min-height: 100vh; } } + +/* ---------- phones ---------- */ +@media (max-width: 720px) { + .play { height: auto; min-height: 100dvh; padding: 14px 14px 104px; gap: 14px; grid-template-rows: auto; align-content: start; } + .play-top { padding-right: 52px; } + .play-top .chip, .sub { display: none; } + .titles h1 { font-size: 19px; } + .stage { grid-template-columns: minmax(0, 1fr); } + .map { min-height: 560px; } + .map-legend { display: none; } + .node { min-width: 0; width: 42%; max-width: 42%; padding: 10px 12px; } + .node-kind { font-size: 9.5px; } + .node-name { font-size: 14px; } + .drawer-body, .logs { height: 52vh; } + .theme-toggle { top: 14px; right: 14px; } + .chapter { grid-template-columns: minmax(0, 1fr); gap: 10px; } + .picker { padding: 72px 16px 40px; } + + /* one section at a time, picked from the dock */ + .play[data-tab='map'] .pane-steps, .play[data-tab='map'] .pane-alerts, .play[data-tab='map'] .pane-terminal, + .play[data-tab='terminal'] .pane-map, .play[data-tab='terminal'] .side, + .play[data-tab='steps'] .pane-map, .play[data-tab='steps'] .pane-alerts, .play[data-tab='steps'] .pane-terminal, + .play[data-tab='alerts'] .pane-steps, .play[data-tab='alerts'] .pane-terminal { display: none; } + .play[data-tab='map'] .quest { display: grid; } + .play[data-tab='terminal'] .stage { display: none; } + .play[data-tab='map'] .gauge, .play[data-tab='steps'] .gauge { display: none; } + .play[data-tab='alerts'] .pane-map { display: block; } + .play[data-tab='alerts'] .map { display: none; } + .gauge { position: static; width: auto; backdrop-filter: none; background: var(--surface); } + + .dock { display: flex; position: fixed; left: 12px; right: 12px; bottom: 14px; z-index: 20; gap: 4px; padding: 6px; border-radius: 22px; background: #08070F; border: 1px solid #221F3A; box-shadow: 0 10px 30px rgba(0,0,0,.35); } + .dock button { flex: 1; min-height: 52px; display: grid; place-items: center; align-content: center; gap: 2px; border: 0; border-radius: 16px; background: transparent; color: #8E89B0; font-size: 11px; font-weight: 600; cursor: pointer; } + .dock button.on { background: var(--accent); color: var(--accent-ink); } + .toast { bottom: 96px; } +} + +@media (prefers-reduced-motion: reduce) { + *, *::before, *::after { animation: none !important; transition: none !important; } +} diff --git a/frontend/src/types.ts b/frontend/src/types.ts new file mode 100644 index 0000000..a89b002 --- /dev/null +++ b/frontend/src/types.ts @@ -0,0 +1,64 @@ +export type Status = 'ok' | 'warn' | 'bad' + +export interface ScenarioSummary { + key: string + title: string + topic: string + chapter: number + summary: string + focus_metric: 'memory' | 'disk' +} + +export interface Objective { id: string; title: string; done: boolean } + +export interface Alert { + id: string + state: 'firing' | 'resolved' + severity: string + summary: string + fired_at: number + acknowledged: boolean +} + +export interface MetricPoint { t: number; memory: number; disk: number; cpu: number } + +export interface MapNode { + id: string + label: string + kind: string + host: string + status: Status + detail: string + level?: number + inspect?: string +} + +export interface Notice { kind: 'alert' | 'resolved' | string; text: string } + +export interface LiveState { + id: number + status: 'active' | 'completed' + clock: number + time: string + prompt: string + objectives: Objective[] + alerts: Alert[] + metrics: Record + services: Record> + current_host: string + hint: string | null + map: { nodes: MapNode[]; edges: [string, string][] } + logs: Record +} + +export interface Run extends LiveState { + scenario: ScenarioSummary & { briefing: string } +} + +export interface Step extends LiveState { + type: 'step' + output: string + exit_code: number + notices: Notice[] + completed: { id: string; title: string }[] +} diff --git a/frontend/tsconfig.app.json b/frontend/tsconfig.app.json new file mode 100644 index 0000000..6830b6f --- /dev/null +++ b/frontend/tsconfig.app.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", + "target": "es2023", + "lib": ["ES2023", "DOM"], + "module": "esnext", + "types": ["vite/client"], + "allowArbitraryExtensions": true, + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "moduleDetection": "force", + "noEmit": true, + "jsx": "react-jsx", + + /* Linting */ + "noUnusedLocals": true, + "noUnusedParameters": true, + "erasableSyntaxOnly": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src"] +} diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json new file mode 100644 index 0000000..1ffef60 --- /dev/null +++ b/frontend/tsconfig.json @@ -0,0 +1,7 @@ +{ + "files": [], + "references": [ + { "path": "./tsconfig.app.json" }, + { "path": "./tsconfig.node.json" } + ] +} diff --git a/frontend/tsconfig.node.json b/frontend/tsconfig.node.json new file mode 100644 index 0000000..8455dcb --- /dev/null +++ b/frontend/tsconfig.node.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", + "target": "es2023", + "lib": ["ES2023"], + "types": ["node"], + "skipLibCheck": true, + + /* Bundler mode */ + "module": "nodenext", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "moduleDetection": "force", + "noEmit": true, + + /* Linting */ + "noUnusedLocals": true, + "noUnusedParameters": true, + "erasableSyntaxOnly": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["vite.config.ts"] +} diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts new file mode 100644 index 0000000..595c553 --- /dev/null +++ b/frontend/vite.config.ts @@ -0,0 +1,13 @@ +import react from '@vitejs/plugin-react' +import { defineConfig } from 'vite' + +// The Rails API runs on :3000. Proxying keeps everything same-origin in dev. +export default defineConfig({ + plugins: [react()], + server: { + proxy: { + '/api': 'http://localhost:3000', + '/cable': { target: 'ws://localhost:3000', ws: true }, + }, + }, +}) From 9181b29ab10532b6b3d3258b862e645d4e1a56d4 Mon Sep 17 00:00:00 2001 From: Royal <88779808+royalpriest@users.noreply.github.com> Date: Fri, 20 Nov 2026 23:56:10 +0000 Subject: [PATCH 2/2] Use actions/checkout v7 in the frontend CI job too --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b3238da..2664b00 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,7 @@ jobs: run: working-directory: frontend steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - uses: actions/setup-node@v4 with: