UNPKG

eve

Version:

Filesystem-first framework for durable backend AI agents that run anywhere.

1 lines 856 B
import{TASK_DELIVERY_INITIATING_INSTRUCTION,TASK_DELIVERY_SETTLED_INSTRUCTION}from"#tasks/delivery-context.js";import{CONDITIONAL_DELIVERY_INSTRUCTION}from"#shared/empty-delivery.js";const POLICIES={conditional:{allowsEmptyDelivery:!0,instruction:CONDITIONAL_DELIVERY_INSTRUCTION},initiating:{allowsEmptyDelivery:!1,instruction:TASK_DELIVERY_INITIATING_INSTRUCTION},normal:{allowsEmptyDelivery:!1},pending:{allowsEmptyDelivery:!0},settled:{allowsEmptyDelivery:!1,instruction:TASK_DELIVERY_SETTLED_INSTRUCTION}};function resolveDeliveryPolicy(e){return e.hasOutputSchema||e.isChild?POLICIES.normal:e.taskDeliveryPhase===`pending`?POLICIES.pending:e.taskDeliveryPhase===`settled`?POLICIES.settled:e.isFirstTurn&&e.hasScheduleProvenance?POLICIES.conditional:e.taskDeliveryPhase===`initiating`?POLICIES.initiating:POLICIES.normal}export{resolveDeliveryPolicy};