/** * Frame Ingestion API Routes * * POST /api/frames - Ingest a new Frame with deduplication */ import { Router } from "express"; import type Database from "better-sqlite3-multiple-ciphers"; import { Frame } from "../../frames/types.js"; export interface ApiErrorResponse { error: string; message: string; field?: string; code: number; } export interface FrameCreateResponse { id: string; status: "created" | "duplicate"; } /** * Generate content hash for Frame deduplication * Hash inputs: referencePoint, summaryCaption, moduleScope, statusSnapshot.next_action, timestamp_bucket(5min) */ export declare function generateFrameContentHash(frame: { reference_point: string; summary_caption: string; module_scope: string[]; status_snapshot: { next_action: string; }; timestamp: string; }): string; /** * Find existing Frame by content hash * Checks all frames for matching content hash */ export declare function findFrameByContentHash(db: Database.Database, contentHash: string): Frame | null; /** * Create frames router * Note: Authentication is now handled by middleware at the app level */ export declare function createFramesRouter(db: Database.Database, _apiKey?: string, _authFailureLimiter?: unknown): Router;