b8e82008e3
- Added `toExtensionId()` method to all capability types for granular extension identification and disabling. - Added `disabledExtensions` and `includeDisabled` options to LoadOptions for filtering disabled capabilities by extension ID. - Added plugin manifest support for `extensions` entry points with automatic discovery from installed plugins. - Fixed skill loading to properly respect disabled skill names from custom directories. - Improved cross-platform path handling by using `path.basename()` instead of string splitting in context file and state manager. - Refactored capability index loading to validate source metadata and filter disabled extensions before processing.
39 lines
944 B
TypeScript
39 lines
944 B
TypeScript
/**
|
|
* Custom Tools Capability
|
|
*
|
|
* User-defined tools that extend agent capabilities.
|
|
*/
|
|
import { defineCapability } from ".";
|
|
import type { SourceMeta } from "./types";
|
|
|
|
/**
|
|
* A custom tool definition.
|
|
*/
|
|
export interface CustomTool {
|
|
/** Tool name (unique key) */
|
|
name: string;
|
|
/** Absolute path to tool definition file */
|
|
path: string;
|
|
/** Tool description */
|
|
description: string;
|
|
/** Tool implementation (script path or inline) */
|
|
implementation?: string;
|
|
/** Source level */
|
|
level: "user" | "project";
|
|
/** Source metadata */
|
|
_source: SourceMeta;
|
|
}
|
|
|
|
export const toolCapability = defineCapability<CustomTool>({
|
|
id: "tools",
|
|
displayName: "Custom Tools",
|
|
description: "User-defined tools that extend agent capabilities",
|
|
key: tool => tool.name,
|
|
toExtensionId: tool => `tool:${tool.name}`,
|
|
validate: tool => {
|
|
if (!tool.name) return "Missing name";
|
|
if (!tool.path) return "Missing path";
|
|
return undefined;
|
|
},
|
|
});
|