swarm-ui: the inference editor fills the section, and the login and API key get a row each
The editor stopped at 60em, and the claude login row packed the login and the API key badges into one wrapping line. The width cap is gone, and the API key has its own row beside the login's.
This commit is contained in:
parent
897f8af77d
commit
025d39d141
5 changed files with 25 additions and 22 deletions
|
|
@ -204,8 +204,9 @@ starts open, the other five folded:
|
|||
- **instructions**: the agent's AGENTS.md, as an editor you can type in.
|
||||
- **inference**: how the agent thinks and what it costs, as an editor in place:
|
||||
its model and effort, the subagent settings and the two context limits, then
|
||||
the claude login and API key (the login's state, **log in**, and **set API
|
||||
key**), since the key is how the agent reaches claude.
|
||||
the claude login and API key, each on its own row (the login's state and
|
||||
**log in**, then the key's state and **set API key**), since the key is how
|
||||
the agent reaches claude. The editor fills the section's width.
|
||||
- **access**: what the agent may reach and use: internet, allowed domains,
|
||||
repositories, SSH, permissions and its resource caps. Each shows a badge;
|
||||
select it to open the control that changes it (described below).
|
||||
|
|
@ -1180,10 +1181,11 @@ reads back and its box starts with the stored text. The secrets never read back,
|
|||
so their box starts empty and replaces the stored secrets only when filled and
|
||||
saved.
|
||||
|
||||
The **claude login** row of an agent's details also sets the API key: **set API
|
||||
key** (or **replace API key**) sends the key as `ANTHROPIC_API_KEY=<key>` to the
|
||||
agent's secrets, **remove API key** deletes them, and **advanced** opens the
|
||||
form above. The row shows whether the store holds a key and never the key. The
|
||||
The **API key** row of an agent's details, under the **claude login** row, sets
|
||||
the API key: **set API key** (or **replace API key**) sends the key as
|
||||
`ANTHROPIC_API_KEY=<key>` to the agent's secrets, **remove API key** deletes
|
||||
them, and **advanced** opens the form above. The row shows whether the store
|
||||
holds a key and never the key. The
|
||||
form reads the stored configuration first: a 404 means the store holds none, and any
|
||||
other failed read shows the error with a **retry** button and keeps **save**
|
||||
disabled, so a save can't replace text that was never read. A
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// <AgentApiKey> — how one agent is billed, in the claude login row: whether an
|
||||
// <AgentApiKey> — how one agent is billed, in the API key row: whether an
|
||||
// API key is stored (`GET …/backend-secrets`, which never returns the key), a
|
||||
// button that sets or replaces it, one that removes it, and the advanced
|
||||
// backend settings. With a key stored the agent tries the key instead of
|
||||
|
|
@ -11,6 +11,7 @@ import { readApiError, type ProblemDetails } from "@hive/shared/api-error.js";
|
|||
import { Badge } from "@hive/shared/badge.js";
|
||||
import { ConfirmDialog } from "../../ui/confirm-dialog/ConfirmDialog.js";
|
||||
import { Dialog } from "../../ui/dialog/Dialog.js";
|
||||
import { Hint } from "../../ui/hint/Hint.js";
|
||||
import { showToast } from "../../ui/toast/toasts.js";
|
||||
import { LinkApiKeyForm } from "../../pages/LinkApiKeyForm.js";
|
||||
import { LinkBackendEnvForm } from "../../pages/LinkBackendEnvForm.js";
|
||||
|
|
@ -70,13 +71,11 @@ export function AgentApiKey({ hive, agent }: { hive: string; agent: string }) {
|
|||
{error ? (
|
||||
<ApiErrorPanel context="reading the API key failed" problem={error} />
|
||||
) : null}
|
||||
{stored === null ? null : (
|
||||
{stored === null ? null : stored ? (
|
||||
<>stored </>
|
||||
) : (
|
||||
<>
|
||||
<Badge
|
||||
label="API key"
|
||||
value={stored ? "stored" : "none"}
|
||||
tone={stored ? "ok" : "neutral"}
|
||||
/>{" "}
|
||||
<Hint as="span">none stored</Hint>{" "}
|
||||
</>
|
||||
)}
|
||||
<Badge
|
||||
|
|
|
|||
|
|
@ -53,10 +53,12 @@ function ClaudeRows({ agent, hive }: { agent: string; hive: string | null }) {
|
|||
<InferenceRows>
|
||||
<InferencePair label="claude login">
|
||||
<AgentClaudeLogin key={agent} agent={agent} />
|
||||
{hive ? (
|
||||
<AgentApiKey key={`${hive}/${agent}`} hive={hive} agent={agent} />
|
||||
) : null}
|
||||
</InferencePair>
|
||||
{hive ? (
|
||||
<InferencePair label="API key">
|
||||
<AgentApiKey key={`${hive}/${agent}`} hive={hive} agent={agent} />
|
||||
</InferencePair>
|
||||
) : null}
|
||||
</InferenceRows>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* <AgentInference> — the settings as labelled values, two to a line where there
|
||||
is room, each value followed by where it comes from. */
|
||||
/* <AgentInference> — the settings as labelled values, one to a line, each
|
||||
value followed by where it comes from. */
|
||||
.ui-agent-inference {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
|
@ -8,14 +8,15 @@
|
|||
}
|
||||
.ui-agent-inference-rows {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(22em, 1fr));
|
||||
gap: 0.3em 2em;
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
gap: 0.4em;
|
||||
align-self: stretch;
|
||||
margin: 0;
|
||||
}
|
||||
.ui-agent-inference-pair {
|
||||
display: grid;
|
||||
grid-template-columns: 12em minmax(0, 1fr);
|
||||
align-items: baseline;
|
||||
gap: 0 1em;
|
||||
}
|
||||
.ui-agent-inference-pair dt {
|
||||
|
|
@ -33,7 +34,6 @@
|
|||
.ui-agent-inference .ui-form-stack {
|
||||
align-items: stretch;
|
||||
align-self: stretch;
|
||||
max-width: 60em;
|
||||
margin-top: 0;
|
||||
}
|
||||
/* The claude login row under the editor. */
|
||||
|
|
|
|||
|
|
@ -259,7 +259,7 @@ export function InferenceFields({
|
|||
);
|
||||
}
|
||||
|
||||
/** Labelled values, two to a line where there is room. */
|
||||
/** Labelled values, one to a line. */
|
||||
export function InferenceRows({ children }: { children: ComponentChildren }) {
|
||||
return <dl class="ui-agent-inference-rows">{children}</dl>;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue