/* tslint:disable */ /* eslint-disable */ export class WasmCognitiveBus { free(): void; [Symbol.dispose](): void; /** * Full event shape: `id`, `source_agent`, `event_type`, `content`, * `timestamp`, `emotional_tag`, `salience`, `is_spike`. */ drainJSON(agent_id: string, limit?: number | null): string; /** * Hippocampus bridge shape: `content`, `source`, `salience`, * `emotional_tag`, `event_type`. Deliberately narrower than `drainJSON`. */ drainMemoryBridgeJSON(): string; /** * `memorySalienceThreshold` matches the PyO3 default of 50.0. */ constructor(memory_salience_threshold?: number | null); /** * Returns the number of subscribers the event was routed to, exactly as * the PyO3 `publish` does. */ publish(source_agent: string, event_type: string, content: string, emotional_tag?: number | null, salience?: number | null): number; queueDepth(agent_id: string): number; setTaskContext(agent_id: string, task_text: string): void; setTick(tick: number): void; statsJSON(): string; /** * `eventTypesJSON` is a JSON array of event-type strings. Passing them as * JSON rather than a `Box<[JsString]>` keeps one decoding path shared with * every other binding here. */ subscribe(agent_id: string, event_types_json: string): void; tick(): void; unsubscribe(agent_id: string): void; } export class WasmEntrolyEngine { free(): void; [Symbol.dispose](): void; /** * Advance the turn counter and apply Ebbinghaus decay. */ advance_turn(): void; /** * Analyze codebase health (A-F grade). */ analyze_health(): any; /** * Clear EGSC cache. */ cache_clear(): void; /** * Cache hit rate. */ cache_hit_rate(): number; /** * Cache empty check. */ cache_is_empty(): boolean; /** * Cache entry count. */ cache_len(): number; /** * Classify a task query. */ classify_task(query: string): any; /** * Clear all fragments and reset engine. */ clear(): void; /** * Dependency graph stats. */ dep_graph_stats(): any; /** * Verify and suppress hallucinations in LLM output. * * Modes: * - "audit": no output change, certificates only (for dashboards) * - "annotate": append warning footer listing unverified claims * - "strict": supported→PASS, abstain→HEDGE [unverified], hallucinated→SUPPRESS * * Returns a JSON object with: * - rewritten_output: the (possibly modified) response text * - n_claims, n_supported, n_abstained, n_hallucinated * - suppressed_count, warned_count, hallucination_rate * - certificates: per-claim verification results * - latency_ms */ eicv_suppress(context: string, output: string, profile: string, mode: string): any; /** * Verify a single claim against evidence using the EICV pipeline. * * Returns a JSON object with: * - phi: epistemic support density [0=hallucinated, 1=grounded] * - hallucination_score: 1 - phi * - decision: "supported" | "abstain" | "hallucinated" * - layer_scores: per-layer breakdown (tg, nli, rnr, gamma, h_sem) * - n_claim_atoms, n_ev_atoms, unsupported_fraction, contradiction_fraction * - elapsed_ms * * Profiles: "rag" (default), "qa", "summarization", "dialogue", "fact_check" */ eicv_verify(evidence: string, claim: string, profile: string): any; /** * Detect entropy anomalies. */ entropy_anomalies(): any; /** * Explain why each fragment was selected/excluded in last optimization. */ explain_selection(): any; /** * Export all fragments as JSON. */ export_fragments(): any; /** * Export full engine state as JSON string. */ export_state(): any; /** * Get fragment count. */ fragment_count(): number; /** * Get the current turn number. */ get_turn(): number; /** * Hierarchical context compression. */ hierarchical_compress(token_budget: number, query: string): any; /** * Import engine state from JSON string. */ import_state(json_str: string): any; /** * Ingest a context fragment into the engine. * Pipeline: tokens → SimHash → dedup → entropy → criticality → depgraph → store */ ingest(content: string, source: string, token_count: number, is_pinned: boolean): any; /** * Create a new Entroly engine with default parameters. */ constructor(); /** * Full optimization pipeline: IOS + PRISM + Channel Coding + Resonance + Causal. */ optimize(token_budget: number, query: string): any; /** * Query manifold stats. */ query_manifold_stats(): any; /** * Semantic recall of relevant fragments. */ recall(query: string, top_k: number): any; /** * AUTO retrieval — zero-config: relevance recall is *always* a * relevance need, so route to BM25, never the SimHash `recall()`. * Mirrors entroly-core's `recall_auto` exactly so every surface * (pip / Python-MCP / npm-wasm) ships ONE behaviour. */ recall_auto(query: string, top_k: number): any; /** * BM25 relevance retrieval — byte-identical behaviour to * entroly-core's `recall_bm25` (same ported `bm25.rs`, same schema * incl. the auditable score breakdown). This is the npm/wasm half * of the cross-runtime parity fix: SimHash `recall()` is a * near-duplicate metric (~0.44 R@1); a real BM25 is the correct * tool (~1.0). pip / Python-MCP / npm now behave the same. */ recall_bm25(query: string, top_k: number): any; /** * Record failed outcome for specific fragment IDs. */ record_failure(fragment_ids_json: string): void; /** * Record a continuous reward signal. */ record_reward(fragment_ids_json: string, reward: number): void; /** * Record successful outcome for specific fragment IDs. */ record_success(fragment_ids_json: string): void; /** * Remove a fragment by ID. */ remove(fragment_id: string): boolean; /** * Scan a fragment for security vulnerabilities. */ scan_fragment(fragment_id: string): any; /** * Score context utilization from LLM response. */ score_utilization(response: string): any; /** * Security report for all fragments. */ security_report(): any; /** * Semantic dedup report. */ semantic_dedup_report(): any; /** * Set cost-per-token directly. */ set_cache_cost_per_token(cost: number): void; /** * Enable/disable channel coding. */ set_channel_coding_enabled(enabled: boolean): void; /** * Set exploration rate. */ set_exploration_rate(rate: number): void; /** * Set cost model from model name. */ set_model(model_name: string): void; /** * Enable/disable query personas. */ set_query_personas_enabled(enabled: boolean): void; /** * Set scoring weights (normalized to sum=1.0). */ set_weights(w_recency: number, w_frequency: number, w_semantic: number, w_entropy: number): void; /** * Get full engine statistics as JSON. */ stats(): any; } export class WasmNkbeAllocator { free(): void; [Symbol.dispose](): void; /** * Returns false when the agent is unknown, matching PyO3. */ addFragment(agent_name: string, fragment_id: string, relevance: number, token_cost: number): boolean; /** * `{agent_name: {budget, weight, utility}}`, as the engine builds it. */ allocateJSON(): string; /** * Defaults mirror the PyO3 constructor exactly: 128000 / 0.1 / 1e-4 / 30 / * 5 / 0.01. Divergent defaults would be a parity break that no test on * either side would notice. */ constructor(global_budget?: number | null, tau?: number | null, epsilon?: number | null, max_iter?: number | null, nash_iterations?: number | null, learning_rate?: number | null); registerAgent(name: string, weight: number, min_budget: number): void; reinforce(outcomes_json: string): boolean; statsJSON(): string; } export class WasmTrustEngine { free(): void; [Symbol.dispose](): void; assessClaimJSON(evidence: string, claim: string): string; fileCriticality(path: string): string; hasSafetySignal(content: string): boolean; constructor(profile: string); } export class WasmWorkGraph { free(): void; [Symbol.dispose](): void; applyEventJSON(json_text: string): string; contextScopeJSON(workstream_id: string | null | undefined, max_evidence: number, pretty: boolean): string; continuationProofJSON(handoff_json: string, manifest_json: string): string; coordinationJSON(now_ms: number, pretty: boolean): string; exportJSON(pretty: boolean): string; static fromJSON(json_text: string): WasmWorkGraph; handoffJSON(workstream_id: string, from_agent: string, to_agent: string, generated_at_ms: number, pretty: boolean): string; mergeJSON(json_text: string): number; constructor(repo_id: string); observeRepositoryJSON(json_text: string): string; reconstructedContinuationProofJSON(workstream_id: string, to_agent: string, manifest_json: string): string; recordContextReceiptJSON(receipt_json: string, agent_id: string, session_id: string): string; recordExecutionChainJSON(route_json: string, outcome_json: string, verification_json: string, invalidated_commitments_json?: string | null): string; recordMemoryJSON(memory_json: string, now_ms: number, superseded_ids_json?: string | null): string; resumeJSON(workstream_id: string | null | undefined, max_evidence: number, pretty: boolean): string; snapshotJSON(pretty: boolean): string; summaryJSON(): string; unfinishedJSON(pretty: boolean): string; static verifyHandoffIntegrityJSON(receipt_json: string): boolean; verifyHandoffJSON(receipt_json: string): boolean; readonly eventCount: number; readonly graphCommitment: string; readonly repoId: string; readonly revision: bigint; } export function classify_learning_query(query: string): string; export function classify_query_transition(prev_hash: bigint, current_query: string, elapsed_s: number, time_window_s: number, rephrase_threshold: number, topic_change_threshold: number): any; /** * Build a canonical receipt envelope and return it as canonical JSON. * * Reference lists arrive as JSON arrays rather than `Box<[JsString]>` so there * is one decoding path shared with the other bindings here, and so an empty * list is expressed the same way in both runtimes. */ export function contextReceiptBuildJSON(repository_id: string, repository_commitment: string, graph_commitment: string, work_scope_id: string, source_commitment?: string | null, selected_refs_json?: string | null, omitted_refs_json?: string | null, pinned_refs_json?: string | null, recoverable_refs_json?: string | null, recovery_handles_json?: string | null, evidence_ids_json?: string | null, budget_tokens?: number | null, selection_policy?: string | null, execution_id?: string | null, created_at_ms?: number | null): string; /** * The commitment carried by a verified envelope. */ export function contextReceiptCommitment(receipt_json: string): string; /** * Project a verified envelope into the Work Graph reference form, as JSON. */ export function contextReceiptGraphRefJSON(receipt_json: string, workstream_id: string, agent_id: string, session_id: string): string; /** * Schema version this build implements. */ export function contextReceiptSchemaVersion(): number; /** * Parse and verify an envelope, returning its canonical JSON. * * Fails closed on a commitment that does not recompute and on an unrecognised * schema version — a caller cannot obtain an unverified envelope here. */ export function contextReceiptVerifyJSON(receipt_json: string): string; export function governanceComputeAuditChainHash(prev_chain_hash: string, event_id: string, payload_json: string): string; export function governanceComputeIdentityToken(payload_json: string, key: string): string; export function governanceComputeRisk(signals_json: string): string; export function governanceEvaluatePolicy(identity_json: string, scope: string, resource: string, risk_level: string, policy_json: string): string; export function governanceProvenanceNodeId(entity_type: string, actor_id: string, subject_id: string, created_at_ms: bigint, correlation_id: string): string; export function governanceScanToolSchema(tool_name: string, schema_json: string, known_good_hash?: string | null): string; export function governanceStandardRiskSignals(change_json: string): string; export function governanceVerifyAuditChain(entries_json: string): string; export function governanceVerifyIdentityToken(payload_json: string, token: string, key: string): boolean; /** * May this memory be injected, and why. * * No score parameter, by design — section 10's "do not let similarity score * imply truth" is enforced by the signature in both runtimes alike. */ export function memoryRecordAdmissibility(record_json: string, now_ms: number, superseded_ids_json?: string | null): string; /** * Build a memory record and return it as canonical JSON. */ export function memoryRecordBuildJSON(repository_id: string, content_reference: string, trust_state: string, task_id?: string | null, workstream_id?: string | null, source_agent?: string | null, source_session?: string | null, source_execution?: string | null, content_commitment?: string | null, evidence_ids_json?: string | null, created_at_ms?: number | null, observed_at_ms?: number | null, valid_until_ms?: number | null, supersedes_json?: string | null, contradicted_by_json?: string | null, recovery_handle?: string | null): string; /** * Schema version this build implements for memory records. */ export function memoryRecordSchemaVersion(): number; /** * Parse and check a memory record, returning its canonical JSON. */ export function memoryRecordVerifyJSON(record_json: string): string; export function modelExecutionOutcomeBuildJSON(input_json: string): string; export function modelExecutionOutcomeVerifyJSON(value_json: string): string; export function optimize_task_profiles(episodes_json: string): any; export function qccr_expand_query(query: string): string; export function qccr_rank_files(sources: string[], texts: string[], query: string, overrides_json: string): string; export function qccr_select(fragments_json: string, token_budget: number, query: string, overrides_json: string, preferred_json: string): string; /** * Build a recovery handle and return it as canonical JSON. * * Throws when a disposition promises recovery without the means to honour it. */ export function recoveryHandleBuildJSON(repository_id: string, receipt_id: string, disposition: string, source_ref?: string | null, source_commitment?: string | null, fragment_commitment?: string | null, byte_start?: number | null, byte_end?: number | null, version?: string | null, storage_locator?: string | null, observed_at_ms?: number | null): string; /** * Schema version this build implements for recovery handles. */ export function recoveryHandleSchemaVersion(): number; /** * Check recovered bytes against the handle's commitment. * * Returns `verified`, `commitment_mismatch` or `not_recoverable`. */ export function recoveryHandleVerifyBytes(handle_json: string, payload: Uint8Array): string; /** * Parse and check a handle, returning its canonical JSON. */ export function recoveryHandleVerifyJSON(handle_json: string): string; export function reward_weighted_optimize(episodes_json: string, current_weights_json: string): any; export function routingDecisionBuildJSON(input_json: string): string; export function routingDecisionVerifyJSON(value_json: string): string; export function verificationRecordBuildJSON(input_json: string): string; export function verificationRecordFreshness(value_json: string, current_repository_commitment: string, now_ms: number, invalidated_commitments_json?: string | null): string; export function verificationRecordVerifyJSON(value_json: string): string; export function verifiedContextSnapshotVerifyBytes(payload: Uint8Array, expected_commitment: string): string; export function workContinuationProofBuildJSON(input_json: string): string; export function workContinuationProofState(value_json: string, repository_id: string, graph_revision: number, graph_commitment: string): string; export function workContinuationProofVerifyJSON(value_json: string): string; /** * Canonical edge identity. See `workGraphNodeId`. */ export function workGraphEdgeId(from: string, kind: string, to: string): string; /** * Canonical node identity, so Node addresses artifacts exactly as Python and * the graph itself do. Same engine function behind all three. */ export function workGraphNodeId(kind: string, repo_id: string, key: string): string;