import { ID } from '../../commonStateTypes/common'; import { ZeniDate } from '../../zeniDayJS'; export interface AiCfoAnswerParagraph { text: string; orderedList?: Array<{ text: string; subText?: string; unorderedList?: string[]; }>; } export declare const ALL_AI_CFO_CHARTS_TYPES: readonly ["bar_chart", "pie_chart", "line_chart"]; export declare const ALL_AI_CFO_VISUALIZATION_TYPES: readonly ["bar_chart", "pie_chart", "line_chart", "table", "interactive_form"]; export declare const ALL_INTERACTIVE_FORM_TYPES: readonly ["cards_creation", "card_policy"]; export declare const toInteractiveFormType: (v: string) => "cards_creation" | "card_policy"; export declare const toInteractiveFormTypeStrict: (v: string) => "cards_creation" | "card_policy" | undefined; export type InteractiveFormType = ReturnType; export declare const toAiCfoVisualizationType: (v: string) => "bar_chart" | "pie_chart" | "line_chart" | "table" | "interactive_form"; export declare const toAiCfoVisualizationTypeStrict: (v: string) => "bar_chart" | "pie_chart" | "line_chart" | "table" | "interactive_form" | undefined; export type AiCfoVisualizationType = ReturnType; export declare const toAiCfoChartType: (v: string) => "bar_chart" | "pie_chart" | "line_chart"; export declare const toAiCfoChartTypeStrict: (v: string) => "bar_chart" | "pie_chart" | "line_chart" | undefined; export type AiCfoChartType = ReturnType; export declare const ALL_AI_CFO_ANSWER_STATE_TYPES: readonly ["complete", "partial"]; export declare const ALL_AI_CFO_ANSWER_RESPONSE_TYPES: readonly ["analysis", "answer", "reasoning", "thought"]; export declare const ALL_Y_FORMAT_TYPES: readonly ["currency", "number"]; export declare const ALL_Y_FORMAT_NON_CURRENCY_UNITS: readonly ["percentage", "unit", "ratio"]; export declare const ALL_Y_FORMAT_SCALES: readonly ["raw", "K", "M", "B", "T"]; export declare const toYFormatType: (v: string) => "number" | "currency"; export declare const toYFormatUnit: (v: string) => string; export declare const toYFormatScale: (v: string) => "M" | "raw" | "K" | "B" | "T"; export declare const toYFormatTypeStrict: (v: string) => "number" | "currency" | undefined; export declare const toYFormatUnitStrict: (v: string) => string; export declare const toYFormatScaleStrict: (v: string) => "M" | "raw" | "K" | "B" | "T" | undefined; export type YFormatType = ReturnType; export type YFormatUnit = ReturnType; export type YFormatScale = ReturnType; export interface YFormat { scale: YFormatScale; type: YFormatType; unit: YFormatUnit; symbol?: string; } export declare const toAiCfoAnswerStateType: (v: string) => "complete" | "partial"; export declare const toAiCfoAnswerResponseType: (v: string) => "analysis" | "answer" | "reasoning" | "thought"; export declare const toAiCfoAnswerStateTypeStrict: (v: string) => "complete" | "partial" | undefined; export declare const toAiCfoAnswerResponseTypeStrict: (v: string) => "analysis" | "answer" | "reasoning" | "thought" | undefined; export type AiCfoAnswerStateType = ReturnType; export type AiCfoAnswerResponseType = ReturnType; export interface TableVisualization { columns: string[]; rows: string[][]; } export interface ChartVisualization { values: Array>; x: string; y: string[]; lines?: string[]; yFormat?: YFormat; } export type CardsCardKind = 'vendor' | 'class' | 'category'; export interface CardNameOption { id: string; kind: CardsCardKind; label: string; } export interface CardsCreationCommonData { cardNameOptions: CardNameOption[]; suggestedOwnerUserIdByTeamId: Record; } export type CardsCreationInitialData = (CardsCreationCommonData & { mode: 'review'; teamRows: Array<{ avgMonthlySpend: string; cardKind: CardsCardKind; id: string; label: string; recommendedLimit: string; recommendedLimitCadence?: string; }>; }) | (CardsCreationCommonData & { cardRows: Array<{ cardKind: CardsCardKind; id: string; label: string; recommendedLimit?: number; suggestedOwnerUserId?: ID; }>; mode: 'create'; }); export interface CardPolicyDraftPolicyEntity { categoryCodes: string[]; merchantNames: string[]; } export interface CardPolicySpendLimits { transaction: number; } export interface CardPolicyDraftPolicy { allowedEntity: CardPolicyDraftPolicyEntity; applyToCards: string[]; blockedEntity: CardPolicyDraftPolicyEntity; description: string; id: string; mode: string; name: string; requiredReceiptThreshold: number; spendLimits: CardPolicySpendLimits; } export interface CardPolicyStep5Review { draftPolicies: CardPolicyDraftPolicy[]; groupingSource: string; prompt: string; } export interface CardPolicyWizardPlan { step5Review: CardPolicyStep5Review; } export interface CardPolicyUploadSource { confidenceScore: number; fileName: string; lowConfidenceFields: string[]; } export type CardPolicyInitialData = { policyKind: 'auto'; wizardPlan: CardPolicyWizardPlan; } | { policyKind: 'guided'; wizardPlan: CardPolicyWizardPlan; } | { policyKind: 'upload'; source?: CardPolicyUploadSource; wizardPlan?: CardPolicyWizardPlan; }; export type InteractiveFormVisualization = { formType: 'cards_creation'; payload: CardsCreationInitialData; } | { formType: 'card_policy'; payload: CardPolicyInitialData; }; export interface AiCfoVisualization { data: TableVisualization | ChartVisualization | InteractiveFormVisualization; type: AiCfoVisualizationType; } export declare const toMessageSender: (v: string) => "user" | "agent"; export declare const toMessageType: (v: string) => "plain_text" | "json"; export declare const toMessageSenderStrict: (v: string) => "user" | "agent" | undefined; export declare const toMessageTypeStrict: (v: string) => "plain_text" | "json" | undefined; export type MessageSender = ReturnType; export type MessageType = ReturnType; export interface ResponseBlockBase { chatSessionId: ID; createdAt: ZeniDate; messageId: ID; sender: MessageSender; state: AiCfoAnswerStateType; userId: ID; } /** Where a capability promo renders; 'banner' = dismissible hint bar above the composer. */ export type AiCfoCapabilityPromoSurface = 'banner' | 'inline'; export interface AiCfoCapabilityPromo { copy: string; id: string; surface: AiCfoCapabilityPromoSurface; cta?: AiCfoCapabilityPromoCta; } export interface AiCfoCapabilityPromoCta { label: string; prefill: string; } /** A downloadable spreadsheet attached to one answer. See AiCfoExportPayload. */ export interface AiCfoExport { exportId: ID; name: string; sizeBytes?: number; } /** The body the Save to Skill control POSTs to /1.0/skills. */ export interface AiCfoSkillDraft { displayName: string; instructions: string; name: string; description?: string; parameterHints?: string[]; } export interface AnswerContentBlockBase { assumptions: string; chainOfThoughtActionSteps: string[]; followUpQuestions: string[]; insights: string; text: string; artifact?: string; artifactHostUrl?: string; artifactTitle?: string; /** Feature-discovery promo (banner surface): dismissible hint bar above the composer. */ capabilityPromo?: AiCfoCapabilityPromo; exports?: AiCfoExport[]; /** Unsaved skill body from a `/create-skill` turn; drives the Save to Skill control. */ skillDraft?: AiCfoSkillDraft; suggestedReply?: string; summarizedTitle?: string; table?: AiCfoVisualization; visualization?: AiCfoVisualization; } export interface FileAttachmentMetadata { file_size: number; filename: string; mime_type: string; file_id?: string; } export interface QuestionContentBlockBase extends ResponseBlockBase { questionText: string; attachments?: FileAttachmentMetadata[]; } export interface ResponseBlockType extends ResponseBlockBase { content: AnswerContentBlockBase; type: AiCfoAnswerResponseType; } export interface AiCfoQuestionWithAnswer { question: QuestionContentBlockBase; questionAnswerId: ID; responses: Partial>; } export interface ChatSession { chatSessionId: ID; createdAt: ZeniDate; userId: ID; chatSessionSummary?: string; } export interface ChatSessionWithMessages { chatSession: ChatSession; questionAnswers: AiCfoQuestionWithAnswer[]; } export declare const ALL_SYNTHETIC_AI_CFO_ANSWER_KINDS: readonly ["creating_cards", "creating_policy", "created_cards", "created_policy", "errored_cards", "errored_policy"]; export type SyntheticAiCfoAnswerKind = (typeof ALL_SYNTHETIC_AI_CFO_ANSWER_KINDS)[number]; export interface SyntheticAiCfoAnswer { createdAt: ZeniDate; entityIds: ID[]; id: ID; kind: SyntheticAiCfoAnswerKind; sourceQuestionAnswerId: ID; } export interface AiCfoState { aiCfoByChatSessionId: Record; partialQuestionAnswers: Record; syntheticAnswersByChatSessionId: Record; }