Fix agent routing and E2E create flow

This commit is contained in:
Mohamed Boudra
2026-01-24 20:20:56 +07:00
parent 3e2d403f1b
commit dc4839e2c0
14 changed files with 204 additions and 147 deletions
@@ -0,0 +1,27 @@
import { create } from "zustand";
type PendingCreateAttempt = {
serverId: string;
agentId: string | null;
messageId: string;
text: string;
timestamp: number;
};
type CreateFlowState = {
pending: PendingCreateAttempt | null;
setPending: (pending: PendingCreateAttempt) => void;
updateAgentId: (agentId: string) => void;
clear: () => void;
};
export const useCreateFlowStore = create<CreateFlowState>((set) => ({
pending: null,
setPending: (pending) => set({ pending }),
updateAgentId: (agentId) =>
set((state) =>
state.pending ? { pending: { ...state.pending, agentId } } : state
),
clear: () => set({ pending: null }),
}));