🙌 OpenHands: AI-Driven Development
feat(frontend): Display skill ready events as expandable skill list in chat (#13511)
Vasco Schiavofdc6ba82c936
diff --git a/frontend/__tests__/components/v1/chat/event-content-helpers/create-skill-ready-event.test.ts b/frontend/__tests__/components/v1/chat/event-content-helpers/create-skill-ready-event.test.tsnew file mode 100644index 0000000000..e2d7d7d2e1--- /dev/null+++ b/frontend/__tests__/components/v1/chat/event-content-helpers/create-skill-ready-event.test.ts@@ -0,0 +1,79 @@+import { describe, expect, it } from "vitest";+import {+ createSkillReadyEvent,+ isSkillReadyEvent,+} from "#/components/v1/chat/event-content-helpers/create-skill-ready-event";+import { MessageEvent } from "#/types/v1/core";++const makeMessageEvent = (+ overrides: Partial<MessageEvent> = {},+): MessageEvent =>+ ({+ id: "msg-1",+ timestamp: "2024-01-01T00:00:00Z",+ source: "user",+ message: { role: "user", content: [{ type: "text", text: "test" }] },+ activated_microagents: [],+ extended_content: [],+ ...overrides,+ }) as MessageEvent;++describe("createSkillReadyEvent", () => {+ it("includes _skillReadyItems with structured skill data", () => {+ const event = makeMessageEvent({+ activated_microagents: ["docker"],+ extended_content: [+ { type: "text", text: "<EXTRA_INFO>Docker guide</EXTRA_INFO>" },+ ],+ });++ const result = createSkillReadyEvent(event);++ expect(result._skillReadyItems).toEqual([+ { name: "docker", content: "Docker guide" },+ ]);+ });++ it("sets correct id and source", () => {+ const event = makeMessageEvent({+ id: "msg-42",+ activated_microagents: ["skill1"],+ extended_content: [+ { type: "text", text: "<EXTRA_INFO>content</EXTRA_INFO>" },+ ],+ });++ const result = createSkillReadyEvent(event);++ expect(result.id).toBe("msg-42-skill-ready");+ expect(result.source).toBe("agent");+ expect(result._isSkillReadyEvent).toBe(true);+ });++ it("throws when no skills and no extended content", () => {+ const event = makeMessageEvent();++ expect(() => createSkillReadyEvent(event)).toThrow(+ "Cannot create skill ready event",+ );+ });+});++describe("isSkillReadyEvent", () => {+ it("returns true for valid SkillReadyEvent", () => {+ const event = makeMessageEvent({+ activated_microagents: ["skill1"],+ extended_content: [+ { type: "text", text: "<EXTRA_INFO>content</EXTRA_INFO>" },+ ],+ });++ expect(isSkillReadyEvent(createSkillReadyEvent(event))).toBe(true);+ });++ it("returns false for plain objects", () => {+ expect(isSkillReadyEvent({})).toBe(false);+ expect(isSkillReadyEvent(null)).toBe(false);+ expect(isSkillReadyEvent({ _isSkillReadyEvent: false })).toBe(false);+ });+});diff --git a/frontend/__tests__/components/v1/chat/event-content-helpers/get-skill-ready-items.test.ts b/frontend/__tests__/components/v1/chat/event-content-helpers/get-skill-ready-items.test.tsnew file mode 100644index 0000000000..a19c3e3755--- /dev/null+++ b/frontend/__tests__/components/v1/chat/event-content-helpers/get-skill-ready-items.test.ts@@ -0,0 +1,74 @@+import { describe, expect, it } from "vitest";+import { getSkillReadyItems } from "#/components/v1/chat/event-content-helpers/get-skill-ready-content";+import { TextContent } from "#/types/v1/core/base/common";++const makeTextContent = (text: string): TextContent[] => [+ { type: "text", text },+];++const wrapExtraInfo = (content: string): string =>+ `<EXTRA_INFO>${content}</EXTRA_INFO>`;++describe("getSkillReadyItems", () => {+ it("pairs skills with their EXTRA_INFO blocks by index", () => {+ const skills = ["docker", "gitlab"];+ const extended = makeTextContent(+ `${wrapExtraInfo("Docker guide")}${wrapExtraInfo("GitLab guide")}`,+ );++ const items = getSkillReadyItems(skills, extended);++ expect(items).toEqual([+ { name: "docker", content: "Docker guide" },+ { name: "gitlab", content: "GitLab guide" },+ ]);+ });++ it("returns empty content for skills without matching EXTRA_INFO", () => {+ const skills = ["docker", "gitlab"];+ const extended = makeTextContent(wrapExtraInfo("Docker guide only"));++ const items = getSkillReadyItems(skills, extended);++ expect(items).toEqual([+ { name: "docker", content: "Docker guide only" },+ { name: "gitlab", content: "" },+ ]);+ });++ it("returns unnamed items when no skills but EXTRA_INFO blocks exist", () => {+ const extended = makeTextContent(+ `${wrapExtraInfo("Block A")}${wrapExtraInfo("Block B")}`,+ );++ const items = getSkillReadyItems([], extended);++ expect(items).toEqual([+ { name: "Extended Content 1", content: "Block A" },+ { name: "Extended Content 2", content: "Block B" },+ ]);+ });++ it("returns empty array when no skills and no extended content", () => {+ expect(getSkillReadyItems([], [])).toEqual([]);+ });++ it("skips empty EXTRA_INFO blocks for unnamed items", () => {+ const extended = makeTextContent(+ `${wrapExtraInfo("Content")}${wrapExtraInfo(" ")}`,+ );++ const items = getSkillReadyItems([], extended);++ expect(items).toEqual([{ name: "Extended Content 1", content: "Content" }]);+ });++ it("trims content from EXTRA_INFO blocks", () => {+ const skills = ["docker"];+ const extended = makeTextContent(wrapExtraInfo(" trimmed content "));++ const items = getSkillReadyItems(skills, extended);++ expect(items[0].content).toBe("trimmed content");+ });+});diff --git a/frontend/__tests__/components/v1/chat/event-message-components/skill-item-expanded.test.ts b/frontend/__tests__/components/v1/chat/event-message-components/skill-item-expanded.test.tsnew file mode 100644index 0000000000..c32207c7ba--- /dev/null+++ b/frontend/__tests__/components/v1/chat/event-message-components/skill-item-expanded.test.ts@@ -0,0 +1,108 @@+import { describe, expect, it } from "vitest";+import {+ parseSkillContent,+ styleImportantTags,+} from "#/components/v1/chat/event-message-components/skill-item-expanded";++describe("parseSkillContent", () => {+ it("should extract matchInfo from content", () => {+ const content =+ "The following information has been included based on keyword match\nIt may or may not be relevant\n\nActual body content";+ const result = parseSkillContent(content);++ expect(result.matchInfo).toBe(+ "The following information has been included based on keyword match",+ );+ expect(result.body).toBe("Actual body content");+ });++ it("should extract filePath from content", () => {+ const content = "Skill location: /path/to/skill.md\n\nBody here";+ const result = parseSkillContent(content);++ expect(result.filePath).toBe("/path/to/skill.md");+ expect(result.body).toBe("Body here");+ });++ it("should handle content with both matchInfo and filePath", () => {+ const content =+ "The following information has been included based on keyword match\nIt may or may not be relevant\nSkill location: /path/to/skill.md\n(Use this path to resolve imports)\n\nBody content";+ const result = parseSkillContent(content);++ expect(result.matchInfo).toBe(+ "The following information has been included based on keyword match",+ );+ expect(result.filePath).toBe("/path/to/skill.md");+ expect(result.body).toBe("Body content");+ });++ it("should handle content with no metadata", () => {+ const content = "Just plain body content\nWith multiple lines";+ const result = parseSkillContent(content);++ expect(result.matchInfo).toBeNull();+ expect(result.filePath).toBeNull();+ expect(result.body).toBe("Just plain body content\nWith multiple lines");+ });++ it("should handle empty content", () => {+ const result = parseSkillContent("");++ expect(result.matchInfo).toBeNull();+ expect(result.filePath).toBeNull();+ expect(result.body).toBe("");+ });++ it("should skip blank lines between metadata and body", () => {+ const content = "Skill location: /path/to/skill.md\n\n\nBody after blanks";+ const result = parseSkillContent(content);++ expect(result.filePath).toBe("/path/to/skill.md");+ expect(result.body).toBe("Body after blanks");+ });+});++describe("styleImportantTags", () => {+ it("should wrap important tag content with bold markers", () => {+ const text = "Some text <important>critical info</important> more text";+ const result = styleImportantTags(text);++ expect(result).toBe("Some text **critical info** more text");+ });++ it("should handle multiple important tags", () => {+ const text =+ "<important>first</important> and <important>second</important>";+ const result = styleImportantTags(text);++ expect(result).toBe("**first** and **second**");+ });++ it("should handle multiline content inside important tags", () => {+ const text = "<important>line1\nline2</important>";+ const result = styleImportantTags(text);++ expect(result).toBe("**line1\nline2**");+ });++ it("should be case-insensitive", () => {+ const text = "<IMPORTANT>test</IMPORTANT>";+ const result = styleImportantTags(text);++ expect(result).toBe("**test**");+ });++ it("should return text unchanged if no important tags", () => {+ const text = "No important tags here";+ const result = styleImportantTags(text);++ expect(result).toBe("No important tags here");+ });++ it("should trim whitespace inside important tags", () => {+ const text = "<important> spaced </important>";+ const result = styleImportantTags(text);++ expect(result).toBe("**spaced**");+ });+});diff --git a/frontend/__tests__/components/v1/chat/event-message-components/skill-ready-content-list.test.tsx b/frontend/__tests__/components/v1/chat/event-message-components/skill-ready-content-list.test.tsxnew file mode 100644index 0000000000..13dfc727b8--- /dev/null+++ b/frontend/__tests__/components/v1/chat/event-message-components/skill-ready-content-list.test.tsx@@ -0,0 +1,124 @@+import { screen } from "@testing-library/react";+import userEvent from "@testing-library/user-event";+import { describe, it, expect } from "vitest";+import { renderWithProviders } from "test-utils";+import { SkillReadyContentList } from "#/components/v1/chat/event-message-components/skill-ready-content-list";+import { SkillReadyItem } from "#/components/v1/chat/event-content-helpers/create-skill-ready-event";++const makeItems = (+ ...entries: [string, string][]+): SkillReadyItem[] =>+ entries.map(([name, content]) => ({ name, content }));++describe("SkillReadyContentList", () => {+ it("renders all skill names", () => {+ const items = makeItems(["docker", "content1"], ["gitlab", "content2"]);++ renderWithProviders(<SkillReadyContentList items={items} />);++ expect(screen.getByText("docker")).toBeInTheDocument();+ expect(screen.getByText("gitlab")).toBeInTheDocument();+ });++ it("renders the header label", () => {+ const items = makeItems(["docker", "content"]);++ renderWithProviders(<SkillReadyContentList items={items} />);++ expect(+ screen.getByText("SKILLS$TRIGGERED_SKILL_KNOWLEDGE"),+ ).toBeInTheDocument();+ });++ it("does not show content before clicking", () => {+ const items = makeItems(["docker", "Docker usage guide"]);++ renderWithProviders(<SkillReadyContentList items={items} />);++ expect(screen.queryByText("Docker usage guide")).not.toBeInTheDocument();+ });++ it("expands skill content on click", async () => {+ const user = userEvent.setup();+ const items = makeItems(["docker", "Docker usage guide"]);++ renderWithProviders(<SkillReadyContentList items={items} />);++ await user.click(screen.getByText("docker"));++ expect(screen.getByText("Docker usage guide")).toBeInTheDocument();+ });++ it("collapses skill content on second click", async () => {+ const user = userEvent.setup();+ const items = makeItems(["docker", "Docker usage guide"]);++ renderWithProviders(<SkillReadyContentList items={items} />);++ await user.click(screen.getByText("docker"));+ expect(screen.getByText("Docker usage guide")).toBeInTheDocument();++ await user.click(screen.getByText("docker"));+ expect(screen.queryByText("Docker usage guide")).not.toBeInTheDocument();+ });++ it("expands skills independently", async () => {+ const user = userEvent.setup();+ const items = makeItems(+ ["docker", "Docker guide"],+ ["gitlab", "GitLab guide"],+ );++ renderWithProviders(<SkillReadyContentList items={items} />);++ await user.click(screen.getByText("docker"));++ expect(screen.getByText("Docker guide")).toBeInTheDocument();+ expect(screen.queryByText("GitLab guide")).not.toBeInTheDocument();+ });++ it("renders <important> content as bold text", async () => {+ const user = userEvent.setup();+ const content = "Some text <important>critical info</important> more text";+ const items = makeItems(["docker", content]);++ renderWithProviders(<SkillReadyContentList items={items} />);++ await user.click(screen.getByText("docker"));++ // The important text should be rendered as bold (strong element)+ const boldElement = screen.getByText("critical info");+ expect(boldElement).toBeInTheDocument();+ expect(boldElement.tagName).toBe("STRONG");+ });++ it("parses and displays file path from metadata", async () => {+ const user = userEvent.setup();+ const content = [+ "The following information has been included based on a keyword match for \"docker\".",+ "It may or may not be relevant to the user's request.",+ "Skill location: /home/openhands/.openhands/skills/docker/SKILL.md",+ "(Use this path to resolve relative file references)",+ "",+ "Docker Usage Guide",+ ].join("\n");+ const items = makeItems(["docker", content]);++ renderWithProviders(<SkillReadyContentList items={items} />);++ await user.click(screen.getByText("docker"));++ // File path rendered in code element+ expect(+ screen.getByText(+ "/home/openhands/.openhands/skills/docker/SKILL.md",+ ),+ ).toBeInTheDocument();+ // Actual skill body rendered+ expect(screen.getByText("Docker Usage Guide")).toBeInTheDocument();+ // Metadata preamble lines are not rendered as-is in the body+ expect(+ screen.queryByText("It may or may not be relevant"),+ ).not.toBeInTheDocument();+ });+});diff --git a/frontend/src/components/v1/chat/event-content-helpers/create-skill-ready-event.ts b/frontend/src/components/v1/chat/event-content-helpers/create-skill-ready-event.tsindex 4682b8a90f..73fdf11646 100644--- a/frontend/src/components/v1/chat/event-content-helpers/create-skill-ready-event.ts+++ b/frontend/src/components/v1/chat/event-content-helpers/create-skill-ready-event.ts@@ -1,6 +1,12 @@import { MessageEvent } from "#/types/v1/core";import { BaseEvent } from "#/types/v1/core/base/event";-import { getSkillReadyContent } from "./get-skill-ready-content";+import {+ getSkillReadyContent,+ getSkillReadyItems,+ SkillReadyItem,+} from "./get-skill-ready-content";++export type { SkillReadyItem };/*** Synthetic event type for Skill Ready events.@@ -9,6 +15,7 @@ import { getSkillReadyContent } from "./get-skill-ready-content";export interface SkillReadyEvent extends BaseEvent {_isSkillReadyEvent: true;_skillReadyContent: string;+ _skillReadyItems: SkillReadyItem[];}/**@@ -45,6 +52,7 @@ export const createSkillReadyEvent = (}const content = getSkillReadyContent(activatedSkills, extendedContent);+ const items = getSkillReadyItems(activatedSkills, extendedContent);return {id: `${userEvent.id}-skill-ready`,@@ -52,5 +60,6 @@ export const createSkillReadyEvent = (source: "agent",_isSkillReadyEvent: true,_skillReadyContent: content,+ _skillReadyItems: items,};};diff --git a/frontend/src/components/v1/chat/event-content-helpers/get-skill-ready-content.ts b/frontend/src/components/v1/chat/event-content-helpers/get-skill-ready-content.tsindex 5f4b14f846..6cbe62afed 100644--- a/frontend/src/components/v1/chat/event-content-helpers/get-skill-ready-content.ts+++ b/frontend/src/components/v1/chat/event-content-helpers/get-skill-ready-content.ts@@ -1,5 +1,13 @@import { TextContent } from "#/types/v1/core/base/common";+/**+ * Represents a single activated skill with its name and associated content.+ */+export interface SkillReadyItem {+ name: string;+ content: string;+}+/*** Extracts all text content from an array of TextContent items.*/@@ -78,24 +86,24 @@ const formatExtendedContentOnly = (extraInfoBlocks: string[]): string => {return content;};+/**+ * Extracts EXTRA_INFO blocks from extended content.+ */+const getExtraInfoBlocks = (extendedContent: TextContent[]): string[] => {+ if (!extendedContent || extendedContent.length === 0) return [];+ return extractExtraInfoBlocks(extractAllText(extendedContent));+};+/*** Formats activated skills and extended content into markdown for display.- * Similar to how v0 formats microagent knowledge in recall observations.- ** Each skill is paired with its corresponding <EXTRA_INFO> block by index.*/export const getSkillReadyContent = (activatedSkills: string[],extendedContent: TextContent[],): string => {- // Extract all <EXTRA_INFO> blocks from extended_content- const extraInfoBlocks: string[] = [];- if (extendedContent && extendedContent.length > 0) {- const allText = extractAllText(extendedContent);- extraInfoBlocks.push(...extractExtraInfoBlocks(allText));- }+ const extraInfoBlocks = getExtraInfoBlocks(extendedContent);- // Format output based on what we haveif (activatedSkills && activatedSkills.length > 0) {return formatSkillKnowledge(activatedSkills, extraInfoBlocks);}@@ -106,3 +114,33 @@ export const getSkillReadyContent = (return "";};++/**+ * Returns structured skill items with their names and associated content.+ * Each skill is paired with its corresponding <EXTRA_INFO> block by index.+ */+export const getSkillReadyItems = (+ activatedSkills: string[],+ extendedContent: TextContent[],+): SkillReadyItem[] => {+ const extraInfoBlocks = getExtraInfoBlocks(extendedContent);++ if (activatedSkills && activatedSkills.length > 0) {+ return activatedSkills.map((skill, index) => ({+ name: skill,+ content:+ index < extraInfoBlocks.length ? extraInfoBlocks[index].trim() : "",+ }));+ }++ if (extraInfoBlocks.length > 0) {+ return extraInfoBlocks+ .filter((block) => block.trim().length > 0)+ .map((block, index) => ({+ name: `Extended Content ${index + 1}`,+ content: block.trim(),+ }));+ }++ return [];+};diff --git a/frontend/src/components/v1/chat/event-message-components/generic-event-message-wrapper.tsx b/frontend/src/components/v1/chat/event-message-components/generic-event-message-wrapper.tsxindex 3c2d404bdf..80bc4e0a7d 100644--- a/frontend/src/components/v1/chat/event-message-components/generic-event-message-wrapper.tsx+++ b/frontend/src/components/v1/chat/event-message-components/generic-event-message-wrapper.tsx@@ -9,6 +9,7 @@ import {} from "../event-content-helpers/create-skill-ready-event";import { V1ConfirmationButtons } from "#/components/shared/buttons/v1-confirmation-buttons";import { ObservationResultStatus } from "../../../features/chat/event-content-helpers/get-observation-result";+import { SkillReadyContentList } from "./skill-ready-content-list";interface GenericEventMessageWrapperProps {event: OpenHandsEvent | SkillReadyEvent;@@ -23,29 +24,36 @@ export function GenericEventMessageWrapper({}: GenericEventMessageWrapperProps) {const { title, details } = getEventContent(event, correspondingAction);- // SkillReadyEvent is not an observation event, so skip the observation checks- if (!isSkillReadyEvent(event)) {- if (isObservationEvent(event)) {- if (event.observation.kind === "TaskTrackerObservation") {- return <div>{details}</div>;- }- }+ // TaskTrackerObservation has its own rendering+ if (+ !isSkillReadyEvent(event) &&+ isObservationEvent(event) &&+ event.observation.kind === "TaskTrackerObservation"+ ) {+ return <div>{details}</div>;}// Determine success statuslet success: ObservationResultStatus | undefined;if (isSkillReadyEvent(event)) {- // Skill Ready events should show success indicator, same as v0 recall observationssuccess = "success";} else if (isObservationEvent(event)) {success = getObservationResult(event);}+ // For Skill Ready events with items, render expandable skill list+ const skillReadyDetails =+ isSkillReadyEvent(event) && event._skillReadyItems.length > 0 ? (+ <SkillReadyContentList items={event._skillReadyItems} />+ ) : (+ details+ );+return (<div><GenericEventMessagetitle={title}- details={details}+ details={skillReadyDetails}success={success}initiallyExpanded={false}/>diff --git a/frontend/src/components/v1/chat/event-message-components/skill-item-expanded.tsx b/frontend/src/components/v1/chat/event-message-components/skill-item-expanded.tsxnew file mode 100644index 0000000000..9cb22d9235--- /dev/null+++ b/frontend/src/components/v1/chat/event-message-components/skill-item-expanded.tsx@@ -0,0 +1,94 @@+import { useTranslation } from "react-i18next";+import { I18nKey } from "#/i18n/declaration";+import { METADATA_PREFIXES } from "#/utils/constants";+import { Typography } from "#/ui/typography";+import { MarkdownRenderer } from "../../../features/markdown/markdown-renderer";++interface ParsedSkillContent {+ matchInfo: string | null;+ filePath: string | null;+ body: string;+}++/**+ * Parses skill content into metadata (keyword match info, file path)+ * and the actual skill body.+ */+export function parseSkillContent(content: string): ParsedSkillContent {+ const lines = content.split("\n");+ let matchInfo: string | null = null;+ let filePath: string | null = null;+ let bodyStartIndex = 0;++ for (let i = 0; i < lines.length; i += 1) {+ const line = lines[i];++ if (line.startsWith(METADATA_PREFIXES[0])) {+ matchInfo = line.trim();+ bodyStartIndex = i + 1;+ } else if (line.startsWith(METADATA_PREFIXES[2])) {+ filePath = line.replace(METADATA_PREFIXES[2], "").trim();+ bodyStartIndex = i + 1;+ } else if (+ line.startsWith(METADATA_PREFIXES[1]) ||+ line.startsWith(METADATA_PREFIXES[3])+ ) {+ bodyStartIndex = i + 1;+ } else if (line.trim() === "" && i <= bodyStartIndex) {+ bodyStartIndex = i + 1;+ } else {+ break;+ }+ }++ return {+ matchInfo,+ filePath,+ body: lines.slice(bodyStartIndex).join("\n").trim(),+ };+}++/**+ * Wraps `<important>...</important>` tags in the content with bold markers+ * so the markdown renderer displays them as bold text.+ */+export function styleImportantTags(text: string): string {+ return text.replace(+ /<important>([\s\S]*?)<\/important>/gi,+ (_match, inner) => `**${inner.trim()}**`,+ );+}++interface SkillItemExpandedProps {+ content: string;+}++export function SkillItemExpanded({ content }: SkillItemExpandedProps) {+ const { t } = useTranslation();+ const { matchInfo, filePath, body } = parseSkillContent(content);+ const hasMetadata = matchInfo || filePath;++ return (+ <div className="pl-6 pr-2 pt-2 pb-2">+ {hasMetadata && (+ <div className="mb-3 text-sm text-neutral-400 space-y-1">+ {matchInfo && <p>{matchInfo}</p>}+ {filePath && (+ <p>+ <Typography.Text className="text-neutral-500">+ {t(I18nKey.COMMON$PATH)}{" "}+ </Typography.Text>+ <code className="bg-neutral-800 px-1.5 py-0.5 rounded text-neutral-300">+ {filePath}+ </code>+ </p>+ )}+ </div>+ )}++ {hasMetadata && body && <hr className="border-neutral-700 mb-3" />}++ {body && <MarkdownRenderer>{styleImportantTags(body)}</MarkdownRenderer>}+ </div>+ );+}diff --git a/frontend/src/components/v1/chat/event-message-components/skill-ready-content-list.tsx b/frontend/src/components/v1/chat/event-message-components/skill-ready-content-list.tsxnew file mode 100644index 0000000000..46e2d2ba04--- /dev/null+++ b/frontend/src/components/v1/chat/event-message-components/skill-ready-content-list.tsx@@ -0,0 +1,64 @@+import React from "react";+import { useTranslation } from "react-i18next";+import { ChevronDown, ChevronRight } from "lucide-react";+import { I18nKey } from "#/i18n/declaration";+import { Typography } from "#/ui/typography";+import { SkillReadyItem } from "../event-content-helpers/create-skill-ready-event";+import { SkillItemExpanded } from "./skill-item-expanded";++interface SkillReadyContentListProps {+ items: SkillReadyItem[];+}++export function SkillReadyContentList({ items }: SkillReadyContentListProps) {+ const { t } = useTranslation();+ const [expandedSkills, setExpandedSkills] = React.useState<+ Record<string, boolean>+ >({});++ const toggleSkill = (name: string) => {+ setExpandedSkills((prev) => ({ ...prev, [name]: !prev[name] }));+ };++ return (+ <div className="flex flex-col gap-1 mt-1">+ <Typography.Text className="font-bold text-neutral-200 text-sm px-2 py-1">+ {t(I18nKey.SKILLS$TRIGGERED_SKILL_KNOWLEDGE)}+ </Typography.Text>+ {items.map((item) => {+ const isExpanded = expandedSkills[item.name] || false;++ return (+ <div+ key={item.name}+ className="border border-neutral-700 rounded-md overflow-hidden"+ >+ <button+ type="button"+ onClick={() => toggleSkill(item.name)}+ className="w-full py-1.5 px-2 text-left flex items-center gap-2 hover:bg-neutral-700 transition-colors cursor-pointer"+ >+ <Typography.Text className="text-neutral-300">+ {isExpanded ? (+ <ChevronDown size={14} />+ ) : (+ <ChevronRight size={14} />+ )}+ </Typography.Text>+ <Typography.Text className="font-semibold text-neutral-200 text-sm">+ {item.name}+ </Typography.Text>+ </button>++ {isExpanded && item.content && (+ <>+ <hr className="border-neutral-700" />+ <SkillItemExpanded content={item.content} />+ </>+ )}+ </div>+ );+ })}+ </div>+ );+}diff --git a/frontend/src/i18n/declaration.ts b/frontend/src/i18n/declaration.tsindex 7529891668..24223a0d34 100644--- a/frontend/src/i18n/declaration.ts+++ b/frontend/src/i18n/declaration.ts@@ -700,6 +700,8 @@ export enum I18nKey {COMMON$TRIGGERS = "COMMON$TRIGGERS",MICROAGENTS_MODAL$INPUTS = "MICROAGENTS_MODAL$INPUTS",MICROAGENTS_MODAL$TOOLS = "MICROAGENTS_MODAL$TOOLS",+ COMMON$PATH = "COMMON$PATH",+ SKILLS$TRIGGERED_SKILL_KNOWLEDGE = "SKILLS$TRIGGERED_SKILL_KNOWLEDGE",COMMON$CONTENT = "COMMON$CONTENT",SKILLS_MODAL$NO_CONTENT = "SKILLS_MODAL$NO_CONTENT",COMMON$FETCH_ERROR = "COMMON$FETCH_ERROR",diff --git a/frontend/src/i18n/translation.json b/frontend/src/i18n/translation.jsonindex f6899d2e05..d244f77f32 100644--- a/frontend/src/i18n/translation.json+++ b/frontend/src/i18n/translation.json@@ -11899,6 +11899,40 @@"uk": "Інструменти","ca": "Eines"},+ "COMMON$PATH": {+ "en": "Path:",+ "ja": "パス:",+ "zh-CN": "路径:",+ "zh-TW": "路徑:",+ "ko-KR": "경로:",+ "no": "Sti:",+ "ar": "المسار:",+ "de": "Pfad:",+ "fr": "Chemin :",+ "it": "Percorso:",+ "pt": "Caminho:",+ "es": "Ruta:",+ "tr": "Yol:",+ "uk": "Шлях:",+ "ca": "Camí:"+ },+ "SKILLS$TRIGGERED_SKILL_KNOWLEDGE": {+ "en": "Triggered Skill Knowledge:",+ "ja": "トリガーされたスキル知識:",+ "zh-CN": "触发的技能知识:",+ "zh-TW": "觸發的技能知識:",+ "ko-KR": "트리거된 스킬 지식:",+ "no": "Utløst ferdighetskunnskap:",+ "ar": "معرفة المهارات المُفعَّلة:",+ "de": "Ausgelöstes Skill-Wissen:",+ "fr": "Connaissances de compétences déclenchées :",+ "it": "Conoscenze delle competenze attivate:",+ "pt": "Conhecimento de habilidades acionadas:",+ "es": "Conocimiento de habilidades activadas:",+ "tr": "Tetiklenen yetenek bilgisi:",+ "uk": "Знання активованих навичок:",+ "ca": "Coneixement d'habilitats activades:"+ },"COMMON$CONTENT": {"en": "Content","ja": "コンテンツ",diff --git a/frontend/src/utils/constants.ts b/frontend/src/utils/constants.tsindex 64cf632d61..9bab335758 100644--- a/frontend/src/utils/constants.ts+++ b/frontend/src/utils/constants.ts@@ -70,3 +70,11 @@ export const CHAT_INPUT = {// UI tolerance constantsexport const EPS = 1.5; // px tolerance for "near min" height comparisons++// Skill content metadata prefixes+export const METADATA_PREFIXES: readonly string[] = [+ "The following information has been included",+ "It may or may not be relevant",+ "Skill location:",+ "(Use this path to resolve",+];