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 🙏

© 2025 – Pkg Stats / Ryan Hefner

digital-workers

v0.1.1

Published

Enhanced autonomous digital workers with event loop, KPI tracking, and communication capabilities

Downloads

6

Readme

digital-workers

npm version License: MIT

Enhanced autonomous digital workers with event loop, KPI tracking, and communication capabilities. This package builds on the autonomous-agents infrastructure to create digital workers with advanced features.

Purpose

The digital-workers package extends the autonomous agents concept by providing:

  • Constant event loop for regular evaluation of KPIs against OKRs
  • Context and memory management for long-running tasks
  • Plan creation and execution for achieving objectives
  • Multi-channel communication capabilities (Slack, Teams, Email, Phone)
  • Enhanced autonomy through continuous self-evaluation

How It Builds on autonomous-agents

The digital-workers package uses the function-based Agent from autonomous-agents as its foundation, adding:

  • Event Loop: Continuous evaluation and adjustment based on KPIs
  • Enhanced Context: Maintains richer context and memory for improved decision-making
  • Communication Channels: Integrated support for multiple communication platforms
  • KPI Tracking: Automated tracking and evaluation of key performance indicators
  • OKR Alignment: Ensures actions align with organizational objectives and key results

Installation

# Using npm
npm install digital-workers

# Using yarn
yarn add digital-workers

# Using pnpm
pnpm add digital-workers

Usage

Basic Usage

import { Worker } from 'digital-workers'

// Create a digital worker for customer support
const supportWorker = Worker({
  name: 'Support Assistant',
  description: 'Handles customer support inquiries and resolves issues',
  id: 'support-worker-1',
  initialContext: {
    department: 'Customer Support',
    specialization: 'Technical Issues'
  },
  initialPlans: [
    {
      name: 'Handle New Tickets',
      steps: ['Review ticket', 'Categorize issue', 'Respond with solution or escalate']
    }
  ],
  communication: {
    slack: {
      token: process.env.SLACK_TOKEN,
      channels: ['support', 'escalations']
    },
    email: {
      smtp: process.env.SMTP_CONFIG,
      address: '[email protected]'
    }
  },
  eventLoop: {
    frequency: '*/15 * * * *', // Cron expression for every 15 minutes
    kpis: ['responseTime', 'resolutionRate', 'customerSatisfaction'],
    okrs: {
      responseTime: { target: '< 30 minutes', weight: 0.3 },
      resolutionRate: { target: '> 85%', weight: 0.4 },
      customerSatisfaction: { target: '> 4.5/5', weight: 0.3 }
    }
  }
})

// Execute a task
const result = await supportWorker.execute({
  action: 'respondToTicket',
  ticketId: '12345',
  message: 'Thank you for your inquiry. Here is the solution...'
})

// Update worker context
await supportWorker.updateContext({
  currentLoad: 'high',
  priorityIssues: ['server-outage', 'payment-processing']
})

// Send a message via configured channels
await supportWorker.sendMessage('slack', {
  channel: 'support',
  message: 'New high-priority issue detected: server outage'
})

API Reference

Worker(config)

Creates a new digital worker with the provided configuration.

Parameters:

  • config (WorkerConfig): The configuration for the worker

Returns:

  • (WorkerInstance): A digital worker instance

WorkerConfig

The configuration object for creating a worker.

| Property | Type | Description | | -------------- | ----------------------- | ------------------------------------------------- | | name | string | The name of the worker | | description | string | Description of the worker's purpose | | id | string (optional) | Unique identifier for the worker | | initialContext | object (optional) | Initial context data for the worker | | initialPlans | Plan[] (optional) | Initial plans for the worker to execute | | communication | CommunicationConfig | Configuration for communication channels | | eventLoop | EventLoopConfig | Configuration for the event loop and KPI tracking |

WorkerInstance

The worker instance returned by the Worker function.

| Property/Method | Type | Description | | --------------- | --------------------------------------------------- | ----------------------------------------------------- | | id | string | Unique identifier for the worker | | agent | AutonomousAgent | The underlying autonomous agent | | context | object | Current context data for the worker | | plans | Plan[] | Current plans for the worker | | execute | (input: any) => Promise | Executes an action using the underlying agent | | updateContext | (newContext: any) => Promise | Updates the worker's context | | sendMessage | (channel: string, message: any) => Promise | Sends a message via the specified communication channel |

Dependencies

  • autonomous-agents: For the underlying agent functionality
  • Node.js 18+: For native features like fetch API

License

MIT