Files
cobble/src/pages/admin/bots/[bot_id]/(partials)/proposal-env-row.tsx
T
tbenandClaude Opus 5.5 fefc295d15 Let the coordinator manage skills, MCP servers and tools, behind a confirm card
- Coordinator tools in its own chat (super admin only): list_extensions,
  set_extension_access, delete_extension, and update_skill /
  update_mcp_server / update_custom_tool for what can't change where
  anything is sent (on/off, names, arguments, left-out tools)
- Adding a skill, MCP server or tool, or changing a skill's words, a
  server's URL or headers or a tool's kind or config, goes through
  propose_skill / propose_mcp_server / propose_custom_tool: stored in
  extension_proposals with the bot's background check, shown as a
  [proposal:ID] chip that opens a card with Confirm and Reject
- The card's facts are worked out by the app from what Confirm saves: the
  host, every {{env.KEY}} and whether it's saved, the config; for a skill
  its links, hosts, tool names, mentions of secrets and a diff against
  the saved runbook
- Confirming decides once and checks again; a server or tool missing a key
  is saved switched off, and the outcome is posted to the bot in chat
- Never from a bot: stdio servers, a URL whose host a template decides,
  envs in a prompt tool, a key's value

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 06:08:09 +01:00

39 lines
1.5 KiB
TypeScript

import Row from "@moduletrace/twui/layout/Row";
import Span from "@moduletrace/twui/layout/Span";
import Stack from "@moduletrace/twui/layout/Stack";
import { twMerge } from "tailwind-merge";
import type { ExtensionProposalEnv } from "@/src/types";
type Props = {
/**
* Passed whole: its `key` field can't be a React prop.
*/
env: ExtensionProposalEnv;
};
/**
* One key a proposed server or tool sends: its name, where it goes, and
* whether it's saved (and where) or still has to be added.
*/
export default function ProposalEnvRow({ env }: Props) {
const { key: env_key, where, saved_in } = env;
const saved = saved_in.length > 0;
return (
<Row className="w-full py-2 gap-3! flex-nowrap items-center border-0 border-b border-solid border-hairline last:border-b-0">
<Stack className="grow min-w-0 gap-0! items-start">
<Span className="font-mono text-[13px] leading-5 font-bold text-ink break-all">{env_key}</Span>
<Span className="text-[12px] leading-4 text-ink-secondary">{`Sent in the ${where}`}</Span>
</Stack>
<Span
className={twMerge(
"shrink-0 rounded-default-xs px-2 py-0.5 text-[12px] leading-4 font-bold",
saved ? "bg-sunken text-ink-secondary" : "bg-ink text-on-ink",
)}
>
{saved ? `Saved · ${saved_in.join(", ")}` : "Missing"}
</Span>
</Row>
);
}