Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

feat(tags): enable tagging call record entities (#4703)

gbirman7d377efa77fd
diff --git a/.sqlx/query-089ddab77c715460d9e8573812b50ba5b5eb4ba617f613b80c1ac772db727669.json b/.sqlx/query-089ddab77c715460d9e8573812b50ba5b5eb4ba617f613b80c1ac772db727669.json
index ed4aa7bbf2..71348ac40d 100644
--- a/.sqlx/query-089ddab77c715460d9e8573812b50ba5b5eb4ba617f613b80c1ac772db727669.json
+++ b/.sqlx/query-089ddab77c715460d9e8573812b50ba5b5eb4ba617f613b80c1ac772db727669.json
@@ -34,7 +34,8 @@
"THREAD",
"USER",
"COMPANY",
- "TASK"
+ "TASK",
+ "CALL_RECORD"
]
}
}
diff --git a/.sqlx/query-3907578083a1a10d49eab63c85fd92d078cbce9ef2e968480ea475623ec76f63.json b/.sqlx/query-0b530d403bea9918c7c1f29423ffc27b74e91de13b7e560923f975d1d67f3d2b.json
similarity index 62%
rename from .sqlx/query-3907578083a1a10d49eab63c85fd92d078cbce9ef2e968480ea475623ec76f63.json
rename to .sqlx/query-0b530d403bea9918c7c1f29423ffc27b74e91de13b7e560923f975d1d67f3d2b.json
index 43ea9df225..f09c868847 100644
--- a/.sqlx/query-3907578083a1a10d49eab63c85fd92d078cbce9ef2e968480ea475623ec76f63.json
+++ b/.sqlx/query-0b530d403bea9918c7c1f29423ffc27b74e91de13b7e560923f975d1d67f3d2b.json
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
- "query": "\n SELECT\n cr.id AS \"call_id!\",\n cr.channel_id AS \"channel_id!\",\n cr.created_by AS \"created_by!\",\n cc.name AS \"channel_name?\"\n FROM call_records cr\n LEFT JOIN comms_channels cc ON cc.id = cr.channel_id\n WHERE cr.id = $1\n ",
+ "query": "\n SELECT\n cr.id AS \"call_id!\",\n cr.channel_id AS \"channel_id!\",\n cr.created_by AS \"created_by!\",\n cr.custom_name AS \"custom_name?\",\n cc.name AS \"channel_name?\"\n FROM call_records cr\n LEFT JOIN comms_channels cc ON cc.id = cr.channel_id\n WHERE cr.id = $1\n ",
"describe": {
"columns": [
{
@@ -20,6 +20,11 @@
},
{
"ordinal": 3,
+ "name": "custom_name?",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 4,
"name": "channel_name?",
"type_info": "Varchar"
}
@@ -33,8 +38,9 @@
false,
false,
false,
+ true,
true
]
},
- "hash": "3907578083a1a10d49eab63c85fd92d078cbce9ef2e968480ea475623ec76f63"
+ "hash": "0b530d403bea9918c7c1f29423ffc27b74e91de13b7e560923f975d1d67f3d2b"
}
diff --git a/.sqlx/query-17abbeaf7ccbb5164cf1d29f7c553e34a9164ae5129763481771597a731cc25f.json b/.sqlx/query-17abbeaf7ccbb5164cf1d29f7c553e34a9164ae5129763481771597a731cc25f.json
index c3e8e5b7f1..3effad5d4c 100644
--- a/.sqlx/query-17abbeaf7ccbb5164cf1d29f7c553e34a9164ae5129763481771597a731cc25f.json
+++ b/.sqlx/query-17abbeaf7ccbb5164cf1d29f7c553e34a9164ae5129763481771597a731cc25f.json
@@ -18,7 +18,8 @@
"THREAD",
"USER",
"COMPANY",
- "TASK"
+ "TASK",
+ "CALL_RECORD"
]
}
}
diff --git a/.sqlx/query-301f5b3142a30e271df62607b5743ff019bff1a5b0142fc260ff772837db3f39.json b/.sqlx/query-301f5b3142a30e271df62607b5743ff019bff1a5b0142fc260ff772837db3f39.json
index 3b5b423da4..a64a4e61fc 100644
--- a/.sqlx/query-301f5b3142a30e271df62607b5743ff019bff1a5b0142fc260ff772837db3f39.json
+++ b/.sqlx/query-301f5b3142a30e271df62607b5743ff019bff1a5b0142fc260ff772837db3f39.json
@@ -28,7 +28,8 @@
"THREAD",
"USER",
"COMPANY",
- "TASK"
+ "TASK",
+ "CALL_RECORD"
]
}
}
@@ -111,7 +112,8 @@
"THREAD",
"USER",
"COMPANY",
- "TASK"
+ "TASK",
+ "CALL_RECORD"
]
}
}
@@ -152,7 +154,8 @@
"THREAD",
"USER",
"COMPANY",
- "TASK"
+ "TASK",
+ "CALL_RECORD"
]
}
}
diff --git a/.sqlx/query-3f3b5a5d8734e3748d4e29d64cfa89baff99dae621e7cbd7a10017beec9485c8.json b/.sqlx/query-3f3b5a5d8734e3748d4e29d64cfa89baff99dae621e7cbd7a10017beec9485c8.json
index 5c152ecd5e..a562fc8cc7 100644
--- a/.sqlx/query-3f3b5a5d8734e3748d4e29d64cfa89baff99dae621e7cbd7a10017beec9485c8.json
+++ b/.sqlx/query-3f3b5a5d8734e3748d4e29d64cfa89baff99dae621e7cbd7a10017beec9485c8.json
@@ -23,7 +23,8 @@
"THREAD",
"USER",
"COMPANY",
- "TASK"
+ "TASK",
+ "CALL_RECORD"
]
}
}
diff --git a/.sqlx/query-45ac2a692bf3676d053ca1905fe8586ff1dd139822d3cbde8e125add5575194a.json b/.sqlx/query-45ac2a692bf3676d053ca1905fe8586ff1dd139822d3cbde8e125add5575194a.json
index fcef7e28e8..743e277ed9 100644
--- a/.sqlx/query-45ac2a692bf3676d053ca1905fe8586ff1dd139822d3cbde8e125add5575194a.json
+++ b/.sqlx/query-45ac2a692bf3676d053ca1905fe8586ff1dd139822d3cbde8e125add5575194a.json
@@ -24,7 +24,8 @@
"THREAD",
"USER",
"COMPANY",
- "TASK"
+ "TASK",
+ "CALL_RECORD"
]
}
}
diff --git a/.sqlx/query-462655d9cce541e4b25cb2d85e9d2e8ce3c84e28b4f459e4ea4ef62881278ae8.json b/.sqlx/query-462655d9cce541e4b25cb2d85e9d2e8ce3c84e28b4f459e4ea4ef62881278ae8.json
index 2dbdd8559c..6f47bbf27f 100644
--- a/.sqlx/query-462655d9cce541e4b25cb2d85e9d2e8ce3c84e28b4f459e4ea4ef62881278ae8.json
+++ b/.sqlx/query-462655d9cce541e4b25cb2d85e9d2e8ce3c84e28b4f459e4ea4ef62881278ae8.json
@@ -65,7 +65,8 @@
"THREAD",
"USER",
"COMPANY",
- "TASK"
+ "TASK",
+ "CALL_RECORD"
]
}
}
diff --git a/.sqlx/query-4cc83ea0dfe3d47bf30c18701f37f77a52760d279c5dbdeae68b88d329d8c124.json b/.sqlx/query-4cc83ea0dfe3d47bf30c18701f37f77a52760d279c5dbdeae68b88d329d8c124.json
index 146bcb925c..ef5af28e2b 100644
--- a/.sqlx/query-4cc83ea0dfe3d47bf30c18701f37f77a52760d279c5dbdeae68b88d329d8c124.json
+++ b/.sqlx/query-4cc83ea0dfe3d47bf30c18701f37f77a52760d279c5dbdeae68b88d329d8c124.json
@@ -23,7 +23,8 @@
"THREAD",
"USER",
"COMPANY",
- "TASK"
+ "TASK",
+ "CALL_RECORD"
]
}
}
diff --git a/.sqlx/query-4d75ecd9c8d6f98881d44d88d10ebc20de426c8aad90b680cc8ae351118e5495.json b/.sqlx/query-4d75ecd9c8d6f98881d44d88d10ebc20de426c8aad90b680cc8ae351118e5495.json
index 067614a699..30c7bb54c5 100644
--- a/.sqlx/query-4d75ecd9c8d6f98881d44d88d10ebc20de426c8aad90b680cc8ae351118e5495.json
+++ b/.sqlx/query-4d75ecd9c8d6f98881d44d88d10ebc20de426c8aad90b680cc8ae351118e5495.json
@@ -28,7 +28,8 @@
"THREAD",
"USER",
"COMPANY",
- "TASK"
+ "TASK",
+ "CALL_RECORD"
]
}
}
@@ -111,7 +112,8 @@
"THREAD",
"USER",
"COMPANY",
- "TASK"
+ "TASK",
+ "CALL_RECORD"
]
}
}
@@ -152,7 +154,8 @@
"THREAD",
"USER",
"COMPANY",
- "TASK"
+ "TASK",
+ "CALL_RECORD"
]
}
}
diff --git a/.sqlx/query-4e7dff37296c4976495ee40673ee20a6729b6ce030222e1776a0fd22d93bafb7.json b/.sqlx/query-4e7dff37296c4976495ee40673ee20a6729b6ce030222e1776a0fd22d93bafb7.json
index b54de1a07a..1634fc9c55 100644
--- a/.sqlx/query-4e7dff37296c4976495ee40673ee20a6729b6ce030222e1776a0fd22d93bafb7.json
+++ b/.sqlx/query-4e7dff37296c4976495ee40673ee20a6729b6ce030222e1776a0fd22d93bafb7.json
@@ -65,7 +65,8 @@
"THREAD",
"USER",
"COMPANY",
- "TASK"
+ "TASK",
+ "CALL_RECORD"
]
}
}
diff --git a/.sqlx/query-6fd87794b687b1687b8c4f0bc0390ffcc91811ae9909ce333273e6bf77013b03.json b/.sqlx/query-6fd87794b687b1687b8c4f0bc0390ffcc91811ae9909ce333273e6bf77013b03.json
index 354995e8a1..dd0f75ea70 100644
--- a/.sqlx/query-6fd87794b687b1687b8c4f0bc0390ffcc91811ae9909ce333273e6bf77013b03.json
+++ b/.sqlx/query-6fd87794b687b1687b8c4f0bc0390ffcc91811ae9909ce333273e6bf77013b03.json
@@ -65,7 +65,8 @@
"THREAD",
"USER",
"COMPANY",
- "TASK"
+ "TASK",
+ "CALL_RECORD"
]
}
}
@@ -119,7 +120,8 @@
"THREAD",
"USER",
"COMPANY",
- "TASK"
+ "TASK",
+ "CALL_RECORD"
]
}
}
diff --git a/.sqlx/query-79edd9ca0d31434d5d7a4db78a6b3f8eb316ff51e1099e40611ba77f5c048828.json b/.sqlx/query-79edd9ca0d31434d5d7a4db78a6b3f8eb316ff51e1099e40611ba77f5c048828.json
deleted file mode 100644
index 2cef855296..0000000000
--- a/.sqlx/query-79edd9ca0d31434d5d7a4db78a6b3f8eb316ff51e1099e40611ba77f5c048828.json
+++ /dev/null
@@ -1,119 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n WITH user_source_ids AS (\n SELECT cp.channel_id::text AS source_id\n FROM comms_channel_participants cp\n WHERE cp.user_id = $1 AND cp.left_at IS NULL\n UNION ALL\n SELECT t.team_id::text AS source_id\n FROM team_user t\n WHERE t.user_id = $1\n UNION ALL\n SELECT $1 AS source_id\n ),\n visible_calls AS (\n SELECT\n c.id AS call_id,\n c.channel_id,\n c.room_name,\n c.created_by,\n c.created_at AS started_at,\n NULL::timestamptz AS ended_at,\n NULL::bigint AS duration_ms,\n c.egress_id,\n c.recording_key,\n c.preview_url,\n c.recording_started_at,\n NULL::text AS custom_name,\n NULL::text AS summary,\n c.share_with_team,\n true AS is_active,\n CASE\n WHEN EXISTS (\n SELECT 1 FROM call_participants cp\n WHERE cp.call_id = c.id AND cp.user_id = $1\n ) THEN 'ATTENDED'::text\n WHEN EXISTS (\n SELECT 1 FROM comms_channel_participants ccp\n WHERE ccp.channel_id = c.channel_id\n AND ccp.user_id = $1\n AND ccp.left_at IS NULL\n ) THEN 'MISSED'::text\n ELSE 'UNATTENDED'::text\n END AS status\n FROM calls c\n WHERE EXISTS (\n SELECT 1 FROM entity_access ea\n JOIN user_source_ids u ON u.source_id = ea.source_id\n WHERE ea.entity_id = c.id\n AND ea.entity_type = 'call'\n )\n AND ($3::bool IS FALSE OR c.channel_id = ANY($4))\n AND ($5::bool IS FALSE OR c.id = ANY($6))\n UNION ALL\n SELECT\n cr.id AS call_id,\n cr.channel_id,\n cr.room_name,\n cr.created_by,\n cr.started_at,\n cr.ended_at,\n cr.duration_ms,\n cr.egress_id,\n cr.recording_key,\n cr.preview_url,\n cr.recording_started_at,\n cr.custom_name,\n cr.summary,\n cr.share_with_team,\n false AS is_active,\n CASE\n WHEN EXISTS (\n SELECT 1 FROM call_record_participants crp\n WHERE crp.call_record_id = cr.id AND crp.user_id = $1\n ) THEN 'ATTENDED'::text\n WHEN EXISTS (\n SELECT 1 FROM comms_channel_participants ccp\n WHERE ccp.channel_id = cr.channel_id\n AND ccp.user_id = $1\n AND ccp.left_at IS NULL\n ) THEN 'MISSED'::text\n ELSE 'UNATTENDED'::text\n END AS status\n FROM call_records cr\n WHERE EXISTS (\n SELECT 1 FROM entity_access ea\n JOIN user_source_ids u ON u.source_id = ea.source_id\n WHERE ea.entity_id = cr.id\n AND ea.entity_type = 'call'\n )\n AND ($3::bool IS FALSE OR cr.channel_id = ANY($4))\n AND ($5::bool IS FALSE OR cr.id = ANY($6))\n )\n SELECT\n call_id as \"call_id!\",\n channel_id as \"channel_id!\",\n room_name as \"room_name!\",\n created_by as \"created_by!\",\n started_at as \"started_at!\",\n ended_at,\n duration_ms,\n egress_id,\n recording_key,\n preview_url,\n recording_started_at,\n custom_name,\n summary,\n share_with_team as \"share_with_team!\",\n is_active as \"is_active!\",\n status as \"status!\"\n FROM visible_calls\n WHERE ($7::bool IS FALSE OR status = ANY($8::text[]))\n ORDER BY \"started_at!\" DESC\n LIMIT $2\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "call_id!",
- "type_info": "Uuid"
- },
- {
- "ordinal": 1,
- "name": "channel_id!",
- "type_info": "Uuid"
- },
- {
- "ordinal": 2,
- "name": "room_name!",
- "type_info": "Text"
- },
- {
- "ordinal": 3,
- "name": "created_by!",
- "type_info": "Text"
- },
- {
- "ordinal": 4,
- "name": "started_at!",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 5,
- "name": "ended_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 6,
- "name": "duration_ms",
- "type_info": "Int8"
- },
- {
- "ordinal": 7,
- "name": "egress_id",
- "type_info": "Text"
- },
- {
- "ordinal": 8,
- "name": "recording_key",
- "type_info": "Text"
- },
- {
- "ordinal": 9,
- "name": "preview_url",
- "type_info": "Text"
- },
- {
- "ordinal": 10,
- "name": "recording_started_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 11,
- "name": "custom_name",
- "type_info": "Text"
- },
- {
- "ordinal": 12,
- "name": "summary",
- "type_info": "Text"
- },
- {
- "ordinal": 13,
- "name": "share_with_team!",
- "type_info": "Bool"
- },
- {
- "ordinal": 14,
- "name": "is_active!",
- "type_info": "Bool"
- },
- {
- "ordinal": 15,
- "name": "status!",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- "Int8",
- "Bool",
- "UuidArray",
- "Bool",
- "UuidArray",
- "Bool",
- "TextArray"
- ]
- },
- "nullable": [
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null
- ]
- },
- "hash": "79edd9ca0d31434d5d7a4db78a6b3f8eb316ff51e1099e40611ba77f5c048828"
-}
diff --git a/.sqlx/query-7d08bfd9600cf2460a1ee8769d415d3963907a083ffe68ef8eaf679e898ca354.json b/.sqlx/query-7d08bfd9600cf2460a1ee8769d415d3963907a083ffe68ef8eaf679e898ca354.json
index 9b50011e48..9b7df6ca51 100644
--- a/.sqlx/query-7d08bfd9600cf2460a1ee8769d415d3963907a083ffe68ef8eaf679e898ca354.json
+++ b/.sqlx/query-7d08bfd9600cf2460a1ee8769d415d3963907a083ffe68ef8eaf679e898ca354.json
@@ -65,7 +65,8 @@
"THREAD",
"USER",
"COMPANY",
- "TASK"
+ "TASK",
+ "CALL_RECORD"
]
}
}
diff --git a/.sqlx/query-a63c0f9e0b3c58438d46cff265e3f412890402e3627b85d5dfb74a08d72787e1.json b/.sqlx/query-a63c0f9e0b3c58438d46cff265e3f412890402e3627b85d5dfb74a08d72787e1.json
index ae7e70b085..551831f606 100644
--- a/.sqlx/query-a63c0f9e0b3c58438d46cff265e3f412890402e3627b85d5dfb74a08d72787e1.json
+++ b/.sqlx/query-a63c0f9e0b3c58438d46cff265e3f412890402e3627b85d5dfb74a08d72787e1.json
@@ -65,7 +65,8 @@
"THREAD",
"USER",
"COMPANY",
- "TASK"
+ "TASK",
+ "CALL_RECORD"
]
}
}
diff --git a/.sqlx/query-b55a16688355355ab26840343edf126c876002a8f90e4d6dc299f22a1a91e34c.json b/.sqlx/query-b55a16688355355ab26840343edf126c876002a8f90e4d6dc299f22a1a91e34c.json
new file mode 100644
index 0000000000..f9ec0a09c4
--- /dev/null
+++ b/.sqlx/query-b55a16688355355ab26840343edf126c876002a8f90e4d6dc299f22a1a91e34c.json
@@ -0,0 +1,122 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "\n WITH user_source_ids AS (\n SELECT cp.channel_id::text AS source_id\n FROM comms_channel_participants cp\n WHERE cp.user_id = $1 AND cp.left_at IS NULL\n UNION ALL\n SELECT t.team_id::text AS source_id\n FROM team_user t\n WHERE t.user_id = $1\n UNION ALL\n SELECT $1 AS source_id\n ),\n visible_calls AS (\n SELECT\n c.id AS call_id,\n c.channel_id,\n c.room_name,\n c.created_by,\n c.created_at AS started_at,\n NULL::timestamptz AS ended_at,\n NULL::bigint AS duration_ms,\n c.egress_id,\n c.recording_key,\n c.preview_url,\n c.recording_started_at,\n NULL::text AS custom_name,\n NULL::text AS summary,\n c.share_with_team,\n true AS is_active,\n CASE\n WHEN EXISTS (\n SELECT 1 FROM call_participants cp\n WHERE cp.call_id = c.id AND cp.user_id = $1\n ) THEN 'ATTENDED'::text\n WHEN EXISTS (\n SELECT 1 FROM comms_channel_participants ccp\n WHERE ccp.channel_id = c.channel_id\n AND ccp.user_id = $1\n AND ccp.left_at IS NULL\n ) THEN 'MISSED'::text\n ELSE 'UNATTENDED'::text\n END AS status\n FROM calls c\n WHERE EXISTS (\n SELECT 1 FROM entity_access ea\n JOIN user_source_ids u ON u.source_id = ea.source_id\n WHERE ea.entity_id = c.id\n AND ea.entity_type = 'call'\n )\n AND ($3::bool IS FALSE OR c.channel_id = ANY($4))\n AND ($5::bool IS FALSE OR c.id = ANY($6))\n AND ($9::bool IS FALSE OR (\n ($11::bool IS FALSE AND EXISTS (\n SELECT 1 FROM entity_properties ep\n WHERE ep.entity_id = c.id::text\n AND ep.entity_type = 'CALL_RECORD'\n AND jsonb_typeof(ep.values -> 'value') = 'array'\n AND jsonb_exists_any(ep.values -> 'value', $10::text[])\n ))\n OR ($11::bool IS TRUE AND $10::text[] <@ (\n SELECT COALESCE(array_agg(elem), ARRAY[]::text[])\n FROM (\n SELECT values FROM entity_properties\n WHERE entity_id = c.id::text\n AND entity_type = 'CALL_RECORD'\n AND jsonb_typeof(values -> 'value') = 'array'\n ) ep\n CROSS JOIN LATERAL jsonb_array_elements_text(ep.values -> 'value') AS elem\n ))\n ))\n UNION ALL\n SELECT\n cr.id AS call_id,\n cr.channel_id,\n cr.room_name,\n cr.created_by,\n cr.started_at,\n cr.ended_at,\n cr.duration_ms,\n cr.egress_id,\n cr.recording_key,\n cr.preview_url,\n cr.recording_started_at,\n cr.custom_name,\n cr.summary,\n cr.share_with_team,\n false AS is_active,\n CASE\n WHEN EXISTS (\n SELECT 1 FROM call_record_participants crp\n WHERE crp.call_record_id = cr.id AND crp.user_id = $1\n ) THEN 'ATTENDED'::text\n WHEN EXISTS (\n SELECT 1 FROM comms_channel_participants ccp\n WHERE ccp.channel_id = cr.channel_id\n AND ccp.user_id = $1\n AND ccp.left_at IS NULL\n ) THEN 'MISSED'::text\n ELSE 'UNATTENDED'::text\n END AS status\n FROM call_records cr\n WHERE EXISTS (\n SELECT 1 FROM entity_access ea\n JOIN user_source_ids u ON u.source_id = ea.source_id\n WHERE ea.entity_id = cr.id\n AND ea.entity_type = 'call'\n )\n AND ($3::bool IS FALSE OR cr.channel_id = ANY($4))\n AND ($5::bool IS FALSE OR cr.id = ANY($6))\n AND ($9::bool IS FALSE OR (\n ($11::bool IS FALSE AND EXISTS (\n SELECT 1 FROM entity_properties ep\n WHERE ep.entity_id = cr.id::text\n AND ep.entity_type = 'CALL_RECORD'\n AND jsonb_typeof(ep.values -> 'value') = 'array'\n AND jsonb_exists_any(ep.values -> 'value', $10::text[])\n ))\n OR ($11::bool IS TRUE AND $10::text[] <@ (\n SELECT COALESCE(array_agg(elem), ARRAY[]::text[])\n FROM (\n SELECT values FROM entity_properties\n WHERE entity_id = cr.id::text\n AND entity_type = 'CALL_RECORD'\n AND jsonb_typeof(values -> 'value') = 'array'\n ) ep\n CROSS JOIN LATERAL jsonb_array_elements_text(ep.values -> 'value') AS elem\n ))\n ))\n )\n SELECT\n call_id as \"call_id!\",\n channel_id as \"channel_id!\",\n room_name as \"room_name!\",\n created_by as \"created_by!\",\n started_at as \"started_at!\",\n ended_at,\n duration_ms,\n egress_id,\n recording_key,\n preview_url,\n recording_started_at,\n custom_name,\n summary,\n share_with_team as \"share_with_team!\",\n is_active as \"is_active!\",\n status as \"status!\"\n FROM visible_calls\n WHERE ($7::bool IS FALSE OR status = ANY($8::text[]))\n ORDER BY \"started_at!\" DESC\n LIMIT $2\n ",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "call_id!",
+ "type_info": "Uuid"
+ },
+ {
+ "ordinal": 1,
+ "name": "channel_id!",
+ "type_info": "Uuid"
+ },
+ {
+ "ordinal": 2,
+ "name": "room_name!",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 3,
+ "name": "created_by!",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 4,
+ "name": "started_at!",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 5,
+ "name": "ended_at",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 6,
+ "name": "duration_ms",
+ "type_info": "Int8"
+ },
+ {
+ "ordinal": 7,
+ "name": "egress_id",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 8,
+ "name": "recording_key",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 9,
+ "name": "preview_url",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 10,
+ "name": "recording_started_at",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 11,
+ "name": "custom_name",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 12,
+ "name": "summary",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 13,
+ "name": "share_with_team!",
+ "type_info": "Bool"
+ },
+ {
+ "ordinal": 14,
+ "name": "is_active!",
+ "type_info": "Bool"
+ },
+ {
+ "ordinal": 15,
+ "name": "status!",
+ "type_info": "Text"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Text",
+ "Int8",
+ "Bool",
+ "UuidArray",
+ "Bool",
+ "UuidArray",
+ "Bool",
+ "TextArray",
+ "Bool",
+ "TextArray",
+ "Bool"
+ ]
+ },
+ "nullable": [
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null
+ ]
+ },
+ "hash": "b55a16688355355ab26840343edf126c876002a8f90e4d6dc299f22a1a91e34c"
+}
diff --git a/.sqlx/query-b6a900ce4ef05b399b15c5df9df622228577a112642245990b64442fb691305f.json b/.sqlx/query-b6a900ce4ef05b399b15c5df9df622228577a112642245990b64442fb691305f.json
index c2d448113f..4b3b9da95a 100644
--- a/.sqlx/query-b6a900ce4ef05b399b15c5df9df622228577a112642245990b64442fb691305f.json
+++ b/.sqlx/query-b6a900ce4ef05b399b15c5df9df622228577a112642245990b64442fb691305f.json
@@ -65,7 +65,8 @@
"THREAD",
"USER",
"COMPANY",
- "TASK"
+ "TASK",
+ "CALL_RECORD"
]
}
}
diff --git a/.sqlx/query-be9196900ae5aa5d1bf5bdee0a4e8bb94fa15e24fe46ee1fd0cbeb9b644c80ea.json b/.sqlx/query-be9196900ae5aa5d1bf5bdee0a4e8bb94fa15e24fe46ee1fd0cbeb9b644c80ea.json
index ab32428f61..0fe26da4f8 100644
--- a/.sqlx/query-be9196900ae5aa5d1bf5bdee0a4e8bb94fa15e24fe46ee1fd0cbeb9b644c80ea.json
+++ b/.sqlx/query-be9196900ae5aa5d1bf5bdee0a4e8bb94fa15e24fe46ee1fd0cbeb9b644c80ea.json
@@ -65,7 +65,8 @@
"THREAD",
"USER",
"COMPANY",
- "TASK"
+ "TASK",
+ "CALL_RECORD"
]
}
}
diff --git a/.sqlx/query-c12b511f8fbe853ce8e5489db2468ee8a07030cb234bc0a10bc014c493b8e9c2.json b/.sqlx/query-c12b511f8fbe853ce8e5489db2468ee8a07030cb234bc0a10bc014c493b8e9c2.json
index e2aa061544..8594056ddf 100644
--- a/.sqlx/query-c12b511f8fbe853ce8e5489db2468ee8a07030cb234bc0a10bc014c493b8e9c2.json
+++ b/.sqlx/query-c12b511f8fbe853ce8e5489db2468ee8a07030cb234bc0a10bc014c493b8e9c2.json
@@ -18,7 +18,8 @@
"THREAD",
"USER",
"COMPANY",
- "TASK"
+ "TASK",
+ "CALL_RECORD"
]
}
}
diff --git a/.sqlx/query-c132d149b4610459f6c2ff333a128c8aa28e0bd9409ec0e9232f0edd27531887.json b/.sqlx/query-c132d149b4610459f6c2ff333a128c8aa28e0bd9409ec0e9232f0edd27531887.json
index 01d15647d7..c9784d61eb 100644
--- a/.sqlx/query-c132d149b4610459f6c2ff333a128c8aa28e0bd9409ec0e9232f0edd27531887.json
+++ b/.sqlx/query-c132d149b4610459f6c2ff333a128c8aa28e0bd9409ec0e9232f0edd27531887.json
@@ -19,7 +19,8 @@
"THREAD",
"USER",
"COMPANY",
- "TASK"
+ "TASK",
+ "CALL_RECORD"
]
}
}
diff --git a/.sqlx/query-d09a22b5d0a049677c6fc96d0aef74260d592ae30752c12a50512ebf95592e5f.json b/.sqlx/query-d09a22b5d0a049677c6fc96d0aef74260d592ae30752c12a50512ebf95592e5f.json
index 2a3dbfedef..b126dea627 100644
--- a/.sqlx/query-d09a22b5d0a049677c6fc96d0aef74260d592ae30752c12a50512ebf95592e5f.json
+++ b/.sqlx/query-d09a22b5d0a049677c6fc96d0aef74260d592ae30752c12a50512ebf95592e5f.json
@@ -28,7 +28,8 @@
"THREAD",
"USER",
"COMPANY",
- "TASK"
+ "TASK",
+ "CALL_RECORD"
]
}
}
@@ -111,7 +112,8 @@
"THREAD",
"USER",
"COMPANY",
- "TASK"
+ "TASK",
+ "CALL_RECORD"
]
}
}
@@ -148,7 +150,8 @@
"THREAD",
"USER",
"COMPANY",
- "TASK"
+ "TASK",
+ "CALL_RECORD"
]
}
}
diff --git a/.sqlx/query-eaf32ba063527b6af6e09f701039d2bf0fd4316d9e1280175eca27a0470c2a71.json b/.sqlx/query-eaf32ba063527b6af6e09f701039d2bf0fd4316d9e1280175eca27a0470c2a71.json
index 1b9f06c60a..38d93cc368 100644
--- a/.sqlx/query-eaf32ba063527b6af6e09f701039d2bf0fd4316d9e1280175eca27a0470c2a71.json
+++ b/.sqlx/query-eaf32ba063527b6af6e09f701039d2bf0fd4316d9e1280175eca27a0470c2a71.json
@@ -29,7 +29,8 @@
"THREAD",
"USER",
"COMPANY",
- "TASK"
+ "TASK",
+ "CALL_RECORD"
]
}
}
diff --git a/.sqlx/query-f54491fb1559e95fd91f725c67f260e2057b1bf4679801f170bcf8f891027282.json b/.sqlx/query-f54491fb1559e95fd91f725c67f260e2057b1bf4679801f170bcf8f891027282.json
index 0f8c6f84b5..f395a59f2b 100644
--- a/.sqlx/query-f54491fb1559e95fd91f725c67f260e2057b1bf4679801f170bcf8f891027282.json
+++ b/.sqlx/query-f54491fb1559e95fd91f725c67f260e2057b1bf4679801f170bcf8f891027282.json
@@ -76,7 +76,8 @@
"THREAD",
"USER",
"COMPANY",
- "TASK"
+ "TASK",
+ "CALL_RECORD"
]
}
}
diff --git a/apps/web/src/features/block-call/component/sidepanel/CallSidePanelSections.tsx b/apps/web/src/features/block-call/component/sidepanel/CallSidePanelSections.tsx
index 48fc7ea56d..e24f58e3ab 100644
--- a/apps/web/src/features/block-call/component/sidepanel/CallSidePanelSections.tsx
+++ b/apps/web/src/features/block-call/component/sidepanel/CallSidePanelSections.tsx
@@ -1,3 +1,4 @@
+import { EntityPropertiesSection } from '@app/features/property/side-panel/properties';
import { useCallContextOptional } from '@channel/Call/CallContext';
import { SidePanel } from '@components/app/side-panel';
import { useBlockId } from '@core/block';
@@ -28,6 +29,14 @@ export function CallSidePanelSections(props: CallSidePanelSectionsProps) {
<SidePanel.Section id="details" title="Details" defaultOpen order={10}>
<DetailsSectionContent record={props.record} />
</SidePanel.Section>
+ <SidePanel.Section
+ id="properties"
+ title="Properties"
+ defaultOpen
+ order={15}
+ >
+ <PropertiesSectionContent record={props.record} />
+ </SidePanel.Section>
<SidePanel.Section id="sharing" title="Sharing" order={20}>
<SharingSectionContent record={props.record} />
</SidePanel.Section>
@@ -87,6 +96,22 @@ function DetailsSectionContent(props: { record: Accessor<CallRecord> }) {
);
}
+function PropertiesSectionContent(props: { record: Accessor<CallRecord> }) {
+ // Tag/property writes are authorized server-side via the call's owning
+ // channel (edit access), mirroring the sharing control above, so the editor
+ // is always mounted and the backend rejects unauthorized mutations.
+ return (
+ <EntityPropertiesSection
+ entityId={props.record().callId}
+ entityType="CALL_RECORD"
+ canEdit
+ documentName={
+ props.record().customName ?? props.record().channelName ?? undefined
+ }
+ />
+ );
+}
+
function OwnerValue(props: { ownerId: string }) {
const [displayName] = useDisplayName(tryMacroId(props.ownerId));
return (
diff --git a/apps/web/src/features/entity/composed/list-entity/wide-layout.tsx b/apps/web/src/features/entity/composed/list-entity/wide-layout.tsx
index 73639372e7..5a740a9c81 100644
--- a/apps/web/src/features/entity/composed/list-entity/wide-layout.tsx
+++ b/apps/web/src/features/entity/composed/list-entity/wide-layout.tsx
@@ -218,6 +218,17 @@ export function WideLayout(props: LayoutProps) {
/>
)}
</Show>
+ <Show
+ when={rowTagsVisible() && isCallEntity(props.entity) && props.entity}
+ >
+ {(entity) => (
+ <RowTags
+ entityId={entity().id}
+ entityType={EntityType.CALL_RECORD}
+ properties={entity().properties}
+ />
+ )}
+ </Show>
<Show
when={
props.isShared && !owningInbox() && !isGithubPrEntity(props.entity)
diff --git a/apps/web/src/features/entity/types/entity.ts b/apps/web/src/features/entity/types/entity.ts
index ec618f68c1..bf00595b99 100644
--- a/apps/web/src/features/entity/types/entity.ts
+++ b/apps/web/src/features/entity/types/entity.ts
@@ -223,6 +223,7 @@ export type CallEntity = EntityBase & {
durationMs?: number;
participantIds: string[];
summary?: string;
+ properties?: SoupProperty[];
};
export type AutomationEntity = EntityBase & {
diff --git a/apps/web/src/features/next-soup/soup-view/filters-bar/search/search-facets.tsx b/apps/web/src/features/next-soup/soup-view/filters-bar/search/search-facets.tsx
index c8961b3040..74ff9645c1 100644
--- a/apps/web/src/features/next-soup/soup-view/filters-bar/search/search-facets.tsx
+++ b/apps/web/src/features/next-soup/soup-view/filters-bar/search/search-facets.tsx
@@ -498,7 +498,7 @@ export function useSearchFacets(
case 'channels':
return [type, channelIn, channelFrom];
case 'calls':
- return [type, callIn, callFrom, callStatus];
+ return [type, callIn, callFrom, callStatus, ...tagFacets()];
case 'task':
return [
type,
diff --git a/apps/web/src/features/next-soup/soup-view/filters-bar/search/search-filters-state.ts b/apps/web/src/features/next-soup/soup-view/filters-bar/search/search-filters-state.ts
index 74bbd821bb..4dda62409d 100644
--- a/apps/web/src/features/next-soup/soup-view/filters-bar/search/search-filters-state.ts
+++ b/apps/web/src/features/next-soup/soup-view/filters-bar/search/search-filters-state.ts
@@ -27,14 +27,15 @@ export type SearchIndexId =
export type SearchTypeValue = SearchIndexId | 'all';
/** Search types where tag filtering applies: documents/tasks, emails, chats,
- * folders, plus the mixed `all` view (tags there narrow the taggable result
- * types and leave the rest untouched). */
+ * calls, folders, plus the mixed `all` view (tags there narrow the taggable
+ * result types and leave the rest untouched). */
export const TAG_SEARCH_TYPES = new Set<SearchTypeValue>([
'all',
'task',
'document-or-file',
'email',
'agent',
+ 'calls',
'folders',
]);
@@ -72,7 +73,7 @@ export type SearchFiltersState = SearchFiltersSections & {
type: SearchTypeValue;
// Selected tags. Applied only on the TAG_SEARCH_TYPES types and read live
// from the compiled query, so they persist across those types but clear
- // when switching to a type where tags do not apply (channels/calls/etc).
+ // when switching to a type where tags do not apply (channels/etc).
// Each entry carries its owning definition id and option id.
tags: PropertyFilter[];
// How the selected tags combine: match any of them (default) or all.
@@ -101,7 +102,7 @@ export function compileSearchQuery(state: SearchFiltersState): Query {
const exclude: FieldFilters = { ...baseline.exclude };
// Tags apply on the TAG_SEARCH_TYPES types only, so a tag filter never
- // silently empties a search narrowed to channels/calls.
+ // silently empties a search narrowed to channels.
if (TAG_SEARCH_TYPES.has(state.type) && state.tags.length) {
include.tagFilters = state.tags;
if (state.tagMode === 'all') {
diff --git a/apps/web/src/features/property/editors/selectors/entityUtils.ts b/apps/web/src/features/property/editors/selectors/entityUtils.ts
index b2b4f58c54..ff3301616b 100644
--- a/apps/web/src/features/property/editors/selectors/entityUtils.ts
+++ b/apps/web/src/features/property/editors/selectors/entityUtils.ts
@@ -29,6 +29,8 @@ export type EntityTypeItemMap = {
TASK: EntityItem<TaskEntity>;
THREAD: EntityItem<EmailEntity>;
COMPANY: never;
+ // Call records aren't entity-reference targets in quickAccess.
+ CALL_RECORD: never;
};
/**
@@ -44,6 +46,7 @@ function entityTypeToBuckets(entityType: EntityType): readonly Bucket[] {
.with('TASK', () => ['task'] as const)
.with('THREAD', () => ['email'] as const) // Note: emails aren't in quickAccess yet, handled separately
.with('COMPANY', () => [] as const) // Companies aren't in quickAccess
+ .with('CALL_RECORD', () => [] as const) // Call records aren't in quickAccess
.exhaustive();
return buckets;
}
diff --git a/apps/web/src/features/property/side-panel/properties/EntityPropertiesSection.tsx b/apps/web/src/features/property/side-panel/properties/EntityPropertiesSection.tsx
index 6601963936..64b0b2eace 100644
--- a/apps/web/src/features/property/side-panel/properties/EntityPropertiesSection.tsx
+++ b/apps/web/src/features/property/side-panel/properties/EntityPropertiesSection.tsx
@@ -77,6 +77,7 @@ const TAGGABLE_ENTITY_TYPES: ReadonlySet<EntityType> = new Set<EntityType>([
'THREAD',
'PROJECT',
'CHAT',
+ 'CALL_RECORD',
]);
export function EntityPropertiesSection(props: EntityPropertiesSectionProps) {
diff --git a/apps/web/src/features/property/utils/entityConversion.ts b/apps/web/src/features/property/utils/entityConversion.ts
index ef79ba4ef6..b28819ccf1 100644
--- a/apps/web/src/features/property/utils/entityConversion.ts
+++ b/apps/web/src/features/property/utils/entityConversion.ts
@@ -55,6 +55,7 @@ export function entityTypeToItemType(type: EntityType): ItemType | undefined {
.with('PROJECT', () => 'project' as ItemType)
.with('CHANNEL', () => 'channel' as ItemType)
.with('CHAT', () => 'chat' as ItemType)
+ .with('CALL_RECORD', () => 'call' as ItemType)
.with('COMPANY', () => undefined) // huh
.with('USER', () => undefined) // huh
.with('THREAD', () => 'email' as ItemType)
@@ -73,7 +74,7 @@ export function macroEntityToPropertyEntityType(
.with({ type: 'document' }, () => EntityType.DOCUMENT)
.with({ type: 'channel_message' }, () => EntityType.CHANNEL)
.with({ type: 'channel_thread' }, () => EntityType.CHANNEL)
- .with({ type: 'call' }, () => EntityType.CHANNEL)
+ .with({ type: 'call' }, () => EntityType.CALL_RECORD)
.with({ type: 'crm_company' }, () => EntityType.COMPANY)
.with({ type: 'crm_contact' }, () => {
// No CONTACT in the properties-service EntityType yet.
diff --git a/apps/web/src/lib/queries/soup/transform-utils.ts b/apps/web/src/lib/queries/soup/transform-utils.ts
index 2531c463e8..fe1e81eb2c 100644
--- a/apps/web/src/lib/queries/soup/transform-utils.ts
+++ b/apps/web/src/lib/queries/soup/transform-utils.ts
@@ -507,6 +507,7 @@ export const useSearchResponseItemMapper = () => {
attended: status === 'ATTENDED',
durationMs: result.metadata.duration_ms,
participantIds: result.participant_ids,
+ properties: result.properties ?? undefined,
search,
},
];
@@ -642,6 +643,7 @@ export const mapApiSoupItemToEntity = (item: DisplayableSoupItem): SoupEntity =>
durationMs: item.data.durationMs ?? undefined,
participantIds: item.data.participants.map((p) => p.userId),
summary: item.data.summary ?? undefined,
+ properties: item.data.properties,
} satisfies CallEntity;
})
.with({ tag: 'channelThread' }, (item) => {
diff --git a/apps/web/src/lib/service-clients/service-cognition/generated/tools/schemas.ts b/apps/web/src/lib/service-clients/service-cognition/generated/tools/schemas.ts
index 986796cc8a..e10eaafb62 100644
--- a/apps/web/src/lib/service-clients/service-cognition/generated/tools/schemas.ts
+++ b/apps/web/src/lib/service-clients/service-cognition/generated/tools/schemas.ts
@@ -677,6 +677,7 @@ export const GetEntityProperties = z.object({
'chat',
'thread',
'channel',
+ 'call',
'user',
'company',
]),
@@ -1107,6 +1108,32 @@ export const ListEntitiesResponse = z.object({
z.object({
createdBy: z.string(),
id: z.string().uuid(),
+ tags: z
+ .array(
+ z.object({
+ label: z.string(),
+ scope: z.any().superRefine((x, ctx) => {
+ const schemas = [z.literal('personal'), z.literal('team')];
+ const errors = schemas.reduce<z.ZodError[]>(
+ (errors, schema) =>
+ ((result) =>
+ result.error ? [...errors, result.error] : errors)(
+ schema.safeParse(x)
+ ),
+ []
+ );
+ if (schemas.length - errors.length !== 1) {
+ ctx.addIssue({
+ path: ctx.path,
+ code: 'invalid_union',
+ unionErrors: errors,
+ message: 'Invalid input: Should pass single schema',
+ });
+ }
+ }),
+ })
+ )
+ .optional(),
type: z.literal('call'),
}),
z.object({
@@ -2584,6 +2611,7 @@ export const SetEntityProperty = z.object({
'chat',
'thread',
'channel',
+ 'call',
'user',
'company',
]),
@@ -2603,6 +2631,7 @@ export const SetEntityProperty = z.object({
'chat',
'thread',
'channel',
+ 'call',
'user',
'company',
]),
@@ -2618,6 +2647,7 @@ export const SetEntityProperty = z.object({
'chat',
'thread',
'channel',
+ 'call',
'user',
'company',
]),
diff --git a/apps/web/src/lib/service-clients/service-cognition/generated/tools/types.ts b/apps/web/src/lib/service-clients/service-cognition/generated/tools/types.ts
index 97a9f4571b..732d047f9a 100644
--- a/apps/web/src/lib/service-clients/service-cognition/generated/tools/types.ts
+++ b/apps/web/src/lib/service-clients/service-cognition/generated/tools/types.ts
@@ -272,6 +272,10 @@ export type EntityItem =
* Call id.
*/
id: string;
+ /**
+ * Tags on the call visible to the user.
+ */
+ tags?: AppliedTag[];
type: 'call';
}
| {
@@ -302,6 +306,7 @@ export type ToolEntityType =
| 'chat'
| 'thread'
| 'channel'
+ | 'call'
| 'user'
| 'company';
/**
@@ -1050,7 +1055,7 @@ export interface CompanyPropertyOption {
id: string;
}
/**
- * Search items by their content: document body text; email subject/body/sender/recipient/cc/bcc and the display names on those addresses; chat messages; call transcripts. This is keyword search, not semantic search: queries only match literal words/tokens, prefixes, or exact quoted terms that appear in the indexed content. Use this for targeted keyword/content lookup, not for activity-summary questions like "what happened today", "what's going on", "catch me up", or "what happened in standup today"; those should start with ListEntities using time/type/channel filters. Whitespace-separated terms are ANDed. For documents and emails, every term must match somewhere in the document — different terms can appear in different chunks/pages or different fields. For documents and emails specifically, each single-word term is matched as a prefix (so `scri` matches `script`); for emails the prefix expansion also runs against the local-part of address fields. For chats, channels, and call transcripts the whole query is matched as a single adjacent phrase prefix — so pass 1-3 targeted keywords drawn from words that would literally appear in the content, not the user's natural-language description; long phrases will not match. Matching defaults to prefix; set matchType to 'exact' to match whole tokens/phrases with no prefix expansion (e.g. an exact word, identifier, or full email address). Wrap a multi-word phrase in double quotes to keep it together as one adjacent phrase. If the user's request combines a person with a topic, run separate searches rather than one combined query. Leave entityTypes empty by default; only filter when the user explicitly scopes to a type. Results for documents, emails, AI chats, and projects include the tags visible to the user as {label, scope} pairs; to restrict a search to tagged items, pass the tag labels in the tags argument (ListTags shows which tags exist).
+ * Search items by their content: document body text; email subject/body/sender/recipient/cc/bcc and the display names on those addresses; chat messages; call transcripts. This is keyword search, not semantic search: queries only match literal words/tokens, prefixes, or exact quoted terms that appear in the indexed content. Use this for targeted keyword/content lookup, not for activity-summary questions like "what happened today", "what's going on", "catch me up", or "what happened in standup today"; those should start with ListEntities using time/type/channel filters. Whitespace-separated terms are ANDed. For documents and emails, every term must match somewhere in the document — different terms can appear in different chunks/pages or different fields. For documents and emails specifically, each single-word term is matched as a prefix (so `scri` matches `script`); for emails the prefix expansion also runs against the local-part of address fields. For chats, channels, and call transcripts the whole query is matched as a single adjacent phrase prefix — so pass 1-3 targeted keywords drawn from words that would literally appear in the content, not the user's natural-language description; long phrases will not match. Matching defaults to prefix; set matchType to 'exact' to match whole tokens/phrases with no prefix expansion (e.g. an exact word, identifier, or full email address). Wrap a multi-word phrase in double quotes to keep it together as one adjacent phrase. If the user's request combines a person with a topic, run separate searches rather than one combined query. Leave entityTypes empty by default; only filter when the user explicitly scopes to a type. Results for documents, emails, AI chats, projects, and call records include the tags visible to the user as {label, scope} pairs; to restrict a search to tagged items, pass the tag labels in the tags argument (ListTags shows which tags exist).
*/
export interface ContentSearch {
/**
@@ -1067,7 +1072,7 @@ export interface ContentSearch {
*/
query: string;
/**
- * Restrict results to items carrying the given tags — any of them by default, every one of them with tagsMatch="all". Each entry names a tag by its label, matched case-insensitively against the user's own tags; only set scope ("personal" or "team") when the user distinguishes between their personal and team tags. An unknown label fails with the list of available tags — call ListTags first when unsure what tags exist. Only taggable items (documents, emails, AI chats, projects) can match, so channels and call records are dropped while a tag filter is active.
+ * Restrict results to items carrying the given tags — any of them by default, every one of them with tagsMatch="all". Each entry names a tag by its label, matched case-insensitively against the user's own tags; only set scope ("personal" or "team") when the user distinguishes between their personal and team tags. An unknown label fails with the list of available tags — call ListTags first when unsure what tags exist. Only taggable items (documents, emails, AI chats, projects, call records) can match, so channels are dropped while a tag filter is active.
*/
tags?: TagFilter[] | null;
tagsMatch?: TagMatch;
@@ -1736,7 +1741,7 @@ export interface ListCompaniesResponse {
summary: string;
}
/**
- * Browse the user's Macro workspace to see recent items they have access to. Returns Macro documents, AI conversations, projects, emails, chat channels, call records, and foreign entities. Use this to get an overview of what the user has been working on or to find items by type. Start here for activity-summary questions such as "what happened today", "what's going on", "catch me up", or "what happened in standup today"; apply precise time, type, channel, or mailbox filters when the user gives that scope. For Macro task requests such as "list my tasks", "tasks assigned to me", or "tasks I completed yesterday", prefer this tool over external task trackers such as Linear unless the user explicitly asks for Linear. Macro tasks are document items with df subtype {"l":{"dst":"task"}} and includeTypes ["document"]. Filter task Status and Assignees through propf using entity_type TASK: Status property 00000001-0000-0000-0000-000000000002, Completed option 00000001-0000-0000-0002-000000000004, Assignees property 00000001-0000-0000-0000-000000000001. The current user's assignee entity id is their Macro user id, usually macro|<their email address from context>. For "completed yesterday", combine status Completed, assigned-to-me, and a df updatedAt yesterday window with ua gte/lt ISO timestamps. Returned documents, AI chats, projects, and emails include the tags visible to the user as {label, scope} pairs. To filter by tag (e.g. "my items tagged bug-report"), pass the tag labels in the tags argument — ListTags shows which tags exist. For finding specific items by name or content, use the search tool instead.
+ * Browse the user's Macro workspace to see recent items they have access to. Returns Macro documents, AI conversations, projects, emails, chat channels, call records, and foreign entities. Use this to get an overview of what the user has been working on or to find items by type. Start here for activity-summary questions such as "what happened today", "what's going on", "catch me up", or "what happened in standup today"; apply precise time, type, channel, or mailbox filters when the user gives that scope. For Macro task requests such as "list my tasks", "tasks assigned to me", or "tasks I completed yesterday", prefer this tool over external task trackers such as Linear unless the user explicitly asks for Linear. Macro tasks are document items with df subtype {"l":{"dst":"task"}} and includeTypes ["document"]. Filter task Status and Assignees through propf using entity_type TASK: Status property 00000001-0000-0000-0000-000000000002, Completed option 00000001-0000-0000-0002-000000000004, Assignees property 00000001-0000-0000-0000-000000000001. The current user's assignee entity id is their Macro user id, usually macro|<their email address from context>. For "completed yesterday", combine status Completed, assigned-to-me, and a df updatedAt yesterday window with ua gte/lt ISO timestamps. Returned documents, AI chats, projects, emails, and call records include the tags visible to the user as {label, scope} pairs. To filter by tag (e.g. "my items tagged bug-report"), pass the tag labels in the tags argument — ListTags shows which tags exist. For finding specific items by name or content, use the search tool instead.
*/
export interface ListEntities {
/**
@@ -1817,7 +1822,7 @@ export interface ListEntities {
};
sortBy?: SortBy;
/**
- * Filter results to items carrying the given tags — any of them by default, every one of them with tagsMatch="all". Each entry names a tag by its label, matched case-insensitively against the user's own tags; only set scope ("personal" or "team") when the user distinguishes between their personal and team tags. An unknown label fails with the list of available tags — call ListTags first when unsure what tags exist. Only taggable items (documents, tasks, projects, emails, AI chats) can match a tag filter. Prefer this over hand-building a propf filter for tags.
+ * Filter results to items carrying the given tags — any of them by default, every one of them with tagsMatch="all". Each entry names a tag by its label, matched case-insensitively against the user's own tags; only set scope ("personal" or "team") when the user distinguishes between their personal and team tags. An unknown label fails with the list of available tags — call ListTags first when unsure what tags exist. Only taggable items (documents, tasks, projects, emails, AI chats, call records) can match a tag filter. Prefer this over hand-building a propf filter for tags.
*/
tags?: TagFilter[] | null;
tagsMatch?: TagMatch;
@@ -2193,7 +2198,7 @@ export interface MarkNotificationsSeen {
notificationIds: string[];
}
/**
- * Search items by their name or title: document name, email subject, chat title, project name, the channel name a call belongs to. This is keyword search, not semantic search: queries only match literal words/tokens, prefixes, or exact quoted terms that appear in the indexed title/name. Use this for targeted name/title lookup, not for activity-summary questions like "what happened today", "what's going on", "catch me up", or "what happened in standup today"; those should start with ListEntities using time/type/channel filters. For emails, whitespace-separated terms are ANDed and each is a prefix match against the subject. For all other types the whole query is matched as a single adjacent phrase prefix — so pass 1-3 targeted keywords drawn from words that would literally appear in the title, not the user's natural-language description; long phrases will not match. Matching defaults to prefix; set matchType to 'exact' to match whole tokens/phrases with no prefix expansion. Wrap a multi-word phrase in double quotes to keep it together as one adjacent phrase. If the user's request combines a person with a topic, run separate searches (NameSearch for the person, ContentSearch for the topic) rather than one combined query. Leave entityTypes empty by default; only filter when the user explicitly scopes to a type. Results for documents, emails, AI chats, and projects include the tags visible to the user as {label, scope} pairs; to restrict a search to tagged items, pass the tag labels in the tags argument (ListTags shows which tags exist).
+ * Search items by their name or title: document name, email subject, chat title, project name, the channel name a call belongs to. This is keyword search, not semantic search: queries only match literal words/tokens, prefixes, or exact quoted terms that appear in the indexed title/name. Use this for targeted name/title lookup, not for activity-summary questions like "what happened today", "what's going on", "catch me up", or "what happened in standup today"; those should start with ListEntities using time/type/channel filters. For emails, whitespace-separated terms are ANDed and each is a prefix match against the subject. For all other types the whole query is matched as a single adjacent phrase prefix — so pass 1-3 targeted keywords drawn from words that would literally appear in the title, not the user's natural-language description; long phrases will not match. Matching defaults to prefix; set matchType to 'exact' to match whole tokens/phrases with no prefix expansion. Wrap a multi-word phrase in double quotes to keep it together as one adjacent phrase. If the user's request combines a person with a topic, run separate searches (NameSearch for the person, ContentSearch for the topic) rather than one combined query. Leave entityTypes empty by default; only filter when the user explicitly scopes to a type. Results for documents, emails, AI chats, projects, and call records include the tags visible to the user as {label, scope} pairs; to restrict a search to tagged items, pass the tag labels in the tags argument (ListTags shows which tags exist).
*/
export interface NameSearch {
/**
@@ -2210,7 +2215,7 @@ export interface NameSearch {
*/
name: string;
/**
- * Restrict results to items carrying the given tags — any of them by default, every one of them with tagsMatch="all". Each entry names a tag by its label, matched case-insensitively against the user's own tags; only set scope ("personal" or "team") when the user distinguishes between their personal and team tags. An unknown label fails with the list of available tags — call ListTags first when unsure what tags exist. Only taggable items (documents, emails, AI chats, projects) can match, so channels and call records are dropped while a tag filter is active.
+ * Restrict results to items carrying the given tags — any of them by default, every one of them with tagsMatch="all". Each entry names a tag by its label, matched case-insensitively against the user's own tags; only set scope ("personal" or "team") when the user distinguishes between their personal and team tags. An unknown label fails with the list of available tags — call ListTags first when unsure what tags exist. Only taggable items (documents, emails, AI chats, projects, call records) can match, so channels are dropped while a tag filter is active.
*/
tags?: TagFilter[] | null;
tagsMatch?: TagMatch;
diff --git a/apps/web/src/lib/service-clients/service-properties/generated/schemas/entityType.ts b/apps/web/src/lib/service-clients/service-properties/generated/schemas/entityType.ts
index ebe5676cfd..1451a0e434 100644
--- a/apps/web/src/lib/service-clients/service-properties/generated/schemas/entityType.ts
+++ b/apps/web/src/lib/service-clients/service-properties/generated/schemas/entityType.ts
@@ -12,6 +12,7 @@ export type EntityType = (typeof EntityType)[keyof typeof EntityType];
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const EntityType = {
+ CALL_RECORD: 'CALL_RECORD',
CHANNEL: 'CHANNEL',
CHAT: 'CHAT',
COMPANY: 'COMPANY',
diff --git a/apps/web/src/lib/service-clients/service-properties/generated/zod.ts b/apps/web/src/lib/service-clients/service-properties/generated/zod.ts
index dc4316c887..a1337fabc2 100644
--- a/apps/web/src/lib/service-clients/service-properties/generated/zod.ts
+++ b/apps/web/src/lib/service-clients/service-properties/generated/zod.ts
@@ -19,6 +19,7 @@ export const listPropertiesQueryParams = zod.object({
.describe('Whether to include property options in the response'),
for_entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -93,6 +94,7 @@ export const listPropertiesResponseItem = zod
zod.null(),
zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -171,6 +173,7 @@ export const listPropertiesResponseItem = zod
zod.null(),
zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -295,6 +298,7 @@ export const createPropertyDefinitionBody = zod
zod.null(),
zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -506,6 +510,7 @@ export const getBulkEntityPropertiesBody = zod
entity_id: zod.string(),
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -606,6 +611,7 @@ export const getBulkEntityPropertiesResponse = zod.record(
zod.null(),
zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -671,6 +677,7 @@ export const getBulkEntityPropertiesResponse = zod.record(
entity_id: zod.string(),
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -765,6 +772,7 @@ export const getBulkEntityPropertiesResponse = zod.record(
entity_id: zod.string(),
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -828,6 +836,7 @@ export const getBulkEntityPropertiesResponse = zod.record(
export const getEntityPropertiesParams = zod.object({
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -913,6 +922,7 @@ export const getEntityPropertiesResponse = zod
zod.null(),
zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -978,6 +988,7 @@ export const getEntityPropertiesResponse = zod
entity_id: zod.string(),
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -1072,6 +1083,7 @@ export const getEntityPropertiesResponse = zod
entity_id: zod.string(),
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -1134,6 +1146,7 @@ export const getEntityPropertiesResponse = zod
export const setEntityPropertyParams = zod.object({
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -1200,6 +1213,7 @@ export const setEntityPropertyBody = zod
entity_id: zod.string(),
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -1233,6 +1247,7 @@ export const setEntityPropertyBody = zod
entity_id: zod.string(),
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -1294,6 +1309,7 @@ when adding one option.
export const addEntityPropertyOptionParams = zod.object({
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -1318,6 +1334,7 @@ each other.
export const removeEntityPropertyOptionParams = zod.object({
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -1408,6 +1425,7 @@ export const listTagsResponseItem = zod
zod.null(),
zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -1547,6 +1565,7 @@ export const ensureTagSetResponse = zod
zod.null(),
zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
diff --git a/apps/web/src/lib/service-clients/service-properties/openapi.json b/apps/web/src/lib/service-clients/service-properties/openapi.json
index 3b9ef253ea..4e12a93e9c 100644
--- a/apps/web/src/lib/service-clients/service-properties/openapi.json
+++ b/apps/web/src/lib/service-clients/service-properties/openapi.json
@@ -1027,6 +1027,7 @@
"type": "string",
"description": "Type of entity that can be referenced by entity properties.",
"enum": [
+ "CALL_RECORD",
"CHANNEL",
"CHAT",
"COMPANY",
diff --git a/apps/web/src/lib/service-clients/service-search/generated/models/callRecordSearchResponseItemWithMetadataAllOf.ts b/apps/web/src/lib/service-clients/service-search/generated/models/callRecordSearchResponseItemWithMetadataAllOf.ts
index d49ec3f66b..27eaf775cd 100644
--- a/apps/web/src/lib/service-clients/service-search/generated/models/callRecordSearchResponseItemWithMetadataAllOf.ts
+++ b/apps/web/src/lib/service-clients/service-search/generated/models/callRecordSearchResponseItemWithMetadataAllOf.ts
@@ -5,7 +5,10 @@
* OpenAPI spec version: 0.1.0
*/
import type { CallRecordSearchResponseItemWithMetadataAllOfMetadata } from './callRecordSearchResponseItemWithMetadataAllOfMetadata';
+import type { CallRecordSearchResponseItemWithMetadataAllOfProperties } from './callRecordSearchResponseItemWithMetadataAllOfProperties';
export type CallRecordSearchResponseItemWithMetadataAllOf = {
metadata?: CallRecordSearchResponseItemWithMetadataAllOfMetadata;
+ /** Entity properties (e.g. tags) on the call. */
+ properties?: CallRecordSearchResponseItemWithMetadataAllOfProperties;
};
diff --git a/apps/web/src/lib/service-clients/service-search/generated/models/callRecordSearchResponseItemWithMetadataAllOfProperties.ts b/apps/web/src/lib/service-clients/service-search/generated/models/callRecordSearchResponseItemWithMetadataAllOfProperties.ts
new file mode 100644
index 0000000000..c0b8a2a6af
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-search/generated/models/callRecordSearchResponseItemWithMetadataAllOfProperties.ts
@@ -0,0 +1,14 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * search_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { SoupProperty } from './soupProperty';
+
+/**
+ * Entity properties (e.g. tags) on the call.
+ */
+export type CallRecordSearchResponseItemWithMetadataAllOfProperties =
+ | SoupProperty[]
+ | null;
diff --git a/apps/web/src/lib/service-clients/service-search/generated/models/entityType.ts b/apps/web/src/lib/service-clients/service-search/generated/models/entityType.ts
index ae8974ec49..f07d552b58 100644
--- a/apps/web/src/lib/service-clients/service-search/generated/models/entityType.ts
+++ b/apps/web/src/lib/service-clients/service-search/generated/models/entityType.ts
@@ -12,6 +12,7 @@ export type EntityType = (typeof EntityType)[keyof typeof EntityType];
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const EntityType = {
+ CALL_RECORD: 'CALL_RECORD',
CHANNEL: 'CHANNEL',
CHAT: 'CHAT',
COMPANY: 'COMPANY',
diff --git a/apps/web/src/lib/service-clients/service-search/generated/models/index.ts b/apps/web/src/lib/service-clients/service-search/generated/models/index.ts
index 51b773edbd..d177456514 100644
--- a/apps/web/src/lib/service-clients/service-search/generated/models/index.ts
+++ b/apps/web/src/lib/service-clients/service-search/generated/models/index.ts
@@ -15,6 +15,7 @@ export * from './callRecordSearchResponseItemName';
export * from './callRecordSearchResponseItemWithMetadata';
export * from './callRecordSearchResponseItemWithMetadataAllOf';
export * from './callRecordSearchResponseItemWithMetadataAllOfMetadata';
+export * from './callRecordSearchResponseItemWithMetadataAllOfProperties';
export * from './callRecordSearchResult';
export * from './callRecordSearchResultEndedAt';
export * from './callRecordSearchResultScore';
diff --git a/apps/web/src/lib/service-clients/service-search/openapi.json b/apps/web/src/lib/service-clients/service-search/openapi.json
index 6403abe0c6..d2125c44d0 100644
--- a/apps/web/src/lib/service-clients/service-search/openapi.json
+++ b/apps/web/src/lib/service-clients/service-search/openapi.json
@@ -318,6 +318,13 @@
"description": "`None` if the call has been deleted."
}
]
+ },
+ "properties": {
+ "type": ["array", "null"],
+ "items": {
+ "$ref": "#/components/schemas/SoupProperty"
+ },
+ "description": "Entity properties (e.g. tags) on the call."
}
}
}
@@ -1692,6 +1699,7 @@
"type": "string",
"description": "Type of entity that can be referenced by entity properties.",
"enum": [
+ "CALL_RECORD",
"CHANNEL",
"CHAT",
"COMPANY",
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/entityType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/entityType.ts
index 752c62d1d0..696c62ba68 100644
--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/entityType.ts
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/entityType.ts
@@ -12,6 +12,7 @@ export type EntityType = (typeof EntityType)[keyof typeof EntityType];
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const EntityType = {
+ CALL_RECORD: 'CALL_RECORD',
CHANNEL: 'CHANNEL',
CHAT: 'CHAT',
COMPANY: 'COMPANY',
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupCallRecord.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupCallRecord.ts
index df54c7a0c4..a3ae1d59a5 100644
--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupCallRecord.ts
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupCallRecord.ts
@@ -12,6 +12,7 @@ import type { SoupCallRecordDurationMs } from './soupCallRecordDurationMs';
import type { SoupCallRecordEndedAt } from './soupCallRecordEndedAt';
import type { SoupCallRecordParticipant } from './soupCallRecordParticipant';
import type { SoupCallRecordSummary } from './soupCallRecordSummary';
+import type { SoupProperty } from './soupProperty';
/**
* A call record as displayed in Soup. Excludes room_name, egress_id,
@@ -39,6 +40,8 @@ and derived from `status == ATTENDED`. */
isActive: boolean;
/** Participants in the call. */
participants: SoupCallRecordParticipant[];
+ /** Entity properties (e.g. tags). Populated after fetch by the soup repo. */
+ properties: SoupProperty[];
/** When the call started. */
startedAt: string;
/** Viewer-relative call status for the requesting user. */
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/zod.ts b/apps/web/src/lib/service-clients/service-storage/generated/zod.ts
index 30622f8954..b62a2466aa 100644
--- a/apps/web/src/lib/service-clients/service-storage/generated/zod.ts
+++ b/apps/web/src/lib/service-clients/service-storage/generated/zod.ts
@@ -3953,6 +3953,7 @@ export const createTaskHandlerBody = zod
entity_id: zod.string(),
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -3986,6 +3987,7 @@ export const createTaskHandlerBody = zod
entity_id: zod.string(),
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -6802,6 +6804,7 @@ export const getItemsSoupResponse = zod
zod.null(),
zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -6901,6 +6904,7 @@ export const getItemsSoupResponse = zod
entity_id: zod.string(),
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -7089,6 +7093,7 @@ export const getItemsSoupResponse = zod
zod.null(),
zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -7188,6 +7193,7 @@ export const getItemsSoupResponse = zod
entity_id: zod.string(),
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -7339,6 +7345,7 @@ export const getItemsSoupResponse = zod
zod.null(),
zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -7438,6 +7445,7 @@ export const getItemsSoupResponse = zod
entity_id: zod.string(),
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -7740,6 +7748,7 @@ export const getItemsSoupResponse = zod
zod.null(),
zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -7839,6 +7848,7 @@ export const getItemsSoupResponse = zod
entity_id: zod.string(),
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -8304,6 +8314,228 @@ export const getItemsSoupResponse = zod
)
)
.describe('Participants in the call.'),
+ properties: zod
+ .array(
+ zod
+ .object({
+ definition: zod
+ .object({
+ created_at: zod.iso.datetime({}),
+ data_type: zod
+ .enum([
+ 'BOOLEAN',
+ 'DATE',
+ 'NUMBER',
+ 'STRING',
+ 'SELECT_NUMBER',
+ 'SELECT_STRING',
+ 'TAG',
+ 'ENTITY',
+ 'LINK',
+ ])
+ .describe(
+ 'Data type for property values, determining storage and validation.'
+ ),
+ display_name: zod.string(),
+ id: zod.uuid(),
+ is_metadata: zod
+ .boolean()
+ .describe(
+ 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'
+ ),
+ is_multi_select: zod.boolean(),
+ is_system: zod
+ .boolean()
+ .describe(
+ 'Flag to indicate if this is a system property (stored in DB).'
+ ),
+ owner: zod
+ .union([
+ zod
+ .object({
+ scope: zod.enum(['user']),
+ user_id: zod.string(),
+ })
+ .describe('User-scoped property.'),
+ zod
+ .object({
+ scope: zod.enum(['team']),
+ team_id: zod.uuid(),
+ })
+ .describe('Team-scoped property.'),
+ zod
+ .object({
+ scope: zod.enum(['system']),
+ })
+ .describe(
+ 'System-owned property (no user or team owner).'
+ ),
+ ])
+ .describe(
+ 'Defines who owns a property - user-scoped, team-scoped, or system.'
+ ),
+ specific_entity_type: zod
+ .union([
+ zod.null(),
+ zod
+ .enum([
+ 'CALL_RECORD',
+ 'CHANNEL',
+ 'CHAT',
+ 'COMPANY',
+ 'DOCUMENT',
+ 'PROJECT',
+ 'TASK',
+ 'THREAD',
+ 'USER',
+ ])
+ .describe(
+ 'Type of entity that can be referenced by entity properties.'
+ ),
+ ])
+ .optional(),
+ updated_at: zod.iso.datetime({}),
+ })
+ .describe(
+ 'Property definition model (service representation).'
+ ),
+ id: zod
+ .uuid()
+ .describe(
+ 'Globally unique id of the assignment attaching this property to an entity.'
+ ),
+ value: zod
+ .union([
+ zod.null(),
+ zod
+ .union([
+ zod
+ .object({
+ type: zod.enum(['Boolean']),
+ value: zod
+ .boolean()
+ .describe(
+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'
+ ),
+ })
+ .describe(
+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Number']),
+ value: zod
+ .number()
+ .describe(
+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'
+ ),
+ })
+ .describe(
+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['String']),
+ value: zod
+ .string()
+ .describe(
+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'
+ ),
+ })
+ .describe(
+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Date']),
+ value: zod.iso
+ .datetime({})
+ .describe(
+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'
+ ),
+ })
+ .describe(
+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['SelectOption']),
+ value: zod
+ .array(zod.uuid())
+ .describe(
+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'
+ ),
+ })
+ .describe(
+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'
+ ),
+ zod
+ .object({
+ type: zod.enum(['EntityReference']),
+ value: zod
+ .array(
+ zod
+ .object({
+ entity_id: zod.string(),
+ entity_type: zod
+ .enum([
+ 'CALL_RECORD',
+ 'CHANNEL',
+ 'CHAT',
+ 'COMPANY',
+ 'DOCUMENT',
+ 'PROJECT',
+ 'TASK',
+ 'THREAD',
+ 'USER',
+ ])
+ .describe(
+ 'Type of entity that can be referenced by entity properties.'
+ ),
+ specific_message_id: zod
+ .uuid()
+ .nullish()
+ .describe(
+ 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'
+ ),
+ })
+ .describe(
+ 'Entity reference for entity-type property values.'
+ )
+ )
+ .describe(
+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'
+ ),
+ })
+ .describe(
+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Link']),
+ value: zod
+ .array(zod.string())
+ .describe(
+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'
+ ),
+ })
+ .describe(
+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'
+ ),
+ ])
+ .describe(
+ 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'
+ ),
+ ])
+ .optional(),
+ })
+ .describe(
+ 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'
+ )
+ )
+ .describe(
+ 'Entity properties (e.g. tags). Populated after fetch by the soup repo.'
+ ),
startedAt: zod.iso
.datetime({})
.describe('When the call started.'),
@@ -8448,6 +8680,7 @@ export const getItemsSoupResponse = zod
zod.null(),
zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -8547,6 +8780,7 @@ export const getItemsSoupResponse = zod
entity_id: zod.string(),
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -9393,6 +9627,7 @@ export const postItemsSoupResponse = zod
zod.null(),
zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -9492,6 +9727,7 @@ export const postItemsSoupResponse = zod
entity_id: zod.string(),
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -9680,6 +9916,7 @@ export const postItemsSoupResponse = zod
zod.null(),
zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -9779,6 +10016,7 @@ export const postItemsSoupResponse = zod
entity_id: zod.string(),
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -9930,6 +10168,7 @@ export const postItemsSoupResponse = zod
zod.null(),
zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -10029,6 +10268,7 @@ export const postItemsSoupResponse = zod
entity_id: zod.string(),
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -10331,6 +10571,7 @@ export const postItemsSoupResponse = zod
zod.null(),
zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -10430,6 +10671,7 @@ export const postItemsSoupResponse = zod
entity_id: zod.string(),
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -10895,45 +11137,267 @@ export const postItemsSoupResponse = zod
)
)
.describe('Participants in the call.'),
- startedAt: zod.iso
- .datetime({})
- .describe('When the call started.'),
- status: zod
- .enum(['ATTENDED', 'MISSED', 'UNATTENDED'])
- .describe(
- 'Viewer-relative attendance status for a call record.\nSerializes as `ATTENDED`, `MISSED`, or `UNATTENDED`.'
- ),
- summary: zod
- .string()
- .nullish()
- .describe(
- 'AI-generated summary of the call. Only set on archived\n`call_records` once summarization has run; active calls always\nreturn `None`.'
- ),
- })
- .describe(
- 'A call record as displayed in Soup. Excludes room_name, egress_id,\nand transcript — fields that are irrelevant for the soup feed.'
- ),
- tag: zod.enum(['call']),
- })
- .describe('Call record item.'),
- zod
- .object({
- data: zod
- .object({
- createdAt: zod.iso
- .datetime({})
- .describe('When the company was created.'),
- description: zod
- .string()
- .nullish()
- .describe(
- "Display description from the primary domain's directory entry."
- ),
- domains: zod
+ properties: zod
.array(
zod
.object({
- companyId: zod
+ definition: zod
+ .object({
+ created_at: zod.iso.datetime({}),
+ data_type: zod
+ .enum([
+ 'BOOLEAN',
+ 'DATE',
+ 'NUMBER',
+ 'STRING',
+ 'SELECT_NUMBER',
+ 'SELECT_STRING',
+ 'TAG',
+ 'ENTITY',
+ 'LINK',
+ ])
+ .describe(
+ 'Data type for property values, determining storage and validation.'
+ ),
+ display_name: zod.string(),
+ id: zod.uuid(),
+ is_metadata: zod
+ .boolean()
+ .describe(
+ 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'
+ ),
+ is_multi_select: zod.boolean(),
+ is_system: zod
+ .boolean()
+ .describe(
+ 'Flag to indicate if this is a system property (stored in DB).'
+ ),
+ owner: zod
+ .union([
+ zod
+ .object({
+ scope: zod.enum(['user']),
+ user_id: zod.string(),
+ })
+ .describe('User-scoped property.'),
+ zod
+ .object({
+ scope: zod.enum(['team']),
+ team_id: zod.uuid(),
+ })
+ .describe('Team-scoped property.'),
+ zod
+ .object({
+ scope: zod.enum(['system']),
+ })
+ .describe(
+ 'System-owned property (no user or team owner).'
+ ),
+ ])
+ .describe(
+ 'Defines who owns a property - user-scoped, team-scoped, or system.'
+ ),
+ specific_entity_type: zod
+ .union([
+ zod.null(),
+ zod
+ .enum([
+ 'CALL_RECORD',
+ 'CHANNEL',
+ 'CHAT',
+ 'COMPANY',
+ 'DOCUMENT',
+ 'PROJECT',
+ 'TASK',
+ 'THREAD',
+ 'USER',
+ ])
+ .describe(
+ 'Type of entity that can be referenced by entity properties.'
+ ),
+ ])
+ .optional(),
+ updated_at: zod.iso.datetime({}),
+ })
+ .describe(
+ 'Property definition model (service representation).'
+ ),
+ id: zod
+ .uuid()
+ .describe(
+ 'Globally unique id of the assignment attaching this property to an entity.'
+ ),
+ value: zod
+ .union([
+ zod.null(),
+ zod
+ .union([
+ zod
+ .object({
+ type: zod.enum(['Boolean']),
+ value: zod
+ .boolean()
+ .describe(
+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'
+ ),
+ })
+ .describe(
+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Number']),
+ value: zod
+ .number()
+ .describe(
+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'
+ ),
+ })
+ .describe(
+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['String']),
+ value: zod
+ .string()
+ .describe(
+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'
+ ),
+ })
+ .describe(
+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Date']),
+ value: zod.iso
+ .datetime({})
+ .describe(
+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'
+ ),
+ })
+ .describe(
+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['SelectOption']),
+ value: zod
+ .array(zod.uuid())
+ .describe(
+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'
+ ),
+ })
+ .describe(
+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'
+ ),
+ zod
+ .object({
+ type: zod.enum(['EntityReference']),
+ value: zod
+ .array(
+ zod
+ .object({
+ entity_id: zod.string(),
+ entity_type: zod
+ .enum([
+ 'CALL_RECORD',
+ 'CHANNEL',
+ 'CHAT',
+ 'COMPANY',
+ 'DOCUMENT',
+ 'PROJECT',
+ 'TASK',
+ 'THREAD',
+ 'USER',
+ ])
+ .describe(
+ 'Type of entity that can be referenced by entity properties.'
+ ),
+ specific_message_id: zod
+ .uuid()
+ .nullish()
+ .describe(
+ 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'
+ ),
+ })
+ .describe(
+ 'Entity reference for entity-type property values.'
+ )
+ )
+ .describe(
+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'
+ ),
+ })
+ .describe(
+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Link']),
+ value: zod
+ .array(zod.string())
+ .describe(
+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'
+ ),
+ })
+ .describe(
+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'
+ ),
+ ])
+ .describe(
+ 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'
+ ),
+ ])
+ .optional(),
+ })
+ .describe(
+ 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'
+ )
+ )
+ .describe(
+ 'Entity properties (e.g. tags). Populated after fetch by the soup repo.'
+ ),
+ startedAt: zod.iso
+ .datetime({})
+ .describe('When the call started.'),
+ status: zod
+ .enum(['ATTENDED', 'MISSED', 'UNATTENDED'])
+ .describe(
+ 'Viewer-relative attendance status for a call record.\nSerializes as `ATTENDED`, `MISSED`, or `UNATTENDED`.'
+ ),
+ summary: zod
+ .string()
+ .nullish()
+ .describe(
+ 'AI-generated summary of the call. Only set on archived\n`call_records` once summarization has run; active calls always\nreturn `None`.'
+ ),
+ })
+ .describe(
+ 'A call record as displayed in Soup. Excludes room_name, egress_id,\nand transcript — fields that are irrelevant for the soup feed.'
+ ),
+ tag: zod.enum(['call']),
+ })
+ .describe('Call record item.'),
+ zod
+ .object({
+ data: zod
+ .object({
+ createdAt: zod.iso
+ .datetime({})
+ .describe('When the company was created.'),
+ description: zod
+ .string()
+ .nullish()
+ .describe(
+ "Display description from the primary domain's directory entry."
+ ),
+ domains: zod
+ .array(
+ zod
+ .object({
+ companyId: zod
.uuid()
.describe(
'The id of the company the domain belongs to.'
@@ -11039,6 +11503,7 @@ export const postItemsSoupResponse = zod
zod.null(),
zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -11138,6 +11603,7 @@ export const postItemsSoupResponse = zod
entity_id: zod.string(),
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -11510,6 +11976,7 @@ export const postItemsSoupAstResponse = zod
zod.null(),
zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -11609,6 +12076,7 @@ export const postItemsSoupAstResponse = zod
entity_id: zod.string(),
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -11797,6 +12265,7 @@ export const postItemsSoupAstResponse = zod
zod.null(),
zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -11896,6 +12365,7 @@ export const postItemsSoupAstResponse = zod
entity_id: zod.string(),
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -12047,6 +12517,7 @@ export const postItemsSoupAstResponse = zod
zod.null(),
zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -12146,6 +12617,7 @@ export const postItemsSoupAstResponse = zod
entity_id: zod.string(),
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -12448,6 +12920,7 @@ export const postItemsSoupAstResponse = zod
zod.null(),
zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -12547,6 +13020,7 @@ export const postItemsSoupAstResponse = zod
entity_id: zod.string(),
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -13010,10 +13484,232 @@ export const postItemsSoupAstResponse = zod
userId: zod.string().describe('The user id.'),
})
.describe(
- 'A participant in a call record, as displayed in Soup.'
+ 'A participant in a call record, as displayed in Soup.'
+ )
+ )
+ .describe('Participants in the call.'),
+ properties: zod
+ .array(
+ zod
+ .object({
+ definition: zod
+ .object({
+ created_at: zod.iso.datetime({}),
+ data_type: zod
+ .enum([
+ 'BOOLEAN',
+ 'DATE',
+ 'NUMBER',
+ 'STRING',
+ 'SELECT_NUMBER',
+ 'SELECT_STRING',
+ 'TAG',
+ 'ENTITY',
+ 'LINK',
+ ])
+ .describe(
+ 'Data type for property values, determining storage and validation.'
+ ),
+ display_name: zod.string(),
+ id: zod.uuid(),
+ is_metadata: zod
+ .boolean()
+ .describe(
+ 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'
+ ),
+ is_multi_select: zod.boolean(),
+ is_system: zod
+ .boolean()
+ .describe(
+ 'Flag to indicate if this is a system property (stored in DB).'
+ ),
+ owner: zod
+ .union([
+ zod
+ .object({
+ scope: zod.enum(['user']),
+ user_id: zod.string(),
+ })
+ .describe('User-scoped property.'),
+ zod
+ .object({
+ scope: zod.enum(['team']),
+ team_id: zod.uuid(),
+ })
+ .describe('Team-scoped property.'),
+ zod
+ .object({
+ scope: zod.enum(['system']),
+ })
+ .describe(
+ 'System-owned property (no user or team owner).'
+ ),
+ ])
+ .describe(
+ 'Defines who owns a property - user-scoped, team-scoped, or system.'
+ ),
+ specific_entity_type: zod
+ .union([
+ zod.null(),
+ zod
+ .enum([
+ 'CALL_RECORD',
+ 'CHANNEL',
+ 'CHAT',
+ 'COMPANY',
+ 'DOCUMENT',
+ 'PROJECT',
+ 'TASK',
+ 'THREAD',
+ 'USER',
+ ])
+ .describe(
+ 'Type of entity that can be referenced by entity properties.'
+ ),
+ ])
+ .optional(),
+ updated_at: zod.iso.datetime({}),
+ })
+ .describe(
+ 'Property definition model (service representation).'
+ ),
+ id: zod
+ .uuid()
+ .describe(
+ 'Globally unique id of the assignment attaching this property to an entity.'
+ ),
+ value: zod
+ .union([
+ zod.null(),
+ zod
+ .union([
+ zod
+ .object({
+ type: zod.enum(['Boolean']),
+ value: zod
+ .boolean()
+ .describe(
+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'
+ ),
+ })
+ .describe(
+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Number']),
+ value: zod
+ .number()
+ .describe(
+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'
+ ),
+ })
+ .describe(
+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['String']),
+ value: zod
+ .string()
+ .describe(
+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'
+ ),
+ })
+ .describe(
+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Date']),
+ value: zod.iso
+ .datetime({})
+ .describe(
+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'
+ ),
+ })
+ .describe(
+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['SelectOption']),
+ value: zod
+ .array(zod.uuid())
+ .describe(
+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'
+ ),
+ })
+ .describe(
+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'
+ ),
+ zod
+ .object({
+ type: zod.enum(['EntityReference']),
+ value: zod
+ .array(
+ zod
+ .object({
+ entity_id: zod.string(),
+ entity_type: zod
+ .enum([
+ 'CALL_RECORD',
+ 'CHANNEL',
+ 'CHAT',
+ 'COMPANY',
+ 'DOCUMENT',
+ 'PROJECT',
+ 'TASK',
+ 'THREAD',
+ 'USER',
+ ])
+ .describe(
+ 'Type of entity that can be referenced by entity properties.'
+ ),
+ specific_message_id: zod
+ .uuid()
+ .nullish()
+ .describe(
+ 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'
+ ),
+ })
+ .describe(
+ 'Entity reference for entity-type property values.'
+ )
+ )
+ .describe(
+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'
+ ),
+ })
+ .describe(
+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Link']),
+ value: zod
+ .array(zod.string())
+ .describe(
+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'
+ ),
+ })
+ .describe(
+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'
+ ),
+ ])
+ .describe(
+ 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'
+ ),
+ ])
+ .optional(),
+ })
+ .describe(
+ 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'
)
)
- .describe('Participants in the call.'),
+ .describe(
+ 'Entity properties (e.g. tags). Populated after fetch by the soup repo.'
+ ),
startedAt: zod.iso
.datetime({})
.describe('When the call started.'),
@@ -13158,6 +13854,7 @@ export const postItemsSoupAstResponse = zod
zod.null(),
zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -13257,6 +13954,7 @@ export const postItemsSoupAstResponse = zod
entity_id: zod.string(),
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -13885,6 +14583,7 @@ export const postItemsSoupAstGroupedResponse = zod
zod.null(),
zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -13984,6 +14683,7 @@ export const postItemsSoupAstGroupedResponse = zod
entity_id: zod.string(),
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -14176,6 +14876,7 @@ export const postItemsSoupAstGroupedResponse = zod
zod.null(),
zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -14275,6 +14976,7 @@ export const postItemsSoupAstGroupedResponse = zod
entity_id: zod.string(),
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -14426,6 +15128,7 @@ export const postItemsSoupAstGroupedResponse = zod
zod.null(),
zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -14525,6 +15228,7 @@ export const postItemsSoupAstGroupedResponse = zod
entity_id: zod.string(),
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -14848,6 +15552,7 @@ export const postItemsSoupAstGroupedResponse = zod
zod.null(),
zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -14949,6 +15654,7 @@ export const postItemsSoupAstGroupedResponse = zod
entity_id: zod.string(),
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -15449,10 +16155,232 @@ export const postItemsSoupAstGroupedResponse = zod
userId: zod.string().describe('The user id.'),
})
.describe(
- 'A participant in a call record, as displayed in Soup.'
+ 'A participant in a call record, as displayed in Soup.'
+ )
+ )
+ .describe('Participants in the call.'),
+ properties: zod
+ .array(
+ zod
+ .object({
+ definition: zod
+ .object({
+ created_at: zod.iso.datetime({}),
+ data_type: zod
+ .enum([
+ 'BOOLEAN',
+ 'DATE',
+ 'NUMBER',
+ 'STRING',
+ 'SELECT_NUMBER',
+ 'SELECT_STRING',
+ 'TAG',
+ 'ENTITY',
+ 'LINK',
+ ])
+ .describe(
+ 'Data type for property values, determining storage and validation.'
+ ),
+ display_name: zod.string(),
+ id: zod.uuid(),
+ is_metadata: zod
+ .boolean()
+ .describe(
+ 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'
+ ),
+ is_multi_select: zod.boolean(),
+ is_system: zod
+ .boolean()
+ .describe(
+ 'Flag to indicate if this is a system property (stored in DB).'
+ ),
+ owner: zod
+ .union([
+ zod
+ .object({
+ scope: zod.enum(['user']),
+ user_id: zod.string(),
+ })
+ .describe('User-scoped property.'),
+ zod
+ .object({
+ scope: zod.enum(['team']),
+ team_id: zod.uuid(),
+ })
+ .describe('Team-scoped property.'),
+ zod
+ .object({
+ scope: zod.enum(['system']),
+ })
+ .describe(
+ 'System-owned property (no user or team owner).'
+ ),
+ ])
+ .describe(
+ 'Defines who owns a property - user-scoped, team-scoped, or system.'
+ ),
+ specific_entity_type: zod
+ .union([
+ zod.null(),
+ zod
+ .enum([
+ 'CALL_RECORD',
+ 'CHANNEL',
+ 'CHAT',
+ 'COMPANY',
+ 'DOCUMENT',
+ 'PROJECT',
+ 'TASK',
+ 'THREAD',
+ 'USER',
+ ])
+ .describe(
+ 'Type of entity that can be referenced by entity properties.'
+ ),
+ ])
+ .optional(),
+ updated_at: zod.iso.datetime({}),
+ })
+ .describe(
+ 'Property definition model (service representation).'
+ ),
+ id: zod
+ .uuid()
+ .describe(
+ 'Globally unique id of the assignment attaching this property to an entity.'
+ ),
+ value: zod
+ .union([
+ zod.null(),
+ zod
+ .union([
+ zod
+ .object({
+ type: zod.enum(['Boolean']),
+ value: zod
+ .boolean()
+ .describe(
+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'
+ ),
+ })
+ .describe(
+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Number']),
+ value: zod
+ .number()
+ .describe(
+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'
+ ),
+ })
+ .describe(
+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['String']),
+ value: zod
+ .string()
+ .describe(
+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'
+ ),
+ })
+ .describe(
+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Date']),
+ value: zod.iso
+ .datetime({})
+ .describe(
+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'
+ ),
+ })
+ .describe(
+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['SelectOption']),
+ value: zod
+ .array(zod.uuid())
+ .describe(
+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'
+ ),
+ })
+ .describe(
+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'
+ ),
+ zod
+ .object({
+ type: zod.enum(['EntityReference']),
+ value: zod
+ .array(
+ zod
+ .object({
+ entity_id: zod.string(),
+ entity_type: zod
+ .enum([
+ 'CALL_RECORD',
+ 'CHANNEL',
+ 'CHAT',
+ 'COMPANY',
+ 'DOCUMENT',
+ 'PROJECT',
+ 'TASK',
+ 'THREAD',
+ 'USER',
+ ])
+ .describe(
+ 'Type of entity that can be referenced by entity properties.'
+ ),
+ specific_message_id: zod
+ .uuid()
+ .nullish()
+ .describe(
+ 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'
+ ),
+ })
+ .describe(
+ 'Entity reference for entity-type property values.'
+ )
+ )
+ .describe(
+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'
+ ),
+ })
+ .describe(
+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Link']),
+ value: zod
+ .array(zod.string())
+ .describe(
+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'
+ ),
+ })
+ .describe(
+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'
+ ),
+ ])
+ .describe(
+ 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'
+ ),
+ ])
+ .optional(),
+ })
+ .describe(
+ 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'
)
)
- .describe('Participants in the call.'),
+ .describe(
+ 'Entity properties (e.g. tags). Populated after fetch by the soup repo.'
+ ),
startedAt: zod.iso
.datetime({})
.describe('When the call started.'),
@@ -15599,6 +16527,7 @@ export const postItemsSoupAstGroupedResponse = zod
zod.null(),
zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -15698,6 +16627,7 @@ export const postItemsSoupAstGroupedResponse = zod
entity_id: zod.string(),
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -16006,6 +16936,7 @@ export const postItemsSoupAstGroupedResponse = zod
zod.null(),
zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -16105,6 +17036,7 @@ export const postItemsSoupAstGroupedResponse = zod
entity_id: zod.string(),
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -16297,6 +17229,7 @@ export const postItemsSoupAstGroupedResponse = zod
zod.null(),
zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -16396,6 +17329,7 @@ export const postItemsSoupAstGroupedResponse = zod
entity_id: zod.string(),
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -16547,6 +17481,7 @@ export const postItemsSoupAstGroupedResponse = zod
zod.null(),
zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -16646,6 +17581,7 @@ export const postItemsSoupAstGroupedResponse = zod
entity_id: zod.string(),
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -16969,6 +17905,7 @@ export const postItemsSoupAstGroupedResponse = zod
zod.null(),
zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -17070,6 +18007,7 @@ export const postItemsSoupAstGroupedResponse = zod
entity_id: zod.string(),
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -17574,6 +18512,228 @@ export const postItemsSoupAstGroupedResponse = zod
)
)
.describe('Participants in the call.'),
+ properties: zod
+ .array(
+ zod
+ .object({
+ definition: zod
+ .object({
+ created_at: zod.iso.datetime({}),
+ data_type: zod
+ .enum([
+ 'BOOLEAN',
+ 'DATE',
+ 'NUMBER',
+ 'STRING',
+ 'SELECT_NUMBER',
+ 'SELECT_STRING',
+ 'TAG',
+ 'ENTITY',
+ 'LINK',
+ ])
+ .describe(
+ 'Data type for property values, determining storage and validation.'
+ ),
+ display_name: zod.string(),
+ id: zod.uuid(),
+ is_metadata: zod
+ .boolean()
+ .describe(
+ 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'
+ ),
+ is_multi_select: zod.boolean(),
+ is_system: zod
+ .boolean()
+ .describe(
+ 'Flag to indicate if this is a system property (stored in DB).'
+ ),
+ owner: zod
+ .union([
+ zod
+ .object({
+ scope: zod.enum(['user']),
+ user_id: zod.string(),
+ })
+ .describe('User-scoped property.'),
+ zod
+ .object({
+ scope: zod.enum(['team']),
+ team_id: zod.uuid(),
+ })
+ .describe('Team-scoped property.'),
+ zod
+ .object({
+ scope: zod.enum(['system']),
+ })
+ .describe(
+ 'System-owned property (no user or team owner).'
+ ),
+ ])
+ .describe(
+ 'Defines who owns a property - user-scoped, team-scoped, or system.'
+ ),
+ specific_entity_type: zod
+ .union([
+ zod.null(),
+ zod
+ .enum([
+ 'CALL_RECORD',
+ 'CHANNEL',
+ 'CHAT',
+ 'COMPANY',
+ 'DOCUMENT',
+ 'PROJECT',
+ 'TASK',
+ 'THREAD',
+ 'USER',
+ ])
+ .describe(
+ 'Type of entity that can be referenced by entity properties.'
+ ),
+ ])
+ .optional(),
+ updated_at: zod.iso.datetime({}),
+ })
+ .describe(
+ 'Property definition model (service representation).'
+ ),
+ id: zod
+ .uuid()
+ .describe(
+ 'Globally unique id of the assignment attaching this property to an entity.'
+ ),
+ value: zod
+ .union([
+ zod.null(),
+ zod
+ .union([
+ zod
+ .object({
+ type: zod.enum(['Boolean']),
+ value: zod
+ .boolean()
+ .describe(
+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'
+ ),
+ })
+ .describe(
+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Number']),
+ value: zod
+ .number()
+ .describe(
+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'
+ ),
+ })
+ .describe(
+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['String']),
+ value: zod
+ .string()
+ .describe(
+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'
+ ),
+ })
+ .describe(
+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Date']),
+ value: zod.iso
+ .datetime({})
+ .describe(
+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'
+ ),
+ })
+ .describe(
+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['SelectOption']),
+ value: zod
+ .array(zod.uuid())
+ .describe(
+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'
+ ),
+ })
+ .describe(
+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'
+ ),
+ zod
+ .object({
+ type: zod.enum(['EntityReference']),
+ value: zod
+ .array(
+ zod
+ .object({
+ entity_id: zod.string(),
+ entity_type: zod
+ .enum([
+ 'CALL_RECORD',
+ 'CHANNEL',
+ 'CHAT',
+ 'COMPANY',
+ 'DOCUMENT',
+ 'PROJECT',
+ 'TASK',
+ 'THREAD',
+ 'USER',
+ ])
+ .describe(
+ 'Type of entity that can be referenced by entity properties.'
+ ),
+ specific_message_id: zod
+ .uuid()
+ .nullish()
+ .describe(
+ 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'
+ ),
+ })
+ .describe(
+ 'Entity reference for entity-type property values.'
+ )
+ )
+ .describe(
+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'
+ ),
+ })
+ .describe(
+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Link']),
+ value: zod
+ .array(zod.string())
+ .describe(
+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'
+ ),
+ })
+ .describe(
+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'
+ ),
+ ])
+ .describe(
+ 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'
+ ),
+ ])
+ .optional(),
+ })
+ .describe(
+ 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'
+ )
+ )
+ .describe(
+ 'Entity properties (e.g. tags). Populated after fetch by the soup repo.'
+ ),
startedAt: zod.iso
.datetime({})
.describe('When the call started.'),
@@ -17720,6 +18880,7 @@ export const postItemsSoupAstGroupedResponse = zod
zod.null(),
zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
@@ -17819,6 +18980,7 @@ export const postItemsSoupAstGroupedResponse = zod
entity_id: zod.string(),
entity_type: zod
.enum([
+ 'CALL_RECORD',
'CHANNEL',
'CHAT',
'COMPANY',
diff --git a/apps/web/src/lib/service-clients/service-storage/graphql-properties.test.ts b/apps/web/src/lib/service-clients/service-storage/graphql-properties.test.ts
index 48c6b7e42e..a0cbc33c83 100644
--- a/apps/web/src/lib/service-clients/service-storage/graphql-properties.test.ts
+++ b/apps/web/src/lib/service-clients/service-storage/graphql-properties.test.ts
@@ -102,6 +102,7 @@ describe('toGraphqlPropertyEntityType', () => {
expect(toGraphqlPropertyEntityType('DOCUMENT')).toBe('DOCUMENT');
expect(toGraphqlPropertyEntityType('TASK')).toBe('TASK');
expect(toGraphqlPropertyEntityType('COMPANY')).toBe('COMPANY');
+ expect(toGraphqlPropertyEntityType('CALL_RECORD')).toBe('CALL_RECORD');
});
});
diff --git a/apps/web/src/lib/service-clients/service-storage/graphql-properties.ts b/apps/web/src/lib/service-clients/service-storage/graphql-properties.ts
index 15caf05aec..0cbff4b5bc 100644
--- a/apps/web/src/lib/service-clients/service-storage/graphql-properties.ts
+++ b/apps/web/src/lib/service-clients/service-storage/graphql-properties.ts
@@ -35,6 +35,7 @@ import { getGraphqlSoupClient } from './graphql-soup';
* bad request.
*/
const ENTITY_TYPE_TO_GRAPHQL: Record<EntityType, GraphqlPropertyEntityType> = {
+ CALL_RECORD: 'CALL_RECORD',
CHANNEL: 'CHANNEL',
CHAT: 'CHAT',
COMPANY: 'COMPANY',
diff --git a/apps/web/src/lib/service-clients/service-storage/graphql/generated/graphql.ts b/apps/web/src/lib/service-clients/service-storage/graphql/generated/graphql.ts
index 81a887e35a..6bf96a869d 100644
--- a/apps/web/src/lib/service-clients/service-storage/graphql/generated/graphql.ts
+++ b/apps/web/src/lib/service-clients/service-storage/graphql/generated/graphql.ts
@@ -306,6 +306,8 @@ export type GraphqlPropertyDataType =
/** An entity type supported by the properties domain. */
export type GraphqlPropertyEntityType =
+ /** Call record entity. */
+ | 'CALL_RECORD'
/** Channel entity. */
| 'CHANNEL'
/** Chat entity. */
@@ -501,4 +503,4 @@ export type SoupChannelMessageFieldsFragment = { id: string, threadId: string |
export const SoupPropertyFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlProperty"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"propertyDefinitionId"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}},{"kind":"Field","name":{"kind":"Name","value":"isMultiSelect"}},{"kind":"Field","name":{"kind":"Name","value":"specificEntityType"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"value"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlBooleanPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"boolValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNumberPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"numberValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlStringPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"stringValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDatePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"dateValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSelectOptionPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"optionIds"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityReferencePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"references"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"specificMessageId"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlLinkPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"urls"}}]}}]}}]}}]} as unknown as DocumentNode<SoupPropertyFieldsFragment, unknown>;
export const SoupChannelMessageFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupChannelMessageFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"mentions"}}]}}]} as unknown as DocumentNode<SoupChannelMessageFieldsFragment, unknown>;
export const SetEntityPropertyDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SetEntityProperty"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SetEntityPropertyInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"setEntityProperty"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlProperty"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"propertyDefinitionId"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}},{"kind":"Field","name":{"kind":"Name","value":"isMultiSelect"}},{"kind":"Field","name":{"kind":"Name","value":"specificEntityType"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"value"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlBooleanPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"boolValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNumberPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"numberValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlStringPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"stringValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDatePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"dateValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSelectOptionPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"optionIds"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityReferencePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"references"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"specificMessageId"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlLinkPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"urls"}}]}}]}}]}}]} as unknown as DocumentNode<SetEntityPropertyMutation, SetEntityPropertyMutationVariables>;
-export const SoupDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Soup"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SoupInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"soup"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"frecencyScore"}},{"kind":"Field","name":{"kind":"Name","value":"entity"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupDocument"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","alias":{"kind":"Name","value":"documentName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"fileType"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"subType"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"isCompleted"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChat"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","alias":{"kind":"Name","value":"chatName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"isPersistent"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupProject"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","alias":{"kind":"Name","value":"projectName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"parentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEmailThread"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"providerId"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"inboxVisible"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","alias":{"kind":"Name","value":"emailName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"senderEmail"}},{"kind":"Field","name":{"kind":"Name","value":"senderName"}},{"kind":"Field","name":{"kind":"Name","value":"senderPhotoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"isRead"}},{"kind":"Field","name":{"kind":"Name","value":"isDraft"}},{"kind":"Field","name":{"kind":"Name","value":"isImportant"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"sortTs"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"sfsPhotoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"attachments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"providerAttachmentId"}},{"kind":"Field","name":{"kind":"Name","value":"filename"}},{"kind":"Field","name":{"kind":"Name","value":"mimeType"}},{"kind":"Field","name":{"kind":"Name","value":"sizeBytes"}},{"kind":"Field","name":{"kind":"Name","value":"contentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"labels"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"providerLabelId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"messageListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"labelListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannel"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","alias":{"kind":"Name","value":"channelName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"channelType"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"organizationId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"interactedAt"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestNonThreadMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelThread"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"effectiveUpdatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"replyCount"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCall"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"channelName"}},{"kind":"Field","name":{"kind":"Name","value":"createdBy"}},{"kind":"Field","name":{"kind":"Name","value":"customName"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}},{"kind":"Field","name":{"kind":"Name","value":"startedAt"}},{"kind":"Field","name":{"kind":"Name","value":"endedAt"}},{"kind":"Field","name":{"kind":"Name","value":"durationMs"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"attended"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCrmCompany"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","alias":{"kind":"Name","value":"crmTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmCompanyName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"emailSync"}},{"kind":"Field","name":{"kind":"Name","value":"hidden"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"domains"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupForeignEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","name":{"kind":"Name","value":"foreignEntitySource"}},{"kind":"Field","name":{"kind":"Name","value":"storedForId"}},{"kind":"Field","name":{"kind":"Name","value":"storedForAuthEntity"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"nextCursor"}},{"kind":"Field","name":{"kind":"Name","value":"hasMore"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlProperty"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"propertyDefinitionId"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}},{"kind":"Field","name":{"kind":"Name","value":"isMultiSelect"}},{"kind":"Field","name":{"kind":"Name","value":"specificEntityType"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"value"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlBooleanPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"boolValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNumberPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"numberValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlStringPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"stringValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDatePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"dateValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSelectOptionPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"optionIds"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityReferencePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"references"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"specificMessageId"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlLinkPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"urls"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupChannelMessageFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"mentions"}}]}}]} as unknown as DocumentNode<SoupQuery, SoupQueryVariables>;
+export const SoupDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Soup"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SoupInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"soup"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"frecencyScore"}},{"kind":"Field","name":{"kind":"Name","value":"entity"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupDocument"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","alias":{"kind":"Name","value":"documentName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"fileType"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"subType"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"isCompleted"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChat"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","alias":{"kind":"Name","value":"chatName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"isPersistent"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupProject"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","alias":{"kind":"Name","value":"projectName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"parentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEmailThread"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"providerId"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"inboxVisible"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","alias":{"kind":"Name","value":"emailName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"senderEmail"}},{"kind":"Field","name":{"kind":"Name","value":"senderName"}},{"kind":"Field","name":{"kind":"Name","value":"senderPhotoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"isRead"}},{"kind":"Field","name":{"kind":"Name","value":"isDraft"}},{"kind":"Field","name":{"kind":"Name","value":"isImportant"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"sortTs"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"sfsPhotoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"attachments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"providerAttachmentId"}},{"kind":"Field","name":{"kind":"Name","value":"filename"}},{"kind":"Field","name":{"kind":"Name","value":"mimeType"}},{"kind":"Field","name":{"kind":"Name","value":"sizeBytes"}},{"kind":"Field","name":{"kind":"Name","value":"contentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"labels"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"providerLabelId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"messageListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"labelListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannel"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","alias":{"kind":"Name","value":"channelName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"channelType"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"organizationId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"interactedAt"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestNonThreadMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelThread"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"effectiveUpdatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"replyCount"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCall"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"channelName"}},{"kind":"Field","name":{"kind":"Name","value":"createdBy"}},{"kind":"Field","name":{"kind":"Name","value":"customName"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}},{"kind":"Field","name":{"kind":"Name","value":"startedAt"}},{"kind":"Field","name":{"kind":"Name","value":"endedAt"}},{"kind":"Field","name":{"kind":"Name","value":"durationMs"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"attended"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCrmCompany"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","alias":{"kind":"Name","value":"crmTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmCompanyName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"emailSync"}},{"kind":"Field","name":{"kind":"Name","value":"hidden"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"domains"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupForeignEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","name":{"kind":"Name","value":"foreignEntitySource"}},{"kind":"Field","name":{"kind":"Name","value":"storedForId"}},{"kind":"Field","name":{"kind":"Name","value":"storedForAuthEntity"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"nextCursor"}},{"kind":"Field","name":{"kind":"Name","value":"hasMore"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlProperty"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"propertyDefinitionId"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}},{"kind":"Field","name":{"kind":"Name","value":"isMultiSelect"}},{"kind":"Field","name":{"kind":"Name","value":"specificEntityType"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"value"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlBooleanPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"boolValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNumberPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"numberValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlStringPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"stringValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDatePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"dateValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSelectOptionPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"optionIds"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityReferencePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"references"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"specificMessageId"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlLinkPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"urls"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupChannelMessageFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"mentions"}}]}}]} as unknown as DocumentNode<SoupQuery, SoupQueryVariables>;
\ No newline at end of file
diff --git a/apps/web/src/lib/service-clients/service-storage/openapi.json b/apps/web/src/lib/service-clients/service-storage/openapi.json
index 35761582bd..437c1ee038 100644
--- a/apps/web/src/lib/service-clients/service-storage/openapi.json
+++ b/apps/web/src/lib/service-clients/service-storage/openapi.json
@@ -14354,6 +14354,7 @@
"type": "string",
"description": "Type of entity that can be referenced by entity properties.",
"enum": [
+ "CALL_RECORD",
"CHANNEL",
"CHAT",
"COMPANY",
@@ -18184,7 +18185,8 @@
"isActive",
"status",
"attended",
- "participants"
+ "participants",
+ "properties"
],
"properties": {
"attended": {
@@ -18234,6 +18236,13 @@
},
"description": "Participants in the call."
},
+ "properties": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/SoupProperty"
+ },
+ "description": "Entity properties (e.g. tags). Populated after fetch by the soup repo."
+ },
"startedAt": {
"type": "string",
"format": "date-time",
diff --git a/crates/ai_tools/src/search/search_service/content.rs b/crates/ai_tools/src/search/search_service/content.rs
index c1b3bd02f2..9b35b2d8b8 100644
--- a/crates/ai_tools/src/search/search_service/content.rs
+++ b/crates/ai_tools/src/search/search_service/content.rs
@@ -18,7 +18,7 @@ use serde::Deserialize;
#[derive(Debug, JsonSchema, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
#[schemars(
- description = "Search items by their content: document body text; email subject/body/sender/recipient/cc/bcc and the display names on those addresses; chat messages; call transcripts. This is keyword search, not semantic search: queries only match literal words/tokens, prefixes, or exact quoted terms that appear in the indexed content. Use this for targeted keyword/content lookup, not for activity-summary questions like \"what happened today\", \"what's going on\", \"catch me up\", or \"what happened in standup today\"; those should start with ListEntities using time/type/channel filters. Whitespace-separated terms are ANDed. For documents and emails, every term must match somewhere in the document — different terms can appear in different chunks/pages or different fields. For documents and emails specifically, each single-word term is matched as a prefix (so `scri` matches `script`); for emails the prefix expansion also runs against the local-part of address fields. For chats, channels, and call transcripts the whole query is matched as a single adjacent phrase prefix — so pass 1-3 targeted keywords drawn from words that would literally appear in the content, not the user's natural-language description; long phrases will not match. Matching defaults to prefix; set matchType to 'exact' to match whole tokens/phrases with no prefix expansion (e.g. an exact word, identifier, or full email address). Wrap a multi-word phrase in double quotes to keep it together as one adjacent phrase. If the user's request combines a person with a topic, run separate searches rather than one combined query. Leave entityTypes empty by default; only filter when the user explicitly scopes to a type. Results for documents, emails, AI chats, and projects include the tags visible to the user as {label, scope} pairs; to restrict a search to tagged items, pass the tag labels in the tags argument (ListTags shows which tags exist).",
+ description = "Search items by their content: document body text; email subject/body/sender/recipient/cc/bcc and the display names on those addresses; chat messages; call transcripts. This is keyword search, not semantic search: queries only match literal words/tokens, prefixes, or exact quoted terms that appear in the indexed content. Use this for targeted keyword/content lookup, not for activity-summary questions like \"what happened today\", \"what's going on\", \"catch me up\", or \"what happened in standup today\"; those should start with ListEntities using time/type/channel filters. Whitespace-separated terms are ANDed. For documents and emails, every term must match somewhere in the document — different terms can appear in different chunks/pages or different fields. For documents and emails specifically, each single-word term is matched as a prefix (so `scri` matches `script`); for emails the prefix expansion also runs against the local-part of address fields. For chats, channels, and call transcripts the whole query is matched as a single adjacent phrase prefix — so pass 1-3 targeted keywords drawn from words that would literally appear in the content, not the user's natural-language description; long phrases will not match. Matching defaults to prefix; set matchType to 'exact' to match whole tokens/phrases with no prefix expansion (e.g. an exact word, identifier, or full email address). Wrap a multi-word phrase in double quotes to keep it together as one adjacent phrase. If the user's request combines a person with a topic, run separate searches rather than one combined query. Leave entityTypes empty by default; only filter when the user explicitly scopes to a type. Results for documents, emails, AI chats, projects, and call records include the tags visible to the user as {label, scope} pairs; to restrict a search to tagged items, pass the tag labels in the tags argument (ListTags shows which tags exist).",
title = "ContentSearch"
)]
pub struct ContentSearch {
@@ -51,7 +51,7 @@ them with tagsMatch=\"all\". Each entry names a tag by its label, matched case-i
against the user's own tags; only set scope (\"personal\" or \"team\") when the user \
distinguishes between their personal and team tags. An unknown label fails with the list of \
available tags — call ListTags first when unsure what tags exist. Only taggable items \
-(documents, emails, AI chats, projects) can match, so channels and call records are dropped \
+(documents, emails, AI chats, projects, call records) can match, so channels are dropped \
while a tag filter is active.")]
#[serde(default)]
pub tags: Option<Vec<TagFilter>>,
diff --git a/crates/ai_tools/src/search/search_service/name.rs b/crates/ai_tools/src/search/search_service/name.rs
index 36422b4fc9..860f6ee44e 100644
--- a/crates/ai_tools/src/search/search_service/name.rs
+++ b/crates/ai_tools/src/search/search_service/name.rs
@@ -18,7 +18,7 @@ use serde::Deserialize;
#[derive(Debug, JsonSchema, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
#[schemars(
- description = "Search items by their name or title: document name, email subject, chat title, project name, the channel name a call belongs to. This is keyword search, not semantic search: queries only match literal words/tokens, prefixes, or exact quoted terms that appear in the indexed title/name. Use this for targeted name/title lookup, not for activity-summary questions like \"what happened today\", \"what's going on\", \"catch me up\", or \"what happened in standup today\"; those should start with ListEntities using time/type/channel filters. For emails, whitespace-separated terms are ANDed and each is a prefix match against the subject. For all other types the whole query is matched as a single adjacent phrase prefix — so pass 1-3 targeted keywords drawn from words that would literally appear in the title, not the user's natural-language description; long phrases will not match. Matching defaults to prefix; set matchType to 'exact' to match whole tokens/phrases with no prefix expansion. Wrap a multi-word phrase in double quotes to keep it together as one adjacent phrase. If the user's request combines a person with a topic, run separate searches (NameSearch for the person, ContentSearch for the topic) rather than one combined query. Leave entityTypes empty by default; only filter when the user explicitly scopes to a type. Results for documents, emails, AI chats, and projects include the tags visible to the user as {label, scope} pairs; to restrict a search to tagged items, pass the tag labels in the tags argument (ListTags shows which tags exist).",
+ description = "Search items by their name or title: document name, email subject, chat title, project name, the channel name a call belongs to. This is keyword search, not semantic search: queries only match literal words/tokens, prefixes, or exact quoted terms that appear in the indexed title/name. Use this for targeted name/title lookup, not for activity-summary questions like \"what happened today\", \"what's going on\", \"catch me up\", or \"what happened in standup today\"; those should start with ListEntities using time/type/channel filters. For emails, whitespace-separated terms are ANDed and each is a prefix match against the subject. For all other types the whole query is matched as a single adjacent phrase prefix — so pass 1-3 targeted keywords drawn from words that would literally appear in the title, not the user's natural-language description; long phrases will not match. Matching defaults to prefix; set matchType to 'exact' to match whole tokens/phrases with no prefix expansion. Wrap a multi-word phrase in double quotes to keep it together as one adjacent phrase. If the user's request combines a person with a topic, run separate searches (NameSearch for the person, ContentSearch for the topic) rather than one combined query. Leave entityTypes empty by default; only filter when the user explicitly scopes to a type. Results for documents, emails, AI chats, projects, and call records include the tags visible to the user as {label, scope} pairs; to restrict a search to tagged items, pass the tag labels in the tags argument (ListTags shows which tags exist).",
title = "NameSearch"
)]
pub struct NameSearch {
@@ -51,7 +51,7 @@ them with tagsMatch=\"all\". Each entry names a tag by its label, matched case-i
against the user's own tags; only set scope (\"personal\" or \"team\") when the user \
distinguishes between their personal and team tags. An unknown label fails with the list of \
available tags — call ListTags first when unsure what tags exist. Only taggable items \
-(documents, emails, AI chats, projects) can match, so channels and call records are dropped \
+(documents, emails, AI chats, projects, call records) can match, so channels are dropped \
while a tag filter is active.")]
#[serde(default)]
pub tags: Option<Vec<TagFilter>>,
diff --git a/crates/ai_tools/src/search/search_service/types.rs b/crates/ai_tools/src/search/search_service/types.rs
index 4a75a23f52..31ff579718 100644
--- a/crates/ai_tools/src/search/search_service/types.rs
+++ b/crates/ai_tools/src/search/search_service/types.rs
@@ -168,9 +168,8 @@ fn item_properties(item: &UnifiedSearchResponseItem) -> Option<&Vec<SoupProperty
UnifiedSearchResponseItem::Chat(i) => i.properties.as_ref(),
UnifiedSearchResponseItem::Email(i) => i.properties.as_ref(),
UnifiedSearchResponseItem::Project(i) => i.properties.as_ref(),
- UnifiedSearchResponseItem::Channel(_)
- | UnifiedSearchResponseItem::Call(_)
- | UnifiedSearchResponseItem::Company(_) => None,
+ UnifiedSearchResponseItem::Call(i) => i.properties.as_ref(),
+ UnifiedSearchResponseItem::Channel(_) | UnifiedSearchResponseItem::Company(_) => None,
}
}
@@ -180,8 +179,7 @@ fn item_properties_mut(item: &mut UnifiedSearchResponseItem) -> Option<&mut Vec<
UnifiedSearchResponseItem::Chat(i) => i.properties.as_mut(),
UnifiedSearchResponseItem::Email(i) => i.properties.as_mut(),
UnifiedSearchResponseItem::Project(i) => i.properties.as_mut(),
- UnifiedSearchResponseItem::Channel(_)
- | UnifiedSearchResponseItem::Call(_)
- | UnifiedSearchResponseItem::Company(_) => None,
+ UnifiedSearchResponseItem::Call(i) => i.properties.as_mut(),
+ UnifiedSearchResponseItem::Channel(_) | UnifiedSearchResponseItem::Company(_) => None,
}
}
diff --git a/crates/call/src/outbound/pg_call_repo.rs b/crates/call/src/outbound/pg_call_repo.rs
index 6bae73e994..d17fd5cfaf 100644
--- a/crates/call/src/outbound/pg_call_repo.rs
+++ b/crates/call/src/outbound/pg_call_repo.rs
@@ -13,7 +13,7 @@ use entity_access::domain::models::AccessLevel;
use filter_ast::Expr;
use item_filters::{
CallStatus,
- ast::{LiteralTree, call::CallLiteral},
+ ast::{LiteralTree, call::CallLiteral, properties::PropertyMatchValue},
};
use macro_user_id::{cowlike::CowLike, user_id::MacroUserIdStr};
use models_permissions::share_permission::SharePermissionV2;
@@ -62,6 +62,8 @@ fn collect_channel_ids(expr: &Expr<CallLiteral>, ids: &mut Vec<Uuid>) {
Expr::Literal(CallLiteral::Attended(_)) => {}
// Speaker is transcript-segment-only; soup's call list ignores it.
Expr::Literal(CallLiteral::Speaker(_)) => {}
+ // Tag/property conditions are handled by `extract_tag_option_ids`.
+ Expr::Literal(CallLiteral::Property(_)) => {}
Expr::And(a, b) | Expr::Or(a, b) => {
collect_channel_ids(a, ids);
collect_channel_ids(b, ids);
@@ -80,6 +82,61 @@ fn extract_call_ids(filter: &LiteralTree<CallLiteral>) -> Vec<Uuid> {
ids
}
+/// Extract tag option ids (select-option UUIDs) from `CallLiteral::Property`
+/// literals. Tags are def-less: a call matches if any of its property values
+/// contains one of these option ids, mirroring the search-service tag filter.
+/// Structure (AND/OR/NOT) is flattened — soup only folds in a positive OR of
+/// tag literals, so a flat "any of" match is exact.
+fn extract_tag_option_ids(filter: &LiteralTree<CallLiteral>) -> Vec<String> {
+ let Some(expr) = filter else {
+ return Vec::new();
+ };
+ let mut ids = Vec::new();
+ collect_tag_option_ids(expr, &mut ids);
+ ids
+}
+
+fn collect_tag_option_ids(expr: &Expr<CallLiteral>, ids: &mut Vec<String>) {
+ match expr {
+ Expr::Literal(CallLiteral::Property(lit)) => {
+ if let PropertyMatchValue::SelectOption(option_id) = &lit.value {
+ ids.push(option_id.to_string());
+ }
+ }
+ Expr::Literal(_) => {}
+ Expr::And(a, b) | Expr::Or(a, b) => {
+ collect_tag_option_ids(a, ids);
+ collect_tag_option_ids(b, ids);
+ }
+ Expr::Not(inner) => collect_tag_option_ids(inner, ids),
+ }
+}
+
+/// Whether the tag filter requires ALL of its options rather than ANY. The
+/// tag filter is folded in as an OR of tag literals for ANY and an AND of tag
+/// literals for ALL (matching the search index's `match_all_tags`), so an
+/// `And` joining two tag-bearing branches marks ALL. A single option reads as
+/// ANY, which is equivalent.
+fn tag_filter_requires_all(filter: &LiteralTree<CallLiteral>) -> bool {
+ fn contains_tag(expr: &Expr<CallLiteral>) -> bool {
+ match expr {
+ Expr::Literal(CallLiteral::Property(_)) => true,
+ Expr::Literal(_) => false,
+ Expr::And(a, b) | Expr::Or(a, b) => contains_tag(a) || contains_tag(b),
+ Expr::Not(inner) => contains_tag(inner),
+ }
+ }
+ fn walk(expr: &Expr<CallLiteral>) -> bool {
+ match expr {
+ Expr::And(a, b) => (contains_tag(a) && contains_tag(b)) || walk(a) || walk(b),
+ Expr::Or(a, b) => walk(a) || walk(b),
+ Expr::Not(inner) => walk(inner),
+ Expr::Literal(_) => false,
+ }
+ }
+ filter.as_ref().is_some_and(|expr| walk(expr))
+}
+
fn collect_call_ids(expr: &Expr<CallLiteral>, ids: &mut Vec<Uuid>) {
match expr {
Expr::Literal(CallLiteral::CallId(id)) => ids.push(*id),
@@ -87,6 +144,7 @@ fn collect_call_ids(expr: &Expr<CallLiteral>, ids: &mut Vec<Uuid>) {
Expr::Literal(CallLiteral::Status(_)) => {}
Expr::Literal(CallLiteral::Attended(_)) => {}
Expr::Literal(CallLiteral::Speaker(_)) => {}
+ Expr::Literal(CallLiteral::Property(_)) => {}
Expr::And(a, b) | Expr::Or(a, b) => {
collect_call_ids(a, ids);
collect_call_ids(b, ids);
@@ -210,7 +268,8 @@ fn status_set_for_expr(expr: &Expr<CallLiteral>) -> Option<CallStatusSet> {
Expr::Literal(CallLiteral::Attended(false)) => Some(CallStatusSet::not_participant()),
Expr::Literal(CallLiteral::CallId(_))
| Expr::Literal(CallLiteral::ChannelId(_))
- | Expr::Literal(CallLiteral::Speaker(_)) => None,
+ | Expr::Literal(CallLiteral::Speaker(_))
+ | Expr::Literal(CallLiteral::Property(_)) => None,
Expr::And(a, b) => match (status_set_for_expr(a), status_set_for_expr(b)) {
(Some(left), Some(right)) => Some(left.intersect(right)),
(Some(status_set), None) | (None, Some(status_set)) => Some(status_set),
@@ -1329,6 +1388,9 @@ impl CallRepository for PgCallRepo {
.map(call_status_sql_value)
.map(str::to_string)
.collect();
+ let tag_option_ids = extract_tag_option_ids(filter);
+ let has_tag_filter = !tag_option_ids.is_empty();
+ let match_all_tags = tag_filter_requires_all(filter);
let rows = sqlx::query!(
r#"
@@ -1382,6 +1444,25 @@ impl CallRepository for PgCallRepo {
)
AND ($3::bool IS FALSE OR c.channel_id = ANY($4))
AND ($5::bool IS FALSE OR c.id = ANY($6))
+ AND ($9::bool IS FALSE OR (
+ ($11::bool IS FALSE AND EXISTS (
+ SELECT 1 FROM entity_properties ep
+ WHERE ep.entity_id = c.id::text
+ AND ep.entity_type = 'CALL_RECORD'
+ AND jsonb_typeof(ep.values -> 'value') = 'array'
+ AND jsonb_exists_any(ep.values -> 'value', $10::text[])
+ ))
+ OR ($11::bool IS TRUE AND $10::text[] <@ (
+ SELECT COALESCE(array_agg(elem), ARRAY[]::text[])
+ FROM (
+ SELECT values FROM entity_properties
+ WHERE entity_id = c.id::text
+ AND entity_type = 'CALL_RECORD'
+ AND jsonb_typeof(values -> 'value') = 'array'
+ ) ep
+ CROSS JOIN LATERAL jsonb_array_elements_text(ep.values -> 'value') AS elem
+ ))
+ ))
UNION ALL
SELECT
cr.id AS call_id,
@@ -1421,6 +1502,25 @@ impl CallRepository for PgCallRepo {
)
AND ($3::bool IS FALSE OR cr.channel_id = ANY($4))
AND ($5::bool IS FALSE OR cr.id = ANY($6))
+ AND ($9::bool IS FALSE OR (
+ ($11::bool IS FALSE AND EXISTS (
+ SELECT 1 FROM entity_properties ep
+ WHERE ep.entity_id = cr.id::text
+ AND ep.entity_type = 'CALL_RECORD'
+ AND jsonb_typeof(ep.values -> 'value') = 'array'
+ AND jsonb_exists_any(ep.values -> 'value', $10::text[])
+ ))
+ OR ($11::bool IS TRUE AND $10::text[] <@ (
+ SELECT COALESCE(array_agg(elem), ARRAY[]::text[])
+ FROM (
+ SELECT values FROM entity_properties
+ WHERE entity_id = cr.id::text
+ AND entity_type = 'CALL_RECORD'
+ AND jsonb_typeof(values -> 'value') = 'array'
+ ) ep
+ CROSS JOIN LATERAL jsonb_array_elements_text(ep.values -> 'value') AS elem
+ ))
+ ))
)
SELECT
call_id as "call_id!",
@@ -1452,6 +1552,9 @@ impl CallRepository for PgCallRepo {
&call_ids,
has_status_filter,
&status_filter_values,
+ has_tag_filter,
+ &tag_option_ids,
+ match_all_tags,
)
.fetch_all(&self.pool)
.await?;
diff --git a/crates/call/src/outbound/pg_call_repo/test.rs b/crates/call/src/outbound/pg_call_repo/test.rs
index 73e29e81eb..e971cf0735 100644
--- a/crates/call/src/outbound/pg_call_repo/test.rs
+++ b/crates/call/src/outbound/pg_call_repo/test.rs
@@ -30,6 +30,58 @@ fn status_filter(status: CallStatus) -> LiteralTree<CallLiteral> {
Some(Arc::new(Expr::Literal(CallLiteral::Status(status))))
}
+fn tag_property_literal(option_id: Uuid) -> CallLiteral {
+ use item_filters::ast::properties::{PropertiesLiteral, PropertyMatchValue};
+ CallLiteral::Property(PropertiesLiteral {
+ property_definition_id: Uuid::from_u128(0xdef),
+ entity_type: None,
+ value: PropertyMatchValue::SelectOption(option_id),
+ })
+}
+
+#[test]
+fn extract_tag_option_ids_collects_select_options_across_or() {
+ let opt1 = Uuid::from_u128(1);
+ let opt2 = Uuid::from_u128(2);
+ let filter: LiteralTree<CallLiteral> = Some(Arc::new(Expr::or(
+ Expr::Literal(tag_property_literal(opt1)),
+ Expr::Literal(tag_property_literal(opt2)),
+ )));
+
+ let mut ids = super::extract_tag_option_ids(&filter);
+ ids.sort();
+ let mut expected = vec![opt1.to_string(), opt2.to_string()];
+ expected.sort();
+ assert_eq!(ids, expected);
+}
+
+#[test]
+fn extract_tag_option_ids_empty_for_non_property_filter() {
+ assert!(super::extract_tag_option_ids(&status_filter(CallStatus::Attended)).is_empty());
+ assert!(super::extract_tag_option_ids(&None).is_empty());
+}
+
+#[test]
+fn tag_filter_requires_all_distinguishes_and_from_or() {
+ let a = Expr::Literal(tag_property_literal(Uuid::from_u128(1)));
+ let b = Expr::Literal(tag_property_literal(Uuid::from_u128(2)));
+ // ANY: options ORed together.
+ let any: LiteralTree<CallLiteral> = Some(Arc::new(Expr::or(a.clone(), b.clone())));
+ assert!(!super::tag_filter_requires_all(&any));
+ // ALL: options ANDed together, even when combined with a channel filter.
+ let all: LiteralTree<CallLiteral> = Some(Arc::new(Expr::and(
+ Expr::Literal(CallLiteral::ChannelId(Uuid::from_u128(9))),
+ Expr::and(a, b),
+ )));
+ assert!(super::tag_filter_requires_all(&all));
+ // A single option (or no filter) reads as ANY.
+ let single: LiteralTree<CallLiteral> = Some(Arc::new(Expr::Literal(tag_property_literal(
+ Uuid::from_u128(1),
+ ))));
+ assert!(!super::tag_filter_requires_all(&single));
+ assert!(!super::tag_filter_requires_all(&None));
+}
+
fn not_status_filter(status: CallStatus) -> LiteralTree<CallLiteral> {
let expr = Expr::Literal(CallLiteral::Status(status));
Some(Arc::new(Expr::is_not(expr)))
diff --git a/crates/graphql_common/src/property_filter.rs b/crates/graphql_common/src/property_filter.rs
index 76eb02ebc5..34d607e52e 100644
--- a/crates/graphql_common/src/property_filter.rs
+++ b/crates/graphql_common/src/property_filter.rs
@@ -35,7 +35,9 @@ impl IntoFilterExpr<PropertiesLiteral> for GraphqlPropertiesLiteral {
fn into_expr(self) -> async_graphql::Result<Expr<PropertiesLiteral>> {
Ok(Expr::val(PropertiesLiteral {
property_definition_id: parse_id(self.property_definition_id, "propertyDefinitionId")?,
- entity_type: self.entity_type.map(Into::into),
+ entity_type: self
+ .entity_type
+ .and_then(|et| PropertyEntityType::try_from(et).ok()),
value: self.value.into_ast()?,
}))
}
@@ -68,6 +70,8 @@ impl GraphqlPropertyMatchValue {
/// An entity type supported by the properties domain.
#[derive(Enum, Copy, Clone, Eq, PartialEq)]
pub enum GraphqlPropertyEntityType {
+ /// Call record entity.
+ CallRecord,
/// Channel entity.
Channel,
/// Chat entity.
@@ -89,6 +93,7 @@ pub enum GraphqlPropertyEntityType {
impl From<GraphqlPropertyEntityType> for models_properties::EntityType {
fn from(value: GraphqlPropertyEntityType) -> Self {
match value {
+ GraphqlPropertyEntityType::CallRecord => Self::CallRecord,
GraphqlPropertyEntityType::Channel => Self::Channel,
GraphqlPropertyEntityType::Chat => Self::Chat,
GraphqlPropertyEntityType::Company => Self::Company,
@@ -104,6 +109,7 @@ impl From<GraphqlPropertyEntityType> for models_properties::EntityType {
impl From<models_properties::EntityType> for GraphqlPropertyEntityType {
fn from(value: models_properties::EntityType) -> Self {
match value {
+ models_properties::EntityType::CallRecord => Self::CallRecord,
models_properties::EntityType::Channel => Self::Channel,
models_properties::EntityType::Chat => Self::Chat,
models_properties::EntityType::Company => Self::Company,
@@ -116,9 +122,11 @@ impl From<models_properties::EntityType> for GraphqlPropertyEntityType {
}
}
-impl From<GraphqlPropertyEntityType> for PropertyEntityType {
- fn from(value: GraphqlPropertyEntityType) -> Self {
- match value {
+impl TryFrom<GraphqlPropertyEntityType> for PropertyEntityType {
+ type Error = GraphqlPropertyEntityType;
+
+ fn try_from(value: GraphqlPropertyEntityType) -> Result<Self, Self::Error> {
+ Ok(match value {
GraphqlPropertyEntityType::Channel => Self::Channel,
GraphqlPropertyEntityType::Chat => Self::Chat,
GraphqlPropertyEntityType::Company => Self::Company,
@@ -127,6 +135,9 @@ impl From<GraphqlPropertyEntityType> for PropertyEntityType {
GraphqlPropertyEntityType::Task => Self::Task,
GraphqlPropertyEntityType::Thread => Self::Thread,
GraphqlPropertyEntityType::User => Self::User,
- }
+ // Call records are not part of the generic property-filter AST.
+ // They are filtered through a dedicated call query instead.
+ other @ GraphqlPropertyEntityType::CallRecord => return Err(other),
+ })
}
}
diff --git a/crates/item_filters/src/ast/call.rs b/crates/item_filters/src/ast/call.rs
index e999aac587..94a8ae610e 100644
--- a/crates/item_filters/src/ast/call.rs
+++ b/crates/item_filters/src/ast/call.rs
@@ -3,7 +3,7 @@ use macro_user_id::{cowlike::CowLike, user_id::MacroUserIdStr};
use serde::{Deserialize, Serialize};
use uuid::Uuid;
-use crate::{CallFilters, CallStatus, ast::ExpandErr};
+use crate::{CallFilters, CallStatus, ast::ExpandErr, ast::properties::PropertiesLiteral};
/// the possible literal values in a call filter ast
#[derive(Debug, Serialize, Deserialize, Clone)]
@@ -18,6 +18,10 @@ pub enum CallLiteral {
Status(CallStatus),
/// whether the requesting user attended the call
Attended(bool),
+ /// entity-property (e.g. tag) condition on the call. Produced internally
+ /// by soup when a def-less tag filter is folded into the call leg; never
+ /// sent by clients.
+ Property(PropertiesLiteral),
}
impl ExpandFrame<CallLiteral> for CallFilters {
diff --git a/crates/macro_db_client/migrations/20260709192942_add_call_record_property_entity_type.sql b/crates/macro_db_client/migrations/20260709192942_add_call_record_property_entity_type.sql
new file mode 100644
index 0000000000..f0f82e8ccb
--- /dev/null
+++ b/crates/macro_db_client/migrations/20260709192942_add_call_record_property_entity_type.sql
@@ -0,0 +1,2 @@
+-- Allow entity properties (e.g. tags) to be attached to call records.
+ALTER TYPE property_entity_type ADD VALUE IF NOT EXISTS 'CALL_RECORD';
diff --git a/crates/macro_db_client/src/call_record/get.rs b/crates/macro_db_client/src/call_record/get.rs
index 84c9bebac5..058192cdd3 100644
--- a/crates/macro_db_client/src/call_record/get.rs
+++ b/crates/macro_db_client/src/call_record/get.rs
@@ -38,6 +38,9 @@ pub struct CallRecordSearchPayload {
pub channel_id: Uuid,
pub created_by: String,
pub channel_name: Option<String>,
+ /// Caller-assigned name for the call, if renamed. Indexed as the call's
+ /// searchable name, falling back to `channel_name`.
+ pub custom_name: Option<String>,
pub participant_ids: Vec<String>,
pub segments: Vec<CallRecordTranscriptSegment>,
}
@@ -166,6 +169,7 @@ pub async fn get_call_record_search_payload(
cr.id AS "call_id!",
cr.channel_id AS "channel_id!",
cr.created_by AS "created_by!",
+ cr.custom_name AS "custom_name?",
cc.name AS "channel_name?"
FROM call_records cr
LEFT JOIN comms_channels cc ON cc.id = cr.channel_id
@@ -215,6 +219,7 @@ pub async fn get_call_record_search_payload(
channel_id: header.channel_id,
created_by: header.created_by,
channel_name: header.channel_name,
+ custom_name: header.custom_name,
participant_ids,
segments,
}))
diff --git a/crates/models_properties/src/shared/entity_type.rs b/crates/models_properties/src/shared/entity_type.rs
index 252be4abc3..359ea783fd 100644
--- a/crates/models_properties/src/shared/entity_type.rs
+++ b/crates/models_properties/src/shared/entity_type.rs
@@ -13,6 +13,7 @@ use utoipa::ToSchema;
rename_all = "SCREAMING_SNAKE_CASE"
)]
pub enum EntityType {
+ CallRecord,
Channel,
Chat,
Company,
@@ -26,6 +27,7 @@ pub enum EntityType {
impl fmt::Display for EntityType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
+ EntityType::CallRecord => write!(f, "call_record"),
EntityType::Channel => write!(f, "channel"),
EntityType::Chat => write!(f, "chat"),
EntityType::Company => write!(f, "company"),
@@ -46,6 +48,7 @@ impl FromStr for EntityType {
type Err = NoConversion;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s.to_lowercase().as_str() {
+ "call_record" => Ok(Self::CallRecord),
"channel" => Ok(Self::Channel),
"chat" => Ok(Self::Chat),
"company" => Ok(Self::Company),
diff --git a/crates/models_search/src/call_record.rs b/crates/models_search/src/call_record.rs
index 56803c686b..18e2b39812 100644
--- a/crates/models_search/src/call_record.rs
+++ b/crates/models_search/src/call_record.rs
@@ -1,5 +1,6 @@
use chrono::{DateTime, Utc};
use item_filters::{CallFilters, CallStatus};
+use models_soup::SoupProperty;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use utoipa::ToSchema;
@@ -45,6 +46,10 @@ pub struct CallRecordMetadata {
pub struct CallRecordSearchResponseItemWithMetadata {
/// `None` if the call has been deleted.
pub metadata: Option<CallRecordMetadata>,
+ /// Entity properties (e.g. tags) on the call.
+ #[serde(skip_serializing_if = "Option::is_none")]
+ #[schemars(skip)]
+ pub properties: Option<Vec<SoupProperty>>,
#[serde(flatten)]
pub extra: CallRecordSearchResponseItem,
}
diff --git a/crates/models_soup/src/call_record.rs b/crates/models_soup/src/call_record.rs
index d95e3dd7e7..4a4e6f0680 100644
--- a/crates/models_soup/src/call_record.rs
+++ b/crates/models_soup/src/call_record.rs
@@ -4,6 +4,8 @@ use item_filters::CallStatus;
use serde::{Deserialize, Serialize};
use uuid::Uuid;
+use crate::SoupProperty;
+
/// A participant in a call record, as displayed in Soup.
#[derive(Debug, Serialize, Deserialize)]
#[cfg_attr(feature = "schema", derive(utoipa::ToSchema))]
@@ -52,6 +54,8 @@ pub struct SoupCallRecord {
pub attended: bool,
/// Participants in the call.
pub participants: Vec<SoupCallRecordParticipant>,
+ /// Entity properties (e.g. tags). Populated after fetch by the soup repo.
+ pub properties: Vec<SoupProperty>,
}
fn participant_derived_status(participants: &[CallRecordParticipant], user_id: &str) -> CallStatus {
@@ -93,6 +97,7 @@ impl SoupCallRecord {
left_at: p.left_at,
})
.collect(),
+ properties: Vec::new(),
}
}
}
diff --git a/crates/models_soup/src/item.rs b/crates/models_soup/src/item.rs
index e2c324ed52..80dc5e7e0e 100644
--- a/crates/models_soup/src/item.rs
+++ b/crates/models_soup/src/item.rs
@@ -199,7 +199,7 @@ impl SoupItem {
/// Converts this item to an [`EntityReference`] for property lookups.
///
/// Returns `None` for item types that don't support properties
- /// (e.g., channels, calls, foreign entities).
+ /// (e.g., channels, channel threads, foreign entities).
pub fn to_entity_reference(&self) -> Option<EntityReference> {
match self {
SoupItem::Document(doc) => {
@@ -219,7 +219,10 @@ impl SoupItem {
)),
SoupItem::Channel(_) => None,
SoupItem::ChannelThread(_) => None,
- SoupItem::Call(_) => None,
+ SoupItem::Call(c) => Some(EntityReference::new(
+ c.call_id.to_string(),
+ PropertiesEntityType::CallRecord,
+ )),
SoupItem::CrmCompany(c) => Some(EntityReference::new(
c.id.to_string(),
PropertiesEntityType::Company,
diff --git a/crates/opensearch_client/src/call_record.rs b/crates/opensearch_client/src/call_record.rs
index 0e41c9e9bc..874f607a33 100644
--- a/crates/opensearch_client/src/call_record.rs
+++ b/crates/opensearch_client/src/call_record.rs
@@ -3,6 +3,7 @@ use crate::{
upsert::{
self, BulkUpsertResult,
call_record::{UpsertCallRecordSegmentArgs, bulk_upsert_call_record_segments},
+ properties::IndexedProperty,
},
};
@@ -25,6 +26,16 @@ impl OpensearchClient {
bulk_upsert_call_record_segments(&self.inner, segments, index_override).await
}
+ /// Refresh only the denormalized `properties` on an existing parent call doc.
+ #[tracing::instrument(skip(self, properties))]
+ pub async fn update_call_record_properties(
+ &self,
+ call_id: &str,
+ properties: &[IndexedProperty],
+ ) -> Result<()> {
+ upsert::call_record::update_call_record_properties(&self.inner, call_id, properties).await
+ }
+
#[tracing::instrument(skip(self))]
pub async fn delete_call_record(
&self,
diff --git a/crates/opensearch_client/src/search/call_records.rs b/crates/opensearch_client/src/search/call_records.rs
index 4c5a461e8d..264925fa5e 100644
--- a/crates/opensearch_client/src/search/call_records.rs
+++ b/crates/opensearch_client/src/search/call_records.rs
@@ -7,6 +7,7 @@ use crate::{
model::{
Highlight, SearchGotoCallRecord, SearchGotoContent, SearchHit, parse_highlight_hit,
},
+ properties::build_tag_filter,
query::Keys,
},
};
@@ -42,6 +43,8 @@ pub(crate) struct CallRecordIndex {
pub participant_ids: Vec<String>,
#[serde(default)]
pub channel_name: Option<String>,
+ #[serde(default)]
+ pub name: Option<String>,
pub started_at_seconds: i64,
#[serde(default)]
pub ended_at_seconds: Option<i64>,
@@ -50,14 +53,31 @@ pub(crate) struct CallRecordIndex {
pub(crate) struct CallRecordSearchConfig;
impl SearchQueryConfig for CallRecordSearchConfig {
- const TITLE_KEY: &'static str = "channel_name";
+ const TITLE_KEY: &'static str = "name";
const ENTITY_INDEX: OpenSearchEntityType = OpenSearchEntityType::CallRecords;
}
+/// Which fields a call search matches on. `Content` (the default) preserves
+/// the segment-only `has_child` behavior. `Name` matches the parent `name`.
+/// `NameContent` matches either. Mirrors `DocumentSearchMode`.
+#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
+pub enum CallRecordSearchMode {
+ /// Match terms against the parent `name` only.
+ Name,
+ /// Match terms against segment `content` only.
+ #[default]
+ Content,
+ /// Match terms against either the parent `name` or segment `content`.
+ NameContent,
+}
+
pub(crate) struct CallRecordQueryBuilder {
inner: SearchQueryBuilder<CallRecordSearchConfig>,
channel_ids: Vec<String>,
speaker_ids: Vec<String>,
+ tag_option_ids: Vec<String>,
+ match_all_tags: bool,
+ mode: CallRecordSearchMode,
}
impl CallRecordQueryBuilder {
@@ -66,6 +86,9 @@ impl CallRecordQueryBuilder {
inner: SearchQueryBuilder::new(terms),
channel_ids: Vec::new(),
speaker_ids: Vec::new(),
+ tag_option_ids: Vec::new(),
+ match_all_tags: false,
+ mode: CallRecordSearchMode::default(),
}
}
@@ -89,11 +112,26 @@ impl CallRecordQueryBuilder {
self
}
- /// Parent/child join query: one `has_child` clause per term, ANDed
- /// inside `bool.must` so every search term must match some segment
- /// in the same call. channel_id lives on the parent so it sits on
- /// `bool.filter` directly; speaker_id is child-side so it's a
- /// has_child filter clause.
+ pub fn tag_option_ids(mut self, tag_option_ids: Vec<String>) -> Self {
+ self.tag_option_ids = tag_option_ids;
+ self
+ }
+
+ pub fn match_all_tags(mut self, match_all_tags: bool) -> Self {
+ self.match_all_tags = match_all_tags;
+ self
+ }
+
+ pub fn mode(mut self, mode: CallRecordSearchMode) -> Self {
+ self.mode = mode;
+ self
+ }
+
+ /// Parent/child join query. channel_id lives on the parent so it sits on
+ /// `bool.filter` directly; speaker_id is child-side so it's a has_child
+ /// filter clause. The match clause depends on [`CallRecordSearchMode`]:
+ /// the parent `name` (Name), segment `content` via has_child (Content),
+ /// or either (NameContent) — mirroring documents.
pub fn build_bool_query<'a>(&'a self) -> Result<BoolQueryBuilder<'a>> {
if self.inner.ids_only && self.inner.ids.is_empty() {
return Err(crate::error::OpensearchClientError::EmptyIdsWithIdsOnly(
@@ -131,39 +169,82 @@ impl CallRecordQueryBuilder {
bool_query.filter(QueryType::terms("channel_id", self.channel_ids.clone()));
}
- // One has_child clause per term, ANDed via bool.must. Each
- // carries its own inner_hits; the shared highlight_query tags
- // every search term on a returned segment regardless of which
- // clause produced it.
- //
- // speaker_id is a child-side field — it lives inside each
- // has_child clause alongside the term query so the same segment
- // that matches the term must also be from one of the requested
- // speakers. Filtering speaker_id at the bool level instead
- // would only require *some* segment in the call to have the
- // speaker, not necessarily the segment matching the term.
- let highlight_query =
- build_all_terms_highlight_query(&self.inner.terms, &self.inner.match_type);
- for (idx, term) in self.inner.terms.iter().enumerate() {
- let term_query = build_child_content_query(term, &self.inner.match_type);
- let inner_query = if self.speaker_ids.is_empty() {
- term_query
- } else {
- let mut combined = BoolQueryBuilder::new();
- combined.must(term_query);
- combined.must(QueryType::terms("speaker_id", self.speaker_ids.clone()));
- combined.build().into()
- };
- let inner_hits = InnerHits::new()
- .name(format!("term_{idx}"))
- .size(INNER_HITS_PER_TERM)
- .highlight(inner_hits_content_highlight(&highlight_query));
- let has_child = HasChildQuery::new(CHILD_RELATION, inner_query).inner_hits(inner_hits);
- bool_query.must(has_child.into());
+ // Tag filter: a single nested clause matching any of the option ids in
+ // the parent's `properties.values`, with no definition_id constraint.
+ if let Some(nested) = build_tag_filter(&self.tag_option_ids, self.match_all_tags) {
+ bool_query.filter(nested);
+ }
+
+ // Match clause(s) per mode.
+ let include_name = matches!(
+ self.mode,
+ CallRecordSearchMode::Name | CallRecordSearchMode::NameContent
+ );
+ let include_content = matches!(
+ self.mode,
+ CallRecordSearchMode::Content | CallRecordSearchMode::NameContent
+ );
+
+ if include_name && include_content {
+ // A call matches when its name matches every term, or every term
+ // matches some segment's content.
+ let mut content_bool = BoolQueryBuilder::new();
+ for clause in self.build_content_has_child_clauses() {
+ content_bool.must(clause);
+ }
+ let mut matched = BoolQueryBuilder::new();
+ matched.minimum_should_match(1);
+ matched.should(content_bool.build().into());
+ matched.should(self.inner.build_title_term_query()?);
+ bool_query.must(matched.build().into());
+ } else if include_name {
+ bool_query.must(self.inner.build_title_term_query()?);
+ } else {
+ for clause in self.build_content_has_child_clauses() {
+ bool_query.must(clause);
+ }
}
Ok(bool_query)
}
+
+ /// One `has_child` clause per term, each carrying its own `inner_hits` so
+ /// segment-level highlights come back alongside the parent. The shared
+ /// highlight_query tags every search term on a returned segment regardless
+ /// of which clause produced it.
+ ///
+ /// speaker_id is a child-side field — it lives inside each has_child clause
+ /// alongside the term query so the same segment that matches the term must
+ /// also be from one of the requested speakers. Filtering speaker_id at the
+ /// bool level instead would only require *some* segment in the call to have
+ /// the speaker, not necessarily the segment matching the term.
+ fn build_content_has_child_clauses<'a>(&'a self) -> Vec<QueryType<'a>> {
+ let highlight_query =
+ build_all_terms_highlight_query(&self.inner.terms, &self.inner.match_type);
+ self.inner
+ .terms
+ .iter()
+ .enumerate()
+ .map(|(idx, term)| {
+ let term_query = build_child_content_query(term, &self.inner.match_type);
+ let inner_query = if self.speaker_ids.is_empty() {
+ term_query
+ } else {
+ let mut combined = BoolQueryBuilder::new();
+ combined.must(term_query);
+ combined.must(QueryType::terms("speaker_id", self.speaker_ids.clone()));
+ combined.build().into()
+ };
+ let inner_hits = InnerHits::new()
+ .name(format!("term_{idx}"))
+ .size(INNER_HITS_PER_TERM)
+ .highlight(inner_hits_content_highlight(&highlight_query));
+ HasChildQuery::new(CHILD_RELATION, inner_query)
+ .inner_hits(inner_hits)
+ .into()
+ })
+ .collect()
+ }
}
/// Highlight config attached to each `has_child` inner_hits block.
@@ -228,6 +309,9 @@ pub struct CallRecordSearchArgs {
pub match_type: String,
pub collapse: bool,
pub ids_only: bool,
+ pub tag_option_ids: Vec<String>,
+ pub match_all_tags: bool,
+ pub mode: CallRecordSearchMode,
}
impl From<CallRecordSearchArgs> for CallRecordQueryBuilder {
@@ -242,6 +326,9 @@ impl From<CallRecordSearchArgs> for CallRecordQueryBuilder {
.speaker_ids(args.speaker_ids)
.collapse(args.collapse)
.ids_only(args.ids_only)
+ .tag_option_ids(args.tag_option_ids)
+ .match_all_tags(args.match_all_tags)
+ .mode(args.mode)
}
}
diff --git a/crates/opensearch_client/src/search/unified.rs b/crates/opensearch_client/src/search/unified.rs
index 78952e744d..c2330ed269 100644
--- a/crates/opensearch_client/src/search/unified.rs
+++ b/crates/opensearch_client/src/search/unified.rs
@@ -7,6 +7,7 @@ use crate::{
builder::{SearchQueryConfig, updated_at_sort},
call_records::{
CallRecordIndex, CallRecordQueryBuilder, CallRecordSearchArgs, CallRecordSearchConfig,
+ CallRecordSearchMode,
},
channels::{
ChannelMessageIndex, ChannelMessageQueryBuilder, ChannelMessageSearchArgs,
@@ -165,6 +166,9 @@ impl From<UnifiedSearchArgs> for CallRecordSearchArgs {
call_ids: args.call_record_search_args.call_ids,
channel_ids: args.call_record_search_args.channel_ids,
speaker_ids: args.call_record_search_args.speaker_ids,
+ tag_option_ids: args.call_record_search_args.tag_option_ids,
+ match_all_tags: args.call_record_search_args.match_all_tags,
+ mode: args.call_record_search_args.mode,
}
}
}
@@ -242,6 +246,9 @@ pub struct UnifiedCallRecordSearchArgs {
pub channel_ids: Vec<String>,
pub speaker_ids: Vec<String>,
pub ids_only: bool,
+ pub tag_option_ids: Vec<String>,
+ pub match_all_tags: bool,
+ pub mode: CallRecordSearchMode,
}
#[derive(Debug, Default, Clone)]
@@ -417,15 +424,54 @@ fn expand_hit_into_search_hits(hit: Hit<UnifiedSearchIndex>) -> Vec<SearchHit> {
expanded
}
UnifiedSearchIndex::CallRecord(parent) => {
- let Some(inner) = hit.inner_hits.as_ref() else {
- return vec![hit.into()];
- };
- let expanded =
- crate::search::call_records::expand_inner_hits_to_search_hits(parent, inner);
- if expanded.is_empty() {
+ let updated_at = DateTime::from_timestamp(parent.started_at_seconds, 0);
+ let mut out: Vec<SearchHit> = Vec::new();
+
+ // A name match surfaces as a parent-level hit. Segment content lives
+ // in inner_hits and never highlights `name`, so a top-level highlight
+ // on that field means the call name matched. `goto` points at the
+ // call itself (no segment) so downstream grouping treats it as a name
+ // match rather than an empty content result.
+ if let Some(highlight) = hit.highlight.as_ref()
+ && highlight.contains_key(CallRecordSearchConfig::TITLE_KEY)
+ {
+ out.push(SearchHit {
+ entity_id: parent.entity_id,
+ entity_type: SearchEntityType::CallRecords,
+ score: hit.score,
+ highlight: parse_highlight_hit(
+ highlight.clone(),
+ Keys {
+ title_key: CallRecordSearchConfig::TITLE_KEY,
+ content_key: CallRecordSearchConfig::CONTENT_KEY,
+ },
+ ),
+ goto: Some(SearchGotoContent::CallRecords(SearchGotoCallRecord {
+ channel_id: parent.channel_id,
+ transcript_id: uuid::Uuid::nil(),
+ speaker_id: String::new(),
+ sequence_num: 0,
+ started_at: updated_at.unwrap_or_default(),
+ ended_at: parent
+ .ended_at_seconds
+ .and_then(|s| DateTime::from_timestamp(s, 0)),
+ participant_ids: parent.participant_ids.clone(),
+ })),
+ updated_at,
+ });
+ }
+
+ // Content matches surface as one hit per matching segment.
+ if let Some(inner) = hit.inner_hits.as_ref() {
+ out.extend(
+ crate::search::call_records::expand_inner_hits_to_search_hits(parent, inner),
+ );
+ }
+
+ if out.is_empty() {
return vec![hit.into()];
}
- expanded
+ out
}
_ => vec![hit.into()],
}
diff --git a/crates/opensearch_client/src/upsert/call_record.rs b/crates/opensearch_client/src/upsert/call_record.rs
index ffe93c9898..17b040fc0f 100644
--- a/crates/opensearch_client/src/upsert/call_record.rs
+++ b/crates/opensearch_client/src/upsert/call_record.rs
@@ -3,7 +3,11 @@ use std::collections::HashSet;
use models_opensearch::SearchIndex;
use super::BulkUpsertResult;
-use crate::{Result, date_format::EpochSeconds};
+use crate::upsert::properties::IndexedProperty;
+use crate::{Result, date_format::EpochSeconds, error::OpensearchClientError};
+
+#[cfg(test)]
+mod test;
/// Relation name for parent docs in the call_records join field.
const PARENT_RELATION: &str = "call";
@@ -20,12 +24,20 @@ pub struct UpsertCallRecordSegmentArgs {
pub participant_ids: Vec<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub channel_name: Option<String>,
+ /// Display name of the call (custom name, falling back to the channel
+ /// name). Indexed on the parent so calls are name-searchable.
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub name: Option<String>,
pub speaker_id: String,
pub sequence_num: i32,
pub content: String,
pub started_at_seconds: EpochSeconds,
#[serde(skip_serializing_if = "Option::is_none")]
pub ended_at_seconds: Option<EpochSeconds>,
+ /// Denormalized parent entity properties (tags, custom) used for search
+ /// filtering. Shared across every segment of a call; empty for untagged
+ /// calls. Only written onto the parent doc.
+ pub properties: Vec<IndexedProperty>,
}
fn resolve_destination(index_override: Option<&str>) -> &str {
@@ -58,7 +70,9 @@ pub(crate) async fn bulk_upsert_call_record_segments(
bulk_upsert_call_record_segments_inner(client, segments, index).await
}
-/// Builds the JSON document body for the parent call doc.
+/// Builds the JSON document body for the parent call doc. Properties ride
+/// every parent write because the write is a full overwrite — omitting them
+/// would wipe values set by `update_call_record_properties`.
fn parent_doc_body(any_segment: &UpsertCallRecordSegmentArgs) -> serde_json::Value {
let mut doc = serde_json::json!({
"entity_id": &any_segment.call_id,
@@ -67,12 +81,20 @@ fn parent_doc_body(any_segment: &UpsertCallRecordSegmentArgs) -> serde_json::Val
"started_at_seconds": any_segment.started_at_seconds,
"call_relation": PARENT_RELATION,
});
- if let Some(name) = &any_segment.channel_name {
- doc["channel_name"] = serde_json::Value::String(name.clone());
+ if let Some(channel_name) = &any_segment.channel_name {
+ doc["channel_name"] = serde_json::Value::String(channel_name.clone());
+ }
+ if let Some(name) = &any_segment.name {
+ doc["name"] = serde_json::Value::String(name.clone());
}
if let Some(ended) = &any_segment.ended_at_seconds {
doc["ended_at_seconds"] = serde_json::to_value(ended).unwrap_or(serde_json::Value::Null);
}
+ if !any_segment.properties.is_empty()
+ && let Ok(properties) = serde_json::to_value(&any_segment.properties)
+ {
+ doc["properties"] = properties;
+ }
doc
}
@@ -131,3 +153,78 @@ async fn bulk_upsert_call_record_segments_inner(
)
.await
}
+
+/// Update only the denormalized `properties` on an existing parent call doc,
+/// without touching segments. Used when a call's properties change
+/// independently of its content. A missing doc (404) is treated as a no-op —
+/// the next segment upsert will include the properties.
+pub(crate) async fn update_call_record_properties(
+ client: &opensearch::OpenSearch,
+ call_id: &str,
+ properties: &[IndexedProperty],
+) -> Result<()> {
+ use serde_json::json;
+
+ let properties_value =
+ serde_json::to_value(properties).map_err(|err| OpensearchClientError::Unknown {
+ details: err.to_string(),
+ method: Some("update_call_record_properties".to_string()),
+ })?;
+ let body = json!({ "doc": { "properties": properties_value } });
+
+ let response = client
+ .update(opensearch::UpdateParts::IndexId(
+ SearchIndex::CallRecords.as_ref(),
+ call_id,
+ ))
+ .routing(call_id)
+ .body(body)
+ .send()
+ .await
+ .map_err(|err| OpensearchClientError::DeserializationFailed {
+ details: err.to_string(),
+ method: Some("update_call_record_properties".to_string()),
+ })?;
+
+ let status_code = response.status_code();
+ if status_code.is_success() {
+ tracing::trace!(call_id=%call_id, "call record properties updated");
+ return Ok(());
+ }
+ let body =
+ response
+ .text()
+ .await
+ .map_err(|err| OpensearchClientError::DeserializationFailed {
+ details: err.to_string(),
+ method: Some("update_call_record_properties".to_string()),
+ })?;
+
+ // A *missing document* 404 is a no-op: the call isn't indexed yet, so the
+ // next segment upsert will include its properties. A *missing index* 404
+ // (`index_not_found_exception`) is a real outage and must propagate.
+ if status_code.as_u16() == 404 {
+ let error_type = serde_json::from_str::<serde_json::Value>(&body)
+ .ok()
+ .and_then(|value| value["error"]["type"].as_str().map(str::to_owned));
+ if error_type.as_deref() == Some("document_missing_exception") {
+ tracing::debug!(
+ call_id=%call_id,
+ "call record not indexed yet; skipping property update"
+ );
+ return Ok(());
+ }
+ }
+
+ tracing::error!(
+ status_code=?status_code,
+ body=?body,
+ call_id=%call_id,
+ "error updating call record properties",
+ );
+
+ Err(OpensearchClientError::Unknown {
+ details: body,
+ method: Some("update_call_record_properties".to_string()),
+ })
+}
diff --git a/crates/opensearch_client/src/upsert/call_record/test.rs b/crates/opensearch_client/src/upsert/call_record/test.rs
new file mode 100644
index 0000000000..692fa084d2
--- /dev/null
+++ b/crates/opensearch_client/src/upsert/call_record/test.rs
@@ -0,0 +1,69 @@
+use super::*;
+
+fn segment() -> UpsertCallRecordSegmentArgs {
+ UpsertCallRecordSegmentArgs {
+ call_id: "call1".to_string(),
+ transcript_id: "seg1".to_string(),
+ channel_id: "channel1".to_string(),
+ participant_ids: vec!["macro|[email protected]".to_string()],
+ channel_name: Some("Standup".to_string()),
+ name: Some("Weekly standup".to_string()),
+ speaker_id: "macro|[email protected]".to_string(),
+ sequence_num: 0,
+ content: "segment content".to_string(),
+ started_at_seconds: EpochSeconds::new(1_700_000_000).unwrap(),
+ ended_at_seconds: Some(EpochSeconds::new(1_700_000_100).unwrap()),
+ properties: vec![],
+ }
+}
+
+#[test]
+fn parent_doc_body_has_metadata_and_name_no_child_fields() {
+ let doc = parent_doc_body(&segment());
+
+ assert_eq!(doc["entity_id"], "call1");
+ assert_eq!(doc["channel_id"], "channel1");
+ assert_eq!(doc["channel_name"], "Standup");
+ assert_eq!(doc["name"], "Weekly standup");
+ assert_eq!(doc["call_relation"], "call");
+ // Child-only fields must not be present on the parent.
+ assert!(doc.get("content").is_none());
+ assert!(doc.get("transcript_id").is_none());
+ assert!(doc.get("speaker_id").is_none());
+ // No properties key when the call has none.
+ assert!(doc.get("properties").is_none());
+}
+
+#[test]
+fn parent_doc_body_includes_properties_when_present() {
+ let mut seg = segment();
+ seg.properties = vec![IndexedProperty {
+ definition_id: "tag-def".to_string(),
+ values: vec!["option-1".to_string(), "option-2".to_string()],
+ ..Default::default()
+ }];
+
+ let doc = parent_doc_body(&seg);
+ let props = doc["properties"].as_array().expect("properties array");
+ assert_eq!(props.len(), 1);
+ assert_eq!(props[0]["definition_id"], "tag-def");
+ assert_eq!(
+ props[0]["values"],
+ serde_json::json!(["option-1", "option-2"])
+ );
+}
+
+#[test]
+fn child_doc_body_has_no_properties_or_name() {
+ let mut seg = segment();
+ seg.properties = vec![IndexedProperty {
+ definition_id: "tag-def".to_string(),
+ values: vec!["option-1".to_string()],
+ ..Default::default()
+ }];
+
+ let doc = child_doc_body(&seg);
+ assert!(doc.get("properties").is_none());
+ assert!(doc.get("name").is_none());
+ assert_eq!(doc["call_relation"]["parent"], "call1");
+}
diff --git a/crates/properties/src/domain/model.rs b/crates/properties/src/domain/model.rs
index dfd85bec7c..2b20641f38 100644
--- a/crates/properties/src/domain/model.rs
+++ b/crates/properties/src/domain/model.rs
@@ -17,6 +17,8 @@ use uuid::Uuid;
pub fn access_entity_type(entity_type: EntityType) -> AccessEntityType {
match entity_type {
EntityType::Document => AccessEntityType::Document,
+ // Call access is resolved through the call's owning channel.
+ EntityType::CallRecord => AccessEntityType::Call,
EntityType::Chat => AccessEntityType::Chat,
EntityType::Project => AccessEntityType::Project,
EntityType::Thread => AccessEntityType::EmailThread,
diff --git a/crates/properties/src/domain/service_impl/mod.rs b/crates/properties/src/domain/service_impl/mod.rs
index 92979a6d72..71048d422a 100644
--- a/crates/properties/src/domain/service_impl/mod.rs
+++ b/crates/properties/src/domain/service_impl/mod.rs
@@ -47,6 +47,7 @@ fn is_search_indexed(entity_type: EntityType) -> bool {
| EntityType::Thread
| EntityType::Chat
| EntityType::Project
+ | EntityType::CallRecord
)
}
diff --git a/crates/properties/src/inbound/toolset/get_entity_properties.rs b/crates/properties/src/inbound/toolset/get_entity_properties.rs
index 74988cbeee..7396a37141 100644
--- a/crates/properties/src/inbound/toolset/get_entity_properties.rs
+++ b/crates/properties/src/inbound/toolset/get_entity_properties.rs
@@ -28,6 +28,7 @@ pub enum ToolEntityType {
Chat,
Thread,
Channel,
+ Call,
User,
Company,
}
@@ -41,6 +42,7 @@ impl From<ToolEntityType> for EntityType {
ToolEntityType::Chat => EntityType::Chat,
ToolEntityType::Thread => EntityType::Thread,
ToolEntityType::Channel => EntityType::Channel,
+ ToolEntityType::Call => EntityType::CallRecord,
ToolEntityType::User => EntityType::User,
ToolEntityType::Company => EntityType::Company,
}
diff --git a/crates/properties/src/outbound/permission_queries.rs b/crates/properties/src/outbound/permission_queries.rs
index 3566f65436..93757092d1 100644
--- a/crates/properties/src/outbound/permission_queries.rs
+++ b/crates/properties/src/outbound/permission_queries.rs
@@ -16,8 +16,15 @@ pub async fn get_owner_and_deleted(
entity_type: EntityType,
) -> anyhow::Result<(String, bool)> {
let result = match entity_type {
- // The following entity types are either deleted immediately or simply unsupported
- EntityType::Channel | EntityType::Company | EntityType::User | EntityType::Thread => {
+ // The following entity types are either deleted immediately or simply
+ // unsupported by this owner lookup. Calls resolve access through their
+ // owning channel (see `access_entity_type`), so the caller skips this
+ // path for them entirely.
+ EntityType::CallRecord
+ | EntityType::Channel
+ | EntityType::Company
+ | EntityType::User
+ | EntityType::Thread => {
anyhow::bail!("unsupported entity type")
}
EntityType::Document | EntityType::Task => {
diff --git a/crates/properties/src/outbound/permission_service.rs b/crates/properties/src/outbound/permission_service.rs
index 83175f9993..2b0cda415f 100644
--- a/crates/properties/src/outbound/permission_service.rs
+++ b/crates/properties/src/outbound/permission_service.rs
@@ -106,7 +106,11 @@ impl<Svc: EntityAccessService> PermissionService for PermissionServiceImpl<Svc>
// Check if entity is deleted: the owner always has access, and deleted
// entities are only visible to their owner.
match entity_type {
- EntityType::Channel | EntityType::Company | EntityType::User | EntityType::Thread => {}
+ EntityType::CallRecord
+ | EntityType::Channel
+ | EntityType::Company
+ | EntityType::User
+ | EntityType::Thread => {}
_ => {
let (owner, deleted) =
permission_queries::get_owner_and_deleted(&self.db, entity_id, entity_type)
diff --git a/crates/search_service/src/api/search/call_record.rs b/crates/search_service/src/api/search/call_record.rs
index 3857a745a4..7e4b910359 100644
--- a/crates/search_service/src/api/search/call_record.rs
+++ b/crates/search_service/src/api/search/call_record.rs
@@ -2,12 +2,15 @@ use channels::outbound::channel_name::batch_resolve_channel_names;
use indexmap::IndexMap;
use item_filters::CallStatus;
use macro_user_id::user_id::MacroUserIdStr;
+use models_properties::{EntityReference, EntityType};
use models_search::call_record::{
CallRecordMetadata, CallRecordSearchResponseItem, CallRecordSearchResponseItemWithMetadata,
CallRecordSearchResult,
};
+use models_soup::SoupProperty;
use opensearch_client::search::model::{SearchGotoContent, SearchHit};
use sqlx::types::Uuid;
+use std::collections::HashMap;
use crate::api::context::SearchHandlerState;
use crate::api::search::simple::SearchError;
@@ -49,7 +52,7 @@ pub(in crate::api::search) async fn enrich_call_records(
.collect()
};
let channel_names_by_id =
- batch_resolve_channel_names(&ctx.db, &unique_channel_ids, viewer_user_id)
+ batch_resolve_channel_names(&ctx.db, &unique_channel_ids, viewer_user_id.clone())
.await
.map_err(|e| SearchError::InternalError(e.into()))?;
@@ -107,6 +110,35 @@ pub(in crate::api::search) async fn enrich_call_records(
});
}
+ // Fetch each call's tags so rows can render and re-check them. Scope to the
+ // viewer (like the soup path) so another user's personal tags never leak
+ // into the response.
+ let call_entity_refs: Vec<EntityReference> = call_ids
+ .iter()
+ .map(|id| EntityReference::new(id.to_string(), EntityType::CallRecord))
+ .collect();
+ let properties_map: HashMap<String, Vec<SoupProperty>> =
+ properties::outbound::entity_properties_get_query::get_bulk_entity_properties_values_filtered(
+ &ctx.db,
+ &call_entity_refs,
+ &[],
+ Some(&viewer_user_id),
+ )
+ .await
+ .inspect_err(|e| tracing::error!(error=?e, "failed to fetch call record properties"))
+ .unwrap_or_default()
+ .into_iter()
+ .map(|(id, props)| {
+ (
+ id,
+ props
+ .into_iter()
+ .map(SoupProperty::from)
+ .collect::<Vec<_>>(),
+ )
+ })
+ .collect();
+
let result = hits_by_call_id
.into_iter()
.map(|(call_id, mut hits)| {
@@ -117,6 +149,10 @@ pub(in crate::api::search) async fn enrich_call_records(
.cloned()
.expect("CallRecords hit missing SearchGotoCallRecord");
let metadata = metadata_by_id.get(&call_id).cloned();
+ let properties = properties_map
+ .get(&call_id.to_string())
+ .cloned()
+ .filter(|p| !p.is_empty());
CallRecordSearchResponseItemWithMetadata {
extra: CallRecordSearchResponseItem {
@@ -132,6 +168,7 @@ pub(in crate::api::search) async fn enrich_call_records(
call_search_results: hits,
},
metadata,
+ properties,
}
})
.collect();
diff --git a/crates/search_service/src/api/search/simple/simple_unified.rs b/crates/search_service/src/api/search/simple/simple_unified.rs
index 6ebc97d801..8aa91759b6 100644
--- a/crates/search_service/src/api/search/simple/simple_unified.rs
+++ b/crates/search_service/src/api/search/simple/simple_unified.rs
@@ -21,6 +21,7 @@ use models_search::{
unified::{SimpleUnifiedSearchResponse, UnifiedSearchRequest},
};
use models_search_cursor::{SearchCursor, SearchCursorOption, SearchMethodCursor};
+use opensearch_client::search::call_records::CallRecordSearchMode;
use opensearch_client::search::documents::{DocumentSearchMode, PropertyFilterArg};
use opensearch_client::search::model::SearchHit;
use opensearch_client::search::unified::UnifiedSearchArgs;
@@ -232,15 +233,14 @@ pub(in crate::api::search) async fn perform_unified_search(
// Property filters live at the top level of the request and only apply to
// the OpenSearch documents index, so capture them before the conversion
// (which drops them) and attach them to the document search args below.
- // Tags additionally apply to the emails index (thread properties
- // denormalized onto every message doc) and the chats index (nested on
- // the parent chat doc).
+ // Tags, by contrast, are indexed on every taggable source, each of which
+ // applies the tag filter itself (see the per-source gating below).
let property_filter_args = to_property_filter_args(&req.filters.property_filters);
let tag_option_ids = req.filters.tag_option_ids.clone();
let match_all_tags = req.filters.tag_filter_mode == item_filters::TagFilterMode::All;
- // Tags are only indexed for the documents, emails, and chats indexes.
- // With a tag filter active every other source is dropped, so response
- // pages contain only rows the filter was actually applied to.
+ // A tag filter keeps only the tag-indexed sources; channels and CRM drop
+ // out below (see should_include_channels), so response pages contain only
+ // rows the filter was actually applied to.
let tags_active = !tag_option_ids.is_empty();
// CRM is opt-in: it only runs when the caller resolved a team receipt
@@ -258,13 +258,14 @@ pub(in crate::api::search) async fn perform_unified_search(
let call_filters = search_filters.call_filters;
let should_include_documents = search_filters.should_include_documents;
+ // A tag filter drops channels (and CRM, below) because they aren't
+ // tag-indexed. Every tag-indexed source — documents, chats, projects,
+ // emails, call records — stays included and applies the filter itself.
let should_include_channels = search_filters.should_include_channels && !tags_active;
- // Chats stay live under a tag filter: both chat legs apply it (nested
- // clause on the chats index, entity_properties EXISTS on the name leg).
let should_include_chats = search_filters.should_include_chats;
let should_include_projects = search_filters.should_include_projects;
let should_include_emails = search_filters.should_include_emails;
- let should_include_call_records = search_filters.should_include_call_records && !tags_active;
+ let should_include_call_records = search_filters.should_include_call_records;
let email_terms = search_terms.clone();
// Await all tasks in parallel
@@ -336,6 +337,8 @@ pub(in crate::api::search) async fn perform_unified_search(
filter_email_response.tag_option_ids = tag_option_ids.clone();
filter_email_response.match_all_tags = match_all_tags;
filter_call_record_response.terms = search_terms.clone();
+ filter_call_record_response.tag_option_ids = tag_option_ids.clone();
+ filter_call_record_response.match_all_tags = match_all_tags;
filter_project_response.terms = search_terms.clone();
filter_project_response.tag_option_ids = tag_option_ids;
filter_project_response.match_all_tags = match_all_tags;
@@ -455,25 +458,28 @@ pub(in crate::api::search) async fn perform_unified_search(
}
},
async {
- // Documents, email subjects, and project names are name-searched
- // in OpenSearch. In Name mode keep only those indices: chats
- // still name-search in Postgres above, and channels/call records
+ // Documents, email subjects, project names, and call names are
+ // name-searched in OpenSearch. In Name mode keep only those
+ // indices: chats still name-search in Postgres above, and channels
// have no name concept. Documents match `document_name`, emails
- // their subject, projects their `name`. Projects have no content,
- // so a content-only search drops them.
+ // their subject, projects their `name`, calls their `name`.
+ // Projects have no content, so a content-only search drops them.
let mut args = unified_search_args;
match search_on {
SearchOn::Name => {
args.document_search_args.mode = DocumentSearchMode::Name;
+ args.call_record_search_args.mode = CallRecordSearchMode::Name;
args.email_search_args.subject_only = true;
args.search_indices.retain(|i| {
*i == models_opensearch::OpenSearchEntityType::Documents
|| *i == models_opensearch::OpenSearchEntityType::Emails
|| *i == models_opensearch::OpenSearchEntityType::Projects
+ || *i == models_opensearch::OpenSearchEntityType::CallRecords
});
}
SearchOn::NameContent => {
args.document_search_args.mode = DocumentSearchMode::NameContent;
+ args.call_record_search_args.mode = CallRecordSearchMode::NameContent;
}
SearchOn::Content => {
args.document_search_args.mode = DocumentSearchMode::Content;
diff --git a/crates/soup/src/domain/models.rs b/crates/soup/src/domain/models.rs
index 285fce91e9..884b468fec 100644
--- a/crates/soup/src/domain/models.rs
+++ b/crates/soup/src/domain/models.rs
@@ -21,6 +21,7 @@ use item_filters::{
EntityFilters,
ast::{
EntityFilterAst, ExpandErr,
+ call::CallLiteral,
crm_company::CrmCompanyLiteral,
email::EmailLiteral,
properties::{
@@ -391,7 +392,16 @@ impl SoupRequest<Option<EntityFilterAst>> {
}
pub(crate) fn build_call_request(&self) -> Option<GetCallRecordsRequest> {
- if self.properties_filter_blocks_propertyless() {
+ // A def-less tag filter (entity_type None on every literal) applies to
+ // calls, which carry tags; it is folded into the call filter below and
+ // rendered as a `properties.values` EXISTS by the call query. Any other
+ // active properties filter can't match a call, so the leg is skipped by
+ // the propertyless check.
+ let properties_filter = self
+ .entity_ast()
+ .and_then(|a| a.properties_filter.as_deref())
+ .filter(|p| properties_filter_can_apply_to(p, &[]));
+ if properties_filter.is_none() && self.properties_filter_blocks_propertyless() {
return None;
}
Some(GetCallRecordsRequest {
@@ -400,7 +410,10 @@ impl SoupRequest<Option<EntityFilterAst>> {
query: match &self.cursor {
SoupQuery::Simple(SimpleQueryInner(Query::Sort(t, f))) => Some(Query::Sort(
*t,
- f.as_ref().and_then(|f| f.call_filter.clone()),
+ with_call_properties_filter(
+ f.as_ref().and_then(|f| f.call_filter.clone()),
+ properties_filter,
+ ),
)),
SoupQuery::Simple(SimpleQueryInner(Query::Cursor(CursorWithValAndFilter {
id,
@@ -411,7 +424,10 @@ impl SoupRequest<Option<EntityFilterAst>> {
id: *id,
limit: *limit,
val: val.clone(),
- filter: filter.as_ref().and_then(|f| f.call_filter.clone()),
+ filter: with_call_properties_filter(
+ filter.as_ref().and_then(|f| f.call_filter.clone()),
+ properties_filter,
+ ),
})),
// query by frecency not yet implemented for call records
SoupQuery::Frecency(_) => None,
@@ -625,6 +641,32 @@ fn map_properties_to_email(expr: &Expr<PropertiesLiteral>) -> Expr<EmailLiteral>
}
}
+/// ANDs a properties filter (mapped to [CallLiteral::Property] conditions) into
+/// the call filter tree, so the call query returns exactly the calls that also
+/// satisfy the tag filter.
+fn with_call_properties_filter(
+ tree: Option<Arc<Expr<CallLiteral>>>,
+ properties_filter: Option<&Expr<PropertiesLiteral>>,
+) -> Option<Arc<Expr<CallLiteral>>> {
+ let Some(propf) = properties_filter else {
+ return tree;
+ };
+ let mapped = map_properties_to_call(propf);
+ Some(Arc::new(match tree {
+ Some(tree) => Expr::and((*tree).clone(), mapped),
+ None => mapped,
+ }))
+}
+
+fn map_properties_to_call(expr: &Expr<PropertiesLiteral>) -> Expr<CallLiteral> {
+ match expr {
+ Expr::And(a, b) => Expr::and(map_properties_to_call(a), map_properties_to_call(b)),
+ Expr::Or(a, b) => Expr::or(map_properties_to_call(a), map_properties_to_call(b)),
+ Expr::Not(a) => Expr::Not(Box::new(map_properties_to_call(a))),
+ Expr::Literal(lit) => Expr::Literal(CallLiteral::Property(lit.clone())),
+ }
+}
+
/// Parameters for fetching CRM companies to fold into the soup feed.
#[derive(Debug)]
pub struct GetCrmCompaniesRequest {
diff --git a/crates/soup/src/inbound/toolset/list_entities.rs b/crates/soup/src/inbound/toolset/list_entities.rs
index e6ace6a9ab..6f22c78316 100644
--- a/crates/soup/src/inbound/toolset/list_entities.rs
+++ b/crates/soup/src/inbound/toolset/list_entities.rs
@@ -193,6 +193,9 @@ pub enum EntityItem {
id: Uuid,
/// User or actor that created the call.
created_by: String,
+ /// Tags on the call visible to the user.
+ #[serde(default, skip_serializing_if = "Vec::is_empty")]
+ tags: Vec<AppliedTag>,
},
/// Foreign entity item.
#[serde(rename_all = "camelCase")]
@@ -256,6 +259,7 @@ impl EntityItem {
SoupItem::Call(record) => EntityItem::Call {
id: record.call_id,
created_by: record.created_by,
+ tags: resolve_applied_tags(&record.properties, tag_map),
},
// `entity_filter_ast` force-filters CrmCompany out — kept
// loud here so a contract break is obvious, not silent.
@@ -332,7 +336,7 @@ pub struct ListEntitiesResponse {
#[serde(rename_all = "camelCase")]
#[schemars(
title = "ListEntities",
- description = "Browse the user's Macro workspace to see recent items they have access to. Returns Macro documents, AI conversations, projects, emails, chat channels, call records, and foreign entities. Use this to get an overview of what the user has been working on or to find items by type. Start here for activity-summary questions such as \"what happened today\", \"what's going on\", \"catch me up\", or \"what happened in standup today\"; apply precise time, type, channel, or mailbox filters when the user gives that scope. For Macro task requests such as \"list my tasks\", \"tasks assigned to me\", or \"tasks I completed yesterday\", prefer this tool over external task trackers such as Linear unless the user explicitly asks for Linear. Macro tasks are document items with df subtype {\"l\":{\"dst\":\"task\"}} and includeTypes [\"document\"]. Filter task Status and Assignees through propf using entity_type TASK: Status property 00000001-0000-0000-0000-000000000002, Completed option 00000001-0000-0000-0002-000000000004, Assignees property 00000001-0000-0000-0000-000000000001. The current user's assignee entity id is their Macro user id, usually macro|<their email address from context>. For \"completed yesterday\", combine status Completed, assigned-to-me, and a df updatedAt yesterday window with ua gte/lt ISO timestamps. Returned documents, AI chats, projects, and emails include the tags visible to the user as {label, scope} pairs. To filter by tag (e.g. \"my items tagged bug-report\"), pass the tag labels in the tags argument — ListTags shows which tags exist. For finding specific items by name or content, use the search tool instead."
+ description = "Browse the user's Macro workspace to see recent items they have access to. Returns Macro documents, AI conversations, projects, emails, chat channels, call records, and foreign entities. Use this to get an overview of what the user has been working on or to find items by type. Start here for activity-summary questions such as \"what happened today\", \"what's going on\", \"catch me up\", or \"what happened in standup today\"; apply precise time, type, channel, or mailbox filters when the user gives that scope. For Macro task requests such as \"list my tasks\", \"tasks assigned to me\", or \"tasks I completed yesterday\", prefer this tool over external task trackers such as Linear unless the user explicitly asks for Linear. Macro tasks are document items with df subtype {\"l\":{\"dst\":\"task\"}} and includeTypes [\"document\"]. Filter task Status and Assignees through propf using entity_type TASK: Status property 00000001-0000-0000-0000-000000000002, Completed option 00000001-0000-0000-0002-000000000004, Assignees property 00000001-0000-0000-0000-000000000001. The current user's assignee entity id is their Macro user id, usually macro|<their email address from context>. For \"completed yesterday\", combine status Completed, assigned-to-me, and a df updatedAt yesterday window with ua gte/lt ISO timestamps. Returned documents, AI chats, projects, emails, and call records include the tags visible to the user as {label, scope} pairs. To filter by tag (e.g. \"my items tagged bug-report\"), pass the tag labels in the tags argument — ListTags shows which tags exist. For finding specific items by name or content, use the search tool instead."
)]
pub struct ListEntities {
/// Filter returned items to specific item types.
@@ -456,8 +460,8 @@ with tagsMatch=\"all\". Each entry names a tag by its label, matched case-insens
against the user's own tags; only set scope (\"personal\" or \"team\") when the user \
distinguishes between their personal and team tags. An unknown label fails with the list of \
available tags — call ListTags first when unsure what tags exist. Only taggable items \
-(documents, tasks, projects, emails, AI chats) can match a tag filter. Prefer this over \
-hand-building a propf filter for tags.")]
+(documents, tasks, projects, emails, AI chats, call records) can match a tag filter. Prefer \
+this over hand-building a propf filter for tags.")]
#[serde(default)]
pub tags: Option<Vec<TagFilter>>,
diff --git a/crates/soup/src/outbound/pg_soup_repo.rs b/crates/soup/src/outbound/pg_soup_repo.rs
index 3defd1b8a3..70c8a0606e 100644
--- a/crates/soup/src/outbound/pg_soup_repo.rs
+++ b/crates/soup/src/outbound/pg_soup_repo.rs
@@ -219,11 +219,9 @@ pub(crate) async fn populate_properties(
SoupItem::EmailThread(x) => properties_map.get(&x.thread.id.to_string()),
SoupItem::Chat(x) => properties_map.get(&x.id.to_string()),
SoupItem::CrmCompany(x) => properties_map.get(&x.id.to_string()),
- // Channels, calls, and foreign entities are not in entity_properties.
- SoupItem::Channel(_)
- | SoupItem::ChannelThread(_)
- | SoupItem::Call(_)
- | SoupItem::ForeignEntity(_) => None,
+ SoupItem::Call(x) => properties_map.get(&x.call_id.to_string()),
+ // Channels and foreign entities are not in entity_properties.
+ SoupItem::Channel(_) | SoupItem::ChannelThread(_) | SoupItem::ForeignEntity(_) => None,
};
if let Some(props) = props {
let soup_props: Vec<SoupProperty> =
@@ -234,10 +232,8 @@ pub(crate) async fn populate_properties(
SoupItem::EmailThread(x) => x.properties = soup_props,
SoupItem::Chat(x) => x.properties = soup_props,
SoupItem::CrmCompany(x) => x.properties = soup_props,
- SoupItem::Channel(_)
- | SoupItem::ChannelThread(_)
- | SoupItem::Call(_)
- | SoupItem::ForeignEntity(_) => {}
+ SoupItem::Call(x) => x.properties = soup_props,
+ SoupItem::Channel(_) | SoupItem::ChannelThread(_) | SoupItem::ForeignEntity(_) => {}
}
}
}
diff --git a/infra/stacks/opensearch/helpers/scripts/add_properties_field.ts b/infra/stacks/opensearch/helpers/scripts/add_properties_field.ts
index 2fad584e68..6d6717ba01 100644
--- a/infra/stacks/opensearch/helpers/scripts/add_properties_field.ts
+++ b/infra/stacks/opensearch/helpers/scripts/add_properties_field.ts
@@ -1,11 +1,16 @@
require('dotenv').config();
import { client } from '../client';
-import { CHATS_ALIAS, EMAILS_ALIAS, IS_DRY_RUN } from '../constants';
+import {
+ CALL_RECORDS_ALIAS,
+ CHATS_ALIAS,
+ EMAILS_ALIAS,
+ IS_DRY_RUN,
+} from '../constants';
// Indexes that receive the nested entity-properties field additively
// (documents shipped with it; projects_v1 was created with it).
-const SUPPORTED_INDEXES = [EMAILS_ALIAS, CHATS_ALIAS];
+const SUPPORTED_INDEXES = [EMAILS_ALIAS, CHATS_ALIAS, CALL_RECORDS_ALIAS];
async function addPropertiesField(dryRun: boolean) {
const index = process.env.INDEX;
@@ -36,23 +41,31 @@ async function addPropertiesField(dryRun: boolean) {
}
console.log('\nAdding nested properties field mapping...');
- const mappingUpdate = {
+ const fields: Record<string, unknown> = {
+ // Entity properties (e.g. tags), same nested shape as the documents
+ // index so the shared property/tag filters apply unchanged. Emails:
+ // thread-level values denormalized onto every message doc. Chats and
+ // calls: values live on the parent doc only.
properties: {
- // Entity properties (e.g. tags), same nested shape as the documents
- // index so the shared property/tag filters apply unchanged. Emails:
- // thread-level values denormalized onto every message doc. Chats:
- // values live on the parent chat doc only.
+ type: 'nested' as const,
properties: {
- type: 'nested' as const,
- properties: {
- definition_id: { type: 'keyword' as const },
- values: { type: 'keyword' as const },
- number_value: { type: 'double' as const },
- date_value: { type: 'date' as const },
- },
+ definition_id: { type: 'keyword' as const },
+ values: { type: 'keyword' as const },
+ number_value: { type: 'double' as const },
+ date_value: { type: 'date' as const },
},
},
};
+ // Calls also gain a searchable `name` field (custom name, falling back to
+ // the channel name). Existing indexes only got channel_name; the calls
+ // backfill re-populates `name` on every parent doc.
+ if (index === CALL_RECORDS_ALIAS) {
+ fields.name = {
+ type: 'text' as const,
+ fields: { keyword: { type: 'keyword' as const, ignore_above: 128 } },
+ };
+ }
+ const mappingUpdate = { properties: fields };
if (dryRun) {
console.log('[DRY-RUN] Would add nested properties field mapping');
diff --git a/infra/stacks/opensearch/helpers/scripts/create_indices.ts b/infra/stacks/opensearch/helpers/scripts/create_indices.ts
index 5d5e436417..2f84743a23 100644
--- a/infra/stacks/opensearch/helpers/scripts/create_indices.ts
+++ b/infra/stacks/opensearch/helpers/scripts/create_indices.ts
@@ -585,6 +585,12 @@ const CALL_RECORDS_V2_BODY = {
type: 'text',
fields: { keyword: { type: 'keyword', ignore_above: 128 } },
},
+ // Searchable display name of the call (custom name, falling back to the
+ // channel name). Matched in Name/NameContent mode.
+ name: {
+ type: 'text',
+ fields: { keyword: { type: 'keyword', ignore_above: 128 } },
+ },
participant_ids: { type: 'keyword', index: true, doc_values: true },
started_at_seconds: {
type: 'date',
@@ -598,6 +604,18 @@ const CALL_RECORDS_V2_BODY = {
index: false,
doc_values: true,
},
+ // Parent-only entity properties (tags, custom). Same nested shape as
+ // DOCUMENT_BODY so property filters match definition_id + value within
+ // the same entry rather than cross-matching across properties.
+ properties: {
+ type: 'nested',
+ properties: {
+ definition_id: { type: 'keyword' },
+ values: { type: 'keyword' },
+ number_value: { type: 'double' },
+ date_value: { type: 'date' },
+ },
+ },
// Child-only fields
transcript_id: { type: 'keyword', index: false, doc_values: true },
speaker_id: { type: 'keyword', index: true, doc_values: true },
diff --git a/services/search_processing_service/src/process/call.rs b/services/search_processing_service/src/process/call.rs
index 53a8f251ed..a5b7c4017c 100644
--- a/services/search_processing_service/src/process/call.rs
+++ b/services/search_processing_service/src/process/call.rs
@@ -1,11 +1,15 @@
use anyhow::Context;
+use models_properties::EntityType;
use opensearch_client::{
OpensearchClient, date_format::EpochSeconds, upsert::call_record::UpsertCallRecordSegmentArgs,
};
+use properties::outbound::entity_properties_get_query::get_entity_properties_for_index;
use sqlx::PgPool;
use sqs_client::search::call::{CallRecordMessage, RemoveCallRecord};
use uuid::Uuid;
+use crate::process::properties::to_indexed_properties;
+
#[tracing::instrument(skip(opensearch_client, db), err)]
pub async fn process_call_record(
opensearch_client: &OpensearchClient,
@@ -32,6 +36,22 @@ pub async fn process_call_record(
let call_id_s = payload.call_id.to_string();
let channel_id_s = payload.channel_id.to_string();
+ // The searchable call name is the caller-assigned custom name, falling
+ // back to the owning channel's name.
+ let name = payload
+ .custom_name
+ .clone()
+ .or_else(|| payload.channel_name.clone());
+
+ // The parent doc is a full overwrite, so its properties must ride every
+ // write or values set by the property-update path get wiped. A fetch
+ // failure propagates (retry) rather than being mistaken for "empty".
+ let properties = to_indexed_properties(
+ get_entity_properties_for_index(db, &call_id_s, EntityType::CallRecord)
+ .await
+ .context("failed to fetch call record properties for search index")?,
+ );
+
let segments: Vec<UpsertCallRecordSegmentArgs> = payload
.segments
.into_iter()
@@ -46,11 +66,13 @@ pub async fn process_call_record(
channel_id: channel_id_s.clone(),
participant_ids: payload.participant_ids.clone(),
channel_name: payload.channel_name.clone(),
+ name: name.clone(),
speaker_id: seg.speaker_id,
sequence_num: seg.sequence_num,
content: seg.content,
started_at_seconds: EpochSeconds::new(seg.started_at.timestamp())?,
ended_at_seconds,
+ properties: properties.clone(),
})
})
.collect::<Result<Vec<_>, _>>()?;
diff --git a/services/search_processing_service/src/process/properties.rs b/services/search_processing_service/src/process/properties.rs
index a49c0d4c34..1299152570 100644
--- a/services/search_processing_service/src/process/properties.rs
+++ b/services/search_processing_service/src/process/properties.rs
@@ -43,6 +43,10 @@ pub async fn process_entity_property_update(
.update_project_properties(entity_id, &properties)
.await
.context("failed to update project properties in search index"),
+ EntityType::CallRecord => opensearch_client
+ .update_call_record_properties(entity_id, &properties)
+ .await
+ .context("failed to update call record properties in search index"),
other => {
tracing::warn!(
entity_type = %other,
diff --git a/static_assets/schema.graphql b/static_assets/schema.graphql
index 91a451a436..713edd2a5e 100644
--- a/static_assets/schema.graphql
+++ b/static_assets/schema.graphql
@@ -468,6 +468,10 @@ type GraphqlPropertyEntityReference {
An entity type supported by the properties domain.
"""
enum GraphqlPropertyEntityType {
+ """
+ Call record entity.
+ """
+ CALL_RECORD
"""
Channel entity.
"""