Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
fix(ai): list my tasks (#4042)
Eric Hayesf9485ef75629
diff --git a/js/app/packages/service-clients/service-cognition/generated/tools/types.ts b/js/app/packages/service-clients/service-cognition/generated/tools/types.tsindex bc97b58c24..070bce3275 100644--- a/js/app/packages/service-clients/service-cognition/generated/tools/types.ts+++ b/js/app/packages/service-clients/service-cognition/generated/tools/types.ts@@ -1262,7 +1262,7 @@ export interface ListCallRecordsResponse {records: CallRecordSummary[];}/**- * Browse the user's workspace to see recent items they have access to. Returns 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 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. For finding specific items by name or content, use the search tool instead.*/export interface ListEntities {/**@@ -1284,7 +1284,7 @@ export interface ListEntities {[k: string]: unknown;};/**- * Full soup AST document filter (df). Use the same shape as /items/soup/ast, e.g. {"l":{"id":"..."}}.+ * Full soup AST document filter (df). Use the same shape as /items/soup/ast, e.g. {"l":{"id":"..."}}. For Macro tasks, use {"l":{"dst":"task"}}. For "completed yesterday", AND the task subtype with updatedAt bounds, e.g. {"&":[{"l":{"dst":"task"}},{"&":[{"l":{"ua":{"gte":"<start>"}}},{"l":{"ua":{"lt":"<end>"}}}]}]} using ISO timestamps.*/df?: {[k: string]: unknown;@@ -1312,7 +1312,7 @@ export interface ListEntities {[k: string]: unknown;};/**- * Filter returned items to specific item types. If not provided, returns all types. Example: ["document", "email"] returns only documents and emails. This is folded into the AST and applied as part of cursor-level filtering.+ * Filter returned items to specific item types. If not provided, returns all types. Example: ["document", "email"] returns only documents and emails. Macro tasks are returned as document items, so use includeTypes=["document"] with df subtype task for task requests. This is folded into the AST and applied as part of cursor-level filtering.*/includeTypes?: ItemType[] | null;/**@@ -1326,7 +1326,7 @@ export interface ListEntities {[k: string]: unknown;};/**- * Full soup AST property filter (propf).+ * Full soup AST property filter (propf). Use this for Macro task Status, Assignees, Priority, and other entity properties. For task Status Completed: {"l":{"pd":"00000001-0000-0000-0000-000000000002","et":"TASK","v":{"so":"00000001-0000-0000-0002-000000000004"}}}. For tasks assigned to the current user: {"l":{"pd":"00000001-0000-0000-0000-000000000001","et":"TASK","v":{"er":"macro|[email protected]"}}}. Combine both with &: {"&":[statusCompleted, assignedToMe]}. Prefer this over Linear tools for unqualified task requests.*/propf?: {[k: string]: unknown;diff --git a/rust/cloud-storage/soup/src/inbound/toolset/list_entities.rs b/rust/cloud-storage/soup/src/inbound/toolset/list_entities.rsindex 4a4a8ac736..f14a2a6bef 100644--- a/rust/cloud-storage/soup/src/inbound/toolset/list_entities.rs+++ b/rust/cloud-storage/soup/src/inbound/toolset/list_entities.rs@@ -157,11 +157,11 @@ pub struct ListEntitiesResponse {#[serde(rename_all = "camelCase")]#[schemars(title = "ListEntities",- description = "Browse the user's workspace to see recent items they have access to. Returns 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 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. For finding specific items by name or content, use the search tool instead.")]pub struct ListEntities {#[schemars(- description = "Filter returned items to specific item types. If not provided, returns all types. Example: [\"document\", \"email\"] returns only documents and emails. This is folded into the AST and applied as part of cursor-level filtering."+ description = "Filter returned items to specific item types. If not provided, returns all types. Example: [\"document\", \"email\"] returns only documents and emails. Macro tasks are returned as document items, so use includeTypes=[\"document\"] with df subtype task for task requests. This is folded into the AST and applied as part of cursor-level filtering.")]#[serde(default)]pub include_types: Option<Vec<ItemType>>,@@ -173,7 +173,7 @@ pub struct ListEntities {pub sort_by: SortBy,#[schemars(- description = "Full soup AST document filter (df). Use the same shape as /items/soup/ast, e.g. {\"l\":{\"id\":\"...\"}}.",+ description = "Full soup AST document filter (df). Use the same shape as /items/soup/ast, e.g. {\"l\":{\"id\":\"...\"}}. For Macro tasks, use {\"l\":{\"dst\":\"task\"}}. For \"completed yesterday\", AND the task subtype with updatedAt bounds, e.g. {\"&\":[{\"l\":{\"dst\":\"task\"}},{\"&\":[{\"l\":{\"ua\":{\"gte\":\"<start>\"}}},{\"l\":{\"ua\":{\"lt\":\"<end>\"}}}]}]} using ISO timestamps.",with = "Option<serde_json::Value>")]#[serde(default, rename = "df")]@@ -228,7 +228,7 @@ pub struct ListEntities {pub foreign_entity_filter: LiteralTree<ForeignEntityLiteral>,#[schemars(- description = "Full soup AST property filter (propf).",+ description = "Full soup AST property filter (propf). Use this for Macro task Status, Assignees, Priority, and other entity properties. For task Status Completed: {\"l\":{\"pd\":\"00000001-0000-0000-0000-000000000002\",\"et\":\"TASK\",\"v\":{\"so\":\"00000001-0000-0000-0002-000000000004\"}}}. For tasks assigned to the current user: {\"l\":{\"pd\":\"00000001-0000-0000-0000-000000000001\",\"et\":\"TASK\",\"v\":{\"er\":\"macro|[email protected]\"}}}. Combine both with &: {\"&\":[statusCompleted, assignedToMe]}. Prefer this over Linear tools for unqualified task requests.",with = "Option<serde_json::Value>")]#[serde(default, rename = "propf")]diff --git a/rust/cloud-storage/soup/src/inbound/toolset/test.rs b/rust/cloud-storage/soup/src/inbound/toolset/test.rsindex d95ee49c07..405288c688 100644--- a/rust/cloud-storage/soup/src/inbound/toolset/test.rs+++ b/rust/cloud-storage/soup/src/inbound/toolset/test.rs@@ -21,11 +21,77 @@ fn test_list_entities_schema_validation() {"Tool name should match the schemars title");assert!(- description.contains("Browse the user's workspace"),+ description.contains("Browse the user's Macro workspace"),"Description should contain expected text");}+#[test]+fn test_list_entities_schema_guides_macro_task_queries() {+ let schema = generate_tool_input_schema!(ListEntities);+ let schema_json = serde_json::to_string(&schema).unwrap();++ assert!(+ schema_json.contains("prefer this tool over external task trackers such as Linear"),+ "schema should prefer Macro tasks over Linear for unqualified task requests"+ );+ assert!(+ schema_json.contains("00000001-0000-0000-0000-000000000001"),+ "schema should document the Assignees property id"+ );+ assert!(+ schema_json.contains("00000001-0000-0000-0002-000000000004"),+ "schema should document the Completed status option id"+ );+}++#[test]+fn test_macro_task_completed_assigned_to_me_filter_deserializes() {+ let input = serde_json::json!({+ "includeTypes": ["document"],+ "df": {+ "&": [+ { "l": { "dst": "task" } },+ {+ "&": [+ { "l": { "ua": { "gte": "2026-06-11T04:00:00Z" } } },+ { "l": { "ua": { "lt": "2026-06-12T04:00:00Z" } } }+ ]+ }+ ]+ },+ "propf": {+ "&": [+ {+ "l": {+ "pd": "00000001-0000-0000-0000-000000000002",+ "et": "TASK",+ "v": { "so": "00000001-0000-0000-0002-000000000004" }+ }+ },+ {+ "l": {+ "pd": "00000001-0000-0000-0000-000000000001",+ "et": "TASK",+ "v": { "er": "macro|[email protected]" }+ }+ }+ ]+ },+ "sortBy": "recently_updated"+ });++ let list: ListEntities = serde_json::from_value(input).unwrap();+ let ast = list.entity_filter_ast();++ assert_eq!(+ list.effective_include_types(),+ Some(vec![ItemType::Document])+ );+ assert!(ast.document_filter.is_some());+ assert!(ast.properties_filter.is_some());+}+#[test]fn test_default_values() {let list = ListEntities::default();