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"}}{{if .Models.Adding}}{{copy "chat.connections.title"}}{{else}}{{template "settings-up-label" .}}{{end}}{{end}}
2{{define "up"}}{{if .Models.Adding}}/conversation/settings/connections{{else}}{{template "settings-up" .}}{{end}}{{end}}
3{{define "title"}}{{if .Models.Adding}}{{copy "chat.connections.add"}}{{else}}{{copy "chat.connections.title"}}{{end}}{{end}}
4{{define "conn-star"}}<span equipo-sparkle data-conn-star aria-hidden="true"><svg viewBox="0 0 16 16" focusable="false"><path d="M8 0C8.6 4.6 11.4 7.4 16 8 11.4 8.6 8.6 11.4 8 16 7.4 11.4 4.6 8.6 0 8 4.6 7.4 7.4 4.6 8 0Z"/><circle cx="8" cy="8" r="1.7"/></svg><i data-sat="1"></i><i data-sat="2"></i><i data-sat="3"></i></span>{{end}}
5{{define "conn-copy"}}<button type="button" rst-btn data-copy="{{.}}" data-copied="{{copy "chat.connections.copied"}}">{{copy "chat.connections.copy"}}</button>{{end}}
6{{define "conn-copy-link"}}<button type="button" rst-btn data-copy="{{.}}" data-copy-link data-copied="{{copy "chat.connections.copied"}}">{{copy "chat.connections.copy_link"}}</button>{{end}}
7{{define "conn-sign-in-instead"}}<form method="post" action="/conversation/connections" data-add-form equipo-inline-form><input type="hidden" name="provider" value="claude">{{with .}}<input type="hidden" name="runner_id" value="{{.}}">{{end}}<input type="hidden" name="kind" value="subscription"><button equipo-link type="submit" data-sign-in-instead>{{copy "chat.connections.sign_in_instead"}}</button></form>{{end}}
8{{define "conn-paste-instead"}}<form method="post" action="/conversation/connections" data-add-form equipo-inline-form><input type="hidden" name="provider" value="claude">{{with .}}<input type="hidden" name="runner_id" value="{{.}}">{{end}}<input type="hidden" name="kind" value="token"><button equipo-link type="submit" data-paste-instead>{{copy "chat.connections.paste_token_instead"}}</button></form>{{end}}
9{{define "conn-waiting"}}<p equipo-conn-waiting aria-live="polite">{{template "conn-star"}}<span data-words>{{.}}</span></p>{{end}}
10{{define "conn-cancel"}}<form method="post" action="/conversation/connections/{{.}}/cancel" equipo-inline-form><button rst-btn data-quiet type="submit" data-connection-cancel>{{copy "chat.connections.cancel"}}</button></form>{{end}}
11{{define "conn-attempt"}}<div equipo-conn-card data-connection="{{.ID}}" data-connecting data-provider="{{.Provider}}"{{if eq .Kind "token"}} data-kind="token" data-runner="{{.RunnerID}}" data-endpoint="{{.Endpoint}}"{{with .SealKey}} data-seal-key="{{.}}"{{end}}{{else if eq .Kind "api_key"}} data-kind="api_key" data-runner="{{.RunnerID}}" data-endpoint="{{.Endpoint}}"{{with .SealKey}} data-seal-key="{{.}}"{{end}}{{else if .SignIn}} data-kind="sign_in" data-runner="{{.RunnerID}}" data-endpoint="{{.Endpoint}}" data-attempt="{{.Prompt.Attempt}}"{{with .SealKey}} data-seal-key="{{.}}"{{end}}{{end}}>
12<div equipo-conn-card-head>{{template "conn-mark" .Provider}}<div><h3>{{if .Title}}{{.Title}}{{else if eq .Provider "codex"}}{{copy "chat.connections.title_codex"}}{{else}}{{copy "chat.connections.title_claude"}}{{end}}</h3><p>{{if .Sub}}{{.Sub}}{{else if eq .Kind "token"}}{{copy "chat.connections.token_sub"}}{{else if .Phrases}}{{copy "chat.connections.loading_sub"}}{{else if eq .Provider "codex"}}{{copy "chat.connections.codex_sub"}}{{else}}{{copy "chat.connections.claude_sub"}}{{end}}</p></div></div>
13{{if eq .Kind "api_key"}}{{template "conn-api-key" .}}{{else if .SignIn}}{{if .Phrases}}<div equipo-conn-loading data-loading data-phrases="{{.Phrases}}">{{template "conn-star"}}<p data-phrase>{{index (split .Phrases "|") 0}}</p></div>
14<div equipo-conn-card-foot><span></span>{{template "conn-cancel" .ID}}</div>
15{{else if .Prompt.URL}}<ol equipo-conn-steps data-code-steps>
16<li><div equipo-conn-link-row><a rst-btn="primary" href="{{.Prompt.URL}}" rel="noopener" target="_blank" data-open-anthropic>{{icon "external-link"}}{{copy "chat.connections.open_anthropic"}}</a>{{template "conn-copy-link" .Prompt.URL}}</div></li>
17<li><div><form method="post" action="/conversation/connections/{{.ID}}/email" equipo-conn-token data-code-form autocomplete="off"><input type="hidden" name="from" value="add"><label for="code-{{.ID}}">{{copy "chat.connections.code_paste"}}</label>{{if .Prompt.WrongCode}}<span equipo-conn-small data-code-wrong data-tone="bad" role="status">{{copy "chat.connections.code_wrong"}}</span>{{end}}<span equipo-conn-token-row><input rst-input id="code-{{.ID}}" type="password" data-code-field autocomplete="off" autocapitalize="off" spellcheck="false" required></span><span equipo-conn-small data-token-note role="status" hidden data-bad="{{copy "chat.connections.code_bad"}}" data-failed="{{copy "chat.connections.code_failed"}}" data-no-key="{{copy "chat.connections.code_no_key"}}"></span><span equipo-conn-small data-token-trust>{{copy "chat.connections.token_sealed"}}</span><span equipo-conn-signin-email><label for="signin-email-{{.ID}}">{{copy "chat.connections.email_ask"}}</label><input rst-input id="signin-email-{{.ID}}" type="email" name="email" maxlength="254" autocapitalize="off" spellcheck="false" data-email-field><span equipo-conn-small>{{copy "chat.connections.email_hint"}}</span><span equipo-conn-small data-email-note role="status" hidden data-bad="{{copy "chat.connections.email_bad"}}" data-tone="bad"></span></span><span><button rst-btn="primary" type="submit" data-code-connect>{{copy "chat.connections.token_connect"}}</button></span></form></div></li>
18</ol>
19<div data-token-waiting hidden>{{template "conn-waiting" (copy "chat.connections.waiting_code")}}</div>
20<div equipo-conn-card-foot><span equipo-conn-small>{{template "conn-paste-instead" .Machine}}</span>{{template "conn-cancel" .ID}}</div>
21{{else}}{{template "conn-waiting" (copy "chat.connections.waiting_code")}}
22<p equipo-conn-small>{{copy "chat.connections.token_sealed"}}</p>
23<div equipo-conn-card-foot><span></span>{{template "conn-cancel" .ID}}</div>
24{{end}}{{else if and (not .Prompt) (eq .Kind "token")}}{{template "conn-waiting" (copy "chat.connections.waiting_token")}}
25<p equipo-conn-small>{{copy "chat.connections.token_sealed"}}</p>
26<div equipo-conn-card-foot><span></span>{{template "conn-cancel" .ID}}</div>
27{{else if not .Prompt}}<div equipo-conn-loading data-loading data-phrases="{{.Phrases}}">{{template "conn-star"}}<p data-phrase>{{index (split .Phrases "|") 0}}</p></div>
28<div equipo-conn-card-foot><span></span>{{template "conn-cancel" .ID}}</div>
29{{else if eq .Prompt.Kind "device_code"}}<ol equipo-conn-steps data-device-code>
30<li><div equipo-conn-link-row><a rst-btn="primary" href="{{.Prompt.URL}}" rel="noopener" target="_blank" data-open-provider>{{icon "external-link"}}{{copy "chat.connections.open_openai"}}</a>{{template "conn-copy-link" .Prompt.URL}}</div></li>
31<li><div><p>{{copy "chat.connections.enter_code"}}</p><div equipo-conn-code-row><code equipo-conn-code data-code>{{.Prompt.Code}}</code>{{template "conn-copy" .Prompt.Code}}<p equipo-conn-once>{{copy "chat.connections.code_once"}}</p></div></div></li>
32<li><div><p>{{copy "chat.connections.approve_back"}}</p></div></li>
33</ol>
34{{template "conn-waiting" (copy "chat.connections.waiting_approve")}}
35<p equipo-conn-small>{{copy "chat.connections.device_off"}}</p>
36<div equipo-conn-card-foot><span equipo-conn-small>{{copy "chat.connections.codex_fine"}}</span>{{template "conn-cancel" .ID}}</div>
37{{else if eq .Prompt.Kind "token"}}<ol equipo-conn-steps data-token-steps>
38<li><div><p>{{copy "chat.connections.token_run"}}</p><div equipo-conn-code-row><code equipo-conn-code data-command>{{.Prompt.Code}}</code>{{template "conn-copy" .Prompt.Code}}</div></div></li>
39<li><div><p>{{copy "chat.connections.token_approve"}}</p></div></li>
40<li><div><form equipo-conn-token data-token-form autocomplete="off"><label for="token-{{.ID}}">{{copy "chat.connections.token_paste"}}</label><span equipo-conn-token-row><input rst-input id="token-{{.ID}}" type="password" data-token-field autocomplete="off" autocapitalize="off" spellcheck="false" required><button rst-btn="primary" type="submit" data-token-connect>{{copy "chat.connections.token_connect"}}</button></span><span equipo-conn-small data-token-trust>{{copy "chat.connections.token_sealed"}}</span><span equipo-conn-small data-token-note role="status" hidden data-bad="{{copy "chat.connections.token_bad"}}" data-failed="{{copy "chat.connections.token_failed"}}" data-no-key="{{copy "chat.connections.token_no_key"}}"></span></form></div></li>
41</ol>
42<div data-token-waiting hidden>{{template "conn-waiting" (copy "chat.connections.waiting_token")}}</div>
43<div equipo-conn-card-foot><span equipo-conn-small>{{template "conn-sign-in-instead" .Machine}}</span>{{template "conn-cancel" .ID}}</div>
44{{else}}<div equipo-conn-card-foot><span></span>{{template "conn-cancel" .ID}}</div>
45{{end}}</div>{{end}}
46{{define "conn-api-key"}}{{if and .Prompt (eq .Prompt.Kind "api_key")}}<ol equipo-conn-steps data-key-steps>
47<li><div><form equipo-conn-token data-key-form autocomplete="off"><label for="key-{{.ID}}">{{printf (copy "chat.connections.metered.key_paste") .Name}}</label><span equipo-conn-token-row><input rst-input id="key-{{.ID}}" type="password" data-key-field autocomplete="off" autocapitalize="off" spellcheck="false" required><button rst-btn="primary" type="submit" data-key-connect>{{copy "chat.connections.token_connect"}}</button></span><span equipo-conn-small data-token-trust>{{copy "chat.connections.token_sealed"}}</span><span equipo-conn-small data-token-note role="status" hidden data-bad="{{copy "chat.connections.metered.key_bad"}}" data-failed="{{copy "chat.connections.metered.key_failed"}}" data-no-key="{{copy "chat.connections.metered.too_old"}}"></span></form></div></li>
48</ol>
49<div data-token-waiting hidden>{{template "conn-waiting" (copy "chat.connections.metered.waiting_key")}}</div>
50{{else if and .Prompt (eq .Prompt.Kind "model") .Prompt.Models}}<form method="post" action="/conversation/connections/{{.ID}}/model" equipo-conn-models data-model-form><p>{{copy "chat.connections.metered.model_pick"}}</p>{{range $i, $m := .Prompt.Models}}<label equipo-conn-model><input type="radio" name="model" value="{{$m}}"{{if eq $i 0}} checked{{end}} required><code>{{$m}}</code></label>{{end}}<button rst-btn="primary" type="submit" data-model-use>{{copy "chat.connections.metered.model_use"}}</button></form>
51{{else if and .Prompt (eq .Prompt.Kind "models") .Prompt.Choices}}<form method="post" action="/conversation/connections/{{.ID}}/models" equipo-conn-models data-models-form><input type="hidden" name="from" value="add"><input type="hidden" name="revision" value="0"><p>{{copy "chat.connections.metered.models_pick"}}</p>{{range .Prompt.Choices}}<label equipo-conn-model{{if not .Eligible}} data-no-price{{end}}><input type="checkbox" name="model" value="{{.ID}}"{{if .Eligible}} checked{{else}} disabled{{end}}><code>{{.ID}}</code>{{if .Eligible}}{{with .Tier}} <span equipo-conn-small>{{copy (printf "chat.connections.metered.tier.%s" .)}}</span>{{end}}{{else}} <span equipo-conn-small>{{copy "chat.connections.metered.no_price"}}</span>{{end}}</label>{{end}}<p equipo-conn-small>{{copy "chat.connections.metered.models_one"}}</p><button rst-btn="primary" type="submit" data-models-use>{{copy "chat.connections.metered.models_use"}}</button></form>
52{{else if and .Prompt (or (eq .Prompt.Kind "model") (eq .Prompt.Kind "models"))}}{{template "conn-waiting" (copy "chat.connections.metered.waiting_probe")}}
53{{else}}{{template "conn-waiting" (copy "chat.connections.metered.waiting_key")}}{{end}}
54<div equipo-conn-card-foot><span></span>{{template "conn-cancel" .ID}}</div>{{end}}
55{{define "conn-metered-add"}}<details equipo-conn-metered data-add-metered="{{.Provider}}"{{if .Refused}} open{{end}}><summary equipo-conn-opt>{{template "conn-mark" .Provider}}<span><span equipo-conn-opt-name>{{.Name}}</span><span equipo-conn-opt-desc>{{.Desc}}</span></span>{{icon "chevron-right"}}</summary>
56<form method="post" action="/conversation/connections" equipo-conn-metered-form data-metered-form autocomplete="off"><input type="hidden" name="provider" value="{{.Provider}}"><input type="hidden" name="kind" value="api_key">
57{{with .Refused}}<p equipo-conn-small data-tone="bad" role="status" data-metered-refused>{{.}}</p>{{end}}
58<label equipo-conn-confirm><input type="checkbox" name="limit_confirmed" value="1" required data-limit-confirmed><span>{{.Confirm}}</span></label>
59<p equipo-conn-small>{{.How}} <a href="{{.Docs}}" rel="noopener" target="_blank">{{.DocsText}}</a></p>
60<p equipo-conn-small data-cannot-see>{{.CannotSee}}</p>
61<fieldset equipo-conn-budget><legend>{{copy "chat.connections.metered.budget_legend"}}</legend><label>{{copy "chat.connections.metered.budget_day"}}<input rst-input name="budget_day" inputmode="decimal" value="{{.Day}}" required></label><label>{{copy "chat.connections.metered.budget_month"}}<input rst-input name="budget_month" inputmode="decimal" value="{{.Month}}" required></label></fieldset>
62<p equipo-conn-small>{{copy "chat.connections.metered.budget_note"}}</p>
63<button rst-btn="primary" type="submit" data-metered-continue>{{copy "chat.connections.metered.continue"}}</button></form></details>{{end}}
64{{define "conn-metered-row"}}<div equipo-conn-spend data-spend>{{with .Model}}<code equipo-conn-model-id>{{.}}</code>{{end}}{{with .ModelsTooOld}}<p equipo-conn-small data-models-too-old>{{.}}</p>{{end}}{{if .ModelsLine}}<details equipo-conn-email data-models="{{.ID}}"><summary data-models-line>{{.ModelsLine}}</summary><form method="post" action="/conversation/connections/{{.ID}}/models" equipo-conn-models data-models-change><input type="hidden" name="revision" value="{{.ModelsRevision}}">{{range .Models}}<label equipo-conn-model{{if not .Eligible}} data-no-price{{end}}><input type="checkbox" name="model" value="{{.ID}}"{{if .Allowed}} checked{{end}}{{if not .Eligible}} disabled{{end}}><code>{{.ID}}</code>{{with .Tier}} <span equipo-conn-small>{{.}}</span>{{end}}{{with .Note}} <span equipo-conn-small data-model-note>{{.}}</span>{{end}}</label>{{end}}<p equipo-conn-small>{{copy "chat.connections.metered.models_one"}}</p><button rst-btn type="submit" data-models-save>{{copy "form.save"}}</button></form>{{with .ModelsPending}}<p equipo-conn-small data-models-pending>{{.}}</p>{{end}}</details>{{end}}{{with .Spend}}<p><span data-spend-line>{{.}}</span> <span equipo-conn-small>{{$.SpendTail}}</span></p>{{end}}
65{{with .Paused}}<p equipo-conn-paused data-paused>{{.}}</p>{{end}}
66{{with .Unknown}}<div equipo-conn-unknown data-spend-unknown><span>{{.}}</span><form method="post" action="/conversation/connections/{{$.ID}}/resume" equipo-inline-form><input type="hidden" name="pause_revision" value="{{$.PauseRevision}}"><button rst-btn type="submit" data-resume>{{copy "chat.connections.metered.resume"}}</button></form></div>{{end}}
67{{with .Pending}}<p equipo-conn-small data-budget-pending>{{.}}</p>{{end}}
68{{if .BudgetDay}}<details equipo-conn-email data-budget-form="{{.ID}}"><summary>{{copy "chat.connections.metered.change_budget"}}</summary><form method="post" action="/conversation/connections/{{.ID}}/budget" equipo-conn-budget autocomplete="off"><input type="hidden" name="revision" value="{{.BudgetRevision}}"><label>{{copy "chat.connections.metered.budget_day"}}<input rst-input name="budget_day" inputmode="decimal" value="{{.BudgetDay}}" required></label><label>{{copy "chat.connections.metered.budget_month"}}<input rst-input name="budget_month" inputmode="decimal" value="{{.BudgetMonth}}" required></label><button rst-btn type="submit" data-budget-save>{{copy "form.save"}}</button></form><p equipo-conn-small>{{copy "chat.connections.metered.budget_note"}}</p></details>{{end}}</div>{{end}}
69{{define "conn-chooser"}}<div equipo-conn-chooser role="group" aria-label="{{copy "chat.connections.add"}}">
70<form method="post" action="/conversation/connections" data-add-form><input type="hidden" name="provider" value="claude"><input type="hidden" name="kind" value="subscription"><button type="submit" equipo-conn-opt data-add="claude">{{template "conn-mark" "claude"}}<span><span equipo-conn-opt-name>Claude</span><span equipo-conn-opt-desc>{{copy "chat.connections.claude_desc"}}</span><span equipo-conn-opt-how data-sign-in-how>{{copy "chat.connections.sign_in_how"}}</span></span>{{icon "chevron-right"}}</button></form>
71<div equipo-conn-alt>{{template "conn-paste-instead"}}</div>
72{{range .Metered}}{{template "conn-metered-add" .}}{{end}}
73<form method="post" action="/conversation/connections" data-add-form><input type="hidden" name="provider" value="codex"><button type="submit" equipo-conn-opt data-add="codex">{{template "conn-mark" "codex"}}<span><span equipo-conn-opt-name>Codex</span><span equipo-conn-opt-desc>{{copy "chat.connections.codex_desc"}}</span></span>{{icon "chevron-right"}}</button></form>
74<p equipo-conn-sep>{{copy "chat.connections.soon"}}</p>
75<button type="button" equipo-conn-opt disabled>{{template "conn-mark" "local"}}<span><span equipo-conn-opt-name>{{copy "chat.connections.local"}}</span><span equipo-conn-opt-desc>{{copy "chat.connections.local_desc"}}</span></span><span equipo-conn-soon>{{copy "chat.connections.soon"}}</span></button>
76<button type="button" equipo-conn-opt disabled>{{template "conn-mark" "mistral"}}<span><span equipo-conn-opt-name>{{copy "chat.connections.mistral"}}</span><span equipo-conn-opt-desc>{{copy "chat.connections.mistral_desc"}}</span></span><span equipo-conn-soon>{{copy "chat.connections.soon"}}</span></button>
77</div>{{end}}
78{{define "conn-add-link"}}<a rst-btn{{if .}}="primary"{{end}} href="/conversation/settings/connections/add" equipo-conn-add data-add-link>{{icon "plug"}}{{copy "chat.connections.add"}}</a>{{end}}
79{{define "conn-note"}}<div equipo-conn-note data-connection="{{.Row.ID}}" data-connection-note role="status"><span>{{.Row.Note}}</span><form method="post" action="/conversation/connections/{{.Row.ID}}/forget" equipo-inline-form>{{if .Add}}<input type="hidden" name="from" value="add">{{end}}<button type="submit" equipo-conn-dismiss aria-label="{{copy "chat.connections.dismiss"}}" title="{{copy "chat.connections.dismiss"}}" data-dismiss>{{icon "x"}}</button></form></div>{{end}}
80{{define "conn-row"}}<article equipo-conn-row data-connection="{{.ID}}" data-provider="{{.Provider}}" data-state="{{.State}}"{{if .Needs}} data-needs{{end}}{{if .New}} data-new{{end}}>
81{{template "conn-mark" .Provider}}
82<div equipo-conn-body id="connection-{{.ID}}">
83<p equipo-conn-head><span equipo-conn-name>{{.Name}}</span><span equipo-conn-account data-conn-label="{{.Tag.Text}}">{{template "conn-account" .Tag}}{{with .Plan}}, {{.}}{{end}}</span>{{if .Preferred}}<span equipo-conn-pref>{{icon "star"}}{{copy "chat.connections.preferred"}}</span>{{end}}</p>
84<p equipo-conn-facts><span equipo-conn-state data-connection-state data-s="{{.State}}"{{with .WordsAt}} title="{{.}}"{{end}}>{{.Words}}</span>{{with .Expires}}<span equipo-conn-expires data-token-expires>{{.}}</span>{{end}}{{range .Meters}}<span equipo-conn-meter data-level="{{.Level}}"{{with .At}} title="{{.}}"{{end}}><span equipo-conn-bar><i data-w="{{.Used}}"></i></span><span>{{.Name}} <b>{{.Used}}%</b>{{with .Resets}}, {{.}}{{end}}</span></span>{{end}}{{with .Age}}<span equipo-conn-usage-note data-reading-age>{{.}}</span>{{end}}{{with .UsageNote}}<span equipo-conn-usage-note data-usage-note>{{.}}</span>{{end}}</p>
85{{if .Metered}}{{template "conn-metered-row" .}}{{end}}
86{{if .AskEmail}}<details equipo-conn-email data-account-email="{{.ID}}"{{if .AskOpen}} open{{end}}><summary>{{if .Stated}}{{copy "chat.connections.email_change"}}{{else}}{{copy "chat.connections.email_add"}}{{end}}</summary><form method="post" action="/conversation/connections/{{.ID}}/email" equipo-conn-token data-email-form autocomplete="off"><label for="email-{{.ID}}">{{copy "chat.connections.email_ask"}}</label><span equipo-conn-token-row><input rst-input id="email-{{.ID}}" type="email" name="email" maxlength="254" value="{{.Stated}}" autocapitalize="off" spellcheck="false" data-email-field><button rst-btn type="submit" data-email-save>{{copy "form.save"}}</button></span><span equipo-conn-small>{{copy "chat.connections.email_hint"}}</span><span equipo-conn-small data-email-note role="status" hidden data-bad="{{copy "chat.connections.email_bad"}}" data-tone="bad"></span></form></details>{{end}}
87{{if .Renew}}<div equipo-conn-renew data-token-renew>{{copy "chat.connections.token_renew"}} <form method="post" action="/conversation/connections" data-add-form equipo-inline-form><input type="hidden" name="provider" value="{{.Provider}}">{{with .Machine}}<input type="hidden" name="runner_id" value="{{.}}">{{end}}<button equipo-link type="submit" data-renew>{{copy "chat.connections.sign_in_again_action"}}</button></form></div>{{end}}
88{{if .Roles}}<p equipo-conn-roles><span equipo-conn-roles-label>{{copy "chat.connections.serving"}}</span>{{range .Roles}}<span equipo-conn-chip{{if .Live}} data-live{{end}}>{{if .Live}}{{template "conn-star"}}{{end}}{{.Name}}</span>{{end}}</p>{{else}}{{with .RolesNote}}<p equipo-conn-roles><span equipo-conn-roles-note>{{.}}</span></p>{{end}}{{end}}
89</div>
90<div equipo-conn-side>
91<div equipo-conn-actions>{{if .Needs}}<form method="post" action="/conversation/connections" data-add-form equipo-inline-form><input type="hidden" name="provider" value="{{.Provider}}">{{with .Machine}}<input type="hidden" name="runner_id" value="{{.}}">{{end}}<button rst-btn type="submit" data-recover="{{.Provider}}">{{.Needs}}</button></form>{{end}}{{if or .MakePreferred .SignOut .Forget .CheckAgain}}<span equipo-conn-quiet>{{template "conn-quiet" .}}</span><details equipo-conn-more><summary aria-label="{{copy "chat.connections.more"}}">{{icon "more-horizontal"}}</summary><div>{{template "conn-quiet" .}}</div></details>{{end}}</div>
92<p equipo-conn-usage>{{if eq .State "signed_out"}}{{printf (copy "chat.connections.tokens_before") .Usage}}{{else}}<b>{{.Usage}}</b>{{.UsageTail}}{{end}}</p>
93</div>
94</article>{{end}}
95{{define "conn-quiet"}}{{if .CheckAgain}}<form method="post" action="/conversation/connections/{{.ID}}/check" equipo-inline-form><button type="submit" data-check-again>{{copy "chat.connections.check_again"}}</button></form>{{end}}{{if .MakePreferred}}<form method="post" action="/conversation/connections/prefer" equipo-inline-form><input type="hidden" name="provider" value="{{.Provider}}"><input type="hidden" name="revision" value="{{.PreferRevision}}"><button type="submit" data-make-preferred>{{copy "chat.connections.make_preferred"}}</button></form>{{end}}{{if .SignOut}}<form method="post" action="/conversation/connections/{{.ID}}/sign-out" equipo-inline-form><button type="submit" data-danger data-sign-out>{{copy "chat.connections.sign_out"}}</button></form>{{end}}{{if .Forget}}<form method="post" action="/conversation/connections/{{.ID}}/forget" equipo-inline-form><button type="submit" data-danger data-forget>{{copy "chat.connections.forget"}}</button></form>{{end}}{{end}}
96{{define "content"}}
97<div equipo-settings-layout data-section="connections">
98<template equipo-saved-template><span equipo-saved-tick role="status">{{icon "check"}}<span>{{copy "settings.saved"}}</span></span></template>
99{{template "settings-nav" .}}
100<section equipo-settings-body equipo-connections data-connections{{if .Models.Adding}} data-adding{{end}} data-cursor="{{.Models.Cursor}}" data-connected="{{copy "chat.connections.connected_big"}}" data-connected-next="{{copy "chat.connections.connected_next"}}">
101{{if .Models.Adding}}{{template "settings-head" (dict "Title" "chat.connections.add" "Lede" "chat.connections.chooser_lede")}}
102{{else}}{{template "settings-head" (dict "Title" "chat.connections.title" "Lede" (and .Models.Rows "chat.connections.lede"))}}{{end}}
103{{if .Models.Offline}}<p equipo-offline role="status">{{copy "chat.connections.offline"}}</p>{{end}}
104<div data-connections-live>
105{{if .Models.Adding}}{{range .Models.Ended}}{{template "conn-note" (dict "Row" . "Add" $.Models.Adding)}}{{end}}
106<div equipo-conn-add-area data-attempts>{{range .Models.Attempts}}{{template "conn-attempt" .}}{{else}}{{template "conn-chooser" .Models}}{{end}}</div>
107<div hidden>{{range .Models.Rows}}<i data-held-connection="{{.ID}}" data-state="{{.State}}" data-account="{{.Label}}"></i>{{end}}</div>
108{{else if or .Models.Rows (gt (len .Models.Machines) 1)}}{{if .Models.Rows}}{{with .Models.Answering}}<section equipo-conn-answering{{with .Tone}} data-tone="{{.}}"{{end}} aria-label="{{copy "chat.connections.title"}}" data-answering>{{if .Tone}}<span equipo-conn-lead-icon aria-hidden="true">{{icon "alert-triangle"}}</span>{{else}}{{template "conn-star"}}{{end}}<p equipo-conn-lead{{with .LeadAt}} title="{{.}}"{{end}}>{{.LeadStart}}<b>{{.LeadName}}</b>{{.LeadEnd}}</p><p equipo-conn-sub>{{.Sub}}{{if .SeeConversation}} <a href="/conversation">{{copy "chat.connections.answering.see"}}</a>{{end}}</p>
109{{if not .Tone}}{{with $.Models.Prefer}}<div equipo-conn-prefer><span>{{copy "chat.connections.prefer"}}</span><span equipo-seg role="group" aria-label="{{copy "chat.connections.prefer"}}">{{range .Options}}<form method="post" action="/conversation/connections/prefer" equipo-inline-form><input type="hidden" name="provider" value="{{.Value}}"><input type="hidden" name="revision" value="{{$.Models.Prefer.Revision}}"><button type="submit" aria-pressed="{{.On}}" data-prefer="{{.Value}}">{{.Label}}</button></form>{{end}}</span><span equipo-conn-hint>{{.Hint}}</span></div>{{end}}{{end}}
110</section>{{end}}{{end}}
111{{if gt (len .Models.Machines) 1}}{{range $i, $m := .Models.Machines}}<section equipo-conn-group data-machine="{{$m.ID}}" id="machine-{{$m.ID}}"><h2>{{$m.Name}} <span equipo-conn-n>{{len $m.Rows}}</span>{{if eq $i 0}}<span equipo-conn-hint>{{copy "chat.connections.usage_resets"}}</span>{{end}}</h2>
112<div equipo-conn-list{{if $m.Primary}} data-connection-list{{end}} aria-live="polite">{{range $m.Rows}}{{template "conn-row" .}}{{end}}</div>
113{{if $m.Primary}}{{range $.Models.Ended}}{{template "conn-note" (dict "Row" . "Add" $.Models.Adding)}}{{end}}
114<div equipo-conn-add-foot>{{template "conn-add-link" false}}<span>{{copy "chat.connections.add_hint"}}</span></div>{{end}}
115{{with $m.AddClaude}}<div equipo-conn-add-foot><form method="post" action="/conversation/connections" data-add-form equipo-inline-form><input type="hidden" name="provider" value="claude"><input type="hidden" name="kind" value="subscription"><input type="hidden" name="runner_id" value="{{$m.ID}}"><button rst-btn type="submit" data-add-claude="{{$m.ID}}">{{icon "plug"}}{{.}}</button></form></div>{{end}}
116</section>{{end}}{{else}}<section equipo-conn-group><h2>{{copy "chat.connections.group"}} <span equipo-conn-n>{{len .Models.Rows}}</span><span equipo-conn-hint>{{copy "chat.connections.usage_resets"}}</span></h2>
117<div equipo-conn-list data-connection-list aria-live="polite">{{range .Models.Rows}}{{template "conn-row" .}}{{end}}</div>
118{{range .Models.Ended}}{{template "conn-note" (dict "Row" . "Add" $.Models.Adding)}}{{end}}
119<div equipo-conn-add-foot>{{template "conn-add-link" false}}<span>{{copy "chat.connections.add_hint"}}</span></div>
120</section>{{end}}
121{{else}}<section equipo-conn-empty data-empty-state="chat.connections.empty"><p equipo-conn-pair>{{template "conn-mark" "claude"}}{{template "conn-mark" "codex"}}</p>
122<h2>{{copy "chat.connections.empty_title"}}</h2>
123<p>{{copy "chat.connections.empty_body"}}</p>
124{{range .Models.Ended}}{{template "conn-note" (dict "Row" . "Add" $.Models.Adding)}}{{end}}
125{{template "conn-add-link" true}}
126<p equipo-conn-fine>{{copy "chat.connections.empty_fine"}}</p>
127<div hidden data-connection-list></div>
128</section>{{end}}
129</div>
130{{if and .Models.Adding .Models.Connecting}}{{with index .Models.Attempts 0}}<noscript><p equipo-conn-small><a href="/conversation/settings/connections/add?attempt={{.ID}}">{{copy "chat.connections.check_again"}}</a></p></noscript>{{end}}{{end}}
131</section>
132{{if .Models.Adding}}<template data-loading-template>{{template "conn-attempt" (loadingLine "codex")}}</template>
133<template data-loading-template-claude>{{template "conn-attempt" (loadingLine "claude")}}</template>
134<template data-success-template><div equipo-conn-card data-success aria-live="polite"><div equipo-conn-success><span equipo-conn-burst>{{template "conn-star"}}</span><p equipo-conn-big data-success-title></p><p equipo-conn-account data-success-account></p></div></div></template>{{end}}
135</div>
136{{end}}
137