Skip to content

armgit / macro

Public Imported from GitHub
0

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

feat(initiatives): Add EntityType Initiative (#6393)

Will Hutchinson5ccd83f23a4d
diff --git a/apps/web/src/features/dynamic-ui/widgets/Timeline.tsx b/apps/web/src/features/dynamic-ui/widgets/Timeline.tsx
index 4b660146ca..4456e2d374 100644
--- a/apps/web/src/features/dynamic-ui/widgets/Timeline.tsx
+++ b/apps/web/src/features/dynamic-ui/widgets/Timeline.tsx
@@ -22,6 +22,7 @@ function toItemType(type: EntityRef['type']): ItemType | undefined {
'skill',
'agent_session',
'scheduled_action',
+ 'initiative',
() => undefined
)
.otherwise((itemType) => itemType);
diff --git a/apps/web/src/lib/queries/notification/user-notifications.ts b/apps/web/src/lib/queries/notification/user-notifications.ts
index 71644b6acb..46288efcb5 100644
--- a/apps/web/src/lib/queries/notification/user-notifications.ts
+++ b/apps/web/src/lib/queries/notification/user-notifications.ts
@@ -936,7 +936,8 @@ function notificationEntityTypeToSoupTag(
'crm_contact',
'skill',
'agent_session',
- 'scheduled_action'
+ 'scheduled_action',
+ 'initiative'
),
() => null
)
diff --git a/apps/web/src/lib/service-clients/service-cognition/generated/schemas/entityType.ts b/apps/web/src/lib/service-clients/service-cognition/generated/schemas/entityType.ts
index 66b3665f5c..7b3e84e916 100644
--- a/apps/web/src/lib/service-clients/service-cognition/generated/schemas/entityType.ts
+++ b/apps/web/src/lib/service-clients/service-cognition/generated/schemas/entityType.ts
@@ -30,4 +30,5 @@ export const EntityType = {
skill: 'skill',
agent_session: 'agent_session',
scheduled_action: 'scheduled_action',
+ initiative: 'initiative',
} as const;
diff --git a/apps/web/src/lib/service-clients/service-cognition/openapi.json b/apps/web/src/lib/service-clients/service-cognition/openapi.json
index b3085bb5f4..6abed633ba 100644
--- a/apps/web/src/lib/service-clients/service-cognition/openapi.json
+++ b/apps/web/src/lib/service-clients/service-cognition/openapi.json
@@ -2973,7 +2973,8 @@
"reminder",
"skill",
"agent_session",
- "scheduled_action"
+ "scheduled_action",
+ "initiative"
]
},
"ErrorBody": {
diff --git a/apps/web/src/lib/service-clients/service-connection/generated/schemas/entityType.ts b/apps/web/src/lib/service-clients/service-connection/generated/schemas/entityType.ts
index 1a604de95b..743b2e7e61 100644
--- a/apps/web/src/lib/service-clients/service-connection/generated/schemas/entityType.ts
+++ b/apps/web/src/lib/service-clients/service-connection/generated/schemas/entityType.ts
@@ -30,4 +30,5 @@ export const EntityType = {
skill: 'skill',
agent_session: 'agent_session',
scheduled_action: 'scheduled_action',
+ initiative: 'initiative',
} as const;
diff --git a/apps/web/src/lib/service-clients/service-connection/openapi.json b/apps/web/src/lib/service-clients/service-connection/openapi.json
index cd215f2aaf..6ce54ee642 100644
--- a/apps/web/src/lib/service-clients/service-connection/openapi.json
+++ b/apps/web/src/lib/service-clients/service-connection/openapi.json
@@ -262,7 +262,8 @@
"reminder",
"skill",
"agent_session",
- "scheduled_action"
+ "scheduled_action",
+ "initiative"
]
},
"GenericErrorResponse": {
diff --git a/apps/web/src/lib/service-clients/service-notification/generated/schemas/entityType.ts b/apps/web/src/lib/service-clients/service-notification/generated/schemas/entityType.ts
index c8f8ddf184..c7be02cae3 100644
--- a/apps/web/src/lib/service-clients/service-notification/generated/schemas/entityType.ts
+++ b/apps/web/src/lib/service-clients/service-notification/generated/schemas/entityType.ts
@@ -30,4 +30,5 @@ export const EntityType = {
skill: 'skill',
agent_session: 'agent_session',
scheduled_action: 'scheduled_action',
+ initiative: 'initiative',
} as const;
diff --git a/apps/web/src/lib/service-clients/service-notification/generated/zod.ts b/apps/web/src/lib/service-clients/service-notification/generated/zod.ts
index 16f720b698..ef59419896 100644
--- a/apps/web/src/lib/service-clients/service-notification/generated/zod.ts
+++ b/apps/web/src/lib/service-clients/service-notification/generated/zod.ts
@@ -156,6 +156,7 @@ export const listTypedNotificationsResponse = zod
'skill',
'agent_session',
'scheduled_action',
+ 'initiative',
])
.describe('The type of an entity in Macro'),
})
@@ -1734,6 +1735,7 @@ export const bulkGetTypedNotificationsByEventItemIdsResponse = zod
'skill',
'agent_session',
'scheduled_action',
+ 'initiative',
])
.describe('The type of an entity in Macro'),
})
@@ -3306,6 +3308,7 @@ export const getTypedNotificationsByEventItemIdResponse = zod
'skill',
'agent_session',
'scheduled_action',
+ 'initiative',
])
.describe('The type of an entity in Macro'),
})
@@ -4883,6 +4886,7 @@ export const getTypedNotificationByIdResponse = zod
'skill',
'agent_session',
'scheduled_action',
+ 'initiative',
])
.describe('The type of an entity in Macro'),
})
diff --git a/apps/web/src/lib/service-clients/service-notification/openapi.json b/apps/web/src/lib/service-clients/service-notification/openapi.json
index bcca393fd2..9bf222c23c 100644
--- a/apps/web/src/lib/service-clients/service-notification/openapi.json
+++ b/apps/web/src/lib/service-clients/service-notification/openapi.json
@@ -1622,7 +1622,8 @@
"reminder",
"skill",
"agent_session",
- "scheduled_action"
+ "scheduled_action",
+ "initiative"
]
},
"ErrorResponse": {
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/addFavoriteRequestEntityType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/addFavoriteRequestEntityType.ts
index 425babc0f3..3e04329e15 100644
--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/addFavoriteRequestEntityType.ts
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/addFavoriteRequestEntityType.ts
@@ -26,4 +26,5 @@ export type AddFavoriteRequestEntityType =
| 'reminder'
| 'skill'
| 'agent_session'
- | 'scheduled_action';
+ | 'scheduled_action'
+ | 'initiative';
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/collabSurfaceResponseParentEntityType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/collabSurfaceResponseParentEntityType.ts
index 24e908e43b..b299ade833 100644
--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/collabSurfaceResponseParentEntityType.ts
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/collabSurfaceResponseParentEntityType.ts
@@ -26,4 +26,5 @@ export type CollabSurfaceResponseParentEntityType =
| 'reminder'
| 'skill'
| 'agent_session'
- | 'scheduled_action';
+ | 'scheduled_action'
+ | 'initiative';
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/createReminderRequestEntityType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/createReminderRequestEntityType.ts
index a9e04f0022..b39662d427 100644
--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/createReminderRequestEntityType.ts
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/createReminderRequestEntityType.ts
@@ -27,4 +27,5 @@ export type CreateReminderRequestEntityType =
| 'reminder'
| 'skill'
| 'agent_session'
- | 'scheduled_action';
+ | 'scheduled_action'
+ | 'initiative';
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/ensureCollabSurfaceRequestParentEntityType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/ensureCollabSurfaceRequestParentEntityType.ts
index 513e40483f..053d31ce44 100644
--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/ensureCollabSurfaceRequestParentEntityType.ts
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/ensureCollabSurfaceRequestParentEntityType.ts
@@ -26,4 +26,5 @@ export type EnsureCollabSurfaceRequestParentEntityType =
| 'reminder'
| 'skill'
| 'agent_session'
- | 'scheduled_action';
+ | 'scheduled_action'
+ | 'initiative';
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/favoriteEntityRefEntityType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/favoriteEntityRefEntityType.ts
index fb6026f771..afe3435ad6 100644
--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/favoriteEntityRefEntityType.ts
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/favoriteEntityRefEntityType.ts
@@ -26,4 +26,5 @@ export type FavoriteEntityRefEntityType =
| 'reminder'
| 'skill'
| 'agent_session'
- | 'scheduled_action';
+ | 'scheduled_action'
+ | 'initiative';
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/favoriteEntityType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/favoriteEntityType.ts
index 066681fcd1..7630873b50 100644
--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/favoriteEntityType.ts
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/favoriteEntityType.ts
@@ -26,4 +26,5 @@ export type FavoriteEntityType =
| 'reminder'
| 'skill'
| 'agent_session'
- | 'scheduled_action';
+ | 'scheduled_action'
+ | 'initiative';
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/listFavoritesEntityTypeItem.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/listFavoritesEntityTypeItem.ts
index 1fc62e31af..ba926b3dd7 100644
--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/listFavoritesEntityTypeItem.ts
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/listFavoritesEntityTypeItem.ts
@@ -31,4 +31,5 @@ export const ListFavoritesEntityTypeItem = {
skill: 'skill',
agent_session: 'agent_session',
scheduled_action: 'scheduled_action',
+ initiative: 'initiative',
} as const;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/listRemindersEntityTypeItem.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/listRemindersEntityTypeItem.ts
index 8fd16c6d8e..e0409f348e 100644
--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/listRemindersEntityTypeItem.ts
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/listRemindersEntityTypeItem.ts
@@ -31,4 +31,5 @@ export const ListRemindersEntityTypeItem = {
skill: 'skill',
agent_session: 'agent_session',
scheduled_action: 'scheduled_action',
+ initiative: 'initiative',
} as const;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/reminderEntityType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/reminderEntityType.ts
index 48c41fd4c8..15e8bd1ef8 100644
--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/reminderEntityType.ts
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/reminderEntityType.ts
@@ -27,4 +27,5 @@ export type ReminderEntityType =
| 'reminder'
| 'skill'
| 'agent_session'
- | 'scheduled_action';
+ | 'scheduled_action'
+ | 'initiative';
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderReferenceEntityType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderReferenceEntityType.ts
index 7c123a3e34..12d622aefd 100644
--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderReferenceEntityType.ts
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderReferenceEntityType.ts
@@ -26,4 +26,5 @@ export type SoupReminderReferenceEntityType =
| 'reminder'
| 'skill'
| 'agent_session'
- | 'scheduled_action';
+ | 'scheduled_action'
+ | 'initiative';
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/zod.ts b/apps/web/src/lib/service-clients/service-storage/generated/zod.ts
index 56345b86c4..d076f8fddc 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
@@ -4110,6 +4110,7 @@ export const getCollabSurfaceResponse = zod
'skill',
'agent_session',
'scheduled_action',
+ 'initiative',
])
.describe('The type of an entity in Macro')
.describe('Type of the parent entity.'),
@@ -4161,6 +4162,7 @@ export const ensureCollabSurfaceBody = zod
'skill',
'agent_session',
'scheduled_action',
+ 'initiative',
])
.describe('The type of an entity in Macro')
.describe('Type of the parent entity access derives from.'),
@@ -4193,6 +4195,7 @@ export const ensureCollabSurfaceResponse = zod
'skill',
'agent_session',
'scheduled_action',
+ 'initiative',
])
.describe('The type of an entity in Macro')
.describe('Type of the parent entity.'),
@@ -8565,6 +8568,7 @@ export const listFavoritesQueryParams = zod.object({
'skill',
'agent_session',
'scheduled_action',
+ 'initiative',
])
.describe('The type of an entity in Macro')
)
@@ -8624,6 +8628,7 @@ export const listFavoritesResponse = zod
'skill',
'agent_session',
'scheduled_action',
+ 'initiative',
])
.describe('The type of an entity in Macro')
.describe('The type of the favorited entity.'),
@@ -8671,6 +8676,7 @@ export const addFavoriteBody = zod
'skill',
'agent_session',
'scheduled_action',
+ 'initiative',
])
.describe('The type of an entity in Macro')
.describe('The type of the entity to favorite.'),
@@ -8719,6 +8725,7 @@ export const addFavoriteResponse = zod
'skill',
'agent_session',
'scheduled_action',
+ 'initiative',
])
.describe('The type of an entity in Macro')
.describe('The type of the favorited entity.'),
@@ -8764,6 +8771,7 @@ export const reorderFavoritesBody = zod
'skill',
'agent_session',
'scheduled_action',
+ 'initiative',
])
.describe('The type of an entity in Macro')
.describe('The type of the favorited entity.'),
@@ -8802,6 +8810,7 @@ export const removeFavoriteByEntityParams = zod.object({
'skill',
'agent_session',
'scheduled_action',
+ 'initiative',
])
.describe('The type of the favorited entity.'),
entity_id: zod.string().describe('The id of the favorited entity.'),
@@ -12349,6 +12358,7 @@ export const getItemsSoupResponse = zod
'skill',
'agent_session',
'scheduled_action',
+ 'initiative',
])
.describe('The type of an entity in Macro')
.describe("The referenced entity's type."),
@@ -16317,6 +16327,7 @@ export const postItemsSoupResponse = zod
'skill',
'agent_session',
'scheduled_action',
+ 'initiative',
])
.describe('The type of an entity in Macro')
.describe("The referenced entity's type."),
@@ -19728,6 +19739,7 @@ export const postItemsSoupAstResponse = zod
'skill',
'agent_session',
'scheduled_action',
+ 'initiative',
])
.describe('The type of an entity in Macro')
.describe("The referenced entity's type."),
@@ -23495,6 +23507,7 @@ export const postItemsSoupAstGroupedResponse = zod
'skill',
'agent_session',
'scheduled_action',
+ 'initiative',
])
.describe('The type of an entity in Macro')
.describe("The referenced entity's type."),
@@ -26902,6 +26915,7 @@ export const postItemsSoupAstGroupedResponse = zod
'skill',
'agent_session',
'scheduled_action',
+ 'initiative',
])
.describe('The type of an entity in Macro')
.describe("The referenced entity's type."),
@@ -29259,6 +29273,7 @@ export const listRemindersQueryParams = zod.object({
'skill',
'agent_session',
'scheduled_action',
+ 'initiative',
])
.describe('The type of an entity in Macro')
)
@@ -29341,6 +29356,7 @@ export const listRemindersResponse = zod
'skill',
'agent_session',
'scheduled_action',
+ 'initiative',
])
.describe('The type of an entity in Macro'),
])
@@ -29428,6 +29444,7 @@ export const createReminderBody = zod
'skill',
'agent_session',
'scheduled_action',
+ 'initiative',
])
.describe('The type of an entity in Macro'),
])
@@ -29512,6 +29529,7 @@ export const getReminderResponse = zod
'skill',
'agent_session',
'scheduled_action',
+ 'initiative',
])
.describe('The type of an entity in Macro'),
])
@@ -29656,6 +29674,7 @@ export const updateReminderResponse = zod
'skill',
'agent_session',
'scheduled_action',
+ 'initiative',
])
.describe('The type of an entity in Macro'),
])
diff --git a/apps/web/src/lib/service-clients/service-storage/graphql-favorites.ts b/apps/web/src/lib/service-clients/service-storage/graphql-favorites.ts
index 981759748d..0ac55683e6 100644
--- a/apps/web/src/lib/service-clients/service-storage/graphql-favorites.ts
+++ b/apps/web/src/lib/service-clients/service-storage/graphql-favorites.ts
@@ -43,6 +43,7 @@ const FAVORITE_ENTITY_TYPE_TO_GRAPHQL = {
skill: 'SKILL',
agent_session: 'AGENT_SESSION',
scheduled_action: 'SCHEDULED_ACTION',
+ initiative: 'INITIATIVE',
} satisfies Record<FavoriteEntityType, GraphqlEntityType>;
const GRAPHQL_ENTITY_TYPE_TO_FAVORITE = {
@@ -57,6 +58,7 @@ const GRAPHQL_ENTITY_TYPE_TO_FAVORITE = {
DOCUMENT: 'document',
EMAIL_THREAD: 'email_thread',
FOREIGN_ENTITY: 'foreign_entity',
+ INITIATIVE: 'initiative',
PROJECT: 'project',
REMINDER: 'reminder',
SKILL: 'skill',
diff --git a/apps/web/src/lib/service-clients/service-storage/graphql/generated/graphql.ts b/apps/web/src/lib/service-clients/service-storage/graphql/generated/graphql.ts
index fd6404c6bc..49cc56cc71 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
@@ -619,6 +619,8 @@ export type GraphqlEntityType =
| 'EMAIL_THREAD'
/** Foreign entity. */
| 'FOREIGN_ENTITY'
+ /** Initiative entity. */
+ | 'INITIATIVE'
/** Project entity. */
| 'PROJECT'
/** Reminder entity. */
diff --git a/apps/web/src/lib/service-clients/service-storage/openapi.json b/apps/web/src/lib/service-clients/service-storage/openapi.json
index 37ac9f7e0e..1f9f405530 100644
--- a/apps/web/src/lib/service-clients/service-storage/openapi.json
+++ b/apps/web/src/lib/service-clients/service-storage/openapi.json
@@ -8640,7 +8640,8 @@
"reminder",
"skill",
"agent_session",
- "scheduled_action"
+ "scheduled_action",
+ "initiative"
]
}
},
@@ -8854,7 +8855,8 @@
"reminder",
"skill",
"agent_session",
- "scheduled_action"
+ "scheduled_action",
+ "initiative"
]
}
},
@@ -11343,7 +11345,8 @@
"reminder",
"skill",
"agent_session",
- "scheduled_action"
+ "scheduled_action",
+ "initiative"
]
}
},
@@ -12981,7 +12984,8 @@
"reminder",
"skill",
"agent_session",
- "scheduled_action"
+ "scheduled_action",
+ "initiative"
]
}
],
@@ -17048,7 +17052,8 @@
"reminder",
"skill",
"agent_session",
- "scheduled_action"
+ "scheduled_action",
+ "initiative"
]
}
],
@@ -17861,7 +17866,8 @@
"reminder",
"skill",
"agent_session",
- "scheduled_action"
+ "scheduled_action",
+ "initiative"
]
}
],
@@ -20332,7 +20338,8 @@
"reminder",
"skill",
"agent_session",
- "scheduled_action"
+ "scheduled_action",
+ "initiative"
]
}
],
@@ -20744,7 +20751,8 @@
"reminder",
"skill",
"agent_session",
- "scheduled_action"
+ "scheduled_action",
+ "initiative"
]
}
],
@@ -20793,7 +20801,8 @@
"reminder",
"skill",
"agent_session",
- "scheduled_action"
+ "scheduled_action",
+ "initiative"
]
}
],
@@ -24424,7 +24433,8 @@
"reminder",
"skill",
"agent_session",
- "scheduled_action"
+ "scheduled_action",
+ "initiative"
]
}
],
@@ -26770,7 +26780,8 @@
"reminder",
"skill",
"agent_session",
- "scheduled_action"
+ "scheduled_action",
+ "initiative"
]
}
],
diff --git a/crates/activity/src/outbound/pg_activity_repo.rs b/crates/activity/src/outbound/pg_activity_repo.rs
index 3c67c6f3a8..d4b9f79d2b 100644
--- a/crates/activity/src/outbound/pg_activity_repo.rs
+++ b/crates/activity/src/outbound/pg_activity_repo.rs
@@ -445,7 +445,8 @@ const fn _rankable_entity_types_are_exhaustive(entity_type: EntityType) {
| EntityType::Reminder
| EntityType::Skill
| EntityType::AgentSession
- | EntityType::ScheduledAction => {}
+ | EntityType::ScheduledAction
+ | EntityType::Initiative => {}
}
}
@@ -470,6 +471,7 @@ fn rankable_entity_types() -> Vec<String> {
EntityType::Skill,
EntityType::AgentSession,
EntityType::ScheduledAction,
+ EntityType::Initiative,
]
.into_iter()
.map(|entity_type| entity_type.as_ref().to_owned())
diff --git a/crates/entity_access/src/domain/ports.rs b/crates/entity_access/src/domain/ports.rs
index 4eb5473b7c..1ee55ddbec 100644
--- a/crates/entity_access/src/domain/ports.rs
+++ b/crates/entity_access/src/domain/ports.rs
@@ -75,6 +75,13 @@ pub trait AccessRepository: Clone + Send + Sync + 'static {
user_id: Option<&MacroUserId<Lowercase<'_>>>,
) -> impl Future<Output = Result<Option<AccessLevel>, AccessError>> + Send;
+ /// Get the highest access level a user has for an initiative.
+ fn get_initiative_access(
+ &self,
+ initiative_id: &str,
+ user_id: Option<&MacroUserId<Lowercase<'_>>>,
+ ) -> impl Future<Output = Result<Option<AccessLevel>, AccessError>> + Send;
+
/// Get the access level a user has for a reminder.
///
/// A reminder is never shared, so this is ownership and nothing else:
diff --git a/crates/entity_access/src/domain/service.rs b/crates/entity_access/src/domain/service.rs
index 107f23810a..57463810d8 100644
--- a/crates/entity_access/src/domain/service.rs
+++ b/crates/entity_access/src/domain/service.rs
@@ -53,6 +53,7 @@ where
EntityType::AgentSession => {
self.repo.get_agent_session_access(entity_id, user_id).await
}
+ EntityType::Initiative => self.repo.get_initiative_access(entity_id, user_id).await,
EntityType::CalendarEvent => {
self.repo
.get_calendar_event_access(entity_id, user_id)
@@ -181,7 +182,8 @@ where
| EntityType::Project
| EntityType::EmailThread
| EntityType::Call
- | EntityType::AgentSession => {
+ | EntityType::AgentSession
+ | EntityType::Initiative => {
let access_level = self
.repo
.get_team_entity_access(bot_id, team_id, entity_id, entity_type)
@@ -417,7 +419,8 @@ where
| EntityType::EmailThread
| EntityType::Call
| EntityType::CalendarEvent
- | EntityType::AgentSession => {
+ | EntityType::AgentSession
+ | EntityType::Initiative => {
self.get_optimized_access(entity_id, user_id, entity_type)
.await
}
@@ -493,7 +496,8 @@ where
| EntityType::EmailThread
| EntityType::Call
| EntityType::CalendarEvent
- | EntityType::AgentSession => {
+ | EntityType::AgentSession
+ | EntityType::Initiative => {
let access = self
.get_optimized_access(entity_id, user_id, entity_type)
.await?;
@@ -600,7 +604,8 @@ where
| EntityType::Chat
| EntityType::Project
| EntityType::EmailThread
- | EntityType::AgentSession => {
+ | EntityType::AgentSession
+ | EntityType::Initiative => {
let entity_id = Uuid::parse_str(entity_id).map_err(|_| {
AccessError::BadRequest("invalid entity_id for get_users_by_entity")
})?;
diff --git a/crates/entity_access/src/domain/service/test.rs b/crates/entity_access/src/domain/service/test.rs
index 28a2c4963d..b5f631e901 100644
--- a/crates/entity_access/src/domain/service/test.rs
+++ b/crates/entity_access/src/domain/service/test.rs
@@ -28,6 +28,7 @@ struct MockRepo {
owned_email_thread_ids: Arc<Mutex<Vec<Uuid>>>,
call_access: Arc<Mutex<Option<AccessLevel>>>,
agent_session_access: Arc<Mutex<Option<AccessLevel>>>,
+ initiative_access: Arc<Mutex<Option<AccessLevel>>>,
reminder_access: Arc<Mutex<Option<AccessLevel>>>,
team_entity_access: Arc<Mutex<Option<AccessLevel>>>,
team_entity_access_calls: Arc<AtomicUsize>,
@@ -64,6 +65,7 @@ impl MockRepo {
owned_email_thread_ids: Arc::new(Mutex::new(Vec::new())),
call_access: Arc::new(Mutex::new(None)),
agent_session_access: Arc::new(Mutex::new(None)),
+ initiative_access: Arc::new(Mutex::new(None)),
reminder_access: Arc::new(Mutex::new(None)),
team_entity_access: Arc::new(Mutex::new(None)),
team_entity_access_calls: Arc::new(AtomicUsize::new(0)),
@@ -310,6 +312,14 @@ impl AccessRepository for MockRepo {
Ok(*self.agent_session_access.lock().await)
}
+ async fn get_initiative_access(
+ &self,
+ _initiative_id: &str,
+ _user_id: Option<&MacroUserId<Lowercase<'_>>>,
+ ) -> Result<Option<AccessLevel>, AccessError> {
+ Ok(*self.initiative_access.lock().await)
+ }
+
async fn get_reminder_access(
&self,
_reminder_id: &str,
@@ -413,6 +423,7 @@ impl AccessRepository for MockRepo {
EntityType::Project => Ok(self.project_users.lock().await.clone()),
EntityType::EmailThread => Ok(self.thread_users.lock().await.clone()),
EntityType::AgentSession => Ok(self.agent_session_users.lock().await.clone()),
+ EntityType::Initiative => Ok(vec![]),
_ => Err(AccessError::BadRequest("unsupported entity type")),
}
}
@@ -1234,6 +1245,7 @@ async fn team_scoped_bot_dispatches_all_item_types() {
EntityType::Project,
EntityType::EmailThread,
EntityType::Call,
+ EntityType::Initiative,
] {
let receipt = service
.generate_bot_entity_access_receipt::<ViewAccessLevel>(
@@ -1257,7 +1269,7 @@ async fn team_scoped_bot_dispatches_all_item_types() {
));
}
- assert_eq!(repo.team_entity_access_calls.load(Ordering::SeqCst), 5);
+ assert_eq!(repo.team_entity_access_calls.load(Ordering::SeqCst), 6);
}
#[tokio::test]
diff --git a/crates/entity_access/src/outbound/pg_access_repo.rs b/crates/entity_access/src/outbound/pg_access_repo.rs
index bfd26b963b..ef72eb3b08 100644
--- a/crates/entity_access/src/outbound/pg_access_repo.rs
+++ b/crates/entity_access/src/outbound/pg_access_repo.rs
@@ -225,6 +225,25 @@ impl AccessRepository for PgAccessRepository {
.await?)
}
+ async fn get_initiative_access(
+ &self,
+ initiative_id: &str,
+ user_id: Option<&MacroUserId<Lowercase<'_>>>,
+ ) -> Result<Option<AccessLevel>, AccessError> {
+ let initiative_uuid = initiative_id
+ .parse::<Uuid>()
+ .map_err(|_| AccessError::BadRequest("Invalid initiative ID format"))?;
+ let source_ids = queries::get_user_source_ids(&self.pool, user_id)
+ .await
+ .map_err(anyhow_access_error)?;
+ Ok(queries::initiative_access::get_initiative_access(
+ &self.pool,
+ &initiative_uuid,
+ &source_ids,
+ )
+ .await?)
+ }
+
// A macro user id embeds the user's email, so it stays out of the span; the
// reminder id is what identifies the lookup anyway.
#[tracing::instrument(err, skip(self, user_id))]
@@ -309,6 +328,14 @@ impl AccessRepository for PgAccessRepository {
)
.await
}
+ EntityType::Initiative => {
+ queries::initiative_access::get_initiative_access(
+ &self.pool,
+ &entity_uuid,
+ &source_ids,
+ )
+ .await
+ }
EntityType::User
| EntityType::Channel
| EntityType::ChannelMessage
diff --git a/crates/entity_access/src/outbound/pg_access_repo/queries.rs b/crates/entity_access/src/outbound/pg_access_repo/queries.rs
index bcd28f2c3b..ff89e833ec 100644
--- a/crates/entity_access/src/outbound/pg_access_repo/queries.rs
+++ b/crates/entity_access/src/outbound/pg_access_repo/queries.rs
@@ -31,6 +31,7 @@ pub mod crm_company_access;
pub mod crm_contact_access;
pub mod document_access;
pub mod foreign_entity_access;
+pub mod initiative_access;
pub mod project_access;
pub mod team_access;
pub mod thread_access;
diff --git a/crates/entity_access/src/outbound/pg_access_repo/queries/initiative_access.rs b/crates/entity_access/src/outbound/pg_access_repo/queries/initiative_access.rs
new file mode 100644
index 0000000000..d2ea1fdeeb
--- /dev/null
+++ b/crates/entity_access/src/outbound/pg_access_repo/queries/initiative_access.rs
@@ -0,0 +1,30 @@
+#[cfg(feature = "explain_binary")]
+use crate::{
+ domain::models::AccessGrant, outbound::pg_access_repo::queries::list_entity_access_grants,
+};
+use crate::{domain::models::AccessLevel, outbound::pg_access_repo::queries::SourceIds};
+#[cfg(feature = "explain_binary")]
+use model_entity::EntityType;
+use sqlx::PgPool;
+
+#[tracing::instrument(err, skip(pool, source_ids))]
+pub async fn get_initiative_access(
+ pool: &PgPool,
+ initiative_id: &uuid::Uuid,
+ source_ids: &SourceIds,
+) -> Result<Option<AccessLevel>, sqlx::Error> {
+ // The entity_access + SharePermission join is the follow-up query task.
+ // Returning None keeps exhaustive matches compiling without a new sqlx::query!.
+ let _ = (pool, initiative_id, source_ids);
+ Ok(None)
+}
+
+#[cfg(feature = "explain_binary")]
+#[tracing::instrument(err, skip(pool, source_ids))]
+pub async fn explain_initiative_access(
+ pool: &PgPool,
+ initiative_id: &uuid::Uuid,
+ source_ids: &SourceIds,
+) -> Result<Vec<AccessGrant>, sqlx::Error> {
+ list_entity_access_grants(pool, initiative_id, EntityType::Initiative, source_ids).await
+}
diff --git a/crates/entity_access/src/outbound/pg_explain_access_repo.rs b/crates/entity_access/src/outbound/pg_explain_access_repo.rs
index 161ebe4611..f4439ecdef 100644
--- a/crates/entity_access/src/outbound/pg_explain_access_repo.rs
+++ b/crates/entity_access/src/outbound/pg_explain_access_repo.rs
@@ -118,6 +118,18 @@ impl ExplainAccessRepository for PgExplainAccessRepository {
)
.await?)
}
+ EntityType::Initiative => {
+ let initiative_id = parse_uuid(entity_id, "Invalid initiative ID format")?;
+ let source_ids = queries::get_user_source_ids(&self.pool, Some(user_id))
+ .await
+ .map_err(anyhow_access_error)?;
+ Ok(queries::initiative_access::explain_initiative_access(
+ &self.pool,
+ &initiative_id,
+ &source_ids,
+ )
+ .await?)
+ }
EntityType::Channel => {
let channel_id = parse_uuid(entity_id, "Invalid channel ID format")?;
Ok(queries::channel_role::explain_channel_access(
diff --git a/crates/entity_access_db_utils/src/lib.rs b/crates/entity_access_db_utils/src/lib.rs
index ddc9c12eab..16b3e153f2 100644
--- a/crates/entity_access_db_utils/src/lib.rs
+++ b/crates/entity_access_db_utils/src/lib.rs
@@ -307,7 +307,8 @@ pub async fn update_entity_access_channel_share_permissions(
| EntityType::Chat
| EntityType::Document
| EntityType::EmailThread
- | EntityType::Call => {
+ | EntityType::Call
+ | EntityType::Initiative => {
sqlx::query!(
r#"
DELETE FROM entity_access
@@ -420,7 +421,8 @@ pub async fn update_entity_access_channel_share_permissions(
| EntityType::Chat
| EntityType::Document
| EntityType::EmailThread
- | EntityType::Call => {
+ | EntityType::Call
+ | EntityType::Initiative => {
let entity_type_str = entity_type.as_ref();
let mut qb: QueryBuilder<Postgres> = QueryBuilder::new(
diff --git a/crates/favorites/src/domain/mutation_service.rs b/crates/favorites/src/domain/mutation_service.rs
index 3a5842b503..5f9d85b971 100644
--- a/crates/favorites/src/domain/mutation_service.rs
+++ b/crates/favorites/src/domain/mutation_service.rs
@@ -106,6 +106,7 @@ fn validate_favoritable(entity_type: EntityType) -> Result<(), FavoritesError> {
| EntityType::Reminder
| EntityType::Skill
| EntityType::AgentSession
- | EntityType::ScheduledAction => Err(FavoritesError::UnsupportedEntityType(entity_type)),
+ | EntityType::ScheduledAction
+ | EntityType::Initiative => Err(FavoritesError::UnsupportedEntityType(entity_type)),
}
}
diff --git a/crates/graphql_common/src/entity_type.rs b/crates/graphql_common/src/entity_type.rs
index 05364177b4..74424da85c 100644
--- a/crates/graphql_common/src/entity_type.rs
+++ b/crates/graphql_common/src/entity_type.rs
@@ -69,6 +69,8 @@ pub enum GraphqlEntityType {
AgentSession,
/// Scheduled action entity.
ScheduledAction,
+ /// Initiative entity.
+ Initiative,
}
impl GraphqlSoupEntityType {
@@ -100,7 +102,8 @@ impl GraphqlSoupEntityType {
| EntityType::StaticFile
| EntityType::CrmContact
| EntityType::Skill
- | EntityType::ScheduledAction => return None,
+ | EntityType::ScheduledAction
+ | EntityType::Initiative => return None,
})
}
@@ -145,6 +148,7 @@ impl GraphqlEntityType {
EntityType::Skill => Self::Skill,
EntityType::AgentSession => Self::AgentSession,
EntityType::ScheduledAction => Self::ScheduledAction,
+ EntityType::Initiative => Self::Initiative,
}
}
@@ -174,6 +178,7 @@ impl GraphqlEntityType {
Self::Skill => EntityType::Skill,
Self::AgentSession => EntityType::AgentSession,
Self::ScheduledAction => EntityType::ScheduledAction,
+ Self::Initiative => EntityType::Initiative,
}
}
}
@@ -229,4 +234,16 @@ mod test {
fn scheduled_action_is_not_a_soup_entity_type() {
assert!(GraphqlSoupEntityType::try_new(EntityType::ScheduledAction).is_none());
}
+
+ #[test]
+ fn initiative_round_trips_through_graphql_entity_type() {
+ let graphql = GraphqlEntityType::new(EntityType::Initiative);
+ assert!(matches!(graphql, GraphqlEntityType::Initiative));
+ assert!(matches!(graphql.into_model(), EntityType::Initiative));
+ }
+
+ #[test]
+ fn initiative_is_not_a_soup_entity_type() {
+ assert!(GraphqlSoupEntityType::try_new(EntityType::Initiative).is_none());
+ }
}
diff --git a/crates/graphql_soup/src/loaders.rs b/crates/graphql_soup/src/loaders.rs
index 892afc59a9..94721dde7a 100644
--- a/crates/graphql_soup/src/loaders.rs
+++ b/crates/graphql_soup/src/loaders.rs
@@ -375,7 +375,8 @@ fn entity_filter_ast(entities: &[Entity<'static>]) -> Result<EntityFilterAst, So
| EntityType::StaticFile
| EntityType::CrmContact
| EntityType::Skill
- | EntityType::ScheduledAction => {
+ | EntityType::ScheduledAction
+ | EntityType::Initiative => {
return Err(rootcause::report!(
"entity type {} is not represented in Soup",
entity.entity_type
diff --git a/crates/macro_db_client/src/item_access/delete.rs b/crates/macro_db_client/src/item_access/delete.rs
index 7f4f001a6b..b78400b60f 100644
--- a/crates/macro_db_client/src/item_access/delete.rs
+++ b/crates/macro_db_client/src/item_access/delete.rs
@@ -69,7 +69,8 @@ pub async fn delete_user_entity_access_bulk(
| EntityType::Document
| EntityType::EmailThread
| EntityType::Call
- | EntityType::AgentSession => {
+ | EntityType::AgentSession
+ | EntityType::Initiative => {
sqlx::query!(
r#"
DELETE FROM "entity_access"
diff --git a/crates/model-entity/src/lib.rs b/crates/model-entity/src/lib.rs
index d92060a4b9..994ce46164 100644
--- a/crates/model-entity/src/lib.rs
+++ b/crates/model-entity/src/lib.rs
@@ -70,6 +70,8 @@ pub enum EntityType {
AgentSession,
/// The entity is a scheduled action (see the `scheduled_action` service)
ScheduledAction,
+ /// The entity is an initiative (a named grouping of tasks)
+ Initiative,
}
impl EntityType {
@@ -111,6 +113,9 @@ impl EntityType {
// file into a project. Access currently resolves from the owner
// column, not from a row in the `entity_access` table.
EntityType::ScheduledAction => false,
+ // Initiatives hold `entity_access` rows but are not something
+ // you file into a project.
+ EntityType::Initiative => false,
}
}
/// provide an entity string slice to upgrade this type into an [Entity]
diff --git a/crates/model-entity/src/tests.rs b/crates/model-entity/src/tests.rs
index 29f586c227..255ae65df0 100644
--- a/crates/model-entity/src/tests.rs
+++ b/crates/model-entity/src/tests.rs
@@ -27,3 +27,23 @@ fn scheduled_action_round_trips_as_snake_case() {
fn scheduled_action_is_not_an_entity_access_entity() {
assert!(!EntityType::ScheduledAction.is_valid_entity_access_entity());
}
+
+#[test]
+fn initiative_round_trips_as_snake_case() {
+ let encoded = serde_json::to_string(&EntityType::Initiative).unwrap();
+ assert_eq!(encoded, "\"initiative\"");
+ assert_eq!(
+ serde_json::from_str::<EntityType>(&encoded).unwrap(),
+ EntityType::Initiative
+ );
+ assert_eq!(EntityType::Initiative.as_ref(), "initiative");
+ assert_eq!(
+ EntityType::from_str("initiative").unwrap(),
+ EntityType::Initiative
+ );
+}
+
+#[test]
+fn initiative_is_not_an_entity_access_entity() {
+ assert!(!EntityType::Initiative.is_valid_entity_access_entity());
+}
diff --git a/crates/properties/src/domain/model.rs b/crates/properties/src/domain/model.rs
index 27de229423..80090d1f66 100644
--- a/crates/properties/src/domain/model.rs
+++ b/crates/properties/src/domain/model.rs
@@ -56,7 +56,8 @@ pub fn storage_entity_type(entity_type: AccessEntityType) -> Option<EntityType>
| AccessEntityType::Reminder
| AccessEntityType::Skill
| AccessEntityType::AgentSession
- | AccessEntityType::ScheduledAction => None,
+ | AccessEntityType::ScheduledAction
+ | AccessEntityType::Initiative => None,
}
}
diff --git a/crates/properties/src/domain/model/test.rs b/crates/properties/src/domain/model/test.rs
index a31df8253a..e6682ef7c4 100644
--- a/crates/properties/src/domain/model/test.rs
+++ b/crates/properties/src/domain/model/test.rs
@@ -52,6 +52,7 @@ fn canonical_types_without_properties_storage_map_to_none() {
AccessEntityType::Skill,
AccessEntityType::AgentSession,
AccessEntityType::ScheduledAction,
+ AccessEntityType::Initiative,
] {
assert_eq!(storage_entity_type(unsupported), None, "{unsupported:?}");
}
diff --git a/packages/sdk/generated/cognition/types.gen.ts b/packages/sdk/generated/cognition/types.gen.ts
index 699d2edbcb..7785d07ecc 100644
--- a/packages/sdk/generated/cognition/types.gen.ts
+++ b/packages/sdk/generated/cognition/types.gen.ts
@@ -508,7 +508,7 @@ export type Entity = {
/**
* The type of an entity in Macro
*/
-export type EntityType = 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill' | 'agent_session' | 'scheduled_action';
+export type EntityType = 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill' | 'agent_session' | 'scheduled_action' | 'initiative';
/**
* Error response body.
diff --git a/packages/sdk/generated/connection/types.gen.ts b/packages/sdk/generated/connection/types.gen.ts
index f97dce031e..5173cba53f 100644
--- a/packages/sdk/generated/connection/types.gen.ts
+++ b/packages/sdk/generated/connection/types.gen.ts
@@ -40,7 +40,7 @@ export type Entity = {
/**
* The type of an entity in Macro
*/
-export type EntityType = 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill' | 'agent_session' | 'scheduled_action';
+export type EntityType = 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill' | 'agent_session' | 'scheduled_action' | 'initiative';
export type GenericErrorResponse = {
/**
diff --git a/packages/sdk/generated/notification/types.gen.ts b/packages/sdk/generated/notification/types.gen.ts
index 7d4be33810..3dac02627e 100644
--- a/packages/sdk/generated/notification/types.gen.ts
+++ b/packages/sdk/generated/notification/types.gen.ts
@@ -438,7 +438,7 @@ export type Entity = {
/**
* The type of an entity in Macro
*/
-export type EntityType = 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill' | 'agent_session' | 'scheduled_action';
+export type EntityType = 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill' | 'agent_session' | 'scheduled_action' | 'initiative';
/**
* A plain old json error response for use with axum.
diff --git a/packages/sdk/generated/storage/types.gen.ts b/packages/sdk/generated/storage/types.gen.ts
index ce814b79ef..c3e6af745a 100644
--- a/packages/sdk/generated/storage/types.gen.ts
+++ b/packages/sdk/generated/storage/types.gen.ts
@@ -62,7 +62,7 @@ export type AddFavoriteRequest = {
/**
* The type of the entity to favorite.
*/
- entityType: 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill' | 'agent_session' | 'scheduled_action';
+ entityType: 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill' | 'agent_session' | 'scheduled_action' | 'initiative';
};
/**
@@ -2881,7 +2881,7 @@ export type CollabSurfaceResponse = {
/**
* Type of the parent entity.
*/
- parentEntityType: 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill' | 'agent_session' | 'scheduled_action';
+ parentEntityType: 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill' | 'agent_session' | 'scheduled_action' | 'initiative';
/**
* Lifecycle state (`ready` for every surface visible via the API).
*/
@@ -3461,7 +3461,7 @@ export type CreateReminderRequest = {
/**
* Type of the entity to attach the reminder to. Requires `entityId`.
*/
- entityType?: null | 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill' | 'agent_session' | 'scheduled_action';
+ entityType?: null | 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill' | 'agent_session' | 'scheduled_action' | 'initiative';
/**
* When and how often the reminder fires.
*/
@@ -5061,7 +5061,7 @@ export type EnsureCollabSurfaceRequest = {
/**
* Type of the parent entity access derives from.
*/
- parentEntityType: 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill' | 'agent_session' | 'scheduled_action';
+ parentEntityType: 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill' | 'agent_session' | 'scheduled_action' | 'initiative';
};
/**
@@ -5344,7 +5344,7 @@ export type Favorite = {
/**
* The type of the favorited entity.
*/
- entityType: 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill' | 'agent_session' | 'scheduled_action';
+ entityType: 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill' | 'agent_session' | 'scheduled_action' | 'initiative';
/**
* File type of the favorited document, when applicable.
*/
@@ -5366,7 +5366,7 @@ export type FavoriteEntityRef = {
/**
* The type of the favorited entity.
*/
- entityType: 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill' | 'agent_session' | 'scheduled_action';
+ entityType: 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill' | 'agent_session' | 'scheduled_action' | 'initiative';
};
/**
@@ -7192,7 +7192,7 @@ export type Reminder = {
/**
* Type of the associated entity, when the reminder is attached to one.
*/
- entityType?: null | 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill' | 'agent_session' | 'scheduled_action';
+ entityType?: null | 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill' | 'agent_session' | 'scheduled_action' | 'initiative';
/**
* Reminder id.
*/
@@ -8775,7 +8775,7 @@ export type SoupReminderReference = {
/**
* The referenced entity's type.
*/
- entityType: 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill' | 'agent_session' | 'scheduled_action';
+ entityType: 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill' | 'agent_session' | 'scheduled_action' | 'initiative';
/**
* File type, when the reference is a document — `md`, `pdf`, and so on.
*/
@@ -13233,7 +13233,7 @@ export type ListFavoritesData = {
/**
* Restrict to favorites whose entity is one of these types.
*/
- entityType?: Array<'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill' | 'agent_session' | 'scheduled_action'>;
+ entityType?: Array<'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill' | 'agent_session' | 'scheduled_action' | 'initiative'>;
/**
* Restrict to favorites whose entity is one of these ids.
*/
@@ -13302,7 +13302,7 @@ export type RemoveFavoriteByEntityData = {
/**
* The type of an entity in Macro
*/
- entity_type: 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill' | 'agent_session' | 'scheduled_action';
+ entity_type: 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill' | 'agent_session' | 'scheduled_action' | 'initiative';
/**
* The id of the favorited entity.
*/
@@ -14394,7 +14394,7 @@ export type ListRemindersData = {
/**
* Restrict to reminders attached to an entity of these types.
*/
- entityType?: Array<'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill' | 'agent_session' | 'scheduled_action'>;
+ entityType?: Array<'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill' | 'agent_session' | 'scheduled_action' | 'initiative'>;
/**
* Restrict to reminders attached to these entity ids.
*/
diff --git a/packages/sdk/specs/cognition.json b/packages/sdk/specs/cognition.json
index b3085bb5f4..6abed633ba 100644
--- a/packages/sdk/specs/cognition.json
+++ b/packages/sdk/specs/cognition.json
@@ -2973,7 +2973,8 @@
"reminder",
"skill",
"agent_session",
- "scheduled_action"
+ "scheduled_action",
+ "initiative"
]
},
"ErrorBody": {
diff --git a/packages/sdk/specs/connection.json b/packages/sdk/specs/connection.json
index cd215f2aaf..6ce54ee642 100644
--- a/packages/sdk/specs/connection.json
+++ b/packages/sdk/specs/connection.json
@@ -262,7 +262,8 @@
"reminder",
"skill",
"agent_session",
- "scheduled_action"
+ "scheduled_action",
+ "initiative"
]
},
"GenericErrorResponse": {
diff --git a/packages/sdk/specs/notification.json b/packages/sdk/specs/notification.json
index bcca393fd2..9bf222c23c 100644
--- a/packages/sdk/specs/notification.json
+++ b/packages/sdk/specs/notification.json
@@ -1622,7 +1622,8 @@
"reminder",
"skill",
"agent_session",
- "scheduled_action"
+ "scheduled_action",
+ "initiative"
]
},
"ErrorResponse": {
diff --git a/packages/sdk/specs/storage.json b/packages/sdk/specs/storage.json
index 37ac9f7e0e..1f9f405530 100644
--- a/packages/sdk/specs/storage.json
+++ b/packages/sdk/specs/storage.json
@@ -8640,7 +8640,8 @@
"reminder",
"skill",
"agent_session",
- "scheduled_action"
+ "scheduled_action",
+ "initiative"
]
}
},
@@ -8854,7 +8855,8 @@
"reminder",
"skill",
"agent_session",
- "scheduled_action"
+ "scheduled_action",
+ "initiative"
]
}
},
@@ -11343,7 +11345,8 @@
"reminder",
"skill",
"agent_session",
- "scheduled_action"
+ "scheduled_action",
+ "initiative"
]
}
},
@@ -12981,7 +12984,8 @@
"reminder",
"skill",
"agent_session",
- "scheduled_action"
+ "scheduled_action",
+ "initiative"
]
}
],
@@ -17048,7 +17052,8 @@
"reminder",
"skill",
"agent_session",
- "scheduled_action"
+ "scheduled_action",
+ "initiative"
]
}
],
@@ -17861,7 +17866,8 @@
"reminder",
"skill",
"agent_session",
- "scheduled_action"
+ "scheduled_action",
+ "initiative"
]
}
],
@@ -20332,7 +20338,8 @@
"reminder",
"skill",
"agent_session",
- "scheduled_action"
+ "scheduled_action",
+ "initiative"
]
}
],
@@ -20744,7 +20751,8 @@
"reminder",
"skill",
"agent_session",
- "scheduled_action"
+ "scheduled_action",
+ "initiative"
]
}
],
@@ -20793,7 +20801,8 @@
"reminder",
"skill",
"agent_session",
- "scheduled_action"
+ "scheduled_action",
+ "initiative"
]
}
],
@@ -24424,7 +24433,8 @@
"reminder",
"skill",
"agent_session",
- "scheduled_action"
+ "scheduled_action",
+ "initiative"
]
}
],
@@ -26770,7 +26780,8 @@
"reminder",
"skill",
"agent_session",
- "scheduled_action"
+ "scheduled_action",
+ "initiative"
]
}
],
diff --git a/services/document_storage_service/src/service/entity_mutation.rs b/services/document_storage_service/src/service/entity_mutation.rs
index 296b70a08e..3674720e67 100644
--- a/services/document_storage_service/src/service/entity_mutation.rs
+++ b/services/document_storage_service/src/service/entity_mutation.rs
@@ -410,7 +410,8 @@ where
| EntityType::Reminder
| EntityType::Skill
| EntityType::AgentSession
- | EntityType::ScheduledAction => {
+ | EntityType::ScheduledAction
+ | EntityType::Initiative => {
return unsupported(requested, "rename");
}
};
@@ -457,7 +458,8 @@ where
| EntityType::Reminder
| EntityType::Skill
| EntityType::AgentSession
- | EntityType::ScheduledAction => {
+ | EntityType::ScheduledAction
+ | EntityType::Initiative => {
return unsupported(requested, "move");
}
};
@@ -506,7 +508,8 @@ where
| EntityType::Reminder
| EntityType::Skill
| EntityType::AgentSession
- | EntityType::ScheduledAction => {
+ | EntityType::ScheduledAction
+ | EntityType::Initiative => {
return unsupported(requested, "share policy updates");
}
};
@@ -558,7 +561,8 @@ where
| EntityType::Reminder
| EntityType::Skill
| EntityType::AgentSession
- | EntityType::ScheduledAction => {
+ | EntityType::ScheduledAction
+ | EntityType::Initiative => {
return unsupported(requested, "trash");
}
};
@@ -589,7 +593,8 @@ where
| EntityType::Reminder
| EntityType::Skill
| EntityType::AgentSession
- | EntityType::ScheduledAction => {
+ | EntityType::ScheduledAction
+ | EntityType::Initiative => {
return unsupported(requested, "restore");
}
};
@@ -640,7 +645,8 @@ where
| EntityType::Reminder
| EntityType::Skill
| EntityType::AgentSession
- | EntityType::ScheduledAction => {
+ | EntityType::ScheduledAction
+ | EntityType::Initiative => {
return unsupported(requested, "permanent deletion");
}
};
@@ -701,7 +707,8 @@ where
| EntityType::Reminder
| EntityType::Skill
| EntityType::AgentSession
- | EntityType::ScheduledAction => {
+ | EntityType::ScheduledAction
+ | EntityType::Initiative => {
return unsupported(requested, "duplication");
}
};
diff --git a/static_assets/schema.graphql b/static_assets/schema.graphql
index a150770b82..2031fb6143 100644
--- a/static_assets/schema.graphql
+++ b/static_assets/schema.graphql
@@ -2223,6 +2223,10 @@ enum GraphqlEntityType {
Scheduled action entity.
"""
SCHEDULED_ACTION
+ """
+ Initiative entity.
+ """
+ INITIATIVE
}
"""