feat: Add intelligent auto-router and enhanced integrations
- Add intelligent-router.sh hook for automatic agent routing - Add AUTO-TRIGGER-SUMMARY.md documentation - Add FINAL-INTEGRATION-SUMMARY.md documentation - Complete Prometheus integration (6 commands + 4 tools) - Complete Dexto integration (12 commands + 5 tools) - Enhanced Ralph with access to all agents - Fix /clawd command (removed disable-model-invocation) - Update hooks.json to v5 with intelligent routing - 291 total skills now available - All 21 commands with automatic routing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
56
dexto/packages/webui/components/hooks/useMemories.ts
Normal file
56
dexto/packages/webui/components/hooks/useMemories.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
||||
import { queryKeys } from '@/lib/queryKeys';
|
||||
import { client } from '@/lib/client';
|
||||
|
||||
export function useMemories(enabled: boolean = true) {
|
||||
return useQuery({
|
||||
queryKey: queryKeys.memories.all,
|
||||
queryFn: async () => {
|
||||
const response = await client.api.memory.$get({ query: {} });
|
||||
if (!response.ok) {
|
||||
throw new Error(`Failed to fetch memories: ${response.status}`);
|
||||
}
|
||||
const data = await response.json();
|
||||
return data.memories;
|
||||
},
|
||||
enabled,
|
||||
staleTime: 30 * 1000, // 30 seconds - memories can be added during chat
|
||||
});
|
||||
}
|
||||
|
||||
export function useDeleteMemory() {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
return useMutation({
|
||||
mutationFn: async ({ memoryId }: { memoryId: string }) => {
|
||||
const response = await client.api.memory[':id'].$delete({ param: { id: memoryId } });
|
||||
if (!response.ok) {
|
||||
throw new Error(`Failed to delete memory: ${response.status}`);
|
||||
}
|
||||
return memoryId;
|
||||
},
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: queryKeys.memories.all });
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export function useCreateMemory() {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
return useMutation({
|
||||
mutationFn: async (payload: Parameters<typeof client.api.memory.$post>[0]['json']) => {
|
||||
const response = await client.api.memory.$post({ json: payload });
|
||||
if (!response.ok) {
|
||||
throw new Error(`Failed to create memory: ${response.status}`);
|
||||
}
|
||||
return await response.json();
|
||||
},
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: queryKeys.memories.all });
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// Export inferred types for components to use
|
||||
export type Memory = NonNullable<ReturnType<typeof useMemories>['data']>[number];
|
||||
Reference in New Issue
Block a user