Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

feat(plugins): update plugin marketplace to support LobeHub/pai-chat ToolManifest format and adjust category defaults

nirholas22516ec5e4fa
diff --git a/api/_lib/migrations/2026-05-01-plugins.sql b/api/_lib/migrations/2026-05-01-plugins.sql
index d59e072c1..78619c5f9 100644
--- a/api/_lib/migrations/2026-05-01-plugins.sql
+++ b/api/_lib/migrations/2026-05-01-plugins.sql
@@ -1,7 +1,7 @@
--- ── plugins — JSON manifest plugin marketplace ───────────────────────────────
--- Each row is a community-published plugin manifest.
--- Plugins are keyed by (identifier, author_id) so the same identifier can be
--- published by different authors without conflict.
+-- ── plugins — LobeHub/pai-chat compatible plugin marketplace ─────────────────
+-- Manifest format matches ToolManifest from pai-chat:
+-- { identifier, meta: { title, description?, avatar?, tags? }, api[],
+-- systemRole?, type?, settings?, version?, openapi?, gateway? }
create table if not exists plugins (
id uuid primary key default gen_random_uuid(),
@@ -11,7 +11,7 @@ create table if not exists plugins (
manifest_json jsonb not null,
name text not null,
description text not null default '',
- category text not null default 'general',
+ category text not null default 'tools',
tags text[] not null default '{}',
is_public boolean not null default true,
install_count integer not null default 0,
@@ -23,54 +23,54 @@ create table if not exists plugins (
unique (identifier, author_id)
);
-create index if not exists plugins_category_idx on plugins(category);
-create index if not exists plugins_author_idx on plugins(author_id);
-create index if not exists plugins_popular_idx on plugins(install_count desc);
-create index if not exists plugins_new_idx on plugins(created_at desc);
-create index if not exists plugins_identifier_idx on plugins(identifier);
+create index if not exists plugins_category_idx on plugins(category);
+create index if not exists plugins_author_idx on plugins(author_id);
+create index if not exists plugins_popular_idx on plugins(install_count desc);
+create index if not exists plugins_new_idx on plugins(created_at desc);
+create index if not exists plugins_identifier_idx on plugins(identifier);
do $$ begin
create trigger plugins_set_updated_at before update on plugins
for each row execute function set_updated_at();
exception when duplicate_object then null; end $$;
--- ── Seed: built-in community plugins ─────────────────────────────────────────
+-- ── Seed: built-in community plugins (ToolManifest format) ───────────────────
insert into plugins (identifier, name, description, category, tags, manifest_json, is_public) values
('web-search', 'Web Search', 'Search the web for up-to-date information and return top results inline.',
- 'utility', '{"search","web","utility"}',
- '{"schema_version":"plugin/1.0","identifier":"web-search","version":"1.0.0","meta":{"title":"Web Search","description":"Search the web for up-to-date information and return top results inline.","tags":["search","web","utility"],"category":"utility"},"api":[{"name":"search_web","description":"Search the web for a query and return relevant results","url":null,"method":"POST","parameters":{"type":"object","properties":{"query":{"type":"string","description":"The search query"},"max_results":{"type":"integer","description":"Maximum number of results to return (default 5)","default":5}},"required":["query"]}}],"system_role":"You can search the web for current information. Use search_web when the user asks about recent events, current data, or anything you may not have up-to-date knowledge about."}',
+ 'web-search', '{"search","web","utility"}',
+ '{"identifier":"web-search","version":"1.0.0","meta":{"title":"Web Search","description":"Search the web for up-to-date information and return top results inline.","avatar":"🔍","tags":["search","web","utility"]},"api":[{"name":"search_web","description":"Search the web for a query and return relevant results","parameters":{"type":"object","properties":{"query":{"type":"string","description":"The search query"},"max_results":{"type":"integer","description":"Maximum number of results to return","default":5}},"required":["query"]}}],"systemRole":"You can search the web for current information. Use search_web when the user asks about recent events, current data, or anything you may not have up-to-date knowledge about.","type":"default"}',
true),
('datetime', 'Date & Time', 'Get the current date, time, and timezone in any conversation.',
- 'utility', '{"time","date","timezone","utility"}',
- '{"schema_version":"plugin/1.0","identifier":"datetime","version":"1.0.0","meta":{"title":"Date & Time","description":"Get the current date, time, and timezone in any conversation.","tags":["time","date","timezone","utility"],"category":"utility"},"api":[{"name":"get_current_time","description":"Get the current date and time for a given timezone","url":null,"method":"POST","parameters":{"type":"object","properties":{"timezone":{"type":"string","description":"IANA timezone name (e.g. America/New_York). Defaults to UTC.","default":"UTC"}},"required":[]}},{"name":"convert_timezone","description":"Convert a time from one timezone to another","url":null,"method":"POST","parameters":{"type":"object","properties":{"time":{"type":"string","description":"ISO 8601 datetime string"},"from_tz":{"type":"string","description":"Source IANA timezone"},"to_tz":{"type":"string","description":"Target IANA timezone"}},"required":["time","from_tz","to_tz"]}}],"system_role":"You can retrieve the current date and time and convert between timezones. Use get_current_time when the user asks what time or date it is."}',
+ 'tools', '{"time","date","timezone","utility"}',
+ '{"identifier":"datetime","version":"1.0.0","meta":{"title":"Date & Time","description":"Get the current date, time, and timezone in any conversation.","avatar":"🕐","tags":["time","date","timezone","utility"]},"api":[{"name":"get_current_time","description":"Get the current date and time for a given timezone","parameters":{"type":"object","properties":{"timezone":{"type":"string","description":"IANA timezone name (e.g. America/New_York). Defaults to UTC.","default":"UTC"}},"required":[]}},{"name":"convert_timezone","description":"Convert a time from one timezone to another","parameters":{"type":"object","properties":{"time":{"type":"string","description":"ISO 8601 datetime string"},"from_tz":{"type":"string","description":"Source IANA timezone"},"to_tz":{"type":"string","description":"Target IANA timezone"}},"required":["time","from_tz","to_tz"]}}],"systemRole":"You can retrieve the current date and time and convert between timezones. Use get_current_time when the user asks what time or date it is.","type":"default"}',
true),
('calculator', 'Calculator', 'Perform precise arithmetic calculations and unit conversions.',
- 'utility', '{"math","calculator","arithmetic","utility"}',
- '{"schema_version":"plugin/1.0","identifier":"calculator","version":"1.0.0","meta":{"title":"Calculator","description":"Perform precise arithmetic calculations and unit conversions.","tags":["math","calculator","arithmetic","utility"],"category":"utility"},"api":[{"name":"calculate","description":"Evaluate a mathematical expression and return the result","url":null,"method":"POST","parameters":{"type":"object","properties":{"expression":{"type":"string","description":"Mathematical expression to evaluate (e.g. 2 + 2, sqrt(16), sin(pi/2))"}},"required":["expression"]}}],"system_role":"You have access to a calculator. Use calculate for any arithmetic, algebra, or trigonometry the user requests."}',
+ 'tools', '{"math","calculator","arithmetic","utility"}',
+ '{"identifier":"calculator","version":"1.0.0","meta":{"title":"Calculator","description":"Perform precise arithmetic calculations and unit conversions.","avatar":"🧮","tags":["math","calculator","arithmetic","utility"]},"api":[{"name":"calculate","description":"Evaluate a mathematical expression and return the result","parameters":{"type":"object","properties":{"expression":{"type":"string","description":"Mathematical expression to evaluate (e.g. 2 + 2, sqrt(16), sin(pi/2))"}},"required":["expression"]}}],"systemRole":"You have access to a calculator. Use calculate for any arithmetic, algebra, or trigonometry the user requests.","type":"default"}',
true),
('image-gen', 'Image Generator', 'Generate images from text descriptions using AI.',
- 'creative', '{"image","ai","creative","generation"}',
- '{"schema_version":"plugin/1.0","identifier":"image-gen","version":"1.0.0","meta":{"title":"Image Generator","description":"Generate images from text descriptions using AI.","tags":["image","ai","creative","generation"],"category":"creative"},"api":[{"name":"generate_image","description":"Generate an image from a text prompt","url":null,"method":"POST","parameters":{"type":"object","properties":{"prompt":{"type":"string","description":"Detailed description of the image to generate"},"style":{"type":"string","description":"Art style (e.g. photorealistic, cartoon, watercolor)","default":"photorealistic"},"size":{"type":"string","description":"Image dimensions","enum":["512x512","1024x1024","1792x1024"],"default":"1024x1024"}},"required":["prompt"]}}],"system_role":"You can generate images from text descriptions. Use generate_image when the user asks you to create, draw, or visualize something."}',
+ 'media-generate', '{"image","ai","creative","generation"}',
+ '{"identifier":"image-gen","version":"1.0.0","meta":{"title":"Image Generator","description":"Generate images from text descriptions using AI.","avatar":"🎨","tags":["image","ai","creative","generation"]},"api":[{"name":"generate_image","description":"Generate an image from a text prompt","parameters":{"type":"object","properties":{"prompt":{"type":"string","description":"Detailed description of the image to generate"},"style":{"type":"string","description":"Art style (e.g. photorealistic, cartoon, watercolor)","default":"photorealistic"},"size":{"type":"string","description":"Image dimensions","enum":["512x512","1024x1024","1792x1024"],"default":"1024x1024"}},"required":["prompt"]}}],"systemRole":"You can generate images from text descriptions. Use generate_image when the user asks you to create, draw, or visualize something.","type":"default"}',
true),
('weather', 'Weather', 'Get real-time weather conditions and forecasts for any location.',
- 'utility', '{"weather","forecast","location","utility"}',
- '{"schema_version":"plugin/1.0","identifier":"weather","version":"1.0.0","meta":{"title":"Weather","description":"Get real-time weather conditions and forecasts for any location.","tags":["weather","forecast","location","utility"],"category":"utility"},"api":[{"name":"get_weather","description":"Get current weather conditions for a location","url":null,"method":"POST","parameters":{"type":"object","properties":{"location":{"type":"string","description":"City name or coordinates (lat,lon)"},"units":{"type":"string","description":"Temperature units","enum":["celsius","fahrenheit"],"default":"celsius"}},"required":["location"]}},{"name":"get_forecast","description":"Get a multi-day weather forecast for a location","url":null,"method":"POST","parameters":{"type":"object","properties":{"location":{"type":"string","description":"City name or coordinates"},"days":{"type":"integer","description":"Number of forecast days (1-7)","default":3},"units":{"type":"string","description":"Temperature units","enum":["celsius","fahrenheit"],"default":"celsius"}},"required":["location"]}}],"system_role":"You can retrieve live weather conditions and forecasts. Use get_weather for current conditions and get_forecast for multi-day outlooks."}',
+ 'tools', '{"weather","forecast","location","utility"}',
+ '{"identifier":"weather","version":"1.0.0","meta":{"title":"Weather","description":"Get real-time weather conditions and forecasts for any location.","avatar":"🌤️","tags":["weather","forecast","location","utility"]},"api":[{"name":"get_weather","description":"Get current weather conditions for a location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"City name or coordinates (lat,lon)"},"units":{"type":"string","description":"Temperature units","enum":["celsius","fahrenheit"],"default":"celsius"}},"required":["location"]}},{"name":"get_forecast","description":"Get a multi-day weather forecast for a location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"City name or coordinates"},"days":{"type":"integer","description":"Number of forecast days (1-7)","default":3},"units":{"type":"string","description":"Temperature units","enum":["celsius","fahrenheit"],"default":"celsius"}},"required":["location"]}}],"systemRole":"You can retrieve live weather conditions and forecasts. Use get_weather for current conditions and get_forecast for multi-day outlooks.","type":"default"}',
true),
('code-runner', 'Code Runner', 'Execute Python, JavaScript, or shell code snippets in a sandbox.',
- 'developer', '{"code","python","javascript","developer","sandbox"}',
- '{"schema_version":"plugin/1.0","identifier":"code-runner","version":"1.0.0","meta":{"title":"Code Runner","description":"Execute Python, JavaScript, or shell code snippets in a sandbox.","tags":["code","python","javascript","developer","sandbox"],"category":"developer"},"api":[{"name":"run_code","description":"Execute a code snippet in a sandboxed environment","url":null,"method":"POST","parameters":{"type":"object","properties":{"code":{"type":"string","description":"The code to execute"},"language":{"type":"string","description":"Programming language","enum":["python","javascript","bash"],"default":"python"}},"required":["code"]}}],"system_role":"You can run code in a secure sandbox. Use run_code when the user wants to test code, run calculations, or verify logic."}',
+ 'tools', '{"code","python","javascript","developer","sandbox"}',
+ '{"identifier":"code-runner","version":"1.0.0","meta":{"title":"Code Runner","description":"Execute Python, JavaScript, or shell code snippets in a sandbox.","avatar":"💻","tags":["code","python","javascript","developer","sandbox"]},"api":[{"name":"run_code","description":"Execute a code snippet in a sandboxed environment","parameters":{"type":"object","properties":{"code":{"type":"string","description":"The code to execute"},"language":{"type":"string","description":"Programming language","enum":["python","javascript","bash"],"default":"python"}},"required":["code"]}}],"systemRole":"You can run code in a secure sandbox. Use run_code when the user wants to test code, run calculations, or verify logic.","type":"default"}',
true),
('tradingview', 'TradingView Charts', 'Embed live candlestick charts for any crypto or stock symbol.',
- 'finance', '{"finance","crypto","stocks","charts","tradingview"}',
- '{"schema_version":"plugin/1.0","identifier":"tradingview","version":"1.0.0","meta":{"title":"TradingView Charts","description":"Embed live candlestick charts for any crypto or stock symbol.","tags":["finance","crypto","stocks","charts","tradingview"],"category":"finance"},"api":[{"name":"show_chart","description":"Display a TradingView chart for a symbol","url":null,"method":"POST","parameters":{"type":"object","properties":{"symbol":{"type":"string","description":"Ticker symbol (e.g. BTCUSDT, AAPL, EURUSD)"},"interval":{"type":"string","description":"Chart interval","enum":["1m","5m","15m","1h","4h","1D","1W"],"default":"1D"},"theme":{"type":"string","description":"Chart color theme","enum":["dark","light"],"default":"dark"}},"required":["symbol"]}}],"system_role":"You can show live TradingView charts. Use show_chart when the user asks about price action, charts, or technical analysis for any tradable symbol."}',
+ 'stocks-finance', '{"finance","crypto","stocks","charts","tradingview"}',
+ '{"identifier":"tradingview","version":"1.0.0","meta":{"title":"TradingView Charts","description":"Embed live candlestick charts for any crypto or stock symbol.","avatar":"📈","tags":["finance","crypto","stocks","charts","tradingview"]},"api":[{"name":"show_chart","description":"Display a TradingView chart for a symbol","parameters":{"type":"object","properties":{"symbol":{"type":"string","description":"Ticker symbol (e.g. BTCUSDT, AAPL, EURUSD)"},"interval":{"type":"string","description":"Chart interval","enum":["1m","5m","15m","1h","4h","1D","1W"],"default":"1D"},"theme":{"type":"string","description":"Chart color theme","enum":["dark","light"],"default":"dark"}},"required":["symbol"]}}],"ui":{"url":"https://three.ws/widgets/tradingview","height":480},"systemRole":"You can show live TradingView charts. Use show_chart when the user asks about price action, charts, or technical analysis for any tradable symbol.","type":"default"}',
true)
on conflict (identifier, author_id) do nothing;
diff --git a/api/plugins/[action].js b/api/plugins/[action].js
index 3a7f73a6b..b8151689f 100644
--- a/api/plugins/[action].js
+++ b/api/plugins/[action].js
@@ -21,16 +21,16 @@ const VALID_SORTS = new Set(['popular', 'new', 'az']);
const MAX_MANIFEST_BYTES = 64 * 1024; // 64 KB
const FETCH_TIMEOUT_MS = 8000;
-// ── Manifest validation (mirrors src/plugins/index.js) ───────────────────────
+// ── Manifest validation — LobeHub/pai-chat ToolManifest format ───────────────
+// Required: identifier, meta.title, api[]
+// Optional: systemRole, type, settings, version, openapi, gateway, ui
function validateManifest(json) {
if (!json || typeof json !== 'object') throw new Error('Manifest must be a JSON object');
- if (!String(json.schema_version || '').startsWith('plugin/'))
- throw new Error('Invalid schema_version — expected "plugin/1.x"');
if (!json.identifier || typeof json.identifier !== 'string')
throw new Error('Missing identifier');
- if (!/^[a-z0-9-_]+$/i.test(json.identifier))
- throw new Error('identifier must be alphanumeric + hyphens/underscores');
+ if (!/^[a-z0-9._-]+$/i.test(json.identifier))
+ throw new Error('identifier must be alphanumeric with dots, hyphens, or underscores');
if (!json.meta?.title) throw new Error('Missing meta.title');
if (!Array.isArray(json.api) || !json.api.length)
throw new Error('api must be a non-empty array');
diff --git a/chat/src/SkillsMarketplaceModal.svelte b/chat/src/SkillsMarketplaceModal.svelte
index 16e95ef4b..6b07531b1 100644
--- a/chat/src/SkillsMarketplaceModal.svelte
+++ b/chat/src/SkillsMarketplaceModal.svelte
@@ -9,6 +9,7 @@
// Browse state
let skills = [];
let loading = false;
+ let fetchFailed = false;
let searchQuery = '';
let debouncedSearch = '';
let selectedCategory = null;
@@ -121,6 +122,7 @@
async function loadSkills(reset = false) {
loading = true;
+ fetchFailed = false;
try {
const p = new URLSearchParams();
if (debouncedSearch) p.set('q', debouncedSearch);
@@ -135,6 +137,7 @@
page = data.next_cursor || null;
hasMore = !!data.next_cursor;
} catch (e) {
+ fetchFailed = true;
notify(e.message, 'error');
} finally {
loading = false;
@@ -434,10 +437,12 @@
// init and keyboard
- $: if (open && skills.length === 0) {
+ $: if (open && skills.length === 0 && !loading && !fetchFailed) {
Promise.all([loadSkills(true), loadCategories()]);
}
+ $: if (!open) fetchFailed = false;
+
$: tagPills = publishForm.tags
.split(',')
.map((t) => t.trim())
diff --git a/src/app.js b/src/app.js
index 87aab4904..3eef8168a 100644
--- a/src/app.js
+++ b/src/app.js
@@ -1371,6 +1371,22 @@ class App {
if (this.skills) {
window.VIEWER.agent_skills = this.skills;
}
+
+ // Wire ElevenLabs frequency-based lipsync to the avatar.
+ // onStart fires when audio is actually playing (analyserNode already wired).
+ // BrowserTTS has no analyserNode, so it skips connectLipSync and continues
+ // using the text-based startLipsync path already in speech.js.
+ if (this.runtime?.tts) {
+ const tts = this.runtime.tts;
+ const avatar = this.avatar;
+ tts.onStart = () => {
+ if (tts.analyserNode) avatar.connectLipSync(tts.analyserNode);
+ };
+ tts.onEnd = () => {
+ avatar._lipSync?.disconnect();
+ avatar._lipSync = null;
+ };
+ }
}
/**
diff --git a/vercel.json b/vercel.json
index cc6447d58..b65f98110 100644
--- a/vercel.json
+++ b/vercel.json
@@ -779,28 +779,16 @@
"dest": "/discover/$1"
},
{
- "src": "/api/plugins/categories",
- "dest": "/api/plugins/[action]?action=categories"
- },
- {
- "src": "/api/plugins/list",
- "dest": "/api/plugins/[action]?action=list"
- },
- {
- "src": "/api/plugins/import",
- "dest": "/api/plugins/[action]?action=import"
- },
- {
- "src": "/api/plugins/publish",
- "dest": "/api/plugins/[action]?action=publish"
+ "src": "/api/plugins/([^/]+)/install",
+ "dest": "/api/plugins/[action]?id=$1&sub=install"
},
{
- "src": "/api/plugins/([^/]+)/install",
- "dest": "/api/plugins/[action]?action=$1/install"
+ "src": "/api/plugins/(categories|list|import|publish)",
+ "dest": "/api/plugins/[action]?action=$1"
},
{
"src": "/api/plugins/([^/]+)",
- "dest": "/api/plugins/[action]?action=$1"
+ "dest": "/api/plugins/[action]?id=$1"
},
{
"src": "/api/skills/categories",