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

@peacethinking/mediation-workflows

v0.1.0

Published

Deterministic mediation flows — XState v5 machines, workflow templates, voting engine for conflict resolution

Readme

@peacethinking/mediation-workflows

Deterministic mediation flows — XState v5 machines, workflow templates, voting engine.

Production-ready state machines and workflow infrastructure for building AI-assisted mediation platforms. Includes 8 workflow templates, a pure voting engine with conflict resolution, and psychologically-informed emotional check-in logic.

Install

npm install @peacethinking/mediation-workflows

Usage

XState State Machine

import { participantWorkflowMachine } from '@peacethinking/mediation-workflows';
import { createActor } from 'xstate';

const actor = createActor(participantWorkflowMachine);
actor.start();

// States: idle -> executingElement -> readyToFinalize -> finalized
//         -> waitingForMediation -> reviewingProposals -> voting -> resolved

actor.send({ type: 'START_WORKFLOW', elements: myWorkflowElements });
actor.send({ type: 'ELEMENT_COMPLETED', elementId: 'step-1', data: { text: '...' } });
actor.send({ type: 'NEXT_ELEMENT' });

Workflow Templates

import { WORKFLOW_TEMPLATES, getTemplateById, cloneTemplate } from '@peacethinking/mediation-workflows';

// 8 templates: Simple, Standard, Advanced, Two-Party,
//              Coached, Human-Only, Dual-Mediator, Face-to-Face

const template = getTemplateById('template_standard');
const { steps, roles } = cloneTemplate(template);

| Template | Category | Key Feature | |---|---|---| | Simple | simple | Minimal, AI-only proposals, 1 voting round | | Standard | standard | + Emotional check-ins (flood + 12-emotion) | | Advanced | advanced | + Surveys, AI review, mediator gate, 3 rounds | | Two-Party | simple | No mediator, AI handles everything | | Coached | advanced | Coach + Trusted Ally roles | | Human-Only | advanced | No AI, mediator creates all proposals | | Dual-Mediator | advanced | AI + human mediator, combined proposals | | Face-to-Face | advanced | Live voice conversation with transcription |

Voting Engine

import { computeVoteStatistics, resolveConflicts } from '@peacethinking/mediation-workflows';

const result = computeVoteStatistics(options, totalParticipants);
// { optionStats, isComplete, hasConflicts }

if (result.hasConflicts) {
  const resolution = resolveConflicts(options);
  // Uses preference-rating algorithm (highest avg rating wins)
}

Emotional Check-in

import { assessFloodLevel, getCheckinRequirement } from '@peacethinking/mediation-workflows';

// Gottman-based flooding assessment
const flood = assessFloodLevel(8, 7, 'en');
// { level: 8, isFlooded: true, recommendation: "You are experiencing significant..." }

// Check if a check-in is required
const req = getCheckinRequirement(dialogueConfig, 'BEFORE_VIEWPOINTS');
// { isMandatory: true, isOptional: false, isAvailable: true }

Workflow Element Types

29 step types organized into 7 categories:

  • Setup: Consent, Role Briefing, Guidelines, Invitation
  • Understanding: Viewpoint Input, Additional Context, Ally Context, Coach Guidance, Live Conversation
  • Check-ins: Flood Level, 12-Emotion Radar, Questionnaire
  • Analysis: AI Review, AI Analysis, AI Reflection, AI Proposal, Human Proposal
  • Review: Mediator Review, Coach Review, Proposal Review, Mediator Approval
  • Decision: Voting, Conditional Acceptance, Finalization
  • Flow: Wait

License

MIT