{# The onboarding chat surface: every state — gate, choice, interview, review. Pushed verbatim by the SSE stream into #onboarding-surface, so it carries no sse-connect attributes (the wrapper owns the connection). #} {# The transcript: the conversation log. Choice answers carry kind="choice" — they render as the clicked button / filled widget, not as a chat bubble — while typed messages and agent turns always show. #} {% macro transcript(state) %}
{% for m in state.messages %}{% if m.role != "system" and not (m.role == "user" and m.kind == "choice") %} {% if m.role == "note" %}
{{ m.content }}
{% else %}
{{ m.content }}
{% endif %} {% endif %}{% endfor %}
{% endmacro %} {# The typed widget for a question's "something else" answer, shaped by free_text_kind (None | "date" | "number" | "password" | "multiline"). `value` prefills the field — the chip editor reuses the widget to show the resume's extracted value for editing. #} {% macro free_text_widget(question, value="") %} {% if question.free_text_kind == "multiline" %} {% elif question.free_text_kind == "number" %} {% elif question.free_text_kind == "date" %} {% elif question.free_text_kind == "password" %} {% else %} {% endif %} {% endmacro %} {# The resume's answers, shown as editable chips beside the question card. Each chip opens into its own editor: choice questions get the same select the review form uses (an off-list extraction renders as its own selected option, so saving keeps it), free-text questions reuse the typed widget prefilled with the extracted value — and Clear removes the resume's value entirely. What the user saves or types is a recorded answer, which always beats the extraction. #} {% macro prefill_chips(prefilled_answers) %} {% if prefilled_answers %}

From your resume

The agent read these from your resume. Open one to change or clear it — what you pick or type always wins.

{% for row in prefilled_answers %} {% set spec = row.spec %}
{{ spec.prompt }} {{ row.value }}
{% if spec.choices %} {% else %} {{ free_text_widget(spec, row.value) }} {% endif %}
{% endfor %}
{% endif %} {% endmacro %} {# The typed-answer form. Questions WITH choices keep the box collapsed behind "Something else…" (buttons first, typing second); free-text-only questions render it directly — typing is the answer. #} {% macro free_text_form(question) %}
{{ free_text_widget(question) }}
{% endmacro %} {# Headless sign-in path: the spawned CLI printed its OAuth URL, so it is offered as a plain link (the portal has no browser of its own). #} {% macro signin_link(url) %} {% if url %}

No browser window opened? Open {{ url }} — this page updates when you're done.

{% endif %} {% endmacro %} {# The start-choice cards: sign-in wait, claude start, provider fallback, or the agent-account prompt. Shared by the no-state gate surface and the intake screen (which keeps them below the resume upload as the skip path), so the backend choice logic lives in exactly one place. #} {% macro start_choices(ready, login_url, login_started) %} {% set card_link = none if login_started else login_url %} Opening the interview — with a resume saved, the agent reads it first; this can take a moment. {% if login_started and ready.claude and ready.claude.state == "signed_out" %}

Waiting for you to finish the Claude sign-in… This page updates automatically once you're signed in.

{{ signin_link(login_url) }}
{% endif %} {% if ready.can_start_claude %}

Interview agent ready

The interview runs on your signed-in Claude account — no API key needed.

{% elif ready.can_start_llm %}

Choose how the interview runs

Claude Code isn't signed in yet, but a provider is configured on the Settings page. Signing in gives the no-API-key experience; the provider works right now.

{{ signin_link(card_link) }}
{% else %}

Agent account needed

Claude Code is installed but not signed in. Click Sign in — a browser window will open for the normal Claude sign-in, and this page picks it up automatically.

Use my AI provider instead
{{ signin_link(card_link) }}
{% endif %} {% endmacro %} {# Versioned shell: every push of this partial carries the state sequence it was rendered from. The wrapper's SSE guard (onboarding_surface.html) drops pushes older than what the DOM already shows — a push rendered mid-POST can otherwise arrive after the POST's own fresher swap and replace new content with stale, freezing the flow mid-question. #}
{% if error %}

{{ error }}

{% endif %} {% if login_error %}

{{ login_error }}

{% endif %}
  1. Agent account
  2. Interview
  3. Review profile
  4. Find jobs
{% if state is none %} {# ---- No interview yet: gate or choice ---- #} {# The button becomes a waiting state while a sign-in is in flight; the SSE channel (already polling claude_status in its signature) flips this surface to the ready card the moment the sign-in completes. #} {{ start_choices(ready, login_url, login_started) }} {% elif state.phase == "intake" %} {# ---- Intake: resume upload before any question (resume-first) ---- #}

Start with your resume

Upload or paste your resume first — the interview reads it and asks only what it can't already see. Work-authorization questions are always asked directly, never inferred from a document.

{% if state.messages %}

✓ {{ state.messages[-1].content }}

{% endif %}
Reading your resume — this page updates when it's saved, and the interview reads it before asking anything.

In a hurry? Skip the resume — starting without one just means answering every question yourself, one at a time.

{# Starting the interview is the skip path (no resume) and the transition out of intake once one is saved — the backend-choice cards stay below. #} {{ start_choices(ready, login_url, login_started) }} {% elif state.phase == "interview" %} {# ---- Interview: the active question (or agent-led chat) + transcript ---- #}
{{ transcript(state) }} {% if question %} {# Guided mode: the portal owns the order — one question at a time. A pick posts its value; "Something else…" reveals the typed widget when the question allows free text; both land in the transcript as the user's turn. #}

{{ state.answers | length }} answered — skipping is fine, review lists anything empty.

{% if remaining_gaps | length > 1 %} {# The open agenda, in the review surface's chip pattern: what's still ahead, with this question marked. #}
{% for spec in remaining_gaps %} {{ spec.prompt }} {% endfor %}
{% endif %}

{{ question.prompt }}

{% if question_hint %}

{{ question_hint }}

{% endif %} {% if question.choices %}
{% for c in question.choices %}
{% endfor %}
{% endif %} {% if question.allow_free_text %} {% if question.choices %}
Something else… {{ free_text_form(question) }}
{% else %} {{ free_text_form(question) }} {% endif %} {% endif %}
Ask the agent — {{ question.agent_hint }}
{% else %} {# Agent-led mode: today's free-form interview, unchanged #}
{% endif %} The agent is thinking… {{ prefill_chips(prefilled_answers) }}
Attach a resume (txt/md/pdf file or paste — we read PDFs for you)
{% elif state.phase == "review" %} {# ---- Review: the chat stays visible, the profile preview below ---- #}
{{ transcript(state) }}

Review your profile

Change anything below, then confirm. Empty fields stay empty — nothing is filled in for you.

{% set needs = review_fields | selectattr("needs_answer") | list %} {% if needs %}
{% for row in needs %} {{ row.spec.prompt }} {% endfor %}
{% endif %}
{% for row in review_fields %} {% set spec = row.spec %}
{% if spec.choices %} {% elif spec.free_text_kind == "multiline" %} {% elif spec.free_text_kind == "number" %} {% elif spec.free_text_kind == "date" %} {% else %} {% endif %}
{% endfor %}
{% else %} {# ---- Done ---- #}

Profile saved ✓

Your profile and search setup are saved. From here the jobs board is the front page; run discovery whenever you like.

Go to the jobs board

Discovery runs in the background — progress streams on the Runs page, and results land on the jobs board.

{% endif %}