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

@lumenflow/agent

v2.18.1

Published

Agent session management for LumenFlow workflow framework

Readme

@lumenflow/agent

Agent session management and verification for LumenFlow workflow framework.

Installation

npm install @lumenflow/agent

Overview

This package provides agent session management for AI agents working within the LumenFlow framework. It enables:

  • Session management: Track agent sessions with WU context
  • Incident logging: Record incidents with severity levels
  • WU verification: Verify WU completion status
  • Feedback promotion: Promote agent feedback to project guidelines

Usage

Session Management

import { startSession, getCurrentSession, endSession, logIncident } from '@lumenflow/agent';

// Start a session (auto-detects lane from git branch)
const sessionId = await startSession('WU-123', 2, 'claude-code');

// Get current session
const session = await getCurrentSession();
console.log(session?.wu_id, session?.lane);

// Log an incident during the session
await logIncident({
  category: 'validation',
  severity: 'minor',
  title: 'Schema validation warning',
  description: 'Optional field missing from response',
});

// End session and get summary
const summary = await endSession();
console.log(`Completed ${summary.wu_id} with ${summary.incidents_logged} incidents`);

WU Verification

import { verifyWUComplete, debugSummary } from '@lumenflow/agent';

// Verify a WU has been properly completed
const result = verifyWUComplete('WU-123');

if (result.complete) {
  console.log('WU-123 is complete');
} else {
  console.log(debugSummary(result));
  // Verification failed:
  // - Missing stamp .lumenflow/stamps/WU-123.done
  // - No commit on main touching WU YAML
}

Incident Tracking

import { appendIncident, readIncidents } from '@lumenflow/agent/incidents';

// Append an incident to the log
appendIncident({
  timestamp: new Date().toISOString(),
  session_id: 'uuid-here',
  wu_id: 'WU-123',
  lane: 'Operations',
  category: 'gate_failure',
  severity: 'major',
  title: 'Typecheck failed',
  description: 'Missing type export in index.ts',
});

// Read all incidents
const incidents = readIncidents();

Feedback Promotion

import { promoteFeedback } from '@lumenflow/agent/feedback-promote';
import { reviewFeedback } from '@lumenflow/agent/feedback-review';

// Review pending feedback items
const pending = await reviewFeedback();
for (const item of pending) {
  console.log(`${item.id}: ${item.title}`);
}

// Promote feedback to project guidelines
await promoteFeedback('feedback-001', {
  target: 'CLAUDE.md',
  section: 'Constraints',
});

Subpath Exports

// Main entry (all exports)
import { startSession, verifyWUComplete } from '@lumenflow/agent';

// Specific modules
import { startSession, getCurrentSession, endSession, logIncident } from '@lumenflow/agent/session';
import { appendIncident, readIncidents } from '@lumenflow/agent/incidents';
import { verifyWUComplete, debugSummary } from '@lumenflow/agent/verification';
import { initAutoSession, getAutoSession } from '@lumenflow/agent/auto-session';
import { promoteFeedback } from '@lumenflow/agent/feedback-promote';
import { reviewFeedback } from '@lumenflow/agent/feedback-review';

API Reference

Session Management

| Function | Description | | -------------------------------------- | -------------------------------------- | | startSession(wuId, tier, agentType?) | Start a new agent session | | getCurrentSession() | Get the current active session | | endSession() | End session and return summary | | logIncident(data) | Log an incident to the current session |

Verification

| Function | Description | | ------------------------ | ------------------------------------------------ | | verifyWUComplete(wuId) | Verify WU completion (stamp, commit, clean tree) | | debugSummary(result) | Format verification result for display |

Incidents

| Function | Description | | -------------------------- | ----------------------------- | | appendIncident(incident) | Append incident to NDJSON log | | readIncidents() | Read all incidents from log |

Types

interface SessionData {
  session_id: string;
  wu_id: string;
  lane: string;
  started: string;
  completed?: string;
  agent_type: string;
  context_tier: number;
  incidents_logged: number;
  incidents_major: number;
}

interface VerificationResult {
  complete: boolean;
  failures: string[];
}

interface IncidentData {
  timestamp: string;
  session_id: string;
  wu_id: string;
  lane: string;
  category: string;
  severity: 'minor' | 'major' | 'blocker';
  title: string;
  description: string;
  context?: Record<string, unknown>;
}

Features

  • Session isolation: One session per agent, prevents conflicts
  • Auto lane detection: Parses lane from git branch name
  • Incident severity: Track minor/major/blocker incidents
  • Completion verification: Multi-check WU completion validation
  • Modern: Node 22+, ESM-only, TypeScript

Documentation

For complete documentation, see the LumenFlow documentation.

License

Apache-2.0