{% extends "layouts/console_base.html" %} {% set page_title = "CreatureOS" %} {% set sidebar_title = "CreatureOS" %} {% set sidebar_kicker = "Ecosystem" %} {% set body_class = "dc-chat local-creature-app" %} {% set chat_empty = (active_view == "chats" and (messages | length) == 0) %} {% set onboarding_required = onboarding_state.required if onboarding_state is defined else false %} {% set onboarding_phase = onboarding_state.phase if onboarding_state is defined else "" %} {% set keeper_slug = onboarding_state.creature_slug if onboarding_state is defined and onboarding_state.creature_slug is defined else "" %} {% set keeper_conversation_id = onboarding_state.conversation_id if onboarding_state is defined and onboarding_state.conversation_id is defined else None %} {% macro render_onboarding_starter_link(summon_ready=true) -%}
{%- endmacro %} {% macro render_sidebar_redirect_fields(row_slug) -%} {% if selected_creature and selected_creature.slug == row_slug and active_view == 'chats' and selected_chat %} {% endif %} {% if selected_creature and selected_creature.slug == row_slug and active_view == 'activity' and selected_run %} {% endif %} {%- endmacro %} {% block body_attrs %} data-aud="creatureos" data-active-view="{{ active_view }}" data-chat-empty="{{ 'true' if chat_empty else 'false' }}" data-ecosystem="{{ settings_state.ecosystem.current if settings_state.ecosystem is defined else 'woodlands' }}" data-thinking-feed-label="{{ thinking_feed_label }}"{% endblock %} {% block head_extra %} {% if onboarding_required and active_view == "onboarding-ecosystem" %} {% for href in onboarding_state.ecosystem_preload_assets %} {% endfor %} {% endif %} {% endblock %} {% block sidebar_header_controls %} {% if not onboarding_required %} {% endif %} {% endblock %} {% block sidebar_nav %} {% endblock %} {% block sidebar_footer %} {% endblock %} {% block main %} {% if active_view == "onboarding-ecosystem" %}

Choose an Ecosystem

{% for item in onboarding_state.ecosystem_choices %} {% endfor %}
{% elif active_view == "onboarding-starter" %}
{% set assistant_turn = namespace(value=0) %} {% for message in onboarding_state.chat_messages %}
{% if message.role == 'creature' %} {% set assistant_turn.value = assistant_turn.value + 1 %} {% if assistant_turn.value == 1 %}
{{ message.typewriter_text }}
{% else %} {% if message.body %}
{% endif %} {% endif %} {% if message.attachments %}
{% for attachment in message.attachments %} {% if attachment.is_image %} {{ attachment.filename }} {{ attachment.filename }} {% else %} {{ attachment.filename }} {{ attachment.size_label }} {% endif %} {% endfor %}
{% endif %} {% else %} {% if message.body %}
{{ message.body }}
{% endif %} {% if message.attachments %}
{% for attachment in message.attachments %} {% if attachment.is_image %} {{ attachment.filename }} {{ attachment.filename }} {% else %} {{ attachment.filename }} {{ attachment.size_label }} {% endif %} {% endfor %}
{% endif %} {% endif %}
{% endfor %}
{% if onboarding_state.starter_ready %}
{{ render_onboarding_starter_link(true) }}
{% endif %}
{% set onboarding_feed = onboarding_state.chat_feed if onboarding_state.chat_feed is defined else {} %} {% set onboarding_feed_status = onboarding_feed.status if onboarding_feed.status is defined else 'idle' %} {% set onboarding_feed_lines = onboarding_feed.lines if onboarding_feed.lines is defined else [] %} {% set onboarding_thinking = onboarding_state.thinking if onboarding_state.thinking is defined else {} %}
{{ 'Working' if onboarding_feed_status == 'running' else 'Listening' }} {{ onboarding_feed_status }}
{% if onboarding_feed_lines %}{% for item in onboarding_feed_lines %}{{ item }}{% if not loop.last %}{{ '\n' }}{% endif %}{% endfor %}{% else %}Waiting for first output…{% endif %}
{% if onboarding_state.creature_slug and onboarding_state.conversation_id %}
{% endif %}
{% elif active_view == "creature" %}
{% if selected_creature.is_keeper %}
{% if selected_keeper_dialog.last_user_body %}
{{ selected_keeper_dialog.last_user_body }}
{% endif %}
{% if selected_keeper_dialog.typewriter_text %}
{{ selected_keeper_dialog.typewriter_text }}
{% else %}
{% endif %}
{% if selected_keeper_dialog.summon_ready %}
{% if selected_keeper_dialog.conversation_id %} {% endif %}
{% endif %}
{% set keeper_thinking = selected_keeper_dialog.thinking if selected_keeper_dialog.thinking is defined else {} %}
{% if selected_keeper_dialog.conversation_id %} {% endif %}
{% if selected_keeper_dialog.conversation_id %}
{% endif %}
{% else %}

{{ selected_creature.display_name }}

{% if selected_creature.is_keeper and selected_creature.role_label %} {{ selected_creature.role_label }} {% endif %} Habits {{ selected_creature.habit_summary }}

{{ selected_creature.purpose_summary or selected_creature.concern }}

{% if not selected_creature.is_keeper and not selected_creature.can_delete %} Protected from release {% endif %}
{% if selected_creature.status == 'error' %}
This creature hit a problem on its last pass. {% if selected_creature.last_error %} {{ selected_creature.last_error }} {% endif %}
{% endif %}
Open a chat when you want {{ selected_creature.display_name }} to work with you directly. Visit Habits when you want to teach it recurring work.
{% endif %}
{% elif active_view == "settings" %}
Codex Usage
Last checked {{ settings_state.codex_access.last_checked_at_relative }}
{% if settings_state.codex_access.limits.available %}
5-hour allowance {{ settings_state.codex_access.limits.primary.left_percent_label }} left Resets {{ settings_state.codex_access.limits.primary.resets_at_display }}
Weekly allowance {{ settings_state.codex_access.limits.secondary.left_percent_label }} left Resets {{ settings_state.codex_access.limits.secondary.resets_at_display }}
{% endif %} {% if settings_state.codex_access.last_error %}
{{ settings_state.codex_access.last_error }}
{% endif %}
Feed the ecosystem
If CreatureOS has been useful, you can support it here.
Release every creature, clear the habitat, and restart first-run onboarding.
{% elif active_view == "activity" %}
{% if selected_habit %}
Skill {{ "Active" if selected_habit.enabled else "Paused" }} {{ selected_habit.schedule_summary }}

{{ selected_habit.title }}

{{ selected_habit.instructions }}

{% if selected_habit.last_summary %}
Last summary {{ selected_habit.last_summary }}
{% endif %}
{% elif selected_habits %}

Pick a habit from the sidebar to see its history.

{% else %}

This creature has not been taught any habits yet.

{% endif %}
{% if selected_habit %}
Run log
{% endif %} {% for item in selected_activity_feed %}
{% if item.habit_title %} Skill {{ item.habit_title }} {% endif %} {{ (item.severity or "info")|upper }}

{{ item.summary or (item.trigger_type|replace('_', ' ')|title) }}

{% if item.message_text or item.activity_note %}
{% if item.message_text %}What I’d tell you{% else %}What happened{% endif %}

{{ item.message_text or item.activity_note }}

{% endif %}
{% endfor %} {% if selected_habit and not selected_activity_feed %}

This skill has not logged any completed runs yet.

{% endif %}
{% else %}
{% if messages %} {% for message in messages %}
{% if message.role == 'system' %}
System
{% if message.body %}
{% endif %} {% if message.attachments %}
{% for attachment in message.attachments %} {% if attachment.is_image %} {{ attachment.filename }} {{ attachment.filename }} {% else %} {{ attachment.filename }} {{ attachment.size_label }} {% endif %} {% endfor %}
{% endif %}
{% elif message.role == 'creature' %} {% if message.body %}
{% endif %} {% if message.attachments %}
{% for attachment in message.attachments %} {% if attachment.is_image %} {{ attachment.filename }} {{ attachment.filename }} {% else %} {{ attachment.filename }} {{ attachment.size_label }} {% endif %} {% endfor %}
{% endif %} {% else %} {% if message.body %}
{{ message.body }}
{% endif %} {% if message.attachments %}
{% for attachment in message.attachments %} {% if attachment.is_image %} {{ attachment.filename }} {{ attachment.filename }} {% else %} {{ attachment.filename }} {{ attachment.size_label }} {% endif %} {% endfor %}
{% endif %} {% endif %}
{% endfor %} {% endif %}
{% if selected_creature and active_view == 'chats' %}
{% if selected_busy_state and selected_busy_state.is_busy %}

{{ selected_busy_state.headline }}

{{ selected_busy_state.detail }}

{% endif %}
{% if selected_chat %} {% else %} {% endif %}
{% if not (selected_busy_state and selected_busy_state.is_busy) %} {% endif %}
{% if selected_chat %}
{% else %}
{% endif %}
{% endif %}
{% endif %} {% endblock %} {% block modals %} {% if selected_creature and active_view == "creature" %} {% endif %} {% endblock %} {% block scripts %} {{ super() }} {% endblock %}