npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@animastor/web-generator

v0.3.0

Published

Generation-progress domain slice for Animastor web frontend — the pure/near-pure analysis state machine, progress panel rows, SSE event routing, and generation timer. Host capabilities (identity, transport, phase, auth, i18n, navigation) arrive via the in

Readme

@animastor/web-generator

Generation-progress domain slice for Animastor web frontend — the pure/near-pure analysis state machine, progress panel rows, SSE event routing, and generation timer.

Scope — Pure domain logic. This package contains no UI components, no signals, no JSX. It is a pure/near-pure TypeScript domain module: state machines, data transformations, and timer math. All host capabilities — session identity (bookId/buildId), transport (api/client), i18n, navigation, phase/error management — arrive through the injected ProgressRowContext and ProgressEventSink contracts. The package never imports host stores, the API client, i18n, or any @animastor/* package.

Install

npm install @animastor/web-generator

No peer dependencies required — the package is pure TypeScript with zero runtime dependencies.

Usage

import {
  computeProgressRows,
  createProgressTrackingState,
  createGenerationTimer,
  routeProgressEvent,
  type ProgressRowContext,
  type ProgressEventSink,
} from '@animastor/web-generator';

// Host owns the state objects
const progressTracking = createProgressTrackingState();
const generationTimer = createGenerationTimer();

// Build the progress panel via the domain function
const ctx: ProgressRowContext = {
  tracking: progressTracking,
  timer: generationTimer,
  now: Date.now(),
  vbookStage: 'IDLE',
  isRunning: false,
  vbookStageLabel: (stepType, sceneIndex) => /* i18n lookup */,
  setRegenerating: (v) => { /* host signal write */ },
  onGenerationFinalized: () => { /* stop stream, apply results */ },
  onRunningIdle: () => { /* clear nav-icon status */ },
};

const panelState = computeProgressRows(ctx, serverPanel, vbookProgress, labels);

Public API

| Export | Kind | Purpose | |---|---|---| | applyAnalysisEvent | function | Pure per-task transition for parallel AI analysis | | applyAnalysisHeartbeat | function | Forward-only wave counters (parallel mode) | | analysisOverallPercent | function | Aggregate health flag for the overall row | | createInitialAnalysisProgress | function | Fresh empty phase state (reset) | | isAnalysisTaskId | function | Type guard for task IDs | | vbookProgressFromEvent | function | Map SSE vbook event to VBookProgress | | applyAgentStatus | function | Merge /agent-status poll into progress | | createIdleVBookProgress | function | Idle state factory | | createAnalyzingVBookProgress | function | ANALYZING state factory | | computeProgressRows | function | Build progress panel from server rows + VBook | | createProgressTrackingState | function | Fresh explicit tracking state | | resetProgressTracking | function | Clear in-flight tracking (Settings clear cache) | | hasAnyProgress | function | Any in-flight work ever recorded? | | routeProgressEvent | function | Parse + dispatch SSE progress-stream payload | | createGenerationTimer | function | Fresh wall-clock timer | | startGenerationTimer | function | Anchor the session start | | stopGenerationTimer | function | Freeze final elapsed | | elapsedSeconds | function | Live elapsed while running; frozen final once stopped | | formatTimerText | function | hh:mm:ss formatter | | Types | types | AnalysisProgress, AnalysisStatus, AnalysisTaskId, AnalysisTaskRow, VBookProgress, VBookStage, AgentStatusLike, ProgressTrackingState, GenerationTimerState, ProgressRowContext, ProgressEventSink, ProgressPanelState, TaskRow, TaskLabels, ProgressPanelResponse, ProgressTask, ProgressEvent |

Package boundary

  • The package imports nothing at runtime — zero dependencies and zero peerDependencies.
  • Host stores, api/client, i18n, router, icons, signals, and @animastor/* packages are forbidden inside the package (enforced by architecture guard tests).
  • @animastor/web-generator → host = forbidden; host → @animastor/web-generator = allowed through the public entry point only.
  • Wire types (ProgressEvent, ProgressPanelResponse, ProgressTask) are vendored locally (src/models.ts) following the @animastor/web-player models.ts precedent.

Development

npm install
npm run typecheck   # tsc --noEmit
npm run test        # vitest (domain unit tests)
npm run build       # tsup → dist/ (ESM + d.ts + sourcemaps)

License

MIT