Package Exports
- @qulib/core
Readme
@qulib/core
@qulib/core is the TypeScript-first Qulib package for analyzing deployed web apps (and optionally a local repo) and surfacing honest quality gaps.
Install
npm install @qulib/coreCLI (from npm)
npx @qulib/core analyze --url https://example.comUse npx playwright install chromium the first time you scan (Playwright is a dependency).
Programmatic API
import { analyzeApp, type HarnessConfig } from '@qulib/core';
const config: HarnessConfig = {
maxPagesToScan: 20,
maxDepth: 3,
minPagesForConfidence: 3,
timeoutMs: 30000,
retryCount: 2,
llmTokenBudget: 4000,
testGenerationLimit: 10,
readOnlyMode: true,
requireHumanReview: true,
failOnConsoleError: false,
explorer: 'playwright',
defaultAdapter: 'playwright',
adapters: ['playwright', 'cypress-e2e'],
};
const result = await analyzeApp({
url: 'https://example.com',
config,
writeArtifacts: false,
});
console.log(result.releaseConfidence, result.gapAnalysis);Repository
Source and issues: github.com/TapeshN/qulib.
Monorepo context
This package is part of Qulib (repo README). Install dependencies from the repository root: npm install. Build all packages: npm run build (from root).
Current capabilities
- CLI
analyzeflow:observe→think→act. - Playwright explorer: route discovery, axe-core (WCAG 2.0 A/AA), sampled internal link HEAD checks.
- Optional authenticated crawling via
authin config (form-loginor Playwrightstorage-state). - Repo scanner: routes, tests, Cypress structure.
- Gap engine: deterministic gaps, release confidence with a low-page coverage floor, coverage warnings.
- Reports:
output/report.jsonandoutput/report.mdwhen not using--ephemeral. - State under
.scan-state/unless--ephemeral(no disk writes; full JSON on stdout). npm run cleanremoves generatedoutput/and.scan-state/and restores.gitkeepplaceholders.
Tech stack
TypeScript (strict, NodeNext), Commander, Zod, Playwright, @axe-core/playwright, fast-glob; optional Anthropic API for scenario generation.
Layout
src/
adapters/ # test rendering adapters
analyze.ts # programmatic API (also used by @qulib/mcp)
cli/ # CLI entry
harness/ # state + decision logging
llm/ # LLM contracts
phases/ # observe / think / act
reporters/ # JSON + Markdown reports
schemas/ # Zod schemas
tools/ # explorers, auth, gap engine, repo scannerRepo rules: see CLAUDE.md.
Configuration
Default file: qulib.config.ts in this package directory (or pass --config <path> relative to the process working directory).
Optional auth for authenticated scanning — see commented example in qulib.config.ts. For local credentials, use a separate file (e.g. qulib.test-auth.config.ts, gitignored at the repo root) and point --config at it.
Use the same origin for --url as the app uses after login so same-origin links are discovered during the crawl.
Scripts (from packages/core)
npm run dev— CLI viatsx(append subcommands, e.g.npm run dev -- clean)npm run analyze -- --url <url> [--repo <path>] [--config <file>] [--ephemeral]npm run clean— resetoutput/and.scan-state/herenpm run build— compile todist/
From the repository root:
npm run analyze -w @qulib/core -- --url <url> …npm run clean— runs core clean via workspace
Binary name after publish: qulib (see package.json bin).
Usage examples
cd packages/core
# app only
npm run analyze -- --url http://localhost:3000
# app + repo
npm run analyze -- --url http://localhost:3000 --repo ../your-app
# local auth config (keep out of git)
npm run analyze -- --config ../../qulib.test-auth.config.ts --url https://example.com
# ephemeral: JSON on stdout, logs on stderr
npm run analyze -- --url https://example.com --ephemeral > report.bundle.json
npm run cleanPlaywright browsers
npx playwright install chromiumOutput and state (cwd = packages/core when you cd here)
Ephemeral: stdout prints one JSON object: gapAnalysis, discoveredRoutes, repoInventory, decisionLog.
Persistent:
.scan-state/discovered-routes.json,gap-analysis.json,decision-log.json, andrepo-inventory.jsonwhen--repois setoutput/report.json,output/report.md
For more options (repoPath, loading config from disk), see src/analyze.ts in the repository.