mirror of
https://github.com/andy-stack/vaultkeeper-ai.git
synced 2026-07-22 06:42:03 +00:00
- Rename ReadFile to ReadVaultFile for consistency - Add WriteVaultFile function for destructive operations - Fix array concatenation bug in getQueryActions - Return all vault files when search yields no results - Update SearchVaultFiles description to clarify fallback behavior - Improve error handling in writeFile to return error details - Reorder system prompt sections for better clarity
21 lines
No EOL
616 B
TypeScript
21 lines
No EOL
616 B
TypeScript
import type { IAIFunctionDefinition } from "./IAIFunctionDefinition";
|
|
import { SearchVaultFiles } from "./Functions/SearchVaultFiles";
|
|
import { ReadVaultFile } from "./Functions/ReadVaultFile";
|
|
import { WriteVaultFile } from "./Functions/WriteVaultFile";
|
|
|
|
export class AIFunctionDefinitions {
|
|
public getQueryActions(destructive: boolean): IAIFunctionDefinition[] {
|
|
let actions = [
|
|
SearchVaultFiles,
|
|
ReadVaultFile
|
|
];
|
|
|
|
if (destructive) {
|
|
actions = actions.concat([
|
|
WriteVaultFile
|
|
]);
|
|
}
|
|
|
|
return actions;
|
|
}
|
|
} |