UNPKG

@sema-agent/core

Version:

Stateless, task-oriented AI agent core

16 lines (15 loc) • 550 B
export const PROMPT_BLOCK_CAUSES = Object.freeze(["block", "crashed", "timeout", "cancelled"]); const PROMPT_BLOCK_CAUSE_SET = new Set(PROMPT_BLOCK_CAUSES); export function isPromptBlockCause(v) { return PROMPT_BLOCK_CAUSE_SET.has(v); } export const TERMINAL_CAUSE_IS_REPLAYABLE = { completed: true, failed: false, blocked: false, paused: false, }; Object.freeze(TERMINAL_CAUSE_IS_REPLAYABLE); export function isTerminalCauseKind(kind) { return typeof kind === "string" && Object.hasOwn(TERMINAL_CAUSE_IS_REPLAYABLE, kind); }