/** * Governance Consumer — Agent-side primitives for reading governed content. * * Completes the 360 loop: * Publisher: embedGovernance() → HTML with signed block * Agent: fetchGovernedContent() → verify → check terms → create access receipt * * The access receipt is cryptographic proof that the agent accessed * this content under these terms at this time. This is the evidence * trail for compliance monitoring and settlement. */ import type { GovernanceBlock, UsagePermission } from './governance-block.js'; export interface AccessReceipt { receiptId: string; /** Agent's DID */ agent_did: string; /** Publisher's DID (from governance block) */ publisher_did: string; /** Content hash (from governance block) */ content_hash: string; /** URL where content was accessed */ source_url: string; /** The terms that were in effect at access time */ terms_at_access: GovernanceBlock['terms']; /** The revocation policy in effect */ revocation_policy_at_access: GovernanceBlock['revocation_policy']; /** How the agent intends to use this content */ intended_usage: string; /** Whether the governance block was valid at access time */ governance_verified: boolean; /** Timestamp */ accessed_at: string; /** Ed25519 signature by the consuming agent */ signature: string; } export interface GovernanceCheckResult { /** Was a governance block found? */ found: boolean; /** Source: 'html_script' | 'html_meta' | 'http_header' | 'aps_txt' | 'none' */ source: string; /** The governance block (if found) */ block: GovernanceBlock | null; /** Verification result */ verified: boolean; /** Terms for the requested usage */ usageCheck: { permitted: boolean; condition: UsagePermission | 'not_specified'; } | null; /** Errors */ errors: string[]; } /** * Check governance for HTML content — extracts block from HTML, * verifies signature and content hash, checks usage permission. */ export declare function checkHTMLGovernance(html: string, contentBody: string, publisherPublicKey: string, intendedUsage: 'inference' | 'training' | 'redistribution' | 'derivative' | 'caching'): GovernanceCheckResult; /** * Check governance from HTTP response headers. */ export declare function checkHeaderGovernance(headers: Record, contentBody: string, publisherPublicKey: string, intendedUsage: 'inference' | 'training' | 'redistribution' | 'derivative' | 'caching'): GovernanceCheckResult; export declare function createAccessReceipt(input: { /** Agent's keys */ agentPublicKey: string; agentPrivateKey: string; /** Governance block from the content */ block: GovernanceBlock; /** URL where content was accessed */ sourceUrl: string; /** How the agent intends to use this */ intendedUsage: string; /** Was the governance block valid? */ governanceVerified: boolean; }): AccessReceipt; export declare function verifyAccessReceipt(receipt: AccessReceipt, agentPublicKey: string): boolean; export interface Full360Result { /** Governance check result */ governance: GovernanceCheckResult; /** Access receipt (if governance found and agent keys provided) */ receipt: AccessReceipt | null; /** Is the intended usage permitted? */ permitted: boolean; /** Human-readable summary */ summary: string; } /** * Execute the full 360 governance loop: * * 1. Extract governance block from HTML (script tag, meta tag, or headers) * 2. Verify signature + content hash + DID consistency * 3. Check if intended usage is permitted * 4. Create signed access receipt (proof of consumption under terms) * * This is the function an agent calls on every page it reads. */ export declare function governanceLoop360(input: { /** Full HTML of the page */ html: string; /** Article content body (text only, for hash verification) */ contentBody: string; /** Publisher's public key (for verification) */ publisherPublicKey: string; /** Agent's keys (for receipt signing) */ agentPublicKey: string; agentPrivateKey: string; /** How the agent intends to use this content */ intendedUsage: 'inference' | 'training' | 'redistribution' | 'derivative' | 'caching'; /** URL of the page */ sourceUrl: string; /** Optional HTTP response headers */ responseHeaders?: Record; }): Full360Result; //# sourceMappingURL=governance-consumer.d.ts.map