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

@loopwork-ai/ai-monitor

v0.1.0

Published

AI-powered log monitoring and auto-healing for Loopwork

Readme

@loopwork-ai/ai-monitor

AI-powered log monitoring and auto-healing for Loopwork task automation framework.

Overview

@loopwork-ai/ai-monitor provides intelligent monitoring capabilities that watch your Loopwork task execution, detect failure patterns, and automatically recover from common issues. It uses AI to analyze logs, suggest fixes, and maintain system health.

Installation

bun add @loopwork-ai/ai-monitor

Quick Start

import { compose, defineConfig } from '@loopwork-ai/loopwork'
import { withJSONBackend } from '@loopwork-ai/loopwork/backends'
import { withAIMonitor } from '@loopwork-ai/ai-monitor'

export default compose(
  withJSONBackend({ tasksFile: '.specs/tasks/tasks.json' }),
  withAIMonitor({
    enabled: true,
    logWatching: true,
    autoHealing: true,
  })
)(defineConfig({
  cli: 'claude',
  maxIterations: 50,
}))

Features

Circuit Breaker

Automatically detects repeating failures and halts execution to prevent resource waste:

  • Tracks failure patterns across tasks
  • Configurable failure thresholds
  • Time-based reset windows
  • Manual recovery options

Log Watching

Real-time log analysis with pattern detection:

  • Monitors CLI output streams
  • Detects error patterns and anomalies
  • Categorizes issues by severity
  • Provides actionable insights

Task Recovery

Intelligent task failure recovery:

  • Analyzes failure context
  • Suggests alternative approaches
  • Auto-retries with strategy adjustments
  • Escalates to human intervention when needed

Wisdom Capture

Learns from failures to prevent recurrence:

  • Records failure patterns and solutions
  • Builds knowledge base of fixes
  • Shares learnings across task executions
  • Exports wisdom for team sharing

Configuration

export interface AIMonitorConfig {
  enabled: boolean
  logWatching?: boolean
  autoHealing?: boolean
  circuitBreaker?: {
    enabled: boolean
    failureThreshold: number
    resetTimeout: number
  }
  wisdomCapture?: {
    enabled: boolean
    outputPath: string
  }
}

API Reference

Plugin Hooks

  • onLoopStart - Initialize monitoring session
  • onTaskStart - Begin task monitoring
  • onTaskComplete - Analyze task success
  • onTaskFailed - Analyze failure and attempt recovery
  • onLoopEnd - Generate monitoring report

Core Functions

analyzeFailure(context, error)

Analyzes task failure using AI to determine root cause and suggest fixes.

Parameters:

  • context: TaskContext - Task execution context
  • error: Error - Failure error object

Returns: FailureAnalysis with root cause and suggested actions

checkCircuitBreaker(namespace)

Checks if circuit breaker is open for a namespace.

Parameters:

  • namespace: string - Task namespace to check

Returns: CircuitBreakerState with status and metrics

captureWisdom(analysis, resolution)

Records failure and resolution for future reference.

Parameters:

  • analysis: FailureAnalysis - Failure analysis results
  • resolution: Resolution - How the issue was resolved

Returns: void

generateReport(stats)

Generates monitoring report for completed loop.

Parameters:

  • stats: LoopStats - Loop execution statistics

Returns: MonitoringReport with insights and recommendations

Examples

Custom Circuit Breaker Configuration

withAIMonitor({
  enabled: true,
  circuitBreaker: {
    enabled: true,
    failureThreshold: 3, // Open after 3 failures
    resetTimeout: 300000, // Reset after 5 minutes
  }
})

Wisdom Export

withAIMonitor({
  enabled: true,
  wisdomCapture: {
    enabled: true,
    outputPath: '.loopwork/wisdom.json'
  }
})

CLI Usage

The AI Monitor can be used as a standalone command-line tool:

Standalone Commands

# Watch and heal logs in real-time
loopwork ai-monitor --watch

# Watch only, don't execute healing actions
loopwork ai-monitor --dry-run

# Show circuit breaker status
loopwork ai-monitor --status

# Monitor a specific log file
loopwork ai-monitor --log-file /path/to/log.log

# Override log directory
loopwork ai-monitor --log-dir .loopwork/runs

# Monitor a specific namespace
loopwork ai-monitor --namespace my-namespace

# Use a specific LLM model for analysis
loopwork ai-monitor --model opus

Integration with Run/Start Commands

Enable AI Monitor when running loopwork:

# Run with AI monitoring
loopwork run --with-ai-monitor

# Start with AI monitoring
loopwork start --with-ai-monitor

Testing

bun test

License

MIT

Contributing

See the main Loopwork repository for contribution guidelines.