Skip to content

LeoYeAI/agent-master-skills / skills/agent-chat-ux-v1-4-0

agent-chat-ux

Verified

Multi-agent UX for OpenClaw Control UI — agent selector, per-agent sessions, session history viewer with search, agent-filtered Sessions tab with friendly names, Create Agent wizard, emoji picker, and backend agent CRUD.

references/agents-utils.txt

View on GitHub
diff --git a/ui/src/ui/views/agents-utils.ts b/ui/src/ui/views/agents-utils.ts
index f4f604c5a..03d8b6600 100644
--- a/ui/src/ui/views/agents-utils.ts
+++ b/ui/src/ui/views/agents-utils.ts
@@ -372,6 +372,62 @@ export type ModelInfo = {
   contextWindow?: number;
 };
 
+export function buildModelOptionsMulti(
+  configForm: Record<string, unknown> | null,
+  selected: string[],
+  availableModels?: ModelInfo[],
+) {
+  if (availableModels && availableModels.length > 0) {
+    const providerGroups = new Map<string, ModelInfo[]>();
+    for (const model of availableModels) {
+      const group = providerGroups.get(model.provider) || [];
+      group.push(model);
+      providerGroups.set(model.provider, group);
+    }
+    const priorityProviders = ["anthropic", "openai", "google", "mistral", "cohere"];
+    const sortedProviders = [...providerGroups.keys()].toSorted((a, b) => {
+      const aIdx = priorityProviders.indexOf(a.toLowerCase());
+      const bIdx = priorityProviders.indexOf(b.toLowerCase());
+      if (aIdx !== -1 && bIdx !== -1) return aIdx - bIdx;
+      if (aIdx !== -1) return -1;
+      if (bIdx !== -1) return 1;
+      return a.localeCompare(b);
+    });
+    return sortedProviders.map(
+      (provider) => html`
+        <optgroup label="${provider}">
+          ${(providerGroups.get(provider) ?? []).map((m) => {
+            const value = `${m.provider}/${m.id}`;
+            const ctxLabel = m.contextWindow ? ` (${Math.round(m.contextWindow / 1000)}k ctx)` : "";
+            const label = (m.name || m.id) + ctxLabel;
+            return html`
+              <option value="${value}" ?selected=${selected.includes(value)}>
+                ${label}
+              </option>
+            `;
+          })}
+        </optgroup>
+      `,
+    );
+  }
+  const options = resolveConfiguredModels(configForm);
+  for (const s of selected) {
+    if (s && !options.some((o) => o.value === s)) {
+      options.unshift({ value: s, label: `Current (${s})` });
+    }
+  }
+  if (options.length === 0) {
+    return html`<option value="" disabled>No configured models</option>`;
+  }
+  return options.map(
+    (option) => html`
+      <option value=${option.value} ?selected=${selected.includes(option.value)}>
+        ${option.label}
+      </option>
+    `,
+  );
+}
+
 export function buildModelOptions(
   configForm: Record<string, unknown> | null,
   current?: string | null,
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall