Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
import { throwOnErr } from '@core/util/result';
import {
type AgentConversation,
type AgentConversationTurn,
retryAgentConversationTurn,
} from '@service-agent-harness/agent-conversations';
import { useMutation } from '@tanstack/solid-query';
type ConversationControl = {
type: 'retry';
conversation: Pick<AgentConversation, 'channelId' | 'botId'>;
turn: AgentConversationTurn;
};
export function useAgentConversationControl(callbacks: {
onSuccess: () => void;
onError: () => void;
}) {
return useMutation(() => ({
mutationFn: async (action: ConversationControl) => {
await throwOnErr(() =>
retryAgentConversationTurn(action.conversation, action.turn)
);
},
...callbacks,
}));
}