Fix agent routing and E2E create flow
This commit is contained in:
@@ -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 }),
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user