// Package consts contains shared daemon-internal protocol constants.
package consts

// ParsedEventKind values are the normalized agent runtime events emitted by
// runtime drivers and consumed by the agent process and dispatcher.
const (
	ParsedEventKindSessionInit           = "session_init"
	ParsedEventKindThinking              = "thinking"
	ParsedEventKindText                  = "text"
	ParsedEventKindToolCall              = "tool_call"
	ParsedEventKindToolOutput            = "tool_output"
	ParsedEventKindSubagentActivity      = "subagent_activity"
	ParsedEventKindTurnEnd               = "turn_end"
	ParsedEventKindRuntimeIdle           = "runtime_idle"
	ParsedEventKindRuntimeCompacting     = "runtime_compacting"
	ParsedEventKindRuntimeCompacted      = "runtime_compacted"
	ParsedEventKindError                 = "error"
	ParsedEventKindUsage                 = "usage"
	ParsedEventKindPromptInput           = "prompt_input"
	ParsedEventKindRuntimeInputPending   = "runtime_input_pending"
	ParsedEventKindRuntimeInputAcked     = "runtime_input_surfaced"
	ParsedEventKindRuntimeInputUncertain = "runtime_input_uncertain"
)

// ParsedEventStopReason values are stop reasons returned by runtime drivers on
// ParsedEventKindTurnEnd events.
const (
	ParsedEventStopReasonEndTurn   = "end_turn"
	ParsedEventStopReasonMaxTokens = "max_tokens"
	ParsedEventStopReasonToolUse   = "tool_use"
	ParsedEventStopReasonStopSeq   = "stop_sequence"
)

// WakeStatus values describe the wake-to-visible-reply lifecycle.
const (
	WakeStatusReceived                     = "received"
	WakeStatusReplySent                    = "reply_sent"
	WakeStatusCompletedWithoutVisibleReply = "completed_without_visible_reply"
	WakeStatusFailed                       = "failed"
)

// RuntimeEventClass values are legacy runtime diagnostic classes that are still
// emitted on the AgentTeam wire protocol and persisted by the server.
const (
	RuntimeEventClassRoutedMessageDeferred     = "routed_message_deferred"
	RuntimeEventClassDeferredReplayStarted     = "deferred_replay_started"
	RuntimeEventClassVisibleReplySent          = "visible_reply_sent"
	RuntimeEventClassCompletedWithoutReply     = "completed_without_visible_reply"
	RuntimeEventClassRuntimeStartFailed        = "runtime_start_failed"
	RuntimeEventClassRuntimeExitedUnexpectedly = "runtime_exited_unexpectedly"
	RuntimeEventClassWakeFailed                = "wake_failed"
	RuntimeEventClassRuntimeRetrying           = "runtime_retrying"
	RuntimeEventClassDeliveryDeferred          = "delivery_deferred"
	RuntimeEventClassDeliveryReplayed          = "delivery_replayed"
	RuntimeEventClassHeartbeatStale            = "runtime_heartbeat_stale"
	RuntimeEventClassContextWindowExceeded     = "context_window_exceeded"
	RuntimeEventClassEventBusSubscriberDropped = "eventbus_subscriber_dropped"
	RuntimeEventClassEventBusSinkFailed        = "eventbus_sink_failed"
)

// DriverEventType values are raw runtime-driver protocol labels shared across
// adapters before normalization into ParsedEventKind values.
const (
	DriverEventTypeToolUse = "tool_use"
)

// TrajectoryKind values are emitted in types.TrajectoryEntry.Kind.
const (
	TrajectoryKindToolStart    = "tool_start"
	TrajectoryKindStatus       = "status"
	TrajectoryKindContextUsage = "context_usage"
)

// PromptKind values identify prompt input slots in trajectory entries.
const (
	PromptKindBaseInstructions       = "base_instructions"
	PromptKindDeveloperInstructions  = "developer_instructions"
	PromptKindRuntimeNativeContract  = "runtime_native_contract"
	PromptKindResume                 = "resume"
	PromptKindTurnInput              = "turn_input"
	PromptKindDeliveryText           = "delivery_text"
	PromptKindFinalVisibleReplyCheck = "final_visible_reply_check"
	PromptKindDeferredContinuation   = "deferred_continuation"
	PromptKindSystemNotification     = "system_notification"
	PromptKindRuntimeRetry           = "runtime_retry"
)

// PromptSlot values are prompt compiler slot identifiers before they are
// normalized into PromptKind values.
const (
	PromptSlotBaseInstructions      = "baseInstructions"
	PromptSlotDeveloperInstructions = "developerInstructions"
	PromptSlotRuntimeCarrier        = "runtimeCarrier"
	PromptSlotTurnInput             = "turnInput"
	PromptSlotDeliveryText          = "deliveryText"
)
