import type { CEETraceMeta, CEEQualityMeta, CEEValidationIssue, CEEDraftGraphResponseV1, CEEExplainGraphResponseV1, CEEEvidenceHelperResponseV1, CEEOptionsResponseV1, CEEBiasCheckResponseV1, CEESensitivityCoachResponseV1, CEETeamPerspectivesResponseV1 } from "./ceeTypes.js"; export type CeeQualityBand = "confident" | "uncertain" | "low_confidence"; export declare function classifyCeeQuality(quality: CEEQualityMeta | null | undefined): CeeQualityBand | undefined; export type AnyCEEEnvelope = CEEDraftGraphResponseV1 | CEEExplainGraphResponseV1 | CEEEvidenceHelperResponseV1 | CEEOptionsResponseV1 | CEEBiasCheckResponseV1 | CEESensitivityCoachResponseV1 | CEETeamPerspectivesResponseV1; type CEEWithLimits = CEEDraftGraphResponseV1 | CEEEvidenceHelperResponseV1 | CEEBiasCheckResponseV1 | CEEOptionsResponseV1 | CEESensitivityCoachResponseV1; export declare function getCEETrace(response: T): CEETraceMeta | undefined; export declare function getCEEQualityOverall(response: T): number | undefined; export declare function getCEEValidationIssues(response: T): CEEValidationIssue[]; export declare function ceeAnyTruncated(response: CEEWithLimits | null | undefined): boolean; export interface DecisionStorySummary { headline: string; key_drivers: string[]; risks_and_gaps: string[]; next_actions: string[]; any_truncated: boolean; quality_overall?: number; } export declare function isRetryableCEEError(error: unknown): boolean; export interface CeeErrorMetadata { ceeCode?: string; retryable: boolean; traceId?: string; } export declare function getCeeErrorMetadata(error: unknown): CeeErrorMetadata; export interface CeeErrorViewModel { code?: string; retryable: boolean; traceId?: string; suggestedAction: "retry" | "fix_input" | "fail"; } export declare function buildCeeErrorViewModel(error: unknown): CeeErrorViewModel; export declare function buildDecisionStorySummary(args: { draft?: CEEDraftGraphResponseV1 | null; explain?: CEEExplainGraphResponseV1 | null; evidence?: CEEEvidenceHelperResponseV1 | null; options?: CEEOptionsResponseV1 | null; bias?: CEEBiasCheckResponseV1 | null; sensitivity?: CEESensitivityCoachResponseV1 | null; team?: CEETeamPerspectivesResponseV1 | null; }): DecisionStorySummary; export interface CeeUiFlags { has_high_risk_envelopes: boolean; has_team_disagreement: boolean; has_truncation_somewhere: boolean; is_journey_complete: boolean; } export declare function buildCeeUiFlags(journey: CeeJourneySummary): CeeUiFlags; export interface CeeHealthSummary { status: "ok" | "warning" | "risk"; reasons: string[]; any_truncated: boolean; has_validation_issues: boolean; quality_overall?: number; source: "draft" | "explain" | "evidence" | "bias" | "options" | "sensitivity" | "team"; } export declare function buildCeeHealthSummary(source: CeeHealthSummary["source"], response: AnyCEEEnvelope | null | undefined): CeeHealthSummary; export interface CeeEvidenceCoverageSummary { requested_count?: number; returned_count: number; max_items?: number; items_truncated: boolean; saturation_ratio?: number; coverage_level: "none" | "partial" | "full"; } export declare function buildCeeEvidenceCoverageSummary(args: { evidence?: CEEEvidenceHelperResponseV1 | null; requestedCount?: number; }): CeeEvidenceCoverageSummary; export type CeeHealthTone = "success" | "warning" | "danger"; export declare function mapCeeHealthStatusToTone(status: CeeHealthSummary["status"]): CeeHealthTone; export interface CeeJourneyEnvelopes { draft?: CEEDraftGraphResponseV1 | null; explain?: CEEExplainGraphResponseV1 | null; evidence?: CEEEvidenceHelperResponseV1 | null; options?: CEEOptionsResponseV1 | null; bias?: CEEBiasCheckResponseV1 | null; sensitivity?: CEESensitivityCoachResponseV1 | null; team?: CEETeamPerspectivesResponseV1 | null; } export interface CeeEngineStatus { provider?: string; model?: string; degraded: boolean; } export declare function buildCeeEngineStatus(envelopes: CeeJourneyEnvelopes): CeeEngineStatus | undefined; export interface CeeJourneyHealth { perEnvelope: Partial>; overallStatus: CeeHealthSummary["status"]; overallTone: CeeHealthTone; any_truncated: boolean; has_validation_issues: boolean; } export interface CeeJourneySummary { story: DecisionStorySummary; health: CeeJourneyHealth; is_complete: boolean; missing_envelopes: CeeHealthSummary["source"][]; has_team_disagreement: boolean; } export declare function buildCeeJourneySummary(envelopes: CeeJourneyEnvelopes): CeeJourneySummary; /** * Compact, metadata-only payload suitable for driving a Sandbox/Scenario-style * "decision review" UI. * * This is the canonical CEE v1 review contract exposed by the SDK: * - Only structured metadata (story/journey/uiFlags/trace). * - No prompts, briefs, graph labels, or LLM text. * - Safe to persist/log on the PLoT side for saved or explicit "review" runs. * * PLoT should surface this shape as `ceeReview` on its APIs; the Scenario UI * should treat it as read-only input. * * @typedef {Object} CeeDecisionReviewPayload * @property {DecisionStorySummary} story * @property {CeeJourneySummary} journey * @property {CeeUiFlags} uiFlags * @property {Object} [trace] * @property {string} [trace.request_id] * @property {string} [trace.correlation_id] */ export interface CeeDecisionReviewPayload { story: DecisionStorySummary; journey: CeeJourneySummary; uiFlags: CeeUiFlags; trace?: { request_id?: string; correlation_id?: string; }; } /** * Build a CeeDecisionReviewPayload from a set of CEE envelopes. * * This helper is: * - Metadata-only: it consumes existing CEE envelopes (draft, options, evidence, * bias, sensitivity, team, explain) and never inspects briefs, graphs, or * LLM text. * - Deterministic: given the same envelopes, it always returns the same * story/journey/uiFlags/trace. * * The resulting payload is suitable for persistence on the PLoT side and for * driving a Decision Review panel in the Scenario UI. * * @param {CeeJourneyEnvelopes} envelopes * @returns {CeeDecisionReviewPayload} */ export declare function buildCeeDecisionReviewPayload(envelopes: CeeJourneyEnvelopes): CeeDecisionReviewPayload; /** * Compact trace summary for downstream integration surfaces (PLoT / Scenario). * * Only exposes a requestId, degraded flag, and optional timestamp/provider/model, * never raw prompts, graphs, or LLM text. */ export interface CeeTraceSummary { requestId: string; degraded: boolean; timestamp?: string; provider?: string; model?: string; } /** * Build a CeeTraceSummary from a CEETraceMeta and optional engine status. * * Returns null if no request_id is present on the trace; callers can use this * to decide whether to attach trace metadata to a review bundle. */ export declare function buildCeeTraceSummary(args: { trace?: CEETraceMeta | null; engineStatus?: CeeEngineStatus | null; timestamp?: string; }): CeeTraceSummary | null; /** * Thin wrapper that builds a CeeErrorView (UI-safe error model) from an error. * * This is an alias over buildCeeErrorViewModel to make the integration surface * explicit for PLoT and Scenario UI consumers. */ export type CeeErrorView = CeeErrorViewModel; /** * Thin wrapper that builds a CeeErrorView (UI-safe error model) from an error. * * This is an alias over buildCeeErrorViewModel to make the integration surface * explicit for PLoT and Scenario UI consumers. */ export declare function buildCeeErrorView(error: unknown): CeeErrorView; /** * Canonical bundle for CEE integration: compact review payload + trace summary * + optional error view. * * This is the shape PLoT is expected to expose to the Scenario UI as the * "decision review" attachment for a scenario/report. */ export interface CeeIntegrationReviewBundle { review: CeeDecisionReviewPayload | null; trace: CeeTraceSummary | null; error?: CeeErrorView; } /** * Build a CeeIntegrationReviewBundle, normalising undefined fields. */ export declare function buildCeeIntegrationReviewBundle(args: { review?: CeeDecisionReviewPayload | null; trace?: CeeTraceSummary | null; error?: CeeErrorView | null; }): CeeIntegrationReviewBundle; export type CeeError = CeeErrorView; export type CeeTrace = CeeTraceSummary; export type CeeDecisionReviewPayloadV1 = CeeDecisionReviewPayload; export type CeeReviewResult = CeeIntegrationReviewBundle; export interface CeeBiasStructureDraftSummary { quality_overall?: number; quality_band?: CeeQualityBand; structural_warning_count: number; structural_warnings_by_id: Record; confidence_flags?: { simplification_applied?: boolean; uncertain_node_count?: number; }; } export interface CeeBiasStructureBiasSummary { quality_overall?: number; quality_band?: CeeQualityBand; total_findings: number; by_severity: Record; by_category: Record; by_code: Record; } export interface CeeBiasStructureSnapshot { draft?: CeeBiasStructureDraftSummary | null; bias?: CeeBiasStructureBiasSummary | null; } export declare function buildCeeBiasStructureSnapshot(envelopes: CeeJourneyEnvelopes): CeeBiasStructureSnapshot; export {};