oficina / equipo Public

Clone
git clone https://amadan.net/oficina/equipo

Plain git — no account needed to clone.

Download

Download this file

1{{define "up-label"}}{{copy "nav.work"}}{{end}}
2{{define "title"}}{{if .Chat.Job}}{{copy "jobs.title"}}{{else}}{{copy "conversation.title"}}{{end}}{{end}}
3{{define "card-job"}}{{with .Job}}<input type="hidden" name="from" value="job"><input type="hidden" name="job" value="{{.}}">{{end}}{{end}}
4{{define "chat-card"}}<li equipo-card="{{.Kind}}"{{if .Receipt}} equipo-receipt{{end}} id="card-{{.ID}}" data-card="{{.ID}}" data-state="{{.State}}" data-turn-id="{{.TurnID}}">
5{{template "roster-byline" .}}{{if .SetAside}}<section equipo-aside-stub><span data-aside-title title="{{.AsideTitle}}">{{.AsideTitle}}</span><small>{{copy "roster.aside"}}</small>{{template "roster-undo" .}}</section>{{else}}<section equipo-roster-card{{if .Interactive}} data-ask{{end}}{{if .Receipt}} data-flat{{end}}{{if or (and (not .Open) .Note (not .Presentation.Thread)) .Presentation.Coverage.Skipped}} data-done{{end}}>
6{{if .Interactive}}<form method="post" action="/conversation/cards/{{.ID}}/visibility" data-card-form equipo-set-aside><input type="hidden" name="revision" value="{{.Revision}}"><input type="hidden" name="aside" value="true">{{template "card-job" .}}<button type="submit" data-set-aside aria-label="{{copy "roster.set_aside"}}" title="{{copy "roster.set_aside"}}" data-busy-label="{{copy "roster.setting_aside"}}">{{icon "x"}}</button></form>{{end}}
7{{with .ContextTask}}<p equipo-roster-task>{{.}}</p>{{end}}{{if .Presentation.Coverage.Skipped}}<p equipo-card-done role="status">{{icon "check"}}{{copy "roster.copy_done"}}</p>{{else if and (not .Open) .Note (ne .Kind "direction")}}<p equipo-card-done role="status">{{icon "check"}}{{.Note}}</p>{{else if and .Task (or .Task.CopyHold .Task.CopyCanSkip)}}{{template "roster-copy-hold" .}}<div equipo-roster-links><button type="button" rst-btn data-report-talk aria-controls="report-thread-{{.ID}}" aria-expanded="{{if .Presentation.Thread}}true{{else}}false{{end}}">{{copy "roster.talk"}}</button></div>{{template "report-thread" .ReportThread}}{{else if and .Receipt (eq .Kind "task")}}{{template "work-task-receipt" .}}
8{{else if eq .Kind "advice"}}{{if ne .State "resolved"}}<p equipo-card-line data-advice-card>{{icon "lightbulb"}}<span>{{.Line}}</span></p>{{if .Open}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form equipo-actions><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}<button rst-btn="primary" name="choice" value="act" type="submit" data-advice-choice="act">{{.ActLabel}}</button><button rst-btn name="choice" value="dismiss" type="submit" data-advice-choice="dismiss">{{.DismissLabel}}</button></form>{{else}}{{with .Note}}<p equipo-card-note>{{.}}</p>{{end}}{{end}}{{end}}
9{{else if eq .Kind "housekeeping"}}<p equipo-card-line data-digest>{{icon "list-checks"}}<span>{{.Line}} <a href="/housekeeping" data-digest-link>{{copy "chat.housekeeping.link"}}</a></span></p>
10{{else if .Receipt}}<p equipo-card-line>{{icon "folder"}}<span>{{.Line}}</span></p>{{if .Open}}<button type="button" equipo-receipt-more aria-expanded="false" aria-controls="acts-{{.ID}}" aria-label="{{copy "chat.card.more"}}">⋯</button><span equipo-receipt-actions id="acts-{{.ID}}">{{if or (eq .Kind "home") (eq .Kind "combined")}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}<button equipo-link name="choice" value="undo" type="submit" data-card-undo>{{copy "chat.card.undo"}}</button></form>{{else}}<details equipo-change><summary equipo-link>{{.Change}}</summary><form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}<select rst-input name="choice" aria-label="{{.Change}}">{{range .Choices}}<option>{{.}}</option>{{end}}</select><button rst-btn="primary" type="submit">{{copy "chat.card.use"}}</button></form></details>{{if .Remove}}<form method="post" action="/conversation/projects/{{.ProjectID}}/remove" data-card-form><button equipo-link type="submit">{{copy "chat.card.remove"}}</button></form>{{end}}{{end}}</span>{{end}}
11{{else if eq .Kind "question"}}<div equipo-subchat data-question-thread data-roster-turn="{{.Presentation.TurnID}}">
12<div equipo-thread-list role="log" aria-live="polite"><div equipo-thread-turn data-first><span equipo-thread-avatar>{{if eq .AuthorIcon "sparkles"}}{{template "roster-mark" .}}{{else}}{{icon .AuthorIcon}}{{end}}</span><div equipo-thread-bubble><div equipo-thread-who>{{.Author}}</div><div equipo-thread-text>{{.Line}}</div></div></div>{{template "roster-thread-turns" .}}</div>
13{{if .Open}}{{if .Options}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form equipo-actions><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}{{template "project-name-confirm" .}}{{range .Options}}<button rst-btn name="choice" value="{{.}}" type="submit">{{.}}</button>{{end}}</form>{{else}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form equipo-mini-composer><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}{{template "project-name-confirm" .}}<div equipo-mini-pill><textarea name="choice" required maxlength="2000" rows="1" aria-label="{{copy "chat.card.answer"}}" placeholder="{{copy "chat.card.answer"}}"></textarea><button type="submit" data-thread-send aria-label="{{copy "conversation.send_short"}}" data-busy-label="{{copy "roster.sending"}}">{{icon "arrow-up"}}</button></div></form>{{end}}{{else if not .Presentation.Waiting}}<form method="post" action="/conversation/cards/{{.ID}}/reply" data-card-form equipo-mini-composer><input type="hidden" name="request_id" value="{{.ReplyKey}}">{{template "card-job" .}}<div equipo-mini-pill><textarea name="body" required maxlength="2000" rows="1" aria-label="{{copy "roster.reply"}}" placeholder="{{copy "roster.reply"}}"></textarea><button type="submit" data-thread-send aria-label="{{copy "conversation.send_short"}}" data-busy-label="{{copy "roster.sending"}}">{{icon "arrow-up"}}</button></div></form>{{end}}</div>
14{{else if eq .Kind "home"}}<p equipo-card-line>{{icon "folder"}}<span>{{.Line}}</span></p><form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form equipo-actions><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}<button rst-btn="primary" name="choice" value="confirm" type="submit">{{copy "chat.card.confirm"}}</button></form>
15{{else if eq .Kind "direction"}}<p equipo-card-line>{{.Line}}</p>{{template "design-gallery" .Gallery}}{{if .Open}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form equipo-actions><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}{{template "project-name-confirm" .}}{{range .Options}}{{if eq . "again"}}<button type="button" rst-btn data-thread-open>{{copy "chat.card.again"}}</button>{{else if and (eq . "build") $.BuildNote}}{{else}}<button rst-btn="{{if eq . "build"}}primary{{end}}" name="choice" value="{{.}}" type="submit" data-direction-choice="{{.}}"{{if eq . "build"}} data-busy-label="{{copy "roster.building"}}"{{end}}>{{copy (printf "chat.card.%s" .)}}</button>{{end}}{{end}}</form>{{if .BuildNote}}<details equipo-subchat data-direction-build><summary equipo-thread-open>{{copy "chat.card.build"}}</summary><form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form equipo-mini-composer><input type="hidden" name="revision" value="{{.Revision}}"><input type="hidden" name="choice" value="build">{{template "card-job" .}}<div equipo-mini-pill><textarea name="note" required maxlength="1000" rows="1" aria-label="{{copy "chat.card.build_note"}}" placeholder="{{copy "chat.card.build_note"}}"></textarea><button type="submit" data-thread-send data-direction-choice="build" aria-label="{{copy "chat.card.build"}}" data-busy-label="{{copy "roster.building"}}">{{icon "arrow-up"}}</button></div></form></details>{{end}}<details equipo-subchat data-direction-thread><summary equipo-thread-open>{{copy "chat.card.again"}}</summary><div equipo-thread-list role="log" aria-live="polite"><div equipo-thread-turn><span equipo-thread-avatar>{{icon .AuthorIcon}}</span><div equipo-thread-bubble><div equipo-thread-who>{{.Author}}</div><div equipo-thread-text>{{copy "roster.change"}}</div></div></div></div><form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form equipo-mini-composer><input type="hidden" name="revision" value="{{.Revision}}"><input type="hidden" name="choice" value="again">{{template "card-job" .}}<div equipo-mini-pill><textarea name="note" required maxlength="1000" rows="1" aria-label="{{copy "roster.reply"}}" placeholder="{{copy "roster.reply"}}"></textarea><button type="submit" data-thread-send data-direction-choice="again" aria-label="{{copy "conversation.send_short"}}" data-busy-label="{{copy "roster.sending"}}">{{icon "arrow-up"}}</button></div></form></details>{{else}}{{with .Note}}<p equipo-card-done role="status">{{.}}</p>{{end}}{{if .Presentation.Thread}}<div equipo-subchat data-roster-step="{{.Presentation.StepID}}"><div equipo-thread-list role="log" aria-live="polite">{{template "roster-thread-turns" .}}</div></div>{{end}}{{end}}
16{{else if eq .Kind "specialist"}}<p equipo-card-line>{{.Line}}</p>{{with .Specialist}}{{range .Capabilities}}<p equipo-card-note data-capability="{{.ID}}">{{.Words}}</p>{{end}}<p equipo-card-note data-specialist-brief>{{printf (copy "chat.card.specialist_brief") .Brief}}</p>{{end}}{{if .Open}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form equipo-actions><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}{{template "project-name-confirm" .}}{{range .Options}}<button rst-btn="{{if eq . "add"}}primary{{end}}" name="choice" value="{{.}}" type="submit" data-specialist-choice="{{.}}">{{copy (printf "chat.card.%s" .)}}</button>{{end}}</form>{{else}}{{with .Note}}<p equipo-card-note>{{.}}</p>{{end}}{{end}}
17{{else if eq .Kind "research_sources"}}<p equipo-card-line>{{.Line}}</p>{{with .Name}}<p equipo-card-note data-research-task>{{printf (copy "chat.card.research_for") .}}</p>{{end}}{{with .Research}}<p equipo-card-note data-research-question>{{printf (copy "chat.card.research_looks_for") .Question}}</p><ul equipo-card-list data-research-urls>{{range .URLs}}<li><code>{{.}}</code></li>{{end}}</ul>{{end}}{{if .Open}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form equipo-actions><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}{{template "project-name-confirm" .}}{{range .Options}}<button rst-btn="{{if eq . "allow"}}primary{{end}}" name="choice" value="{{.}}" type="submit" data-research-choice="{{.}}">{{copy (printf "chat.card.%s" .)}}</button>{{end}}</form>{{else}}{{with .Note}}<p equipo-card-note>{{.}}</p>{{end}}{{end}}
18{{else if eq .Kind "instance_inventory"}}<p equipo-card-line>{{.Line}}</p>{{with .Inventory}}<ul equipo-card-list data-instance-addresses>{{range .Addresses}}<li><code>{{.}}</code></li>{{end}}</ul>{{end}}{{if .Open}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form equipo-actions><input type="hidden" name="revision" value="{{.Revision}}"><button rst-btn="primary" name="choice" value="confirm" type="submit" data-instance-confirm>{{copy "services.inventory.confirm"}}</button></form>{{end}}{{else if eq .Kind "research_inventory"}}<p equipo-card-line>{{.Line}}</p>{{with .Inventory}}<ul equipo-card-list data-research-addresses>{{range .Addresses}}<li><code>{{.}}</code></li>{{end}}</ul>{{end}}{{if .Open}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form equipo-actions><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}<button rst-btn="primary" name="choice" value="confirm" type="submit" data-inventory-confirm>{{copy "chat.card.inventory_confirm"}}</button></form>{{else}}{{with .Note}}<p equipo-card-note>{{.}}</p>{{end}}{{end}}
19{{else if eq .Kind "place"}}<p equipo-card-line>{{.Line}}</p>{{if .Open}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form equipo-actions><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}{{range $i, $c := .PlaceChoices}}<button rst-btn="{{if eq $i 0}}primary{{end}}" name="choice" value="{{$c.ID}}" type="submit" data-place-choice="{{$c.ID}}">{{$c.Label}}</button>{{end}}<button rst-btn name="choice" value="not_now" type="submit" data-place-choice="not_now">{{copy "chat.card.not_now"}}</button></form>{{else}}{{with .Note}}<p equipo-card-note>{{.}}</p>{{end}}{{end}}{{else if eq .Kind "publish"}}<p equipo-card-line>{{.Line}}</p>{{with .Site}}{{if .URL}}<p equipo-card-note><a href="{{.URL}}" rel="noopener" target="_blank" data-site-link>{{copy "chat.card.site_link"}}</a></p>{{end}}{{end}}{{if .Open}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form equipo-actions><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}{{template "project-name-confirm" .}}{{range .Options}}<button rst-btn="{{if eq . "publish"}}primary{{end}}" name="choice" value="{{.}}" type="submit" data-publish-choice="{{.}}">{{copy (printf "chat.card.%s" .)}}</button>{{end}}</form>{{else}}{{with .Note}}<p equipo-card-note>{{.}}</p>{{end}}{{end}}
20{{else if eq .Kind "maker_removed"}}<p equipo-card-line>{{.Line}}</p>{{if .Open}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form equipo-actions><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}{{range .Options}}<button rst-btn="primary" name="choice" value="{{.}}" type="submit" data-maker-choice="{{.}}">{{copy (printf "chat.card.%s" .)}}</button>{{end}}</form>{{else}}{{with .Note}}<p equipo-card-note>{{.}}</p>{{end}}{{end}}{{else if eq .Kind "merge"}}<p equipo-card-line>{{.Line}}</p>{{with .PreviewURL}}<p equipo-card-note><a href="{{.}}" rel="noopener" target="_blank" data-preview-link>{{copy "chat.card.preview_link"}}</a></p>{{end}}{{if .Open}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form equipo-actions><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}{{template "project-name-confirm" .}}{{range .Options}}<button rst-btn="{{if eq . "merge"}}primary{{end}}" name="choice" value="{{.}}" type="submit" data-merge-choice="{{.}}">{{copy (printf "chat.card.%s" .)}}</button>{{end}}</form>{{else}}{{with .Note}}<p equipo-card-note>{{.}}</p>{{end}}{{end}}
21{{else if or (eq .Kind "merge_ships") (eq .Kind "merge_policy") (eq .Kind "merge_receipt")}}{{if eq .Kind "merge_receipt"}}<div equipo-card-line equipo-markdown data-merge-receipt>{{chatMarkdown .Line}}</div>{{else}}<p equipo-card-line>{{.Line}}</p>{{end}}{{if .Open}}<form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form equipo-actions><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}{{template "project-name-confirm" .}}{{range .Options}}<button rst-btn="{{if or (eq . "save") (eq . "not_ships")}}primary{{end}}" name="choice" value="{{.}}" type="submit" data-merge-choice="{{.}}">{{copy (printf "chat.card.%s" .)}}</button>{{end}}</form>{{else}}{{with .Note}}<p equipo-card-note>{{.}}</p>{{end}}{{end}}
22{{else if .Access}}{{template "access-card" .}}
23{{else if eq .Kind "access"}}<p equipo-card-line>{{.Line}}</p>{{if .Open}}<details equipo-grant><summary rst-btn>{{copy "chat.card.grant"}}</summary><p>{{.GrantHow}}</p><code>amadan agent grant {{.Agent}} {{.Namespace}}</code><form method="post" action="/conversation/cards/{{.ID}}/answer" data-card-form><input type="hidden" name="revision" value="{{.Revision}}">{{template "card-job" .}}<button rst-btn name="choice" value="check" type="submit" data-grant-check>{{copy "chat.card.grant_check"}}</button></form></details>{{end}}
24{{end}}<p equipo-card-error role="alert" hidden></p></section>{{end}}{{if .Presentation.Coverage.Skipped}}<section equipo-roster-card data-flat>{{template "work-task-receipt" .}}</section>{{end}}{{if not .SetAside}}{{range .ResearchReports}}<div equipo-roster-byline><span equipo-roster-avatar>{{icon "search"}}</span><b>{{copy "work.specialist.research"}}</b><span>{{copy "roster.reports"}}</span>{{template "roster-project" $}}{{with .At}}<time datetime="{{.Format "2006-01-02T15:04:05Z07:00"}}">{{.Format "15:04"}}</time>{{end}}</div><section equipo-roster-card data-research-report><header equipo-roster-research-head><h3>{{copy "roster.research"}}</h3>{{with $.Presentation.Context.TaskTitle}}<span equipo-roster-task>{{.}}</span>{{end}}</header><p>{{.Summary}}</p><ol equipo-roster-findings>{{range .Facts}}<li><div><strong>{{.Label}}</strong> {{.Value}}</div>{{range .Sources}}{{if .URL}}<a href="{{.URL}}" title="{{.URL}}" target="_blank" rel="noopener"><span>{{.Domain}}</span></a>{{else}}<span>{{.ID}}</span>{{end}}{{end}}</li>{{end}}{{range .Gaps}}<li data-gap>{{.}}</li>{{end}}</ol><div equipo-roster-links><button type="button" rst-btn data-report-talk aria-controls="report-thread-{{$.ID}}" aria-expanded="{{if $.Presentation.Thread}}true{{else}}false{{end}}">{{copy "roster.talk"}}</button><a href="/tasks/{{$.TaskID}}#research-{{.StepID}}">{{copy "roster.research_log"}} ({{len .Fetches}})</a></div></section>{{end}}{{end}}
25</li>{{end}}
26{{define "roster-copy-hold"}}<div equipo-copy-hold><span equipo-roster-stage>{{copy "roster.copy_waiting"}}</span><h3>{{.Line}}</h3><p>{{.HoldReason}}</p>{{with .Presentation.Coverage}}<div equipo-copy-meter>{{if .Known}}{{if .Total}}<meter min="0" max="{{.Total}}" value="{{.Reviewed}}" aria-label="{{printf (copy "roster.copy_count") .Reviewed .Total}}"></meter>{{end}}<span>{{printf (copy "roster.copy_count") .Reviewed .Total}}</span>{{else}}<span>{{copy "roster.copy_coverage"}}</span>{{end}}{{with .Since}}<small>{{printf (copy "roster.copy_since") (.Format "15:04")}}</small>{{end}}</div>{{end}}<div equipo-actions><a rst-btn="primary" href="/conversation?about={{.TaskID}}">{{copy "work.decide.ask_coordinator"}}</a>{{if .Task.CopyCanSkip}}<form method="post" action="/conversation/tasks/{{.TaskID}}/continue-without-copy" data-card-form><button rst-btn type="submit" data-copy-continue>{{copy "copy.continue"}}</button></form>{{end}}</div></div>{{end}}
27{{define "roster-thread-turns"}}{{range .Presentation.Thread}}<div equipo-thread-turn{{if .Own}} data-own{{end}}>{{if not .Own}}<span equipo-thread-avatar{{if eq $.AuthorIcon "sparkles"}} equipo-coordinator-mark{{end}}>{{if eq $.AuthorIcon "sparkles"}}{{template "roster-mark" .}}{{else}}{{icon $.AuthorIcon}}{{end}}</span>{{end}}<div equipo-thread-bubble>{{if not .Own}}<div equipo-thread-who>{{$.Author}} <time datetime="{{.At.Format "2006-01-02T15:04:05Z07:00"}}">{{.At.Format "15:04"}}</time></div>{{end}}<div equipo-thread-text equipo-markdown>{{chatMarkdown .Text}}</div></div>{{if .Own}}<small equipo-thread-sent>{{copy "roster.sent"}}</small>{{end}}</div>{{end}}{{with .ThreadError}}<p equipo-thread-error role="alert">{{.}}</p>{{end}}{{if .Presentation.Waiting}}<div equipo-thread-wait role="status"><span equipo-reading-dots aria-hidden="true"><i></i><i></i><i></i></span><span>{{if .ThreadActivity}}{{.ThreadActivity}}{{else}}{{printf (copy "roster.waiting") .Author}}{{end}}</span><div equipo-thread-draft></div></div>{{end}}{{end}}
28{{define "roster-undo"}}<form method="post" action="/conversation/cards/{{.ID}}/visibility" data-card-form><input type="hidden" name="revision" value="{{.Revision}}"><input type="hidden" name="aside" value="false">{{template "card-job" .}}<button equipo-link type="submit" data-aside-undo data-busy-label="{{copy "roster.restoring"}}">{{copy "roster.undo"}}</button></form>{{end}}
29{{define "roster-byline"}}<div equipo-roster-byline><span equipo-roster-avatar{{if eq .AuthorIcon "sparkles"}} equipo-coordinator-mark{{end}}>{{if eq .AuthorIcon "sparkles"}}{{template "roster-mark" .}}{{else}}{{icon .AuthorIcon}}{{end}}</span>{{if eq .AuthorIcon "sparkles"}}<span equipo-visually-hidden>{{.Author}} {{.Verb}}</span>{{else}}<span equipo-roster-author><b>{{.Author}}</b> <span>{{.Verb}}</span></span>{{end}}{{template "roster-project" .}}<time datetime="{{.BylineAt.Format "2006-01-02T15:04:05Z07:00"}}">{{.BylineAt.Format "15:04"}}</time></div>{{end}}
30{{define "roster-project"}}{{if and .TaskID .Presentation.Context.ProjectTitle}}{{if .Task}}{{template "placement-chip" .Task}}{{else}}{{template "placement-chip" (dict "ID" .TaskID "Project" .Presentation.Context.ProjectTitle "Mono" .ProjectMono)}}{{end}}{{else if .Presentation.Context.ProjectTitle}}<span equipo-roster-project><span aria-hidden="true">·</span>{{if not .ProjectMono.InTitle}}{{template "mono-s" .ProjectMono}}{{end}}<span equipo-project-name title="{{.Presentation.Context.ProjectTitle}}">{{.Presentation.Context.ProjectTitle}}</span></span>{{end}}{{end}}
31{{/* The empty conversation: a quiet drawing (your message on the right, the
32 coordinator's reply on the left with its mark), one short line and three starters. A starter fills the
33 composer with its opening words and never sends; without script it is
34 a GET that opens the conversation with those words in the composer. */}}
35{{define "chat-welcome"}}<li equipo-welcome data-empty-state="conversation.empty">{{template "welcome-art"}}<h2 equipo-welcome-title>{{copy "conversation.empty"}}</h2>{{if not .Chat.Job}}<form equipo-starters method="get" action="/conversation" aria-label="{{copy "conversation.start.label"}}">{{template "starter" "bug"}}{{template "starter" "feature"}}{{template "starter" "project"}}</form>{{end}}</li>{{end}}
36{{define "starter"}}<button type="submit" rst-btn name="start" value="{{.}}" data-draft="{{copy (printf "conversation.start.%s_draft" .)}}">{{if eq . "bug"}}{{icon "wrench"}}{{else if eq . "feature"}}{{icon "lightbulb"}}{{else}}{{icon "folder"}}{{end}}<span>{{copy (printf "conversation.start.%s" .)}}</span></button>{{end}}
37{{define "welcome-art"}}<svg equipo-welcome-art viewBox="0 0 112 70" aria-hidden="true" focusable="false"><rect data-part="own" x="40" y="4" width="68" height="28" rx="14"/><path data-part="words" d="M53 14h42M53 22h20"/><path data-part="caret" d="M78 17.5v9"/><path data-part="mark" d="M12 44c1 5.2 2.8 7 8 8-5.2 1-7 2.8-8 8-1-5.2-2.8-7-8-8 5.2-1 7-2.8 8-8Z"/><rect data-part="reply" x="26" y="38" width="44" height="28" rx="14"/><g data-part="dots"><circle cx="38" cy="52" r="2.2"/><circle cx="48" cy="52" r="2.2"/><circle cx="58" cy="52" r="2.2"/></g></svg>{{end}}
38{{define "roster-mark"}}<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 3c1.1 5.8 3.2 7.9 9 9-5.8 1.1-7.9 3.2-9 9-1.1-5.8-3.2-7.9-9-9 5.8-1.1 7.9-3.2 9-9Z"/></svg>{{end}}
39{{define "work-task-receipt"}}{{$card := .}}{{with .Task}}<div equipo-roster-report{{if $card.SlimReport}} data-slim{{end}}{{if $card.Compact}} data-compact{{end}}>
40<div equipo-roster-report-head>{{with .Eyebrow}}<span equipo-roster-stage equipo-stage data-stage="{{$card.Task.Stage}}" data-tone="{{$card.Task.RosterTone}}">{{.}}</span>{{end}}{{if .NeedsYou}}<span equipo-needs-chip>{{icon "hand"}}{{copy "nav.needs-you"}}</span>{{end}}<h3 equipo-card-line><a href="/tasks/{{.ID}}">{{.Title}}</a></h3>{{if not $card.Compact}}{{with .Why}}<p equipo-roster-why>{{.}}</p>{{end}}{{end}}</div>
41{{if not $card.Compact}}{{template "pause" (dict "Task" . "From" "conversation" "Job" $card.Job)}}{{if and (ne .Stage "cancelled") (not $card.SlimReport)}}{{template "track-full" .}}{{end}}{{with $card.ExplorationSummary}}<p equipo-exploration-summary>{{.}}</p>{{end}}
42<dl equipo-roster-facts>{{if .ChecksLine}}<div><dt>{{copy "roster.checks"}}</dt><dd data-checks>{{.RosterChecks}}</dd>{{with .RosterChecksDetail}}<small>{{.}}</small>{{end}}</div>{{end}}{{if .ReviewLine}}<div><dt>{{copy "roster.review"}}</dt><dd data-verdict>{{.RosterReview}}</dd>{{with .RosterReviewDetail}}<small>{{.}}</small>{{end}}</div>{{end}}{{if .Branch}}<div><dt>{{copy "roster.branch"}}</dt><dd><code title="{{.Branch}}">{{.Branch}}</code></dd><small title="{{.CandidateSHA}}">{{short .CandidateSHA}}</small></div>{{end}}</dl>
43{{if .MergeDropped}}<p equipo-card-note>{{copy "work.tl.merge_dropped"}}</p>{{end}}{{end}}<div equipo-roster-links>{{if not $card.Compact}}{{with $card.ReportAction}}{{if .Post}}<form method="post" action="{{.Post}}" data-card-form>{{if not $card.Job}}<input type="hidden" name="from" value="conversation">{{end}}{{if .CardID}}<input type="hidden" name="revision" value="{{.Revision}}"><input type="hidden" name="choice" value="merge">{{end}}{{template "card-job" $card}}<button rst-btn="primary" type="submit" data-report-next data-success-state="{{if eq .Kind "round"}}in_progress{{else}}merging{{end}}" data-success-label="{{copy (printf "roster.%s_done" .Kind)}}" data-busy-label="{{copy (printf "roster.%s_busy" .Kind)}}">{{.Label}}</button></form>{{else}}<a rst-btn="primary" href="{{.Href}}" target="_blank" rel="noopener" data-report-next>{{.Label}}</a>{{end}}{{end}}{{end}}<button type="button" {{if $card.Compact}}equipo-link{{else}}rst-btn{{end}} data-report-talk aria-controls="report-thread-{{$card.ID}}" aria-expanded="{{if $card.Presentation.Thread}}true{{else}}false{{end}}">{{copy "roster.talk"}}</button>{{if not $card.Compact}}<a href="/tasks/{{.ID}}">{{copy "roster.open_task"}}</a>{{if and .Pushed (not .MergedLine)}}<a href="{{.URL}}" rel="noopener" target="_blank" data-open-amadan>{{copy "work.open"}}</a>{{end}}{{if .MergedLine}}<span data-merged><span>{{.MergedLine}}</span> <a href="{{.RepoURL}}" rel="noopener" target="_blank" data-open-amadan>{{copy "work.open"}}</a></span>{{end}}{{end}}</div>
44{{template "report-thread" $card.ReportThread}}
45</div>{{end}}{{end}}
46{{define "message-files"}}{{with .}}<div equipo-message-files>{{range .}}{{if eq .Kind "image"}}<a equipo-file-thumb href="/conversation/attachments/{{.ID}}" target="_blank" rel="noopener" data-attachment="{{.ID}}"><img src="/conversation/attachments/{{.ID}}/preview" alt="{{.Name}}"{{if .Width}} width="{{.Width}}" height="{{.Height}}"{{end}} loading="lazy" decoding="async"></a>{{else}}<a equipo-file-chip href="/conversation/attachments/{{.ID}}" target="_blank" rel="noopener" data-attachment="{{.ID}}">{{icon "file-text"}}<span equipo-file-name>{{.Name}}</span><span equipo-file-size>{{fileSize .Size}}</span></a>{{end}}{{end}}</div>{{end}}{{end}}
47{{define "chat-lines"}}{{$address := .Address}}{{range .Lines}}
48{{if .CardOnly}}{{range .Cards}}{{template "chat-card" .}}{{end}}{{else}}
49{{range .Receipts}}{{template "chat-card" .}}{{end}}
50<li equipo-message="{{if .Own}}own{{else}}incoming{{end}}" data-message="{{.ID}}" data-turn-id="{{.TurnID}}">
51<div equipo-message-meta><strong{{if .Own}} equipo-visually-hidden{{end}}>{{if .Own}}{{$address}}{{else}}<span equipo-coordinator-mark>{{template "roster-mark" .}}</span><span equipo-visually-hidden>{{copy "conversation.coordinator"}}</span>{{end}}</strong><time datetime="{{.CreatedAt.Format "2006-01-02T15:04:05Z07:00"}}">{{.CreatedAt.Format "15:04"}}</time></div>
52{{if .Own}}{{template "message-files" .Files}}{{end}}<div equipo-bubble>{{if .Own}}<p equipo-message-body>{{.Text}}</p>{{else}}<div equipo-message-body equipo-markdown>{{chatMarkdown .Text}}</div>{{end}}</div>
53{{with .Waiting}}<p equipo-card-note data-waiting-connection>{{.}}</p>{{end}}
54{{with .Queued}}<p equipo-card-note data-queued>{{.}}</p>{{end}}
55{{with .Switched}}<p equipo-card-note data-switched>{{.}}</p>{{end}}
56</li>
57{{range .Cards}}{{template "chat-card" .}}{{end}}{{end}}{{end}}{{end}}
58{{define "chat-day"}}<li equipo-rollup id="day-{{.Key}}" data-day="{{.Key}}"{{if .Expanded}} data-expanded{{end}}>
59<section equipo-day-box aria-labelledby="day-title-{{.Key}}">
60<header equipo-day-head><h2 id="day-title-{{.Key}}"><time datetime="{{.Key}}">{{.Label}}</time></h2><span equipo-day-count>{{.Messages}}</span></header>
61{{if not .Quiet}}<div equipo-daybar aria-hidden="true">{{range .Rows}}<i data-kind="{{.Key}}" data-w="{{.Width}}"></i>{{end}}</div><div equipo-day-legend>{{range .Rows}}<span data-kind="{{.Key}}"><b>{{.Count}}</b> {{.Label}}</span>{{end}}</div>{{end}}
62{{if .Quiet}}<p equipo-day-quiet>{{copy "chat.day.quiet"}}</p>{{else}}<dl equipo-day-rows>{{range .Rows}}{{template "day-row" .}}{{end}}</dl>{{end}}
63<a equipo-day-toggle href="{{.Toggle}}" data-day-toggle="{{.Key}}" aria-expanded="{{if .Expanded}}true{{else}}false{{end}}" aria-controls="day-feed-{{.Key}}"><span>{{if .Expanded}}{{copy "chat.day.hide"}}{{else}}{{copy "chat.day.show"}}{{end}}</span>{{icon "chevron-down"}}</a>
64</section>
65{{if .Expanded}}<ol equipo-feed equipo-day-feed id="day-feed-{{.Key}}" aria-labelledby="day-title-{{.Key}}">{{template "chat-lines" .Feed}}</ol>{{end}}
66</li>{{end}}
67{{define "day-row"}}<div equipo-day-row data-row="{{.Key}}"><dt>{{.Label}}</dt><dd{{if .Stack}} data-stack{{end}}>{{range $i, $it := .Items}}{{if and $i (not $.Stack)}}, {{end}}<span equipo-day-item>{{if .TaskID}}<a href="/tasks/{{.TaskID}}">{{.Text}}</a>{{else}}{{.Text}}{{end}}{{with .Note}}: <span equipo-day-decision>{{.}}</span>{{end}}</span>{{end}}{{with .More}} <span equipo-day-more>{{.}}</span>{{end}}</dd></div>{{end}}
68{{define "content"}}
69<div equipo-conversation{{if .Chat.Job}} data-job="{{.Chat.Job.ID}}"{{else}} data-chat-stream{{end}} data-card-failed="{{copy "roster.failed"}}" data-card-stale="{{copy "roster.stale"}}" data-card-busy="{{copy "roster.busy"}}" data-card-retry="{{copy "roster.retry"}}" data-aside-label="{{copy "roster.aside"}}" data-thinking-set="{{.ThinkingSet}}" data-thinking-words="{{.ThinkingWords}}" data-cursor="{{.Chat.Cursor}}" data-person="{{.Address}}" data-elapsed="{{copy "chat.elapsed"}}" data-moving-in="{{copy "chat.moving_in"}}" data-exploring="{{copy "chat.exploring"}}" data-queued-note="{{copy "chat.queued"}}">
70<header equipo-chat-header>{{with .Chat.Job}}<h1>{{.Label}}</h1><a href="/jobs" equipo-link data-jobs-all>{{copy "jobs.all"}}</a><a href="/conversation" equipo-link data-jobs-back>{{copy "jobs.back"}}</a>{{else}}<h1>{{copy "conversation.title"}}</h1>{{if .Rail.Needs.Known}}<a equipo-needs-pill href="/tasks?needs=you" aria-label="{{printf (copy "roster.needs") .Rail.Needs.N}}">{{icon "inbox"}}<span>{{.Rail.Needs.N}}</span></a>{{end}}{{if .Chat.FromBase}}<a href="/jobs" equipo-header-button aria-label="{{copy "jobs.title"}}" title="{{copy "jobs.title"}}" data-jobs-link>{{icon "inbox"}}</a>{{end}}<a href="/conversation/settings/notebook" equipo-header-button aria-label="{{copy "chat.notebook.link"}}" title="{{copy "chat.notebook.link"}}">{{icon "notebook"}}</a><a href="/housekeeping" equipo-header-button aria-label="{{copy "chat.housekeeping.link"}}" title="{{copy "chat.housekeeping.link"}}" data-housekeeping-link>{{icon "list-checks"}}</a><a href="/conversation/settings/connections" equipo-header-button aria-label="{{copy "chat.connections.title"}}" title="{{copy "chat.connections.title"}}" data-connections-link>{{icon "plug"}}</a>{{end}}</header>
71<p equipo-offline role="status"{{if not .Chat.Offline}} hidden{{end}}>{{copy "chat.offline"}}</p>
72<div equipo-scroll tabindex="0" role="region" aria-label="{{copy "conversation.title"}}">
73<section id="conversation-feed">
74<template equipo-message-template><li equipo-message="incoming" data-message=""><div equipo-message-meta><strong><span equipo-coordinator-mark>{{template "roster-mark" .}}</span><span equipo-visually-hidden>{{copy "conversation.coordinator"}}</span></strong><time></time></div><div equipo-bubble><div equipo-message-body equipo-chat-text></div></div></li></template>
75<template equipo-own-template><li equipo-message="own" data-message=""><div equipo-message-meta><strong equipo-visually-hidden>{{.Address}}</strong><time></time></div><div equipo-message-files hidden></div><div equipo-bubble><p equipo-message-body></p></div></li></template>
76<template equipo-file-template><a equipo-file-chip href="" target="_blank" rel="noopener" data-attachment="">{{icon "file-text"}}<span equipo-file-name></span><span equipo-file-size></span></a></template>
77<template equipo-chip-template><li equipo-chip data-state="uploading"><span equipo-chip-thumb>{{icon "file-text"}}</span><span equipo-chip-text><span equipo-chip-name></span><span equipo-chip-note></span></span><span equipo-chip-progress role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><i></i></span><button type="button" equipo-chip-remove>{{icon "x"}}</button></li></template>
78<template equipo-thinking-template><li equipo-message="incoming" equipo-thinking data-turn="" data-started="" aria-busy="true"><div equipo-message-meta><strong><span equipo-coordinator-mark>{{template "roster-mark" .}}</span><span equipo-visually-hidden>{{copy "conversation.coordinator"}}</span></strong><time></time></div><div equipo-bubble><div equipo-message-body equipo-markdown data-stream-text></div><p equipo-activity-line><span equipo-activity>{{copy "chat.activity.thinking"}}</span><span equipo-activity-sep aria-hidden="true">·</span><span equipo-elapsed></span></p><form method="post" data-card-form equipo-turn-stop hidden><button rst-btn data-quiet type="submit" data-turn-stop data-busy-label="{{copy "roster.stopping"}}">{{copy "roster.stop"}}</button></form></div></li></template>
79<template equipo-ended-template><li equipo-system-note data-ended=""><p></p></li></template>
80<ol equipo-feed>
81{{range .Chat.Days}}{{template "chat-day" .}}{{end}}
82{{if .Chat.Days}}<li equipo-day-divider data-today><span>{{copy "chat.day.today"}}</span></li>{{end}}
83{{if .Chat.HasOpen}}<li equipo-day-note data-still-open>{{copy "chat.day.still_open"}}</li>{{end}}
84{{template "chat-lines" (.Chat.Earlier .Address)}}
85{{template "chat-lines" (.Chat.Today .Address)}}
86{{if not (or .Chat.Days .Chat.Open .Chat.Messages)}}{{template "chat-welcome" .}}{{end}}
87{{range .Chat.Waiting}}<li equipo-message="incoming" equipo-thinking data-turn="{{.ID}}"{{with .Kind}} data-kind="{{.}}"{{end}} data-started="{{.CreatedAt.UnixMilli}}" aria-busy="true"><div equipo-message-meta><strong><span equipo-coordinator-mark>{{template "roster-mark" .}}</span><span equipo-visually-hidden>{{copy "conversation.coordinator"}}</span></strong><time></time></div><div equipo-bubble><div equipo-message-body equipo-markdown data-stream-text></div><p equipo-activity-line><span equipo-activity>{{if eq .Kind "move_in"}}{{copy "chat.moving_in"}}{{else if eq .Kind "explore"}}{{copy "chat.exploring"}}{{else}}{{copy "chat.activity.thinking"}}{{end}}</span><span equipo-activity-sep aria-hidden="true">·</span><span equipo-elapsed></span></p><form method="post" action="/conversation/turns/{{.ID}}/stop" data-card-form equipo-turn-stop>{{with $.Chat.Job}}<input type="hidden" name="from" value="job"><input type="hidden" name="job" value="{{.ID}}">{{end}}<button rst-btn data-quiet type="submit" data-turn-stop data-busy-label="{{copy "roster.stopping"}}">{{copy "roster.stop"}}</button></form></div></li>{{end}}
88{{with .Chat.NoConnection}}<li equipo-card="no_connection" data-no-connection="{{.TurnID}}"><p equipo-card-line>{{.Line}}</p><p equipo-actions><a rst-btn="primary" href="/conversation/settings/connections/add" data-add-connection>{{copy "chat.no_connection.add"}}</a></p></li>{{end}}
89{{with .Chat.Ended}}<li equipo-system-note data-ended="{{.ID}}"><p>{{.Line}}</p>{{if .Retry}}<form method="post" action="/conversation/turns/{{.ID}}/retry" data-card-form equipo-ended-action><button rst-btn type="submit" data-retry-turn>{{copy "chat.failed.retry"}}</button></form>{{else if .SignIn}}<a rst-btn href="{{.SignIn}}" equipo-ended-action data-sign-in-again>{{copy "chat.connections.sign_in_again_action"}}</a>{{end}}</li>{{end}}
90</ol>
91{{/* The bottom of the conversation: a card answered without script returns here (chatCardAnswer). */}}<span id="conversation-end"></span>
92</section>
93</div>
94<div equipo-announcements role="status" aria-live="polite" aria-atomic="false"></div>
95<div id="chat-composer">
96<div equipo-roster-toast role="status" hidden></div>
97{{with .Chat.Job}}<form id="composer" equipo-form equipo-composer method="post" action="/jobs/{{.ID}}/messages" data-job-composer>
98<input type="hidden" name="request_id" value="{{$.RequestID}}">
99<div equipo-pill>
100<div equipo-pill-row>
101<textarea id="chat-body" rst-input name="body" required maxlength="16384" rows="1" aria-label="{{copy "conversation.composer"}}" placeholder="{{copy "conversation.placeholder"}}"></textarea>
102<button type="submit" equipo-send aria-label="{{copy "conversation.send_short"}}" title="{{copy "conversation.send_short"}}">{{icon "arrow-up"}}</button>
103</div>
104</div>
105</form>{{else}}<form id="composer" equipo-form equipo-composer method="post" action="/conversation" data-failed="{{copy "chat.failed"}}" data-failed-many="{{copy "chat.failed_many"}}" data-failed-storage="{{copy "chat.failed_storage"}}" data-retry="{{copy "conversation.retry"}}" data-cancelled="{{copy "chat.cancelled"}}" data-upload="/conversation/attachments" data-max-files="5" data-max-bytes="10485760" data-too-large="{{copy "api.attachment_too_large"}}" data-heic="{{copy "api.attachment_heic"}}" data-too-many="{{copy "chat.attach.too_many"}}" data-upload-failed="{{copy "chat.attach.failed"}}" data-uploading="{{copy "chat.attach.uploading"}}" data-remove="{{copy "chat.attach.remove"}}">
106<input type="hidden" name="request_id" value="{{.RequestID}}">
107<div equipo-adder hidden><button type="button" equipo-plus aria-label="{{copy "chat.attach.add"}}" title="{{copy "chat.attach.add"}}" aria-haspopup="menu" aria-expanded="false" aria-controls="attach-menu">{{icon "plus"}}</button><div equipo-add-menu id="attach-menu" role="menu" aria-label="{{copy "chat.attach.add"}}" hidden><button type="button" role="menuitem" data-pick="image">{{icon "image"}}<span>{{copy "chat.attach.image"}}</span></button><button type="button" role="menuitem" data-pick="file">{{icon "file-text"}}<span>{{copy "chat.attach.file"}}</span></button></div><input type="file" data-picker="image" accept="image/*" multiple tabindex="-1" aria-hidden="true" equipo-visually-hidden><input type="file" data-picker="file" accept=".txt,.md,.markdown,.csv,.json,.log,.pdf,text/plain,text/markdown,text/csv,application/json,application/pdf" multiple tabindex="-1" aria-hidden="true" equipo-visually-hidden></div>
108<div equipo-pill>
109<ul equipo-chips aria-label="{{copy "chat.attach.list"}}" hidden></ul>
110<p equipo-add-note role="alert" hidden></p>
111<div equipo-pill-row>
112<textarea id="chat-body" rst-input name="body" required maxlength="16384" rows="1" aria-label="{{copy "conversation.composer"}}" placeholder="{{copy "conversation.placeholder"}}"{{if .Chat.Draft}} autofocus{{end}}>{{.Chat.Draft}}</textarea>
113<button type="submit" equipo-send aria-label="{{copy "conversation.send_short"}}" title="{{copy "conversation.send_short"}}">{{icon "arrow-up"}}</button>
114</div>
115</div>
116</form>{{end}}
117</div>
118</div>
119{{end}}
120
121{{define "report-thread"}}<details equipo-subchat data-report-thread id="report-thread-{{.ID}}" data-roster-turn="{{.Presentation.TurnID}}"{{if .Presentation.Thread}} open{{end}}><summary equipo-thread-open>{{copy "roster.talk"}}</summary><div equipo-thread-list role="log" aria-live="polite">{{template "roster-thread-turns" .}}</div>{{if not .Presentation.Waiting}}<form method="post" action="/conversation/cards/{{.ID}}/reply" data-card-form equipo-mini-composer><input type="hidden" name="request_id" value="{{.ReplyKey}}">{{template "card-job" .}}<div equipo-mini-pill><textarea name="body" required maxlength="2000" rows="1" aria-label="{{copy "roster.reply"}}" placeholder="{{copy "roster.reply"}}"></textarea><button type="submit" data-thread-send aria-label="{{copy "conversation.send_short"}}" data-busy-label="{{copy "roster.sending"}}">{{icon "arrow-up"}}</button></div></form>{{end}}</details>{{end}}
122
123{{define "project-name-confirm"}}{{with .RememberName}}<div rst-stack><input type="hidden" name="remember_present" value="1"><label><input type="checkbox" name="remember" value="1" checked>{{printf (copy "projects.remember_name") .}}</label><input name="remember_name" value="{{.}}" maxlength="120" aria-label="{{copy "projects.name_to_remember"}}"></div>{{end}}{{end}}
124