779ca4872b
- Removed Prettier configuration files (.prettierignore and .prettierrc) and migrated formatting to Biome. - Updated Biome configuration from version 2.3.11 to 2.3.12 and changed arrowParentheses rule from 'always' to 'asNeeded'. - Pinned @biomejs/biome dependency to exact version 2.3.12 in package.json and bun.lock. - Applied consistent arrow function formatting across 489 files by removing unnecessary parentheses around single parameters. - Removed blank lines after comment blocks and reorganized imports for consistency across the codebase.
38 lines
900 B
TypeScript
38 lines
900 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,
|
|
validate: tool => {
|
|
if (!tool.name) return "Missing name";
|
|
if (!tool.path) return "Missing path";
|
|
return undefined;
|
|
},
|
|
});
|