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 { createQueryKeys } from '@lukemorales/query-key-factory';
import type { MessageParent } from '@service-storage/messages';
export const messageKeys = createQueryKeys('messages', {
messages: (
parent: MessageParent,
loadAroundMessageId: string | null = null
) => ({ queryKey: [parent, { loadAroundMessageId }] }),
messagesByIds: (parent: MessageParent, messageIds: string[]) => ({
queryKey: [parent, { messageIds }],
}),
threadReplies: (parent: MessageParent, rootId: string) => ({
queryKey: [parent, rootId],
}),
postedComment: (documentId: string, markId: string) => ({
queryKey: [documentId, markId],
}),
resolveMessage: (parent: MessageParent, messageId: string) => ({
queryKey: [parent, messageId],
}),
});
export const MessageNonceKeys = {
MESSAGE: 'message',
REACTION: 'message-reaction',
} as const;
export const parentKey = (parent: MessageParent) =>
`${parent.type}:${parent.id}`;