UNPKG

@mesh-tech/mesh-cli

Version:

CLI for Mesh platform development utilities

45 lines (44 loc) 1.52 kB
export interface DecodedEvent { eventId: string; kind: "userSignal" | "callLLMResult" | "other"; payload?: unknown; } export interface RawHistoryEvent { eventId?: unknown; activityTaskScheduledEventAttributes?: { activityType?: { name?: string | null; } | null; input?: { payloads?: unknown[] | null; } | null; } | null; workflowExecutionSignaledEventAttributes?: { signalName?: string | null; input?: { payloads?: unknown[] | null; } | null; } | null; activityTaskCompletedEventAttributes?: { scheduledEventId?: unknown; result?: { payloads?: unknown[] | null; } | null; } | null; [k: string]: unknown; } export type DecodePayload = (payloads: unknown[] | undefined | null) => Promise<unknown>; export declare function classifyHistoryEvents(rawEvents: Iterable<RawHistoryEvent>, decodePayload: DecodePayload): Promise<DecodedEvent[]>; export type ModelMessage = { role?: string; content?: unknown; } & Record<string, unknown>; export declare function extractSnapshotMessages(rawEvents: Iterable<RawHistoryEvent>, decodePayload: DecodePayload): Promise<ModelMessage[]>; export interface Turn { role: "user" | "assistant"; text: string; toolCalls?: string[]; eventId: string; } export declare function reconstructTranscript(events: DecodedEvent[]): Turn[]; export declare function renderTranscriptMarkdown(turns: Turn[]): string;