Skip to content

Formerly KrillinAI, VideoTranslation and Dubbing Tool for 120+ Languages. Open-source AI workspace for creators, powered by Codex. Video downloader, video translation, create videos, images, audios, and edits with Agents in one place. For your Social Media like YouTube, TikTok, Instagram, etc.

1.3 KB
Raw Blame
import type { CodexMcpListResponse, CodexSkillListResponse } from '@opencreator/protocol';
import type { CodexProfileListResponse } from '../../services/capability-service.js';
import { useLocalizedCopy } from '../../i18n/useLocalizedCopy.js';

export type CapabilitiesViewProps = {
  connected: boolean;
  skills?: CodexSkillListResponse;
  mcp?: CodexMcpListResponse;
  profiles?: CodexProfileListResponse;
};

export function CapabilitiesView(props: CapabilitiesViewProps) {
  const l = useLocalizedCopy();
  if (!props.connected) {
    return (
      <div className="panel-scroll">
        {l('本机 Runtime 就绪后查看技能、MCP 和 Profiles', 'Connect the local Runtime to view Skills, MCP, and Profiles')}
      </div>
    );
  }

  return (
    <div className="panel-scroll">
      <h2>{l("能力", "ability")}</h2>
      <section>
        <h3>{l('技能', 'Skills')}</h3>
        <p>{props.skills?.skills.length ?? 0} {l('个技能', 'skills')}</p>
      </section>
      <section>
        <h3>MCP</h3>
        <p>{l(`${props.mcp?.servers.length ?? 0} 个 servers`, `${props.mcp?.servers.length ?? 0} servers`)}</p>
      </section>
      <section>
        <h3>Profiles</h3>
        <p>{l(`${props.profiles?.profiles.length ?? 0} 个 profiles`, `${props.profiles?.profiles.length ?? 0} profiles`)}</p>
      </section>
    </div>
  );
}