import type { CanonicalApplicationContract } from './canonical-application.js'; import { type FlowDiagnostic, type FlowMigrationOperation, type FlowSpec, type FlowSpecDiff } from './flowspec.js'; export interface FeltDBContractSnapshot { application: { application_id: string; environment: string; }; contract_version: number; contract_hash: string; dsl_version: number; schema: CanonicalApplicationContract['manifest']['collections']; indexes: CanonicalApplicationContract['manifest']['indexes']; policies: CanonicalApplicationContract['manifest']['policies']; workflows: CanonicalApplicationContract['manifest']['workflows']; agents: CanonicalApplicationContract['manifest']['agents']; capabilities: CanonicalApplicationContract['manifest']['capabilities']; modules: NonNullable; supported_primitives: readonly string[]; } export interface FeltDBFlowProposal { baseContractHash: string; baseFlowHash: string; proposedFlow: string; summary: string; changes: string[]; warnings: string[]; implementation?: import('./module-intent.js').ModuleImplementationPlan; understanding?: import('./application-understanding.js').ApplicationUnderstanding; source_plan?: { files: import('./proposal.js').ProposalSourceOperation[]; }; } export interface AuthorizationChange { policy: string; before?: string[]; after?: string[]; widening: boolean; } export interface ValidatedFlowProposal { proposal: FeltDBFlowProposal; proposedSpec: FlowSpec; proposedContract: CanonicalApplicationContract; diagnostics: FlowDiagnostic[]; diff: FlowSpecDiff; migration: FlowMigrationOperation[]; authorizationChanges: AuthorizationChange[]; } export declare function createContractSnapshot(contract: CanonicalApplicationContract, options?: { environment?: string; contractVersion?: number; }): FeltDBContractSnapshot; export declare function contractSnapshotText(snapshot: FeltDBContractSnapshot): string; /** Load the same whitelisted snapshot from local, self-hosted, or managed SDKs. */ export declare function loadContractSnapshot(db: { application: { get(): Promise>; }; }): Promise; export declare function flowSourceHash(source: string): Promise; export declare const FELTDB_FLOW_DSL_GUIDE = "FeltDB FlowSpec v1 reference:\n- One document: flow_version 1, then app Name { ... }.\n- collection Name { field: primitive; optional fields append ?; references use ref Collection; indexes use index name using hash(field) }.\n- capability Name { visibility public|internal|agent; read Collection; write Collection }.\n- module Name { provider provider-name; version exact-semver }. Module-qualified references use ref module.Model.\n- workflow Name { step step_name { read Collection | write Collection | capability CapabilityName } }.\n- agent Name { capability CapabilityName; workflow WorkflowName }.\n- policy Collection { read: expression; write: expression }. Preserve existing authorization unless the request explicitly requires a change.\n- Valid policy examples include authenticated, member, owner, self(field), and alternatives joined with |.\n- Every referenced collection, capability, and workflow must be declared. Names are case-sensitive.\n- Use only supported_primitives from the supplied snapshot. Do not invent UI, deployment, record data, secrets, or executable implementation syntax.\n- Make the smallest semantic change that satisfies the request and retain all unrelated declarations."; /** One provider-neutral prompt used by local WebLLM and bring-your-own models. */ export declare function createFlowProposalMessages(snapshot: FeltDBContractSnapshot, currentFlow: string, intent: string): Promise<({ role: "system"; content: string; } | { role: "user"; content: string; })[]>; /** Parse and validate untrusted model output through the canonical FeltDB pipeline. */ export declare function validateGeneratedFlowProposal(input: { raw: string; intent: string; snapshot: FeltDBContractSnapshot; currentFlow: string; allowDestructiveProposal?: boolean; }): Promise; export declare function validateFlowProposal(input: { proposal: FeltDBFlowProposal; currentFlow: string; snapshot: FeltDBContractSnapshot; tenantId?: string; }): Promise; //# sourceMappingURL=application-development.d.ts.map