builtin-tool

Build LobeHub builtin tool packages with manifests, executors, runtimes, and chat UI surfaces.

74|11|Updated Jul 4, 2024
One-click install
npx skills add https://github.com/OpenSourceAGI/qwksearch-research-agent --skill builtin-tool-opensourceagi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: builtin-tool
Source: https://github.com/OpenSourceAGI/qwksearch-research-agent/tree/main/apps/qwk-in-lobe/.agents/skills/builtin-tool
Command: npx skills add https://github.com/OpenSourceAGI/qwksearch-research-agent --skill builtin-tool-opensourceagi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Creating a new agent-callable builtin tool in the LobeHub codebase requires coordinating five separate faces — manifest, ExecutionRuntime, frontend executor, client UI surfaces, and registry wiring — and missing any one causes silent failures like "tool not found" or blank result cards. This Skill provides the complete authoring guide, conventions, and checklists to build these packages correctly. ## Core Features & Use Cases - Five-face architecture guidance: Covers manifest/types/systemRole, pure ExecutionRuntime with service injection, BaseExecutor subclass wiring, six optional client UI surfaces (Inspector, Render, Placeholder, Streaming, Intervention, Portal), and central registry registration. - Design rules and pitfalls: Enforces stable lobe-<domain> identifiers, as const ApiName objects, the mandatory toResult() funnel, result-domain-only pluginState, and i18n key conventions, with a symptom-to-cause diagnostics table. - Use Case: When adding a new packages/builtin-tool-<name>/ package or a new API to an existing tool, follow the authoring checklist and copy the closest reference tool (calculator, task, web-browsing, or local-system) to ship a working tool with correct Inspector, Render, and registry wiring. ## Quick Start Ask the agent to scaffold a new builtin tool package named lobe-notes with a manifest, ExecutionRuntime, executor, and Inspector following the builtin-tool conventions.

Frequently Asked Questions about builtin-tool

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a new LobeHub builtin tool package?

Create packages/builtin-tool-<name>/ with src/manifest.ts, types.ts, systemRole.ts, an ExecutionRuntime directory, and a client folder containing the executor and Inspector. Then register it in packages/builtin-tools/src/index.ts, identifiers.ts, inspectors.ts, and the executors slice.

What is the difference between ExecutionRuntime and the client executor?

ExecutionRuntime is pure runtime logic with services injected via constructor, containing no React or Zustand, and is callable from server or tests. The client executor extends BaseExecutor, wires frontend stores and services, delegates to the runtime, and funnels results through toResult().

Why does my builtin tool return ApiNotFound at runtime?

The executor method name does not exactly match the ApiName value, since BaseExecutor dispatches by invoking this[apiName]. Also ensure methods are arrow-function class fields, not class methods, so this stays bound when the registry invokes them.

When should I add Render, Placeholder, Streaming, or Intervention surfaces?

Only Inspector is required. Add Render for structured results, Placeholder for APIs with noticeable execution lag, Streaming for incremental output like command stdout, and Intervention when the manifest sets humanIntervention for destructive actions.

Why is the Debug pane blank even though pluginState was saved?

The executor returned undefined or empty content. Always return through the toResult() funnel, which guarantees content is never undefined by defaulting to the error message, and preserves partial state on failure.