feat(tools): add ToolRegistry, ToolSearchTool and ExpertTool to support on-demand tool visibility, discovery, activation, and expert/subagent tooling; extend DualAgentOrchestrator API and interfaces to manage tool lifecycle
This commit is contained in:
@@ -1,5 +1,65 @@
|
||||
import * as plugins from './plugins.js';
|
||||
|
||||
// ================================
|
||||
// Tool Visibility & Registry Types
|
||||
// ================================
|
||||
|
||||
/**
|
||||
* Tool visibility mode
|
||||
* - 'initial': Conveyed to model in system prompt AND discoverable via search
|
||||
* - 'on-demand': Only discoverable via search, must be activated before use
|
||||
*/
|
||||
export type TToolVisibility = 'initial' | 'on-demand';
|
||||
|
||||
/**
|
||||
* Tool metadata for discovery and management
|
||||
*/
|
||||
export interface IToolMetadata {
|
||||
name: string;
|
||||
description: string;
|
||||
actions: IToolAction[];
|
||||
visibility: TToolVisibility;
|
||||
isActivated: boolean;
|
||||
isInitialized: boolean;
|
||||
tags?: string[];
|
||||
category?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options when registering a tool
|
||||
*/
|
||||
export interface IToolRegistrationOptions {
|
||||
visibility?: TToolVisibility;
|
||||
tags?: string[];
|
||||
category?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Configuration for creating an Expert (SubAgent)
|
||||
*/
|
||||
export interface IExpertConfig {
|
||||
/** Unique name for the expert */
|
||||
name: string;
|
||||
/** Description of the expert's capabilities */
|
||||
description: string;
|
||||
/** System message defining expert behavior */
|
||||
systemMessage: string;
|
||||
/** Guardian policy for the expert's inner agent */
|
||||
guardianPolicy: string;
|
||||
/** AI provider (defaults to parent's provider) */
|
||||
provider?: plugins.smartai.TProvider;
|
||||
/** Tools available to this expert */
|
||||
tools?: IAgentToolWrapper[];
|
||||
/** Max iterations for expert tasks (default: 10) */
|
||||
maxIterations?: number;
|
||||
/** Visibility mode (default: 'initial') */
|
||||
visibility?: TToolVisibility;
|
||||
/** Searchable tags */
|
||||
tags?: string[];
|
||||
/** Category for grouping */
|
||||
category?: string;
|
||||
}
|
||||
|
||||
// ================================
|
||||
// Task Run Options
|
||||
// ================================
|
||||
|
||||
Reference in New Issue
Block a user