import type { ApprovalAnswer } from './gateway/index.ts'; /** Agent-scoped system-prompt section. Not a complete prompt; stock DSH still owns tools and persona. */ export declare const FEISHU_SPEAKING_CONTRACT_SECTION = "dsh-messaging-gateway:feishu-voice"; /** * Product speaking contract for gateway-created Feishu sessions. * Written here; not Grok Bot handbook text. Desktop agents.create and Slack do not get this. */ export declare const FEISHU_SPEAKING_CONTRACT: string; /** Drop leading English planning so Feishu only sees the spoken sentence. */ export declare function visibleChatText(raw: string): string; /** * Take finished spoken sentences off the front of `text`. * Chinese `。!?` end a sentence. ASCII `.!?` only count when not a decimal or URL. */ export declare function takeCompleteSentences(text: string): { parts: string[]; consumed: number; }; /** * First spoken sentence vs the rest of the same text. * Feishu sends at most this first sentence early; the rest stays one bubble. */ export declare function splitFirstSpoken(text: string): { first: string; rest: string; }; export declare function assistantChunkTextFromEvent(event: { type: string; data?: unknown; }): string; /** Attach the Feishu speaking contract on this agent only. No-op when systemPrompt is missing. */ export declare function installFeishuSpeakingContract(agentCtx: object): void; export type ApprovalHoldRequest = { readonly toolName?: string; readonly callId?: string; readonly reason?: string; readonly signal?: AbortSignal; readonly agent?: { readonly id?: unknown; }; }; export type ApprovalHoldOutcome = 'allowed-once' | 'rejected' | 'cancelled' | 'unavailable'; /** * Map this gateway's existing answers onto DSH's closed approval vocabulary. * Do not add allow-always or other states. */ export declare function outcomeFromAnswer(answer: ApprovalAnswer): ApprovalHoldOutcome; /** * Hold one DSH approval/request until Feishu or the rest of the chain (desktop) answers. * First settled outcome wins. */ export declare function installFeishuApprovalHold(agentCtx: object, hold: (request: ApprovalHoldRequest, next: () => Promise) => Promise): void;