import * as react_jsx_runtime from 'react/jsx-runtime';
type PolicyType = "Income" | "Security" | "Serviceability" | "Loan Type" | "Borrower";
type PolicyQueryType = "single_bank" | "cross_bank_comparison" | "threshold_filter" | "ranking" | "scenario_match" | "general";
type PolicyVerdict = "yes" | "soft_no" | "no" | "unknown";
/** What the Policy AI classifier detected about the broker's query. */
interface PolicyQueryContext {
policyType: PolicyType;
/** Fine-grained categories, e.g. ["Bonus Income", "Add Backs"] */
categories: string[];
queryType: PolicyQueryType;
/** Only set for single_bank queries. */
bankName?: string;
}
/** A single citation attached to a Policy AI response. */
interface PolicyCitationItem {
/** 1-based index used inline as [N] markers in the answer text. */
index: number;
bankName: string;
category: string;
/** Excerpt from the source policy document. */
excerpt: string;
}
/** A bank's verdict in a cross-bank comparison. */
interface PolicyBankVerdict {
bankName: string;
verdict: PolicyVerdict;
/** Brief human-readable explanation from the policy engine. */
details?: string;
citations?: number[];
}
/** A bank's entry in a TOPSIS-ranked list. */
interface PolicyRankedBankItem {
rank: number;
bankName: string;
/** TOPSIS closeness score 0.0–1.0 (higher = better). */
score: number;
verdict: PolicyVerdict;
/** Key policy highlights shown as bullets under the bank row. */
highlights: string[];
citations?: number[];
}
/**
* Discriminated union of the three response content formats that Policy AI
* can return, corresponding to retrieval tiers A / B / C.
*/
type PolicyResponseContent = {
type: "single_bank";
bankName: string;
verdict: PolicyVerdict;
/** Prose answer with inline [N] citation markers. */
answer: string;
citations: PolicyCitationItem[];
} | {
type: "cross_bank_comparison";
categories: string[];
banks: PolicyBankVerdict[];
summaryCounts: {
yes: number;
softNo: number;
no: number;
total: number;
};
citations: PolicyCitationItem[];
} | {
type: "ranked_list";
categories: string[];
banks: PolicyRankedBankItem[];
citations: PolicyCitationItem[];
};
/**
* A past conversation entry — reserved for the conversation history feature.
* Used when rendering a list of previous Policy AI sessions (inline mode).
*/
interface PolicyConversationItem {
id: string;
/** First user query — used as the conversation title. */
title: string;
/** Human-readable timestamp, e.g. "Today, 10:24 AM". */
timestamp?: string;
}
/** A single message in the Policy AI chat. */
interface PolicyAIMessage {
id: string;
role: "user" | "assistant";
content: string;
/** Classification info shown above the response as a query chip. */
queryContext?: PolicyQueryContext;
/** Structured response payload (absent for user messages). */
responseContent?: PolicyResponseContent;
}
interface PolicyQueryChipProps {
context: PolicyQueryContext;
className?: string;
}
interface PolicyVerdictBadgeProps {
verdict: PolicyVerdict;
className?: string;
}
interface PolicyCitationPanelProps {
citations: PolicyCitationItem[];
className?: string;
}
/**
* Chip rendered above every Policy AI assistant response.
* Shows the detected policy type, categories, and query routing type —
* equivalent to Jira Rovo's "Searching Confluence…" context indicator.
*
* @example
*
*/
declare function PolicyQueryChip({ context, className }: PolicyQueryChipProps): react_jsx_runtime.JSX.Element;
/**
* Coloured badge indicating a bank's lending policy verdict.
* - Yes → success (green)
* - Soft No → warning (amber) — accepted on specialist/non-prime products
* - No → destructive (red) — not accepted
* - Unknown → secondary — data not available
*/
declare function PolicyVerdictBadge({ verdict, className, }: PolicyVerdictBadgeProps): react_jsx_runtime.JSX.Element;
/**
* Collapsible panel listing the policy document sources behind an AI response.
* Rendered below every response format (SingleBankAnswer, ComparisonTable, RankedList).
* Collapsed by default; expands on toggle.
*/
declare function PolicyCitationPanel({ citations, className, }: PolicyCitationPanelProps): react_jsx_runtime.JSX.Element | null;
interface PolicySingleBankAnswerProps {
bankName: string;
verdict: PolicyVerdict;
/** Prose answer text. May contain inline [N] citation markers. */
answer: string;
citations: PolicyCitationItem[];
/**
* Optional query context — when provided, policy type and categories are
* rendered as an Info icon tooltip inside the bank header.
*/
queryContext?: PolicyQueryContext;
className?: string;
}
interface PolicySummaryCounts {
yes: number;
softNo: number;
no: number;
total: number;
}
interface PolicyComparisonTableProps {
/** Column headers — one per policy category queried. */
categories: string[];
banks: PolicyBankVerdict[];
summaryCounts: PolicySummaryCounts;
citations: PolicyCitationItem[];
/** Optional query context — shown as Info icon tooltip in the summary header. */
queryContext?: PolicyQueryContext;
className?: string;
}
interface PolicyRankedListProps {
/** Categories used in the TOPSIS ranking (shown in header). */
categories: string[];
banks: PolicyRankedBankItem[];
citations: PolicyCitationItem[];
/** Optional query context — shown as Info icon tooltip in the ranking header. */
queryContext?: PolicyQueryContext;
className?: string;
}
/**
* Displays a single-bank policy answer (Type A RAG retrieval).
* Shows the bank name, verdict badge, AI-generated prose with inline citation
* markers, and a collapsible citation panel listing source excerpts.
*
* @example
*
*/
declare function PolicySingleBankAnswer({ bankName, verdict, answer, citations, queryContext, className, }: PolicySingleBankAnswerProps): react_jsx_runtime.JSX.Element;
/**
* Displays a cross-bank policy comparison matrix (Type B/C retrieval).
* Shows a summary count row, search input, verdict filter tabs, a table
* with one row per bank and one column per policy category, and a
* collapsible citation panel at the bottom.
*
* @example
*
*/
declare function PolicyComparisonTable({ categories, banks, summaryCounts, citations, queryContext, className, }: PolicyComparisonTableProps): react_jsx_runtime.JSX.Element;
/**
* Displays a TOPSIS-ranked list of banks (Type C retrieval).
* Each bank row shows rank number, name, a colour-coded score progress bar,
* percentage, verdict badge, and key policy highlights as bullet points.
* A collapsible citation panel appears at the bottom.
*
* @example
*
*/
declare function PolicyRankedList({ categories, banks, citations, queryContext, className, }: PolicyRankedListProps): react_jsx_runtime.JSX.Element;
interface PolicyAIFABProps {
onClick: () => void;
hasNudge?: boolean;
className?: string;
}
interface PolicyAIPanelProps {
/** Required in float mode; ignored in `inline` mode. */
open?: boolean;
/** Required in float mode; ignored in `inline` mode. */
onClose?: () => void;
messages?: PolicyAIMessage[];
suggestedQuestions?: Record;
isStreaming?: boolean;
isLoading?: boolean;
/**
* Live thinking steps for the streaming reply, in the order received from the
* SSE stream. The last item is rendered in-progress, earlier ones as done.
* Falls back to a generic placeholder when empty. (Not used while `isLoading`.)
*/
thinkingSteps?: string[];
onSendMessage?: (text: string) => void;
/** Called when the user selects files via the paperclip attachment button. */
onAttachFile?: (files: FileList) => void;
/** Called when the user selects images via the image upload button. */
onAttachImage?: (files: FileList) => void;
onReset?: () => void;
/** True when older messages can be loaded (cursor pagination). */
hasMoreMessages?: boolean;
/** True while a `onLoadMoreMessages` request is in flight. */
isLoadingMoreMessages?: boolean;
/** Fired when the user scrolls near the top — fetch older messages. */
onLoadMoreMessages?: () => void;
/** Position relative to viewport — defaults to bottom-right. Ignored when `inline` is true. */
position?: "bottom-right" | "bottom-left";
/**
* When true, renders as an inline block filling its parent container instead
* of a fixed-position float widget. Use inside drawers, sheets, or tab panels.
* Hides the minimize and close buttons.
*/
inline?: boolean;
className?: string;
}
/**
* Floating action button that opens the PolicyAIPanel.
*
* @example
* setOpen(true)} />
*/
declare function PolicyAIFAB({ onClick, hasNudge, className, }: PolicyAIFABProps): react_jsx_runtime.JSX.Element;
/**
* Policy AI chat panel — shows suggested questions in home state and
* structured response cards (SingleBankAnswer / ComparisonTable / RankedList)
* in chat state.
*
* Float mode: fixed-position overlay next to the FAB.
* Inline mode: fills its parent container — use inside drawers or tab panels.
*
* @example
* setOpen(true)} />
* setOpen(false)}
* messages={messages}
* onSendMessage={handleSend}
* onReset={() => setMessages([])}
* />
*/
declare function PolicyAIPanel({ open, onClose, messages, suggestedQuestions, isStreaming, isLoading, thinkingSteps, onSendMessage, onAttachFile, onAttachImage, onReset, hasMoreMessages, isLoadingMoreMessages, onLoadMoreMessages, position, inline, className, }: PolicyAIPanelProps): react_jsx_runtime.JSX.Element | null;
export { PolicyAIFAB as P, type PolicyAIFABProps as a, type PolicyAIMessage as b, PolicyAIPanel as c, type PolicyAIPanelProps as d, type PolicyBankVerdict as e, type PolicyCitationItem as f, PolicyCitationPanel as g, type PolicyCitationPanelProps as h, PolicyComparisonTable as i, type PolicyComparisonTableProps as j, PolicyQueryChip as k, type PolicyQueryChipProps as l, type PolicyQueryContext as m, type PolicyQueryType as n, type PolicyRankedBankItem as o, PolicyRankedList as p, type PolicyRankedListProps as q, type PolicyResponseContent as r, PolicySingleBankAnswer as s, type PolicySingleBankAnswerProps as t, type PolicySummaryCounts as u, type PolicyType as v, type PolicyVerdict as w, PolicyVerdictBadge as x, type PolicyVerdictBadgeProps as y, type PolicyConversationItem as z };