50 modules. Zero dependencies. All exports, types, and usage examples.
Agent Mesh Protocol — the on-wire format for all agent interactions. Creates, signs, and verifies AMP envelopes. Implements all 7 protocol verbs and 4 settlement rails.
.discover(skill, constraints) · .negotiate(agentDid, terms) · .delegate(to, intent, settle) · .execute(delegationId, result) · .settle(outcomeId) · .attest(outcomeId, sig) · .revoke(delegationId, reason)auth field set to hex-encoded signature.v · kind · id · parent · from · to · intent · settle · require · auth · nonce · ts · payloadimport { createAMP } from "@hyperbridge/forge/amp";
const amp = createAMP({ did: "did:w7:alice", privateKey: myKey });
const result = await amp.delegate({
to: "did:w7:skill/tax-filing",
intent: { action: "file_quarterly", params: { quarter: "2026-Q1" } },
settle: { rail: "amp-escrow", amount: "50 USD" }
});
Accountable Intelligence Graph — a tamper-evident DAG of signed events. Tracks the full lineage from Intent → Delegation → Inference → Outcome. Computes Merkle roots for L0 commitment.
.addNode(node) · .addEdge(fromId, toId, type) · .walk(rootId) · .lineage(outcomeId) · .merkleRoot() · .merkleProof(nodeId) · .anchor() · .toDot().intent(envelope) · .delegation(envelope) · .inference(envelope) · .outcome(envelope) · .build()id · kind · envelope · signature · timestamp · childrenimport { AIGBuilder } from "@hyperbridge/forge/aig";
const graph = new AIGBuilder()
.intent(intentEnvelope)
.delegation(delegationEnvelope)
.inference(inferenceEnvelope)
.outcome(outcomeEnvelope)
.build();
const root = graph.merkleRoot();
// anchor to L0: graph.anchor()
Proof-of-Outcome — the 8-check verification predicate. Verifies agent authorisation, model identity, ZK-ML inference, policy compliance, and stake adequacy. Any failed check triggers slashing logic.
principalSig(25) · delegationSig(20) · agentSig(15) · zkml(15) · policy(10) · stake(5) · sla(5) · attestors(5)import { verifyPoO, CHECKS } from "@hyperbridge/forge/poo";
const result = await verifyPoO(intentEnv, outcomeEnv);
if (result.pass) {
const payout = settlementValue(result, 50); // USD
await releaseEscrow(delegationId, payout);
} else {
await slashReputation(result.agentDid, result.failedChecks);
}
AES-256-GCM encryption, secret leases, and env loading. Uses Web Crypto API natively on Vercel/Cloudflare with a Node.js crypto fallback for Docker deployments. Namespace-isolated per agent.
.encrypt(data) · .decrypt(ciphertext) · .setSecret(key, value, ttl?) · .getSecret(key) · .rotateKey() · .namespace(ns).env file, encrypts all values, exposes via .get(key). Supports per-deployment key rotation without re-deploying app..value · .expiresAt · .renew() · .revoke()Reputation-as-Collateral ledger. Non-transferable, domain-scoped, slashable. 6-month half-life decay. 6 slash triggers with configurable distribution ratios.
.getScore(agentDid, domain) · .recordOutcome(agentDid, outcomeValue, domain) · .slash(agentDid, rule, domain) · .gate(minScore)outcome_value × principal_stake × domain_match × 0.5^(months/6)badZkml: 100% · signatureForger: 100% · policyViolation: 50% · missedSla: 20% · failedAttestation: 25% · unavailability: 10%Implements the 4 AMP settlement rails: escrow (milestone), outcome (binary), subscription (recurring), and split (multi-agent revenue share). All rails are PoO-triggered.
.lockFunds(delegationId, amount) · .releaseMilestone(milestoneId) · .forfeit(delegationId, reason) · .dispute(delegationId) · .balance(delegationId).subscribe(agentDid, plan) · .cancel(subscriptionId) · .pauseBilling(subscriptionId) · .nextBillingDate(subscriptionId).define(splits: {did, pct}[]) · .execute(totalAmount) · .audit()AMP_ESCROW · AMP_OUTCOME · AMP_SUBSCRIPTION · AMP_SPLITDID registry, Verifiable Credentials, RBAC, and sessions. Implements the did:w7 method for all entity types. Mock ed25519 in v0.1; hardware-backed in production.
.create(slug) · .resolve(did) · .sign(did, data) · .verify(did, data, sig) · .update(did, patch, sig) · .deactivate(did, sig) · .importPublic(did, pubKeyHex).issue(subject, claims, expiry?) · .verify(vc) · .revoke(vcId).defineRole(name, permissions[]) · .assign(did, role) · .can(did, permission) · .middleware(permission).create(did, scope) · .validate(token) · .revoke(token) · .extend(token, ttl)Full cron expression parser and scheduler. Handles all cron features including ranges, steps, and lists. Distributed lock support for multi-instance deployments.
*, ranges (1-5), steps (*/15), lists (1,3,5), and named (@daily)..add(name, expr, fn, opts?) · .remove(name) · .start() · .stop() · .status(). Opts: timeout, concurrency, distributedLock@hourly · @daily · @weekly · @monthly · @yearly · @midnightimport { CronScheduler, NAMED } from "@hyperbridge/forge/cron";
const scheduler = new CronScheduler();
scheduler.add("daily-report", NAMED.daily, async () => {
await generateDailyReport();
}, { timeout: 30_000 });
scheduler.start();
Type-safe event bus with wildcard patterns, middleware, dead-letter queue, and event store for replay/snapshot. Used internally by AMP to emit lifecycle events.
.on(pattern, handler) · .emit(event) · .off(pattern, handler) · .use(middleware) · .waitFor(pattern, timeout?) · .deadLetter(handler)* (single segment) and ** (multi-segment) wildcards. "user.*" matches "user.created" but not "user.profile.updated"..record(event) · .rebuild(fromSnapshot?) · .snapshot() · .replay(fromSeq)Security observability: rate limiting (sliding window), threat scoring (rule-based), IP blocklist, and NDJSON audit logging. Used by the Vigil security app and all production services.
.check(key, limit, windowMs) · .block(key, durationMs) · .middleware(opts).addRule(name, weight, fn) · .score(request) · .middleware(threshold).record(event) · .export('ndjson') · .query(filters)Geographic utilities: Haversine distance, bearing, geohash encoding/decoding/neighbors, BBox, and a grid-based SpatialIndex for proximity queries.
.insert(id, point) · .nearest(point, k?) · .withinRadius(point, radiusKm)Reactive state management with signals, computed values, time-travel undo/redo, and pluggable persistence. Works server-side for agent state and client-side for UI state.
atom.value. Write: atom.set(newValue). Subscribe: atom.subscribe(fn)..get(path) · .set(path, value) · .undo() · .redo()Deployment orchestration: canary releases, blue-green switches, pre-deploy HTTP checks, and a release manager with automated rollback.
.setWeight(pct) · .autoEvaluate(errorThreshold, latencyThreshold) · .promote() · .rollback().deploy(env: 'blue'|'green') · .switch() · .status() · .rollback().addHttpCheck(url, expectedStatus) · .addCustomCheck(name, fn) · .run() — all checks must pass before deploy proceeds.Self-learning meta-layer for Web7 agents. Monitors PoO outcomes, mines AIG patterns, proposes new modules, wraps external APIs as AMP skills, and discovers new conformance test vectors — all autonomously. See RFC-0006 for the normative spec.
.learn(record) — ingest an outcome record. .reflect() — run reflection cycle, returns ImprovementProposal[]. .getScore() — current average PoO score. .proposals() — all accumulated proposals. .history() — reflection cycle history from agent memory..mine(aigNodes) — analyse AIG intent nodes from aig.walk() or aig.lineage(). .results() — all patterns above minFrequency. .highValue() — patterns with successRate ≥ 0.80 and count ≥ 5. .lowValue() — failing patterns to route to specialist agents..fromPatterns(patterns) — generate module stubs from PatternMiner results. .stubs() — returns ModuleStub[] with import path, frequency, success rate, and full JS stub. .toRFC() — emit Markdown RFC body for all proposed modules..fromOpenAPI(spec) — parse an OpenAPI 3.x document. .toAMPSkills() — returns AMPSkill[] ready for registerSkill() in Prime. Each operation becomes one skill with a live HTTP handler. .skillCount() — number of operations found..observe(pooResult) — feed production PoO results. .newVectors() — all auto-discovered test vectors. .mature(minEvidence?) — vectors with enough evidence to add to the conformance suite (default: ≥ 3). .failureRate() — overall PoO failure rate observed..agent(did) · .observe(poo) · .mine(nodes) · .adapt(did, openApiSpec) · .report()import { getEvolveRuntime } from "@hyperbridge/forge/evolve";
import { getAIG, verifyPoO } from "@hyperbridge/forge/amp";
const runtime = getEvolveRuntime();
const learner = runtime.agent("did:w7:skill/tax-agent");
// After each outcome:
learner.learn({ outcomeId: outcome.id, action: intent.intent.action,
ok: poo.ok, score: poo.score });
// Periodic reflection (every 100 outcomes or 1h):
const proposals = learner.reflect();
// proposals[0] → { type: "workflow", suggestion: "Action 'file_quarterly' ..." }
// Mine the AIG for new module candidates:
runtime.mine(getAIG().walk());
console.log(runtime.report());
// { patterns: 12, highValuePatterns: 3, moduleProposals: 3, ... }