import { Applog } from '../applog/datom-types.ts'; import { query } from './basic.ts'; /** * Situations are meant to flag and possibly autocorrect or autosuggest solutions * * Types of Situations: * Divergences = leaf nodes that are based on different previous versions/contexts * Conflicts/Disagreement = different agents setting the same attribute (based on same previous) * Overwrite = one agent's action implicitly overrides another's without explicit confirmation * Conscious Disagreement = agents explicitly acknowledge and accept conflicting changes * Suggestions = recommendations for improvements or alternatives */ interface Situation { name: string; desc: string; intensity: number; type: typeof SituationTypes[keyof typeof SituationTypes]; query: typeof query; resolutionOptions: Resolution[]; metadata?: { agentId?: string; timestamp?: number; context?: Record; }; } interface QueryResultWithSituations { result: any; situations: Situation[]; threadView?: ThreadView; } interface ThreadView { id: string; situations: SituatedMessage[]; resolutionState: ResolutionState; } interface SituatedMessage { id: string; situation: Situation; message: string; resolutions: ResolutionAction[]; timestamp: number; agentId?: string; } interface ResolutionState { pending: string[]; resolved: string[]; ignored: string[]; } interface ResolutionAction { name: string; applied: boolean; appliedAt?: number; appliedBy?: string; } declare const SituationTypes: { readonly divergence: "divergence"; readonly disagreement: "disagreement"; readonly overwrite: "overwrite"; readonly consciousDisagreement: "consciousDisagreement"; readonly suggestion: "suggestion"; }; interface Resolution { name: string; desc: string; assertion: () => Applog[]; } /** * Creates a thread view for situations detected in query results */ export declare function createThreadForSituations(result: any, situations: Situation[], options?: { threadId?: string; groupByType?: boolean; sortByIntensity?: boolean; }): QueryResultWithSituations; /** * Applies a resolution action to a situation in a thread */ export declare function applyResolution(threadView: ThreadView, messageId: string, resolutionName: string, appliedBy: string): ThreadView; export {}; //# sourceMappingURL=situations.d.ts.map