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
{
"db_name": "PostgreSQL",
"query": "\n SELECT\n d.id as \"document_id\",\n COALESCE(db.id, di.id) as \"document_version_id!\",\n d.name as \"document_name\",\n d.\"fileType\" as \"file_type\",\n d.\"branchedFromId\" as branched_from_id,\n d.\"branchedFromVersionId\" as branched_from_version_id,\n d.\"documentFamilyId\" as document_family_id,\n d.\"createdAt\"::timestamptz as created_at,\n d.\"updatedAt\"::timestamptz as updated_at\n FROM\n \"Document\" d\n LEFT JOIN LATERAL (\n SELECT\n i.id\n FROM\n \"DocumentInstance\" i\n WHERE\n i.\"documentId\" = d.id\n ORDER BY\n i.\"createdAt\" DESC\n LIMIT 1\n ) di ON d.\"fileType\" IS DISTINCT FROM 'docx'\n LEFT JOIN LATERAL (\n SELECT\n b.id\n FROM\n \"DocumentBom\" b\n WHERE\n b.\"documentId\" = d.id\n ORDER BY\n b.\"createdAt\" DESC\n LIMIT 1\n ) db ON d.\"fileType\" = 'docx'\n WHERE\n d.owner = $1 AND d.\"deletedAt\" IS NULL\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "document_id",
"type_info": "Text"
},
{
"ordinal": 1,
"name": "document_version_id!",
"type_info": "Int8"
},
{
"ordinal": 2,
"name": "document_name",
"type_info": "Text"
},
{
"ordinal": 3,
"name": "file_type",
"type_info": "Text"
},
{
"ordinal": 4,
"name": "branched_from_id",
"type_info": "Text"
},
{
"ordinal": 5,
"name": "branched_from_version_id",
"type_info": "Int8"
},
{
"ordinal": 6,
"name": "document_family_id",
"type_info": "Int8"
},
{
"ordinal": 7,
"name": "created_at",
"type_info": "Timestamptz"
},
{
"ordinal": 8,
"name": "updated_at",
"type_info": "Timestamptz"
}
],
"parameters": {
"Left": [
"Text"
]
},
"nullable": [
false,
null,
false,
true,
true,
true,
true,
null,
null
]
},
"hash": "2500e65cc47f0cfb5cf99c7b4aa87ca672780591c4b7b2ff5429121d5b4594bf"
}