/** * Signal intake pack generator. * * Produces the offline half of the fast intake path: a prose brief written for * the intake task and a ready round-1 question. Both are stored per user and * refreshed in the background, so `/i/new` can render round 1 with no model call. */ import type { BaseLanguageModelInput } from "@langchain/core/language_models/base"; import type { Runnable } from "@langchain/core/runnables"; /** One selectable option on the round-1 question. */ export interface IntakePackQuestionOption { label: string; description: string; } /** Round-1 question, shaped exactly like the frontend `QuestionPayload`. */ export interface IntakePackQuestion { title: string; prompt: string; options: IntakePackQuestionOption[]; multiSelect: boolean; } /** Everything the generator needs about a user. */ export interface IntakePackInput { premises: Array<{ text: string; }>; networkTitles: string[]; globalContext: string | null; } /** Stored artifact: the brief plus the ready round-1 question. */ export interface IntakePack { brief: string; question: IntakePackQuestion; } /** Generates and normalizes the per-user intake pack. */ export declare class SignalIntakePackGenerator { private readonly model; /** * @param model - Optional injected structured model. Tests pass a stub. */ constructor(model?: Runnable); /** * Generate the intake pack for one user. * * @param input - Active premises, membership titles, and the global context paragraph * @returns Normalized brief and round-1 question */ generate(input: IntakePackInput): Promise; } /** * Clamp a generated pack into the shape the frontend can render. * * @param pack - Raw model output * @returns Normalized pack * @throws When the question has fewer than 2 usable options */ export declare function normalizeIntakePack(pack: IntakePack): IntakePack;