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
export const SPREADSHEET_COMMENT_PARAMS = { commentId: 'comment_id' } as const;
export type SpreadsheetCommentAnchor = {
sheetId: string;
sheetName: string;
range: string;
};
export function spreadsheetCommentAnchor(
value: unknown
): SpreadsheetCommentAnchor | undefined {
if (
!value ||
typeof value !== 'object' ||
!('type' in value) ||
value.type !== 'spreadsheet' ||
!('sheetId' in value) ||
!('sheetName' in value) ||
!('range' in value)
)
return;
if (
typeof value.sheetId !== 'string' ||
!value.sheetId ||
typeof value.sheetName !== 'string' ||
typeof value.range !== 'string'
)
return;
const addresses = value.range.split(':');
if (
addresses.length > 2 ||
!addresses.every((address) => /^[A-Z]+[1-9]\d*$/.test(address))
)
return;
return {
sheetId: value.sheetId,
sheetName: value.sheetName,
range: value.range,
};
}