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
refactor(projects): make a task's project its Project property (#7424)
teo8329c8dfef30
diff --git a/.sqlx/query-55d25e12b2b7effa8b188f1ec354c00e1ea2c0f77a18d9c6c032f472b04ea46e.json b/.sqlx/query-55d25e12b2b7effa8b188f1ec354c00e1ea2c0f77a18d9c6c032f472b04ea46e.jsondeleted file mode 100644index 409c43239a..0000000000--- a/.sqlx/query-55d25e12b2b7effa8b188f1ec354c00e1ea2c0f77a18d9c6c032f472b04ea46e.json+++ /dev/null@@ -1,28 +0,0 @@-{- "db_name": "PostgreSQL",- "query": "SELECT task_id, initiative_id FROM task_initiative WHERE task_id = ANY($1)",- "describe": {- "columns": [- {- "ordinal": 0,- "name": "task_id",- "type_info": "Text"- },- {- "ordinal": 1,- "name": "initiative_id",- "type_info": "Uuid"- }- ],- "parameters": {- "Left": [- "TextArray"- ]- },- "nullable": [- false,- false- ]- },- "hash": "55d25e12b2b7effa8b188f1ec354c00e1ea2c0f77a18d9c6c032f472b04ea46e"-}diff --git a/.sqlx/query-7be53dc216b01e1dddfb3b446c5f696248a25fee57f48cea19eca7323af956c0.json b/.sqlx/query-7be53dc216b01e1dddfb3b446c5f696248a25fee57f48cea19eca7323af956c0.jsondeleted file mode 100644index 3dffe266f6..0000000000--- a/.sqlx/query-7be53dc216b01e1dddfb3b446c5f696248a25fee57f48cea19eca7323af956c0.json+++ /dev/null@@ -1,28 +0,0 @@-{- "db_name": "PostgreSQL",- "query": "\n WITH task AS (\n SELECT d.id, COALESCE(dst.sub_type = 'task', false) AS is_task\n FROM \"Document\" d\n LEFT JOIN document_sub_type dst ON dst.document_id = d.id\n WHERE d.id = $1 AND d.\"deletedAt\" IS NULL\n ), removed AS (\n DELETE FROM task_initiative ti\n USING task\n WHERE ti.task_id = task.id AND task.is_task\n RETURNING initiative_id\n ), updated AS (\n UPDATE initiative\n SET updated_at = now()\n WHERE id IN (SELECT initiative_id FROM removed)\n RETURNING id\n )\n SELECT task.is_task AS \"is_task!\", (SELECT id FROM updated) AS initiative_id\n FROM task\n ",- "describe": {- "columns": [- {- "ordinal": 0,- "name": "is_task!",- "type_info": "Bool"- },- {- "ordinal": 1,- "name": "initiative_id",- "type_info": "Uuid"- }- ],- "parameters": {- "Left": [- "Text"- ]- },- "nullable": [- null,- null- ]- },- "hash": "7be53dc216b01e1dddfb3b446c5f696248a25fee57f48cea19eca7323af956c0"-}diff --git a/.sqlx/query-7c2b158ff8819b7717f5373a1cd8dddf1463122d30c610c20505778989d5b219.json b/.sqlx/query-7c2b158ff8819b7717f5373a1cd8dddf1463122d30c610c20505778989d5b219.jsondeleted file mode 100644index 45fc128c99..0000000000--- a/.sqlx/query-7c2b158ff8819b7717f5373a1cd8dddf1463122d30c610c20505778989d5b219.json+++ /dev/null@@ -1,23 +0,0 @@-{- "db_name": "PostgreSQL",- "query": "\n INSERT INTO task_initiative (task_id, initiative_id)\n SELECT dst.document_id, $1\n FROM UNNEST($2::text[]) AS t(task_id)\n JOIN document_sub_type dst\n ON dst.document_id = t.task_id AND dst.sub_type = 'task'\n ON CONFLICT (task_id) DO UPDATE\n SET initiative_id = EXCLUDED.initiative_id, created_at = now()\n RETURNING task_id\n ",- "describe": {- "columns": [- {- "ordinal": 0,- "name": "task_id",- "type_info": "Text"- }- ],- "parameters": {- "Left": [- "Uuid",- "TextArray"- ]- },- "nullable": [- false- ]- },- "hash": "7c2b158ff8819b7717f5373a1cd8dddf1463122d30c610c20505778989d5b219"-}diff --git a/.sqlx/query-a2ba0e3bffb82564ebf3c8a7ed1708d29eefecfa61aff494df50ca15d80d914c.json b/.sqlx/query-92171cd5bd2395999f9b7de5113a5c5b0be6d8648908b2891c249ff7f30d1a97.jsonsimilarity index 57%rename from .sqlx/query-a2ba0e3bffb82564ebf3c8a7ed1708d29eefecfa61aff494df50ca15d80d914c.jsonrename to .sqlx/query-92171cd5bd2395999f9b7de5113a5c5b0be6d8648908b2891c249ff7f30d1a97.jsonindex 72c6ae9112..af1584311f 100644--- a/.sqlx/query-a2ba0e3bffb82564ebf3c8a7ed1708d29eefecfa61aff494df50ca15d80d914c.json+++ b/.sqlx/query-92171cd5bd2395999f9b7de5113a5c5b0be6d8648908b2891c249ff7f30d1a97.json@@ -1,6 +1,6 @@{"db_name": "PostgreSQL",- "query": "\n SELECT\n i.id,\n i.name,\n i.owner_user_id,\n i.created_at,\n i.updated_at,\n i.share_permission_id,\n COALESCE(\n array_agg(DISTINCT m.user_id) FILTER (WHERE m.user_id IS NOT NULL),\n '{}'::text[]\n ) AS \"member_ids!\",\n COALESCE(\n array_agg(DISTINCT t.task_id) FILTER (WHERE t.task_id IS NOT NULL),\n '{}'::text[]\n ) AS \"task_ids!\",\n sp.\"linkShare\" AS \"link_share?\",\n sp.\"linkShareAccessLevel\" AS \"link_share_access_level?: AccessLevel\",\n sp.team_share_access_level AS \"team_share_access_level?: AccessLevel\",\n COALESCE(\n (\n SELECT json_agg(json_build_object(\n 'channel_id', channel.\"channel_id\",\n 'access_level', channel.\"access_level\"\n ))\n FROM \"ChannelSharePermission\" channel\n WHERE channel.\"share_permission_id\" = i.share_permission_id\n ),\n '[]'::json\n ) AS \"channel_share_permissions!\"\n FROM initiative i\n JOIN \"SharePermission\" sp ON sp.id = i.share_permission_id\n LEFT JOIN initiative_member m ON m.initiative_id = i.id\n LEFT JOIN task_initiative t ON t.initiative_id = i.id\n WHERE i.id = $1\n GROUP BY\n i.id,\n i.name,\n i.owner_user_id,\n i.created_at,\n i.updated_at,\n i.share_permission_id,\n sp.\"linkShare\",\n sp.\"linkShareAccessLevel\",\n sp.team_share_access_level\n ",+ "query": "\n SELECT\n i.id,\n i.name,\n i.owner_user_id,\n i.created_at,\n i.updated_at,\n i.share_permission_id,\n COALESCE(\n array_agg(DISTINCT m.user_id) FILTER (WHERE m.user_id IS NOT NULL),\n '{}'::text[]\n ) AS \"member_ids!\",\n sp.\"linkShare\" AS \"link_share?\",\n sp.\"linkShareAccessLevel\" AS \"link_share_access_level?: AccessLevel\",\n sp.team_share_access_level AS \"team_share_access_level?: AccessLevel\",\n COALESCE(\n (\n SELECT json_agg(json_build_object(\n 'channel_id', channel.\"channel_id\",\n 'access_level', channel.\"access_level\"\n ))\n FROM \"ChannelSharePermission\" channel\n WHERE channel.\"share_permission_id\" = i.share_permission_id\n ),\n '[]'::json\n ) AS \"channel_share_permissions!\"\n FROM initiative i\n JOIN \"SharePermission\" sp ON sp.id = i.share_permission_id\n LEFT JOIN initiative_member m ON m.initiative_id = i.id\n WHERE i.id = $1\n GROUP BY\n i.id,\n i.name,\n i.owner_user_id,\n i.created_at,\n i.updated_at,\n i.share_permission_id,\n sp.\"linkShare\",\n sp.\"linkShareAccessLevel\",\n sp.team_share_access_level\n ","describe": {"columns": [{@@ -40,16 +40,11 @@},{"ordinal": 7,- "name": "task_ids!",- "type_info": "TextArray"- },- {- "ordinal": 8,"name": "link_share?","type_info": "Text"},{- "ordinal": 9,+ "ordinal": 8,"name": "link_share_access_level?: AccessLevel","type_info": {"Custom": {@@ -66,7 +61,7 @@}},{- "ordinal": 10,+ "ordinal": 9,"name": "team_share_access_level?: AccessLevel","type_info": {"Custom": {@@ -83,7 +78,7 @@}},{- "ordinal": 11,+ "ordinal": 10,"name": "channel_share_permissions!","type_info": "Json"}@@ -101,12 +96,11 @@false,false,null,- null,true,true,true,null]},- "hash": "a2ba0e3bffb82564ebf3c8a7ed1708d29eefecfa61aff494df50ca15d80d914c"+ "hash": "92171cd5bd2395999f9b7de5113a5c5b0be6d8648908b2891c249ff7f30d1a97"}diff --git a/.sqlx/query-b1ceaae1abccab9be8102b59a717a14b7f91d29ccf55ec6cbf0ebcc7696224e1.json b/.sqlx/query-b1ceaae1abccab9be8102b59a717a14b7f91d29ccf55ec6cbf0ebcc7696224e1.jsondeleted file mode 100644index e5f380b760..0000000000--- a/.sqlx/query-b1ceaae1abccab9be8102b59a717a14b7f91d29ccf55ec6cbf0ebcc7696224e1.json+++ /dev/null@@ -1,28 +0,0 @@-{- "db_name": "PostgreSQL",- "query": "\n SELECT task_id, initiative_id\n FROM task_initiative\n WHERE task_id = ANY($1)\n FOR UPDATE\n ",- "describe": {- "columns": [- {- "ordinal": 0,- "name": "task_id",- "type_info": "Text"- },- {- "ordinal": 1,- "name": "initiative_id",- "type_info": "Uuid"- }- ],- "parameters": {- "Left": [- "TextArray"- ]- },- "nullable": [- false,- false- ]- },- "hash": "b1ceaae1abccab9be8102b59a717a14b7f91d29ccf55ec6cbf0ebcc7696224e1"-}diff --git a/.sqlx/query-ba07cac3edf79914bb89912c6934f7314fe5485b7c830800c490869ed1f2a621.json b/.sqlx/query-ba07cac3edf79914bb89912c6934f7314fe5485b7c830800c490869ed1f2a621.jsonnew file mode 100644index 0000000000..a486ff5093--- /dev/null+++ b/.sqlx/query-ba07cac3edf79914bb89912c6934f7314fe5485b7c830800c490869ed1f2a621.json@@ -0,0 +1,29 @@+{+ "db_name": "PostgreSQL",+ "query": "\n SELECT entity_id, values->'value'->0->>'entity_id' AS \"project_id!\"\n FROM entity_properties\n WHERE property_definition_id = $1\n AND entity_type = 'TASK'\n AND entity_id = ANY($2)\n AND values->'value'->0->>'entity_type' = 'INITIATIVE'\n ",+ "describe": {+ "columns": [+ {+ "ordinal": 0,+ "name": "entity_id",+ "type_info": "Text"+ },+ {+ "ordinal": 1,+ "name": "project_id!",+ "type_info": "Text"+ }+ ],+ "parameters": {+ "Left": [+ "Uuid",+ "TextArray"+ ]+ },+ "nullable": [+ false,+ null+ ]+ },+ "hash": "ba07cac3edf79914bb89912c6934f7314fe5485b7c830800c490869ed1f2a621"+}diff --git a/.sqlx/query-9cd40fbb1ade51e9e0d49792839d1a363cada017252a6f653c2272608189bcc4.json b/.sqlx/query-cc81ad7d6ba51ef03b127349e145a241b3789e1c27738e4eedb0d81a5344d16f.jsonsimilarity index 69%rename from .sqlx/query-9cd40fbb1ade51e9e0d49792839d1a363cada017252a6f653c2272608189bcc4.jsonrename to .sqlx/query-cc81ad7d6ba51ef03b127349e145a241b3789e1c27738e4eedb0d81a5344d16f.jsonindex 9d717fa5f9..5afd9edb80 100644--- a/.sqlx/query-9cd40fbb1ade51e9e0d49792839d1a363cada017252a6f653c2272608189bcc4.json+++ b/.sqlx/query-cc81ad7d6ba51ef03b127349e145a241b3789e1c27738e4eedb0d81a5344d16f.json@@ -1,6 +1,6 @@{"db_name": "PostgreSQL",- "query": "\n SELECT property_definition_id, values\n FROM entity_properties\n WHERE entity_id = $1\n AND entity_type = 'TASK'\n ",+ "query": "\n SELECT property_definition_id, values\n FROM entity_properties\n WHERE entity_id = $1\n AND entity_type = 'TASK'\n AND property_definition_id <> $2\n ","describe": {"columns": [{@@ -16,7 +16,8 @@],"parameters": {"Left": [- "Text"+ "Text",+ "Uuid"]},"nullable": [@@ -24,5 +25,5 @@true]},- "hash": "9cd40fbb1ade51e9e0d49792839d1a363cada017252a6f653c2272608189bcc4"+ "hash": "cc81ad7d6ba51ef03b127349e145a241b3789e1c27738e4eedb0d81a5344d16f"}diff --git a/.sqlx/query-d7bad4039582741fcae82df8c90a5148a76cfd4567fcef8e0432ee746a9a2e3d.json b/.sqlx/query-d7bad4039582741fcae82df8c90a5148a76cfd4567fcef8e0432ee746a9a2e3d.jsonnew file mode 100644index 0000000000..484e28e4af--- /dev/null+++ b/.sqlx/query-d7bad4039582741fcae82df8c90a5148a76cfd4567fcef8e0432ee746a9a2e3d.json@@ -0,0 +1,23 @@+{+ "db_name": "PostgreSQL",+ "query": "\n SELECT entity_id\n FROM entity_properties\n WHERE property_definition_id = $1\n AND entity_type = 'TASK'\n AND values @> jsonb_build_object(\n 'value', jsonb_build_array(jsonb_build_object(\n 'entity_id', $2::text, 'entity_type', 'INITIATIVE'\n ))\n )\n ORDER BY entity_id\n ",+ "describe": {+ "columns": [+ {+ "ordinal": 0,+ "name": "entity_id",+ "type_info": "Text"+ }+ ],+ "parameters": {+ "Left": [+ "Uuid",+ "Text"+ ]+ },+ "nullable": [+ false+ ]+ },+ "hash": "d7bad4039582741fcae82df8c90a5148a76cfd4567fcef8e0432ee746a9a2e3d"+}diff --git a/.sqlx/query-e4f15ad91d99ba713786127ac520e2f4e8fe092d37e7062df1d7b0364a182510.json b/.sqlx/query-e4f15ad91d99ba713786127ac520e2f4e8fe092d37e7062df1d7b0364a182510.jsondeleted file mode 100644index f9bf51ee5e..0000000000--- a/.sqlx/query-e4f15ad91d99ba713786127ac520e2f4e8fe092d37e7062df1d7b0364a182510.json+++ /dev/null@@ -1,15 +0,0 @@-{- "db_name": "PostgreSQL",- "query": "\n DELETE FROM task_initiative\n WHERE task_id = $1 AND initiative_id = $2\n ",- "describe": {- "columns": [],- "parameters": {- "Left": [- "Text",- "Uuid"- ]- },- "nullable": []- },- "hash": "e4f15ad91d99ba713786127ac520e2f4e8fe092d37e7062df1d7b0364a182510"-}diff --git a/Cargo.lock b/Cargo.lockindex 753a5e667a..c524b9781d 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -464,6 +464,7 @@ dependencies = ["sqlx","static_file","static_file_service_client",+ "system_properties","teams","tokio","tokio-retry",@@ -679,6 +680,7 @@ dependencies = ["model_owner","models_properties","properties",+ "rootcause","serde","serde_json","sha2 0.10.9",@@ -726,6 +728,7 @@ dependencies = ["serde_json","sqlx","static_file",+ "system_properties","teams","tokio","tracing",@@ -17603,6 +17606,7 @@ dependencies = ["rootcause","serde","serde_json",+ "system_properties","tokio","tokio-retry","tracing",diff --git a/apps/docs/AI/mcp/tools/assign-tasks-to-initiative.mdx b/apps/docs/AI/mcp/tools/assign-tasks-to-initiative.mdxdeleted file mode 100644index 1124e3ecd6..0000000000--- a/apps/docs/AI/mcp/tools/assign-tasks-to-initiative.mdx+++ /dev/null@@ -1,16 +0,0 @@-----title: AssignTasksToInitiative-description: >-- Move tasks into an initiative.------# AssignTasksToInitiative--Move tasks into an initiative. A task already in another initiative is moved; duplicates are ignored; at most 100 unique task ids per call. Requires edit access to the initiative and to each task. Returns one status per task id: assigned, moved, not_a_task, not_found, or skipped_no_permission.--## Parameters--| Parameter | Type | Required | Description |-| --- | --- | --- | --- |-| `initiativeId` | string | Yes | The id of the initiative to assign tasks to. Requires edit access. |-| `taskIds` | string[] | Yes | Task document ids to assign, at least one and at most 100 unique ids per call. Duplicates are ignored. Requires edit access to each task. |diff --git a/apps/docs/AI/mcp/tools/index.mdx b/apps/docs/AI/mcp/tools/index.mdxindex f7aa8f5f3b..19c423a185 100644--- a/apps/docs/AI/mcp/tools/index.mdx+++ b/apps/docs/AI/mcp/tools/index.mdx@@ -9,7 +9,6 @@ These pages are generated from Macro's Rust MCP tool registry.## Tools-- [AssignTasksToInitiative](/AI/mcp/tools/assign-tasks-to-initiative)- [BashCodeExecution](/AI/mcp/tools/bash-code-execution)- [BulkSetEntityPropertyOptions](/AI/mcp/tools/bulk-set-entity-property-options)- [CalculateSpreadsheet](/AI/mcp/tools/calculate-spreadsheet)@@ -82,7 +81,6 @@ These pages are generated from Macro's Rust MCP tool registry.- [ReadProject](/AI/mcp/tools/read-project)- [ReadSkill](/AI/mcp/tools/read-skill)- [ReadSpreadsheet](/AI/mcp/tools/read-spreadsheet)-- [ReadTaskInitiatives](/AI/mcp/tools/read-task-initiatives)- [ReadThread](/AI/mcp/tools/read-thread)- [RenameChannel](/AI/mcp/tools/rename-channel)- [RenameDocument](/AI/mcp/tools/rename-document)@@ -97,10 +95,8 @@ These pages are generated from Macro's Rust MCP tool registry.- [SendEmail](/AI/mcp/tools/send-email)- [SetEntityProperty](/AI/mcp/tools/set-entity-property)- [SetSenderPolicy](/AI/mcp/tools/set-sender-policy)-- [SetTaskInitiative](/AI/mcp/tools/set-task-initiative)- [Subagent](/AI/mcp/tools/subagent)- [TextEditorCodeExecution](/AI/mcp/tools/text-editor-code-execution)-- [UnassignTasksFromInitiative](/AI/mcp/tools/unassign-tasks-from-initiative)- [UpdateCalendarEvent](/AI/mcp/tools/update-calendar-event)- [UpdateInitiative](/AI/mcp/tools/update-initiative)- [UpdateInitiativeSharing](/AI/mcp/tools/update-initiative-sharing)diff --git a/apps/docs/AI/mcp/tools/read-task-initiatives.mdx b/apps/docs/AI/mcp/tools/read-task-initiatives.mdxdeleted file mode 100644index e762a417fb..0000000000--- a/apps/docs/AI/mcp/tools/read-task-initiatives.mdx+++ /dev/null@@ -1,15 +0,0 @@-----title: ReadTaskInitiatives-description: >-- Find the project associated with each requested task.------# ReadTaskInitiatives--Find the project associated with each requested task. Returns project id/name only when both task and project are visible. Distinguishes no project from unavailable. Accepts up to 100 unique task ids.--## Parameters--| Parameter | Type | Required | Description |-| --- | --- | --- | --- |-| `taskIds` | string[] | Yes | Task ids to look up, deduplicated in input order. |diff --git a/apps/docs/AI/mcp/tools/set-entity-property.mdx b/apps/docs/AI/mcp/tools/set-entity-property.mdxindex 93656f542a..079adb39a0 100644--- a/apps/docs/AI/mcp/tools/set-entity-property.mdx+++ b/apps/docs/AI/mcp/tools/set-entity-property.mdx@@ -19,6 +19,9 @@ Tasks always have these system properties (use these property_definition_id valu- Subtasks (00000001-0000-0000-0000-000000000006): entity, multi. Use entity_refs with entity_type='task'.- Story Points (00000001-0000-0000-0000-000000000009): number, single. Use number_value.+A task can belong to one project:+- Project (00000001-0000-0000-0000-000000000014): entity, single. Use entity_ref with entity_type='initiative' and the project UUID; send no value field to remove the task from its project. Setting it requires edit access to the task and the project, and the project's agents are assigned to the task.+CRM companies (entity_type='company', entity_id=the company UUID) always have these system properties:- Stage (00000001-0000-0000-0000-000000000010): select_string, single. Use option_id. Default options: Lead (00000001-0000-0000-0010-000000000001), Qualified (...0002), Demo (...0003), Trial (...0004), Negotiation (...0005), Customer (...0006), Churned (...0007). Teams can customize their stages, so prefer calling GetCompany or GetEntityProperties first to get the valid stage option ids.- Owner (00000001-0000-0000-0000-000000000011): entity, single. Use entity_ref with entity_type='user' and entity_id='macro|[email protected]'.diff --git a/apps/docs/AI/mcp/tools/set-task-initiative.mdx b/apps/docs/AI/mcp/tools/set-task-initiative.mdxdeleted file mode 100644index 12201f7bbe..0000000000--- a/apps/docs/AI/mcp/tools/set-task-initiative.mdx+++ /dev/null@@ -1,17 +0,0 @@-----title: SetTaskInitiative-description: >-- Set the project associated with tasks, moving them from their previous project- if needed.------# SetTaskInitiative--Set the project associated with tasks, moving them from their previous project if needed. Requires edit access to each task and the destination project; access to the previous project is unnecessary. Omit initiativeId to clear the association using task edit access alone. Reports each task's outcome independently; at most 100 unique tasks.--## Parameters--| Parameter | Type | Required | Description |-| --- | --- | --- | --- |-| `taskIds` | string[] | Yes | Task ids to assign or clear, deduplicated in request order. |-| `initiativeId` | string | No | Destination project; omit to clear each task's current project. |diff --git a/apps/docs/AI/mcp/tools/unassign-tasks-from-initiative.mdx b/apps/docs/AI/mcp/tools/unassign-tasks-from-initiative.mdxdeleted file mode 100644index 42c33a7760..0000000000--- a/apps/docs/AI/mcp/tools/unassign-tasks-from-initiative.mdx+++ /dev/null@@ -1,16 +0,0 @@-----title: UnassignTasksFromInitiative-description: >-- Move tasks out of a specific initiative (project).------# UnassignTasksFromInitiative--Move tasks out of a specific initiative (project). Requires edit access to the initiative and each task; at most 100 unique tasks. Returns one status per task id: unassigned, or not_assigned when the task was not in this initiative. Tasks in other initiatives are left unchanged. An access or service failure stops the batch; earlier removals may have succeeded.--## Parameters--| Parameter | Type | Required | Description |-| --- | --- | --- | --- |-| `initiativeId` | string | Yes | The id of the initiative to remove tasks from. Requires edit access. |-| `taskIds` | string[] | Yes | Task document ids to remove. Provide at least one and at most 100 unique ids; duplicates are ignored. Requires edit access to each task. |diff --git a/apps/docs/config/tool-pages.json b/apps/docs/config/tool-pages.jsonindex d1b0a2953d..f4980a7668 100644--- a/apps/docs/config/tool-pages.json+++ b/apps/docs/config/tool-pages.json@@ -1,6 +1,5 @@["AI/mcp/tools/index",- "AI/mcp/tools/assign-tasks-to-initiative","AI/mcp/tools/bash-code-execution","AI/mcp/tools/bulk-set-entity-property-options","AI/mcp/tools/calculate-spreadsheet",@@ -73,7 +72,6 @@"AI/mcp/tools/read-project","AI/mcp/tools/read-skill","AI/mcp/tools/read-spreadsheet",- "AI/mcp/tools/read-task-initiatives","AI/mcp/tools/read-thread","AI/mcp/tools/rename-channel","AI/mcp/tools/rename-document",@@ -88,10 +86,8 @@"AI/mcp/tools/send-email","AI/mcp/tools/set-entity-property","AI/mcp/tools/set-sender-policy",- "AI/mcp/tools/set-task-initiative","AI/mcp/tools/subagent","AI/mcp/tools/text-editor-code-execution",- "AI/mcp/tools/unassign-tasks-from-initiative","AI/mcp/tools/update-calendar-event","AI/mcp/tools/update-initiative","AI/mcp/tools/update-initiative-sharing",diff --git a/apps/docs/docs.json b/apps/docs/docs.jsonindex 87a869e288..8c60e31a51 100644--- a/apps/docs/docs.json+++ b/apps/docs/docs.json@@ -71,7 +71,6 @@"icon": "wrench","pages": ["AI/mcp/tools/index",- "AI/mcp/tools/assign-tasks-to-initiative","AI/mcp/tools/bash-code-execution","AI/mcp/tools/bulk-set-entity-property-options","AI/mcp/tools/calculate-spreadsheet",@@ -144,7 +143,6 @@"AI/mcp/tools/read-project","AI/mcp/tools/read-skill","AI/mcp/tools/read-spreadsheet",- "AI/mcp/tools/read-task-initiatives","AI/mcp/tools/read-thread","AI/mcp/tools/rename-channel","AI/mcp/tools/rename-document",@@ -159,10 +157,8 @@"AI/mcp/tools/send-email","AI/mcp/tools/set-entity-property","AI/mcp/tools/set-sender-policy",- "AI/mcp/tools/set-task-initiative","AI/mcp/tools/subagent","AI/mcp/tools/text-editor-code-execution",- "AI/mcp/tools/unassign-tasks-from-initiative","AI/mcp/tools/update-calendar-event","AI/mcp/tools/update-initiative","AI/mcp/tools/update-initiative-sharing",diff --git a/apps/web/src/features/projects/context/projects-context.tsx b/apps/web/src/features/projects/context/projects-context.tsxindex dac67a4eec..a6a39b350e 100644--- a/apps/web/src/features/projects/context/projects-context.tsx+++ b/apps/web/src/features/projects/context/projects-context.tsx@@ -3,12 +3,7 @@ import type { Property, PropertyApiValues } from '@property/types';import type { Accessor, ParentProps } from 'solid-js';import { createContext, useContext } from 'solid-js';import type { ProjectAssignmentResult } from '../core/assignment';-import type {- Project,- ProjectDetail,- ProjectFilters,- TaskProjectReference,-} from '../core/project';+import type { Project, ProjectDetail, ProjectFilters } from '../core/project';export type ProjectRow = {project: Project;@@ -57,12 +52,8 @@ export type ProjectsContext = {loading: Accessor<boolean>;error: Accessor<Error | undefined>;};- createReferencesSource(ids: Accessor<readonly string[]>): {- references: Accessor<ReadonlyMap<string, TaskProjectReference>>;- loading: Accessor<boolean>;- error: Accessor<Error | undefined>;- };createCommands(): {+ /** One request creates the task with its Project property set. */createTask(projectId: string,...args: Parameters<typeof createTaskWithProperties>@@ -72,6 +63,7 @@ export type ProjectsContext = {create(input: ProjectCreationInput): Promise<ProjectDetail>;rename(id: string, name: string): Promise<void>;setMembers(id: string, memberIds: string[]): Promise<void>;+ /** Sets or, without a project, clears each task's Project property. */assignTasks(projectId: string | undefined,taskIds: readonly string[]diff --git a/apps/web/src/features/projects/core/assignment.test.ts b/apps/web/src/features/projects/core/assignment.test.tsindex aafe109f66..0579dbf0dc 100644--- a/apps/web/src/features/projects/core/assignment.test.ts+++ b/apps/web/src/features/projects/core/assignment.test.ts@@ -2,40 +2,32 @@ import { describe, expect, it, vi } from 'vitest';import { assignProjectTasks } from './assignment';describe('project task assignment', () => {- it('preserves successful task results when a later batch fails', async () => {- const tasks = Array.from({ length: 105 }, (_, index) => `task-${index}`);- const assign = vi.fn(async (_id: string, ids: string[]) =>- ids.map((taskId) => ({ taskId }))- );- assign- .mockImplementationOnce(async (_id, ids) =>- ids.map((taskId) => ({ taskId }))- )- .mockRejectedValueOnce(new Error('access changed'));- const results = await assignProjectTasks(- { assign, clear: vi.fn() },- 'initiative',- [...tasks, tasks[0]]- );- expect(assign).toHaveBeenCalledTimes(2);+ it('sets each unique task once and keeps successes when some fail', async () => {+ const tasks = Array.from({ length: 30 }, (_, index) => `task-${index}`);+ const setProject = vi.fn(async (taskId: string) => {+ if (taskId === 'task-27') throw new Error('access changed');+ });+ const results = await assignProjectTasks(setProject, 'initiative', [+ ...tasks,+ tasks[0],+ ]);+ expect(setProject).toHaveBeenCalledTimes(30);+ expect(setProject).toHaveBeenCalledWith('task-0', 'initiative');expect(results.filter((result) => result.error).map((result) => result.taskId)- ).toEqual(tasks.slice(100));- expect(- results.filter((result) => !result.error).map((result) => result.taskId)- ).toEqual(tasks.slice(0, 100));- expect(results).toHaveLength(105);+ ).toEqual(['task-27']);+ expect(results).toHaveLength(30);});- it('returns per-task removal failures without discarding successes', async () => {- const clear = vi.fn(async (id: string) => {+ it('clears the project and reports per-task removal failures', async () => {+ const setProject = vi.fn(async (id: string) => {if (id === 'locked') throw new Error('forbidden');});- const results = await assignProjectTasks(- { assign: vi.fn(), clear },- undefined,- ['editable', 'locked']- );+ const results = await assignProjectTasks(setProject, undefined, [+ 'editable',+ 'locked',+ ]);+ expect(setProject).toHaveBeenCalledWith('editable', undefined);expect(results[0]).toEqual({ taskId: 'editable', error: undefined });expect(results[1].error).toBeTruthy();});diff --git a/apps/web/src/features/projects/core/assignment.ts b/apps/web/src/features/projects/core/assignment.tsindex b7523c6559..064ccc8e63 100644--- a/apps/web/src/features/projects/core/assignment.ts+++ b/apps/web/src/features/projects/core/assignment.ts@@ -1,48 +1,34 @@export type ProjectAssignmentResult = { taskId: string; error?: string };-export type ProjectAssignmentPort = {- assign(- projectId: string,- taskIds: string[]- ): Promise<ProjectAssignmentResult[]>;- clear(taskId: string): Promise<void>;-};+const CONCURRENT_SAVES = 25;-/** Keep successes when another batch fails so the picker retries only unfinished tasks. */+/**+ * Sets each task's Project independently, so a failure keeps the other tasks'+ * changes and the picker retries only the unfinished tasks.+ */export async function assignProjectTasks(- port: ProjectAssignmentPort,+ setProject: (taskId: string, projectId: string | undefined) => Promise<void>,projectId: string | undefined,taskIds: readonly string[]): Promise<ProjectAssignmentResult[]> {const results: ProjectAssignmentResult[] = [];const unique = [...new Set(taskIds)];- for (let offset = 0; offset < unique.length; offset += 100) {- const batch = unique.slice(offset, offset + 100);- if (projectId) {- try {- results.push(...(await port.assign(projectId, batch)));- } catch {- results.push(- ...batch.map((taskId) => ({- taskId,- error: 'Could not set the project. Retry this task.',- }))- );- }- } else {- const removed = await Promise.allSettled(- batch.map((taskId) => port.clear(taskId))- );- results.push(- ...removed.map((result, index) => ({- taskId: batch[index],- error:- result.status === 'rejected'- ? 'Could not remove this task from its project.'- : undefined,- }))- );- }+ for (let offset = 0; offset < unique.length; offset += CONCURRENT_SAVES) {+ const batch = unique.slice(offset, offset + CONCURRENT_SAVES);+ const saved = await Promise.allSettled(+ batch.map((taskId) => setProject(taskId, projectId))+ );+ results.push(+ ...saved.map((result, index) => ({+ taskId: batch[index],+ error:+ result.status === 'fulfilled'+ ? undefined+ : projectId+ ? 'Could not set the project. You need edit access to the task and the project.'+ : 'Could not remove this task from its project.',+ }))+ );}return results;}diff --git a/apps/web/src/features/projects/project-property.tsx b/apps/web/src/features/projects/project-property.tsxindex 8cf29390ac..2bb8aeb2b7 100644--- a/apps/web/src/features/projects/project-property.tsx+++ b/apps/web/src/features/projects/project-property.tsx@@ -1,11 +1,12 @@+import { useUserId } from '@core/context/user';import CaretDownIcon from '@phosphor/caret-down.svg';import CircleDashedEmpty from '@phosphor/circle-dashed.svg';import StackIcon from '@phosphor/stack.svg';import { Property } from '@property';import { Dropdown, HoverCard, Layer } from '@ui';import { createSignal, Show } from 'solid-js';-import type { TaskProjectReference } from './core/project';import { Projects } from './projects';+import { useTaskProjectReference } from './queries/project-identity';import { ProjectPicker } from './views/project-picker';type AnchorRect = { x: number; y: number; width?: number; height?: number };@@ -49,18 +50,19 @@ export function ProjectPickerPopover(props: {);}-/** Task list cell for a task's project, matching the other property cells. */+/** Task list cell for a task's Project property, matching the other property cells. */export function ProjectPropertyCell(props: {taskId: string;- reference?: TaskProjectReference;+ projectId?: string;}) {const [anchor, setAnchor] = createSignal<HTMLElement>();- const project = () =>- props.reference?.state === 'visible' ? props.reference : undefined;+ const reference = useTaskProjectReference(() => props.projectId, useUserId());+ const project = () => {+ const current = reference();+ return current?.state === 'visible' ? current : undefined;+ };const emptyLabel = () =>- props.reference?.state === 'unavailable'- ? 'Unavailable project'- : 'Project';+ reference()?.state === 'unavailable' ? 'Unavailable project' : 'Project';return (<><HoverCarddiff --git a/apps/web/src/features/projects/project-share.test.tsx b/apps/web/src/features/projects/project-share.test.tsxindex c335aa2c58..b193da80f6 100644--- a/apps/web/src/features/projects/project-share.test.tsx+++ b/apps/web/src/features/projects/project-share.test.tsx@@ -68,7 +68,6 @@ function launch(source: {userId: () => 'owner',createCollectionSource: unused,createPropertyDefinitionsSource: unused,- createReferencesSource: unused,createProjectSource: (id) => {requested.push(id());return {diff --git a/apps/web/src/features/projects/projects.test.tsx b/apps/web/src/features/projects/projects.test.tsxindex 54ff3d663e..f392a63e7c 100644--- a/apps/web/src/features/projects/projects.test.tsx+++ b/apps/web/src/features/projects/projects.test.tsx@@ -18,7 +18,6 @@ const mocks = vi.hoisted(() => ({soup: vi.fn(),graphql: undefined as Client | undefined,get: vi.fn(),- taskReferences: vi.fn(),}));vi.mock('@app/lib/analytics/posthog', () => ({useFeatureFlag: () => createMemo(() => ({ enabled: mocks.enabled() })),@@ -55,8 +54,8 @@ vi.mock('@queries/client', async () => {}),};});-vi.mock('./queries/create-project-task', () => ({- createProjectTaskMutation: () => vi.fn(),+vi.mock('@block-md/util/taskComposerProperties', () => ({+ createTaskWithProperties: vi.fn(),}));// These independent property adapters are not used by this fixture.vi.mock('@entity', () => ({ isTaskEntity: () => false }));@@ -68,7 +67,6 @@ vi.mock('@queries/properties/graphql/entity', () => ({}));vi.mock('@queries/soup/transform-utils', () => ({}));vi.mock('@service-storage/graphql-soup', () => ({getGraphqlSoupClient: () => mocks.graphql,- getGraphqlSoupCacheHost: () => undefined,mapGraphqlProperties: () => [],}));@@ -146,11 +144,6 @@ it('keeps retained query sources gated after their view owner is disposed', asynexchanges: [exchange],});mocks.get.mockResolvedValue(ok(project));- mocks.taskReferences.mockResolvedValue(- ok({- references: [{ taskId: 'task', state: 'visible', initiative: project }],- })- );// The context belongs to a view, but split-owned queries are constructed// under a separate owner that survives view unmount.@@ -173,28 +166,23 @@ it('keeps retained query sources gated after their view owner is disposed', asynreturn {collection: retainedContext.createCollectionSource(),detail: retainedContext.createProjectSource(() => 'launch'),- references: retainedContext.createReferencesSource(() => ['task']),};});await vi.advanceTimersByTimeAsync(60_000);- for (const request of [mocks.get, mocks.taskReferences])- expect(request).not.toHaveBeenCalled();+ expect(mocks.get).not.toHaveBeenCalled();setEnabled(true);await vi.waitFor(() => expect(sources.detail.project()?.name).toBe('Launch'));await vi.waitFor(() => expect(sources.collection.rows()).toHaveLength(1));expect(mocks.page).not.toHaveBeenCalled();expect(mocks.soup).toHaveBeenCalledTimes(1);- expect(sources.references.references().size).toBe(1);await vi.advanceTimersByTimeAsync(30_000);- for (const request of [mocks.get, mocks.taskReferences])- expect(request).toHaveBeenCalledTimes(2);+ expect(mocks.get).toHaveBeenCalledTimes(2);setEnabled(false);const soupRequests = mocks.soup.mock.calls.length;expect(sources.collection.rows()).toBeUndefined();expect(sources.detail.project()).toBeUndefined();- expect(sources.references.references().size).toBe(0);await Promise.all([sources.collection.loadMore(),sources.collection.refresh(),@@ -202,8 +190,7 @@ it('keeps retained query sources gated after their view owner is disposed', asynqueryClient.invalidateQueries(),]);await vi.advanceTimersByTimeAsync(60_000);- for (const request of [mocks.get, mocks.taskReferences])- expect(request).toHaveBeenCalledTimes(2);+ expect(mocks.get).toHaveBeenCalledTimes(2);expect(mocks.soup).toHaveBeenCalledTimes(soupRequests);setEnabled(true);@@ -223,7 +210,7 @@ it('keeps standalone source adapters enabled when no rollout gate is injected',disposeSource = dispose;return createProjectSources(initiativeClient,- { client: () => mocks.graphql!, cacheHost: () => undefined },+ { client: () => mocks.graphql! },cache,() => 'viewer').createProjectSource(() => 'launch');diff --git a/apps/web/src/features/projects/projects.tsx b/apps/web/src/features/projects/projects.tsxindex 1df291da4f..ccf8923d42 100644--- a/apps/web/src/features/projects/projects.tsx+++ b/apps/web/src/features/projects/projects.tsx@@ -14,13 +14,9 @@ import { enableProjects } from '@core/constant/featureFlags';import { useUserId } from '@core/context/user';import { registerActivityRevalidator } from '@queries/activity/push-registry';import { queryClient } from '@queries/client';-import {- getGraphqlSoupCacheHost,- getGraphqlSoupClient,-} from '@service-storage/graphql-soup';+import { getGraphqlSoupClient } from '@service-storage/graphql-soup';import { initiativeClient } from '@service-storage/initiative';import { Button } from '@ui';-import type { Accessor } from 'solid-js';import {createSignal,ErrorBoundary,@@ -66,7 +62,7 @@ function createProjectsContext() {);return createProjectSources(initiativeClient,- { client: getGraphqlSoupClient, cacheHost: getGraphqlSoupCacheHost },+ { client: getGraphqlSoupClient },queryClient,userId,createProjectReadGate@@ -191,7 +187,3 @@ export function ProjectAssignmentDialog(props: {</Projects>);}--export function useTaskProjectReferences(ids: Accessor<readonly string[]>) {- return createProjectsContext().createReferencesSource(ids);-}diff --git a/apps/web/src/features/projects/queries/create-project-task.test.ts b/apps/web/src/features/projects/queries/create-project-task.test.tsdeleted file mode 100644index 93ba2d6c15..0000000000--- a/apps/web/src/features/projects/queries/create-project-task.test.ts+++ /dev/null@@ -1,137 +0,0 @@-import { buildTaskQuery } from '@app/features/tasks-view/queries/task-query';-import { soupKeys } from '@queries/soup/keys';-import { QueryClient } from '@tanstack/solid-query';-import { ok } from 'neverthrow';-import { createRoot } from 'solid-js';-import { afterEach, expect, it, vi } from 'vitest';-import { createProjectTaskMutation } from './create-project-task';-import { projectKeys } from './keys';--const mock = vi.hoisted(() => ({ create: vi.fn(), failure: vi.fn() }));-vi.mock('@block-md/util/taskComposerProperties', () => ({- createTaskWithProperties: mock.create,-}));-vi.mock('@core/component/Toast/Toast', () => ({- toast: { failure: mock.failure },-}));-vi.mock('@service-storage/websocket', () => ({- storageWS: { reconnectIfDisconnected: vi.fn() },- createWebSocketJob: vi.fn(),-}));-vi.mock('@service-connection/websocket', () => ({- ws: { addEventListener: vi.fn(), send: vi.fn() },- state: () => 'closed',- createConnectionBlockWebsocketEffect: vi.fn(),- createConnectionWebsocketEffect: vi.fn(),-}));-afterEach(() => vi.clearAllMocks());--it.each(['saved', 'failed', 'assignment-failed'] as const)(- 'inserts before closing or contacting the server and handles %s',- async (outcome) => {- const cache = new QueryClient();- const detailKey = projectKeys.detail('viewer', 'project').queryKey;- cache.setQueryData(detailKey, { project: { taskIds: [] }, properties: [] });- const args = (taskIds: string[]) =>- buildTaskQuery({- tab: 'team-tasks',- userId: 'viewer',- taskIds,- groupBy: 'none',- facets: {},- sort: [],- });- cache.setQueryData(soupKeys.astItems(args([])).queryKey, {- pages: [{ kind: 'flat', items: [], nextCursor: null }],- pageParams: [null],- });- let complete!: (- result: { documentId: string; initialSnapshot: undefined } | null- ) => void;- mock.create.mockImplementation(- () =>- new Promise((resolve) => {- complete = resolve;- })- );- const assignTasks = vi.fn(async () =>- ok({- results: [- {- taskId: 'saved',- status:- outcome === 'assignment-failed'- ? ('skippedNoPermission' as const)- : ('assigned' as const),- },- ],- })- );- const refresh = vi.fn(async () => {});- let dispose!: () => void;- const create = createRoot((d) => {- dispose = d;- return createProjectTaskMutation(- { assignTasks },- () => undefined,- cache,- () => 'viewer',- refresh- );- });- const onMutate = vi.fn(() => {- const ids = cache.getQueryData<{ project: { taskIds: string[] } }>(- detailKey- )!.project.taskIds;- const data = cache.getQueryData<{- pages: { items: { tag: string; data: { name: string } }[] }[];- }>(soupKeys.astItems(args(ids)).queryKey)!;- expect(data.pages[0].items[0]).toMatchObject({- tag: 'document',- data: { name: 'Created task' },- });- expect(mock.create).not.toHaveBeenCalled();- });- try {- const saving = create(- 'project',- 'Created task',- '',- [],- new Map(),- vi.fn(),- { onMutate, shareWithTeam: false }- );- await vi.waitFor(() => expect(mock.create).toHaveBeenCalledOnce());- expect(mock.create).toHaveBeenCalledWith(- 'Created task',- '',- [],- new Map(),- expect.any(Function),- { revalidateSoup: false, shareWithTeam: false }- );- expect(onMutate).toHaveBeenCalledOnce();- expect(assignTasks).not.toHaveBeenCalled();- complete(- outcome === 'failed'- ? null- : { documentId: 'saved', initialSnapshot: undefined }- );- const result = await saving;- const ids = cache.getQueryData<{ project: { taskIds: string[] } }>(- detailKey- )!.project.taskIds;- expect(ids).toEqual(outcome === 'saved' ? ['saved'] : []);- expect(result?.documentId).toBe(- outcome === 'failed' ? undefined : 'saved'- );- if (outcome === 'assignment-failed')- expect(mock.failure).toHaveBeenCalledOnce();- expect(refresh).toHaveBeenCalledOnce();- } finally {- dispose();- cache.clear();- }- }-);diff --git a/apps/web/src/features/projects/queries/create-project-task.ts b/apps/web/src/features/projects/queries/create-project-task.tsdeleted file mode 100644index 61da1619c6..0000000000--- a/apps/web/src/features/projects/queries/create-project-task.ts+++ /dev/null@@ -1,137 +0,0 @@-import { createTaskWithProperties } from '@block-md/util/taskComposerProperties';-import { toast } from '@core/component/Toast/Toast';-import { throwOnErr } from '@core/util/result';-import type { CacheHost } from '@graphql-cache/host/types';-import type { initiativeClient } from '@service-storage/initiative';-import { type QueryClient, useMutation } from '@tanstack/solid-query';-import type { Accessor } from 'solid-js';-import { projectKeys } from './keys';-import {- optimisticProjectTask,- type ProjectTaskDraft,- updateProjectTaskCache,-} from './project-task-cache';--/** Owns task creation and membership as one optimistic mutation. */-export function createProjectTaskMutation(- client: Pick<typeof initiativeClient, 'assignTasks'>,- cacheHost: () => CacheHost | undefined,- cache: QueryClient,- userId: Accessor<string | undefined>,- refresh: () => Promise<void>-) {- // Cache read/write pairs must stay ordered when Create More submits overlap.- let writes = Promise.resolve();- const update = (...args: Parameters<typeof updateProjectTaskCache>) => {- const next = writes.then(() => updateProjectTaskCache(...args));- writes = next.catch(() => {});- return next;- };- const mutation = useMutation(- () => ({- mutationKey: projectKeys.createTask._def,- onMutate: async (input: {- projectId: string;- draft: ProjectTaskDraft;- id: string;- ownerId: string;- }) => {- const task = optimisticProjectTask(- input.id,- input.ownerId,- input.draft- );- try {- await update(- cache,- cacheHost(),- input.ownerId,- input.projectId,- undefined,- task- );- } finally {- input.draft[5]?.onMutate?.();- }- return { task };- },- mutationFn: async ({- projectId,- draft,- }: {- projectId: string;- draft: ProjectTaskDraft;- id: string;- ownerId: string;- }) => {- const [title, content, properties, definitions, history] = draft;- const result = await createTaskWithProperties(- title,- content,- properties,- definitions,- history,- { revalidateSoup: false, shareWithTeam: draft[5]?.shareWithTeam }- );- if (!result) throw new Error('Task creation failed');- let assigned = false;- try {- const response = await throwOnErr(() =>- client.assignTasks(projectId, { taskIds: [result.documentId] })- );- assigned = response.results.every(- (item) => item.status === 'assigned'- );- } catch {- /* Preserve the saved task if only project assignment failed. */- }- if (!assigned)- toast.failure(- 'Task created, but could not be added to the project. Use Add to project from the task menu to try again.'- );- return { result, assigned };- },- onSuccess: async ({ result, assigned }, input, context) => {- await update(- cache,- cacheHost(),- input.ownerId,- input.projectId,- input.id,- assigned && context- ? { ...context.task, id: result.documentId }- : undefined- );- },- onError: async (_error, input) => {- await update(- cache,- cacheHost(),- input.ownerId,- input.projectId,- input.id- );- },- }),- () => cache- );- return async (projectId: string, ...draft: ProjectTaskDraft) => {- const ownerId = userId();- if (!ownerId) return null;- try {- return (- await mutation.mutateAsync({- projectId,- draft,- ownerId,- id: crypto.randomUUID(),- })- ).result;- } catch {- return null;- } finally {- if (!cache.isMutating({ mutationKey: projectKeys.createTask._def }))- void refresh();- }- };-}diff --git a/apps/web/src/features/projects/queries/keys.ts b/apps/web/src/features/projects/queries/keys.tsindex bfca9ac51e..b0684a1eeb 100644--- a/apps/web/src/features/projects/queries/keys.ts+++ b/apps/web/src/features/projects/queries/keys.ts@@ -1,14 +1,7 @@import { createQueryKeys } from '@lukemorales/query-key-factory';export const projectKeys = createQueryKeys('initiatives', {- createTask: (id: string) => [id],detail: (userId: string | undefined, id: string) => ({queryKey: [userId, id],}),- tasks: (userId: string | undefined, id: string) => ({- queryKey: [userId, id],- }),- taskReferences: (userId: string | undefined, ids: readonly string[]) => ({- queryKey: [userId, [...ids].sort()],- }),});diff --git a/apps/web/src/features/projects/queries/project-identity.ts b/apps/web/src/features/projects/queries/project-identity.tsindex 2109fcbd5b..a9b69e4fd9 100644--- a/apps/web/src/features/projects/queries/project-identity.ts+++ b/apps/web/src/features/projects/queries/project-identity.ts@@ -6,6 +6,7 @@ import {} from '@service-storage/initiative';import { type QueryClient, useQuery } from '@tanstack/solid-query';import type { Accessor } from 'solid-js';+import type { TaskProjectReference } from '../core/project';import { projectKeys } from './keys';import { toProjectDetail } from './project-model';import { projectProperties } from './project-properties';@@ -59,3 +60,22 @@ export function useProjectIdentityQuery(() => queryClient);}++/**+ * A task's project, named only after an authorized project read; a project+ * the viewer cannot read stays unavailable. Undefined while loading.+ */+export function useTaskProjectReference(+ projectId: Accessor<string | undefined>,+ userId: Accessor<string | undefined>+): Accessor<TaskProjectReference | undefined> {+ const project = useProjectIdentityQuery(() => projectId() ?? '', userId);+ return () => {+ if (!projectId()) return { state: 'none' };+ if (project.isError) return { state: 'unavailable' };+ if (project.isPending) return undefined;+ return project.data+ ? { state: 'visible', id: project.data.id, name: project.data.name }+ : { state: 'unavailable' };+ };+}diff --git a/apps/web/src/features/projects/queries/project-sources.test.ts b/apps/web/src/features/projects/queries/project-sources.test.tsnew file mode 100644index 0000000000..2167901d2b--- /dev/null+++ b/apps/web/src/features/projects/queries/project-sources.test.ts@@ -0,0 +1,190 @@+import { SYSTEM_PROPERTY_IDS } from '@property/identifiers';+import { QueryClient } from '@tanstack/solid-query';+import { createRoot } from 'solid-js';+import { afterEach, expect, it, vi } from 'vitest';+import { TASK_PROJECT_PROPERTY } from './task-project';++const mock = vi.hoisted(() => ({+ createTask: vi.fn(),+ saveProperty: vi.fn(),+ taskProperties: vi.fn(),+ toastFailure: vi.fn(),+}));+vi.mock('@service-properties/client', () => ({+ propertiesServiceClient: { getEntityProperties: mock.taskProperties },+}));+vi.mock('@core/component/Toast/Toast', () => ({+ toast: { failure: mock.toastFailure },+}));+vi.mock('@block-md/util/taskComposerProperties', () => ({+ createTaskWithProperties: mock.createTask,+}));+vi.mock('@queries/properties/graphql/entity', () => ({+ createGraphqlBulkSaveEntityPropertiesMutation: () => ({+ isPending: false,+ mutateAsync: mock.saveProperty,+ }),+ refetchGraphqlInitiativeProperties: vi.fn(),+}));+vi.mock('@queries/properties/definitions', () => ({}));+vi.mock('@queries/soup/graphql/active-queries', () => ({+ refreshActiveGraphqlSoupQueries: vi.fn(async () => {}),+}));+vi.mock('./create-project', () => ({ createProjectMutation: () => ({}) }));+vi.mock('./project-soup', () => ({}));+vi.mock('./project-identity', () => ({}));++import { createProjectSources } from './project-sources';++afterEach(() => vi.clearAllMocks());++function commands() {+ const cache = new QueryClient();+ return createRoot((dispose) => {+ const sources = createProjectSources(+ {} as never,+ { client: () => ({}) as never },+ cache,+ () => 'viewer'+ );+ return { commands: sources.createCommands(), dispose };+ });+}++/** The created task's properties as the server reports them. */+function serverProject(projectId: string | undefined) {+ mock.taskProperties.mockResolvedValue({+ isErr: () => false,+ value: {+ properties: projectId+ ? [+ {+ property: {+ id: 'row',+ created_at: '2026-10-03T00:00:00Z',+ updated_at: '2026-10-03T00:00:00Z',+ },+ definition: {+ id: SYSTEM_PROPERTY_IDS.PROJECT,+ owner: { scope: 'system' },+ display_name: 'Project',+ data_type: 'ENTITY',+ is_multi_select: false,+ specific_entity_type: 'INITIATIVE',+ is_system: true,+ created_at: '2026-10-03T00:00:00Z',+ updated_at: '2026-10-03T00:00:00Z',+ },+ value: {+ type: 'EntityReference',+ value: [{ entity_id: projectId, entity_type: 'INITIATIVE' }],+ },+ },+ ]+ : [],+ },+ });+}++it('creates a project task in one call with its Project property', async () => {+ mock.createTask.mockResolvedValue({ documentId: 'task' });+ serverProject('project');+ const { commands: project, dispose } = commands();+ const history = vi.fn();+ await project.createTask(+ 'project',+ 'Ship it',+ '',+ [+ ['status', { valueType: 'SELECT_STRING', values: ['done'] }],+ [+ SYSTEM_PROPERTY_IDS.PROJECT,+ {+ valueType: 'ENTITY',+ refs: [{ entity_id: 'other', entity_type: 'INITIATIVE' }],+ },+ ],+ ],+ new Map(),+ history+ );+ expect(mock.createTask).toHaveBeenCalledWith(+ 'Ship it',+ '',+ [+ ['status', { valueType: 'SELECT_STRING', values: ['done'] }],+ [+ SYSTEM_PROPERTY_IDS.PROJECT,+ {+ valueType: 'ENTITY',+ refs: [{ entity_id: 'project', entity_type: 'INITIATIVE' }],+ },+ ],+ ],+ new Map(),+ history+ );+ expect(mock.toastFailure).not.toHaveBeenCalled();+ dispose();+});++it('says so when a created task could not join the project', async () => {+ mock.createTask.mockResolvedValue({ documentId: 'task' });+ serverProject(undefined);+ const { commands: project, dispose } = commands();+ const created = await project.createTask(+ 'project',+ 'Ship it',+ '',+ [],+ new Map(),+ vi.fn()+ );+ expect(created).toEqual({ documentId: 'task' });+ expect(mock.taskProperties).toHaveBeenCalledWith(+ expect.objectContaining({ entity_type: 'DOCUMENT', entity_id: 'task' })+ );+ expect(mock.toastFailure).toHaveBeenCalledWith(+ expect.stringContaining('could not be added to the project')+ );+ dispose();+});++it('sets and clears each task Project property, reporting failures per task', async () => {+ mock.saveProperty.mockImplementation(+ async ({ properties: [{ entityId }] }) => ({+ error: entityId === 'locked' ? new Error('forbidden') : undefined,+ })+ );+ const { commands: project, dispose } = commands();+ const assigned = await project.assignTasks('project', ['task', 'locked']);+ expect(mock.saveProperty).toHaveBeenCalledWith({+ properties: [+ {+ entityType: 'TASK',+ entityId: 'task',+ property: TASK_PROJECT_PROPERTY,+ apiValues: {+ valueType: 'ENTITY',+ refs: [{ entity_id: 'project', entity_type: 'INITIATIVE' }],+ },+ },+ ],+ });+ expect(assigned.map((result) => [result.taskId, !!result.error])).toEqual([+ ['task', false],+ ['locked', true],+ ]);++ mock.saveProperty.mockClear();+ await project.assignTasks(undefined, ['task']);+ expect(mock.saveProperty).toHaveBeenCalledWith({+ properties: [+ expect.objectContaining({+ entityId: 'task',+ apiValues: { valueType: 'ENTITY', refs: null },+ }),+ ],+ });+ dispose();+});diff --git a/apps/web/src/features/projects/queries/project-sources.ts b/apps/web/src/features/projects/queries/project-sources.tsindex df19dc8b35..b322ff2a32 100644--- a/apps/web/src/features/projects/queries/project-sources.ts+++ b/apps/web/src/features/projects/queries/project-sources.ts@@ -1,5 +1,7 @@+import { createTaskWithProperties } from '@block-md/util/taskComposerProperties';+import { toast } from '@core/component/Toast/Toast';import { thrownResultErrorHasCode, throwOnErr } from '@core/util/result';-import type { CacheHost } from '@graphql-cache/host/types';+import { SYSTEM_PROPERTY_IDS } from '@property/identifiers';import { useListPropertiesQuery } from '@queries/properties/definitions';import {createGraphqlBulkSaveEntityPropertiesMutation,@@ -9,23 +11,21 @@ import { propertiesKeys } from '@queries/properties/keys';import { refreshActiveGraphqlSoupQueries } from '@queries/soup/graphql/active-queries';import { soupKeys } from '@queries/soup/keys';import type { initiativeClient } from '@service-storage/initiative';-import {- type QueryClient,- useIsMutating,- useMutation,- useQuery,-} from '@tanstack/solid-query';+import { type QueryClient, useMutation, useQuery } from '@tanstack/solid-query';import type { Client } from '@urql/core';import type { Accessor } from 'solid-js';import type { ProjectsContext } from '../context/projects-context';import { assignProjectTasks } from '../core/assignment';-import type { ProjectDetail, TaskProjectReference } from '../core/project';import { createProjectMutation } from './create-project';-import { createProjectTaskMutation } from './create-project-task';import { projectKeys } from './keys';import { projectDetailQueryOptions } from './project-identity';import { projectDefinitionProperties } from './project-properties';import { createProjectSoupSource } from './project-soup';+import {+ TASK_PROJECT_PROPERTY,+ taskIsInProject,+ taskProjectValue,+} from './task-project';type ProjectCommands = ReturnType<ProjectsContext['createCommands']>;@@ -34,10 +34,9 @@ const accessLost = (error: unknown) =>thrownResultErrorHasCode(error, code));-/** GraphQL Soup lists projects and holds the optimistic rows of their tasks. */+/** GraphQL Soup lists projects. */export type ProjectSoupTransport = {client(): Client;- cacheHost(): CacheHost | undefined;};/** Transport and cache mechanics stay outside the feature's reactive consumers. */@@ -80,17 +79,12 @@ export function createProjectSources(},createProjectSource(id) {const readEnabled = createReadGate();- const creating = useIsMutating(- () => ({ mutationKey: projectKeys.createTask._def }),- () => cache- );const query = useQuery(() => {const projectId = id();return {...projectDetailQueryOptions(client, userId(), projectId),- enabled:- readEnabled() && Boolean(userId() && projectId) && !creating(),+ enabled: readEnabled() && Boolean(userId() && projectId),};},() => cache@@ -112,94 +106,35 @@ export function createProjectSources(},};},- createReferencesSource(ids) {- const readEnabled = createReadGate();- const creating = useIsMutating(- () => ({ mutationKey: projectKeys.createTask._def }),- () => cache- );- const query = useQuery(- () => {- const taskIds = [...new Set(ids())].sort();- return {- queryKey: projectKeys.taskReferences(userId(), taskIds).queryKey,- enabled:- readEnabled() &&- Boolean(userId() && taskIds.length) &&- !creating(),- initialData: () => {- if (!creating()) return undefined;- const projects = cache.getQueriesData<{- project: ProjectDetail;- }>({ queryKey: projectKeys.detail._def });- const references = new Map<string, TaskProjectReference>();- for (const taskId of taskIds) {- const project = projects.find(([, data]) =>- data?.project.taskIds.includes(taskId)- )?.[1]?.project;- if (!project) return undefined;- references.set(taskId, {- state: 'visible',- id: project.id,- name: project.name,- });- }- return references;- },- initialDataUpdatedAt: 0,- placeholderData: (previous) => previous,- queryFn: async ({ signal }) => {- const references = new Map<string, TaskProjectReference>();- for (let offset = 0; offset < taskIds.length; offset += 100) {- const page = await throwOnErr(() =>- client.taskReferences(- taskIds.slice(offset, offset + 100),- signal- )- );- for (const reference of page.references) {- references.set(- reference.taskId,- reference.state === 'visible' && reference.initiative- ? { state: 'visible', ...reference.initiative }- : {- state:- reference.state === 'none' ? 'none' : 'unavailable',- }- );- }- }- return references;- },- staleTime: 30_000,- refetchInterval: 30_000,- refetchOnWindowFocus: true,- };- },- () => cache- );- return {- references: () =>- !readEnabled() || query.isPending || accessLost(query.error)- ? new Map()- : (query.data ?? new Map()),- loading: () => readEnabled() && query.isPending,- error: () => (readEnabled() ? (query.error ?? undefined) : undefined),- };- },createCommands() {- const createTask = createProjectTaskMutation(- client,- soup.cacheHost,- cache,- userId,- async () => {- await Promise.all([- refresh(),- cache.invalidateQueries({ queryKey: soupKeys._def }),- ]);- }- );+ // A task joins a project through its Project property, set at creation.+ // Creation keeps the task when a property is rejected, so confirm the+ // join and say when it didn't happen.+ const createTask: ProjectCommands['createTask'] = async (+ projectId,+ title,+ content,+ properties,+ ...rest+ ) => {+ const created = await createTaskWithProperties(+ title,+ content,+ [+ ...properties.filter(([id]) => id !== SYSTEM_PROPERTY_IDS.PROJECT),+ [SYSTEM_PROPERTY_IDS.PROJECT, taskProjectValue(projectId)],+ ],+ ...rest+ );+ if (+ created &&+ (await taskIsInProject(created.documentId, projectId)) === false+ )+ toast.failure(+ 'Task created, but could not be added to the project. Use Add to project from the task menu to try again.'+ );+ return created;+ };const create = createProjectMutation(client, cache, userId);const update = useMutation(() => ({@@ -255,45 +190,45 @@ export function createProjectSources(]);},});+ const taskProject = createGraphqlBulkSaveEntityPropertiesMutation();const assign = useMutation(() => ({- mutationFn: async ({+ mutationFn: ({projectId,taskIds,}: {projectId?: string;taskIds: readonly string[];- }) => {- return assignProjectTasks(- {- assign: async (projectId, batch) => {- const response = await throwOnErr(() =>- client.assignTasks(projectId, { taskIds: batch })- );- return response.results.map((result) => ({- taskId: result.taskId,- error:- result.status === 'notATask'- ? 'This item is not a task.'- : result.status === 'notFound'- ? 'Task no longer exists.'- : result.status === 'skippedNoPermission'- ? 'You need edit access to this task.'- : undefined,- }));- },- clear: async (taskId) => {- await throwOnErr(() => client.removeTask(taskId));- },+ }) =>+ assignProjectTasks(+ async (taskId, projectId) => {+ const result = await taskProject.mutateAsync({+ properties: [+ {+ entityType: 'TASK',+ entityId: taskId,+ property: TASK_PROJECT_PROPERTY,+ apiValues: taskProjectValue(projectId),+ },+ ],+ });+ if (result.error) throw result.error;},projectId,taskIds- );- },- onSettled: async () => {+ ),+ onSettled: async (_results, _error, { taskIds }) => {await Promise.all([refresh(),cache.invalidateQueries({ queryKey: soupKeys._def }),+ ...taskIds.map((entityId) =>+ cache.invalidateQueries({+ queryKey: propertiesKeys.entity({+ entityType: 'TASK',+ entityId,+ }).queryKey,+ })+ ),]);},}),diff --git a/apps/web/src/features/projects/queries/project-task-cache.test.ts b/apps/web/src/features/projects/queries/project-task-cache.test.tsdeleted file mode 100644index 930245b89a..0000000000--- a/apps/web/src/features/projects/queries/project-task-cache.test.ts+++ /dev/null@@ -1,334 +0,0 @@-import { buildTaskQuery } from '@app/features/tasks-view/queries/task-query';-import { soupKeys } from '@queries/soup/keys';-import { QueryClient } from '@tanstack/solid-query';-import { expect, it, vi } from 'vitest';-import { projectKeys } from './keys';-import {- optimisticProjectTask,- updateProjectTaskCache,-} from './project-task-cache';--const args = (taskIds: string[]) =>- buildTaskQuery({- tab: 'team-tasks',- userId: 'viewer',- facets: {},- groupBy: 'none',- sort: [],- taskIds,- });-it('inserts a normal task into the next membership query before any network response', async () => {- const cache = new QueryClient();- cache.setQueryData(projectKeys.detail('viewer', 'project').queryKey, {- project: { taskIds: [] },- properties: [],- });- cache.setQueryData(soupKeys.astItems(args([])).queryKey, {- pages: [{ kind: 'flat', items: [], nextCursor: null }],- pageParams: [null],- });- const task = optimisticProjectTask('temporary', 'viewer', [- 'New task',- '',- [],- new Map(),- vi.fn(),- ]);- await updateProjectTaskCache(- cache,- undefined,- 'viewer',- 'project',- undefined,- task- );- expect(- cache.getQueryData(projectKeys.detail('viewer', 'project').queryKey)- ).toMatchObject({ project: { taskIds: ['temporary'] } });- expect(- cache.getQueryData(soupKeys.astItems(args(['temporary'])).queryKey)- ).toMatchObject({- pages: [- {- kind: 'flat',- items: [- { tag: 'document', data: { id: 'temporary', name: 'New task' } },- ],- },- ],- });-});--vi.mock('@service-storage/websocket', () => ({- storageWS: { reconnectIfDisconnected: vi.fn() },- createWebSocketJob: vi.fn(),-}));-vi.mock('@service-connection/websocket', () => ({- ws: { addEventListener: vi.fn(), send: vi.fn() },- state: () => 'closed',- createConnectionBlockWebsocketEffect: vi.fn(),- createConnectionWebsocketEffect: vi.fn(),-}));--it('replaces IDs without duplicating the task and rolls back only a failed concurrent insert', async () => {- const cache = new QueryClient();- cache.setQueryData(projectKeys.detail('viewer', 'project').queryKey, {- project: { taskIds: [] },- properties: [],- });- cache.setQueryData(soupKeys.astItems(args([])).queryKey, {- pages: [{ kind: 'flat', items: [], nextCursor: null }],- pageParams: [null],- });- const first = optimisticProjectTask('first', 'viewer', [- 'First',- '',- [],- new Map(),- vi.fn(),- ]);- const second = optimisticProjectTask('second', 'viewer', [- 'Second',- '',- [],- new Map(),- vi.fn(),- ]);- await updateProjectTaskCache(- cache,- undefined,- 'viewer',- 'project',- undefined,- first- );- await updateProjectTaskCache(- cache,- undefined,- 'viewer',- 'project',- undefined,- second- );- await updateProjectTaskCache(cache, undefined, 'viewer', 'project', 'first', {- ...first,- id: 'saved',- });- await updateProjectTaskCache(cache, undefined, 'viewer', 'project', 'second');- expect(- cache.getQueryData(projectKeys.detail('viewer', 'project').queryKey)- ).toMatchObject({ project: { taskIds: ['saved'] } });- expect(- cache.getQueryData(soupKeys.astItems(args(['saved'])).queryKey)- ).toMatchObject({- pages: [{ items: [{ data: { id: 'saved', name: 'First' } }] }],- });- expect(- (- cache.getQueryData(soupKeys.astItems(args(['saved'])).queryKey) as {- pages: { items: unknown[] }[];- }- ).pages[0].items- ).toHaveLength(1);-});--import type {- CacheHost,- CacheReadArgs,- CacheWriteArgs,-} from '@graphql-cache/host/types';-import {- makeGraphqlGroupedSoupInput,- makeGraphqlSoupInput,-} from '@queries/soup/graphql/ast';-import type {- GroupSoupQuery,- SoupQuery,-} from '@service-storage/graphql/generated/graphql';-import { hashKey } from '@tanstack/solid-query';--it.each(['none', 'status'] as const)(- 'writes %s GraphQL query data with REST disabled, preserving grouping and rollback',- async (groupBy) => {- const cache = new QueryClient();- const queryArgs = (ids: string[]) => ({- ...args(ids),- groupBy:- groupBy === 'status'- ? { type: 'property' as const, propertyDefinitionId: 'status' }- : undefined,- });- const input = (ids: string[]) =>- groupBy === 'status'- ? makeGraphqlGroupedSoupInput({- ...queryArgs(ids),- groupBy: queryArgs(ids).groupBy!,- })- : makeGraphqlSoupInput(queryArgs(ids));- // GraphQL views still register the disabled REST observer, but have no REST data.- cache- .getQueryCache()- .build(cache, { queryKey: soupKeys.astItems(queryArgs([])).queryKey });- cache.setQueryData(projectKeys.detail('viewer', 'project').queryKey, {- project: { taskIds: [] },- properties: [],- });- const data = new Map<string, unknown>();- data.set(- hashKey([input([])]),- groupBy === 'status'- ? { user: { id: 'viewer', groupSoup: { bins: [] } } }- : {- user: {- id: 'viewer',- soup: { items: [], nextCursor: null },- emailLinks: [],- },- }- );- const host: Pick<CacheHost, 'readQuery' | 'writeQuery' | 'deleteRecords'> =- {- readQuery: vi.fn(async ({ variables }: CacheReadArgs) =>- data.has(hashKey([variables?.input]))- ? {- kind: 'hit' as const,- data: data.get(hashKey([variables?.input])),- }- : { kind: 'miss' as const }- ),- writeQuery: vi.fn(async ({ variables, data: next }: CacheWriteArgs) => {- data.set(hashKey([variables?.input]), next);- return {- revision: 'test' as import('@graphql-cache/protocol').CacheRevision,- revisionAdvanced: true,- changed: [],- affectedOps: [],- reset: false,- };- }),- deleteRecords: vi.fn(async () => ({- revision: 'test' as import('@graphql-cache/protocol').CacheRevision,- affectedOps: [],- })),- };- const task = optimisticProjectTask('temporary', 'viewer', [- 'GraphQL task',- '',- [],- new Map(),- vi.fn(),- ]);- await updateProjectTaskCache(- cache,- host,- 'viewer',- 'project',- undefined,- task- );- const inserted = data.get(- hashKey([input(['temporary'])])- ) as GroupSoupQuery & SoupQuery;- const items =- groupBy === 'status'- ? inserted.user.groupSoup.bins[0].items- : inserted.user.soup.items;- expect(items).toEqual([task]);- if (groupBy === 'status')- expect(inserted.user.groupSoup.bins[0].totalCount).toBe(1);- // Mirrors the observer switching to its seeded key.- cache.getQueryCache().build(cache, {- queryKey: soupKeys.astItems(queryArgs(['temporary'])).queryKey,- });- await updateProjectTaskCache(cache, host, 'viewer', 'project', 'temporary');- const rolledBack = data.get(hashKey([input([])])) as GroupSoupQuery &- SoupQuery;- expect(- groupBy === 'status'- ? rolledBack.user.groupSoup.bins.flatMap((bin) => bin.items)- : rolledBack.user.soup.items- ).toEqual([]);- expect(host.deleteRecords).toHaveBeenCalledWith([- 'GraphqlSoupDocument:temporary',- ]);- }-);--it.each(['status', 'assignee', 'date'] as const)(- 'creates a normal %s group in a cold REST query',- async (groupBy) => {- const cache = new QueryClient();- const queryArgs = (taskIds: string[]) =>- buildTaskQuery({- tab: 'team-tasks',- userId: 'viewer',- facets: {},- sort: [],- groupBy,- taskIds,- });- cache.setQueryData(projectKeys.detail('viewer', 'project').queryKey, {- project: { taskIds: [] },- properties: [],- });- cache- .getQueryCache()- .build(cache, { queryKey: soupKeys.astItems(queryArgs([])).queryKey });- const task = optimisticProjectTask('temporary', 'viewer', [- 'New task',- '',- [],- new Map(),- vi.fn(),- ]);- await updateProjectTaskCache(- cache,- undefined,- 'viewer',- 'project',- undefined,- task- );- expect(- cache.getQueryData(soupKeys.astItems(queryArgs(['temporary'])).queryKey)- ).toMatchObject({- pages: [- {- kind: 'grouped',- groups: [{ totalCount: 1, itemIds: ['temporary'] }],- items: { temporary: { tag: 'document', data: { id: 'temporary' } } },- },- ],- });- }-);--it('does not put an optimistic task into a query excluded by its active filters', async () => {- const cache = new QueryClient();- cache.setQueryData(projectKeys.detail('viewer', 'project').queryKey, {- project: { taskIds: [] },- properties: [],- });- cache.getQueryCache().build(cache, {- queryKey: soupKeys.astItems(args([])).queryKey,- meta: { insertFilter: () => false },- });- const task = optimisticProjectTask('temporary', 'viewer', [- 'Filtered task',- '',- [],- new Map(),- vi.fn(),- ]);- await updateProjectTaskCache(- cache,- undefined,- 'viewer',- 'project',- undefined,- task- );- expect(- cache.getQueryData(soupKeys.astItems(args(['temporary'])).queryKey)- ).toMatchObject({ pages: [{ kind: 'flat', items: [] }] });-});diff --git a/apps/web/src/features/projects/queries/project-task-cache.ts b/apps/web/src/features/projects/queries/project-task-cache.tsdeleted file mode 100644index b2e434cbea..0000000000--- a/apps/web/src/features/projects/queries/project-task-cache.ts+++ /dev/null@@ -1,375 +0,0 @@-import { taskMembershipScope } from '@app/features/tasks-view/queries/task-membership';-import type { createTaskWithProperties } from '@block-md/util/taskComposerProperties';-import type { CacheHost } from '@graphql-cache/host/types';-import type { Property } from '@property/types';-import { apiValuesToGraphqlPropertyValue } from '@queries/properties/graphql-optimistic';-import {- makeGraphqlGroupedSoupInput,- makeGraphqlSoupInput,-} from '@queries/soup/graphql/ast';-import { computeGroupKeysForItem } from '@queries/soup/grouped/api';-import type {- SoupAstItemsPage,- SoupAstItemsQueryArgs,-} from '@queries/soup/items';-import { soupKeys } from '@queries/soup/keys';-import {- insertGroupedPage,- removeGroupedPage,-} from '@queries/soup/normalized-cache/grouped-operations';-import {- GroupSoupDocument,- type GroupSoupQuery,- SoupDocument,- type SoupItemFieldsFragment,- type SoupQuery,-} from '@service-storage/graphql/generated/graphql';-import { mapGraphqlSoupItem } from '@service-storage/graphql-soup';-import {- hashKey,- type InfiniteData,- type QueryClient,-} from '@tanstack/solid-query';-import { stringifyDocument } from '@urql/core';-import type { ProjectDetail } from '../core/project';-import { projectKeys } from './keys';--export type ProjectTaskDraft = Parameters<typeof createTaskWithProperties>;-type TaskRecord = Extract<- SoupItemFieldsFragment,- { __typename: 'GraphqlSoupDocument' }->;-type DetailData = { project: ProjectDetail; properties: Property[] };--/** The same complete task record is written to either Soup transport's cache. */-export function optimisticProjectTask(- id: string,- ownerId: string,- [title, , values, definitions]: ProjectTaskDraft-): TaskRecord {- const now = new Date().toISOString();- return {- __typename: 'GraphqlSoupDocument',- id,- entityType: 'DOCUMENT',- documentName: title,- displayName: title,- ownerId,- fileType: 'md',- createdAt: now,- updatedAt: now,- viewedAt: null,- deletedAt: null,- projectId: null,- cacheProjection: null,- frecencyScore: 0,- isFavorited: false,- notifications: [],- subType: { __typename: 'GraphqlTaskSubType', isCompleted: false },- properties: values.flatMap(([definitionId, value]) => {- const definition = definitions.get(definitionId);- if (!definition) return [];- const metadata =- 'data_type' in definition- ? {- displayName: definition.display_name,- dataType: definition.data_type,- isMultiSelect: definition.is_multi_select,- isSystem: definition.is_system,- isMetadata: definition.is_metadata,- specificEntityType: definition.specific_entity_type ?? null,- }- : {- displayName: definition.displayName,- dataType: definition.dataType,- isMultiSelect: definition.isMultiSelect,- isSystem: definition.isSystem,- isMetadata: definition.isMetadata,- specificEntityType: definition.specificEntityType ?? null,- };- return [- {- id: `${id}:${definitionId}`,- propertyDefinitionId: definitionId,- ...metadata,- value: apiValuesToGraphqlPropertyValue(value),- },- ];- }),- };-}--/** Seed the next membership query before publishing its task IDs to readers. */-export async function updateProjectTaskCache(- cache: QueryClient,- host:- | Pick<CacheHost, 'disabled' | 'readQuery' | 'writeQuery' | 'deleteRecords'>- | undefined,- userId: string,- projectId: string,- removeId?: string,- task?: TaskRecord-) {- const detailKey = projectKeys.detail(userId, projectId).queryKey;- await cache.cancelQueries({ queryKey: detailKey, exact: true });- const detail = cache.getQueryData<DetailData>(detailKey);- if (!detail) return;- const previousIds = detail.project.taskIds;- const nextIds = [- ...new Set([- ...previousIds.filter((id) => id !== removeId),- ...(task ? [task.id] : []),- ]),- ];- const previousScope = hashKey([taskMembershipScope(previousIds)]);- const candidate = task ? mapGraphqlSoupItem(task) : undefined;- const removeIds = new Set(removeId ? [removeId] : []);- const queries = cache- .getQueryCache()- .findAll({ queryKey: soupKeys.astItems._def });- for (const query of queries) {- const [, , params, body, groupBy, transport] = query.queryKey as ReturnType<- typeof soupKeys.astItems- >['queryKey'];- const df = body.df as ReturnType<typeof taskMembershipScope> | undefined;- if (!df || !('&' in df) || hashKey([df['&'][1]]) !== previousScope)- continue;- const insertFilter = query.meta?.insertFilter;- const item =- candidate &&- (typeof insertFilter !== 'function' || insertFilter(candidate))- ? candidate- : undefined;- const targetGroups = item- ? groupBy?.type === 'date'- ? ['today']- : (computeGroupKeysForItem(item, groupBy) ?? [])- : [];- const previousArgs = { params, body, groupBy, transport };- const nextArgs: SoupAstItemsQueryArgs = {- ...previousArgs,- body: {- ...body,- df: { '&': [df['&'][0], taskMembershipScope(nextIds)] },- },- };- await cache.cancelQueries({ queryKey: query.queryKey, exact: true });- const previous = cache.getQueryData<InfiniteData<SoupAstItemsPage>>(- query.queryKey- ) ?? {- pageParams: [null],- pages: [- groupBy- ? {- kind: 'grouped' as const,- items: {},- groups: [],- nextCursor: null,- }- : { kind: 'flat' as const, items: [], nextCursor: null },- ],- };- if (previous) {- const next: InfiniteData<SoupAstItemsPage> = {- ...previous,- pages: previous.pages.map((page, index) => {- if (page.kind === 'flat')- return {- ...page,- items: [- ...(index === 0 && item ? [item] : []),- ...page.items.filter(- (row) =>- row.tag !== 'document' ||- (!removeIds.has(row.data.id) && row.data.id !== task?.id)- ),- ],- };- const remaining = removeGroupedPage(page, removeIds);- if (index !== 0 || !item || !task) return remaining;- const inserted = insertGroupedPage(remaining, item, task.id, groupBy);- if (inserted) return inserted;- // New tasks have a known creation/update date. Assignee labels are- // resolved by the standard task group header from the group key.- const groups = remaining.groups.map((group) =>- targetGroups.includes(group.key) && !group.itemIds.includes(task.id)- ? {- ...group,- itemIds: [task.id, ...group.itemIds],- totalCount: group.totalCount + 1,- }- : group- );- for (const key of targetGroups) {- if (!groups.some((group) => group.key === key))- groups.push({- key,- label: groupBy?.type === 'date' ? 'Today' : key,- displayOrder: null,- itemIds: [task.id],- totalCount: 1,- nextCursor: null,- });- }- return {- ...remaining,- items: { ...remaining.items, [task.id]: item },- groups,- };- }),- };- cache.setQueryData(query.queryKey, next);- cache.setQueryData(soupKeys.astItems(nextArgs).queryKey, next);- }- if (!host || host.disabled) continue;- if (groupBy) {- const queryText = stringifyDocument(GroupSoupDocument);- const oldInput = makeGraphqlGroupedSoupInput({- ...previousArgs,- groupBy,- });- const input = makeGraphqlGroupedSoupInput({ ...nextArgs, groupBy });- const read = await host.readQuery({- query: queryText,- operationName: 'GroupSoup',- variables: { input: oldInput },- priority: 'user-visible',- });- const data: GroupSoupQuery =- read.kind === 'hit'- ? (read.data as GroupSoupQuery)- : { user: { id: userId, groupSoup: { bins: [] } } };- const bins = data.user.groupSoup.bins.map((bin) => {- const items = bin.items.filter(- (row) => !removeIds.has(row.id) && row.id !== task?.id- );- return {- ...bin,- items,- totalCount: Math.max(- 0,- bin.totalCount - (bin.items.length - items.length)- ),- };- });- for (const key of targetGroups) {- const bin = bins.find((bin) => bin.key === key);- if (bin) {- bin.items = [task!, ...bin.items];- bin.totalCount += 1;- } else- bins.unshift({- key,- items: [task!],- totalCount: 1,- nextCursor: null,- });- }- // Keep the old ID readable until observers switch to the seeded new key.- // The membership filter admits only one of these IDs at either point.- const previousBins = data.user.groupSoup.bins.map((bin) => ({- ...bin,- items: [...bin.items],- }));- for (const key of targetGroups) {- const bin = previousBins.find((bin) => bin.key === key);- if (bin && !bin.items.some((row) => row.id === task!.id)) {- bin.items.unshift(task!);- bin.totalCount++;- } else if (!bin)- previousBins.unshift({- key,- items: [task!],- totalCount: 1,- nextCursor: null,- });- }- await host.writeQuery({- query: queryText,- operationName: 'GroupSoup',- variables: { input: oldInput },- data: {- ...data,- user: { ...data.user, groupSoup: { bins: previousBins } },- } satisfies GroupSoupQuery,- });- await host.writeQuery({- query: queryText,- operationName: 'GroupSoup',- variables: { input },- data: {- ...data,- user: { ...data.user, groupSoup: { ...data.user.groupSoup, bins } },- } satisfies GroupSoupQuery,- });- } else {- const queryText = stringifyDocument(SoupDocument);- const read = await host.readQuery({- query: queryText,- operationName: 'Soup',- variables: { input: makeGraphqlSoupInput(previousArgs) },- priority: 'user-visible',- });- const data: SoupQuery =- read.kind === 'hit'- ? (read.data as SoupQuery)- : {- user: {- id: userId,- emailLinks: [],- soup: { items: [], nextCursor: null },- },- };- await host.writeQuery({- query: queryText,- operationName: 'Soup',- variables: { input: makeGraphqlSoupInput(previousArgs) },- data: {- ...data,- user: {- ...data.user,- soup: {- ...data.user.soup,- items: [- ...(item && task ? [task] : []),- ...data.user.soup.items.filter((row) => row.id !== task?.id),- ],- },- },- } satisfies SoupQuery,- });-- await host.writeQuery({- query: queryText,- operationName: 'Soup',- variables: { input: makeGraphqlSoupInput(nextArgs) },- data: {- ...data,- user: {- ...data.user,- soup: {- ...data.user.soup,- items: [- ...(item && task ? [task] : []),- ...data.user.soup.items.filter(- (row) => !removeIds.has(row.id) && row.id !== task?.id- ),- ],- },- },- } satisfies SoupQuery,- });- }- }- // Lists no longer hold the optimistic record, but Quick Access would.- if (removeId && host && !host.disabled)- await host.deleteRecords([`GraphqlSoupDocument:${removeId}`]);- cache.setQueryData<DetailData>(detailKey, (current) =>- current- ? {- ...current,- project: { ...current.project, taskIds: nextIds },- }- : current- );-}diff --git a/apps/web/src/features/projects/queries/project-tasks.test.ts b/apps/web/src/features/projects/queries/project-tasks.test.tsindex 85ea9dee29..0fb767e159 100644--- a/apps/web/src/features/projects/queries/project-tasks.test.ts+++ b/apps/web/src/features/projects/queries/project-tasks.test.ts@@ -1,4 +1,5 @@import type { UseTasksDataSourceOptions } from '@app/features/tasks-view/queries/use-tasks-query';+import { SYSTEM_PROPERTY_IDS } from '@property/identifiers';import { createRoot, createSignal } from 'solid-js';import { expect, it, vi } from 'vitest';import type { ProjectDetail } from '../core/project';@@ -25,22 +26,22 @@ vi.mock('@app/features/tasks-view/queries/use-tasks-query', () => ({},}));-it('uses complete current membership and disables the shared source immediately on access loss', async () => {+it('scopes tasks to the Project property and disables the shared source immediately on access loss', async () => {await new Promise<void>((resolve, reject) =>createRoot((dispose) => {- const ids = Array.from({ length: 150 }, (_, index) => `task-${index}`);const [project, setProject] = createSignal<ProjectDetail | undefined>({id: 'project',name: 'Launch',ownerId: 'owner',memberIds: [],- taskIds: ids,+ taskIds: [],access: 'view',createdAt: '',updatedAt: '',});const refresh = vi.fn(async () => {});const source = createProjectTasksDataSource(+ 'project',{project,properties: () => [],@@ -62,10 +63,12 @@ it('uses complete current membership and disables the shared source immediatelyisGroupExpanded: () => true,});- expect(mock.options?.taskIds?.()).toEqual(ids);+ expect(mock.options?.reference?.()).toEqual({+ propertyDefinitionId: SYSTEM_PROPERTY_IDS.PROJECT,+ entityId: 'project',+ });expect(mock.options?.enabled?.()).toBe(true);setProject(undefined);- expect(mock.options?.taskIds?.()).toEqual([]);expect(mock.options?.enabled?.()).toBe(false);source.refresh()diff --git a/apps/web/src/features/projects/queries/project-tasks.ts b/apps/web/src/features/projects/queries/project-tasks.tsindex dc0c4bd6eb..039c67d263 100644--- a/apps/web/src/features/projects/queries/project-tasks.ts+++ b/apps/web/src/features/projects/queries/project-tasks.ts@@ -4,17 +4,25 @@ import {type UseTasksDataSourceOptions,useTasksDataSource,} from '@app/features/tasks-view/queries/use-tasks-query';+import { SYSTEM_PROPERTY_IDS } from '@property/identifiers';import type { ProjectSource } from '../context/projects-context';-/** The standard Tasks source scoped to complete, currently authorized membership. */+/**+ * The standard Tasks source scoped to tasks whose Project property names the+ * project, enabled only while the project itself is readable.+ */export function createProjectTasksDataSource(+ projectId: string,project: ProjectSource,state: TasksDataSourceInput,options: UseTasksDataSourceOptions): TasksDataSource {const source = useTasksDataSource(state, {...options,- taskIds: () => project.project()?.taskIds ?? [],+ reference: () => ({+ propertyDefinitionId: SYSTEM_PROPERTY_IDS.PROJECT,+ entityId: projectId,+ }),enabled: () => Boolean(project.project()),});return {diff --git a/apps/web/src/features/projects/queries/task-project.test.ts b/apps/web/src/features/projects/queries/task-project.test.tsnew file mode 100644index 0000000000..e0e67a12f5--- /dev/null+++ b/apps/web/src/features/projects/queries/task-project.test.ts@@ -0,0 +1,27 @@+import { SYSTEM_PROPERTY_IDS } from '@property/identifiers';+import type { Property } from '@property/types';+import { describe, expect, it } from 'vitest';+import { taskProjectId, taskProjectValue } from './task-project';++describe('task Project property', () => {+ it('builds the value naming a project, or clearing it', () => {+ expect(taskProjectValue('initiative')).toEqual({+ valueType: 'ENTITY',+ refs: [{ entity_id: 'initiative', entity_type: 'INITIATIVE' }],+ });+ expect(taskProjectValue()).toEqual({ valueType: 'ENTITY', refs: null });+ });++ it("reads the project a task's properties name", () => {+ const project = {+ propertyDefinitionId: SYSTEM_PROPERTY_IDS.PROJECT,+ valueType: 'ENTITY',+ value: [{ entity_id: 'initiative', entity_type: 'INITIATIVE' }],+ } as Property;+ expect(taskProjectId([project])).toBe('initiative');+ expect(taskProjectId([{ ...project, value: null } as Property])).toBe(+ undefined+ );+ expect(taskProjectId([])).toBe(undefined);+ });+});diff --git a/apps/web/src/features/projects/queries/task-project.ts b/apps/web/src/features/projects/queries/task-project.tsnew file mode 100644index 0000000000..a5785bddd6--- /dev/null+++ b/apps/web/src/features/projects/queries/task-project.ts@@ -0,0 +1,67 @@+import { entityPropertyFromApi } from '@property/api/converters';+import { SYSTEM_PROPERTY_IDS } from '@property/identifiers';+import type {+ Property,+ PropertyApiValues,+ PropertyDefinitionDomain,+} from '@property/types';+import { propertiesServiceClient } from '@service-properties/client';++/** A task's project is its Project system property: one project reference. */+export const TASK_PROJECT_PROPERTY: PropertyDefinitionDomain = {+ id: SYSTEM_PROPERTY_IDS.PROJECT,+ displayName: 'Project',+ valueType: 'ENTITY',+ isMultiSelect: false,+ isMetadata: false,+ isSystem: true,+ owner: { scope: 'system' },+ specificEntityType: 'INITIATIVE',+ createdAt: new Date(0),+ updatedAt: new Date(0),+};++/** The Project property value naming `projectId`, or clearing it. */+export const taskProjectValue = (projectId?: string): PropertyApiValues => ({+ valueType: 'ENTITY',+ refs: projectId+ ? [{ entity_id: projectId, entity_type: 'INITIATIVE' }]+ : null,+});++/** The project a task's properties name, if any. */+export function taskProjectId(+ properties: readonly Property[]+): string | undefined {+ const property = properties.find(+ (property) => property.propertyDefinitionId === SYSTEM_PROPERTY_IDS.PROJECT+ );+ if (property?.valueType !== 'ENTITY') return undefined;+ return property.value?.find(+ (reference) => reference.entity_type === 'INITIATIVE'+ )?.entity_id;+}++/**+ * Whether the server has `taskId` in `projectId`, from its Project property;+ * undefined when the properties can't be read.+ */+export async function taskIsInProject(+ taskId: string,+ projectId: string+): Promise<boolean | undefined> {+ const result = await propertiesServiceClient.getEntityProperties({+ entity_type: 'DOCUMENT',+ entity_id: taskId,+ query: {},+ });+ if (result.isErr()) return undefined;+ const properties = result.value.properties.flatMap((property) => {+ try {+ return [entityPropertyFromApi(property)];+ } catch {+ return [];+ }+ });+ return taskProjectId(properties) === projectId;+}diff --git a/apps/web/src/features/projects/task-project-property.tsx b/apps/web/src/features/projects/task-project-property.tsxindex 13652e8cc6..5bccfa8a98 100644--- a/apps/web/src/features/projects/task-project-property.tsx+++ b/apps/web/src/features/projects/task-project-property.tsx@@ -1,3 +1,4 @@+import { useUserId } from '@core/context/user';import { Projects } from './projects';import { TaskProjectProperty as TaskProjectPropertyContent } from './views/task-project-property';@@ -7,7 +8,7 @@ export function TaskProjectProperty(props: {}) {return (<Projects>- <TaskProjectPropertyContent {...props} />+ <TaskProjectPropertyContent {...props} userId={useUserId()} /></Projects>);}diff --git a/apps/web/src/features/projects/views/create-project.test.tsx b/apps/web/src/features/projects/views/create-project.test.tsxindex c1c466550e..47bd91a09d 100644--- a/apps/web/src/features/projects/views/create-project.test.tsx+++ b/apps/web/src/features/projects/views/create-project.test.tsx@@ -100,7 +100,6 @@ function setup(userId: () => 'owner',createCollectionSource: unused,createProjectSource: unused,- createReferencesSource: unused,createPropertyDefinitionsSource: () => ({properties: () => [dueDate],loading: () => false,diff --git a/apps/web/src/features/projects/views/project-tasks-list.tsx b/apps/web/src/features/projects/views/project-tasks-list.tsxindex bc36360cf9..b0d82e8a0a 100644--- a/apps/web/src/features/projects/views/project-tasks-list.tsx+++ b/apps/web/src/features/projects/views/project-tasks-list.tsx@@ -6,11 +6,9 @@ import {type TasksViewProviderProps,useTasksView,} from '@app/features/tasks-view/tasks-view-context';-import { useIsMutating } from '@tanstack/solid-query';import { Button } from '@ui';import { type ParentProps, Show } from 'solid-js';import { useProjectsContext } from '../context/projects-context';-import { projectKeys } from '../queries/keys';import { createProjectTasksDataSource } from '../queries/project-tasks';export type ProjectTasksProviderProps = ParentProps<{@@ -29,9 +27,6 @@ export type ProjectTasksListProps = Omit</** Embeds the actual Tasks list, including its controllers, menus and row editors. */export function ProjectTasksProvider(props: ProjectTasksProviderProps) {const context = useProjectsContext();- const creating = useIsMutating(() => ({- mutationKey: projectKeys.createTask._def,- }));return (<Show when={props.projectId} keyed>{(projectId) => (@@ -43,9 +38,10 @@ export function ProjectTasksProvider(props: ProjectTasksProviderProps) {onCloseTask={() => {}}sourceFactory={(state, options) =>createProjectTasksDataSource(+ projectId,context.createProjectSource(() => projectId),state,- { ...options, networkPaused: () => creating() > 0 }+ options)}>diff --git a/apps/web/src/features/projects/views/projects-collection.test.tsx b/apps/web/src/features/projects/views/projects-collection.test.tsxindex 7409a07244..acb33ec505 100644--- a/apps/web/src/features/projects/views/projects-collection.test.tsx+++ b/apps/web/src/features/projects/views/projects-collection.test.tsx@@ -216,7 +216,6 @@ function setup(refresh: async () => {},}),createProjectSource: unused,- createReferencesSource: unused,createPropertyDefinitionsSource: () => ({properties: () => options.properties ?? [status, priority],loading: () => false,diff --git a/apps/web/src/features/projects/views/task-project-property.tsx b/apps/web/src/features/projects/views/task-project-property.tsxindex 99d5a94d4e..3f0190569b 100644--- a/apps/web/src/features/projects/views/task-project-property.tsx+++ b/apps/web/src/features/projects/views/task-project-property.tsx@@ -1,26 +1,34 @@import CaretDownIcon from '@phosphor/caret-down.svg';import StackIcon from '@phosphor/stack.svg';+import { useEntityPropertiesQuery } from '@queries/properties/entity';import { Button, Tooltip } from '@ui';-import { createSignal, Show } from 'solid-js';-import { useProjectsContext } from '../context/projects-context';+import { type Accessor, createSignal, Show } from 'solid-js';+import { useTaskProjectReference } from '../queries/project-identity';+import { taskProjectId } from '../queries/task-project';import { ProjectAssignment } from './project-assignment';-/** Project membership is a task relation, rendered alongside its properties. */+/** The task's Project property, rendered alongside its other properties. */export function TaskProjectProperty(props: {taskId: string;canEdit: boolean;+ userId: Accessor<string | undefined>;}) {- const references = useProjectsContext().createReferencesSource(() => [- props.taskId,- ]);+ const properties = useEntityPropertiesQuery(+ () => 'TASK',+ () => props.taskId,+ false+ );+ const reference = useTaskProjectReference(+ () => taskProjectId(properties.data ?? []),+ props.userId+ );const [open, setOpen] = createSignal(false);- const reference = () => references.references().get(props.taskId);const label = () => {const project = reference();- if (project?.state === 'visible') return project.name;- if (project?.state === 'unavailable') return 'Unavailable project';- if (references.loading()) return 'Loading project…';- if (references.error()) return 'Could not load project';+ if (properties.error) return 'Could not load project';+ if (properties.isLoading || !project) return 'Loading project…';+ if (project.state === 'visible') return project.name;+ if (project.state === 'unavailable') return 'Unavailable project';return 'No project';};diff --git a/apps/web/src/features/property/hooks/usePropertySelection.ts b/apps/web/src/features/property/hooks/usePropertySelection.tsindex 3ec3cad854..a5114f0366 100644--- a/apps/web/src/features/property/hooks/usePropertySelection.ts+++ b/apps/web/src/features/property/hooks/usePropertySelection.ts@@ -1,4 +1,5 @@import { type Accessor, createMemo, createSignal } from 'solid-js';+import { SYSTEM_PROPERTY_IDS } from '../identifiers';import type { PropertyDefinitionDomain } from '../types';export function usePropertySelection(@@ -25,7 +26,9 @@ export function usePropertySelection(!existingIds.has(property.id) &&// Tag definitions are managed through the dedicated Tags UI, never the// generic property pickers.- property.valueType !== 'TAG'+ property.valueType !== 'TAG' &&+ // A task's project is set from its own Project row and pickers.+ property.id !== SYSTEM_PROPERTY_IDS.PROJECT);// Then apply search filterdiff --git a/apps/web/src/features/property/identifiers.ts b/apps/web/src/features/property/identifiers.tsindex 67d44c1675..95421916c7 100644--- a/apps/web/src/features/property/identifiers.ts+++ b/apps/web/src/features/property/identifiers.ts@@ -19,6 +19,8 @@ export const SYSTEM_PROPERTY_IDS = {COMPANY_OWNER: '00000001-0000-0000-0000-000000000011',REVENUE: '00000001-0000-0000-0000-000000000012',CONTACTS: '00000001-0000-0000-0000-000000000013',+ /** The one project (initiative) a task belongs to. */+ PROJECT: '00000001-0000-0000-0000-000000000014',} as const;/** Stable option IDs, kept independent of UI/block registries for tooling. */diff --git a/apps/web/src/features/property/side-panel/properties/EntityPropertiesSection.tsx b/apps/web/src/features/property/side-panel/properties/EntityPropertiesSection.tsxindex 1aeeb620a5..0e9d888c70 100644--- a/apps/web/src/features/property/side-panel/properties/EntityPropertiesSection.tsx+++ b/apps/web/src/features/property/side-panel/properties/EntityPropertiesSection.tsx@@ -13,6 +13,7 @@ import { Property as PropertyNS, useProperty } from '@property';import { AddPropertyButton } from '@property/component/AddPropertyButton';import { Modals } from '@property/component/modal';import { PropertyValueIcon } from '@property/component/propertyValue/PropertyValueIcon';+import { SYSTEM_PROPERTY_IDS } from '@property/constants';import {PropertiesProvider,type PropertySaveHandler,@@ -175,6 +176,10 @@ export function EntityPropertiesSection(props: EntityPropertiesSectionProps) {if (tagDefinitionIds().has(property.propertyDefinitionId)) {return false;}+ // A task's project has its own row beside the properties.+ if (property.propertyDefinitionId === SYSTEM_PROPERTY_IDS.PROJECT) {+ return false;+ }if (props.propertyFilter && !props.propertyFilter(property)) {return false;}diff --git a/apps/web/src/features/tasks-view/components/task-list/TaskList.tsx b/apps/web/src/features/tasks-view/components/task-list/TaskList.tsxindex 611499af68..b2d87a1bc3 100644--- a/apps/web/src/features/tasks-view/components/task-list/TaskList.tsx+++ b/apps/web/src/features/tasks-view/components/task-list/TaskList.tsx@@ -25,6 +25,7 @@ import { isTouchDevice } from '@core/mobile/isTouchDevice';import {type EntityData,EntitySelectionToolbar,+ getTaskReferencedEntityIds,getTaskStatusOptionId,ListLayoutProvider,type TaskEntityWithProperties,@@ -64,10 +65,7 @@ import { TaskListHeader } from './TaskListHeader';import { taskGridColumnCount } from './task-grid-template';import './task-list.css';import { ProjectPropertyCell } from '@app/features/projects/project-property';-import {- ProjectAssignmentDialog,- useTaskProjectReferences,-} from '@app/features/projects/projects';+import { ProjectAssignmentDialog } from '@app/features/projects/projects';function ResponsiveTaskListHeader() {const layout = useListLayout();@@ -223,11 +221,6 @@ export function TaskList(props: TaskListProps) {);const visibleRows = source.items;- const projectReferences = useTaskProjectReferences(() =>- visibleRows().flatMap((row) =>- row.kind === 'entity' ? [row.entity.id] : []- )- );const columnCount = () => taskGridColumnCount(projectsEnabled());const [assigningProjectTasks, setAssigningProjectTasks] =createSignal<string[]>();@@ -527,9 +520,12 @@ export function TaskList(props: TaskListProps) {projectsEnabled() ? (<ProjectPropertyCelltaskId={entityRow().entity.id}- reference={projectReferences- .references()- .get(entityRow().entity.id)}+ projectId={+ getTaskReferencedEntityIds(+ entityRow().entity,+ SYSTEM_PROPERTY_IDS.PROJECT+ )[0]+ }/>) : undefined}diff --git a/apps/web/src/features/tasks-view/queries/task-membership.ts b/apps/web/src/features/tasks-view/queries/task-membership.tsdeleted file mode 100644index 16ff44d471..0000000000--- a/apps/web/src/features/tasks-view/queries/task-membership.ts+++ /dev/null@@ -1,21 +0,0 @@-import {- type BackendAstNode,- literal,-} from '@app/features/soup/filters/facets/clause';-import { NIL_ID as NIL_UUID } from '@app/features/soup/filters/facets/constants';--export const taskMembershipScope = (ids: readonly string[]): BackendAstNode => {- if (!ids.length) return literal('id', NIL_UUID);- // A project may contain thousands of tasks. Balance the binary AST to stay- // below the JSON parser's recursion limit while keeping every membership ID.- let level = ids.map((id) => literal('id', id));- while (level.length > 1) {- const next: BackendAstNode[] = [];- for (let index = 0; index < level.length; index += 2) {- const right = level[index + 1];- next.push(right ? { '|': [level[index], right] } : level[index]);- }- level = next;- }- return level[0];-};diff --git a/apps/web/src/features/tasks-view/queries/task-query.test.ts b/apps/web/src/features/tasks-view/queries/task-query.test.tsindex f53bddbd00..1b88868a73 100644--- a/apps/web/src/features/tasks-view/queries/task-query.test.ts+++ b/apps/web/src/features/tasks-view/queries/task-query.test.ts@@ -1,4 +1,3 @@-import { NIL_UUID } from '@app/features/soup';import { describe, expect, it, vi } from 'vitest';import { type BuildTaskQueryOptions, buildTaskQuery } from './task-query';import { buildTaskSearchRequest } from './task-search';@@ -22,65 +21,6 @@ const options: BuildTaskQueryOptions = {sort: [{ id: 'updated_at', reversed: true }],};-describe('project task membership scope', () => {- it('intersects authorized IDs with task/facet filters before server grouping and paging', () => {- const query = buildTaskQuery({ ...options, taskIds: ['first', 'second'] });- expect(query.body.df).toEqual({- '&': [- { l: { dst: 'task' } },- { '|': [{ l: { id: 'first' } }, { l: { id: 'second' } }] },- ],- });- expect(query.body.propf).toBeDefined();- expect(query.groupBy).toMatchObject({ type: 'property' });- expect(query.params).toMatchObject({- sort_method: 'updated_at',- sort_direction: 'asc',- });- });- it('makes an empty project match no tasks in both listing and content search', () => {- expect(buildTaskQuery({ ...options, taskIds: [] }).body.df).toEqual({- '&': [{ l: { dst: 'task' } }, { l: { id: NIL_UUID } }],- });- const search = buildTaskSearchRequest({- ...options,- taskIds: [],- query: 'launch',- matchType: 'partial',- });- expect(search.body.filters?.document_filters).toMatchObject({- sub_types: ['task'],- document_ids: [NIL_UUID],- });- expect(search.body.filters?.property_filters).toHaveLength(1);- });- it('keeps every task in large projects without exceeding JSON recursion depth', () => {- const ids = Array.from({ length: 1024 }, (_, index) => `task-${index}`);- const scope = buildTaskQuery({ ...options, taskIds: ids }).body.df;- const leaves: string[] = [];- const depth = (node: unknown): number => {- if (!node || typeof node !== 'object') return 0;- const record = node as Record<string, unknown>;- if ('l' in record) {- const leaf = record.l as { id?: string };- if (leaf.id) leaves.push(leaf.id);- return 1;- }- const branches = (record['&'] ?? record['|']) as unknown[];- return 1 + Math.max(...branches.map(depth));- };- expect(depth(scope)).toBeLessThan(20);- expect(leaves).toEqual(ids);- const search = buildTaskSearchRequest({- ...options,- taskIds: ids,- query: 'launch',- matchType: 'partial',- });- expect(search.body.filters?.document_filters?.document_ids).toEqual(ids);- });-});-describe('task reference scope', () => {const reference = {propertyDefinitionId: '00000001-0000-0000-0000-00000000000c',diff --git a/apps/web/src/features/tasks-view/queries/task-query.ts b/apps/web/src/features/tasks-view/queries/task-query.tsindex 4e8a74adce..07ea73638d 100644--- a/apps/web/src/features/tasks-view/queries/task-query.ts+++ b/apps/web/src/features/tasks-view/queries/task-query.ts@@ -22,8 +22,6 @@ import type {TaskTab,} from '../types';-import { taskMembershipScope } from './task-membership';-type TaskAst = BackendAstNode;const entityPropertyLiteral = (@@ -113,8 +111,6 @@ export type BuildTaskQueryOptions = {facetContext?: TaskFacetContext;groupBy: TaskGroupBy;sort: SortSelection<TaskSortId>[];- /** Authorized membership scope; an empty set deliberately matches no tasks. */- taskIds?: readonly string[];/** Only tasks whose property references this entity. */reference?: TaskReferenceScope;};@@ -145,12 +141,9 @@ export function buildTaskQuery(const taskDocuments = documentScope(options.tab, options.userId);- let documents: TaskAst = compiledFacets.df+ const documents: TaskAst = compiledFacets.df? { '&': [taskDocuments, compiledFacets.df] }: taskDocuments;- if (options.taskIds !== undefined) {- documents = { '&': [documents, taskMembershipScope(options.taskIds)] };- }const body: SoupAstBody = {...nonTaskTargets,diff --git a/apps/web/src/features/tasks-view/queries/task-search.ts b/apps/web/src/features/tasks-view/queries/task-search.tsindex 7abb3d15e1..364a30d494 100644--- a/apps/web/src/features/tasks-view/queries/task-search.ts+++ b/apps/web/src/features/tasks-view/queries/task-search.ts@@ -85,7 +85,6 @@ export function buildTaskSearchRequest(options: {userId: string | undefined;facets: FacetSelection;facetContext?: TaskFacetContext;- taskIds?: readonly string[];reference?: TaskReferenceScope;}): SearchSoupQueryArgs {const facetContext = options.facetContext ?? EMPTY_TASK_FACET_CONTEXT;@@ -123,13 +122,6 @@ export function buildTaskSearchRequest(options: {document_filters: {sub_types: ['task'],...(owners ? { owners } : {}),- ...(options.taskIds !== undefined- ? {- document_ids: options.taskIds.length- ? [...options.taskIds]- : [NIL_UUID],- }- : {}),},...(propertyFilters.length > 0? { property_filters: propertyFilters }diff --git a/apps/web/src/features/tasks-view/queries/use-tasks-query.test.ts b/apps/web/src/features/tasks-view/queries/use-tasks-query.test.tsindex 3000f6be0f..87ce5fdec5 100644--- a/apps/web/src/features/tasks-view/queries/use-tasks-query.test.ts+++ b/apps/web/src/features/tasks-view/queries/use-tasks-query.test.ts@@ -37,11 +37,10 @@ vi.mock('@queries/soup/grouped/create-grouped-soup-queries', () => ({import { useTasksDataSource } from './use-tasks-query';-it('retains cached rows during membership changes but filters them by current access', () => {+it('retains cached rows while a referenced list refetches and hides them when disabled', () => {const [placeholder, setPlaceholder] = createSignal(false);const [enabled, setEnabled] = createSignal(true);- const [members, setMembers] = createSignal(['task']);- const task: TaskEntityWithProperties = {+ const task = {type: 'document',fileType: 'md',id: 'task',@@ -50,8 +49,16 @@ it('retains cached rows during membership changes but filters them by current accreatedAt: new Date(),updatedAt: new Date(),subType: { type: 'task', is_completed: false },- properties: [],- };+ properties: [+ {+ definition: { id: 'project-definition' },+ value: {+ type: 'EntityReference',+ value: [{ entity_type: 'INITIATIVE', entity_id: 'project' }],+ },+ },+ ],+ } as unknown as TaskEntityWithProperties;fixture.query = {isLoading: false,get isPlaceholderData() {@@ -74,7 +81,10 @@ it('retains cached rows during membership changes but filters them by current actagSets: () => [],tagSetsReady: () => true,isGroupExpanded: () => true,- taskIds: members,+ reference: () => ({+ propertyDefinitionId: 'project-definition',+ entityId: 'project',+ }),enabled,});@@ -83,12 +93,7 @@ it('retains cached rows during membership changes but filters them by current acsetPlaceholder(true);expect(source.items()).toHaveLength(1);expect(source.isLoading()).toBe(false);- setMembers([]);- expect(source.items()).toEqual([]);- setMembers(['task']);setPlaceholder(false);- expect(source.items()).toHaveLength(1);- expect(source.isLoading()).toBe(false);setEnabled(false);expect(source.items()).toEqual([]);expect(source.isLoading()).toBe(false);diff --git a/apps/web/src/features/tasks-view/queries/use-tasks-query.ts b/apps/web/src/features/tasks-view/queries/use-tasks-query.tsindex ac785feca2..60670fbd73 100644--- a/apps/web/src/features/tasks-view/queries/use-tasks-query.ts+++ b/apps/web/src/features/tasks-view/queries/use-tasks-query.ts@@ -46,7 +46,6 @@ export type UseTasksDataSourceOptions = {tagSets: Accessor<readonly TagSetResponse[]>;tagSetsReady: Accessor<boolean>;isGroupExpanded: (groupId: string) => boolean;- taskIds?: Accessor<readonly string[]>;/** Only tasks whose property references this entity. */reference?: Accessor<TaskReferenceScope>;enabled?: Accessor<boolean>;@@ -101,11 +100,10 @@ export function useTasksDataSource(facetContext: facetContext(),groupBy: state.groupBy,sort: state.sort,- taskIds: options.taskIds?.(),reference: options.reference?.(),});- const scoped = Boolean(options.taskIds || options.reference);+ const scoped = Boolean(options.reference);const query = useSoupAstItemsQuery(queryArgs, () => ({enabled: facetOptionsReady(),networkPaused: options.networkPaused?.(),@@ -136,11 +134,9 @@ export function useTasksDataSource(const transformEntities = (entities: EntityData[]) => {const selected: TaskEntityWithProperties[] = [];const context = viewContext();- const memberIds = options.taskIds ? new Set(options.taskIds()) : undefined;const reference = options.reference?.();for (const entity of entities) {if (!isTaskEntity(entity)) continue;- if (memberIds && !memberIds.has(entity.id)) continue;if (reference && !referencesEntity(entity, reference)) continue;if (!taskMatchesView(entity, context)) continue;@@ -151,8 +147,7 @@ export function useTasksDataSource(const baseTasks = createMemo<TaskEntityWithProperties[]>((previous) => {if (query.isLoading) return previous;- if (!options.taskIds && query.isPlaceholderData && previous.length > 0)- return previous;+ if (query.isPlaceholderData && previous.length > 0) return previous;return sortItems(transformEntities(query.data?.entities ?? []),@@ -185,7 +180,6 @@ export function useTasksDataSource(userId: options.userId(),facets: state.facets,facetContext: facetContext(),- taskIds: options.taskIds?.(),reference: options.reference?.(),}),});@@ -244,8 +238,7 @@ export function useTasksDataSource((previous) => {if (!search.isSearching() &&- (query.isLoading ||- (!options.taskIds && query.isPlaceholderData && previous.length > 0))+ (query.isLoading || (query.isPlaceholderData && previous.length > 0))) {return previous;}@@ -269,7 +262,6 @@ export function useTasksDataSource(.entities(group.key).filter((task) =>- (!options.taskIds || options.taskIds().includes(task.id)) &&(!reference || referencesEntity(task, reference)) &&taskMatchesView(task, viewContext()));@@ -303,13 +295,8 @@ export function useTasksDataSource(const items = createMemo(() => {if (options.enabled?.() === false) return [];- // Retained cache rows are still filtered by the current authorized membership.- if (options.taskIds && query.isLoading) return [];- const members = options.taskIds ? new Set(options.taskIds()) : undefined;- return rows().filter(- (row) =>- isSoupRowVisible(row, options.isGroupExpanded) &&- (row.kind !== 'entity' || !members || members.has(row.entity.id))+ return rows().filter((row) =>+ isSoupRowVisible(row, options.isGroupExpanded));});@@ -317,7 +304,6 @@ export function useTasksDataSource(const isLoading = () => {if (options.enabled?.() === false) return false;- if (options.taskIds && query.isLoading) return true;if (!search.isSearching()) {// A query held back for the tag sets is loading, not empty.return (query.isLoading || !facetOptionsReady()) && rows().length === 0;diff --git a/apps/web/src/lib/core/component/AI/component/tool/Initiatives.test.tsx b/apps/web/src/lib/core/component/AI/component/tool/Initiatives.test.tsxindex 8a15e9814c..a16a0d65f1 100644--- a/apps/web/src/lib/core/component/AI/component/tool/Initiatives.test.tsx+++ b/apps/web/src/lib/core/component/AI/component/tool/Initiatives.test.tsx@@ -115,82 +115,6 @@ it('expands project results and opens a native project view', () => {);});-it('preserves per-task failures and unavailable references in expandable results', () => {- tool(- 'SetTaskInitiative',- { initiativeId: projectId },- {- results: [- { taskId: 'a', status: 'assigned' },- { taskId: 'b', status: 'skippedNoPermission' },- ],- }- );- fireEvent.click(screen.getByRole('button', { name: '2 tasks' }));- expect(screen.getByText('Task 2: skipped no permission')).toBeTruthy();- cleanup();- tool(- 'ReadTaskInitiatives',- { taskIds: ['a'] },- {- references: [{ state: 'unavailable', taskId: 'a' }],- }- );- fireEvent.click(screen.getByRole('button', { name: '1 task' }));- expect(screen.getByText('Unavailable project')).toBeTruthy();- expect(screen.queryByRole('button', { name: 'Project' })).toBeNull();-});--it('shows separate assignment outcomes and retains the full response', () => {- tool(- 'AssignTasksToInitiative',- { initiativeId: projectId, taskIds: ['a', 'b', 'c'] },- {- initiativeId: projectId,- results: [- { taskId: 'a', status: 'assigned' },- { taskId: 'b', status: 'moved' },- { taskId: 'c', status: 'skipped_no_permission' },- ],- }- );- expect(screen.getByText('Add 3 tasks to project')).toBeTruthy();- fireEvent.click(screen.getByRole('button', { name: '3 tasks' }));- expect(screen.getByText('a — assigned')).toBeTruthy();- expect(screen.getByText('b — moved')).toBeTruthy();- expect(screen.getByText('c — skipped no permission')).toBeTruthy();- expect(screen.getByText('Result data')).toBeTruthy();-});--it('distinguishes removed tasks from tasks not assigned to the project', () => {- tool(- 'UnassignTasksFromInitiative',- { initiativeId: projectId, taskIds: ['a', 'b'] },- {- initiativeId: projectId,- results: [- { taskId: 'a', status: 'unassigned' },- { taskId: 'b', status: 'not_assigned' },- ],- }- );- expect(screen.getByText('Remove 2 tasks from project')).toBeTruthy();- fireEvent.click(screen.getByRole('button', { name: '2 tasks' }));- expect(screen.getByText('a — unassigned')).toBeTruthy();- expect(screen.getByText('b — not assigned')).toBeTruthy();-});--it('refreshes project caches after both batch membership tools', async () => {- await initiativeToolHandlers.AssignTasksToInitiative.handleResponse?.(- {} as never- );- await initiativeToolHandlers.UnassignTasksFromInitiative.handleResponse?.(- {} as never- );- expect(invalidate).toHaveBeenCalledTimes(2);- expect(invalidate).toHaveBeenCalledWith({ queryKey: ['initiatives'] });-});-it('keeps successful deletion results inspectable without a stale project link', () => {tool('DeleteInitiative', { initiativeId: projectId }, { success: true });fireEvent.click(screen.getByRole('button', { name: 'Deleted' }));diff --git a/apps/web/src/lib/core/component/AI/component/tool/Initiatives.tsx b/apps/web/src/lib/core/component/AI/component/tool/Initiatives.tsxindex 4705237755..60bd349c64 100644--- a/apps/web/src/lib/core/component/AI/component/tool/Initiatives.tsx+++ b/apps/web/src/lib/core/component/AI/component/tool/Initiatives.tsx@@ -125,55 +125,7 @@ function ProjectDetailsResult(props: { project: ProjectDetails }) {);}-function TaskMembershipResults(props: {- results?: { taskId: string; status: string }[];-}) {- return (- <Tool.List>- <For each={props.results}>- {(outcome) => (- <Tool.ListItem>- {outcome.taskId} — {outcome.status.replaceAll('_', ' ')}- </Tool.ListItem>- )}- </For>- </Tool.List>- );-}-export const initiativeToolHandlers = {- AssignTasksToInitiative: createToolRenderer({- name: 'AssignTasksToInitiative',- handleResponse: refreshProjectsAfterMutation,- render: (ctx) => (- <ProjectToolCard- label={`Add ${ctx.tool.data.taskIds.length} tasks to project`}- renderContext={ctx.renderContext}- hasResult={!!ctx.response}- result={ctx.response?.data}- projectId={ctx.tool.data.initiativeId}- status={resultCount(ctx.response?.data.results.length ?? 0, 'task')}- >- <TaskMembershipResults results={ctx.response?.data.results} />- </ProjectToolCard>- ),- }),- UnassignTasksFromInitiative: createToolRenderer({- name: 'UnassignTasksFromInitiative',- handleResponse: refreshProjectsAfterMutation,- render: (ctx) => (- <ProjectToolCard- label={`Remove ${ctx.tool.data.taskIds.length} tasks from project`}- renderContext={ctx.renderContext}- hasResult={!!ctx.response}- result={ctx.response?.data}- projectId={ctx.tool.data.initiativeId}- status={resultCount(ctx.response?.data.results.length ?? 0, 'task')}- >- <TaskMembershipResults results={ctx.response?.data.results} />- </ProjectToolCard>- ),- }),ListInitiatives: createToolRenderer({name: 'ListInitiatives',render: (ctx) => (@@ -305,76 +257,6 @@ export const initiativeToolHandlers = {</ProjectToolCard>),}),- SetTaskInitiative: createToolRenderer({- name: 'SetTaskInitiative',- handleResponse: refreshProjectsAfterMutation,- render: (ctx) => (- <ProjectToolCard- label={- ctx.tool.data.initiativeId ? 'Set task project' : 'Clear task project'- }- renderContext={ctx.renderContext}- hasResult={!!ctx.response}- result={ctx.response?.data}- projectId={ctx.tool.data.initiativeId}- status={resultCount(ctx.response?.data.results.length ?? 0, 'task')}- >- <Tool.List>- <For each={ctx.response?.data.results}>- {(outcome, index) => (- <Tool.ListItem>- Task {index() + 1}:{' '}- {outcome.status- .replace(/([a-z])([A-Z])/g, '$1 $2')- .toLowerCase()}- </Tool.ListItem>- )}- </For>- </Tool.List>- </ProjectToolCard>- ),- }),- ReadTaskInitiatives: createToolRenderer({- name: 'ReadTaskInitiatives',- render: (ctx) => (- <ProjectToolCard- label="Read task projects"- renderContext={ctx.renderContext}- hasResult={!!ctx.response}- result={ctx.response?.data}- status={resultCount(ctx.response?.data.references.length ?? 0, 'task')}- >- <Tool.List>- <For each={ctx.response?.data.references}>- {(reference, index) => (- <Tool.ListItem>- <div class="flex items-center gap-2">- <span>Task {index() + 1}</span>- <Show- when={reference.state === 'visible' ? reference : undefined}- fallback={- <span>- {reference.state === 'unavailable'- ? 'Unavailable project'- : 'No project'}- </span>- }- >- {(project) => (- <ProjectLink- id={project().initiativeId}- name={project().name}- />- )}- </Show>- </div>- </Tool.ListItem>- )}- </For>- </Tool.List>- </ProjectToolCard>- ),- }),ReadInitiativeActivity: createToolRenderer({name: 'ReadInitiativeActivity',render: (ctx) => (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.tsindex 0376e278a4..492e8cbb56 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@@ -3,44 +3,6 @@*/import { z } from 'zod/v3';-export const AssignTasksToInitiative = z.object({- initiativeId: z.string().uuid(),- taskIds: z.array(z.string()),-});--export const AssignTasksToInitiativeResponse = z.object({- initiativeId: z.string().uuid(),- results: z.array(- z.object({- taskId: z.string(),- status: z.any().superRefine((x, ctx) => {- const schemas = [- z.literal('assigned'),- z.literal('moved'),- z.literal('not_a_task'),- z.literal('not_found'),- z.literal('skipped_no_permission'),- ];- 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',- });- }- }),- })- ),-});-export const BashCodeExecution = z.object({ input: z.string() });export const BashCodeExecutionResponse = z.object({@@ -5963,40 +5925,6 @@ export const ReadSpreadsheet = z.object({includeStyles: z.union([z.boolean(), z.null()]).optional(),});-export const ReadTaskInitiatives = z.object({ taskIds: z.array(z.string()) });--export const TaskProjectReferences = z.object({- references: z.array(- z.any().superRefine((x, ctx) => {- const schemas = [- z.object({ taskId: z.string(), state: z.literal('none') }),- z.object({ taskId: z.string(), state: z.literal('unavailable') }),- z.object({- taskId: z.string(),- initiativeId: z.string().uuid(),- name: z.string(),- state: z.literal('visible'),- }),- ];- 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',- });- }- })- ),-});-export const RenameChannel = z.object({channelId: z.string().uuid(),name: z.string(),@@ -6750,15 +6678,6 @@ export const SetSenderPolicyResponse = z.object({summary: z.string(),});-export const SetTaskInitiative = z.object({- taskIds: z.array(z.string()),- initiativeId: z.union([z.string().uuid(), z.null()]).optional(),-});--export const TaskProjectOutcomes = z.object({- results: z.array(z.object({ taskId: z.string(), status: z.string() })),-});-export const Subagent = z.object({ task: z.string() });export const SubagentResponse = z.object({ result: z.string() });@@ -6874,38 +6793,6 @@ export const TextEditorCodeExecutionResponse = z.object({}),});-export const UnassignTasksFromInitiative = z.object({- initiativeId: z.string().uuid(),- taskIds: z.array(z.string()),-});--export const UnassignTasksFromInitiativeResponse = z.object({- initiativeId: z.string().uuid(),- results: z.array(- z.object({- taskId: z.string(),- status: z.any().superRefine((x, ctx) => {- const schemas = [z.literal('unassigned'), z.literal('not_assigned')];- 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',- });- }- }),- })- ),-});-export const UpdateCalendarEvent = z.object({eventId: z.string().uuid(),calendarId: z.union([z.string().uuid(), z.null()]).optional(),diff --git a/apps/web/src/lib/service-clients/service-cognition/generated/tools/tool.ts b/apps/web/src/lib/service-clients/service-cognition/generated/tools/tool.tsindex 4eadc97cdf..5bc3974666 100644--- a/apps/web/src/lib/service-clients/service-cognition/generated/tools/tool.ts+++ b/apps/web/src/lib/service-clients/service-cognition/generated/tools/tool.ts@@ -8,10 +8,6 @@ import * as schemas from './schemas';import type * as types from './types';type ToolParserMap = {- AssignTasksToInitiative: {- call: types.AssignTasksToInitiative;- response: types.AssignTasksToInitiativeResponse;- };BashCodeExecution: {call: types.BashCodeExecution;response: types.BashCodeExecutionResponse;@@ -240,10 +236,6 @@ type ToolParserMap = {call: types.ReadSpreadsheet;response: types.SpreadsheetResponse;};- ReadTaskInitiatives: {- call: types.ReadTaskInitiatives;- response: types.TaskProjectReferences;- };ReadThread: { call: types.ReadThread; response: types.ReadResponse };RenameChannel: {call: types.RenameChannel;@@ -294,19 +286,11 @@ type ToolParserMap = {call: types.SetSenderPolicy;response: types.SetSenderPolicyResponse;};- SetTaskInitiative: {- call: types.SetTaskInitiative;- response: types.TaskProjectOutcomes;- };Subagent: { call: types.Subagent; response: types.SubagentResponse };TextEditorCodeExecution: {call: types.TextEditorCodeExecution;response: types.TextEditorCodeExecutionResponse;};- UnassignTasksFromInitiative: {- call: types.UnassignTasksFromInitiative;- response: types.UnassignTasksFromInitiativeResponse;- };UpdateCalendarEvent: {call: types.UpdateCalendarEvent;response: types.ToolCalendarEvent;@@ -330,10 +314,6 @@ type ToolParserMap = {};const toolParserMap = {- AssignTasksToInitiative: {- call: schemas.AssignTasksToInitiative,- response: schemas.AssignTasksToInitiativeResponse,- },BashCodeExecution: {call: schemas.BashCodeExecution,response: schemas.BashCodeExecutionResponse,@@ -589,10 +569,6 @@ const toolParserMap = {call: schemas.ReadSpreadsheet,response: schemas.SpreadsheetResponse,},- ReadTaskInitiatives: {- call: schemas.ReadTaskInitiatives,- response: schemas.TaskProjectReferences,- },ReadThread: { call: schemas.ReadThread, response: schemas.ReadResponse },RenameChannel: {call: schemas.RenameChannel,@@ -646,19 +622,11 @@ const toolParserMap = {call: schemas.SetSenderPolicy,response: schemas.SetSenderPolicyResponse,},- SetTaskInitiative: {- call: schemas.SetTaskInitiative,- response: schemas.TaskProjectOutcomes,- },Subagent: { call: schemas.Subagent, response: schemas.SubagentResponse },TextEditorCodeExecution: {call: schemas.TextEditorCodeExecution,response: schemas.TextEditorCodeExecutionResponse,},- UnassignTasksFromInitiative: {- call: schemas.UnassignTasksFromInitiative,- response: schemas.UnassignTasksFromInitiativeResponse,- },UpdateCalendarEvent: {call: schemas.UpdateCalendarEvent,response: schemas.ToolCalendarEvent,@@ -696,10 +664,6 @@ type NamedRawTool = {};type ToolDataMap = {- AssignTasksToInitiative: {- call: types.AssignTasksToInitiative;- response: types.AssignTasksToInitiativeResponse;- };BashCodeExecution: {call: types.BashCodeExecution;response: types.BashCodeExecutionResponse;@@ -928,10 +892,6 @@ type ToolDataMap = {call: types.ReadSpreadsheet;response: types.SpreadsheetResponse;};- ReadTaskInitiatives: {- call: types.ReadTaskInitiatives;- response: types.TaskProjectReferences;- };ReadThread: { call: types.ReadThread; response: types.ReadResponse };RenameChannel: {call: types.RenameChannel;@@ -982,19 +942,11 @@ type ToolDataMap = {call: types.SetSenderPolicy;response: types.SetSenderPolicyResponse;};- SetTaskInitiative: {- call: types.SetTaskInitiative;- response: types.TaskProjectOutcomes;- };Subagent: { call: types.Subagent; response: types.SubagentResponse };TextEditorCodeExecution: {call: types.TextEditorCodeExecution;response: types.TextEditorCodeExecutionResponse;};- UnassignTasksFromInitiative: {- call: types.UnassignTasksFromInitiative;- response: types.UnassignTasksFromInitiativeResponse;- };UpdateCalendarEvent: {call: types.UpdateCalendarEvent;response: types.ToolCalendarEvent;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.tsindex a846ecb755..a27e293eec 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@@ -8,15 +8,6 @@* and run json-schema-to-typescript to regenerate this file.*/-/**- * Tool-facing status of a task assignment.- */-export type TaskAssignmentStatus =- | 'assigned'- | 'moved'- | 'not_a_task'- | 'not_found'- | 'skipped_no_permission';/*** Content of a bash code execution response - either a result or an error*/@@ -1273,39 +1264,6 @@ export type AccessLevel = 'view' | 'comment' | 'edit' | 'owner';* The kind of an item inside a project.*/export type ProjectItemType = 'document' | 'chat' | 'project';-/**- * Privacy-preserving task project reference.- */-export type TaskProjectReference =- | {- /**- * Requested task id.- */- taskId: string;- state: 'none';- }- | {- /**- * Requested task id.- */- taskId: string;- state: 'unavailable';- }- | {- /**- * Requested task id.- */- taskId: string;- /**- * Associated project id.- */- initiativeId: string;- /**- * Associated project name.- */- name: string;- state: 'visible';- };/*** How a group's conditions combine.*/@@ -1529,10 +1487,6 @@ export type TextEditorCodeExecutionContent =| (TextEditorCodeExecutionToolError & {type: 'text_editor_code_execution_tool_result_error';});-/**- * Tool-facing status of a task unassignment.- */-export type TaskUnassignmentStatus = 'unassigned' | 'not_assigned';/*** How much of a recurring series an update applies to.*/@@ -1625,42 +1579,6 @@ export type ReadThreadReadContent =type: 'itemPreviews';};-/**- * Move tasks into an initiative. A task already in another initiative is moved; duplicates are ignored; at most 100 unique task ids per call. Requires edit access to the initiative and to each task. Returns one status per task id: assigned, moved, not_a_task, not_found, or skipped_no_permission.- */-export interface AssignTasksToInitiative {- /**- * The id of the initiative to assign tasks to. Requires edit access.- */- initiativeId: string;- /**- * Task document ids to assign, at least one and at most 100 unique ids per call. Duplicates are ignored. Requires edit access to each task.- */- taskIds: string[];-}-/**- * Response from [`AssignTasksToInitiative`].- */-export interface AssignTasksToInitiativeResponse {- /**- * The id of the initiative receiving the tasks.- */- initiativeId: string;- /**- * Outcomes in request order after removing duplicates.- */- results: TaskAssignmentOutcome[];-}-/**- * The result of assigning one task to an initiative.- */-export interface TaskAssignmentOutcome {- /**- * The task id this outcome describes.- */- taskId: string;- status: TaskAssignmentStatus;-}/*** Execute a bash command in a sandboxed environment using Claude's built-in code execution tool.*/@@ -7018,24 +6936,6 @@ export interface ReadSpreadsheet {*/includeStyles?: boolean | null;}-/**- * Find the project associated with each requested task. Returns project id/name only when both task and project are visible. Distinguishes no project from unavailable. Accepts up to 100 unique task ids.- */-export interface ReadTaskInitiatives {- /**- * Task ids to look up, deduplicated in input order.- */- taskIds: string[];-}-/**- * Visibility-aware project references for the requested tasks.- */-export interface TaskProjectReferences {- /**- * References in deduplicated request order.- */- references: TaskProjectReference[];-}/*** Rename an existing channel. Requires the current user to be an active channel participant. Direct-message channels cannot be renamed. Use only when the user asks to rename a channel.*/@@ -7492,6 +7392,9 @@ export interface SendEmail {* - Subtasks (00000001-0000-0000-0000-000000000006): entity, multi. Use entity_refs with entity_type='task'.* - Story Points (00000001-0000-0000-0000-000000000009): number, single. Use number_value.*+ * A task can belong to one project:+ * - Project (00000001-0000-0000-0000-000000000014): entity, single. Use entity_ref with entity_type='initiative' and the project UUID; send no value field to remove the task from its project. Setting it requires edit access to the task and the project, and the project's agents are assigned to the task.+ ** CRM companies (entity_type='company', entity_id=the company UUID) always have these system properties:* - Stage (00000001-0000-0000-0000-000000000010): select_string, single. Use option_id. Default options: Lead (00000001-0000-0000-0010-000000000001), Qualified (...0002), Demo (...0003), Trial (...0004), Negotiation (...0005), Customer (...0006), Churned (...0007). Teams can customize their stages, so prefer calling GetCompany or GetEntityProperties first to get the valid stage option ids.* - Owner (00000001-0000-0000-0000-000000000011): entity, single. Use entity_ref with entity_type='user' and entity_id='macro|[email protected]'.@@ -7620,41 +7523,6 @@ export interface SetSenderPolicyResponse {*/summary: string;}-/**- * Set the project associated with tasks, moving them from their previous project if needed. Requires edit access to each task and the destination project; access to the previous project is unnecessary. Omit initiativeId to clear the association using task edit access alone. Reports each task's outcome independently; at most 100 unique tasks.- */-export interface SetTaskInitiative {- /**- * Task ids to assign or clear, deduplicated in request order.- */- taskIds: string[];- /**- * Destination project; omit to clear each task's current project.- */- initiativeId?: string | null;-}-/**- * Results in deduplicated input order.- */-export interface TaskProjectOutcomes {- /**- * Outcome for every submitted task.- */- results: TaskProjectOutcome[];-}-/**- * One task mutation outcome.- */-export interface TaskProjectOutcome {- /**- * Requested task identifier.- */- taskId: string;- /**- * assigned, moved, cleared, notATask, notFound, skippedNoPermission, or failed.- */- status: string;-}/*** Delegate a task to a subagent that can independently use tools to research and complete it. The subagent has access to search, documents, properties, calls, and channel tools. Use this for tasks that require multiple tool calls or independent research.*/@@ -7739,42 +7607,6 @@ export interface TextEditorCodeExecutionResult {export interface TextEditorCodeExecutionToolError {error_code: CodeExecutionErrorCode;}-/**- * Move tasks out of a specific initiative (project). Requires edit access to the initiative and each task; at most 100 unique tasks. Returns one status per task id: unassigned, or not_assigned when the task was not in this initiative. Tasks in other initiatives are left unchanged. An access or service failure stops the batch; earlier removals may have succeeded.- */-export interface UnassignTasksFromInitiative {- /**- * The id of the initiative to remove tasks from. Requires edit access.- */- initiativeId: string;- /**- * Task document ids to remove. Provide at least one and at most 100 unique ids; duplicates are ignored. Requires edit access to each task.- */- taskIds: string[];-}-/**- * Response from [`UnassignTasksFromInitiative`].- */-export interface UnassignTasksFromInitiativeResponse {- /**- * The id of the initiative the tasks were removed from.- */- initiativeId: string;- /**- * Outcomes in request order after removing duplicates.- */- results: TaskUnassignmentOutcome[];-}-/**- * The result of removing one task from an initiative.- */-export interface TaskUnassignmentOutcome {- /**- * The task id this outcome describes.- */- taskId: string;- status: TaskUnassignmentStatus;-}/*** Update an existing calendar event. Only the supplied fields change; omitted fields keep their current values. The change is written to Google immediately and attendees are notified of it, so confirm details with the user first. Get the `eventId` from ListCalendarEvents.*diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/assignTaskStatus.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/assignTaskStatus.tsdeleted file mode 100644index 5b521c9e3c..0000000000--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/assignTaskStatus.ts+++ /dev/null@@ -1,21 +0,0 @@-/**- * Generated by orval v7.21.0 🍺- * Do not edit manually.- * document_storage_service- * OpenAPI spec version: 0.1.0- */--/**- * Status written onto one assign result.- */-export type AssignTaskStatus =- (typeof AssignTaskStatus)[keyof typeof AssignTaskStatus];--// eslint-disable-next-line @typescript-eslint/no-redeclare-export const AssignTaskStatus = {- assigned: 'assigned',- moved: 'moved',- notATask: 'notATask',- notFound: 'notFound',- skippedNoPermission: 'skippedNoPermission',-} as const;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/assignTasksRequest.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/assignTasksRequest.tsdeleted file mode 100644index e3efd856a3..0000000000--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/assignTasksRequest.ts+++ /dev/null@@ -1,14 +0,0 @@-/**- * Generated by orval v7.21.0 🍺- * Do not edit manually.- * document_storage_service- * OpenAPI spec version: 0.1.0- */--/**- * Assign-tasks HTTP body.- */-export interface AssignTasksRequest {- /** Task ids to assign, in request order. */- taskIds: string[];-}diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/assignTasksResponse.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/assignTasksResponse.tsdeleted file mode 100644index 3cfcc93e36..0000000000--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/assignTasksResponse.ts+++ /dev/null@@ -1,15 +0,0 @@-/**- * Generated by orval v7.21.0 🍺- * Do not edit manually.- * document_storage_service- * OpenAPI spec version: 0.1.0- */-import type { AssignTasksResult } from './assignTasksResult';--/**- * Assign-tasks HTTP response.- */-export interface AssignTasksResponse {- /** Outcomes in request order after dedupe. */- results: AssignTasksResult[];-}diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/assignTasksResult.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/assignTasksResult.tsdeleted file mode 100644index e5869d4116..0000000000--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/assignTasksResult.ts+++ /dev/null@@ -1,17 +0,0 @@-/**- * Generated by orval v7.21.0 🍺- * Do not edit manually.- * document_storage_service- * OpenAPI spec version: 0.1.0- */-import type { AssignTaskStatus } from './assignTaskStatus';--/**- * Per-task outcome of an assign call.- */-export interface AssignTasksResult {- /** What happened to the task. */- status: AssignTaskStatus;- /** Task id this outcome describes. */- taskId: string;-}diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/index.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/index.tsindex 9d7acf0176..685fce8e06 100644--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/index.ts+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/index.ts@@ -125,10 +125,6 @@ export * from './applyOpsResponse';export * from './approvePairingRequest';export * from './approvePairingRequestName';export * from './approvePairingRequestTeamId';-export * from './assignTaskStatus';-export * from './assignTasksRequest';-export * from './assignTasksResponse';-export * from './assignTasksResult';export * from './attachmentChange';export * from './attachmentChangeOneOf';export * from './attachmentChangeOneOfFive';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.tsindex 74eea3aafe..4450743b0e 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@@ -14985,56 +14985,6 @@ export const updateInitiativeResponse = zod'Full initiative returned to a caller, including members, tasks, and share state.');-/**- * @summary Assign tasks the caller can edit.- */-export const assignInitiativeTasksParams = zod.object({- initiative_id: zod.string().describe('Initiative identifier.'),-});--export const assignInitiativeTasksBody = zod- .object({- taskIds: zod- .array(zod.string())- .describe('Task ids to assign, in request order.'),- })- .describe('Assign-tasks HTTP body.');--export const assignInitiativeTasksResponse = zod- .object({- results: zod- .array(- zod- .object({- status: zod- .enum([- 'assigned',- 'moved',- 'notATask',- 'notFound',- 'skippedNoPermission',- ])- .describe('Status written onto one assign result.'),- taskId: zod.string().describe('Task id this outcome describes.'),- })- .describe('Per-task outcome of an assign call.')- )- .describe('Outcomes in request order after dedupe.'),- })- .describe('Assign-tasks HTTP response.');--/**- * @summary Unassign one task the caller can edit.- */-export const unassignInitiativeTaskParams = zod.object({- initiative_id: zod.string().describe('Initiative identifier.'),- task_id: zod.string().describe('Task identifier.'),-});--export const unassignInitiativeTaskResponse = zod.object({- success: zod.boolean().describe('Indicates if the request was successful'),-});-/*** @summary Gets the instructions document for the current user*/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.tsindex a0b2043ca8..67f4988cce 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@@ -1335,19 +1335,6 @@ export type InitiativeSharePermissionInput = {teamShareAccessLevel?: GraphqlEntityAccessLevel | null | undefined;};-/** Per-task result of an assignment request. */-export type InitiativeTaskAssignmentStatus =- /** Newly assigned or already assigned here. */- | 'ASSIGNED'- /** Moved from another initiative. */- | 'MOVED'- /** Document exists but is not a task. */- | 'NOT_A_TASK'- /** Task could not be found. */- | 'NOT_FOUND'- /** Viewer cannot edit this task. */- | 'SKIPPED_NO_PERMISSION';-/** Input for marking an email thread as seen. */export type MarkEmailThreadSeenInput = {/** Email thread to mark as seen. */@@ -1546,15 +1533,6 @@ export type SoupInput =| { continuation?: never; /** Start a new Soup query. */initial: SoupInitialInput; };-/** Visibility state of a task's initiative. */-export type TaskInitiativeReferenceState =- /** Visible task without an initiative. */- | 'NONE'- /** Task or initiative cannot be viewed. */- | 'UNAVAILABLE'- /** Both task and initiative can be viewed. */- | 'VISIBLE';-/** Input for applying option deltas across one entity's properties. */export type UpdateEntityPropertyOptionsInput = {/** Identifier of the entity whose properties are changing. */@@ -9236,13 +9214,6 @@ export type InitiativeQuery = { user: { id: string, initiative: { __typename: 'G| { __typename: 'GraphqlStringPropertyValue', stringValue: string }| null }>, sharePermission: { __typename: 'InitiativeSharePermission', id: string, owner: string, linkShare: InitiativeLinkShare | null, linkShareAccessLevel: GraphqlEntityAccessLevel | null, teamShareAccessLevel: GraphqlEntityAccessLevel | null, channelSharePermissions: Array<{ channelId: string, accessLevel: GraphqlEntityAccessLevel }> } } } };-export type TaskInitiativeReferencesQueryVariables = Exact<{- taskIds: Array<string | number> | string | number;-}>;---export type TaskInitiativeReferencesQuery = { user: { id: string, taskInitiativeReferences: Array<{ taskId: string, state: TaskInitiativeReferenceState, initiative: { __typename: 'GraphqlSoupInitiative', id: string, displayName: string | null } | null }> } };-export type CreateInitiativeMutationVariables = Exact<{input: CreateInitiativeInput;}>;@@ -9298,21 +9269,6 @@ export type DeleteInitiativeMutationVariables = Exact<{export type DeleteInitiativeMutation = { deleteInitiative: boolean };-export type AssignInitiativeTasksMutationVariables = Exact<{- initiativeId: string | number;- taskIds: Array<string | number> | string | number;-}>;---export type AssignInitiativeTasksMutation = { assignInitiativeTasks: Array<{ taskId: string, status: InitiativeTaskAssignmentStatus }> };--export type ClearTaskInitiativeMutationVariables = Exact<{- taskId: string | number;-}>;---export type ClearTaskInitiativeMutation = { clearTaskInitiative: boolean };-export type NotificationUpdatesSubscriptionVariables = Exact<{ [key: string]: never; }>;@@ -15831,13 +15787,10 @@ export const ReorderFavoritesDocument = {"kind":"Document","definitions":[{"kindexport const GroupSoupMembershipDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GroupSoupMembership"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"GroupedSoupInput"}}}}],"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":"groupSoup"},"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":"bins"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}},{"kind":"Field","name":{"kind":"Name","value":"nextCursor"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode<GroupSoupMembershipQuery, GroupSoupMembershipQueryVariables>;export const GroupSoupDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GroupSoup"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"GroupedSoupInput"}}}}],"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":"groupSoup"},"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":"bins"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}},{"kind":"Field","name":{"kind":"Name","value":"nextCursor"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupItemFields"}}]}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupEntityIdentityFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"isFavorited"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyValueFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlPropertyValue"}},"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":"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":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyValueFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"MailPreviewFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMailPreviewMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"subject"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"isDraft"}},{"kind":"Field","name":{"kind":"Name","value":"senderEmail"}},{"kind":"Field","name":{"kind":"Name","value":"senderName"}},{"kind":"Field","name":{"kind":"Name","value":"senderPhotoUrl"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"EmailDraftAggregateFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMailDraftAggregate"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"messageCount"}},{"kind":"Field","name":{"kind":"Name","value":"inboxVisible"}},{"kind":"Field","name":{"kind":"Name","value":"isRead"}},{"kind":"Field","name":{"kind":"Name","value":"isSignal"}},{"kind":"Field","name":{"kind":"Name","value":"hasCalendarAttachment"}},{"kind":"Field","name":{"kind":"Name","value":"latestInboundMessageTs"}},{"kind":"Field","name":{"kind":"Name","value":"latestNonSpamMessageTs"}},{"kind":"Field","name":{"kind":"Name","value":"latestOutboundMessageTs"}},{"kind":"Field","name":{"kind":"Name","value":"previewTs"}},{"kind":"Field","name":{"kind":"Name","value":"preview"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MailPreviewFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"EmailDraftStateFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMailDraftState"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"baseline"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EmailDraftAggregateFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"drafts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"macroDraft"}},{"kind":"Field","name":{"kind":"Name","value":"facts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EmailDraftAggregateFields"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupChannelMessageFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessagePreview"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"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"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupItemPreviewFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"cacheProjection"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}]},{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupEntityIdentityFields"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupAgentSession"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"sessionName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isArchived"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"harness"}},{"kind":"Field","name":{"kind":"Name","value":"repoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"repoBranch"}},{"kind":"Field","name":{"kind":"Name","value":"pullRequestUrl"}},{"kind":"Field","name":{"kind":"Name","value":"workingBranch"}},{"kind":"Field","name":{"kind":"Name","value":"pullRequestState"}},{"kind":"Field","name":{"kind":"Name","value":"pullRequestId"}},{"kind":"Field","name":{"kind":"Name","value":"turnState"}},{"kind":"Field","name":{"kind":"Name","value":"bot"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"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":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"frecencyScore"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupDatabaseRow"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"tableId"}},{"kind":"Field","name":{"kind":"Name","value":"databaseId"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"creatorId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"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":"GraphqlSoupInitiative"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"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":"viewerPermission"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAccessLevelPermission"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accessLevel"}}]}}]}},{"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":"GraphqlSoupDocument"}},"selectionSet":{"kind":"SelectionSet","selections":[{"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":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlTaskSubType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"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","alias":{"kind":"Name","value":"chatName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"model"}},{"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","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":"providerId"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"inboxVisible"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"latestInboundMessageTs"}},{"kind":"Field","name":{"kind":"Name","value":"mailDraftState"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EmailDraftStateFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"mailAllPreview"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MailPreviewFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"mailDraftPreview"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MailPreviewFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"mailSentPreview"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MailPreviewFields"}}]}},{"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":"isSignal"}},{"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":"__typename"}},{"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","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":"isParticipant"}},{"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":"GraphqlSoupChannelMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"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","alias":{"kind":"Name","value":"callChannelId"},"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":"Field","name":{"kind":"Name","value":"guests"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"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":"GraphqlSoupCrmCompany"}},"selectionSet":{"kind":"SelectionSet","selections":[{"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":"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":"sourceMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupReminder"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"reminderDescription"},"name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"scheduleType"}},{"kind":"Field","name":{"kind":"Name","value":"remindAt"}},{"kind":"Field","name":{"kind":"Name","value":"cron"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"nextRunAt"}},{"kind":"Field","name":{"kind":"Name","value":"enabled"}},{"kind":"Field","name":{"kind":"Name","value":"completedAt"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"referencedEntity"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"fileType"}},{"kind":"Field","name":{"kind":"Name","value":"subType"}}]}},{"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":"GraphqlSoupCalendarEvent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"calendarEventTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventStatus"},"name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"time"}},{"kind":"Field","name":{"kind":"Name","value":"conferenceUrl"}},{"kind":"Field","name":{"kind":"Name","value":"isReadOnly"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationStateFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNotification"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"eventType"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"sent"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationNavigationMetadataFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNotifEvent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMentionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMentionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionChannelType"},"name":{"kind":"Name","value":"channelType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDocumentMentionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"documentMentionDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionHasAttachments"},"name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionChannelType"},"name":{"kind":"Name","value":"channelType"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMentionedInDocumentCommentMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentMentionId"},"name":{"kind":"Name","value":"mentionId"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentCommentId"},"name":{"kind":"Name","value":"commentId"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlRepliedToDocumentCommentThreadMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadCommentId"},"name":{"kind":"Name","value":"commentId"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCommentedOnDocumentMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentCommentId"},"name":{"kind":"Name","value":"commentId"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlInitiativeDiscussionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionProjectName"},"name":{"kind":"Name","value":"projectName"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionReason"},"name":{"kind":"Name","value":"reason"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCrmDiscussionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionRecordName"},"name":{"kind":"Name","value":"recordName"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionReason"},"name":{"kind":"Name","value":"reason"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelInviteMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelInviteInvitedBy"},"name":{"kind":"Name","value":"invitedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"channelInviteChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelInviteMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelInviteSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMessageSendMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendSender"},"name":{"kind":"Name","value":"sender"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendChannelType"},"name":{"kind":"Name","value":"channelType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMessageReactionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionEmoji"},"name":{"kind":"Name","value":"emoji"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionChannelType"},"name":{"kind":"Name","value":"channelType"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelReplyMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelReplyThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyUserId"},"name":{"kind":"Name","value":"userId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyThreadParentSenderId"},"name":{"kind":"Name","value":"threadParentSenderId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyChannelType"},"name":{"kind":"Name","value":"channelType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCallStartedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"callStartedChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"callStartedSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNewEmailMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"newEmailSender"},"name":{"kind":"Name","value":"sender"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailToEmail"},"name":{"kind":"Name","value":"toEmail"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailSubject"},"name":{"kind":"Name","value":"subject"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailSnippet"},"name":{"kind":"Name","value":"snippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlInboxReauthRequiredMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"inboxReauthRequiredEmailAddress"},"name":{"kind":"Name","value":"emailAddress"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlInviteToTeamMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamTeamName"},"name":{"kind":"Name","value":"teamName"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamTeamInviteId"},"name":{"kind":"Name","value":"teamInviteId"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamInvitedBy"},"name":{"kind":"Name","value":"invitedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamRole"},"name":{"kind":"Name","value":"role"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlTaskAssignedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedTaskId"},"name":{"kind":"Name","value":"taskId"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedTaskName"},"name":{"kind":"Name","value":"taskName"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedAssignedBy"},"name":{"kind":"Name","value":"assignedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlReminderMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"reminderReminderId"},"name":{"kind":"Name","value":"reminderId"}},{"kind":"Field","alias":{"kind":"Name","value":"reminderDescription"},"name":{"kind":"Name","value":"description"}},{"kind":"Field","alias":{"kind":"Name","value":"reminderScheduledFor"},"name":{"kind":"Name","value":"scheduledFor"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCalendarEventReminderMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderEventId"},"name":{"kind":"Name","value":"eventId"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderOccurrenceKey"},"name":{"kind":"Name","value":"occurrenceKey"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderStartsAt"},"name":{"kind":"Name","value":"startsAt"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderEndsAt"},"name":{"kind":"Name","value":"endsAt"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderStartDate"},"name":{"kind":"Name","value":"startDate"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderTimeZone"},"name":{"kind":"Name","value":"timeZone"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderMinutesBefore"},"name":{"kind":"Name","value":"minutesBefore"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAiResponseMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"aiResponseSummary"},"name":{"kind":"Name","value":"summary"}},{"kind":"Field","alias":{"kind":"Name","value":"aiResponseMessageId"},"name":{"kind":"Name","value":"messageId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrStatusChangedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedStatus"},"name":{"kind":"Name","value":"status"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedAction"},"name":{"kind":"Name","value":"action"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedPreviousStatus"},"name":{"kind":"Name","value":"previousStatus"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedHeadBranch"},"name":{"kind":"Name","value":"headBranch"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedBaseBranch"},"name":{"kind":"Name","value":"baseBranch"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedMergedAt"},"name":{"kind":"Name","value":"mergedAt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrCheckRunMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckRunGithubId"},"name":{"kind":"Name","value":"checkRunGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckName"},"name":{"kind":"Name","value":"checkName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckStatus"},"name":{"kind":"Name","value":"checkStatus"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunConclusion"},"name":{"kind":"Name","value":"conclusion"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunState"},"name":{"kind":"Name","value":"state"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckUrl"},"name":{"kind":"Name","value":"checkUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCompletedAt"},"name":{"kind":"Name","value":"completedAt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubReviewRequestedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedRequestedReviewerGithubLogin"},"name":{"kind":"Name","value":"requestedReviewerGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedRequestedReviewerGithubUserId"},"name":{"kind":"Name","value":"requestedReviewerGithubUserId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrCommentMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentKind"},"name":{"kind":"Name","value":"commentKind"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentGithubId"},"name":{"kind":"Name","value":"commentGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentUrl"},"name":{"kind":"Name","value":"commentUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentSnippet"},"name":{"kind":"Name","value":"commentSnippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrMentionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionLocation"},"name":{"kind":"Name","value":"location"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionCommentGithubId"},"name":{"kind":"Name","value":"commentGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionCommentUrl"},"name":{"kind":"Name","value":"commentUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionTextSnippet"},"name":{"kind":"Name","value":"textSnippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrReviewMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewReviewGithubId"},"name":{"kind":"Name","value":"reviewGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewReviewUrl"},"name":{"kind":"Name","value":"reviewUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewState"},"name":{"kind":"Name","value":"state"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewReviewSnippet"},"name":{"kind":"Name","value":"reviewSnippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAgentSessionSettledMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledSession"},"name":{"kind":"Name","value":"session"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sessionId"}},{"kind":"Field","name":{"kind":"Name","value":"sessionName"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"botName"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"announcementMessageId"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledTurn"},"name":{"kind":"Name","value":"turn"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledActor"},"name":{"kind":"Name","value":"actor"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledStopReason"},"name":{"kind":"Name","value":"stopReason"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledExcerpt"},"name":{"kind":"Name","value":"excerpt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAgentSessionWaitingForInputMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"agentSessionWaitingForInputSession"},"name":{"kind":"Name","value":"session"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sessionId"}},{"kind":"Field","name":{"kind":"Name","value":"sessionName"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"botName"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"announcementMessageId"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionWaitingForInputTurn"},"name":{"kind":"Name","value":"turn"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionWaitingForInputQuestion"},"name":{"kind":"Name","value":"question"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAgentSessionMentionedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"agentSessionMentionedSession"},"name":{"kind":"Name","value":"session"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sessionId"}},{"kind":"Field","name":{"kind":"Name","value":"sessionName"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"botName"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"announcementMessageId"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionMentionedMentionedBy"},"name":{"kind":"Name","value":"mentionedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionMentionedActionId"},"name":{"kind":"Name","value":"actionId"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationMetadataFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNotifEvent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationNavigationMetadataFields"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMentionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMentionHasAttachments"},"name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMessageSendMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendHasAttachments"},"name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelReplyMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelReplyHasAttachments"},"name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplySenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplySenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNotification"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationStateFields"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationMetadataFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupItemPreviewFields"}},{"kind":"Field","name":{"kind":"Name","value":"notifications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationFields"}}]}}]}}]} as unknown as DocumentNode<GroupSoupQuery, GroupSoupQueryVariables>;export const InitiativeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Initiative"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"initiativeId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"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":"initiative"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"initiativeId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"initiativeId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"InitiativeDetailFields"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyValueFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlPropertyValue"}},"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":"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":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyValueFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"InitiativeDetailFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupInitiative"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewerPermission"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAccessLevelPermission"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accessLevel"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"taskCount"}},{"kind":"Field","name":{"kind":"Name","value":"completedTaskCount"}},{"kind":"Field","name":{"kind":"Name","value":"memberIds"}},{"kind":"Field","name":{"kind":"Name","value":"taskIds"}},{"kind":"Field","name":{"kind":"Name","value":"sharePermission"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"owner"}},{"kind":"Field","name":{"kind":"Name","value":"linkShare"}},{"kind":"Field","name":{"kind":"Name","value":"linkShareAccessLevel"}},{"kind":"Field","name":{"kind":"Name","value":"teamShareAccessLevel"}},{"kind":"Field","name":{"kind":"Name","value":"channelSharePermissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"accessLevel"}}]}}]}}]}}]} as unknown as DocumentNode<InitiativeQuery, InitiativeQueryVariables>;-export const TaskInitiativeReferencesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"TaskInitiativeReferences"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"taskIds"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}}}],"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":"taskInitiativeReferences"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"taskIds"},"value":{"kind":"Variable","name":{"kind":"Name","value":"taskIds"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"taskId"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"initiative"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}}]}}]}}]}}]}}]} as unknown as DocumentNode<TaskInitiativeReferencesQuery, TaskInitiativeReferencesQueryVariables>;export const CreateInitiativeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateInitiative"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateInitiativeInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createInitiative"},"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":"InitiativeDetailFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyValueFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlPropertyValue"}},"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":"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":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyValueFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"InitiativeDetailFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupInitiative"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewerPermission"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAccessLevelPermission"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accessLevel"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"taskCount"}},{"kind":"Field","name":{"kind":"Name","value":"completedTaskCount"}},{"kind":"Field","name":{"kind":"Name","value":"memberIds"}},{"kind":"Field","name":{"kind":"Name","value":"taskIds"}},{"kind":"Field","name":{"kind":"Name","value":"sharePermission"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"owner"}},{"kind":"Field","name":{"kind":"Name","value":"linkShare"}},{"kind":"Field","name":{"kind":"Name","value":"linkShareAccessLevel"}},{"kind":"Field","name":{"kind":"Name","value":"teamShareAccessLevel"}},{"kind":"Field","name":{"kind":"Name","value":"channelSharePermissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"accessLevel"}}]}}]}}]}}]} as unknown as DocumentNode<CreateInitiativeMutation, CreateInitiativeMutationVariables>;export const UpdateInitiativeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateInitiative"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"initiativeId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateInitiativeInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateInitiative"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"initiativeId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"initiativeId"}}},{"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":"InitiativeDetailFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyValueFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlPropertyValue"}},"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":"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":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyValueFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"InitiativeDetailFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupInitiative"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewerPermission"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAccessLevelPermission"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accessLevel"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"taskCount"}},{"kind":"Field","name":{"kind":"Name","value":"completedTaskCount"}},{"kind":"Field","name":{"kind":"Name","value":"memberIds"}},{"kind":"Field","name":{"kind":"Name","value":"taskIds"}},{"kind":"Field","name":{"kind":"Name","value":"sharePermission"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"owner"}},{"kind":"Field","name":{"kind":"Name","value":"linkShare"}},{"kind":"Field","name":{"kind":"Name","value":"linkShareAccessLevel"}},{"kind":"Field","name":{"kind":"Name","value":"teamShareAccessLevel"}},{"kind":"Field","name":{"kind":"Name","value":"channelSharePermissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"accessLevel"}}]}}]}}]}}]} as unknown as DocumentNode<UpdateInitiativeMutation, UpdateInitiativeMutationVariables>;export const EnsureInitiativeDescriptionSurfaceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"EnsureInitiativeDescriptionSurface"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"initiativeId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ensureInitiativeDescriptionSurface"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"initiativeId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"initiativeId"}}}]}]}}]} as unknown as DocumentNode<EnsureInitiativeDescriptionSurfaceMutation, EnsureInitiativeDescriptionSurfaceMutationVariables>;export const DeleteInitiativeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteInitiative"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"initiativeId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteInitiative"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"initiativeId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"initiativeId"}}}]}]}}]} as unknown as DocumentNode<DeleteInitiativeMutation, DeleteInitiativeMutationVariables>;-export const AssignInitiativeTasksDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"AssignInitiativeTasks"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"initiativeId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"taskIds"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"assignInitiativeTasks"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"initiativeId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"initiativeId"}}},{"kind":"Argument","name":{"kind":"Name","value":"taskIds"},"value":{"kind":"Variable","name":{"kind":"Name","value":"taskIds"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"taskId"}},{"kind":"Field","name":{"kind":"Name","value":"status"}}]}}]}}]} as unknown as DocumentNode<AssignInitiativeTasksMutation, AssignInitiativeTasksMutationVariables>;-export const ClearTaskInitiativeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ClearTaskInitiative"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"taskId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"clearTaskInitiative"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"taskId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"taskId"}}}]}]}}]} as unknown as DocumentNode<ClearTaskInitiativeMutation, ClearTaskInitiativeMutationVariables>;export const NotificationUpdatesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"subscription","name":{"kind":"Name","value":"NotificationUpdates"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"notificationUpdates"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNewNotification"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"notification"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlUpdatedNotification"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"notification"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCacheDeletion"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"graphqlTypeName"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationStateFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNotification"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"eventType"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"sent"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationNavigationMetadataFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNotifEvent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMentionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMentionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionChannelType"},"name":{"kind":"Name","value":"channelType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDocumentMentionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"documentMentionDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionHasAttachments"},"name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionChannelType"},"name":{"kind":"Name","value":"channelType"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMentionedInDocumentCommentMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentMentionId"},"name":{"kind":"Name","value":"mentionId"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentCommentId"},"name":{"kind":"Name","value":"commentId"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlRepliedToDocumentCommentThreadMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadCommentId"},"name":{"kind":"Name","value":"commentId"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCommentedOnDocumentMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentCommentId"},"name":{"kind":"Name","value":"commentId"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlInitiativeDiscussionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionProjectName"},"name":{"kind":"Name","value":"projectName"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionReason"},"name":{"kind":"Name","value":"reason"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCrmDiscussionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionRecordName"},"name":{"kind":"Name","value":"recordName"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionReason"},"name":{"kind":"Name","value":"reason"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelInviteMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelInviteInvitedBy"},"name":{"kind":"Name","value":"invitedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"channelInviteChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelInviteMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelInviteSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMessageSendMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendSender"},"name":{"kind":"Name","value":"sender"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendChannelType"},"name":{"kind":"Name","value":"channelType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMessageReactionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionEmoji"},"name":{"kind":"Name","value":"emoji"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionChannelType"},"name":{"kind":"Name","value":"channelType"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelReplyMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelReplyThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyUserId"},"name":{"kind":"Name","value":"userId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyThreadParentSenderId"},"name":{"kind":"Name","value":"threadParentSenderId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyChannelType"},"name":{"kind":"Name","value":"channelType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCallStartedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"callStartedChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"callStartedSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNewEmailMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"newEmailSender"},"name":{"kind":"Name","value":"sender"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailToEmail"},"name":{"kind":"Name","value":"toEmail"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailSubject"},"name":{"kind":"Name","value":"subject"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailSnippet"},"name":{"kind":"Name","value":"snippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlInboxReauthRequiredMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"inboxReauthRequiredEmailAddress"},"name":{"kind":"Name","value":"emailAddress"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlInviteToTeamMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamTeamName"},"name":{"kind":"Name","value":"teamName"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamTeamInviteId"},"name":{"kind":"Name","value":"teamInviteId"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamInvitedBy"},"name":{"kind":"Name","value":"invitedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamRole"},"name":{"kind":"Name","value":"role"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlTaskAssignedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedTaskId"},"name":{"kind":"Name","value":"taskId"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedTaskName"},"name":{"kind":"Name","value":"taskName"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedAssignedBy"},"name":{"kind":"Name","value":"assignedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlReminderMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"reminderReminderId"},"name":{"kind":"Name","value":"reminderId"}},{"kind":"Field","alias":{"kind":"Name","value":"reminderDescription"},"name":{"kind":"Name","value":"description"}},{"kind":"Field","alias":{"kind":"Name","value":"reminderScheduledFor"},"name":{"kind":"Name","value":"scheduledFor"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCalendarEventReminderMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderEventId"},"name":{"kind":"Name","value":"eventId"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderOccurrenceKey"},"name":{"kind":"Name","value":"occurrenceKey"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderStartsAt"},"name":{"kind":"Name","value":"startsAt"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderEndsAt"},"name":{"kind":"Name","value":"endsAt"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderStartDate"},"name":{"kind":"Name","value":"startDate"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderTimeZone"},"name":{"kind":"Name","value":"timeZone"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderMinutesBefore"},"name":{"kind":"Name","value":"minutesBefore"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAiResponseMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"aiResponseSummary"},"name":{"kind":"Name","value":"summary"}},{"kind":"Field","alias":{"kind":"Name","value":"aiResponseMessageId"},"name":{"kind":"Name","value":"messageId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrStatusChangedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedStatus"},"name":{"kind":"Name","value":"status"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedAction"},"name":{"kind":"Name","value":"action"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedPreviousStatus"},"name":{"kind":"Name","value":"previousStatus"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedHeadBranch"},"name":{"kind":"Name","value":"headBranch"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedBaseBranch"},"name":{"kind":"Name","value":"baseBranch"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedMergedAt"},"name":{"kind":"Name","value":"mergedAt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrCheckRunMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckRunGithubId"},"name":{"kind":"Name","value":"checkRunGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckName"},"name":{"kind":"Name","value":"checkName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckStatus"},"name":{"kind":"Name","value":"checkStatus"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunConclusion"},"name":{"kind":"Name","value":"conclusion"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunState"},"name":{"kind":"Name","value":"state"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckUrl"},"name":{"kind":"Name","value":"checkUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCompletedAt"},"name":{"kind":"Name","value":"completedAt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubReviewRequestedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedRequestedReviewerGithubLogin"},"name":{"kind":"Name","value":"requestedReviewerGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedRequestedReviewerGithubUserId"},"name":{"kind":"Name","value":"requestedReviewerGithubUserId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrCommentMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentKind"},"name":{"kind":"Name","value":"commentKind"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentGithubId"},"name":{"kind":"Name","value":"commentGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentUrl"},"name":{"kind":"Name","value":"commentUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentSnippet"},"name":{"kind":"Name","value":"commentSnippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrMentionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionLocation"},"name":{"kind":"Name","value":"location"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionCommentGithubId"},"name":{"kind":"Name","value":"commentGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionCommentUrl"},"name":{"kind":"Name","value":"commentUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionTextSnippet"},"name":{"kind":"Name","value":"textSnippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrReviewMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewReviewGithubId"},"name":{"kind":"Name","value":"reviewGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewReviewUrl"},"name":{"kind":"Name","value":"reviewUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewState"},"name":{"kind":"Name","value":"state"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewReviewSnippet"},"name":{"kind":"Name","value":"reviewSnippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAgentSessionSettledMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledSession"},"name":{"kind":"Name","value":"session"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sessionId"}},{"kind":"Field","name":{"kind":"Name","value":"sessionName"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"botName"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"announcementMessageId"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledTurn"},"name":{"kind":"Name","value":"turn"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledActor"},"name":{"kind":"Name","value":"actor"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledStopReason"},"name":{"kind":"Name","value":"stopReason"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledExcerpt"},"name":{"kind":"Name","value":"excerpt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAgentSessionWaitingForInputMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"agentSessionWaitingForInputSession"},"name":{"kind":"Name","value":"session"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sessionId"}},{"kind":"Field","name":{"kind":"Name","value":"sessionName"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"botName"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"announcementMessageId"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionWaitingForInputTurn"},"name":{"kind":"Name","value":"turn"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionWaitingForInputQuestion"},"name":{"kind":"Name","value":"question"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAgentSessionMentionedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"agentSessionMentionedSession"},"name":{"kind":"Name","value":"session"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sessionId"}},{"kind":"Field","name":{"kind":"Name","value":"sessionName"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"botName"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"announcementMessageId"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionMentionedMentionedBy"},"name":{"kind":"Name","value":"mentionedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionMentionedActionId"},"name":{"kind":"Name","value":"actionId"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationMetadataFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNotifEvent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationNavigationMetadataFields"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMentionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMentionHasAttachments"},"name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMessageSendMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendHasAttachments"},"name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelReplyMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelReplyHasAttachments"},"name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplySenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplySenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNotification"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationStateFields"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationMetadataFields"}}]}}]}}]} as unknown as DocumentNode<NotificationUpdatesSubscription, NotificationUpdatesSubscriptionVariables>;export const ItemPreviewNameCacheWriteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ItemPreviewNameCacheWrite"},"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":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupDocument"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"documentName"},"name":{"kind":"Name","value":"name"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChat"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"chatName"},"name":{"kind":"Name","value":"name"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupProject"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"projectName"},"name":{"kind":"Name","value":"name"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannel"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelDisplayName"},"name":{"kind":"Name","value":"name"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCall"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"customName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCrmCompany"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"companyName"},"name":{"kind":"Name","value":"name"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEmailThread"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"emailName"},"name":{"kind":"Name","value":"name"}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode<ItemPreviewNameCacheWriteQuery, ItemPreviewNameCacheWriteQueryVariables>;export const ItemPreviewFileTypeCacheWriteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ItemPreviewFileTypeCacheWrite"},"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":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupDocument"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fileType"}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode<ItemPreviewFileTypeCacheWriteQuery, ItemPreviewFileTypeCacheWriteQueryVariables>;diff --git a/apps/web/src/lib/service-clients/service-storage/graphql/initiatives.graphql b/apps/web/src/lib/service-clients/service-storage/graphql/initiatives.graphqlindex 05189a86aa..f4381b9560 100644--- a/apps/web/src/lib/service-clients/service-storage/graphql/initiatives.graphql+++ b/apps/web/src/lib/service-clients/service-storage/graphql/initiatives.graphql@@ -43,21 +43,6 @@ query Initiative($initiativeId: ID!) {}}-query TaskInitiativeReferences($taskIds: [ID!]!) {- user {- id- taskInitiativeReferences(taskIds: $taskIds) {- taskId- state- initiative {- __typename- id- displayName- }- }- }-}-mutation CreateInitiative($input: CreateInitiativeInput!) {createInitiative(input: $input) {...InitiativeDetailFields@@ -77,14 +62,3 @@ mutation EnsureInitiativeDescriptionSurface($initiativeId: ID!) {mutation DeleteInitiative($initiativeId: ID!) {deleteInitiative(initiativeId: $initiativeId)}--mutation AssignInitiativeTasks($initiativeId: ID!, $taskIds: [ID!]!) {- assignInitiativeTasks(initiativeId: $initiativeId, taskIds: $taskIds) {- taskId- status- }-}--mutation ClearTaskInitiative($taskId: ID!) {- clearTaskInitiative(taskId: $taskId)-}diff --git a/apps/web/src/lib/service-clients/service-storage/initiative.test.ts b/apps/web/src/lib/service-clients/service-storage/initiative.test.tsindex 9d99e31816..8ef7095dac 100644--- a/apps/web/src/lib/service-clients/service-storage/initiative.test.ts+++ b/apps/web/src/lib/service-clients/service-storage/initiative.test.ts@@ -148,56 +148,4 @@ describe('initiative GraphQL transport', () => {const result = await client.get('project-1', controller.signal);expect(result.isErr()).toBe(true);});-- it('does not expose a restricted task relationship', async () => {- const { client, requests } = clientWith(() => ({- data: {- user: {- taskInitiativeReferences: [- { taskId: 'task-1', state: 'UNAVAILABLE', initiative: null },- {- taskId: 'task-2',- state: 'VISIBLE',- initiative: {- __typename: 'GraphqlSoupInitiative',- id: 'project-1',- displayName: 'Launch',- },- },- ],- },- },- }));- const result = await client.taskReferences(['task-1', 'task-2']);- expect(requests[0].variables).toEqual({ taskIds: ['task-1', 'task-2'] });- expect(result.isOk() && result.value.references).toEqual([- { taskId: 'task-1', state: 'unavailable', initiative: null },- {- taskId: 'task-2',- state: 'visible',- initiative: { id: 'project-1', name: 'Launch' },- },- ]);- });-- it('preserves per-task failures instead of treating a batch response as full success', async () => {- const { client, requests } = clientWith(() => ({- data: {- assignInitiativeTasks: [- { taskId: 'task-1', status: 'MOVED' },- { taskId: 'task-2', status: 'SKIPPED_NO_PERMISSION' },- { taskId: 'task-3', status: 'NOT_A_TASK' },- ],- },- }));- const result = await client.assignTasks('project-1', {- taskIds: ['task-1', 'task-2', 'task-3'],- });- expect(requests[0].kind).toBe('mutation');- expect(result.isOk() && result.value.results).toEqual([- { taskId: 'task-1', status: 'moved' },- { taskId: 'task-2', status: 'skippedNoPermission' },- { taskId: 'task-3', status: 'notATask' },- ]);- });});diff --git a/apps/web/src/lib/service-clients/service-storage/initiative.ts b/apps/web/src/lib/service-clients/service-storage/initiative.tsindex f0d962dd03..1665e71be4 100644--- a/apps/web/src/lib/service-clients/service-storage/initiative.ts+++ b/apps/web/src/lib/service-clients/service-storage/initiative.ts@@ -6,8 +6,6 @@ import type {OperationResult,} from '@urql/core';import {- AssignInitiativeTasksDocument,- ClearTaskInitiativeDocument,CreateInitiativeDocument,type CreateInitiativeInput,DeleteInitiativeDocument,@@ -16,7 +14,6 @@ import {type InitiativeDetailFieldsFragment,InitiativeDocument,type InitiativeLinkShare,- TaskInitiativeReferencesDocument,UpdateInitiativeDocument,type UpdateInitiativeInput,} from './graphql/generated/graphql';@@ -54,23 +51,11 @@ const ACCESS_TO_GRAPHQL = {edit: 'EDIT',owner: 'OWNER',} as const;-const ASSIGNMENT_FROM_GRAPHQL = {- ASSIGNED: 'assigned',- MOVED: 'moved',- NOT_A_TASK: 'notATask',- NOT_FOUND: 'notFound',- SKIPPED_NO_PERMISSION: 'skippedNoPermission',-} as const;const OPERATION_TO_GRAPHQL = {add: 'ADD',remove: 'REMOVE',replace: 'REPLACE',} as const;-const REFERENCE_FROM_GRAPHQL = {- NONE: 'none',- UNAVAILABLE: 'unavailable',- VISIBLE: 'visible',-} as const;export function mapInitiativeDetail(project: InitiativeDetailFieldsFragment) {const sharing = project.sharePermission;@@ -194,21 +179,6 @@ export function createInitiativeClient(client: () => Client) {.initiative)),- taskReferences: (taskIds: string[], signal?: AbortSignal) =>- catchToResult(async () => ({- references: (- await query(TaskInitiativeReferencesDocument, { taskIds }, signal)- ).user.taskInitiativeReferences.map((reference) => ({- taskId: reference.taskId,- state: REFERENCE_FROM_GRAPHQL[reference.state],- initiative: reference.initiative- ? {- id: reference.initiative.id,- name: reference.initiative.displayName ?? 'Untitled project',- }- : null,- })),- })),create: (input: CreateInitiativeInput) =>catchToResult(async () =>mapInitiativeDetail(@@ -242,24 +212,6 @@ export function createInitiativeClient(client: () => Client) {(await mutation(DeleteInitiativeDocument, { initiativeId: id })).deleteInitiative),- assignTasks: (id: string, input: { taskIds: string[] }) =>- catchToResult(async () => ({- results: (- await mutation(AssignInitiativeTasksDocument, {- initiativeId: id,- taskIds: input.taskIds,- })- ).assignInitiativeTasks.map((result) => ({- taskId: result.taskId,- status: ASSIGNMENT_FROM_GRAPHQL[result.status],- })),- })),- removeTask: (taskId: string) =>- catchToResult(- async () =>- (await mutation(ClearTaskInitiativeDocument, { taskId }))- .clearTaskInitiative- ),};}diff --git a/apps/web/src/lib/service-clients/service-storage/openapi.json b/apps/web/src/lib/service-clients/service-storage/openapi.jsonindex 6855ffe243..8afacdf6af 100644--- a/apps/web/src/lib/service-clients/service-storage/openapi.json+++ b/apps/web/src/lib/service-clients/service-storage/openapi.json@@ -12077,165 +12077,6 @@}}},- "/initiatives/{initiative_id}/tasks": {- "put": {- "tags": ["initiative"],- "summary": "Assign tasks the caller can edit.",- "operationId": "assign_initiative_tasks",- "parameters": [- {- "name": "initiative_id",- "in": "path",- "description": "Initiative identifier.",- "required": true,- "schema": {- "type": "string"- }- }- ],- "requestBody": {- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/AssignTasksRequest"- }- }- },- "required": true- },- "responses": {- "200": {- "description": "",- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/AssignTasksResponse"- }- }- }- },- "400": {- "description": "",- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/ErrorResponse"- }- }- }- },- "401": {- "description": "Missing or invalid credentials",- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/ErrorResponse"- }- }- }- },- "404": {- "description": "",- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/ErrorResponse"- }- }- }- },- "500": {- "description": "",- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/ErrorResponse"- }- }- }- }- }- }- },- "/initiatives/{initiative_id}/tasks/{task_id}": {- "delete": {- "tags": ["initiative"],- "summary": "Unassign one task the caller can edit.",- "operationId": "unassign_initiative_task",- "parameters": [- {- "name": "initiative_id",- "in": "path",- "description": "Initiative identifier.",- "required": true,- "schema": {- "type": "string"- }- },- {- "name": "task_id",- "in": "path",- "description": "Task identifier.",- "required": true,- "schema": {- "type": "string"- }- }- ],- "responses": {- "200": {- "description": "",- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/GenericSuccessResponse"- }- }- }- },- "400": {- "description": "",- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/ErrorResponse"- }- }- }- },- "401": {- "description": "Missing or invalid credentials",- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/ErrorResponse"- }- }- }- },- "404": {- "description": "",- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/ErrorResponse"- }- }- }- },- "500": {- "description": "",- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/ErrorResponse"- }- }- }- }- }- }- },"/instructions": {"get": {"tags": ["instructions::get_instructions"],@@ -17795,60 +17636,6 @@}}},- "AssignTaskStatus": {- "type": "string",- "description": "Status written onto one assign result.",- "enum": [- "assigned",- "moved",- "notATask",- "notFound",- "skippedNoPermission"- ]- },- "AssignTasksRequest": {- "type": "object",- "description": "Assign-tasks HTTP body.",- "required": ["taskIds"],- "properties": {- "taskIds": {- "type": "array",- "items": {- "type": "string"- },- "description": "Task ids to assign, in request order."- }- }- },- "AssignTasksResponse": {- "type": "object",- "description": "Assign-tasks HTTP response.",- "required": ["results"],- "properties": {- "results": {- "type": "array",- "items": {- "$ref": "#/components/schemas/AssignTasksResult"- },- "description": "Outcomes in request order after dedupe."- }- }- },- "AssignTasksResult": {- "type": "object",- "description": "Per-task outcome of an assign call.",- "required": ["taskId", "status"],- "properties": {- "status": {- "$ref": "#/components/schemas/AssignTaskStatus",- "description": "What happened to the task."- },- "taskId": {- "type": "string",- "description": "Task id this outcome describes."- }- }- },"AttachmentChange": {"oneOf": [{diff --git a/crates/agent_trigger/Cargo.toml b/crates/agent_trigger/Cargo.tomlindex d3f1940fd6..1c74452a20 100644--- a/crates/agent_trigger/Cargo.toml+++ b/crates/agent_trigger/Cargo.toml@@ -41,6 +41,7 @@ properties = { path = "../properties", default-features = false }initiative = { path = "../initiative", default-features = false, features = ["ports"] }models_properties = { path = "../models_properties" }system_properties = { path = "../system_properties" }+rootcause = { workspace = true }# Domain vocabulary: channel-parent trigger events keep the channel-only post# shape, and the channel topic's `message_posted` can still feed the trigger.channels = { path = "../channels", default-features = false }diff --git a/crates/agent_trigger/src/domain/project_assignment.rs b/crates/agent_trigger/src/domain/project_assignment.rsindex c7203e3bf8..70fd9ec60c 100644--- a/crates/agent_trigger/src/domain/project_assignment.rs+++ b/crates/agent_trigger/src/domain/project_assignment.rs@@ -2,20 +2,75 @@use std::collections::HashMap;+use channel_sender::ChannelSender;use entity_access::domain::{models::{AccessError, BotAccessScope, EntityAccessReceipt, EntityType, RequiredPermission},ports::EntityAccessService,};use initiative::domain::{- events::{InitiativeEventActor, InitiativeTasksChanged},+ events::InitiativeEventActor,models::{InitiativeError, InitiativeId},- ports::InitiativeRepo,};+use models_properties::{EntityType as PropertyEntityType, service::property_value::PropertyValue};+use properties::domain::events::EntityPropertyUpdatedMetadata;use properties::{EditReceipt, PropertiesErr, PropertiesService, ViewReceipt};+use system_properties::{SystemPropertiesService, SystemPropertyKey};#[cfg(test)]mod test;+/// A task that joined a project: its Project property now names a different project.+#[derive(Debug, Clone, PartialEq, Eq)]+pub struct ProjectTaskAdded {+ /// Task that joined the project.+ pub task_id: String,+ /// Project the task joined.+ pub project_id: InitiativeId,+ /// Who set the property.+ pub actor: InitiativeEventActor,+}++impl ProjectTaskAdded {+ /// Ignore other properties, removals, unchanged saves, and unattributed writes.+ pub fn from_update(updated: &EntityPropertyUpdatedMetadata) -> Option<Self> {+ if updated.entity_type != PropertyEntityType::Task+ || updated.property_definition_id != SystemPropertyKey::PROJECT_UUID+ {+ return None;+ }+ let project_id = project_of(updated.value.as_ref())?;+ if project_of(updated.previous_value.as_ref()) == Some(project_id) {+ return None;+ }+ let actor = match (&updated.actor, &updated.actor_user_id) {+ (Some(actor), _) => InitiativeEventActor {+ actor: actor.clone(),+ on_behalf_of: updated.on_behalf_of.clone(),+ },+ (None, Some(user)) => InitiativeEventActor {+ actor: ChannelSender::new_from_user(user.clone()),+ on_behalf_of: None,+ },+ (None, None) => return None,+ };+ Some(Self {+ task_id: updated.entity_id.clone(),+ project_id,+ actor,+ })+ }+}++fn project_of(value: Option<&PropertyValue>) -> Option<InitiativeId> {+ let Some(PropertyValue::EntityRef(references)) = value else {+ return None;+ };+ references+ .iter()+ .find(|reference| reference.entity_type == PropertyEntityType::Initiative)+ .and_then(|reference| reference.entity_id.parse().ok())+}+/// Failure to read or apply a project assignment; the consumer retries the event.#[derive(Debug, thiserror::Error)]pub enum ProjectAssignmentError {@@ -40,12 +95,18 @@ pub trait ProjectMemberships: Send + Sync {) -> impl Future<Output = Result<HashMap<String, InitiativeId>, InitiativeError>> + Send;}-impl<R: InitiativeRepo> ProjectMemberships for R {+impl<S: SystemPropertiesService> ProjectMemberships for S {async fn memberships(&self,tasks: Vec<String>,) -> Result<HashMap<String, InitiativeId>, InitiativeError> {- self.task_memberships(tasks).await.map_err(Into::into)+ Ok(self+ .task_projects(tasks)+ .await+ .map_err(|error| InitiativeError::Internal(rootcause::report!(error).into()))?+ .into_iter()+ .map(|(task, project)| (task, InitiativeId::from_uuid(project)))+ .collect())}}@@ -164,81 +225,58 @@ impl<P: ProjectAgentInheritance, I: ProjectMemberships, A: ProjectAssignmentAcce}}- /// Recheck queued membership changes before inheriting the destination's agents.+ /// Recheck a queued addition before inheriting the destination's agents.#[tracing::instrument(err, skip_all)]- pub async fn process(- &self,- event: &InitiativeTasksChanged,- ) -> Result<(), ProjectAssignmentError> {- let Some(attribution) = &event.attribution else {- return Ok(());- };- let Some(_) = attribution+ pub async fn process(&self, added: &ProjectTaskAdded) -> Result<(), ProjectAssignmentError> {+ let Some(_) = added+ .actor.actor.as_user()- .or(attribution.on_behalf_of.as_ref())+ .or(added.actor.on_behalf_of.as_ref())else {return Ok(());};- let additions: Vec<_> = event- .changes- .iter()- .filter(|change| change.to.is_some() && change.to != change.from)- .collect();- if additions.is_empty() {- return Ok(());- }let memberships = self.initiatives- .memberships(- additions- .iter()- .map(|change| change.task_id.clone())- .collect(),- )+ .memberships(vec![added.task_id.clone()]).await?;- for change in additions {- let Some(project_id) = change- .to- .filter(|id| memberships.get(&change.task_id) == Some(id))- else {- continue;- };- let Some((project, task)) = self- .access- .receipts(attribution, project_id, &change.task_id)- .await?- else {- continue;- };- match self.properties.inherit(&project, &task).await {- Ok(()) => {}- Err(- error- @ (PropertiesErr::Repo(_) | PropertiesErr::PermissionServiceNotConfigured),- ) => {- return Err(error.into());- }- Err(- error @ (PropertiesErr::Validation(_)- | PropertiesErr::PermissionDenied- | PropertiesErr::NotFound- | PropertiesErr::OptionNotFound- | PropertiesErr::EntityPropertyNotFound- | PropertiesErr::RequiredProperty- | PropertiesErr::DuplicateOptionValue- | PropertiesErr::ConflictingTeamLabel(_)- | PropertiesErr::SystemPropertyNotModifiable- | PropertiesErr::TeamMembershipRequired- | PropertiesErr::ManagedDefinition),- ) => {- tracing::warn!(- error = ?error,- task_id = %change.task_id,- project_id = %project_id,- "skipping invalid project agent assignment"- );- }+ // A later move or removal supersedes this addition.+ if memberships.get(&added.task_id) != Some(&added.project_id) {+ return Ok(());+ }+ let Some((project, task)) = self+ .access+ .receipts(&added.actor, added.project_id, &added.task_id)+ .await?+ else {+ return Ok(());+ };+ match self.properties.inherit(&project, &task).await {+ Ok(()) => {}+ Err(+ error @ (PropertiesErr::Repo(_) | PropertiesErr::PermissionServiceNotConfigured),+ ) => {+ return Err(error.into());+ }+ Err(+ error @ (PropertiesErr::Validation(_)+ | PropertiesErr::PermissionDenied+ | PropertiesErr::NotFound+ | PropertiesErr::OptionNotFound+ | PropertiesErr::EntityPropertyNotFound+ | PropertiesErr::RequiredProperty+ | PropertiesErr::DuplicateOptionValue+ | PropertiesErr::ConflictingTeamLabel(_)+ | PropertiesErr::SystemPropertyNotModifiable+ | PropertiesErr::TeamMembershipRequired+ | PropertiesErr::ManagedDefinition),+ ) => {+ tracing::warn!(+ error = ?error,+ task_id = %added.task_id,+ project_id = %added.project_id,+ "skipping invalid project agent assignment"+ );}}Ok(())diff --git a/crates/agent_trigger/src/domain/project_assignment/test.rs b/crates/agent_trigger/src/domain/project_assignment/test.rsindex 84a7df414a..41def8040e 100644--- a/crates/agent_trigger/src/domain/project_assignment/test.rs+++ b/crates/agent_trigger/src/domain/project_assignment/test.rs@@ -4,24 +4,47 @@ use chrono::Utc;use entity_access::domain::models::{AccessLevel, Entity, EntityAccessReceipt, EntityPermission, RequiredPermission,};-use initiative::domain::events::{InitiativeEventActor, TaskMembershipChange};+use initiative::domain::events::InitiativeEventActor;use macro_user_id::user_id::MacroUserIdStr;+use macro_uuid::Uuid;+use models_properties::shared::EntityReference;fn user() -> MacroUserIdStr<'static> {MacroUserIdStr::try_from_email("[email protected]").unwrap()}-fn event(changes: Vec<TaskMembershipChange>) -> InitiativeTasksChanged {- InitiativeTasksChanged {- attribution: Some(InitiativeEventActor {- actor: ChannelSender::new_from_user(user()),- on_behalf_of: None,- }),- changes,- occurred_at: Utc::now(),+fn project_value(project: Option<InitiativeId>) -> Option<PropertyValue> {+ project.map(|project| {+ PropertyValue::EntityRef(vec![EntityReference {+ entity_id: project.to_string(),+ entity_type: PropertyEntityType::Initiative,+ specific_message_id: None,+ }])+ })+}++fn update(+ previous: Option<InitiativeId>,+ project: Option<InitiativeId>,+) -> EntityPropertyUpdatedMetadata {+ EntityPropertyUpdatedMetadata {+ entity_property_id: Uuid::now_v7(),+ entity_id: "task".to_owned(),+ entity_type: PropertyEntityType::Task,+ property_definition_id: SystemPropertyKey::PROJECT_UUID,+ actor_user_id: Some(user()),+ actor: None,+ on_behalf_of: None,+ value: project_value(project),+ previous_value: project_value(previous),+ updated_at: Utc::now(),}}+fn added(project: InitiativeId) -> ProjectTaskAdded {+ ProjectTaskAdded::from_update(&update(None, Some(project))).unwrap()+}+fn receipt<T: RequiredPermission>(id: String, entity_type: EntityType) -> EntityAccessReceipt<T> {EntityAccessReceipt::try_new_authenticated_user(user(),@@ -50,198 +73,151 @@ fn allowed_receipts(Box::pin(async move { Ok(Some(receipts)) })}-#[tokio::test]-async fn new_tasks_and_moves_inherit_independently_with_their_own_receipts() {- let project = InitiativeId::generate();- let previous = InitiativeId::generate();- let event = event(vec![- TaskMembershipChange {- task_id: "new-task".into(),- from: None,- to: Some(project),- },- TaskMembershipChange {- task_id: "moved-task".into(),- from: Some(previous),- to: Some(project),- },- ]);+fn current_membership(project: Option<InitiativeId>) -> MockProjectMemberships {let mut memberships = MockProjectMemberships::new();memberships.expect_memberships().once()- .withf(|ids| ids == &["new-task", "moved-task"])+ .withf(|ids| ids == &["task"]).return_once(move |_| {Box::pin(async move {- Ok(HashMap::from([- ("new-task".into(), project),- ("moved-task".into(), project),- ]))+ Ok(project+ .map(|project| HashMap::from([("task".to_owned(), project)]))+ .unwrap_or_default())})});+ memberships+}++#[test]+fn additions_and_moves_are_read_from_project_updates() {+ let project = InitiativeId::generate();+ let previous = InitiativeId::generate();++ let joined = ProjectTaskAdded::from_update(&update(None, Some(project))).unwrap();+ assert_eq!(joined.task_id, "task");+ assert_eq!(joined.project_id, project);+ assert_eq!(joined.actor.actor.as_user(), Some(&user()));+ assert_eq!(joined.actor.on_behalf_of, None);+ assert_eq!(+ ProjectTaskAdded::from_update(&update(Some(previous), Some(project)))+ .unwrap()+ .project_id,+ project+ );++ let mut delegated = update(None, Some(project));+ delegated.actor_user_id = None;+ delegated.actor = Some(ChannelSender::new_from_bot(bot_id::BotId::TEST_A));+ delegated.on_behalf_of = Some(user());+ let delegated = ProjectTaskAdded::from_update(&delegated).unwrap();+ assert!(delegated.actor.actor.as_bot().is_some());+ assert_eq!(delegated.actor.on_behalf_of, Some(user()));+}++#[test]+fn removals_unchanged_saves_other_properties_and_unattributed_writes_are_ignored() {+ let project = InitiativeId::generate();+ assert!(ProjectTaskAdded::from_update(&update(Some(project), None)).is_none());+ assert!(ProjectTaskAdded::from_update(&update(Some(project), Some(project))).is_none());++ let mut other_property = update(None, Some(project));+ other_property.property_definition_id = SystemPropertyKey::ASSIGNEES_UUID;+ assert!(ProjectTaskAdded::from_update(&other_property).is_none());++ let mut not_a_task = update(None, Some(project));+ not_a_task.entity_type = PropertyEntityType::Document;+ assert!(ProjectTaskAdded::from_update(¬_a_task).is_none());++ let mut unattributed = update(None, Some(project));+ unattributed.actor_user_id = None;+ assert!(ProjectTaskAdded::from_update(&unattributed).is_none());+}++#[tokio::test]+async fn an_addition_inherits_with_its_own_receipts() {+ let project = InitiativeId::generate();let mut access = MockProjectAssignmentAccess::new();access.expect_receipts()- .times(2)- .withf(move |actor, id, _| actor.actor.as_user() == Some(&user()) && *id == project)- .returning(allowed_receipts);- let mut properties = MockProjectAgentInheritance::new();- properties- .expect_inherit().once()- .withf(move |source, target| {- source.entity().entity_id == project.to_string()- && target.entity().entity_id == "new-task"+ .withf(move |actor, id, task| {+ actor.actor.as_user() == Some(&user()) && *id == project && task == "task"})- .returning(|_, _| Box::pin(async { Ok(()) }));+ .returning(allowed_receipts);+ let mut properties = MockProjectAgentInheritance::new();properties.expect_inherit().once().withf(move |source, target| {- source.entity().entity_id == project.to_string()- && target.entity().entity_id == "moved-task"+ source.entity().entity_id == project.to_string() && target.entity().entity_id == "task"}).returning(|_, _| Box::pin(async { Ok(()) }));- ProjectAssignmentService::new(properties, memberships, access)- .process(&event)+ ProjectAssignmentService::new(properties, current_membership(Some(project)), access)+ .process(&added(project)).await.unwrap();}#[tokio::test]-async fn removals_unchanged_membership_and_unattributed_events_do_nothing() {+async fn superseded_additions_are_skipped() {let project = InitiativeId::generate();- let service = ProjectAssignmentService::new(- MockProjectAgentInheritance::new(),- MockProjectMemberships::new(),- MockProjectAssignmentAccess::new(),- );- let mut event = event(vec![- TaskMembershipChange {- task_id: "removed".into(),- from: Some(project),- to: None,- },- TaskMembershipChange {- task_id: "unchanged".into(),- from: Some(project),- to: Some(project),- },- ]);- service.process(&event).await.unwrap();- event.changes[0].to = Some(InitiativeId::generate());- event.attribution = None;- service.process(&event).await.unwrap();- event.attribution = Some(InitiativeEventActor {- actor: ChannelSender::new_from_bot(bot_id::BotId::TEST_A),- on_behalf_of: None,- });- service.process(&event).await.unwrap();+ for current in [Some(InitiativeId::generate()), None] {+ ProjectAssignmentService::new(+ MockProjectAgentInheritance::new(),+ current_membership(current),+ MockProjectAssignmentAccess::new(),+ )+ .process(&added(project))+ .await+ .unwrap();+ }}#[tokio::test]-async fn superseded_moves_and_tasks_without_membership_are_skipped() {+async fn revoked_access_skips_the_task() {let project = InitiativeId::generate();- let event = event(vec![- TaskMembershipChange {- task_id: "moved-again".into(),- from: None,- to: Some(project),- },- TaskMembershipChange {- task_id: "unassigned".into(),- from: None,- to: Some(project),- },- ]);- let mut memberships = MockProjectMemberships::new();- memberships.expect_memberships().once().return_once(|_| {- Box::pin(async {- Ok(HashMap::from([(- "moved-again".into(),- InitiativeId::generate(),- )]))- })- });+ let mut access = MockProjectAssignmentAccess::new();+ access+ .expect_receipts()+ .once()+ .returning(|_, _, _| Box::pin(async { Ok(None) }));ProjectAssignmentService::new(MockProjectAgentInheritance::new(),- memberships,- MockProjectAssignmentAccess::new(),+ current_membership(Some(project)),+ access,)- .process(&event)+ .process(&added(project)).await.unwrap();}#[tokio::test]-async fn revoked_access_skips_only_the_affected_task() {+async fn bots_without_a_delegating_user_do_nothing() {let project = InitiativeId::generate();- let event = event(vec![- TaskMembershipChange {- task_id: "revoked".into(),- from: None,- to: Some(project),- },- TaskMembershipChange {- task_id: "allowed".into(),- from: None,- to: Some(project),- },- ]);- let mut memberships = MockProjectMemberships::new();- memberships- .expect_memberships()- .once()- .return_once(move |_| {- Box::pin(async move {- Ok(HashMap::from([- ("revoked".into(), project),- ("allowed".into(), project),- ]))- })- });- let mut access = MockProjectAssignmentAccess::new();- access- .expect_receipts()- .once()- .withf(|_, _, task| task == "revoked")- .returning(|_, _, _| Box::pin(async { Ok(None) }));- access- .expect_receipts()- .once()- .withf(|_, _, task| task == "allowed")- .returning(allowed_receipts);- let mut properties = MockProjectAgentInheritance::new();- properties- .expect_inherit()- .once()- .withf(|_, task| task.entity().entity_id == "allowed")- .returning(|_, _| Box::pin(async { Ok(()) }));- ProjectAssignmentService::new(properties, memberships, access)- .process(&event)- .await- .unwrap();+ let mut addition = added(project);+ addition.actor = InitiativeEventActor {+ actor: ChannelSender::new_from_bot(bot_id::BotId::TEST_A),+ on_behalf_of: None,+ };+ ProjectAssignmentService::new(+ MockProjectAgentInheritance::new(),+ MockProjectMemberships::new(),+ MockProjectAssignmentAccess::new(),+ )+ .process(&addition)+ .await+ .unwrap();}#[tokio::test]-async fn delegated_changes_recheck_the_delegating_users_access() {+async fn delegated_additions_recheck_the_delegating_users_access() {let project = InitiativeId::generate();- let mut event = event(vec![TaskMembershipChange {- task_id: "task".into(),- from: None,- to: Some(project),- }]);- event.attribution = Some(InitiativeEventActor {+ let mut addition = added(project);+ addition.actor = InitiativeEventActor {actor: ChannelSender::new_from_bot(bot_id::BotId::TEST_A),on_behalf_of: Some(user()),- });- let mut memberships = MockProjectMemberships::new();- memberships- .expect_memberships()- .once()- .return_once(move |_| {- Box::pin(async move { Ok(HashMap::from([("task".into(), project)])) })- });+ };let mut access = MockProjectAssignmentAccess::new();access.expect_receipts()@@ -253,8 +229,8 @@ async fn delegated_changes_recheck_the_delegating_users_access() {.expect_inherit().once().returning(|_, _| Box::pin(async { Ok(()) }));- ProjectAssignmentService::new(properties, memberships, access)- .process(&event)+ ProjectAssignmentService::new(properties, current_membership(Some(project)), access)+ .process(&addition).await.unwrap();}@@ -262,18 +238,6 @@ async fn delegated_changes_recheck_the_delegating_users_access() {#[tokio::test]async fn inheritance_failure_is_propagated_for_retry() {let project = InitiativeId::generate();- let event = event(vec![TaskMembershipChange {- task_id: "task".into(),- from: None,- to: Some(project),- }]);- let mut memberships = MockProjectMemberships::new();- memberships- .expect_memberships()- .once()- .return_once(move |_| {- Box::pin(async move { Ok(HashMap::from([("task".into(), project)])) })- });let mut access = MockProjectAssignmentAccess::new();access.expect_receipts().once().returning(allowed_receipts);let mut properties = MockProjectAgentInheritance::new();@@ -281,64 +245,30 @@ async fn inheritance_failure_is_propagated_for_retry() {Box::pin(async { Err(PropertiesErr::Repo(anyhow::anyhow!("database unavailable"))) })});assert!(matches!(- ProjectAssignmentService::new(properties, memberships, access)- .process(&event)+ ProjectAssignmentService::new(properties, current_membership(Some(project)), access)+ .process(&added(project)).await,Err(ProjectAssignmentError::Properties(_))));}#[tokio::test]-async fn invalid_assignment_does_not_block_later_tasks() {+async fn invalid_assignments_are_skipped_instead_of_retried() {for failure in [PropertiesErr::Validation("invalid stored assignees".into()),PropertiesErr::PermissionDenied,PropertiesErr::NotFound,] {let project = InitiativeId::generate();- let event = event(vec![- TaskMembershipChange {- task_id: "invalid".into(),- from: None,- to: Some(project),- },- TaskMembershipChange {- task_id: "valid".into(),- from: None,- to: Some(project),- },- ]);- let mut memberships = MockProjectMemberships::new();- memberships- .expect_memberships()- .once()- .return_once(move |_| {- Box::pin(async move {- Ok(HashMap::from([- ("invalid".into(), project),- ("valid".into(), project),- ]))- })- });let mut access = MockProjectAssignmentAccess::new();- access- .expect_receipts()- .times(2)- .returning(allowed_receipts);+ access.expect_receipts().once().returning(allowed_receipts);let mut properties = MockProjectAgentInheritance::new();properties.expect_inherit().once()- .withf(|_, task| task.entity().entity_id == "invalid").return_once(move |_, _| Box::pin(async move { Err(failure) }));- properties- .expect_inherit()- .once()- .withf(|_, task| task.entity().entity_id == "valid")- .returning(|_, _| Box::pin(async { Ok(()) }));-- ProjectAssignmentService::new(properties, memberships, access)- .process(&event)+ ProjectAssignmentService::new(properties, current_membership(Some(project)), access)+ .process(&added(project)).await.unwrap();}diff --git a/crates/agent_trigger/src/domain/sources.rs b/crates/agent_trigger/src/domain/sources.rsindex 025170f8f1..dff75cfd84 100644--- a/crates/agent_trigger/src/domain/sources.rs+++ b/crates/agent_trigger/src/domain/sources.rs@@ -3,23 +3,21 @@//!//! `message.posted` on `macro.messages` is the source of record: it carries the//! persisted parent, so a mention in a document discussion routes like one in a-//! channel. The consumer also reads properties and project membership changes-//! for task assignments.+//! channel. The consumer also reads property changes for task assignments,+//! including a task joining a project through its Project property.#[cfg(test)]mod test;use super::processing::TriggerInput;+use super::project_assignment::ProjectTaskAdded;use super::task_assignment::TaskAssignment;-use initiative::domain::events::{- InitiativeMacroEvent, InitiativeTasksChanged, InitiativeTopicEvent,-};use macro_event_broker::{MacroEvent as _, MacroEventCollection};use macro_uuid::Uuid;use messages::outbound::broker::{MessageMacroEvent, MessageTopicEvent};use properties::domain::events::{PropertyMacroEvent, PropertyTopicEvent};-macro_event_broker::declare_topics!(MessageTriggerEvents: MessageMacroEvent, PropertyMacroEvent, InitiativeMacroEvent);+macro_event_broker::declare_topics!(MessageTriggerEvents: MessageMacroEvent, PropertyMacroEvent);/// A decoded broker record from the trigger source.#[derive(Debug, Clone, PartialEq, Eq)]@@ -33,8 +31,8 @@ pub struct DecodedTrigger {pub posted: Option<TriggerInput>,/// Newly assigned agents, from a task assignment property update.pub assignment: Option<TaskAssignment>,- /// Tasks entering or leaving a project; additions inherit project agents.- pub project_tasks: Option<InitiativeTasksChanged>,+ /// A task joining a project, which inherits the project's agents.+ pub project_task: Option<ProjectTaskAdded>,}/// A topic collection whose records may carry a committed post.@@ -48,7 +46,6 @@ impl TriggerEvents for MessageTriggerEvents {let event = match self {Self::MessageMacroEvent(event) => event,Self::PropertyMacroEvent(event) => return property_trigger(event),- Self::InitiativeMacroEvent(event) => return initiative_trigger(event),};let envelope = event.event();let (event_type, posted) = match &envelope.event {@@ -70,50 +67,32 @@ impl TriggerEvents for MessageTriggerEvents {event_type,posted,assignment: None,- project_tasks: None,+ project_task: None,}}}fn property_trigger(event: PropertyMacroEvent) -> DecodedTrigger {let envelope = event.event();- let (event_type, assignment) = match &envelope.event {+ let (event_type, assignment, project_task) = match &envelope.event {PropertyTopicEvent::EntityPropertyUpdated(updated) => ("entity_property.updated",TaskAssignment::from_update(envelope.event_id, updated),+ ProjectTaskAdded::from_update(updated),),- PropertyTopicEvent::Created(_) => ("property.created", None),- PropertyTopicEvent::Deleted(_) => ("property.deleted", None),- PropertyTopicEvent::OptionCreated(_) => ("property_option.created", None),- PropertyTopicEvent::OptionUpdated(_) => ("property_option.updated", None),- PropertyTopicEvent::OptionDeleted(_) => ("property_option.deleted", None),- PropertyTopicEvent::EntityPropertyDeleted(_) => ("entity_property.deleted", None),- PropertyTopicEvent::EntityPropertiesCleared(_) => ("entity_properties.cleared", None),+ PropertyTopicEvent::Created(_) => ("property.created", None, None),+ PropertyTopicEvent::Deleted(_) => ("property.deleted", None, None),+ PropertyTopicEvent::OptionCreated(_) => ("property_option.created", None, None),+ PropertyTopicEvent::OptionUpdated(_) => ("property_option.updated", None, None),+ PropertyTopicEvent::OptionDeleted(_) => ("property_option.deleted", None, None),+ PropertyTopicEvent::EntityPropertyDeleted(_) => ("entity_property.deleted", None, None),+ PropertyTopicEvent::EntityPropertiesCleared(_) => ("entity_properties.cleared", None, None),};DecodedTrigger {event_id: envelope.event_id,event_type,posted: None,assignment,- project_tasks: None,- }-}--fn initiative_trigger(event: InitiativeMacroEvent) -> DecodedTrigger {- let envelope = event.event();- let (event_type, project_tasks) = match &envelope.event {- InitiativeTopicEvent::Created(_) => ("initiative.created", None),- InitiativeTopicEvent::Updated(_) => ("initiative.updated", None),- InitiativeTopicEvent::TasksChanged(changes) => {- ("initiative.tasks_changed", Some(changes.clone()))- }- InitiativeTopicEvent::Purged { .. } => ("initiative.purged", None),- };- DecodedTrigger {- event_id: envelope.event_id,- event_type,- posted: None,- assignment: None,- project_tasks,+ project_task,}}diff --git a/crates/agent_trigger/src/domain/sources/test.rs b/crates/agent_trigger/src/domain/sources/test.rsindex 061b818af3..20a78af829 100644--- a/crates/agent_trigger/src/domain/sources/test.rs+++ b/crates/agent_trigger/src/domain/sources/test.rs@@ -84,55 +84,48 @@ fn the_message_source_carries_the_persisted_parent_through() {}#[test]-fn the_trigger_reads_messages_properties_and_project_membership() {+fn the_trigger_reads_messages_and_properties() {assert_eq!(MessageTriggerEvents::topics(),- ["macro.messages", "macro.properties", "macro.initiatives"]+ ["macro.messages", "macro.properties"]);}#[test]-fn project_membership_events_keep_their_attribution_and_changes() {- use initiative::domain::{events::TaskMembershipChange, models::InitiativeId};- let project = InitiativeId::generate();- let changes = InitiativeTasksChanged {- attribution: Some(initiative::domain::events::InitiativeEventActor {- actor: sender(),- on_behalf_of: None,- }),- changes: vec![TaskMembershipChange {- task_id: "task-a".into(),- from: None,- to: Some(project),- }],- occurred_at: Utc::now(),+fn a_task_joining_a_project_decodes_as_a_project_addition() {+ use initiative::domain::models::InitiativeId;+ use models_properties::{+ EntityType, service::property_value::PropertyValue, shared::EntityReference,};- let event =- InitiativeMacroEvent::new(project, InitiativeTopicEvent::TasksChanged(changes.clone()));- let decoded = MessageTriggerEvents::decode(&record(&event))- .unwrap()- .into_trigger();- assert_eq!(decoded.event_type, "initiative.tasks_changed");- assert_eq!(decoded.project_tasks, Some(changes));- assert!(decoded.assignment.is_none());- assert!(decoded.posted.is_none());-}+ use properties::domain::events::EntityPropertyUpdatedMetadata;+ use system_properties::SystemPropertyKey;-#[test]-fn project_edits_do_not_assign_existing_tasks() {- use initiative::domain::{events::InitiativeChange, models::InitiativeId};let project = InitiativeId::generate();- let event = InitiativeMacroEvent::new(- project,- InitiativeTopicEvent::Updated(InitiativeChange {- initiative_id: project,- attribution: None,- occurred_at: Utc::now(),- }),- );+ let user = MacroUserIdStr::try_from_email("[email protected]").unwrap();+ let event = PropertyMacroEvent::entity_property_updated(EntityPropertyUpdatedMetadata {+ entity_property_id: Uuid::now_v7(),+ entity_id: "task-a".to_owned(),+ entity_type: EntityType::Task,+ property_definition_id: SystemPropertyKey::PROJECT_UUID,+ actor_user_id: Some(user.clone()),+ actor: None,+ on_behalf_of: None,+ value: Some(PropertyValue::EntityRef(vec![EntityReference {+ entity_id: project.to_string(),+ entity_type: EntityType::Initiative,+ specific_message_id: None,+ }])),+ previous_value: None,+ updated_at: Utc::now(),+ });let decoded = MessageTriggerEvents::decode(&record(&event)).unwrap().into_trigger();- assert!(decoded.project_tasks.is_none());+ assert_eq!(decoded.event_type, "entity_property.updated");+ let added = decoded.project_task.unwrap();+ assert_eq!(added.task_id, "task-a");+ assert_eq!(added.project_id, project);+ assert_eq!(added.actor.actor.as_user(), Some(&user));assert!(decoded.assignment.is_none());+ assert!(decoded.posted.is_none());}diff --git a/crates/ai_tools/src/test.rs b/crates/ai_tools/src/test.rsindex 602ec10c39..5ae8498ea8 100644--- a/crates/ai_tools/src/test.rs+++ b/crates/ai_tools/src/test.rs@@ -81,8 +81,6 @@ fn project_workflows_are_available_in_every_host_alongside_folder_and_property_t"UpdateInitiative","DeleteInitiative","UpdateInitiativeSharing",- "SetTaskInitiative",- "ReadTaskInitiatives","ReadInitiativeActivity","SetEntityProperty","CommentOnDocument",diff --git a/crates/complete_graph/src/schema.rs b/crates/complete_graph/src/schema.rsindex 0c09a2d563..a90a7870f8 100644--- a/crates/complete_graph/src/schema.rs+++ b/crates/complete_graph/src/schema.rs@@ -32,9 +32,8 @@ use graphql_favorite::{GraphqlFavorite, NoOpEntityFavoriteEdgeReader, NoOpFavoriteMutationService, resolve_favorites,};use graphql_initiative::{- GraphqlInitiativeTasksPage, GraphqlTaskInitiativeReference, InitiativeMutationRoot,- InitiativeTasksInput, resolve_initiative, resolve_initiative_tasks,- resolve_task_initiative_references,+ GraphqlInitiativeTasksPage, InitiativeMutationRoot, InitiativeTasksInput, resolve_initiative,+ resolve_initiative_tasks,};use graphql_notification::{NoOpNotificationMutationService, NoOpSoupNotificationEdgeReader, NotificationMutationRoot,@@ -658,17 +657,6 @@ where.await}- /// Initiative chips for tasks, without inaccessible project metadata.- async fn task_initiative_references(- &self,- ctx: &Context<'_>,- task_ids: Vec<ID>,- ) -> async_graphql::Result<- Vec<GraphqlTaskInitiativeReference<SoupEdges<NR, PR, ER, FR, AR, AcR>>>,- > {- resolve_task_initiative_references(ctx, self.user_id.clone(), task_ids).await- }-/// AI routines the authenticated user can access.async fn scheduled_actions(&self,diff --git a/crates/complete_graph/src/sdl_test.rs b/crates/complete_graph/src/sdl_test.rsindex 85b3bb762d..33bf7d0149 100644--- a/crates/complete_graph/src/sdl_test.rs+++ b/crates/complete_graph/src/sdl_test.rs@@ -430,12 +430,12 @@ fn initiative_reads_and_mutations_share_the_canonical_soup_entity() {assert_sdl_line(object("GraphqlSoupInitiative"), field);}assert_sdl_line(- object("TaskInitiativeReference"),- "initiative: GraphqlSoupInitiative",+ &sdl,+ "createInitiative(input: CreateInitiativeInput!): GraphqlSoupInitiative!",);assert_sdl_line(&sdl,- "createInitiative(input: CreateInitiativeInput!): GraphqlSoupInitiative!",+ "ensureInitiativeDescriptionSurface(initiativeId: ID!): ID!",);assert_sdl_line(&sdl,@@ -452,6 +452,12 @@ fn initiative_reads_and_mutations_share_the_canonical_soup_entity() {"enum InitiativeSort {","type InitiativePropertySnapshot {","initiatives(input:",+ // Tasks join a project through their Project property.+ "type TaskInitiativeReference {",+ "taskInitiativeReferences(",+ "assignInitiativeTasks(",+ "unassignInitiativeTask(",+ "clearTaskInitiative(",] {assert!(!sdl.contains(obsolete), "obsolete API remains: {obsolete}");}diff --git a/crates/graphql_initiative/src/context.rs b/crates/graphql_initiative/src/context.rsindex 5f87c845dd..7ffb9475c8 100644--- a/crates/graphql_initiative/src/context.rs+++ b/crates/graphql_initiative/src/context.rs@@ -9,23 +9,14 @@ use entity_access::domain::{},ports::EntityAccessService,};-use futures::{StreamExt, TryStreamExt, stream};use initiative::domain::{- models::{- AssignTasksResponse, CreateInitiativeRequest, InitiativeDetail, InitiativeError,- TaskAssignment, TaskAssignmentBatch, UpdateInitiativeRequest,- },+ models::{CreateInitiativeRequest, InitiativeDetail, InitiativeError, UpdateInitiativeRequest},ports::InitiativeService,- reads::{- InitiativePageRow, InitiativeTasksPage, InitiativeTasksRequest, TaskInitiativeReferences,- TaskInitiativeReferencesRequest,- },+ reads::{InitiativePageRow, InitiativeTasksPage, InitiativeTasksRequest},};use macro_user_id::user_id::MacroUserIdStr;use uuid::Uuid;-const MAX_CONCURRENT_TASK_AUTHORIZATIONS: usize = 16;-/// Object-safe forwarding future for the request's concrete domain services.pub(crate) type ApiFuture<'a, T> =Pin<Box<dyn Future<Output = Result<T, InitiativeError>> + Send + 'a>>;@@ -45,11 +36,6 @@ pub(crate) trait InitiativeApi: Send + Sync {id: Uuid,input: InitiativeTasksRequest,) -> ApiFuture<'_, InitiativeTasksPage>;- fn references(- &self,- user: MacroUserIdStr<'static>,- ids: Vec<String>,- ) -> ApiFuture<'_, TaskInitiativeReferences>;fn create(&self,user: MacroUserIdStr<'static>,@@ -62,19 +48,6 @@ pub(crate) trait InitiativeApi: Send + Sync {input: UpdateInitiativeRequest,) -> ApiFuture<'_, InitiativeDetail>;fn delete(&self, user: MacroUserIdStr<'static>, id: Uuid) -> ApiFuture<'_, ()>;- fn assign(- &self,- user: MacroUserIdStr<'static>,- id: Uuid,- task_ids: Vec<String>,- ) -> ApiFuture<'_, AssignTasksResponse>;- fn unassign(- &self,- user: MacroUserIdStr<'static>,- id: Uuid,- task_id: String,- ) -> ApiFuture<'_, ()>;- fn clear(&self, user: MacroUserIdStr<'static>, task_id: String) -> ApiFuture<'_, ()>;}/// Request-scoped initiative capability, shared by viewer reads and mutations.@@ -172,18 +145,6 @@ impl<S: InitiativeService, A: InitiativeAuthorizer> InitiativeApi for Initiative})}- fn references(- &self,- user: MacroUserIdStr<'static>,- ids: Vec<String>,- ) -> ApiFuture<'_, TaskInitiativeReferences> {- Box::pin(async move {- self.service- .task_references(&user, TaskInitiativeReferencesRequest { task_ids: ids })- .await- })- }-fn create(&self,user: MacroUserIdStr<'static>,@@ -216,62 +177,4 @@ impl<S: InitiativeService, A: InitiativeAuthorizer> InitiativeApi for Initiativeself.service.delete(receipt).await})}-- fn assign(- &self,- user: MacroUserIdStr<'static>,- id: Uuid,- task_ids: Vec<String>,- ) -> ApiFuture<'_, AssignTasksResponse> {- Box::pin(async move {- let batch = TaskAssignmentBatch::try_new(task_ids)?;- let receipt = self- .access- .authorize::<EditAccessLevel>(&user, &id.to_string(), EntityType::Initiative)- .await?;- let tasks = stream::iter(batch.into_task_ids().into_iter().map(|task_id| {- let user = &user;- async move {- let access = self- .access- .authorize::<EditAccessLevel>(user, &task_id, EntityType::Document)- .await;- TaskAssignment::from_access(task_id, access)- }- }))- .buffered(MAX_CONCURRENT_TASK_AUTHORIZATIONS)- .try_collect()- .await?;- self.service.assign_tasks(receipt, tasks).await- })- }-- fn unassign(- &self,- user: MacroUserIdStr<'static>,- id: Uuid,- task_id: String,- ) -> ApiFuture<'_, ()> {- Box::pin(async move {- let receipt = self- .access- .authorize::<EditAccessLevel>(&user, &id.to_string(), EntityType::Initiative)- .await?;- let task_receipt = self- .access- .authorize::<EditAccessLevel>(&user, &task_id, EntityType::Document)- .await?;- self.service.unassign_task(receipt, task_receipt).await- })- }-- fn clear(&self, user: MacroUserIdStr<'static>, task_id: String) -> ApiFuture<'_, ()> {- Box::pin(async move {- let task_receipt = self- .access- .authorize::<EditAccessLevel>(&user, &task_id, EntityType::Document)- .await?;- self.service.clear_task(task_receipt).await- })- }}diff --git a/crates/graphql_initiative/src/lib.rs b/crates/graphql_initiative/src/lib.rsindex c3bba3427e..f8ccbf2658 100644--- a/crates/graphql_initiative/src/lib.rs+++ b/crates/graphql_initiative/src/lib.rs@@ -1,4 +1,4 @@-//! Typed GraphQL inbound adapter for initiatives and their task membership.+//! Typed GraphQL inbound adapter for initiatives.#![deny(missing_docs)]mod context;@@ -18,10 +18,8 @@ pub use loaders::{initiative_summary_loader, load_initiative_detail, load_initiative_summary,};pub use mutation::{InitiativeEntityLoader, InitiativeMutationRoot};-pub use objects::{- GraphqlInitiativeSharePermission, GraphqlInitiativeTasksPage, GraphqlTaskInitiativeReference,-};-pub use query::{resolve_initiative, resolve_initiative_tasks, resolve_task_initiative_references};+pub use objects::{GraphqlInitiativeSharePermission, GraphqlInitiativeTasksPage};+pub use query::{resolve_initiative, resolve_initiative_tasks};use async_graphql::ErrorExtensions;use initiative::domain::models::InitiativeError;@@ -30,7 +28,6 @@ use initiative::domain::models::InitiativeError;fn graphql_error(error: InitiativeError) -> async_graphql::Error {let (message, code) = match error {InitiativeError::NotFound => ("initiative not found".to_string(), "NOT_FOUND"),- InitiativeError::NotATask => ("document is not a task".to_string(), "BAD_USER_INPUT"),InitiativeError::Unauthorized => ("unauthorized".to_string(), "FORBIDDEN"),InitiativeError::BadRequest(message) => (message, "BAD_USER_INPUT"),InitiativeError::Conflict(message) => (message, "CONFLICT"),diff --git a/crates/graphql_initiative/src/mutation.rs b/crates/graphql_initiative/src/mutation.rsindex 0c234ed666..ec79cf6738 100644--- a/crates/graphql_initiative/src/mutation.rs+++ b/crates/graphql_initiative/src/mutation.rs@@ -9,11 +9,10 @@ use graphql_soup::{GraphqlSoupInitiative, SoupEntityEdges, SoupItemDataLoader};use crate::{InitiativeGraphqlContext, graphql_error,inputs::{CreateInitiativeInput, UpdateInitiativeInput},- objects::GraphqlInitiativeTaskAssignment,query::load_from_soup,};-/// Primary-backed canonical Soup reader for initiative detail, references, and mutation replies.+/// Primary-backed canonical Soup reader for initiative detail and mutation replies./// List queries and subscriptions retain their replica-backed Soup reader.#[derive(Clone)]pub struct InitiativeEntityLoader(pub SoupItemDataLoader);@@ -27,7 +26,8 @@ impl<E: SoupEntityEdges> Default for InitiativeMutationRoot<E> {}}-/// Authenticated initiative lifecycle, sharing, and task relationship mutations.+/// Authenticated initiative lifecycle and sharing mutations. Tasks join a project through+/// their Project property.#[Object]impl<E: SoupEntityEdges> InitiativeMutationRoot<E> {/// Create an initiative owned by the authenticated user.@@ -108,58 +108,4 @@ impl<E: SoupEntityEdges> InitiativeMutationRoot<E> {.map_err(graphql_error)?;Ok(true)}-- /// Assign or move tasks, preserving partial task authorization results.- async fn assign_initiative_tasks(- &self,- ctx: &Context<'_>,- initiative_id: ID,- task_ids: Vec<ID>,- ) -> async_graphql::Result<Vec<GraphqlInitiativeTaskAssignment>> {- let user = require_authenticated_user(ctx)?;- let id = parse_id(initiative_id, "initiativeId")?;- let result = ctx- .data::<InitiativeGraphqlContext>()?- .0- .assign(- user,- id,- task_ids.into_iter().map(|id| id.to_string()).collect(),- )- .await- .map_err(graphql_error)?;- Ok(result.results.into_iter().map(Into::into).collect())- }-- /// Remove a task using project and task edit capabilities.- async fn unassign_initiative_task(- &self,- ctx: &Context<'_>,- initiative_id: ID,- task_id: ID,- ) -> async_graphql::Result<bool> {- let user = require_authenticated_user(ctx)?;- let id = parse_id(initiative_id, "initiativeId")?;- ctx.data::<InitiativeGraphqlContext>()?- .0- .unassign(user, id, task_id.to_string())- .await- .map_err(graphql_error)?;- Ok(true)- }-- /// Clear a task's project using task edit access, even after project access is revoked.- async fn clear_task_initiative(- &self,- ctx: &Context<'_>,- task_id: ID,- ) -> async_graphql::Result<bool> {- let user = require_authenticated_user(ctx)?;- ctx.data::<InitiativeGraphqlContext>()?- .0- .clear(user, task_id.to_string())- .await- .map_err(graphql_error)?;- Ok(true)- }}diff --git a/crates/graphql_initiative/src/objects.rs b/crates/graphql_initiative/src/objects.rsindex 1b404c68a5..d4390d0971 100644--- a/crates/graphql_initiative/src/objects.rs+++ b/crates/graphql_initiative/src/objects.rs@@ -1,16 +1,11 @@-//! Initiative sharing values and task relationships.+//! Initiative sharing values and task pages.-use async_graphql::{Context, Enum, ID, Object, SimpleObject};+use async_graphql::{ID, SimpleObject};use graphql_permission::GraphqlEntityAccessLevel;-use graphql_soup::{GraphqlSoupInitiative, SoupEntityEdges};-use initiative::domain::{- models::{AssignTaskStatus, AssignTasksResult, InitiativeId},- reads::{InitiativeTasksPage, TaskInitiativeReference},-};+use initiative::domain::reads::InitiativeTasksPage;use models_permissions::share_permission::SharePermissionV2;-use tokio::sync::OnceCell;-use crate::{inputs::GraphqlInitiativeLinkShare, query::load_initiative};+use crate::inputs::GraphqlInitiativeLinkShare;/// Typed sharing state for an initiative.#[derive(SimpleObject)]@@ -86,139 +81,3 @@ impl From<InitiativeTasksPage> for GraphqlInitiativeTasksPage {}}}--/// Visibility state of a task's initiative.-#[derive(Clone, Copy, Enum, Eq, PartialEq)]-#[graphql(name = "TaskInitiativeReferenceState")]-pub enum GraphqlTaskInitiativeReferenceState {- /// Visible task without an initiative.- None,- /// Task or initiative cannot be viewed.- Unavailable,- /// Both task and initiative can be viewed.- Visible,-}--/// Permission-filtered task-to-initiative relationship.-pub struct GraphqlTaskInitiativeReference<E: SoupEntityEdges> {- task_id: String,- state: GraphqlTaskInitiativeReferenceState,- initiative_id: Option<InitiativeId>,- initiative: OnceCell<Option<GraphqlSoupInitiative<E>>>,-}--impl<E: SoupEntityEdges> From<TaskInitiativeReference> for GraphqlTaskInitiativeReference<E> {- fn from(value: TaskInitiativeReference) -> Self {- let (task_id, state, initiative) = match value {- TaskInitiativeReference::None { task_id } => {- (task_id, GraphqlTaskInitiativeReferenceState::None, None)- }- TaskInitiativeReference::Unavailable { task_id } => (- task_id,- GraphqlTaskInitiativeReferenceState::Unavailable,- None,- ),- TaskInitiativeReference::Visible {- task_id,- initiative,- } => (- task_id,- GraphqlTaskInitiativeReferenceState::Visible,- Some(initiative.id),- ),- };- Self {- task_id,- state,- initiative_id: initiative,- initiative: OnceCell::new(),- }- }-}--impl<E: SoupEntityEdges> GraphqlTaskInitiativeReference<E> {- async fn hydrated_initiative(- &self,- ctx: &Context<'_>,- ) -> async_graphql::Result<&Option<GraphqlSoupInitiative<E>>> {- self.initiative- .get_or_try_init(|| async {- match self.initiative_id {- Some(id) => load_initiative(ctx, id.as_uuid()).await,- None => Ok(None),- }- })- .await- }-}--/// Permission-filtered relationship between a task and its project.-#[Object(name = "TaskInitiativeReference")]-impl<E: SoupEntityEdges> GraphqlTaskInitiativeReference<E> {- /// Task whose relationship is described, never this object's identity.- async fn task_id(&self) -> ID {- ID(self.task_id.clone())- }- /// Permission-filtered relationship state.- async fn state(- &self,- ctx: &Context<'_>,- ) -> async_graphql::Result<GraphqlTaskInitiativeReferenceState> {- if self.state == GraphqlTaskInitiativeReferenceState::Visible- && self.hydrated_initiative(ctx).await?.is_none()- {- return Ok(GraphqlTaskInitiativeReferenceState::Unavailable);- }- Ok(self.state)- }- /// The same initiative entity used by collection/detail queries.- async fn initiative(- &self,- ctx: &Context<'_>,- ) -> async_graphql::Result<Option<&GraphqlSoupInitiative<E>>> {- Ok(self.hydrated_initiative(ctx).await?.as_ref())- }-}--/// Per-task result of an assignment request.-#[derive(Clone, Copy, Enum, Eq, PartialEq)]-#[graphql(name = "InitiativeTaskAssignmentStatus")]-pub enum GraphqlInitiativeTaskAssignmentStatus {- /// Newly assigned or already assigned here.- Assigned,- /// Moved from another initiative.- Moved,- /// Document exists but is not a task.- NotATask,- /// Task could not be found.- NotFound,- /// Viewer cannot edit this task.- SkippedNoPermission,-}--/// One result in the deduplicated request order.-#[derive(SimpleObject)]-#[graphql(name = "InitiativeTaskAssignment")]-pub struct GraphqlInitiativeTaskAssignment {- /// Task whose assignment was attempted.- task_id: ID,- /// Domain result of this assignment.- status: GraphqlInitiativeTaskAssignmentStatus,-}--impl From<AssignTasksResult> for GraphqlInitiativeTaskAssignment {- fn from(value: AssignTasksResult) -> Self {- Self {- task_id: ID(value.task_id),- status: match value.status {- AssignTaskStatus::Assigned => GraphqlInitiativeTaskAssignmentStatus::Assigned,- AssignTaskStatus::Moved => GraphqlInitiativeTaskAssignmentStatus::Moved,- AssignTaskStatus::NotATask => GraphqlInitiativeTaskAssignmentStatus::NotATask,- AssignTaskStatus::NotFound => GraphqlInitiativeTaskAssignmentStatus::NotFound,- AssignTaskStatus::SkippedNoPermission => {- GraphqlInitiativeTaskAssignmentStatus::SkippedNoPermission- }- },- }- }-}diff --git a/crates/graphql_initiative/src/query.rs b/crates/graphql_initiative/src/query.rsindex 26a7e66c1b..9d6ae21490 100644--- a/crates/graphql_initiative/src/query.rs+++ b/crates/graphql_initiative/src/query.rs@@ -8,8 +8,8 @@ use model_entity::EntityType;use uuid::Uuid;use crate::{- GraphqlInitiativeTasksPage, GraphqlTaskInitiativeReference, InitiativeEntityLoader,- InitiativeGraphqlContext, InitiativeTasksInput, graphql_error,+ GraphqlInitiativeTasksPage, InitiativeEntityLoader, InitiativeGraphqlContext,+ InitiativeTasksInput, graphql_error,};/// Hydrate the canonical Soup object from the primary for read-after-write consistency.@@ -70,21 +70,3 @@ pub async fn resolve_initiative_tasks(.map_err(graphql_error)?;Ok(page.into())}--/// Resolve project chips without exposing inaccessible project identifiers.-pub async fn resolve_task_initiative_references<E: SoupEntityEdges>(- ctx: &Context<'_>,- user: MacroUserIdStr<'static>,- task_ids: Vec<ID>,-) -> async_graphql::Result<Vec<GraphqlTaskInitiativeReference<E>>> {- let references = ctx- .data::<InitiativeGraphqlContext>()?- .0- .references(- user,- task_ids.into_iter().map(|id| id.to_string()).collect(),- )- .await- .map_err(graphql_error)?;- Ok(references.references.into_iter().map(Into::into).collect())-}diff --git a/crates/graphql_initiative/src/test.rs b/crates/graphql_initiative/src/test.rsindex 76ad6930ad..21d84319ae 100644--- a/crates/graphql_initiative/src/test.rs+++ b/crates/graphql_initiative/src/test.rs@@ -12,7 +12,6 @@ use models_permissions::share_permission::{use std::sync::{Arc, Mutex};use uuid::Uuid;-mod access;mod soup;use self::soup::RecordingSoupService;@@ -173,14 +172,6 @@ impl Viewer {) -> async_graphql::Result<GraphqlSoupInitiative<TestSoupEdges>> {resolve_initiative(ctx, initiative_id).await}-- async fn task_initiative_references(- &self,- ctx: &Context<'_>,- task_ids: Vec<ID>,- ) -> async_graphql::Result<Vec<GraphqlTaskInitiativeReference<TestSoupEdges>>> {- resolve_task_initiative_references(ctx, self.0.clone(), task_ids).await- }}const PROJECT_ID: &str = "00000000-0000-4000-8000-000000000001";@@ -338,57 +329,9 @@ impl InitiativeApi for RecordingApi {})})}- fn references(- &self,- user: MacroUserIdStr<'static>,- _ids: Vec<String>,- ) -> ApiFuture<'_, TaskInitiativeReferences> {- Box::pin(async move {- self.record(&user, "references")?;- Ok(TaskInitiativeReferences {- references: vec![- TaskInitiativeReference::Visible {- task_id: "visible".into(),- initiative: InitiativeReference {- id: detail().id,- name: "Launch".into(),- },- },- TaskInitiativeReference::Unavailable {- task_id: "hidden".into(),- },- TaskInitiativeReference::None {- task_id: "unassigned".into(),- },- ],- })- })- }fn delete(&self, user: MacroUserIdStr<'static>, _id: Uuid) -> ApiFuture<'_, ()> {Box::pin(async move { self.record(&user, "delete") })}- fn assign(- &self,- user: MacroUserIdStr<'static>,- _id: Uuid,- _ids: Vec<String>,- ) -> ApiFuture<'_, AssignTasksResponse> {- Box::pin(async move {- self.record(&user, "assign")?;- Ok(AssignTasksResponse { results: vec![] })- })- }- fn unassign(- &self,- user: MacroUserIdStr<'static>,- _id: Uuid,- _task: String,- ) -> ApiFuture<'_, ()> {- Box::pin(async move { self.record(&user, "unassign") })- }- fn clear(&self, user: MacroUserIdStr<'static>, _task: String) -> ApiFuture<'_, ()> {- Box::pin(async move { self.record(&user, "clear") })- }}fn schema(@@ -565,33 +508,6 @@ async fn detail_fields_load_only_when_selected_and_share_one_domain_read() {assert_eq!(calls, ["get", "summary"]);}-#[tokio::test]-async fn task_references_use_the_canonical_soup_entity_and_hide_inaccessible_projects() {- let api = Arc::new(RecordingApi::default());- let replica = RecordingSoupService::replica();- let primary = RecordingSoupService::primary(api.clone());- let response = schema_with_readers(api.clone(), replica.clone(), primary.clone()).execute(Request::new(- "{ user { taskInitiativeReferences(taskIds: [\"visible\",\"hidden\",\"unassigned\"]) { taskId state initiative { __typename id displayName metadata { ownerId } } } } }"- ).data(user())).await;- assert!(response.errors.is_empty(), "{:?}", response.errors);- let data = response.data.into_json().unwrap();- let references = &data["user"]["taskInitiativeReferences"];- assert_eq!(references[0]["state"], "VISIBLE");- assert_eq!(references[1]["state"], "UNAVAILABLE");- assert_eq!(references[2]["state"], "NONE");- assert_eq!(- references[0]["initiative"]["__typename"],- "GraphqlSoupInitiative"- );- assert_eq!(references[0]["initiative"]["id"], PROJECT_ID);- assert_eq!(references[0]["initiative"]["displayName"], "Launch");- assert!(references[1]["initiative"].is_null());- assert!(references[2]["initiative"].is_null());- assert_eq!(*api.calls.lock().unwrap(), ["references"]);- assert!(replica.calls.lock().unwrap().is_empty());- assert_eq!(primary.calls.lock().unwrap().len(), 1);-}-#[tokio::test]async fn mutation_replies_use_primary_state_and_preserve_viewed_metadata() {let api = Arc::new(RecordingApi::default());@@ -663,7 +579,7 @@ async fn newly_created_project_uses_primary_hydration_before_replica_catches_up(}#[tokio::test]-async fn missing_or_revoked_project_is_not_exposed_by_detail_or_reference() {+async fn missing_or_revoked_project_is_not_exposed_by_detail() {let api = Arc::new(RecordingApi::default());let replica = RecordingSoupService::replica();let primary = RecordingSoupService::empty();@@ -678,33 +594,10 @@ async fn missing_or_revoked_project_is_not_exposed_by_detail_or_reference() {.await;assert_eq!(response.errors[0].message, "initiative not found");assert!(api.calls.lock().unwrap().is_empty());- primary.calls.lock().unwrap().clear();-- let response = schema.execute(Request::new(- "{ user { taskInitiativeReferences(taskIds: [\"visible\"]) { state initiative { id displayName } } } }"- ).data(user())).await;- assert!(response.errors.is_empty(), "{:?}", response.errors);- let data = response.data.into_json().unwrap();- let reference = &data["user"]["taskInitiativeReferences"][0];- assert!(reference["initiative"].is_null());- assert_eq!(reference["state"], "UNAVAILABLE");- assert_eq!(primary.calls.lock().unwrap().len(), 1);assert!(replica.calls.lock().unwrap().is_empty(),"revoked primary access must not fall back to stale replica data");-- let response = schema- .execute(- Request::new("{ user { taskInitiativeReferences(taskIds: [\"visible\"]) { state } } }")- .data(user()),- )- .await;- assert!(response.errors.is_empty(), "{:?}", response.errors);- assert_eq!(- response.data.into_json().unwrap()["user"]["taskInitiativeReferences"][0]["state"],- "UNAVAILABLE"- );}#[tokio::test]diff --git a/crates/graphql_initiative/src/test/access.rs b/crates/graphql_initiative/src/test/access.rsdeleted file mode 100644index a4cfe13f94..0000000000--- a/crates/graphql_initiative/src/test/access.rs+++ /dev/null@@ -1,401 +0,0 @@-use super::*;-use entity_access::domain::models::{- AccessError, EditAccessLevel, EntityAccessAuth, EntityAccessReceipt, EntityPermission,- EntityType, OwnerAccessLevel, RequiredPermission, ViewAccessLevel,-};-use initiative::domain::ports::InitiativeService;--#[derive(Default)]-struct ReceiptService {- receipts: Mutex<Vec<(String, String)>>,- assignments: Mutex<Vec<String>>,-}--#[allow(unused_variables)]-impl InitiativeService for ReceiptService {- async fn summary(- &self,- receipt: EntityAccessReceipt<ViewAccessLevel>,- ) -> Result<InitiativePageRow, InitiativeError> {- unreachable!("unexpected domain call")- }- async fn page(- &self,- user_id: &MacroUserIdStr<'_>,- request: InitiativePageRequest,- ) -> Result<InitiativePage, InitiativeError> {- unreachable!("unexpected domain call")- }- async fn tasks_page(- &self,- receipt: EntityAccessReceipt<ViewAccessLevel>,- request: InitiativeTasksRequest,- ) -> Result<InitiativeTasksPage, InitiativeError> {- unreachable!("unexpected domain call")- }- async fn task_references(- &self,- user_id: &MacroUserIdStr<'_>,- request: TaskInitiativeReferencesRequest,- ) -> Result<TaskInitiativeReferences, InitiativeError> {- unreachable!("unexpected domain call")- }- async fn create(- &self,- user_id: &MacroUserIdStr<'_>,- request: CreateInitiativeRequest,- ) -> Result<InitiativeDetail, InitiativeError> {- unreachable!("unexpected domain call")- }- async fn create_attributed(- &self,- user_id: &MacroUserIdStr<'_>,- request: CreateInitiativeRequest,- attribution: activity::Attribution,- ) -> Result<InitiativeDetail, InitiativeError> {- unreachable!("unexpected domain call")- }- async fn internal_get_basic(- &self,- id: InitiativeId,- ) -> Result<InitiativeBasic, InitiativeError> {- unreachable!("unexpected domain call")- }- async fn get(- &self,- receipt: EntityAccessReceipt<ViewAccessLevel>,- ) -> Result<InitiativeDetail, InitiativeError> {- unreachable!("unexpected domain call")- }- async fn ensure_description_surface(- &self,- receipt: EntityAccessReceipt<ViewAccessLevel>,- ) -> Result<(), InitiativeError> {- self.receipts.lock().unwrap().push((- receipt.entity().entity_id.clone(),- receipt.get_authenticated_user().unwrap().to_string(),- ));- Ok(())- }-- async fn read_description(- &self,- _receipt: EntityAccessReceipt<ViewAccessLevel>,- ) -> Result<String, InitiativeError> {- Ok(String::new())- }- async fn list(&self, user_id: &MacroUserIdStr<'_>) -> Result<InitiativeList, InitiativeError> {- unreachable!("unexpected domain call")- }- async fn update(- &self,- receipt: EntityAccessReceipt<EditAccessLevel>,- request: UpdateInitiativeRequest,- ) -> Result<InitiativeDetail, InitiativeError> {- unreachable!("unexpected domain call")- }- async fn assign_tasks(- &self,- receipt: EntityAccessReceipt<EditAccessLevel>,- assignments: Vec<TaskAssignment>,- ) -> Result<AssignTasksResponse, InitiativeError> {- *self.assignments.lock().unwrap() = assignments- .iter()- .map(|assignment| assignment.task_id().to_owned())- .collect();- Ok(AssignTasksResponse {- results: assignments- .into_iter()- .map(|assignment| AssignTasksResult {- task_id: assignment.task_id().to_owned(),- status: match assignment {- TaskAssignment::Authorized { .. } => AssignTaskStatus::Assigned,- TaskAssignment::NotFound { .. } => AssignTaskStatus::NotFound,- TaskAssignment::SkippedNoPermission { .. } => {- AssignTaskStatus::SkippedNoPermission- }- },- })- .collect(),- })- }- async fn unassign_task(- &self,- receipt: EntityAccessReceipt<EditAccessLevel>,- task_receipt: EntityAccessReceipt<EditAccessLevel>,- ) -> Result<(), InitiativeError> {- unreachable!("unexpected domain call")- }- async fn clear_task(- &self,- task_receipt: EntityAccessReceipt<EditAccessLevel>,- ) -> Result<(), InitiativeError> {- self.receipts.lock().unwrap().push((- task_receipt.entity().entity_id.clone(),- task_receipt.get_authenticated_user().unwrap().to_string(),- ));- Ok(())- }- async fn grant_assignees(- &self,- receipt: EntityAccessReceipt<EditAccessLevel>,- user_ids: Vec<MacroUserIdStr<'static>>,- ) -> Result<(), InitiativeError> {- unreachable!("unexpected domain call")- }- async fn delete(- &self,- receipt: EntityAccessReceipt<OwnerAccessLevel>,- ) -> Result<(), InitiativeError> {- unreachable!("unexpected domain call")- }-}--struct TaskOnlyAccess {- level: AccessLevel,- calls: Mutex<Vec<(String, EntityType)>>,-}--impl InitiativeAuthorizer for TaskOnlyAccess {- async fn authorize<T: RequiredPermission>(- &self,- user: &MacroUserIdStr<'static>,- id: &str,- entity_type: EntityType,- ) -> Result<EntityAccessReceipt<T>, AccessError> {- self.calls- .lock()- .unwrap()- .push((id.to_string(), entity_type));- assert_eq!(- entity_type,- EntityType::Document,- "clearing a task must not depend on project access"- );- EntityAccessReceipt::try_new(- EntityAccessAuth::Authenticated(user.clone()),- entity_access::domain::models::Entity {- entity_id: id.to_string(),- entity_type,- },- EntityPermission::AccessLevel {- access_level: self.level,- },- )- }-}--#[tokio::test]-async fn clear_task_succeeds_using_only_task_edit_access() {- let service = Arc::new(ReceiptService::default());- let access = Arc::new(TaskOnlyAccess {- level: AccessLevel::Edit,- calls: Mutex::new(Vec::new()),- });- let context = InitiativeGraphqlContext::new(service.clone(), access.clone());- let schema = Schema::build(- Query,- InitiativeMutationRoot::<TestSoupEdges>::default(),- EmptySubscription,- )- .data(context)- .finish();- let response = schema- .execute(Request::new("mutation { clearTaskInitiative(taskId: \"task-1\") }").data(user()))- .await;- assert!(response.errors.is_empty(), "{:?}", response.errors);- assert_eq!(- *service.receipts.lock().unwrap(),- [("task-1".into(), "macro|[email protected]".into())]- );- assert_eq!(- *access.calls.lock().unwrap(),- [("task-1".into(), EntityType::Document)]- );-}--#[tokio::test]-async fn clear_task_denied_edit_access_never_calls_service() {- let service = Arc::new(ReceiptService::default());- let access = Arc::new(TaskOnlyAccess {- level: AccessLevel::View,- calls: Mutex::new(Vec::new()),- });- let context = InitiativeGraphqlContext::new(service.clone(), access);- let schema = Schema::build(- Query,- InitiativeMutationRoot::<TestSoupEdges>::default(),- EmptySubscription,- )- .data(context)- .finish();- let response = schema- .execute(Request::new("mutation { clearTaskInitiative(taskId: \"task-1\") }").data(user()))- .await;- assert_eq!(response.errors[0].message, "unauthorized");- assert!(service.receipts.lock().unwrap().is_empty());-}--#[derive(Default)]-struct ConcurrentAccess {- destination_checked: std::sync::atomic::AtomicBool,- inflight: std::sync::atomic::AtomicUsize,- peak: std::sync::atomic::AtomicUsize,- calls: Mutex<Vec<String>>,- deny_destination: bool,-}--impl InitiativeAuthorizer for ConcurrentAccess {- async fn authorize<T: RequiredPermission>(- &self,- user: &MacroUserIdStr<'static>,- id: &str,- entity_type: EntityType,- ) -> Result<EntityAccessReceipt<T>, AccessError> {- use std::sync::atomic::Ordering::SeqCst;- self.calls.lock().unwrap().push(id.to_owned());- if entity_type == EntityType::Initiative {- self.destination_checked.store(true, SeqCst);- if self.deny_destination {- return Err(AccessError::Unauthorized);- }- } else {- assert!(self.destination_checked.load(SeqCst));- let running = self.inflight.fetch_add(1, SeqCst) + 1;- self.peak.fetch_max(running, SeqCst);- tokio::task::yield_now().await;- if id.ends_with('0') {- tokio::task::yield_now().await;- }- self.inflight.fetch_sub(1, SeqCst);- if id == "task-1" {- return Err(AccessError::Unauthorized);- }- }- EntityAccessReceipt::try_new(- EntityAccessAuth::Authenticated(user.clone()),- entity_access::domain::models::Entity {- entity_id: id.to_owned(),- entity_type,- },- EntityPermission::AccessLevel {- access_level: AccessLevel::Edit,- },- )- }-}--#[tokio::test]-async fn task_assignment_authorization_is_bounded_concurrent_and_keeps_input_order() {- let service = Arc::new(ReceiptService::default());- let access = Arc::new(ConcurrentAccess::default());- let context = InitiativeGraphqlContext::new(service.clone(), access.clone());- let ids: Vec<_> = (0..40).map(|index| format!("task-{index}")).collect();- let result = context- .0- .assign(user(), Uuid::from_u128(1), ids.clone())- .await- .unwrap();- assert_eq!(*service.assignments.lock().unwrap(), ids);- assert_eq!(- result.results[1].status,- AssignTaskStatus::SkippedNoPermission- );- let peak = access.peak.load(std::sync::atomic::Ordering::SeqCst);- assert!(- peak > 1 && peak <= 16,- "expected bounded parallel checks; observed {peak}"- );-}--#[tokio::test]-async fn task_assignment_validates_batch_and_destination_before_authorizing_tasks() {- let service = Arc::new(ReceiptService::default());- let access = Arc::new(ConcurrentAccess {- deny_destination: true,- ..Default::default()- });- let context = InitiativeGraphqlContext::new(service.clone(), access.clone());- assert!(- context- .0- .assign(- user(),- Uuid::from_u128(1),- (0..101).map(|id| id.to_string()).collect()- )- .await- .is_err()- );- assert!(access.calls.lock().unwrap().is_empty());- assert!(- context- .0- .assign(user(), Uuid::from_u128(1), vec!["task-0".into()])- .await- .is_err()- );- assert_eq!(access.calls.lock().unwrap().len(), 1);- assert!(service.assignments.lock().unwrap().is_empty());-}--/// Grants view access, recording which entities were checked.-#[derive(Default)]-struct ProjectViewAccess {- calls: Mutex<Vec<(String, EntityType)>>,-}--impl InitiativeAuthorizer for ProjectViewAccess {- async fn authorize<T: RequiredPermission>(- &self,- user: &MacroUserIdStr<'static>,- id: &str,- entity_type: EntityType,- ) -> Result<EntityAccessReceipt<T>, AccessError> {- self.calls- .lock()- .unwrap()- .push((id.to_string(), entity_type));- EntityAccessReceipt::try_new(- EntityAccessAuth::Authenticated(user.clone()),- entity_access::domain::models::Entity {- entity_id: id.to_string(),- entity_type,- },- EntityPermission::AccessLevel {- access_level: AccessLevel::View,- },- )- }-}--#[tokio::test]-async fn viewers_ensure_the_description_surface_with_a_project_view_receipt() {- let service = Arc::new(ReceiptService::default());- let access = Arc::new(ProjectViewAccess::default());- let context = InitiativeGraphqlContext::new(service.clone(), access.clone());- let schema = Schema::build(- Query,- InitiativeMutationRoot::<TestSoupEdges>::default(),- EmptySubscription,- )- .data(context)- .finish();- let response = schema- .execute(- Request::new(format!(- "mutation {{ ensureInitiativeDescriptionSurface(initiativeId: \"{PROJECT_ID}\") }}"- ))- .data(user()),- )- .await;- assert!(response.errors.is_empty(), "{:?}", response.errors);- assert_eq!(- *service.receipts.lock().unwrap(),- [(PROJECT_ID.to_string(), "macro|[email protected]".into())]- );- assert_eq!(- *access.calls.lock().unwrap(),- [(PROJECT_ID.to_string(), EntityType::Initiative)]- );-}diff --git a/crates/initiative/src/domain/activity.rs b/crates/initiative/src/domain/activity.rsindex 3ea4f60540..01869553e1 100644--- a/crates/initiative/src/domain/activity.rs+++ b/crates/initiative/src/domain/activity.rs@@ -3,42 +3,11 @@#[cfg(test)]mod test;-use activity::{- Action, Activity, ActivitySource, CommonAction, DomainActivity, EntityType, Ingest,- InitiativeTaskChange,-};+use activity::{Activity, ActivitySource, CommonAction, EntityType, Ingest};use uuid::Uuid;use super::events::{InitiativeChange, InitiativeTopicEvent};-enum MembershipActivity {- Added {- initiative_id: String,- task_id: String,- },- Removed {- initiative_id: String,- task_id: String,- },-}--impl DomainActivity for MembershipActivity {- const ENTITY_TYPE: EntityType = EntityType::Initiative;- fn entity_id(&self) -> &str {- match self {- Self::Added { initiative_id, .. } | Self::Removed { initiative_id, .. } => {- initiative_id- }- }- }- fn into_action(self) -> Action {- match self {- Self::Added { task_id, .. } => Action::TaskAdded(InitiativeTaskChange { task_id }),- Self::Removed { task_id, .. } => Action::TaskRemoved(InitiativeTaskChange { task_id }),- }- }-}-fn lifecycle(event_id: Uuid, change: &InitiativeChange, action: CommonAction) -> Ingest {let Some(attribution) = &change.attribution else {return Ingest::Ignore;@@ -63,51 +32,6 @@ impl ActivitySource for InitiativeTopicEvent {Self::Purged { initiative_id } => {Ingest::Purge(vec![(EntityType::Initiative, initiative_id.to_string())])}- Self::TasksChanged(changed) => {- let Some(attribution) = &changed.attribution else {- return Ingest::Ignore;- };- let mut rows = Vec::new();- // At most 100 changes per service command; source/removal is always the- // first ordinal and destination/addition the second, including replays.- for (index, change) in changed.changes.iter().enumerate() {- if change.from == change.to {- continue;- }- let ordinal = u32::try_from(index).expect("bounded task batch") * 2;- if let Some(source) = change.from {- rows.push(Activity::from_domain(- event_id,- ordinal,- attribution.actor.clone(),- attribution.on_behalf_of.clone(),- MembershipActivity::Removed {- initiative_id: source.to_string(),- task_id: change.task_id.clone(),- },- changed.occurred_at,- ));- }- if let Some(destination) = change.to {- rows.push(Activity::from_domain(- event_id,- ordinal + 1,- attribution.actor.clone(),- attribution.on_behalf_of.clone(),- MembershipActivity::Added {- initiative_id: destination.to_string(),- task_id: change.task_id.clone(),- },- changed.occurred_at,- ));- }- }- if rows.is_empty() {- Ingest::Ignore- } else {- Ingest::Insert(rows)- }- }}}}diff --git a/crates/initiative/src/domain/activity/test.rs b/crates/initiative/src/domain/activity/test.rsindex 8dfa282b18..fbd87d0af5 100644--- a/crates/initiative/src/domain/activity/test.rs+++ b/crates/initiative/src/domain/activity/test.rs@@ -1,8 +1,5 @@use super::super::{- events::{- InitiativeChange, InitiativeEventActor, InitiativeTasksChanged, InitiativeTopicEvent,- TaskMembershipChange,- },+ events::{InitiativeChange, InitiativeEventActor, InitiativeTopicEvent},models::InitiativeId,};use activity::{ActivitySource, Actor, Ingest};@@ -21,45 +18,6 @@ fn time() -> chrono::DateTime<Utc> {Utc.with_ymd_and_hms(2026, 9, 22, 12, 0, 0).unwrap()}-#[test]-fn moves_record_source_and_destination_with_stable_ids() {- let event = InitiativeTopicEvent::TasksChanged(InitiativeTasksChanged {- attribution: actor(),- occurred_at: time(),- changes: vec![TaskMembershipChange {- task_id: "task-1".into(),- from: Some(id(1)),- to: Some(id(2)),- }],- });- let event_id = uuid::Uuid::from_u128(9);- let rows = event.ingest(event_id);- assert_eq!(rows, event.ingest(event_id));- let Ingest::Insert(rows) = rows else {- panic!("activities");- };- assert_eq!(rows.len(), 2);- assert_eq!(rows[0].entity_id, id(1).to_string());- assert_eq!(rows[0].action.to_columns().0, "task_removed");- assert_eq!(rows[1].entity_id, id(2).to_string());- assert_eq!(rows[1].action.to_columns().0, "task_added");- assert_ne!(rows[0].id, rows[1].id);-}--#[test]-fn repeated_assignment_is_not_new_activity() {- let event = InitiativeTopicEvent::TasksChanged(InitiativeTasksChanged {- attribution: actor(),- occurred_at: time(),- changes: vec![TaskMembershipChange {- task_id: "task-1".into(),- from: Some(id(1)),- to: Some(id(1)),- }],- });- assert_eq!(event.ingest(uuid::Uuid::from_u128(9)), Ingest::Ignore);-}-#[test]fn unattributable_mutations_are_ignored_but_purges_are_applied() {let change = InitiativeChange {@@ -79,3 +37,26 @@ fn unattributable_mutations_are_ignored_but_purges_are_applied() {Ingest::Purge(vec![(activity::EntityType::Initiative, id(1).to_string())]));}++#[test]+fn attributed_lifecycle_changes_record_one_stable_row() {+ let change = InitiativeChange {+ initiative_id: id(1),+ attribution: actor(),+ occurred_at: time(),+ };+ let event_id = uuid::Uuid::from_u128(9);+ for (event, action) in [+ (InitiativeTopicEvent::Created(change.clone()), "created"),+ (InitiativeTopicEvent::Updated(change), "edited"),+ ] {+ let ingest = event.ingest(event_id);+ assert_eq!(ingest, event.ingest(event_id));+ let Ingest::Insert(rows) = ingest else {+ panic!("activities");+ };+ assert_eq!(rows.len(), 1);+ assert_eq!(rows[0].entity_id, id(1).to_string());+ assert_eq!(rows[0].action.to_columns().0, action);+ }+}diff --git a/crates/initiative/src/domain/events.rs b/crates/initiative/src/domain/events.rsindex 858a4823b0..f3e0c23211 100644--- a/crates/initiative/src/domain/events.rs+++ b/crates/initiative/src/domain/events.rs@@ -9,7 +9,7 @@ use macro_event_topics::MacroInitiativesTopic;use macro_user_id::user_id::MacroUserIdStr;use serde::{Deserialize, Serialize};-use super::models::{AssignTasksResult, InitiativeError, InitiativeId};+use super::models::{InitiativeError, InitiativeId};/// Actor and optional delegating user retained on a committed mutation.#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]@@ -29,26 +29,6 @@ impl From<Attribution> for InitiativeEventActor {}}-/// The exact before/after membership committed by the repository.-#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]-pub struct TaskMembershipChange {- /// Task whose membership changed. Names are never stored in membership events.- pub task_id: String,- /// Previous initiative, absent for first assignment.- pub from: Option<InitiativeId>,- /// New initiative, absent for removal.- pub to: Option<InitiativeId>,-}--/// Assignment results plus the exact committed transitions for publication.-#[derive(Debug, Clone, Default, PartialEq, Eq)]-pub struct AssignedTasks {- /// Public per-task outcomes.- pub results: Vec<AssignTasksResult>,- /// Only actual changes; repeated assignment to the same project is omitted.- pub changes: Vec<TaskMembershipChange>,-}-/// Attributed lifecycle event for one initiative.#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]pub struct InitiativeChange {@@ -60,17 +40,6 @@ pub struct InitiativeChange {pub occurred_at: DateTime<Utc>,}-/// One atomic membership operation, including both sides of moves.-#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]-pub struct InitiativeTasksChanged {- /// Actor, absent for unattributable internal operations.- pub attribution: Option<InitiativeEventActor>,- /// Committed membership transitions in deterministic request order.- pub changes: Vec<TaskMembershipChange>,- /// Time of the operation.- pub occurred_at: DateTime<Utc>,-}-/// Events owned by initiatives. Property changes use the property domain's topic.#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]#[serde(tag = "event_type", content = "metadata")]@@ -81,9 +50,6 @@ pub enum InitiativeTopicEvent {/// A project name, sharing policy, or collaborators changed.#[serde(rename = "initiative.updated")]Updated(InitiativeChange),- /// Tasks were assigned, moved, or removed.- #[serde(rename = "initiative.tasks_changed")]- TasksChanged(InitiativeTasksChanged),/// An initiative was permanently deleted and its history must be removed.#[serde(rename = "initiative.purged")]Purged {diff --git a/crates/initiative/src/domain/models.rs b/crates/initiative/src/domain/models.rsindex de3e3e1662..2668848972 100644--- a/crates/initiative/src/domain/models.rs+++ b/crates/initiative/src/domain/models.rs@@ -3,13 +3,12 @@#[cfg(test)]mod test;-use std::collections::HashSet;use std::fmt;use std::str::FromStr;use chrono::{DateTime, Utc};#[cfg(feature = "ports")]-use entity_access::domain::models::{AccessError, EditAccessLevel, EntityAccessReceipt};+use entity_access::domain::models::AccessError;use macro_user_id::user_id::MacroUserIdStr;use models_permissions::share_permission::access_level::AccessLevel;use models_permissions::share_permission::team_share::AuthorizedTeamShareCommand;@@ -23,9 +22,6 @@ pub const MAX_INITIATIVE_NAME_GRAPHEMES: usize = 100;/// Maximum length of the create-time description prefill, counted in Unicode grapheme clusters.pub const MAX_INITIATIVE_DESCRIPTION_GRAPHEMES: usize = 2_000;-/// Maximum number of tasks accepted in one assign call.-pub const MAX_TASKS_PER_ASSIGN: usize = 100;-/// Opaque identifier for an initiative. Minted as UUIDv7 in application code.#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]#[cfg_attr(feature = "inbound", derive(utoipa::ToSchema))]@@ -166,80 +162,6 @@ pub struct UpdateInitiativeRequest {pub share_permission: Option<UpdateSharePermissionRequestV2>,}-/// Assign-tasks HTTP body.-#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]-#[cfg_attr(feature = "inbound", derive(utoipa::ToSchema))]-#[serde(rename_all = "camelCase")]-pub struct AssignTasksRequest {- /// Task ids to assign, in request order.- pub task_ids: Vec<String>,-}--/// A bounded, deduplicated task request, validated before looking up access receipts.-#[derive(Debug, Clone, PartialEq, Eq)]-pub struct TaskAssignmentBatch(Vec<String>);--impl TaskAssignmentBatch {- /// Deduplicate in request order and enforce the assignment limit before access lookup.- pub fn try_new(task_ids: Vec<String>) -> Result<Self, InitiativeError> {- let mut seen = HashSet::new();- let mut unique = Vec::new();- for task_id in task_ids {- if seen.insert(task_id.clone()) {- if unique.len() == MAX_TASKS_PER_ASSIGN {- return Err(InitiativeError::BadRequest(format!(- "cannot assign more than {MAX_TASKS_PER_ASSIGN} tasks at once"- )));- }- unique.push(task_id);- }- }- Ok(Self(unique))- }-- /// Consume the batch for receipt generation.- pub fn into_task_ids(self) -> Vec<String> {- self.0- }-}--/// Per-task outcome of an assign call.-#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]-#[cfg_attr(feature = "inbound", derive(utoipa::ToSchema))]-#[serde(rename_all = "camelCase")]-pub struct AssignTasksResult {- /// Task id this outcome describes.- pub task_id: String,- /// What happened to the task.- pub status: AssignTaskStatus,-}--/// Assign-tasks HTTP response.-#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]-#[cfg_attr(feature = "inbound", derive(utoipa::ToSchema))]-#[serde(rename_all = "camelCase")]-pub struct AssignTasksResponse {- /// Outcomes in request order after dedupe.- pub results: Vec<AssignTasksResult>,-}--/// Status written onto one assign result.-#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]-#[cfg_attr(feature = "inbound", derive(utoipa::ToSchema))]-#[serde(rename_all = "camelCase")]-pub enum AssignTaskStatus {- /// Newly assigned to this initiative.- Assigned,- /// Moved here from another initiative.- Moved,- /// The id exists but is not a task.- NotATask,- /// The id does not exist.- NotFound,- /// The caller cannot assign this task.- SkippedNoPermission,-}-/// Accessible-initiative list.#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]#[cfg_attr(feature = "inbound", derive(utoipa::ToSchema))]@@ -249,62 +171,6 @@ pub struct InitiativeList {pub initiatives: Vec<InitiativeSummary>,}-/// One task in an assign-tasks service call, retaining the verified edit capability.-#[cfg(feature = "ports")]-#[derive(Debug, Clone)]-pub enum TaskAssignment {- /// The caller can edit this document; persistence confirms its task subtype.- Authorized {- /// Verified capability for the task, retained through the domain boundary.- receipt: EntityAccessReceipt<EditAccessLevel>,- },- /// Inbound could not find this task.- NotFound {- /// Task id.- task_id: String,- },- /// Inbound found the task but the caller cannot assign it.- SkippedNoPermission {- /// Task id.- task_id: String,- },-}--#[cfg(feature = "ports")]-impl TaskAssignment {- /// Retain a verified task capability or classify the access failure for a partial batch.- pub fn from_access(- task_id: String,- result: Result<EntityAccessReceipt<EditAccessLevel>, AccessError>,- ) -> Result<Self, InitiativeError> {- match result {- Ok(receipt) if receipt.entity().entity_id == task_id => {- Ok(Self::Authorized { receipt })- }- Ok(_) => Err(InitiativeError::BadRequest(- "task receipt does not match the requested task".to_string(),- )),- Err(AccessError::Unauthorized | AccessError::UnauthorizedWithMessage(_)) => {- Ok(Self::SkippedNoPermission { task_id })- }- Err(AccessError::NotFound(_) | AccessError::BadRequest(_)) => {- Ok(Self::NotFound { task_id })- }- Err(error) => Err(InitiativeError::Internal(- rootcause::Report::new(error).into_dynamic(),- )),- }- }-- /// Task id this assignment refers to.- pub fn task_id(&self) -> &str {- match self {- Self::Authorized { receipt } => &receipt.entity().entity_id,- Self::NotFound { task_id } | Self::SkippedNoPermission { task_id } => task_id,- }- }-}-/// Arguments for creating an initiative row. No serde: repository-only.#[derive(Debug, Clone, PartialEq, Eq)]pub struct CreateInitiativeRepoArgs {@@ -341,9 +207,6 @@ pub enum InitiativeError {/// The initiative does not exist.#[error("initiative not found")]NotFound,- /// The document exists but does not have the task subtype.- #[error("document is not a task")]- NotATask,/// The caller cannot perform this action.#[error("unauthorized")]Unauthorized,diff --git a/crates/initiative/src/domain/models/test.rs b/crates/initiative/src/domain/models/test.rsindex 8b4a47e62c..83b2e91952 100644--- a/crates/initiative/src/domain/models/test.rs+++ b/crates/initiative/src/domain/models/test.rs@@ -8,26 +8,6 @@ fn initiative_id_round_trips_uuid_strings() {assert_eq!(InitiativeId::from_uuid(id.as_uuid()), id);}-#[test]-fn wire_types_serialize_camel_case() {- let json = serde_json::to_value(AssignTasksResponse {- results: vec![AssignTasksResult {- task_id: "task-1".to_string(),- status: AssignTaskStatus::NotATask,- }],- })- .expect("json");- assert_eq!(- json,- serde_json::json!({- "results": [{ "taskId": "task-1", "status": "notATask" }]- })- );-- let skipped = serde_json::to_value(AssignTaskStatus::SkippedNoPermission).expect("json");- assert_eq!(skipped, serde_json::json!("skippedNoPermission"));-}-#[test]fn update_request_has_no_description_field() {let request: UpdateInitiativeRequest = serde_json::from_value(serde_json::json!({@@ -61,61 +41,3 @@ fn create_request_deserializes_camel_case() {);assert_eq!(request.share_with_team, Some(true));}--#[cfg(feature = "ports")]-#[test]-fn task_assignment_exposes_task_id() {- assert_eq!(- TaskAssignment::Authorized {- receipt: EntityAccessReceipt::dangerously_assert_internal_user(- "t1",- entity_access::domain::models::EntityType::Document- )- }- .task_id(),- "t1"- );- assert_eq!(- TaskAssignment::NotFound {- task_id: "t2".into()- }- .task_id(),- "t2"- );- assert_eq!(- TaskAssignment::SkippedNoPermission {- task_id: "t3".into()- }- .task_id(),- "t3"- );-}--#[test]-fn assignment_batch_bounds_unique_ids_and_keeps_request_order() {- let batch =- TaskAssignmentBatch::try_new(vec!["b".into(), "a".into(), "b".into()]).expect("bounded");- assert_eq!(batch.into_task_ids(), ["b", "a"]);- assert!(TaskAssignmentBatch::try_new(vec!["same".into(); MAX_TASKS_PER_ASSIGN + 1]).is_ok());- assert!(matches!(- TaskAssignmentBatch::try_new(- (0..=MAX_TASKS_PER_ASSIGN)- .map(|i| format!("task-{i}"))- .collect()- ),- Err(InitiativeError::BadRequest(_))- ));-}--#[cfg(feature = "ports")]-#[test]-fn assignment_access_result_must_match_requested_task() {- let receipt = EntityAccessReceipt::dangerously_assert_internal_user(- "other",- entity_access::domain::models::EntityType::Document,- );- assert!(matches!(- TaskAssignment::from_access("requested".into(), Ok(receipt)),- Err(InitiativeError::BadRequest(_))- ));-}diff --git a/crates/initiative/src/domain/ports.rs b/crates/initiative/src/domain/ports.rsindex b5e0ed4ceb..f71d6d550c 100644--- a/crates/initiative/src/domain/ports.rs+++ b/crates/initiative/src/domain/ports.rs@@ -2,7 +2,7 @@use super::reads::{InitiativePage, InitiativePageRequest, InitiativePageRow, InitiativeTasksPage,- InitiativeTasksRequest, TaskInitiativeReferences, TaskInitiativeReferencesRequest,+ InitiativeTasksRequest,};use entity_access::domain::models::{EditAccessLevel, EntityAccessReceipt, OwnerAccessLevel, ViewAccessLevel,@@ -10,13 +10,11 @@ use entity_access::domain::models::{use macro_user_id::user_id::MacroUserIdStr;use models_permissions::share_permission::team_share::{TeamShareCreation, TeamShareFacts};use models_permissions::share_permission::{SharePermissionV2, TeamLinkShareDefault};-use std::collections::HashMap;-use crate::domain::events::{AssignedTasks, TaskMembershipChange};use crate::domain::models::{- AssignTasksResponse, CreateInitiativeRepoArgs, CreateInitiativeRequest, InitiativeBasic,- InitiativeDetail, InitiativeError, InitiativeId, InitiativeList, TaskAssignment,- UpdateInitiativeRepoArgs, UpdateInitiativeRequest,+ CreateInitiativeRepoArgs, CreateInitiativeRequest, InitiativeBasic, InitiativeDetail,+ InitiativeError, InitiativeId, InitiativeList, UpdateInitiativeRepoArgs,+ UpdateInitiativeRequest,};/// Outbound port for the collab surface holding an initiative's description. The surface@@ -52,12 +50,6 @@ pub trait InitiativeRepo: Send + Sync + 'static {/// The error type returned by repository operations.type Err: Into<InitiativeError> + Send + std::fmt::Debug;- /// Read task membership in one batch. Callers authorize both ends before displaying it.- fn task_memberships(- &self,- task_ids: Vec<String>,- ) -> impl Future<Output = Result<HashMap<String, InitiativeId>, Self::Err>> + Send;-/// Persist a new initiative, its members, and initial share state in one transaction.fn create(&self,@@ -72,7 +64,8 @@ pub trait InitiativeRepo: Send + Sync + 'static {id: InitiativeId,) -> impl Future<Output = Result<Option<InitiativeBasic>, Self::Err>> + Send;- /// Load the full initiative, including members, tasks, and share state.+ /// Load the full initiative, including members and share state. `task_ids` is left empty:+ /// tasks belong through their Project property, which the service reads.fn get_detail(&self,id: InitiativeId,@@ -103,26 +96,6 @@ pub trait InitiativeRepo: Send + Sync + 'static {user_id: &MacroUserIdStr<'static>,) -> impl Future<Output = Result<Option<TeamLinkShareDefault>, Self::Err>> + Send;- /// Assign the accepted task ids. Returns one outcome per submitted id.- fn assign_tasks(- &self,- id: InitiativeId,- task_ids: Vec<String>,- ) -> impl Future<Output = Result<AssignedTasks, Self::Err>> + Send;-- /// Remove one task from the initiative.- fn unassign_task(- &self,- id: InitiativeId,- task_id: &str,- ) -> impl Future<Output = Result<Option<TaskMembershipChange>, Self::Err>> + Send;-- /// Clear any initiative association for a task. Already unassigned tasks succeed.- fn clear_task(- &self,- task_id: &str,- ) -> impl Future<Output = Result<Option<TaskMembershipChange>, Self::Err>> + Send;-/// Grant assignees edit access to the initiative in one transaction,/// recording non-owner recipients as collaborators without removing anyone or/// downgrading existing grants. Clearing the property does not undo this share.@@ -158,12 +131,6 @@ pub trait InitiativeService: Send + Sync + 'static {request: InitiativeTasksRequest,) -> impl Future<Output = Result<InitiativeTasksPage, InitiativeError>> + Send;- /// Resolve task chips without revealing inaccessible initiative metadata.- fn task_references(- &self,- user_id: &MacroUserIdStr<'_>,- request: TaskInitiativeReferencesRequest,- ) -> impl Future<Output = Result<TaskInitiativeReferences, InitiativeError>> + Send;/// Create an initiative owned by `user_id`.fn create(&self,@@ -219,28 +186,6 @@ pub trait InitiativeService: Send + Sync + 'static {request: UpdateInitiativeRequest,) -> impl Future<Output = Result<InitiativeDetail, InitiativeError>> + Send;- /// Assign or move tasks using destination and task edit capabilities for the same actor.- /// Source initiative edit access is deliberately not required.- fn assign_tasks(- &self,- receipt: EntityAccessReceipt<EditAccessLevel>,- assignments: Vec<TaskAssignment>,- ) -> impl Future<Output = Result<AssignTasksResponse, InitiativeError>> + Send;-- /// Unassign one task using both initiative and task edit capabilities for the same actor.- fn unassign_task(- &self,- receipt: EntityAccessReceipt<EditAccessLevel>,- task_receipt: EntityAccessReceipt<EditAccessLevel>,- ) -> impl Future<Output = Result<(), InitiativeError>> + Send;-- /// Clear a task's initiative using task edit access alone, including after project access- /// is revoked. Already unassigned tasks succeed.- fn clear_task(- &self,- task_receipt: EntityAccessReceipt<EditAccessLevel>,- ) -> impl Future<Output = Result<(), InitiativeError>> + Send;-/// Share both project entities with assignees, adding non-owner collaborators./// Clearing an assignee does not revoke access or membership, matching task sharing.fn grant_assignees(diff --git a/crates/initiative/src/domain/reads.rs b/crates/initiative/src/domain/reads.rsindex c8ef6b97ff..9c60ea619c 100644--- a/crates/initiative/src/domain/reads.rs+++ b/crates/initiative/src/domain/reads.rs@@ -1,11 +1,11 @@-//! Project collection and task-reference read contracts.+//! Project collection and task read contracts.use chrono::{DateTime, Utc};use models_permissions::share_permission::access_level::AccessLevel;use serde::{Deserialize, Serialize};use uuid::Uuid;-use super::models::{InitiativeDetail, InitiativeError, InitiativeId, InitiativeSummary};+use super::models::{InitiativeDetail, InitiativeError, InitiativeSummary};const DEFAULT_PAGE_SIZE: u16 = 50;const MAX_PAGE_SIZE: u16 = 100;@@ -170,64 +170,3 @@ impl InitiativeDetail {})}}--/// Bounded batch of task ids to resolve.-#[derive(Debug, Clone, Serialize, Deserialize)]-#[cfg_attr(feature = "inbound", derive(utoipa::ToSchema))]-#[serde(rename_all = "camelCase")]-pub struct TaskInitiativeReferencesRequest {- /// At most one hundred distinct task ids.- pub task_ids: Vec<String>,-}--/// Minimal project display reference.-#[derive(Debug, Clone, Serialize, Deserialize)]-#[cfg_attr(feature = "inbound", derive(utoipa::ToSchema))]-pub struct InitiativeReference {- /// Project id.- pub id: InitiativeId,- /// Authorized project name.- pub name: String,-}--/// A task's project. An inaccessible project never exposes its id or name.-#[derive(Debug, Clone, Serialize, Deserialize)]-#[cfg_attr(feature = "inbound", derive(utoipa::ToSchema))]-#[serde(- tag = "state",- rename_all = "camelCase",- rename_all_fields = "camelCase"-)]-pub enum TaskInitiativeReference {- /// The visible task has no project.- None {- /// Task id.- #[serde(rename = "taskId")]- task_id: String,- },- /// The task or its project is not visible to the caller.- Unavailable {- /// Requested task id, with no inaccessible metadata.- #[serde(rename = "taskId")]- task_id: String,- },- /// Both task and project are visible.- Visible {- /// Task id.- #[serde(rename = "taskId")]- task_id: String,- /// Authorized project reference.- initiative: InitiativeReference,- },-}--/// Task references in deduplicated request order.-#[derive(Debug, Clone, Serialize, Deserialize)]-#[cfg_attr(feature = "inbound", derive(utoipa::ToSchema))]-pub struct TaskInitiativeReferences {- /// Per-task visibility-aware references.- pub references: Vec<TaskInitiativeReference>,-}--#[cfg(all(test, feature = "inbound"))]-mod test;diff --git a/crates/initiative/src/domain/reads/test.rs b/crates/initiative/src/domain/reads/test.rsdeleted file mode 100644index 887c68cdd4..0000000000--- a/crates/initiative/src/domain/reads/test.rs+++ /dev/null@@ -1,15 +0,0 @@-use super::TaskInitiativeReference;--#[test]-fn task_reference_schema_matches_runtime_field_names() {- let serialized = serde_json::to_value(TaskInitiativeReference::None {- task_id: "task".into(),- })- .unwrap();- assert_eq!(serialized["taskId"], "task");- let schema =- serde_json::to_value(<TaskInitiativeReference as utoipa::PartialSchema>::schema()).unwrap();- let schema = schema.to_string();- assert!(schema.contains("taskId"));- assert!(!schema.contains("task_id"));-}diff --git a/crates/initiative/src/domain/resources.rs b/crates/initiative/src/domain/resources.rsindex 3c66b8b739..ad69490041 100644--- a/crates/initiative/src/domain/resources.rs+++ b/crates/initiative/src/domain/resources.rs@@ -30,8 +30,12 @@ pub trait InitiativeResources: std::fmt::Debug + Send + Sync + 'static {id: InitiativeId,values: Vec<InitialPropertyValue>,) -> ResourceFuture<'_, ()>;- /// Clean up properties after the initiative is deleted using its already-verified capability.+ /// Clean up properties after the initiative is deleted using its already-verified capability:+ /// its own values, and the Project values that put tasks in it.fn purge(&self, receipt: EntityAccessReceipt<EditAccessLevel>) -> ResourceFuture<'_, ()>;+ /// Tasks whose Project property names the initiative, in id order. Callers authorize each+ /// task before showing it.+ fn project_tasks(&self, id: InitiativeId) -> ResourceFuture<'_, Vec<String>>;/// Return a view capability for a related entity under the same user/bot scope./// Missing and inaccessible entities return `None`; infrastructure failures remain errors.fn view(diff --git a/crates/initiative/src/domain/service.rs b/crates/initiative/src/domain/service.rsindex d67851e854..dfcfbda35a 100644--- a/crates/initiative/src/domain/service.rs+++ b/crates/initiative/src/domain/service.rs@@ -4,18 +4,15 @@mod test;use crate::domain::events::{- AssignedTasks, InitiativeChange, InitiativeEventPublisher, InitiativeMacroEvent,- InitiativeTasksChanged, InitiativeTopicEvent, receipt_attribution,+ InitiativeChange, InitiativeEventPublisher, InitiativeMacroEvent, InitiativeTopicEvent,+ receipt_attribution,};use chrono::Utc;-use std::collections::{HashMap, HashSet};+use std::collections::HashSet;use std::str::FromStr;use std::sync::Arc;mod reads;-mod tasks;--pub use tasks::{ClearTaskOutcome, ClearTaskStatus, clear_task_batch};use entity_access::domain::models::{AccessLevel, EditAccessLevel, EntityAccessAuth, EntityAccessReceipt, EntityPermission,@@ -31,10 +28,9 @@ use models_permissions::share_permission::team_share::{use unicode_segmentation::UnicodeSegmentation;use crate::domain::models::{- AssignTaskStatus, AssignTasksResponse, AssignTasksResult, CreateInitiativeRepoArgs,- CreateInitiativeRequest, InitiativeBasic, InitiativeDetail, InitiativeError, InitiativeId,- InitiativeList, MAX_INITIATIVE_DESCRIPTION_GRAPHEMES, MAX_INITIATIVE_NAME_GRAPHEMES,- MAX_TASKS_PER_ASSIGN, TaskAssignment, UpdateInitiativeRepoArgs, UpdateInitiativeRequest,+ CreateInitiativeRepoArgs, CreateInitiativeRequest, InitiativeBasic, InitiativeDetail,+ InitiativeError, InitiativeId, InitiativeList, MAX_INITIATIVE_DESCRIPTION_GRAPHEMES,+ MAX_INITIATIVE_NAME_GRAPHEMES, UpdateInitiativeRepoArgs, UpdateInitiativeRequest,};use crate::domain::ports::{InitiativeDescriptionSurfaces, InitiativeRepo, InitiativeService};use crate::domain::resources::InitiativeResources;@@ -156,13 +152,6 @@ whereself.read_tasks_page(receipt, request).await}- async fn task_references(- &self,- user_id: &MacroUserIdStr<'_>,- request: crate::domain::reads::TaskInitiativeReferencesRequest,- ) -> Result<crate::domain::reads::TaskInitiativeReferences, InitiativeError> {- self.read_task_references(user_id, request).await- }/// A seeded description surface commits before the initiative row. A failed create/// retires it, and a failed property initialization deletes the new initiative.#[tracing::instrument(err, skip_all)]@@ -308,7 +297,9 @@ where.map_err(Into::into)?.ok_or(InitiativeError::NotFound)?;detail.user_access_level = receipt_access_level(&receipt)?;- detail.task_ids = self.visible_tasks(receipt.auth(), detail.task_ids).await?;+ detail.task_ids = self+ .visible_tasks(receipt.auth(), self.resources.project_tasks(id).await?)+ .await?;Ok(detail)}@@ -403,117 +394,12 @@ where).await;detail.user_access_level = receipt_access_level(&receipt)?;- detail.task_ids = self.visible_tasks(receipt.auth(), detail.task_ids).await?;+ detail.task_ids = self+ .visible_tasks(receipt.auth(), self.resources.project_tasks(id).await?)+ .await?;Ok(detail)}- #[tracing::instrument(err, skip_all)]- async fn assign_tasks(- &self,- receipt: EntityAccessReceipt<EditAccessLevel>,- assignments: Vec<TaskAssignment>,- ) -> Result<AssignTasksResponse, InitiativeError> {- let id = initiative_id_from_receipt(&receipt)?;-- let assignments = dedupe_assignments(assignments);- if assignments.len() > MAX_TASKS_PER_ASSIGN {- return Err(InitiativeError::BadRequest(format!(- "cannot assign more than {MAX_TASKS_PER_ASSIGN} tasks at once"- )));- }-- let mut candidate_ids = Vec::new();- for assignment in &assignments {- if let TaskAssignment::Authorized {- receipt: task_receipt,- } = assignment- {- validate_task_receipt(task_receipt)?;- require_same_actor(&receipt, task_receipt)?;- candidate_ids.push(task_receipt.entity().entity_id.clone());- }- }-- let committed = if candidate_ids.is_empty() {- AssignedTasks::default()- } else {- self.repo- .assign_tasks(id, candidate_ids)- .await- .map_err(Into::into)?- };-- if !committed.changes.is_empty() {- self.publish(- id,- InitiativeTopicEvent::TasksChanged(InitiativeTasksChanged {- attribution: receipt_attribution(&receipt),- changes: committed.changes,- occurred_at: Utc::now(),- }),- )- .await;- }- Ok(AssignTasksResponse {- results: merge_assign_results(&assignments, committed.results),- })- }-- #[tracing::instrument(err, skip_all)]- async fn unassign_task(- &self,- receipt: EntityAccessReceipt<EditAccessLevel>,- task_receipt: EntityAccessReceipt<EditAccessLevel>,- ) -> Result<(), InitiativeError> {- let id = initiative_id_from_receipt(&receipt)?;- validate_task_receipt(&task_receipt)?;- require_same_actor(&receipt, &task_receipt)?;- let change = self- .repo- .unassign_task(id, &task_receipt.entity().entity_id)- .await- .map_err(Into::into)?;- if let Some(change) = change {- self.publish(- id,- InitiativeTopicEvent::TasksChanged(InitiativeTasksChanged {- attribution: receipt_attribution(&receipt),- changes: vec![change],- occurred_at: Utc::now(),- }),- )- .await;- }- Ok(())- }-- #[tracing::instrument(err, skip_all)]- async fn clear_task(- &self,- task_receipt: EntityAccessReceipt<EditAccessLevel>,- ) -> Result<(), InitiativeError> {- validate_task_receipt(&task_receipt)?;- let change = self- .repo- .clear_task(&task_receipt.entity().entity_id)- .await- .map_err(Into::into)?;- if let Some(change) = change- && let Some(id) = change.from- {- self.publish(- id,- InitiativeTopicEvent::TasksChanged(InitiativeTasksChanged {- attribution: receipt_attribution(&task_receipt),- changes: vec![change],- occurred_at: Utc::now(),- }),- )- .await;- }- Ok(())- }-#[tracing::instrument(err, skip_all)]async fn grant_assignees(&self,@@ -523,10 +409,9 @@ wheresuper::assignees::grant(&self.repo, &receipt, user_ids).await}- /// Initiative rows first, then the description. The document FK's `ON DELETE RESTRICT`- /// would reject a document-first purge while the initiative still names it. Purging the- /// document drops its sync-service session, which the surface adopted; the surface row- /// is then soft-deleted so no token outlives the initiative.+ /// Initiative rows first, then cleanup that must not outlive them: the initiative's own+ /// properties and its tasks' Project values, then the description surface, which is+ /// retired so no token outlives the initiative.#[tracing::instrument(err, skip_all)]async fn delete(&self,@@ -600,35 +485,6 @@ fn receipt_access_level<T: entity_access::domain::models::RequiredPermission>(}}-fn validate_task_receipt(- receipt: &EntityAccessReceipt<EditAccessLevel>,-) -> Result<(), InitiativeError> {- if receipt.entity().entity_type != EntityType::Document {- return Err(InitiativeError::BadRequest(- "requires a task document access receipt".to_string(),- ));- }- Ok(())-}--fn require_same_actor(- initiative: &EntityAccessReceipt<EditAccessLevel>,- task: &EntityAccessReceipt<EditAccessLevel>,-) -> Result<(), InitiativeError> {- let same_actor = match (initiative.auth(), task.auth()) {- (EntityAccessAuth::Authenticated(left), EntityAccessAuth::Authenticated(right)) => {- left == right- }- (EntityAccessAuth::Bot(left), EntityAccessAuth::Bot(right)) => left == right,- (EntityAccessAuth::Internal, EntityAccessAuth::Internal) => true,- _ => false,- };- if !same_actor {- return Err(InitiativeError::Unauthorized);- }- Ok(())-}-fn normalize_name(name: &str) -> Result<String, InitiativeError> {let name = name.trim();if name.is_empty() {@@ -729,41 +585,3 @@ fn member_diff(.collect();(added, removed)}--fn dedupe_assignments(assignments: Vec<TaskAssignment>) -> Vec<TaskAssignment> {- let mut seen = HashSet::new();- assignments- .into_iter()- .filter(|assignment| seen.insert(assignment.task_id().to_string()))- .collect()-}--fn merge_assign_results(- assignments: &[TaskAssignment],- repo_results: Vec<AssignTasksResult>,-) -> Vec<AssignTasksResult> {- let repo_by_id: HashMap<String, AssignTaskStatus> = repo_results- .into_iter()- .map(|result| (result.task_id, result.status))- .collect();- assignments- .iter()- .map(|assignment| match assignment {- TaskAssignment::Authorized { receipt } => AssignTasksResult {- task_id: receipt.entity().entity_id.clone(),- status: repo_by_id- .get(&receipt.entity().entity_id)- .copied()- .unwrap_or(AssignTaskStatus::NotFound),- },- TaskAssignment::NotFound { task_id } => AssignTasksResult {- task_id: task_id.clone(),- status: AssignTaskStatus::NotFound,- },- TaskAssignment::SkippedNoPermission { task_id } => AssignTasksResult {- task_id: task_id.clone(),- status: AssignTaskStatus::SkippedNoPermission,- },- })- .collect()-}diff --git a/crates/initiative/src/domain/service/reads.rs b/crates/initiative/src/domain/service/reads.rsindex bc0d27839e..73c9ad1892 100644--- a/crates/initiative/src/domain/service/reads.rs+++ b/crates/initiative/src/domain/service/reads.rs@@ -11,13 +11,11 @@ use serde::{Deserialize, Serialize};use super::{InitiativeServiceImpl, receipt_access_level};use crate::domain::{- models::{InitiativeError, InitiativeId, MAX_TASKS_PER_ASSIGN},+ models::{InitiativeError, InitiativeId},ports::{InitiativeDescriptionSurfaces, InitiativeRepo, InitiativeService},reads::{- InitiativePage, InitiativePageRequest, InitiativePageRow, InitiativeReference,- InitiativeSort, InitiativeTasksPage, InitiativeTasksRequest, MAX_CURSOR_LENGTH,- TaskInitiativeReference, TaskInitiativeReferences, TaskInitiativeReferencesRequest,- page_size as limit,+ InitiativePage, InitiativePageRequest, InitiativePageRow, InitiativeSort,+ InitiativeTasksPage, InitiativeTasksRequest, MAX_CURSOR_LENGTH, page_size as limit,},};@@ -345,16 +343,8 @@ impl<R: InitiativeRepo, S: InitiativeDescriptionSurfaces> InitiativeServiceImpl<let mut tasks_by_project = HashMap::new();let mut task_receipts = Vec::new();for row in &rows {- let Some(detail) = self- .repo- .get_detail(row.initiative.id)- .await- .map_err(Into::into)?- else {- continue;- };let mut ids = Vec::new();- for id in detail.task_ids {+ for id in self.resources.project_tasks(row.initiative.id).await? {if let Some(receipt) = self.resources.view(@@ -402,78 +392,4 @@ impl<R: InitiativeRepo, S: InitiativeDescriptionSurfaces> InitiativeServiceImpl<request.validate()?;self.get(receipt).await?.task_page(request)}-- pub(super) async fn read_task_references(- &self,- user_id: &MacroUserIdStr<'_>,- request: TaskInitiativeReferencesRequest,- ) -> Result<TaskInitiativeReferences, InitiativeError> {- let mut seen = std::collections::HashSet::new();- let mut ids = Vec::new();- for id in request.task_ids {- if id.is_empty() || id.len() > 128 {- return Err(InitiativeError::BadRequest("invalid task id".into()));- }- if seen.insert(id.clone()) {- if ids.len() == MAX_TASKS_PER_ASSIGN {- return Err(InitiativeError::BadRequest(- "at most 100 task ids are allowed".into(),- ));- }- ids.push(id);- }- }- let auth = EntityAccessAuth::Authenticated(user_id.clone().into_owned());- let visible = self.visible_tasks(&auth, ids.clone()).await?;- let memberships = self- .repo- .task_memberships(visible.clone())- .await- .map_err(Into::into)?;- let mut projects = HashMap::new();- for id in memberships.values() {- if projects.contains_key(id) {- continue;- }- let basic = if self- .resources- .view(- auth.clone(),- Entity {- entity_id: id.to_string(),- entity_type: EntityType::Initiative,- },- )- .await?- .is_some()- {- self.repo.get_basic(*id).await.map_err(Into::into)?- } else {- None- };- projects.insert(*id, basic);- }- let references = ids- .into_iter()- .map(|task_id| {- if !visible.contains(&task_id) {- return TaskInitiativeReference::Unavailable { task_id };- }- match memberships.get(&task_id) {- None => TaskInitiativeReference::None { task_id },- Some(id) => match projects.get(id).and_then(Option::as_ref) {- Some(project) => TaskInitiativeReference::Visible {- task_id,- initiative: InitiativeReference {- id: *id,- name: project.name.clone(),- },- },- None => TaskInitiativeReference::Unavailable { task_id },- },- }- })- .collect();- Ok(TaskInitiativeReferences { references })- }}diff --git a/crates/initiative/src/domain/service/tasks.rs b/crates/initiative/src/domain/service/tasks.rsdeleted file mode 100644index e24a01ca67..0000000000--- a/crates/initiative/src/domain/service/tasks.rs+++ /dev/null@@ -1,62 +0,0 @@-//! Independent outcomes for a bounded batch of task-side project clears.--use crate::domain::{- models::{InitiativeError, MAX_TASKS_PER_ASSIGN, TaskAssignment},- ports::InitiativeService,-};--/// Result of clearing one task's project association.-#[derive(Debug, Clone, Copy, PartialEq, Eq)]-pub enum ClearTaskStatus {- /// The task is now unassigned, including an already-unassigned task.- Cleared,- /// The authorized document is not a task.- NotATask,- /// The task no longer exists.- NotFound,- /// The actor may not edit this task.- SkippedNoPermission,- /// This task failed; other tasks retain their independent outcomes.- Failed,-}--/// A requested task and its independent clear outcome.-#[derive(Debug, PartialEq, Eq)]-pub struct ClearTaskOutcome {- /// Requested task ID.- pub task_id: String,- /// Committed result or safe failure classification.- pub status: ClearTaskStatus,-}--/// Clear authorized task associations without discarding earlier results on a later failure.-pub async fn clear_task_batch<S: InitiativeService>(- service: &S,- assignments: Vec<TaskAssignment>,-) -> Result<Vec<ClearTaskOutcome>, InitiativeError> {- if assignments.len() > MAX_TASKS_PER_ASSIGN {- return Err(InitiativeError::BadRequest(format!(- "cannot clear more than {MAX_TASKS_PER_ASSIGN} tasks at once"- )));- }- let mut results = Vec::with_capacity(assignments.len());- for assignment in assignments {- let task_id = assignment.task_id().to_owned();- let status = match assignment {- TaskAssignment::Authorized { receipt } => match service.clear_task(receipt).await {- Ok(()) => ClearTaskStatus::Cleared,- Err(InitiativeError::NotATask) => ClearTaskStatus::NotATask,- Err(InitiativeError::NotFound) => ClearTaskStatus::NotFound,- Err(InitiativeError::Unauthorized) => ClearTaskStatus::SkippedNoPermission,- Err(error) => {- tracing::error!(error=?error, %task_id, "failed to clear task project association");- ClearTaskStatus::Failed- }- },- TaskAssignment::NotFound { .. } => ClearTaskStatus::NotFound,- TaskAssignment::SkippedNoPermission { .. } => ClearTaskStatus::SkippedNoPermission,- };- results.push(ClearTaskOutcome { task_id, status });- }- Ok(results)-}diff --git a/crates/initiative/src/domain/service/test.rs b/crates/initiative/src/domain/service/test.rsindex 7b52e8d2ec..51c57f2b0f 100644--- a/crates/initiative/src/domain/service/test.rs+++ b/crates/initiative/src/domain/service/test.rs@@ -20,10 +20,9 @@ use models_permissions::share_permission::{use super::InitiativeServiceImpl;use crate::domain::models::{- AssignTaskStatus, AssignTasksResult, CreateInitiativeRequest, InitiativeBasic,- InitiativeDetail, InitiativeError, InitiativeId, InitiativeList, InitiativeSummary,- MAX_INITIATIVE_DESCRIPTION_GRAPHEMES, MAX_INITIATIVE_NAME_GRAPHEMES, MAX_TASKS_PER_ASSIGN,- TaskAssignment, UpdateInitiativeRequest,+ CreateInitiativeRequest, InitiativeBasic, InitiativeDetail, InitiativeError, InitiativeId,+ InitiativeList, InitiativeSummary, MAX_INITIATIVE_DESCRIPTION_GRAPHEMES,+ MAX_INITIATIVE_NAME_GRAPHEMES, UpdateInitiativeRequest,};use crate::domain::ports::{InitiativeService, MockInitiativeDescriptionSurfaces, MockInitiativeRepo,@@ -83,26 +82,6 @@ fn receipt<T: entity_access::domain::models::RequiredPermission>(.expect("permission satisfies the receipt")}-fn task_receipt(user_id: &str, task_id: &str) -> EntityAccessReceipt<EditAccessLevel> {- EntityAccessReceipt::try_new_authenticated_user(- user(user_id),- Entity {- entity_id: task_id.to_string(),- entity_type: EntityType::Document,- },- EntityPermission::AccessLevel {- access_level: AccessLevel::Edit,- },- )- .expect("task edit capability")-}--fn assignment(task_id: &str) -> TaskAssignment {- TaskAssignment::Authorized {- receipt: task_receipt(OWNER, task_id),- }-}-fn edit_receipt() -> EntityAccessReceipt<EditAccessLevel> {receipt(OWNER, EntityType::Initiative, AccessLevel::Edit)}@@ -554,90 +533,7 @@ async fn team_share_patch_is_refused_when_the_actor_does_not_own_the_initiative(}#[tokio::test]-async fn assign_rejects_non_initiative_receipts() {- let repo = MockInitiativeRepo::new();- let document_receipt: EntityAccessReceipt<EditAccessLevel> =- receipt(OWNER, EntityType::Document, AccessLevel::Edit);- let result = service(repo)- .assign_tasks(document_receipt, vec![assignment("task-1")])- .await;- assert!(matches!(result, Err(InitiativeError::BadRequest(_))));-}--#[tokio::test]-async fn assign_dedupes_enforces_cap_and_preserves_order() {- let mut repo = MockInitiativeRepo::new();- repo.expect_assign_tasks()- .withf(|_, task_ids| task_ids == &["t1".to_string(), "t2".to_string()])- .return_once(|_, _| {- Box::pin(async {- Ok(crate::domain::events::AssignedTasks {- results: vec![- AssignTasksResult {- task_id: "t1".into(),- status: AssignTaskStatus::Assigned,- },- AssignTasksResult {- task_id: "t2".into(),- status: AssignTaskStatus::Moved,- },- ],- changes: Vec::new(),- })- })- });-- let response = service(repo)- .assign_tasks(- edit_receipt(),- vec![- assignment("t1"),- TaskAssignment::SkippedNoPermission {- task_id: "skip".into(),- },- assignment("t1"),- TaskAssignment::NotFound {- task_id: "missing".into(),- },- assignment("t2"),- ],- )- .await- .expect("assigned");-- assert_eq!(- response.results,- vec![- AssignTasksResult {- task_id: "t1".into(),- status: AssignTaskStatus::Assigned,- },- AssignTasksResult {- task_id: "skip".into(),- status: AssignTaskStatus::SkippedNoPermission,- },- AssignTasksResult {- task_id: "missing".into(),- status: AssignTaskStatus::NotFound,- },- AssignTasksResult {- task_id: "t2".into(),- status: AssignTaskStatus::Moved,- },- ]- );-- let over_cap: Vec<TaskAssignment> = (0..=MAX_TASKS_PER_ASSIGN)- .map(|i| assignment(&format!("task-{i}")))- .collect();- let capped = service(MockInitiativeRepo::new())- .assign_tasks(edit_receipt(), over_cap)- .await;- assert!(matches!(capped, Err(InitiativeError::BadRequest(_))));-}--#[tokio::test]-async fn get_list_and_unassign_call_the_repo() {+async fn get_and_list_call_the_repo() {let mut repo = MockInitiativeRepo::new();repo.expect_get_basic().return_once(|_| {Box::pin(async {@@ -661,8 +557,6 @@ async fn get_list_and_unassign_call_the_repo() {})})});- repo.expect_unassign_task()- .return_once(|_, _| Box::pin(async { Ok(None) }));let svc = service(repo);svc.internal_get_basic(initiative_id())@@ -670,9 +564,6 @@ async fn get_list_and_unassign_call_the_repo() {.expect("basic");svc.get(view_receipt()).await.expect("detail");svc.list(&user(OWNER)).await.expect("list");- svc.unassign_task(edit_receipt(), task_receipt(OWNER, "task-1"))- .await- .expect("unassign");}#[tokio::test]diff --git a/crates/initiative/src/domain/service/test/access.rs b/crates/initiative/src/domain/service/test/access.rsindex f06d1a08e9..97df6b11c3 100644--- a/crates/initiative/src/domain/service/test/access.rs+++ b/crates/initiative/src/domain/service/test/access.rs@@ -101,65 +101,6 @@ async fn editors_cannot_replace_or_clear_collaborators_but_can_rename() {.expect("editors may rename the project");}-#[tokio::test]-async fn assignment_rejects_task_capability_for_another_principal() {- let result = service(MockInitiativeRepo::new())- .assign_tasks(- edit_receipt(),- vec![TaskAssignment::Authorized {- receipt: task_receipt(OTHER, "task-1"),- }],- )- .await;- assert!(matches!(result, Err(InitiativeError::Unauthorized)));-}--#[tokio::test]-async fn assignment_rejects_non_document_task_capability() {- let result = service(MockInitiativeRepo::new())- .assign_tasks(- edit_receipt(),- vec![TaskAssignment::Authorized {- receipt: edit_receipt(),- }],- )- .await;- assert!(matches!(result, Err(InitiativeError::BadRequest(_))));-}--#[tokio::test]-async fn removal_rejects_task_capability_for_another_principal() {- let result = service(MockInitiativeRepo::new())- .unassign_task(edit_receipt(), task_receipt(OTHER, "task-1"))- .await;- assert!(matches!(result, Err(InitiativeError::Unauthorized)));-}--#[tokio::test]-async fn removal_requires_a_task_document_capability() {- let result = service(MockInitiativeRepo::new())- .unassign_task(edit_receipt(), edit_receipt())- .await;- assert!(matches!(result, Err(InitiativeError::BadRequest(_))));- let clear = service(MockInitiativeRepo::new())- .clear_task(edit_receipt())- .await;- assert!(matches!(clear, Err(InitiativeError::BadRequest(_))));-}--#[tokio::test]-async fn task_side_clear_needs_no_source_initiative_receipt() {- let mut repo = MockInitiativeRepo::new();- repo.expect_clear_task()- .withf(|id| id == "task-1")- .times(1)- .return_once(|_| Box::pin(async { Ok(None) }));- service(repo)- .clear_task(task_receipt(OWNER, "task-1"))- .await- .expect("cleared");-}-#[tokio::test]async fn all_lifecycle_operations_validate_initiative_entity_type() {let svc = service(MockInitiativeRepo::new());@@ -198,48 +139,3 @@ async fn assignee_sharing_deduplicates_and_keeps_owner_assignable() {.await.expect("granted");}--#[tokio::test]-async fn batch_clear_preserves_successes_and_continues_after_independent_failures() {- use crate::domain::service::{ClearTaskStatus, clear_task_batch};- let mut repo = MockInitiativeRepo::new();- repo.expect_clear_task().times(4).returning(|id| {- let result = match id {- "first" | "last" => Ok(None),- "not-task" => Err(InitiativeError::NotATask),- "broken" => Err(InitiativeError::Internal(rootcause::report!(- "storage unavailable"- ))),- _ => panic!("unauthorized or missing IDs must not reach persistence"),- };- Box::pin(async move { result })- });- let assignments = vec![- assignment("first"),- assignment("broken"),- assignment("not-task"),- TaskAssignment::NotFound {- task_id: "missing".into(),- },- TaskAssignment::SkippedNoPermission {- task_id: "denied".into(),- },- assignment("last"),- ];- let result = clear_task_batch(&service(repo), assignments).await.unwrap();- let actual: Vec<_> = result- .into_iter()- .map(|row| (row.task_id, row.status))- .collect();- assert_eq!(- actual,- vec![- ("first".into(), ClearTaskStatus::Cleared),- ("broken".into(), ClearTaskStatus::Failed),- ("not-task".into(), ClearTaskStatus::NotATask),- ("missing".into(), ClearTaskStatus::NotFound),- ("denied".into(), ClearTaskStatus::SkippedNoPermission),- ("last".into(), ClearTaskStatus::Cleared),- ]- );-}diff --git a/crates/initiative/src/domain/service/test/events.rs b/crates/initiative/src/domain/service/test/events.rsindex 60b8b1fb11..17aa57dd5f 100644--- a/crates/initiative/src/domain/service/test/events.rs+++ b/crates/initiative/src/domain/service/test/events.rs@@ -1,8 +1,5 @@use super::*;-use crate::domain::events::{- AssignedTasks, InitiativeEventPublisher, InitiativeMacroEvent, InitiativeTopicEvent,- TaskMembershipChange,-};+use crate::domain::events::{InitiativeEventPublisher, InitiativeMacroEvent, InitiativeTopicEvent};use macro_event_broker::MacroEvent;use std::{future::Future,@@ -82,52 +79,6 @@ impl InitiativeEventPublisher for Events {}}-#[tokio::test]-async fn assignment_publishes_only_committed_membership_changes() {- let mut repo = MockInitiativeRepo::new();- repo.expect_assign_tasks().times(1).return_once(|id, _| {- Box::pin(async move {- Ok(AssignedTasks {- results: vec![AssignTasksResult {- task_id: "task-1".into(),- status: AssignTaskStatus::Assigned,- }],- changes: vec![TaskMembershipChange {- task_id: "task-1".into(),- from: None,- to: Some(id),- }],- })- })- });- let events = Arc::new(Events::default());- let svc = service(repo).with_event_publisher(events.clone());- svc.assign_tasks(edit_receipt(), vec![assignment("task-1")])- .await- .unwrap();- let events = events.0.lock().unwrap();- let [InitiativeTopicEvent::TasksChanged(change)] = events.as_slice() else {- panic!("expected one committed membership event")- };- assert_eq!(change.changes[0].task_id, "task-1");- assert!(change.attribution.is_some());-}--#[tokio::test]-async fn repeated_assignment_has_no_activity() {- let mut repo = MockInitiativeRepo::new();- repo.expect_assign_tasks()- .times(1)- .return_once(|_, _| Box::pin(async { Ok(AssignedTasks::default()) }));- let events = Arc::new(Events::default());- service(repo)- .with_event_publisher(events.clone())- .assign_tasks(edit_receipt(), vec![assignment("task-1")])- .await- .unwrap();- assert!(events.0.lock().unwrap().is_empty());-}-#[tokio::test]async fn committed_deletion_purges_activity_even_when_description_cleanup_fails() {let mut repo = MockInitiativeRepo::new();diff --git a/crates/initiative/src/domain/service/test/initial_properties.rs b/crates/initiative/src/domain/service/test/initial_properties.rsindex 4c0e29d5e5..eefc4d8a8d 100644--- a/crates/initiative/src/domain/service/test/initial_properties.rs+++ b/crates/initiative/src/domain/service/test/initial_properties.rs@@ -49,6 +49,9 @@ impl InitiativeResources for RecordingResources {fn purge(&self, _receipt: EntityAccessReceipt<EditAccessLevel>) -> ResourceFuture<'_, ()> {panic!("a create never purges through a receipt")}+ fn project_tasks(&self, _id: InitiativeId) -> ResourceFuture<'_, Vec<String>> {+ Box::pin(async { Ok(Vec::new()) })+ }fn view(&self,_auth: EntityAccessAuth,diff --git a/crates/initiative/src/domain/service/test/reads.rs b/crates/initiative/src/domain/service/test/reads.rsindex 2e9fc0c04b..67ab0d464c 100644--- a/crates/initiative/src/domain/service/test/reads.rs+++ b/crates/initiative/src/domain/service/test/reads.rs@@ -12,6 +12,8 @@ use std::{#[derive(Debug, Default)]pub(super) struct FakeResources {denied: HashSet<String>,+ /// Every project's tasks, from their Project property.+ tasks: Vec<String>,values: HashMap<String, InitiativePropertySnapshot>,fail_initialization: bool,}@@ -39,6 +41,9 @@ impl InitiativeResources for FakeResources {fn purge(&self, _receipt: EntityAccessReceipt<EditAccessLevel>) -> ResourceFuture<'_, ()> {Box::pin(async { Ok(()) })}+ fn project_tasks(&self, _id: InitiativeId) -> ResourceFuture<'_, Vec<String>> {+ Box::pin(async { Ok(self.tasks.clone()) })+ }fn view(&self,auth: EntityAccessAuth,@@ -87,19 +92,16 @@ fn summary(id: u128, name: &str) -> InitiativeSummary {#[tokio::test]async fn single_summary_counts_only_visible_tasks_and_uses_canonical_properties() {let mut repo = MockInitiativeRepo::new();- repo.expect_get_detail().times(1).return_once(|_| {- Box::pin(async {- let mut d = detail(Vec::new());- d.task_ids = vec!["open".into(), "done".into(), "hidden".into()];- Ok(Some(d))- })- });+ repo.expect_get_detail()+ .times(1)+ .return_once(|_| Box::pin(async { Ok(Some(detail(Vec::new()))) }));let status = uuid::Uuid::from_u128(50);let project_id = detail(Vec::new()).id.to_string();let svc = service_with_resources(repo,FakeResources {denied: HashSet::from(["hidden".into()]),+ tasks: vec!["open".into(), "done".into(), "hidden".into()],values: HashMap::from([(project_id,@@ -212,17 +214,14 @@ async fn failed_initialization_compensation_does_not_purge_a_remaining_project()#[tokio::test]async fn task_paging_filters_visibility_before_counting_and_page_boundaries() {let mut repo = MockInitiativeRepo::new();- repo.expect_get_detail().times(2).returning(|_| {- Box::pin(async {- let mut d = detail(Vec::new());- d.task_ids = vec!["z".into(), "hidden".into(), "a".into()];- Ok(Some(d))- })- });+ repo.expect_get_detail()+ .times(2)+ .returning(|_| Box::pin(async { Ok(Some(detail(Vec::new()))) }));let svc = service_with_resources(repo,FakeResources {denied: HashSet::from(["hidden".into()]),+ tasks: vec!["z".into(), "hidden".into(), "a".into()],..Default::default()},);@@ -264,14 +263,6 @@ async fn collection_filters_properties_before_paging_and_counts_only_visible_tas})})});- repo.expect_get_detail().times(2).returning(|id| {- Box::pin(async move {- let mut d = detail(Vec::new());- d.id = id;- d.task_ids = vec!["visible".into(), "hidden".into()];- Ok(Some(d))- })- });let selected = InitiativePropertySnapshot {status: Some(status),..Default::default()@@ -280,6 +271,7 @@ async fn collection_filters_properties_before_paging_and_counts_only_visible_tasrepo,FakeResources {denied: HashSet::from(["hidden".into()]),+ tasks: vec!["visible".into(), "hidden".into()],values: HashMap::from([(summary(1, "").id.to_string(), selected.clone()),(summary(2, "").id.to_string(), selected),@@ -318,79 +310,6 @@ async fn collection_filters_properties_before_paging_and_counts_only_visible_tasassert!(last.next_cursor.is_none());}-#[tokio::test]-async fn task_references_distinguish_unassigned_from_inaccessible_without_metadata_leaks() {- let visible_project = summary(1, "Visible").id;- let hidden_project = summary(2, "Secret").id;- let mut repo = MockInitiativeRepo::new();- repo.expect_task_memberships()- .withf(|ids| ids == &["unassigned", "visible", "secret"])- .return_once(move |_| {- Box::pin(async move {- Ok(HashMap::from([- ("visible".into(), visible_project),- ("secret".into(), hidden_project),- ]))- })- });- repo.expect_get_basic()- .withf(move |id| *id == visible_project)- .times(1)- .return_once(move |_| {- Box::pin(async move {- Ok(Some(InitiativeBasic {- id: visible_project,- name: "Visible".into(),- owner_id: user(OWNER),- }))- })- });- let svc = service_with_resources(- repo,- FakeResources {- denied: HashSet::from([hidden_project.to_string(), "hidden-task".into()]),- ..Default::default()- },- );- let response = svc- .task_references(- &user(OWNER),- TaskInitiativeReferencesRequest {- task_ids: vec![- "unassigned".into(),- "visible".into(),- "secret".into(),- "hidden-task".into(),- "visible".into(),- ],- },- )- .await- .unwrap();- assert_eq!(response.references.len(), 4);- assert!(matches!(- response.references[0],- TaskInitiativeReference::None { .. }- ));- assert!(matches!(- response.references[1],- TaskInitiativeReference::Visible { .. }- ));- assert!(matches!(- response.references[2],- TaskInitiativeReference::Unavailable { .. }- ));- assert!(matches!(- response.references[3],- TaskInitiativeReference::Unavailable { .. }- ));- assert!(- !serde_json::to_string(&response)- .unwrap()- .contains(&hidden_project.to_string())- );-}-#[tokio::test]async fn cursors_remain_bounded_and_preserve_full_unicode_name_ordering() {let prefix = format!("A{}", "\u{301}".repeat(1500));@@ -484,9 +403,6 @@ async fn removed_name_cursor_anchor_requires_restarting_instead_of_silently_skip})})});- repo.expect_get_detail()- .times(1)- .return_once(|_| Box::pin(async { Ok(Some(detail(Vec::new()))) }));let svc = service_with_resources(repo, FakeResources::default());let mut request = InitiativePageRequest {limit: Some(1),@@ -542,9 +458,6 @@ async fn renamed_name_cursor_anchor_requires_restarting_in_both_directions() {})})});- repo.expect_get_detail()- .times(1)- .return_once(|_| Box::pin(async { Ok(Some(detail(Vec::new()))) }));let svc = service_with_resources(repo, FakeResources::default());let mut request = InitiativePageRequest {limit: Some(1),diff --git a/crates/initiative/src/inbound/axum_router.rs b/crates/initiative/src/inbound/axum_router.rsindex 7ff527cadf..f2794c9a62 100644--- a/crates/initiative/src/inbound/axum_router.rs+++ b/crates/initiative/src/inbound/axum_router.rs@@ -3,12 +3,10 @@#[cfg(test)]mod test;-pub mod assign_tasks;pub mod create;pub mod delete;pub mod get;pub mod list;-pub mod unassign_task;pub mod update;use std::str::FromStr;@@ -29,9 +27,8 @@ use model_error_response::ErrorResponse;use serde::{Deserialize, Serialize};pub use self::{- assign_tasks::assign_initiative_tasks_handler, create::create_initiative_handler,- delete::delete_initiative_handler, get::get_initiative_handler, list::list_initiatives_handler,- unassign_task::unassign_initiative_task_handler, update::update_initiative_handler,+ create::create_initiative_handler, delete::delete_initiative_handler,+ get::get_initiative_handler, list::list_initiatives_handler, update::update_initiative_handler,};use crate::domain::{models::{InitiativeBasic, InitiativeError, InitiativeId},@@ -101,16 +98,6 @@ pub struct InitiativeIdParams {pub initiative_id: String,}-/// Path parameters for unassigning one task.-#[derive(Debug, Deserialize, utoipa::IntoParams)]-#[into_params(parameter_in = Path)]-pub struct UnassignTaskParams {- /// Initiative identifier.- pub initiative_id: String,- /// Task identifier.- pub task_id: String,-}-/// Build the initiative router.////// Nested under `/initiatives` by the composition root.@@ -128,14 +115,6 @@ where.patch(update_initiative_handler::<S, Eas, Auth>).delete(delete_initiative_handler::<S, Eas, Auth>),)- .route(- "/{initiative_id}/tasks",- routing::put(assign_initiative_tasks_handler::<S, Eas, Auth>),- )- .route(- "/{initiative_id}/tasks/{task_id}",- routing::delete(unassign_initiative_task_handler::<S, Eas, Auth>),- ).layer(middleware::from_fn_with_state(state.clone(),ensure_initiative_exists::<S, Eas, Auth>,@@ -212,7 +191,7 @@ impl IntoResponse for InitiativeError {let status_code = match &self {InitiativeError::NotFound => StatusCode::NOT_FOUND,InitiativeError::Unauthorized => StatusCode::UNAUTHORIZED,- InitiativeError::BadRequest(_) | InitiativeError::NotATask => StatusCode::BAD_REQUEST,+ InitiativeError::BadRequest(_) => StatusCode::BAD_REQUEST,InitiativeError::Conflict(_) => StatusCode::CONFLICT,InitiativeError::NameTooLong { .. } => StatusCode::UNPROCESSABLE_ENTITY,InitiativeError::Internal(_) => StatusCode::INTERNAL_SERVER_ERROR,diff --git a/crates/initiative/src/inbound/axum_router/assign_tasks.rs b/crates/initiative/src/inbound/axum_router/assign_tasks.rsdeleted file mode 100644index ca7748322d..0000000000--- a/crates/initiative/src/inbound/axum_router/assign_tasks.rs+++ /dev/null@@ -1,75 +0,0 @@-//! Handler for assigning tasks to an initiative.--use axum::{Json, extract::State};-use entity_access::domain::models::{EditAccessLevel, EntityType};-use entity_access::domain::ports::EntityAccessService;-use entity_access::inbound::axum_extractors::InitiativeAccessExtractor;-use macro_authorization::{MacroAuthorizationExtractor, MacroAuthorizationService, UserOrInternal};-use model_error_response::ErrorResponse;--use super::{InitiativeIdParams, InitiativeRouterState};-use crate::domain::{- models::{- AssignTasksRequest, AssignTasksResponse, InitiativeError, TaskAssignment,- TaskAssignmentBatch,- },- ports::InitiativeService,-};--/// Assign tasks the caller can edit.-#[utoipa::path(- put,- tag = "initiative",- operation_id = "assign_initiative_tasks",- path = "/initiatives/{initiative_id}/tasks",- params(InitiativeIdParams),- request_body = AssignTasksRequest,- responses(- (status = 200, body = AssignTasksResponse),- (status = 400, body = ErrorResponse),- (status = 401, description = "Missing or invalid credentials", body = ErrorResponse),- (status = 404, body = ErrorResponse),- (status = 500, body = ErrorResponse),- )-)]-#[tracing::instrument(err, skip_all)]-pub async fn assign_initiative_tasks_handler<S, Eas, Auth>(- State(state): State<InitiativeRouterState<S, Eas, Auth>>,- access: InitiativeAccessExtractor<EditAccessLevel, Eas, Auth>,- user: MacroAuthorizationExtractor<Auth, UserOrInternal>,- Json(request): Json<AssignTasksRequest>,-) -> Result<Json<AssignTasksResponse>, InitiativeError>-where- S: InitiativeService,- Eas: EntityAccessService,- Auth: MacroAuthorizationService,-{- let user_id = &user.authorization.user.macro_user_id;- let user_org_id = user- .authorization- .user- .user_context- .organization_id- .map(i64::from);-- let task_ids = TaskAssignmentBatch::try_new(request.task_ids)?.into_task_ids();- let mut assignments = Vec::with_capacity(task_ids.len());- for task_id in task_ids {- let result = state- .entity_access_service- .generate_entity_access_receipt::<EditAccessLevel>(- user_id,- user_org_id,- &task_id,- EntityType::Document,- )- .await;- assignments.push(TaskAssignment::from_access(task_id, result)?);- }-- let response = state- .service- .assign_tasks(access.entity_access_receipt, assignments)- .await?;- Ok(Json(response))-}diff --git a/crates/initiative/src/inbound/axum_router/test.rs b/crates/initiative/src/inbound/axum_router/test.rsindex f3b7348908..57c9d199f0 100644--- a/crates/initiative/src/inbound/axum_router/test.rs+++ b/crates/initiative/src/inbound/axum_router/test.rs@@ -1,6 +1,3 @@-use std::collections::HashMap;--mod access;use std::sync::{Arc, Mutex};use axum::http::{StatusCode, header};@@ -30,18 +27,14 @@ use uuid::Uuid;use super::*;use crate::domain::{models::{- AssignTaskStatus, AssignTasksResponse, AssignTasksResult, CreateInitiativeRequest,- InitiativeBasic, InitiativeDetail, InitiativeError, InitiativeId, InitiativeList,- InitiativeSummary, MAX_INITIATIVE_NAME_GRAPHEMES, TaskAssignment, UpdateInitiativeRequest,+ CreateInitiativeRequest, InitiativeBasic, InitiativeDetail, InitiativeError, InitiativeId,+ InitiativeList, InitiativeSummary, MAX_INITIATIVE_NAME_GRAPHEMES, UpdateInitiativeRequest,},ports::InitiativeService,};const USER_ID: &str = "macro|[email protected]";const VALID_JWT: &str = "valid";-const TASK_OK: &str = "task-ok";-const TASK_DENIED: &str = "task-denied";-const TASK_MISSING: &str = "task-missing";fn existing_id() -> InitiativeId {InitiativeId::from_uuid(Uuid::from_u128(1))@@ -131,23 +124,12 @@ impl MacroAuthorizationService for FakeAuthorizationService {#[derive(Clone)]struct FakeEntityAccessService {initiative_access: Option<AccessLevel>,- document_denials: HashMap<String, fn() -> AccessError>,}impl FakeEntityAccessService {fn without_initiative_access() -> Self {Self {initiative_access: None,- document_denials: HashMap::new(),- }- }-- fn denying_document(task_id: &str, denial: fn() -> AccessError) -> Self {- let mut document_denials = HashMap::new();- document_denials.insert(task_id.to_string(), denial);- Self {- initiative_access: Some(AccessLevel::Owner),- document_denials,}}}@@ -156,7 +138,6 @@ impl Default for FakeEntityAccessService {fn default() -> Self {Self {initiative_access: Some(AccessLevel::Owner),- document_denials: HashMap::new(),}}}@@ -172,9 +153,6 @@ impl EntityAccessService for FakeEntityAccessService {if entity_type != EntityType::Document {return Err(AccessError::internal("test access failure"));}- if let Some(denial) = self.document_denials.get(entity_id) {- return Err(denial());- }EntityAccessReceipt::try_new_authenticated_user(MacroUserIdStr::parse_from_str(USER_ID).expect("valid user id")@@ -286,9 +264,6 @@ enum ServiceCall {Create { name: String },Get,Update,- Assign(Vec<AssignTasksResult>),- Unassign { task_id: String },- Clear { task_id: String },Delete,}@@ -355,16 +330,6 @@ impl InitiativeService for FakeInitiativeService {})}- async fn task_references(- &self,- _user_id: &MacroUserIdStr<'_>,- _request: crate::domain::reads::TaskInitiativeReferencesRequest,- ) -> Result<crate::domain::reads::TaskInitiativeReferences, InitiativeError> {- Ok(crate::domain::reads::TaskInitiativeReferences {- references: Vec::new(),- })- }-async fn create(&self,_user_id: &MacroUserIdStr<'_>,@@ -426,51 +391,6 @@ impl InitiativeService for FakeInitiativeService {Ok(sample_detail())}- async fn assign_tasks(- &self,- _receipt: EntityAccessReceipt<EditAccessLevel>,- assignments: Vec<TaskAssignment>,- ) -> Result<AssignTasksResponse, InitiativeError> {- let response = AssignTasksResponse {- results: assignments- .into_iter()- .map(|assignment| AssignTasksResult {- status: match &assignment {- TaskAssignment::Authorized { .. } => AssignTaskStatus::Assigned,- TaskAssignment::NotFound { .. } => AssignTaskStatus::NotFound,- TaskAssignment::SkippedNoPermission { .. } => {- AssignTaskStatus::SkippedNoPermission- }- },- task_id: assignment.task_id().to_string(),- })- .collect(),- };- self.record(ServiceCall::Assign(response.results.clone()));- Ok(response)- }-- async fn unassign_task(- &self,- _receipt: EntityAccessReceipt<EditAccessLevel>,- task_receipt: EntityAccessReceipt<EditAccessLevel>,- ) -> Result<(), InitiativeError> {- self.record(ServiceCall::Unassign {- task_id: task_receipt.entity().entity_id.clone(),- });- Ok(())- }-- async fn clear_task(- &self,- task_receipt: EntityAccessReceipt<EditAccessLevel>,- ) -> Result<(), InitiativeError> {- self.record(ServiceCall::Clear {- task_id: task_receipt.entity().entity_id.clone(),- });- Ok(())- }-async fn grant_assignees(&self,_receipt: EntityAccessReceipt<EditAccessLevel>,@@ -697,64 +617,6 @@ async fn update_returns_200() {assert_eq!(service.calls(), vec![ServiceCall::Update]);}-#[tokio::test]-async fn assign_tasks_returns_200() {- let service = FakeInitiativeService::default();- let response = send(- build_router(service.clone(), FakeEntityAccessService::default()),- authed(axum::http::Request::put(format!(- "/{}/tasks",- existing_id()- )))- .header(header::CONTENT_TYPE, "application/json")- .body(json_body(serde_json::json!({ "taskIds": [TASK_OK] })))- .expect("request should build"),- )- .await;-- assert_eq!(response.status(), StatusCode::OK);- assert_eq!(- read_json(response).await,- serde_json::json!({- "results": [{ "taskId": TASK_OK, "status": "assigned" }]- })- );- assert_eq!(- service.calls(),- vec![ServiceCall::Assign(vec![AssignTasksResult {- task_id: TASK_OK.to_string(),- status: AssignTaskStatus::Assigned,- }])]- );-}--#[tokio::test]-async fn unassign_task_returns_200() {- let service = FakeInitiativeService::default();- let response = send(- build_router(service.clone(), FakeEntityAccessService::default()),- authed(axum::http::Request::delete(format!(- "/{}/tasks/{TASK_OK}",- existing_id()- )))- .body(axum::body::Body::empty())- .expect("request should build"),- )- .await;-- assert_eq!(response.status(), StatusCode::OK);- assert_eq!(- read_json(response).await,- serde_json::json!({ "success": true })- );- assert_eq!(- service.calls(),- vec![ServiceCall::Unassign {- task_id: TASK_OK.to_string()- }]- );-}-#[tokio::test]async fn delete_returns_200() {let service = FakeInitiativeService::default();@@ -796,133 +658,44 @@ async fn a_name_that_is_too_long_is_422() {}#[tokio::test]-async fn assign_unauthorized_is_skipped_no_permission() {- let service = FakeInitiativeService::default();- let response = send(- build_router(- service.clone(),- FakeEntityAccessService::denying_document(TASK_DENIED, || AccessError::Unauthorized),- ),- authed(axum::http::Request::put(format!(- "/{}/tasks",- existing_id()- )))- .header(header::CONTENT_TYPE, "application/json")- .body(json_body(serde_json::json!({- "taskIds": [TASK_DENIED, TASK_OK]- })))- .expect("request should build"),- )- .await;-- assert_eq!(response.status(), StatusCode::OK);- assert_eq!(- read_json(response).await,- serde_json::json!({- "results": [- { "taskId": TASK_DENIED, "status": "skippedNoPermission" },- { "taskId": TASK_OK, "status": "assigned" }- ]- })- );-}--#[tokio::test]-async fn assign_unauthorized_with_message_is_skipped_no_permission() {+async fn list_without_credentials_is_401() {let response = send(build_router(FakeInitiativeService::default(),- FakeEntityAccessService::denying_document(TASK_DENIED, || {- AccessError::UnauthorizedWithMessage("nope")- }),+ FakeEntityAccessService::default(),),- authed(axum::http::Request::put(format!(- "/{}/tasks",- existing_id()- )))- .header(header::CONTENT_TYPE, "application/json")- .body(json_body(serde_json::json!({ "taskIds": [TASK_DENIED] })))- .expect("request should build"),+ axum::http::Request::get("/")+ .body(axum::body::Body::empty())+ .expect("request should build"),).await;- assert_eq!(response.status(), StatusCode::OK);- assert_eq!(- read_json(response).await,- serde_json::json!({- "results": [{ "taskId": TASK_DENIED, "status": "skippedNoPermission" }]- })- );+ assert_eq!(response.status(), StatusCode::UNAUTHORIZED);}#[tokio::test]-async fn assign_not_found_is_not_found() {- let response = send(- build_router(- FakeInitiativeService::default(),- FakeEntityAccessService::denying_document(TASK_MISSING, || {- AccessError::NotFound("task")- }),- ),+async fn task_membership_routes_are_gone() {+ // Tasks join a project through their Project property instead.+ let service = FakeInitiativeService::default();+ for request in [authed(axum::http::Request::put(format!("/{}/tasks",existing_id()))).header(header::CONTENT_TYPE, "application/json")- .body(json_body(serde_json::json!({ "taskIds": [TASK_MISSING] })))- .expect("request should build"),- )- .await;-- assert_eq!(response.status(), StatusCode::OK);- assert_eq!(- read_json(response).await,- serde_json::json!({- "results": [{ "taskId": TASK_MISSING, "status": "notFound" }]- })- );-}--#[tokio::test]-async fn assign_bad_request_is_not_found() {- let response = send(- build_router(- FakeInitiativeService::default(),- FakeEntityAccessService::denying_document(TASK_MISSING, || {- AccessError::BadRequest("bad")- }),- ),- authed(axum::http::Request::put(format!(- "/{}/tasks",+ .body(json_body(serde_json::json!({ "taskIds": ["task-1"] }))),+ authed(axum::http::Request::delete(format!(+ "/{}/tasks/task-1",existing_id())))- .header(header::CONTENT_TYPE, "application/json")- .body(json_body(serde_json::json!({ "taskIds": [TASK_MISSING] })))- .expect("request should build"),- )- .await;-- assert_eq!(response.status(), StatusCode::OK);- assert_eq!(- read_json(response).await,- serde_json::json!({- "results": [{ "taskId": TASK_MISSING, "status": "notFound" }]- })- );-}--#[tokio::test]-async fn list_without_credentials_is_401() {- let response = send(- build_router(- FakeInitiativeService::default(),- FakeEntityAccessService::default(),- ),- axum::http::Request::get("/")- .body(axum::body::Body::empty())- .expect("request should build"),- )- .await;-- assert_eq!(response.status(), StatusCode::UNAUTHORIZED);+ .body(axum::body::Body::empty()),+ ] {+ let response = send(+ build_router(service.clone(), FakeEntityAccessService::default()),+ request.expect("request should build"),+ )+ .await;+ assert!(response.status().is_client_error(), "{}", response.status());+ }+ assert!(service.calls().is_empty());}diff --git a/crates/initiative/src/inbound/axum_router/test/access.rs b/crates/initiative/src/inbound/axum_router/test/access.rsdeleted file mode 100644index 107ea59e5c..0000000000--- a/crates/initiative/src/inbound/axum_router/test/access.rs+++ /dev/null@@ -1,62 +0,0 @@-use super::*;--#[tokio::test]-async fn unassign_rejects_task_without_edit_access() {- let service = FakeInitiativeService::default();- let response = send(- build_router(- service.clone(),- FakeEntityAccessService::denying_document(TASK_DENIED, || AccessError::Unauthorized),- ),- authed(axum::http::Request::delete(format!(- "/{}/tasks/{TASK_DENIED}",- existing_id()- )))- .body(axum::body::Body::empty())- .expect("request"),- )- .await;- assert_eq!(response.status(), StatusCode::UNAUTHORIZED);- assert!(service.calls().is_empty());-}--#[tokio::test]-async fn assign_rejects_oversized_batch_before_access_lookup() {- let task_ids: Vec<String> = (0..=crate::domain::models::MAX_TASKS_PER_ASSIGN)- .map(|i| format!("task-{i}"))- .collect();- let service = FakeInitiativeService::default();- let response = send(- build_router(- service.clone(),- FakeEntityAccessService::denying_document("task-0", || {- AccessError::internal("access must not run")- }),- ),- authed(axum::http::Request::put(format!(- "/{}/tasks",- existing_id()- )))- .header(header::CONTENT_TYPE, "application/json")- .body(json_body(serde_json::json!({"taskIds": task_ids})))- .expect("request"),- )- .await;- assert_eq!(response.status(), StatusCode::BAD_REQUEST);- assert!(service.calls().is_empty());-}--#[tokio::test]-async fn assign_deduplicates_before_sending_capabilities_to_the_service() {- let response = send(- build_router(FakeInitiativeService::default(), FakeEntityAccessService::default()),- authed(axum::http::Request::put(format!("/{}/tasks", existing_id())))- .header(header::CONTENT_TYPE, "application/json")- .body(json_body(serde_json::json!({"taskIds": vec![TASK_OK; crate::domain::models::MAX_TASKS_PER_ASSIGN + 1]}))).expect("request"),- ).await;- assert_eq!(response.status(), StatusCode::OK);- assert_eq!(- read_json(response).await,- serde_json::json!({"results": [{"taskId": TASK_OK, "status": "assigned"}]})- );-}diff --git a/crates/initiative/src/inbound/axum_router/unassign_task.rs b/crates/initiative/src/inbound/axum_router/unassign_task.rsdeleted file mode 100644index a7adcda329..0000000000--- a/crates/initiative/src/inbound/axum_router/unassign_task.rs+++ /dev/null@@ -1,61 +0,0 @@-//! Handler for unassigning one task from an initiative.--use axum::{- Json,- extract::{Path, State},-};-use entity_access::domain::models::{EditAccessLevel, EntityType};-use entity_access::domain::ports::EntityAccessService;-use entity_access::inbound::axum_extractors::InitiativeAccessExtractor;-use macro_authorization::{MacroAuthorizationExtractor, MacroAuthorizationService, UserOrInternal};-use model_error_response::ErrorResponse;--use super::{GenericSuccessResponse, InitiativeRouterState, UnassignTaskParams};-use crate::domain::{models::InitiativeError, ports::InitiativeService};--/// Unassign one task the caller can edit.-#[utoipa::path(- delete,- tag = "initiative",- operation_id = "unassign_initiative_task",- path = "/initiatives/{initiative_id}/tasks/{task_id}",- params(UnassignTaskParams),- responses(- (status = 200, body = GenericSuccessResponse),- (status = 400, body = ErrorResponse),- (status = 401, description = "Missing or invalid credentials", body = ErrorResponse),- (status = 404, body = ErrorResponse),- (status = 500, body = ErrorResponse),- )-)]-#[tracing::instrument(err, skip_all)]-pub async fn unassign_initiative_task_handler<S, Eas, Auth>(- State(state): State<InitiativeRouterState<S, Eas, Auth>>,- access: InitiativeAccessExtractor<EditAccessLevel, Eas, Auth>,- user: MacroAuthorizationExtractor<Auth, UserOrInternal>,- Path(UnassignTaskParams { task_id, .. }): Path<UnassignTaskParams>,-) -> Result<Json<GenericSuccessResponse>, InitiativeError>-where- S: InitiativeService,- Eas: EntityAccessService,- Auth: MacroAuthorizationService,-{- let task_receipt = state- .entity_access_service- .generate_entity_access_receipt::<EditAccessLevel>(- &user.authorization.user.macro_user_id,- user.authorization- .user- .user_context- .organization_id- .map(i64::from),- &task_id,- EntityType::Document,- )- .await?;- state- .service- .unassign_task(access.entity_access_receipt, task_receipt)- .await?;- Ok(Json(GenericSuccessResponse { success: true }))-}diff --git a/crates/initiative/src/inbound/toolset.rs b/crates/initiative/src/inbound/toolset.rsindex e898277c1d..b0883e8b41 100644--- a/crates/initiative/src/inbound/toolset.rs+++ b/crates/initiative/src/inbound/toolset.rs@@ -1,29 +1,17 @@//! Workflow tools for projects (the initiative domain), separate from folder tools.-mod assign_tasks_to_initiative;mod lifecycle;mod reads;mod sharing;-mod tasks;mod types;-mod unassign_tasks_from_initiative;#[cfg(test)]mod test;-pub use assign_tasks_to_initiative::{- AssignTasksToInitiative, AssignTasksToInitiativeResponse, TaskAssignmentOutcome,- TaskAssignmentStatus,-};pub use lifecycle::{CreateInitiative, DeleteInitiative, UpdateInitiative};-pub use reads::{ListInitiatives, ReadInitiative, ReadInitiativeActivity, ReadTaskInitiatives};+pub use reads::{ListInitiatives, ReadInitiative, ReadInitiativeActivity};pub use sharing::UpdateInitiativeSharing;-pub use tasks::SetTaskInitiative;pub use types::*;-pub use unassign_tasks_from_initiative::{- TaskUnassignmentOutcome, TaskUnassignmentStatus, UnassignTasksFromInitiative,- UnassignTasksFromInitiativeResponse,-};use std::sync::Arc;@@ -109,25 +97,14 @@ fn failure(error: InitiativeError) -> ToolCallError {InitiativeError::NameTooLong { max } => {format!("Project names must be at most {max} graphemes long")}- InitiativeError::NotATask => "The document is not a task".into(),_ => "The project operation failed".into(),},internal_error: error.into(),}}-fn required_task_batch(task_ids: Vec<String>) -> ToolResult<Vec<String>> {- if task_ids.is_empty() {- return Err(failure(InitiativeError::BadRequest(- "provide at least one task id".into(),- )));- }- crate::domain::models::TaskAssignmentBatch::try_new(task_ids)- .map(|batch| batch.into_task_ids())- .map_err(failure)-}--/// Complete project lifecycle, sharing, membership and history toolset.+/// Complete project lifecycle, sharing and history toolset. Tasks join a project through+/// their Project property.pub fn initiative_toolset<S: InitiativeService, A: EntityAccessService, R: EntityActivityReads>()-> AsyncToolCollection<InitiativeToolContext<S, A, R>> {AsyncToolCollection::new()@@ -137,9 +114,5 @@ pub fn initiative_toolset<S: InitiativeService, A: EntityAccessService, R: Entit.add_tool::<UpdateInitiative, InitiativeToolContext<S, A, R>>().add_tool::<DeleteInitiative, InitiativeToolContext<S, A, R>>().add_tool::<UpdateInitiativeSharing, InitiativeToolContext<S, A, R>>()- .add_tool::<SetTaskInitiative, InitiativeToolContext<S, A, R>>()- .add_tool::<AssignTasksToInitiative, InitiativeToolContext<S, A, R>>()- .add_tool::<UnassignTasksFromInitiative, InitiativeToolContext<S, A, R>>()- .add_tool::<ReadTaskInitiatives, InitiativeToolContext<S, A, R>>().add_tool::<ReadInitiativeActivity, InitiativeToolContext<S, A, R>>()}diff --git a/crates/initiative/src/inbound/toolset/assign_tasks_to_initiative.rs b/crates/initiative/src/inbound/toolset/assign_tasks_to_initiative.rsdeleted file mode 100644index 706eeee5bf..0000000000--- a/crates/initiative/src/inbound/toolset/assign_tasks_to_initiative.rs+++ /dev/null@@ -1,144 +0,0 @@-//! AssignTasksToInitiative tool for moving tasks into an initiative.--use activity::domain::ports::EntityActivityReads;-use ai_toolset::{- AsyncTool, RequestContext, ServiceContext, ToolAnnotated, ToolAnnotations, ToolResult,-};-use async_trait::async_trait;-use entity_access::domain::models::{BotAccessScope, EditAccessLevel, EntityType};-use entity_access::domain::ports::EntityAccessService;-use schemars::JsonSchema;-use serde::{Deserialize, Serialize};--use super::{InitiativeToolContext, failure, required_task_batch};-use crate::domain::models::{AssignTaskStatus, TaskAssignment};-use crate::domain::ports::InitiativeService;--/// Response from [`AssignTasksToInitiative`].-#[derive(Debug, Serialize, JsonSchema)]-#[serde(rename_all = "camelCase")]-pub struct AssignTasksToInitiativeResponse {- /// The id of the initiative receiving the tasks.- pub initiative_id: uuid::Uuid,- /// Outcomes in request order after removing duplicates.- pub results: Vec<TaskAssignmentOutcome>,-}--/// The result of assigning one task to an initiative.-#[derive(Debug, Serialize, JsonSchema)]-#[serde(rename_all = "camelCase")]-pub struct TaskAssignmentOutcome {- /// The task id this outcome describes.- pub task_id: String,- /// What happened to the task.- pub status: TaskAssignmentStatus,-}--/// Tool-facing status of a task assignment.-#[derive(Debug, Serialize, JsonSchema, Clone, Copy, PartialEq, Eq)]-#[serde(rename_all = "snake_case")]-pub enum TaskAssignmentStatus {- /// Assigned to this initiative.- Assigned,- /// Moved from another initiative.- Moved,- /// The document exists but is not a task.- NotATask,- /// The task does not exist.- NotFound,- /// The caller cannot edit the task.- SkippedNoPermission,-}--impl From<AssignTaskStatus> for TaskAssignmentStatus {- fn from(status: AssignTaskStatus) -> Self {- match status {- AssignTaskStatus::Assigned => Self::Assigned,- AssignTaskStatus::Moved => Self::Moved,- AssignTaskStatus::NotATask => Self::NotATask,- AssignTaskStatus::NotFound => Self::NotFound,- AssignTaskStatus::SkippedNoPermission => Self::SkippedNoPermission,- }- }-}--/// AssignTasksToInitiative tool input.-#[derive(Debug, Deserialize, JsonSchema, Clone, Default)]-#[serde(rename_all = "camelCase")]-#[schemars(- title = "AssignTasksToInitiative",- description = "Move tasks into an initiative. A task already in another initiative is moved; duplicates are ignored; at most 100 unique task ids per call. Requires edit access to the initiative and to each task. Returns one status per task id: assigned, moved, not_a_task, not_found, or skipped_no_permission."-)]-pub struct AssignTasksToInitiative {- /// The id of the initiative receiving the tasks.- #[schemars(description = "The id of the initiative to assign tasks to. Requires edit access.")]- pub initiative_id: uuid::Uuid,- /// Task document ids to assign, in request order.- #[schemars(- description = "Task document ids to assign, at least one and at most 100 unique ids per call. Duplicates are ignored. Requires edit access to each task."- )]- pub task_ids: Vec<String>,-}--impl ToolAnnotated for AssignTasksToInitiative {- const ANNOTATIONS: ToolAnnotations =- ToolAnnotations::destructive("Assign tasks to initiative").with_idempotent();-}--#[async_trait]-impl<ISvc, ESvc, R> AsyncTool<InitiativeToolContext<ISvc, ESvc, R>> for AssignTasksToInitiative-where- ISvc: InitiativeService,- ESvc: EntityAccessService,- R: EntityActivityReads,-{- type Output = AssignTasksToInitiativeResponse;-- async fn call(- &self,- service_context: ServiceContext<InitiativeToolContext<ISvc, ESvc, R>>,- request_context: RequestContext,- ) -> ToolResult<Self::Output> {- let task_ids = required_task_batch(self.task_ids.clone())?;-- let receipt = service_context- .receipt::<EditAccessLevel>(- &request_context,- &self.initiative_id.to_string(),- EntityType::Initiative,- )- .await?;-- let mut assignments = Vec::with_capacity(task_ids.len());- for task_id in task_ids {- let result = service_context- .access- .generate_bot_entity_access_receipt::<EditAccessLevel>(- service_context.actor,- BotAccessScope::user(request_context.user_id.clone()),- &task_id,- EntityType::Document,- )- .await;- assignments.push(TaskAssignment::from_access(task_id, result).map_err(failure)?);- }-- let response = service_context- .service- .assign_tasks(receipt, assignments)- .await- .map_err(failure)?;-- Ok(AssignTasksToInitiativeResponse {- initiative_id: self.initiative_id,- results: response- .results- .into_iter()- .map(|result| TaskAssignmentOutcome {- task_id: result.task_id,- status: result.status.into(),- })- .collect(),- })- }-}diff --git a/crates/initiative/src/inbound/toolset/reads.rs b/crates/initiative/src/inbound/toolset/reads.rsindex efd1eb8026..2c5790eb09 100644--- a/crates/initiative/src/inbound/toolset/reads.rs+++ b/crates/initiative/src/inbound/toolset/reads.rs@@ -3,10 +3,7 @@use super::*;use crate::domain::{history::{InitiativeActivityCursor, InitiativeActivityRecord},- reads::{- InitiativePageRequest, InitiativeTasksRequest, TaskInitiativeReference,- TaskInitiativeReferencesRequest,- },+ reads::{InitiativePageRequest, InitiativeTasksRequest},};use ai_toolset::{AsyncTool, ServiceContext, ToolAnnotated, ToolAnnotations};use async_trait::async_trait;@@ -217,104 +214,6 @@ impl<S: InitiativeService, A: EntityAccessService, R: EntityActivityReads>}}-/// Resolve projects for a batch of tasks without exposing inaccessible projects.-#[derive(Debug, Clone, Deserialize, JsonSchema)]-#[serde(rename_all = "camelCase")]-#[schemars(- title = "ReadTaskInitiatives",- description = "Find the project associated with each requested task. Returns project id/name only when both task and project are visible. Distinguishes no project from unavailable. Accepts up to 100 unique task ids."-)]-pub struct ReadTaskInitiatives {- /// Task ids to look up, deduplicated in input order.- #[schemars(description = "Task ids to look up, deduplicated in input order.")]- pub task_ids: Vec<String>,-}--/// Privacy-preserving task project reference.-#[derive(Debug, Serialize, JsonSchema)]-#[serde(- tag = "state",- rename_all = "camelCase",- rename_all_fields = "camelCase"-)]-pub enum TaskProjectReference {- /// Visible task with no project association.- None {- /// Requested task id.- task_id: String,- },- /// Task or project is inaccessible.- Unavailable {- /// Requested task id.- task_id: String,- },- /// Task and project are visible.- Visible {- /// Requested task id.- task_id: String,- /// Associated project id.- initiative_id: Uuid,- /// Associated project name.- name: String,- },-}--/// Visibility-aware project references for the requested tasks.-#[derive(Debug, Serialize, JsonSchema)]-pub struct TaskProjectReferences {- /// References in deduplicated request order.- pub references: Vec<TaskProjectReference>,-}--impl ToolAnnotated for ReadTaskInitiatives {- const ANNOTATIONS: ToolAnnotations = ToolAnnotations::read_only("Read task projects");-}--#[async_trait]-impl<S: InitiativeService, A: EntityAccessService, R: EntityActivityReads>- AsyncTool<InitiativeToolContext<S, A, R>> for ReadTaskInitiatives-{- type Output = TaskProjectReferences;- async fn call(- &self,- context: ServiceContext<InitiativeToolContext<S, A, R>>,- request: RequestContext,- ) -> ToolResult<Self::Output> {- let result = context- .service- .task_references(- &request.user_id,- TaskInitiativeReferencesRequest {- task_ids: self.task_ids.clone(),- },- )- .await- .map_err(failure)?;- Ok(TaskProjectReferences {- references: result- .references- .into_iter()- .map(|reference| match reference {- TaskInitiativeReference::None { task_id } => {- TaskProjectReference::None { task_id }- }- TaskInitiativeReference::Unavailable { task_id } => {- TaskProjectReference::Unavailable { task_id }- }- TaskInitiativeReference::Visible {- task_id,- initiative,- } => TaskProjectReference::Visible {- task_id,- initiative_id: initiative.id.as_uuid(),- name: initiative.name,- },- })- .collect(),- })- }-}-/// Read project history with current task permissions applied.#[derive(Debug, Clone, Deserialize, JsonSchema)]#[serde(rename_all = "camelCase")]diff --git a/crates/initiative/src/inbound/toolset/tasks.rs b/crates/initiative/src/inbound/toolset/tasks.rsdeleted file mode 100644index d7397b85c6..0000000000--- a/crates/initiative/src/inbound/toolset/tasks.rs+++ /dev/null@@ -1,128 +0,0 @@-//! Task assignment with shared actor capabilities and bounded partial outcomes.--use super::*;-use crate::domain::{- models::{AssignTaskStatus, TaskAssignment, TaskAssignmentBatch},- service::{ClearTaskStatus, clear_task_batch},-};-use ai_toolset::{AsyncTool, ServiceContext, ToolAnnotated, ToolAnnotations};-use async_trait::async_trait;-use entity_access::domain::models::{BotAccessScope, EditAccessLevel};-use schemars::JsonSchema;-use serde::{Deserialize, Serialize};-use uuid::Uuid;--/// Set or clear the project associated with a bounded set of tasks.-#[derive(Debug, Clone, Deserialize, JsonSchema)]-#[serde(rename_all = "camelCase")]-#[schemars(- title = "SetTaskInitiative",- description = "Set the project associated with tasks, moving them from their previous project if needed. Requires edit access to each task and the destination project; access to the previous project is unnecessary. Omit initiativeId to clear the association using task edit access alone. Reports each task's outcome independently; at most 100 unique tasks."-)]-pub struct SetTaskInitiative {- /// Task ids to assign or clear, deduplicated in request order.- #[schemars(description = "Task ids to assign or clear, deduplicated in request order.")]- pub task_ids: Vec<String>,- /// Destination project; omit to clear each task's current project.- #[schemars(description = "Destination project; omit to clear each task's current project.")]- pub initiative_id: Option<Uuid>,-}--/// One task mutation outcome.-#[derive(Debug, Serialize, JsonSchema)]-#[serde(rename_all = "camelCase")]-pub struct TaskProjectOutcome {- /// Requested task identifier.- pub task_id: String,- /// assigned, moved, cleared, notATask, notFound, skippedNoPermission, or failed.- pub status: String,-}--/// Results in deduplicated input order.-#[derive(Debug, Serialize, JsonSchema)]-pub struct TaskProjectOutcomes {- /// Outcome for every submitted task.- pub results: Vec<TaskProjectOutcome>,-}--impl ToolAnnotated for SetTaskInitiative {- const ANNOTATIONS: ToolAnnotations =- ToolAnnotations::destructive("Set task project").with_idempotent();-}--#[async_trait]-impl<S: InitiativeService, A: EntityAccessService, R: EntityActivityReads>- AsyncTool<InitiativeToolContext<S, A, R>> for SetTaskInitiative-{- type Output = TaskProjectOutcomes;- async fn call(- &self,- context: ServiceContext<InitiativeToolContext<S, A, R>>,- request: RequestContext,- ) -> ToolResult<Self::Output> {- let ids = TaskAssignmentBatch::try_new(self.task_ids.clone())- .map_err(failure)?- .into_task_ids();- let destination = if let Some(id) = self.initiative_id {- Some(- context- .receipt::<EditAccessLevel>(&request, &id.to_string(), EntityType::Initiative)- .await?,- )- } else {- None- };- let mut assignments = Vec::with_capacity(ids.len());- for id in ids {- let access = context- .access- .generate_bot_entity_access_receipt::<EditAccessLevel>(- context.actor,- BotAccessScope::user(request.user_id.clone()),- &id,- EntityType::Document,- )- .await;- assignments.push(TaskAssignment::from_access(id, access).map_err(failure)?);- }- let results = if let Some(destination) = destination {- context- .service- .assign_tasks(destination, assignments)- .await- .map_err(failure)?- .results- .into_iter()- .map(|outcome| TaskProjectOutcome {- task_id: outcome.task_id,- status: match outcome.status {- AssignTaskStatus::Assigned => "assigned",- AssignTaskStatus::Moved => "moved",- AssignTaskStatus::NotATask => "notATask",- AssignTaskStatus::NotFound => "notFound",- AssignTaskStatus::SkippedNoPermission => "skippedNoPermission",- }- .into(),- })- .collect()- } else {- clear_task_batch(context.service.as_ref(), assignments)- .await- .map_err(failure)?- .into_iter()- .map(|outcome| TaskProjectOutcome {- task_id: outcome.task_id,- status: match outcome.status {- ClearTaskStatus::Cleared => "cleared",- ClearTaskStatus::NotATask => "notATask",- ClearTaskStatus::NotFound => "notFound",- ClearTaskStatus::SkippedNoPermission => "skippedNoPermission",- ClearTaskStatus::Failed => "failed",- }- .into(),- })- .collect()- };- Ok(TaskProjectOutcomes { results })- }-}diff --git a/crates/initiative/src/inbound/toolset/test.rs b/crates/initiative/src/inbound/toolset/test.rsindex 988e397666..da99c768d6 100644--- a/crates/initiative/src/inbound/toolset/test.rs+++ b/crates/initiative/src/inbound/toolset/test.rs@@ -1,67 +1,5 @@use super::*;-#[test]-fn batch_tools_have_valid_strict_schemas() {- use ai_toolset::schema::generate_validated_input_schema;- assert_eq!(- generate_validated_input_schema::<AssignTasksToInitiative>()- .unwrap()- .name,- "AssignTasksToInitiative"- );- assert_eq!(- generate_validated_input_schema::<UnassignTasksFromInitiative>()- .unwrap()- .name,- "UnassignTasksFromInitiative"- );-}--#[test]-fn required_batch_rejects_empty_and_oversized_requests_and_deduplicates_in_order() {- assert_eq!(- required_task_batch(vec![]).unwrap_err().description,- "provide at least one task id"- );- assert!(required_task_batch((0..101).map(|id| id.to_string()).collect()).is_err());- assert_eq!(- required_task_batch(vec!["b".into(), "a".into(), "b".into()]).unwrap(),- vec!["b", "a"]- );- assert_eq!(- required_task_batch(vec!["a".into(); 101]).unwrap(),- vec!["a"]- );-}--#[test]-fn task_outcome_statuses_preserve_the_wire_contract() {- use crate::domain::models::AssignTaskStatus;- for (domain, expected) in [- (AssignTaskStatus::Assigned, "assigned"),- (AssignTaskStatus::Moved, "moved"),- (AssignTaskStatus::NotATask, "not_a_task"),- (AssignTaskStatus::NotFound, "not_found"),- (- AssignTaskStatus::SkippedNoPermission,- "skipped_no_permission",- ),- ] {- assert_eq!(- serde_json::to_value(TaskAssignmentStatus::from(domain)).unwrap(),- expected- );- }- assert_eq!(- serde_json::to_value(TaskUnassignmentStatus::Unassigned).unwrap(),- "unassigned"- );- assert_eq!(- serde_json::to_value(TaskUnassignmentStatus::NotAssigned).unwrap(),- "not_assigned"- );-}-#[test]fn invalid_name_length_is_actionable_without_exposing_internal_errors() {let error = failure(InitiativeError::NameTooLong { max: 100 });diff --git a/crates/initiative/src/inbound/toolset/unassign_tasks_from_initiative.rs b/crates/initiative/src/inbound/toolset/unassign_tasks_from_initiative.rsdeleted file mode 100644index a5ae9f97d8..0000000000--- a/crates/initiative/src/inbound/toolset/unassign_tasks_from_initiative.rs+++ /dev/null@@ -1,118 +0,0 @@-//! UnassignTasksFromInitiative tool for moving tasks out of an initiative.--use activity::domain::ports::EntityActivityReads;-use ai_toolset::{- AsyncTool, RequestContext, ServiceContext, ToolAnnotated, ToolAnnotations, ToolResult,-};-use async_trait::async_trait;-use entity_access::domain::models::{EditAccessLevel, EntityType};-use entity_access::domain::ports::EntityAccessService;-use schemars::JsonSchema;-use serde::{Deserialize, Serialize};--use super::{InitiativeToolContext, failure, required_task_batch};-use crate::domain::models::InitiativeError;-use crate::domain::ports::InitiativeService;--/// Response from [`UnassignTasksFromInitiative`].-#[derive(Debug, Serialize, JsonSchema)]-#[serde(rename_all = "camelCase")]-pub struct UnassignTasksFromInitiativeResponse {- /// The id of the initiative the tasks were removed from.- pub initiative_id: uuid::Uuid,- /// Outcomes in request order after removing duplicates.- pub results: Vec<TaskUnassignmentOutcome>,-}--/// The result of removing one task from an initiative.-#[derive(Debug, Serialize, JsonSchema)]-#[serde(rename_all = "camelCase")]-pub struct TaskUnassignmentOutcome {- /// The task id this outcome describes.- pub task_id: String,- /// What happened to the task.- pub status: TaskUnassignmentStatus,-}--/// Tool-facing status of a task unassignment.-#[derive(Debug, Serialize, JsonSchema, Clone, Copy, PartialEq, Eq)]-#[serde(rename_all = "snake_case")]-pub enum TaskUnassignmentStatus {- /// Removed from this initiative.- Unassigned,- /// The task was not assigned to this initiative.- NotAssigned,-}--/// UnassignTasksFromInitiative tool input.-#[derive(Debug, Deserialize, JsonSchema, Clone, Default)]-#[serde(rename_all = "camelCase")]-#[schemars(- title = "UnassignTasksFromInitiative",- description = "Move tasks out of a specific initiative (project). Requires edit access to the initiative and each task; at most 100 unique tasks. Returns one status per task id: unassigned, or not_assigned when the task was not in this initiative. Tasks in other initiatives are left unchanged. An access or service failure stops the batch; earlier removals may have succeeded."-)]-pub struct UnassignTasksFromInitiative {- /// The id of the initiative to remove tasks from.- #[schemars(- description = "The id of the initiative to remove tasks from. Requires edit access."- )]- pub initiative_id: uuid::Uuid,- /// Task document ids to remove, in request order.- #[schemars(- description = "Task document ids to remove. Provide at least one and at most 100 unique ids; duplicates are ignored. Requires edit access to each task."- )]- pub task_ids: Vec<String>,-}--impl ToolAnnotated for UnassignTasksFromInitiative {- const ANNOTATIONS: ToolAnnotations =- ToolAnnotations::destructive("Unassign tasks from initiative").with_idempotent();-}--#[async_trait]-impl<ISvc, ESvc, R> AsyncTool<InitiativeToolContext<ISvc, ESvc, R>> for UnassignTasksFromInitiative-where- ISvc: InitiativeService,- ESvc: EntityAccessService,- R: EntityActivityReads,-{- type Output = UnassignTasksFromInitiativeResponse;-- async fn call(- &self,- service_context: ServiceContext<InitiativeToolContext<ISvc, ESvc, R>>,- request_context: RequestContext,- ) -> ToolResult<Self::Output> {- let task_ids = required_task_batch(self.task_ids.clone())?;-- let receipt = service_context- .receipt::<EditAccessLevel>(- &request_context,- &self.initiative_id.to_string(),- EntityType::Initiative,- )- .await?;-- let mut results = Vec::with_capacity(task_ids.len());- for task_id in task_ids {- let task_receipt = service_context- .receipt::<EditAccessLevel>(&request_context, &task_id, EntityType::Document)- .await?;- let status = match service_context- .service- .unassign_task(receipt.clone(), task_receipt)- .await- {- Ok(()) => TaskUnassignmentStatus::Unassigned,- Err(InitiativeError::NotFound) => TaskUnassignmentStatus::NotAssigned,- Err(error) => return Err(failure(error)),- };- results.push(TaskUnassignmentOutcome { task_id, status });- }-- Ok(UnassignTasksFromInitiativeResponse {- initiative_id: self.initiative_id,- results,- })- }-}diff --git a/crates/initiative/src/outbound/pg_initiative_repo.rs b/crates/initiative/src/outbound/pg_initiative_repo.rsindex 3c108b3869..9abcd2583c 100644--- a/crates/initiative/src/outbound/pg_initiative_repo.rs+++ b/crates/initiative/src/outbound/pg_initiative_repo.rs@@ -4,7 +4,6 @@ mod create;mod list;mod members;mod share;-mod tasks;#[cfg(test)]mod test;@@ -23,7 +22,6 @@ use share_permission_db_utils::team_share::TeamShareError;use sqlx::postgres::PgDatabaseError;use sqlx::{Executor, PgPool, Postgres};-use crate::domain::events::{AssignedTasks, TaskMembershipChange};use crate::domain::models::{CreateInitiativeRepoArgs, InitiativeBasic, InitiativeDetail, InitiativeError, InitiativeId,InitiativeList, UpdateInitiativeRepoArgs,@@ -86,23 +84,6 @@ impl InitiativeRepo for PgInitiativeRepo {list::list_accessible(&self.pool, user_id).await}- async fn task_memberships(- &self,- task_ids: Vec<String>,- ) -> Result<std::collections::HashMap<String, InitiativeId>, Self::Err> {- let rows = sqlx::query!(- "SELECT task_id, initiative_id FROM task_initiative WHERE task_id = ANY($1)",- &task_ids- )- .fetch_all(&self.pool)- .await- .map_err(classify_sqlx)?;- Ok(rows- .into_iter()- .map(|row| (row.task_id, InitiativeId::from_uuid(row.initiative_id)))- .collect())- }-#[tracing::instrument(err, skip(self, args))]async fn update(&self, args: UpdateInitiativeRepoArgs) -> Result<InitiativeDetail, Self::Err> {create::update(&self.pool, args).await@@ -121,29 +102,6 @@ impl InitiativeRepo for PgInitiativeRepo {share::get_team_default_link_share(&self.pool, user_id).await}- #[tracing::instrument(err, skip(self, task_ids))]- async fn assign_tasks(- &self,- id: InitiativeId,- task_ids: Vec<String>,- ) -> Result<AssignedTasks, Self::Err> {- tasks::assign_tasks(&self.pool, id, task_ids).await- }-- #[tracing::instrument(err, skip(self))]- async fn unassign_task(- &self,- id: InitiativeId,- task_id: &str,- ) -> Result<Option<TaskMembershipChange>, Self::Err> {- tasks::unassign_task(&self.pool, id, task_id).await- }-- #[tracing::instrument(err, skip(self))]- async fn clear_task(&self, task_id: &str) -> Result<Option<TaskMembershipChange>, Self::Err> {- tasks::clear_task(&self.pool, task_id).await- }-#[tracing::instrument(err, skip_all)]async fn grant_assignees(&self,@@ -193,7 +151,6 @@ struct InitiativeRecord {updated_at: chrono::DateTime<chrono::Utc>,share_permission_id: String,member_ids: Vec<String>,- task_ids: Vec<String>,link_share: Option<String>,link_share_access_level: Option<AccessLevel>,team_share_access_level: Option<AccessLevel>,@@ -217,7 +174,7 @@ impl InitiativeRecord {name: self.name,owner_id,member_ids: parse_members(self.member_ids)?,- task_ids: self.task_ids,+ task_ids: Vec::new(),share_permission,user_access_level: DETAIL_ACCESS_WITHOUT_ACTOR,created_at: self.created_at,@@ -343,10 +300,6 @@ async fn load_record(array_agg(DISTINCT m.user_id) FILTER (WHERE m.user_id IS NOT NULL),'{}'::text[]) AS "member_ids!",- COALESCE(- array_agg(DISTINCT t.task_id) FILTER (WHERE t.task_id IS NOT NULL),- '{}'::text[]- ) AS "task_ids!",sp."linkShare" AS "link_share?",sp."linkShareAccessLevel" AS "link_share_access_level?: AccessLevel",sp.team_share_access_level AS "team_share_access_level?: AccessLevel",@@ -364,7 +317,6 @@ async fn load_record(FROM initiative iJOIN "SharePermission" sp ON sp.id = i.share_permission_idLEFT JOIN initiative_member m ON m.initiative_id = i.id- LEFT JOIN task_initiative t ON t.initiative_id = i.idWHERE i.id = $1GROUP BYi.id,@@ -390,7 +342,6 @@ async fn load_record(updated_at: row.updated_at,share_permission_id: row.share_permission_id,member_ids: row.member_ids,- task_ids: row.task_ids,link_share: row.link_share,link_share_access_level: row.link_share_access_level,team_share_access_level: row.team_share_access_level,diff --git a/crates/initiative/src/outbound/pg_initiative_repo/tasks.rs b/crates/initiative/src/outbound/pg_initiative_repo/tasks.rsdeleted file mode 100644index 21a3bedb1f..0000000000--- a/crates/initiative/src/outbound/pg_initiative_repo/tasks.rs+++ /dev/null@@ -1,252 +0,0 @@-use std::collections::{HashMap, HashSet};--use sqlx::{PgPool, Postgres, Transaction};-use uuid::Uuid;--use super::{AdapterError, map_sqlx};-use crate::domain::events::{AssignedTasks, TaskMembershipChange};-use crate::domain::models::{AssignTaskStatus, AssignTasksResult, InitiativeError, InitiativeId};--pub(super) async fn assign_tasks(- pool: &PgPool,- id: InitiativeId,- task_ids: Vec<String>,-) -> Result<AssignedTasks, InitiativeError> {- if task_ids.is_empty() {- return Ok(AssignedTasks::default());- }-- let mut tx = pool- .begin()- .await- .map_err(AdapterError::Sqlx)- .map_err(map_sqlx)?;- let initiative_id = id.as_uuid();- lock_initiative(&mut tx, initiative_id).await?;-- sqlx::query!(- r#"- SELECT id- FROM "Document"- WHERE id = ANY($1)- ORDER BY id- FOR UPDATE- "#,- &task_ids,- )- .fetch_all(tx.as_mut())- .await- .map_err(AdapterError::Sqlx)- .map_err(map_sqlx)?;-- let prior_rows = sqlx::query!(- r#"- SELECT task_id, initiative_id- FROM task_initiative- WHERE task_id = ANY($1)- FOR UPDATE- "#,- &task_ids,- )- .fetch_all(tx.as_mut())- .await- .map_err(AdapterError::Sqlx)- .map_err(map_sqlx)?;-- let prior: HashMap<String, Uuid> = prior_rows- .into_iter()- .map(|row| (row.task_id, row.initiative_id))- .collect();-- let returned_rows = sqlx::query!(- r#"- INSERT INTO task_initiative (task_id, initiative_id)- SELECT dst.document_id, $1- FROM UNNEST($2::text[]) AS t(task_id)- JOIN document_sub_type dst- ON dst.document_id = t.task_id AND dst.sub_type = 'task'- ON CONFLICT (task_id) DO UPDATE- SET initiative_id = EXCLUDED.initiative_id, created_at = now()- RETURNING task_id- "#,- initiative_id,- &task_ids,- )- .fetch_all(tx.as_mut())- .await- .map_err(AdapterError::Sqlx)- .map_err(map_sqlx)?;-- let returned: HashSet<String> = returned_rows.into_iter().map(|row| row.task_id).collect();-- sqlx::query!(- r#"- UPDATE initiative- SET updated_at = now()- WHERE id = $1- "#,- initiative_id,- )- .execute(tx.as_mut())- .await- .map_err(AdapterError::Sqlx)- .map_err(map_sqlx)?;-- tx.commit()- .await- .map_err(AdapterError::Sqlx)- .map_err(map_sqlx)?;-- let changes = task_ids- .iter()- .filter(|task_id| {- returned.contains(*task_id) && prior.get(*task_id) != Some(&initiative_id)- })- .map(|task_id| TaskMembershipChange {- task_id: task_id.clone(),- from: prior.get(task_id).copied().map(InitiativeId::from_uuid),- to: Some(id),- })- .collect();- let results = task_ids- .into_iter()- .map(|task_id| AssignTasksResult {- status: assign_status_for(&task_id, &prior, &returned, initiative_id),- task_id,- })- .collect();- Ok(AssignedTasks { results, changes })-}--pub(super) async fn unassign_task(- pool: &PgPool,- id: InitiativeId,- task_id: &str,-) -> Result<Option<TaskMembershipChange>, InitiativeError> {- let mut tx = pool- .begin()- .await- .map_err(AdapterError::Sqlx)- .map_err(map_sqlx)?;- let initiative_id = id.as_uuid();- lock_initiative(&mut tx, initiative_id).await?;- let result = sqlx::query!(- r#"- DELETE FROM task_initiative- WHERE task_id = $1 AND initiative_id = $2- "#,- task_id,- initiative_id,- )- .execute(tx.as_mut())- .await- .map_err(AdapterError::Sqlx)- .map_err(map_sqlx)?;-- if result.rows_affected() == 0 {- return Err(InitiativeError::NotFound);- }-- sqlx::query!(- r#"- UPDATE initiative- SET updated_at = now()- WHERE id = $1- "#,- initiative_id,- )- .execute(tx.as_mut())- .await- .map_err(AdapterError::Sqlx)- .map_err(map_sqlx)?;-- tx.commit()- .await- .map_err(AdapterError::Sqlx)- .map_err(map_sqlx)?;- Ok(Some(TaskMembershipChange {- task_id: task_id.to_string(),- from: Some(id),- to: None,- }))-}--pub(super) async fn clear_task(- pool: &PgPool,- task_id: &str,-) -> Result<Option<TaskMembershipChange>, InitiativeError> {- let outcome = sqlx::query!(- r#"- WITH task AS (- SELECT d.id, COALESCE(dst.sub_type = 'task', false) AS is_task- FROM "Document" d- LEFT JOIN document_sub_type dst ON dst.document_id = d.id- WHERE d.id = $1 AND d."deletedAt" IS NULL- ), removed AS (- DELETE FROM task_initiative ti- USING task- WHERE ti.task_id = task.id AND task.is_task- RETURNING initiative_id- ), updated AS (- UPDATE initiative- SET updated_at = now()- WHERE id IN (SELECT initiative_id FROM removed)- RETURNING id- )- SELECT task.is_task AS "is_task!", (SELECT id FROM updated) AS initiative_id- FROM task- "#,- task_id,- )- .fetch_optional(pool)- .await- .map_err(AdapterError::Sqlx)- .map_err(map_sqlx)?- .ok_or(InitiativeError::NotFound)?;- if !outcome.is_task {- return Err(InitiativeError::NotATask);- }- Ok(outcome.initiative_id.map(|id| TaskMembershipChange {- task_id: task_id.to_string(),- from: Some(InitiativeId::from_uuid(id)),- to: None,- }))-}--async fn lock_initiative(- tx: &mut Transaction<'_, Postgres>,- initiative_id: Uuid,-) -> Result<(), InitiativeError> {- let locked = sqlx::query_scalar!(- r#"- SELECT id- FROM initiative- WHERE id = $1- FOR UPDATE- "#,- initiative_id,- )- .fetch_optional(tx.as_mut())- .await- .map_err(AdapterError::Sqlx)- .map_err(map_sqlx)?;- if locked.is_none() {- return Err(InitiativeError::NotFound);- }- Ok(())-}--fn assign_status_for(- task_id: &str,- prior: &HashMap<String, Uuid>,- returned: &HashSet<String>,- this_initiative: Uuid,-) -> AssignTaskStatus {- if !returned.contains(task_id) {- return AssignTaskStatus::NotATask;- }- match prior.get(task_id) {- Some(owner) if *owner != this_initiative => AssignTaskStatus::Moved,- _ => AssignTaskStatus::Assigned,- }-}diff --git a/crates/initiative/src/outbound/pg_initiative_repo/test.rs b/crates/initiative/src/outbound/pg_initiative_repo/test.rsindex 2425ccba01..2caac99115 100644--- a/crates/initiative/src/outbound/pg_initiative_repo/test.rs+++ b/crates/initiative/src/outbound/pg_initiative_repo/test.rs@@ -24,8 +24,7 @@ use uuid::Uuid;use super::PgInitiativeRepo;use crate::domain::models::{- AssignTaskStatus, CreateInitiativeRepoArgs, InitiativeError, InitiativeId,- UpdateInitiativeRepoArgs,+ CreateInitiativeRepoArgs, InitiativeError, InitiativeId, UpdateInitiativeRepoArgs,};use crate::domain::ports::InitiativeRepo;@@ -214,6 +213,48 @@ async fn insert_document(pool: &PgPool, id: &str, owner: &str, task: bool) -> anOk(())}+/// Put a task in a project the way the properties domain does: through its Project+/// system property (`SystemPropertyKey::PROJECT_UUID`).+async fn set_project(pool: &PgPool, task_id: &str, project: InitiativeId) -> anyhow::Result<()> {+ set_task_reference(pool, task_id, PROJECT_PROPERTY, &project.to_string()).await+}++const PROJECT_PROPERTY: Uuid = Uuid::from_u128(0x00000001_0000_0000_0000_000000000014);++async fn set_task_reference(+ pool: &PgPool,+ task_id: &str,+ property_definition_id: Uuid,+ initiative_id: &str,+) -> anyhow::Result<()> {+ sqlx::query!(+ r#"+ INSERT INTO entity_properties (id, entity_id, entity_type, property_definition_id, values)+ VALUES (+ gen_random_uuid(),+ $1,+ 'TASK',+ $2,+ jsonb_build_object(+ 'type', 'EntityReference',+ 'value', jsonb_build_array(jsonb_build_object(+ 'entity_id', $3::text,+ 'entity_type', 'INITIATIVE'+ ))+ )+ )+ ON CONFLICT (entity_id, entity_type, property_definition_id)+ DO UPDATE SET values = EXCLUDED.values+ "#,+ task_id,+ property_definition_id,+ initiative_id,+ )+ .execute(pool)+ .await?;+ Ok(())+}+async fn access_level(pool: &PgPool,entity_id: Uuid,@@ -371,9 +412,6 @@ async fn get_detail_reports_each_channel_grant_once(pool: PgPool) -> anyhow::Res..update_args(created.id)}).await?;- repo.assign_tasks(created.id, vec![task_a.clone(), task_b.clone()])- .await?;-let detail = repo.get_detail(created.id).await?.expect("busy");assert_eq!(detail.share_permission.channel_share_permissions,@@ -711,128 +749,12 @@ async fn team_share_facts_report_a_missing_initiative(pool: PgPool) -> anyhow::ROk(())}-#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]-async fn assign_tasks_moves_and_reports_non_tasks(pool: PgPool) -> anyhow::Result<()> {- insert_user(&pool, OWNER).await?;- let task_a = Uuid::now_v7().to_string();- let task_b = Uuid::now_v7().to_string();- let not_a_task = Uuid::now_v7().to_string();- let missing = Uuid::now_v7().to_string();- insert_document(&pool, &task_a, OWNER, true).await?;- insert_document(&pool, &task_b, OWNER, true).await?;- insert_document(&pool, ¬_a_task, OWNER, false).await?;-- let repo = repo(pool.clone());- let first = repo- .create(- create_args(OWNER, "First", &[]),- share_off(),- TeamShareCreation::Unshared,- )- .await?;- let second = repo- .create(- create_args(OWNER, "Second", &[]),- share_off(),- TeamShareCreation::Unshared,- )- .await?;-- let first_results = repo- .assign_tasks(first.id, vec![task_a.clone(), task_b.clone()])- .await?;- assert_eq!(- first_results- .results- .iter()- .map(|result| result.status)- .collect::<Vec<_>>(),- vec![AssignTaskStatus::Assigned, AssignTaskStatus::Assigned]- );-- let second_results = repo- .assign_tasks(- second.id,- vec![task_a.clone(), not_a_task.clone(), missing.clone()],- )- .await?;- assert_eq!(second_results.results[0].status, AssignTaskStatus::Moved);- assert_eq!(second_results.results[1].status, AssignTaskStatus::NotATask);- assert_eq!(second_results.results[2].status, AssignTaskStatus::NotATask);- assert_eq!(- second_results.changes,- vec![crate::domain::events::TaskMembershipChange {- task_id: task_a.clone(),- from: Some(first.id),- to: Some(second.id)- }]- );- assert!(- repo.assign_tasks(second.id, vec![task_a.clone()])- .await?- .changes- .is_empty()- );-- let first_detail = repo.get_detail(first.id).await?.expect("first");- let second_detail = repo.get_detail(second.id).await?.expect("second");- assert_eq!(first_detail.task_ids, vec![task_b.clone()]);- assert_eq!(second_detail.task_ids, vec![task_a.clone()]);- assert!(second_detail.updated_at > second.updated_at);- assert!(matches!(- repo.assign_tasks(InitiativeId::generate(), vec![task_a])- .await,- Err(InitiativeError::NotFound)- ));- Ok(())-}--#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]-async fn unassign_task_ignores_links_owned_by_other_initiatives(- pool: PgPool,-) -> anyhow::Result<()> {- insert_user(&pool, OWNER).await?;- let task_id = Uuid::now_v7().to_string();- insert_document(&pool, &task_id, OWNER, true).await?;-- let repo = repo(pool.clone());- let first = repo- .create(- create_args(OWNER, "Keeper", &[]),- share_off(),- TeamShareCreation::Unshared,- )- .await?;- let second = repo- .create(- create_args(OWNER, "Other", &[]),- share_off(),- TeamShareCreation::Unshared,- )- .await?;- repo.assign_tasks(first.id, vec![task_id.clone()]).await?;-- let error = repo- .unassign_task(second.id, &task_id)- .await- .expect_err("other initiative cannot steal the link");- assert!(matches!(error, InitiativeError::NotFound));-- repo.unassign_task(first.id, &task_id).await?;- let detail = repo.get_detail(first.id).await?.expect("keeper");- assert!(detail.task_ids.is_empty());- assert!(detail.updated_at > first.updated_at);- Ok(())-}-#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]async fn delete_leaves_no_initiative_rows(pool: PgPool) -> anyhow::Result<()> {insert_user(&pool, OWNER).await?;insert_user(&pool, MEMBER).await?;let channel_id = Uuid::now_v7();insert_channel(&pool, channel_id, OWNER, MEMBER).await?;- let task_id = Uuid::now_v7().to_string();- insert_document(&pool, &task_id, OWNER, true).await?;let repo = repo(pool.clone());let created = repo@@ -847,7 +769,6 @@ async fn delete_leaves_no_initiative_rows(pool: PgPool) -> anyhow::Result<()> {..update_args(created.id)}).await?;- repo.assign_tasks(created.id, vec![task_id.clone()]).await?;let share_id = created.share_permission.id.clone();let initiative_id = created.id.as_uuid();@@ -886,18 +807,11 @@ async fn delete_leaves_no_initiative_rows(pool: PgPool) -> anyhow::Result<()> {).fetch_one(&pool).await?;- let leftover_task = sqlx::query_scalar!(- r#"SELECT EXISTS(SELECT 1 FROM task_initiative WHERE initiative_id = $1) AS "exists!""#,- initiative_id,- )- .fetch_one(&pool)- .await?;assert!(!leftover_share);assert!(!leftover_channel);assert!(!leftover_access);assert!(!leftover_member);- assert!(!leftover_task);assert!(repo.get_detail(created.id).await?.is_none());assert!(matches!(repo.delete(created.id).await,diff --git a/crates/initiative/src/outbound/pg_initiative_repo/test/access.rs b/crates/initiative/src/outbound/pg_initiative_repo/test/access.rsindex 97bebfdece..d73407ed03 100644--- a/crates/initiative/src/outbound/pg_initiative_repo/test/access.rs+++ b/crates/initiative/src/outbound/pg_initiative_repo/test/access.rs@@ -59,28 +59,3 @@ async fn assignee_sharing_adds_manageable_collaborators_without_owner_downgrade(assert_eq!(initiative_access(&pool, created.id, MEMBER).await?, None);Ok(())}--#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]-async fn task_side_clear_is_idempotent_and_preserves_the_task(pool: PgPool) -> anyhow::Result<()> {- insert_user(&pool, OWNER).await?;- let task_id = Uuid::now_v7().to_string();- insert_document(&pool, &task_id, OWNER, true).await?;- let repo = repo(pool.clone());- let created = repo- .create(- create_args(OWNER, "Launch", &[]),- share_off(),- TeamShareCreation::Unshared,- )- .await?;- repo.assign_tasks(created.id, vec![task_id.clone()]).await?;- repo.clear_task(&task_id).await?;- repo.clear_task(&task_id).await?;- let detail = repo.get_detail(created.id).await?.expect("project exists");- assert!(detail.task_ids.is_empty());- assert!(detail.updated_at > created.updated_at);- // Reassignment also proves that clearing preserved the task document/subtype.- let assigned = repo.assign_tasks(created.id, vec![task_id]).await?;- assert_eq!(assigned.results[0].status, AssignTaskStatus::Assigned);- Ok(())-}diff --git a/crates/initiative/src/outbound/pg_initiative_repo/test/history.rs b/crates/initiative/src/outbound/pg_initiative_repo/test/history.rsindex b484ce5d79..93b55f0d9d 100644--- a/crates/initiative/src/outbound/pg_initiative_repo/test/history.rs+++ b/crates/initiative/src/outbound/pg_initiative_repo/test/history.rs@@ -1,13 +1,8 @@use super::*;-use crate::domain::{- events::{- InitiativeEventActor, InitiativeTasksChanged, InitiativeTopicEvent, TaskMembershipChange,- },- history::InitiativeHistory,-};+use crate::domain::history::InitiativeHistory;use activity::domain::ports::ActivityRepo;use activity::outbound::pg_activity_repo::PgActivityRepo;-use activity::{ActivitySource, Actor, EntityType, Ingest};+use activity::{Action, Activity, Actor, DomainActivity, EntityType, InitiativeTaskChange};use entity_access::{domain::{models::ViewAccessLevel, ports::EntityAccessService, service::EntityAccessServiceImpl,@@ -16,6 +11,25 @@ use entity_access::{};use std::sync::Arc;+/// The project-side row the properties domain records when a task's Project+/// property names the project.+struct TaskAdded {+ project_id: String,+ task_id: String,+}++impl DomainActivity for TaskAdded {+ const ENTITY_TYPE: EntityType = EntityType::Initiative;+ fn entity_id(&self) -> &str {+ &self.project_id+ }+ fn into_action(self) -> Action {+ Action::TaskAdded(InitiativeTaskChange {+ task_id: self.task_id,+ })+ }+}+#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]async fn project_history_filters_task_events_until_task_access_is_granted(pool: PgPool,@@ -32,21 +46,17 @@ async fn project_history_filters_task_events_until_task_access_is_granted(TeamShareCreation::Unshared,).await?;- let topic_event = InitiativeTopicEvent::TasksChanged(InitiativeTasksChanged {- attribution: Some(InitiativeEventActor {- actor: Actor::new_from_user(user(OWNER)),- on_behalf_of: None,- }),- occurred_at: chrono::Utc::now(),- changes: vec![TaskMembershipChange {+ let rows = vec![Activity::from_domain(+ Uuid::now_v7(),+ 2,+ Actor::new_from_user(user(OWNER)),+ None,+ TaskAdded {+ project_id: created.id.to_string(),task_id: task_id.clone(),- from: None,- to: Some(created.id),- }],- });- let Ingest::Insert(rows) = topic_event.ingest(Uuid::now_v7()) else {- panic!("membership activity");- };+ },+ chrono::Utc::now(),+ )];let activity_repo = PgActivityRepo::new(pool.clone());activity_repo.insert_activities(&rows).await?;let access = Arc::new(EntityAccessServiceImpl::new(PgAccessRepository::new(diff --git a/crates/initiative/src/outbound/pg_initiative_repo/test/toolset.rs b/crates/initiative/src/outbound/pg_initiative_repo/test/toolset.rsindex 2e16434368..ed43c9b02f 100644--- a/crates/initiative/src/outbound/pg_initiative_repo/test/toolset.rs+++ b/crates/initiative/src/outbound/pg_initiative_repo/test/toolset.rs@@ -8,13 +8,12 @@ use crate::domain::{resources::{InitiativeResources, ResourceFuture},service::InitiativeServiceImpl,};-use crate::inbound::toolset::{InitiativeToolContext, SetTaskInitiative, UpdateInitiativeSharing};+use crate::inbound::toolset::{InitiativeToolContext, UpdateInitiativeSharing};use activity::outbound::pg_activity_repo::PgActivityRepo;use ai_toolset::{AsyncTool, RequestContext, ServiceContext};use entity_access::{domain::{models::{EditAccessLevel, Entity, EntityAccessAuth, EntityAccessReceipt, ViewAccessLevel},- ports::EntityAccessService,service::EntityAccessServiceImpl,},outbound::PgAccessRepository,@@ -43,6 +42,9 @@ impl InitiativeResources for UnusedProperties {fn purge(&self, _: EntityAccessReceipt<EditAccessLevel>) -> ResourceFuture<'_, ()> {panic!("unexpected property deletion")}+ fn project_tasks(&self, _: InitiativeId) -> ResourceFuture<'_, Vec<String>> {+ Box::pin(async { Ok(Vec::new()) })+ }fn view(&self,_: EntityAccessAuth,@@ -108,156 +110,6 @@ fn context_with_resources(}}-#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]-async fn tool_moves_from_inaccessible_source_and_clears_after_project_access_is_revoked(- pool: PgPool,-) -> anyhow::Result<()> {- for id in [OWNER, MEMBER, OTHER_OWNER] {- insert_user(&pool, id).await?;- }- let task_id = Uuid::now_v7().to_string();- insert_document(&pool, &task_id, MEMBER, true).await?;- entity_access_db_utils::upsert_user_entity_access_bulk(- &pool,- &[user(MEMBER)],- &Uuid::parse_str(&task_id)?,- model_entity::EntityType::Document,- AccessLevel::Owner,- )- .await?;- let repo = repo(pool.clone());- let source = repo- .create(- create_args(OTHER_OWNER, "Hidden source", &[]),- share_off(),- TeamShareCreation::Unshared,- )- .await?;- let destination = repo- .create(- create_args(OWNER, "Destination", &[MEMBER]),- share_off(),- TeamShareCreation::Unshared,- )- .await?;- repo.assign_tasks(source.id, vec![task_id.clone()]).await?;- let events = Arc::new(Events::default());- let context = context(pool, events.clone());- assert!(- context- .access- .generate_entity_access_receipt::<ViewAccessLevel>(- &user(MEMBER),- None,- &source.id.to_string(),- model_entity::EntityType::Initiative- )- .await- .is_err()- );-- let moved = SetTaskInitiative {- task_ids: vec![task_id.clone(), task_id.clone()],- initiative_id: Some(destination.id.as_uuid()),- }- .call(- ServiceContext(context.clone()),- RequestContext::new(user(MEMBER)),- )- .await- .map_err(|error| error.internal_error)?;- assert_eq!(moved.results.len(), 1);- assert_eq!(moved.results[0].status, "moved");- let recorded = events.0.lock().unwrap().clone();- let [InitiativeTopicEvent::TasksChanged(change)] = recorded.as_slice() else {- panic!("one committed membership change")- };- let attribution = change.attribution.as_ref().unwrap();- assert_eq!(- attribution.actor.as_ref(),- bot_id::MACRO_AI_BOT_ID.into_storage_id().as_ref()- );- assert_eq!(attribution.on_behalf_of.as_ref(), Some(&user(MEMBER)));- assert_eq!(change.changes[0].from, Some(source.id));- assert_eq!(change.changes[0].to, Some(destination.id));-- // The same decorated ActivityReads backs personal GraphQL pages/overview and- // the ReadActivity MCP tool. Persist both sides of the move to exercise it.- use activity::domain::ports::{ActivityReads, ActivityRepo};- use activity::{ActivitySource, Ingest};- let Ingest::Insert(rows) = recorded[0].ingest(Uuid::now_v7()) else {- panic!("move activities")- };- let activity_repo = PgActivityRepo::new(repo.pool.clone());- activity_repo.insert_activities(&rows).await?;- let reads = crate::domain::personal_activity::ProjectVisibleActivityReads::new(- activity_repo,- context.access.clone(),- );- let feed = reads- .subject_feed(MEMBER, None, std::num::NonZeroU32::new(10).unwrap())- .await?;- assert_eq!(feed.records.len(), 1);- assert_eq!(feed.records[0].entity_id, destination.id.to_string());- let range = reads- .subject_activity_range(- MEMBER,- chrono::Utc::now() - chrono::Duration::days(1),- chrono::Utc::now() + chrono::Duration::days(1),- std::num::NonZeroU32::new(10).unwrap(),- )- .await?;- assert_eq!(range.records.len(), 1);- assert_eq!(range.records[0].entity_id, destination.id.to_string());- let window = activity::trailing_year(chrono::Utc::now(), "UTC".parse().unwrap());- let overview = reads.subject_overview(MEMBER, window.clone()).await?;- assert_eq!(overview.top_entities.len(), 1);- assert_eq!(- overview.top_entities[0].entity_id,- destination.id.to_string()- );-- let mut remove_access = update_args(destination.id);- remove_access.member_ids_removed = vec![user(MEMBER)];- repo.update(remove_access).await?;- assert!(- reads- .subject_feed(MEMBER, None, std::num::NonZeroU32::new(10).unwrap())- .await?- .records- .is_empty()- );- assert!(- reads- .subject_overview(MEMBER, window)- .await?- .top_entities- .is_empty()- );- assert!(- context- .access- .generate_entity_access_receipt::<ViewAccessLevel>(- &user(MEMBER),- None,- &destination.id.to_string(),- model_entity::EntityType::Initiative- )- .await- .is_err()- );- let cleared = SetTaskInitiative {- task_ids: vec![task_id.clone()],- initiative_id: None,- }- .call(ServiceContext(context), RequestContext::new(user(MEMBER)))- .await- .map_err(|error| error.internal_error)?;- assert_eq!(cleared.results[0].status, "cleared");- assert!(repo.task_memberships(vec![task_id]).await?.is_empty());- Ok(())-}-#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]async fn sharing_tool_checks_actual_ownership_under_delegated_bot_receipt(pool: PgPool,@@ -300,73 +152,3 @@ async fn sharing_tool_checks_actual_ownership_under_delegated_bot_receipt(assert_eq!(shared.access, "owner");Ok(())}--#[tokio::test]-async fn oversized_tool_batch_fails_before_any_database_access() -> anyhow::Result<()> {- let pool = sqlx::postgres::PgPoolOptions::new()- .connect_lazy("postgres://unused:[email protected]:1/unused")?;- let context = context(pool, Arc::new(Events::default()));- let result = SetTaskInitiative {- task_ids: (0..101).map(|id| id.to_string()).collect(),- initiative_id: Some(Uuid::now_v7()),- }- .call(ServiceContext(context), RequestContext::new(user(OWNER)))- .await;- assert!(result.unwrap_err().description.contains("100"));- Ok(())-}--#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]-async fn clear_tool_reports_non_tasks_and_keeps_clearing_the_remaining_tasks(- pool: PgPool,-) -> anyhow::Result<()> {- insert_user(&pool, OWNER).await?;- let ids: Vec<String> = (0..3).map(|_| Uuid::now_v7().to_string()).collect();- for (index, id) in ids.iter().enumerate() {- insert_document(&pool, id, OWNER, index != 1).await?;- entity_access_db_utils::upsert_user_entity_access_bulk(- &pool,- &[user(OWNER)],- &Uuid::parse_str(id)?,- model_entity::EntityType::Document,- AccessLevel::Owner,- )- .await?;- }- let repo = repo(pool.clone());- let initiative = repo- .create(- create_args(OWNER, "Launch", &[]),- share_off(),- TeamShareCreation::Unshared,- )- .await?;- repo.assign_tasks(initiative.id, vec![ids[0].clone(), ids[2].clone()])- .await?;- let context = context(pool, Arc::new(Events::default()));- let result = SetTaskInitiative {- task_ids: ids.clone(),- initiative_id: None,- }- .call(ServiceContext(context), RequestContext::new(user(OWNER)))- .await- .map_err(|error| error.internal_error)?;- assert_eq!(- result- .results- .iter()- .map(|row| row.status.as_str())- .collect::<Vec<_>>(),- ["cleared", "notATask", "cleared"]- );- assert!(- repo.task_memberships(vec![ids[0].clone(), ids[2].clone()])- .await?- .is_empty()- );- assert!(matches!(- repo.clear_task(&Uuid::now_v7().to_string()).await,- Err(InitiativeError::NotFound)- ));- Ok(())-}diff --git a/crates/initiative/src/outbound/pg_initiative_repo/test/toolset/reads.rs b/crates/initiative/src/outbound/pg_initiative_repo/test/toolset/reads.rsindex d299247986..d725fff3d2 100644--- a/crates/initiative/src/outbound/pg_initiative_repo/test/toolset/reads.rs+++ b/crates/initiative/src/outbound/pg_initiative_repo/test/toolset/reads.rs@@ -6,6 +6,8 @@ use entity_access::domain::models::{EntityPermission, EntityType};struct VisibleResources {hidden_task: String,task_reads: Arc<std::sync::atomic::AtomicUsize>,+ /// Membership comes from the tasks' Project property rows in this pool.+ pool: PgPool,}impl InitiativeResources for VisibleResources {@@ -23,6 +25,18 @@ impl InitiativeResources for VisibleResources {fn purge(&self, _: EntityAccessReceipt<EditAccessLevel>) -> ResourceFuture<'_, ()> {panic!("read-only fixture")}+ fn project_tasks(&self, id: InitiativeId) -> ResourceFuture<'_, Vec<String>> {+ use system_properties::SystemPropertiesService;+ let properties = system_properties::SystemPropertiesServiceImpl::new(+ system_properties::PgSystemPropertiesRepository::new(self.pool.clone()),+ );+ Box::pin(async move {+ Ok(properties+ .project_task_ids(id.as_uuid())+ .await+ .expect("project tasks"))+ })+ }fn view(&self,auth: EntityAccessAuth,@@ -76,15 +90,18 @@ async fn tool_cursors_enumerate_projects_and_more_than_two_hundred_visible_tasksinsert_document(&pool, &id, OWNER, true).await?;task_ids.push(id);}- repo.assign_tasks(projects[0].id, task_ids.clone()).await?;+ for task_id in &task_ids {+ set_project(&pool, task_id, projects[0].id).await?;+ }let hidden_task = task_ids.remove(100);let task_reads = Arc::new(std::sync::atomic::AtomicUsize::new(0));let context = context_with_resources(- pool,+ pool.clone(),Arc::new(Events::default()),Arc::new(VisibleResources {hidden_task: hidden_task.clone(),task_reads: task_reads.clone(),+ pool,}),);let mut list: ListInitiatives =diff --git a/crates/initiative/src/outbound/resources.rs b/crates/initiative/src/outbound/resources.rsindex 51cb04d920..23abcf9968 100644--- a/crates/initiative/src/outbound/resources.rs+++ b/crates/initiative/src/outbound/resources.rs@@ -116,9 +116,50 @@ impl<P: PropertiesService, S: SystemPropertiesService, A: EntityAccessService> I}fn purge(&self, receipt: EntityAccessReceipt<EditAccessLevel>) -> ResourceFuture<'_, ()> {Box::pin(async move {+ let id: InitiativeId = receipt+ .entity()+ .entity_id+ .parse()+ .map_err(|_| InitiativeError::BadRequest("invalid initiative id".into()))?;self.properties.delete_entity_properties(&receipt).await+ .map_err(|error| InitiativeError::Internal(rootcause::report!(error).into()))?;+ // Each task leaves through an ordinary property write, so realtime and other+ // consumers hear about it. The write is internal: it records no activity.+ let tasks = self+ .system_properties+ .project_task_ids(id.as_uuid())+ .await+ .map_err(|error| InitiativeError::Internal(rootcause::report!(error).into()))?;+ for task_id in tasks {+ let task = EntityAccessReceipt::<EditAccessLevel>::try_new(+ EntityAccessAuth::Internal,+ Entity {+ entity_id: task_id.clone(),+ entity_type: EntityType::Document,+ },+ EntityPermission::AccessLevel {+ access_level: AccessLevel::Owner,+ },+ )+ .map_err(|error| InitiativeError::Internal(rootcause::report!(error).into()))?;+ if let Err(error) = self+ .properties+ .set_entity_property(&task, SystemPropertyKey::PROJECT_UUID, None)+ .await+ {+ tracing::warn!(?error, %task_id, %id, "task kept a deleted project's reference");+ }+ }+ Ok(())+ })+ }+ fn project_tasks(&self, id: InitiativeId) -> ResourceFuture<'_, Vec<String>> {+ Box::pin(async move {+ self.system_properties+ .project_task_ids(id.as_uuid())+ .await.map_err(|error| InitiativeError::Internal(rootcause::report!(error).into()))})}diff --git a/crates/macro_db_client/migrations/20261003040141_task_project_property.down.sql b/crates/macro_db_client/migrations/20261003040141_task_project_property.down.sqlnew file mode 100644index 0000000000..e98c88df01--- /dev/null+++ b/crates/macro_db_client/migrations/20261003040141_task_project_property.down.sql@@ -0,0 +1,25 @@+CREATE TABLE IF NOT EXISTS task_initiative+(+ task_id TEXT PRIMARY KEY NOT NULL REFERENCES "Document" (id) ON DELETE CASCADE,+ initiative_id UUID NOT NULL REFERENCES initiative (id) ON DELETE CASCADE,+ created_at TIMESTAMPTZ NOT NULL DEFAULT now()+);++CREATE INDEX IF NOT EXISTS task_initiative_initiative_id_idx+ ON task_initiative (initiative_id);++INSERT INTO task_initiative (task_id, initiative_id)+SELECT property.entity_id, initiative.id+FROM entity_properties AS property+JOIN "Document" AS document ON document.id = property.entity_id+JOIN initiative ON initiative.id::text = property.values->'value'->0->>'entity_id'+WHERE property.property_definition_id = '00000001-0000-0000-0000-000000000014'+ON CONFLICT (task_id) DO NOTHING;++DROP INDEX IF EXISTS idx_ep_project_value_gin;++DELETE FROM entity_properties+WHERE property_definition_id = '00000001-0000-0000-0000-000000000014';++DELETE FROM property_definitions+WHERE id = '00000001-0000-0000-0000-000000000014';diff --git a/crates/macro_db_client/migrations/20261003040141_task_project_property.up.sql b/crates/macro_db_client/migrations/20261003040141_task_project_property.up.sqlnew file mode 100644index 0000000000..0b133c98e6--- /dev/null+++ b/crates/macro_db_client/migrations/20261003040141_task_project_property.up.sql@@ -0,0 +1,51 @@+-- A task's project is its Project system property (single-select entity+-- reference to an initiative) instead of a row in task_initiative.+-- The UUID mirrors system_properties::SystemPropertyKey::Project (0x14).+INSERT INTO property_definitions (+ id,+ team_id,+ user_id,+ display_name,+ data_type,+ is_multi_select,+ specific_entity_type,+ is_system+ )+VALUES (+ '00000001-0000-0000-0000-000000000014',+ NULL,+ NULL,+ 'Project',+ 'ENTITY',+ false,+ 'INITIATIVE',+ true+ )+ON CONFLICT (id) DO NOTHING;++INSERT INTO entity_properties (id, entity_id, entity_type, property_definition_id, values)+SELECT+ gen_random_uuid(),+ membership.task_id,+ 'TASK'::property_entity_type,+ '00000001-0000-0000-0000-000000000014'::uuid,+ jsonb_build_object(+ 'type', 'EntityReference',+ 'value', jsonb_build_array(jsonb_build_object(+ 'entity_id', membership.initiative_id::text,+ 'entity_type', 'INITIATIVE'+ ))+ )+FROM task_initiative AS membership+ON CONFLICT (entity_id, entity_type, property_definition_id) DO UPDATE+SET values = EXCLUDED.values;++-- Project task lists filter tasks by this reference.+CREATE INDEX IF NOT EXISTS idx_ep_project_value_gin+ON entity_properties+USING gin ((values->'value') jsonb_path_ops)+WHERE property_definition_id = '00000001-0000-0000-0000-000000000014';++-- task_initiative stays until every service reads the Project property:+-- migrations deploy before services, and the previous release still uses it.+-- A later migration drops it.diff --git a/crates/properties/src/domain/activity.rs b/crates/properties/src/domain/activity.rsindex 23ed242509..0197b44e29 100644--- a/crates/properties/src/domain/activity.rs+++ b/crates/properties/src/domain/activity.rs@@ -9,14 +9,16 @@mod test;use ::activity::{- Activity, ActivitySource, Actor, Attribution, CommonAction, EntityType, Ingest, PropertyChange,- event_time,+ Action, Activity, ActivitySource, Actor, Attribution, CommonAction, DomainActivity, EntityType,+ Ingest, InitiativeTaskChange, PropertyChange, event_time,};use macro_user_id::user_id::MacroUserIdStr;use models_properties::EntityType as PropertyEntityType;+use models_properties::service::property_value::PropertyValue;+use system_properties::SystemPropertyKey;use uuid::Uuid;-use super::events::PropertyTopicEvent;+use super::events::{EntityPropertyUpdatedMetadata, PropertyTopicEvent};/// Maps the properties-domain entity vocabulary onto the soup item-type/// vocabulary activities use. `None` drops the activity (no soup surface).@@ -76,6 +78,101 @@ fn attributed()])}+/// A task joining or leaving a project, recorded on the project.+enum ProjectMembership<'a> {+ Added {+ project_id: &'a str,+ task_id: &'a str,+ },+ Removed {+ project_id: &'a str,+ task_id: &'a str,+ },+}++impl DomainActivity for ProjectMembership<'_> {+ const ENTITY_TYPE: EntityType = EntityType::Initiative;+ fn entity_id(&self) -> &str {+ match self {+ Self::Added { project_id, .. } | Self::Removed { project_id, .. } => project_id,+ }+ }+ fn into_action(self) -> Action {+ match self {+ Self::Added { task_id, .. } => Action::TaskAdded(InitiativeTaskChange {+ task_id: task_id.to_owned(),+ }),+ Self::Removed { task_id, .. } => Action::TaskRemoved(InitiativeTaskChange {+ task_id: task_id.to_owned(),+ }),+ }+ }+}++fn project_id(value: Option<&PropertyValue>) -> Option<&str> {+ match value {+ Some(PropertyValue::EntityRef(references)) => references+ .iter()+ .find(|reference| reference.entity_type == PropertyEntityType::Initiative)+ .map(|reference| reference.entity_id.as_str()),+ _ => None,+ }+}++/// A task's Project change is also activity on the project it left+/// (ordinal 1) and the one it joined (ordinal 2).+fn project_membership_rows(+ event_id: Uuid,+ attribution: &Attribution,+ m: &EntityPropertyUpdatedMetadata,+) -> Vec<Activity> {+ if m.entity_type != PropertyEntityType::Task+ || m.property_definition_id != SystemPropertyKey::PROJECT_UUID+ {+ return Vec::new();+ }+ let from = project_id(m.previous_value.as_ref());+ let to = project_id(m.value.as_ref());+ if from == to {+ return Vec::new();+ }+ let task_id = m.entity_id.as_str();+ let memberships = [+ from.map(|project_id| {+ (+ 1,+ ProjectMembership::Removed {+ project_id,+ task_id,+ },+ )+ }),+ to.map(|project_id| {+ (+ 2,+ ProjectMembership::Added {+ project_id,+ task_id,+ },+ )+ }),+ ];+ memberships+ .into_iter()+ .flatten()+ .map(|(ordinal, membership)| {+ Activity::from_domain(+ event_id,+ ordinal,+ attribution.actor(),+ attribution.on_behalf_of(),+ membership,+ m.updated_at,+ )+ })+ .collect()+}+impl ActivitySource for PropertyTopicEvent {/// Maps one `macro.properties` event to its ingest outcome.///@@ -83,32 +180,43 @@ impl ActivitySource for PropertyTopicEvent {/// until someone classifies it or explicitly drops it.fn ingest(&self, event_id: Uuid) -> Ingest {match self {- PropertyTopicEvent::EntityPropertyUpdated(m) => attributed(- event_id,- event_attribution(&m.actor, &m.on_behalf_of, &m.actor_user_id),- &m.entity_type,- &m.entity_id,- CommonAction::PropertyChanged(PropertyChange {- property: m.property_definition_id.to_string(),- // None means unknown/newly-attached for `from` and- // cleared for `to`; a serialization failure must not- // masquerade as either, so it stores an explicit JSON- // null.- from: m.previous_value.as_ref().map(|value| {- serde_json::to_value(value).unwrap_or_else(|e| {- tracing::error!(error=?e, "unserializable property value");- serde_json::Value::Null- })- }),- to: m.value.as_ref().map(|value| {- serde_json::to_value(value).unwrap_or_else(|e| {- tracing::error!(error=?e, "unserializable property value");- serde_json::Value::Null- })+ PropertyTopicEvent::EntityPropertyUpdated(m) => {+ let attribution = event_attribution(&m.actor, &m.on_behalf_of, &m.actor_user_id);+ let memberships = attribution+ .as_ref()+ .map(|attribution| project_membership_rows(event_id, attribution, m))+ .unwrap_or_default();+ let mut ingest = attributed(+ event_id,+ attribution,+ &m.entity_type,+ &m.entity_id,+ CommonAction::PropertyChanged(PropertyChange {+ property: m.property_definition_id.to_string(),+ // None means unknown/newly-attached for `from` and+ // cleared for `to`; a serialization failure must not+ // masquerade as either, so it stores an explicit JSON+ // null.+ from: m.previous_value.as_ref().map(|value| {+ serde_json::to_value(value).unwrap_or_else(|e| {+ tracing::error!(error=?e, "unserializable property value");+ serde_json::Value::Null+ })+ }),+ to: m.value.as_ref().map(|value| {+ serde_json::to_value(value).unwrap_or_else(|e| {+ tracing::error!(error=?e, "unserializable property value");+ serde_json::Value::Null+ })+ }),}),- }),- m.updated_at,- ),+ m.updated_at,+ );+ if let Ingest::Insert(rows) = &mut ingest {+ rows.extend(memberships);+ }+ ingest+ }PropertyTopicEvent::EntityPropertyDeleted(m) => attributed(event_id,event_attribution(&m.actor, &m.on_behalf_of, &m.actor_user_id),diff --git a/crates/properties/src/domain/activity/test.rs b/crates/properties/src/domain/activity/test.rsindex e3db4a0cf4..b4e36d48d5 100644--- a/crates/properties/src/domain/activity/test.rs+++ b/crates/properties/src/domain/activity/test.rs@@ -126,3 +126,58 @@ fn delegated_property_update_keeps_the_user_as_subject() {);assert_eq!(activities[0].subject_id, "macro|[email protected]");}++fn project(id: &str) -> Option<PropertyValue> {+ Some(PropertyValue::EntityRef(vec![+ models_properties::shared::EntityReference::new(id, PropertyEntityType::Initiative),+ ]))+}++#[test]+fn moving_a_task_between_projects_is_activity_on_the_task_and_both_projects() {+ let mut metadata = update(Some(user("macro|[email protected]")));+ metadata.property_definition_id = SystemPropertyKey::PROJECT_UUID;+ metadata.previous_value = project("project-from");+ metadata.value = project("project-to");+ let event = envelope(PropertyTopicEvent::EntityPropertyUpdated(metadata));++ let Ingest::Insert(activities) = event.event.ingest(event.event_id) else {+ panic!("expected activities");+ };+ assert_eq!(activities.len(), 3);+ assert_eq!(activities[0].entity_type, ActivityEntityType::Document);+ assert!(matches!(activities[0].action, Action::PropertyChanged(_)));+ assert_eq!(activities[1].entity_type, ActivityEntityType::Initiative);+ assert_eq!(activities[1].entity_id, "project-from");+ assert!(matches!(+ &activities[1].action,+ Action::TaskRemoved(change) if change.task_id == "task-1"+ ));+ assert_eq!(activities[2].entity_id, "project-to");+ assert!(matches!(+ &activities[2].action,+ Action::TaskAdded(change) if change.task_id == "task-1"+ ));+ for activity in &activities {+ assert_eq!(activity.actor.as_ref(), "macro|[email protected]");+ }+}++#[test]+fn unchanged_or_unattributed_project_saves_record_no_membership_activity() {+ let mut unchanged = update(Some(user("macro|[email protected]")));+ unchanged.property_definition_id = SystemPropertyKey::PROJECT_UUID;+ unchanged.previous_value = project("project");+ unchanged.value = project("project");+ let event = envelope(PropertyTopicEvent::EntityPropertyUpdated(unchanged));+ let Ingest::Insert(activities) = event.event.ingest(event.event_id) else {+ panic!("expected activities");+ };+ assert_eq!(activities.len(), 1);++ let mut unattributed = update(None);+ unattributed.property_definition_id = SystemPropertyKey::PROJECT_UUID;+ unattributed.value = project("project");+ let event = envelope(PropertyTopicEvent::EntityPropertyUpdated(unattributed));+ assert!(matches!(event.event.ingest(event.event_id), Ingest::Ignore));+}diff --git a/crates/properties/src/domain/service_impl.rs b/crates/properties/src/domain/service_impl.rsindex 5bc834f9bd..2838ca4fe4 100644--- a/crates/properties/src/domain/service_impl.rs+++ b/crates/properties/src/domain/service_impl.rs@@ -729,6 +729,14 @@ where.await?;}+ let property_value = if property_definition_id == SystemPropertyKey::PROJECT_UUID+ && entity_type == EntityType::Task+ {+ self.validate_task_project(access, property_value).await?+ } else {+ property_value+ };+if property_definition_id == SystemPropertyKey::ASSIGNEES_UUID&& entity_type == EntityType::Initiative{diff --git a/crates/properties/src/domain/service_impl/helpers.rs b/crates/properties/src/domain/service_impl/helpers.rsindex 5f7239efa0..3fd2feec7c 100644--- a/crates/properties/src/domain/service_impl/helpers.rs+++ b/crates/properties/src/domain/service_impl/helpers.rs@@ -47,9 +47,10 @@ pub fn extract_option_ids_from_property_value(value: &Option<PropertyValue>) ->/// Check if a property can be attached to the given entity type.pub fn is_property_applicable_to(property_id: Uuid, entity_type: EntityType) -> bool {- // Task-only properties: Parent Task and Subtasks+ // Task-only properties: Parent Task, Subtasks and Projectif property_id == SystemPropertyKey::PARENT_TASK_UUID|| property_id == SystemPropertyKey::SUBTASKS_UUID+ || property_id == SystemPropertyKey::PROJECT_UUID{return entity_type == EntityType::Task;}diff --git a/crates/properties/src/domain/service_impl/task_properties.rs b/crates/properties/src/domain/service_impl/task_properties.rsindex cf9da56b84..533739beab 100644--- a/crates/properties/src/domain/service_impl/task_properties.rs+++ b/crates/properties/src/domain/service_impl/task_properties.rs@@ -13,6 +13,7 @@ use macro_user_id::user_id::MacroUserIdStr;use models_properties::EntityType;use models_properties::api::requests::SetPropertyValue;use models_properties::service::{entity_property::EntityProperty, property_value::PropertyValue};+use models_properties::shared::EntityReference;use system_properties::SystemPropertyKey;use uuid::Uuid;@@ -76,6 +77,22 @@ where&self,access: &EditReceipt,referenced_task_ids: &[Uuid],+ ) -> Result<(), PropertiesErr> {+ self.check_referenced_edit_access(+ access,+ entity_access::domain::models::EntityType::Document,+ referenced_task_ids,+ )+ .await+ }++ /// Require the acting user's edit access to every referenced entity.+ /// Internal (machine) callers are trusted and skip the check.+ async fn check_referenced_edit_access(+ &self,+ access: &EditReceipt,+ entity_type: entity_access::domain::models::EntityType,+ referenced_ids: &[impl std::fmt::Display],) -> Result<(), PropertiesErr> {let user_id = match access.auth() {EntityAccessAuth::Internal => return Ok(()),@@ -86,23 +103,57 @@ where.acting_user_id().ok_or(PropertiesErr::PermissionDenied)?,};- if referenced_task_ids.is_empty() {+ if referenced_ids.is_empty() {return Ok(());}let permission_service = self.permission_service()?;- for task_id in referenced_task_ids {+ for id in referenced_ids {permission_service- .mint_edit_receipt(- user_id,- &task_id.to_string(),- entity_access::domain::models::EntityType::Document,- )+ .mint_edit_receipt(user_id, &id.to_string(), entity_type).await.map_err(|_| PropertiesErr::PermissionDenied)?;}Ok(())}+ /// A task belongs to at most one project. Joining one changes what the+ /// project shows, so it also needs edit access to the project; leaving+ /// needs task edit access alone. Returns the value with the project id+ /// in canonical form, which project task lists match on.+ pub(crate) async fn validate_task_project(+ &self,+ access: &EditReceipt,+ value: Option<PropertyValue>,+ ) -> Result<Option<PropertyValue>, PropertiesErr> {+ let Some(PropertyValue::EntityRef(references)) = &value else {+ return Ok(value);+ };+ let project_id = match references.as_slice() {+ [] => return Ok(value),+ [reference] if reference.entity_type == EntityType::Initiative => {+ Uuid::parse_str(&reference.entity_id).map_err(|_| {+ PropertiesErr::Validation("Project must reference a project id".to_string())+ })?+ }+ _ => {+ return Err(PropertiesErr::Validation(+ "Project must reference one project".to_string(),+ ));+ }+ };+ self.check_referenced_edit_access(+ access,+ entity_access::domain::models::EntityType::Initiative,+ &[project_id],+ )+ .await?;+ Ok(Some(PropertyValue::EntityRef(vec![EntityReference {+ entity_id: project_id.to_string(),+ entity_type: EntityType::Initiative,+ specific_message_id: None,+ }])))+ }+/// Handle task relationship properties (Parent Task / Subtasks) with bidirectional linking.pub(crate) async fn handle_task_relationship_property(&self,diff --git a/crates/properties/src/domain/service_impl/task_properties/test.rs b/crates/properties/src/domain/service_impl/task_properties/test.rsindex f54879c885..763ad75ab1 100644--- a/crates/properties/src/domain/service_impl/task_properties/test.rs+++ b/crates/properties/src/domain/service_impl/task_properties/test.rs@@ -123,3 +123,128 @@ async fn malformed_agent_and_non_user_references_are_rejected_before_side_effectassert!(matches!(result, Err(PropertiesErr::Validation(_))));}}++fn task_edit(user: &MacroUserIdStr<'static>) -> EditReceipt {+ EditReceipt::dangerously_assert_authenticated_user(+ user.clone(),+ &Uuid::from_u128(1).to_string(),+ entity_access::domain::models::EntityType::Document,+ )+}++fn project_reference(entity_id: &str, entity_type: EntityType) -> Option<PropertyValue> {+ Some(PropertyValue::EntityRef(vec![EntityReference::new(+ entity_id,+ entity_type,+ )]))+}++#[tokio::test]+async fn joining_a_project_requires_project_edit_access_and_stores_the_canonical_id() {+ let user = MacroUserIdStr::parse_from_str("macro|[email protected]").unwrap();+ let project = Uuid::from_u128(0xABCDEF);+ let mut permissions = MockPermissionService::new();+ let expected_user = user.clone();+ permissions+ .expect_mint_edit_receipt()+ .once()+ .withf(move |user, id, entity_type| {+ *user == expected_user+ && id == project.to_string()+ && *entity_type == entity_access::domain::models::EntityType::Initiative+ })+ .returning(|user, id, entity_type| {+ let receipt = EditReceipt::dangerously_assert_authenticated_user(+ user.clone().into_owned(),+ id,+ entity_type,+ );+ Box::pin(async move { Ok(receipt) })+ });+ let service = PropertiesServiceImpl::new(+ MockPropertiesRepo::new(),+ Some(permissions),+ None::<MockNotificationService>,+ );++ let value = service+ .validate_task_project(+ &task_edit(&user),+ project_reference(&project.to_string().to_uppercase(), EntityType::Initiative),+ )+ .await+ .unwrap();+ assert_eq!(+ value,+ project_reference(&project.to_string(), EntityType::Initiative)+ );+}++#[tokio::test]+async fn joining_a_project_without_project_edit_access_is_denied() {+ let user = MacroUserIdStr::parse_from_str("macro|[email protected]").unwrap();+ let mut permissions = MockPermissionService::new();+ permissions+ .expect_mint_edit_receipt()+ .once()+ .returning(|_, _, _| Box::pin(async { Err(anyhow::anyhow!("view only")) }));+ let service = PropertiesServiceImpl::new(+ MockPropertiesRepo::new(),+ Some(permissions),+ None::<MockNotificationService>,+ );++ let result = service+ .validate_task_project(+ &task_edit(&user),+ project_reference(&Uuid::from_u128(2).to_string(), EntityType::Initiative),+ )+ .await;+ assert!(matches!(result, Err(PropertiesErr::PermissionDenied)));+}++#[tokio::test]+async fn leaving_a_project_needs_only_task_edit_access() {+ let user = MacroUserIdStr::parse_from_str("macro|[email protected]").unwrap();+ // No permission service: clearing must not check the project.+ let service = PropertiesServiceImpl::new(+ MockPropertiesRepo::new(),+ None::<MockPermissionService>,+ None::<MockNotificationService>,+ );+ for value in [None, Some(PropertyValue::EntityRef(vec![]))] {+ assert_eq!(+ service+ .validate_task_project(&task_edit(&user), value.clone())+ .await+ .unwrap(),+ value+ );+ }+}++#[tokio::test]+async fn project_values_must_name_one_project() {+ let user = MacroUserIdStr::parse_from_str("macro|[email protected]").unwrap();+ let service = PropertiesServiceImpl::new(+ MockPropertiesRepo::new(),+ None::<MockPermissionService>,+ None::<MockNotificationService>,+ );+ let project = Uuid::from_u128(2).to_string();+ for value in [+ project_reference(&project, EntityType::Document),+ project_reference("not-a-uuid", EntityType::Initiative),+ Some(PropertyValue::EntityRef(vec![+ EntityReference::new(&project, EntityType::Initiative),+ EntityReference::new(Uuid::from_u128(3).to_string(), EntityType::Initiative),+ ])),+ ] {+ assert!(matches!(+ service+ .validate_task_project(&task_edit(&user), value)+ .await,+ Err(PropertiesErr::Validation(_))+ ));+ }+}diff --git a/crates/properties/src/inbound/toolset/set_entity_property.rs b/crates/properties/src/inbound/toolset/set_entity_property.rsindex 20cf967a1d..d4d21c5100 100644--- a/crates/properties/src/inbound/toolset/set_entity_property.rs+++ b/crates/properties/src/inbound/toolset/set_entity_property.rs@@ -52,6 +52,9 @@ Tasks always have these system properties (use these property_definition_id valu- Subtasks (00000001-0000-0000-0000-000000000006): entity, multi. Use entity_refs with entity_type='task'.- Story Points (00000001-0000-0000-0000-000000000009): number, single. Use number_value.+A task can belong to one project:+- Project (00000001-0000-0000-0000-000000000014): entity, single. Use entity_ref with entity_type='initiative' and the project UUID; send no value field to remove the task from its project. Setting it requires edit access to the task and the project, and the project's agents are assigned to the task.+CRM companies (entity_type='company', entity_id=the company UUID) always have these system properties:- Stage (00000001-0000-0000-0000-000000000010): select_string, single. Use option_id. Default options: Lead (00000001-0000-0000-0010-000000000001), Qualified (...0002), Demo (...0003), Trial (...0004), Negotiation (...0005), Customer (...0006), Churned (...0007). Teams can customize their stages, so prefer calling GetCompany or GetEntityProperties first to get the valid stage option ids.- Owner (00000001-0000-0000-0000-000000000011): entity, single. Use entity_ref with entity_type='user' and entity_id='macro|[email protected]'.diff --git a/crates/soup_realtime/Cargo.toml b/crates/soup_realtime/Cargo.tomlindex ba838ee4e3..f8a35d94c3 100644--- a/crates/soup_realtime/Cargo.toml+++ b/crates/soup_realtime/Cargo.toml@@ -16,6 +16,7 @@ consumer = ["dep:projects","dep:properties","dep:rdkafka",+ "dep:system_properties","dep:tokio","macro_event_broker/outbound","ports",@@ -56,6 +57,7 @@ properties = { path = "../properties", default-features = false, features = ["pordkafka = { workspace = true, optional = true }rootcause = { workspace = true, optional = true }serde = { workspace = true }+system_properties = { path = "../system_properties", optional = true }tokio = { workspace = true, features = ["sync", "time"], optional = true }tokio-retry = { workspace = true, optional = true }tracing = { workspace = true, optional = true }diff --git a/crates/soup_realtime/src/inbound/kafka_consumer.rs b/crates/soup_realtime/src/inbound/kafka_consumer.rsindex 21b3be7f88..02e5731fb4 100644--- a/crates/soup_realtime/src/inbound/kafka_consumer.rs+++ b/crates/soup_realtime/src/inbound/kafka_consumer.rs@@ -32,11 +32,13 @@ use messages::domain::models::MessageParent;use messages::outbound::broker::{MessageMacroEvent, MessageTopicEvent};use model_entity::{Entity, EntityType};use models_properties::EntityType as PropertyEntityType;+use models_properties::service::property_value::PropertyValue;use projects::domain::events::{ProjectMacroEvent, ProjectTopicEvent};use properties::domain::events::{PropertyMacroEvent, PropertyTopicEvent};use rdkafka::consumer::CommitMode;use rdkafka::message::{BorrowedMessage, Message as _};use rootcause::prelude::{Report, ResultExt as _};+use system_properties::SystemPropertyKey;use tokio_retry::{Retry, strategy::ExponentialBackoff};use tracing::Instrument as _;@@ -162,16 +164,6 @@ fn patches_from_initiative_event(event: &InitiativeTopicEvent) -> Vec<SoupRealtiInitiativeTopicEvent::Purged { initiative_id } => {vec![delete(EntityType::Initiative, initiative_id)]}- InitiativeTopicEvent::TasksChanged(change) => {- let mut patches = Vec::new();- for membership in &change.changes {- push_unique_update(&mut patches, EntityType::Document, &membership.task_id);- for id in [membership.from, membership.to].into_iter().flatten() {- push_unique_update(&mut patches, EntityType::Initiative, &id.to_string());- }- }- patches- }}}@@ -497,7 +489,35 @@ fn property_update(entity_type: PropertyEntityType, entity_id: &str) -> Vec<Soupfn patches_from_property_event(event: &PropertyTopicEvent) -> Vec<SoupRealtimePatch> {match event {PropertyTopicEvent::EntityPropertyUpdated(metadata) => {- property_update(metadata.entity_type, &metadata.entity_id)+ let mut patches = property_update(metadata.entity_type, &metadata.entity_id);+ // Deleting a project clears its tasks with internal, unattributed writes+ // after publishing Purged; refreshing that project here could replace the+ // deletion with a stale replica row.+ let attributed = metadata.actor_user_id.is_some()+ || metadata.actor.is_some()+ || metadata.on_behalf_of.is_some();+ if metadata.entity_type == PropertyEntityType::Task+ && metadata.property_definition_id == SystemPropertyKey::PROJECT_UUID+ && attributed+ {+ // The projects the task left and joined change their task lists.+ for value in [&metadata.previous_value, &metadata.value]+ .into_iter()+ .flatten()+ {+ let PropertyValue::EntityRef(references) = value else {+ continue;+ };+ for reference in references {+ push_unique_update(+ &mut patches,+ EntityType::Initiative,+ &reference.entity_id,+ );+ }+ }+ }+ patches}PropertyTopicEvent::EntityPropertyDeleted(metadata) => {property_update(metadata.entity_type, &metadata.entity_id)diff --git a/crates/soup_realtime/src/inbound/kafka_consumer/test.rs b/crates/soup_realtime/src/inbound/kafka_consumer/test.rsindex 1570d84c42..465333d077 100644--- a/crates/soup_realtime/src/inbound/kafka_consumer/test.rs+++ b/crates/soup_realtime/src/inbound/kafka_consumer/test.rs@@ -1020,33 +1020,45 @@ fn initiative_lifecycle_and_properties_refresh_the_soup_entity() {}#[test]-fn moving_tasks_refreshes_both_initiatives_once_and_each_task() {- use initiative::domain::{- events::{InitiativeTasksChanged, TaskMembershipChange},- models::InitiativeId,+fn moving_a_task_between_projects_refreshes_the_task_and_both_projects() {+ use models_properties::{service::property_value::PropertyValue, shared::EntityReference};+ use system_properties::SystemPropertyKey;++ let project = |id: &str| {+ Some(PropertyValue::EntityRef(vec![EntityReference {+ entity_id: id.to_owned(),+ entity_type: PropertyEntityType::Initiative,+ specific_message_id: None,+ }]))};-- let from = InitiativeId::from_uuid(Uuid::from_u128(42));- let to = InitiativeId::from_uuid(Uuid::from_u128(43));- let event = InitiativeTopicEvent::TasksChanged(InitiativeTasksChanged {- attribution: None,- occurred_at: Utc::now(),- changes: ["task-1", "task-2"]- .into_iter()- .map(|task_id| TaskMembershipChange {- task_id: task_id.to_owned(),- from: Some(from),- to: Some(to),- })- .collect(),+ let event = PropertyTopicEvent::EntityPropertyUpdated(EntityPropertyUpdatedMetadata {+ entity_property_id: Uuid::now_v7(),+ entity_id: DOCUMENT_ID.to_string(),+ entity_type: PropertyEntityType::Task,+ property_definition_id: SystemPropertyKey::PROJECT_UUID,+ actor_user_id: Some(user()),+ actor: None,+ on_behalf_of: None,+ value: project("project-to"),+ previous_value: project("project-from"),+ updated_at: Utc::now(),});assert_eq!(- patches_from_initiative_event(&event),+ patches_from_property_event(&event),vec![- update(EntityType::Document, "task-1"),- update(EntityType::Initiative, from),- update(EntityType::Initiative, to),- update(EntityType::Document, "task-2"),+ update(EntityType::Document, DOCUMENT_ID),+ update(EntityType::Initiative, "project-from"),+ update(EntityType::Initiative, "project-to"),]);+ // A deleted project's internal cleanup refreshes only the task.+ let PropertyTopicEvent::EntityPropertyUpdated(mut cleanup) = event else {+ unreachable!()+ };+ cleanup.actor_user_id = None;+ cleanup.value = None;+ assert_eq!(+ patches_from_property_event(&PropertyTopicEvent::EntityPropertyUpdated(cleanup)),+ vec![update(EntityType::Document, DOCUMENT_ID)]+ );}diff --git a/crates/system_properties/src/domain/model/constants/system_property_key.rs b/crates/system_properties/src/domain/model/constants/system_property_key.rsindex 9be2791aff..f56aab049e 100644--- a/crates/system_properties/src/domain/model/constants/system_property_key.rs+++ b/crates/system_properties/src/domain/model/constants/system_property_key.rs@@ -103,6 +103,9 @@ define_system_properties! {// CRM associations (Companies, 0x0c, is shared with email attachments)Contacts, CONTACTS_UUID, 0x13, "Contacts";++ // Projects: the one project (initiative) a task belongs to+ Project, PROJECT_UUID, 0x14, "Project";}impl SystemPropertyKey {@@ -180,7 +183,7 @@ mod tests {#[test]fn test_all_system_property_keys_returns_all_uuids() {let all_keys = SystemPropertyKey::all_system_property_keys();- assert_eq!(all_keys.len(), 19);+ assert_eq!(all_keys.len(), 20);assert!(all_keys.contains(&SystemPropertyKey::ASSIGNEES_UUID));assert!(all_keys.contains(&SystemPropertyKey::STATUS_UUID));assert!(all_keys.contains(&SystemPropertyKey::PRIORITY_UUID));@@ -200,6 +203,7 @@ mod tests {assert!(all_keys.contains(&SystemPropertyKey::COMPANY_OWNER_UUID));assert!(all_keys.contains(&SystemPropertyKey::REVENUE_UUID));assert!(all_keys.contains(&SystemPropertyKey::CONTACTS_UUID));+ assert!(all_keys.contains(&SystemPropertyKey::PROJECT_UUID));}#[test]@@ -297,6 +301,7 @@ mod tests {SystemPropertyKey::CompanyOwner,SystemPropertyKey::Revenue,SystemPropertyKey::Contacts,+ SystemPropertyKey::Project,];for variant in variants {diff --git a/crates/system_properties/src/domain/port.rs b/crates/system_properties/src/domain/port.rsindex 81fe522c57..bb87945eab 100644--- a/crates/system_properties/src/domain/port.rs+++ b/crates/system_properties/src/domain/port.rs@@ -3,6 +3,8 @@//! These traits define the interfaces that the domain layer uses.//! Implementations live in the outbound module.+use uuid::Uuid;+use crate::{StatusOption, domain::model::SystemPropertyError};/// Repository trait for system property database operations.@@ -35,4 +37,17 @@ pub trait SystemPropertiesRepository: Clone + Send + Sync + 'static {task_id: &str,status: StatusOption,) -> impl Future<Output = Result<(), SystemPropertyError>> + Send;++ /// Tasks whose Project property names `project_id`, in id order.+ fn project_task_ids(+ &self,+ project_id: Uuid,+ ) -> impl Future<Output = Result<Vec<String>, SystemPropertyError>> + Send;++ /// The project each listed task's Project property names, as raw ids;+ /// tasks without a project are absent.+ fn task_projects(+ &self,+ task_ids: &[String],+ ) -> impl Future<Output = Result<Vec<(String, String)>, SystemPropertyError>> + Send;}diff --git a/crates/system_properties/src/domain/service.rs b/crates/system_properties/src/domain/service.rsindex 5863938fdc..7d1c86f4a2 100644--- a/crates/system_properties/src/domain/service.rs+++ b/crates/system_properties/src/domain/service.rs@@ -1,6 +1,9 @@//! Service layer for system properties.+use std::collections::HashMap;+use models_properties::EntityType;+use uuid::Uuid;#[cfg(test)]mod test;@@ -71,6 +74,21 @@ pub trait SystemPropertiesService: Clone + Send + Sync + 'static {task_id: &str,status: StatusOption,) -> impl Future<Output = Result<(), SystemPropertyError>> + Send;++ /// Tasks whose Project property names `project_id`, in id order. Callers+ /// authorize each task before showing it.+ fn project_task_ids(+ &self,+ project_id: Uuid,+ ) -> impl Future<Output = Result<Vec<String>, SystemPropertyError>> + Send;++ /// The project each listed task belongs to, from its Project property.+ /// Tasks without a project are absent. Callers authorize both ends before+ /// showing it.+ fn task_projects(+ &self,+ task_ids: Vec<String>,+ ) -> impl Future<Output = Result<HashMap<String, Uuid>, SystemPropertyError>> + Send;}/// Implementation of SystemPropertiesService using a repository.@@ -161,6 +179,29 @@ where) -> Result<(), SystemPropertyError> {self.repository.update_task_status(task_id, status).await}++ #[tracing::instrument(err, skip(self))]+ async fn project_task_ids(&self, project_id: Uuid) -> Result<Vec<String>, SystemPropertyError> {+ self.repository.project_task_ids(project_id).await+ }++ #[tracing::instrument(err, skip(self, task_ids))]+ async fn task_projects(+ &self,+ task_ids: Vec<String>,+ ) -> Result<HashMap<String, Uuid>, SystemPropertyError> {+ if task_ids.is_empty() {+ return Ok(HashMap::new());+ }+ Ok(self+ .repository+ .task_projects(&task_ids)+ .await?+ .into_iter()+ // Writes store canonical ids; anything else names no project.+ .filter_map(|(task_id, project_id)| Some((task_id, project_id.parse().ok()?)))+ .collect())+ }}/// Collect property rows for a single entity's email attachment properties.diff --git a/crates/system_properties/src/outbound/pgpool.rs b/crates/system_properties/src/outbound/pgpool.rsindex 1ff8abb875..abe3dc59bf 100644--- a/crates/system_properties/src/outbound/pgpool.rs+++ b/crates/system_properties/src/outbound/pgpool.rs@@ -158,15 +158,18 @@ impl SystemPropertiesRepository for PgSystemPropertiesRepository {SystemPropertyKey::RelevantDocuments.uuid(),];- // Step 1: Fetch all properties from source task+ // Step 1: Fetch all properties from source task. A copy doesn't join+ // the source's project: that needs edit access to the project.let source_properties = sqlx::query!(r#"SELECT property_definition_id, valuesFROM entity_propertiesWHERE entity_id = $1AND entity_type = 'TASK'+ AND property_definition_id <> $2"#,- from_task_id+ from_task_id,+ SystemPropertyKey::PROJECT_UUID).fetch_all(&self.pool).await?;@@ -279,6 +282,53 @@ impl SystemPropertiesRepository for PgSystemPropertiesRepository {Ok(())}++ async fn project_task_ids(&self, project_id: Uuid) -> Result<Vec<String>, SystemPropertyError> {+ // Whole-value containment uses the `values` GIN index.+ let rows = sqlx::query_scalar!(+ r#"+ SELECT entity_id+ FROM entity_properties+ WHERE property_definition_id = $1+ AND entity_type = 'TASK'+ AND values @> jsonb_build_object(+ 'value', jsonb_build_array(jsonb_build_object(+ 'entity_id', $2::text, 'entity_type', 'INITIATIVE'+ ))+ )+ ORDER BY entity_id+ "#,+ SystemPropertyKey::PROJECT_UUID,+ project_id.to_string(),+ )+ .fetch_all(&self.pool)+ .await?;+ Ok(rows)+ }++ async fn task_projects(+ &self,+ task_ids: &[String],+ ) -> Result<Vec<(String, String)>, SystemPropertyError> {+ let rows = sqlx::query!(+ r#"+ SELECT entity_id, values->'value'->0->>'entity_id' AS "project_id!"+ FROM entity_properties+ WHERE property_definition_id = $1+ AND entity_type = 'TASK'+ AND entity_id = ANY($2)+ AND values->'value'->0->>'entity_type' = 'INITIATIVE'+ "#,+ SystemPropertyKey::PROJECT_UUID,+ task_ids,+ )+ .fetch_all(&self.pool)+ .await?;+ Ok(rows+ .into_iter()+ .map(|row| (row.entity_id, row.project_id))+ .collect())+ }}// The domain error stays sqlx-free; this adapter owns the mapping so `?`diff --git a/crates/system_properties/src/outbound/pgpool/test.rs b/crates/system_properties/src/outbound/pgpool/test.rsindex d719997f62..7f430c694e 100644--- a/crates/system_properties/src/outbound/pgpool/test.rs+++ b/crates/system_properties/src/outbound/pgpool/test.rs@@ -363,6 +363,44 @@ async fn test_copy_task_properties_copies_custom_properties(Ok(())}+#[sqlx::test(+ migrator = "MACRO_DB_MIGRATIONS",+ fixtures(path = "../../../fixtures", scripts("system_properties"))+)]+async fn test_copy_task_properties_does_not_join_the_project(+ pool: Pool<Postgres>,+) -> anyhow::Result<()> {+ let repo = PgSystemPropertiesRepository::new(pool.clone());+ let from_task_id = "source-task-with-props";+ let to_task_id = "dest-task-project";+ sqlx::query!(+ r#"+ INSERT INTO entity_properties (id, entity_id, entity_type, property_definition_id, values)+ VALUES (gen_random_uuid(), $1, 'TASK', $2, $3)+ "#,+ from_task_id,+ SystemPropertyKey::PROJECT_UUID,+ serde_json::json!({+ "type": "EntityReference",+ "value": [{"entity_id": "00000000-0000-0000-0000-0000000000aa", "entity_type": "INITIATIVE"}]+ }),+ )+ .execute(&pool)+ .await?;++ repo.copy_task_properties(from_task_id, to_task_id).await?;++ let properties = get_task_property_values(&pool, to_task_id).await;+ assert!(!properties.is_empty(), "other properties are copied");+ assert!(+ properties+ .iter()+ .all(|(id, _)| *id != SystemPropertyKey::PROJECT_UUID),+ "the copy must not join the source's project"+ );+ Ok(())+}+#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS",fixtures(path = "../../../fixtures", scripts("system_properties"))@@ -410,3 +448,99 @@ async fn test_copy_task_properties_idempotent(pool: Pool<Postgres>) -> anyhow::ROk(())}++// ============================================================================+// Project membership (the Project property) tests+// ============================================================================++/// Set a task property to one entity reference, the way property writes store it.+async fn set_task_reference(+ pool: &Pool<Postgres>,+ task_id: &str,+ property_definition_id: Uuid,+ entity_id: &str,+ entity_type: &str,+) -> anyhow::Result<()> {+ sqlx::query!(+ r#"+ INSERT INTO entity_properties (id, entity_id, entity_type, property_definition_id, values)+ VALUES (+ gen_random_uuid(), $1, 'TASK', $2,+ jsonb_build_object(+ 'type', 'EntityReference',+ 'value', jsonb_build_array(jsonb_build_object(+ 'entity_id', $3::text, 'entity_type', $4::text+ ))+ )+ )+ ON CONFLICT (entity_id, entity_type, property_definition_id)+ DO UPDATE SET values = EXCLUDED.values+ "#,+ task_id,+ property_definition_id,+ entity_id,+ entity_type,+ )+ .execute(pool)+ .await?;+ Ok(())+}++#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]+async fn project_membership_reads_the_project_property(pool: Pool<Postgres>) -> anyhow::Result<()> {+ let repo = PgSystemPropertiesRepository::new(pool.clone());+ let first = Uuid::now_v7();+ let second = Uuid::now_v7();+ let project = SystemPropertyKey::PROJECT_UUID;+ set_task_reference(&pool, "task-b", project, &first.to_string(), "INITIATIVE").await?;+ set_task_reference(&pool, "task-a", project, &first.to_string(), "INITIATIVE").await?;+ set_task_reference(&pool, "moved", project, &first.to_string(), "INITIATIVE").await?;+ set_task_reference(&pool, "moved", project, &second.to_string(), "INITIATIVE").await?;+ set_task_reference(+ &pool,+ "elsewhere",+ project,+ &second.to_string(),+ "INITIATIVE",+ )+ .await?;+ // Another property referencing the project, and a non-project reference, are not+ // membership.+ set_task_reference(+ &pool,+ "companies",+ SystemPropertyKey::COMPANIES_UUID,+ &first.to_string(),+ "INITIATIVE",+ )+ .await?;+ set_task_reference(+ &pool,+ "not-a-project",+ project,+ &first.to_string(),+ "DOCUMENT",+ )+ .await?;++ assert_eq!(repo.project_task_ids(first).await?, ["task-a", "task-b"]);+ let mut projects = repo+ .task_projects(&[+ "task-a".to_string(),+ "moved".to_string(),+ "companies".to_string(),+ "not-a-project".to_string(),+ "unassigned".to_string(),+ ])+ .await?;+ projects.sort();+ assert_eq!(+ projects,+ [+ ("moved".to_string(), second.to_string()),+ ("task-a".to_string(), first.to_string()),+ ]+ );++ Ok(())+}diff --git a/docs/AGENT_GUIDE/ai-chat.md b/docs/AGENT_GUIDE/ai-chat.mdindex abd96bee68..eab3239e58 100644--- a/docs/AGENT_GUIDE/ai-chat.md+++ b/docs/AGENT_GUIDE/ai-chat.md@@ -7,17 +7,17 @@ lighter bubble with the normal text palette. Preview Markdown and controls at## Working with projects-Project tools can list, read, create, update, delete, and share projects; set or-clear task associations; and read project activity. Backend tool names use-`Initiative`. These operate on the native Projects views in Tasks.+Project tools can list, read, create, update, delete, and share projects, and+read project activity. Backend tool names use `Initiative`. These operate on the+native Projects views in Tasks. Agents set or clear a task's project with+`SetEntityProperty` on the task's `Project` property.Each completed tool row has an expandable result toggle, including empty resultsand per-task failures. Project chips open the native project. Shift-click opensanother split. **Result data** reveals the complete returned response. Successfulmutations refresh the project views.Deleting a project shows its result without a link to the deleted project.-Failed project deletions show `Not deleted`. Clearing projects from several tasks-reports each task's outcome, including partial failures.+Failed project deletions show `Not deleted`.## Phones with new agents enableddiff --git a/docs/AGENT_GUIDE/tasks.md b/docs/AGENT_GUIDE/tasks.mdindex 5adae17145..8674e1376b 100644--- a/docs/AGENT_GUIDE/tasks.md+++ b/docs/AGENT_GUIDE/tasks.md@@ -252,13 +252,17 @@ have description documents; older ones are ignored and stay hidden from documentsearch, history, and Soup lists.An unavailable connection shows `Retry description` without clearing saved content.+A task's project is its `Project` system property: one reference to the project,+set only on tasks. Setting it needs edit access to the task and the project;+removing it needs edit access to the task. The project's Tasks tab lists the+tasks whose Project property names the project.+The project's Tasks tab starts with the task search, controls, and unified list;the project title and property pills appear only on Overview. Use-`New task` to create a task associated with the project. The normal task row is-inserted into the query cache before the composer closes, including its selected-properties and project chip. It stays in its group while saving and assigning,-then uses the saved task ID. Failed creations or assignments roll back that row.-Verify this with GraphQL Soup both enabled and disabled. The section tabs+`New task` to create a task in the project: the create request carries the+Project property, so there is no separate assignment step. The new row appears+once the task is created. Verify this with GraphQL Soup both enabled and+disabled. The section tabsuse the same control as Channels. Editors can choose `Add existing tasks` beside`New task`, search for tasks, select several, and confirm `Add N tasks`. Tasksalready in this project are excluded. Adding a task moves it from its previous@@ -274,6 +278,8 @@ Inside an open task, use the Project pill below the title, the Project row inthe Properties side panel, or `Add to project…` in the title's actions menu.The property shows `No project` until assigned and stays read-only without editaccess. Choose `No project` in the assignment dialog to remove the association.+The Project property does not appear in the generic Properties list or the+`Add property` picker; these project controls set it.Discussion at the bottom of Overview uses the new discussions system. Commentsappear from oldest to newest, with the comment input below them. The Discussiondiff --git a/docs/INITIATIVES_PROJECTS_PLAN.md b/docs/INITIATIVES_PROJECTS_PLAN.mdindex 01a36a3560..9bb0ac141e 100644--- a/docs/INITIATIVES_PROJECTS_PLAN.md+++ b/docs/INITIATIVES_PROJECTS_PLAN.md@@ -120,6 +120,8 @@ The user request takes precedence over Linear differences: Macro Projects live u### Properties, permissions and membership+> **Update:** task membership is now the task's `Project` system property, not the `task_initiative` table and its assign/unassign APIs. Setting it needs edit access to the task and the project; clearing it needs edit access to the task. The membership findings and endpoints below describe the original plan.+1. Reuse Status, Priority, Assignees and Due Date system properties with initiative storage support. Keep one source of truth for values; list/detail projections may include a typed snapshot, not duplicate writable columns. Create applies the same defaults as tasks.2. Assignees represent responsibility. `memberIds` continues to represent existing collaborators with edit grants; assigning someone is not implemented by rewriting that collection. Any assignee-triggered sharing follows the existing task property's policy through its owning service.3. Proposed task association policy: editing the task and destination initiative permits assignment/movement. Source-project edit is not additionally required, so a task editor can move their task out of a project they can no longer edit. Removal requires task edit; the initiative-scoped removal endpoint also requires initiative edit. Expose task-side clear through the same domain use case. This is a proposed policy to implement and document, not a claim about today's behavior.diff --git a/packages/sdk/generated/storage/index.ts b/packages/sdk/generated/storage/index.tsindex 79e4ee0ab1..7048acdc6a 100644--- a/packages/sdk/generated/storage/index.ts+++ b/packages/sdk/generated/storage/index.ts@@ -1,4 +1,4 @@// This file is auto-generated by @hey-api/openapi-tsexport { type Options, Sdk } from './sdk.gen';-export type { AccessLevel, ActiveCallsResponse, ActiveCallSummary, ActiveMeeting, ActiveMeetingsResponse, ActivityType, AddFavoriteData, AddFavoriteError, AddFavoriteErrors, AddFavoriteRequest, AddFavoriteResponse, AddFavoriteResponses, AddParticipantsData, AddParticipantsError, AddParticipantsErrors, AddParticipantsRequest, AddParticipantsResponses, AddPinHandlerData, AddPinHandlerError, AddPinHandlerErrors, AddPinHandlerResponse, AddPinHandlerResponses, AddPinRequest, Agent, AgentActionId, AgentChannelScope, AgentMcpServer, AgentMcpServers, AgentPullRequestState, AgentSessionFilters, AgentSessionLifecycleEvent, Anchor, AnchorId, AnchorResponse, AnnotationIncrementalUpdate, ApiActivity, ApiAttachmentChannelReference, ApiAttachmentEntityReference, ApiAttachmentGenericReference, ApiChannelAttachment, ApiChannelAttachmentsPage, ApiChannelDetail, ApiChannelListMessage, ApiChannelListPage, ApiChannelListParticipant, ApiChannelListType, ApiChannelParticipant, ApiChannelWithLatest, ApiEntityFilterAst, ApiGroupByField, ApiGroupMeta, ApiParticipantListRole, ApiParticipantRole, ApiPropertyEntityType, ApplyDatabaseOpsData, ApplyDatabaseOpsError, ApplyDatabaseOpsErrors, ApplyDatabaseOpsResponse, ApplyDatabaseOpsResponses, ApplyOpsRequest, ApplyOpsResponse, ApproveHarnessPairingData, ApproveHarnessPairingError, ApproveHarnessPairingErrors, ApproveHarnessPairingResponse, ApproveHarnessPairingResponses, ApprovePairingRequest, AssignInitiativeTasksData, AssignInitiativeTasksError, AssignInitiativeTasksErrors, AssignInitiativeTasksResponse, AssignInitiativeTasksResponses, AssignTasksRequest, AssignTasksResponse, AssignTasksResult, AssignTaskStatus, AttachmentChange, AttendeeResponseStatus, Awareness, AwarenessRelay, BasicDocument, BasicDocumentSubType, BomPart, Bot, BotChannel, BotChannelType, BotId, BotKind, BotOwner, BotOwnerProfile, BotSenderProfile, BotToken, BranchNameResponse, BTreeMap, BulkWakeupRequest, BulkWakeupResponse, BulkWakeupSyncServiceDocumentsData, BulkWakeupSyncServiceDocumentsErrors, BulkWakeupSyncServiceDocumentsResponse, BulkWakeupSyncServiceDocumentsResponses, CalendarAttendee, CalendarEvent, CalendarEventFilters, CalendarEventSourceContent, CalendarMentionEvent, CalendarMentionPreviewItem, CalendarMentionPreviewKind, CalendarMentionPreviewRequest, CalendarMentionPreviewRequestItem, CalendarMentionPreviewResponse, CalendarOccurrence, CalendarOccurrenceItem, CalendarOccurrenceResponse, CalendarSyncStatus, CallActiveResponse, CallFilters, CallRecord, CallRecordGuest, CallRecordParticipant, CallRecordPreview, CallRecordPreviewData, CallRecordTranscriptSegment, CallStatus, CallTokenResponse, CallWebhookData, CallWebhookError, CallWebhookErrors, CallWebhookResponses, CancelSlackImportData, CancelSlackImportErrors, CancelSlackImportResponse, CancelSlackImportResponses, CardPosition, CastVerdict, CellValue, CellWrite, ChangedFileDto, ChangesetDto, ChangesetSourceDto, Channel, ChannelCreatedMetadata, ChannelDeletedMetadata, ChannelFilters, ChannelJoinCodeResponse, ChannelLabel, ChannelLabelRule, ChannelLabelsList, ChannelMessage, ChannelParticipant, ChannelParticipantAddedMetadata, ChannelParticipantRemovedMetadata, ChannelPreview, ChannelPreviewData, ChannelSender, ChannelSharePermission, ChannelThreadFilters, ChannelTopicEvent, ChannelType, ChannelUpdatedMetadata, ChannelWebhookRequest, ChannelWebhookResponse, ChannelWithParticipants, Chat, ChatFilters, CheckActiveCallData, CheckActiveCallError, CheckActiveCallErrors, CheckActiveCallResponse, CheckActiveCallResponses, ClaimedPairing, ClaimHarnessPairingData, ClaimHarnessPairingError, ClaimHarnessPairingErrors, ClaimHarnessPairingResponse, ClaimHarnessPairingResponses, ClaimPairingRequest, ClientOptions, CloudStorageItemType, CollabSurfaceResponse, CollabSurfaceTokenResponse, Column, ColumnCast, ColumnChange, ColumnChangeKind, ColumnConfig, ColumnConversion, ColumnConversionRequest, ColumnDetail, ColumnKind, ColumnResult, CommandFailure, CommandRejectedMetadata, CommittedChange, CompleteSlackImportUploadsData, CompleteSlackImportUploadsErrors, CompleteSlackImportUploadsResponse, CompleteSlackImportUploadsResponses, CompleteUploads, ConferenceProvider, Conjunction, ConversationId, ConversationKind, ConversationMetadata, ConversationProgress, ConversationSeal, ConversationStatus, ConvertDatabaseColumnData, ConvertDatabaseColumnError, ConvertDatabaseColumnErrors, ConvertDatabaseColumnResponse, ConvertDatabaseColumnResponses, ConvertedCell, CopyDocumentData, CopyDocumentError, CopyDocumentErrors, CopyDocumentQueryParams, CopyDocumentRequest, CopyDocumentResponse, CopyDocumentResponse2, CopyDocumentResponses, CountedReaction, CreateAgentData, CreateAgentError, CreateAgentErrors, CreateAgentRequest, CreateAgentResponse, CreateAgentResponses, CreateAnchorData, CreateAnchorError, CreateAnchorErrors, CreateAnchorResponse, CreateAnchorResponses, CreateBotRequest, CreateBulkDocumentResponse, CreateBulkDocumentResponseData, CreateChannelData, CreateChannelError, CreateChannelErrors, CreateChannelLabelData, CreateChannelLabelError, CreateChannelLabelErrors, CreateChannelLabelRequest, CreateChannelLabelResponse, CreateChannelLabelResponses, CreateChannelRequest, CreateChannelResponse, CreateChannelResponse2, CreateChannelResponses, CreateChannelScopedBotData, CreateChannelScopedBotError, CreateChannelScopedBotErrors, CreateChannelScopedBotRequest, CreateChannelScopedBotResponse, CreateChannelScopedBotResponse2, CreateChannelScopedBotResponses, CreateCollabSurfaceTokenData, CreateCollabSurfaceTokenError, CreateCollabSurfaceTokenErrors, CreateCollabSurfaceTokenResponse, CreateCollabSurfaceTokenResponses, CreateCrmCompanyData, CreateCrmCompanyError, CreateCrmCompanyErrors, CreateCrmCompanyRequest, CreateCrmCompanyResponse, CreateCrmCompanyResponses, CreateCrmContactData, CreateCrmContactError, CreateCrmContactErrors, CreateCrmContactRequest, CreateCrmContactResponse, CreateCrmContactResponses, CreateDatabaseData, CreateDatabaseError, CreateDatabaseErrors, CreateDatabaseRequest, CreateDatabaseResponse, CreateDatabaseResponses, CreateDocumentData, CreateDocumentError, CreateDocumentErrors, CreateDocumentRequest, CreateDocumentResponse, CreateDocumentResponseData, CreateDocumentResponses, CreatedPairing, CreatedUserApiKey, CreateEntityMentionData, CreateEntityMentionError, CreateEntityMentionErrors, CreateEntityMentionRequest, CreateEntityMentionResponse, CreateEntityMentionResponse2, CreateEntityMentionResponses, CreateHarnessPairingData, CreateHarnessPairingError, CreateHarnessPairingErrors, CreateHarnessPairingResponse, CreateHarnessPairingResponses, CreateImport, CreateInitiativeData, CreateInitiativeError, CreateInitiativeErrors, CreateInitiativeRequest, CreateInitiativeResponse, CreateInitiativeResponses, CreateInstructionsDocumentResponse, CreateInstructionsHandlerData, CreateInstructionsHandlerError, CreateInstructionsHandlerErrors, CreateInstructionsHandlerResponse, CreateInstructionsHandlerResponses, CreateMarkdownDocumentRequest, CreateMarkdownDocumentResponse, CreateMarkdownHandlerData, CreateMarkdownHandlerError, CreateMarkdownHandlerErrors, CreateMarkdownHandlerResponse, CreateMarkdownHandlerResponses, CreateMeetingRequest, CreatePairingRequest, CreateProjectHandlerData, CreateProjectHandlerError, CreateProjectHandlerErrors, CreateProjectHandlerResponse, CreateProjectHandlerResponses, CreateProjectRequest, CreateProjectResponse, CreateReminderData, CreateReminderError, CreateReminderErrors, CreateReminderRequest, CreateReminderResponse, CreateReminderResponses, CreateSkillHandlerData, CreateSkillHandlerError, CreateSkillHandlerErrors, CreateSkillHandlerResponse, CreateSkillHandlerResponses, CreateSkillRequest, CreateSkillResponse, CreateSlackImportData, CreateSlackImportErrors, CreateSlackImportResponse, CreateSlackImportResponses, CreateSnippetHandlerData, CreateSnippetHandlerError, CreateSnippetHandlerErrors, CreateSnippetHandlerResponse, CreateSnippetHandlerResponses, CreateSnippetRequest, CreateSnippetResponse, CreateTaskHandlerData, CreateTaskHandlerError, CreateTaskHandlerErrors, CreateTaskHandlerResponse, CreateTaskHandlerResponses, CreateTaskRequest, CreateTaskResponse, CreateToken, CreateUnthreadedAnchorRequest, CreateUnthreadedAnchorResponse, CreateUnthreadedPdfAnchorRequest, CreateUserApiKeyData, CreateUserApiKeyError, CreateUserApiKeyErrors, CreateUserApiKeyRequest, CreateUserApiKeyResponse, CreateUserApiKeyResponses, CreateViewHandlerData, CreateViewHandlerError, CreateViewHandlerErrors, CreateViewHandlerResponse, CreateViewHandlerResponses, CreateViewRequest, CreateWebhookData, CreateWebhookError, CreateWebhookErrors, CreateWebhookRequest, CreateWebhookResponse, CreateWebhookResponse2, CreateWebhookResponses, CrmCompanyFilters, CrmCompanyResponse, CrmContactResponse, CrmDomainResponse, CrmPermissionRole, CrmStageInput, CrmStageResponse, CrmStagesResponse, CrmTeamSettingsResponse, CustomSpeakerAssignment, Database, DatabaseDetail, DatabaseOp, DatabaseView, DataType, DateOperator, DeleteAnchorData, DeleteAnchorError, DeleteAnchorErrors, DeleteAnchorResponse, DeleteAnchorResponses, DeleteCallRecordData, DeleteCallRecordError, DeleteCallRecordErrors, DeleteCallRecordResponse, DeleteCallRecordResponses, DeleteChannelData, DeleteChannelError, DeleteChannelErrors, DeleteChannelLabelData, DeleteChannelLabelError, DeleteChannelLabelErrors, DeleteChannelLabelResponse, DeleteChannelLabelResponses, DeleteChannelResponse, DeleteChannelResponses, DeleteCollabSurfaceData, DeleteCollabSurfaceError, DeleteCollabSurfaceErrors, DeleteCollabSurfaceResponse, DeleteCollabSurfaceResponses, DeleteDocumentData, DeleteDocumentError, DeleteDocumentErrors, DeleteDocumentResponse, DeleteDocumentResponses, DeleteEntityMentionData, DeleteEntityMentionError, DeleteEntityMentionErrors, DeleteEntityMentionResponse, DeleteEntityMentionResponse2, DeleteEntityMentionResponses, DeleteHarnessData, DeleteHarnessError, DeleteHarnessErrors, DeleteHarnessResponse, DeleteHarnessResponses, DeleteHistoryHandlerData, DeleteHistoryHandlerError, DeleteHistoryHandlerErrors, DeleteHistoryHandlerResponse, DeleteHistoryHandlerResponses, DeleteInitiativeData, DeleteInitiativeError, DeleteInitiativeErrors, DeleteInitiativeResponse, DeleteInitiativeResponses, DeleteProjectHandlerData, DeleteProjectHandlerError, DeleteProjectHandlerErrors, DeleteProjectHandlerResponse, DeleteProjectHandlerResponses, DeleteReminderData, DeleteReminderError, DeleteReminderErrors, DeleteReminderResponse, DeleteReminderResponses, DeleteSelfHarnessData, DeleteSelfHarnessError, DeleteSelfHarnessErrors, DeleteSelfHarnessResponse, DeleteSelfHarnessResponses, DeleteUnthreadedAnchorRequest, DeleteUnthreadedAnchorResponse, DeleteUnthreadedPdfAnchorRequest, DeleteUserApiKeyData, DeleteUserApiKeyError, DeleteUserApiKeyErrors, DeleteUserApiKeyResponse, DeleteUserApiKeyResponses, DeleteUserDocumentViewLocationData, DeleteUserDocumentViewLocationError, DeleteUserDocumentViewLocationErrors, DeleteUserDocumentViewLocationResponse, DeleteUserDocumentViewLocationResponses, DeleteViewHandlerData, DeleteViewHandlerError, DeleteViewHandlerErrors, DeleteViewHandlerResponses, DeleteWebhookData, DeleteWebhookError, DeleteWebhookErrors, DeleteWebhookResponse, DeleteWebhookResponses, DocumentBasic, DocumentContent, DocumentContentLocation, DocumentContentState, DocumentContentUploadedMetadata, DocumentCopiedMetadata, DocumentCreatedMetadata, DocumentDeletedMetadata, DocumentFilters, DocumentId, DocumentInteractionMetadata, DocumentMetadata, DocumentMetadataWithContent, DocumentPermissionsToken, DocumentPermissionsTokenRequest, DocumentPermissionsTokenResponse, DocumentPreview, DocumentPreviewData, DocumentPreviewDataSubType, DocumentPurgedMetadata, DocumentResponse, DocumentResponseMetadata, DocumentResponseMetadataWithContent, DocumentStorageServiceApiVersion, DocumentSubType, DocumentSyncContentUpdatedMetadata, DocumentSyncEditor, DocumentTeamShareResponse, DocumentTopicEvent, DocumentUpdatedMetadata, EditAnchorData, EditAnchorError, EditAnchorErrors, EditAnchorRequest, EditAnchorResponse, EditAnchorResponse2, EditAnchorResponses, EditCallRecordData, EditCallRecordError, EditCallRecordErrors, EditCallRecordRequest, EditCallRecordResponse, EditCallRecordResponses, EditCallTranscriptData, EditCallTranscriptError, EditCallTranscriptErrors, EditCallTranscriptRequest, EditCallTranscriptResponse, EditCallTranscriptResponses, EditDocumentData, EditDocumentError, EditDocumentErrors, EditDocumentResponse, EditDocumentResponse2, EditDocumentResponses, EditDocumentServiceArgs, EditPdfAnchorRequest, EditPdfPlaceableCommentAnchorRequest, EditProjectV2Data, EditProjectV2Error, EditProjectV2Errors, EditProjectV2Response, EditProjectV2Responses, EditThreadV2Data, EditThreadV2Error, EditThreadV2Errors, EditThreadV2Response, EditThreadV2Responses, EmailFilters, EmailFollowup, EmailFollowupCommand, EmailFollowupResponse, EmailReminderCondition, EmailReminderPage, EmailReminderSummary, EmptyResponse, EnsureCollabSurfaceData, EnsureCollabSurfaceError, EnsureCollabSurfaceErrors, EnsureCollabSurfaceRequest, EnsureCollabSurfaceResponse, EnsureCollabSurfaceResponses, EnsureStarterHandlerData, EnsureStarterHandlerErrors, EnsureStarterHandlerResponse, EnsureStarterHandlerResponses, EntityFilters, EntityKind, EntityMessageCreateData, EntityMessageCreateResponse, EntityMessageCreateResponses, EntityMessageDeleteMessageData, EntityMessageDeleteMessageResponse, EntityMessageDeleteMessageResponses, EntityMessageDeleteThreadData, EntityMessageDeleteThreadResponse, EntityMessageDeleteThreadResponses, EntityMessageEditData, EntityMessageEditResponse, EntityMessageEditResponses, EntityMessageGetMessageData, EntityMessageGetMessageResponse, EntityMessageGetMessageResponses, EntityMessageGetThreadData, EntityMessageGetThreadResponse, EntityMessageGetThreadResponses, EntityMessageLegacyData, EntityMessageLegacyResponse, EntityMessageLegacyResponses, EntityMessagePatchThreadData, EntityMessagePatchThreadResponse, EntityMessagePatchThreadResponses, EntityMessageReactData, EntityMessageReactResponse, EntityMessageReactResponses, EntityMessageTypingData, EntityMessageTypingResponse, EntityMessageTypingResponses, EntityPermission, EntityPermissionResponse, EntityRef, EntityReference, EntityType, ErrorResponse, EventReminderOverride, EventReminders, EventStatus, EventTime, EventTransparency, EventType, EventVisibility, ExcludedDefaultView, ExcludeDefaultViewHandlerData, ExcludeDefaultViewHandlerError, ExcludeDefaultViewHandlerErrors, ExcludeDefaultViewHandlerResponses, ExcludeDefaultViewRequest, ExportDocumentData, ExportDocumentError, ExportDocumentErrors, ExportDocumentResponse, ExportDocumentResponse2, ExportDocumentResponses, Favorite, FavoriteEntityRef, FavoritesList, FileChangeKindDto, FileSystemNodeWithIds, FileType, FileTypeUpdate, FilterCondition, FilterGroup, FilterNode, FilterTest, FinalizeSlackImportData, FinalizeSlackImportErrors, FinalizeSlackImportResponse, FinalizeSlackImportResponses, FolderItem, FollowupState, ForeignEntity, ForeignEntityFilters, GenericErrorResponse, GenericResponse, GenericSuccessResponse, GetActiveCallsData, GetActiveCallsError, GetActiveCallsErrors, GetActiveCallsResponse, GetActiveCallsResponses, GetActivityData, GetActivityError, GetActivityErrors, GetActivityResponse, GetActivityResponses, GetAttachmentReferencesData, GetAttachmentReferencesError, GetAttachmentReferencesErrors, GetAttachmentReferencesResponse, GetAttachmentReferencesResponse2, GetAttachmentReferencesResponses, GetBatchCallRecordPreviewData, GetBatchCallRecordPreviewError, GetBatchCallRecordPreviewErrors, GetBatchCallRecordPreviewRequest, GetBatchCallRecordPreviewResponse, GetBatchCallRecordPreviewResponse2, GetBatchCallRecordPreviewResponses, GetBatchChannelPreviewData, GetBatchChannelPreviewError, GetBatchChannelPreviewErrors, GetBatchChannelPreviewRequest, GetBatchChannelPreviewResponse, GetBatchChannelPreviewResponse2, GetBatchChannelPreviewResponses, GetBatchPreviewHandlerData, GetBatchPreviewHandlerError, GetBatchPreviewHandlerErrors, GetBatchPreviewHandlerResponse, GetBatchPreviewHandlerResponses, GetBatchPreviewRequest, GetBatchPreviewResponse, GetBatchProjectPreviewData, GetBatchProjectPreviewError, GetBatchProjectPreviewErrors, GetBatchProjectPreviewRequest, GetBatchProjectPreviewResponse, GetBatchProjectPreviewResponse2, GetBatchProjectPreviewResponses, GetBotOwnerProfilesData, GetBotOwnerProfilesError, GetBotOwnerProfilesErrors, GetBotOwnerProfilesResponse, GetBotOwnerProfilesResponses, GetCallRecordData, GetCallRecordError, GetCallRecordErrors, GetCallRecordResponse, GetCallRecordResponses, GetChannelAttachmentsData, GetChannelAttachmentsError, GetChannelAttachmentsErrors, GetChannelAttachmentsResponse, GetChannelAttachmentsResponses, GetChannelData, GetChannelError, GetChannelErrors, GetChannelJoinLinkData, GetChannelJoinLinkError, GetChannelJoinLinkErrors, GetChannelJoinLinkResponse, GetChannelJoinLinkResponses, GetChannelParticipantsData, GetChannelParticipantsError, GetChannelParticipantsErrors, GetChannelParticipantsResponse, GetChannelParticipantsResponses, GetChannelResponse, GetChannelResponses, GetChannelsData, GetChannelsError, GetChannelsErrors, GetChannelsResponse, GetChannelsResponses, GetCollabSurfaceData, GetCollabSurfaceError, GetCollabSurfaceErrors, GetCollabSurfaceResponse, GetCollabSurfaceResponses, GetCompanyData, GetCompanyError, GetCompanyErrors, GetCompanyResponse, GetCompanyResponses, GetContactByEmailData, GetContactByEmailError, GetContactByEmailErrors, GetContactByEmailResponse, GetContactByEmailResponse2, GetContactByEmailResponses, GetContactData, GetContactError, GetContactErrors, GetContactResponse, GetContactResponses, GetCrmTeamSettingsData, GetCrmTeamSettingsError, GetCrmTeamSettingsErrors, GetCrmTeamSettingsResponse, GetCrmTeamSettingsResponses, GetDatabaseData, GetDatabaseError, GetDatabaseErrors, GetDatabasePermissionsData, GetDatabasePermissionsError, GetDatabasePermissionsErrors, GetDatabasePermissionsResponse, GetDatabasePermissionsResponses, GetDatabaseQueryData, GetDatabaseQueryError, GetDatabaseQueryErrors, GetDatabaseQueryResponse, GetDatabaseQueryResponses, GetDatabaseResponse, GetDatabaseResponses, GetDatabaseRowHistoryData, GetDatabaseRowHistoryError, GetDatabaseRowHistoryErrors, GetDatabaseRowHistoryResponse, GetDatabaseRowHistoryResponses, GetDatabaseTableChangesData, GetDatabaseTableChangesError, GetDatabaseTableChangesErrors, GetDatabaseTableChangesResponse, GetDatabaseTableChangesResponses, GetDatabaseViewPositionsData, GetDatabaseViewPositionsError, GetDatabaseViewPositionsErrors, GetDatabaseViewPositionsResponse, GetDatabaseViewPositionsResponses, GetDocumentAnchorsData, GetDocumentAnchorsError, GetDocumentAnchorsErrors, GetDocumentAnchorsResponse, GetDocumentAnchorsResponses, GetDocumentBranchNameData, GetDocumentBranchNameError, GetDocumentBranchNameErrors, GetDocumentBranchNameResponse, GetDocumentBranchNameResponses, GetDocumentByTeamSlugData, GetDocumentByTeamSlugError, GetDocumentByTeamSlugErrors, GetDocumentByTeamSlugResponse, GetDocumentByTeamSlugResponses, GetDocumentData, GetDocumentError, GetDocumentErrors, GetDocumentGithubPullRequestsData, GetDocumentGithubPullRequestsError, GetDocumentGithubPullRequestsErrors, GetDocumentGithubPullRequestsResponse, GetDocumentGithubPullRequestsResponses, GetDocumentKeyResponse, GetDocumentKeyResponseData, GetDocumentListHandlerData, GetDocumentListHandlerError, GetDocumentListHandlerErrors, GetDocumentListHandlerResponse, GetDocumentListHandlerResponses, GetDocumentListResult, GetDocumentLocationV3Data, GetDocumentLocationV3Error, GetDocumentLocationV3Errors, GetDocumentLocationV3Response, GetDocumentLocationV3Responses, GetDocumentPermissionsResponseDataV2, GetDocumentPermissionsTokenData, GetDocumentPermissionsTokenError, GetDocumentPermissionsTokenErrors, GetDocumentPermissionsTokenResponse, GetDocumentPermissionsTokenResponses, GetDocumentPermissionsV2Data, GetDocumentPermissionsV2Error, GetDocumentPermissionsV2Errors, GetDocumentPermissionsV2Response, GetDocumentPermissionsV2Responses, GetDocumentProcessingResult, GetDocumentProcessingResultData, GetDocumentProcessingResultError, GetDocumentProcessingResultErrors, GetDocumentProcessingResultResponse, GetDocumentProcessingResultResponse2, GetDocumentProcessingResultResponses, GetDocumentResponse, GetDocumentResponse2, GetDocumentResponseData, GetDocumentResponses, GetDocumentSearchResponse, GetDocumentShortIdData, GetDocumentShortIdError, GetDocumentShortIdErrors, GetDocumentShortIdResponse, GetDocumentShortIdResponses, GetDocumentsResponse, GetDocumentTeamShareData, GetDocumentTeamShareError, GetDocumentTeamShareErrors, GetDocumentTeamShareResponse, GetDocumentTeamShareResponses, GetDocumentUserAccessLevelResponse, GetDocumentVersionData, GetDocumentVersionError, GetDocumentVersionErrors, GetDocumentVersionResponse, GetDocumentVersionResponses, GetDocumentViewsHandlerData, GetDocumentViewsHandlerError, GetDocumentViewsHandlerErrors, GetDocumentViewsHandlerResponse, GetDocumentViewsHandlerResponses, GetEmailFollowupData, GetEmailFollowupError, GetEmailFollowupErrors, GetEmailFollowupResponse, GetEmailFollowupResponses, GetEntityPermissionData, GetEntityPermissionErrors, GetEntityPermissionResponse, GetEntityPermissionResponses, GetForeignEntityBySourceData, GetForeignEntityBySourceError, GetForeignEntityBySourceErrors, GetForeignEntityBySourceResponse, GetForeignEntityBySourceResponses, GetForeignEntityData, GetForeignEntityError, GetForeignEntityErrors, GetForeignEntityResponse, GetForeignEntityResponses, GetGithubPullRequestChangesData, GetGithubPullRequestChangesError, GetGithubPullRequestChangesErrors, GetGithubPullRequestChangesPatchData, GetGithubPullRequestChangesPatchError, GetGithubPullRequestChangesPatchErrors, GetGithubPullRequestChangesPatchResponse, GetGithubPullRequestChangesPatchResponses, GetGithubPullRequestChangesResponse, GetGithubPullRequestChangesResponses, GetGithubPullRequestData, GetGithubPullRequestError, GetGithubPullRequestErrors, GetGithubPullRequestFacetsData, GetGithubPullRequestFacetsError, GetGithubPullRequestFacetsErrors, GetGithubPullRequestFacetsResponse, GetGithubPullRequestFacetsResponses, GetGithubPullRequestResponse, GetGithubPullRequestResponses, GetHarnessPairingData, GetHarnessPairingError, GetHarnessPairingErrors, GetHarnessPairingResponse, GetHarnessPairingResponses, GetHistoryHandlerData, GetHistoryHandlerError, GetHistoryHandlerErrors, GetHistoryHandlerResponse, GetHistoryHandlerResponses, GetInitiativeData, GetInitiativeError, GetInitiativeErrors, GetInitiativeResponse, GetInitiativeResponses, GetInstructionsDocumentResponse, GetInstructionsHandlerData, GetInstructionsHandlerError, GetInstructionsHandlerErrors, GetInstructionsHandlerResponse, GetInstructionsHandlerResponses, GetItemsSoupData, GetItemsSoupError, GetItemsSoupErrors, GetItemsSoupResponse, GetItemsSoupResponses, GetLocationHandlerData, GetLocationHandlerError, GetLocationHandlerErrors, GetLocationHandlerResponse, GetLocationHandlerResponses, GetOrCreateAction, GetOrCreateCallData, GetOrCreateCallError, GetOrCreateCallErrors, GetOrCreateCallResponse, GetOrCreateCallResponses, GetOrCreateChannelResponse, GetOrCreateDmData, GetOrCreateDmError, GetOrCreateDmErrors, GetOrCreateDmRequest, GetOrCreateDmResponse, GetOrCreateDmResponses, GetOrCreatePrivateData, GetOrCreatePrivateError, GetOrCreatePrivateErrors, GetOrCreatePrivateRequest, GetOrCreatePrivateResponse, GetOrCreatePrivateResponses, GetPendingProjectsHandlerData, GetPendingProjectsHandlerError, GetPendingProjectsHandlerErrors, GetPendingProjectsHandlerResponse, GetPendingProjectsHandlerResponses, GetPinsHandlerData, GetPinsHandlerError, GetPinsHandlerErrors, GetPinsHandlerResponse, GetPinsHandlerResponses, GetPinsResponse, GetProjectContentHandlerData, GetProjectContentHandlerError, GetProjectContentHandlerErrors, GetProjectContentHandlerResponse, GetProjectContentHandlerResponses, GetProjectContentResponse, GetProjectHandlerData, GetProjectHandlerError, GetProjectHandlerErrors, GetProjectHandlerResponse, GetProjectHandlerResponses, GetProjectPermissionsV2Data, GetProjectPermissionsV2Error, GetProjectPermissionsV2Errors, GetProjectPermissionsV2Response, GetProjectPermissionsV2Responses, GetProjectResponse, GetProjectResponseData, GetProjectsHandlerData, GetProjectsHandlerError, GetProjectsHandlerErrors, GetProjectsHandlerResponse, GetProjectsHandlerResponses, GetProjectsResponse, GetProjectUserAccessLevelData, GetProjectUserAccessLevelError, GetProjectUserAccessLevelErrors, GetProjectUserAccessLevelResponse, GetProjectUserAccessLevelResponses, GetReminderData, GetReminderError, GetReminderErrors, GetReminderResponse, GetReminderResponses, GetRingStatusData, GetRingStatusError, GetRingStatusErrors, GetRingStatusResponse, GetRingStatusResponses, GetSelfBotData, GetSelfBotError, GetSelfBotErrors, GetSelfBotResponse, GetSelfBotResponses, GetSelfHarnessData, GetSelfHarnessError, GetSelfHarnessErrors, GetSelfHarnessResponse, GetSelfHarnessResponses, GetSlackImportData, GetSlackImportErrors, GetSlackImportResponse, GetSlackImportResponses, GetSystemSkillsHandlerData, GetSystemSkillsHandlerError, GetSystemSkillsHandlerErrors, GetSystemSkillsHandlerResponse, GetSystemSkillsHandlerResponses, GetUserDocumentsHandlerData, GetUserDocumentsHandlerError, GetUserDocumentsHandlerErrors, GetUserDocumentsHandlerResponse, GetUserDocumentsHandlerResponses, GetUserDocumentViewLocationData, GetUserDocumentViewLocationError, GetUserDocumentViewLocationErrors, GetUserDocumentViewLocationResponse, GetUserDocumentViewLocationResponses, GetUserHistoryResponse, GetViewsHandlerData, GetViewsHandlerError, GetViewsHandlerErrors, GetViewsHandlerResponse, GetViewsHandlerResponses, GetWebhookData, GetWebhookError, GetWebhookErrors, GetWebhookResponse, GetWebhookResponses, GithubLabelFacet, GithubPullRequest, GithubPullRequestChangesPatchResponse, GithubPullRequestChangesResponse, GithubPullRequestCheckRun, GithubPullRequestComment, GithubPullRequestFacets, GithubPullRequestLabel, GithubPullRequestReview, GithubPullRequestReviewDecision, GithubPullRequestReviewState, GithubPullRequestsResponse, GithubPullRequestUser, GithubRepositoryFacet, GithubUserFacet, GitRefDto, GroupedInitialParams, GroupedPageParams, GroupedSoupGroupPage, GroupedSoupInitialPage, GroupedSoupPage, GroupedSoupSort, GuestId, GuestJoinRequest, HandlerData, HandlerError, HandlerErrors, HandlerResponse, HandlerResponses, Harness, HarnessAgent, HarnessId, HarnessOwner, HarnessSession, HashMap, HealthHandlerData, HealthHandlerResponse, HealthHandlerResponses, HighlightType, ImportCounters, ImportDatabaseTableData, ImportDatabaseTableError, ImportDatabaseTableErrors, ImportDatabaseTableResponse, ImportDatabaseTableResponses, ImportedAuthor, ImportError, ImportLimits, ImportPage, ImportProgress, ImportTable, ImportWarning, InferColumnTypeOutcome, InferColumnTypeRequest, InferDatabaseColumnTypeData, InferDatabaseColumnTypeError, InferDatabaseColumnTypeErrors, InferDatabaseColumnTypeResponse, InferDatabaseColumnTypeResponses, InFlightTurnSummary, IngestTranscriptData, IngestTranscriptError, IngestTranscriptErrors, IngestTranscriptResponses, InitializeUserDocumentsData, InitializeUserDocumentsError, InitializeUserDocumentsErrors, InitializeUserDocumentsResponse, InitializeUserDocumentsResponses, InitialPropertyValue, InitiativeDetail, InitiativeFilters, InitiativeId, InitiativeList, InitiativeSummary, InputReceivedMetadata, InstallSyncData, InstallSyncErrors, InteractionReason, InviteMeetingRequest, InviteMeetingUsersRequest, Item, ItemWithUserAccessLevel, JobId, JobProcessingResultHandlerData, JobProcessingResultHandlerError, JobProcessingResultHandlerErrors, JobProcessingResultHandlerResponse, JobProcessingResultHandlerResponses, JobStatus, JoinChannelByCodeData, JoinChannelByCodeError, JoinChannelByCodeErrors, JoinChannelByCodeResponses, JoinChannelData, JoinChannelError, JoinChannelErrors, JoinChannelResponses, KeySegment, Lane, LaneKey, LatestMessage, LeaveCallResponse, LeaveChannelData, LeaveChannelError, LeaveChannelErrors, LeaveChannelResponses, LeaveOrEndCallData, LeaveOrEndCallError, LeaveOrEndCallErrors, LeaveOrEndCallResponse, LeaveOrEndCallResponses, LinkShare, ListAgentsData, ListAgentsError, ListAgentsErrors, ListAgentsResponse, ListAgentsResponses, ListBotChannelsData, ListBotChannelsError, ListBotChannelsErrors, ListBotChannelsResponse, ListBotChannelsResponses, ListChannelLabelsData, ListChannelLabelsError, ListChannelLabelsErrors, ListChannelLabelsResponse, ListChannelLabelsResponses, ListCompanyContactsData, ListCompanyContactsError, ListCompanyContactsErrors, ListCompanyContactsResponse, ListCompanyContactsResponses, ListDatabaseColumnCastsData, ListDatabaseColumnCastsError, ListDatabaseColumnCastsErrors, ListDatabaseColumnCastsResponse, ListDatabaseColumnCastsResponses, ListDatabasesData, ListDatabasesError, ListDatabasesErrors, ListDatabasesResponse, ListDatabasesResponses, ListedDatabase, ListEmailRemindersData, ListEmailRemindersError, ListEmailRemindersErrors, ListEmailRemindersResponse, ListEmailRemindersResponses, ListFavoritesData, ListFavoritesError, ListFavoritesErrors, ListFavoritesResponse, ListFavoritesResponses, ListHarnessAgentsData, ListHarnessAgentsError, ListHarnessAgentsErrors, ListHarnessAgentsResponse, ListHarnessAgentsResponses, ListHarnessesData, ListHarnessesError, ListHarnessesErrors, ListHarnessesResponse, ListHarnessesResponses, ListHarnessSessionsData, ListHarnessSessionsError, ListHarnessSessionsErrors, ListHarnessSessionsResponse, ListHarnessSessionsResponses, ListInitiativesData, ListInitiativesError, ListInitiativesErrors, ListInitiativesResponse, ListInitiativesResponses, ListOccurrencesData, ListOccurrencesErrors, ListOccurrencesResponse, ListOccurrencesResponses, ListReminderCollectionData, ListReminderCollectionError, ListReminderCollectionErrors, ListReminderCollectionResponse, ListReminderCollectionResponses, ListRemindersData, ListRemindersError, ListRemindersErrors, ListRemindersResponse, ListRemindersResponses, ListSlackImportsData, ListSlackImportsResponse, ListSlackImportsResponses, ListTeamOutOfOfficeData, ListTeamOutOfOfficeErrors, ListTeamOutOfOfficeResponse, ListTeamOutOfOfficeResponses, ListUserApiKeysData, ListUserApiKeysError, ListUserApiKeysErrors, ListUserApiKeysResponse, ListUserApiKeysResponses, ListWebhooksData, ListWebhooksError, ListWebhooksErrors, ListWebhooksResponse, ListWebhooksResponse2, ListWebhooksResponses, LocationResponseData, LocationResponseV3, MacroUserIdStr, Meeting, MeetingCancelData, MeetingCancelError, MeetingCancelErrors, MeetingCancelPreparationData, MeetingCancelPreparationError, MeetingCancelPreparationErrors, MeetingCancelPreparationResponse, MeetingCancelPreparationResponses, MeetingCancelResponse, MeetingCancelResponses, MeetingCreateData, MeetingCreateError, MeetingCreateErrors, MeetingCreateResponse, MeetingCreateResponses, MeetingGuestJoinData, MeetingGuestJoinError, MeetingGuestJoinErrors, MeetingGuestJoinResponse, MeetingGuestJoinResponses, MeetingGuestParticipantsData, MeetingGuestParticipantsError, MeetingGuestParticipantsErrors, MeetingGuestParticipantsResponse, MeetingGuestParticipantsResponses, MeetingInviteData, MeetingInviteError, MeetingInviteErrors, MeetingInvitePermissions, MeetingInvitePermissionsData, MeetingInvitePermissionsError, MeetingInvitePermissionsErrors, MeetingInvitePermissionsResponse, MeetingInvitePermissionsResponses, MeetingInviteResponse, MeetingInviteResponses, MeetingInviteUsersData, MeetingInviteUsersError, MeetingInviteUsersErrors, MeetingInviteUsersResponse, MeetingInviteUsersResponses, MeetingJoinData, MeetingJoinError, MeetingJoinErrors, MeetingJoinResponse, MeetingJoinResponses, MeetingLeaveData, MeetingLeaveError, MeetingLeaveErrors, MeetingLeaveResponse, MeetingLeaveResponses, MeetingListActiveData, MeetingListActiveError, MeetingListActiveErrors, MeetingListActiveResponse, MeetingListActiveResponses, MeetingListData, MeetingListError, MeetingListErrors, MeetingListResponse, MeetingListResponses, MeetingLookupData, MeetingLookupError, MeetingLookupErrors, MeetingLookupResponse, MeetingLookupResponses, MeetingParticipant, MeetingParticipants, MeetingParticipantsData, MeetingParticipantsError, MeetingParticipantsErrors, MeetingParticipantsResponse, MeetingParticipantsResponses, MeetingPreparation, MeetingPrepareData, MeetingPrepareError, MeetingPrepareErrors, MeetingPrepareResponse, MeetingPrepareResponses, MeetingShareData, MeetingShareError, MeetingShareErrors, MeetingShareResponse, MeetingShareResponses, MeetingsResponse, MeetingToken, MeetingUpdateData, MeetingUpdateError, MeetingUpdateErrors, MeetingUpdateResponse, MeetingUpdateResponses, MentionPreviewsData, MentionPreviewsErrors, MentionPreviewsResponse, MentionPreviewsResponses, Message, MessageAttachment, MessageAttachmentCreatedMetadata, MessageAttachmentRemovedMetadata, MessageChange, MessageCursor, MessageDeletedMetadata, MessageDirection, MessageEvent, MessageEventAttachment, MessageListItem, MessageMentionedMetadata, MessagePage, MessageParent, MessagePatch, MessagePatchedMetadata, MessagePostedMetadata, MessageThread, MessageThreadPreview, MessageTimelineData, MessageTimelineQuery, MessageTimelineResponse, MessageTimelineResponses, MessageTopicEvent, NewAttachment, NewColumn, NewOption, NewThreadAnchor, NewView, NotificationFilters, NotificationState, NumberOperator, OpRefusalResponse, OpResult, OptionRef, PairingDetails, Params, ParticipantRole, PatchBotRequest, PatchChannelData, PatchChannelError, PatchChannelErrors, PatchChannelRequest, PatchChannelResponse, PatchChannelResponses, PatchMessageNotificationPolicy, PatchProjectRequestV2, PatchThreadRequestV2, PatchViewHandlerData, PatchViewHandlerError, PatchViewHandlerErrors, PatchViewHandlerResponses, PatchWebhookData, PatchWebhookError, PatchWebhookErrors, PatchWebhookRequest, PatchWebhookResponse, PatchWebhookResponses, PdfAnchor, PdfAnchorId, PdfHighlightAnchor, PdfHighlightAnchorRequest, PdfHighlightRect, PdfHighlightRectAnchorRequest, PdfPlaceableCommentAnchor, PendingClaimResponse, PermanentlyDeleteDocumentData, PermanentlyDeleteDocumentError, PermanentlyDeleteDocumentErrors, PermanentlyDeleteDocumentResponse, PermanentlyDeleteDocumentResponses, PermanentlyDeleteProjectData, PermanentlyDeleteProjectError, PermanentlyDeleteProjectErrors, PermanentlyDeleteProjectResponse, PermanentlyDeleteProjectResponses, PinnedItem, PinRequest, PostActivityData, PostActivityError, PostActivityErrors, PostActivityRequest, PostActivityResponse, PostActivityResponses, PostChannelBotWebhookData, PostChannelBotWebhookError, PostChannelBotWebhookErrors, PostChannelBotWebhookResponse, PostChannelBotWebhookResponses, PostGroupedSoupAstGroupPageRequest, PostGroupedSoupAstInitialRequest, PostGroupedSoupAstRequest, PostItemsSoupAstData, PostItemsSoupAstError, PostItemsSoupAstErrors, PostItemsSoupAstGroupedData, PostItemsSoupAstGroupedError, PostItemsSoupAstGroupedErrors, PostItemsSoupAstGroupedResponse, PostItemsSoupAstGroupedResponses, PostItemsSoupAstResponse, PostItemsSoupAstResponses, PostItemsSoupData, PostItemsSoupError, PostItemsSoupErrors, PostItemsSoupResponse, PostItemsSoupResponses, PostMessage, PostMessageNotificationPolicy, PostSoupAstRequest, PostSoupRequest, PresaveDocumentHandlerData, PresaveDocumentHandlerError, PresaveDocumentHandlerErrors, PresaveDocumentHandlerResponse, PresaveDocumentHandlerResponses, PreSaveDocumentRequest, PreSaveDocumentResponse, PreSaveDocumentResponseData, PresenceOperator, PresignedUrl, PreviewSmartTagData, PreviewSmartTagError, PreviewSmartTagErrors, PreviewSmartTagResponse, PreviewSmartTagResponses, Project, ProjectDeleteResponseData, ProjectDocumentStatus, ProjectFilters, ProjectPreview, ProjectPreviewData, PropertyDefinition, PropertyDefinitionWithOptions, PropertyFilter, PropertyInput, PropertyOption, PropertyOptionValue, PropertyOwner, PropertyValue, PutCrmTeamSettingsData, PutCrmTeamSettingsError, PutCrmTeamSettingsErrors, PutCrmTeamSettingsResponse, PutCrmTeamSettingsResponses, PutCrmTeamStagesData, PutCrmTeamStagesError, PutCrmTeamStagesErrors, PutCrmTeamStagesResponse, PutCrmTeamStagesResponses, QueryDefinition, ReactionInput, RecentlyDeletedData, RecentlyDeletedError, RecentlyDeletedErrors, RecentlyDeletedResponse, RecentlyDeletedResponseData, RecentlyDeletedResponses, RegisterSlackImportUploadsData, RegisterSlackImportUploadsErrors, RegisterSlackImportUploadsResponse, RegisterSlackImportUploadsResponses, RegisterUploads, Reminder, ReminderCollectionPage, ReminderCollectionRow, ReminderFilters, ReminderReference, ReminderSchedule, RemindersList, RemoveBotFromChannelByBotData, RemoveBotFromChannelByBotError, RemoveBotFromChannelByBotErrors, RemoveBotFromChannelByBotResponse, RemoveBotFromChannelByBotResponses, RemoveFavoriteByEntityData, RemoveFavoriteByEntityError, RemoveFavoriteByEntityErrors, RemoveFavoriteByEntityResponses, RemoveParticipantsData, RemoveParticipantsError, RemoveParticipantsErrors, RemoveParticipantsRequest, RemoveParticipantsResponses, RemovePinHandlerData, RemovePinHandlerError, RemovePinHandlerErrors, RemovePinHandlerResponse, RemovePinHandlerResponses, RenameChannelLabelData, RenameChannelLabelError, RenameChannelLabelErrors, RenameChannelLabelRequest, RenameChannelLabelResponse, RenameChannelLabelResponses, ReorderFavoritesData, ReorderFavoritesError, ReorderFavoritesErrors, ReorderFavoritesRequest, ReorderFavoritesResponses, ReorderPinRequest, ReorderPinsHandlerData, ReorderPinsHandlerError, ReorderPinsHandlerErrors, ReorderPinsHandlerResponse, ReorderPinsHandlerResponses, ReplaceCrmStagesRequest, RequestedHarnessScope, RequestedLayout, ResetCrmTeamStagesData, ResetCrmTeamStagesError, ResetCrmTeamStagesErrors, ResetCrmTeamStagesResponse, ResetCrmTeamStagesResponses, RevertDeleteDocumentData, RevertDeleteDocumentError, RevertDeleteDocumentErrors, RevertDeleteDocumentResponse, RevertDeleteDocumentResponses, RevertDeleteProjectData, RevertDeleteProjectError, RevertDeleteProjectErrors, RevertDeleteProjectResponse, RevertDeleteProjectResponses, RingStatus, RingStatusResponse, RowChange, RowChangeKind, RowChanges, RowHistoryEntry, RowHistoryResponse, RowsChange, RowsResult, S3ObjectInfo, SaveBomPart, SaveDatabaseQueryData, SaveDatabaseQueryError, SaveDatabaseQueryErrors, SaveDatabaseQueryResponse, SaveDatabaseQueryResponses, SaveDocumentHandlerData, SaveDocumentHandlerError, SaveDocumentHandlerErrors, SaveDocumentHandlerResponse, SaveDocumentHandlerResponses, SaveDocumentRequest, SaveDocumentResponse, SaveDocumentResponseData, SavedQuery, SaveQueryRequest, SearchContactsData, SearchContactsError, SearchContactsErrors, SearchContactsResponse, SearchContactsResponse2, SearchContactsResponses, SearchState, SessionDeletedMetadata, SessionIdentity, SessionMentionedMetadata, SessionOpenedMetadata, SessionRenamedMetadata, SessionSettledMetadata, SessionStoppedMetadata, SetChannelLabelData, SetChannelLabelError, SetChannelLabelErrors, SetChannelLabelRequest, SetChannelLabelResponse, SetChannelLabelResponses, SetChannelPictureData, SetChannelPictureError, SetChannelPictureErrors, SetChannelPictureRequest, SetChannelPictureResponse, SetChannelPictureResponses, SetCompanyHiddenData, SetCompanyHiddenError, SetCompanyHiddenErrors, SetCompanyHiddenRequest, SetCompanyHiddenResponse, SetCompanyHiddenResponses, SetCompanyNameRequest, SetContactHiddenData, SetContactHiddenError, SetContactHiddenErrors, SetContactHiddenRequest, SetContactHiddenResponse, SetContactHiddenResponses, SetContactNameRequest, SetCrmCompanyNameData, SetCrmCompanyNameError, SetCrmCompanyNameErrors, SetCrmCompanyNameResponse, SetCrmCompanyNameResponses, SetCrmContactNameData, SetCrmContactNameError, SetCrmContactNameErrors, SetCrmContactNameResponse, SetCrmContactNameResponses, SetDocumentTeamShareData, SetDocumentTeamShareError, SetDocumentTeamShareErrors, SetDocumentTeamShareRequest, SetDocumentTeamShareResponse, SetDocumentTeamShareResponses, SetEmailFollowupData, SetEmailFollowupError, SetEmailFollowupErrors, SetEmailFollowupResponse, SetEmailFollowupResponses, SetEmailSyncData, SetEmailSyncError, SetEmailSyncErrors, SetEmailSyncRequest, SetEmailSyncResponse, SetEmailSyncResponses, SetOperator, SetPropertyValue, Sha256Digest, ShareDatabaseAwarenessData, ShareDatabaseAwarenessError, ShareDatabaseAwarenessErrors, ShareDatabaseAwarenessResponse, ShareDatabaseAwarenessResponses, SharedEmailFilter, SharePermissionV2, ShortIdResponse, SimpleMention, SimpleSaveData, SimpleSaveError, SimpleSaveErrors, SimpleSaveResponse, SimpleSaveResponses, SkippedCell, SlackCompleteRequest, SlackCreateRequest, SlackRegisterRequest, SlackTimestamp, SlackUserId, SmartTagChannelMatch, SmartTagPreview, SortDirection, SortKey, SoupAgentSessionSoupPropertiesField, SoupApiItem, SoupApiSort, SoupApiSortDirection, SoupAttachment, SoupCalendarEventSoupPropertiesField, SoupCalendarEventTime, SoupCallRecordGuest, SoupCallRecordParticipant, SoupCallRecordSoupPropertiesField, SoupChannel, SoupChannelThread, SoupChatSoupPropertiesField, SoupContact, SoupCountedReaction, SoupCrmCompanySoupPropertiesField, SoupCrmDomain, SoupDatabaseRowSoupPropertiesField, SoupDocumentSoupPropertiesField, SoupDocumentSubType, SoupEmailThreadPreview, SoupEnrichedEmailThreadPreviewSoupPropertiesField, SoupForeignEntity, SoupInitiativeSoupPropertiesField, SoupItem, SoupLabel, SoupLabelListVisibility, SoupLabelType, SoupMessageAttachment, SoupMessageListVisibility, SoupMessageSender, SoupMessageSenderType, SoupPage, SoupProjectSoupPropertiesField, SoupPropertiesField, SoupProperty, SoupReminderReference, SoupReminderSchedule, SoupReminderSoupPropertiesField, SoupThreadInfo, SoupThreadReply, SourceBinding, SourceId, SourceIdentity, StarterDatabase, StarterDocumentsResponse, StoredGithubPullRequest, StreamEventsData, StreamEventsError, StreamEventsErrors, StreamEventsResponse, StreamEventsResponses, String, SuccessResponse, SurfaceState, SyncServiceVersionId, SystemSkillSummary, Table, TableChange, TableChanged, TableChanges, TableDetail, TableResult, TableVersion, TagFilterMode, TakenId, TaskFilters, TeamOutOfOfficeItem, TeamOutOfOfficeResponse, TeamRole, TextOperator, ThreadAnchor, ThreadOrigin, ThreadPatch, ThreadState, ToggleShareWithTeamData, ToggleShareWithTeamError, ToggleShareWithTeamErrors, ToggleShareWithTeamResponse, ToggleShareWithTeamResponses, TouchedColumn, TouchedRow, TranscribeDictationData, TranscribeDictationError, TranscribeDictationErrors, TranscribeDictationResponse, TranscribeDictationResponses, TranscribeResponse, TranscriptSegmentRequest, TurnEndedMetadata, TurnStartedMetadata, TurnSummary, TypedSuccessResponse, TypedSuccessResponseGetDocumentResponseData, TypingInput, UnassignInitiativeTaskData, UnassignInitiativeTaskError, UnassignInitiativeTaskErrors, UnassignInitiativeTaskResponse, UnassignInitiativeTaskResponses, UndoChangeResponse, UndoDatabaseChangeData, UndoDatabaseChangeError, UndoDatabaseChangeErrors, UndoDatabaseChangeResponse, UndoDatabaseChangeResponses, UndoOutcome, UndoRefusal, UpdateAgentData, UpdateAgentError, UpdateAgentErrors, UpdateAgentRequest, UpdateAgentResponse, UpdateAgentResponses, UpdateChannelSharePermission, UpdateCrmTeamSettingsRequest, UpdateDatabasePermissionsData, UpdateDatabasePermissionsError, UpdateDatabasePermissionsErrors, UpdateDatabasePermissionsResponse, UpdateDatabasePermissionsResponses, UpdateInitiativeData, UpdateInitiativeError, UpdateInitiativeErrors, UpdateInitiativeRequest, UpdateInitiativeResponse, UpdateInitiativeResponses, UpdateMeetingRequest, UpdateOperation, UpdateReminderData, UpdateReminderError, UpdateReminderErrors, UpdateReminderRequest, UpdateReminderResponse, UpdateReminderResponses, UpdateSharePermissionRequestV2, UploadDescriptor, UploadDocumentStatus, UploadExtractFolderHandlerData, UploadExtractFolderHandlerError, UploadExtractFolderHandlerErrors, UploadExtractFolderHandlerResponse, UploadExtractFolderHandlerResponses, UploadExtractFolderRequest, UploadFolderHandlerData, UploadFolderHandlerError, UploadFolderHandlerErrors, UploadFolderHandlerResponse, UploadFolderHandlerResponses, UploadFolderRequest, UploadGrant, UploadId, UpsertHistoryHandlerData, UpsertHistoryHandlerError, UpsertHistoryHandlerErrors, UpsertHistoryHandlerResponse, UpsertHistoryHandlerResponses, UpsertUserDocumentViewLocationData, UpsertUserDocumentViewLocationError, UpsertUserDocumentViewLocationErrors, UpsertUserDocumentViewLocationRequest, UpsertUserDocumentViewLocationResponse, UpsertUserDocumentViewLocationResponses, UserApiKeyId, UserApiKeyInfo, UserApiKeysList, UserDocumentsResponse, UserDocumentViewLocation, UserDocumentViewLocationResponse, UserPinsResponse, UserViewsResponse, ValidateDocumentPermissionsTokenData, ValidateDocumentPermissionsTokenError, ValidateDocumentPermissionsTokenErrors, ValidateDocumentPermissionsTokenResponse, ValidateDocumentPermissionsTokenResponses, ValidateWebhookData, ValidateWebhookError, ValidateWebhookErrors, ValidateWebhookResponse, ValidateWebhookResponse2, ValidateWebhookResponses, Vec, VersionedTable, View, ViewChange, ViewColumn, ViewLayout, ViewPatch, ViewPosition, ViewPositionsResponse, ViewQuery, ViewResult, ViewsResponse, WaitingForInputMetadata, Webhook, WebhookEvent, WebhookFilter, WebhookScope, WebhookStatus, WebhookValidationTestEvent, WithCallId, WithChannelId, WithDocumentId, WithProjectId } from './types.gen';+export type { AccessLevel, ActiveCallsResponse, ActiveCallSummary, ActiveMeeting, ActiveMeetingsResponse, ActivityType, AddFavoriteData, AddFavoriteError, AddFavoriteErrors, AddFavoriteRequest, AddFavoriteResponse, AddFavoriteResponses, AddParticipantsData, AddParticipantsError, AddParticipantsErrors, AddParticipantsRequest, AddParticipantsResponses, AddPinHandlerData, AddPinHandlerError, AddPinHandlerErrors, AddPinHandlerResponse, AddPinHandlerResponses, AddPinRequest, Agent, AgentActionId, AgentChannelScope, AgentMcpServer, AgentMcpServers, AgentPullRequestState, AgentSessionFilters, AgentSessionLifecycleEvent, Anchor, AnchorId, AnchorResponse, AnnotationIncrementalUpdate, ApiActivity, ApiAttachmentChannelReference, ApiAttachmentEntityReference, ApiAttachmentGenericReference, ApiChannelAttachment, ApiChannelAttachmentsPage, ApiChannelDetail, ApiChannelListMessage, ApiChannelListPage, ApiChannelListParticipant, ApiChannelListType, ApiChannelParticipant, ApiChannelWithLatest, ApiEntityFilterAst, ApiGroupByField, ApiGroupMeta, ApiParticipantListRole, ApiParticipantRole, ApiPropertyEntityType, ApplyDatabaseOpsData, ApplyDatabaseOpsError, ApplyDatabaseOpsErrors, ApplyDatabaseOpsResponse, ApplyDatabaseOpsResponses, ApplyOpsRequest, ApplyOpsResponse, ApproveHarnessPairingData, ApproveHarnessPairingError, ApproveHarnessPairingErrors, ApproveHarnessPairingResponse, ApproveHarnessPairingResponses, ApprovePairingRequest, AttachmentChange, AttendeeResponseStatus, Awareness, AwarenessRelay, BasicDocument, BasicDocumentSubType, BomPart, Bot, BotChannel, BotChannelType, BotId, BotKind, BotOwner, BotOwnerProfile, BotSenderProfile, BotToken, BranchNameResponse, BTreeMap, BulkWakeupRequest, BulkWakeupResponse, BulkWakeupSyncServiceDocumentsData, BulkWakeupSyncServiceDocumentsErrors, BulkWakeupSyncServiceDocumentsResponse, BulkWakeupSyncServiceDocumentsResponses, CalendarAttendee, CalendarEvent, CalendarEventFilters, CalendarEventSourceContent, CalendarMentionEvent, CalendarMentionPreviewItem, CalendarMentionPreviewKind, CalendarMentionPreviewRequest, CalendarMentionPreviewRequestItem, CalendarMentionPreviewResponse, CalendarOccurrence, CalendarOccurrenceItem, CalendarOccurrenceResponse, CalendarSyncStatus, CallActiveResponse, CallFilters, CallRecord, CallRecordGuest, CallRecordParticipant, CallRecordPreview, CallRecordPreviewData, CallRecordTranscriptSegment, CallStatus, CallTokenResponse, CallWebhookData, CallWebhookError, CallWebhookErrors, CallWebhookResponses, CancelSlackImportData, CancelSlackImportErrors, CancelSlackImportResponse, CancelSlackImportResponses, CardPosition, CastVerdict, CellValue, CellWrite, ChangedFileDto, ChangesetDto, ChangesetSourceDto, Channel, ChannelCreatedMetadata, ChannelDeletedMetadata, ChannelFilters, ChannelJoinCodeResponse, ChannelLabel, ChannelLabelRule, ChannelLabelsList, ChannelMessage, ChannelParticipant, ChannelParticipantAddedMetadata, ChannelParticipantRemovedMetadata, ChannelPreview, ChannelPreviewData, ChannelSender, ChannelSharePermission, ChannelThreadFilters, ChannelTopicEvent, ChannelType, ChannelUpdatedMetadata, ChannelWebhookRequest, ChannelWebhookResponse, ChannelWithParticipants, Chat, ChatFilters, CheckActiveCallData, CheckActiveCallError, CheckActiveCallErrors, CheckActiveCallResponse, CheckActiveCallResponses, ClaimedPairing, ClaimHarnessPairingData, ClaimHarnessPairingError, ClaimHarnessPairingErrors, ClaimHarnessPairingResponse, ClaimHarnessPairingResponses, ClaimPairingRequest, ClientOptions, CloudStorageItemType, CollabSurfaceResponse, CollabSurfaceTokenResponse, Column, ColumnCast, ColumnChange, ColumnChangeKind, ColumnConfig, ColumnConversion, ColumnConversionRequest, ColumnDetail, ColumnKind, ColumnResult, CommandFailure, CommandRejectedMetadata, CommittedChange, CompleteSlackImportUploadsData, CompleteSlackImportUploadsErrors, CompleteSlackImportUploadsResponse, CompleteSlackImportUploadsResponses, CompleteUploads, ConferenceProvider, Conjunction, ConversationId, ConversationKind, ConversationMetadata, ConversationProgress, ConversationSeal, ConversationStatus, ConvertDatabaseColumnData, ConvertDatabaseColumnError, ConvertDatabaseColumnErrors, ConvertDatabaseColumnResponse, ConvertDatabaseColumnResponses, ConvertedCell, CopyDocumentData, CopyDocumentError, CopyDocumentErrors, CopyDocumentQueryParams, CopyDocumentRequest, CopyDocumentResponse, CopyDocumentResponse2, CopyDocumentResponses, CountedReaction, CreateAgentData, CreateAgentError, CreateAgentErrors, CreateAgentRequest, CreateAgentResponse, CreateAgentResponses, CreateAnchorData, CreateAnchorError, CreateAnchorErrors, CreateAnchorResponse, CreateAnchorResponses, CreateBotRequest, CreateBulkDocumentResponse, CreateBulkDocumentResponseData, CreateChannelData, CreateChannelError, CreateChannelErrors, CreateChannelLabelData, CreateChannelLabelError, CreateChannelLabelErrors, CreateChannelLabelRequest, CreateChannelLabelResponse, CreateChannelLabelResponses, CreateChannelRequest, CreateChannelResponse, CreateChannelResponse2, CreateChannelResponses, CreateChannelScopedBotData, CreateChannelScopedBotError, CreateChannelScopedBotErrors, CreateChannelScopedBotRequest, CreateChannelScopedBotResponse, CreateChannelScopedBotResponse2, CreateChannelScopedBotResponses, CreateCollabSurfaceTokenData, CreateCollabSurfaceTokenError, CreateCollabSurfaceTokenErrors, CreateCollabSurfaceTokenResponse, CreateCollabSurfaceTokenResponses, CreateCrmCompanyData, CreateCrmCompanyError, CreateCrmCompanyErrors, CreateCrmCompanyRequest, CreateCrmCompanyResponse, CreateCrmCompanyResponses, CreateCrmContactData, CreateCrmContactError, CreateCrmContactErrors, CreateCrmContactRequest, CreateCrmContactResponse, CreateCrmContactResponses, CreateDatabaseData, CreateDatabaseError, CreateDatabaseErrors, CreateDatabaseRequest, CreateDatabaseResponse, CreateDatabaseResponses, CreateDocumentData, CreateDocumentError, CreateDocumentErrors, CreateDocumentRequest, CreateDocumentResponse, CreateDocumentResponseData, CreateDocumentResponses, CreatedPairing, CreatedUserApiKey, CreateEntityMentionData, CreateEntityMentionError, CreateEntityMentionErrors, CreateEntityMentionRequest, CreateEntityMentionResponse, CreateEntityMentionResponse2, CreateEntityMentionResponses, CreateHarnessPairingData, CreateHarnessPairingError, CreateHarnessPairingErrors, CreateHarnessPairingResponse, CreateHarnessPairingResponses, CreateImport, CreateInitiativeData, CreateInitiativeError, CreateInitiativeErrors, CreateInitiativeRequest, CreateInitiativeResponse, CreateInitiativeResponses, CreateInstructionsDocumentResponse, CreateInstructionsHandlerData, CreateInstructionsHandlerError, CreateInstructionsHandlerErrors, CreateInstructionsHandlerResponse, CreateInstructionsHandlerResponses, CreateMarkdownDocumentRequest, CreateMarkdownDocumentResponse, CreateMarkdownHandlerData, CreateMarkdownHandlerError, CreateMarkdownHandlerErrors, CreateMarkdownHandlerResponse, CreateMarkdownHandlerResponses, CreateMeetingRequest, CreatePairingRequest, CreateProjectHandlerData, CreateProjectHandlerError, CreateProjectHandlerErrors, CreateProjectHandlerResponse, CreateProjectHandlerResponses, CreateProjectRequest, CreateProjectResponse, CreateReminderData, CreateReminderError, CreateReminderErrors, CreateReminderRequest, CreateReminderResponse, CreateReminderResponses, CreateSkillHandlerData, CreateSkillHandlerError, CreateSkillHandlerErrors, CreateSkillHandlerResponse, CreateSkillHandlerResponses, CreateSkillRequest, CreateSkillResponse, CreateSlackImportData, CreateSlackImportErrors, CreateSlackImportResponse, CreateSlackImportResponses, CreateSnippetHandlerData, CreateSnippetHandlerError, CreateSnippetHandlerErrors, CreateSnippetHandlerResponse, CreateSnippetHandlerResponses, CreateSnippetRequest, CreateSnippetResponse, CreateTaskHandlerData, CreateTaskHandlerError, CreateTaskHandlerErrors, CreateTaskHandlerResponse, CreateTaskHandlerResponses, CreateTaskRequest, CreateTaskResponse, CreateToken, CreateUnthreadedAnchorRequest, CreateUnthreadedAnchorResponse, CreateUnthreadedPdfAnchorRequest, CreateUserApiKeyData, CreateUserApiKeyError, CreateUserApiKeyErrors, CreateUserApiKeyRequest, CreateUserApiKeyResponse, CreateUserApiKeyResponses, CreateViewHandlerData, CreateViewHandlerError, CreateViewHandlerErrors, CreateViewHandlerResponse, CreateViewHandlerResponses, CreateViewRequest, CreateWebhookData, CreateWebhookError, CreateWebhookErrors, CreateWebhookRequest, CreateWebhookResponse, CreateWebhookResponse2, CreateWebhookResponses, CrmCompanyFilters, CrmCompanyResponse, CrmContactResponse, CrmDomainResponse, CrmPermissionRole, CrmStageInput, CrmStageResponse, CrmStagesResponse, CrmTeamSettingsResponse, CustomSpeakerAssignment, Database, DatabaseDetail, DatabaseOp, DatabaseView, DataType, DateOperator, DeleteAnchorData, DeleteAnchorError, DeleteAnchorErrors, DeleteAnchorResponse, DeleteAnchorResponses, DeleteCallRecordData, DeleteCallRecordError, DeleteCallRecordErrors, DeleteCallRecordResponse, DeleteCallRecordResponses, DeleteChannelData, DeleteChannelError, DeleteChannelErrors, DeleteChannelLabelData, DeleteChannelLabelError, DeleteChannelLabelErrors, DeleteChannelLabelResponse, DeleteChannelLabelResponses, DeleteChannelResponse, DeleteChannelResponses, DeleteCollabSurfaceData, DeleteCollabSurfaceError, DeleteCollabSurfaceErrors, DeleteCollabSurfaceResponse, DeleteCollabSurfaceResponses, DeleteDocumentData, DeleteDocumentError, DeleteDocumentErrors, DeleteDocumentResponse, DeleteDocumentResponses, DeleteEntityMentionData, DeleteEntityMentionError, DeleteEntityMentionErrors, DeleteEntityMentionResponse, DeleteEntityMentionResponse2, DeleteEntityMentionResponses, DeleteHarnessData, DeleteHarnessError, DeleteHarnessErrors, DeleteHarnessResponse, DeleteHarnessResponses, DeleteHistoryHandlerData, DeleteHistoryHandlerError, DeleteHistoryHandlerErrors, DeleteHistoryHandlerResponse, DeleteHistoryHandlerResponses, DeleteInitiativeData, DeleteInitiativeError, DeleteInitiativeErrors, DeleteInitiativeResponse, DeleteInitiativeResponses, DeleteProjectHandlerData, DeleteProjectHandlerError, DeleteProjectHandlerErrors, DeleteProjectHandlerResponse, DeleteProjectHandlerResponses, DeleteReminderData, DeleteReminderError, DeleteReminderErrors, DeleteReminderResponse, DeleteReminderResponses, DeleteSelfHarnessData, DeleteSelfHarnessError, DeleteSelfHarnessErrors, DeleteSelfHarnessResponse, DeleteSelfHarnessResponses, DeleteUnthreadedAnchorRequest, DeleteUnthreadedAnchorResponse, DeleteUnthreadedPdfAnchorRequest, DeleteUserApiKeyData, DeleteUserApiKeyError, DeleteUserApiKeyErrors, DeleteUserApiKeyResponse, DeleteUserApiKeyResponses, DeleteUserDocumentViewLocationData, DeleteUserDocumentViewLocationError, DeleteUserDocumentViewLocationErrors, DeleteUserDocumentViewLocationResponse, DeleteUserDocumentViewLocationResponses, DeleteViewHandlerData, DeleteViewHandlerError, DeleteViewHandlerErrors, DeleteViewHandlerResponses, DeleteWebhookData, DeleteWebhookError, DeleteWebhookErrors, DeleteWebhookResponse, DeleteWebhookResponses, DocumentBasic, DocumentContent, DocumentContentLocation, DocumentContentState, DocumentContentUploadedMetadata, DocumentCopiedMetadata, DocumentCreatedMetadata, DocumentDeletedMetadata, DocumentFilters, DocumentId, DocumentInteractionMetadata, DocumentMetadata, DocumentMetadataWithContent, DocumentPermissionsToken, DocumentPermissionsTokenRequest, DocumentPermissionsTokenResponse, DocumentPreview, DocumentPreviewData, DocumentPreviewDataSubType, DocumentPurgedMetadata, DocumentResponse, DocumentResponseMetadata, DocumentResponseMetadataWithContent, DocumentStorageServiceApiVersion, DocumentSubType, DocumentSyncContentUpdatedMetadata, DocumentSyncEditor, DocumentTeamShareResponse, DocumentTopicEvent, DocumentUpdatedMetadata, EditAnchorData, EditAnchorError, EditAnchorErrors, EditAnchorRequest, EditAnchorResponse, EditAnchorResponse2, EditAnchorResponses, EditCallRecordData, EditCallRecordError, EditCallRecordErrors, EditCallRecordRequest, EditCallRecordResponse, EditCallRecordResponses, EditCallTranscriptData, EditCallTranscriptError, EditCallTranscriptErrors, EditCallTranscriptRequest, EditCallTranscriptResponse, EditCallTranscriptResponses, EditDocumentData, EditDocumentError, EditDocumentErrors, EditDocumentResponse, EditDocumentResponse2, EditDocumentResponses, EditDocumentServiceArgs, EditPdfAnchorRequest, EditPdfPlaceableCommentAnchorRequest, EditProjectV2Data, EditProjectV2Error, EditProjectV2Errors, EditProjectV2Response, EditProjectV2Responses, EditThreadV2Data, EditThreadV2Error, EditThreadV2Errors, EditThreadV2Response, EditThreadV2Responses, EmailFilters, EmailFollowup, EmailFollowupCommand, EmailFollowupResponse, EmailReminderCondition, EmailReminderPage, EmailReminderSummary, EmptyResponse, EnsureCollabSurfaceData, EnsureCollabSurfaceError, EnsureCollabSurfaceErrors, EnsureCollabSurfaceRequest, EnsureCollabSurfaceResponse, EnsureCollabSurfaceResponses, EnsureStarterHandlerData, EnsureStarterHandlerErrors, EnsureStarterHandlerResponse, EnsureStarterHandlerResponses, EntityFilters, EntityKind, EntityMessageCreateData, EntityMessageCreateResponse, EntityMessageCreateResponses, EntityMessageDeleteMessageData, EntityMessageDeleteMessageResponse, EntityMessageDeleteMessageResponses, EntityMessageDeleteThreadData, EntityMessageDeleteThreadResponse, EntityMessageDeleteThreadResponses, EntityMessageEditData, EntityMessageEditResponse, EntityMessageEditResponses, EntityMessageGetMessageData, EntityMessageGetMessageResponse, EntityMessageGetMessageResponses, EntityMessageGetThreadData, EntityMessageGetThreadResponse, EntityMessageGetThreadResponses, EntityMessageLegacyData, EntityMessageLegacyResponse, EntityMessageLegacyResponses, EntityMessagePatchThreadData, EntityMessagePatchThreadResponse, EntityMessagePatchThreadResponses, EntityMessageReactData, EntityMessageReactResponse, EntityMessageReactResponses, EntityMessageTypingData, EntityMessageTypingResponse, EntityMessageTypingResponses, EntityPermission, EntityPermissionResponse, EntityRef, EntityReference, EntityType, ErrorResponse, EventReminderOverride, EventReminders, EventStatus, EventTime, EventTransparency, EventType, EventVisibility, ExcludedDefaultView, ExcludeDefaultViewHandlerData, ExcludeDefaultViewHandlerError, ExcludeDefaultViewHandlerErrors, ExcludeDefaultViewHandlerResponses, ExcludeDefaultViewRequest, ExportDocumentData, ExportDocumentError, ExportDocumentErrors, ExportDocumentResponse, ExportDocumentResponse2, ExportDocumentResponses, Favorite, FavoriteEntityRef, FavoritesList, FileChangeKindDto, FileSystemNodeWithIds, FileType, FileTypeUpdate, FilterCondition, FilterGroup, FilterNode, FilterTest, FinalizeSlackImportData, FinalizeSlackImportErrors, FinalizeSlackImportResponse, FinalizeSlackImportResponses, FolderItem, FollowupState, ForeignEntity, ForeignEntityFilters, GenericErrorResponse, GenericResponse, GenericSuccessResponse, GetActiveCallsData, GetActiveCallsError, GetActiveCallsErrors, GetActiveCallsResponse, GetActiveCallsResponses, GetActivityData, GetActivityError, GetActivityErrors, GetActivityResponse, GetActivityResponses, GetAttachmentReferencesData, GetAttachmentReferencesError, GetAttachmentReferencesErrors, GetAttachmentReferencesResponse, GetAttachmentReferencesResponse2, GetAttachmentReferencesResponses, GetBatchCallRecordPreviewData, GetBatchCallRecordPreviewError, GetBatchCallRecordPreviewErrors, GetBatchCallRecordPreviewRequest, GetBatchCallRecordPreviewResponse, GetBatchCallRecordPreviewResponse2, GetBatchCallRecordPreviewResponses, GetBatchChannelPreviewData, GetBatchChannelPreviewError, GetBatchChannelPreviewErrors, GetBatchChannelPreviewRequest, GetBatchChannelPreviewResponse, GetBatchChannelPreviewResponse2, GetBatchChannelPreviewResponses, GetBatchPreviewHandlerData, GetBatchPreviewHandlerError, GetBatchPreviewHandlerErrors, GetBatchPreviewHandlerResponse, GetBatchPreviewHandlerResponses, GetBatchPreviewRequest, GetBatchPreviewResponse, GetBatchProjectPreviewData, GetBatchProjectPreviewError, GetBatchProjectPreviewErrors, GetBatchProjectPreviewRequest, GetBatchProjectPreviewResponse, GetBatchProjectPreviewResponse2, GetBatchProjectPreviewResponses, GetBotOwnerProfilesData, GetBotOwnerProfilesError, GetBotOwnerProfilesErrors, GetBotOwnerProfilesResponse, GetBotOwnerProfilesResponses, GetCallRecordData, GetCallRecordError, GetCallRecordErrors, GetCallRecordResponse, GetCallRecordResponses, GetChannelAttachmentsData, GetChannelAttachmentsError, GetChannelAttachmentsErrors, GetChannelAttachmentsResponse, GetChannelAttachmentsResponses, GetChannelData, GetChannelError, GetChannelErrors, GetChannelJoinLinkData, GetChannelJoinLinkError, GetChannelJoinLinkErrors, GetChannelJoinLinkResponse, GetChannelJoinLinkResponses, GetChannelParticipantsData, GetChannelParticipantsError, GetChannelParticipantsErrors, GetChannelParticipantsResponse, GetChannelParticipantsResponses, GetChannelResponse, GetChannelResponses, GetChannelsData, GetChannelsError, GetChannelsErrors, GetChannelsResponse, GetChannelsResponses, GetCollabSurfaceData, GetCollabSurfaceError, GetCollabSurfaceErrors, GetCollabSurfaceResponse, GetCollabSurfaceResponses, GetCompanyData, GetCompanyError, GetCompanyErrors, GetCompanyResponse, GetCompanyResponses, GetContactByEmailData, GetContactByEmailError, GetContactByEmailErrors, GetContactByEmailResponse, GetContactByEmailResponse2, GetContactByEmailResponses, GetContactData, GetContactError, GetContactErrors, GetContactResponse, GetContactResponses, GetCrmTeamSettingsData, GetCrmTeamSettingsError, GetCrmTeamSettingsErrors, GetCrmTeamSettingsResponse, GetCrmTeamSettingsResponses, GetDatabaseData, GetDatabaseError, GetDatabaseErrors, GetDatabasePermissionsData, GetDatabasePermissionsError, GetDatabasePermissionsErrors, GetDatabasePermissionsResponse, GetDatabasePermissionsResponses, GetDatabaseQueryData, GetDatabaseQueryError, GetDatabaseQueryErrors, GetDatabaseQueryResponse, GetDatabaseQueryResponses, GetDatabaseResponse, GetDatabaseResponses, GetDatabaseRowHistoryData, GetDatabaseRowHistoryError, GetDatabaseRowHistoryErrors, GetDatabaseRowHistoryResponse, GetDatabaseRowHistoryResponses, GetDatabaseTableChangesData, GetDatabaseTableChangesError, GetDatabaseTableChangesErrors, GetDatabaseTableChangesResponse, GetDatabaseTableChangesResponses, GetDatabaseViewPositionsData, GetDatabaseViewPositionsError, GetDatabaseViewPositionsErrors, GetDatabaseViewPositionsResponse, GetDatabaseViewPositionsResponses, GetDocumentAnchorsData, GetDocumentAnchorsError, GetDocumentAnchorsErrors, GetDocumentAnchorsResponse, GetDocumentAnchorsResponses, GetDocumentBranchNameData, GetDocumentBranchNameError, GetDocumentBranchNameErrors, GetDocumentBranchNameResponse, GetDocumentBranchNameResponses, GetDocumentByTeamSlugData, GetDocumentByTeamSlugError, GetDocumentByTeamSlugErrors, GetDocumentByTeamSlugResponse, GetDocumentByTeamSlugResponses, GetDocumentData, GetDocumentError, GetDocumentErrors, GetDocumentGithubPullRequestsData, GetDocumentGithubPullRequestsError, GetDocumentGithubPullRequestsErrors, GetDocumentGithubPullRequestsResponse, GetDocumentGithubPullRequestsResponses, GetDocumentKeyResponse, GetDocumentKeyResponseData, GetDocumentListHandlerData, GetDocumentListHandlerError, GetDocumentListHandlerErrors, GetDocumentListHandlerResponse, GetDocumentListHandlerResponses, GetDocumentListResult, GetDocumentLocationV3Data, GetDocumentLocationV3Error, GetDocumentLocationV3Errors, GetDocumentLocationV3Response, GetDocumentLocationV3Responses, GetDocumentPermissionsResponseDataV2, GetDocumentPermissionsTokenData, GetDocumentPermissionsTokenError, GetDocumentPermissionsTokenErrors, GetDocumentPermissionsTokenResponse, GetDocumentPermissionsTokenResponses, GetDocumentPermissionsV2Data, GetDocumentPermissionsV2Error, GetDocumentPermissionsV2Errors, GetDocumentPermissionsV2Response, GetDocumentPermissionsV2Responses, GetDocumentProcessingResult, GetDocumentProcessingResultData, GetDocumentProcessingResultError, GetDocumentProcessingResultErrors, GetDocumentProcessingResultResponse, GetDocumentProcessingResultResponse2, GetDocumentProcessingResultResponses, GetDocumentResponse, GetDocumentResponse2, GetDocumentResponseData, GetDocumentResponses, GetDocumentSearchResponse, GetDocumentShortIdData, GetDocumentShortIdError, GetDocumentShortIdErrors, GetDocumentShortIdResponse, GetDocumentShortIdResponses, GetDocumentsResponse, GetDocumentTeamShareData, GetDocumentTeamShareError, GetDocumentTeamShareErrors, GetDocumentTeamShareResponse, GetDocumentTeamShareResponses, GetDocumentUserAccessLevelResponse, GetDocumentVersionData, GetDocumentVersionError, GetDocumentVersionErrors, GetDocumentVersionResponse, GetDocumentVersionResponses, GetDocumentViewsHandlerData, GetDocumentViewsHandlerError, GetDocumentViewsHandlerErrors, GetDocumentViewsHandlerResponse, GetDocumentViewsHandlerResponses, GetEmailFollowupData, GetEmailFollowupError, GetEmailFollowupErrors, GetEmailFollowupResponse, GetEmailFollowupResponses, GetEntityPermissionData, GetEntityPermissionErrors, GetEntityPermissionResponse, GetEntityPermissionResponses, GetForeignEntityBySourceData, GetForeignEntityBySourceError, GetForeignEntityBySourceErrors, GetForeignEntityBySourceResponse, GetForeignEntityBySourceResponses, GetForeignEntityData, GetForeignEntityError, GetForeignEntityErrors, GetForeignEntityResponse, GetForeignEntityResponses, GetGithubPullRequestChangesData, GetGithubPullRequestChangesError, GetGithubPullRequestChangesErrors, GetGithubPullRequestChangesPatchData, GetGithubPullRequestChangesPatchError, GetGithubPullRequestChangesPatchErrors, GetGithubPullRequestChangesPatchResponse, GetGithubPullRequestChangesPatchResponses, GetGithubPullRequestChangesResponse, GetGithubPullRequestChangesResponses, GetGithubPullRequestData, GetGithubPullRequestError, GetGithubPullRequestErrors, GetGithubPullRequestFacetsData, GetGithubPullRequestFacetsError, GetGithubPullRequestFacetsErrors, GetGithubPullRequestFacetsResponse, GetGithubPullRequestFacetsResponses, GetGithubPullRequestResponse, GetGithubPullRequestResponses, GetHarnessPairingData, GetHarnessPairingError, GetHarnessPairingErrors, GetHarnessPairingResponse, GetHarnessPairingResponses, GetHistoryHandlerData, GetHistoryHandlerError, GetHistoryHandlerErrors, GetHistoryHandlerResponse, GetHistoryHandlerResponses, GetInitiativeData, GetInitiativeError, GetInitiativeErrors, GetInitiativeResponse, GetInitiativeResponses, GetInstructionsDocumentResponse, GetInstructionsHandlerData, GetInstructionsHandlerError, GetInstructionsHandlerErrors, GetInstructionsHandlerResponse, GetInstructionsHandlerResponses, GetItemsSoupData, GetItemsSoupError, GetItemsSoupErrors, GetItemsSoupResponse, GetItemsSoupResponses, GetLocationHandlerData, GetLocationHandlerError, GetLocationHandlerErrors, GetLocationHandlerResponse, GetLocationHandlerResponses, GetOrCreateAction, GetOrCreateCallData, GetOrCreateCallError, GetOrCreateCallErrors, GetOrCreateCallResponse, GetOrCreateCallResponses, GetOrCreateChannelResponse, GetOrCreateDmData, GetOrCreateDmError, GetOrCreateDmErrors, GetOrCreateDmRequest, GetOrCreateDmResponse, GetOrCreateDmResponses, GetOrCreatePrivateData, GetOrCreatePrivateError, GetOrCreatePrivateErrors, GetOrCreatePrivateRequest, GetOrCreatePrivateResponse, GetOrCreatePrivateResponses, GetPendingProjectsHandlerData, GetPendingProjectsHandlerError, GetPendingProjectsHandlerErrors, GetPendingProjectsHandlerResponse, GetPendingProjectsHandlerResponses, GetPinsHandlerData, GetPinsHandlerError, GetPinsHandlerErrors, GetPinsHandlerResponse, GetPinsHandlerResponses, GetPinsResponse, GetProjectContentHandlerData, GetProjectContentHandlerError, GetProjectContentHandlerErrors, GetProjectContentHandlerResponse, GetProjectContentHandlerResponses, GetProjectContentResponse, GetProjectHandlerData, GetProjectHandlerError, GetProjectHandlerErrors, GetProjectHandlerResponse, GetProjectHandlerResponses, GetProjectPermissionsV2Data, GetProjectPermissionsV2Error, GetProjectPermissionsV2Errors, GetProjectPermissionsV2Response, GetProjectPermissionsV2Responses, GetProjectResponse, GetProjectResponseData, GetProjectsHandlerData, GetProjectsHandlerError, GetProjectsHandlerErrors, GetProjectsHandlerResponse, GetProjectsHandlerResponses, GetProjectsResponse, GetProjectUserAccessLevelData, GetProjectUserAccessLevelError, GetProjectUserAccessLevelErrors, GetProjectUserAccessLevelResponse, GetProjectUserAccessLevelResponses, GetReminderData, GetReminderError, GetReminderErrors, GetReminderResponse, GetReminderResponses, GetRingStatusData, GetRingStatusError, GetRingStatusErrors, GetRingStatusResponse, GetRingStatusResponses, GetSelfBotData, GetSelfBotError, GetSelfBotErrors, GetSelfBotResponse, GetSelfBotResponses, GetSelfHarnessData, GetSelfHarnessError, GetSelfHarnessErrors, GetSelfHarnessResponse, GetSelfHarnessResponses, GetSlackImportData, GetSlackImportErrors, GetSlackImportResponse, GetSlackImportResponses, GetSystemSkillsHandlerData, GetSystemSkillsHandlerError, GetSystemSkillsHandlerErrors, GetSystemSkillsHandlerResponse, GetSystemSkillsHandlerResponses, GetUserDocumentsHandlerData, GetUserDocumentsHandlerError, GetUserDocumentsHandlerErrors, GetUserDocumentsHandlerResponse, GetUserDocumentsHandlerResponses, GetUserDocumentViewLocationData, GetUserDocumentViewLocationError, GetUserDocumentViewLocationErrors, GetUserDocumentViewLocationResponse, GetUserDocumentViewLocationResponses, GetUserHistoryResponse, GetViewsHandlerData, GetViewsHandlerError, GetViewsHandlerErrors, GetViewsHandlerResponse, GetViewsHandlerResponses, GetWebhookData, GetWebhookError, GetWebhookErrors, GetWebhookResponse, GetWebhookResponses, GithubLabelFacet, GithubPullRequest, GithubPullRequestChangesPatchResponse, GithubPullRequestChangesResponse, GithubPullRequestCheckRun, GithubPullRequestComment, GithubPullRequestFacets, GithubPullRequestLabel, GithubPullRequestReview, GithubPullRequestReviewDecision, GithubPullRequestReviewState, GithubPullRequestsResponse, GithubPullRequestUser, GithubRepositoryFacet, GithubUserFacet, GitRefDto, GroupedInitialParams, GroupedPageParams, GroupedSoupGroupPage, GroupedSoupInitialPage, GroupedSoupPage, GroupedSoupSort, GuestId, GuestJoinRequest, HandlerData, HandlerError, HandlerErrors, HandlerResponse, HandlerResponses, Harness, HarnessAgent, HarnessId, HarnessOwner, HarnessSession, HashMap, HealthHandlerData, HealthHandlerResponse, HealthHandlerResponses, HighlightType, ImportCounters, ImportDatabaseTableData, ImportDatabaseTableError, ImportDatabaseTableErrors, ImportDatabaseTableResponse, ImportDatabaseTableResponses, ImportedAuthor, ImportError, ImportLimits, ImportPage, ImportProgress, ImportTable, ImportWarning, InferColumnTypeOutcome, InferColumnTypeRequest, InferDatabaseColumnTypeData, InferDatabaseColumnTypeError, InferDatabaseColumnTypeErrors, InferDatabaseColumnTypeResponse, InferDatabaseColumnTypeResponses, InFlightTurnSummary, IngestTranscriptData, IngestTranscriptError, IngestTranscriptErrors, IngestTranscriptResponses, InitializeUserDocumentsData, InitializeUserDocumentsError, InitializeUserDocumentsErrors, InitializeUserDocumentsResponse, InitializeUserDocumentsResponses, InitialPropertyValue, InitiativeDetail, InitiativeFilters, InitiativeId, InitiativeList, InitiativeSummary, InputReceivedMetadata, InstallSyncData, InstallSyncErrors, InteractionReason, InviteMeetingRequest, InviteMeetingUsersRequest, Item, ItemWithUserAccessLevel, JobId, JobProcessingResultHandlerData, JobProcessingResultHandlerError, JobProcessingResultHandlerErrors, JobProcessingResultHandlerResponse, JobProcessingResultHandlerResponses, JobStatus, JoinChannelByCodeData, JoinChannelByCodeError, JoinChannelByCodeErrors, JoinChannelByCodeResponses, JoinChannelData, JoinChannelError, JoinChannelErrors, JoinChannelResponses, KeySegment, Lane, LaneKey, LatestMessage, LeaveCallResponse, LeaveChannelData, LeaveChannelError, LeaveChannelErrors, LeaveChannelResponses, LeaveOrEndCallData, LeaveOrEndCallError, LeaveOrEndCallErrors, LeaveOrEndCallResponse, LeaveOrEndCallResponses, LinkShare, ListAgentsData, ListAgentsError, ListAgentsErrors, ListAgentsResponse, ListAgentsResponses, ListBotChannelsData, ListBotChannelsError, ListBotChannelsErrors, ListBotChannelsResponse, ListBotChannelsResponses, ListChannelLabelsData, ListChannelLabelsError, ListChannelLabelsErrors, ListChannelLabelsResponse, ListChannelLabelsResponses, ListCompanyContactsData, ListCompanyContactsError, ListCompanyContactsErrors, ListCompanyContactsResponse, ListCompanyContactsResponses, ListDatabaseColumnCastsData, ListDatabaseColumnCastsError, ListDatabaseColumnCastsErrors, ListDatabaseColumnCastsResponse, ListDatabaseColumnCastsResponses, ListDatabasesData, ListDatabasesError, ListDatabasesErrors, ListDatabasesResponse, ListDatabasesResponses, ListedDatabase, ListEmailRemindersData, ListEmailRemindersError, ListEmailRemindersErrors, ListEmailRemindersResponse, ListEmailRemindersResponses, ListFavoritesData, ListFavoritesError, ListFavoritesErrors, ListFavoritesResponse, ListFavoritesResponses, ListHarnessAgentsData, ListHarnessAgentsError, ListHarnessAgentsErrors, ListHarnessAgentsResponse, ListHarnessAgentsResponses, ListHarnessesData, ListHarnessesError, ListHarnessesErrors, ListHarnessesResponse, ListHarnessesResponses, ListHarnessSessionsData, ListHarnessSessionsError, ListHarnessSessionsErrors, ListHarnessSessionsResponse, ListHarnessSessionsResponses, ListInitiativesData, ListInitiativesError, ListInitiativesErrors, ListInitiativesResponse, ListInitiativesResponses, ListOccurrencesData, ListOccurrencesErrors, ListOccurrencesResponse, ListOccurrencesResponses, ListReminderCollectionData, ListReminderCollectionError, ListReminderCollectionErrors, ListReminderCollectionResponse, ListReminderCollectionResponses, ListRemindersData, ListRemindersError, ListRemindersErrors, ListRemindersResponse, ListRemindersResponses, ListSlackImportsData, ListSlackImportsResponse, ListSlackImportsResponses, ListTeamOutOfOfficeData, ListTeamOutOfOfficeErrors, ListTeamOutOfOfficeResponse, ListTeamOutOfOfficeResponses, ListUserApiKeysData, ListUserApiKeysError, ListUserApiKeysErrors, ListUserApiKeysResponse, ListUserApiKeysResponses, ListWebhooksData, ListWebhooksError, ListWebhooksErrors, ListWebhooksResponse, ListWebhooksResponse2, ListWebhooksResponses, LocationResponseData, LocationResponseV3, MacroUserIdStr, Meeting, MeetingCancelData, MeetingCancelError, MeetingCancelErrors, MeetingCancelPreparationData, MeetingCancelPreparationError, MeetingCancelPreparationErrors, MeetingCancelPreparationResponse, MeetingCancelPreparationResponses, MeetingCancelResponse, MeetingCancelResponses, MeetingCreateData, MeetingCreateError, MeetingCreateErrors, MeetingCreateResponse, MeetingCreateResponses, MeetingGuestJoinData, MeetingGuestJoinError, MeetingGuestJoinErrors, MeetingGuestJoinResponse, MeetingGuestJoinResponses, MeetingGuestParticipantsData, MeetingGuestParticipantsError, MeetingGuestParticipantsErrors, MeetingGuestParticipantsResponse, MeetingGuestParticipantsResponses, MeetingInviteData, MeetingInviteError, MeetingInviteErrors, MeetingInvitePermissions, MeetingInvitePermissionsData, MeetingInvitePermissionsError, MeetingInvitePermissionsErrors, MeetingInvitePermissionsResponse, MeetingInvitePermissionsResponses, MeetingInviteResponse, MeetingInviteResponses, MeetingInviteUsersData, MeetingInviteUsersError, MeetingInviteUsersErrors, MeetingInviteUsersResponse, MeetingInviteUsersResponses, MeetingJoinData, MeetingJoinError, MeetingJoinErrors, MeetingJoinResponse, MeetingJoinResponses, MeetingLeaveData, MeetingLeaveError, MeetingLeaveErrors, MeetingLeaveResponse, MeetingLeaveResponses, MeetingListActiveData, MeetingListActiveError, MeetingListActiveErrors, MeetingListActiveResponse, MeetingListActiveResponses, MeetingListData, MeetingListError, MeetingListErrors, MeetingListResponse, MeetingListResponses, MeetingLookupData, MeetingLookupError, MeetingLookupErrors, MeetingLookupResponse, MeetingLookupResponses, MeetingParticipant, MeetingParticipants, MeetingParticipantsData, MeetingParticipantsError, MeetingParticipantsErrors, MeetingParticipantsResponse, MeetingParticipantsResponses, MeetingPreparation, MeetingPrepareData, MeetingPrepareError, MeetingPrepareErrors, MeetingPrepareResponse, MeetingPrepareResponses, MeetingShareData, MeetingShareError, MeetingShareErrors, MeetingShareResponse, MeetingShareResponses, MeetingsResponse, MeetingToken, MeetingUpdateData, MeetingUpdateError, MeetingUpdateErrors, MeetingUpdateResponse, MeetingUpdateResponses, MentionPreviewsData, MentionPreviewsErrors, MentionPreviewsResponse, MentionPreviewsResponses, Message, MessageAttachment, MessageAttachmentCreatedMetadata, MessageAttachmentRemovedMetadata, MessageChange, MessageCursor, MessageDeletedMetadata, MessageDirection, MessageEvent, MessageEventAttachment, MessageListItem, MessageMentionedMetadata, MessagePage, MessageParent, MessagePatch, MessagePatchedMetadata, MessagePostedMetadata, MessageThread, MessageThreadPreview, MessageTimelineData, MessageTimelineQuery, MessageTimelineResponse, MessageTimelineResponses, MessageTopicEvent, NewAttachment, NewColumn, NewOption, NewThreadAnchor, NewView, NotificationFilters, NotificationState, NumberOperator, OpRefusalResponse, OpResult, OptionRef, PairingDetails, Params, ParticipantRole, PatchBotRequest, PatchChannelData, PatchChannelError, PatchChannelErrors, PatchChannelRequest, PatchChannelResponse, PatchChannelResponses, PatchMessageNotificationPolicy, PatchProjectRequestV2, PatchThreadRequestV2, PatchViewHandlerData, PatchViewHandlerError, PatchViewHandlerErrors, PatchViewHandlerResponses, PatchWebhookData, PatchWebhookError, PatchWebhookErrors, PatchWebhookRequest, PatchWebhookResponse, PatchWebhookResponses, PdfAnchor, PdfAnchorId, PdfHighlightAnchor, PdfHighlightAnchorRequest, PdfHighlightRect, PdfHighlightRectAnchorRequest, PdfPlaceableCommentAnchor, PendingClaimResponse, PermanentlyDeleteDocumentData, PermanentlyDeleteDocumentError, PermanentlyDeleteDocumentErrors, PermanentlyDeleteDocumentResponse, PermanentlyDeleteDocumentResponses, PermanentlyDeleteProjectData, PermanentlyDeleteProjectError, PermanentlyDeleteProjectErrors, PermanentlyDeleteProjectResponse, PermanentlyDeleteProjectResponses, PinnedItem, PinRequest, PostActivityData, PostActivityError, PostActivityErrors, PostActivityRequest, PostActivityResponse, PostActivityResponses, PostChannelBotWebhookData, PostChannelBotWebhookError, PostChannelBotWebhookErrors, PostChannelBotWebhookResponse, PostChannelBotWebhookResponses, PostGroupedSoupAstGroupPageRequest, PostGroupedSoupAstInitialRequest, PostGroupedSoupAstRequest, PostItemsSoupAstData, PostItemsSoupAstError, PostItemsSoupAstErrors, PostItemsSoupAstGroupedData, PostItemsSoupAstGroupedError, PostItemsSoupAstGroupedErrors, PostItemsSoupAstGroupedResponse, PostItemsSoupAstGroupedResponses, PostItemsSoupAstResponse, PostItemsSoupAstResponses, PostItemsSoupData, PostItemsSoupError, PostItemsSoupErrors, PostItemsSoupResponse, PostItemsSoupResponses, PostMessage, PostMessageNotificationPolicy, PostSoupAstRequest, PostSoupRequest, PresaveDocumentHandlerData, PresaveDocumentHandlerError, PresaveDocumentHandlerErrors, PresaveDocumentHandlerResponse, PresaveDocumentHandlerResponses, PreSaveDocumentRequest, PreSaveDocumentResponse, PreSaveDocumentResponseData, PresenceOperator, PresignedUrl, PreviewSmartTagData, PreviewSmartTagError, PreviewSmartTagErrors, PreviewSmartTagResponse, PreviewSmartTagResponses, Project, ProjectDeleteResponseData, ProjectDocumentStatus, ProjectFilters, ProjectPreview, ProjectPreviewData, PropertyDefinition, PropertyDefinitionWithOptions, PropertyFilter, PropertyInput, PropertyOption, PropertyOptionValue, PropertyOwner, PropertyValue, PutCrmTeamSettingsData, PutCrmTeamSettingsError, PutCrmTeamSettingsErrors, PutCrmTeamSettingsResponse, PutCrmTeamSettingsResponses, PutCrmTeamStagesData, PutCrmTeamStagesError, PutCrmTeamStagesErrors, PutCrmTeamStagesResponse, PutCrmTeamStagesResponses, QueryDefinition, ReactionInput, RecentlyDeletedData, RecentlyDeletedError, RecentlyDeletedErrors, RecentlyDeletedResponse, RecentlyDeletedResponseData, RecentlyDeletedResponses, RegisterSlackImportUploadsData, RegisterSlackImportUploadsErrors, RegisterSlackImportUploadsResponse, RegisterSlackImportUploadsResponses, RegisterUploads, Reminder, ReminderCollectionPage, ReminderCollectionRow, ReminderFilters, ReminderReference, ReminderSchedule, RemindersList, RemoveBotFromChannelByBotData, RemoveBotFromChannelByBotError, RemoveBotFromChannelByBotErrors, RemoveBotFromChannelByBotResponse, RemoveBotFromChannelByBotResponses, RemoveFavoriteByEntityData, RemoveFavoriteByEntityError, RemoveFavoriteByEntityErrors, RemoveFavoriteByEntityResponses, RemoveParticipantsData, RemoveParticipantsError, RemoveParticipantsErrors, RemoveParticipantsRequest, RemoveParticipantsResponses, RemovePinHandlerData, RemovePinHandlerError, RemovePinHandlerErrors, RemovePinHandlerResponse, RemovePinHandlerResponses, RenameChannelLabelData, RenameChannelLabelError, RenameChannelLabelErrors, RenameChannelLabelRequest, RenameChannelLabelResponse, RenameChannelLabelResponses, ReorderFavoritesData, ReorderFavoritesError, ReorderFavoritesErrors, ReorderFavoritesRequest, ReorderFavoritesResponses, ReorderPinRequest, ReorderPinsHandlerData, ReorderPinsHandlerError, ReorderPinsHandlerErrors, ReorderPinsHandlerResponse, ReorderPinsHandlerResponses, ReplaceCrmStagesRequest, RequestedHarnessScope, RequestedLayout, ResetCrmTeamStagesData, ResetCrmTeamStagesError, ResetCrmTeamStagesErrors, ResetCrmTeamStagesResponse, ResetCrmTeamStagesResponses, RevertDeleteDocumentData, RevertDeleteDocumentError, RevertDeleteDocumentErrors, RevertDeleteDocumentResponse, RevertDeleteDocumentResponses, RevertDeleteProjectData, RevertDeleteProjectError, RevertDeleteProjectErrors, RevertDeleteProjectResponse, RevertDeleteProjectResponses, RingStatus, RingStatusResponse, RowChange, RowChangeKind, RowChanges, RowHistoryEntry, RowHistoryResponse, RowsChange, RowsResult, S3ObjectInfo, SaveBomPart, SaveDatabaseQueryData, SaveDatabaseQueryError, SaveDatabaseQueryErrors, SaveDatabaseQueryResponse, SaveDatabaseQueryResponses, SaveDocumentHandlerData, SaveDocumentHandlerError, SaveDocumentHandlerErrors, SaveDocumentHandlerResponse, SaveDocumentHandlerResponses, SaveDocumentRequest, SaveDocumentResponse, SaveDocumentResponseData, SavedQuery, SaveQueryRequest, SearchContactsData, SearchContactsError, SearchContactsErrors, SearchContactsResponse, SearchContactsResponse2, SearchContactsResponses, SearchState, SessionDeletedMetadata, SessionIdentity, SessionMentionedMetadata, SessionOpenedMetadata, SessionRenamedMetadata, SessionSettledMetadata, SessionStoppedMetadata, SetChannelLabelData, SetChannelLabelError, SetChannelLabelErrors, SetChannelLabelRequest, SetChannelLabelResponse, SetChannelLabelResponses, SetChannelPictureData, SetChannelPictureError, SetChannelPictureErrors, SetChannelPictureRequest, SetChannelPictureResponse, SetChannelPictureResponses, SetCompanyHiddenData, SetCompanyHiddenError, SetCompanyHiddenErrors, SetCompanyHiddenRequest, SetCompanyHiddenResponse, SetCompanyHiddenResponses, SetCompanyNameRequest, SetContactHiddenData, SetContactHiddenError, SetContactHiddenErrors, SetContactHiddenRequest, SetContactHiddenResponse, SetContactHiddenResponses, SetContactNameRequest, SetCrmCompanyNameData, SetCrmCompanyNameError, SetCrmCompanyNameErrors, SetCrmCompanyNameResponse, SetCrmCompanyNameResponses, SetCrmContactNameData, SetCrmContactNameError, SetCrmContactNameErrors, SetCrmContactNameResponse, SetCrmContactNameResponses, SetDocumentTeamShareData, SetDocumentTeamShareError, SetDocumentTeamShareErrors, SetDocumentTeamShareRequest, SetDocumentTeamShareResponse, SetDocumentTeamShareResponses, SetEmailFollowupData, SetEmailFollowupError, SetEmailFollowupErrors, SetEmailFollowupResponse, SetEmailFollowupResponses, SetEmailSyncData, SetEmailSyncError, SetEmailSyncErrors, SetEmailSyncRequest, SetEmailSyncResponse, SetEmailSyncResponses, SetOperator, SetPropertyValue, Sha256Digest, ShareDatabaseAwarenessData, ShareDatabaseAwarenessError, ShareDatabaseAwarenessErrors, ShareDatabaseAwarenessResponse, ShareDatabaseAwarenessResponses, SharedEmailFilter, SharePermissionV2, ShortIdResponse, SimpleMention, SimpleSaveData, SimpleSaveError, SimpleSaveErrors, SimpleSaveResponse, SimpleSaveResponses, SkippedCell, SlackCompleteRequest, SlackCreateRequest, SlackRegisterRequest, SlackTimestamp, SlackUserId, SmartTagChannelMatch, SmartTagPreview, SortDirection, SortKey, SoupAgentSessionSoupPropertiesField, SoupApiItem, SoupApiSort, SoupApiSortDirection, SoupAttachment, SoupCalendarEventSoupPropertiesField, SoupCalendarEventTime, SoupCallRecordGuest, SoupCallRecordParticipant, SoupCallRecordSoupPropertiesField, SoupChannel, SoupChannelThread, SoupChatSoupPropertiesField, SoupContact, SoupCountedReaction, SoupCrmCompanySoupPropertiesField, SoupCrmDomain, SoupDatabaseRowSoupPropertiesField, SoupDocumentSoupPropertiesField, SoupDocumentSubType, SoupEmailThreadPreview, SoupEnrichedEmailThreadPreviewSoupPropertiesField, SoupForeignEntity, SoupInitiativeSoupPropertiesField, SoupItem, SoupLabel, SoupLabelListVisibility, SoupLabelType, SoupMessageAttachment, SoupMessageListVisibility, SoupMessageSender, SoupMessageSenderType, SoupPage, SoupProjectSoupPropertiesField, SoupPropertiesField, SoupProperty, SoupReminderReference, SoupReminderSchedule, SoupReminderSoupPropertiesField, SoupThreadInfo, SoupThreadReply, SourceBinding, SourceId, SourceIdentity, StarterDatabase, StarterDocumentsResponse, StoredGithubPullRequest, StreamEventsData, StreamEventsError, StreamEventsErrors, StreamEventsResponse, StreamEventsResponses, String, SuccessResponse, SurfaceState, SyncServiceVersionId, SystemSkillSummary, Table, TableChange, TableChanged, TableChanges, TableDetail, TableResult, TableVersion, TagFilterMode, TakenId, TaskFilters, TeamOutOfOfficeItem, TeamOutOfOfficeResponse, TeamRole, TextOperator, ThreadAnchor, ThreadOrigin, ThreadPatch, ThreadState, ToggleShareWithTeamData, ToggleShareWithTeamError, ToggleShareWithTeamErrors, ToggleShareWithTeamResponse, ToggleShareWithTeamResponses, TouchedColumn, TouchedRow, TranscribeDictationData, TranscribeDictationError, TranscribeDictationErrors, TranscribeDictationResponse, TranscribeDictationResponses, TranscribeResponse, TranscriptSegmentRequest, TurnEndedMetadata, TurnStartedMetadata, TurnSummary, TypedSuccessResponse, TypedSuccessResponseGetDocumentResponseData, TypingInput, UndoChangeResponse, UndoDatabaseChangeData, UndoDatabaseChangeError, UndoDatabaseChangeErrors, UndoDatabaseChangeResponse, UndoDatabaseChangeResponses, UndoOutcome, UndoRefusal, UpdateAgentData, UpdateAgentError, UpdateAgentErrors, UpdateAgentRequest, UpdateAgentResponse, UpdateAgentResponses, UpdateChannelSharePermission, UpdateCrmTeamSettingsRequest, UpdateDatabasePermissionsData, UpdateDatabasePermissionsError, UpdateDatabasePermissionsErrors, UpdateDatabasePermissionsResponse, UpdateDatabasePermissionsResponses, UpdateInitiativeData, UpdateInitiativeError, UpdateInitiativeErrors, UpdateInitiativeRequest, UpdateInitiativeResponse, UpdateInitiativeResponses, UpdateMeetingRequest, UpdateOperation, UpdateReminderData, UpdateReminderError, UpdateReminderErrors, UpdateReminderRequest, UpdateReminderResponse, UpdateReminderResponses, UpdateSharePermissionRequestV2, UploadDescriptor, UploadDocumentStatus, UploadExtractFolderHandlerData, UploadExtractFolderHandlerError, UploadExtractFolderHandlerErrors, UploadExtractFolderHandlerResponse, UploadExtractFolderHandlerResponses, UploadExtractFolderRequest, UploadFolderHandlerData, UploadFolderHandlerError, UploadFolderHandlerErrors, UploadFolderHandlerResponse, UploadFolderHandlerResponses, UploadFolderRequest, UploadGrant, UploadId, UpsertHistoryHandlerData, UpsertHistoryHandlerError, UpsertHistoryHandlerErrors, UpsertHistoryHandlerResponse, UpsertHistoryHandlerResponses, UpsertUserDocumentViewLocationData, UpsertUserDocumentViewLocationError, UpsertUserDocumentViewLocationErrors, UpsertUserDocumentViewLocationRequest, UpsertUserDocumentViewLocationResponse, UpsertUserDocumentViewLocationResponses, UserApiKeyId, UserApiKeyInfo, UserApiKeysList, UserDocumentsResponse, UserDocumentViewLocation, UserDocumentViewLocationResponse, UserPinsResponse, UserViewsResponse, ValidateDocumentPermissionsTokenData, ValidateDocumentPermissionsTokenError, ValidateDocumentPermissionsTokenErrors, ValidateDocumentPermissionsTokenResponse, ValidateDocumentPermissionsTokenResponses, ValidateWebhookData, ValidateWebhookError, ValidateWebhookErrors, ValidateWebhookResponse, ValidateWebhookResponse2, ValidateWebhookResponses, Vec, VersionedTable, View, ViewChange, ViewColumn, ViewLayout, ViewPatch, ViewPosition, ViewPositionsResponse, ViewQuery, ViewResult, ViewsResponse, WaitingForInputMetadata, Webhook, WebhookEvent, WebhookFilter, WebhookScope, WebhookStatus, WebhookValidationTestEvent, WithCallId, WithChannelId, WithDocumentId, WithProjectId } from './types.gen';diff --git a/packages/sdk/generated/storage/sdk.gen.ts b/packages/sdk/generated/storage/sdk.gen.tsindex c0572cffa2..08324377c0 100644--- a/packages/sdk/generated/storage/sdk.gen.ts+++ b/packages/sdk/generated/storage/sdk.gen.ts@@ -2,7 +2,7 @@import type { Client, ClientMeta, Options as Options2, RequestResult, ServerSentEventsResult, TDataShape } from './client';import { client } from './client.gen';-import type { AddFavoriteData, AddFavoriteErrors, AddFavoriteResponses, AddParticipantsData, AddParticipantsErrors, AddParticipantsResponses, AddPinHandlerData, AddPinHandlerErrors, AddPinHandlerResponses, ApplyDatabaseOpsData, ApplyDatabaseOpsErrors, ApplyDatabaseOpsResponses, ApproveHarnessPairingData, ApproveHarnessPairingErrors, ApproveHarnessPairingResponses, AssignInitiativeTasksData, AssignInitiativeTasksErrors, AssignInitiativeTasksResponses, BulkWakeupSyncServiceDocumentsData, BulkWakeupSyncServiceDocumentsErrors, BulkWakeupSyncServiceDocumentsResponses, CallWebhookData, CallWebhookErrors, CallWebhookResponses, CancelSlackImportData, CancelSlackImportErrors, CancelSlackImportResponses, CheckActiveCallData, CheckActiveCallErrors, CheckActiveCallResponses, ClaimHarnessPairingData, ClaimHarnessPairingErrors, ClaimHarnessPairingResponses, CompleteSlackImportUploadsData, CompleteSlackImportUploadsErrors, CompleteSlackImportUploadsResponses, ConvertDatabaseColumnData, ConvertDatabaseColumnErrors, ConvertDatabaseColumnResponses, CopyDocumentData, CopyDocumentErrors, CopyDocumentResponses, CreateAgentData, CreateAgentErrors, CreateAgentResponses, CreateAnchorData, CreateAnchorErrors, CreateAnchorResponses, CreateChannelData, CreateChannelErrors, CreateChannelLabelData, CreateChannelLabelErrors, CreateChannelLabelResponses, CreateChannelResponses, CreateChannelScopedBotData, CreateChannelScopedBotErrors, CreateChannelScopedBotResponses, CreateCollabSurfaceTokenData, CreateCollabSurfaceTokenErrors, CreateCollabSurfaceTokenResponses, CreateCrmCompanyData, CreateCrmCompanyErrors, CreateCrmCompanyResponses, CreateCrmContactData, CreateCrmContactErrors, CreateCrmContactResponses, CreateDatabaseData, CreateDatabaseErrors, CreateDatabaseResponses, CreateDocumentData, CreateDocumentErrors, CreateDocumentResponses, CreateEntityMentionData, CreateEntityMentionErrors, CreateEntityMentionResponses, CreateHarnessPairingData, CreateHarnessPairingErrors, CreateHarnessPairingResponses, CreateInitiativeData, CreateInitiativeErrors, CreateInitiativeResponses, CreateInstructionsHandlerData, CreateInstructionsHandlerErrors, CreateInstructionsHandlerResponses, CreateMarkdownHandlerData, CreateMarkdownHandlerErrors, CreateMarkdownHandlerResponses, CreateProjectHandlerData, CreateProjectHandlerErrors, CreateProjectHandlerResponses, CreateReminderData, CreateReminderErrors, CreateReminderResponses, CreateSkillHandlerData, CreateSkillHandlerErrors, CreateSkillHandlerResponses, CreateSlackImportData, CreateSlackImportErrors, CreateSlackImportResponses, CreateSnippetHandlerData, CreateSnippetHandlerErrors, CreateSnippetHandlerResponses, CreateTaskHandlerData, CreateTaskHandlerErrors, CreateTaskHandlerResponses, CreateUserApiKeyData, CreateUserApiKeyErrors, CreateUserApiKeyResponses, CreateViewHandlerData, CreateViewHandlerErrors, CreateViewHandlerResponses, CreateWebhookData, CreateWebhookErrors, CreateWebhookResponses, DeleteAnchorData, DeleteAnchorErrors, DeleteAnchorResponses, DeleteCallRecordData, DeleteCallRecordErrors, DeleteCallRecordResponses, DeleteChannelData, DeleteChannelErrors, DeleteChannelLabelData, DeleteChannelLabelErrors, DeleteChannelLabelResponses, DeleteChannelResponses, DeleteCollabSurfaceData, DeleteCollabSurfaceErrors, DeleteCollabSurfaceResponses, DeleteDocumentData, DeleteDocumentErrors, DeleteDocumentResponses, DeleteEntityMentionData, DeleteEntityMentionErrors, DeleteEntityMentionResponses, DeleteHarnessData, DeleteHarnessErrors, DeleteHarnessResponses, DeleteHistoryHandlerData, DeleteHistoryHandlerErrors, DeleteHistoryHandlerResponses, DeleteInitiativeData, DeleteInitiativeErrors, DeleteInitiativeResponses, DeleteProjectHandlerData, DeleteProjectHandlerErrors, DeleteProjectHandlerResponses, DeleteReminderData, DeleteReminderErrors, DeleteReminderResponses, DeleteSelfHarnessData, DeleteSelfHarnessErrors, DeleteSelfHarnessResponses, DeleteUserApiKeyData, DeleteUserApiKeyErrors, DeleteUserApiKeyResponses, DeleteUserDocumentViewLocationData, DeleteUserDocumentViewLocationErrors, DeleteUserDocumentViewLocationResponses, DeleteViewHandlerData, DeleteViewHandlerErrors, DeleteViewHandlerResponses, DeleteWebhookData, DeleteWebhookErrors, DeleteWebhookResponses, EditAnchorData, EditAnchorErrors, EditAnchorResponses, EditCallRecordData, EditCallRecordErrors, EditCallRecordResponses, EditCallTranscriptData, EditCallTranscriptErrors, EditCallTranscriptResponses, EditDocumentData, EditDocumentErrors, EditDocumentResponses, EditProjectV2Data, EditProjectV2Errors, EditProjectV2Responses, EditThreadV2Data, EditThreadV2Errors, EditThreadV2Responses, EnsureCollabSurfaceData, EnsureCollabSurfaceErrors, EnsureCollabSurfaceResponses, EnsureStarterHandlerData, EnsureStarterHandlerErrors, EnsureStarterHandlerResponses, EntityMessageCreateData, EntityMessageCreateResponses, EntityMessageDeleteMessageData, EntityMessageDeleteMessageResponses, EntityMessageDeleteThreadData, EntityMessageDeleteThreadResponses, EntityMessageEditData, EntityMessageEditResponses, EntityMessageGetMessageData, EntityMessageGetMessageResponses, EntityMessageGetThreadData, EntityMessageGetThreadResponses, EntityMessageLegacyData, EntityMessageLegacyResponses, EntityMessagePatchThreadData, EntityMessagePatchThreadResponses, EntityMessageReactData, EntityMessageReactResponses, EntityMessageTypingData, EntityMessageTypingResponses, ExcludeDefaultViewHandlerData, ExcludeDefaultViewHandlerErrors, ExcludeDefaultViewHandlerResponses, ExportDocumentData, ExportDocumentErrors, ExportDocumentResponses, FinalizeSlackImportData, FinalizeSlackImportErrors, FinalizeSlackImportResponses, GetActiveCallsData, GetActiveCallsErrors, GetActiveCallsResponses, GetActivityData, GetActivityErrors, GetActivityResponses, GetAttachmentReferencesData, GetAttachmentReferencesErrors, GetAttachmentReferencesResponses, GetBatchCallRecordPreviewData, GetBatchCallRecordPreviewErrors, GetBatchCallRecordPreviewResponses, GetBatchChannelPreviewData, GetBatchChannelPreviewErrors, GetBatchChannelPreviewResponses, GetBatchPreviewHandlerData, GetBatchPreviewHandlerErrors, GetBatchPreviewHandlerResponses, GetBatchProjectPreviewData, GetBatchProjectPreviewErrors, GetBatchProjectPreviewResponses, GetBotOwnerProfilesData, GetBotOwnerProfilesErrors, GetBotOwnerProfilesResponses, GetCallRecordData, GetCallRecordErrors, GetCallRecordResponses, GetChannelAttachmentsData, GetChannelAttachmentsErrors, GetChannelAttachmentsResponses, GetChannelData, GetChannelErrors, GetChannelJoinLinkData, GetChannelJoinLinkErrors, GetChannelJoinLinkResponses, GetChannelParticipantsData, GetChannelParticipantsErrors, GetChannelParticipantsResponses, GetChannelResponses, GetChannelsData, GetChannelsErrors, GetChannelsResponses, GetCollabSurfaceData, GetCollabSurfaceErrors, GetCollabSurfaceResponses, GetCompanyData, GetCompanyErrors, GetCompanyResponses, GetContactByEmailData, GetContactByEmailErrors, GetContactByEmailResponses, GetContactData, GetContactErrors, GetContactResponses, GetCrmTeamSettingsData, GetCrmTeamSettingsErrors, GetCrmTeamSettingsResponses, GetDatabaseData, GetDatabaseErrors, GetDatabasePermissionsData, GetDatabasePermissionsErrors, GetDatabasePermissionsResponses, GetDatabaseQueryData, GetDatabaseQueryErrors, GetDatabaseQueryResponses, GetDatabaseResponses, GetDatabaseRowHistoryData, GetDatabaseRowHistoryErrors, GetDatabaseRowHistoryResponses, GetDatabaseTableChangesData, GetDatabaseTableChangesErrors, GetDatabaseTableChangesResponses, GetDatabaseViewPositionsData, GetDatabaseViewPositionsErrors, GetDatabaseViewPositionsResponses, GetDocumentAnchorsData, GetDocumentAnchorsErrors, GetDocumentAnchorsResponses, GetDocumentBranchNameData, GetDocumentBranchNameErrors, GetDocumentBranchNameResponses, GetDocumentByTeamSlugData, GetDocumentByTeamSlugErrors, GetDocumentByTeamSlugResponses, GetDocumentData, GetDocumentErrors, GetDocumentGithubPullRequestsData, GetDocumentGithubPullRequestsErrors, GetDocumentGithubPullRequestsResponses, GetDocumentListHandlerData, GetDocumentListHandlerErrors, GetDocumentListHandlerResponses, GetDocumentLocationV3Data, GetDocumentLocationV3Errors, GetDocumentLocationV3Responses, GetDocumentPermissionsTokenData, GetDocumentPermissionsTokenErrors, GetDocumentPermissionsTokenResponses, GetDocumentPermissionsV2Data, GetDocumentPermissionsV2Errors, GetDocumentPermissionsV2Responses, GetDocumentProcessingResultData, GetDocumentProcessingResultErrors, GetDocumentProcessingResultResponses, GetDocumentResponses, GetDocumentShortIdData, GetDocumentShortIdErrors, GetDocumentShortIdResponses, GetDocumentTeamShareData, GetDocumentTeamShareErrors, GetDocumentTeamShareResponses, GetDocumentVersionData, GetDocumentVersionErrors, GetDocumentVersionResponses, GetDocumentViewsHandlerData, GetDocumentViewsHandlerErrors, GetDocumentViewsHandlerResponses, GetEmailFollowupData, GetEmailFollowupErrors, GetEmailFollowupResponses, GetEntityPermissionData, GetEntityPermissionErrors, GetEntityPermissionResponses, GetForeignEntityBySourceData, GetForeignEntityBySourceErrors, GetForeignEntityBySourceResponses, GetForeignEntityData, GetForeignEntityErrors, GetForeignEntityResponses, GetGithubPullRequestChangesData, GetGithubPullRequestChangesErrors, GetGithubPullRequestChangesPatchData, GetGithubPullRequestChangesPatchErrors, GetGithubPullRequestChangesPatchResponses, GetGithubPullRequestChangesResponses, GetGithubPullRequestData, GetGithubPullRequestErrors, GetGithubPullRequestFacetsData, GetGithubPullRequestFacetsErrors, GetGithubPullRequestFacetsResponses, GetGithubPullRequestResponses, GetHarnessPairingData, GetHarnessPairingErrors, GetHarnessPairingResponses, GetHistoryHandlerData, GetHistoryHandlerErrors, GetHistoryHandlerResponses, GetInitiativeData, GetInitiativeErrors, GetInitiativeResponses, GetInstructionsHandlerData, GetInstructionsHandlerErrors, GetInstructionsHandlerResponses, GetItemsSoupData, GetItemsSoupErrors, GetItemsSoupResponses, GetLocationHandlerData, GetLocationHandlerErrors, GetLocationHandlerResponses, GetOrCreateCallData, GetOrCreateCallErrors, GetOrCreateCallResponses, GetOrCreateDmData, GetOrCreateDmErrors, GetOrCreateDmResponses, GetOrCreatePrivateData, GetOrCreatePrivateErrors, GetOrCreatePrivateResponses, GetPendingProjectsHandlerData, GetPendingProjectsHandlerErrors, GetPendingProjectsHandlerResponses, GetPinsHandlerData, GetPinsHandlerErrors, GetPinsHandlerResponses, GetProjectContentHandlerData, GetProjectContentHandlerErrors, GetProjectContentHandlerResponses, GetProjectHandlerData, GetProjectHandlerErrors, GetProjectHandlerResponses, GetProjectPermissionsV2Data, GetProjectPermissionsV2Errors, GetProjectPermissionsV2Responses, GetProjectsHandlerData, GetProjectsHandlerErrors, GetProjectsHandlerResponses, GetProjectUserAccessLevelData, GetProjectUserAccessLevelErrors, GetProjectUserAccessLevelResponses, GetReminderData, GetReminderErrors, GetReminderResponses, GetRingStatusData, GetRingStatusErrors, GetRingStatusResponses, GetSelfBotData, GetSelfBotErrors, GetSelfBotResponses, GetSelfHarnessData, GetSelfHarnessErrors, GetSelfHarnessResponses, GetSlackImportData, GetSlackImportErrors, GetSlackImportResponses, GetSystemSkillsHandlerData, GetSystemSkillsHandlerErrors, GetSystemSkillsHandlerResponses, GetUserDocumentsHandlerData, GetUserDocumentsHandlerErrors, GetUserDocumentsHandlerResponses, GetUserDocumentViewLocationData, GetUserDocumentViewLocationErrors, GetUserDocumentViewLocationResponses, GetViewsHandlerData, GetViewsHandlerErrors, GetViewsHandlerResponses, GetWebhookData, GetWebhookErrors, GetWebhookResponses, HandlerData, HandlerErrors, HandlerResponses, HealthHandlerData, HealthHandlerResponses, ImportDatabaseTableData, ImportDatabaseTableErrors, ImportDatabaseTableResponses, InferDatabaseColumnTypeData, InferDatabaseColumnTypeErrors, InferDatabaseColumnTypeResponses, IngestTranscriptData, IngestTranscriptErrors, IngestTranscriptResponses, InitializeUserDocumentsData, InitializeUserDocumentsErrors, InitializeUserDocumentsResponses, InstallSyncData, InstallSyncErrors, JobProcessingResultHandlerData, JobProcessingResultHandlerErrors, JobProcessingResultHandlerResponses, JoinChannelByCodeData, JoinChannelByCodeErrors, JoinChannelByCodeResponses, JoinChannelData, JoinChannelErrors, JoinChannelResponses, LeaveChannelData, LeaveChannelErrors, LeaveChannelResponses, LeaveOrEndCallData, LeaveOrEndCallErrors, LeaveOrEndCallResponses, ListAgentsData, ListAgentsErrors, ListAgentsResponses, ListBotChannelsData, ListBotChannelsErrors, ListBotChannelsResponses, ListChannelLabelsData, ListChannelLabelsErrors, ListChannelLabelsResponses, ListCompanyContactsData, ListCompanyContactsErrors, ListCompanyContactsResponses, ListDatabaseColumnCastsData, ListDatabaseColumnCastsErrors, ListDatabaseColumnCastsResponses, ListDatabasesData, ListDatabasesErrors, ListDatabasesResponses, ListEmailRemindersData, ListEmailRemindersErrors, ListEmailRemindersResponses, ListFavoritesData, ListFavoritesErrors, ListFavoritesResponses, ListHarnessAgentsData, ListHarnessAgentsErrors, ListHarnessAgentsResponses, ListHarnessesData, ListHarnessesErrors, ListHarnessesResponses, ListHarnessSessionsData, ListHarnessSessionsErrors, ListHarnessSessionsResponses, ListInitiativesData, ListInitiativesErrors, ListInitiativesResponses, ListOccurrencesData, ListOccurrencesErrors, ListOccurrencesResponses, ListReminderCollectionData, ListReminderCollectionErrors, ListReminderCollectionResponses, ListRemindersData, ListRemindersErrors, ListRemindersResponses, ListSlackImportsData, ListSlackImportsResponses, ListTeamOutOfOfficeData, ListTeamOutOfOfficeErrors, ListTeamOutOfOfficeResponses, ListUserApiKeysData, ListUserApiKeysErrors, ListUserApiKeysResponses, ListWebhooksData, ListWebhooksErrors, ListWebhooksResponses, MeetingCancelData, MeetingCancelErrors, MeetingCancelPreparationData, MeetingCancelPreparationErrors, MeetingCancelPreparationResponses, MeetingCancelResponses, MeetingCreateData, MeetingCreateErrors, MeetingCreateResponses, MeetingGuestJoinData, MeetingGuestJoinErrors, MeetingGuestJoinResponses, MeetingGuestParticipantsData, MeetingGuestParticipantsErrors, MeetingGuestParticipantsResponses, MeetingInviteData, MeetingInviteErrors, MeetingInvitePermissionsData, MeetingInvitePermissionsErrors, MeetingInvitePermissionsResponses, MeetingInviteResponses, MeetingInviteUsersData, MeetingInviteUsersErrors, MeetingInviteUsersResponses, MeetingJoinData, MeetingJoinErrors, MeetingJoinResponses, MeetingLeaveData, MeetingLeaveErrors, MeetingLeaveResponses, MeetingListActiveData, MeetingListActiveErrors, MeetingListActiveResponses, MeetingListData, MeetingListErrors, MeetingListResponses, MeetingLookupData, MeetingLookupErrors, MeetingLookupResponses, MeetingParticipantsData, MeetingParticipantsErrors, MeetingParticipantsResponses, MeetingPrepareData, MeetingPrepareErrors, MeetingPrepareResponses, MeetingShareData, MeetingShareErrors, MeetingShareResponses, MeetingUpdateData, MeetingUpdateErrors, MeetingUpdateResponses, MentionPreviewsData, MentionPreviewsErrors, MentionPreviewsResponses, MessageTimelineData, MessageTimelineResponses, PatchChannelData, PatchChannelErrors, PatchChannelResponses, PatchViewHandlerData, PatchViewHandlerErrors, PatchViewHandlerResponses, PatchWebhookData, PatchWebhookErrors, PatchWebhookResponses, PermanentlyDeleteDocumentData, PermanentlyDeleteDocumentErrors, PermanentlyDeleteDocumentResponses, PermanentlyDeleteProjectData, PermanentlyDeleteProjectErrors, PermanentlyDeleteProjectResponses, PostActivityData, PostActivityErrors, PostActivityResponses, PostChannelBotWebhookData, PostChannelBotWebhookErrors, PostChannelBotWebhookResponses, PostItemsSoupAstData, PostItemsSoupAstErrors, PostItemsSoupAstGroupedData, PostItemsSoupAstGroupedErrors, PostItemsSoupAstGroupedResponses, PostItemsSoupAstResponses, PostItemsSoupData, PostItemsSoupErrors, PostItemsSoupResponses, PresaveDocumentHandlerData, PresaveDocumentHandlerErrors, PresaveDocumentHandlerResponses, PreviewSmartTagData, PreviewSmartTagErrors, PreviewSmartTagResponses, PutCrmTeamSettingsData, PutCrmTeamSettingsErrors, PutCrmTeamSettingsResponses, PutCrmTeamStagesData, PutCrmTeamStagesErrors, PutCrmTeamStagesResponses, RecentlyDeletedData, RecentlyDeletedErrors, RecentlyDeletedResponses, RegisterSlackImportUploadsData, RegisterSlackImportUploadsErrors, RegisterSlackImportUploadsResponses, RemoveBotFromChannelByBotData, RemoveBotFromChannelByBotErrors, RemoveBotFromChannelByBotResponses, RemoveFavoriteByEntityData, RemoveFavoriteByEntityErrors, RemoveFavoriteByEntityResponses, RemoveParticipantsData, RemoveParticipantsErrors, RemoveParticipantsResponses, RemovePinHandlerData, RemovePinHandlerErrors, RemovePinHandlerResponses, RenameChannelLabelData, RenameChannelLabelErrors, RenameChannelLabelResponses, ReorderFavoritesData, ReorderFavoritesErrors, ReorderFavoritesResponses, ReorderPinsHandlerData, ReorderPinsHandlerErrors, ReorderPinsHandlerResponses, ResetCrmTeamStagesData, ResetCrmTeamStagesErrors, ResetCrmTeamStagesResponses, RevertDeleteDocumentData, RevertDeleteDocumentErrors, RevertDeleteDocumentResponses, RevertDeleteProjectData, RevertDeleteProjectErrors, RevertDeleteProjectResponses, SaveDatabaseQueryData, SaveDatabaseQueryErrors, SaveDatabaseQueryResponses, SaveDocumentHandlerData, SaveDocumentHandlerErrors, SaveDocumentHandlerResponses, SearchContactsData, SearchContactsErrors, SearchContactsResponses, SetChannelLabelData, SetChannelLabelErrors, SetChannelLabelResponses, SetChannelPictureData, SetChannelPictureErrors, SetChannelPictureResponses, SetCompanyHiddenData, SetCompanyHiddenErrors, SetCompanyHiddenResponses, SetContactHiddenData, SetContactHiddenErrors, SetContactHiddenResponses, SetCrmCompanyNameData, SetCrmCompanyNameErrors, SetCrmCompanyNameResponses, SetCrmContactNameData, SetCrmContactNameErrors, SetCrmContactNameResponses, SetDocumentTeamShareData, SetDocumentTeamShareErrors, SetDocumentTeamShareResponses, SetEmailFollowupData, SetEmailFollowupErrors, SetEmailFollowupResponses, SetEmailSyncData, SetEmailSyncErrors, SetEmailSyncResponses, ShareDatabaseAwarenessData, ShareDatabaseAwarenessErrors, ShareDatabaseAwarenessResponses, SimpleSaveData, SimpleSaveErrors, SimpleSaveResponses, StreamEventsData, StreamEventsErrors, StreamEventsResponse, StreamEventsResponses, ToggleShareWithTeamData, ToggleShareWithTeamErrors, ToggleShareWithTeamResponses, TranscribeDictationData, TranscribeDictationErrors, TranscribeDictationResponses, UnassignInitiativeTaskData, UnassignInitiativeTaskErrors, UnassignInitiativeTaskResponses, UndoDatabaseChangeData, UndoDatabaseChangeErrors, UndoDatabaseChangeResponses, UpdateAgentData, UpdateAgentErrors, UpdateAgentResponses, UpdateDatabasePermissionsData, UpdateDatabasePermissionsErrors, UpdateDatabasePermissionsResponses, UpdateInitiativeData, UpdateInitiativeErrors, UpdateInitiativeResponses, UpdateReminderData, UpdateReminderErrors, UpdateReminderResponses, UploadExtractFolderHandlerData, UploadExtractFolderHandlerErrors, UploadExtractFolderHandlerResponses, UploadFolderHandlerData, UploadFolderHandlerErrors, UploadFolderHandlerResponses, UpsertHistoryHandlerData, UpsertHistoryHandlerErrors, UpsertHistoryHandlerResponses, UpsertUserDocumentViewLocationData, UpsertUserDocumentViewLocationErrors, UpsertUserDocumentViewLocationResponses, ValidateDocumentPermissionsTokenData, ValidateDocumentPermissionsTokenErrors, ValidateDocumentPermissionsTokenResponses, ValidateWebhookData, ValidateWebhookErrors, ValidateWebhookResponses } from './types.gen';+import type { AddFavoriteData, AddFavoriteErrors, AddFavoriteResponses, AddParticipantsData, AddParticipantsErrors, AddParticipantsResponses, AddPinHandlerData, AddPinHandlerErrors, AddPinHandlerResponses, ApplyDatabaseOpsData, ApplyDatabaseOpsErrors, ApplyDatabaseOpsResponses, ApproveHarnessPairingData, ApproveHarnessPairingErrors, ApproveHarnessPairingResponses, BulkWakeupSyncServiceDocumentsData, BulkWakeupSyncServiceDocumentsErrors, BulkWakeupSyncServiceDocumentsResponses, CallWebhookData, CallWebhookErrors, CallWebhookResponses, CancelSlackImportData, CancelSlackImportErrors, CancelSlackImportResponses, CheckActiveCallData, CheckActiveCallErrors, CheckActiveCallResponses, ClaimHarnessPairingData, ClaimHarnessPairingErrors, ClaimHarnessPairingResponses, CompleteSlackImportUploadsData, CompleteSlackImportUploadsErrors, CompleteSlackImportUploadsResponses, ConvertDatabaseColumnData, ConvertDatabaseColumnErrors, ConvertDatabaseColumnResponses, CopyDocumentData, CopyDocumentErrors, CopyDocumentResponses, CreateAgentData, CreateAgentErrors, CreateAgentResponses, CreateAnchorData, CreateAnchorErrors, CreateAnchorResponses, CreateChannelData, CreateChannelErrors, CreateChannelLabelData, CreateChannelLabelErrors, CreateChannelLabelResponses, CreateChannelResponses, CreateChannelScopedBotData, CreateChannelScopedBotErrors, CreateChannelScopedBotResponses, CreateCollabSurfaceTokenData, CreateCollabSurfaceTokenErrors, CreateCollabSurfaceTokenResponses, CreateCrmCompanyData, CreateCrmCompanyErrors, CreateCrmCompanyResponses, CreateCrmContactData, CreateCrmContactErrors, CreateCrmContactResponses, CreateDatabaseData, CreateDatabaseErrors, CreateDatabaseResponses, CreateDocumentData, CreateDocumentErrors, CreateDocumentResponses, CreateEntityMentionData, CreateEntityMentionErrors, CreateEntityMentionResponses, CreateHarnessPairingData, CreateHarnessPairingErrors, CreateHarnessPairingResponses, CreateInitiativeData, CreateInitiativeErrors, CreateInitiativeResponses, CreateInstructionsHandlerData, CreateInstructionsHandlerErrors, CreateInstructionsHandlerResponses, CreateMarkdownHandlerData, CreateMarkdownHandlerErrors, CreateMarkdownHandlerResponses, CreateProjectHandlerData, CreateProjectHandlerErrors, CreateProjectHandlerResponses, CreateReminderData, CreateReminderErrors, CreateReminderResponses, CreateSkillHandlerData, CreateSkillHandlerErrors, CreateSkillHandlerResponses, CreateSlackImportData, CreateSlackImportErrors, CreateSlackImportResponses, CreateSnippetHandlerData, CreateSnippetHandlerErrors, CreateSnippetHandlerResponses, CreateTaskHandlerData, CreateTaskHandlerErrors, CreateTaskHandlerResponses, CreateUserApiKeyData, CreateUserApiKeyErrors, CreateUserApiKeyResponses, CreateViewHandlerData, CreateViewHandlerErrors, CreateViewHandlerResponses, CreateWebhookData, CreateWebhookErrors, CreateWebhookResponses, DeleteAnchorData, DeleteAnchorErrors, DeleteAnchorResponses, DeleteCallRecordData, DeleteCallRecordErrors, DeleteCallRecordResponses, DeleteChannelData, DeleteChannelErrors, DeleteChannelLabelData, DeleteChannelLabelErrors, DeleteChannelLabelResponses, DeleteChannelResponses, DeleteCollabSurfaceData, DeleteCollabSurfaceErrors, DeleteCollabSurfaceResponses, DeleteDocumentData, DeleteDocumentErrors, DeleteDocumentResponses, DeleteEntityMentionData, DeleteEntityMentionErrors, DeleteEntityMentionResponses, DeleteHarnessData, DeleteHarnessErrors, DeleteHarnessResponses, DeleteHistoryHandlerData, DeleteHistoryHandlerErrors, DeleteHistoryHandlerResponses, DeleteInitiativeData, DeleteInitiativeErrors, DeleteInitiativeResponses, DeleteProjectHandlerData, DeleteProjectHandlerErrors, DeleteProjectHandlerResponses, DeleteReminderData, DeleteReminderErrors, DeleteReminderResponses, DeleteSelfHarnessData, DeleteSelfHarnessErrors, DeleteSelfHarnessResponses, DeleteUserApiKeyData, DeleteUserApiKeyErrors, DeleteUserApiKeyResponses, DeleteUserDocumentViewLocationData, DeleteUserDocumentViewLocationErrors, DeleteUserDocumentViewLocationResponses, DeleteViewHandlerData, DeleteViewHandlerErrors, DeleteViewHandlerResponses, DeleteWebhookData, DeleteWebhookErrors, DeleteWebhookResponses, EditAnchorData, EditAnchorErrors, EditAnchorResponses, EditCallRecordData, EditCallRecordErrors, EditCallRecordResponses, EditCallTranscriptData, EditCallTranscriptErrors, EditCallTranscriptResponses, EditDocumentData, EditDocumentErrors, EditDocumentResponses, EditProjectV2Data, EditProjectV2Errors, EditProjectV2Responses, EditThreadV2Data, EditThreadV2Errors, EditThreadV2Responses, EnsureCollabSurfaceData, EnsureCollabSurfaceErrors, EnsureCollabSurfaceResponses, EnsureStarterHandlerData, EnsureStarterHandlerErrors, EnsureStarterHandlerResponses, EntityMessageCreateData, EntityMessageCreateResponses, EntityMessageDeleteMessageData, EntityMessageDeleteMessageResponses, EntityMessageDeleteThreadData, EntityMessageDeleteThreadResponses, EntityMessageEditData, EntityMessageEditResponses, EntityMessageGetMessageData, EntityMessageGetMessageResponses, EntityMessageGetThreadData, EntityMessageGetThreadResponses, EntityMessageLegacyData, EntityMessageLegacyResponses, EntityMessagePatchThreadData, EntityMessagePatchThreadResponses, EntityMessageReactData, EntityMessageReactResponses, EntityMessageTypingData, EntityMessageTypingResponses, ExcludeDefaultViewHandlerData, ExcludeDefaultViewHandlerErrors, ExcludeDefaultViewHandlerResponses, ExportDocumentData, ExportDocumentErrors, ExportDocumentResponses, FinalizeSlackImportData, FinalizeSlackImportErrors, FinalizeSlackImportResponses, GetActiveCallsData, GetActiveCallsErrors, GetActiveCallsResponses, GetActivityData, GetActivityErrors, GetActivityResponses, GetAttachmentReferencesData, GetAttachmentReferencesErrors, GetAttachmentReferencesResponses, GetBatchCallRecordPreviewData, GetBatchCallRecordPreviewErrors, GetBatchCallRecordPreviewResponses, GetBatchChannelPreviewData, GetBatchChannelPreviewErrors, GetBatchChannelPreviewResponses, GetBatchPreviewHandlerData, GetBatchPreviewHandlerErrors, GetBatchPreviewHandlerResponses, GetBatchProjectPreviewData, GetBatchProjectPreviewErrors, GetBatchProjectPreviewResponses, GetBotOwnerProfilesData, GetBotOwnerProfilesErrors, GetBotOwnerProfilesResponses, GetCallRecordData, GetCallRecordErrors, GetCallRecordResponses, GetChannelAttachmentsData, GetChannelAttachmentsErrors, GetChannelAttachmentsResponses, GetChannelData, GetChannelErrors, GetChannelJoinLinkData, GetChannelJoinLinkErrors, GetChannelJoinLinkResponses, GetChannelParticipantsData, GetChannelParticipantsErrors, GetChannelParticipantsResponses, GetChannelResponses, GetChannelsData, GetChannelsErrors, GetChannelsResponses, GetCollabSurfaceData, GetCollabSurfaceErrors, GetCollabSurfaceResponses, GetCompanyData, GetCompanyErrors, GetCompanyResponses, GetContactByEmailData, GetContactByEmailErrors, GetContactByEmailResponses, GetContactData, GetContactErrors, GetContactResponses, GetCrmTeamSettingsData, GetCrmTeamSettingsErrors, GetCrmTeamSettingsResponses, GetDatabaseData, GetDatabaseErrors, GetDatabasePermissionsData, GetDatabasePermissionsErrors, GetDatabasePermissionsResponses, GetDatabaseQueryData, GetDatabaseQueryErrors, GetDatabaseQueryResponses, GetDatabaseResponses, GetDatabaseRowHistoryData, GetDatabaseRowHistoryErrors, GetDatabaseRowHistoryResponses, GetDatabaseTableChangesData, GetDatabaseTableChangesErrors, GetDatabaseTableChangesResponses, GetDatabaseViewPositionsData, GetDatabaseViewPositionsErrors, GetDatabaseViewPositionsResponses, GetDocumentAnchorsData, GetDocumentAnchorsErrors, GetDocumentAnchorsResponses, GetDocumentBranchNameData, GetDocumentBranchNameErrors, GetDocumentBranchNameResponses, GetDocumentByTeamSlugData, GetDocumentByTeamSlugErrors, GetDocumentByTeamSlugResponses, GetDocumentData, GetDocumentErrors, GetDocumentGithubPullRequestsData, GetDocumentGithubPullRequestsErrors, GetDocumentGithubPullRequestsResponses, GetDocumentListHandlerData, GetDocumentListHandlerErrors, GetDocumentListHandlerResponses, GetDocumentLocationV3Data, GetDocumentLocationV3Errors, GetDocumentLocationV3Responses, GetDocumentPermissionsTokenData, GetDocumentPermissionsTokenErrors, GetDocumentPermissionsTokenResponses, GetDocumentPermissionsV2Data, GetDocumentPermissionsV2Errors, GetDocumentPermissionsV2Responses, GetDocumentProcessingResultData, GetDocumentProcessingResultErrors, GetDocumentProcessingResultResponses, GetDocumentResponses, GetDocumentShortIdData, GetDocumentShortIdErrors, GetDocumentShortIdResponses, GetDocumentTeamShareData, GetDocumentTeamShareErrors, GetDocumentTeamShareResponses, GetDocumentVersionData, GetDocumentVersionErrors, GetDocumentVersionResponses, GetDocumentViewsHandlerData, GetDocumentViewsHandlerErrors, GetDocumentViewsHandlerResponses, GetEmailFollowupData, GetEmailFollowupErrors, GetEmailFollowupResponses, GetEntityPermissionData, GetEntityPermissionErrors, GetEntityPermissionResponses, GetForeignEntityBySourceData, GetForeignEntityBySourceErrors, GetForeignEntityBySourceResponses, GetForeignEntityData, GetForeignEntityErrors, GetForeignEntityResponses, GetGithubPullRequestChangesData, GetGithubPullRequestChangesErrors, GetGithubPullRequestChangesPatchData, GetGithubPullRequestChangesPatchErrors, GetGithubPullRequestChangesPatchResponses, GetGithubPullRequestChangesResponses, GetGithubPullRequestData, GetGithubPullRequestErrors, GetGithubPullRequestFacetsData, GetGithubPullRequestFacetsErrors, GetGithubPullRequestFacetsResponses, GetGithubPullRequestResponses, GetHarnessPairingData, GetHarnessPairingErrors, GetHarnessPairingResponses, GetHistoryHandlerData, GetHistoryHandlerErrors, GetHistoryHandlerResponses, GetInitiativeData, GetInitiativeErrors, GetInitiativeResponses, GetInstructionsHandlerData, GetInstructionsHandlerErrors, GetInstructionsHandlerResponses, GetItemsSoupData, GetItemsSoupErrors, GetItemsSoupResponses, GetLocationHandlerData, GetLocationHandlerErrors, GetLocationHandlerResponses, GetOrCreateCallData, GetOrCreateCallErrors, GetOrCreateCallResponses, GetOrCreateDmData, GetOrCreateDmErrors, GetOrCreateDmResponses, GetOrCreatePrivateData, GetOrCreatePrivateErrors, GetOrCreatePrivateResponses, GetPendingProjectsHandlerData, GetPendingProjectsHandlerErrors, GetPendingProjectsHandlerResponses, GetPinsHandlerData, GetPinsHandlerErrors, GetPinsHandlerResponses, GetProjectContentHandlerData, GetProjectContentHandlerErrors, GetProjectContentHandlerResponses, GetProjectHandlerData, GetProjectHandlerErrors, GetProjectHandlerResponses, GetProjectPermissionsV2Data, GetProjectPermissionsV2Errors, GetProjectPermissionsV2Responses, GetProjectsHandlerData, GetProjectsHandlerErrors, GetProjectsHandlerResponses, GetProjectUserAccessLevelData, GetProjectUserAccessLevelErrors, GetProjectUserAccessLevelResponses, GetReminderData, GetReminderErrors, GetReminderResponses, GetRingStatusData, GetRingStatusErrors, GetRingStatusResponses, GetSelfBotData, GetSelfBotErrors, GetSelfBotResponses, GetSelfHarnessData, GetSelfHarnessErrors, GetSelfHarnessResponses, GetSlackImportData, GetSlackImportErrors, GetSlackImportResponses, GetSystemSkillsHandlerData, GetSystemSkillsHandlerErrors, GetSystemSkillsHandlerResponses, GetUserDocumentsHandlerData, GetUserDocumentsHandlerErrors, GetUserDocumentsHandlerResponses, GetUserDocumentViewLocationData, GetUserDocumentViewLocationErrors, GetUserDocumentViewLocationResponses, GetViewsHandlerData, GetViewsHandlerErrors, GetViewsHandlerResponses, GetWebhookData, GetWebhookErrors, GetWebhookResponses, HandlerData, HandlerErrors, HandlerResponses, HealthHandlerData, HealthHandlerResponses, ImportDatabaseTableData, ImportDatabaseTableErrors, ImportDatabaseTableResponses, InferDatabaseColumnTypeData, InferDatabaseColumnTypeErrors, InferDatabaseColumnTypeResponses, IngestTranscriptData, IngestTranscriptErrors, IngestTranscriptResponses, InitializeUserDocumentsData, InitializeUserDocumentsErrors, InitializeUserDocumentsResponses, InstallSyncData, InstallSyncErrors, JobProcessingResultHandlerData, JobProcessingResultHandlerErrors, JobProcessingResultHandlerResponses, JoinChannelByCodeData, JoinChannelByCodeErrors, JoinChannelByCodeResponses, JoinChannelData, JoinChannelErrors, JoinChannelResponses, LeaveChannelData, LeaveChannelErrors, LeaveChannelResponses, LeaveOrEndCallData, LeaveOrEndCallErrors, LeaveOrEndCallResponses, ListAgentsData, ListAgentsErrors, ListAgentsResponses, ListBotChannelsData, ListBotChannelsErrors, ListBotChannelsResponses, ListChannelLabelsData, ListChannelLabelsErrors, ListChannelLabelsResponses, ListCompanyContactsData, ListCompanyContactsErrors, ListCompanyContactsResponses, ListDatabaseColumnCastsData, ListDatabaseColumnCastsErrors, ListDatabaseColumnCastsResponses, ListDatabasesData, ListDatabasesErrors, ListDatabasesResponses, ListEmailRemindersData, ListEmailRemindersErrors, ListEmailRemindersResponses, ListFavoritesData, ListFavoritesErrors, ListFavoritesResponses, ListHarnessAgentsData, ListHarnessAgentsErrors, ListHarnessAgentsResponses, ListHarnessesData, ListHarnessesErrors, ListHarnessesResponses, ListHarnessSessionsData, ListHarnessSessionsErrors, ListHarnessSessionsResponses, ListInitiativesData, ListInitiativesErrors, ListInitiativesResponses, ListOccurrencesData, ListOccurrencesErrors, ListOccurrencesResponses, ListReminderCollectionData, ListReminderCollectionErrors, ListReminderCollectionResponses, ListRemindersData, ListRemindersErrors, ListRemindersResponses, ListSlackImportsData, ListSlackImportsResponses, ListTeamOutOfOfficeData, ListTeamOutOfOfficeErrors, ListTeamOutOfOfficeResponses, ListUserApiKeysData, ListUserApiKeysErrors, ListUserApiKeysResponses, ListWebhooksData, ListWebhooksErrors, ListWebhooksResponses, MeetingCancelData, MeetingCancelErrors, MeetingCancelPreparationData, MeetingCancelPreparationErrors, MeetingCancelPreparationResponses, MeetingCancelResponses, MeetingCreateData, MeetingCreateErrors, MeetingCreateResponses, MeetingGuestJoinData, MeetingGuestJoinErrors, MeetingGuestJoinResponses, MeetingGuestParticipantsData, MeetingGuestParticipantsErrors, MeetingGuestParticipantsResponses, MeetingInviteData, MeetingInviteErrors, MeetingInvitePermissionsData, MeetingInvitePermissionsErrors, MeetingInvitePermissionsResponses, MeetingInviteResponses, MeetingInviteUsersData, MeetingInviteUsersErrors, MeetingInviteUsersResponses, MeetingJoinData, MeetingJoinErrors, MeetingJoinResponses, MeetingLeaveData, MeetingLeaveErrors, MeetingLeaveResponses, MeetingListActiveData, MeetingListActiveErrors, MeetingListActiveResponses, MeetingListData, MeetingListErrors, MeetingListResponses, MeetingLookupData, MeetingLookupErrors, MeetingLookupResponses, MeetingParticipantsData, MeetingParticipantsErrors, MeetingParticipantsResponses, MeetingPrepareData, MeetingPrepareErrors, MeetingPrepareResponses, MeetingShareData, MeetingShareErrors, MeetingShareResponses, MeetingUpdateData, MeetingUpdateErrors, MeetingUpdateResponses, MentionPreviewsData, MentionPreviewsErrors, MentionPreviewsResponses, MessageTimelineData, MessageTimelineResponses, PatchChannelData, PatchChannelErrors, PatchChannelResponses, PatchViewHandlerData, PatchViewHandlerErrors, PatchViewHandlerResponses, PatchWebhookData, PatchWebhookErrors, PatchWebhookResponses, PermanentlyDeleteDocumentData, PermanentlyDeleteDocumentErrors, PermanentlyDeleteDocumentResponses, PermanentlyDeleteProjectData, PermanentlyDeleteProjectErrors, PermanentlyDeleteProjectResponses, PostActivityData, PostActivityErrors, PostActivityResponses, PostChannelBotWebhookData, PostChannelBotWebhookErrors, PostChannelBotWebhookResponses, PostItemsSoupAstData, PostItemsSoupAstErrors, PostItemsSoupAstGroupedData, PostItemsSoupAstGroupedErrors, PostItemsSoupAstGroupedResponses, PostItemsSoupAstResponses, PostItemsSoupData, PostItemsSoupErrors, PostItemsSoupResponses, PresaveDocumentHandlerData, PresaveDocumentHandlerErrors, PresaveDocumentHandlerResponses, PreviewSmartTagData, PreviewSmartTagErrors, PreviewSmartTagResponses, PutCrmTeamSettingsData, PutCrmTeamSettingsErrors, PutCrmTeamSettingsResponses, PutCrmTeamStagesData, PutCrmTeamStagesErrors, PutCrmTeamStagesResponses, RecentlyDeletedData, RecentlyDeletedErrors, RecentlyDeletedResponses, RegisterSlackImportUploadsData, RegisterSlackImportUploadsErrors, RegisterSlackImportUploadsResponses, RemoveBotFromChannelByBotData, RemoveBotFromChannelByBotErrors, RemoveBotFromChannelByBotResponses, RemoveFavoriteByEntityData, RemoveFavoriteByEntityErrors, RemoveFavoriteByEntityResponses, RemoveParticipantsData, RemoveParticipantsErrors, RemoveParticipantsResponses, RemovePinHandlerData, RemovePinHandlerErrors, RemovePinHandlerResponses, RenameChannelLabelData, RenameChannelLabelErrors, RenameChannelLabelResponses, ReorderFavoritesData, ReorderFavoritesErrors, ReorderFavoritesResponses, ReorderPinsHandlerData, ReorderPinsHandlerErrors, ReorderPinsHandlerResponses, ResetCrmTeamStagesData, ResetCrmTeamStagesErrors, ResetCrmTeamStagesResponses, RevertDeleteDocumentData, RevertDeleteDocumentErrors, RevertDeleteDocumentResponses, RevertDeleteProjectData, RevertDeleteProjectErrors, RevertDeleteProjectResponses, SaveDatabaseQueryData, SaveDatabaseQueryErrors, SaveDatabaseQueryResponses, SaveDocumentHandlerData, SaveDocumentHandlerErrors, SaveDocumentHandlerResponses, SearchContactsData, SearchContactsErrors, SearchContactsResponses, SetChannelLabelData, SetChannelLabelErrors, SetChannelLabelResponses, SetChannelPictureData, SetChannelPictureErrors, SetChannelPictureResponses, SetCompanyHiddenData, SetCompanyHiddenErrors, SetCompanyHiddenResponses, SetContactHiddenData, SetContactHiddenErrors, SetContactHiddenResponses, SetCrmCompanyNameData, SetCrmCompanyNameErrors, SetCrmCompanyNameResponses, SetCrmContactNameData, SetCrmContactNameErrors, SetCrmContactNameResponses, SetDocumentTeamShareData, SetDocumentTeamShareErrors, SetDocumentTeamShareResponses, SetEmailFollowupData, SetEmailFollowupErrors, SetEmailFollowupResponses, SetEmailSyncData, SetEmailSyncErrors, SetEmailSyncResponses, ShareDatabaseAwarenessData, ShareDatabaseAwarenessErrors, ShareDatabaseAwarenessResponses, SimpleSaveData, SimpleSaveErrors, SimpleSaveResponses, StreamEventsData, StreamEventsErrors, StreamEventsResponse, StreamEventsResponses, ToggleShareWithTeamData, ToggleShareWithTeamErrors, ToggleShareWithTeamResponses, TranscribeDictationData, TranscribeDictationErrors, TranscribeDictationResponses, UndoDatabaseChangeData, UndoDatabaseChangeErrors, UndoDatabaseChangeResponses, UpdateAgentData, UpdateAgentErrors, UpdateAgentResponses, UpdateDatabasePermissionsData, UpdateDatabasePermissionsErrors, UpdateDatabasePermissionsResponses, UpdateInitiativeData, UpdateInitiativeErrors, UpdateInitiativeResponses, UpdateReminderData, UpdateReminderErrors, UpdateReminderResponses, UploadExtractFolderHandlerData, UploadExtractFolderHandlerErrors, UploadExtractFolderHandlerResponses, UploadFolderHandlerData, UploadFolderHandlerErrors, UploadFolderHandlerResponses, UpsertHistoryHandlerData, UpsertHistoryHandlerErrors, UpsertHistoryHandlerResponses, UpsertUserDocumentViewLocationData, UpsertUserDocumentViewLocationErrors, UpsertUserDocumentViewLocationResponses, ValidateDocumentPermissionsTokenData, ValidateDocumentPermissionsTokenErrors, ValidateDocumentPermissionsTokenResponses, ValidateWebhookData, ValidateWebhookErrors, ValidateWebhookResponses } from './types.gen';export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {/**@@ -1998,27 +1998,6 @@ export class Sdk extends HeyApiClient {});}- /**- * Assign tasks the caller can edit.- */- public assignInitiativeTasks<ThrowOnError extends boolean = false>(options: Options<AssignInitiativeTasksData, ThrowOnError>): RequestResult<AssignInitiativeTasksResponses, AssignInitiativeTasksErrors, ThrowOnError> {- return (options.client ?? this.client).put<AssignInitiativeTasksResponses, AssignInitiativeTasksErrors, ThrowOnError>({- url: '/initiatives/{initiative_id}/tasks',- ...options,- headers: {- 'Content-Type': 'application/json',- ...options.headers- }- });- }-- /**- * Unassign one task the caller can edit.- */- public unassignInitiativeTask<ThrowOnError extends boolean = false>(options: Options<UnassignInitiativeTaskData, ThrowOnError>): RequestResult<UnassignInitiativeTaskResponses, UnassignInitiativeTaskErrors, ThrowOnError> {- return (options.client ?? this.client).delete<UnassignInitiativeTaskResponses, UnassignInitiativeTaskErrors, ThrowOnError>({ url: '/initiatives/{initiative_id}/tasks/{task_id}', ...options });- }-/*** Gets the instructions document for the current user*/diff --git a/packages/sdk/generated/storage/types.gen.ts b/packages/sdk/generated/storage/types.gen.tsindex 0f17e09790..a0abcbffc9 100644--- a/packages/sdk/generated/storage/types.gen.ts+++ b/packages/sdk/generated/storage/types.gen.ts@@ -916,45 +916,6 @@ export type ApprovePairingRequest = {team_id?: string | null;};-/**- * Status written onto one assign result.- */-export type AssignTaskStatus = 'assigned' | 'moved' | 'notATask' | 'notFound' | 'skippedNoPermission';--/**- * Assign-tasks HTTP body.- */-export type AssignTasksRequest = {- /**- * Task ids to assign, in request order.- */- taskIds: Array<string>;-};--/**- * Assign-tasks HTTP response.- */-export type AssignTasksResponse = {- /**- * Outcomes in request order after dedupe.- */- results: Array<AssignTasksResult>;-};--/**- * Per-task outcome of an assign call.- */-export type AssignTasksResult = {- /**- * What happened to the task.- */- status: AssignTaskStatus;- /**- * Task id this outcome describes.- */- taskId: string;-};-/*** Attachment changes interpreted by the common command boundary.*/@@ -18502,70 +18463,6 @@ export type UpdateInitiativeResponses = {export type UpdateInitiativeResponse = UpdateInitiativeResponses[keyof UpdateInitiativeResponses];-export type AssignInitiativeTasksData = {- body: AssignTasksRequest;- path: {- /**- * Initiative identifier.- */- initiative_id: string;- };- query?: never;- url: '/initiatives/{initiative_id}/tasks';-};--export type AssignInitiativeTasksErrors = {- 400: ErrorResponse;- /**- * Missing or invalid credentials- */- 401: ErrorResponse;- 404: ErrorResponse;- 500: ErrorResponse;-};--export type AssignInitiativeTasksError = AssignInitiativeTasksErrors[keyof AssignInitiativeTasksErrors];--export type AssignInitiativeTasksResponses = {- 200: AssignTasksResponse;-};--export type AssignInitiativeTasksResponse = AssignInitiativeTasksResponses[keyof AssignInitiativeTasksResponses];--export type UnassignInitiativeTaskData = {- body?: never;- path: {- /**- * Initiative identifier.- */- initiative_id: string;- /**- * Task identifier.- */- task_id: string;- };- query?: never;- url: '/initiatives/{initiative_id}/tasks/{task_id}';-};--export type UnassignInitiativeTaskErrors = {- 400: ErrorResponse;- /**- * Missing or invalid credentials- */- 401: ErrorResponse;- 404: ErrorResponse;- 500: ErrorResponse;-};--export type UnassignInitiativeTaskError = UnassignInitiativeTaskErrors[keyof UnassignInitiativeTaskErrors];--export type UnassignInitiativeTaskResponses = {- 200: GenericSuccessResponse;-};--export type UnassignInitiativeTaskResponse = UnassignInitiativeTaskResponses[keyof UnassignInitiativeTaskResponses];-export type GetInstructionsHandlerData = {body?: never;path?: never;diff --git a/packages/sdk/specs/storage.json b/packages/sdk/specs/storage.jsonindex 6855ffe243..8afacdf6af 100644--- a/packages/sdk/specs/storage.json+++ b/packages/sdk/specs/storage.json@@ -12077,165 +12077,6 @@}}},- "/initiatives/{initiative_id}/tasks": {- "put": {- "tags": ["initiative"],- "summary": "Assign tasks the caller can edit.",- "operationId": "assign_initiative_tasks",- "parameters": [- {- "name": "initiative_id",- "in": "path",- "description": "Initiative identifier.",- "required": true,- "schema": {- "type": "string"- }- }- ],- "requestBody": {- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/AssignTasksRequest"- }- }- },- "required": true- },- "responses": {- "200": {- "description": "",- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/AssignTasksResponse"- }- }- }- },- "400": {- "description": "",- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/ErrorResponse"- }- }- }- },- "401": {- "description": "Missing or invalid credentials",- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/ErrorResponse"- }- }- }- },- "404": {- "description": "",- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/ErrorResponse"- }- }- }- },- "500": {- "description": "",- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/ErrorResponse"- }- }- }- }- }- }- },- "/initiatives/{initiative_id}/tasks/{task_id}": {- "delete": {- "tags": ["initiative"],- "summary": "Unassign one task the caller can edit.",- "operationId": "unassign_initiative_task",- "parameters": [- {- "name": "initiative_id",- "in": "path",- "description": "Initiative identifier.",- "required": true,- "schema": {- "type": "string"- }- },- {- "name": "task_id",- "in": "path",- "description": "Task identifier.",- "required": true,- "schema": {- "type": "string"- }- }- ],- "responses": {- "200": {- "description": "",- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/GenericSuccessResponse"- }- }- }- },- "400": {- "description": "",- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/ErrorResponse"- }- }- }- },- "401": {- "description": "Missing or invalid credentials",- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/ErrorResponse"- }- }- }- },- "404": {- "description": "",- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/ErrorResponse"- }- }- }- },- "500": {- "description": "",- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/ErrorResponse"- }- }- }- }- }- }- },"/instructions": {"get": {"tags": ["instructions::get_instructions"],@@ -17795,60 +17636,6 @@}}},- "AssignTaskStatus": {- "type": "string",- "description": "Status written onto one assign result.",- "enum": [- "assigned",- "moved",- "notATask",- "notFound",- "skippedNoPermission"- ]- },- "AssignTasksRequest": {- "type": "object",- "description": "Assign-tasks HTTP body.",- "required": ["taskIds"],- "properties": {- "taskIds": {- "type": "array",- "items": {- "type": "string"- },- "description": "Task ids to assign, in request order."- }- }- },- "AssignTasksResponse": {- "type": "object",- "description": "Assign-tasks HTTP response.",- "required": ["results"],- "properties": {- "results": {- "type": "array",- "items": {- "$ref": "#/components/schemas/AssignTasksResult"- },- "description": "Outcomes in request order after dedupe."- }- }- },- "AssignTasksResult": {- "type": "object",- "description": "Per-task outcome of an assign call.",- "required": ["taskId", "status"],- "properties": {- "status": {- "$ref": "#/components/schemas/AssignTaskStatus",- "description": "What happened to the task."- },- "taskId": {- "type": "string",- "description": "Task id this outcome describes."- }- }- },"AttachmentChange": {"oneOf": [{diff --git a/packages/sdk/src/coverage/skipped.ts b/packages/sdk/src/coverage/skipped.tsindex 6abc491e47..90de6940fc 100644--- a/packages/sdk/src/coverage/skipped.ts+++ b/packages/sdk/src/coverage/skipped.ts@@ -382,7 +382,6 @@ export const storageBacklog = ['setEmailFollowup','listEmailReminders','approveHarnessPairing',- 'assignInitiativeTasks','claimHarnessPairing','createAgent','createAnchor',@@ -447,7 +446,6 @@ export const storageBacklog = ['setChannelPicture','simpleSave','toggleShareWithTeam',- 'unassignInitiativeTask','updateAgent','updateInitiative','updateReminder',diff --git a/services/agent_harness_service/Cargo.toml b/services/agent_harness_service/Cargo.tomlindex f7ca0cf1d3..969520cc60 100644--- a/services/agent_harness_service/Cargo.toml+++ b/services/agent_harness_service/Cargo.toml@@ -79,6 +79,7 @@ macro_tower_layers = { path = "../../crates/macro_tower_layers" }notification = { path = "../../crates/notification" }rdkafka = { workspace = true }rootcause = { workspace = true }+system_properties = { path = "../../crates/system_properties" }channels = { path = "../../crates/channels", features = ["ports", "outbound"] }anyhow = { workspace = true }macro_user_id = { path = "../../crates/macro_user_id" }diff --git a/services/agent_harness_service/src/trigger.rs b/services/agent_harness_service/src/trigger.rsindex 438239f95f..feeefd06a2 100644--- a/services/agent_harness_service/src/trigger.rs+++ b/services/agent_harness_service/src/trigger.rs@@ -19,7 +19,6 @@ use entity_access::domain::{ports::EntityAccessService, service::EntityAccessSeruse entity_access::outbound::PgAccessRepository;use entity_registry::OwnerGrantPolicy;use entity_registry_db_utils::OwnedEntityRegistrar;-use initiative::{domain::ports::InitiativeRepo, outbound::PgInitiativeRepo};use kafka_util::{GroupName, InitialOffset, KafkaEventConsumer, consumer_span, record_span_error};use lexical_client::LexicalClient;use macro_event_broker::{@@ -36,6 +35,9 @@ use rdkafka::consumer::CommitMode;use rdkafka::message::{BorrowedMessage, Message as _};use sqlx::PgPool;use std::sync::Arc;+use system_properties::{+ PgSystemPropertiesRepository, SystemPropertiesService, SystemPropertiesServiceImpl,+};use tokio::time::{Duration, sleep};use tracing::Instrument as _;@@ -148,7 +150,7 @@ async fn run(),lexical.clone(),),- PgInitiativeRepo::new(pool.clone()),+ SystemPropertiesServiceImpl::new(PgSystemPropertiesRepository::new(pool.clone())),EntityAccessServiceImpl::new(PgAccessRepository::new(pool.clone())),);let images = VisionImageCaptioner::new(@@ -197,7 +199,7 @@ async fn run(None::<SilentAssignmentNotifications>,).with_event_broker(publisher.clone()),- PgInitiativeRepo::new(pool.clone()),+ SystemPropertiesServiceImpl::new(PgSystemPropertiesRepository::new(pool.clone())),EntityAccessServiceImpl::new(PgAccessRepository::new(pool)),);let consumer = KafkaEventConsumer::<AgentTriggerConsumerGroup>::from_env(&kafka_brokers)?;@@ -224,7 +226,7 @@ async fn consume<Events: TriggerEvents>(task_context: &impl TaskAssignmentContext,project_assignments: &ProjectAssignmentService<impl PropertiesService,- impl InitiativeRepo,+ impl SystemPropertiesService,impl EntityAccessService,>,) -> anyhow::Result<()> {@@ -276,8 +278,8 @@ async fn consume<Events: TriggerEvents>(process_task_assignment(trigger, publisher, messages, task_context, assignment).await?;}- if let Some(changes) = &decoded.project_tasks {- project_assignments.process(changes).await?;+ if let Some(added) = &decoded.project_task {+ project_assignments.process(added).await?;}commit_message(&consumer, kafka_message)?;Ok(())diff --git a/services/agent_trigger_service/Cargo.toml b/services/agent_trigger_service/Cargo.tomlindex 5751e48709..6c5736333c 100644--- a/services/agent_trigger_service/Cargo.toml+++ b/services/agent_trigger_service/Cargo.toml@@ -37,6 +37,7 @@ messages = { path = "../../crates/messages", features = ["broker", "delivery", "properties = { path = "../../crates/properties", default-features = false, features = ["outbound"] }rdkafka = { workspace = true }rootcause = { workspace = true }+system_properties = { path = "../../crates/system_properties" }serde_json = { workspace = true }sqlx = { workspace = true }static_file = { path = "../../crates/static_file" }diff --git a/services/agent_trigger_service/src/main.rs b/services/agent_trigger_service/src/main.rsindex 783347d051..27ffdb8d4d 100644--- a/services/agent_trigger_service/src/main.rs+++ b/services/agent_trigger_service/src/main.rs@@ -28,7 +28,6 @@ use entity_access::domain::{ports::EntityAccessService, service::EntityAccessSeruse entity_access::outbound::PgAccessRepository;use entity_registry::OwnerGrantPolicy;use entity_registry_db_utils::OwnedEntityRegistrar;-use initiative::{domain::ports::InitiativeRepo, outbound::PgInitiativeRepo};use kafka_util::{GroupName, InitialOffset, KafkaEventConsumer, consumer_span, record_span_error};use lexical_client::LexicalClient;use macro_entrypoint::{MacroEntrypoint, shutdown_signal};@@ -48,6 +47,9 @@ use rdkafka::consumer::CommitMode;use rdkafka::message::{BorrowedMessage, Message as _};use sqlx::postgres::PgPoolOptions;use std::sync::Arc;+use system_properties::{+ PgSystemPropertiesRepository, SystemPropertiesService, SystemPropertiesServiceImpl,+};use tracing::Instrument as _;struct AgentTriggerConsumerGroup;@@ -148,7 +150,7 @@ async fn run() -> anyhow::Result<()> {),lexical.clone(),),- PgInitiativeRepo::new(pool.clone()),+ SystemPropertiesServiceImpl::new(PgSystemPropertiesRepository::new(pool.clone())),EntityAccessServiceImpl::new(PgAccessRepository::new(pool.clone())),);let images = VisionImageCaptioner::new(@@ -197,7 +199,7 @@ async fn run() -> anyhow::Result<()> {None::<SilentAssignmentNotifications>,).with_event_broker(publisher.clone()),- PgInitiativeRepo::new(pool.clone()),+ SystemPropertiesServiceImpl::new(PgSystemPropertiesRepository::new(pool.clone())),EntityAccessServiceImpl::new(PgAccessRepository::new(pool.clone())),);let discussion_delivery = messages::domain::delivery::DiscussionDelivery::new(@@ -249,7 +251,7 @@ async fn consume<Events: TriggerEvents>(task_context: &impl TaskAssignmentContext,project_assignments: &ProjectAssignmentService<impl PropertiesService,- impl InitiativeRepo,+ impl SystemPropertiesService,impl EntityAccessService,>,) -> anyhow::Result<()> {@@ -306,8 +308,8 @@ async fn consume<Events: TriggerEvents>(if let Some(assignment) = &decoded.assignment {process_task_assignment(trigger, publisher, messages, task_context, assignment).await?;}- if let Some(changes) = &decoded.project_tasks {- project_assignments.process(changes).await?;+ if let Some(added) = &decoded.project_task {+ project_assignments.process(added).await?;}commit_message(&consumer, kafka_message)?;Ok(())diff --git a/services/document_storage_service/src/api/swagger.rs b/services/document_storage_service/src/api/swagger.rsindex 4a9811e6dc..b4ca9fe119 100644--- a/services/document_storage_service/src/api/swagger.rs+++ b/services/document_storage_service/src/api/swagger.rs@@ -123,7 +123,6 @@ use github_pull_requests::inbound::changes_router::{GithubPullRequestChangesPatchResponse, GithubPullRequestChangesResponse,};use initiative::domain::models::{- AssignTaskStatus, AssignTasksRequest, AssignTasksResponse, AssignTasksResult,CreateInitiativeRequest, InitialPropertyValue, InitiativeDetail, InitiativeId, InitiativeList,InitiativeSummary, UpdateInitiativeRequest,};@@ -455,8 +454,6 @@ use utoipa::OpenApi;initiative::inbound::axum_router::get::get_initiative_handler,initiative::inbound::axum_router::update::update_initiative_handler,initiative::inbound::axum_router::delete::delete_initiative_handler,- initiative::inbound::axum_router::assign_tasks::assign_initiative_tasks_handler,- initiative::inbound::axum_router::unassign_task::unassign_initiative_task_handler,// databasesdatabases::inbound::axum_router::list_databases_handler,databases::inbound::starter_router::ensure_starter_handler,@@ -740,10 +737,6 @@ use utoipa::OpenApi;CreateInitiativeRequest,InitialPropertyValue,UpdateInitiativeRequest,- AssignTasksRequest,- AssignTasksResult,- AssignTasksResponse,- AssignTaskStatus,CollabSurfaceResponse,CollabSurfaceTokenResponse,EnsureCollabSurfaceRequest,diff --git a/static_assets/schema.graphql b/static_assets/schema.graphqlindex 614d984b92..510cadf8cc 100644--- a/static_assets/schema.graphql+++ b/static_assets/schema.graphql@@ -171,18 +171,6 @@ type CompleteMutationRoot {Delete an initiative after its owner capability has been verified."""deleteInitiative(initiativeId: ID!): Boolean!- """- Assign or move tasks, preserving partial task authorization results.- """- assignInitiativeTasks(initiativeId: ID!, taskIds: [ID!]!): [InitiativeTaskAssignment!]!- """- Remove a task using project and task edit capabilities.- """- unassignInitiativeTask(initiativeId: ID!, taskId: ID!): Boolean!- """- Clear a task's project using task edit access, even after project access is revoked.- """- clearTaskInitiative(taskId: ID!): Boolean!}"""@@ -7084,10 +7072,6 @@ type GraphqlUser {"""initiativeTasks(initiativeId: ID!, input: InitiativeTasksInput): InitiativeTasksPage!"""- Initiative chips for tasks, without inaccessible project metadata.- """- taskInitiativeReferences(taskIds: [ID!]!): [TaskInitiativeReference!]!- """AI routines the authenticated user can access."""scheduledActions: [GraphqlScheduledAction!]!@@ -7336,46 +7320,6 @@ input InitiativeSharePermissionInput {channelSharePermissions: [InitiativeChannelShareInput!]}-"""-One result in the deduplicated request order.-"""-type InitiativeTaskAssignment {- """- Task whose assignment was attempted.- """- taskId: ID!- """- Domain result of this assignment.- """- status: InitiativeTaskAssignmentStatus!-}--"""-Per-task result of an assignment request.-"""-enum InitiativeTaskAssignmentStatus {- """- Newly assigned or already assigned here.- """- ASSIGNED- """- Moved from another initiative.- """- MOVED- """- Document exists but is not a task.- """- NOT_A_TASK- """- Task could not be found.- """- NOT_FOUND- """- Viewer cannot edit this task.- """- SKIPPED_NO_PERMISSION-}-"""Cursor pagination for visible initiative tasks."""@@ -7817,42 +7761,6 @@ type SoupUpdated {item: GraphqlSoupEntity!}-"""-Permission-filtered relationship between a task and its project.-"""-type TaskInitiativeReference {- """- Task whose relationship is described, never this object's identity.- """- taskId: ID!- """- Permission-filtered relationship state.- """- state: TaskInitiativeReferenceState!- """- The same initiative entity used by collection/detail queries.- """- initiative: GraphqlSoupInitiative-}--"""-Visibility state of a task's initiative.-"""-enum TaskInitiativeReferenceState {- """- Visible task without an initiative.- """- NONE- """- Task or initiative cannot be viewed.- """- UNAVAILABLE- """- Both task and initiative can be viewed.- """- VISIBLE-}-"""Input for adding or removing a label from an email thread."""