Files
Lum1104 0c247317a0 feat(viewer): standalone dashboard viewer runnable via npx from release assets
New zero-dependency package understand-anything-viewer: a small Node
http server with the prebuilt dashboard embedded, replicating the dev
server's endpoints and security model (127.0.0.1 bind, one-time access
token on every data endpoint, graph filePath sanitisation, file-content
allowlist / 1MB cap / binary rejection, .ua with legacy
.understand-anything fallback). npm-packed and attached to each GitHub
release as understand-anything-viewer.tgz, so teammates without Claude
Code open a committed graph with:

  npx https://github.com/Egonex-AI/Understand-Anything/releases/latest/download/understand-anything-viewer.tgz <project>

No npm registry publishing involved. End-to-end tests spawn the real
server and cover the token gate, sanitisation, allowlist, traversal
guards, and both data-directory layouts.
2026-07-10 17:57:06 +08:00

65 lines
1.8 KiB
YAML

name: CI
on:
# Run on every PR so a contributor's first push gets feedback.
pull_request:
# Also run on direct pushes to main so the "main is green" signal is real.
# Without this, main can silently break for days when someone bypasses
# review. (#249)
push:
branches: [main]
# Cancel any in-flight CI for the same ref when a new commit is pushed —
# saves runner minutes and keeps the latest commit's status the only one
# anyone reads. `github.ref` is a controlled value (refs/heads/* or
# refs/pull/*/merge), not user-controlled input, so it's safe to interpolate.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
ci:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- uses: pnpm/action-setup@v6
- uses: actions/setup-python@v6
with:
python-version: '3.x'
- uses: actions/setup-node@v6
with:
node-version: 22
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: Install dependencies
run: pnpm install
- name: Lint
run: pnpm lint
- name: Build core
run: pnpm --filter @understand-anything/core build
- name: Build skill
run: pnpm --filter @understand-anything/skill build
- name: Build viewer
run: pnpm --filter understand-anything-viewer build
- name: Test core
run: pnpm --filter @understand-anything/core test
- name: Test skill
run: pnpm test
- name: Test Python skill helpers
run: python -m unittest tests.skill.understand.test_merge_batch_graphs tests.skill.understand.test_merge_subdomain_graphs tests.skill.knowledge.test_parse_knowledge_base -v