Compare commits

..
21 Commits
Author SHA1 Message Date
ars9 2281a8729b chore: code reference modal
CI / changes (push) Successful in 6s
CI / version (push) Successful in 6s
CI / server (push) Successful in 1m24s
CI / client (push) Successful in 1m34s
CI / image (push) Successful in 1m57s
- step and snippet editors open a reference of the script runtime and
  its context API from a (?) button next to the Code label
- bump version to 1.24.0
2026-10-01 14:50:23 +03:00
ars9 e3c2c0cebb Merge pull request 'feat(client): add code reference modal to step and snippet editors' (#4) from feat/code-context-help into master
CI / changes (push) Successful in 5s
CI / server (push) Skipped
CI / version (push) Successful in 5s
CI / client (push) Successful in 1m18s
CI / image (push) Skipped
Reviewed-on: #4
2026-10-01 14:48:35 +03:00
ars9 daecf3d539 feat(client): add code reference modal to step and snippet editors
CI / changes (pull_request) Successful in 7s
CI / version (pull_request) Skipped
CI / server (pull_request) Skipped
CI / client (pull_request) Successful in 1m13s
CI / image (pull_request) Skipped
- a (?) button next to the Code label on the step and snippet
  create/edit pages opens a reference of the script runtime: globals,
  every context member with examples, and pitfalls such as awaiting
  getStepOutput and assert
- the reference lives in components/modals/code-help.md and is
  rendered as markdown
- Modal takes size="lg" for document-like content; the dialog is
  capped to the viewport and its body scrolls, focusable when lg so
  the keyboard can scroll it
- docs/scenario.md notes that getStepOutput is async and points to
  the in-app reference to keep in sync
2026-10-01 14:45:03 +03:00
ars9 71259bc11d chore: run log context, data and debug level
CI / changes (push) Successful in 6s
CI / version (push) Successful in 6s
CI / server (push) Successful in 1m9s
CI / client (push) Successful in 1m17s
CI / image (push) Successful in 1m48s
- scenario run log entries carry a context (step/snippet/assertion/run)
  and a data payload split out from the message, plus a new debug level
- run detail page shows the full log list in a terminal-style viewer
  instead of a paginated table
- bump version to 1.23.0
2026-10-01 14:24:01 +03:00
ars9 d085ea3ded Merge pull request 'Add log context and data' (#2) from feat/run-log-context into master
CI / changes (push) Successful in 6s
CI / version (push) Successful in 7s
CI / server (push) Successful in 1m4s
CI / client (push) Successful in 1m22s
CI / image (push) Skipped
Reviewed-on: #2
2026-10-01 14:19:39 +03:00
ars9 1273491eee feat(scenario): split log args into message/data and add debug level
CI / changes (pull_request) Successful in 12s
CI / version (pull_request) Skipped
CI / server (pull_request) Successful in 1m4s
CI / client (pull_request) Successful in 1m33s
CI / image (pull_request) Skipped
- context.log/warn/error and console.* split arguments: strings join
  into message, object/array args are kept out of it and stored as
  the log entry's new data column (JSON), so message stays a stable
  string regardless of an object's shape
- added a debug log level alongside log/warn/error, including
  context.debug() and console.debug() (previously folded into log)
- CSV/Markdown run log export include the data column/block
- LogOutput renders data pretty-printed in a separate block below
  the message, and dims debug entries with a dedicated grey token
  calibrated to the WCAG AA contrast floor
2026-10-01 14:09:45 +03:00
ars9 6cba785e2f feat(scenario): tag run log entries with their context
- scenario_run_logs gains a context column (step:N, snippet:alias,
  assertion:pass/fail, run), tracked through a call stack in
  CodeExecutorService so nested runSnippet calls tag their own and
  inner log lines
- automatic step started/passed/failed entries and the Playwright
  trace upload notice are tagged accordingly
- run log export (CSV/Markdown) and the logs search match context
  as well as message
- add a LogOutput UI component: a terminal-style log viewer with
  level color coding, elapsed-time-since-start timestamps and a
  context tag, replacing the generic Table on the run detail page
- show the full log list instead of paginating it, capped to a
  scrollable block
- fix migrations.spec.ts's revert test, which only undid the last
  migration instead of all of them
2026-10-01 13:26:07 +03:00
ars9 5152fffe82 Merge pull request 'Chore/ci path filters and registry version check' (#1) from chore/ci-path-filters-and-registry-version-check into master
CI / changes (push) Successful in 6s
CI / version (push) Successful in 6s
CI / server (push) Successful in 1m24s
CI / client (push) Successful in 1m15s
CI / image (push) Skipped
Reviewed-on: #1
2026-10-01 12:30:58 +03:00
ars9 9df8a652dc ci: guard image job with an explicit push-event check
CI / changes (pull_request) Successful in 7s
CI / version (pull_request) Skipped
CI / server (pull_request) Successful in 1m6s
CI / client (pull_request) Successful in 1m20s
CI / image (pull_request) Skipped
- defense in depth alongside the version job's existing push-only
  condition, so the image job can't run on pull requests
2026-10-01 12:29:08 +03:00
ars9 e577ee8683 ci: skip unaffected jobs and rebuilt image versions
CI / changes (pull_request) Successful in 11s
CI / version (pull_request) Skipped
CI / server (pull_request) Successful in 1m10s
CI / client (pull_request) Successful in 1m23s
CI / image (pull_request) Skipped
- server and client jobs only run when their directory (or shared
  root files) changed, via a new changes job using dorny/paths-filter
- the version job now checks the registry for an existing image tag
  of the current package.json version instead of diffing against the
  previous commit's package.json, so the image job is skipped once
  that version has already been pushed
- the image job tolerates server/client being skipped rather than
  requiring both to succeed
2026-10-01 12:26:57 +03:00
ars9 0e998333e0 docs(claude): require a branch for features, chores and fixes
- master is reserved for version-bump release commits
2026-10-01 12:23:09 +03:00
ars9 2840df68b2 docs: add quick install script and README section
CI / server (push) Successful in 1m39s
CI / client (push) Successful in 1m23s
CI / version (push) Successful in 7s
CI / image (push) Skipped
- scripts/install.sh prompts for install directory, port and version,
  then writes a compose.yaml using the published registry image and
  creates a data/ directory for the SQLite volume
- README documents a one-line curl | bash install using the script's
  raw URL on the Gitea instance
2026-10-01 12:20:20 +03:00
ars9 0341fc2201 docs(claude): tag version commits with their changelog entry
CI / server (push) Successful in 1m24s
CI / client (push) Successful in 1m43s
CI / version (push) Successful in 6s
CI / image (push) Skipped
- add a step to tag each version-bump commit as v<version>, annotated
  with that version's changelog entry verbatim
- push tags with git push --follow-tags
2026-10-01 12:04:43 +03:00
ars9 bba6eb2f94 chore: license the project under mit
CI / server (push) Successful in 1m9s
CI / client (push) Successful in 1m23s
CI / version (push) Successful in 6s
CI / image (push) Successful in 2m7s
- add the mit LICENSE and set license and author in all package.json
  files, plus a license section in the readme
- generate the license notices of all shipped production dependencies
  and node.js in a dockerfile stage and serve them at /licenses.txt,
  linked from the sidebar footer
- keep license files when slimming node_modules in the image
- add oci labels, with the version passed in by ci
- document licensing in the development docs
- bump version to 1.22.2
2026-10-01 11:44:51 +03:00
ars9 531754c3fa test(server): stop timing-dependent failures on busy ci runners
- raise the jest test timeout to 30s: building the nest app in
  beforeAll can exceed the 5s default when all suites start at once
- accept any run status when reading back a just-created run, since
  the scheduler may already have picked it up
2026-10-01 11:44:51 +03:00
ars9 cafc126d1b ci: set the image registry explicitly
- use REGISTRY (git.hq.ars9.space) for login and image tags instead of
  deriving it from the server url, which is the runner's registration
  address and may be internal-only
- document how jobs reach gitea when the runner uses an internal address
2026-10-01 11:11:39 +03:00
ars9 f24a1b7dd5 ci: add gitea actions for quality checks and versioned images
- run server lint, type-check, tests and build, and client lint, build
  and storybook tests on master and pull requests
- when a push to master changes the package.json version, build the
  docker image and push it to the gitea registry tagged with the
  version and latest
- document the workflow and the REGISTRY_TOKEN secret
2026-10-01 11:07:42 +03:00
ars9 63c2df96f1 build(docker): slim down the runtime image
- install production dependencies and chromium in a separate stage
- drop source maps, typescript sources and declarations, docs,
  typeorm's browser build, better-sqlite3's c sources and ffmpeg
- base the runtime on debian:bookworm-slim with only the node binary
- document the image layout
- bump version to 1.22.1
2026-10-01 10:52:47 +03:00
ars9 23fa302b25 feat(scenarios): export used snippets with a scenario
- list the snippets a scenario uses in the export dialog, checked by
  default, with the versions the scenario uses
- export each selected snippet once per used version (latest and
  pinned) via the new snippetIds query parameter
- resolve used snippets from the exported version's steps
- show the scenario version in the export dialog
- document the export query parameters
- bump version to 1.22.0
2026-10-01 10:45:39 +03:00
ars9 f43d902297 feat(credentials): hide credential data until revealed
- add a RevealableCodeBlock ui component that renders its code only
  after the user clicks Reveal, with a storybook story
- use it for the data section of the credential page
- bump version to 1.21.1
2026-10-01 10:36:37 +03:00
ars9 2129708819 feat(ui): color-code uuid badges and highlight them on hover
- show a circle colored by the first 6 hex digits of the uuid,
  bordered with the badge text color for contrast in both themes
- lighten the uuid badge background on hover
- let Badge accept a className
- add a storybook story with six sample uuids and a randomize button
- bump version to 1.21.0
2026-10-01 10:23:50 +03:00
62 changed files with 1934 additions and 741 deletions

No files matched your search

+138
View File
@@ -0,0 +1,138 @@
# Code quality checks on master and pull requests. The server and client jobs
# only run when their directory (or shared root files) changed. On a push to
# master, also builds the Docker image and pushes it to this Gitea instance's
# container registry, tagged with the root package.json version and `latest`
# - unless that version's image already exists in the registry, in which case
# the push is skipped.
#
# Needs a repository (or owner) secret REGISTRY_TOKEN: a Gitea access token
# with package write access for the repository owner. The registry host is
# set explicitly below rather than taken from the server URL, which is the
# address the runner was registered with and may be internal-only.
name: CI
on:
push:
branches: [master]
pull_request:
env:
REGISTRY: git.hq.ars9.space
jobs:
changes:
runs-on: ubuntu-latest
outputs:
server: ${{ steps.filter.outputs.server }}
client: ${{ steps.filter.outputs.client }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
server:
- 'server/**'
- 'package.json'
- 'package-lock.json'
- '.gitea/workflows/ci.yml'
client:
- 'client/**'
- 'package.json'
- 'package-lock.json'
- '.gitea/workflows/ci.yml'
server:
needs: changes
if: needs.changes.outputs.server == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
- run: npm ci -w server
- name: Lint
run: npm run -w server lint -- --max-warnings=0
- name: Type-check
run: npx tsc --noEmit -p server/tsconfig.json
- name: Test
run: npm test -w server
- name: Build
run: npm run -w server build
client:
needs: changes
if: needs.changes.outputs.client == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
- run: npm ci -w client
- name: Lint
run: npm run -w client lint -- --max-warnings=0
- name: Build
run: npm run -w client build
- name: Install headless Chromium for Storybook tests
run: npx playwright install --with-deps --only-shell chromium
- name: Storybook tests
run: npm run -w client test:storybook
# Skips the image job if the registry already has this version's image
version:
if: github.event_name == 'push'
runs-on: ubuntu-latest
outputs:
version: ${{ steps.check.outputs.version }}
changed: ${{ steps.check.outputs.changed }}
steps:
- uses: actions/checkout@v4
- id: check
env:
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
OWNER: ${{ github.repository_owner }}
run: |
version=$(node -p "require('./package.json').version")
image="${REGISTRY}/$(echo "${GITHUB_REPOSITORY}" | tr '[:upper:]' '[:lower:]')"
echo "$REGISTRY_TOKEN" | docker login "$REGISTRY" -u "$OWNER" --password-stdin
if docker manifest inspect "${image}:${version}" >/dev/null 2>&1; then
echo "version ${version}: image already in registry, skipping"
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "version ${version}: not in registry, building"
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
echo "version=${version}" >> "$GITHUB_OUTPUT"
image:
needs: [server, client, version]
# server/client may be skipped when their paths didn't change
if: |
!failure() && !cancelled() &&
github.event_name == 'push' &&
needs.version.outputs.changed == 'true' &&
(needs.server.result == 'success' || needs.server.result == 'skipped') &&
(needs.client.result == 'success' || needs.client.result == 'skipped')
runs-on: ubuntu-latest
env:
VERSION: ${{ needs.version.outputs.version }}
steps:
- uses: actions/checkout@v4
- name: Log in to the registry
env:
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
OWNER: ${{ github.repository_owner }}
run: |
echo "IMAGE=${REGISTRY}/$(echo "${GITHUB_REPOSITORY}" | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_ENV"
echo "$REGISTRY_TOKEN" | docker login "$REGISTRY" -u "$OWNER" --password-stdin
- name: Build
run: docker build --build-arg VERSION="${VERSION}" -t "${IMAGE}:${VERSION}" -t "${IMAGE}:latest" .
- name: Push
run: |
docker push "${IMAGE}:${VERSION}"
docker push "${IMAGE}:latest"
+77
View File
@@ -2,6 +2,83 @@
All notable changes to this project will be documented in this file.
## 1.24.0 - 2026-10-01
Changes since 1.23.0:
### Added
- Code reference in the UI: a (?) button next to the Code label on the step and snippet create/edit pages opens a modal documenting the script runtime - the globals (`context`, `expect`, `console`, and `args` in snippets) and every `context` member with examples, including pitfalls such as awaiting `getStepOutput()` and `assert()`, and `downloadFile()` not sending the browser's cookies.
### Changed
- `Modal` UI component: new `size="lg"` for long, document-like content. Dialogs are now capped to the viewport height and their body scrolls, instead of overflowing the screen.
## 1.23.0 - 2026-10-01
Changes since 1.22.2:
### Added
- Run log entries now carry a `context` (where the message was generated: `step:<N>`, `snippet:<alias>`, `assertion:pass`/`fail`, or `run`) and a `data` field: `context.log`/`warn`/`error` and `console.*` split their arguments so strings join into `message` while object/array arguments are kept separate as `data` (JSON), instead of being `JSON.stringify`'d into the message text.
- Added a `debug` log level (`context.debug()`, `console.debug()`), alongside `log`/`warn`/`error`.
- New `LogOutput` UI component: a terminal-style log viewer on the run detail page, color-coded by level, with an elapsed-time-since-start column, a context tag, and `data` rendered pretty-printed in a separate block below the message. The full log list is shown (no more pagination), capped to a scrollable block.
- Run log CSV/Markdown export (`GET /scenarios/:id/runs/:runId/export`) include the new `context` and `data` columns/blocks; the logs search (`?q=`) also matches `context`.
## 1.22.2 - 2026-10-01
Changes since 1.22.1:
### Added
- MIT license (`LICENSE`), declared in all `package.json` files and the README.
- The Docker image includes the license notices of everything it ships: `scripts/third-party-licenses.mjs` collects the license of every production dependency of the client and server, the Node.js license is added, and the result is served at `/licenses.txt`, linked as "Licenses" in the sidebar footer.
- OCI image labels for title, version, license and source; CI passes the version as the `VERSION` build arg.
### Fixed
- The Docker image keeps packages' `LICENSE.md`/`NOTICE.md` files, which the 1.22.1 slimming step deleted along with other Markdown files.
## 1.22.1 - 2026-10-01
Changes since 1.22.0:
### Changed
- The Docker image is about 20% smaller (1.09 GB → 876 MB on disk, 251 MB → 220 MB compressed). Production dependencies and Chromium are installed in a separate stage that drops files nothing loads at runtime (source maps, TypeScript sources and declarations, docs, TypeORM's browser build, better-sqlite3's C sources, Playwright's ffmpeg). The runtime image is `debian:bookworm-slim` with only the `node` binary, so it no longer contains `npm`, `npx`, `yarn` or `corepack`.
## 1.22.0 - 2026-10-01
Changes since 1.21.1:
### Added
- The Export Scenario dialog lists the snippets the scenario uses (including ones used only through other snippets), all checked by default. A selected snippet is exported once per version the scenario uses: the latest for `runSnippet("alias")`, plus each version pinned with `alias@N`. `GET /scenarios/:id/export` takes the new `snippetIds` query parameter for this.
- The Export Scenario dialog shows the scenario version next to its name and id.
## 1.21.1 - 2026-10-01
Changes since 1.21.0:
### Changed
- The credential page hides the credential data when it opens; a Reveal button shows it and Hide hides it again. The data is not rendered on the page until revealed.
### Added
- A `RevealableCodeBlock` UI component (a CodeBlock that starts hidden behind a Reveal/Hide button), with a Storybook story.
## 1.21.0 - 2026-10-01
Changes since 1.20.2:
### Added
- UUID badges show a small colored circle in front of the short id. Its color comes from the first 6 hex digits of the UUID, so the same id always gets the same color, and its border uses the badge text color to stay visible in both themes.
- UUID badges get lighter on hover to show they can be clicked.
- `Badge` accepts an optional `className`.
- A Storybook "Colors" story for UuidBadge with six sample ids and a button to randomize them.
## 1.20.2 - 2026-09-30
Changes since 1.20.1:
+14 -1
View File
@@ -26,6 +26,10 @@ Rebuild and restart: `docker compose up -d --build`. Check with `docker compose
The live database is `data/liqa.db`. The container applies pending migrations before starting the server, so back it up before deploying a release with new migrations.
## Branching
Never commit directly to `master` when implementing a feature, chore or bug fix: create a separate branch for the work first. Only version-bump release commits (see "Committing a new version") are made on `master`.
## Code quality
Before committing, run and pass all of these (and report the results):
@@ -53,4 +57,13 @@ When asked to commit:
4. Add a `## <version> - <YYYY-MM-DD>` entry at the top of `CHANGELOG.md` ("Changes since <previous version>:", then `### Added` / `### Changed` / `### Fixed`). Mark breaking changes with **Breaking:**.
5. Update the docs affected by the change (`docs/*.md`, `README.md`, `.env.example`, MCP tool descriptions).
6. Build the commit message with the `/git-commit` skill if it is available, following its format and rules. Otherwise use a conventional commit message (`type(scope): subject`, then a bullet list body). Either way, put the version bump in the body as a bullet (e.g. `- bump version to <version>`), not in the subject line. This overrides the skill's rule of putting versions in the subject. Then make the commit with that message.
7. **After committing, ask the user whether to rebuild and restart the docker compose containers** (`docker compose up -d --build`); don't do it without confirmation.
7. **Tag the version commit** with an annotated tag `v<version>` whose message is that version's `CHANGELOG.md` entry, verbatim (from its `## <version>` heading up to the next version's heading). Commits without a version bump get no tag. `--cleanup=whitespace` is required: the default cleanup strips lines starting with `#`, which would drop the entry's headings:
```bash
v=<version>
awk -v v="$v" 'index($0, "## " v " ") == 1 {p = 1; print; next} p && /^## / {exit} p' CHANGELOG.md \
| git tag -a "v$v" --cleanup=whitespace -F -
```
Don't push the tag; tell the user to push with `git push --follow-tags`, which also pushes annotated tags.
8. **After committing, ask the user whether to rebuild and restart the docker compose containers** (`docker compose up -d --build`); don't do it without confirmation.
+72 -7
View File
@@ -28,8 +28,70 @@ COPY server/tsconfig*.json ./server/
COPY server/src ./server/src
RUN npm run -w server build
# ── Runtime dependencies ──────────────────────────────────────────────────────
FROM node:24-slim AS runtime-deps
WORKDIR /app
COPY package*.json ./
COPY server/package.json ./server/
# Production dependencies and Playwright's headless-only Chromium build,
# matching the installed Playwright version. All browser launches are
# headless, so the full desktop Chromium (GTK, Mesa/LLVM, icon themes) isn't
# needed, and neither is ffmpeg (only used for video recording).
#
# Then drop what nothing loads at runtime: source maps, TypeScript sources and
# declarations, docs (but not license files), TypeORM's browser build and
# better-sqlite3's C sources (the addon is already compiled).
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
RUN npm ci --omit=dev -w server \
&& npx playwright install --only-shell chromium \
&& rm -rf /ms-playwright/ffmpeg-* \
&& find node_modules -type f \( \
-name '*.map' -o -name '*.ts' -o -name '*.mts' -o -name '*.cts' \
-o \( \( -iname '*.md' -o -iname '*.markdown' \) \
! -iname 'licen[cs]e*' ! -iname 'notice*' ! -iname 'copying*' \) \
\) -delete \
&& rm -rf node_modules/typeorm/browser \
node_modules/better-sqlite3/deps \
node_modules/better-sqlite3/src
# ── License notices ───────────────────────────────────────────────────────────
# One file with the project's LICENSE and the license of everything the image
# ships: the production dependencies of both workspaces (the client's are
# bundled into its build, so their license files aren't in the image
# otherwise) and the Node.js binary, whose LICENSE the node image doesn't
# include.
FROM node:24-slim AS licenses
WORKDIR /app
COPY package*.json LICENSE ./
COPY client/package.json ./client/
COPY server/package.json ./server/
COPY scripts/third-party-licenses.mjs ./scripts/
RUN npm ci --omit=dev --ignore-scripts \
&& node scripts/third-party-licenses.mjs > licenses.txt \
&& node -e ' \
const url = `https://raw.githubusercontent.com/nodejs/node/v${process.versions.node}/LICENSE`; \
fetch(url).then(async (r) => { \
if (!r.ok) throw new Error(`${url}: ${r.status}`); \
const rule = "-".repeat(79); \
process.stdout.write(`\n${rule}\n\nnode@${process.versions.node}\nLicense: MIT\n\n${(await r.text()).trim()}\n`); \
}).catch((e) => { console.error(e.message); process.exit(1); });' >> licenses.txt
# ── Runtime ───────────────────────────────────────────────────────────────────
FROM node:24-slim AS runtime
# Plain Debian with just the node binary: npm, yarn, corepack and the C
# headers that come with the node image aren't needed to run the app.
FROM debian:bookworm-slim AS runtime
# Set by CI from the root package.json version
ARG VERSION=dev
LABEL org.opencontainers.image.title="liqa" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.source="https://git.hq.ars9.space/ars9/liqa"
# Runtime only: in the build stages it would make npm ci skip devDependencies
ENV NODE_ENV=production
@@ -63,22 +125,25 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libxrandr2 \
&& rm -rf /var/lib/apt/lists/*
COPY --from=runtime-deps /usr/local/bin/node /usr/local/bin/node
WORKDIR /app
COPY package*.json ./
COPY server/package.json ./server/
# Playwright's headless-only Chromium build, matching the installed Playwright
# version. All browser launches are headless, so the full desktop Chromium
# (GTK, Mesa/LLVM, icon themes) isn't needed.
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
RUN npm ci --omit=dev -w server \
&& npx playwright install --only-shell chromium \
&& npm cache clean --force
COPY --from=runtime-deps /ms-playwright /ms-playwright
COPY --from=runtime-deps /app/node_modules ./node_modules
COPY --from=server-build /app/server/dist ./dist
COPY --from=client-build /app/client/dist ./client
# The project's license, and every shipped component's license notices (also
# served by the app at /licenses.txt)
COPY LICENSE ./
COPY --from=licenses /app/licenses.txt ./client/licenses.txt
# Serve the built client at / (see server/src/common/client-static.ts)
ENV CLIENT_DIR=client
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2026 Andrii Arsenin
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+20
View File
@@ -16,6 +16,18 @@ Everything is served from one container at **http://localhost:13000**: the UI at
---
## Installation
To install liqa from the published image, without cloning this repo:
```bash
curl -fsSL https://git.hq.ars9.space/ars9/liqa/raw/branch/master/scripts/install.sh | bash
```
This asks for an install directory, a port and a version (latest by default), then writes a `compose.yaml` and a `data/` directory there. Start it with `docker compose up -d` in that directory.
---
## Overview
| Concept | Description |
@@ -38,3 +50,11 @@ Scenarios, snippets, environments and credentials can be exported as YAML and im
- [docs/mcp.md](docs/mcp.md) - MCP tool reference
- [docs/development.md](docs/development.md) - setup, configuration, running, testing, linting, Docker
- [CHANGELOG.md](CHANGELOG.md) - release notes
---
## License
[MIT](LICENSE) © 2026 Andrii Arsenin
Third-party packages keep their own licenses. The Docker image includes all their notices, and the app serves them at `/licenses.txt` (linked as "Licenses" in the sidebar footer). See [docs/development.md](docs/development.md#licenses).
@@ -0,0 +1,121 @@
import type { Meta, StoryObj } from '@storybook/react-vite';
import { LogOutput } from '../../src/ui/LogOutput/LogOutput';
const meta: Meta<typeof LogOutput> = {
title: 'UI/LogOutput',
component: LogOutput,
tags: ['autodocs'],
parameters: { layout: 'padded' },
};
export default meta;
type Story = StoryObj<typeof LogOutput>;
const secondsAgo = (n: number) => new Date(Date.now() - n * 1000).toISOString();
export const Default: Story = {
args: {
startTime: secondsAgo(60),
entries: [
{
id: 0,
level: 'debug',
context: 'step:1',
message: 'Resolved credential alias "sdJwtKey" to a file credential',
createdAt: secondsAgo(61),
},
{
id: 1,
level: 'log',
context: 'step:1',
message: 'Step 1 started: Login with PKCS',
createdAt: secondsAgo(60),
},
{
id: 2,
level: 'log',
context: 'snippet:loginWithPkcs',
message: 'Snippet "loginWithPkcs" started',
createdAt: secondsAgo(58),
},
{
id: 3,
level: 'log',
context: 'snippet:loginWithPkcs',
message: 'Saved credential as run file:',
data: JSON.stringify({
id: '181d8ae2-4aee-4f33-a657-210efe7fe668',
name: 'credential.sd-jwt',
mimeType: 'application/octet-stream',
size: 1657,
sha256: '9c4226999c700a39bda30279907e4479a5b3920ccde5c75771ea0e264c638c0',
path: 'data/files/18/181d/181d8ae2-4aee-4f33-a657-210efe7fe668',
}),
createdAt: secondsAgo(57),
},
{
id: 4,
level: 'log',
context: 'snippet:loginWithPkcs',
message: 'Navigating to ID login: https://id.example.com',
createdAt: secondsAgo(57),
},
{
id: 5,
level: 'log',
context: 'assertion:pass',
message: 'Assertion passed: page must have redirected to cabinet URL',
createdAt: secondsAgo(40),
},
{
id: 6,
level: 'warn',
context: 'snippet:loginWithPkcs',
message: 'Retrying file upload after a transient error',
createdAt: secondsAgo(39),
},
{
id: 7,
level: 'log',
context: 'step:1',
message: 'Step 1 passed',
createdAt: secondsAgo(30),
},
{
id: 8,
level: 'error',
context: 'assertion:fail',
message: 'Assertion failed: Document validation must pass (got 422)',
createdAt: secondsAgo(10),
},
{
id: 9,
level: 'error',
context: 'step:2',
message: 'Step 2 failed: Document validation must pass (got 422)',
createdAt: secondsAgo(9),
},
],
},
};
export const Scrollable: Story = {
args: {
maxHeight: 160,
startTime: secondsAgo(60),
entries: Array.from({ length: 30 }, (_, i) => ({
id: i,
level: (['log', 'log', 'log', 'warn', 'error'] as const)[i % 5],
context: `step:${Math.floor(i / 6) + 1}`,
message: `Log entry ${i + 1}`,
createdAt: secondsAgo(60 - i * 2),
})),
},
};
export const Empty: Story = {
args: {
entries: [],
emptyMessage: 'No logs yet.',
},
};
+36 -1
View File
@@ -4,13 +4,22 @@ import { expect, userEvent, within } from 'storybook/test';
import { Modal } from '../../src/ui/Modal/Modal';
import { Button } from '../../src/ui/Button/Button';
function ModalDemo({ title, body }: { title: string; body: string }) {
function ModalDemo({
title,
body,
size,
}: {
title: string;
body: React.ReactNode;
size?: 'md' | 'lg';
}) {
const [open, setOpen] = useState(false);
return (
<>
<Button onClick={() => setOpen(true)}>Open modal</Button>
<Modal
open={open}
size={size}
title={title}
onClose={() => setOpen(false)}
footer={
@@ -61,3 +70,29 @@ export const ClosesOnEscapeAndBackdrop: Story = {
await expect(canvas.queryByRole('dialog')).not.toBeInTheDocument();
},
};
export const Large: Story = {
args: {
title: 'Code reference',
size: 'lg',
body: (
<>
{Array.from({ length: 60 }, (_, i) => (
<p key={i}>Paragraph {i + 1} of a long, document-like modal body.</p>
))}
</>
),
},
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
await userEvent.click(canvas.getByRole('button', { name: 'Open modal' }));
const dialog = canvas.getByRole('dialog', { name: 'Code reference' });
// The dialog stays within the viewport; its body scrolls instead.
await expect(dialog.getBoundingClientRect().height).toBeLessThanOrEqual(window.innerHeight);
const body = within(dialog).getByText(
'Paragraph 1 of a long, document-like modal body.',
).parentElement!;
await expect(body.scrollHeight).toBeGreaterThan(body.clientHeight);
await expect(within(dialog).getByRole('button', { name: 'Confirm' })).toBeVisible();
},
};
@@ -0,0 +1,33 @@
import type { Meta, StoryObj } from '@storybook/react-vite';
import { expect, userEvent, within } from 'storybook/test';
import { RevealableCodeBlock } from '../../src/ui/RevealableCodeBlock/RevealableCodeBlock';
const meta: Meta<typeof RevealableCodeBlock> = {
title: 'UI/RevealableCodeBlock',
component: RevealableCodeBlock,
parameters: { layout: 'padded' },
tags: ['autodocs'],
};
export default meta;
type Story = StoryObj<typeof RevealableCodeBlock>;
export const Default: Story = {
args: {
language: 'json',
code: JSON.stringify({ username: 'admin', password: 's3cr3t-p4ss' }, null, 2),
},
play: async ({ canvasElement }) => {
// The code is not rendered until revealed, and hidden again on the second click
const canvas = within(canvasElement);
const toggle = canvas.getByRole('button');
await expect(canvasElement).not.toHaveTextContent('s3cr3t-p4ss');
await expect(toggle).toHaveAttribute('aria-expanded', 'false');
await userEvent.click(toggle);
await expect(canvasElement.querySelector('code')).toHaveTextContent('s3cr3t-p4ss');
await expect(toggle).toHaveAttribute('aria-expanded', 'true');
await userEvent.click(toggle);
await expect(canvasElement).not.toHaveTextContent('s3cr3t-p4ss');
},
};
@@ -1,5 +1,7 @@
import type { Meta, StoryObj } from '@storybook/react-vite';
import { useState } from 'react';
import { expect, within } from 'storybook/test';
import { Button } from '../../src/ui/Button/Button';
import { UuidBadge } from '../../src/ui/UuidBadge/UuidBadge';
const meta: Meta<typeof UuidBadge> = {
@@ -19,3 +21,43 @@ export const Default: Story = {
await expect(badge).toHaveTextContent('61d2…0b2e');
},
};
const SAMPLE_IDS = [
'61d2b1c2-7664-4dca-974f-436c2ee90b2e',
'e83f0a5d-1b9c-4f27-8d6e-2a4c9b7f1e03',
'0c7a94f1-3e52-4b8d-a1f6-9d2e5c8b4a70',
'f4b21e8c-9a07-4c63-b5d2-7e1f0a3c6d98',
'8d5e3a10-c4f7-4e29-9b81-5f6a2d0c7e14',
'2a9fc067-58d3-4a1e-86b4-c3e7f19d5b2a',
];
function Gallery() {
const [ids, setIds] = useState(SAMPLE_IDS);
return (
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'flex-start', gap: 12 }}>
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 16 }}>
{ids.map((id) => (
<UuidBadge key={id} id={id} />
))}
</div>
<Button
size="sm"
variant="secondary"
onClick={() => setIds(ids.map(() => crypto.randomUUID()))}
>
Randomize
</Button>
</div>
);
}
export const Colors: Story = {
render: () => <Gallery />,
play: async ({ canvasElement }) => {
// Each sample id gets its own badge
const canvas = within(canvasElement);
for (const id of SAMPLE_IDS) {
await expect(canvas.getByTitle(id)).toBeInTheDocument();
}
},
};
+2
View File
@@ -1,6 +1,8 @@
{
"name": "liqa-client",
"private": true,
"license": "MIT",
"author": "Andrii Arsenin",
"type": "module",
"scripts": {
"dev": "vite",
+10
View File
@@ -52,6 +52,16 @@
white-space: nowrap;
}
.versionLink {
color: inherit;
text-decoration: none;
}
.versionLink:hover,
.versionLink:focus-visible {
text-decoration: underline;
}
.navItem {
display: flex;
align-items: center;
+11 -1
View File
@@ -140,7 +140,17 @@ export default function App() {
<div className={styles.sideFooter}>
<ThemeSwitcher />
<div className={styles.version}>v{__APP_VERSION__}</div>
<div className={styles.version}>
v{__APP_VERSION__} ·{' '}
<a
className={styles.versionLink}
href="/licenses.txt"
target="_blank"
rel="noopener noreferrer"
>
{t('nav.licenses')}
</a>
</div>
</div>
</div>
</SidePanel>
+5 -1
View File
@@ -247,9 +247,10 @@ export const scenarios = {
},
exportScenario(
id: string,
options: { includeEnvironment: boolean; credentialIds: string[] } = {
options: { includeEnvironment: boolean; credentialIds: string[]; snippetIds: string[] } = {
includeEnvironment: false,
credentialIds: [],
snippetIds: [],
},
): Promise<string> {
const params = new URLSearchParams();
@@ -257,6 +258,9 @@ export const scenarios = {
for (const cid of options.credentialIds) {
params.append('credentialIds', cid);
}
for (const sid of options.snippetIds) {
params.append('snippetIds', sid);
}
return request(`/scenarios/${id}/export?${params.toString()}`);
},
exportE2eTestUrl(id: string): string {
+5 -1
View File
@@ -147,7 +147,7 @@ export interface RunDefaults {
export type RunStepStatus = 'waiting' | 'pending' | 'in_progress' | 'pass' | 'fail' | 'cancelled';
export type LogLevel = 'log' | 'warn' | 'error';
export type LogLevel = 'debug' | 'log' | 'warn' | 'error';
export interface ScenarioRun {
id: string;
@@ -189,7 +189,11 @@ export interface ScenarioRunLog {
runId: string;
stepRunId: string | null;
level: LogLevel;
/** Where the message was generated, e.g. "step:2", "snippet:login", "assertion:pass". */
context: string | null;
message: string;
/** JSON payload attached to the message (e.g. a created file's metadata), as a raw string. */
data: string | null;
createdAt: string;
}
@@ -0,0 +1,20 @@
.helpButton {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 2px;
border: none;
border-radius: var(--radius-sm);
background: none;
color: var(--color-text-muted);
cursor: pointer;
}
.helpButton:hover {
color: var(--color-primary);
}
.helpButton:focus-visible {
outline: none;
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35);
}
@@ -0,0 +1,54 @@
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { CircleHelp, X } from 'lucide-react';
import { Modal, Button, MarkdownContent } from '../../ui';
import content from './code-help.md?raw';
import styles from './CodeHelpModal.module.css';
export interface CodeHelpModalProps {
open: boolean;
onClose: () => void;
}
/** Reference for the script runtime (`context`, `expect`, ...) available to step and snippet code. */
export function CodeHelpModal({ open, onClose }: CodeHelpModalProps) {
const { t } = useTranslation();
return (
<Modal
open={open}
size="lg"
title={t('code_help.title')}
onClose={onClose}
footer={
<Button variant="secondary" onClick={onClose}>
<X size={14} />
{t('code_help.close')}
</Button>
}
>
<MarkdownContent content={content} />
</Modal>
);
}
/** A (?) button that opens the {@link CodeHelpModal}; place it next to a code field label. */
export function CodeHelpButton() {
const { t } = useTranslation();
const [open, setOpen] = useState(false);
return (
<>
<button
type="button"
className={styles.helpButton}
onClick={() => setOpen(true)}
aria-label={t('code_help.open')}
title={t('code_help.open')}
>
<CircleHelp size={16} />
</button>
<CodeHelpModal open={open} onClose={() => setOpen(false)} />
</>
);
}
@@ -61,3 +61,8 @@
cursor: pointer;
accent-color: var(--color-primary);
}
.versions {
color: var(--color-text-muted);
font-size: var(--font-size-xs);
}
@@ -1,7 +1,7 @@
import { useTranslation } from 'react-i18next';
import { X, Upload } from 'lucide-react';
import { Modal, Button, UuidBadge } from '../../ui';
import type { Scenario, ScenarioCredential } from '../../api';
import type { Scenario, ScenarioCredential, UsedSnippet } from '../../api';
import styles from './ExportScenarioModal.module.css';
export interface ExportScenarioModalProps {
@@ -13,6 +13,9 @@ export interface ExportScenarioModalProps {
onIncludeEnvironmentChange: (v: boolean) => void;
includedCredentialIds: Set<string>;
onCredentialToggle: (id: string, checked: boolean) => void;
usedSnippets: UsedSnippet[];
includedSnippetIds: Set<string>;
onSnippetToggle: (id: string, checked: boolean) => void;
onClose: () => void;
onExport: () => void;
isExporting: boolean;
@@ -27,12 +30,24 @@ export function ExportScenarioModal({
onIncludeEnvironmentChange,
includedCredentialIds,
onCredentialToggle,
usedSnippets,
includedSnippetIds,
onSnippetToggle,
onClose,
onExport,
isExporting,
}: ExportScenarioModalProps) {
const { t } = useTranslation();
// One row per snippet, listing every version the scenario uses (latest or pinned)
const snippetRows = new Map<string, { alias: string; versions: number[] }>();
for (const s of usedSnippets) {
const row = snippetRows.get(s.id) ?? { alias: s.alias, versions: [] };
const version = s.pinnedVersion ?? s.version;
if (!row.versions.includes(version)) row.versions.push(version);
snippetRows.set(s.id, row);
}
return (
<Modal
open={open}
@@ -64,6 +79,10 @@ export function ExportScenarioModal({
<UuidBadge id={scenario.id} />
</span>
</div>
<div className={styles.metaRow}>
<span className={styles.metaLabel}>{t('scenarios.field_version')}</span>
<span className={styles.metaValue}>v{scenario.version}</span>
</div>
</div>
{environment && (
@@ -95,6 +114,25 @@ export function ExportScenarioModal({
))}
</div>
)}
{snippetRows.size > 0 && (
<div className={styles.section}>
<h4 className={styles.sectionTitle}>{t('scenarios.export_include_snippets')}</h4>
{[...snippetRows].map(([snippetId, row]) => (
<label key={snippetId} className={styles.checkboxRow}>
<input
type="checkbox"
checked={includedSnippetIds.has(snippetId)}
onChange={(e) => onSnippetToggle(snippetId, e.target.checked)}
/>
<span>{row.alias}</span>
<span className={styles.versions}>
{row.versions.map((v) => `v${v}`).join(', ')}
</span>
</label>
))}
</div>
)}
</div>
)}
</Modal>
+186
View File
@@ -0,0 +1,186 @@
Step code and snippet code are the **body of an async function**. Use `await` freely; whatever you `return` becomes the step (or snippet) output.
```js
async (context) => {
// your code here
}
```
All steps of a run share one browser, one browser context and one page, so state carries over from step to step: the current URL, cookies, local storage, open dialogs.
A step **passes** when its code returns, and **fails** when it throws or exceeds its timeout. When a step fails, the remaining steps are cancelled, and a screenshot and the page HTML are saved to the run's files.
## Globals
| Name | Description |
| --- | --- |
| `context` | The run context, described below. |
| `expect` | Playwright's [`expect`](https://playwright.dev/docs/test-assertions), with auto-retrying web assertions. |
| `console` | Writes to the run log: `log`/`info` → `log`, plus `warn`, `error` and `debug`. |
| `args` | **Snippets only.** The extra arguments passed to `context.runSnippet(name, ...args)`. |
Code runs in the server process with Node.js. It is trusted code, not sandboxed.
## Browser
### `context.page`
The Playwright [`Page`](https://playwright.dev/docs/api/class-page) of the run.
```js
await context.page.goto(context.getEnv("base_url"));
await context.page.getByRole("button", { name: "Sign in" }).click();
await expect(context.page.locator("h1")).toHaveText("Dashboard");
```
### `context.browser`
The Playwright [`BrowserContext`](https://playwright.dev/docs/api/class-browsercontext) the page belongs to. Use it for cookies, storage state, extra pages and HTTP requests that share the browser's cookies.
```js
const cookies = await context.browser.cookies();
const res = await context.browser.request.get(context.getEnv("api_url") + "/me");
```
### `context.dumpDom(selector?)` → `Promise<DomNode>`
Returns a simplified tree of the live DOM, starting at `selector` (default `"body"`). Decorative and layout elements are filtered out. The tree keeps landmarks, interactive elements, and elements with `role`, `data-testid`, `data-qa`, `data-action` or `data-element-id`. Each node has `tag` and `children`, plus `role`, `testid`, `id`, `name`, `type`, `text`, `href`, `checked`, `disabled`, etc. when they are present. This is useful for finding selectors without a screenshot.
If nothing matches `selector`, it returns a node with `tag: "ERROR"` instead of throwing.
```js
context.log("Login form:", await context.dumpDom("form"));
```
## Environment
### `context.env`
A copy of the selected environment's key/value map, `{}` when there is none. A missing key reads as `undefined`.
### `context.getEnv(key)` → `string`
Returns the environment value for `key`, and **throws** if it is not defined. Prefer it over `context.env[key]` for required settings: the step then fails with a clear message.
```js
const baseUrl = context.getEnv("base_url");
const locale = context.env.locale ?? "en";
```
## Credentials
### `context.getCredential(alias)` → `unknown`
Returns the payload of the credential assigned to this scenario under `alias` (see **Credentials** on the scenario page). JSON data is returned parsed, anything else as a string. **Throws** if no credential has that alias.
```js
const { username, password } = context.getCredential("admin");
await context.page.getByLabel("Username").fill(username);
await context.page.getByLabel("Password").fill(password);
```
## Step outputs
### `context.getStepOutput(order)` → `Promise<unknown>`
Returns the output (the return value) of another step in the same run. **It is async, so `await` it.**
- A positive `order` is absolute: `1` is the first step.
- A negative `order` is relative: `-1` is the previous step.
Returns `null` if that step does not exist, has not run, or returned nothing. A step's output is stored as JSON, so only JSON-serializable values come back as they were returned (no functions, `Date` becomes a string, Playwright objects are not usable).
```js
// step 2
return { orderId: await context.page.locator("#order-id").textContent() };
// step 3
const { orderId } = await context.getStepOutput(-1);
```
## Logging
### `context.log(...args)`, `context.warn(...args)`, `context.error(...args)`, `context.debug(...args)`
Write an entry with that level to the run log. `console.*` does the same. Strings, numbers and booleans are joined with spaces into the message. Objects and arrays are kept separate as structured **data**, shown pretty-printed under the message: one object is stored as is, several are stored as an array.
```js
context.log("Created user", user.id, user); // message "Created user 42", data = user
```
Every entry is tagged with where it came from: `step:<N>`, or `snippet:<alias>` while a snippet runs.
## Assertions
### `context.assert(fn, description)` → `Promise<void>`
Runs `fn` (sync or async) and requires it to return exactly `true`.
- On success, it logs `description` (tagged `assertion:pass`).
- If `fn` returns anything else or throws, it logs `Assertion failed: <description>` as an error (tagged `assertion:fail`) and throws, which fails the step.
Await it, or a failure will not stop the step.
```js
await context.assert(
async () => (await context.page.locator(".cart-item").count()) === 3,
"Cart contains 3 items",
);
```
Use `expect` instead for assertions that wait and retry until the page matches, e.g. `await expect(locator).toBeVisible()`.
## Snippets
### `context.runSnippet(name, ...args)` → `Promise<unknown>`
Runs a stored snippet with the same `context` (same page, environment and credentials) and returns the snippet's return value. Extra arguments are available inside the snippet as `args`.
- `name` is the snippet alias, which runs its latest version.
- `alias@<version>` (e.g. `login@3`) pins a specific version.
Start, finish and failure are logged. If the snippet throws, the error propagates and fails the calling step unless you catch it. Snippets can call other snippets.
```js
// step code
const user = await context.runSnippet("login", "admin", { remember: true });
// snippet "login"
const [alias, opts] = args;
const { username, password } = context.getCredential(alias);
// ...
return { username };
```
## Files
### `context.getScenarioFiles(opts?)` → `Promise<{ items, total }>`
Lists the files uploaded to this scenario (see **Files** on the scenario page). `opts` takes `limit` and `offset` for paging. Each item has `id`, `name`, `mimeType`, `size`, `sha256` and `path`, the absolute path on the server's disk, which you can pass to Playwright:
```js
const { items } = await context.getScenarioFiles();
const doc = items.find((f) => f.name === "contract.pdf");
await context.page.locator("input[type=file]").setInputFiles(doc.path);
```
### `context.downloadFile(url, opts?)` → `Promise<FileInfo>`
Fetches `url` on the server and saves the response as a file of the current run. It returns the same fields as a scenario file (`id`, `name`, `mimeType`, `size`, `sha256`, `path`).
- `opts`: `method`, `headers`, `body` (a string) and `filename`. Without `filename`, the last segment of the URL path is used, and the MIME type is derived from the file extension.
- Redirects are followed. Any final status other than 200 throws. The limits are 100 MB and a 30 s timeout.
- `url` may be a `data:` URI (`data:<type>;base64,<data>` or `data:<type>,<percent-encoded>`), which saves content generated in the script without a network request. Pass `filename` in this case.
- Only works during a real scenario run. It throws in ad-hoc execution such as the `exec_code` MCP tool.
- This is a server-side request: it does **not** send the browser's cookies. Pass them in `headers` if the URL needs a session.
```js
await context.downloadFile(
"data:application/json;base64," + btoa(JSON.stringify(report)),
{ filename: "report.json" },
);
```
## Timeouts
Each step has its own timeout, or else the scenario's timeout, or else 60 s. The whole run fails once it exceeds the scenario's timeout (600 s by default). That check happens between steps.
+2
View File
@@ -6,3 +6,5 @@ export { RunScenarioModal } from './RunScenarioModal';
export type { RunScenarioModalProps } from './RunScenarioModal';
export { ExportLogsModal } from './ExportLogsModal';
export type { ExportLogsModalProps, LogExportFormat } from './ExportLogsModal';
export { CodeHelpModal, CodeHelpButton } from './CodeHelpModal';
export type { CodeHelpModalProps } from './CodeHelpModal';
+13 -3
View File
@@ -12,6 +12,11 @@
"confirm_remove_credential": "Are you sure you want to remove this credential from scenario?",
"save_session": "Save session"
},
"code_help": {
"open": "Code reference",
"title": "Code reference",
"close": "Close"
},
"errors": {
"not_found": "Not found",
"not_found_session": "Session {{id}} does not exist or has been deleted.",
@@ -22,6 +27,7 @@
"generic": "Something went wrong. Please try again."
},
"nav": {
"licenses": "Licenses",
"environments": "Environments",
"credentials": "Credentials",
"snippets": "Snippets",
@@ -217,11 +223,10 @@
"export_modal_title": "Export Scenario",
"export_include_environment": "Include Environment",
"export_include_credentials": "Include Credentials",
"export_include_snippets": "Include Snippets",
"form_timeout": "Scenario Timeout (seconds)",
"form_timeout_placeholder": "Default: 600",
"form_timeout_hint": "Max seconds for the entire scenario run (default: 600)",
"field_name": "Name",
"field_id": "ID"
"form_timeout_hint": "Max seconds for the entire scenario run (default: 600)"
},
"theme": {
"switch_to_light": "Switch to light theme",
@@ -229,6 +234,11 @@
"light_mode": "Light mode",
"dark_mode": "Dark mode"
},
"revealable": {
"hidden": "Hidden so secrets aren't exposed on screen.",
"reveal": "Reveal",
"hide": "Hide"
},
"pagination": {
"prev": "Previous page",
"next": "Next page",
+6
View File
@@ -255,6 +255,12 @@
color: var(--color-text);
}
.labelRow {
display: flex;
align-items: center;
gap: var(--space-1);
}
.textarea {
width: 100%;
padding: var(--space-2) var(--space-3);
@@ -3,11 +3,18 @@ import { useNavigate, useParams } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
import { usePageTitle } from '../../hooks/usePageTitle';
import { Upload, Pencil, Trash2, KeyRound } from 'lucide-react';
import { CodeBlock } from '../../ui';
import { stringify as yamlStringify } from 'yaml';
import { credentials } from '../../api';
import type { Credential } from '../../api';
import { Breadcrumbs, Button, Card, DescriptionList, Timestamp, UuidBadge } from '../../ui';
import {
Breadcrumbs,
Button,
Card,
DescriptionList,
RevealableCodeBlock,
Timestamp,
UuidBadge,
} from '../../ui';
import { DeleteConfirmationModal } from '../../components/modals';
import styles from '../Page.module.css';
@@ -117,7 +124,8 @@ export function CredentialDetailPage() {
<div className={styles.stepsSection}>
<h2 className={styles.sectionHeading}>{t('credentials.section_data')}</h2>
<Card>
<CodeBlock
<RevealableCodeBlock
key={credential.id}
language="json"
code={(() => {
try {
+12 -45
View File
@@ -7,10 +7,8 @@ import type {
Scenario,
ScenarioRunDetail,
ScenarioRunStep,
ScenarioRunLog,
ScenarioRunStatus,
RunStepStatus,
LogLevel,
FileMetadata,
} from '../../api';
import { scenarios } from '../../api';
@@ -27,7 +25,7 @@ import {
Card,
CodeBlock,
DescriptionList,
Pagination,
LogOutput,
Search,
Table,
Timestamp,
@@ -70,12 +68,6 @@ const STEP_STATUS_VARIANT: Record<RunStepStatus, BadgeVariant> = {
cancelled: 'warning',
};
const LOG_LEVEL_VARIANT: Record<LogLevel, BadgeVariant> = {
log: 'neutral',
warn: 'warning',
error: 'error',
};
const FINAL: ScenarioRunStatus[] = ['pass', 'fail'];
export function RunDetailPage() {
@@ -97,7 +89,6 @@ function RunDetail() {
const [error, setError] = useState<string | null>(null);
const [polling, setPolling] = useState(false);
const [pulseKey, setPulseKey] = useState(0);
const [logPage, setLogPage] = useState(1);
const [logSearch, setLogSearch] = useState('');
const [debouncedSearch, setDebouncedSearch] = useState('');
const [expandAll, setExpandAll] = useState(false);
@@ -112,7 +103,6 @@ function RunDetail() {
const [deletingFile, setDeletingFile] = useState(false);
const [repeating, setRepeating] = useState(false);
const logSearchRef = useRef('');
const LOG_PAGE_SIZE = 25;
const pollRef = useRef<ReturnType<typeof setInterval> | null>(null);
const stopPolling = () => {
@@ -221,7 +211,6 @@ function RunDetail() {
const t = setTimeout(() => {
setDebouncedSearch(logSearch);
logSearchRef.current = logSearch;
setLogPage(1);
}, 300);
return () => clearTimeout(t);
}, [logSearch]);
@@ -400,26 +389,6 @@ function RunDetail() {
},
];
const logColumns: TableColumn<ScenarioRunLog>[] = [
{
key: 'level',
header: t('runs.log_level'),
width: 70,
render: (l) => <Badge variant={LOG_LEVEL_VARIANT[l.level]}>{l.level}</Badge>,
},
{
key: 'message',
header: t('runs.log_message'),
render: (l) => <code style={{ wordBreak: 'break-word' }}>{l.message}</code>,
},
{
key: 'time',
header: t('runs.log_time'),
width: 160,
render: (l) => <Timestamp value={l.createdAt} />,
},
];
return (
<div>
<div className={styles.pageToolbar}>
@@ -560,21 +529,19 @@ function RunDetail() {
</Button>
</div>
</div>
<Table
columns={logColumns}
data={run.logs.slice((logPage - 1) * LOG_PAGE_SIZE, logPage * LOG_PAGE_SIZE)}
rowKey={(l) => l.id}
loading={false}
<LogOutput
startTime={run.createdAt}
maxHeight={480}
entries={run.logs.map((l) => ({
id: l.id,
level: l.level,
context: l.context,
message: l.message,
data: l.data,
createdAt: l.createdAt,
}))}
emptyMessage=""
/>
{run.logs.length > LOG_PAGE_SIZE && (
<Pagination
page={logPage}
pageSize={LOG_PAGE_SIZE}
total={run.logs.length}
onPageChange={setLogPage}
/>
)}
</div>
)}
+5 -1
View File
@@ -6,6 +6,7 @@ import { X, Save, ClipboardList } from 'lucide-react';
import { scenarios, steps } from '../../api';
import type { Scenario } from '../../api';
import { Breadcrumbs, Button, Card, Input, CodeEditor, useToast } from '../../ui';
import { CodeHelpButton } from '../../components/modals';
import styles from '../Page.module.css';
export function CreateStepPage() {
@@ -77,7 +78,10 @@ export function CreateStepPage() {
onChange={(e) => setTitle(e.target.value)}
/>
<div className={styles.formField}>
<label className={styles.fieldLabel}>{t('steps.form_exec_code')}</label>
<div className={styles.labelRow}>
<label className={styles.fieldLabel}>{t('steps.form_exec_code')}</label>
<CodeHelpButton />
</div>
<CodeEditor value={execCode} onChange={setExecCode} rows={6} />
</div>
<Input
+5 -1
View File
@@ -6,6 +6,7 @@ import { X, Save, ClipboardList } from 'lucide-react';
import { scenarios, steps } from '../../api';
import type { Scenario, ScenarioStep } from '../../api';
import { Breadcrumbs, Button, Card, Input, CodeEditor, useToast } from '../../ui';
import { CodeHelpButton } from '../../components/modals';
import styles from '../Page.module.css';
export function EditStepPage() {
@@ -89,7 +90,10 @@ export function EditStepPage() {
onChange={(e) => setTitle(e.target.value)}
/>
<div className={styles.formField}>
<label className={styles.fieldLabel}>{t('steps.form_exec_code')}</label>
<div className={styles.labelRow}>
<label className={styles.fieldLabel}>{t('steps.form_exec_code')}</label>
<CodeHelpButton />
</div>
<CodeEditor value={execCode} onChange={setExecCode} rows={6} />
</div>
<Input
@@ -94,6 +94,7 @@ export function ScenarioDetailPage() {
const [exportModalOpen, setExportModalOpen] = useState(false);
const [includeEnvironment, setIncludeEnvironment] = useState(true);
const [includedCredentialIds, setIncludedCredentialIds] = useState<Set<string>>(new Set());
const [includedSnippetIds, setIncludedSnippetIds] = useState<Set<string>>(new Set());
const [isExporting, setIsExporting] = useState(false);
// Files state
@@ -212,8 +213,9 @@ export function ScenarioDetailPage() {
const handleOpenExportModal = () => {
if (!scenario) return;
// Initialise all credential checkboxes to checked
// Initialise all credential and snippet checkboxes to checked
setIncludedCredentialIds(new Set(scenarioCreds.map((sc) => sc.credentialId)));
setIncludedSnippetIds(new Set(usedSnippets.map((s) => s.id)));
setIncludeEnvironment(true);
setExportModalOpen(true);
};
@@ -226,6 +228,7 @@ export function ScenarioDetailPage() {
const yamlContent = await scenarios.exportScenario(scenario.id, {
includeEnvironment,
credentialIds: credIds,
snippetIds: Array.from(includedSnippetIds),
});
const blob = new Blob([yamlContent], { type: 'application/yaml' });
const url = URL.createObjectURL(blob);
@@ -899,6 +902,16 @@ export function ScenarioDetailPage() {
return next;
});
}}
usedSnippets={usedSnippets}
includedSnippetIds={includedSnippetIds}
onSnippetToggle={(snippetId, checked) => {
setIncludedSnippetIds((prev) => {
const next = new Set(prev);
if (checked) next.add(snippetId);
else next.delete(snippetId);
return next;
});
}}
onClose={() => setExportModalOpen(false)}
onExport={handleExport}
isExporting={isExporting}
@@ -5,6 +5,7 @@ import { usePageTitle } from '../../hooks/usePageTitle';
import { X, Save, Braces } from 'lucide-react';
import { snippets } from '../../api';
import { Breadcrumbs, Button, Card, Input, CodeEditor, useToast } from '../../ui';
import { CodeHelpButton } from '../../components/modals';
import styles from '../Page.module.css';
export function CreateSnippetPage() {
@@ -107,10 +108,13 @@ export function CreateSnippetPage() {
/>
</div>
<div className={styles.formField}>
<label className={styles.fieldLabel}>
{t('snippets.form_code')}
<span className={styles.requiredMark}> *</span>
</label>
<div className={styles.labelRow}>
<label className={styles.fieldLabel}>
{t('snippets.form_code')}
<span className={styles.requiredMark}> *</span>
</label>
<CodeHelpButton />
</div>
<CodeEditor
value={code}
onChange={(v) => {
+8 -4
View File
@@ -6,6 +6,7 @@ import { X, Save, Braces } from 'lucide-react';
import { snippets } from '../../api';
import type { Snippet } from '../../api';
import { Breadcrumbs, Button, Card, Input, CodeEditor, useToast } from '../../ui';
import { CodeHelpButton } from '../../components/modals';
import styles from '../Page.module.css';
export function EditSnippetPage() {
@@ -134,10 +135,13 @@ export function EditSnippetPage() {
/>
</div>
<div className={styles.formField}>
<label className={styles.fieldLabel}>
{t('snippets.form_code')}
<span className={styles.requiredMark}> *</span>
</label>
<div className={styles.labelRow}>
<label className={styles.fieldLabel}>
{t('snippets.form_code')}
<span className={styles.requiredMark}> *</span>
</label>
<CodeHelpButton />
</div>
<CodeEditor
value={code}
onChange={(v) => {
+3 -2
View File
@@ -6,12 +6,13 @@ export type BadgeVariant = 'success' | 'error' | 'warning' | 'info' | 'neutral'
export interface BadgeProps {
variant?: BadgeVariant;
dot?: boolean;
className?: string;
children: React.ReactNode;
}
export function Badge({ variant = 'neutral', dot = false, children }: BadgeProps) {
export function Badge({ variant = 'neutral', dot = false, className, children }: BadgeProps) {
return (
<span className={[styles.badge, styles[variant]].join(' ')}>
<span className={[styles.badge, styles[variant], className].filter(Boolean).join(' ')}>
{dot && <span className={styles.dot} aria-hidden="true" />}
{children}
</span>
@@ -0,0 +1,122 @@
.root {
display: flex;
flex-direction: column;
background: var(--color-bg-subtle);
border: var(--border-width) solid var(--color-border);
border-radius: var(--radius-md);
overflow: auto;
font-family: var(--font-mono, ui-monospace, 'Cascadia Code', 'Fira Code', monospace);
font-size: var(--font-size-xs);
}
.empty {
padding: var(--space-4);
color: var(--color-text-muted);
font-size: var(--font-size-sm);
}
.line {
display: flex;
flex-direction: column;
gap: var(--space-1);
padding: var(--space-1) var(--space-3);
border-left: 3px solid transparent;
border-bottom: 1px solid var(--color-border);
}
.line:last-child {
border-bottom: none;
}
.lineHeader {
display: flex;
align-items: baseline;
flex-wrap: wrap;
gap: var(--space-2);
}
.data {
margin: 0 0 var(--space-1) calc(7em + var(--space-2));
border: var(--border-width) solid var(--color-border);
border-radius: var(--radius-sm);
background: var(--color-bg);
max-width: 100%;
overflow-x: auto;
}
.data > * {
margin: 0;
padding: var(--space-2) var(--space-3);
}
.timestamp {
flex: 0 0 auto;
min-width: 7em;
text-align: right;
color: var(--color-text-muted);
white-space: nowrap;
}
.level {
flex: 0 0 auto;
width: 4.5em;
text-transform: uppercase;
font-weight: 700;
}
.context {
flex: 0 0 auto;
color: var(--color-secondary-fg);
}
.context::before {
content: '[';
}
.context::after {
content: ']';
}
.message {
flex: 1 1 320px;
color: var(--color-text);
white-space: pre-wrap;
word-break: break-word;
}
.debug {
border-left-color: var(--color-border);
}
.debug .level,
.debug .message,
.debug .timestamp,
.debug .context {
color: var(--color-text-faint);
}
.log {
border-left-color: var(--color-border);
}
.log .level {
color: var(--color-text-muted);
}
.warn {
border-left-color: var(--color-warning-fg);
background: var(--color-warning-bg);
}
.warn .level {
color: var(--color-warning-fg);
}
.error {
border-left-color: var(--color-error-fg);
background: var(--color-error-bg);
}
.error .level {
color: var(--color-error-fg);
}
+85
View File
@@ -0,0 +1,85 @@
import { CodeBlock } from '../CodeBlock/CodeBlock';
import styles from './LogOutput.module.css';
export type LogOutputLevel = 'debug' | 'log' | 'warn' | 'error';
export interface LogOutputEntry {
id: string | number;
level: LogOutputLevel;
/** Where the message was generated, e.g. "step:2", "snippet:login", "assertion:pass". */
context?: string | null;
message: string;
/** JSON payload attached to the message, as a raw string; rendered pretty-printed, separately from the message. */
data?: string | null;
createdAt: string | number | Date;
}
export interface LogOutputProps {
entries: LogOutputEntry[];
/** Reference point for the elapsed-time column; defaults to the first entry's timestamp. */
startTime?: string | number | Date;
/** Caps the block's height (e.g. "400px"), scrolling once entries overflow it. */
maxHeight?: string | number;
emptyMessage?: string;
className?: string;
}
/** "+12.345s" (or "-" if before startTime, e.g. clock skew). */
function formatElapsed(deltaMs: number): string {
const sign = deltaMs < 0 ? '-' : '+';
return `${sign}${(Math.abs(deltaMs) / 1000).toFixed(3)}s`;
}
/** Pretty-prints `data` if it's valid JSON, otherwise returns it as-is. */
function prettyData(data: string): string {
try {
return JSON.stringify(JSON.parse(data), null, 2);
} catch {
return data;
}
}
/** Terminal-style log viewer: one line per entry, color-coded by level. */
export function LogOutput({
entries,
startTime,
maxHeight,
emptyMessage = 'No logs.',
className,
}: LogOutputProps) {
if (entries.length === 0) {
return <div className={styles.empty}>{emptyMessage}</div>;
}
const startMs = new Date(startTime ?? entries[0].createdAt).getTime();
return (
<div
className={[styles.root, className].filter(Boolean).join(' ')}
style={maxHeight !== undefined ? { maxHeight } : undefined}
role="log"
tabIndex={0}
>
{entries.map((entry) => {
const entryMs = new Date(entry.createdAt).getTime();
return (
<div key={entry.id} className={[styles.line, styles[entry.level]].join(' ')}>
<div className={styles.lineHeader}>
<span className={styles.timestamp} title={new Date(entryMs).toISOString()}>
{formatElapsed(entryMs - startMs)}
</span>
<span className={styles.level}>{entry.level}</span>
{entry.context && <span className={styles.context}>{entry.context}</span>}
<span className={styles.message}>{entry.message}</span>
</div>
{entry.data && (
<div className={styles.data}>
<CodeBlock code={prettyData(entry.data)} language="json" />
</div>
)}
</div>
);
})}
</div>
);
}
+8
View File
@@ -16,6 +16,13 @@
border-radius: var(--radius-lg);
box-shadow: 0 20px 48px color-mix(in srgb, #000 28%, transparent);
overflow: hidden;
display: flex;
flex-direction: column;
max-height: 100%;
}
.lg {
width: min(880px, 100%);
}
.header {
@@ -31,6 +38,7 @@
.body {
padding: var(--space-2) var(--space-5) var(--space-4);
color: var(--color-text-muted);
overflow-y: auto;
}
.footer {
+8 -3
View File
@@ -7,9 +7,11 @@ export interface ModalProps {
children?: React.ReactNode;
onClose: () => void;
footer?: React.ReactNode;
/** `lg` widens the dialog for long, document-like content. */
size?: 'md' | 'lg';
}
export function Modal({ open, title, children, onClose, footer }: ModalProps) {
export function Modal({ open, title, children, onClose, footer, size = 'md' }: ModalProps) {
useEffect(() => {
if (!open) return;
const onKeyDown = (event: KeyboardEvent) => {
@@ -24,7 +26,7 @@ export function Modal({ open, title, children, onClose, footer }: ModalProps) {
return (
<div className={styles.overlay} role="presentation" onClick={onClose}>
<div
className={styles.dialog}
className={size === 'lg' ? `${styles.dialog} ${styles.lg}` : styles.dialog}
role="dialog"
aria-modal="true"
aria-label={title}
@@ -33,7 +35,10 @@ export function Modal({ open, title, children, onClose, footer }: ModalProps) {
<div className={styles.header}>
<h3 className={styles.title}>{title}</h3>
</div>
<div className={styles.body}>{children}</div>
{/* Long (lg) content scrolls; make it focusable so the keyboard can scroll it. */}
<div className={styles.body} tabIndex={size === 'lg' ? 0 : undefined}>
{children}
</div>
{footer && <div className={styles.footer}>{footer}</div>}
</div>
</div>
@@ -0,0 +1,17 @@
.wrapper {
display: flex;
align-items: flex-start;
gap: var(--space-3);
}
.content {
flex: 1;
min-width: 0;
}
.placeholder {
margin: 0;
color: var(--color-text-muted);
font-size: var(--font-size-sm);
line-height: 1.6;
}
@@ -0,0 +1,38 @@
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { Eye, EyeOff } from 'lucide-react';
import { Button } from '../Button/Button';
import { CodeBlock } from '../CodeBlock/CodeBlock';
import styles from './RevealableCodeBlock.module.css';
export interface RevealableCodeBlockProps {
code: string;
language?: string;
}
/** A CodeBlock that starts hidden; the code is only rendered after the user reveals it. */
export function RevealableCodeBlock({ code, language }: RevealableCodeBlockProps) {
const { t } = useTranslation();
const [revealed, setRevealed] = useState(false);
return (
<div className={styles.wrapper}>
<div className={styles.content}>
{revealed ? (
<CodeBlock code={code} language={language} />
) : (
<p className={styles.placeholder}>{t('revealable.hidden')}</p>
)}
</div>
<Button
variant="secondary"
size="sm"
aria-expanded={revealed}
onClick={() => setRevealed((r) => !r)}
>
{revealed ? <EyeOff size={14} /> : <Eye size={14} />}
{revealed ? t('revealable.hide') : t('revealable.reveal')}
</Button>
</div>
);
}
@@ -4,6 +4,23 @@
position: relative;
}
.badge {
transition: background var(--transition);
}
.badge:hover {
background: color-mix(in srgb, var(--color-neutral-bg) 85%, white);
}
.swatch {
width: 8px;
height: 8px;
border-radius: 50%;
border: 1px solid currentColor;
box-sizing: border-box;
flex-shrink: 0;
}
.button {
all: unset;
cursor: pointer;
+10 -1
View File
@@ -7,9 +7,15 @@ export interface UuidBadgeProps {
id: string;
}
function uuidColor(id: string): string | null {
const hex = id.replace(/-/g, '').slice(0, 6);
return /^[0-9a-f]{6}$/i.test(hex) ? `#${hex}` : null;
}
export function UuidBadge({ id }: UuidBadgeProps) {
const [copied, setCopied] = useState(false);
const short = `${id.slice(0, 4)}…${id.slice(-4)}`;
const color = uuidColor(id);
const handleClick = (e: React.MouseEvent) => {
e.stopPropagation();
@@ -21,7 +27,10 @@ export function UuidBadge({ id }: UuidBadgeProps) {
return (
<span className={styles.wrapper} title={copied ? 'Copied!' : id}>
<Badge variant="neutral">
<Badge variant="neutral" className={styles.badge}>
{color && (
<span className={styles.swatch} style={{ background: color }} aria-hidden="true" />
)}
<button type="button" className={styles.button} onClick={handleClick}>
{short}
</button>
+6
View File
@@ -43,6 +43,9 @@ export type { SearchProps } from './Search/Search';
export { CodeBlock } from './CodeBlock/CodeBlock';
export type { CodeBlockProps } from './CodeBlock/CodeBlock';
export { RevealableCodeBlock } from './RevealableCodeBlock/RevealableCodeBlock';
export type { RevealableCodeBlockProps } from './RevealableCodeBlock/RevealableCodeBlock';
export { CodeEditor } from './CodeEditor/CodeEditor';
export type { CodeEditorProps } from './CodeEditor/CodeEditor';
@@ -66,3 +69,6 @@ export type { TableProps, TableColumn, SortDirection } from './Table/Table';
export { UuidBadge } from './UuidBadge/UuidBadge';
export type { UuidBadgeProps } from './UuidBadge/UuidBadge';
export { LogOutput } from './LogOutput/LogOutput';
export type { LogOutputProps, LogOutputEntry, LogOutputLevel } from './LogOutput/LogOutput';
+2
View File
@@ -46,6 +46,7 @@
--color-text: #2D3339;
--color-text-muted: #634DBD; /* Kimberly, a touch darker for 4.5:1 on bg-subtle */
--color-text-faint: #5C6063; /* desaturated grey, ~4.5:1 on bg-subtle - as washed out as WCAG AA allows */
--color-border: #AFBFB9; /* Powder Ash */
--color-bg: #E6EDEA; /* Powder Ash tint */
--color-bg-subtle: #D8E2DE; /* Powder Ash tint, 1 step darker */
@@ -158,6 +159,7 @@ a:hover {
--color-text: #E2EAE6;
--color-text-muted: #A9A3C9; /* lightened Kimberly */
--color-text-faint: #9A9A9A; /* desaturated grey, ~4.5:1 on dark bg-subtle - as washed out as WCAG AA allows */
--color-border: #3D4850;
--color-bg: #1A1F24; /* deeper than Outer Space */
--color-bg-subtle: #2D3339; /* Outer Space */
+41
View File
@@ -204,6 +204,8 @@ The root `Dockerfile` builds a single image with the whole application: it build
The runtime image uses Playwright's headless-only Chromium build (`chromium-headless-shell`) with just the shared libraries it links against, plus DejaVu and Liberation fonts (Liberation is metric-compatible with Arial/Times, so pages lay out as they would with those fonts). All browser launches are headless, so the full desktop Chromium isn't installed. If a new Playwright version needs another library, `ldd` on the `chrome-headless-shell` binary in the image lists what's missing.
To keep the image small, production dependencies and the browser are installed in a separate `runtime-deps` stage, which drops what nothing loads at runtime (source maps, TypeScript sources and declarations, docs, TypeORM's browser build, better-sqlite3's C sources, and Playwright's ffmpeg, which is only used for video recording). The runtime stage is plain `debian:bookworm-slim` with only the `node` binary copied in, so the image has no `npm`, `npx`, `yarn` or `corepack`. If a package starts failing in the image only, check whether it reads one of the deleted file types at runtime.
```bash
docker compose build
```
@@ -216,6 +218,45 @@ docker compose build --no-cache
---
## Licenses
The project is MIT-licensed ([LICENSE](../LICENSE)); the `license` field in all three `package.json` files says the same.
The image ships third-party code: the server's production dependencies, the client's production dependencies (bundled into its build), the Node.js binary, Chromium and Debian packages. Their notices are in the image as follows:
- **npm packages and Node.js**: the `licenses` stage of the Dockerfile runs `scripts/third-party-licenses.mjs`, which writes the project's LICENSE followed by every production dependency of both workspaces with its license files (or, for the few packages that ship none, the declared license, author and source). Node.js's LICENSE for the exact version in the image is fetched from GitHub and appended. The result is `/app/client/licenses.txt`, which the app serves at `/licenses.txt`. The build fails if a package has no license information at all.
- **Server packages' own license files** stay in `node_modules`: the slimming step deletes Markdown files except `LICENSE*`, `NOTICE*` and `COPYING*`.
- **Chromium**: `LICENSE.headless_shell` next to the binary under `/ms-playwright`.
- **Debian packages**: `/usr/share/doc/*/copyright`.
The image also has the OCI labels `org.opencontainers.image.licenses=MIT`, `source`, `title` and `version` (CI passes the version as the `VERSION` build arg).
To check the notices locally, or to review a new dependency's license, run from the repository root:
```bash
node scripts/third-party-licenses.mjs > /tmp/licenses.txt
```
Before adding a dependency, check its license is compatible with MIT distribution (permissive licenses such as MIT, ISC, BSD, Apache-2.0 are; copyleft ones such as GPL or AGPL need a closer look).
---
## CI (Gitea Actions)
`.gitea/workflows/ci.yml` runs on pushes to `master` and on pull requests:
- **changes**: detects which of `server/` and `client/` changed (via `dorny/paths-filter`), also treating root `package.json`/`package-lock.json` and the workflow file itself as affecting both.
- **server** (skipped if nothing under `server/` changed): lint (no warnings allowed), type-check, tests, build.
- **client** (skipped if nothing under `client/` changed): lint (no warnings allowed), build, Storybook tests in headless Chromium.
- **version** (pushes to `master` only): reads `version` from the root `package.json` and checks the registry for an existing `<registry>/<owner>/<repo>:<version>` image; skips the image job if that tag is already present.
- **image** (pushes to `master` only): when the version job found no existing image for the current version, and the server/client jobs passed or were skipped, builds the Docker image and pushes it to the Gitea container registry set by `REGISTRY` at the top of the workflow (`git.hq.ars9.space`) as `<registry>/<owner>/<repo>:<version>` and `:latest`.
The image job logs in as the repository owner with the `REGISTRY_TOKEN` secret: a Gitea access token with package write access (Settings → Applications → token with `write:package`), added under the repository's Settings → Actions → Secrets. It runs `docker` on the runner, so the runner must give jobs access to a Docker daemon (act_runner mounts the host's Docker socket into job containers by default).
Jobs clone the repository from the address the runner was registered with. If that's an internal hostname (such as `http://gitea:3000` from Gitea's compose network), job containers can't resolve it: either register the runner with the public URL, or set `container.network` in the act_runner config to Gitea's Docker network so jobs join it.
---
## Running with Docker Compose
Start (detached):
+18 -5
View File
@@ -32,9 +32,9 @@ Available on `context`:
- `context.env`: shallow copy of the environment's key/value map
- `context.getEnv(key)`: environment value lookup (throws if missing)
- `context.getCredential(alias)`: payload of the credential assigned to the scenario under `alias` (parsed JSON when the data is JSON; throws if missing)
- `context.getStepOutput(order)`: output of a previous step by absolute order (`1`, `2`, ...) or relative (`-1` = previous step); `null` if there is none
- `context.getStepOutput(order)`: async (`await` it); output of a previous step by absolute order (`1`, `2`, ...) or relative (`-1` = previous step); `null` if there is none
- `context.dumpDom(selector?)`: simplified DOM snapshot of the page (or of one element)
- `context.log(...args)`, `context.warn(...args)`, `context.error(...args)`: run log entries
- `context.log(...args)`, `context.warn(...args)`, `context.error(...args)`, `context.debug(...args)`: run log entries
- `context.assert(() => boolean, description)`: runs the arrow function and requires it to return `true`. Logs `description` (as a `log` entry on success, as an `error` entry on failure or exception), then throws to stop the step if the function returned anything other than `true` or threw
- `context.runSnippet(name, ...args)`: runs stored snippet code with the same context; the snippet receives the extra arguments as `...args`. `name` is the snippet alias for its latest version, or `alias@<version>` (e.g. `login@3`) to pin a specific version. Snippet start/finish/failure is logged
- `context.getScenarioFiles(opts?)`: list files uploaded to the scenario (`limit`, `offset`), including their path on disk
@@ -42,12 +42,25 @@ Available on `context`:
Also in scope:
- `console`: proxied to run logs (`log`, `warn`, `error`, etc.)
- `console`: proxied to run logs (`log`/`info` → `log`, `warn`, `error`, `debug`)
- `expect`: Playwright's `expect` (e.g. `await expect(context.page.locator("h1")).toHaveText("Done")`)
Code is syntax-checked before it runs, and executes in the server process: it's trusted code, not sandboxed.
Step run logs also include automatic "Step N started / passed / failed" entries.
The step and snippet editors have a (?) button next to the Code label that opens a reference of this runtime in the UI. Its content is [client/src/components/modals/code-help.md](../client/src/components/modals/code-help.md): keep it in sync with this section when the `context` API changes.
## Run logs
Each run log entry (`level`, `message`, `createdAt`) also carries a `context`: where the message was generated. Contexts:
- `step:<N>`: the step a log entry belongs to, including the automatic "Step N started / passed / failed" entries
- `snippet:<alias>`: entries logged while `context.runSnippet(alias, ...)` is running, including its own automatic "started"/"finished"/"failed" entries. A snippet calling another snippet tags entries with the innermost running snippet's alias
- `assertion:pass` / `assertion:fail`: `context.assert()`'s own log entry
- `run`: run-level entries not tied to a step (e.g. a scenario timeout, or the Playwright trace upload notice)
`context.log`/`warn`/`error` (and `console.log`/etc.) split their arguments: strings/numbers/booleans are joined into `message`, while object/array arguments are kept out of it and stored as `data` (JSON), so `message` stays a stable string regardless of an object's shape. With one object argument `data` is that object; with more than one, `data` is an array of them. E.g. `context.log("Saved credential as run file:", fileMeta)` logs `message: "Saved credential as run file:"` with `fileMeta` as `data`, shown pretty-printed and separately from the message in the UI.
`GET /scenarios/:id/runs/:runId?q=...` and the exported CSV/Markdown logs (`GET /scenarios/:id/runs/:runId/export`) match `q` against both `message` and `context`.
## Versioning
@@ -77,7 +90,7 @@ Exports hold exactly one version and always include its `version` number (the la
- Items are imported in dependency order - environments, credentials, snippets, scenarios - regardless of their order in the file, so a scenario can reference an environment or credential from the same file.
- The response lists what was imported: `{ imported: [{ kind, id, name, version? }] }`.
A scenario export (`GET /scenarios/:id/export`, optionally with its environment and credentials) is in this format, one document per entity, and can be imported back as is.
A scenario export (`GET /scenarios/:id/export`, optionally with its environment, credentials and used snippets) is in this format, one document per entity, and can be imported back as is. Query parameters: `includeEnvironment=true`, `credentialIds` and `snippetIds` (repeat the parameter or separate ids with commas) and `version`. A selected snippet is exported once per version the scenario uses: the latest for plain `runSnippet("alias")` calls, plus each version pinned with `alias@N`. Snippets used only through other snippets count as used.
```yaml
---
+118 -607
View File
@@ -1,12 +1,13 @@
{
"name": "liqa",
"version": "1.20.2",
"version": "1.24.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "liqa",
"version": "1.20.2",
"version": "1.24.0",
"license": "MIT",
"workspaces": [
"server",
"client"
@@ -17,6 +18,7 @@
},
"client": {
"name": "liqa-client",
"license": "MIT",
"dependencies": {
"@monaco-editor/react": "^4.7.0",
"@tanstack/react-query": "^5.99.0",
@@ -1021,9 +1023,9 @@
}
},
"node_modules/@esbuild/aix-ppc64": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz",
"integrity": "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==",
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz",
"integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==",
"cpu": [
"ppc64"
],
@@ -1038,9 +1040,9 @@
}
},
"node_modules/@esbuild/android-arm": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.2.tgz",
"integrity": "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==",
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.12.tgz",
"integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==",
"cpu": [
"arm"
],
@@ -1055,9 +1057,9 @@
}
},
"node_modules/@esbuild/android-arm64": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.2.tgz",
"integrity": "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==",
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz",
"integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==",
"cpu": [
"arm64"
],
@@ -1072,9 +1074,9 @@
}
},
"node_modules/@esbuild/android-x64": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.2.tgz",
"integrity": "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==",
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.12.tgz",
"integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==",
"cpu": [
"x64"
],
@@ -1089,9 +1091,9 @@
}
},
"node_modules/@esbuild/darwin-arm64": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.2.tgz",
"integrity": "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==",
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz",
"integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==",
"cpu": [
"arm64"
],
@@ -1106,9 +1108,9 @@
}
},
"node_modules/@esbuild/darwin-x64": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.2.tgz",
"integrity": "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==",
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz",
"integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==",
"cpu": [
"x64"
],
@@ -1123,9 +1125,9 @@
}
},
"node_modules/@esbuild/freebsd-arm64": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.2.tgz",
"integrity": "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==",
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz",
"integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==",
"cpu": [
"arm64"
],
@@ -1140,9 +1142,9 @@
}
},
"node_modules/@esbuild/freebsd-x64": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.2.tgz",
"integrity": "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==",
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz",
"integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==",
"cpu": [
"x64"
],
@@ -1157,9 +1159,9 @@
}
},
"node_modules/@esbuild/linux-arm": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.2.tgz",
"integrity": "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==",
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz",
"integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==",
"cpu": [
"arm"
],
@@ -1174,9 +1176,9 @@
}
},
"node_modules/@esbuild/linux-arm64": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.2.tgz",
"integrity": "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==",
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz",
"integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==",
"cpu": [
"arm64"
],
@@ -1191,9 +1193,9 @@
}
},
"node_modules/@esbuild/linux-ia32": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.2.tgz",
"integrity": "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==",
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz",
"integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==",
"cpu": [
"ia32"
],
@@ -1208,9 +1210,9 @@
}
},
"node_modules/@esbuild/linux-loong64": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.2.tgz",
"integrity": "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==",
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz",
"integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==",
"cpu": [
"loong64"
],
@@ -1225,9 +1227,9 @@
}
},
"node_modules/@esbuild/linux-mips64el": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.2.tgz",
"integrity": "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==",
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz",
"integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==",
"cpu": [
"mips64el"
],
@@ -1242,9 +1244,9 @@
}
},
"node_modules/@esbuild/linux-ppc64": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.2.tgz",
"integrity": "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==",
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz",
"integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==",
"cpu": [
"ppc64"
],
@@ -1259,9 +1261,9 @@
}
},
"node_modules/@esbuild/linux-riscv64": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.2.tgz",
"integrity": "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==",
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz",
"integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==",
"cpu": [
"riscv64"
],
@@ -1276,9 +1278,9 @@
}
},
"node_modules/@esbuild/linux-s390x": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.2.tgz",
"integrity": "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==",
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz",
"integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==",
"cpu": [
"s390x"
],
@@ -1293,9 +1295,9 @@
}
},
"node_modules/@esbuild/linux-x64": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.2.tgz",
"integrity": "sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==",
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz",
"integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==",
"cpu": [
"x64"
],
@@ -1310,9 +1312,9 @@
}
},
"node_modules/@esbuild/netbsd-arm64": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.2.tgz",
"integrity": "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==",
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz",
"integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==",
"cpu": [
"arm64"
],
@@ -1327,9 +1329,9 @@
}
},
"node_modules/@esbuild/netbsd-x64": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.2.tgz",
"integrity": "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==",
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz",
"integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==",
"cpu": [
"x64"
],
@@ -1344,9 +1346,9 @@
}
},
"node_modules/@esbuild/openbsd-arm64": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.2.tgz",
"integrity": "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==",
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz",
"integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==",
"cpu": [
"arm64"
],
@@ -1361,9 +1363,9 @@
}
},
"node_modules/@esbuild/openbsd-x64": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.2.tgz",
"integrity": "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==",
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz",
"integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==",
"cpu": [
"x64"
],
@@ -1378,9 +1380,9 @@
}
},
"node_modules/@esbuild/openharmony-arm64": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.2.tgz",
"integrity": "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==",
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz",
"integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==",
"cpu": [
"arm64"
],
@@ -1395,9 +1397,9 @@
}
},
"node_modules/@esbuild/sunos-x64": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.2.tgz",
"integrity": "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==",
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz",
"integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==",
"cpu": [
"x64"
],
@@ -1412,9 +1414,9 @@
}
},
"node_modules/@esbuild/win32-arm64": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.2.tgz",
"integrity": "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==",
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz",
"integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==",
"cpu": [
"arm64"
],
@@ -1429,9 +1431,9 @@
}
},
"node_modules/@esbuild/win32-ia32": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.2.tgz",
"integrity": "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==",
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz",
"integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==",
"cpu": [
"ia32"
],
@@ -1446,9 +1448,9 @@
}
},
"node_modules/@esbuild/win32-x64": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.2.tgz",
"integrity": "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==",
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz",
"integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==",
"cpu": [
"x64"
],
@@ -5400,13 +5402,6 @@
"undici-types": ">=7.24.0 <7.24.7"
}
},
"node_modules/@types/node/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/@types/qs": {
"version": "6.15.1",
"resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.15.1.tgz",
@@ -8761,9 +8756,9 @@
}
},
"node_modules/esbuild": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.2.tgz",
"integrity": "sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==",
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz",
"integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==",
"dev": true,
"hasInstallScript": true,
"license": "MIT",
@@ -8774,32 +8769,32 @@
"node": ">=18"
},
"optionalDependencies": {
"@esbuild/aix-ppc64": "0.28.2",
"@esbuild/android-arm": "0.28.2",
"@esbuild/android-arm64": "0.28.2",
"@esbuild/android-x64": "0.28.2",
"@esbuild/darwin-arm64": "0.28.2",
"@esbuild/darwin-x64": "0.28.2",
"@esbuild/freebsd-arm64": "0.28.2",
"@esbuild/freebsd-x64": "0.28.2",
"@esbuild/linux-arm": "0.28.2",
"@esbuild/linux-arm64": "0.28.2",
"@esbuild/linux-ia32": "0.28.2",
"@esbuild/linux-loong64": "0.28.2",
"@esbuild/linux-mips64el": "0.28.2",
"@esbuild/linux-ppc64": "0.28.2",
"@esbuild/linux-riscv64": "0.28.2",
"@esbuild/linux-s390x": "0.28.2",
"@esbuild/linux-x64": "0.28.2",
"@esbuild/netbsd-arm64": "0.28.2",
"@esbuild/netbsd-x64": "0.28.2",
"@esbuild/openbsd-arm64": "0.28.2",
"@esbuild/openbsd-x64": "0.28.2",
"@esbuild/openharmony-arm64": "0.28.2",
"@esbuild/sunos-x64": "0.28.2",
"@esbuild/win32-arm64": "0.28.2",
"@esbuild/win32-ia32": "0.28.2",
"@esbuild/win32-x64": "0.28.2"
"@esbuild/aix-ppc64": "0.25.12",
"@esbuild/android-arm": "0.25.12",
"@esbuild/android-arm64": "0.25.12",
"@esbuild/android-x64": "0.25.12",
"@esbuild/darwin-arm64": "0.25.12",
"@esbuild/darwin-x64": "0.25.12",
"@esbuild/freebsd-arm64": "0.25.12",
"@esbuild/freebsd-x64": "0.25.12",
"@esbuild/linux-arm": "0.25.12",
"@esbuild/linux-arm64": "0.25.12",
"@esbuild/linux-ia32": "0.25.12",
"@esbuild/linux-loong64": "0.25.12",
"@esbuild/linux-mips64el": "0.25.12",
"@esbuild/linux-ppc64": "0.25.12",
"@esbuild/linux-riscv64": "0.25.12",
"@esbuild/linux-s390x": "0.25.12",
"@esbuild/linux-x64": "0.25.12",
"@esbuild/netbsd-arm64": "0.25.12",
"@esbuild/netbsd-x64": "0.25.12",
"@esbuild/openbsd-arm64": "0.25.12",
"@esbuild/openbsd-x64": "0.25.12",
"@esbuild/openharmony-arm64": "0.25.12",
"@esbuild/sunos-x64": "0.25.12",
"@esbuild/win32-arm64": "0.25.12",
"@esbuild/win32-ia32": "0.25.12",
"@esbuild/win32-x64": "0.25.12"
}
},
"node_modules/escalade": {
@@ -16449,9 +16444,9 @@
}
},
"node_modules/undici-types": {
"version": "7.30.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.30.0.tgz",
"integrity": "sha512-7QjA5O+GhM27do7Id6hQZpnYEd7WzHbs7/XIS9A1k+Gat/ZVF7Jmpzt68zL/205f65FYwDNLSjQemHPS8ReM/A==",
"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"
},
@@ -16820,490 +16815,6 @@
}
}
},
"node_modules/vite/node_modules/@esbuild/aix-ppc64": {
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz",
"integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==",
"cpu": [
"ppc64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"aix"
],
"engines": {
"node": ">=18"
}
},
"node_modules/vite/node_modules/@esbuild/android-arm": {
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.12.tgz",
"integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==",
"cpu": [
"arm"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=18"
}
},
"node_modules/vite/node_modules/@esbuild/android-arm64": {
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz",
"integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=18"
}
},
"node_modules/vite/node_modules/@esbuild/android-x64": {
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.12.tgz",
"integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=18"
}
},
"node_modules/vite/node_modules/@esbuild/darwin-arm64": {
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz",
"integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">=18"
}
},
"node_modules/vite/node_modules/@esbuild/darwin-x64": {
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz",
"integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">=18"
}
},
"node_modules/vite/node_modules/@esbuild/freebsd-arm64": {
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz",
"integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"freebsd"
],
"engines": {
"node": ">=18"
}
},
"node_modules/vite/node_modules/@esbuild/freebsd-x64": {
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz",
"integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"freebsd"
],
"engines": {
"node": ">=18"
}
},
"node_modules/vite/node_modules/@esbuild/linux-arm": {
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz",
"integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==",
"cpu": [
"arm"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=18"
}
},
"node_modules/vite/node_modules/@esbuild/linux-arm64": {
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz",
"integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=18"
}
},
"node_modules/vite/node_modules/@esbuild/linux-ia32": {
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz",
"integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==",
"cpu": [
"ia32"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=18"
}
},
"node_modules/vite/node_modules/@esbuild/linux-loong64": {
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz",
"integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==",
"cpu": [
"loong64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=18"
}
},
"node_modules/vite/node_modules/@esbuild/linux-mips64el": {
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz",
"integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==",
"cpu": [
"mips64el"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=18"
}
},
"node_modules/vite/node_modules/@esbuild/linux-ppc64": {
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz",
"integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==",
"cpu": [
"ppc64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=18"
}
},
"node_modules/vite/node_modules/@esbuild/linux-riscv64": {
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz",
"integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==",
"cpu": [
"riscv64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=18"
}
},
"node_modules/vite/node_modules/@esbuild/linux-s390x": {
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz",
"integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==",
"cpu": [
"s390x"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=18"
}
},
"node_modules/vite/node_modules/@esbuild/linux-x64": {
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz",
"integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=18"
}
},
"node_modules/vite/node_modules/@esbuild/netbsd-arm64": {
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz",
"integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"netbsd"
],
"engines": {
"node": ">=18"
}
},
"node_modules/vite/node_modules/@esbuild/netbsd-x64": {
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz",
"integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"netbsd"
],
"engines": {
"node": ">=18"
}
},
"node_modules/vite/node_modules/@esbuild/openbsd-arm64": {
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz",
"integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"openbsd"
],
"engines": {
"node": ">=18"
}
},
"node_modules/vite/node_modules/@esbuild/openbsd-x64": {
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz",
"integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"openbsd"
],
"engines": {
"node": ">=18"
}
},
"node_modules/vite/node_modules/@esbuild/openharmony-arm64": {
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz",
"integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"openharmony"
],
"engines": {
"node": ">=18"
}
},
"node_modules/vite/node_modules/@esbuild/sunos-x64": {
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz",
"integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"sunos"
],
"engines": {
"node": ">=18"
}
},
"node_modules/vite/node_modules/@esbuild/win32-arm64": {
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz",
"integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=18"
}
},
"node_modules/vite/node_modules/@esbuild/win32-ia32": {
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz",
"integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==",
"cpu": [
"ia32"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=18"
}
},
"node_modules/vite/node_modules/@esbuild/win32-x64": {
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz",
"integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=18"
}
},
"node_modules/vite/node_modules/esbuild": {
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz",
"integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==",
"dev": true,
"hasInstallScript": true,
"license": "MIT",
"bin": {
"esbuild": "bin/esbuild"
},
"engines": {
"node": ">=18"
},
"optionalDependencies": {
"@esbuild/aix-ppc64": "0.25.12",
"@esbuild/android-arm": "0.25.12",
"@esbuild/android-arm64": "0.25.12",
"@esbuild/android-x64": "0.25.12",
"@esbuild/darwin-arm64": "0.25.12",
"@esbuild/darwin-x64": "0.25.12",
"@esbuild/freebsd-arm64": "0.25.12",
"@esbuild/freebsd-x64": "0.25.12",
"@esbuild/linux-arm": "0.25.12",
"@esbuild/linux-arm64": "0.25.12",
"@esbuild/linux-ia32": "0.25.12",
"@esbuild/linux-loong64": "0.25.12",
"@esbuild/linux-mips64el": "0.25.12",
"@esbuild/linux-ppc64": "0.25.12",
"@esbuild/linux-riscv64": "0.25.12",
"@esbuild/linux-s390x": "0.25.12",
"@esbuild/linux-x64": "0.25.12",
"@esbuild/netbsd-arm64": "0.25.12",
"@esbuild/netbsd-x64": "0.25.12",
"@esbuild/openbsd-arm64": "0.25.12",
"@esbuild/openbsd-x64": "0.25.12",
"@esbuild/openharmony-arm64": "0.25.12",
"@esbuild/sunos-x64": "0.25.12",
"@esbuild/win32-arm64": "0.25.12",
"@esbuild/win32-ia32": "0.25.12",
"@esbuild/win32-x64": "0.25.12"
}
},
"node_modules/vitest": {
"version": "4.1.11",
"resolved": "https://registry.npmjs.org/vitest/-/vitest-4.1.11.tgz",
@@ -17413,9 +16924,9 @@
}
},
"node_modules/vitest/node_modules/chai": {
"version": "6.2.2",
"resolved": "https://registry.npmjs.org/chai/-/chai-6.2.2.tgz",
"integrity": "sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==",
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/chai/-/chai-6.3.0.tgz",
"integrity": "sha512-XWAtwJ6OHO+tj0EKCs0Y2UamnyOxseZWltU4x2U2wh8g4AigdjwvtUjvLP2tqkA/avxHEtzxNaqGq/YGNwckKg==",
"dev": true,
"license": "MIT",
"engines": {
@@ -17935,7 +17446,7 @@
},
"server": {
"name": "liqa-server",
"license": "ISC",
"license": "MIT",
"dependencies": {
"@modelcontextprotocol/sdk": "^1.29.0",
"@mozilla/readability": "^0.6.0",
+3 -1
View File
@@ -1,7 +1,9 @@
{
"name": "liqa",
"version": "1.20.2",
"version": "1.24.0",
"private": true,
"license": "MIT",
"author": "Andrii Arsenin",
"engines": {
"node": ">=24"
},
+39
View File
@@ -0,0 +1,39 @@
#!/usr/bin/env bash
# Installs liqa into a target directory: writes a compose.yaml pulling the
# published image (git.hq.ars9.space/ars9/liqa) and creates ./data for the
# SQLite database, so the install directory needs no copy of this repo.
set -euo pipefail
REGISTRY_IMAGE="git.hq.ars9.space/ars9/liqa"
read -rp "Install directory [./liqa]: " install_dir
install_dir="${install_dir:-./liqa}"
read -rp "Port to expose [13000]: " port
port="${port:-13000}"
read -rp "Version to install [latest]: " version
version="${version:-latest}"
mkdir -p "$install_dir/data"
compose_file="$install_dir/compose.yaml"
cat > "$compose_file" <<EOF
services:
liqa:
image: ${REGISTRY_IMAGE}:${version}
ports:
- "${port}:3000"
env_file:
- path: .env
required: false
volumes:
- ./data:/app/data
restart: unless-stopped
EOF
echo "Wrote $compose_file"
echo "Created $install_dir/data"
echo
echo "To start liqa:"
echo " cd $install_dir && docker compose up -d"
+118
View File
@@ -0,0 +1,118 @@
#!/usr/bin/env node
// Writes the license notices for everything the app ships to stdout: the
// project's own LICENSE, then every production dependency of the client and
// server workspaces with its license text, as installed in node_modules.
//
// node scripts/third-party-licenses.mjs > licenses.txt
//
// Run it from the repository root after `npm ci` (dev dependencies may be
// installed too; only production dependencies are listed). Exits non-zero
// when a package's license can't be determined.
import { execFileSync } from "node:child_process";
import * as fs from "node:fs";
import * as path from "node:path";
const ROOT = process.cwd();
const LICENSE_FILE = /^(licen[cs]e|copying|notice)(\.|-|$)/i;
const tree = JSON.parse(
execFileSync("npm", ["ls", "--omit=dev", "--all", "--long", "--json"], {
cwd: ROOT,
encoding: "utf8",
maxBuffer: 256 * 1024 * 1024,
// npm ls exits non-zero on unmet optional peers; the JSON is still complete
stdio: ["ignore", "pipe", "ignore"],
}).toString() || "{}",
);
const workspaces = new Set(
(
JSON.parse(fs.readFileSync(path.join(ROOT, "package.json"), "utf8"))
.workspaces ?? []
).map((w) => path.resolve(ROOT, w)),
);
/** name@version → { name, version, license, dir } */
const packages = new Map();
const walk = (node) => {
for (const [name, dep] of Object.entries(node.dependencies ?? {})) {
// Unmet optional peers have no path
if (!dep.path) continue;
// Workspace packages are our own code: list only their dependencies
if (!workspaces.has(fs.realpathSync(dep.path))) {
const key = `${name}@${dep.version}`;
if (packages.has(key)) continue;
packages.set(key, { name, version: dep.version, dir: dep.path });
}
walk(dep);
}
};
walk(tree);
const manifestOf = (pkg) =>
JSON.parse(fs.readFileSync(path.join(pkg.dir, "package.json"), "utf8"));
const licenseOf = (pkg) => {
const manifest = manifestOf(pkg);
const field = manifest.license ?? manifest.licenses;
if (typeof field === "string") return field;
if (Array.isArray(field)) return field.map((l) => l.type ?? l).join(" OR ");
if (field?.type) return field.type;
return null;
};
const licenseTexts = (pkg) =>
fs
.readdirSync(pkg.dir)
.filter(
(f) =>
LICENSE_FILE.test(f) && fs.statSync(path.join(pkg.dir, f)).isFile(),
)
.sort()
.map((f) => fs.readFileSync(path.join(pkg.dir, f), "utf8").trim());
// For packages that ship no license file, record who to attribute and where
// the full terms are
const withoutLicenseFile = (pkg, license) => {
const { author, repository, homepage } = manifestOf(pkg);
const authorName = typeof author === "string" ? author : author?.name;
const repo = typeof repository === "string" ? repository : repository?.url;
return [
`The package ships no license file; its package.json declares ${license}.`,
authorName && `Author: ${authorName}`,
(repo || homepage) && `Source: ${repo || homepage}`,
]
.filter(Boolean)
.join("\n");
};
const missing = [];
const sections = [...packages.values()]
.sort(
(a, b) =>
a.name.localeCompare(b.name) || a.version.localeCompare(b.version),
)
.map((pkg) => {
const license = licenseOf(pkg);
const texts = licenseTexts(pkg);
if (!license && texts.length === 0)
missing.push(`${pkg.name}@${pkg.version}`);
const body =
texts.length > 0 ? texts.join("\n\n") : withoutLicenseFile(pkg, license);
return `${pkg.name}@${pkg.version}\nLicense: ${license ?? "see below"}\n\n${body}`;
});
if (missing.length > 0) {
console.error(`No license information for: ${missing.join(", ")}`);
process.exit(1);
}
const rule = "-".repeat(79);
process.stdout.write(
[
fs.readFileSync(path.join(ROOT, "LICENSE"), "utf8").trim(),
`${"=".repeat(79)}\n\nThird-party software\n\nThis application includes the following third-party packages (${sections.length}),\nunder their own licenses:`,
...sections,
].join(`\n\n${rule}\n\n`) + "\n",
);
+4
View File
@@ -12,4 +12,8 @@ module.exports = {
'^@mozilla/readability$': '<rootDir>/test/__mocks__/readability.ts',
},
testEnvironment: 'node',
// Each suite builds a full Nest app in beforeAll. That takes well under a
// second on an idle machine, but several seconds when every suite starts at
// once on a busy CI runner, past Jest's default 5 s.
testTimeout: 30_000,
};
+2 -2
View File
@@ -18,8 +18,8 @@
"test:watch": "jest --watch"
},
"keywords": [],
"author": "",
"license": "ISC",
"author": "Andrii Arsenin",
"license": "MIT",
"dependencies": {
"@modelcontextprotocol/sdk": "^1.29.0",
"@mozilla/readability": "^0.6.0",
@@ -19,8 +19,12 @@ export interface ExecResult {
}
export type ScriptLogger = (
level: "log" | "warn" | "error",
level: "debug" | "log" | "warn" | "error",
message: string,
/** Where the message was generated, e.g. "step:2", "snippet:login", "assertion:pass". */
context?: string | null,
/** Structured payload attached to the message (e.g. a created file's metadata). */
data?: unknown,
) => void;
/** The `context` object available inside user scripts as the sole argument. */
@@ -42,6 +46,7 @@ export interface ScriptContext {
log: (...args: unknown[]) => void;
warn: (...args: unknown[]) => void;
error: (...args: unknown[]) => void;
debug: (...args: unknown[]) => void;
/**
* Runs `fn` and requires it to return `true`. Logs the outcome under
* `description`, then throws if `fn` returned anything other than `true`
@@ -70,6 +75,8 @@ export interface ExecContext {
browser: BrowserContext;
code: string;
log?: ScriptLogger;
/** Base log context for this execution, e.g. "step:2". */
logContext?: string | null;
getStepOutput?: (order: number) => Promise<unknown>;
credentials?: Record<string, unknown>;
environment?: EnvironmentData | null;
@@ -110,6 +117,7 @@ export class CodeExecutorService {
browser,
code,
log,
logContext,
getStepOutput,
credentials,
environment,
@@ -120,10 +128,44 @@ export class CodeExecutorService {
} = ctx;
const scriptLog: ScriptLogger =
log ?? ((level, msg) => this.logger[level](msg));
const toStr = (args: unknown[]) =>
args
.map((a) => (typeof a === "object" ? JSON.stringify(a) : String(a)))
.join(" ");
// Splits console/log args into a plain-text message (strings, numbers, ...)
// and a structured data payload (objects/arrays), logged separately so the
// message stays a stable string regardless of the object's shape.
const splitLogArgs = (
args: unknown[],
): { message: string; data: unknown } => {
const strings: string[] = [];
const objects: unknown[] = [];
for (const a of args) {
if (a !== null && typeof a === "object") {
objects.push(a);
} else {
strings.push(String(a));
}
}
return {
message: strings.join(" "),
data: objects.length === 0 ? null : objects.length === 1 ? objects[0] : objects,
};
};
// Innermost running snippet (if any) tags log entries; falls back to
// logContext (e.g. the current step) outside of any runSnippet call.
const contextStack: string[] = logContext ? [logContext] : [];
const currentContext = (): string | null =>
contextStack.length > 0 ? contextStack[contextStack.length - 1] : null;
const emit = (
level: "debug" | "log" | "warn" | "error",
message: string,
contextOverride?: string,
data?: unknown,
): void =>
scriptLog(level, message, contextOverride ?? currentContext(), data);
const emitArgs = (level: "debug" | "log" | "warn" | "error", args: unknown[]): void => {
const { message, data } = splitLogArgs(args);
emit(level, message, undefined, data);
};
const credMap: Record<string, unknown> = credentials ?? {};
const envData: EnvironmentData = environment ?? {};
@@ -133,11 +175,11 @@ export class CodeExecutorService {
let scriptContext: ScriptContext;
const fakeConsole = {
log: (...args: unknown[]) => scriptLog("log", toStr(args)),
warn: (...args: unknown[]) => scriptLog("warn", toStr(args)),
error: (...args: unknown[]) => scriptLog("error", toStr(args)),
info: (...args: unknown[]) => scriptLog("log", toStr(args)),
debug: (...args: unknown[]) => scriptLog("log", toStr(args)),
log: (...args: unknown[]) => emitArgs("log", args),
warn: (...args: unknown[]) => emitArgs("warn", args),
error: (...args: unknown[]) => emitArgs("error", args),
info: (...args: unknown[]) => emitArgs("log", args),
debug: (...args: unknown[]) => emitArgs("debug", args),
};
try {
@@ -145,9 +187,10 @@ export class CodeExecutorService {
page,
browser,
dumpDom: (selector?: string) => dumpDom(page, selector),
log: (...args: unknown[]) => scriptLog("log", toStr(args)),
warn: (...args: unknown[]) => scriptLog("warn", toStr(args)),
error: (...args: unknown[]) => scriptLog("error", toStr(args)),
log: (...args: unknown[]) => emitArgs("log", args),
warn: (...args: unknown[]) => emitArgs("warn", args),
error: (...args: unknown[]) => emitArgs("error", args),
debug: (...args: unknown[]) => emitArgs("debug", args),
assert: async (
fn: () => boolean | Promise<boolean>,
description: string,
@@ -161,13 +204,13 @@ export class CodeExecutorService {
failureReason = (err as Error).message;
}
if (passed) {
scriptLog("log", `Assertion passed: ${description}`);
emit("log", description, "assertion:pass");
return;
}
const message = failureReason
? `Assertion failed: ${description} (${failureReason})`
: `Assertion failed: ${description}`;
scriptLog("error", message);
emit("error", message, "assertion:fail");
throw new Error(message);
},
getStepOutput: getStepOutput ?? (() => Promise.resolve(null)),
@@ -197,7 +240,9 @@ export class CodeExecutorService {
if (snippetCode == null) {
throw new Error(`Snippet alias "${alias}" not found`);
}
scriptLog("log", `Snippet "${alias}" started`);
const snippetContext = `snippet:${alias}`;
contextStack.push(snippetContext);
emit("log", `Snippet "${alias}" started`, snippetContext);
const snippetFn = new Function(
"context",
"console",
@@ -212,14 +257,17 @@ export class CodeExecutorService {
args,
playwrightExpect,
);
scriptLog("log", `Snippet "${alias}" finished`);
emit("log", `Snippet "${alias}" finished`, snippetContext);
return snippetResult;
} catch (err) {
scriptLog(
emit(
"error",
`Snippet "${alias}" failed: ${(err as Error).message}`,
snippetContext,
);
throw err;
} finally {
contextStack.pop();
}
},
getScenarioFiles: async (opts?: { limit?: number; offset?: number }) => {
@@ -26,6 +26,11 @@ export class ExecContextBuilder {
return this;
}
logContext(logContext: string): this {
this.ctx.logContext = logContext;
return this;
}
getStepOutput(fn: (order: number) => Promise<unknown>): this {
this.ctx.getStepOutput = fn;
return this;
@@ -0,0 +1,31 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class AddRunLogContext1790848194828 implements MigrationInterface {
name = "AddRunLogContext1790848194828";
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`CREATE TABLE "temporary_scenario_run_logs" ("id" varchar PRIMARY KEY NOT NULL, "runId" varchar NOT NULL, "stepRunId" varchar, "level" text NOT NULL DEFAULT ('log'), "message" text NOT NULL, "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "seq" integer NOT NULL DEFAULT (0), "context" text, CONSTRAINT "FK_dde48478a42823e583a360dd468" FOREIGN KEY ("runId") REFERENCES "scenario_runs" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_62d82b9fce3a6a2947ed1136c67" FOREIGN KEY ("stepRunId") REFERENCES "scenario_run_steps" ("id") ON DELETE SET NULL ON UPDATE NO ACTION)`,
);
await queryRunner.query(
`INSERT INTO "temporary_scenario_run_logs"("id", "runId", "stepRunId", "level", "message", "createdAt", "seq") SELECT "id", "runId", "stepRunId", "level", "message", "createdAt", "seq" FROM "scenario_run_logs"`,
);
await queryRunner.query(`DROP TABLE "scenario_run_logs"`);
await queryRunner.query(
`ALTER TABLE "temporary_scenario_run_logs" RENAME TO "scenario_run_logs"`,
);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "scenario_run_logs" RENAME TO "temporary_scenario_run_logs"`,
);
await queryRunner.query(
`CREATE TABLE "scenario_run_logs" ("id" varchar PRIMARY KEY NOT NULL, "runId" varchar NOT NULL, "stepRunId" varchar, "level" text NOT NULL DEFAULT ('log'), "message" text NOT NULL, "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "seq" integer NOT NULL DEFAULT (0), CONSTRAINT "FK_dde48478a42823e583a360dd468" FOREIGN KEY ("runId") REFERENCES "scenario_runs" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_62d82b9fce3a6a2947ed1136c67" FOREIGN KEY ("stepRunId") REFERENCES "scenario_run_steps" ("id") ON DELETE SET NULL ON UPDATE NO ACTION)`,
);
await queryRunner.query(
`INSERT INTO "scenario_run_logs"("id", "runId", "stepRunId", "level", "message", "createdAt", "seq") SELECT "id", "runId", "stepRunId", "level", "message", "createdAt", "seq" FROM "temporary_scenario_run_logs"`,
);
await queryRunner.query(`DROP TABLE "temporary_scenario_run_logs"`);
}
}
@@ -0,0 +1,31 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class AddRunLogData1790850734763 implements MigrationInterface {
name = "AddRunLogData1790850734763";
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`CREATE TABLE "temporary_scenario_run_logs" ("id" varchar PRIMARY KEY NOT NULL, "runId" varchar NOT NULL, "stepRunId" varchar, "level" text NOT NULL DEFAULT ('log'), "message" text NOT NULL, "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "seq" integer NOT NULL DEFAULT (0), "context" text, "data" text, CONSTRAINT "FK_62d82b9fce3a6a2947ed1136c67" FOREIGN KEY ("stepRunId") REFERENCES "scenario_run_steps" ("id") ON DELETE SET NULL ON UPDATE NO ACTION, CONSTRAINT "FK_dde48478a42823e583a360dd468" FOREIGN KEY ("runId") REFERENCES "scenario_runs" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`,
);
await queryRunner.query(
`INSERT INTO "temporary_scenario_run_logs"("id", "runId", "stepRunId", "level", "message", "createdAt", "seq", "context") SELECT "id", "runId", "stepRunId", "level", "message", "createdAt", "seq", "context" FROM "scenario_run_logs"`,
);
await queryRunner.query(`DROP TABLE "scenario_run_logs"`);
await queryRunner.query(
`ALTER TABLE "temporary_scenario_run_logs" RENAME TO "scenario_run_logs"`,
);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "scenario_run_logs" RENAME TO "temporary_scenario_run_logs"`,
);
await queryRunner.query(
`CREATE TABLE "scenario_run_logs" ("id" varchar PRIMARY KEY NOT NULL, "runId" varchar NOT NULL, "stepRunId" varchar, "level" text NOT NULL DEFAULT ('log'), "message" text NOT NULL, "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "seq" integer NOT NULL DEFAULT (0), "context" text, CONSTRAINT "FK_62d82b9fce3a6a2947ed1136c67" FOREIGN KEY ("stepRunId") REFERENCES "scenario_run_steps" ("id") ON DELETE SET NULL ON UPDATE NO ACTION, CONSTRAINT "FK_dde48478a42823e583a360dd468" FOREIGN KEY ("runId") REFERENCES "scenario_runs" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`,
);
await queryRunner.query(
`INSERT INTO "scenario_run_logs"("id", "runId", "stepRunId", "level", "message", "createdAt", "seq", "context") SELECT "id", "runId", "stepRunId", "level", "message", "createdAt", "seq", "context" FROM "temporary_scenario_run_logs"`,
);
await queryRunner.query(`DROP TABLE "temporary_scenario_run_logs"`);
}
}
+7 -1
View File
@@ -1,7 +1,13 @@
import { Initial1790793447827 } from "./1790793447827-Initial";
import { AddRunLogContext1790848194828 } from "./1790848194828-AddRunLogContext";
import { AddRunLogData1790850734763 } from "./1790850734763-AddRunLogData";
/**
* All migrations, oldest first. Listed explicitly (instead of a glob) so the
* same list works from compiled JS, ts-jest and the TypeORM CLI.
*/
export const MIGRATIONS = [Initial1790793447827];
export const MIGRATIONS = [
Initial1790793447827,
AddRunLogContext1790848194828,
AddRunLogData1790850734763,
];
@@ -13,6 +13,7 @@ import {
ValidateNested,
} from "class-validator";
import { EnvironmentData } from "../../environment/environment.entity";
import { SnippetExportDto } from "../../snippet/dto/snippet-export.dto";
export class ScenarioStepExportDto {
@ApiPropertyOptional()
@@ -154,4 +155,5 @@ export class ScenarioExportDto {
export type ExportEntity =
| EnvironmentExportInlineDto
| CredentialExportDto
| SnippetExportDto
| ScenarioExportDto;
+10 -1
View File
@@ -9,7 +9,7 @@ import {
import { ScenarioRunStepEntity } from "./scenario-run-step.entity";
import { ScenarioRunEntity } from "./scenario-run.entity";
export type LogLevel = "log" | "warn" | "error";
export type LogLevel = "debug" | "log" | "warn" | "error";
@Entity("scenario_run_logs")
export class ScenarioRunLogEntity {
@@ -36,9 +36,18 @@ export class ScenarioRunLogEntity {
@Column({ type: "text", default: "log" })
level: LogLevel;
// Where the message was generated, e.g. "step:2", "snippet:login", "assertion:pass"
@Column({ type: "text", nullable: true })
context: string | null;
@Column({ type: "text" })
message: string;
// JSON payload attached to the message (e.g. a created file's metadata),
// kept separate so message stays a stable, human-readable string.
@Column({ type: "text", nullable: true })
data: string | null;
// Assigned in call order per run, since concurrent unawaited writes can
// otherwise persist out of order (createdAt alone isn't a reliable tiebreaker).
@Column({ type: "int", default: 0 })
@@ -143,26 +143,36 @@ export class ScenarioSchedulerService implements OnModuleInit {
statuses: ["pending", "waiting"],
})
.execute();
this.persistLog(runId, null, "error", reason);
this.persistLog(runId, null, "error", reason, "run");
}
private persistLog(
runId: string,
stepRunId: string | null,
level: "log" | "warn" | "error",
level: "debug" | "log" | "warn" | "error",
message: string,
context: string | null = null,
data: unknown = null,
): void {
const seq = (this.runLogSeq.get(runId) ?? 0) + 1;
this.runLogSeq.set(runId, seq);
void this.runLogRepo.save(
this.runLogRepo.create({ runId, stepRunId, level, message, seq }),
this.runLogRepo.create({
runId,
stepRunId,
level,
message,
context,
data: data != null ? JSON.stringify(data) : null,
seq,
}),
);
}
private stepLogger(stepRunId: string, runId: string): ScriptLogger {
return (level, msg) => {
return (level, msg, context, data) => {
this.logger[level](`StepRun #${stepRunId} script: ${msg}`);
this.persistLog(runId, stepRunId, level, msg);
this.persistLog(runId, stepRunId, level, msg, context ?? null, data ?? null);
};
}
@@ -384,6 +394,7 @@ export class ScenarioSchedulerService implements OnModuleInit {
stepRun.id,
"log",
`Step ${step.order} started${step.title ? `: ${step.title}` : ""}`,
`step:${step.order}`,
);
try {
@@ -402,6 +413,7 @@ export class ScenarioSchedulerService implements OnModuleInit {
.browser(context)
.code(step.execCode)
.log(this.stepLogger(stepRun.id, stepRun.runId))
.logContext(`step:${step.order}`)
.getStepOutput(getStepOutput)
.credentials(creds)
.environment(env)
@@ -527,6 +539,7 @@ export class ScenarioSchedulerService implements OnModuleInit {
null,
"log",
"Playwright trace uploaded to run files (open with `npx playwright show-trace trace.zip` or https://trace.playwright.dev)",
"run",
);
} catch (err) {
this.logger.warn(
@@ -557,6 +570,7 @@ export class ScenarioSchedulerService implements OnModuleInit {
stepRun.id,
"log",
`Step ${stepRun.order} passed`,
`step:${stepRun.order}`,
);
// Find the next waiting step in this run (next by order)
@@ -599,6 +613,7 @@ export class ScenarioSchedulerService implements OnModuleInit {
stepRun.id,
"error",
`Step ${stepRun.order} failed: ${description}`,
`step:${stepRun.order}`,
);
await this.dumpPageOnFailure(stepRun);
@@ -666,6 +681,7 @@ export class ScenarioSchedulerService implements OnModuleInit {
stepRun.id,
"log",
`Step ${stepRun.order} failed: page dump uploaded to run files`,
`step:${stepRun.order}`,
);
}
}
+11 -7
View File
@@ -135,18 +135,17 @@ export class ScenarioController {
@Param("id", ParseUUIDPipe) id: string,
@Query("includeEnvironment") includeEnvironment: string,
@Query("credentialIds") credentialIds: string | string[] | undefined,
@Query("snippetIds") snippetIds: string | string[] | undefined,
@Query("version", new ParseIntPipe({ optional: true }))
version: number | undefined,
@Res({ passthrough: true }) res: Response,
) {
const credIds: string[] = credentialIds
? Array.isArray(credentialIds)
? credentialIds
: credentialIds.split(",").filter(Boolean)
: [];
const toIds = (ids: string | string[] | undefined): string[] =>
ids ? (Array.isArray(ids) ? ids : ids.split(",").filter(Boolean)) : [];
const entities = await this.scenarioService.exportScenario(id, {
includeEnvironment: includeEnvironment === "true",
credentialIds: credIds,
credentialIds: toIds(credentialIds),
snippetIds: toIds(snippetIds),
version,
});
res.setHeader("Content-Type", "application/yaml; charset=utf-8");
@@ -155,12 +154,17 @@ export class ScenarioController {
const kindLabels: Record<string, string> = {
environment: "Environment",
credential: "Credential",
snippet: "Snippet",
scenario: "Scenario",
};
return (entities as ExportEntity[])
.map((entity) => {
const label = kindLabels[entity.kind ?? ""] ?? entity.kind ?? "Entity";
const comment = `# ${label}: ${entity.name ?? entity.id ?? ""}`;
const title =
entity.kind === "snippet"
? `${entity.alias ?? entity.name} v${entity.version}`
: entity.name;
const comment = `# ${label}: ${title ?? entity.id ?? ""}`;
return `---\n${comment}\n${yamlStringify(entity)}`;
})
.join("");
+47 -10
View File
@@ -486,11 +486,18 @@ export class ScenarioService implements OnModuleInit {
*/
async getUsedSnippets(scenarioId: string): Promise<UsedSnippet[]> {
const scenario = await this.findOne(scenarioId);
const snippetMap = await this.snippetService.buildSnippetMap();
const usedRefs = resolveUsedSnippetAliases(
return this.resolveUsedSnippets(
scenario.steps.map((s) => s.execCode ?? ""),
snippetMap,
).map(parseSnippetRef);
);
}
private async resolveUsedSnippets(
execCodes: string[],
): Promise<UsedSnippet[]> {
const snippetMap = await this.snippetService.buildSnippetMap();
const usedRefs = resolveUsedSnippetAliases(execCodes, snippetMap).map(
parseSnippetRef,
);
if (usedRefs.length === 0) return [];
const snippets = await this.snippetService.findByAliases([
...new Set(usedRefs.map((r) => r.alias)),
@@ -571,7 +578,12 @@ export class ScenarioService implements OnModuleInit {
`Run ${runId} not found in scenario ${scenarioId}`,
);
const logs = await this.runLogRepo.find({
where: q?.trim() ? { runId, message: Like(`%${q.trim()}%`) } : { runId },
where: q?.trim()
? [
{ runId, message: Like(`%${q.trim()}%`) },
{ runId, context: Like(`%${q.trim()}%`) },
]
: { runId },
order: { seq: "ASC", createdAt: "ASC" },
});
return Object.assign(run, { logs });
@@ -599,9 +611,9 @@ export class ScenarioService implements OnModuleInit {
const escapeCsv = (value: string): string =>
/[",\n]/.test(value) ? `"${value.replace(/"/g, '""')}"` : value;
const rows = [
["Timestamp", "Level", "Message"].map(escapeCsv).join(","),
["Timestamp", "Level", "Context", "Message", "Data"].map(escapeCsv).join(","),
...logs.map((l) =>
[l.createdAt.toISOString(), l.level, l.message]
[l.createdAt.toISOString(), l.level, l.context ?? "", l.message, l.data ?? ""]
.map((v) => escapeCsv(String(v)))
.join(","),
),
@@ -609,9 +621,13 @@ export class ScenarioService implements OnModuleInit {
return rows.join("\n");
}
const sections = logs.map(
(l) => `## [${l.level}] ${l.createdAt.toISOString()}\n\n${l.message}`,
);
const sections = logs.map((l) => {
const header = `## [${l.level}]${l.context ? ` (${l.context})` : ""} ${l.createdAt.toISOString()}`;
const data = l.data
? `\n\n\`\`\`json\n${JSON.stringify(JSON.parse(l.data), null, 2)}\n\`\`\``
: "";
return `${header}\n\n${l.message}${data}`;
});
return [`# Run ${runId} logs`, ...sections].join("\n\n");
}
@@ -699,6 +715,8 @@ export class ScenarioService implements OnModuleInit {
options: {
includeEnvironment: boolean;
credentialIds: string[];
/** Used snippets to include, at every version the scenario uses. */
snippetIds?: string[];
/** Version to export; defaults to the latest. */
version?: number;
},
@@ -741,6 +759,25 @@ export class ScenarioService implements OnModuleInit {
}
}
// Include selected snippets, once per used version (latest or pinned)
const snippetIds = options.snippetIds ?? [];
if (snippetIds.length > 0) {
const used = await this.resolveUsedSnippets(
content.steps.map((s) => s.execCode ?? ""),
);
const seen = new Set<string>();
for (const snippet of used) {
if (!snippetIds.includes(snippet.id)) continue;
const version = snippet.pinnedVersion ?? snippet.version;
const key = `${snippet.id}@${version}`;
if (seen.has(key)) continue;
seen.add(key);
entities.push(
await this.snippetService.exportSnippet(snippet, version),
);
}
}
// Scenario is always last
const allCreds = scenario.scenarioCredentials ?? [];
const credentialMappings = allCreds
+4 -2
View File
@@ -48,12 +48,14 @@ describe("Database migrations", () => {
}
});
it("can revert the initial migration", async () => {
it("can revert all migrations", async () => {
const dataSource = new DataSource(dataSourceOptions(":memory:"));
await dataSource.initialize();
try {
await dataSource.runMigrations();
await dataSource.undoLastMigration();
for (let i = 0; i < MIGRATIONS.length; i++) {
await dataSource.undoLastMigration();
}
const tables = await dataSource.query(
`SELECT name FROM sqlite_master WHERE type = 'table' AND name NOT IN ('migrations', 'sqlite_sequence')`,
);
+4 -1
View File
@@ -810,7 +810,10 @@ describe("ScenarioController", () => {
.expect(200);
expect(res.body.id).toBe(runId);
expect(res.body.status).toBe("pending");
// The scheduler may already have picked the run up
expect(["pending", "in_progress", "pass", "fail"]).toContain(
res.body.status,
);
expect(Array.isArray(res.body.stepRuns)).toBe(true);
expect(res.body.stepRuns[0]).toHaveProperty("scenarioStep");
expect(Array.isArray(res.body.logs)).toBe(true);
+41
View File
@@ -277,6 +277,47 @@ describe("Versioning", () => {
expect(first[first.length - 1]).toMatchObject({ version: 1, steps: [] });
});
it("includes selected used snippets at the versions the scenario uses", async () => {
const alias = `exp-snip-${uniq()}`;
const sn = await snippetService.create({
alias,
title: "t",
code: "return 'one';",
});
await snippetService.update(sn.id, { code: "return 'two';" });
const other = await snippetService.create({
alias: `exp-other-${uniq()}`,
title: "t",
code: "return 3;",
});
const sc = await scenarioService.create({ name: `exp-sn-${uniq()}` });
await scenarioService.createStep(sc.id, {
execCode: `await context.runSnippet("${alias}"); await context.runSnippet("${alias}@1"); await context.runSnippet("${alias}"); return context.runSnippet("${other.alias}");`,
});
const withSnippet = await scenarioService.exportScenario(sc.id, {
includeEnvironment: false,
credentialIds: [],
snippetIds: [sn.id],
});
expect(withSnippet.map((e) => e.kind)).toEqual([
"snippet",
"snippet",
"scenario",
]);
expect(withSnippet.slice(0, 2)).toMatchObject([
{ id: sn.id, version: 2, code: "return 'two';" },
{ id: sn.id, version: 1, code: "return 'one';" },
]);
const without = await scenarioService.exportScenario(sc.id, {
includeEnvironment: false,
credentialIds: [],
});
expect(without.map((e) => e.kind)).toEqual(["scenario"]);
});
it("restores exact versions by id + version", async () => {
const id = crypto.randomUUID();
const base = { kind: "scenario" as const, id, name: "imported" };