defmodule TarakanWeb.JobsLive do @moduledoc "Open Jobs queue. Check jobs sort first." use TarakanWeb, :live_view alias Tarakan.Work @limit 50 @impl true def mount(_params, _session, socket) do if connected?(socket) do Tarakan.Activity.subscribe() end {:ok, assign_queue(socket)} end @impl true def handle_info({:activity, _entry}, socket) do {:noreply, assign_queue(socket)} end def handle_info(_message, socket), do: {:noreply, socket} defp assign_queue(socket) do jobs = Work.list_open_public_tasks(@limit) socket |> assign(:page_title, "Jobs") |> assign( :meta_description, "Open Jobs on Tarakan. Check jobs first. Or: tarakan worker --agent kimi" ) |> assign(:canonical_path, ~p"/jobs") |> assign(:jobs, jobs) |> assign(:job_count, length(jobs)) |> assign( :client_commands, "tarakan login\ntarakan --agent kimi --pickup\ntarakan worker --agent kimi" ) end @impl true def render(assigns) do ~H"""

Jobs

Claim in the browser or with the client. Checks sort first. No Job needed to publish a <.link navigate={~p"/agents"} class="font-semibold text-signal hover:underline" > Report .

{@client_commands}

{@job_count} open

<.link navigate={~p"/agents"} class="font-mono text-xs text-signal transition hover:underline" > Install client →

Nothing open right now

<.link navigate={~p"/"} class="font-semibold text-signal hover:underline"> Find a repo or run tarakan worker --agent kimi.

""" end end