import { C as Configure } from './client-TtsyrmTu.mjs'; import { ConnectorName } from './types.mjs'; type SpectrumMessage = { id?: string; content?: { type?: string; text?: string; }; sender?: unknown; reply: (message: unknown) => unknown | Promise; }; type SpectrumSpace = { id?: string; }; type SpectrumApp = { messages: AsyncIterable<[SpectrumSpace, SpectrumMessage]>; }; /** This user's Configure profile runtime: .read(), .search(), .remember(fact), .tools(), .executeTool(). */ type ProfileRuntime = ReturnType; /** What reply() can return: one text, several texts, or nothing. */ type Reply = string | string[] | null | undefined; interface PersonalizeOptions { /** Secret key (sk_). Server-side only. */ apiKey: string; /** Publishable key (pk_). Safe to put in the sign-in link. */ publishableKey: string; /** Your agent handle in Configure. */ agent: string; /** * Write the reply for this turn. Return a string, or an array of strings to * send as separate texts with a natural pause between them. */ reply: (context: ReplyContext) => Reply | Promise; /** Optional: the agent's iMessage line (E.164) for the sign-in "text back" button. */ agentPhone?: string; /** Optional: agent display name shown on the hosted sign-in page. */ displayName?: string; /** Optional: connectors to request at sign-in, e.g. ["gmail", "calendar"]. */ connectors?: ConnectorName[]; /** Optional: how to phrase the sign-in message. Default: "Connect your profile: ". */ connectMessage?: (url: string) => string; /** Optional: words that trigger the sign-in link. Default: connect / link / sign in / login. */ connectIntent?: RegExp; } interface ReplyContext { /** The incoming message text. */ text: string; /** The user's Configure profile (identity, preferences, memories, ...). */ profile: unknown; /** Convenience: the user's first name, or null if unknown. */ name: string | null; /** True once the user has signed in (linked); false while anonymous. */ linked: boolean; /** The hosted sign-in link - offer it to anyone you don't recognize yet. */ signInUrl: string; /** This user's Configure profile runtime - read AND write: .remember(fact), .tools(), .executeTool(). */ runtime: ProfileRuntime; } /** * Legacy Spectrum demo helper retained for compatibility with configure@1.1.x. * * New Spectrum integrations should use the `configure-spectrum` package, which * keeps Spectrum in charge of transport and Configure at the identity/profile boundary. */ declare function personalize(app: SpectrumApp, options: PersonalizeOptions): void; export { type PersonalizeOptions, type Reply, type ReplyContext, personalize };