Files
oh-my-pi/packages/coding-agent/src/capability/tool.ts
T
can1357 fcbfab765b refactor: consolidated module import paths
- Removed custom TypeScript path aliases and the associated transformation script.
- Replaced aliased imports with direct `@oh-my-pi` package imports for improved clarity.
- Simplified internal module references by removing explicit `/index` suffixes.
2026-01-23 21:01:13 +01:00

39 lines
905 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;
},
});