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
/** Keep a short final word pair together without forcing long URLs to overflow. */
export function keepLastWords(text: string, maxPairLength = 32): string {
return text.replace(
/(\S+)\s+(\S+)(\s*)$/,
(match, penultimate: string, last: string, trailing: string) =>
penultimate.length + last.length <= maxPairLength
? `${penultimate}\u00a0${last}${trailing}`
: match
);
}