mirror of
https://github.com/EthanMarti/infio-copilot.git
synced 2026-05-08 08:00:10 +00:00
- Introduces a new match_search_files tool for fuzzy/keyword search, integrating with Obsidian's core search plugin and updating Omnisearch integration for improved file search capabilities. - Adds settings for selecting search backends (core plugin, Omnisearch, ripgrep) for both regex and match searches. - Updates language files, prompts, and types to support the new functionality. - Restructures search-related files for better organization.
109 lines
2.1 KiB
TypeScript
109 lines
2.1 KiB
TypeScript
/**
|
|
* 用于指定插入内容的工具参数
|
|
*/
|
|
|
|
export enum ApplyStatus {
|
|
Idle = 0,
|
|
Applied = 1,
|
|
Failed = 2,
|
|
Rejected = 3,
|
|
}
|
|
|
|
export type ReadFileToolArgs = {
|
|
type: 'read_file';
|
|
filepath?: string;
|
|
}
|
|
|
|
export type ListFilesToolArgs = {
|
|
type: 'list_files';
|
|
filepath?: string;
|
|
recursive?: boolean;
|
|
}
|
|
|
|
export type MatchSearchFilesToolArgs = {
|
|
type: 'match_search_files';
|
|
filepath?: string;
|
|
query?: string;
|
|
file_pattern?: string;
|
|
finish?: boolean;
|
|
}
|
|
|
|
export type RegexSearchFilesToolArgs = {
|
|
type: 'regex_search_files';
|
|
filepath?: string;
|
|
regex?: string;
|
|
file_pattern?: string;
|
|
finish?: boolean;
|
|
}
|
|
|
|
export type SemanticSearchFilesToolArgs = {
|
|
type: 'semantic_search_files';
|
|
filepath?: string;
|
|
query?: string;
|
|
finish?: boolean;
|
|
}
|
|
export type WriteToFileToolArgs = {
|
|
type: 'write_to_file';
|
|
filepath?: string;
|
|
content?: string;
|
|
startLine?: number;
|
|
endLine?: number;
|
|
}
|
|
|
|
export type InsertContentToolArgs = {
|
|
type: 'insert_content';
|
|
filepath?: string;
|
|
content?: string;
|
|
startLine?: number;
|
|
endLine?: number;
|
|
}
|
|
|
|
export type SearchAndReplaceToolArgs = {
|
|
type: 'search_and_replace';
|
|
filepath: string;
|
|
operations: {
|
|
search: string;
|
|
replace: string;
|
|
startLine?: number;
|
|
endLine?: number;
|
|
useRegex?: boolean;
|
|
ignoreCase?: boolean;
|
|
regexFlags?: string;
|
|
}[];
|
|
}
|
|
|
|
export type ApplyDiffToolArgs = {
|
|
type: 'apply_diff';
|
|
filepath: string;
|
|
diff: string;
|
|
finish?: boolean;
|
|
}
|
|
|
|
export type SearchWebToolArgs = {
|
|
type: 'search_web';
|
|
query: string;
|
|
finish?: boolean;
|
|
}
|
|
|
|
export type FetchUrlsContentToolArgs = {
|
|
type: 'fetch_urls_content';
|
|
urls: string[];
|
|
finish?: boolean;
|
|
}
|
|
|
|
export type SwitchModeToolArgs = {
|
|
type: 'switch_mode';
|
|
mode: string;
|
|
reason: string;
|
|
finish?: boolean;
|
|
}
|
|
|
|
export type UseMcpToolArgs = {
|
|
type: 'use_mcp_tool';
|
|
server_name: string;
|
|
tool_name: string;
|
|
parameters: Record<string, unknown>;
|
|
}
|
|
|
|
export type ToolArgs = ReadFileToolArgs | WriteToFileToolArgs | InsertContentToolArgs | SearchAndReplaceToolArgs | ListFilesToolArgs | MatchSearchFilesToolArgs | RegexSearchFilesToolArgs | SemanticSearchFilesToolArgs | SearchWebToolArgs | FetchUrlsContentToolArgs | SwitchModeToolArgs | ApplyDiffToolArgs | UseMcpToolArgs;
|