UNPKG

@promptbook/remote-server

Version:

Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action

144 lines (143 loc) 4.65 kB
import type { TODO_any } from '../../../utils/organization/TODO_any'; /** * Action performed by timeout tools. * * @private internal timeout-chat type */ export type TimeoutToolCallAction = 'set' | 'cancel'; /** * Friendly presentation payload derived from timeout tool arguments and result. * * @private internal utility of `<Chat/>` */ export type TimeoutToolCallPresentation = { /** * Timeout action represented by this tool call. */ readonly action: TimeoutToolCallAction; /** * Timeout operation status from tool result. */ readonly status: string | null; /** * Requested timeout duration in milliseconds. */ readonly milliseconds: number | null; /** * Optional timeout identifier returned by runtime. */ readonly timeoutId: string | null; /** * Optional custom timeout wake-up message. */ readonly message: string | null; /** * Parsed due date for scheduled timeout. */ readonly dueAtDate: Date | null; /** * Exact due timestamp in ISO UTC format. */ readonly dueAtIsoUtc: string | null; /** * Local timezone used for user-facing rendering. */ readonly localTimezone: string; /** * Compact duration label used by timeout chips. */ readonly compactDurationLabel: string | null; /** * Long duration label used by timeout detail popup copy. */ readonly humanDurationLabel: string | null; /** * Relative time label resolved from due date and current time. */ readonly relativeDueLabel: string | null; /** * Localized due time for friendly popups. */ readonly localDueTimeLabel: string | null; /** * Localized due date for friendly popups. */ readonly localDueDateLabel: string | null; }; /** * Optional localized labels used by timeout chips and friendly modal copy. * * @private internal utility of `<Chat/>` */ type TimeoutToolCallTranslations = { readonly toolCallTimeoutChipLabel?: string; readonly toolCallTimeoutChipCancelledLabel?: string; readonly toolCallTimeoutChipInactiveLabel?: string; readonly toolCallTimeoutChipUpdatedLabel?: string; readonly toolCallTimeoutChipFallbackLabel?: string; readonly toolCallTimeoutPrimaryScheduledLabel?: string; readonly toolCallTimeoutSecondaryDurationLabel?: string; readonly toolCallTimeoutPrimaryCancelledLabel?: string; readonly toolCallTimeoutPrimaryInactiveLabel?: string; readonly toolCallTimeoutPrimaryUpdatedLabel?: string; readonly toolCallTimeoutPrimaryFallbackLabel?: string; }; /** * Inputs required to derive timeout presentation metadata. * * @private internal timeout-chat type */ type ResolveTimeoutToolCallPresentationOptions = { /** * Tool name being rendered. */ readonly toolCallName: string; /** * Parsed tool arguments. */ readonly args: Record<string, TODO_any>; /** * Parsed raw tool result payload. */ readonly resultRaw: TODO_any; /** * Current date used to calculate relative labels. */ readonly currentDate?: Date; /** * Optional BCP-47 locale string used to format local-time labels. * When omitted the browser/OS default locale is used. */ readonly locale?: string; }; /** * Determines whether a tool name belongs to the timeout commitment. * * @private internal utility of `<Chat/>` */ export declare function isTimeoutToolCallName(toolName: string): boolean; /** * Resolves friendly timeout presentation metadata from one tool call payload. * * @private internal utility of `<Chat/>` */ export declare function resolveTimeoutToolCallPresentation(options: ResolveTimeoutToolCallPresentationOptions): TimeoutToolCallPresentation | null; /** * Builds concise chip text for timeout tool calls. * * @private internal utility of `<Chat/>` */ export declare function buildTimeoutToolCallChipLabel(presentation: TimeoutToolCallPresentation, translations?: TimeoutToolCallTranslations): string; /** * Builds the primary timeout sentence shown in default modal view. * * @private internal utility of `<Chat/>` */ export declare function buildTimeoutToolPrimarySentence(presentation: TimeoutToolCallPresentation, translations?: TimeoutToolCallTranslations): string; /** * Builds one default-view scheduling sentence with local-time and relative context. * * @private internal utility of `<Chat/>` */ export declare function buildTimeoutToolScheduleSentence(presentation: TimeoutToolCallPresentation, translations?: TimeoutToolCallTranslations): string | null; export {};