package work import "time" // AgentExecutionRequest is the serializable hand-off from the durable worker // to an executor. The bridge receives the already-authorized dispatch context; // it does not receive database credentials or ambient authority. type AgentExecutionRequest struct { Intent AgentDispatchIntent `json:"intent"` WorkerID string `json:"worker_id"` FencingToken AgentFencingToken `json:"fencing_token"` LeaseExpiresAt time.Time `json:"lease_expires_at"` } type AgentExecutionState string const ( AgentExecutionCompleted AgentExecutionState = "COMPLETED" AgentExecutionWaiting AgentExecutionState = "WAITING" AgentExecutionFailed AgentExecutionState = "FAILED" ) // AgentExecutionResult is an acknowledgement of the external execution // attempt. The worker persists it through the work owner before completing a // dispatch, so a bridge timeout never becomes an unrecorded success. type AgentExecutionResult struct { State AgentExecutionState `json:"state"` Summary string `json:"summary"` OutcomeRef string `json:"outcome_ref"` ArtifactRefs []string `json:"artifact_refs"` ObservedAtUnixMillis int64 `json:"observed_at_unix_millis"` }