mirror of
https://github.com/andy-stack/vaultkeeper-ai.git
synced 2026-07-22 06:42:03 +00:00
Add Exception helper class for consistent error handling and logging. Replace throw statements and console.error calls with Exception methods. Update service methods to return Error | T instead of mixed success/failure objects. Improve type safety in Claude.extractContents with explicit return type. Add WikiLinks helper to VaultCacheService for managing wiki link references. Update unit tests.
21 lines
No EOL
694 B
TypeScript
21 lines
No EOL
694 B
TypeScript
import { Exception } from "Helpers/Exception";
|
|
|
|
export enum AIFunction {
|
|
SearchVaultFiles = "search_vault_files",
|
|
ReadVaultFiles = "read_vault_files",
|
|
WriteVaultFile = "write_vault_file",
|
|
DeleteVaultFiles = "delete_vault_files",
|
|
MoveVaultFiles = "move_vault_files",
|
|
ListVaultFiles = "list_vault_files",
|
|
|
|
// only used by gemini
|
|
RequestWebSearch = "request_web_search",
|
|
}
|
|
|
|
export function fromString(functionName: string): AIFunction {
|
|
const enumValue = Object.values(AIFunction).find((value: string) => value === functionName);
|
|
if (enumValue) {
|
|
return enumValue as AIFunction;
|
|
}
|
|
Exception.throw(`Unknown function name: ${functionName}`);
|
|
} |