UNPKG

@sema-agent/core

Version:

Stateless, task-oriented AI agent core

10 lines (9 loc) • 621 B
export const RESUME_AT_OUTSIDE_WINDOW_REASONS = Object.freeze(["branch_not_held", "attachment_frames_unreadable"]); export const RESUME_AT_REMEDY_KINDS = Object.freeze(["retry_on_handle_holding_message", "resume_at_mode_before"]); const REMEDY_KINDS_OF_REASON = { branch_not_held: [], attachment_frames_unreadable: ["retry_on_handle_holding_message", "resume_at_mode_before"], }; export function resumeAtOutsideWindowDetail(reason, takesBefore = true) { return { reason, remedies: REMEDY_KINDS_OF_REASON[reason].filter((kind) => takesBefore || kind !== "resume_at_mode_before").map((kind) => ({ kind })) }; }