Skip to main content

Class: BundleExporter

Defined in: packages/agentos/src/core/provenance/verification/BundleExporter.ts:32

Constructors

Constructor

new BundleExporter(ledger, keyManager, anchorStorage?, tablePrefix?): BundleExporter

Defined in: packages/agentos/src/core/provenance/verification/BundleExporter.ts:38

Parameters

ledger

SignedEventLedger

keyManager

AgentKeyManager

anchorStorage?

AnchorStorageAdapter | null

tablePrefix?

string = ''

Returns

BundleExporter

Methods

exportAsJSONL()

exportAsJSONL(fromSequence?, toSequence?): Promise<string>

Defined in: packages/agentos/src/core/provenance/verification/BundleExporter.ts:131

Export a bundle as a JSONL string (one JSON object per line). Format: Line 1: Bundle metadata (version, agentId, publicKey, exportedAt, bundleHash, bundleSignature) Lines 2-N: One event per line Lines N+1-M: One anchor per line (prefixed with type: 'anchor')

Parameters

fromSequence?

number

toSequence?

number

Returns

Promise<string>


exportBundle()

exportBundle(fromSequence?, toSequence?): Promise<VerificationBundle>

Defined in: packages/agentos/src/core/provenance/verification/BundleExporter.ts:58

Export a verification bundle containing all events, anchors, and public key. The bundle is signed for tamper evidence.

Parameters

fromSequence?

number

Optional start sequence (inclusive). Defaults to 1.

toSequence?

number

Optional end sequence (inclusive). Defaults to latest.

Returns

Promise<VerificationBundle>

A self-contained verification bundle.


importAndVerify()

static importAndVerify(bundle): Promise<VerificationResult>

Defined in: packages/agentos/src/core/provenance/verification/BundleExporter.ts:170

Import and verify a bundle. Works completely offline (no DB required).

Parameters

bundle

VerificationBundle

The verification bundle to verify.

Returns

Promise<VerificationResult>

Verification result.


parseJSONL()

static parseJSONL(jsonl): VerificationBundle

Defined in: packages/agentos/src/core/provenance/verification/BundleExporter.ts:275

Parse a JSONL bundle string back into a VerificationBundle.

Parameters

jsonl

string

Returns

VerificationBundle