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

@openagentaudit/adapters

v0.2.4

Published

Source-format adapters: AEP, ComplianceEvalRecord, bscode, OTel, Langfuse, LangSmith

Readme

@openagentaudit/adapters

Source-format adapters that map external trace formats into the OpenAgentAudit canonical event model.

Each adapter is a versioned pure function: (source) → CanonicalEvent[]. Adapters never fabricate data and never call out to the network. See docs/adapter-contract.md for the full contract.

Adapters

| Adapter id | Source format | File | Status | |---|---|---|---| | aep-v0.2 | @wasmagent/aep AEPRecord (aep/v0.2) | src/aep-v0_2.ts | implemented | | bscode-rollout-v1 | bscode RolloutWireRecord | src/bscode.ts | implemented | | compliance-eval-record-v0.1 | @wasmagent/compliance records | src/compliance-eval-record.ts | implemented | | otel-genai-v0.1 | OpenTelemetry GenAI spans | src/otel.ts | implemented | | langfuse-export-v0.1 | Langfuse trace export | src/langfuse.ts | implemented | | langsmith-export-v0.1 | LangSmith trace export | src/langsmith.ts | implemented |

Usage

import { aepV0_2, bscode } from '@openagentaudit/adapters';

// AEP v0.2
const run = aepV0_2.AepV0_2Adapter.beginRun(aepRecord);
const events = aepV0_2.AepV0_2Adapter.toEvents(aepRecord);

// Extract run-provenance metadata and attach to ReportMeta
const prov = aepV0_2.getProvenance(aepRecord);
const meta: ReportMeta = { ..., aep_provenance: prov };

// bscode rollout
const run = bscode.BscodeAdapter.beginRun(rolloutRecord);
const events = bscode.BscodeAdapter.toEvents(rolloutRecord);

Batch conversion with toEventsBatch

When auditing multiple AEP records from the same session or across runs, use toEventsBatch to produce a single continuous event stream with hash-chain continuity across record boundaries:

import { aepV0_2 } from '@openagentaudit/adapters';

const records: AEPRecordInput[] = [record1, record2, record3];
const events = aepV0_2.toEventsBatch(records);
// or via the adapter object:
const events2 = aepV0_2.AepV0_2Adapter.toEventsBatch!(records);

The method signature on the SourceFormatAdapter interface:

toEventsBatch?(records: TSource[], initialPrevHash?: string): CanonicalEvent[];

Warning: Calling toEvents per record and concatenating the results will break the hash chain (prev_hash of the first event in record N+1 will not match the last hash of record N). Always use toEventsBatch when you need aggregate reporting across multiple source records.

AEP v0.2 adapter — what is preserved, what is rejected, where the boundary is

What the adapter preserves

| AEP field | Canonical field | Notes | |---|---|---| | actions[].tool_name | event.tool.name | Direct mapping | | actions[].capability_decision.capability | event.tool.capability | Only when present | | actions[].input_taint_labels + output_taint_labels | event.tool.risk_tags | Merged into single array | | capability_decisions[].decision | event.policy.decision | dry_runallow (closest semantic) | | capability_decisions[].reason_code | event.policy.reason | Empty string when absent | | verifier_results[] (failed only) | event type observation | Passed verifiers are silent | | signature.sig / signature.key_id | event.evidence.signature / signer_key_id | Carried on every event | | run_id, model_id, run_context.agent_id | run.run_id, run.model_id, run.agent_id | Via beginRun() | | repo_commit, runtime_version, policy_bundle_digest, tool_manifest_digest | AepProvenance struct | Via getProvenance() |

What is rejected (silently dropped)

  • input_refs, output_refs — not yet mapped to a canonical field
  • budget_ledger — inventory data, not an event
  • run_context.environment_digest, dependency_lock_digest — no canonical equivalent yet
  • Passing verifier results — only failures emit an observation event

Schema mismatch boundary

The adapter accepts both aep/v0.1 and aep/v0.2 records. Missing required fields (run_id, schema_version, created_at_ms, signature.*) cause an actionable error rather than a silent partial parse:

AEP adapter: missing required fields [run_id]. Ensure the AEPRecord was
produced by a compliant emitter (aep/v0.2).

Mapping

AEPRecord.actions[]               → CanonicalEvent type:"tool_call"
AEPRecord.capability_decisions[]  → CanonicalEvent type:"policy_decision"
AEPRecord.verifier_results[] (failed only) → CanonicalEvent type:"observation"

RolloutWireRecord.tool_call_sequence[] → CanonicalEvent type:"tool_call" / "observation"
RolloutWireRecord.final_answer    → CanonicalEvent type:"final_answer"
RolloutWireRecord.build_result    → CanonicalEvent type:"observation" source:"build_verifier"

Test fixtures

Real-world AEPRecord fixtures from both upstream emitters are committed under examples/traces/:

| File | Source | Key fields | |---|---|---| | aep-wasmagent-fixture.json | [email protected] — signed with Ed25519 | 2 actions, 1 cap-decision, 2 verifier results (1 failed), all 4 traceability fields | | aep-bscode-fixture.json | [email protected] via buildAEPEvidence() — signed with Ed25519 | 2 actions, 1 cap-decision, 1 verifier result (passed), all 4 traceability fields via resolveRunProvenance() |

The adapter test suite (src/aep-v0_2.test.ts) exercises both fixtures end-to-end and asserts canonical-event output shape, taint propagation, provenance extraction, and error messages for invalid inputs.