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

@ai-operations/ops-policy

v0.1.0

Published

Policy engine for AI Operations OS — rule evaluation, autonomy levels, budget enforcement, escalation logic

Readme

@ai-operations/ops-policy

Business rules, autonomy levels, escalation paths, and budget tracking for AI Operations OS.

Part of AI Operations OS — autonomous business workflow orchestration with safety enforcement.

Install

npm install @ai-operations/ops-policy

Quick Start

import { AutonomyManager, BudgetTracker } from '@ai-operations/ops-policy';
import { DEFAULT_POLICY } from '@ai-operations/shared-types';

const manager = new AutonomyManager(DEFAULT_POLICY);
const decision = manager.canExecute('gmail', 'send', { source: 'email' });

if (decision.allowed && !decision.requiresApproval) {
  // Safe to execute autonomously
  manager.recordAction();
}

API

RuleEngine

Evaluates policy rules against connector operations. Rules are checked in priority order (highest first); the first matching rule wins.

constructor(config: PolicyConfig)
evaluate(connector: string, operation: string, context?: EvaluationContext): EvaluationResult
  • EvaluationContext{ source?: string; intent?: string; amount?: number }
  • EvaluationResult{ autonomy: AutonomyLevel; risk: RiskLevel; matchedRule?: PolicyRule; reason: string }

AutonomyManager

Wraps RuleEngine with rate limiting (hourly action counts, daily spend limits). Provides the primary canExecute interface for the orchestration layer.

constructor(config: PolicyConfig)
canExecute(connector: string, operation: string, context?: EvaluationContext): AutonomyDecision
recordAction(amount?: number): void
resetCounters(): void
getDailySpend(): number
getHourlyActionCount(): number
  • AutonomyDecision{ allowed: boolean; requiresApproval: boolean; reason: string }

EscalationManager

Tracks denial counts per task and determines when and to whom issues should be escalated. Prevents tasks from being silently stuck in denial loops.

constructor(config?: EscalationConfig)
shouldEscalate(taskId: string, denialCount: number): boolean
getEscalationTarget(taskId: string): EscalationTarget | undefined
recordDenial(taskId: string): void
recordEscalation(taskId: string, target: EscalationTarget): void
clearState(taskId: string): void
  • EscalationTarget{ role: string; channel: string; urgency: 'low' | 'normal' | 'high' | 'critical' }

BudgetTracker

Fine-grained spending management with global daily limits and per-connector breakdowns. Auto-resets at midnight.

constructor(dailyLimit?: number, connectorLimits?: Record<string, number>)
canSpend(amount: number, connector: string): { allowed: boolean; reason: string }
recordSpend(amount: number, connector: string): void
getDailyTotal(): number
getConnectorTotal(connector: string): number
getBreakdown(): Record<string, number>
getRemainingBudget(): number
setConnectorLimit(connector: string, limit: number): void

Related Packages

License

MIT