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

@h9-foundry/agentforge-runtime

v0.12.10

Published

Deterministic workflow runtime and tool mediation engine for AgentForge.

Downloads

117

Readme

@h9-foundry/agentforge-runtime

Deterministic workflow orchestration and tool mediation for AgentForge.

This package runs ordered workflow nodes, enforces policy decisions around tool use, records audit entries, links lifecycle artifacts, and returns a final audit bundle for the run.

Install

npm install @h9-foundry/agentforge-runtime

What It Does

  • Executes workflow nodes in order.
  • Invokes registered agents with minimal state slices.
  • Mediates tool requests through registered adapters and a policy engine.
  • Blocks denied or approval-gated tool calls before execution.
  • Redacts sensitive values before audit output is persisted.
  • Returns the updated workflow state and the generated audit bundle.

Usage

import { runWorkflow } from "@h9-foundry/agentforge-runtime";
import { agentOutputSchema } from "@h9-foundry/agentforge-schemas";
import type { RuntimeAgent } from "@h9-foundry/agentforge-sdk";
import type { WorkflowStateEnvelope } from "@h9-foundry/agentforge-shared-types";

const initialState: WorkflowStateEnvelope = {
  version: "1.0.0",
  runId: "run-1",
  workflow: "pr-review",
  mode: "inspect",
  repo: {
    root: "/repo",
    name: "repo",
    branch: "main",
    packageManager: "pnpm",
    languages: ["typescript"],
    ci: false,
    detectedFiles: []
  },
  changes: {
    changedFiles: [],
    stagedFiles: [],
    untrackedFiles: [],
    impactedPaths: [],
    diffStats: { filesChanged: 0, insertions: 0, deletions: 0 },
    fileDetails: []
  },
  context: {
    localExecution: true,
    ciExecution: false,
    trigger: "manual",
    timestamp: new Date().toISOString()
  },
  policy: {
    version: 1,
    environment: "local",
    resolvedAt: new Date().toISOString(),
    defaults: {
      executionMode: "inspect",
      modelAccess: false,
      network: "deny",
      writes: "approval_required"
    },
    paths: {
      allowedRead: ["**/*"],
      allowedWrite: [".agentops/runs/**"],
      blocked: [".env*"]
    },
    plugins: {
      allowedTiers: ["core", "verified"],
      allowedSources: ["official", "local"],
      requireReviewed: true
    },
    tools: {}
  },
  approvals: [],
  findings: [],
  proposedActions: [],
  lifecycleArtifacts: [],
  blockedPlugins: [],
  workflowInputs: {},
  agentResults: {},
  auditTrail: []
};

const noopAgent: RuntimeAgent = {
  manifest: {
    version: 1,
    name: "noop",
    displayName: "Noop",
    category: "test",
    runtime: { minVersion: "0.1.0", kind: "deterministic" },
    permissions: { model: false, network: false, tools: [], readPaths: [], writePaths: [] },
    inputs: [],
    outputs: ["summary"],
    contextPolicy: { sections: ["repo", "changes"], minimalContext: true },
    trust: { tier: "core", source: "official", reviewed: true }
  },
  outputSchema: agentOutputSchema,
  async execute() {
    return {
      summary: "Completed",
      findings: [],
      proposedActions: [],
      lifecycleArtifacts: [],
      requestedTools: [],
      blockedActionFlags: [],
      metadata: {}
    };
  }
};

const result = await runWorkflow({
  workflow: {
    version: 1,
    name: "pr-review",
    trigger: "manual",
    nodes: [
      { id: "context", kind: "deterministic", agent: "noop", outputsTo: "agentResults.context", contextSections: [], tools: [] },
      { id: "report", kind: "report", outputsTo: "report.final", contextSections: [], tools: [] }
    ]
  },
  initialState,
  agents: new Map([["noop", noopAgent]]),
  adapters: new Map(),
  policyEngine: {
    snapshot: initialState.policy,
    canReadPath: () => ({ allowed: true, effect: "allow", requiresApproval: false }),
    canWritePath: () => ({ allowed: false, effect: "approval_required", requiresApproval: true, reason: "Write requires approval." }),
    evaluateToolRequest: () => ({ allowed: false, effect: "deny", requiresApproval: false }),
    redactSecrets: (value) => value,
    sanitizeLifecycleArtifact: (artifact) => artifact
  },
  artifactJsonPath: ".agentops/runs/run-1/bundle.json",
  artifactMarkdownPath: ".agentops/runs/run-1/summary.md"
});

console.log(result.bundle.workflow);
console.log(result.state.auditTrail.length);

API

runWorkflow(deps)

Runs a workflow and returns:

  • state: the updated WorkflowStateEnvelope
  • bundle: the generated audit bundle

deps includes:

  • workflow: workflow definition to execute
  • initialState: normalized workflow state envelope
  • agents: registered runtime agents by name
  • adapters: registered tool adapters by name
  • policyEngine: policy mediation and redaction hooks
  • provider: optional reasoning provider for bounded reasoning nodes
  • artifactJsonPath: output path recorded in the audit bundle for JSON artifacts
  • artifactMarkdownPath: output path recorded in the audit bundle for Markdown artifacts

Related Packages

Source