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

@nobulex/elizaos-plugin

v0.2.1

Published

ElizaOS plugin — actions, evaluators, providers, and plugin registration for covenant-governed AI agents

Downloads

14

Readme

@nobulex/elizaos-plugin

ElizaOS plugin for covenant-governed AI agents. Provides actions, evaluators, providers, and plugin registration for integrating Nobulex covenant enforcement into ElizaOS agents.

Installation

npm install @nobulex/elizaos-plugin

Requirements: Node.js >= 18

Dependencies: @nobulex/core-types, @nobulex/crypto, @nobulex/identity, @nobulex/covenant-lang, @nobulex/action-log, @nobulex/middleware, @nobulex/verification

Quick Usage

import { createCovenantPlugin } from '@nobulex/elizaos-plugin';

const plugin = createCovenantPlugin({
  agentDid: 'did:nobulex:my-agent',
  covenantSource: `
    covenant MyAgent {
      permit read;
      permit write;
      forbid delete;
    }
  `,
  handlers: {
    read: async (params) => ({ data: 'some data' }),
    write: async (params) => ({ written: true }),
  },
});

// Register with ElizaOS
agent.registerPlugin(plugin);

// Or use the runtime directly
const { runtime } = plugin;

const result = await runtime.execute('read', { resource: '/data' });
console.log(result.success); // true

const blocked = await runtime.execute('delete', { resource: '/data' });
console.log(blocked.success); // false
console.log(blocked.error);   // 'Action "delete" blocked by covenant: ...'

// Verify compliance
const verification = runtime.verify();
console.log(verification.compliant); // true

API Reference

Plugin Factory

createCovenantPlugin(config: CovenantPluginConfig): ElizaPlugin & { runtime: CovenantRuntime }

Create a complete ElizaOS plugin with all built-in actions, evaluators, and providers. Returns both the plugin definition (for registering with ElizaOS) and the underlying CovenantRuntime for direct access.

The plugin includes:

Actions:

  • check-covenant -- Check if an action is permitted without executing it
  • execute-action -- Execute an action through covenant enforcement
  • verify-compliance -- Verify the agent's compliance with its covenant
  • get-action-log -- Get the tamper-evident action log

Evaluators:

  • covenant-compliance -- Evaluate whether the agent is complying with its covenant
  • action-permission -- Pre-evaluate whether a proposed action would be allowed

Providers:

  • covenant-spec -- Provides the agent's covenant specification
  • agent-status -- Provides current agent status including compliance and action count

Classes

CovenantRuntime

Covenant-governed agent runtime that manages enforcement and logging.

import { CovenantRuntime } from '@nobulex/elizaos-plugin';

const runtime = new CovenantRuntime({
  agentDid: 'did:nobulex:agent-1',
  covenantSource: 'covenant Safe { permit read; forbid delete; }',
  logBlocked: true,
  handlers: {
    read: async (params) => fetchData(params),
  },
});

Properties:

| Property | Type | Description | | ------------- | ---------------------------- | ------------------------------ | | agentDid | string | The agent's DID | | spec | CovenantSpec | Parsed covenant specification | | history | readonly ElizaActionResult[] | All action results | | actionCount | number | Total actions processed |

Methods:

check(action: string, params?: Record<string, unknown>): EnforcementDecision

Check whether an action is permitted without executing it.

const decision = runtime.check('delete');
console.log(decision.action); // 'block'
execute(action: string, params?: Record<string, unknown>): Promise<ElizaActionResult>

Execute an action through covenant enforcement. If a handler is registered for the action, it will be called. Blocked actions return { success: false, error: '...' }.

const result = await runtime.execute('read', { resource: '/data' });
console.log(result.success); // true
console.log(result.data);    // handler's return value
getLog(): ActionLog

Get the action log with all recorded actions.

verify(): VerificationResult

Verify compliance of the action log against the covenant.

Action Factory Functions

Each function takes a CovenantRuntime and returns an ElizaAction:

createCheckAction(runtime: CovenantRuntime): ElizaAction

Creates the check-covenant action. Requires an action parameter.

createExecuteAction(runtime: CovenantRuntime): ElizaAction

Creates the execute-action action. Requires an action parameter.

createVerifyAction(runtime: CovenantRuntime): ElizaAction

Creates the verify-compliance action. No parameters required.

createLogAction(runtime: CovenantRuntime): ElizaAction

Creates the get-action-log action. Returns the log and its integrity status.

Evaluator Factory Functions

createComplianceEvaluator(runtime: CovenantRuntime): ElizaEvaluator

Creates the covenant-compliance evaluator. Returns a score based on the ratio of compliant actions to total actions.

createPermissionEvaluator(runtime: CovenantRuntime): ElizaEvaluator

Creates the action-permission evaluator. Pre-evaluates whether a proposed action would be allowed (score 1.0 for allowed, 0.0 for blocked).

Provider Factory Functions

createSpecProvider(runtime: CovenantRuntime): ElizaProvider

Creates the covenant-spec provider. Returns the covenant specification.

createStatusProvider(runtime: CovenantRuntime): ElizaProvider

Creates the agent-status provider. Returns agent DID, covenant name, action count, compliance status, and violation count.

Interfaces

CovenantPluginConfig

| Field | Type | Default | Description | | ---------------- | ----------------------- | ------- | -------------------------------- | | agentDid | string | -- | Agent DID identifier | | covenantSource | string | -- | Covenant DSL source text | | logBlocked | boolean | true | Whether to log blocked actions | | handlers | Record<string, fn> | {} | Custom action handlers |

ElizaPlugin

| Field | Type | Description | | ------------ | -------------------------- | -------------------------- | | name | string | Plugin name | | version | string | Plugin version | | description| string | Plugin description | | actions | readonly ElizaAction[] | Registered actions | | evaluators | readonly ElizaEvaluator[]| Registered evaluators | | providers | readonly ElizaProvider[] | Registered providers |

ElizaAction

| Field | Type | Description | | ----------- | ---------- | ------------------------------------ | | name | string | Action name | | description | string | Human-readable description | | examples | readonly string[] | Example prompts | | handler | function | Action handler | | validate | function | Optional parameter validator |

ElizaActionResult

| Field | Type | Description | | --------- | --------- | ------------------------------ | | success | boolean | Whether the action succeeded | | data | unknown | Return data (if successful) | | error | string | Error message (if failed) |

ElizaEvaluator

| Field | Type | Description | | ----------- | ---------- | ---------------------- | | name | string | Evaluator name | | description | string | Description | | handler | function | Evaluation function |

EvaluatorContext

| Field | Type | Description | | --------- | ---------------------------- | ------------------------ | | agentDid| string | Agent's DID | | action | string | Action being evaluated | | params | Record<string, unknown> | Action parameters | | history | readonly ElizaActionResult[]| Previous action results |

EvaluatorResult

| Field | Type | Description | | -------- | --------- | --------------------------- | | passed | boolean | Whether evaluation passed | | score | number | Score from 0.0 to 1.0 | | reason | string | Explanation |

ElizaProvider

| Field | Type | Description | | ----------- | ---------- | ---------------------- | | name | string | Provider name | | description | string | Description | | get | function | Data retrieval function|

License

MIT