{% include "scene-context.jinja2" %}
<|SECTION:TASK|>
{% set last_message = scene.last_message_of_type(["character", "narrator"]) -%}
{% set character_direction=scene.last_message_of_type("director", source=character.name, max_iterations=3) -%}
{% if agent_context_state["conversation__instruction"] -%}
{% set character_direction=agent_context_state["conversation__instruction"] -%}
{% endif -%}
{% set bullet_num=0 -%}
Your task is to analyze the scene progression so far and how it informs what {{ character.name }}'s next line or action in the scene will be.

The information you write will be given to the other story editors to write {{ character.name }}'s next action in the scene.

{% set bullet_num = bullet_num+1 %}{{ bullet_num }}) Briefly make statements about context, meaning and facts established relevant to the current moment in the scene. Facts are sourced from the existing story, don't assume, only state things that are explicitly true.

{% set bullet_num = bullet_num+1 %}{{ bullet_num }}) Brielfy list who the characters in the scene are to each other. (Active or referenced)

{% if character_direction %}{% set bullet_num = bullet_num+1 %}{{ bullet_num }}) The story editors were given the following direction: "{{ character_direction }}". Briefly analyse the direction, what does it mean for {{ character.name }}'s next action? Are they already following the direction or do they need to change course?

{% endif %}
{% if last_message -%}
{% set bullet_num = bullet_num+1 %}{{ bullet_num }}) Briefly the meaning of the current moment in the scene. What was the meaning of their dialogue and actions?

``` current moment in the scene
{{ last_message }}
```

{% set bullet_num = bullet_num+1 %}{{ bullet_num }}) Is {{ character.name }} aware of the current moment? This is IMPORTANT - It cannot affect their next action if they are not aware. You must be very explicit about this and either say Yes or No.
{% endif %}

{% set bullet_num = bullet_num+1 %}{{ bullet_num }}) What is the cadence and nature of the current dialogue? Is it ongoing or is a new dialogue starting? Who is talking to who?

{% if context_investigation -%}
{% set bullet_num = bullet_num+1 %}{{ bullet_num }}) Briefly list any relevant bits of information from the "Potentially relevant information" section. Skip this step if there aren't any.

Note that the 'Potentially relevant information' section has been filled in from a previous prompt and may not be relevant at all.
{% endif %}

{% if length <= 256 %}Your analysis should be 1 - 2 paragraphs long.{% elif length <= 512 %}Your analysis should be 2 - 3 paragraphs long.{% endif %}

Use natural and easy to read language and plain-text formatting in your response. 
<|CLOSE_SECTION|>