andy-stack_vaultkeeper-ai/AIClasses/FunctionDefinitions/Functions/SearchVaultFiles.ts
Andrew Beal 2de8109a74 refactor: restructure AI prompt and agent architecture for multi-agent planning support
- Move prompts from AIClasses to AIPrompts directory
- Replace centralized IPrompt injection with direct property setters on IAIClass
- Remove allowDestructiveActions parameter from streamRequest methods
- Add toolDefinitions, systemPrompt, and userInstruction properties to IAIClass
- Refactor AIFunctionDefinitions to static methods with agent-specific tool sets
- Add planning agent function definitions (CreatePlan, Replan, CompleteStep, SubmitPlan)
- Create AIControllerService to handle agent orchestration
- Add execution plan related copy strings and replacement utility
- Update all AI providers (Claude, Gemini, OpenAI) to use new architecture
2025-12-30 19:07:00 +00:00

31 lines
No EOL
1.5 KiB
TypeScript

import { AIFunction } from "Enums/AIFunction";
import type { IAIFunctionDefinition } from "../IAIFunctionDefinition";
export const SearchVaultFiles: IAIFunctionDefinition = {
name: AIFunction.SearchVaultFiles,
description: `Searches the content of all vault files using regex pattern matching.
Returns files containing any of the search terms with contextual snippets showing where matches appear.
Use this function when you need to:
- Find specific concepts, keywords, or text within note contents
- Locate content matching multiple patterns or phrases
- Answer questions about what the user has written about a topic
- Search across both file names and file contents simultaneously
- Search for multiple related terms or variations in a single query`,
parameters: {
type: "object",
properties: {
search_terms: {
type: "array",
items: {
type: "string"
},
description: "Search patterns for vault files (searches both names and content). Supports plain text (case-insensitive) or regex literals with /pattern/flags format. Examples: \"meeting notes\", /\\bproject\\b/i, /(k8s|kubernetes)/i. Returns files matching ANY term (OR logic).",
},
user_message: {
type: "string",
description: "A short message to be displayed to the user explaining what is being searched for. Example: 'Searching for notes about project meetings' or 'Finding files containing todo items'"
}
},
required: ["search_terms", "user_message"]
}
}