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(reminders): Soup integration and the Reminders view (#5464)

Evan Hutnika4e0db2cd9de
diff --git a/.github/workspace-dep-closures.json b/.github/workspace-dep-closures.json
index 7a56a3687a..875a3b90e7 100644
--- a/.github/workspace-dep-closures.json
+++ b/.github/workspace-dep-closures.json
@@ -116,6 +116,7 @@
"crates/properties",
"crates/rate_limit",
"crates/readonly_pool",
+ "crates/reminders",
"crates/remote_env_var",
"crates/roles_and_permissions",
"crates/s3_key",
@@ -287,6 +288,7 @@
"crates/properties",
"crates/rate_limit",
"crates/readonly_pool",
+ "crates/reminders",
"crates/remote_env_var",
"crates/roles_and_permissions",
"crates/s3_key",
@@ -445,6 +447,7 @@
"crates/properties",
"crates/rate_limit",
"crates/referral",
+ "crates/reminders",
"crates/remote_env_var",
"crates/roles_and_permissions",
"crates/s3_key",
@@ -746,6 +749,7 @@
"crates/properties",
"crates/rate_limit",
"crates/readonly_pool",
+ "crates/reminders",
"crates/remote_env_var",
"crates/roles_and_permissions",
"crates/s3_key",
@@ -1000,6 +1004,7 @@
"crates/properties",
"crates/rate_limit",
"crates/readonly_pool",
+ "crates/reminders",
"crates/remote_env_var",
"crates/roles_and_permissions",
"crates/s3_key",
@@ -1398,6 +1403,7 @@
"crates/prompt",
"crates/properties",
"crates/rate_limit",
+ "crates/reminders",
"crates/remote_env_var",
"crates/roles_and_permissions",
"crates/s3_key",
@@ -1513,6 +1519,7 @@
"crates/properties",
"crates/rate_limit",
"crates/readonly_pool",
+ "crates/reminders",
"crates/remote_env_var",
"crates/roles_and_permissions",
"crates/s3_key",
@@ -1809,6 +1816,7 @@
"crates/prompt",
"crates/properties",
"crates/rate_limit",
+ "crates/reminders",
"crates/remote_env_var",
"crates/s3_key",
"crates/secretsmanager_client",
@@ -1891,6 +1899,7 @@
"crates/prompt",
"crates/properties",
"crates/rate_limit",
+ "crates/reminders",
"crates/remote_env_var",
"crates/s3_key",
"crates/secretsmanager_client",
@@ -2687,6 +2696,7 @@
"crates/prompt",
"crates/properties",
"crates/rate_limit",
+ "crates/reminders",
"crates/remote_env_var",
"crates/s3_key",
"crates/secretsmanager_client",
@@ -2923,6 +2933,7 @@
"crates/properties",
"crates/rate_limit",
"crates/readonly_pool",
+ "crates/reminders",
"crates/remote_env_var",
"crates/roles_and_permissions",
"crates/s3_key",
@@ -3157,6 +3168,7 @@
"crates/properties",
"crates/rate_limit",
"crates/readonly_pool",
+ "crates/reminders",
"crates/remote_env_var",
"crates/roles_and_permissions",
"crates/s3_key",
@@ -3389,6 +3401,7 @@
"crates/prompt",
"crates/properties",
"crates/rate_limit",
+ "crates/reminders",
"crates/remote_env_var",
"crates/share_permission_db_utils",
"crates/sqs_worker",
@@ -3460,6 +3473,7 @@
"crates/prompt",
"crates/properties",
"crates/rate_limit",
+ "crates/reminders",
"crates/remote_env_var",
"crates/share_permission_db_utils",
"crates/sqs_worker",
@@ -3838,6 +3852,7 @@
"crates/properties",
"crates/rate_limit",
"crates/readonly_pool",
+ "crates/reminders",
"crates/remote_env_var",
"crates/roles_and_permissions",
"crates/s3_key",
@@ -3948,6 +3963,7 @@
"crates/properties",
"crates/rate_limit",
"crates/readonly_pool",
+ "crates/reminders",
"crates/remote_env_var",
"crates/roles_and_permissions",
"crates/s3_key",
@@ -4159,6 +4175,7 @@
"crates/prompt",
"crates/properties",
"crates/rate_limit",
+ "crates/reminders",
"crates/remote_env_var",
"crates/share_permission_db_utils",
"crates/sqs_worker",
@@ -4231,6 +4248,7 @@
"crates/prompt",
"crates/properties",
"crates/rate_limit",
+ "crates/reminders",
"crates/remote_env_var",
"crates/share_permission_db_utils",
"crates/sqs_worker",
@@ -4704,6 +4722,7 @@
"crates/prompt",
"crates/properties",
"crates/rate_limit",
+ "crates/reminders",
"crates/remote_env_var",
"crates/s3_key",
"crates/secretsmanager_client",
@@ -4999,6 +5018,7 @@
"crates/properties",
"crates/rate_limit",
"crates/readonly_pool",
+ "crates/reminders",
"crates/remote_env_var",
"crates/roles_and_permissions",
"crates/s3_key",
@@ -5105,6 +5125,7 @@
"crates/prompt",
"crates/properties",
"crates/rate_limit",
+ "crates/reminders",
"crates/remote_env_var",
"crates/roles_and_permissions",
"crates/s3_client",
@@ -5192,6 +5213,7 @@
"crates/properties",
"crates/rate_limit",
"crates/readonly_pool",
+ "crates/reminders",
"crates/remote_env_var",
"crates/search_service",
"crates/secretsmanager_client",
@@ -5264,6 +5286,7 @@
"crates/prompt",
"crates/properties",
"crates/rate_limit",
+ "crates/reminders",
"crates/remote_env_var",
"crates/search_service_client",
"crates/share_permission_db_utils",
@@ -5383,6 +5406,7 @@
"crates/prompt",
"crates/properties",
"crates/rate_limit",
+ "crates/reminders",
"crates/remote_env_var",
"crates/roles_and_permissions",
"crates/share_permission_db_utils",
@@ -5488,6 +5512,7 @@
"crates/properties",
"crates/rate_limit",
"crates/readonly_pool",
+ "crates/reminders",
"crates/remote_env_var",
"crates/share_permission_db_utils",
"crates/soup",
@@ -5572,6 +5597,7 @@
"crates/prompt",
"crates/properties",
"crates/rate_limit",
+ "crates/reminders",
"crates/remote_env_var",
"crates/roles_and_permissions",
"crates/s3_key",
@@ -5834,6 +5860,7 @@
"crates/prompt",
"crates/properties",
"crates/rate_limit",
+ "crates/reminders",
"crates/remote_env_var",
"crates/secretsmanager_client",
"crates/share_permission_db_utils",
@@ -6168,6 +6195,7 @@
"crates/prompt",
"crates/properties",
"crates/rate_limit",
+ "crates/reminders",
"crates/remote_env_var",
"crates/s3_key",
"crates/secretsmanager_client",
diff --git a/.sqlx/query-56a5ce1ef1d875e3b497b3f10ba0134543594196057576bb092d4a06be851192.json b/.sqlx/query-56a5ce1ef1d875e3b497b3f10ba0134543594196057576bb092d4a06be851192.json
new file mode 100644
index 0000000000..4b0a01b617
--- /dev/null
+++ b/.sqlx/query-56a5ce1ef1d875e3b497b3f10ba0134543594196057576bb092d4a06be851192.json
@@ -0,0 +1,14 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "\n DELETE FROM notification\n WHERE event_item_type = 'reminder' AND event_item_id = $1\n ",
+ "describe": {
+ "columns": [],
+ "parameters": {
+ "Left": [
+ "Text"
+ ]
+ },
+ "nullable": []
+ },
+ "hash": "56a5ce1ef1d875e3b497b3f10ba0134543594196057576bb092d4a06be851192"
+}
diff --git a/.sqlx/query-5e3545ee71091d2c36af1c778680ca240d9d1dca7efcd636d30888b17caf6169.json b/.sqlx/query-5e3545ee71091d2c36af1c778680ca240d9d1dca7efcd636d30888b17caf6169.json
new file mode 100644
index 0000000000..46eaf10ef0
--- /dev/null
+++ b/.sqlx/query-5e3545ee71091d2c36af1c778680ca240d9d1dca7efcd636d30888b17caf6169.json
@@ -0,0 +1,104 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "\n SELECT\n r.id,\n r.description,\n r.entity_type,\n r.entity_id,\n r.remind_at,\n r.cron,\n r.timezone,\n r.next_run_at,\n r.enabled,\n r.completed_at,\n r.created_at,\n r.updated_at,\n d.\"fileType\" as \"referenced_file_type?\",\n dst.sub_type::text as \"referenced_sub_type?\"\n FROM reminder r\n -- Resolve the referenced document in the same round trip: the block\n -- a reminder opens (and its icon) comes from the document's file\n -- type, and the client's icon path is synchronous. \"Document\".id is\n -- still TEXT while reminder.entity_id is a uuid, hence the cast.\n LEFT JOIN \"Document\" d\n ON r.entity_type = 'document'\n AND d.id = r.entity_id::text\n AND d.\"deletedAt\" IS NULL\n LEFT JOIN document_sub_type dst ON dst.document_id = d.id\n WHERE r.user_id = $1\n AND ($2::uuid[] IS NULL OR r.id = ANY($2))\n AND (\n $3::text[] IS NULL\n OR (\n r.entity_id IS NOT NULL\n AND r.entity_type || ':' || r.entity_id::text = ANY($3)\n )\n )\n AND ($4::bool IS NULL OR (r.completed_at IS NOT NULL) = $4)\n -- Descending to match Soup's global ordering, so the LIMIT keeps the\n -- same rows Soup would keep after merging every item type.\n ORDER BY r.next_run_at DESC, r.id DESC\n LIMIT $5\n ",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "id",
+ "type_info": "Uuid"
+ },
+ {
+ "ordinal": 1,
+ "name": "description",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 2,
+ "name": "entity_type",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 3,
+ "name": "entity_id",
+ "type_info": "Uuid"
+ },
+ {
+ "ordinal": 4,
+ "name": "remind_at",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 5,
+ "name": "cron",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 6,
+ "name": "timezone",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 7,
+ "name": "next_run_at",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 8,
+ "name": "enabled",
+ "type_info": "Bool"
+ },
+ {
+ "ordinal": 9,
+ "name": "completed_at",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 10,
+ "name": "created_at",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 11,
+ "name": "updated_at",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 12,
+ "name": "referenced_file_type?",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 13,
+ "name": "referenced_sub_type?",
+ "type_info": "Text"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Text",
+ "UuidArray",
+ "TextArray",
+ "Bool",
+ "Int8"
+ ]
+ },
+ "nullable": [
+ false,
+ false,
+ true,
+ true,
+ true,
+ true,
+ true,
+ false,
+ false,
+ true,
+ false,
+ false,
+ true,
+ null
+ ]
+ },
+ "hash": "5e3545ee71091d2c36af1c778680ca240d9d1dca7efcd636d30888b17caf6169"
+}
diff --git a/.sqlx/query-768f7ca693d6cead9738e985801752fea6be33b910542c7da015634e67ee4726.json b/.sqlx/query-768f7ca693d6cead9738e985801752fea6be33b910542c7da015634e67ee4726.json
new file mode 100644
index 0000000000..549a8ea45c
--- /dev/null
+++ b/.sqlx/query-768f7ca693d6cead9738e985801752fea6be33b910542c7da015634e67ee4726.json
@@ -0,0 +1,28 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "\n SELECT r.id, r.next_run_at\n FROM reminder r\n WHERE r.enabled\n AND r.completed_at IS NULL\n AND r.cron IS NULL\n AND r.next_run_at <= $1\n AND NOT EXISTS (\n SELECT 1\n FROM reminder_occurrence o\n WHERE o.reminder_id = r.id\n AND o.scheduled_for = r.next_run_at\n AND o.sent_at IS NOT NULL\n )\n ORDER BY r.next_run_at\n ",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "id",
+ "type_info": "Uuid"
+ },
+ {
+ "ordinal": 1,
+ "name": "next_run_at",
+ "type_info": "Timestamptz"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Timestamptz"
+ ]
+ },
+ "nullable": [
+ false,
+ false
+ ]
+ },
+ "hash": "768f7ca693d6cead9738e985801752fea6be33b910542c7da015634e67ee4726"
+}
diff --git a/.sqlx/query-a7a8fe712c27896d29b2550800fe36f9b684d3c9e2ddb5e6516a5aef593aa052.json b/.sqlx/query-934ef0d818def008d982726b8526d0833070a97f430eaf93830fd9cc2890c04c.json
similarity index 65%
rename from .sqlx/query-a7a8fe712c27896d29b2550800fe36f9b684d3c9e2ddb5e6516a5aef593aa052.json
rename to .sqlx/query-934ef0d818def008d982726b8526d0833070a97f430eaf93830fd9cc2890c04c.json
index 2d0cc4e4c6..b2c513e3a5 100644
--- a/.sqlx/query-a7a8fe712c27896d29b2550800fe36f9b684d3c9e2ddb5e6516a5aef593aa052.json
+++ b/.sqlx/query-934ef0d818def008d982726b8526d0833070a97f430eaf93830fd9cc2890c04c.json
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
- "query": "\n UPDATE reminder\n SET description = COALESCE($3::text, description),\n remind_at = CASE WHEN $4::bool THEN $5::timestamptz ELSE remind_at END,\n cron = CASE WHEN $4::bool THEN $6::text ELSE cron END,\n timezone = CASE WHEN $4::bool THEN $7::text ELSE timezone END,\n next_run_at = COALESCE($8::timestamptz, next_run_at),\n enabled = COALESCE($9::bool, enabled),\n completed_at = CASE WHEN $4::bool THEN NULL ELSE completed_at END,\n updated_at = now()\n WHERE id = $1 AND user_id = $2\n RETURNING\n id,\n description,\n entity_type,\n entity_id,\n remind_at,\n cron,\n timezone,\n next_run_at,\n enabled,\n completed_at,\n created_at,\n updated_at\n ",
+ "query": "\n UPDATE reminder\n SET description = COALESCE($3::text, description),\n remind_at = CASE WHEN $4::bool THEN $5::timestamptz ELSE remind_at END,\n cron = CASE WHEN $4::bool THEN $6::text ELSE cron END,\n timezone = CASE WHEN $4::bool THEN $7::text ELSE timezone END,\n next_run_at = COALESCE($8::timestamptz, next_run_at),\n enabled = COALESCE($9::bool, enabled),\n -- An explicit `completed` wins over the reschedule rule above;\n -- COALESCE keeps re-completing an already-completed reminder\n -- from moving its timestamp.\n completed_at = CASE\n WHEN $10::bool IS TRUE THEN COALESCE(completed_at, now())\n WHEN $10::bool IS FALSE THEN NULL\n WHEN $4::bool THEN NULL\n ELSE completed_at\n END,\n updated_at = now()\n WHERE id = $1 AND user_id = $2\n RETURNING\n id,\n description,\n entity_type,\n entity_id,\n remind_at,\n cron,\n timezone,\n next_run_at,\n enabled,\n completed_at,\n created_at,\n updated_at\n ",
"describe": {
"columns": [
{
@@ -74,6 +74,7 @@
"Text",
"Text",
"Timestamptz",
+ "Bool",
"Bool"
]
},
@@ -92,5 +93,5 @@
false
]
},
- "hash": "a7a8fe712c27896d29b2550800fe36f9b684d3c9e2ddb5e6516a5aef593aa052"
+ "hash": "934ef0d818def008d982726b8526d0833070a97f430eaf93830fd9cc2890c04c"
}
diff --git a/.sqlx/query-d4eb2c260373b3e0443d494e3b5bea07f5a1732e5eab923c148091838d29f83a.json b/.sqlx/query-d4eb2c260373b3e0443d494e3b5bea07f5a1732e5eab923c148091838d29f83a.json
deleted file mode 100644
index 03e2b466a7..0000000000
--- a/.sqlx/query-d4eb2c260373b3e0443d494e3b5bea07f5a1732e5eab923c148091838d29f83a.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n UPDATE reminder\n SET completed_at = now(), updated_at = now()\n WHERE id = $1\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "d4eb2c260373b3e0443d494e3b5bea07f5a1732e5eab923c148091838d29f83a"
-}
diff --git a/.sqlx/query-e92f206e8bc0388e1882ff37f6c160deff421b30e2a790050f0079f629263809.json b/.sqlx/query-e92f206e8bc0388e1882ff37f6c160deff421b30e2a790050f0079f629263809.json
deleted file mode 100644
index 0042ba681c..0000000000
--- a/.sqlx/query-e92f206e8bc0388e1882ff37f6c160deff421b30e2a790050f0079f629263809.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT id, next_run_at\n FROM reminder\n WHERE enabled\n AND completed_at IS NULL\n AND cron IS NULL\n AND next_run_at <= $1\n ORDER BY next_run_at\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 1,
- "name": "next_run_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Timestamptz"
- ]
- },
- "nullable": [
- false,
- false
- ]
- },
- "hash": "e92f206e8bc0388e1882ff37f6c160deff421b30e2a790050f0079f629263809"
-}
diff --git a/Cargo.lock b/Cargo.lock
index 6d9ea77344..5250c87ca2 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -293,6 +293,7 @@ dependencies = [
"properties",
"rand 0.9.4",
"readonly_pool",
+ "reminders",
"remote_env_var",
"reqwest 0.13.4",
"rootcause",
@@ -4371,6 +4372,7 @@ dependencies = [
"readonly_pool",
"redis",
"regex",
+ "reminders",
"reqwest 0.13.4",
"roles_and_permissions",
"schemars 1.2.1",
@@ -9119,6 +9121,7 @@ dependencies = [
"prompt",
"readonly_pool",
"redis",
+ "reminders",
"rmcp",
"search_service_client",
"secretsmanager_client",
@@ -9198,6 +9201,7 @@ dependencies = [
"macro_uuid",
"notification",
"readonly_pool",
+ "reminders",
"search_service_client",
"serde",
"serde_json",
@@ -9663,6 +9667,7 @@ dependencies = [
"model-entity",
"models_pagination",
"models_properties",
+ "reminders",
"serde",
"serde_json",
"strum 0.27.2",
@@ -13903,6 +13908,7 @@ dependencies = [
"properties",
"readonly_pool",
"recursion",
+ "reminders",
"rootcause",
"schemars 1.2.1",
"serde",
diff --git a/apps/web/src/components/app/app-sidebar/sidebar.tsx b/apps/web/src/components/app/app-sidebar/sidebar.tsx
index 3a47d3e3d5..71d86e0323 100644
--- a/apps/web/src/components/app/app-sidebar/sidebar.tsx
+++ b/apps/web/src/components/app/app-sidebar/sidebar.tsx
@@ -51,6 +51,7 @@ import {
ENABLE_CALLS,
ENABLE_CRM,
ENABLE_NEW_PRICING_OVERRIDE,
+ ENABLE_REMINDERS,
} from '@core/constant/featureFlags';
import {
type SettingsTab,
@@ -81,6 +82,7 @@ import { AnimatedSearchIcon } from '@icon/wide-search';
import { AnimatedStarIcon } from '@icon/wide-star';
import { AnimatedTaskIcon } from '@icon/wide-task';
import { ContextMenu } from '@kobalte/core/context-menu';
+import BellSimpleIcon from '@phosphor/bell-simple.svg';
import CaretRightIcon from '@phosphor/caret-right.svg';
import CaretUpIcon from '@phosphor/caret-up.svg';
import CompassIcon from '@phosphor/compass.svg';
@@ -1011,6 +1013,17 @@ const ACTIVITY_LINK: SidebarItem = {
hotkeyToken: TOKENS.sidebar.goTo.activity,
};
+const REMINDERS_LINK: SidebarItem = {
+ id: 'reminders',
+ label: 'Reminders',
+ href: LIST_VIEW_PATHS.reminders,
+ icon: BellSimpleIcon,
+ // `r` is Calendar; `m` is free and the only other letter in "reminders" that
+ // is not already a sidebar destination.
+ hotkey: 'm',
+ hotkeyToken: TOKENS.sidebar.goTo.reminders,
+};
+
/**
* Assemble the ordered sidebar link list: the static links plus Home, Getting
* started, and the flag-gated Activity, Calendar, Calls, and CRM entries in
@@ -1043,6 +1056,17 @@ const buildSidebarLinks = (
];
}
+ if (ENABLE_REMINDERS()) {
+ // Directly below Activity, or below Inbox when Activity is off.
+ const anchorId = ENABLE_ACTIVITY ? 'activity' : 'inbox';
+ const idx = links.findIndex((l) => l.id === anchorId);
+ links = [
+ ...links.slice(0, idx + 1),
+ REMINDERS_LINK,
+ ...links.slice(idx + 1),
+ ];
+ }
+
if (ENABLE_CALLS()) {
const idx = links.findIndex((l) => l.id === 'channels');
links = [...links.slice(0, idx + 1), CALLS_LINK, ...links.slice(idx + 1)];
@@ -1291,8 +1315,11 @@ export const AppSidebar = (props: AppSidebarProps) => {
),
});
+ // Ids, not the built list: this group is a fixed set, and everything else
+ // lives in the collapsible Workspace section. `findLink` drops ids that
+ // `buildSidebarLinks` gated out, so flag-gated rows need no filter here.
const topLinks = createMemo(() =>
- ['home', 'getting-started', 'inbox', 'activity']
+ ['home', 'getting-started', 'inbox', 'activity', 'reminders']
.filter(
(id) => id !== 'getting-started' || !gettingStartedVisibility.hidden()
)
diff --git a/apps/web/src/components/app/split-layout/componentRegistry.tsx b/apps/web/src/components/app/split-layout/componentRegistry.tsx
index f514bb0899..75a2afe133 100644
--- a/apps/web/src/components/app/split-layout/componentRegistry.tsx
+++ b/apps/web/src/components/app/split-layout/componentRegistry.tsx
@@ -25,6 +25,7 @@ import {
DEV_MODE_ENV,
ENABLE_ACTIVITY,
ENABLE_CRM,
+ ENABLE_REMINDERS,
LOCAL_ONLY,
} from '@core/constant/featureFlags';
import { useUserContext } from '@core/context/user';
@@ -192,6 +193,28 @@ registerComponent(
})
);
+registerComponent(
+ 'reminders',
+ withAuth(() => {
+ // Registered even when the flag is closed so a bookmarked /reminders or a
+ // restored split recovers to the inbox instead of an empty split.
+ if (!ENABLE_REMINDERS()) {
+ return <RedirectSplit to={{ type: 'component', id: 'inbox' }} />;
+ }
+ usePageViewTracking('reminders');
+ const preset = getViewPreset('reminders');
+ return (
+ <SoupView
+ viewName="Reminders"
+ initialFilters={preset?.filters}
+ initialClientFilters={preset?.clientFilters}
+ initialGroupBy={preset?.groupBy}
+ disableLocalSearch
+ />
+ );
+ })
+);
+
const CalendarView = lazy(() =>
import('@app/features/calendar/calendar-view').then((module) => ({
default: module.CalendarView,
diff --git a/apps/web/src/components/app/split-layout/components/SplitFileMenu.tsx b/apps/web/src/components/app/split-layout/components/SplitFileMenu.tsx
index 4460e40bd4..5a8a41723a 100644
--- a/apps/web/src/components/app/split-layout/components/SplitFileMenu.tsx
+++ b/apps/web/src/components/app/split-layout/components/SplitFileMenu.tsx
@@ -307,7 +307,7 @@ export function SplitFileMenu(props: {
const entity = menuEntity();
if (!entity || !createReminderAction.canExecute(entity)) return undefined;
return {
- label: 'Remind me about this',
+ label: 'Remind me',
icon: BellSimple,
action: () => {
setOpen(false);
diff --git a/apps/web/src/components/app/split-layout/components/SplitHeader.tsx b/apps/web/src/components/app/split-layout/components/SplitHeader.tsx
index 1c2f36a52c..4d8b06af2e 100644
--- a/apps/web/src/components/app/split-layout/components/SplitHeader.tsx
+++ b/apps/web/src/components/app/split-layout/components/SplitHeader.tsx
@@ -69,6 +69,10 @@ function getEntitySplitContent(data: EntityDragEvent['draggable']['data']):
if (data.type === 'foreign') return undefined;
+ // A reminder has no block of its own — it is opened through the entity it
+ // references, which the caller navigates to instead.
+ if (data.type === 'reminder') return undefined;
+
// CRM entity types map to their dedicated blocks (entity type !== block name).
if (data.type === 'crm_company') return { type: 'company', id: data.id };
if (data.type === 'crm_contact') return { type: 'contact', id: data.id };
diff --git a/apps/web/src/features/block-canvas/component/CanvasController.tsx b/apps/web/src/features/block-canvas/component/CanvasController.tsx
index 06a2da6ac4..774c8812a9 100644
--- a/apps/web/src/features/block-canvas/component/CanvasController.tsx
+++ b/apps/web/src/features/block-canvas/component/CanvasController.tsx
@@ -870,6 +870,8 @@ export function CanvasController(props: ParentProps) {
// CRM companies/contacts aren't renderable as canvas mentions.
if (entityType === 'crm_company') return;
if (entityType === 'crm_contact') return;
+ // Nor are reminders — they have no canvas representation.
+ if (entityType === 'reminder') return;
// Track document mention and get UUID
let mentionUuid: string | undefined;
diff --git a/apps/web/src/features/channel/Attachments/attachment-utils.ts b/apps/web/src/features/channel/Attachments/attachment-utils.ts
index 50d6983e86..5bbcce11b9 100644
--- a/apps/web/src/features/channel/Attachments/attachment-utils.ts
+++ b/apps/web/src/features/channel/Attachments/attachment-utils.ts
@@ -61,5 +61,8 @@ export function getEntityClickContent(entity: EntityData): SplitContent {
.with({ type: 'crm_contact' }, () => {
throw new Error('crm contacts are not openable as attachments');
})
+ .with({ type: 'reminder' }, () => {
+ throw new Error('reminders are not openable as attachments');
+ })
.exhaustive();
}
diff --git a/apps/web/src/features/entity/composed/InlineEntity.tsx b/apps/web/src/features/entity/composed/InlineEntity.tsx
index 52205a4650..772a666e73 100644
--- a/apps/web/src/features/entity/composed/InlineEntity.tsx
+++ b/apps/web/src/features/entity/composed/InlineEntity.tsx
@@ -1,14 +1,18 @@
-import { EntityIcon } from '../extractors/entity-icon';
-import { EntityTitle } from '../extractors/entity-title';
+import { Entity } from '../entity';
import type { EntityData } from '../types/entity';
+// Goes through the `Entity` namespace like every other composed row rather
+// than reaching into the extractors directly. Beyond matching them: the
+// barrel exports this module before `./entity`, so importing an extractor
+// here would start one mid-cycle and leave `entity.ts` reading a member that
+// is still initializing.
export function InlineEntity(props: { entity: EntityData }) {
return (
<div class="flex items-center gap-1 min-w-0 truncate">
<span class="size-[1.25em] shrink-0">
- <EntityIcon entity={props.entity} />
+ <Entity.Icon entity={props.entity} />
</span>
- <EntityTitle entity={props.entity} />
+ <Entity.Title entity={props.entity} />
</div>
);
}
diff --git a/apps/web/src/features/entity/extractors-property/entity-key-properties.tsx b/apps/web/src/features/entity/extractors-property/entity-key-properties.tsx
index 0837b2f663..bbe7552123 100644
--- a/apps/web/src/features/entity/extractors-property/entity-key-properties.tsx
+++ b/apps/web/src/features/entity/extractors-property/entity-key-properties.tsx
@@ -54,6 +54,9 @@ function getEntityType(entity: EntityData): EntityType {
.with({ type: 'foreign' }, () => {
throw new Error('foreign entities do not support properties');
})
+ .with({ type: 'reminder' }, () => {
+ throw new Error('reminders do not support properties');
+ })
.exhaustive();
}
diff --git a/apps/web/src/features/entity/extractors/entity-icon.tsx b/apps/web/src/features/entity/extractors/entity-icon.tsx
index faa5b48f4a..2c56126796 100644
--- a/apps/web/src/features/entity/extractors/entity-icon.tsx
+++ b/apps/web/src/features/entity/extractors/entity-icon.tsx
@@ -4,6 +4,7 @@ import {
getIconConfig,
} from '@core/component/EntityIcon';
import { UserIcon } from '@core/component/UserIcon';
+import { itemToBlockName } from '@core/constant/allBlocks';
import { useUserId } from '@core/context/user';
import GitMerge from '@phosphor/git-merge.svg';
import GitPullRequest from '@phosphor/git-pull-request.svg';
@@ -16,6 +17,7 @@ import type {
ChannelEntity,
EntityData,
GithubPullRequestEntity,
+ NamedSubType,
} from '../types/entity';
import {
isCallEntity,
@@ -107,28 +109,48 @@ function GithubPullRequestIcon(props: {
export function EntityIcon(props: EntityIconProps) {
const iconType = () => {
- return match(props.entity)
- .when(isChannelEntity, ({ channelType }) => channelType)
- .when(isChannelMessageEntity, ({ channelType }) => channelType)
- .when(isTaskEntity, () => 'task')
- .when(isSnippetEntity, () => 'snippet')
- .with({ type: 'document' }, ({ fileType }) => {
- return fileType ?? 'default';
- })
- .with({ type: 'chat' }, () => 'chat')
- .with({ type: 'project' }, () => 'project')
- .with({ type: 'email' }, ({ isRead, hasIcsAttachment }) =>
- hasIcsAttachment ? 'emailInvite' : isRead ? 'emailRead' : 'email'
- )
- .when(isCallEntity, () => 'call')
- .with({ type: 'automation' }, () => 'automation')
- .with(
- { type: 'foreign', foreignSource: 'github_pull_request' },
- () => 'githubPullRequest'
- )
- .with({ type: 'foreign' }, () => 'default')
- .with({ type: 'crm_company' }, () => 'crm_company')
- .otherwise(() => 'default');
+ return (
+ match(props.entity)
+ .when(isChannelEntity, ({ channelType }) => channelType)
+ .when(isChannelMessageEntity, ({ channelType }) => channelType)
+ .when(isTaskEntity, () => 'task')
+ .when(isSnippetEntity, () => 'snippet')
+ .with({ type: 'document' }, ({ fileType }) => {
+ return fileType ?? 'default';
+ })
+ .with({ type: 'chat' }, () => 'chat')
+ .with({ type: 'project' }, () => 'project')
+ .with({ type: 'email' }, ({ isRead, hasIcsAttachment }) =>
+ hasIcsAttachment ? 'emailInvite' : isRead ? 'emailRead' : 'email'
+ )
+ .when(isCallEntity, () => 'call')
+ .with({ type: 'automation' }, () => 'automation')
+ .with(
+ { type: 'foreign', foreignSource: 'github_pull_request' },
+ () => 'githubPullRequest'
+ )
+ .with({ type: 'foreign' }, () => 'default')
+ .with({ type: 'crm_company' }, () => 'crm_company')
+ // A reminder shows the icon of what it references; `fileType` comes
+ // resolved from the server so this stays synchronous. With nothing
+ // referenced there is no such icon, so it falls back to the bell rather
+ // than to `default`, whose wide variant is the unknown-file glyph.
+ .with({ type: 'reminder' }, ({ referencedEntity }) =>
+ referencedEntity
+ ? (itemToBlockName(
+ {
+ type: referencedEntity.type,
+ fileType: referencedEntity.fileType,
+ subType: referencedEntity.subType
+ ? { type: referencedEntity.subType as NamedSubType }
+ : undefined,
+ },
+ true
+ ) ?? 'reminder')
+ : 'reminder'
+ )
+ .otherwise(() => 'default')
+ );
};
const validIconType = () => {
diff --git a/apps/web/src/features/entity/extractors/entity-title.tsx b/apps/web/src/features/entity/extractors/entity-title.tsx
index a99ab09ab6..d3feb30a06 100644
--- a/apps/web/src/features/entity/extractors/entity-title.tsx
+++ b/apps/web/src/features/entity/extractors/entity-title.tsx
@@ -8,38 +8,42 @@ import { type EntityData, isGithubPrEntity } from '../types/entity';
import { isSearchEntity } from '../types/search';
function extractRawTitle(entity: EntityData): JSX.Element {
- return match<EntityData, JSX.Element>(entity)
- .with({ type: 'document' }, (e) =>
- formatDocumentName(e.name, e.fileType, {
- fullyQualifiedBlockName: true,
- })
- )
- .with({ type: 'project' }, (e) => e.name)
- .with({ type: 'channel' }, (e) => e.name)
- .with({ type: 'channel_message' }, (e) => e.channelName)
- .with({ type: 'channel_thread' }, (e) => e.name)
- .with({ type: 'email' }, (e) => e.name || '(No Subject)')
- .with({ type: 'chat' }, (e) => e.name)
- .with({ type: 'call' }, (e) => e.name || blockNameToDefaultFile('call'))
- .with(
- { type: 'automation' },
- (e) => e.name || blockNameToDefaultFile('automation')
- )
- .when(isGithubPrEntity, (e) => (
- <>
- {e.metadata.name}{' '}
- <span class="text-ink-extra-muted font-normal">
- #{e.metadata.number}
- </span>
- </>
- ))
- .with({ type: 'foreign' }, (e) => e.name)
- .with({ type: 'crm_company' }, (e) => e.name || 'Unknown Company')
- .with(
- { type: 'crm_contact' },
- (e) => e.name || e.email || 'Unknown Contact'
- )
- .otherwise(() => 'Unknown');
+ return (
+ match<EntityData, JSX.Element>(entity)
+ .with({ type: 'document' }, (e) =>
+ formatDocumentName(e.name, e.fileType, {
+ fullyQualifiedBlockName: true,
+ })
+ )
+ .with({ type: 'project' }, (e) => e.name)
+ .with({ type: 'channel' }, (e) => e.name)
+ .with({ type: 'channel_message' }, (e) => e.channelName)
+ .with({ type: 'channel_thread' }, (e) => e.name)
+ .with({ type: 'email' }, (e) => e.name || '(No Subject)')
+ .with({ type: 'chat' }, (e) => e.name)
+ .with({ type: 'call' }, (e) => e.name || blockNameToDefaultFile('call'))
+ .with(
+ { type: 'automation' },
+ (e) => e.name || blockNameToDefaultFile('automation')
+ )
+ .when(isGithubPrEntity, (e) => (
+ <>
+ {e.metadata.name}{' '}
+ <span class="text-ink-extra-muted font-normal">
+ #{e.metadata.number}
+ </span>
+ </>
+ ))
+ .with({ type: 'foreign' }, (e) => e.name)
+ .with({ type: 'crm_company' }, (e) => e.name || 'Unknown Company')
+ .with(
+ { type: 'crm_contact' },
+ (e) => e.name || e.email || 'Unknown Contact'
+ )
+ // A reminder's name is its description — there is no separate title.
+ .with({ type: 'reminder' }, (e) => e.name || 'Reminder')
+ .otherwise(() => 'Unknown')
+ );
}
function extractSearchHighlight(entity: EntityData): string | undefined {
diff --git a/apps/web/src/features/entity/queries/dss.ts b/apps/web/src/features/entity/queries/dss.ts
index e083bc91bb..177beec791 100644
--- a/apps/web/src/features/entity/queries/dss.ts
+++ b/apps/web/src/features/entity/queries/dss.ts
@@ -9,6 +9,8 @@ import { throwOnErr } from '@core/util/result';
import { scheduledActionKeys } from '@queries/agent-schedule/keys';
import { callKeys } from '@queries/call/keys';
import { queryClient } from '@queries/client';
+import { notificationKeys } from '@queries/notification/keys';
+import { reminderKeys } from '@queries/reminders/keys';
import {
getSoupEntityById,
invalidateSoupEntity,
@@ -22,6 +24,7 @@ import { soupKeys } from '@queries/soup/keys';
import { callServiceClient } from '@service-call/client';
import { scheduledActionClient } from '@service-scheduled-action/client';
import type { ItemType } from '@service-storage/client';
+import { storageServiceClient } from '@service-storage/client';
import { useMutation } from '@tanstack/solid-query';
import { type EntityData, getEntityProjectId } from '../types/entity';
@@ -33,7 +36,8 @@ export function createBulkDeleteDssItemsMutation() {
type === 'document' ||
type === 'project' ||
type === 'call' ||
- type === 'automation'
+ type === 'automation' ||
+ type === 'reminder'
);
};
return useMutation(() => ({
@@ -51,12 +55,27 @@ export function createBulkDeleteDssItemsMutation() {
scheduledActionClient.deleteSchedule({ scheduleId: e.id })
).then(() => true);
}
+ if (e.type === 'reminder') {
+ // Deleting a reminder also retracts the notification it produced —
+ // the API does both in one transaction, since a reminder *is* its
+ // notification's event_item.
+ return throwOnErr(() =>
+ storageServiceClient.reminders.deleteReminder(e.id)
+ ).then(() => true);
+ }
return deleteItem({ id: e.id, itemType: e.type as ItemType });
})
);
if (deletable.some((e) => e.type === 'call')) {
queryClient.invalidateQueries({ queryKey: callKeys._def });
}
+ if (deletable.some((e) => e.type === 'reminder')) {
+ // The reminder lists are their own queries; the soup cache is already
+ // handled by the shared optimistic removal in onMutate. Notifications
+ // too, since the delete retracted them server-side.
+ queryClient.invalidateQueries({ queryKey: reminderKeys._def });
+ queryClient.invalidateQueries({ queryKey: notificationKeys._def });
+ }
if (deletable.some((e) => e.type === 'automation')) {
const deletedIds = new Set(
deletable.filter((e) => e.type === 'automation').map((e) => e.id)
diff --git a/apps/web/src/features/entity/queries/rename.ts b/apps/web/src/features/entity/queries/rename.ts
index 49fd543592..1d0e292bab 100644
--- a/apps/web/src/features/entity/queries/rename.ts
+++ b/apps/web/src/features/entity/queries/rename.ts
@@ -92,7 +92,13 @@ const getEntityRenameData = (
): EntityRenameData | null => {
const { entity, newName } = operation;
// crm companies/contacts aren't renamable and have no storage item type.
- if (entity.type === 'crm_company' || entity.type === 'crm_contact') {
+ // Reminders aren't either — the entity-mutation router rejects them, and a
+ // reminder's name is its description, edited through the reminders API.
+ if (
+ entity.type === 'crm_company' ||
+ entity.type === 'crm_contact' ||
+ entity.type === 'reminder'
+ ) {
return null;
}
return {
diff --git a/apps/web/src/features/entity/types/entity.ts b/apps/web/src/features/entity/types/entity.ts
index 81a65993e7..fd0f97dcff 100644
--- a/apps/web/src/features/entity/types/entity.ts
+++ b/apps/web/src/features/entity/types/entity.ts
@@ -298,6 +298,43 @@ export type CrmContactEntity = EntityBase & {
hidden: boolean;
};
+export type ReminderEntity = EntityBase & {
+ type: 'reminder';
+ /** What to remind the user about. Doubles as {@link EntityBase.name}. */
+ description: string;
+ /** The entity the reminder is about, when it is attached to one. Clicking a
+ * reminder navigates here rather than to the reminder itself, and the row
+ * borrows this entity's icon.
+ *
+ * `type` is already mapped to the display {@link EntityType} (`email`,
+ * `foreign`), not the canonical API names (`email_thread`,
+ * `foreign_entity`). `fileType`/`subType` are resolved server-side and only
+ * present for documents — without them a referenced document has no
+ * resolvable block, since the icon and open paths are both synchronous.
+ *
+ * A reminder never references another reminder — the mapper yields
+ * `undefined` for that — so the type excludes it and the reference stays
+ * assignable to the preview/open helpers, which only know real targets. */
+ referencedEntity?: {
+ id: string;
+ type: Exclude<EntityType, 'reminder'>;
+ fileType?: string;
+ subType?: string;
+ };
+ /** Whether the reminder fires once or on a cron schedule. */
+ scheduleType: 'once' | 'recurring';
+ /** Cron expression, for a recurring reminder. */
+ cron?: string;
+ /** Timezone the cron is evaluated in, for a recurring reminder. */
+ timezone?: string;
+ /** The next firing. Soup orders reminders on this. */
+ nextRunAt: DateValue;
+ /** When false, the dispatcher skips this reminder. */
+ enabled: boolean;
+ /** Set once a one-shot reminder has fired. */
+ completedAt?: DateValue | null;
+};
+
export type EntityData =
| ChannelEntity
| ChannelMessageEntity
@@ -312,6 +349,7 @@ export type EntityData =
| CrmCompanyEntity
| CrmContactEntity
| AutomationEntity
+ | ReminderEntity
| ForeignEntity;
const ENTITY_TYPE_VALUES = new Set<EntityData['type']>([
@@ -326,6 +364,7 @@ const ENTITY_TYPE_VALUES = new Set<EntityData['type']>([
'crm_company',
'crm_contact',
'automation',
+ 'reminder',
'foreign',
]);
diff --git a/apps/web/src/features/entity/utils/shared.ts b/apps/web/src/features/entity/utils/shared.ts
index 62ea6d50b6..a6df8f9cb0 100644
--- a/apps/web/src/features/entity/utils/shared.ts
+++ b/apps/web/src/features/entity/utils/shared.ts
@@ -8,6 +8,10 @@ export function useIsShared(entity: EntityData) {
if (entity.type === 'call') return false;
if (entity.type === 'foreign') return entity.storedForId !== userId();
if (entity.type === 'crm_company') return false;
+ // A reminder is private to whoever set it, and the API only ever returns
+ // the caller's own, so it carries no ownerId at all — without this the
+ // undefined would never match and every reminder would read as shared.
+ if (entity.type === 'reminder') return false;
if (entity.ownerId === userId()) return false;
return true;
};
diff --git a/apps/web/src/features/next-soup/actions/make-copy-action.ts b/apps/web/src/features/next-soup/actions/make-copy-action.ts
index c121aabcf4..c169fcc342 100644
--- a/apps/web/src/features/next-soup/actions/make-copy-action.ts
+++ b/apps/web/src/features/next-soup/actions/make-copy-action.ts
@@ -13,7 +13,10 @@ export const makeCopyAction = () => {
entity.type !== 'channel_message' &&
entity.type !== 'channel_thread' &&
entity.type !== 'foreign' &&
- entity.type !== 'automation'
+ entity.type !== 'automation' &&
+ // There is no duplicate endpoint for reminders; the bulk copy mutation
+ // only knows how to clone documents.
+ entity.type !== 'reminder'
);
};
diff --git a/apps/web/src/features/next-soup/actions/make-create-reminder-action.test.ts b/apps/web/src/features/next-soup/actions/make-create-reminder-action.test.ts
index ec7d2937ea..1183b4349e 100644
--- a/apps/web/src/features/next-soup/actions/make-create-reminder-action.test.ts
+++ b/apps/web/src/features/next-soup/actions/make-create-reminder-action.test.ts
@@ -23,6 +23,15 @@ import { makeCreateReminderAction } from './make-create-reminder-action';
const entity = (type: EntityData['type'], id = 'e1') =>
({ type, id, name: 'Thing' }) as EntityData;
+const threadEntity = (channelId = 'chan-1') =>
+ ({
+ type: 'channel_thread',
+ id: 'msg-1',
+ channelId,
+ name: 'Channel thread',
+ content: 'ship it',
+ }) as EntityData;
+
describe('makeCreateReminderAction', () => {
beforeEach(() => {
vi.clearAllMocks();
@@ -37,16 +46,29 @@ describe('makeCreateReminderAction', () => {
expect(canExecute(entity('crm_company'))).toBe(true);
});
- // Channel messages/threads have composite `channelId:messageId` ids that the
- // entity-access layer cannot resolve an access level for.
+ // `entity_access` resolves no access level for `channel_message`, so the
+ // receipt the reminders API requires cannot be minted for one.
it('cannot run for entity types with no reminder mapping', () => {
const { canExecute } = makeCreateReminderAction();
expect(canExecute(entity('channel_message'))).toBe(false);
- expect(canExecute(entity('channel_thread'))).toBe(false);
expect(canExecute(entity('automation'))).toBe(false);
});
+ // Thread rows are offered the action even though `channel_message` is not a
+ // reminder target: they fall back to the parent channel.
+ it('can run for a channel thread row', () => {
+ expect(makeCreateReminderAction().canExecute(threadEntity())).toBe(true);
+ });
+
+ it('opens the composer for a channel thread row', () => {
+ const target = threadEntity();
+
+ makeCreateReminderAction().execute([target]);
+
+ expect(mocks.openReminderComposer).toHaveBeenCalledWith(target);
+ });
+
it('opens the composer for the entity', () => {
const target = entity('document', 'doc-1');
diff --git a/apps/web/src/features/next-soup/actions/make-create-reminder-action.ts b/apps/web/src/features/next-soup/actions/make-create-reminder-action.ts
index 42a772572c..f401ae7c0b 100644
--- a/apps/web/src/features/next-soup/actions/make-create-reminder-action.ts
+++ b/apps/web/src/features/next-soup/actions/make-create-reminder-action.ts
@@ -1,7 +1,7 @@
import { openReminderComposer } from '@app/features/reminders/reminder-composer';
import { ENABLE_REMINDERS } from '@core/constant/featureFlags';
import type { EntityData } from '@entity';
-import { reminderEntityType } from '@queries/reminders/reminders';
+import { reminderTarget } from '@queries/reminders/reminders';
import type { SoupState } from '../create-soup-state';
/**
@@ -18,7 +18,7 @@ import type { SoupState } from '../create-soup-state';
*/
export const makeCreateReminderAction = () => {
const canExecute = (entity: EntityData): boolean =>
- ENABLE_REMINDERS() && reminderEntityType(entity.type) !== undefined;
+ ENABLE_REMINDERS() && reminderTarget(entity) !== undefined;
const execute = (entities: EntityData[]) => {
const [entity] = entities;
diff --git a/apps/web/src/features/next-soup/actions/make-delete-action.test.ts b/apps/web/src/features/next-soup/actions/make-delete-action.test.ts
new file mode 100644
index 0000000000..5ace4ec2b0
--- /dev/null
+++ b/apps/web/src/features/next-soup/actions/make-delete-action.test.ts
@@ -0,0 +1,102 @@
+import type { EntityData } from '@entity';
+import { beforeEach, describe, expect, it, vi } from 'vitest';
+
+const mocks = vi.hoisted(() => ({
+ openBulkEditModal: vi.fn(),
+ bulkDeleteMutateAsync: vi.fn(async () => []),
+}));
+
+// The action pulls in the bulk-edit modal, split manager and toast at module
+// scope; only `canExecute` is under test, and it touches none of them.
+vi.mock('@app/features/entity/bulk-edit/BulkEditEntityModal', () => ({
+ openBulkEditModal: mocks.openBulkEditModal,
+}));
+vi.mock('@app/signal/splitLayout', () => ({
+ globalSplitManager: () => undefined,
+}));
+vi.mock('@components/app/split-layout/layoutUtils', () => ({
+ globalRemoveFromSplitHistory: vi.fn(),
+}));
+vi.mock('@core/component/Toast/Toast', () => ({
+ toast: { success: vi.fn(), failure: vi.fn(), dismiss: vi.fn() },
+}));
+// The real barrel reaches the query clients, which open websockets under jsdom.
+vi.mock('@entity', () => ({
+ createBulkDeleteDssItemsMutation: () => ({
+ mutateAsync: mocks.bulkDeleteMutateAsync,
+ }),
+}));
+vi.mock('../utils', () => ({
+ restoreSoupFocus: vi.fn(),
+ trashEmails: vi.fn(),
+}));
+
+import { makeDeleteAction } from './make-delete-action';
+
+const ME = 'macro|[email protected]';
+
+const entity = (
+ type: EntityData['type'],
+ overrides: Partial<EntityData> = {}
+) =>
+ ({ type, id: 'e1', name: 'Thing', ownerId: ME, ...overrides }) as EntityData;
+
+const { canExecute, execute } = makeDeleteAction({ userId: () => ME });
+
+beforeEach(() => vi.clearAllMocks());
+
+describe('makeDeleteAction.execute', () => {
+ const reminder = entity('reminder', { ownerId: '' });
+
+ it('deletes a reminder without a confirmation step', async () => {
+ await execute([reminder]);
+
+ expect(mocks.bulkDeleteMutateAsync).toHaveBeenCalledWith([reminder]);
+ expect(mocks.openBulkEditModal).not.toHaveBeenCalled();
+ });
+
+ it('still confirms for everything else', async () => {
+ await execute([entity('document')]);
+
+ expect(mocks.openBulkEditModal).toHaveBeenCalledOnce();
+ });
+
+ // A mixed selection confirms only the entities the modal actually lists;
+ // the reminders in it are already gone by then.
+ it('splits a mixed selection, confirming only the non-reminders', async () => {
+ const doc = entity('document', { id: 'doc-1' });
+
+ await execute([reminder, doc]);
+
+ expect(mocks.bulkDeleteMutateAsync).toHaveBeenCalledWith([reminder]);
+ expect(mocks.openBulkEditModal).toHaveBeenCalledWith(
+ expect.objectContaining({ entities: [doc] })
+ );
+ });
+});
+
+describe('makeDeleteAction.canExecute', () => {
+ it('allows deleting entities the caller owns', () => {
+ expect(canExecute(entity('document'))).toBe(true);
+ expect(canExecute(entity('chat'))).toBe(true);
+ });
+
+ it('refuses entities owned by someone else', () => {
+ expect(canExecute(entity('document', { ownerId: 'macro|other' }))).toBe(
+ false
+ );
+ });
+
+ it('refuses channels and channel rows outright', () => {
+ expect(canExecute(entity('channel'))).toBe(false);
+ expect(canExecute(entity('channel_message'))).toBe(false);
+ expect(canExecute(entity('channel_thread'))).toBe(false);
+ });
+
+ // Reminders carry no owner id, so the ownership check would reject them.
+ // The API only ever returns the caller's own, so there is nobody else's to
+ // delete.
+ it('allows deleting a reminder despite it carrying no owner id', () => {
+ expect(canExecute(entity('reminder', { ownerId: '' }))).toBe(true);
+ });
+});
diff --git a/apps/web/src/features/next-soup/actions/make-delete-action.ts b/apps/web/src/features/next-soup/actions/make-delete-action.ts
index 0602a552c5..98acc74817 100644
--- a/apps/web/src/features/next-soup/actions/make-delete-action.ts
+++ b/apps/web/src/features/next-soup/actions/make-delete-action.ts
@@ -2,7 +2,7 @@ import { openBulkEditModal } from '@app/features/entity/bulk-edit/BulkEditEntity
import { globalSplitManager } from '@app/signal/splitLayout';
import { globalRemoveFromSplitHistory } from '@components/app/split-layout/layoutUtils';
import { toast } from '@core/component/Toast/Toast';
-import type { EntityData } from '@entity';
+import { createBulkDeleteDssItemsMutation, type EntityData } from '@entity';
import ArrowCounterClockwise from '@phosphor-icons/core/regular/arrow-counter-clockwise.svg?component-solid';
import type { SoupState } from '../create-soup-state';
import { restoreSoupFocus, trashEmails } from '../utils';
@@ -13,6 +13,42 @@ type MakeDeleteOptions = {
export const makeDeleteAction = (options: MakeDeleteOptions) => {
const { userId } = options;
+ const bulkDelete = createBulkDeleteDssItemsMutation();
+
+ /**
+ * Delete reminders straight away, with no confirmation step.
+ *
+ * Unlike a document or a folder, a reminder holds nothing — deleting one
+ * discards a note to self, so the modal cost more than it protected.
+ *
+ * Note this is genuinely unrecoverable: the reminders API has no undelete,
+ * so unlike email (which trashes with an Undo toast) there is nothing to
+ * offer here. Failures are surfaced by the mutation's own error handler,
+ * which also rolls the row back into the list.
+ */
+ const deleteRemindersNow = async (reminders: EntityData[]) => {
+ if (reminders.length === 0) return;
+ try {
+ await bulkDelete.mutateAsync(reminders);
+ // Only after the delete lands: the mutation restores the rows on
+ // failure, and a dropped split-history entry cannot be restored with
+ // them.
+ const splitManager = globalSplitManager();
+ if (splitManager) {
+ const ids = new Set(reminders.map(({ id }) => id));
+ globalRemoveFromSplitHistory(splitManager, (entry) =>
+ ids.has(entry.id)
+ );
+ }
+ toast.success(
+ reminders.length > 1
+ ? `Deleted ${reminders.length} reminders`
+ : 'Reminder deleted'
+ );
+ } catch {
+ // createBulkDeleteDssItemsMutation already toasts and restores the rows.
+ }
+ };
const canExecute = (entity: EntityData): boolean => {
if (entity.type === 'channel_message' || entity.type === 'channel_thread') {
@@ -24,23 +60,34 @@ export const makeDeleteAction = (options: MakeDeleteOptions) => {
if (entity.type === 'channel') {
return false;
}
+ // Reminders carry no owner id — they are private to their owner, and the
+ // API only ever returns the caller's own — so the ownership check below
+ // would reject every one of them.
+ if (entity.type === 'reminder') {
+ return true;
+ }
return entity.ownerId === userId();
};
const execute = async (entities: EntityData[]) => {
+ const reminders = entities.filter((e) => e.type === 'reminder');
+ const rest = entities.filter((e) => e.type !== 'reminder');
+ void deleteRemindersNow(reminders);
+ if (rest.length === 0) return;
+
openBulkEditModal({
view: 'delete',
- entities,
+ entities: rest,
onFinish: () => {
const splitManager = globalSplitManager();
if (splitManager) {
- const entityIdSet = new Set(entities.map(({ id }) => id));
+ const entityIdSet = new Set(rest.map(({ id }) => id));
globalRemoveFromSplitHistory(splitManager, (entry) =>
entityIdSet.has(entry.id)
);
}
toast.success(
- entities.length > 1 ? `Deleted ${entities.length} items` : 'Deleted'
+ rest.length > 1 ? `Deleted ${rest.length} items` : 'Deleted'
);
},
});
@@ -51,9 +98,19 @@ export const makeDeleteAction = (options: MakeDeleteOptions) => {
const nextRow =
soup.items.at(currentIndex + 1) ?? soup.items.at(currentIndex - 1);
- // Separate email entities from non-email entities
+ // Three lanes: emails trash immediately (with Undo), reminders delete
+ // immediately (no Undo to give), everything else confirms first.
const emailEntities = entities.filter((e) => e.type === 'email');
- const nonEmailEntities = entities.filter((e) => e.type !== 'email');
+ const reminderEntities = entities.filter((e) => e.type === 'reminder');
+ const nonEmailEntities = entities.filter(
+ (e) => e.type !== 'email' && e.type !== 'reminder'
+ );
+
+ const advancePastDeleted = () => {
+ soup.selection.clear();
+ if (nextRow) soup.focus.set(nextRow.id);
+ restoreSoupFocus(nextRow?.id);
+ };
const trashEmailEntities = () => {
const handle = trashEmails(emailEntities.map((e) => e.id));
@@ -125,11 +182,7 @@ export const makeDeleteAction = (options: MakeDeleteOptions) => {
if (emailEntities.length > 0) {
trashEmailEntities();
} else {
- soup.selection.clear();
- if (nextRow) {
- soup.focus.set(nextRow.id);
- }
- restoreSoupFocus(nextRow?.id);
+ advancePastDeleted();
}
},
onCancel: () => {
@@ -143,7 +196,15 @@ export const makeDeleteAction = (options: MakeDeleteOptions) => {
} else if (emailEntities.length > 0) {
// Email-only selection: trash immediately
trashEmailEntities();
+ } else if (reminderEntities.length > 0) {
+ // Reminders-only selection: no modal, so move focus on now rather than
+ // waiting for a confirmation that never comes.
+ advancePastDeleted();
}
+
+ // Reminders never gate on the modal, so they go regardless of what else
+ // was selected — the confirmation covers only the entities it lists.
+ void deleteRemindersNow(reminderEntities);
};
return { canExecute, execute, executeWithSoup };
diff --git a/apps/web/src/features/next-soup/actions/make-mark-done-action.ts b/apps/web/src/features/next-soup/actions/make-mark-done-action.ts
index 6208846699..806afc2b02 100644
--- a/apps/web/src/features/next-soup/actions/make-mark-done-action.ts
+++ b/apps/web/src/features/next-soup/actions/make-mark-done-action.ts
@@ -30,6 +30,10 @@ const VALID_MARK_DONE_LIST_VIEWS: `${ListView}-${string}`[] = [
'mail-all',
'mail-noise',
'mail-shared',
+ // Completing a reminder is the whole point of the Reminders view: without
+ // it the only way to clear one is to delete it.
+ 'reminders-upcoming',
+ 'reminders-all',
];
export const canExecuteMarkDoneOnView = (view: ListView, tabId: string) => {
@@ -54,6 +58,7 @@ type MarkDoneVariables = {
entities: EntityData[];
emailIds: string[];
notificationIds: string[];
+ reminderIds: string[];
restoreFocus?: () => void;
/** Suppress the "Marked as done" toast, e.g. for send-triggered mark done
* where it would replace the "Email sent" toast. */
@@ -108,11 +113,13 @@ export const makeMarkDoneAction = (options: MakeMarkDoneOptions) => {
entityIds: variables.entities.map((entity) => entity.id),
emailIds: variables.emailIds,
notificationIds: variables.notificationIds,
+ reminderIds: variables.reminderIds,
}),
mutationFn: (variables) =>
executeMarkEntitiesDone({
emailIds: variables.emailIds,
notificationIds: variables.notificationIds,
+ reminderIds: variables.reminderIds,
}),
onError: (_err, _variables, context) => {
context?.rollback();
@@ -124,6 +131,7 @@ export const makeMarkDoneAction = (options: MakeMarkDoneOptions) => {
await executeMarkEntitiesUndone({
emailIds: variables.emailIds,
notificationIds: variables.notificationIds,
+ reminderIds: variables.reminderIds,
});
} catch (err) {
context?.reapply();
@@ -136,6 +144,7 @@ export const makeMarkDoneAction = (options: MakeMarkDoneOptions) => {
await executeMarkEntitiesDone({
emailIds: variables.emailIds,
notificationIds: variables.notificationIds,
+ reminderIds: variables.reminderIds,
});
} catch (err) {
context?.applyUndone();
@@ -198,7 +207,10 @@ export const makeMarkDoneAction = (options: MakeMarkDoneOptions) => {
entity.type === 'chat' ||
entity.type === 'document' ||
entity.type === 'project' ||
- entity.type === 'foreign'
+ entity.type === 'foreign' ||
+ // Marked done by hand like everything else — opening a reminder does not
+ // dismiss it. Signal gates on the not-done notification either way.
+ entity.type === 'reminder'
) {
return true;
}
@@ -216,15 +228,17 @@ export const makeMarkDoneAction = (options: MakeMarkDoneOptions) => {
const targets = entities.filter(isMarkDoneTarget);
if (targets.length === 0) return;
- const { emailIds, notificationIds } = resolveMarkEntitiesDoneVariables({
- entities: targets,
- notificationSource: notificationSource(),
- scopeChannelNotificationsToEntity: scopeChannelNotificationsToEntity(),
- });
+ const { emailIds, notificationIds, reminderIds } =
+ resolveMarkEntitiesDoneVariables({
+ entities: targets,
+ notificationSource: notificationSource(),
+ scopeChannelNotificationsToEntity: scopeChannelNotificationsToEntity(),
+ });
await mutation.mutateAsync({
entities: targets,
emailIds,
notificationIds,
+ reminderIds,
restoreFocus,
silent: opts?.silent,
onUndoHandle: opts?.onUndoHandle,
diff --git a/apps/web/src/features/next-soup/actions/make-mark-not-done-action.ts b/apps/web/src/features/next-soup/actions/make-mark-not-done-action.ts
index e24b3fa8d5..e78d63921b 100644
--- a/apps/web/src/features/next-soup/actions/make-mark-not-done-action.ts
+++ b/apps/web/src/features/next-soup/actions/make-mark-not-done-action.ts
@@ -15,20 +15,60 @@ type MakeMarkNotDoneOptions = {
notificationSource: () => NotificationSource;
};
+/**
+ * Return completed reminders to the Upcoming tab. Kept off the email path:
+ * none of its preconditions apply, and a reminder's not-done state is its own
+ * `completed` column rather than a notification override.
+ */
+const uncompleteReminders = async (reminders: EntityData[]) => {
+ const reminderIds = reminders.map((r) => r.id);
+ const optimistic = applyEntitiesNotDoneOptimistic({
+ emailIds: [],
+ notificationIds: [],
+ reminderIds,
+ });
+ try {
+ await executeMarkEntitiesUndone({
+ emailIds: [],
+ notificationIds: [],
+ reminderIds,
+ });
+ toast.success(
+ reminderIds.length > 1
+ ? `Marked ${reminderIds.length} reminders as not done`
+ : 'Marked as not done',
+ { duration: 3_000, stack: true, hideOnMobile: true }
+ );
+ } catch {
+ optimistic.rollback();
+ toast.failure('Failed to mark as not done');
+ }
+};
+
/**
* Reverses a mark-done: unarchives email threads and restores their
- * notifications. Only done emails qualify — other entity types' done state
+ * notifications, and un-completes reminders. Other entity types' done state
* lives on their notifications, and their rows never render as done in the
* mark-done-capable views. Threads whose done state can't be reversed (no
* inbound message) are dropped at execute time; see
* `threadCanBeMarkedNotDone`.
*/
export const makeMarkNotDoneAction = (options: MakeMarkNotDoneOptions) => {
+ // Always reversible — unlike a done thread there is no "permanently done" case.
+ const isCompletedReminder = (entity: EntityData): boolean =>
+ entity.type === 'reminder' && entity.completedAt != null;
+
const canExecute = (entity: EntityData): boolean =>
- entity.type === 'email' && entity.done === true;
+ (entity.type === 'email' && entity.done === true) ||
+ isCompletedReminder(entity);
const execute = async (entities: EntityData[]) => {
- const candidates = entities.filter(canExecute);
+ const reminders = entities.filter(isCompletedReminder);
+ if (reminders.length > 0) await uncompleteReminders(reminders);
+
+ const candidates = entities.filter(
+ (e) => e.type === 'email' && e.done === true
+ );
if (candidates.length === 0) return;
// `done` alone doesn't mean the state is reversible — a thread with only
diff --git a/apps/web/src/features/next-soup/actions/make-move-to-project-action.ts b/apps/web/src/features/next-soup/actions/make-move-to-project-action.ts
index 55354b4b18..03250440dd 100644
--- a/apps/web/src/features/next-soup/actions/make-move-to-project-action.ts
+++ b/apps/web/src/features/next-soup/actions/make-move-to-project-action.ts
@@ -10,7 +10,9 @@ export const makeMoveToProjectAction = () => {
entity.type !== 'channel' &&
entity.type !== 'channel_message' &&
entity.type !== 'channel_thread' &&
- entity.type !== 'foreign'
+ entity.type !== 'foreign' &&
+ // Reminders are private to their owner and live outside the folder tree.
+ entity.type !== 'reminder'
);
};
diff --git a/apps/web/src/features/next-soup/actions/use-block-entity-commands.ts b/apps/web/src/features/next-soup/actions/use-block-entity-commands.ts
index 368caf870c..fb27c083e0 100644
--- a/apps/web/src/features/next-soup/actions/use-block-entity-commands.ts
+++ b/apps/web/src/features/next-soup/actions/use-block-entity-commands.ts
@@ -376,7 +376,7 @@ export const useBlockEntityCommands = (
hotkey: ['h'],
hotkeyToken: TOKENS.entity.action.createReminder,
scopeId,
- description: 'Remind me about this',
+ description: 'Remind me',
keyDownHandler: runCreateReminder,
condition: () => {
if (!canUseReminderHotkey()) return false;
@@ -392,7 +392,7 @@ export const useBlockEntityCommands = (
// from the command menu
registerHotkey({
scopeId,
- description: 'Remind me about this',
+ description: 'Remind me',
keyDownHandler: runCreateReminder,
condition: () => {
if (canUseReminderHotkey()) return false;
diff --git a/apps/web/src/features/next-soup/actions/use-entity-action-hotkeys.ts b/apps/web/src/features/next-soup/actions/use-entity-action-hotkeys.ts
index 9ab95d0984..a9006b51a8 100644
--- a/apps/web/src/features/next-soup/actions/use-entity-action-hotkeys.ts
+++ b/apps/web/src/features/next-soup/actions/use-entity-action-hotkeys.ts
@@ -488,7 +488,7 @@ export const useEntityActionHotkeys = (
hotkey: ['h'],
hotkeyToken: TOKENS.entity.action.createReminder,
scopeId,
- description: 'Remind me about this',
+ description: 'Remind me',
keyDownHandler: () => {
const entities = getEntitiesForAction();
if (entities.length !== 1) return false;
diff --git a/apps/web/src/features/next-soup/filters/configs/entity.ts b/apps/web/src/features/next-soup/filters/configs/entity.ts
index facdc19ae7..94c7e8e027 100644
--- a/apps/web/src/features/next-soup/filters/configs/entity.ts
+++ b/apps/web/src/features/next-soup/filters/configs/entity.ts
@@ -9,8 +9,10 @@ import {
crmCompanyFilter as crmCompanyPredicate,
filesAndFolderFilter as filesAndFolderPredicate,
projectFilter as projectPredicate,
+ remindersFilter as remindersPredicate,
searchSupportedFilter as searchSupportedPredicate,
taskFilter as taskPredicate,
+ upcomingRemindersFilter as upcomingRemindersPredicate,
} from '../predicates';
import { config, isAgent, isNotTask, NIL_UUID } from './base';
@@ -70,6 +72,23 @@ export const crmCompanyFilter = config({
query: defineQueryFilters({}, { skipTargets: ['ccf'] }),
});
+// Reminders are opt-in server-side, so unlike the other entity filters these
+// queries name `includeReminders` rather than just skipping their own target —
+// there is no `remf` entry in ID_FIELD_NAMES to skip.
+export const remindersFilter = config({
+ id: 'reminders',
+ predicate: remindersPredicate,
+ query: defineQueryFilters({ include: { includeReminders: true } }),
+});
+
+export const upcomingRemindersFilter = config({
+ id: 'reminders-upcoming',
+ predicate: upcomingRemindersPredicate,
+ query: defineQueryFilters({
+ include: { includeReminders: true, reminderCompleted: false },
+ }),
+});
+
export const crmCompanyActiveFilter = config({
id: 'crm-company-active',
predicate: crmCompanyActivePredicate,
diff --git a/apps/web/src/features/next-soup/filters/configs/index.ts b/apps/web/src/features/next-soup/filters/configs/index.ts
index 74c90368bf..52a7fb468d 100644
--- a/apps/web/src/features/next-soup/filters/configs/index.ts
+++ b/apps/web/src/features/next-soup/filters/configs/index.ts
@@ -37,7 +37,9 @@ import {
foldersFilter,
inFolderFilter,
notTaskFilter,
+ remindersFilter,
searchSupportedFilter,
+ upcomingRemindersFilter,
} from './entity';
import { ENTITY_TYPE_FILTERS } from './entity-type';
import {
@@ -93,6 +95,8 @@ export const SOUP_FILTERS = [
companyStageFilter,
emailAttachmentsFilter,
inFolderFilter,
+ remindersFilter,
+ upcomingRemindersFilter,
searchSupportedFilter,
...ENTITY_TYPE_FILTERS,
...TASK_STATUS_FILTERS,
diff --git a/apps/web/src/features/next-soup/filters/filter-store/compile.test.ts b/apps/web/src/features/next-soup/filters/filter-store/compile.test.ts
index 54020cb03d..7e4027138d 100644
--- a/apps/web/src/features/next-soup/filters/filter-store/compile.test.ts
+++ b/apps/web/src/features/next-soup/filters/filter-store/compile.test.ts
@@ -169,6 +169,23 @@ describe('compileToAst', () => {
});
});
+ it('compiles the reminder opt-in to a bare Include literal', () => {
+ const ast = compileToAst(
+ queryStateFrom({ include: { includeReminders: true } })
+ );
+
+ // Reminders are off in Soup unless a view asks; this literal is the ask.
+ expect(ast.remf).toEqual({ l: 'inc' });
+ });
+
+ it('leaves reminders unrequested when a view does not opt in', () => {
+ const ast = compileToAst(
+ queryStateFrom({ include: { documentDone: false } })
+ );
+
+ expect(ast.remf).toBeUndefined();
+ });
+
it('compiles channel message thread ids onto regular channel filters', () => {
const ast = compileToAst(
queryStateFrom({
diff --git a/apps/web/src/features/next-soup/filters/filter-store/compile.ts b/apps/web/src/features/next-soup/filters/filter-store/compile.ts
index 407c8119fc..e061cd52bd 100644
--- a/apps/web/src/features/next-soup/filters/filter-store/compile.ts
+++ b/apps/web/src/features/next-soup/filters/filter-store/compile.ts
@@ -29,6 +29,7 @@ type QueryTarget =
| 'callf'
| 'fef'
| 'ccf'
+ | 'remf'
| 'propf';
export type TargetAstMap = {
@@ -137,6 +138,9 @@ const FIELD_CONFIG: Record<
foreignEntityIncludesMe: { target: 'fef', field: 'me', unit: true },
crmCompanyId: { target: 'ccf', field: 'id' },
crmCompanyHidden: { target: 'ccf', field: 'hidden' },
+ reminderId: { target: 'remf', field: 'id' },
+ reminderCompleted: { target: 'remf', field: 'comp' },
+ includeReminders: { target: 'remf', field: 'inc', unit: true },
};
const DATE_RANGE_FIELDS: Record<
@@ -197,6 +201,7 @@ const emptyTargetAstLists = (): Record<QueryTarget, BackendAst[]> => ({
callf: [],
fef: [],
ccf: [],
+ remf: [],
propf: [],
});
diff --git a/apps/web/src/features/next-soup/filters/filter-store/types.ts b/apps/web/src/features/next-soup/filters/filter-store/types.ts
index 081e3d29e1..90764652ef 100644
--- a/apps/web/src/features/next-soup/filters/filter-store/types.ts
+++ b/apps/web/src/features/next-soup/filters/filter-store/types.ts
@@ -62,6 +62,7 @@ export type ArrayFieldFilters = {
foreignEntityRecordId?: string[];
foreignEntitySource?: string[];
crmCompanyId?: string[];
+ reminderId?: string[];
properties?: PropertyFilter[];
// Selected tags. Kept separate from `properties` because tags combine as a
// single OR across all tag definitions (personal + team), whereas `properties`
@@ -97,6 +98,9 @@ export type ScalarFieldFilters = {
callStatus?: CallStatus;
callAttended?: boolean;
crmCompanyHidden?: boolean;
+ // Reminders are off by default in Soup; a view must opt in.
+ includeReminders?: boolean;
+ reminderCompleted?: boolean;
documentCreatedAt?: DateRangeFilter;
documentUpdatedAt?: DateRangeFilter;
chatCreatedAt?: DateRangeFilter;
diff --git a/apps/web/src/features/next-soup/filters/inbox-filters.ts b/apps/web/src/features/next-soup/filters/inbox-filters.ts
index 8664d300c7..6ce9ca173c 100644
--- a/apps/web/src/features/next-soup/filters/inbox-filters.ts
+++ b/apps/web/src/features/next-soup/filters/inbox-filters.ts
@@ -133,6 +133,10 @@ export function signalFilter(entity: EntityData): boolean {
// Foreign entities (e.g. GitHub PRs) are gated by the inbox query on the
// user's not-done notifications, so they're signal whenever returned.
return true;
+ case 'reminder':
+ // A reminder that has fired is gated into the Inbox by its notification,
+ // same as the other notification-driven types.
+ return true;
}
}
diff --git a/apps/web/src/features/next-soup/filters/predicates.ts b/apps/web/src/features/next-soup/filters/predicates.ts
index d0ad7e4341..704470dc76 100644
--- a/apps/web/src/features/next-soup/filters/predicates.ts
+++ b/apps/web/src/features/next-soup/filters/predicates.ts
@@ -141,6 +141,26 @@ export function crmCompanyFilter(entity: EntityData): boolean {
return entity.type === 'crm_company';
}
+export function remindersFilter(entity: EntityData): boolean {
+ return entity.type === 'reminder';
+}
+
+/**
+ * Reminders that have not fired yet.
+ *
+ * `completedAt` alone is not enough: it means the owner has dealt with the
+ * reminder, and firing deliberately does not set it — a reminder that has just
+ * arrived is waiting on them, not finished. So a fired one would otherwise sit
+ * in "Upcoming" until dismissed. The firing time is what makes it upcoming.
+ */
+export function upcomingRemindersFilter(entity: EntityData): boolean {
+ return (
+ entity.type === 'reminder' &&
+ !entity.completedAt &&
+ new Date(entity.nextRunAt).getTime() > Date.now()
+ );
+}
+
/**
* Entity types the search view supports. Mirrors the search preset's
* server-side exclusions (foreign entities + CRM) so entities that enter
diff --git a/apps/web/src/features/next-soup/filters/query-filters.ts b/apps/web/src/features/next-soup/filters/query-filters.ts
index c131311994..28d8d7dc85 100644
--- a/apps/web/src/features/next-soup/filters/query-filters.ts
+++ b/apps/web/src/features/next-soup/filters/query-filters.ts
@@ -161,6 +161,10 @@ export function filterSoupItemByRequestBody(
)
// Calendar soup rendering lands with the calendar FE; never cache-match.
.with({ tag: 'calendarEvent' }, () => false)
+ .with(
+ { tag: 'reminder' },
+ ({ data }) => !isIdFilteredOut(body.reminder_filters?.ids, data.id)
+ )
.exhaustive()
);
}
diff --git a/apps/web/src/features/next-soup/sidebar/soup-filter-presets.test.ts b/apps/web/src/features/next-soup/sidebar/soup-filter-presets.test.ts
index 7b42ecc426..309527e9ac 100644
--- a/apps/web/src/features/next-soup/sidebar/soup-filter-presets.test.ts
+++ b/apps/web/src/features/next-soup/sidebar/soup-filter-presets.test.ts
@@ -1,11 +1,19 @@
-import { describe, expect, it, vi } from 'vitest';
+import { afterEach, describe, expect, it, vi } from 'vitest';
+
+const mocks = vi.hoisted(() => ({ remindersEnabled: true }));
vi.mock('@core/constant/featureFlags', () => ({
ENABLE_NEW_INBOX: () => false,
+ ENABLE_REMINDERS: () => mocks.remindersEnabled,
ENABLE_SNIPPETS: () => true,
ENABLE_SUPPORTED_SOUP_FOREIGN_ENTITIES_OVERRIDE: false,
}));
+afterEach(() => {
+ mocks.remindersEnabled = true;
+});
+
+import { compileToAst, queryStateFrom } from '../filters/filter-store/compile';
import { getViewPreset, VIEW_TAB_PRESETS } from './soup-filter-presets';
const mailTabs = Object.keys(VIEW_TAB_PRESETS.mail.tabs);
@@ -33,3 +41,67 @@ describe('calendar event scoping', () => {
).toEqual([nilId]);
});
});
+
+describe('inbox view presets', () => {
+ it('opts the signal tab into reminders', () => {
+ const filters = getViewPreset('inbox', 'signal')?.filters;
+ const ast = compileToAst(queryStateFrom(filters!));
+
+ // Reminders are off server-side unless a query names them; this is the ask.
+ expect(ast.remf).toEqual({ l: 'inc' });
+ });
+
+ it('leaves the signal tab alone when the reminders flag is off', () => {
+ mocks.remindersEnabled = false;
+
+ const filters = getViewPreset('inbox', 'signal')?.filters;
+ const ast = compileToAst(queryStateFrom(filters!));
+
+ // No `remf` at all, so an unflagged user never hits the reminders service.
+ expect(ast.remf).toBeUndefined();
+ });
+
+ it('leaves every other inbox tab without reminders', () => {
+ for (const tab of ['noise', 'all']) {
+ const filters = getViewPreset('inbox', tab)?.filters;
+ const ast = compileToAst(queryStateFrom(filters!));
+ expect(ast.remf, `${tab} should not request reminders`).toBeUndefined();
+ }
+ });
+});
+
+describe('reminders view presets', () => {
+ const astFor = (tab: string) => {
+ const preset = getViewPreset('reminders', tab);
+ if (!preset) throw new Error(`no reminders preset for tab "${tab}"`);
+ return compileToAst(queryStateFrom(preset.filters));
+ };
+
+ it('defaults to the upcoming tab', () => {
+ expect(VIEW_TAB_PRESETS.reminders.default).toBe('upcoming');
+ });
+
+ it('asks for reminders that have not fired on the upcoming tab', () => {
+ expect(astFor('upcoming').remf).toEqual({
+ '&': [{ l: { comp: false } }, { l: 'inc' }],
+ });
+ });
+
+ it('asks for every reminder on the all tab', () => {
+ expect(astFor('all').remf).toEqual({ l: 'inc' });
+ });
+
+ // defineQueryFilters NIL-excludes every target a query does not name, which
+ // is the only thing keeping other entity types out of this view.
+ it.each(['upcoming', 'all'])(
+ 'excludes every other entity type on the %s tab',
+ (tab) => {
+ const ast = astFor(tab);
+
+ expect(ast.df, 'documents').toBeDefined();
+ expect(ast.ef, 'emails').toBeDefined();
+ expect(ast.chanf, 'channels').toBeDefined();
+ expect(ast.cf, 'chats').toBeDefined();
+ }
+ );
+});
diff --git a/apps/web/src/features/next-soup/sidebar/soup-filter-presets.ts b/apps/web/src/features/next-soup/sidebar/soup-filter-presets.ts
index 9799730d67..84039482f6 100644
--- a/apps/web/src/features/next-soup/sidebar/soup-filter-presets.ts
+++ b/apps/web/src/features/next-soup/sidebar/soup-filter-presets.ts
@@ -7,6 +7,7 @@ import {
} from '@app/features/next-soup/filters/filter-store';
import {
ENABLE_NEW_INBOX,
+ ENABLE_REMINDERS,
ENABLE_SNIPPETS,
ENABLE_SUPPORTED_SOUP_FOREIGN_ENTITIES_OVERRIDE,
} from '@core/constant/featureFlags';
@@ -98,6 +99,12 @@ const getInboxSignalFilters = () => {
foreignEntityDone: false,
foreignEntityIncludesMe: true,
emailShared: 'exclude',
+ // Reminders are off by default server-side rather than excluded by
+ // `defineQueryFilters` (there is no `remf` entry in ID_FIELD_NAMES), so
+ // this literal is the only thing that surfaces them — and Signal is the
+ // only view that sends it. Behind the flag so an unflagged user never
+ // pays for the reminders lookup on every Signal fetch.
+ ...(ENABLE_REMINDERS() ? { includeReminders: true } : {}),
},
exclude: getDisabledSnippetSubtypeExclude(),
emailView: 'inbox',
@@ -484,6 +491,29 @@ export const VIEW_TAB_PRESETS: Record<ListView, ViewTabConfig> = {
}),
},
},
+ // Reminders are the one entity type that is opt-in server-side, so naming
+ // `includeReminders` both surfaces them and — via defineQueryFilters, which
+ // NIL-excludes every target this query does not reference — makes the view
+ // reminders-only. Soup already orders them by when they fire.
+ reminders: {
+ default: 'upcoming',
+ tabs: {
+ // Not yet fired. Recurring reminders never complete, so they stay here
+ // across firings, which is what "upcoming" should mean for them.
+ upcoming: () => ({
+ filters: defineQueryFilters({
+ include: { includeReminders: true, reminderCompleted: false },
+ }),
+ clientFilters: { and: ['reminders-upcoming'] },
+ }),
+ all: () => ({
+ filters: defineQueryFilters({
+ include: { includeReminders: true },
+ }),
+ clientFilters: { and: ['reminders'] },
+ }),
+ },
+ },
search: {
default: 'all',
tabs: {
diff --git a/apps/web/src/features/next-soup/soup-view/create-soup-entity-actions.ts b/apps/web/src/features/next-soup/soup-view/create-soup-entity-actions.ts
index fd2f00ddc1..d1a0378bf4 100644
--- a/apps/web/src/features/next-soup/soup-view/create-soup-entity-actions.ts
+++ b/apps/web/src/features/next-soup/soup-view/create-soup-entity-actions.ts
@@ -34,7 +34,11 @@ import {
makeShareAction,
} from '../actions';
import type { SoupState } from '../create-soup-state';
-import { openEntityInSplitFromUnifiedList } from '../utils';
+import {
+ markReminderSeenOnOpen,
+ openEntityInSplitFromUnifiedList,
+ reminderSplitTarget,
+} from '../utils';
const SIGNAL_TABS = new Set<string | undefined>([
undefined,
@@ -211,6 +215,15 @@ export function createSoupEntityActions(): {
if (!entity || entity.type === 'foreign') return undefined;
const splitManager = globalSplitManager();
if (!splitManager) return undefined;
+ // A reminder opens what it references. A standalone one references
+ // nothing, so there is nothing to open.
+ if (entity.type === 'reminder') {
+ const target = reminderSplitTarget(entity);
+ if (!target) return undefined;
+ const open = splitManager.getSplitByContent(target.type, target.id);
+ if (open && open.id !== splitHandle?.viewerId()) return undefined;
+ return entity;
+ }
const contentId =
entity.type === 'channel_message' || entity.type === 'channel_thread'
? entity.channelId
@@ -233,6 +246,8 @@ export function createSoupEntityActions(): {
});
}
+ markReminderSeenOnOpen(entity, notificationSource);
+
// Same path as shift/opt+click, so the menu inherits Preview Pair
// routing (new split when it fits; replacing the pair outright) and
// per-entity targeting such as a thread row's driving message.
@@ -293,7 +308,7 @@ export function createSoupEntityActions(): {
if (entities.length === 1 && createReminderAction.canExecute(entities[0])) {
middleItems.push({
id: 'create-reminder',
- label: 'Remind me about this',
+ label: 'Remind me',
hotkeyToken: TOKENS.entity.action.createReminder,
onClick: handle(createReminderAction.executeWithSoup),
});
diff --git a/apps/web/src/features/next-soup/soup-view/empty-states.tsx b/apps/web/src/features/next-soup/soup-view/empty-states.tsx
index 87b16a0ab7..6a5fd46206 100644
--- a/apps/web/src/features/next-soup/soup-view/empty-states.tsx
+++ b/apps/web/src/features/next-soup/soup-view/empty-states.tsx
@@ -25,6 +25,15 @@ import { type Component, type JSXElement, Match, Switch } from 'solid-js';
import { FolderDropZone } from './FolderDropZone';
import { useSoupView } from './soup-view-context';
+/** A single key, sized to sit inline in a sentence rather than on its own row. */
+function HotkeyCap(props: { children: JSXElement }) {
+ return (
+ <kbd class="rounded border border-edge-muted px-1 py-px font-mono text-xs">
+ {props.children}
+ </kbd>
+ );
+}
+
type FallbackContent = {
plural: string;
graphic?: Component<{ class?: string }>;
@@ -50,6 +59,17 @@ const FALLBACK_CONTENT: Partial<Record<ListView, FallbackContent>> = {
create: { label: 'New channel', blockName: 'channel' },
documentationUrl: `${DOCS_BASE}/product/channels`,
},
+ // No `create`: a reminder is always set on something, from that thing's own
+ // menu — there is no standalone "new reminder" to offer here.
+ reminders: {
+ plural: 'reminders',
+ description: (
+ <>
+ Set a reminder on anything in Macro by selecting it and pressing{' '}
+ <HotkeyCap>h</HotkeyCap>, or with the option in its right-click menu.
+ </>
+ ),
+ },
calls: {
plural: 'calls',
graphic: EmptyStateCallsGraphic,
diff --git a/apps/web/src/features/next-soup/soup-view/filters-bar/unified-filter-dropdown.tsx b/apps/web/src/features/next-soup/soup-view/filters-bar/unified-filter-dropdown.tsx
index b8099ced3a..d840075839 100644
--- a/apps/web/src/features/next-soup/soup-view/filters-bar/unified-filter-dropdown.tsx
+++ b/apps/web/src/features/next-soup/soup-view/filters-bar/unified-filter-dropdown.tsx
@@ -385,6 +385,9 @@ export const VIEW_FILTER_CATEGORIES: Record<ListView, FilterCategory[]> = {
channels: [],
calls: [],
folders: [],
+ // The two tabs already split reminders on the only axis they have; there is
+ // nothing further to refine by.
+ reminders: [],
search: [],
};
diff --git a/apps/web/src/features/next-soup/soup-view/soup-view-tabs.tsx b/apps/web/src/features/next-soup/soup-view/soup-view-tabs.tsx
index 498e8bc13e..8ff8f545d3 100644
--- a/apps/web/src/features/next-soup/soup-view/soup-view-tabs.tsx
+++ b/apps/web/src/features/next-soup/soup-view/soup-view-tabs.tsx
@@ -37,6 +37,7 @@ export type TabbedListView = Extract<
| 'channels'
| 'calls'
| 'folders'
+ | 'reminders'
>;
/** Tab definitions for each list view. */
@@ -87,6 +88,10 @@ export const VIEW_TAB_LISTS: Record<TabbedListView, TabItem[]> = {
{ value: 'owned', label: 'Owned' },
{ value: 'all', label: 'All' },
],
+ reminders: [
+ { value: 'upcoming', label: 'Upcoming' },
+ { value: 'all', label: 'All' },
+ ],
};
const useCurrentListView = () => {
diff --git a/apps/web/src/features/next-soup/soup-view/soup-view.tsx b/apps/web/src/features/next-soup/soup-view/soup-view.tsx
index ae48ddbd6e..bf99f6ebd8 100644
--- a/apps/web/src/features/next-soup/soup-view/soup-view.tsx
+++ b/apps/web/src/features/next-soup/soup-view/soup-view.tsx
@@ -49,6 +49,7 @@ import { TaskListEntity } from '@app/features/next-soup/soup-view/views/tasks/Ta
import { ResponsiveTaskListHeader } from '@app/features/next-soup/soup-view/views/tasks/TaskListHeader';
import { TaskGroupHeader } from '@app/features/next-soup/soup-view/views/tasks/task-group-header';
import {
+ markReminderSeenOnOpen,
openEntityInNewTab,
openEntityInSplitFromUnifiedList,
preventDuplicatePreviewEntityOpen,
@@ -926,6 +927,8 @@ const SoupViewListContent = (props: SoupViewListProps) => {
type === 'entity' ? args.entity : args.projectEntity
) as EntityData;
+ markReminderSeenOnOpen(entity, notificationSource);
+
// FIXME: this never gets called because we have overrides
if (event.metaKey || event.ctrlKey) {
// Channels the viewer hasn't joined can't be opened; the row's inline
diff --git a/apps/web/src/features/next-soup/soup-view/use-soup-view-hotkeys.ts b/apps/web/src/features/next-soup/soup-view/use-soup-view-hotkeys.ts
index bc0e28cc32..a1e795a1c6 100644
--- a/apps/web/src/features/next-soup/soup-view/use-soup-view-hotkeys.ts
+++ b/apps/web/src/features/next-soup/soup-view/use-soup-view-hotkeys.ts
@@ -2,9 +2,13 @@ import { GO_TO_COMMAND_SCOPE, GO_TO_LEADER_KEY } from '@app/constants/hotkeys';
import { isListViewID, type ListView } from '@app/constants/list-views';
import { CommandState } from '@app/features/command/state';
import { VIEW_TAB_PRESETS } from '@app/features/next-soup/sidebar/soup-filter-presets';
-import { openEntityInSplitFromUnifiedList } from '@app/features/next-soup/utils';
+import {
+ markReminderSeenOnOpen,
+ openEntityInSplitFromUnifiedList,
+} from '@app/features/next-soup/utils';
import { useAnalytics } from '@app/lib/analytics/analytics-context';
import { globalSplitManager } from '@app/signal/splitLayout';
+import { useGlobalNotificationSource } from '@components/app/GlobalAppState';
import type { SplitHandle } from '@components/app/split-layout/layoutManager';
import { createHotkeyGroup, registerHotkey } from '@core/hotkey/hotkeys';
import { TOKENS } from '@core/hotkey/tokens';
@@ -45,6 +49,7 @@ export const useSoupViewHotkeys = (options: UseSoupViewHotkeysOptions) => {
} = options;
const analytics = useAnalytics();
+ const notificationSource = useGlobalNotificationSource();
const splitIsUnifiedList = () => isListViewID(splitHandle.content().id);
@@ -174,6 +179,7 @@ export const useSoupViewHotkeys = (options: UseSoupViewHotkeysOptions) => {
const location =
contentHitData?.length === 1 ? contentHitData[0]?.location : undefined;
+ markReminderSeenOnOpen(entity, notificationSource);
openEntityInSplitFromUnifiedList(entity, {
splitHandle,
location,
@@ -213,6 +219,7 @@ export const useSoupViewHotkeys = (options: UseSoupViewHotkeysOptions) => {
keyDownHandler: () => {
const entity = soup.focus.item();
if (!entity) return false;
+ markReminderSeenOnOpen(entity, notificationSource);
openEntityInSplitFromUnifiedList(entity, {
splitHandle,
replacePreview: true,
@@ -323,6 +330,7 @@ export const useSoupViewHotkeys = (options: UseSoupViewHotkeysOptions) => {
const entity = soup.focus.item();
if (!entity) return false;
+ markReminderSeenOnOpen(entity, notificationSource);
openEntityInSplitFromUnifiedList(entity, {
splitHandle,
openInNewSplit: true,
diff --git a/apps/web/src/features/next-soup/soup-view/views/inbox/inbox-card-layouts.tsx b/apps/web/src/features/next-soup/soup-view/views/inbox/inbox-card-layouts.tsx
index 7af0668506..73852b102f 100644
--- a/apps/web/src/features/next-soup/soup-view/views/inbox/inbox-card-layouts.tsx
+++ b/apps/web/src/features/next-soup/soup-view/views/inbox/inbox-card-layouts.tsx
@@ -3,6 +3,7 @@ import { formatCallDuration } from '@block-call/utils';
import { BotIcon } from '@channel/Message/BotIcon';
import { MACRO_AI_BOT_ID, MACRO_AI_NAME } from '@channel/macroAi';
import { EntityIcon, getEntityIconType } from '@core/component/EntityIcon';
+import { ItemPreview, useItemPreviewData } from '@core/component/ItemPreview';
import { StaticMarkdown } from '@core/component/LexicalMarkdown/component/core/StaticMarkdown';
import {
createTheme,
@@ -41,6 +42,7 @@ import {
} from '@property/context/PropertiesContext';
import type { PropertyApiValues, Property as PropertyT } from '@property/types';
import { senderFromStorageId } from '@queries/channel/message-sender';
+import type { ItemEntity } from '@queries/preview';
import { useBulkSaveEntityPropertiesMutation } from '@queries/properties/entity';
import { EntityType } from '@service-storage/generated/schemas';
import { Avatar, cn, Tooltip } from '@ui';
@@ -126,6 +128,13 @@ const getNotificationSenderFallbackName = (
};
const getTimestamp = (entity: EntityData, notification?: Notification) => {
+ // Reminders sort on when they fire, so the row has to show that field too.
+ // The notification's time drifts from it for anything recurring, retried, or
+ // dispatched late, and the list then reads as unsorted.
+ if (entity.type === 'reminder') {
+ return entity.nextRunAt != null ? String(entity.nextRunAt) : undefined;
+ }
+
const messageTime =
entity.type === 'channel'
? entity.latestRootMessage?.createdAt
@@ -475,6 +484,12 @@ function BaseCard(props: {
leading: JSX.Element;
title: JSX.Element;
preview?: string;
+ /**
+ * Inline element rendered at the head of the preview line, before the text,
+ * and on its own when there is no text. Must be inline-level — the line
+ * truncates as one run, the way an inline mention does in a message preview.
+ */
+ previewInline?: JSX.Element;
attachments?: InboxCardAttachment[];
entityId: string;
properties?: PropertyT[];
@@ -496,16 +511,19 @@ function BaseCard(props: {
</InboxCard.Header>
<div class="col-start-2 row-start-2 flex min-w-0 flex-col">
- <Show when={props.preview?.trim()}>
- {(value) => (
- <InboxCard.Content class="truncate text-sm">
- <StaticMarkdown
- markdown={value()}
- singleLine
- theme={unifiedListMarkdownTheme}
- />
- </InboxCard.Content>
- )}
+ <Show when={props.previewInline || props.preview?.trim()}>
+ <InboxCard.Content class="truncate text-sm">
+ {props.previewInline}
+ <Show when={props.preview?.trim()}>
+ {(value) => (
+ <StaticMarkdown
+ markdown={value()}
+ singleLine
+ theme={unifiedListMarkdownTheme}
+ />
+ )}
+ </Show>
+ </InboxCard.Content>
</Show>
<PropertyPills
@@ -1421,6 +1439,108 @@ export function CallCardLayout(props: InboxCardLayoutProps) {
);
}
+/**
+ * A reminder is self-set, so there is no sender and no action to describe.
+ *
+ * With something to point at, the description leads and the chip below says
+ * what it is about. Standalone, there is nothing to link to, so the generic
+ * title leads — matching `ReminderMetadata::format_title` on the backend, so
+ * the row and the push notification read the same — and the description
+ * becomes the body.
+ */
+export function ReminderCardLayout(props: InboxCardLayoutProps) {
+ // The current description, not the notification's copy of it, so editing a
+ // reminder after it fires updates the row.
+ const description = () => props.item.entity.name;
+
+ const referenced = () =>
+ props.item.entity.type === 'reminder'
+ ? props.item.entity.referencedEntity
+ : undefined;
+
+ return (
+ <BaseCard
+ entityId={props.item.entity.id}
+ selected={props.selected}
+ highlighted={props.highlighted}
+ onClick={props.onClick}
+ unread={props.item.unread}
+ timestamp={props.item.timestamp}
+ leading={
+ // Always the bell, never the referenced entity's icon: the row is a
+ // reminder first, and the thing it points at is named right below.
+ <InboxCard.Icon fallback={<BellSimpleIcon class="size-4" />} />
+ }
+ title={
+ <Show when={referenced()} fallback="Reminder">
+ {(reference) => (
+ <ReminderTitle
+ description={description()}
+ id={reference().id}
+ type={reference().type}
+ />
+ )}
+ </Show>
+ }
+ // Shown as the body only when it isn't already the title.
+ preview={referenced() ? undefined : description()}
+ previewInline={
+ <Show when={referenced()}>
+ {(reference) => (
+ <ReminderReferenceChip
+ id={reference().id}
+ type={reference().type}
+ />
+ )}
+ </Show>
+ }
+ />
+ );
+}
+
+/**
+ * The reminder's description, unless it says nothing the chip below doesn't.
+ *
+ * The composer derives the description from the entity, so today it usually
+ * *is* the referenced entity's name — printing it as the title would just
+ * repeat the chip. Falling back to the generic title keeps the row readable
+ * until descriptions become editable, and gets out of the way once they are.
+ */
+function ReminderTitle(props: ItemEntity & { description: string }) {
+ const { item, name } = useItemPreviewData(() => ({
+ id: props.id,
+ type: props.type,
+ }));
+
+ const ownText = () => {
+ const description = props.description.trim();
+ // While the reference is resolving, `name()` is a placeholder, so the two
+ // cannot be compared yet — hold the generic title rather than flash text
+ // that is about to collapse into it.
+ if (!description || item().loading) return undefined;
+ return description === name().trim() ? undefined : description;
+ };
+
+ return <>{ownText() ?? 'Reminder'}</>;
+}
+
+/**
+ * What the reminder is about, as an inline mention chip — the same icon, name,
+ * and hover preview a document mention gets inside a message. `ItemPreview`
+ * resolves the name and handles the deleted / no-access cases; the classes
+ * strip its default boxed-button look back to inline text.
+ */
+function ReminderReferenceChip(props: ItemEntity) {
+ return (
+ <ItemPreview
+ {...props}
+ class="inline-flex h-auto max-w-full rounded-none px-0 align-[-0.15em] ring-0 hover:bg-transparent"
+ iconClass="mr-1 size-3.5"
+ textClass="underline decoration-current/20 decoration-[max(1px,0.1em)] underline-offset-2"
+ />
+ );
+}
+
export function GenericCardLayout(props: InboxCardLayoutProps) {
const text = createMemo(() => ({
title: props.item.entity.name
@@ -1516,6 +1636,9 @@ export function InboxCardLayout(props: InboxCardLayoutProps) {
<Match when={props.item.entity.type === 'channel_thread'}>
<ChannelThreadCardLayout {...props} />
</Match>
+ <Match when={props.item.entity.type === 'reminder'}>
+ <ReminderCardLayout {...props} />
+ </Match>
<Match when={true}>
<GenericCardLayout {...props} />
</Match>
diff --git a/apps/web/src/features/next-soup/utils.test.ts b/apps/web/src/features/next-soup/utils.test.ts
index ed4ec124cc..af22643de9 100644
--- a/apps/web/src/features/next-soup/utils.test.ts
+++ b/apps/web/src/features/next-soup/utils.test.ts
@@ -124,7 +124,11 @@ describe('resolveMarkEntitiesDoneVariables', () => {
entities: [channelRow({ notifications: [notification] })],
notificationSource,
})
- ).toEqual({ emailIds: [], notificationIds: ['notification-1'] });
+ ).toEqual({
+ emailIds: [],
+ notificationIds: ['notification-1'],
+ reminderIds: [],
+ });
});
});
diff --git a/apps/web/src/features/next-soup/utils.ts b/apps/web/src/features/next-soup/utils.ts
index aee3b1f210..b16203bc8a 100644
--- a/apps/web/src/features/next-soup/utils.ts
+++ b/apps/web/src/features/next-soup/utils.ts
@@ -40,6 +40,7 @@ import {
isSearchEntity,
isWithNotification,
queryKeys,
+ type ReminderEntity,
type SearchLocation,
toNotificationEntity,
type WithSearch,
@@ -48,6 +49,7 @@ import {
compositeEntity,
getAllNotificationsFromGroup,
getChannelNotificationParams,
+ markNotificationsForEntityAsRead,
type NotificationSource,
notificationIsRead,
setDoneOverride,
@@ -63,6 +65,10 @@ import {
restoreUserNotifications,
snapshotUserNotifications,
} from '@queries/notification/user-notifications';
+import {
+ invalidateRemindersById,
+ setReminderCompleted,
+} from '@queries/reminders/reminders';
import {
getSoupEntityById,
invalidateSoupEntity,
@@ -202,6 +208,18 @@ export const openEntityInNewTab = ({
entity: EntityData;
location?: SearchLocation;
}) => {
+ // A reminder has no route of its own — it opens what it references, the
+ // same as the split paths. A standalone one references nothing, so there is
+ // no tab to open.
+ if (entity.type === 'reminder') {
+ const target = reminderSplitTarget(entity);
+ if (!target) return;
+ openExternalUrl(
+ new URL(`/app/${target.type}/${target.id}`, window.location.origin).href
+ );
+ return;
+ }
+
// Build URL for the entity
let entityPath: string;
if (entity.type === 'document') {
@@ -586,6 +604,9 @@ export const openEntityInSplitFromUnifiedList = async (
const blockOrchestrator = splitManager.getOrchestrator();
+ // A standalone reminder points at nothing, so there is nothing to open.
+ if (entity.type === 'reminder' && !entity.referencedEntity) return;
+
const content = getEntitySplitContent(entity);
if (
@@ -667,6 +688,48 @@ export const openEntityInSplitFromUnifiedList = async (
}
};
+/**
+ * Mark a reminder's notification read when the user opens it.
+ *
+ * Every other entity type gets this for free from the block it opens into,
+ * which mounts `DebouncedNotificationReadMarker`. A reminder has no block of
+ * its own — it navigates to whatever it references, and that block's marker
+ * clears the referenced entity's notifications, not the reminder's. So opening
+ * is the only signal we get, and without this the row keeps its unread dot
+ * forever.
+ *
+ * Seen, not done: the reminder stays in Signal until the user dismisses it.
+ */
+export function markReminderSeenOnOpen(
+ entity: EntityData,
+ notificationSource: NotificationSource
+) {
+ if (entity.type !== 'reminder') return;
+ void markNotificationsForEntityAsRead(notificationSource, {
+ type: entity.type,
+ id: entity.id,
+ });
+}
+
+/**
+ * The split a reminder opens: the entity it references, never itself.
+ * `undefined` for a standalone reminder, which points at nothing — callers use
+ * that to decide whether opening is possible at all.
+ *
+ * `fileType`/`subType` come resolved from the server, so a referenced document
+ * lands on its real block rather than 'unknown'.
+ */
+export function reminderSplitTarget(entity: ReminderEntity) {
+ const referenced = entity.referencedEntity;
+ if (!referenced) return undefined;
+ return {
+ type: fileTypeToBlockName(
+ referenced.subType ?? referenced.fileType ?? referenced.type
+ ),
+ id: referenced.id,
+ };
+}
+
// TODO(dev-rb/github): Map GitHub PRs to { type: 'pr', id }.
function getEntitySplitContent(entity: EntityData) {
return match(entity)
@@ -691,6 +754,14 @@ function getEntitySplitContent(entity: EntityData) {
.with({ type: 'crm_contact' }, (entity) => {
return { type: 'contact' as const, id: entity.id };
})
+ .with({ type: 'reminder' }, (entity) => {
+ return (
+ reminderSplitTarget(entity) ?? {
+ type: 'unknown' as const,
+ id: entity.id,
+ }
+ );
+ })
.otherwise((entity) => {
return { type: entity.type, id: entity.id };
});
@@ -1033,13 +1104,19 @@ export function resolveMarkEntitiesDoneVariables(args: {
* channel_thread mark-done only targets that thread's stack.
*/
scopeChannelNotificationsToEntity?: boolean;
-}): { emailIds: string[]; notificationIds: string[] } {
+}): { emailIds: string[]; notificationIds: string[]; reminderIds: string[] } {
const {
entities,
notificationSource,
scopeChannelNotificationsToEntity = false,
} = args;
const emailIds = entities.filter((e) => e.type === 'email').map((e) => e.id);
+ // A reminder's done state is its own column, not its notification's: an
+ // upcoming reminder has no notification to mark, and the Reminders view
+ // filters on the column.
+ const reminderIds = entities
+ .filter((e) => e.type === 'reminder')
+ .map((e) => e.id);
const notificationIds = entities.flatMap((entity) => {
// GraphQL Soup rows carry their own notification edge. Prefer that edge
// over the global notification query, which may not have paged far enough
@@ -1064,6 +1141,7 @@ export function resolveMarkEntitiesDoneVariables(args: {
return {
emailIds: [...new Set(emailIds)],
notificationIds: [...new Set(notificationIds)],
+ reminderIds: [...new Set(reminderIds)],
};
}
@@ -1077,8 +1155,9 @@ export function applyEntitiesDoneOptimistic(args: {
entityIds: string[];
emailIds: string[];
notificationIds: string[];
+ reminderIds?: string[];
}): MarkEntitiesDoneContext {
- const { entityIds, emailIds, notificationIds } = args;
+ const { entityIds, emailIds, notificationIds, reminderIds = [] } = args;
const emailIdSet = new Set(emailIds);
const entityIdSet = new Set(entityIds);
@@ -1150,6 +1229,8 @@ export function applyEntitiesDoneOptimistic(args: {
let soupTxn: ReturnType<typeof removeSoupEntities> | null = null;
let emailRowTxns: { rollback: () => void }[] = [];
+ let reminderRowTxns: { rollback: () => void }[] = [];
+ const completedStamp = new Date().toISOString();
const reapply = () => {
// Remove the marked entities from done-filtered soup queries (inbox,
@@ -1167,11 +1248,25 @@ export function applyEntitiesDoneOptimistic(args: {
frecency_score: getSoupEntityById(id)?.frecency_score ?? 0,
})
);
+ // Stamping `completedAt` is what drops a reminder out of the Upcoming
+ // tab, which requires `!entity.completedAt` — so this takes effect before
+ // any refetch, whether or not the reminder had already fired.
+ reminderRowTxns = reminderIds.map((id) =>
+ optimisticUpdateSoupEntity({
+ tag: 'reminder',
+ data: { id, completedAt: completedStamp },
+ frecency_score: getSoupEntityById(id)?.frecency_score ?? 0,
+ })
+ );
filterEmailCache();
setDoneOverride(notificationIds, true);
};
const rollbackSoup = () => {
+ for (const txn of [...reminderRowTxns].reverse()) {
+ txn.rollback();
+ }
+ reminderRowTxns = [];
for (const txn of [...emailRowTxns].reverse()) {
txn.rollback();
}
@@ -1209,8 +1304,18 @@ export function applyEntitiesDoneOptimistic(args: {
export function applyEntitiesNotDoneOptimistic(args: {
emailIds: string[];
notificationIds: string[];
+ reminderIds?: string[];
}): { rollback: () => void } {
- const { emailIds, notificationIds } = args;
+ const { emailIds, notificationIds, reminderIds = [] } = args;
+ // Clearing `completedAt` is what returns a reminder to the Upcoming tab,
+ // whose predicate is `!entity.completedAt`.
+ const reminderRowTxns = reminderIds.map((id) =>
+ optimisticUpdateSoupEntity({
+ tag: 'reminder',
+ data: { id, completedAt: null },
+ frecency_score: getSoupEntityById(id)?.frecency_score ?? 0,
+ })
+ );
const emailRowTxns = emailIds.map((id) =>
optimisticUpdateSoupEntity({
@@ -1223,6 +1328,9 @@ export function applyEntitiesNotDoneOptimistic(args: {
return {
rollback: () => {
+ for (const txn of [...reminderRowTxns].reverse()) {
+ txn.rollback();
+ }
for (const txn of [...emailRowTxns].reverse()) {
txn.rollback();
}
@@ -1236,11 +1344,23 @@ export function applyEntitiesNotDoneOptimistic(args: {
* failure; caller is responsible for rollback via the context returned by
* `applyEntitiesDoneOptimistic`.
*/
+/**
+ * Flip the reminders' own `completed` column. One PATCH each — the reminders
+ * API has no bulk endpoint, and a mark-done selection is normally one row.
+ */
+function setRemindersCompleted(
+ reminderIds: string[],
+ completed: boolean
+): Promise<unknown>[] {
+ return reminderIds.map((id) => setReminderCompleted(id, completed));
+}
+
export async function executeMarkEntitiesDone(args: {
emailIds: string[];
notificationIds: string[];
+ reminderIds?: string[];
}): Promise<void> {
- const { emailIds, notificationIds } = args;
+ const { emailIds, notificationIds, reminderIds = [] } = args;
await Promise.all([
queryClient.cancelQueries({ queryKey: queryKeys.all.email }),
queryClient.cancelQueries({ queryKey: notificationKeys.user._def }),
@@ -1255,6 +1375,7 @@ export async function executeMarkEntitiesDone(args: {
notificationIds.length > 0
? bulkMarkNotificationsAsDone(notificationIds)
: Promise.resolve(),
+ ...setRemindersCompleted(reminderIds, true),
]);
const rejected = results.find(
@@ -1263,15 +1384,20 @@ export async function executeMarkEntitiesDone(args: {
if (rejected) {
// Real refetch to reconcile server state with the UI after the caller
- // rolls back its optimistic cache writes.
+ // rolls back its optimistic cache writes. `allSettled` means some
+ // reminders may have been written even though the caller rolls all of
+ // them back, so they have to be reconciled too, not just the emails.
+ invalidateRemindersById(reminderIds, { refetch: true });
await Promise.all([
queryClient.invalidateQueries({ queryKey: queryKeys.all.email }),
queryClient.invalidateQueries({ queryKey: notificationKeys.user._def }),
...emailIds.map((id) => invalidateSoupEntity(id)),
+ ...reminderIds.map((id) => invalidateSoupEntity(id)),
]);
throw rejected.reason ?? new Error('Failed to mark as done');
}
+ invalidateRemindersById(reminderIds);
await Promise.all([
queryClient.invalidateQueries({
queryKey: queryKeys.all.email,
@@ -1292,8 +1418,9 @@ export async function executeMarkEntitiesDone(args: {
export async function executeMarkEntitiesUndone(args: {
emailIds: string[];
notificationIds: string[];
+ reminderIds?: string[];
}): Promise<void> {
- const { emailIds, notificationIds } = args;
+ const { emailIds, notificationIds, reminderIds = [] } = args;
await Promise.all([
queryClient.cancelQueries({ queryKey: queryKeys.all.email }),
queryClient.cancelQueries({ queryKey: notificationKeys.user._def }),
@@ -1308,6 +1435,7 @@ export async function executeMarkEntitiesUndone(args: {
notificationIds.length > 0
? bulkMarkNotificationsAsUndone(notificationIds)
: Promise.resolve(),
+ ...setRemindersCompleted(reminderIds, false),
]);
const rejected = results.find(
@@ -1315,13 +1443,22 @@ export async function executeMarkEntitiesUndone(args: {
);
if (rejected) {
+ // `allSettled`, so some of these may have succeeded even though the caller
+ // rolls every optimistic transaction back. Reconcile both kinds against the
+ // server or their Soup rows keep the state the rollback restored — an
+ // unarchived thread would sit there still showing as done.
+ invalidateRemindersById(reminderIds, { refetch: true });
await Promise.all([
queryClient.invalidateQueries({ queryKey: queryKeys.all.email }),
queryClient.invalidateQueries({ queryKey: notificationKeys.user._def }),
+ ...emailIds.map((id) => invalidateSoupEntity(id)),
+ ...reminderIds.map((id) => invalidateSoupEntity(id)),
]);
throw rejected.reason ?? new Error('Failed to undo');
}
+ invalidateRemindersById(reminderIds);
+
await Promise.all([
queryClient.invalidateQueries({
queryKey: queryKeys.all.email,
diff --git a/apps/web/src/features/notifications/notification-navigation.ts b/apps/web/src/features/notifications/notification-navigation.ts
index 60c56b6009..073d759c7b 100644
--- a/apps/web/src/features/notifications/notification-navigation.ts
+++ b/apps/web/src/features/notifications/notification-navigation.ts
@@ -14,10 +14,14 @@ import {
itemToBlockName,
resolveBlockAlias,
} from '@core/constant/allBlocks';
-import { USE_MACRO_PR_SUMMARY_BLOCK } from '@core/constant/featureFlags';
+import {
+ ENABLE_REMINDERS,
+ USE_MACRO_PR_SUMMARY_BLOCK,
+} from '@core/constant/featureFlags';
import type { EntityType, NotificationType } from '@core/types';
import { openExternalUrl } from '@core/util/url';
import { getNotificationById } from '@queries/notification/user-notifications';
+import { getReminderById } from '@queries/reminders/reminders';
import { errAsync, ResultAsync } from 'neverthrow';
import { match, P } from 'ts-pattern';
import { GITHUB_EVENT_TYPES } from './github-event-types';
@@ -361,20 +365,26 @@ function getSupportedHandler(
});
})
.with('reminder', () => {
- // A reminder carries no entity details of its own — it points at
- // whatever it was set on, and that lives on the notification. A
- // standalone reminder is addressed at the user and has nothing to open.
- const entityType = notification.entity_type as EntityType;
- if (entityType === 'user') return null;
-
+ // The notification points at the reminder itself, so there is nothing to
+ // open until the reminder is fetched and its referenced entity read. A
+ // standalone reminder references nothing and opens nothing.
return async (lm: SplitManager, newSplit: boolean = false) => {
+ // A reminder created before the flag closed still has a live
+ // notification; opening it would reach reminder surfaces the user is
+ // no longer meant to have.
+ if (!ENABLE_REMINDERS()) return;
+ const reminder = await getReminderById(notification.entity_id);
+ const entityType = reminder?.entityType;
+ const entityId = reminder?.entityId;
+ if (!entityType || !entityId) return;
+
const blockName = await DefaultNotificationBlockNameResolver(
- notification.entity_id,
- entityType
+ entityId,
+ entityType as EntityType
);
if (!blockName) return;
- openSplitIfNotOpen(lm, blockName, notification.entity_id, {
+ openSplitIfNotOpen(lm, blockName, entityId, {
newSplit,
sourceHandle,
});
diff --git a/apps/web/src/features/property/utils/entityConversion.ts b/apps/web/src/features/property/utils/entityConversion.ts
index ae2554c0d2..07a04bbf5c 100644
--- a/apps/web/src/features/property/utils/entityConversion.ts
+++ b/apps/web/src/features/property/utils/entityConversion.ts
@@ -88,5 +88,8 @@ export function macroEntityToPropertyEntityType(
.with({ type: 'foreign' }, () => {
throw new Error('foreign entities do not support properties');
})
+ .with({ type: 'reminder' }, () => {
+ throw new Error('reminders do not support properties');
+ })
.exhaustive();
}
diff --git a/apps/web/src/features/reminders/CreateReminderModal.tsx b/apps/web/src/features/reminders/CreateReminderModal.tsx
index fbfa5a3162..db04db6abc 100644
--- a/apps/web/src/features/reminders/CreateReminderModal.tsx
+++ b/apps/web/src/features/reminders/CreateReminderModal.tsx
@@ -5,7 +5,7 @@ import { useListKeyBindings } from '@core/util/useListKeyBindings';
import { type EntityData, InlineEntity } from '@entity';
import BellIcon from '@phosphor/bell-simple.svg';
import {
- reminderEntityType,
+ reminderTarget,
useCreateReminderMutation,
} from '@queries/reminders/reminders';
import { mergeRefs } from '@solid-primitives/refs';
@@ -86,7 +86,7 @@ export function CreateReminderModal() {
}
const description = reminderDescriptionFor(target);
- const entityType = reminderEntityType(target.type);
+ const attachTo = reminderTarget(target);
closeReminderComposer();
try {
@@ -94,7 +94,7 @@ export function CreateReminderModal() {
description,
schedule: onceSchedule(date),
// Both or neither: the API rejects one without the other.
- ...(entityType ? { entityId: target.id, entityType } : undefined),
+ ...(attachTo ?? undefined),
});
toast.success(`Reminder set for ${formatWhen(date)}`);
} catch {
diff --git a/apps/web/src/features/reminders/reminder-schedule.test.ts b/apps/web/src/features/reminders/reminder-schedule.test.ts
index aae20e365c..1e902db870 100644
--- a/apps/web/src/features/reminders/reminder-schedule.test.ts
+++ b/apps/web/src/features/reminders/reminder-schedule.test.ts
@@ -161,6 +161,35 @@ describe('reminderDescriptionFor', () => {
);
});
+ // A thread's name is the placeholder "Channel thread", and its reminder
+ // attaches to the parent channel — so the message text is the only thing
+ // telling two reminders on the same channel apart.
+ it('describes a channel thread by its message text', () => {
+ const thread = {
+ type: 'channel_thread',
+ id: 'msg-1',
+ channelId: 'chan-1',
+ name: 'Channel thread',
+ content: 'can we ship the migration today?',
+ } as EntityData;
+
+ expect(reminderDescriptionFor(thread)).toBe(
+ 'can we ship the migration today?'
+ );
+ });
+
+ it('falls back to the thread placeholder when it has no text', () => {
+ const thread = {
+ type: 'channel_thread',
+ id: 'msg-1',
+ channelId: 'chan-1',
+ name: 'Channel thread',
+ content: ' ',
+ } as EntityData;
+
+ expect(reminderDescriptionFor(thread)).toBe('Channel thread');
+ });
+
// The API rejects an empty description, and plenty of entities have no name:
// a subject-less thread, a freshly created doc.
it('names an unnamed entity the way lists label it', () => {
diff --git a/apps/web/src/features/reminders/reminder-schedule.ts b/apps/web/src/features/reminders/reminder-schedule.ts
index 6691dc954a..f9343ff382 100644
--- a/apps/web/src/features/reminders/reminder-schedule.ts
+++ b/apps/web/src/features/reminders/reminder-schedule.ts
@@ -137,7 +137,13 @@ function untitledName(type: EntityData['type']): string {
* Counts characters, not bytes, because the service's limit does.
*/
export function reminderDescriptionFor(entity: EntityData): string {
- const name = entity.name?.trim();
+ // A thread row's `name` is the literal placeholder "Channel thread", so the
+ // message text is the only thing that says which thread. It matters more
+ // here than elsewhere: the reminder attaches to the parent channel, so the
+ // description is all that distinguishes two reminders on the same channel.
+ const label =
+ entity.type === 'channel_thread' ? entity.content?.trim() : undefined;
+ const name = label || entity.name?.trim();
const characters = [...(name || untitledName(entity.type))];
return characters.length > REMINDER_DESCRIPTION_MAX_LENGTH
? characters.slice(0, REMINDER_DESCRIPTION_MAX_LENGTH).join('')
diff --git a/apps/web/src/lib/constants/list-views.ts b/apps/web/src/lib/constants/list-views.ts
index fff4326f42..79b533ded4 100644
--- a/apps/web/src/lib/constants/list-views.ts
+++ b/apps/web/src/lib/constants/list-views.ts
@@ -16,6 +16,7 @@ export const LIST_VIEWS = [
'calls',
'companies',
'folders',
+ 'reminders',
'search',
] as const;
@@ -31,6 +32,7 @@ export const LIST_VIEW_PATHS = {
calls: '/calls',
companies: '/companies',
folders: '/folders',
+ reminders: '/reminders',
search: '/search',
} as const satisfies Record<ListView, string>;
@@ -44,6 +46,7 @@ export const LIST_VIEW_ID = {
calls: 'calls',
companies: 'companies',
folders: 'folders',
+ reminders: 'reminders',
search: 'search',
} as const satisfies Record<ListView, string>;
@@ -87,6 +90,7 @@ export const soupItemMatchesListView = (
.with('folders', () => item.tag === 'project')
.with('inbox', 'search', undefined, () => true)
.with('companies', () => item.tag === 'crmCompany')
+ .with('reminders', () => item.tag === 'reminder')
.exhaustive();
const propertiesMatchTagFilter = (
diff --git a/apps/web/src/lib/core/component/AI/component/tool/Notifications.tsx b/apps/web/src/lib/core/component/AI/component/tool/Notifications.tsx
index f935b5aa21..90b118d86b 100644
--- a/apps/web/src/lib/core/component/AI/component/tool/Notifications.tsx
+++ b/apps/web/src/lib/core/component/AI/component/tool/Notifications.tsx
@@ -19,6 +19,7 @@ const NOTIFICATION_TYPE_LABELS: Record<NotificationFilterType, string> = {
call: 'calls',
task: 'tasks',
github: 'GitHub',
+ reminder: 'reminders',
};
const formatList = (items: string[]) => {
diff --git a/apps/web/src/lib/core/component/EntityIcon.tsx b/apps/web/src/lib/core/component/EntityIcon.tsx
index 2a460dcbd6..d0d31fee03 100644
--- a/apps/web/src/lib/core/component/EntityIcon.tsx
+++ b/apps/web/src/lib/core/component/EntityIcon.tsx
@@ -11,6 +11,8 @@ import type {
DocumentEntity,
EmailEntity,
EntityData,
+ NamedSubType,
+ ReminderEntity,
} from '@entity';
import GithubIcon from '@icon/mcp-github.svg';
import WideAutomation from '@icon/wide-automation.svg';
@@ -36,6 +38,7 @@ import WideStar from '@icon/wide-star.svg';
import WideTask from '@icon/wide-task.svg';
import WideUnknown from '@icon/wide-unknown.svg';
import WideVideo from '@icon/wide-video.svg';
+import BellSimple from '@phosphor/bell-simple.svg';
import Building from '@phosphor/building.svg';
import Chat from '@phosphor/chat.svg';
import Check from '@phosphor/check-fat.svg';
@@ -85,7 +88,8 @@ export type EntityWithValidIcon =
| 'archive'
| 'files'
| 'crm_company'
- | 'html';
+ | 'html'
+ | 'reminder';
const ARCHIVE_EXTENSIONS = new Set(
Object.values(FileTypeMap)
@@ -298,6 +302,12 @@ export const ENTITY_ICON_CONFIGS: Record<EntityWithValidIcon, IconConfig> = {
background: 'bg-default/20',
prettyName: 'Company',
},
+ reminder: {
+ icon: BellSimple,
+ foreground: 'text-default',
+ background: 'bg-default/20',
+ prettyName: 'Reminder',
+ },
};
// this will match fall-through cases like code files which match multiple extensions
@@ -363,6 +373,9 @@ const WIDE_ICONS: Record<
automation: WideAutomation,
crm_company: AnimatedCompanyIcon,
company: AnimatedCompanyIcon,
+ // No wide bell asset exists; the phosphor one carries over, as it does for
+ // `organization` and the github icons.
+ reminder: BellSimple,
};
const ICON_SIZES = {
@@ -494,6 +507,8 @@ type EntityIconData = Pick<EntityData, 'type'> & {
fileType?: DocumentEntity['fileType'] | null;
subType?: DocumentEntity['subType'];
isRead?: EmailEntity['isRead'];
+ /** Reminders icon as the entity they reference. */
+ referencedEntity?: ReminderEntity['referencedEntity'];
};
export function getEntityIconType(entity: EntityIconData): EntityWithValidIcon {
@@ -503,6 +518,26 @@ export function getEntityIconType(entity: EntityIconData): EntityWithValidIcon {
.with({ type: 'document' }, (e) => itemToBlockName(e, true) ?? 'default')
.with({ type: 'email', isRead: true }, () => 'emailRead')
.with({ type: 'email' }, () => 'email')
+ // A reminder shows the icon of what it is about. The referenced entity's
+ // fileType/subType are resolved server-side precisely so this stays
+ // synchronous — every icon call site is.
+ //
+ // A standalone reminder is about nothing else, so it falls back to a bell
+ // rather than to `default`, whose wide variant is the unknown-file glyph.
+ .with({ type: 'reminder' }, (e) =>
+ e.referencedEntity
+ ? (itemToBlockName(
+ {
+ type: e.referencedEntity.type,
+ fileType: e.referencedEntity.fileType,
+ subType: e.referencedEntity.subType
+ ? { type: e.referencedEntity.subType as NamedSubType }
+ : undefined,
+ },
+ true
+ ) ?? 'reminder')
+ : 'reminder'
+ )
.otherwise((e) => e.type);
return validateEntity(typeString);
diff --git a/apps/web/src/lib/core/constant/allBlocks.ts b/apps/web/src/lib/core/constant/allBlocks.ts
index 95b339a0a0..1848e5dbf4 100644
--- a/apps/web/src/lib/core/constant/allBlocks.ts
+++ b/apps/web/src/lib/core/constant/allBlocks.ts
@@ -235,10 +235,13 @@ export function blockNameToDefaultFile(block?: BlockName | string | null) {
}
export type ItemLike = {
- type: ItemType | 'call' | 'crm_company';
+ type: ItemType | 'call' | 'crm_company' | 'reminder';
fileType?: BasicDocumentFileType;
subType?: SubType | BasicDocumentSubTypeProperty;
name?: string;
+ /** Present on reminders: the entity the reminder is about. A reminder has no
+ * block of its own, so it borrows this entity's icon. */
+ referencedEntity?: { type: string; fileType?: string; subType?: string };
};
/**
@@ -265,6 +268,17 @@ export function itemToBlockName(
return fileTypeToBlockName(item.fileType, icon);
}
if (item.type === 'channel_thread') return 'channel';
+ // A reminder has no block of its own; it points at one. A standalone
+ // reminder falls through to 'unknown'. Same precedence as the referenced
+ // entity would get on its own row, so a task or a .docx resolves to its
+ // specific block rather than the generic 'document'.
+ if (item.type === 'reminder') {
+ const referenced = item.referencedEntity;
+ if (referenced?.subType && isBlockAlias(referenced.subType)) {
+ return referenced.subType;
+ }
+ return fileTypeToBlockName(referenced?.fileType ?? referenced?.type, icon);
+ }
return fileTypeToBlockName(item.type, icon);
}
diff --git a/apps/web/src/lib/core/constant/featureFlags.ts b/apps/web/src/lib/core/constant/featureFlags.ts
index 3acac8aa8d..14f0af4661 100644
--- a/apps/web/src/lib/core/constant/featureFlags.ts
+++ b/apps/web/src/lib/core/constant/featureFlags.ts
@@ -170,7 +170,7 @@ export function ENABLE_CRM(): boolean {
return analytics.posthog.isFeatureEnabled(ENABLE_CRM_FLAG) ?? false;
}
-// Reminders: the "Remind me about this" entry in the command menu, the soup
+// Reminders: the "Remind me" entry in the command menu, the soup
// context menu and the block ⋯ menu, its 'h' shortcut, and the composer modal.
// Every surface routes through `makeCreateReminderAction().canExecute`, so this
// is the single gate for all of them. PostHog-gated with a dev-mode default.
diff --git a/apps/web/src/lib/core/hotkey/tokens.ts b/apps/web/src/lib/core/hotkey/tokens.ts
index f6cc726308..9192bad5ee 100644
--- a/apps/web/src/lib/core/hotkey/tokens.ts
+++ b/apps/web/src/lib/core/hotkey/tokens.ts
@@ -111,6 +111,7 @@ export const TOKENS = {
calls: 'sidebar.goTo.calls',
companies: 'sidebar.goTo.companies',
folders: 'sidebar.goTo.folders',
+ reminders: 'sidebar.goTo.reminders',
},
},
diff --git a/apps/web/src/lib/queries/notification/user-notifications.ts b/apps/web/src/lib/queries/notification/user-notifications.ts
index a36aed9f10..274bf1e641 100644
--- a/apps/web/src/lib/queries/notification/user-notifications.ts
+++ b/apps/web/src/lib/queries/notification/user-notifications.ts
@@ -862,6 +862,7 @@ function notificationEntityTypeToSoupTag(
.with('project', () => 'project' as const)
.with('email_thread', () => 'emailThread' as const)
.with('foreign_entity', () => 'foreignEntity' as const)
+ .with('reminder', () => 'reminder' as const)
.with(
P.union(
'user',
@@ -871,10 +872,7 @@ function notificationEntityTypeToSoupTag(
'static_file',
'crm_company',
'crm_contact',
- 'calendar_event',
- // A reminder notification is keyed by the reminder itself, which has
- // no soup entity to map to here.
- 'reminder'
+ 'calendar_event'
),
() => null
)
diff --git a/apps/web/src/lib/queries/reminders/keys.ts b/apps/web/src/lib/queries/reminders/keys.ts
index d6df233e87..deeab55493 100644
--- a/apps/web/src/lib/queries/reminders/keys.ts
+++ b/apps/web/src/lib/queries/reminders/keys.ts
@@ -1,5 +1,12 @@
import { createQueryKeys } from '@lukemorales/query-key-factory';
+import type { ListRemindersParams } from '@service-storage/generated/schemas/listRemindersParams';
export const reminderKeys = createQueryKeys('reminders', {
- list: null,
+ /**
+ * One page of reminders for a given filter. Use `reminderKeys.list._def` to
+ * invalidate every list regardless of filter.
+ */
+ list: (params: ListRemindersParams = {}) => [params],
+ /** A single reminder by id. */
+ detail: (id: string) => [id],
});
diff --git a/apps/web/src/lib/queries/reminders/reminders.test.ts b/apps/web/src/lib/queries/reminders/reminders.test.ts
new file mode 100644
index 0000000000..4d319b3b9f
--- /dev/null
+++ b/apps/web/src/lib/queries/reminders/reminders.test.ts
@@ -0,0 +1,57 @@
+import type { EntityData } from '@entity';
+import { describe, expect, it } from 'vitest';
+import { reminderEntityType, reminderTarget } from './reminders';
+
+const entity = (type: EntityData['type'], id = 'e1') =>
+ ({ type, id, name: 'Thing' }) as EntityData;
+
+const threadEntity = (channelId = 'chan-1', id = 'msg-1') =>
+ ({
+ type: 'channel_thread',
+ id,
+ channelId,
+ name: 'Channel thread',
+ }) as EntityData;
+
+describe('reminderEntityType', () => {
+ it('maps frontend types onto their backend names', () => {
+ expect(reminderEntityType('document')).toBe('document');
+ expect(reminderEntityType('email')).toBe('email_thread');
+ expect(reminderEntityType('channel')).toBe('channel');
+ });
+
+ it('has no mapping for types a reminder cannot attach to', () => {
+ expect(reminderEntityType('channel_message')).toBeUndefined();
+ expect(reminderEntityType('channel_thread')).toBeUndefined();
+ expect(reminderEntityType('automation')).toBeUndefined();
+ });
+});
+
+describe('reminderTarget', () => {
+ it('pairs a supported type with the entity id', () => {
+ expect(reminderTarget(entity('document', 'doc-1'))).toEqual({
+ entityType: 'document',
+ entityId: 'doc-1',
+ });
+ });
+
+ // The whole reason type and id resolve together: a thread attaches to its
+ // parent channel, so the id is the channel's, not the row's own message id.
+ it('attaches a thread row to its parent channel', () => {
+ expect(reminderTarget(threadEntity('chan-9', 'msg-7'))).toEqual({
+ entityType: 'channel',
+ entityId: 'chan-9',
+ });
+ });
+
+ it('does not send the thread row id under the channel type', () => {
+ expect(reminderTarget(threadEntity('chan-9', 'msg-7'))?.entityId).not.toBe(
+ 'msg-7'
+ );
+ });
+
+ it('is undefined for types with no reminder target', () => {
+ expect(reminderTarget(entity('channel_message'))).toBeUndefined();
+ expect(reminderTarget(entity('automation'))).toBeUndefined();
+ });
+});
diff --git a/apps/web/src/lib/queries/reminders/reminders.ts b/apps/web/src/lib/queries/reminders/reminders.ts
index 5540fa3d03..fa24025f53 100644
--- a/apps/web/src/lib/queries/reminders/reminders.ts
+++ b/apps/web/src/lib/queries/reminders/reminders.ts
@@ -2,8 +2,11 @@ import { throwOnErr } from '@core/util/result';
import type { EntityData } from '@entity';
import { storageServiceClient } from '@service-storage/client';
import type { CreateReminderRequest } from '@service-storage/generated/schemas/createReminderRequest';
+import type { ListRemindersParams } from '@service-storage/generated/schemas/listRemindersParams';
import type { Reminder } from '@service-storage/generated/schemas/reminder';
-import { useMutation } from '@tanstack/solid-query';
+import type { RemindersList } from '@service-storage/generated/schemas/remindersList';
+import type { UpdateReminderRequest } from '@service-storage/generated/schemas/updateReminderRequest';
+import { useMutation, useQuery } from '@tanstack/solid-query';
import { queryClient } from '../client';
import { type MutationCallbacks, withCallbacks } from '../utils';
@@ -42,14 +45,43 @@ export function reminderEntityType(
return 'crm_company';
case 'crm_contact':
return 'crm_contact';
- // Channel messages and threads are excluded for the same reason favorites
- // excludes them: their frontend id is a composite `channelId:messageId`
- // that the entity-access layer has no access level for.
+ // Channel messages and threads have no reminder type of their own —
+ // `entity_access` resolves no access level for `channel_message`, so the
+ // receipt the reminders API requires cannot be minted. Thread rows attach
+ // to their parent channel instead; see `reminderTarget`.
default:
return undefined;
}
}
+/** What a reminder attaches to: a backend entity type paired with its id. */
+export type ReminderTarget = {
+ entityType: NonNullable<ReminderEntityType>;
+ entityId: string;
+};
+
+/**
+ * Resolve what a reminder created from `entity` should point at.
+ *
+ * Returns the type and the id together because they do not always come from
+ * the same place: a thread row attaches to its parent channel, so its
+ * `channelId` is the id — pairing `reminderEntityType()` with `entity.id`
+ * would store the message id under the `channel` type.
+ *
+ * A thread reminder pointing at the channel is a deliberate limitation, not an
+ * oversight: attaching to the message itself needs `entity_access` to resolve
+ * a `ChannelMessage` through its owning channel, which it does not do yet.
+ * Opening such a reminder lands on the channel rather than the thread; the
+ * description still quotes the message, so the row says which one.
+ */
+export function reminderTarget(entity: EntityData): ReminderTarget | undefined {
+ if (entity.type === 'channel_thread') {
+ return { entityType: 'channel', entityId: entity.channelId };
+ }
+ const entityType = reminderEntityType(entity.type);
+ return entityType ? { entityType, entityId: entity.id } : undefined;
+}
+
type CreateReminderArgs = CreateReminderRequest;
type CreateReminderCallbacks = MutationCallbacks<
Reminder,
@@ -57,12 +89,62 @@ type CreateReminderCallbacks = MutationCallbacks<
CreateReminderArgs
>;
+/**
+ * Set a reminder's completed flag.
+ *
+ * Bulk done/not-done runs over a mixed selection (emails, notifications,
+ * reminders) with one shared optimistic layer, so it drives the writes itself
+ * rather than through a mutation per row. The service call still belongs
+ * here; `next-soup/utils` keeps only the orchestration.
+ */
+export async function setReminderCompleted(id: string, completed: boolean) {
+ return await throwOnErr(() =>
+ storageServiceClient.reminders.updateReminder(id, { completed })
+ );
+}
+
+/**
+ * Invalidate the lists plus each of the given reminder details.
+ *
+ * `refetch` should be true only when the server state is unknown — after a
+ * failed or partly-failed write. On success the optimistic layer already
+ * holds the right values, and an immediate refetch would detach the list's
+ * Suspense boundary and reset its scroll.
+ */
+export function invalidateRemindersById(
+ ids: string[],
+ { refetch = false }: { refetch?: boolean } = {}
+) {
+ if (ids.length === 0) return;
+ const refetchType = refetch ? undefined : ('none' as const);
+ void queryClient.invalidateQueries({
+ queryKey: reminderKeys.list._def,
+ refetchType,
+ });
+ for (const id of ids) {
+ void queryClient.invalidateQueries({
+ queryKey: reminderKeys.detail(id).queryKey,
+ refetchType,
+ });
+ }
+}
+
+/** Invalidate every reminder list, plus one detail when the id is known. */
+function invalidateReminders(id?: string) {
+ void queryClient.invalidateQueries({ queryKey: reminderKeys.list._def });
+ if (id) {
+ void queryClient.invalidateQueries({
+ queryKey: reminderKeys.detail(id).queryKey,
+ });
+ }
+}
+
/**
* Create a reminder.
*
- * Not optimistic: nothing renders a reminder list yet, so there is no cache to
- * update ahead of the server. The list key is invalidated so whatever reads it
- * first sees the new row.
+ * Not optimistic: a reminder's `nextRunAt` is derived server-side from its
+ * schedule, so an optimistic row would sort into the wrong place until the
+ * response lands. Lists are invalidated instead.
*/
export function useCreateReminderMutation(callbacks?: CreateReminderCallbacks) {
return useMutation(() => ({
@@ -71,13 +153,96 @@ export function useCreateReminderMutation(callbacks?: CreateReminderCallbacks) {
storageServiceClient.reminders.createReminder(args)
),
...withCallbacks<Reminder, Error, CreateReminderArgs>(
- {
- onSettled: () =>
- queryClient.invalidateQueries({
- queryKey: reminderKeys.list.queryKey,
- }),
- },
+ { onSettled: () => invalidateReminders() },
callbacks
),
}));
}
+
+/** One page of the caller's reminders, soonest firing first. */
+export function useRemindersQuery(
+ params: () => ListRemindersParams = () => ({})
+) {
+ return useQuery(() => ({
+ queryKey: reminderKeys.list(params()).queryKey,
+ queryFn: async () =>
+ await throwOnErr(() =>
+ storageServiceClient.reminders.listReminders(params())
+ ),
+ }));
+}
+
+/**
+ * Fetch one reminder outside a component, going through the query cache so a
+ * reminder already on screen is not re-fetched.
+ *
+ * Used by notification navigation, which has to read a reminder's referenced
+ * entity before it knows what to open.
+ */
+export async function getReminderById(
+ id: string
+): Promise<Reminder | undefined> {
+ try {
+ return await queryClient.fetchQuery({
+ queryKey: reminderKeys.detail(id).queryKey,
+ queryFn: async () =>
+ await throwOnErr(() => storageServiceClient.reminders.getReminder(id)),
+ });
+ } catch {
+ return undefined;
+ }
+}
+
+/** A single reminder by id. */
+export function useReminderQuery(id: () => string | undefined) {
+ return useQuery(() => ({
+ queryKey: reminderKeys.detail(id() ?? '').queryKey,
+ queryFn: async () =>
+ await throwOnErr(() =>
+ storageServiceClient.reminders.getReminder(id() as string)
+ ),
+ enabled: !!id(),
+ }));
+}
+
+type UpdateReminderArgs = { id: string; patch: UpdateReminderRequest };
+type UpdateReminderCallbacks = MutationCallbacks<
+ Reminder,
+ Error,
+ UpdateReminderArgs
+>;
+
+/** Modify a reminder's description, schedule, or enabled flag. */
+export function useUpdateReminderMutation(callbacks?: UpdateReminderCallbacks) {
+ return useMutation(() => ({
+ mutationFn: async ({ id, patch }: UpdateReminderArgs) =>
+ await throwOnErr(() =>
+ storageServiceClient.reminders.updateReminder(id, patch)
+ ),
+ ...withCallbacks<Reminder, Error, UpdateReminderArgs>(
+ { onSettled: (_data, _error, args) => invalidateReminders(args?.id) },
+ callbacks
+ ),
+ }));
+}
+
+type DeleteReminderCallbacks = MutationCallbacks<void, Error, string>;
+
+/**
+ * Delete a reminder.
+ *
+ * The delete is a hard delete server-side, so any notification it already
+ * produced outlives it — see the retraction note on the reminders service.
+ */
+export function useDeleteReminderMutation(callbacks?: DeleteReminderCallbacks) {
+ return useMutation(() => ({
+ mutationFn: async (id: string) =>
+ await throwOnErr(() => storageServiceClient.reminders.deleteReminder(id)),
+ ...withCallbacks<void, Error, string>(
+ { onSettled: (_data, _error, id) => invalidateReminders(id) },
+ callbacks
+ ),
+ }));
+}
+
+export type { RemindersList };
diff --git a/apps/web/src/lib/queries/soup/normalized-cache/operations.ts b/apps/web/src/lib/queries/soup/normalized-cache/operations.ts
index 044eaba226..a632fe7334 100644
--- a/apps/web/src/lib/queries/soup/normalized-cache/operations.ts
+++ b/apps/web/src/lib/queries/soup/normalized-cache/operations.ts
@@ -361,7 +361,12 @@ function soupQueryExcludesDone(key: QueryKey): boolean {
return (
serialized.includes('"emailView":"inbox"') ||
serialized.includes('"NotificationDone":false') ||
- serialized.includes('"nd":false')
+ serialized.includes('"nd":false') ||
+ // Reminders carry their done state on themselves rather than on a
+ // notification, so `reminderCompleted` — compiled to `remf.comp` — is the
+ // shape the Reminders "Upcoming" view filters on. Without it, marking a
+ // reminder done left the row sitting there until the next refetch.
+ serialized.includes('"comp":false')
);
}
@@ -584,6 +589,10 @@ export function buildSingleEntityFilter(
...base,
calendar_event_filters: { calendar_event_ids: [entityId] },
}))
+ .with('reminder', () => ({
+ ...base,
+ reminder_filters: { ids: [entityId] },
+ }))
.exhaustive();
}
diff --git a/apps/web/src/lib/queries/soup/recently-viewed.ts b/apps/web/src/lib/queries/soup/recently-viewed.ts
index 610b32e617..865ef1803b 100644
--- a/apps/web/src/lib/queries/soup/recently-viewed.ts
+++ b/apps/web/src/lib/queries/soup/recently-viewed.ts
@@ -58,11 +58,13 @@ export function useRecentlyViewedSoupQuery() {
})
);
return page.items.flatMap((item): RecentlyViewedItem[] => {
+ // Reminders have no `viewedAt` — they are never "viewed", only fired.
if (
item.tag === 'call' ||
item.tag === 'foreignEntity' ||
item.tag === 'channelThread' ||
- item.tag === 'calendarEvent'
+ item.tag === 'calendarEvent' ||
+ item.tag === 'reminder'
) {
return [];
}
diff --git a/apps/web/src/lib/queries/soup/transform-utils.ts b/apps/web/src/lib/queries/soup/transform-utils.ts
index 07df7e111d..bd7272f957 100644
--- a/apps/web/src/lib/queries/soup/transform-utils.ts
+++ b/apps/web/src/lib/queries/soup/transform-utils.ts
@@ -25,6 +25,7 @@ import type {
NamedSubType,
Notification,
ProjectEntity,
+ ReminderEntity,
SearchData,
WithSearch,
} from '@entity';
@@ -41,12 +42,13 @@ import type {
GithubPullRequest,
SoupApiItem,
SoupPage,
+ SoupReminderReference,
} from '@service-storage/generated/schemas';
import type { ChannelType } from '@service-storage/generated/schemas/channelType';
import { formatDocumentName } from '@service-storage/util/filename';
import type { UseQueryResult } from '@tanstack/solid-query';
import { differenceInMilliseconds } from 'date-fns';
-import { match } from 'ts-pattern';
+import { match, P } from 'ts-pattern';
type InnerSearchResult =
| DocumentSearchResult
@@ -72,6 +74,7 @@ type SoupEntity =
| ChannelThreadEntity
| CallEntity
| CrmCompanyEntity
+ | ReminderEntity
| ForeignEntity;
type SoupItemWithOptionalNotifications = DisplayableSoupItem & {
@@ -623,6 +626,51 @@ function withRawNotifications<T extends SoupEntity>(
return { ...entity, notifications } as T;
}
+type ReferencedEntityType = NonNullable<
+ ReminderEntity['referencedEntity']
+>['type'];
+
+/**
+ * Map a reminder's referenced entity from canonical API names onto the display
+ * {@link EntityType} names used across the frontend. The inverse of
+ * `toNotificationEntity`.
+ *
+ * Types with no display entity (`user`, `team`, `static_file`, and a reminder
+ * referencing another reminder) yield `undefined`, which renders the reminder
+ * as standalone rather than linking somewhere unresolvable.
+ */
+function toReferencedEntity(
+ reference: SoupReminderReference | null | undefined
+): ReminderEntity['referencedEntity'] {
+ if (!reference) return undefined;
+ const type = match<string, ReferencedEntityType | undefined>(
+ reference.entityType
+ )
+ .with('email_thread', () => 'email')
+ .with('foreign_entity', () => 'foreign')
+ .with(
+ P.union(
+ 'document',
+ 'chat',
+ 'project',
+ 'channel',
+ 'channel_message',
+ 'call',
+ 'crm_company',
+ 'crm_contact'
+ ),
+ (t) => t
+ )
+ .otherwise(() => undefined);
+ if (!type) return undefined;
+ return {
+ id: reference.id,
+ type,
+ fileType: reference.fileType ?? undefined,
+ subType: reference.subType ?? undefined,
+ };
+}
+
export const mapApiSoupItemToEntity = (
item: DisplayableSoupItem
): SoupEntity => {
@@ -878,6 +926,31 @@ export const mapApiSoupItemToEntity = (
properties: item.data.properties,
} satisfies CrmCompanyEntity;
})
+ .with({ tag: 'reminder' }, (item) => {
+ const schedule = item.data.schedule;
+ const recurring = schedule.type === 'recurring';
+ return {
+ type: 'reminder',
+ id: item.data.id,
+ // A reminder has no separate title — its description is its name.
+ name: item.data.description,
+ description: item.data.description,
+ // Reminders are private to their owner, so the row carries no owner id.
+ ownerId: '',
+ referencedEntity: toReferencedEntity(item.data.referencedEntity),
+ scheduleType: recurring ? 'recurring' : 'once',
+ cron: recurring ? schedule.cron : undefined,
+ timezone: recurring ? schedule.timezone : undefined,
+ nextRunAt: item.data.nextRunAt,
+ enabled: item.data.enabled,
+ completedAt: item.data.completedAt,
+ createdAt: item.data.createdAt,
+ updatedAt: item.data.updatedAt,
+ // Soup orders reminders by when they fire, not when they changed.
+ sortTs: item.data.nextRunAt,
+ frecencyScore: item.frecency_score,
+ } satisfies ReminderEntity;
+ })
.exhaustive();
return withRawNotifications(entity, item);
diff --git a/apps/web/src/lib/service-clients/service-cognition/generated/tools/schemas.ts b/apps/web/src/lib/service-clients/service-cognition/generated/tools/schemas.ts
index 2a0f9dc9cb..80a5e4409a 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
@@ -1697,6 +1697,7 @@ export const ListNotifications = z.object({
'call',
'task',
'github',
+ 'reminder',
]),
id: z.string(),
})
@@ -1717,6 +1718,7 @@ export const ListNotifications = z.object({
'call',
'task',
'github',
+ 'reminder',
])
),
z.null(),
diff --git a/apps/web/src/lib/service-clients/service-cognition/generated/tools/types.ts b/apps/web/src/lib/service-clients/service-cognition/generated/tools/types.ts
index f2e14b4d71..a53599cd62 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
@@ -399,7 +399,8 @@ export type NotificationItemType =
| 'chat'
| 'call'
| 'task'
- | 'github';
+ | 'github'
+ | 'reminder';
/**
* The kind of entity to move.
*/
diff --git a/apps/web/src/lib/service-clients/service-search/generated/models/entityFilters.ts b/apps/web/src/lib/service-clients/service-search/generated/models/entityFilters.ts
index 17e70b403b..fa7aec3da2 100644
--- a/apps/web/src/lib/service-clients/service-search/generated/models/entityFilters.ts
+++ b/apps/web/src/lib/service-clients/service-search/generated/models/entityFilters.ts
@@ -15,6 +15,7 @@ import type { EmailFilters } from './emailFilters';
import type { ForeignEntityFilters } from './foreignEntityFilters';
import type { ProjectFilters } from './projectFilters';
import type { PropertyFilter } from './propertyFilter';
+import type { ReminderFilters } from './reminderFilters';
import type { TagFilterMode } from './tagFilterMode';
/**
@@ -43,6 +44,8 @@ export interface EntityFilters {
project_filters?: ProjectFilters;
/** property-based filters applied across entity types */
property_filters?: PropertyFilter[];
+ /** the bundled [ReminderFilters] */
+ reminder_filters?: ReminderFilters;
/** How the `tag_option_ids` combine: `any` (default) matches entities
holding at least one selected tag, `all` requires every selected tag. */
tag_filter_mode?: TagFilterMode;
diff --git a/apps/web/src/lib/service-clients/service-search/generated/models/index.ts b/apps/web/src/lib/service-clients/service-search/generated/models/index.ts
index a9f09c6ea6..c3eb9459c7 100644
--- a/apps/web/src/lib/service-clients/service-search/generated/models/index.ts
+++ b/apps/web/src/lib/service-clients/service-search/generated/models/index.ts
@@ -205,6 +205,8 @@ export * from './propertyValueOneOfSevenType';
export * from './propertyValueOneOfThree';
export * from './propertyValueOneOfThreeType';
export * from './propertyValueOneOfType';
+export * from './reminderFilters';
+export * from './reminderFiltersCompleted';
export * from './searchHighlight';
export * from './searchHighlightName';
export * from './searchHighlightSender';
diff --git a/apps/web/src/lib/service-clients/service-search/generated/models/reminderFilters.ts b/apps/web/src/lib/service-clients/service-search/generated/models/reminderFilters.ts
new file mode 100644
index 0000000000..9838962958
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-search/generated/models/reminderFilters.ts
@@ -0,0 +1,23 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * search_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { ReminderFiltersCompleted } from './reminderFiltersCompleted';
+
+/**
+ * Filters for reminders.
+ */
+export interface ReminderFilters {
+ /** Filter on whether the reminder has already fired. `None` returns both. */
+ completed?: ReminderFiltersCompleted;
+ /** Restrict to reminders attached to these entities, each `"{type}:{id}"`. */
+ entities?: string[];
+ /** Reminder ids to filter by. Empty to include all of the caller's reminders. */
+ ids?: string[];
+ /** Opt this query into reminders at all. Reminders are off by default —
+see [`crate::ast::reminder::ReminderLiteral::Include`]. Asking for
+specific `ids` or `entities` also opts in. */
+ include?: boolean;
+}
diff --git a/apps/web/src/lib/service-clients/service-search/generated/models/reminderFiltersCompleted.ts b/apps/web/src/lib/service-clients/service-search/generated/models/reminderFiltersCompleted.ts
new file mode 100644
index 0000000000..0283bdbdb1
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-search/generated/models/reminderFiltersCompleted.ts
@@ -0,0 +1,11 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * search_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * Filter on whether the reminder has already fired. `None` returns both.
+ */
+export type ReminderFiltersCompleted = boolean | null;
diff --git a/apps/web/src/lib/service-clients/service-search/openapi.json b/apps/web/src/lib/service-clients/service-search/openapi.json
index e0f68ed39f..b669d6a13c 100644
--- a/apps/web/src/lib/service-clients/service-search/openapi.json
+++ b/apps/web/src/lib/service-clients/service-search/openapi.json
@@ -1833,6 +1833,10 @@
},
"description": "property-based filters applied across entity types"
},
+ "reminder_filters": {
+ "$ref": "#/components/schemas/ReminderFilters",
+ "description": "the bundled [ReminderFilters]"
+ },
"tag_filter_mode": {
"$ref": "#/components/schemas/TagFilterMode",
"description": "How the `tag_option_ids` combine: `any` (default) matches entities\nholding at least one selected tag, `all` requires every selected tag."
@@ -2844,6 +2848,34 @@
],
"description": "Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to/from JSONB in the database."
},
+ "ReminderFilters": {
+ "type": "object",
+ "description": "Filters for reminders.",
+ "properties": {
+ "completed": {
+ "type": ["boolean", "null"],
+ "description": "Filter on whether the reminder has already fired. `None` returns both."
+ },
+ "entities": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Restrict to reminders attached to these entities, each `\"{type}:{id}\"`."
+ },
+ "ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Reminder ids to filter by. Empty to include all of the caller's reminders."
+ },
+ "include": {
+ "type": "boolean",
+ "description": "Opt this query into reminders at all. Reminders are off by default —\nsee [`crate::ast::reminder::ReminderLiteral::Include`]. Asking for\nspecific `ids` or `entities` also opts in."
+ }
+ }
+ },
"SearchHighlight": {
"type": "object",
"properties": {
diff --git a/apps/web/src/lib/service-clients/service-storage/client.ts b/apps/web/src/lib/service-clients/service-storage/client.ts
index 1fc36771a4..c5f0874dd8 100644
--- a/apps/web/src/lib/service-clients/service-storage/client.ts
+++ b/apps/web/src/lib/service-clients/service-storage/client.ts
@@ -118,6 +118,7 @@ import type { GroupedSoupInitialPage } from './generated/schemas/groupedSoupInit
import type { GroupedSoupSort } from './generated/schemas/groupedSoupSort';
import type { Item } from './generated/schemas/item';
import type { ListOccurrencesParams } from './generated/schemas/listOccurrencesParams';
+import type { ListRemindersParams } from './generated/schemas/listRemindersParams';
import type { LocationResponseV3 } from './generated/schemas/locationResponseV3';
import type { PatchChannelRequest } from './generated/schemas/patchChannelRequest';
import type { PatchMessageRequest } from './generated/schemas/patchMessageRequest';
@@ -134,6 +135,7 @@ import type { PostSoupRequest } from './generated/schemas/postSoupRequest';
import type { PostTypingRequest } from './generated/schemas/postTypingRequest';
import type { Project } from './generated/schemas/project';
import type { Reminder } from './generated/schemas/reminder';
+import type { RemindersList } from './generated/schemas/remindersList';
import type { RemoveParticipantsRequest } from './generated/schemas/removeParticipantsRequest';
import type { ReorderFavoritesRequest } from './generated/schemas/reorderFavoritesRequest';
import type { ReorderPinRequest } from './generated/schemas/reorderPinRequest';
@@ -146,6 +148,7 @@ import type { SyncServiceVersionID } from './generated/schemas/syncServiceVersio
import type { ThreadResponse } from './generated/schemas/threadResponse';
import type { TypedSuccessResponse } from './generated/schemas/typedSuccessResponse';
import type { UpdateCrmTeamSettingsRequest } from './generated/schemas/updateCrmTeamSettingsRequest';
+import type { UpdateReminderRequest } from './generated/schemas/updateReminderRequest';
import type { UploadExtractFolderHandler200 } from './generated/schemas/uploadExtractFolderHandler200';
import type { UserPinsResponse } from './generated/schemas/userPinsResponse';
import type { UserViewsResponse } from './generated/schemas/userViewsResponse';
@@ -2338,6 +2341,32 @@ export const storageServiceClient = {
body: JSON.stringify(params),
});
},
+ async listReminders(params?: ListRemindersParams) {
+ const query = new URLSearchParams();
+ if (params?.entityType) query.set('entityType', params.entityType);
+ if (params?.entityId) query.set('entityId', params.entityId);
+ if (params?.includeCompleted !== undefined) {
+ query.set('includeCompleted', String(params.includeCompleted));
+ }
+ if (params?.limit !== undefined) query.set('limit', String(params.limit));
+ if (params?.cursor) query.set('cursor', params.cursor);
+ const qs = query.toString();
+ return await dssFetch<RemindersList>(`/reminders${qs ? `?${qs}` : ''}`, {
+ method: 'GET',
+ });
+ },
+ async getReminder(id: string) {
+ return await dssFetch<Reminder>(`/reminders/${id}`, { method: 'GET' });
+ },
+ async updateReminder(id: string, params: UpdateReminderRequest) {
+ return await dssFetch<Reminder>(`/reminders/${id}`, {
+ method: 'PATCH',
+ body: JSON.stringify(params),
+ });
+ },
+ async deleteReminder(id: string) {
+ return await dssFetch(`/reminders/${id}`, { method: 'DELETE' });
+ },
},
async editThread(params) {
const { threadId, ...body } = params;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiEntityFilterAst.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiEntityFilterAst.ts
index f2b63dcfd9..cf7eb60727 100644
--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiEntityFilterAst.ts
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiEntityFilterAst.ts
@@ -45,4 +45,8 @@ unlike the materialized [`EntityFilterAst`] used for cursors. */
pf?: unknown;
/** the filters that should be applied based on entity properties */
propf?: unknown;
+ /** Filters applied to reminders (wire key `remf`). Unlike every other
+filter here, empty/omitted returns **no** reminders: they are opt-in,
+so the caller must send `inc`, an id, or an entity to get any. */
+ remf?: unknown;
}
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/entityFilters.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/entityFilters.ts
index 4824371fc1..e8c83e97b7 100644
--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/entityFilters.ts
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/entityFilters.ts
@@ -15,6 +15,7 @@ import type { EmailFilters } from './emailFilters';
import type { ForeignEntityFilters } from './foreignEntityFilters';
import type { ProjectFilters } from './projectFilters';
import type { PropertyFilter } from './propertyFilter';
+import type { ReminderFilters } from './reminderFilters';
import type { TagFilterMode } from './tagFilterMode';
/**
@@ -43,6 +44,8 @@ export interface EntityFilters {
project_filters?: ProjectFilters;
/** property-based filters applied across entity types */
property_filters?: PropertyFilter[];
+ /** the bundled [ReminderFilters] */
+ reminder_filters?: ReminderFilters;
/** How the `tag_option_ids` combine: `any` (default) matches entities
holding at least one selected tag, `all` requires every selected tag. */
tag_filter_mode?: TagFilterMode;
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.ts
index e5befc125e..aea50b8e80 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
@@ -886,6 +886,8 @@ export * from './reminder';
export * from './reminderCompletedAt';
export * from './reminderEntityId';
export * from './reminderEntityType';
+export * from './reminderFilters';
+export * from './reminderFiltersCompleted';
export * from './reminderSchedule';
export * from './reminderScheduleOneOf';
export * from './reminderScheduleOneOfThree';
@@ -1048,6 +1050,8 @@ export * from './soupItemOneOfSevenTag';
export * from './soupItemOneOfTag';
export * from './soupItemOneOfThree';
export * from './soupItemOneOfThreeTag';
+export * from './soupItemOneOfTwoone';
+export * from './soupItemOneOfTwooneTag';
export * from './soupLabel';
export * from './soupLabelListVisibility';
export * from './soupLabelType';
@@ -1070,6 +1074,20 @@ export * from './soupProjectSoupPropertiesFieldAllOfTwoViewedAt';
export * from './soupPropertiesField';
export * from './soupProperty';
export * from './soupPropertyValue';
+export * from './soupReminderReference';
+export * from './soupReminderReferenceEntityType';
+export * from './soupReminderReferenceFileType';
+export * from './soupReminderReferenceSubType';
+export * from './soupReminderSchedule';
+export * from './soupReminderScheduleOneOf';
+export * from './soupReminderScheduleOneOfThree';
+export * from './soupReminderScheduleOneOfThreeType';
+export * from './soupReminderScheduleOneOfType';
+export * from './soupReminderSoupPropertiesField';
+export * from './soupReminderSoupPropertiesFieldAllOf';
+export * from './soupReminderSoupPropertiesFieldAllOfTwo';
+export * from './soupReminderSoupPropertiesFieldAllOfTwoCompletedAt';
+export * from './soupReminderSoupPropertiesFieldAllOfTwoReferencedEntity';
export * from './soupThreadInfo';
export * from './soupThreadInfoLatestReplyAt';
export * from './soupThreadReply';
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/reminder.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/reminder.ts
index 4cfed84da3..e96de94b2c 100644
--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/reminder.ts
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/reminder.ts
@@ -16,7 +16,8 @@ import type { ReminderSchedule } from './reminderSchedule';
so the field would be redundant on the wire.
*/
export interface Reminder {
- /** Set once a one-shot reminder has fired. */
+ /** Set once the owner marks the reminder as dealt with. Firing does not
+set it — a delivered reminder is waiting on its owner, not finished. */
completedAt?: ReminderCompletedAt;
/** When the reminder was created. */
createdAt: string;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/reminderCompletedAt.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/reminderCompletedAt.ts
index 94c975065d..cbcbf33c56 100644
--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/reminderCompletedAt.ts
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/reminderCompletedAt.ts
@@ -6,6 +6,7 @@
*/
/**
- * Set once a one-shot reminder has fired.
+ * Set once the owner marks the reminder as dealt with. Firing does not
+set it — a delivered reminder is waiting on its owner, not finished.
*/
export type ReminderCompletedAt = string | null;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/reminderFilters.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/reminderFilters.ts
new file mode 100644
index 0000000000..1083328139
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/reminderFilters.ts
@@ -0,0 +1,23 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { ReminderFiltersCompleted } from './reminderFiltersCompleted';
+
+/**
+ * Filters for reminders.
+ */
+export interface ReminderFilters {
+ /** Filter on whether the reminder has already fired. `None` returns both. */
+ completed?: ReminderFiltersCompleted;
+ /** Restrict to reminders attached to these entities, each `"{type}:{id}"`. */
+ entities?: string[];
+ /** Reminder ids to filter by. Empty to include all of the caller's reminders. */
+ ids?: string[];
+ /** Opt this query into reminders at all. Reminders are off by default —
+see [`crate::ast::reminder::ReminderLiteral::Include`]. Asking for
+specific `ids` or `entities` also opts in. */
+ include?: boolean;
+}
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/reminderFiltersCompleted.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/reminderFiltersCompleted.ts
new file mode 100644
index 0000000000..a0c81e4096
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/reminderFiltersCompleted.ts
@@ -0,0 +1,11 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * Filter on whether the reminder has already fired. `None` returns both.
+ */
+export type ReminderFiltersCompleted = boolean | null;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupItem.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupItem.ts
index 4cc7075ad7..c4f308ef04 100644
--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupItem.ts
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupItem.ts
@@ -14,6 +14,7 @@ import type { SoupItemOneOfOneseven } from './soupItemOneOfOneseven';
import type { SoupItemOneOfOnethree } from './soupItemOneOfOnethree';
import type { SoupItemOneOfSeven } from './soupItemOneOfSeven';
import type { SoupItemOneOfThree } from './soupItemOneOfThree';
+import type { SoupItemOneOfTwoone } from './soupItemOneOfTwoone';
/**
* A single item in the Soup feed.
@@ -28,4 +29,5 @@ export type SoupItem =
| SoupItemOneOfOnethree
| SoupItemOneOfOnefive
| SoupItemOneOfOneseven
- | SoupItemOneOfOnenine;
+ | SoupItemOneOfOnenine
+ | SoupItemOneOfTwoone;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupItemOneOfTwoone.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupItemOneOfTwoone.ts
new file mode 100644
index 0000000000..3475d97ad8
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupItemOneOfTwoone.ts
@@ -0,0 +1,18 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+import type { SoupItemOneOfTwooneTag } from './soupItemOneOfTwooneTag';
+import type { SoupReminderSoupPropertiesField } from './soupReminderSoupPropertiesField';
+
+/**
+ * Reminder item.
+ */
+export type SoupItemOneOfTwoone = {
+ /** Reminder item. */
+ data: SoupReminderSoupPropertiesField;
+ tag: SoupItemOneOfTwooneTag;
+};
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupItemOneOfTwooneTag.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupItemOneOfTwooneTag.ts
new file mode 100644
index 0000000000..34b011fec2
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupItemOneOfTwooneTag.ts
@@ -0,0 +1,14 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+export type SoupItemOneOfTwooneTag =
+ (typeof SoupItemOneOfTwooneTag)[keyof typeof SoupItemOneOfTwooneTag];
+
+// eslint-disable-next-line @typescript-eslint/no-redeclare
+export const SoupItemOneOfTwooneTag = {
+ reminder: 'reminder',
+} as const;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderReference.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderReference.ts
new file mode 100644
index 0000000000..487074aff9
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderReference.ts
@@ -0,0 +1,28 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { SoupReminderReferenceEntityType } from './soupReminderReferenceEntityType';
+import type { SoupReminderReferenceFileType } from './soupReminderReferenceFileType';
+import type { SoupReminderReferenceSubType } from './soupReminderReferenceSubType';
+
+/**
+ * The entity a reminder is about, resolved server-side.
+
+A reminder has no block of its own — it opens, and is iconed as, whatever it
+references. Which block that is depends on the referenced document's file
+type, and the client's icon path is synchronous, so this is resolved here
+rather than costing a fetch per row.
+ */
+export interface SoupReminderReference {
+ /** The referenced entity's type. */
+ entityType: SoupReminderReferenceEntityType;
+ /** File type, when the reference is a document — `md`, `pdf`, and so on. */
+ fileType?: SoupReminderReferenceFileType;
+ /** The referenced entity's id. */
+ id: string;
+ /** Sub type, when the reference is a task or snippet document. */
+ subType?: SoupReminderReferenceSubType;
+}
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
new file mode 100644
index 0000000000..83a5c014b9
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderReferenceEntityType.ts
@@ -0,0 +1,26 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * The referenced entity's type.
+ */
+export type SoupReminderReferenceEntityType =
+ | 'user'
+ | 'chat'
+ | 'channel'
+ | 'channel_message'
+ | 'document'
+ | 'project'
+ | 'email_thread'
+ | 'calendar_event'
+ | 'team'
+ | 'call'
+ | 'foreign_entity'
+ | 'static_file'
+ | 'crm_company'
+ | 'crm_contact'
+ | 'reminder';
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderReferenceFileType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderReferenceFileType.ts
new file mode 100644
index 0000000000..a4f5c9df45
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderReferenceFileType.ts
@@ -0,0 +1,11 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * File type, when the reference is a document — `md`, `pdf`, and so on.
+ */
+export type SoupReminderReferenceFileType = string | null;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderReferenceSubType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderReferenceSubType.ts
new file mode 100644
index 0000000000..aa56667e9c
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderReferenceSubType.ts
@@ -0,0 +1,11 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * Sub type, when the reference is a task or snippet document.
+ */
+export type SoupReminderReferenceSubType = string | null;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderSchedule.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderSchedule.ts
new file mode 100644
index 0000000000..f9ca9ff3f9
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderSchedule.ts
@@ -0,0 +1,19 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { SoupReminderScheduleOneOf } from './soupReminderScheduleOneOf';
+import type { SoupReminderScheduleOneOfThree } from './soupReminderScheduleOneOfThree';
+
+/**
+ * How often a reminder fires, flattened for the wire.
+
+The domain's [`ReminderSchedule`] is an internally-tagged enum carrying a
+validated cron type; Soup only needs enough to render "once" vs "every
+weekday at 9am", so the cron is exposed as a plain string.
+ */
+export type SoupReminderSchedule =
+ | SoupReminderScheduleOneOf
+ | SoupReminderScheduleOneOfThree;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderScheduleOneOf.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderScheduleOneOf.ts
new file mode 100644
index 0000000000..50ce7cc00a
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderScheduleOneOf.ts
@@ -0,0 +1,16 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { SoupReminderScheduleOneOfType } from './soupReminderScheduleOneOfType';
+
+/**
+ * Fires once, at a fixed instant.
+ */
+export type SoupReminderScheduleOneOf = {
+ /** The instant to fire at. */
+ remindAt: string;
+ type: SoupReminderScheduleOneOfType;
+};
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderScheduleOneOfThree.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderScheduleOneOfThree.ts
new file mode 100644
index 0000000000..fdf2e298fc
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderScheduleOneOfThree.ts
@@ -0,0 +1,18 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { SoupReminderScheduleOneOfThreeType } from './soupReminderScheduleOneOfThreeType';
+
+/**
+ * Fires repeatedly, on a cron schedule evaluated in `timezone`.
+ */
+export type SoupReminderScheduleOneOfThree = {
+ /** Cron expression, normalized to the 6-field form. */
+ cron: string;
+ /** The timezone the cron expression is evaluated in. */
+ timezone: string;
+ type: SoupReminderScheduleOneOfThreeType;
+};
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderScheduleOneOfThreeType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderScheduleOneOfThreeType.ts
new file mode 100644
index 0000000000..e9c2924252
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderScheduleOneOfThreeType.ts
@@ -0,0 +1,14 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+export type SoupReminderScheduleOneOfThreeType =
+ (typeof SoupReminderScheduleOneOfThreeType)[keyof typeof SoupReminderScheduleOneOfThreeType];
+
+// eslint-disable-next-line @typescript-eslint/no-redeclare
+export const SoupReminderScheduleOneOfThreeType = {
+ recurring: 'recurring',
+} as const;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderScheduleOneOfType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderScheduleOneOfType.ts
new file mode 100644
index 0000000000..e86ea5b731
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderScheduleOneOfType.ts
@@ -0,0 +1,14 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+export type SoupReminderScheduleOneOfType =
+ (typeof SoupReminderScheduleOneOfType)[keyof typeof SoupReminderScheduleOneOfType];
+
+// eslint-disable-next-line @typescript-eslint/no-redeclare
+export const SoupReminderScheduleOneOfType = {
+ once: 'once',
+} as const;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderSoupPropertiesField.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderSoupPropertiesField.ts
new file mode 100644
index 0000000000..95eba93c16
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderSoupPropertiesField.ts
@@ -0,0 +1,18 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { SoupReminderSoupPropertiesFieldAllOf } from './soupReminderSoupPropertiesFieldAllOf';
+import type { SoupReminderSoupPropertiesFieldAllOfTwo } from './soupReminderSoupPropertiesFieldAllOfTwo';
+
+/**
+ * A reminder as displayed in Soup.
+
+Reminders are user-owned rather than shared, so unlike most Soup items they
+carry no access metadata — the repository only ever returns the caller's own.
+ */
+export type SoupReminderSoupPropertiesField =
+ SoupReminderSoupPropertiesFieldAllOf &
+ SoupReminderSoupPropertiesFieldAllOfTwo;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderSoupPropertiesFieldAllOf.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderSoupPropertiesFieldAllOf.ts
new file mode 100644
index 0000000000..05e131e442
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderSoupPropertiesFieldAllOf.ts
@@ -0,0 +1,15 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { SoupProperty } from './soupProperty';
+
+/**
+ * Property fields that can be flattened into property-bearing Soup items.
+ */
+export type SoupReminderSoupPropertiesFieldAllOf = {
+ /** Properties attached to the entity. */
+ properties: SoupProperty[];
+};
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderSoupPropertiesFieldAllOfTwo.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderSoupPropertiesFieldAllOfTwo.ts
new file mode 100644
index 0000000000..bd3d90c5fc
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderSoupPropertiesFieldAllOfTwo.ts
@@ -0,0 +1,30 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+import type { SoupReminderSchedule } from './soupReminderSchedule';
+import type { SoupReminderSoupPropertiesFieldAllOfTwoCompletedAt } from './soupReminderSoupPropertiesFieldAllOfTwoCompletedAt';
+import type { SoupReminderSoupPropertiesFieldAllOfTwoReferencedEntity } from './soupReminderSoupPropertiesFieldAllOfTwoReferencedEntity';
+
+export type SoupReminderSoupPropertiesFieldAllOfTwo = {
+ /** Set once a one-shot reminder has fired. */
+ completedAt?: SoupReminderSoupPropertiesFieldAllOfTwoCompletedAt;
+ /** When the reminder was created. */
+ createdAt: string;
+ /** What to remind the user about. Doubles as the display name. */
+ description: string;
+ /** When false, the dispatcher skips this reminder. */
+ enabled: boolean;
+ /** The reminder id. */
+ id: string;
+ /** The next firing. This is what Soup sorts reminders on. */
+ nextRunAt: string;
+ referencedEntity?: SoupReminderSoupPropertiesFieldAllOfTwoReferencedEntity;
+ /** When and how often the reminder fires. */
+ schedule: SoupReminderSchedule;
+ /** When the reminder was last modified. */
+ updatedAt: string;
+};
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderSoupPropertiesFieldAllOfTwoCompletedAt.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderSoupPropertiesFieldAllOfTwoCompletedAt.ts
new file mode 100644
index 0000000000..524b92d735
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderSoupPropertiesFieldAllOfTwoCompletedAt.ts
@@ -0,0 +1,11 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * Set once a one-shot reminder has fired.
+ */
+export type SoupReminderSoupPropertiesFieldAllOfTwoCompletedAt = string | null;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderSoupPropertiesFieldAllOfTwoReferencedEntity.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderSoupPropertiesFieldAllOfTwoReferencedEntity.ts
new file mode 100644
index 0000000000..a4055c4d6c
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderSoupPropertiesFieldAllOfTwoReferencedEntity.ts
@@ -0,0 +1,10 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { SoupReminderReference } from './soupReminderReference';
+
+export type SoupReminderSoupPropertiesFieldAllOfTwoReferencedEntity =
+ null | SoupReminderReference;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/updateReminderRequest.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/updateReminderRequest.ts
index e63729603c..6b8ac4ac15 100644
--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/updateReminderRequest.ts
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/updateReminderRequest.ts
@@ -18,6 +18,9 @@ advertising a value the API has no meaning for; the deserializer still
tolerates `null` rather than erroring on it.
*/
export interface UpdateReminderRequest {
+ /** Mark the reminder as dealt with, or live again. Distinct from
+`enabled`, which controls whether the dispatcher considers it. */
+ completed?: boolean;
/** Replacement description. */
description?: string;
/** Whether the reminder should fire at all. */
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 997d0da949..47b3cc2633 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
@@ -10351,6 +10351,349 @@ export const getItemsSoupResponse = zod
tag: zod.enum(['foreignEntity']),
})
.describe('Foreign entity item.'),
+ zod
+ .object({
+ data: zod
+ .object({
+ properties: zod
+ .array(
+ zod
+ .object({
+ definition: zod
+ .object({
+ created_at: zod.iso.datetime({}),
+ data_type: zod
+ .enum([
+ 'BOOLEAN',
+ 'DATE',
+ 'NUMBER',
+ 'STRING',
+ 'SELECT_NUMBER',
+ 'SELECT_STRING',
+ 'TAG',
+ 'ENTITY',
+ 'LINK',
+ ])
+ .describe(
+ 'Data type for property values, determining storage and validation.'
+ ),
+ display_name: zod.string(),
+ id: zod.uuid(),
+ is_metadata: zod
+ .boolean()
+ .describe(
+ 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'
+ ),
+ is_multi_select: zod.boolean(),
+ is_system: zod
+ .boolean()
+ .describe(
+ 'Flag to indicate if this is a system property (stored in DB).'
+ ),
+ owner: zod
+ .union([
+ zod
+ .object({
+ scope: zod.enum(['user']),
+ user_id: zod.string(),
+ })
+ .describe('User-scoped property.'),
+ zod
+ .object({
+ scope: zod.enum(['team']),
+ team_id: zod.uuid(),
+ })
+ .describe('Team-scoped property.'),
+ zod
+ .object({
+ scope: zod.enum(['system']),
+ })
+ .describe(
+ 'System-owned property (no user or team owner).'
+ ),
+ ])
+ .describe(
+ 'Defines who owns a property - user-scoped, team-scoped, or system.'
+ ),
+ specific_entity_type: zod
+ .union([
+ zod.null(),
+ zod
+ .enum([
+ 'CALENDAR_EVENT',
+ 'CALL_RECORD',
+ 'CHANNEL',
+ 'CHAT',
+ 'COMPANY',
+ 'DOCUMENT',
+ 'PROJECT',
+ 'TASK',
+ 'THREAD',
+ 'USER',
+ ])
+ .describe(
+ 'Type of entity that can be referenced by entity properties.'
+ ),
+ ])
+ .optional(),
+ updated_at: zod.iso.datetime({}),
+ })
+ .describe(
+ 'Property definition model (service representation).'
+ ),
+ id: zod
+ .uuid()
+ .describe(
+ 'Globally unique id of the assignment attaching this property to an entity.'
+ ),
+ value: zod
+ .union([
+ zod.null(),
+ zod
+ .union([
+ zod
+ .object({
+ type: zod.enum(['Boolean']),
+ value: zod
+ .boolean()
+ .describe(
+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'
+ ),
+ })
+ .describe(
+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Number']),
+ value: zod
+ .number()
+ .describe(
+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'
+ ),
+ })
+ .describe(
+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['String']),
+ value: zod
+ .string()
+ .describe(
+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'
+ ),
+ })
+ .describe(
+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Date']),
+ value: zod.iso
+ .datetime({})
+ .describe(
+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'
+ ),
+ })
+ .describe(
+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['SelectOption']),
+ value: zod
+ .array(zod.uuid())
+ .describe(
+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'
+ ),
+ })
+ .describe(
+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'
+ ),
+ zod
+ .object({
+ type: zod.enum(['EntityReference']),
+ value: zod
+ .array(
+ zod
+ .object({
+ entity_id: zod.string(),
+ entity_type: zod
+ .enum([
+ 'CALENDAR_EVENT',
+ 'CALL_RECORD',
+ 'CHANNEL',
+ 'CHAT',
+ 'COMPANY',
+ 'DOCUMENT',
+ 'PROJECT',
+ 'TASK',
+ 'THREAD',
+ 'USER',
+ ])
+ .describe(
+ 'Type of entity that can be referenced by entity properties.'
+ ),
+ specific_message_id: zod
+ .uuid()
+ .nullish()
+ .describe(
+ 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'
+ ),
+ })
+ .describe(
+ 'Entity reference for entity-type property values.'
+ )
+ )
+ .describe(
+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'
+ ),
+ })
+ .describe(
+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Link']),
+ value: zod
+ .array(zod.string())
+ .describe(
+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'
+ ),
+ })
+ .describe(
+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'
+ ),
+ ])
+ .describe(
+ 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'
+ ),
+ ])
+ .optional(),
+ })
+ .describe(
+ 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'
+ )
+ )
+ .describe('Properties attached to the entity.'),
+ })
+ .describe(
+ 'Property fields that can be flattened into property-bearing Soup items.'
+ )
+ .and(
+ zod.object({
+ completedAt: zod.iso
+ .datetime({})
+ .nullish()
+ .describe('Set once a one-shot reminder has fired.'),
+ createdAt: zod.iso
+ .datetime({})
+ .describe('When the reminder was created.'),
+ description: zod
+ .string()
+ .describe(
+ 'What to remind the user about. Doubles as the display name.'
+ ),
+ enabled: zod
+ .boolean()
+ .describe(
+ 'When false, the dispatcher skips this reminder.'
+ ),
+ id: zod.uuid().describe('The reminder id.'),
+ nextRunAt: zod.iso
+ .datetime({})
+ .describe(
+ 'The next firing. This is what Soup sorts reminders on.'
+ ),
+ referencedEntity: zod
+ .union([
+ zod.null(),
+ zod
+ .object({
+ entityType: zod
+ .enum([
+ 'user',
+ 'chat',
+ 'channel',
+ 'channel_message',
+ 'document',
+ 'project',
+ 'email_thread',
+ 'calendar_event',
+ 'team',
+ 'call',
+ 'foreign_entity',
+ 'static_file',
+ 'crm_company',
+ 'crm_contact',
+ 'reminder',
+ ])
+ .describe('The type of an entity in Macro')
+ .describe("The referenced entity's type."),
+ fileType: zod
+ .string()
+ .nullish()
+ .describe(
+ 'File type, when the reference is a document — `md`, `pdf`, and so on.'
+ ),
+ id: zod
+ .string()
+ .describe("The referenced entity's id."),
+ subType: zod
+ .string()
+ .nullish()
+ .describe(
+ 'Sub type, when the reference is a task or snippet document.'
+ ),
+ })
+ .describe(
+ "The entity a reminder is about, resolved server-side.\n\nA reminder has no block of its own — it opens, and is iconed as, whatever it\nreferences. Which block that is depends on the referenced document's file\ntype, and the client's icon path is synchronous, so this is resolved here\nrather than costing a fetch per row."
+ ),
+ ])
+ .optional(),
+ schedule: zod
+ .union([
+ zod
+ .object({
+ remindAt: zod.iso
+ .datetime({})
+ .describe('The instant to fire at.'),
+ type: zod.enum(['once']),
+ })
+ .describe('Fires once, at a fixed instant.'),
+ zod
+ .object({
+ cron: zod
+ .string()
+ .describe(
+ 'Cron expression, normalized to the 6-field form.'
+ ),
+ timezone: zod
+ .string()
+ .describe(
+ 'The timezone the cron expression is evaluated in.'
+ ),
+ type: zod.enum(['recurring']),
+ })
+ .describe(
+ 'Fires repeatedly, on a cron schedule evaluated in `timezone`.'
+ ),
+ ])
+ .describe(
+ 'How often a reminder fires, flattened for the wire.\n\nThe domain\'s [`ReminderSchedule`] is an internally-tagged enum carrying a\nvalidated cron type; Soup only needs enough to render \"once\" vs \"every\nweekday at 9am\", so the cron is exposed as a plain string.'
+ ),
+ updatedAt: zod.iso
+ .datetime({})
+ .describe('When the reminder was last modified.'),
+ })
+ )
+ .describe(
+ "A reminder as displayed in Soup.\n\nReminders are user-owned rather than shared, so unlike most Soup items they\ncarry no access metadata — the repository only ever returns the caller's own."
+ ),
+ tag: zod.enum(['reminder']),
+ })
+ .describe('Reminder item.'),
])
.describe('A single item in the Soup feed.')
.and(
@@ -10941,6 +11284,35 @@ export const postItemsSoupBody = zod
)
.optional()
.describe('property-based filters applied across entity types'),
+ reminder_filters: zod
+ .object({
+ completed: zod
+ .boolean()
+ .nullish()
+ .describe(
+ 'Filter on whether the reminder has already fired. `None` returns both.'
+ ),
+ entities: zod
+ .array(zod.string())
+ .optional()
+ .describe(
+ 'Restrict to reminders attached to these entities, each `\"{type}:{id}\"`.'
+ ),
+ ids: zod
+ .array(zod.string())
+ .optional()
+ .describe(
+ "Reminder ids to filter by. Empty to include all of the caller's reminders."
+ ),
+ include: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'Opt this query into reminders at all. Reminders are off by default —\nsee [`crate::ast::reminder::ReminderLiteral::Include`]. Asking for\nspecific `ids` or `entities` also opts in.'
+ ),
+ })
+ .optional()
+ .describe('Filters for reminders.'),
tag_filter_mode: zod
.enum(['any', 'all'])
.optional()
@@ -13127,110 +13499,459 @@ export const postItemsSoupResponse = zod
),
})
.describe(
- 'Entity reference for entity-type property values.'
- )
- )
+ 'Entity reference for entity-type property values.'
+ )
+ )
+ .describe(
+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'
+ ),
+ })
+ .describe(
+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Link']),
+ value: zod
+ .array(zod.string())
+ .describe(
+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'
+ ),
+ })
+ .describe(
+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'
+ ),
+ ])
+ .describe(
+ 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'
+ ),
+ ])
+ .optional(),
+ })
+ .describe(
+ 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'
+ )
+ )
+ .describe('Properties attached to the entity.'),
+ })
+ .describe(
+ 'Property fields that can be flattened into property-bearing Soup items.'
+ ),
+ icalUid: zod
+ .string()
+ .describe('RFC 5545 UID used for source reconciliation.'),
+ id: zod.uuid().describe('Entity identifier.'),
+ isReadOnly: zod
+ .boolean()
+ .describe(
+ 'Whether the selected canonical source is read-only.'
+ ),
+ location: zod
+ .string()
+ .nullish()
+ .describe('Optional location label.'),
+ organizerEmail: zod
+ .string()
+ .nullish()
+ .describe('Organizer email.'),
+ organizerName: zod
+ .string()
+ .nullish()
+ .describe('Organizer display name.'),
+ ownerId: zod.string().describe('Owning Macro user.'),
+ status: zod.string().describe('Canonical status.'),
+ time: zod
+ .union([
+ zod
+ .object({
+ ends_at: zod.iso
+ .datetime({})
+ .describe('Exclusive end.'),
+ kind: zod.enum(['timed']),
+ starts_at: zod.iso
+ .datetime({})
+ .describe('Inclusive start.'),
+ time_zone: zod
+ .string()
+ .nullish()
+ .describe('Original IANA time zone.'),
+ })
+ .describe('Absolute timed event.'),
+ zod
+ .object({
+ end_date: zod.iso
+ .date()
+ .describe('Exclusive end date.'),
+ kind: zod.enum(['allDay']),
+ start_date: zod.iso
+ .date()
+ .describe('Inclusive start date.'),
+ })
+ .describe('All-day event with an exclusive end date.'),
+ ])
+ .describe('Timed or all-day calendar event span.'),
+ title: zod.string().describe('Display title.'),
+ transparency: zod
+ .string()
+ .describe('Availability transparency.'),
+ updatedAt: zod.iso
+ .datetime({})
+ .describe('Entity update timestamp.'),
+ visibility: zod.string().describe('Canonical visibility.'),
+ })
+ .describe('A canonical calendar event entity in Soup.'),
+ tag: zod.enum(['calendarEvent']),
+ })
+ .describe('Calendar event item.'),
+ zod
+ .object({
+ data: zod
+ .object({
+ properties: zod
+ .array(
+ zod
+ .object({
+ definition: zod
+ .object({
+ created_at: zod.iso.datetime({}),
+ data_type: zod
+ .enum([
+ 'BOOLEAN',
+ 'DATE',
+ 'NUMBER',
+ 'STRING',
+ 'SELECT_NUMBER',
+ 'SELECT_STRING',
+ 'TAG',
+ 'ENTITY',
+ 'LINK',
+ ])
+ .describe(
+ 'Data type for property values, determining storage and validation.'
+ ),
+ display_name: zod.string(),
+ id: zod.uuid(),
+ is_metadata: zod
+ .boolean()
+ .describe(
+ 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'
+ ),
+ is_multi_select: zod.boolean(),
+ is_system: zod
+ .boolean()
+ .describe(
+ 'Flag to indicate if this is a system property (stored in DB).'
+ ),
+ owner: zod
+ .union([
+ zod
+ .object({
+ scope: zod.enum(['user']),
+ user_id: zod.string(),
+ })
+ .describe('User-scoped property.'),
+ zod
+ .object({
+ scope: zod.enum(['team']),
+ team_id: zod.uuid(),
+ })
+ .describe('Team-scoped property.'),
+ zod
+ .object({
+ scope: zod.enum(['system']),
+ })
+ .describe(
+ 'System-owned property (no user or team owner).'
+ ),
+ ])
+ .describe(
+ 'Defines who owns a property - user-scoped, team-scoped, or system.'
+ ),
+ specific_entity_type: zod
+ .union([
+ zod.null(),
+ zod
+ .enum([
+ 'CALENDAR_EVENT',
+ 'CALL_RECORD',
+ 'CHANNEL',
+ 'CHAT',
+ 'COMPANY',
+ 'DOCUMENT',
+ 'PROJECT',
+ 'TASK',
+ 'THREAD',
+ 'USER',
+ ])
+ .describe(
+ 'Type of entity that can be referenced by entity properties.'
+ ),
+ ])
+ .optional(),
+ updated_at: zod.iso.datetime({}),
+ })
+ .describe(
+ 'Property definition model (service representation).'
+ ),
+ id: zod
+ .uuid()
+ .describe(
+ 'Globally unique id of the assignment attaching this property to an entity.'
+ ),
+ value: zod
+ .union([
+ zod.null(),
+ zod
+ .union([
+ zod
+ .object({
+ type: zod.enum(['Boolean']),
+ value: zod
+ .boolean()
+ .describe(
+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'
+ ),
+ })
+ .describe(
+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Number']),
+ value: zod
+ .number()
+ .describe(
+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'
+ ),
+ })
+ .describe(
+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['String']),
+ value: zod
+ .string()
+ .describe(
+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'
+ ),
+ })
+ .describe(
+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Date']),
+ value: zod.iso
+ .datetime({})
+ .describe(
+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'
+ ),
+ })
+ .describe(
+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['SelectOption']),
+ value: zod
+ .array(zod.uuid())
+ .describe(
+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'
+ ),
+ })
+ .describe(
+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'
+ ),
+ zod
+ .object({
+ type: zod.enum(['EntityReference']),
+ value: zod
+ .array(
+ zod
+ .object({
+ entity_id: zod.string(),
+ entity_type: zod
+ .enum([
+ 'CALENDAR_EVENT',
+ 'CALL_RECORD',
+ 'CHANNEL',
+ 'CHAT',
+ 'COMPANY',
+ 'DOCUMENT',
+ 'PROJECT',
+ 'TASK',
+ 'THREAD',
+ 'USER',
+ ])
+ .describe(
+ 'Type of entity that can be referenced by entity properties.'
+ ),
+ specific_message_id: zod
+ .uuid()
+ .nullish()
+ .describe(
+ 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'
+ ),
+ })
.describe(
- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'
- ),
- })
+ 'Entity reference for entity-type property values.'
+ )
+ )
.describe(
'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'
),
- zod
- .object({
- type: zod.enum(['Link']),
- value: zod
- .array(zod.string())
- .describe(
- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'
- ),
- })
+ })
+ .describe(
+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Link']),
+ value: zod
+ .array(zod.string())
.describe(
'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'
),
- ])
+ })
.describe(
- 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'
+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'
),
])
- .optional(),
- })
- .describe(
- 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'
- )
+ .describe(
+ 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'
+ ),
+ ])
+ .optional(),
+ })
+ .describe(
+ 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'
)
- .describe('Properties attached to the entity.'),
- })
- .describe(
- 'Property fields that can be flattened into property-bearing Soup items.'
- ),
- icalUid: zod
- .string()
- .describe('RFC 5545 UID used for source reconciliation.'),
- id: zod.uuid().describe('Entity identifier.'),
- isReadOnly: zod
- .boolean()
- .describe(
- 'Whether the selected canonical source is read-only.'
- ),
- location: zod
- .string()
- .nullish()
- .describe('Optional location label.'),
- organizerEmail: zod
+ )
+ .describe('Properties attached to the entity.'),
+ })
+ .describe(
+ 'Property fields that can be flattened into property-bearing Soup items.'
+ )
+ .and(
+ zod.object({
+ createdAt: zod.iso
+ .datetime({})
+ .describe('When the company was created.'),
+ description: zod
+ .string()
+ .nullish()
+ .describe(
+ "Display description from the primary domain's directory entry."
+ ),
+ domains: zod
+ .array(
+ zod
+ .object({
+ companyId: zod
+ .uuid()
+ .describe(
+ 'The id of the company the domain belongs to.'
+ ),
+ createdAt: zod.iso
+ .datetime({})
+ .describe('When the domain record was created.'),
+ domain: zod
+ .string()
+ .describe(
+ 'The domain (lowercased, e.g. \"acme.com\").'
+ ),
+ id: zod
+ .uuid()
+ .describe('The id of the domain record.'),
+ })
+ .describe(
+ "A CRM domain as displayed in Soup. Mirrors the crm crate's\n[`CrmDomain`] with a stable wire shape that the FE can rely on."
+ )
+ )
+ .describe(
+ 'Domains associated with this company, ordered by creation time\nascending (primary first).'
+ ),
+ emailSync: zod
+ .boolean()
+ .describe(
+ 'Whether email sync is enabled for this company.'
+ ),
+ hidden: zod
+ .boolean()
+ .describe(
+ 'Whether the company is hidden from CRM listings. Soup filters\nthese out by default.'
+ ),
+ id: zod.uuid().describe('The id of the company.'),
+ name: zod
+ .string()
+ .nullish()
+ .describe(
+ "Display name from the primary domain's directory entry, or\n`None` when unresolved."
+ ),
+ teamId: zod
+ .uuid()
+ .describe(
+ 'The id of the team that owns this company record.'
+ ),
+ updatedAt: zod.iso
+ .datetime({})
+ .describe('When the company was last updated.'),
+ viewedAt: zod.iso
+ .datetime({})
+ .nullish()
+ .describe(
+ 'When the requesting user last viewed this company, or `None` if\nnever viewed. Mirrors the `viewed_at` other soup entities carry.'
+ ),
+ })
+ )
+ .describe(
+ 'A CRM company as displayed in Soup. Carries the core company\nfields plus display metadata resolved from `crm_domain_directory`\nagainst the primary (earliest-created) domain.'
+ ),
+ tag: zod.enum(['crmCompany']),
+ })
+ .describe('CRM company item.'),
+ zod
+ .object({
+ data: zod
+ .object({
+ createdAt: zod.iso
+ .datetime({})
+ .describe('Timestamp when the record was created.'),
+ foreignEntityId: zod
.string()
- .nullish()
- .describe('Organizer email.'),
- organizerName: zod
+ .describe('Identifier assigned by the external system.'),
+ foreignEntitySource: zod
.string()
- .nullish()
- .describe('Organizer display name.'),
- ownerId: zod.string().describe('Owning Macro user.'),
- status: zod.string().describe('Canonical status.'),
- time: zod
- .union([
- zod
- .object({
- ends_at: zod.iso
- .datetime({})
- .describe('Exclusive end.'),
- kind: zod.enum(['timed']),
- starts_at: zod.iso
- .datetime({})
- .describe('Inclusive start.'),
- time_zone: zod
- .string()
- .nullish()
- .describe('Original IANA time zone.'),
- })
- .describe('Absolute timed event.'),
- zod
- .object({
- end_date: zod.iso
- .date()
- .describe('Exclusive end date.'),
- kind: zod.enum(['allDay']),
- start_date: zod.iso
- .date()
- .describe('Inclusive start date.'),
- })
- .describe('All-day event with an exclusive end date.'),
- ])
- .describe('Timed or all-day calendar event span.'),
- title: zod.string().describe('Display title.'),
- transparency: zod
+ .describe(
+ 'Source system that owns the external identifier.'
+ ),
+ id: zod
+ .uuid()
+ .describe(
+ 'Internal primary key for this foreign entity record.'
+ ),
+ metadata: zod
+ .object({})
+ .describe('Arbitrary metadata stored with the mapping.'),
+ storedForAuthEntity: zod
.string()
- .describe('Availability transparency.'),
+ .describe(
+ 'Internal auth entity namespace this foreign entity is stored for.'
+ ),
+ storedForId: zod
+ .string()
+ .describe(
+ 'Internal entity identifier this foreign entity is stored for.'
+ ),
updatedAt: zod.iso
.datetime({})
- .describe('Entity update timestamp.'),
- visibility: zod.string().describe('Canonical visibility.'),
+ .describe('Timestamp when the record was last updated.'),
})
- .describe('A canonical calendar event entity in Soup.'),
- tag: zod.enum(['calendarEvent']),
+ .describe('A foreign entity record as displayed in Soup.'),
+ tag: zod.enum(['foreignEntity']),
})
- .describe('Calendar event item.'),
+ .describe('Foreign entity item.'),
zod
.object({
data: zod
@@ -13463,123 +14184,117 @@ export const postItemsSoupResponse = zod
)
.and(
zod.object({
+ completedAt: zod.iso
+ .datetime({})
+ .nullish()
+ .describe('Set once a one-shot reminder has fired.'),
createdAt: zod.iso
.datetime({})
- .describe('When the company was created.'),
+ .describe('When the reminder was created.'),
description: zod
.string()
- .nullish()
.describe(
- "Display description from the primary domain's directory entry."
+ 'What to remind the user about. Doubles as the display name.'
),
- domains: zod
- .array(
+ enabled: zod
+ .boolean()
+ .describe(
+ 'When false, the dispatcher skips this reminder.'
+ ),
+ id: zod.uuid().describe('The reminder id.'),
+ nextRunAt: zod.iso
+ .datetime({})
+ .describe(
+ 'The next firing. This is what Soup sorts reminders on.'
+ ),
+ referencedEntity: zod
+ .union([
+ zod.null(),
zod
.object({
- companyId: zod
- .uuid()
+ entityType: zod
+ .enum([
+ 'user',
+ 'chat',
+ 'channel',
+ 'channel_message',
+ 'document',
+ 'project',
+ 'email_thread',
+ 'calendar_event',
+ 'team',
+ 'call',
+ 'foreign_entity',
+ 'static_file',
+ 'crm_company',
+ 'crm_contact',
+ 'reminder',
+ ])
+ .describe('The type of an entity in Macro')
+ .describe("The referenced entity's type."),
+ fileType: zod
+ .string()
+ .nullish()
.describe(
- 'The id of the company the domain belongs to.'
+ 'File type, when the reference is a document — `md`, `pdf`, and so on.'
),
- createdAt: zod.iso
+ id: zod
+ .string()
+ .describe("The referenced entity's id."),
+ subType: zod
+ .string()
+ .nullish()
+ .describe(
+ 'Sub type, when the reference is a task or snippet document.'
+ ),
+ })
+ .describe(
+ "The entity a reminder is about, resolved server-side.\n\nA reminder has no block of its own — it opens, and is iconed as, whatever it\nreferences. Which block that is depends on the referenced document's file\ntype, and the client's icon path is synchronous, so this is resolved here\nrather than costing a fetch per row."
+ ),
+ ])
+ .optional(),
+ schedule: zod
+ .union([
+ zod
+ .object({
+ remindAt: zod.iso
.datetime({})
- .describe('When the domain record was created.'),
- domain: zod
+ .describe('The instant to fire at.'),
+ type: zod.enum(['once']),
+ })
+ .describe('Fires once, at a fixed instant.'),
+ zod
+ .object({
+ cron: zod
.string()
.describe(
- 'The domain (lowercased, e.g. \"acme.com\").'
+ 'Cron expression, normalized to the 6-field form.'
),
- id: zod
- .uuid()
- .describe('The id of the domain record.'),
+ timezone: zod
+ .string()
+ .describe(
+ 'The timezone the cron expression is evaluated in.'
+ ),
+ type: zod.enum(['recurring']),
})
.describe(
- "A CRM domain as displayed in Soup. Mirrors the crm crate's\n[`CrmDomain`] with a stable wire shape that the FE can rely on."
- )
- )
- .describe(
- 'Domains associated with this company, ordered by creation time\nascending (primary first).'
- ),
- emailSync: zod
- .boolean()
- .describe(
- 'Whether email sync is enabled for this company.'
- ),
- hidden: zod
- .boolean()
- .describe(
- 'Whether the company is hidden from CRM listings. Soup filters\nthese out by default.'
- ),
- id: zod.uuid().describe('The id of the company.'),
- name: zod
- .string()
- .nullish()
- .describe(
- "Display name from the primary domain's directory entry, or\n`None` when unresolved."
- ),
- teamId: zod
- .uuid()
+ 'Fires repeatedly, on a cron schedule evaluated in `timezone`.'
+ ),
+ ])
.describe(
- 'The id of the team that owns this company record.'
+ 'How often a reminder fires, flattened for the wire.\n\nThe domain\'s [`ReminderSchedule`] is an internally-tagged enum carrying a\nvalidated cron type; Soup only needs enough to render \"once\" vs \"every\nweekday at 9am\", so the cron is exposed as a plain string.'
),
updatedAt: zod.iso
.datetime({})
- .describe('When the company was last updated.'),
- viewedAt: zod.iso
- .datetime({})
- .nullish()
- .describe(
- 'When the requesting user last viewed this company, or `None` if\nnever viewed. Mirrors the `viewed_at` other soup entities carry.'
- ),
+ .describe('When the reminder was last modified.'),
})
)
.describe(
- 'A CRM company as displayed in Soup. Carries the core company\nfields plus display metadata resolved from `crm_domain_directory`\nagainst the primary (earliest-created) domain.'
+ "A reminder as displayed in Soup.\n\nReminders are user-owned rather than shared, so unlike most Soup items they\ncarry no access metadata — the repository only ever returns the caller's own."
),
- tag: zod.enum(['crmCompany']),
- })
- .describe('CRM company item.'),
- zod
- .object({
- data: zod
- .object({
- createdAt: zod.iso
- .datetime({})
- .describe('Timestamp when the record was created.'),
- foreignEntityId: zod
- .string()
- .describe('Identifier assigned by the external system.'),
- foreignEntitySource: zod
- .string()
- .describe(
- 'Source system that owns the external identifier.'
- ),
- id: zod
- .uuid()
- .describe(
- 'Internal primary key for this foreign entity record.'
- ),
- metadata: zod
- .object({})
- .describe('Arbitrary metadata stored with the mapping.'),
- storedForAuthEntity: zod
- .string()
- .describe(
- 'Internal auth entity namespace this foreign entity is stored for.'
- ),
- storedForId: zod
- .string()
- .describe(
- 'Internal entity identifier this foreign entity is stored for.'
- ),
- updatedAt: zod.iso
- .datetime({})
- .describe('Timestamp when the record was last updated.'),
- })
- .describe('A foreign entity record as displayed in Soup.'),
- tag: zod.enum(['foreignEntity']),
+ tag: zod.enum(['reminder']),
})
- .describe('Foreign entity item.'),
+ .describe('Reminder item.'),
])
.describe('A single item in the Soup feed.')
.and(
@@ -13673,6 +14388,12 @@ export const postItemsSoupAstBody = zod
.describe(
'the filters that should be applied based on entity properties'
),
+ remf: zod
+ .unknown()
+ .optional()
+ .describe(
+ 'Filters applied to reminders (wire key `remf`). Unlike every other\nfilter here, empty\/omitted returns \*\*no\*\* reminders: they are opt-in,\nso the caller must send `inc`, an id, or an entity to get any.'
+ ),
})
.describe('Wire-format entity filter AST accepted by soup AST endpoints.')
.and(
@@ -15702,259 +16423,608 @@ export const postItemsSoupAstResponse = zod
.union([
zod
.object({
- scope: zod.enum(['user']),
- user_id: zod.string(),
+ scope: zod.enum(['user']),
+ user_id: zod.string(),
+ })
+ .describe('User-scoped property.'),
+ zod
+ .object({
+ scope: zod.enum(['team']),
+ team_id: zod.uuid(),
+ })
+ .describe('Team-scoped property.'),
+ zod
+ .object({
+ scope: zod.enum(['system']),
+ })
+ .describe(
+ 'System-owned property (no user or team owner).'
+ ),
+ ])
+ .describe(
+ 'Defines who owns a property - user-scoped, team-scoped, or system.'
+ ),
+ specific_entity_type: zod
+ .union([
+ zod.null(),
+ zod
+ .enum([
+ 'CALENDAR_EVENT',
+ 'CALL_RECORD',
+ 'CHANNEL',
+ 'CHAT',
+ 'COMPANY',
+ 'DOCUMENT',
+ 'PROJECT',
+ 'TASK',
+ 'THREAD',
+ 'USER',
+ ])
+ .describe(
+ 'Type of entity that can be referenced by entity properties.'
+ ),
+ ])
+ .optional(),
+ updated_at: zod.iso.datetime({}),
+ })
+ .describe(
+ 'Property definition model (service representation).'
+ ),
+ id: zod
+ .uuid()
+ .describe(
+ 'Globally unique id of the assignment attaching this property to an entity.'
+ ),
+ value: zod
+ .union([
+ zod.null(),
+ zod
+ .union([
+ zod
+ .object({
+ type: zod.enum(['Boolean']),
+ value: zod
+ .boolean()
+ .describe(
+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'
+ ),
+ })
+ .describe(
+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Number']),
+ value: zod
+ .number()
+ .describe(
+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'
+ ),
+ })
+ .describe(
+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['String']),
+ value: zod
+ .string()
+ .describe(
+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'
+ ),
+ })
+ .describe(
+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Date']),
+ value: zod.iso
+ .datetime({})
+ .describe(
+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'
+ ),
})
- .describe('User-scoped property.'),
+ .describe(
+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'
+ ),
zod
.object({
- scope: zod.enum(['team']),
- team_id: zod.uuid(),
+ type: zod.enum(['SelectOption']),
+ value: zod
+ .array(zod.uuid())
+ .describe(
+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'
+ ),
})
- .describe('Team-scoped property.'),
+ .describe(
+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'
+ ),
zod
.object({
- scope: zod.enum(['system']),
+ type: zod.enum(['EntityReference']),
+ value: zod
+ .array(
+ zod
+ .object({
+ entity_id: zod.string(),
+ entity_type: zod
+ .enum([
+ 'CALENDAR_EVENT',
+ 'CALL_RECORD',
+ 'CHANNEL',
+ 'CHAT',
+ 'COMPANY',
+ 'DOCUMENT',
+ 'PROJECT',
+ 'TASK',
+ 'THREAD',
+ 'USER',
+ ])
+ .describe(
+ 'Type of entity that can be referenced by entity properties.'
+ ),
+ specific_message_id: zod
+ .uuid()
+ .nullish()
+ .describe(
+ 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'
+ ),
+ })
+ .describe(
+ 'Entity reference for entity-type property values.'
+ )
+ )
+ .describe(
+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'
+ ),
})
.describe(
- 'System-owned property (no user or team owner).'
+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'
),
- ])
- .describe(
- 'Defines who owns a property - user-scoped, team-scoped, or system.'
- ),
- specific_entity_type: zod
- .union([
- zod.null(),
zod
- .enum([
- 'CALENDAR_EVENT',
- 'CALL_RECORD',
- 'CHANNEL',
- 'CHAT',
- 'COMPANY',
- 'DOCUMENT',
- 'PROJECT',
- 'TASK',
- 'THREAD',
- 'USER',
- ])
+ .object({
+ type: zod.enum(['Link']),
+ value: zod
+ .array(zod.string())
+ .describe(
+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'
+ ),
+ })
.describe(
- 'Type of entity that can be referenced by entity properties.'
+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'
),
])
- .optional(),
- updated_at: zod.iso.datetime({}),
- })
+ .describe(
+ 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'
+ ),
+ ])
+ .optional(),
+ })
+ .describe(
+ 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'
+ )
+ )
+ .describe('Properties attached to the entity.'),
+ })
+ .describe(
+ 'Property fields that can be flattened into property-bearing Soup items.'
+ ),
+ icalUid: zod
+ .string()
+ .describe('RFC 5545 UID used for source reconciliation.'),
+ id: zod.uuid().describe('Entity identifier.'),
+ isReadOnly: zod
+ .boolean()
+ .describe(
+ 'Whether the selected canonical source is read-only.'
+ ),
+ location: zod
+ .string()
+ .nullish()
+ .describe('Optional location label.'),
+ organizerEmail: zod
+ .string()
+ .nullish()
+ .describe('Organizer email.'),
+ organizerName: zod
+ .string()
+ .nullish()
+ .describe('Organizer display name.'),
+ ownerId: zod.string().describe('Owning Macro user.'),
+ status: zod.string().describe('Canonical status.'),
+ time: zod
+ .union([
+ zod
+ .object({
+ ends_at: zod.iso
+ .datetime({})
+ .describe('Exclusive end.'),
+ kind: zod.enum(['timed']),
+ starts_at: zod.iso
+ .datetime({})
+ .describe('Inclusive start.'),
+ time_zone: zod
+ .string()
+ .nullish()
+ .describe('Original IANA time zone.'),
+ })
+ .describe('Absolute timed event.'),
+ zod
+ .object({
+ end_date: zod.iso
+ .date()
+ .describe('Exclusive end date.'),
+ kind: zod.enum(['allDay']),
+ start_date: zod.iso
+ .date()
+ .describe('Inclusive start date.'),
+ })
+ .describe('All-day event with an exclusive end date.'),
+ ])
+ .describe('Timed or all-day calendar event span.'),
+ title: zod.string().describe('Display title.'),
+ transparency: zod
+ .string()
+ .describe('Availability transparency.'),
+ updatedAt: zod.iso
+ .datetime({})
+ .describe('Entity update timestamp.'),
+ visibility: zod.string().describe('Canonical visibility.'),
+ })
+ .describe('A canonical calendar event entity in Soup.'),
+ tag: zod.enum(['calendarEvent']),
+ })
+ .describe('Calendar event item.'),
+ zod
+ .object({
+ data: zod
+ .object({
+ properties: zod
+ .array(
+ zod
+ .object({
+ definition: zod
+ .object({
+ created_at: zod.iso.datetime({}),
+ data_type: zod
+ .enum([
+ 'BOOLEAN',
+ 'DATE',
+ 'NUMBER',
+ 'STRING',
+ 'SELECT_NUMBER',
+ 'SELECT_STRING',
+ 'TAG',
+ 'ENTITY',
+ 'LINK',
+ ])
.describe(
- 'Property definition model (service representation).'
+ 'Data type for property values, determining storage and validation.'
),
- id: zod
- .uuid()
+ display_name: zod.string(),
+ id: zod.uuid(),
+ is_metadata: zod
+ .boolean()
.describe(
- 'Globally unique id of the assignment attaching this property to an entity.'
+ 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'
),
- value: zod
+ is_multi_select: zod.boolean(),
+ is_system: zod
+ .boolean()
+ .describe(
+ 'Flag to indicate if this is a system property (stored in DB).'
+ ),
+ owner: zod
+ .union([
+ zod
+ .object({
+ scope: zod.enum(['user']),
+ user_id: zod.string(),
+ })
+ .describe('User-scoped property.'),
+ zod
+ .object({
+ scope: zod.enum(['team']),
+ team_id: zod.uuid(),
+ })
+ .describe('Team-scoped property.'),
+ zod
+ .object({
+ scope: zod.enum(['system']),
+ })
+ .describe(
+ 'System-owned property (no user or team owner).'
+ ),
+ ])
+ .describe(
+ 'Defines who owns a property - user-scoped, team-scoped, or system.'
+ ),
+ specific_entity_type: zod
+ .union([
+ zod.null(),
+ zod
+ .enum([
+ 'CALENDAR_EVENT',
+ 'CALL_RECORD',
+ 'CHANNEL',
+ 'CHAT',
+ 'COMPANY',
+ 'DOCUMENT',
+ 'PROJECT',
+ 'TASK',
+ 'THREAD',
+ 'USER',
+ ])
+ .describe(
+ 'Type of entity that can be referenced by entity properties.'
+ ),
+ ])
+ .optional(),
+ updated_at: zod.iso.datetime({}),
+ })
+ .describe(
+ 'Property definition model (service representation).'
+ ),
+ id: zod
+ .uuid()
+ .describe(
+ 'Globally unique id of the assignment attaching this property to an entity.'
+ ),
+ value: zod
+ .union([
+ zod.null(),
+ zod
.union([
- zod.null(),
zod
- .union([
- zod
- .object({
- type: zod.enum(['Boolean']),
- value: zod
- .boolean()
- .describe(
- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'
- ),
- })
+ .object({
+ type: zod.enum(['Boolean']),
+ value: zod
+ .boolean()
.describe(
'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'
),
- zod
- .object({
- type: zod.enum(['Number']),
- value: zod
- .number()
- .describe(
- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'
- ),
- })
+ })
+ .describe(
+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Number']),
+ value: zod
+ .number()
.describe(
'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'
),
- zod
- .object({
- type: zod.enum(['String']),
- value: zod
- .string()
- .describe(
- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'
- ),
- })
+ })
+ .describe(
+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['String']),
+ value: zod
+ .string()
.describe(
'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'
),
- zod
- .object({
- type: zod.enum(['Date']),
- value: zod.iso
- .datetime({})
- .describe(
- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'
- ),
- })
+ })
+ .describe(
+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Date']),
+ value: zod.iso
+ .datetime({})
.describe(
'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'
),
- zod
- .object({
- type: zod.enum(['SelectOption']),
- value: zod
- .array(zod.uuid())
- .describe(
- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'
- ),
- })
+ })
+ .describe(
+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['SelectOption']),
+ value: zod
+ .array(zod.uuid())
.describe(
'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'
),
- zod
- .object({
- type: zod.enum(['EntityReference']),
- value: zod
- .array(
- zod
- .object({
- entity_id: zod.string(),
- entity_type: zod
- .enum([
- 'CALENDAR_EVENT',
- 'CALL_RECORD',
- 'CHANNEL',
- 'CHAT',
- 'COMPANY',
- 'DOCUMENT',
- 'PROJECT',
- 'TASK',
- 'THREAD',
- 'USER',
- ])
- .describe(
- 'Type of entity that can be referenced by entity properties.'
- ),
- specific_message_id: zod
- .uuid()
- .nullish()
- .describe(
- 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'
- ),
- })
+ })
+ .describe(
+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'
+ ),
+ zod
+ .object({
+ type: zod.enum(['EntityReference']),
+ value: zod
+ .array(
+ zod
+ .object({
+ entity_id: zod.string(),
+ entity_type: zod
+ .enum([
+ 'CALENDAR_EVENT',
+ 'CALL_RECORD',
+ 'CHANNEL',
+ 'CHAT',
+ 'COMPANY',
+ 'DOCUMENT',
+ 'PROJECT',
+ 'TASK',
+ 'THREAD',
+ 'USER',
+ ])
.describe(
- 'Entity reference for entity-type property values.'
- )
- )
+ 'Type of entity that can be referenced by entity properties.'
+ ),
+ specific_message_id: zod
+ .uuid()
+ .nullish()
+ .describe(
+ 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'
+ ),
+ })
.describe(
- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'
- ),
- })
+ 'Entity reference for entity-type property values.'
+ )
+ )
.describe(
'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'
),
- zod
- .object({
- type: zod.enum(['Link']),
- value: zod
- .array(zod.string())
- .describe(
- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'
- ),
- })
+ })
+ .describe(
+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Link']),
+ value: zod
+ .array(zod.string())
.describe(
'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'
),
- ])
+ })
.describe(
- 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'
+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'
),
])
- .optional(),
- })
- .describe(
- 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'
- )
+ .describe(
+ 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'
+ ),
+ ])
+ .optional(),
+ })
+ .describe(
+ 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'
)
- .describe('Properties attached to the entity.'),
- })
+ )
+ .describe('Properties attached to the entity.'),
+ })
+ .describe(
+ 'Property fields that can be flattened into property-bearing Soup items.'
+ )
+ .and(
+ zod.object({
+ createdAt: zod.iso
+ .datetime({})
+ .describe('When the company was created.'),
+ description: zod
+ .string()
+ .nullish()
+ .describe(
+ "Display description from the primary domain's directory entry."
+ ),
+ domains: zod
+ .array(
+ zod
+ .object({
+ companyId: zod
+ .uuid()
+ .describe(
+ 'The id of the company the domain belongs to.'
+ ),
+ createdAt: zod.iso
+ .datetime({})
+ .describe('When the domain record was created.'),
+ domain: zod
+ .string()
+ .describe(
+ 'The domain (lowercased, e.g. \"acme.com\").'
+ ),
+ id: zod
+ .uuid()
+ .describe('The id of the domain record.'),
+ })
+ .describe(
+ "A CRM domain as displayed in Soup. Mirrors the crm crate's\n[`CrmDomain`] with a stable wire shape that the FE can rely on."
+ )
+ )
+ .describe(
+ 'Domains associated with this company, ordered by creation time\nascending (primary first).'
+ ),
+ emailSync: zod
+ .boolean()
+ .describe(
+ 'Whether email sync is enabled for this company.'
+ ),
+ hidden: zod
+ .boolean()
+ .describe(
+ 'Whether the company is hidden from CRM listings. Soup filters\nthese out by default.'
+ ),
+ id: zod.uuid().describe('The id of the company.'),
+ name: zod
+ .string()
+ .nullish()
+ .describe(
+ "Display name from the primary domain's directory entry, or\n`None` when unresolved."
+ ),
+ teamId: zod
+ .uuid()
+ .describe(
+ 'The id of the team that owns this company record.'
+ ),
+ updatedAt: zod.iso
+ .datetime({})
+ .describe('When the company was last updated.'),
+ viewedAt: zod.iso
+ .datetime({})
+ .nullish()
+ .describe(
+ 'When the requesting user last viewed this company, or `None` if\nnever viewed. Mirrors the `viewed_at` other soup entities carry.'
+ ),
+ })
+ )
+ .describe(
+ 'A CRM company as displayed in Soup. Carries the core company\nfields plus display metadata resolved from `crm_domain_directory`\nagainst the primary (earliest-created) domain.'
+ ),
+ tag: zod.enum(['crmCompany']),
+ })
+ .describe('CRM company item.'),
+ zod
+ .object({
+ data: zod
+ .object({
+ createdAt: zod.iso
+ .datetime({})
+ .describe('Timestamp when the record was created.'),
+ foreignEntityId: zod
+ .string()
+ .describe('Identifier assigned by the external system.'),
+ foreignEntitySource: zod
+ .string()
.describe(
- 'Property fields that can be flattened into property-bearing Soup items.'
+ 'Source system that owns the external identifier.'
),
- icalUid: zod
- .string()
- .describe('RFC 5545 UID used for source reconciliation.'),
- id: zod.uuid().describe('Entity identifier.'),
- isReadOnly: zod
- .boolean()
+ id: zod
+ .uuid()
.describe(
- 'Whether the selected canonical source is read-only.'
+ 'Internal primary key for this foreign entity record.'
),
- location: zod
- .string()
- .nullish()
- .describe('Optional location label.'),
- organizerEmail: zod
- .string()
- .nullish()
- .describe('Organizer email.'),
- organizerName: zod
+ metadata: zod
+ .object({})
+ .describe('Arbitrary metadata stored with the mapping.'),
+ storedForAuthEntity: zod
.string()
- .nullish()
- .describe('Organizer display name.'),
- ownerId: zod.string().describe('Owning Macro user.'),
- status: zod.string().describe('Canonical status.'),
- time: zod
- .union([
- zod
- .object({
- ends_at: zod.iso
- .datetime({})
- .describe('Exclusive end.'),
- kind: zod.enum(['timed']),
- starts_at: zod.iso
- .datetime({})
- .describe('Inclusive start.'),
- time_zone: zod
- .string()
- .nullish()
- .describe('Original IANA time zone.'),
- })
- .describe('Absolute timed event.'),
- zod
- .object({
- end_date: zod.iso
- .date()
- .describe('Exclusive end date.'),
- kind: zod.enum(['allDay']),
- start_date: zod.iso
- .date()
- .describe('Inclusive start date.'),
- })
- .describe('All-day event with an exclusive end date.'),
- ])
- .describe('Timed or all-day calendar event span.'),
- title: zod.string().describe('Display title.'),
- transparency: zod
+ .describe(
+ 'Internal auth entity namespace this foreign entity is stored for.'
+ ),
+ storedForId: zod
.string()
- .describe('Availability transparency.'),
+ .describe(
+ 'Internal entity identifier this foreign entity is stored for.'
+ ),
updatedAt: zod.iso
.datetime({})
- .describe('Entity update timestamp.'),
- visibility: zod.string().describe('Canonical visibility.'),
+ .describe('Timestamp when the record was last updated.'),
})
- .describe('A canonical calendar event entity in Soup.'),
- tag: zod.enum(['calendarEvent']),
+ .describe('A foreign entity record as displayed in Soup.'),
+ tag: zod.enum(['foreignEntity']),
})
- .describe('Calendar event item.'),
+ .describe('Foreign entity item.'),
zod
.object({
data: zod
@@ -16187,123 +17257,117 @@ export const postItemsSoupAstResponse = zod
)
.and(
zod.object({
+ completedAt: zod.iso
+ .datetime({})
+ .nullish()
+ .describe('Set once a one-shot reminder has fired.'),
createdAt: zod.iso
.datetime({})
- .describe('When the company was created.'),
+ .describe('When the reminder was created.'),
description: zod
.string()
- .nullish()
- .describe(
- "Display description from the primary domain's directory entry."
- ),
- domains: zod
- .array(
- zod
- .object({
- companyId: zod
- .uuid()
- .describe(
- 'The id of the company the domain belongs to.'
- ),
- createdAt: zod.iso
- .datetime({})
- .describe('When the domain record was created.'),
- domain: zod
- .string()
- .describe(
- 'The domain (lowercased, e.g. \"acme.com\").'
- ),
- id: zod
- .uuid()
- .describe('The id of the domain record.'),
- })
- .describe(
- "A CRM domain as displayed in Soup. Mirrors the crm crate's\n[`CrmDomain`] with a stable wire shape that the FE can rely on."
- )
- )
- .describe(
- 'Domains associated with this company, ordered by creation time\nascending (primary first).'
- ),
- emailSync: zod
- .boolean()
.describe(
- 'Whether email sync is enabled for this company.'
+ 'What to remind the user about. Doubles as the display name.'
),
- hidden: zod
+ enabled: zod
.boolean()
.describe(
- 'Whether the company is hidden from CRM listings. Soup filters\nthese out by default.'
- ),
- id: zod.uuid().describe('The id of the company.'),
- name: zod
- .string()
- .nullish()
- .describe(
- "Display name from the primary domain's directory entry, or\n`None` when unresolved."
- ),
- teamId: zod
- .uuid()
- .describe(
- 'The id of the team that owns this company record.'
+ 'When false, the dispatcher skips this reminder.'
),
- updatedAt: zod.iso
+ id: zod.uuid().describe('The reminder id.'),
+ nextRunAt: zod.iso
.datetime({})
- .describe('When the company was last updated.'),
- viewedAt: zod.iso
- .datetime({})
- .nullish()
.describe(
- 'When the requesting user last viewed this company, or `None` if\nnever viewed. Mirrors the `viewed_at` other soup entities carry.'
+ 'The next firing. This is what Soup sorts reminders on.'
),
- })
- )
- .describe(
- 'A CRM company as displayed in Soup. Carries the core company\nfields plus display metadata resolved from `crm_domain_directory`\nagainst the primary (earliest-created) domain.'
- ),
- tag: zod.enum(['crmCompany']),
- })
- .describe('CRM company item.'),
- zod
- .object({
- data: zod
- .object({
- createdAt: zod.iso
- .datetime({})
- .describe('Timestamp when the record was created.'),
- foreignEntityId: zod
- .string()
- .describe('Identifier assigned by the external system.'),
- foreignEntitySource: zod
- .string()
- .describe(
- 'Source system that owns the external identifier.'
- ),
- id: zod
- .uuid()
- .describe(
- 'Internal primary key for this foreign entity record.'
- ),
- metadata: zod
- .object({})
- .describe('Arbitrary metadata stored with the mapping.'),
- storedForAuthEntity: zod
- .string()
- .describe(
- 'Internal auth entity namespace this foreign entity is stored for.'
- ),
- storedForId: zod
- .string()
- .describe(
- 'Internal entity identifier this foreign entity is stored for.'
- ),
- updatedAt: zod.iso
- .datetime({})
- .describe('Timestamp when the record was last updated.'),
- })
- .describe('A foreign entity record as displayed in Soup.'),
- tag: zod.enum(['foreignEntity']),
+ referencedEntity: zod
+ .union([
+ zod.null(),
+ zod
+ .object({
+ entityType: zod
+ .enum([
+ 'user',
+ 'chat',
+ 'channel',
+ 'channel_message',
+ 'document',
+ 'project',
+ 'email_thread',
+ 'calendar_event',
+ 'team',
+ 'call',
+ 'foreign_entity',
+ 'static_file',
+ 'crm_company',
+ 'crm_contact',
+ 'reminder',
+ ])
+ .describe('The type of an entity in Macro')
+ .describe("The referenced entity's type."),
+ fileType: zod
+ .string()
+ .nullish()
+ .describe(
+ 'File type, when the reference is a document — `md`, `pdf`, and so on.'
+ ),
+ id: zod
+ .string()
+ .describe("The referenced entity's id."),
+ subType: zod
+ .string()
+ .nullish()
+ .describe(
+ 'Sub type, when the reference is a task or snippet document.'
+ ),
+ })
+ .describe(
+ "The entity a reminder is about, resolved server-side.\n\nA reminder has no block of its own — it opens, and is iconed as, whatever it\nreferences. Which block that is depends on the referenced document's file\ntype, and the client's icon path is synchronous, so this is resolved here\nrather than costing a fetch per row."
+ ),
+ ])
+ .optional(),
+ schedule: zod
+ .union([
+ zod
+ .object({
+ remindAt: zod.iso
+ .datetime({})
+ .describe('The instant to fire at.'),
+ type: zod.enum(['once']),
+ })
+ .describe('Fires once, at a fixed instant.'),
+ zod
+ .object({
+ cron: zod
+ .string()
+ .describe(
+ 'Cron expression, normalized to the 6-field form.'
+ ),
+ timezone: zod
+ .string()
+ .describe(
+ 'The timezone the cron expression is evaluated in.'
+ ),
+ type: zod.enum(['recurring']),
+ })
+ .describe(
+ 'Fires repeatedly, on a cron schedule evaluated in `timezone`.'
+ ),
+ ])
+ .describe(
+ 'How often a reminder fires, flattened for the wire.\n\nThe domain\'s [`ReminderSchedule`] is an internally-tagged enum carrying a\nvalidated cron type; Soup only needs enough to render \"once\" vs \"every\nweekday at 9am\", so the cron is exposed as a plain string.'
+ ),
+ updatedAt: zod.iso
+ .datetime({})
+ .describe('When the reminder was last modified.'),
+ })
+ )
+ .describe(
+ "A reminder as displayed in Soup.\n\nReminders are user-owned rather than shared, so unlike most Soup items they\ncarry no access metadata — the repository only ever returns the caller's own."
+ ),
+ tag: zod.enum(['reminder']),
})
- .describe('Foreign entity item.'),
+ .describe('Reminder item.'),
])
.describe('A single item in the Soup feed.')
.and(
@@ -16405,6 +17469,12 @@ export const postItemsSoupAstGroupedBody = zod
.describe(
'the filters that should be applied based on entity properties'
),
+ remf: zod
+ .unknown()
+ .optional()
+ .describe(
+ 'Filters applied to reminders (wire key `remf`). Unlike every other\nfilter here, empty\/omitted returns \*\*no\*\* reminders: they are opt-in,\nso the caller must send `inc`, an id, or an entity to get any.'
+ ),
})
.describe('Wire-format entity filter AST accepted by soup AST endpoints.')
.and(
@@ -16561,6 +17631,12 @@ export const postItemsSoupAstGroupedBody = zod
.describe(
'the filters that should be applied based on entity properties'
),
+ remf: zod
+ .unknown()
+ .optional()
+ .describe(
+ 'Filters applied to reminders (wire key `remf`). Unlike every other\nfilter here, empty\/omitted returns \*\*no\*\* reminders: they are opt-in,\nso the caller must send `inc`, an id, or an entity to get any.'
+ ),
})
.describe('Wire-format entity filter AST accepted by soup AST endpoints.')
.and(
@@ -18805,224 +19881,583 @@ export const postItemsSoupAstGroupedResponse = zod
updated_at: zod.iso.datetime({}),
})
.describe(
- 'Property definition model (service representation).'
+ 'Property definition model (service representation).'
+ ),
+ id: zod
+ .uuid()
+ .describe(
+ 'Globally unique id of the assignment attaching this property to an entity.'
+ ),
+ value: zod
+ .union([
+ zod.null(),
+ zod
+ .union([
+ zod
+ .object({
+ type: zod.enum(['Boolean']),
+ value: zod
+ .boolean()
+ .describe(
+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'
+ ),
+ })
+ .describe(
+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Number']),
+ value: zod
+ .number()
+ .describe(
+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'
+ ),
+ })
+ .describe(
+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['String']),
+ value: zod
+ .string()
+ .describe(
+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'
+ ),
+ })
+ .describe(
+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Date']),
+ value: zod.iso
+ .datetime({})
+ .describe(
+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'
+ ),
+ })
+ .describe(
+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'
+ ),
+ zod
+ .object({
+ type: zod.enum([
+ 'SelectOption',
+ ]),
+ value: zod
+ .array(zod.uuid())
+ .describe(
+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'
+ ),
+ })
+ .describe(
+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'
+ ),
+ zod
+ .object({
+ type: zod.enum([
+ 'EntityReference',
+ ]),
+ value: zod
+ .array(
+ zod
+ .object({
+ entity_id: zod.string(),
+ entity_type: zod
+ .enum([
+ 'CALENDAR_EVENT',
+ 'CALL_RECORD',
+ 'CHANNEL',
+ 'CHAT',
+ 'COMPANY',
+ 'DOCUMENT',
+ 'PROJECT',
+ 'TASK',
+ 'THREAD',
+ 'USER',
+ ])
+ .describe(
+ 'Type of entity that can be referenced by entity properties.'
+ ),
+ specific_message_id: zod
+ .uuid()
+ .nullish()
+ .describe(
+ 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'
+ ),
+ })
+ .describe(
+ 'Entity reference for entity-type property values.'
+ )
+ )
+ .describe(
+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'
+ ),
+ })
+ .describe(
+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Link']),
+ value: zod
+ .array(zod.string())
+ .describe(
+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'
+ ),
+ })
+ .describe(
+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'
+ ),
+ ])
+ .describe(
+ 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'
+ ),
+ ])
+ .optional(),
+ })
+ .describe(
+ 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'
+ )
+ )
+ .describe('Properties attached to the entity.'),
+ })
+ .describe(
+ 'Property fields that can be flattened into property-bearing Soup items.'
+ ),
+ icalUid: zod
+ .string()
+ .describe(
+ 'RFC 5545 UID used for source reconciliation.'
+ ),
+ id: zod.uuid().describe('Entity identifier.'),
+ isReadOnly: zod
+ .boolean()
+ .describe(
+ 'Whether the selected canonical source is read-only.'
+ ),
+ location: zod
+ .string()
+ .nullish()
+ .describe('Optional location label.'),
+ organizerEmail: zod
+ .string()
+ .nullish()
+ .describe('Organizer email.'),
+ organizerName: zod
+ .string()
+ .nullish()
+ .describe('Organizer display name.'),
+ ownerId: zod.string().describe('Owning Macro user.'),
+ status: zod.string().describe('Canonical status.'),
+ time: zod
+ .union([
+ zod
+ .object({
+ ends_at: zod.iso
+ .datetime({})
+ .describe('Exclusive end.'),
+ kind: zod.enum(['timed']),
+ starts_at: zod.iso
+ .datetime({})
+ .describe('Inclusive start.'),
+ time_zone: zod
+ .string()
+ .nullish()
+ .describe('Original IANA time zone.'),
+ })
+ .describe('Absolute timed event.'),
+ zod
+ .object({
+ end_date: zod.iso
+ .date()
+ .describe('Exclusive end date.'),
+ kind: zod.enum(['allDay']),
+ start_date: zod.iso
+ .date()
+ .describe('Inclusive start date.'),
+ })
+ .describe(
+ 'All-day event with an exclusive end date.'
+ ),
+ ])
+ .describe('Timed or all-day calendar event span.'),
+ title: zod.string().describe('Display title.'),
+ transparency: zod
+ .string()
+ .describe('Availability transparency.'),
+ updatedAt: zod.iso
+ .datetime({})
+ .describe('Entity update timestamp.'),
+ visibility: zod
+ .string()
+ .describe('Canonical visibility.'),
+ })
+ .describe('A canonical calendar event entity in Soup.'),
+ tag: zod.enum(['calendarEvent']),
+ })
+ .describe('Calendar event item.'),
+ zod
+ .object({
+ data: zod
+ .object({
+ properties: zod
+ .array(
+ zod
+ .object({
+ definition: zod
+ .object({
+ created_at: zod.iso.datetime({}),
+ data_type: zod
+ .enum([
+ 'BOOLEAN',
+ 'DATE',
+ 'NUMBER',
+ 'STRING',
+ 'SELECT_NUMBER',
+ 'SELECT_STRING',
+ 'TAG',
+ 'ENTITY',
+ 'LINK',
+ ])
+ .describe(
+ 'Data type for property values, determining storage and validation.'
),
- id: zod
- .uuid()
+ display_name: zod.string(),
+ id: zod.uuid(),
+ is_metadata: zod
+ .boolean()
.describe(
- 'Globally unique id of the assignment attaching this property to an entity.'
+ 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'
),
- value: zod
+ is_multi_select: zod.boolean(),
+ is_system: zod
+ .boolean()
+ .describe(
+ 'Flag to indicate if this is a system property (stored in DB).'
+ ),
+ owner: zod
+ .union([
+ zod
+ .object({
+ scope: zod.enum(['user']),
+ user_id: zod.string(),
+ })
+ .describe('User-scoped property.'),
+ zod
+ .object({
+ scope: zod.enum(['team']),
+ team_id: zod.uuid(),
+ })
+ .describe('Team-scoped property.'),
+ zod
+ .object({
+ scope: zod.enum(['system']),
+ })
+ .describe(
+ 'System-owned property (no user or team owner).'
+ ),
+ ])
+ .describe(
+ 'Defines who owns a property - user-scoped, team-scoped, or system.'
+ ),
+ specific_entity_type: zod
.union([
zod.null(),
zod
- .union([
- zod
- .object({
- type: zod.enum(['Boolean']),
- value: zod
- .boolean()
- .describe(
- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'
- ),
- })
+ .enum([
+ 'CALENDAR_EVENT',
+ 'CALL_RECORD',
+ 'CHANNEL',
+ 'CHAT',
+ 'COMPANY',
+ 'DOCUMENT',
+ 'PROJECT',
+ 'TASK',
+ 'THREAD',
+ 'USER',
+ ])
+ .describe(
+ 'Type of entity that can be referenced by entity properties.'
+ ),
+ ])
+ .optional(),
+ updated_at: zod.iso.datetime({}),
+ })
+ .describe(
+ 'Property definition model (service representation).'
+ ),
+ id: zod
+ .uuid()
+ .describe(
+ 'Globally unique id of the assignment attaching this property to an entity.'
+ ),
+ value: zod
+ .union([
+ zod.null(),
+ zod
+ .union([
+ zod
+ .object({
+ type: zod.enum(['Boolean']),
+ value: zod
+ .boolean()
.describe(
'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'
),
- zod
- .object({
- type: zod.enum(['Number']),
- value: zod
- .number()
- .describe(
- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'
- ),
- })
+ })
+ .describe(
+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Number']),
+ value: zod
+ .number()
.describe(
'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'
),
- zod
- .object({
- type: zod.enum(['String']),
- value: zod
- .string()
- .describe(
- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'
- ),
- })
+ })
+ .describe(
+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['String']),
+ value: zod
+ .string()
.describe(
'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'
),
- zod
- .object({
- type: zod.enum(['Date']),
- value: zod.iso
- .datetime({})
- .describe(
- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'
- ),
- })
+ })
+ .describe(
+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Date']),
+ value: zod.iso
+ .datetime({})
.describe(
'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'
),
- zod
- .object({
- type: zod.enum([
- 'SelectOption',
- ]),
- value: zod
- .array(zod.uuid())
- .describe(
- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'
- ),
- })
+ })
+ .describe(
+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['SelectOption']),
+ value: zod
+ .array(zod.uuid())
.describe(
'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'
),
- zod
- .object({
- type: zod.enum([
- 'EntityReference',
- ]),
- value: zod
- .array(
- zod
- .object({
- entity_id: zod.string(),
- entity_type: zod
- .enum([
- 'CALENDAR_EVENT',
- 'CALL_RECORD',
- 'CHANNEL',
- 'CHAT',
- 'COMPANY',
- 'DOCUMENT',
- 'PROJECT',
- 'TASK',
- 'THREAD',
- 'USER',
- ])
- .describe(
- 'Type of entity that can be referenced by entity properties.'
- ),
- specific_message_id: zod
- .uuid()
- .nullish()
- .describe(
- 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'
- ),
- })
+ })
+ .describe(
+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'
+ ),
+ zod
+ .object({
+ type: zod.enum(['EntityReference']),
+ value: zod
+ .array(
+ zod
+ .object({
+ entity_id: zod.string(),
+ entity_type: zod
+ .enum([
+ 'CALENDAR_EVENT',
+ 'CALL_RECORD',
+ 'CHANNEL',
+ 'CHAT',
+ 'COMPANY',
+ 'DOCUMENT',
+ 'PROJECT',
+ 'TASK',
+ 'THREAD',
+ 'USER',
+ ])
+ .describe(
+ 'Type of entity that can be referenced by entity properties.'
+ ),
+ specific_message_id: zod
+ .uuid()
+ .nullish()
.describe(
- 'Entity reference for entity-type property values.'
- )
- )
+ 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'
+ ),
+ })
.describe(
- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'
- ),
- })
+ 'Entity reference for entity-type property values.'
+ )
+ )
.describe(
'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'
),
- zod
- .object({
- type: zod.enum(['Link']),
- value: zod
- .array(zod.string())
- .describe(
- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'
- ),
- })
+ })
+ .describe(
+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Link']),
+ value: zod
+ .array(zod.string())
.describe(
'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'
),
- ])
+ })
.describe(
- 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'
+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'
),
])
- .optional(),
- })
- .describe(
- 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'
- )
+ .describe(
+ 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'
+ ),
+ ])
+ .optional(),
+ })
+ .describe(
+ 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'
)
- .describe('Properties attached to the entity.'),
- })
+ )
+ .describe('Properties attached to the entity.'),
+ })
+ .describe(
+ 'Property fields that can be flattened into property-bearing Soup items.'
+ )
+ .and(
+ zod.object({
+ createdAt: zod.iso
+ .datetime({})
+ .describe('When the company was created.'),
+ description: zod
+ .string()
+ .nullish()
+ .describe(
+ "Display description from the primary domain's directory entry."
+ ),
+ domains: zod
+ .array(
+ zod
+ .object({
+ companyId: zod
+ .uuid()
+ .describe(
+ 'The id of the company the domain belongs to.'
+ ),
+ createdAt: zod.iso
+ .datetime({})
+ .describe(
+ 'When the domain record was created.'
+ ),
+ domain: zod
+ .string()
+ .describe(
+ 'The domain (lowercased, e.g. \"acme.com\").'
+ ),
+ id: zod
+ .uuid()
+ .describe('The id of the domain record.'),
+ })
+ .describe(
+ "A CRM domain as displayed in Soup. Mirrors the crm crate's\n[`CrmDomain`] with a stable wire shape that the FE can rely on."
+ )
+ )
+ .describe(
+ 'Domains associated with this company, ordered by creation time\nascending (primary first).'
+ ),
+ emailSync: zod
+ .boolean()
+ .describe(
+ 'Whether email sync is enabled for this company.'
+ ),
+ hidden: zod
+ .boolean()
+ .describe(
+ 'Whether the company is hidden from CRM listings. Soup filters\nthese out by default.'
+ ),
+ id: zod.uuid().describe('The id of the company.'),
+ name: zod
+ .string()
+ .nullish()
+ .describe(
+ "Display name from the primary domain's directory entry, or\n`None` when unresolved."
+ ),
+ teamId: zod
+ .uuid()
+ .describe(
+ 'The id of the team that owns this company record.'
+ ),
+ updatedAt: zod.iso
+ .datetime({})
+ .describe('When the company was last updated.'),
+ viewedAt: zod.iso
+ .datetime({})
+ .nullish()
+ .describe(
+ 'When the requesting user last viewed this company, or `None` if\nnever viewed. Mirrors the `viewed_at` other soup entities carry.'
+ ),
+ })
+ )
+ .describe(
+ 'A CRM company as displayed in Soup. Carries the core company\nfields plus display metadata resolved from `crm_domain_directory`\nagainst the primary (earliest-created) domain.'
+ ),
+ tag: zod.enum(['crmCompany']),
+ })
+ .describe('CRM company item.'),
+ zod
+ .object({
+ data: zod
+ .object({
+ createdAt: zod.iso
+ .datetime({})
+ .describe('Timestamp when the record was created.'),
+ foreignEntityId: zod
+ .string()
.describe(
- 'Property fields that can be flattened into property-bearing Soup items.'
+ 'Identifier assigned by the external system.'
),
- icalUid: zod
+ foreignEntitySource: zod
.string()
.describe(
- 'RFC 5545 UID used for source reconciliation.'
+ 'Source system that owns the external identifier.'
),
- id: zod.uuid().describe('Entity identifier.'),
- isReadOnly: zod
- .boolean()
+ id: zod
+ .uuid()
.describe(
- 'Whether the selected canonical source is read-only.'
+ 'Internal primary key for this foreign entity record.'
),
- location: zod
- .string()
- .nullish()
- .describe('Optional location label.'),
- organizerEmail: zod
- .string()
- .nullish()
- .describe('Organizer email.'),
- organizerName: zod
+ metadata: zod
+ .object({})
+ .describe(
+ 'Arbitrary metadata stored with the mapping.'
+ ),
+ storedForAuthEntity: zod
.string()
- .nullish()
- .describe('Organizer display name.'),
- ownerId: zod.string().describe('Owning Macro user.'),
- status: zod.string().describe('Canonical status.'),
- time: zod
- .union([
- zod
- .object({
- ends_at: zod.iso
- .datetime({})
- .describe('Exclusive end.'),
- kind: zod.enum(['timed']),
- starts_at: zod.iso
- .datetime({})
- .describe('Inclusive start.'),
- time_zone: zod
- .string()
- .nullish()
- .describe('Original IANA time zone.'),
- })
- .describe('Absolute timed event.'),
- zod
- .object({
- end_date: zod.iso
- .date()
- .describe('Exclusive end date.'),
- kind: zod.enum(['allDay']),
- start_date: zod.iso
- .date()
- .describe('Inclusive start date.'),
- })
- .describe(
- 'All-day event with an exclusive end date.'
- ),
- ])
- .describe('Timed or all-day calendar event span.'),
- title: zod.string().describe('Display title.'),
- transparency: zod
+ .describe(
+ 'Internal auth entity namespace this foreign entity is stored for.'
+ ),
+ storedForId: zod
.string()
- .describe('Availability transparency.'),
+ .describe(
+ 'Internal entity identifier this foreign entity is stored for.'
+ ),
updatedAt: zod.iso
.datetime({})
- .describe('Entity update timestamp.'),
- visibility: zod
- .string()
- .describe('Canonical visibility.'),
+ .describe(
+ 'Timestamp when the record was last updated.'
+ ),
})
- .describe('A canonical calendar event entity in Soup.'),
- tag: zod.enum(['calendarEvent']),
+ .describe(
+ 'A foreign entity record as displayed in Soup.'
+ ),
+ tag: zod.enum(['foreignEntity']),
})
- .describe('Calendar event item.'),
+ .describe('Foreign entity item.'),
zod
.object({
data: zod
@@ -19255,133 +20690,119 @@ export const postItemsSoupAstGroupedResponse = zod
)
.and(
zod.object({
+ completedAt: zod.iso
+ .datetime({})
+ .nullish()
+ .describe(
+ 'Set once a one-shot reminder has fired.'
+ ),
createdAt: zod.iso
.datetime({})
- .describe('When the company was created.'),
+ .describe('When the reminder was created.'),
description: zod
.string()
- .nullish()
.describe(
- "Display description from the primary domain's directory entry."
+ 'What to remind the user about. Doubles as the display name.'
),
- domains: zod
- .array(
+ enabled: zod
+ .boolean()
+ .describe(
+ 'When false, the dispatcher skips this reminder.'
+ ),
+ id: zod.uuid().describe('The reminder id.'),
+ nextRunAt: zod.iso
+ .datetime({})
+ .describe(
+ 'The next firing. This is what Soup sorts reminders on.'
+ ),
+ referencedEntity: zod
+ .union([
+ zod.null(),
zod
.object({
- companyId: zod
- .uuid()
+ entityType: zod
+ .enum([
+ 'user',
+ 'chat',
+ 'channel',
+ 'channel_message',
+ 'document',
+ 'project',
+ 'email_thread',
+ 'calendar_event',
+ 'team',
+ 'call',
+ 'foreign_entity',
+ 'static_file',
+ 'crm_company',
+ 'crm_contact',
+ 'reminder',
+ ])
+ .describe('The type of an entity in Macro')
+ .describe("The referenced entity's type."),
+ fileType: zod
+ .string()
+ .nullish()
.describe(
- 'The id of the company the domain belongs to.'
+ 'File type, when the reference is a document — `md`, `pdf`, and so on.'
),
- createdAt: zod.iso
+ id: zod
+ .string()
+ .describe("The referenced entity's id."),
+ subType: zod
+ .string()
+ .nullish()
+ .describe(
+ 'Sub type, when the reference is a task or snippet document.'
+ ),
+ })
+ .describe(
+ "The entity a reminder is about, resolved server-side.\n\nA reminder has no block of its own — it opens, and is iconed as, whatever it\nreferences. Which block that is depends on the referenced document's file\ntype, and the client's icon path is synchronous, so this is resolved here\nrather than costing a fetch per row."
+ ),
+ ])
+ .optional(),
+ schedule: zod
+ .union([
+ zod
+ .object({
+ remindAt: zod.iso
.datetime({})
+ .describe('The instant to fire at.'),
+ type: zod.enum(['once']),
+ })
+ .describe('Fires once, at a fixed instant.'),
+ zod
+ .object({
+ cron: zod
+ .string()
.describe(
- 'When the domain record was created.'
+ 'Cron expression, normalized to the 6-field form.'
),
- domain: zod
+ timezone: zod
.string()
.describe(
- 'The domain (lowercased, e.g. \"acme.com\").'
+ 'The timezone the cron expression is evaluated in.'
),
- id: zod
- .uuid()
- .describe('The id of the domain record.'),
+ type: zod.enum(['recurring']),
})
.describe(
- "A CRM domain as displayed in Soup. Mirrors the crm crate's\n[`CrmDomain`] with a stable wire shape that the FE can rely on."
- )
- )
- .describe(
- 'Domains associated with this company, ordered by creation time\nascending (primary first).'
- ),
- emailSync: zod
- .boolean()
- .describe(
- 'Whether email sync is enabled for this company.'
- ),
- hidden: zod
- .boolean()
- .describe(
- 'Whether the company is hidden from CRM listings. Soup filters\nthese out by default.'
- ),
- id: zod.uuid().describe('The id of the company.'),
- name: zod
- .string()
- .nullish()
- .describe(
- "Display name from the primary domain's directory entry, or\n`None` when unresolved."
- ),
- teamId: zod
- .uuid()
+ 'Fires repeatedly, on a cron schedule evaluated in `timezone`.'
+ ),
+ ])
.describe(
- 'The id of the team that owns this company record.'
+ 'How often a reminder fires, flattened for the wire.\n\nThe domain\'s [`ReminderSchedule`] is an internally-tagged enum carrying a\nvalidated cron type; Soup only needs enough to render \"once\" vs \"every\nweekday at 9am\", so the cron is exposed as a plain string.'
),
updatedAt: zod.iso
.datetime({})
- .describe('When the company was last updated.'),
- viewedAt: zod.iso
- .datetime({})
- .nullish()
- .describe(
- 'When the requesting user last viewed this company, or `None` if\nnever viewed. Mirrors the `viewed_at` other soup entities carry.'
- ),
+ .describe('When the reminder was last modified.'),
})
)
.describe(
- 'A CRM company as displayed in Soup. Carries the core company\nfields plus display metadata resolved from `crm_domain_directory`\nagainst the primary (earliest-created) domain.'
- ),
- tag: zod.enum(['crmCompany']),
- })
- .describe('CRM company item.'),
- zod
- .object({
- data: zod
- .object({
- createdAt: zod.iso
- .datetime({})
- .describe('Timestamp when the record was created.'),
- foreignEntityId: zod
- .string()
- .describe(
- 'Identifier assigned by the external system.'
- ),
- foreignEntitySource: zod
- .string()
- .describe(
- 'Source system that owns the external identifier.'
- ),
- id: zod
- .uuid()
- .describe(
- 'Internal primary key for this foreign entity record.'
- ),
- metadata: zod
- .object({})
- .describe(
- 'Arbitrary metadata stored with the mapping.'
- ),
- storedForAuthEntity: zod
- .string()
- .describe(
- 'Internal auth entity namespace this foreign entity is stored for.'
- ),
- storedForId: zod
- .string()
- .describe(
- 'Internal entity identifier this foreign entity is stored for.'
- ),
- updatedAt: zod.iso
- .datetime({})
- .describe(
- 'Timestamp when the record was last updated.'
- ),
- })
- .describe(
- 'A foreign entity record as displayed in Soup.'
+ "A reminder as displayed in Soup.\n\nReminders are user-owned rather than shared, so unlike most Soup items they\ncarry no access metadata — the repository only ever returns the caller's own."
),
- tag: zod.enum(['foreignEntity']),
+ tag: zod.enum(['reminder']),
})
- .describe('Foreign entity item.'),
+ .describe('Reminder item.'),
])
.describe('A single item in the Soup feed.')
.and(
@@ -21510,261 +22931,620 @@ export const postItemsSoupAstGroupedResponse = zod
team_id: zod.uuid(),
})
.describe(
- 'Team-scoped property.'
+ 'Team-scoped property.'
+ ),
+ zod
+ .object({
+ scope: zod.enum(['system']),
+ })
+ .describe(
+ 'System-owned property (no user or team owner).'
+ ),
+ ])
+ .describe(
+ 'Defines who owns a property - user-scoped, team-scoped, or system.'
+ ),
+ specific_entity_type: zod
+ .union([
+ zod.null(),
+ zod
+ .enum([
+ 'CALENDAR_EVENT',
+ 'CALL_RECORD',
+ 'CHANNEL',
+ 'CHAT',
+ 'COMPANY',
+ 'DOCUMENT',
+ 'PROJECT',
+ 'TASK',
+ 'THREAD',
+ 'USER',
+ ])
+ .describe(
+ 'Type of entity that can be referenced by entity properties.'
+ ),
+ ])
+ .optional(),
+ updated_at: zod.iso.datetime({}),
+ })
+ .describe(
+ 'Property definition model (service representation).'
+ ),
+ id: zod
+ .uuid()
+ .describe(
+ 'Globally unique id of the assignment attaching this property to an entity.'
+ ),
+ value: zod
+ .union([
+ zod.null(),
+ zod
+ .union([
+ zod
+ .object({
+ type: zod.enum(['Boolean']),
+ value: zod
+ .boolean()
+ .describe(
+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'
+ ),
+ })
+ .describe(
+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Number']),
+ value: zod
+ .number()
+ .describe(
+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'
+ ),
+ })
+ .describe(
+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['String']),
+ value: zod
+ .string()
+ .describe(
+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'
+ ),
+ })
+ .describe(
+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Date']),
+ value: zod.iso
+ .datetime({})
+ .describe(
+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'
+ ),
+ })
+ .describe(
+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'
+ ),
+ zod
+ .object({
+ type: zod.enum([
+ 'SelectOption',
+ ]),
+ value: zod
+ .array(zod.uuid())
+ .describe(
+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'
+ ),
+ })
+ .describe(
+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'
+ ),
+ zod
+ .object({
+ type: zod.enum([
+ 'EntityReference',
+ ]),
+ value: zod
+ .array(
+ zod
+ .object({
+ entity_id: zod.string(),
+ entity_type: zod
+ .enum([
+ 'CALENDAR_EVENT',
+ 'CALL_RECORD',
+ 'CHANNEL',
+ 'CHAT',
+ 'COMPANY',
+ 'DOCUMENT',
+ 'PROJECT',
+ 'TASK',
+ 'THREAD',
+ 'USER',
+ ])
+ .describe(
+ 'Type of entity that can be referenced by entity properties.'
+ ),
+ specific_message_id: zod
+ .uuid()
+ .nullish()
+ .describe(
+ 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'
+ ),
+ })
+ .describe(
+ 'Entity reference for entity-type property values.'
+ )
+ )
+ .describe(
+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'
+ ),
+ })
+ .describe(
+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'
),
zod
.object({
- scope: zod.enum(['system']),
+ type: zod.enum(['Link']),
+ value: zod
+ .array(zod.string())
+ .describe(
+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'
+ ),
})
.describe(
- 'System-owned property (no user or team owner).'
+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'
),
])
.describe(
- 'Defines who owns a property - user-scoped, team-scoped, or system.'
+ 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'
),
- specific_entity_type: zod
- .union([
- zod.null(),
- zod
- .enum([
- 'CALENDAR_EVENT',
- 'CALL_RECORD',
- 'CHANNEL',
- 'CHAT',
- 'COMPANY',
- 'DOCUMENT',
- 'PROJECT',
- 'TASK',
- 'THREAD',
- 'USER',
- ])
- .describe(
- 'Type of entity that can be referenced by entity properties.'
- ),
- ])
- .optional(),
- updated_at: zod.iso.datetime({}),
- })
+ ])
+ .optional(),
+ })
+ .describe(
+ 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'
+ )
+ )
+ .describe('Properties attached to the entity.'),
+ })
+ .describe(
+ 'Property fields that can be flattened into property-bearing Soup items.'
+ ),
+ icalUid: zod
+ .string()
+ .describe(
+ 'RFC 5545 UID used for source reconciliation.'
+ ),
+ id: zod.uuid().describe('Entity identifier.'),
+ isReadOnly: zod
+ .boolean()
+ .describe(
+ 'Whether the selected canonical source is read-only.'
+ ),
+ location: zod
+ .string()
+ .nullish()
+ .describe('Optional location label.'),
+ organizerEmail: zod
+ .string()
+ .nullish()
+ .describe('Organizer email.'),
+ organizerName: zod
+ .string()
+ .nullish()
+ .describe('Organizer display name.'),
+ ownerId: zod.string().describe('Owning Macro user.'),
+ status: zod.string().describe('Canonical status.'),
+ time: zod
+ .union([
+ zod
+ .object({
+ ends_at: zod.iso
+ .datetime({})
+ .describe('Exclusive end.'),
+ kind: zod.enum(['timed']),
+ starts_at: zod.iso
+ .datetime({})
+ .describe('Inclusive start.'),
+ time_zone: zod
+ .string()
+ .nullish()
+ .describe('Original IANA time zone.'),
+ })
+ .describe('Absolute timed event.'),
+ zod
+ .object({
+ end_date: zod.iso
+ .date()
+ .describe('Exclusive end date.'),
+ kind: zod.enum(['allDay']),
+ start_date: zod.iso
+ .date()
+ .describe('Inclusive start date.'),
+ })
+ .describe(
+ 'All-day event with an exclusive end date.'
+ ),
+ ])
+ .describe('Timed or all-day calendar event span.'),
+ title: zod.string().describe('Display title.'),
+ transparency: zod
+ .string()
+ .describe('Availability transparency.'),
+ updatedAt: zod.iso
+ .datetime({})
+ .describe('Entity update timestamp.'),
+ visibility: zod
+ .string()
+ .describe('Canonical visibility.'),
+ })
+ .describe('A canonical calendar event entity in Soup.'),
+ tag: zod.enum(['calendarEvent']),
+ })
+ .describe('Calendar event item.'),
+ zod
+ .object({
+ data: zod
+ .object({
+ properties: zod
+ .array(
+ zod
+ .object({
+ definition: zod
+ .object({
+ created_at: zod.iso.datetime({}),
+ data_type: zod
+ .enum([
+ 'BOOLEAN',
+ 'DATE',
+ 'NUMBER',
+ 'STRING',
+ 'SELECT_NUMBER',
+ 'SELECT_STRING',
+ 'TAG',
+ 'ENTITY',
+ 'LINK',
+ ])
.describe(
- 'Property definition model (service representation).'
+ 'Data type for property values, determining storage and validation.'
),
- id: zod
- .uuid()
+ display_name: zod.string(),
+ id: zod.uuid(),
+ is_metadata: zod
+ .boolean()
.describe(
- 'Globally unique id of the assignment attaching this property to an entity.'
+ 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'
),
- value: zod
+ is_multi_select: zod.boolean(),
+ is_system: zod
+ .boolean()
+ .describe(
+ 'Flag to indicate if this is a system property (stored in DB).'
+ ),
+ owner: zod
+ .union([
+ zod
+ .object({
+ scope: zod.enum(['user']),
+ user_id: zod.string(),
+ })
+ .describe('User-scoped property.'),
+ zod
+ .object({
+ scope: zod.enum(['team']),
+ team_id: zod.uuid(),
+ })
+ .describe('Team-scoped property.'),
+ zod
+ .object({
+ scope: zod.enum(['system']),
+ })
+ .describe(
+ 'System-owned property (no user or team owner).'
+ ),
+ ])
+ .describe(
+ 'Defines who owns a property - user-scoped, team-scoped, or system.'
+ ),
+ specific_entity_type: zod
.union([
zod.null(),
zod
- .union([
- zod
- .object({
- type: zod.enum(['Boolean']),
- value: zod
- .boolean()
- .describe(
- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'
- ),
- })
- .describe(
- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'
- ),
- zod
- .object({
- type: zod.enum(['Number']),
- value: zod
- .number()
- .describe(
- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'
- ),
- })
+ .enum([
+ 'CALENDAR_EVENT',
+ 'CALL_RECORD',
+ 'CHANNEL',
+ 'CHAT',
+ 'COMPANY',
+ 'DOCUMENT',
+ 'PROJECT',
+ 'TASK',
+ 'THREAD',
+ 'USER',
+ ])
+ .describe(
+ 'Type of entity that can be referenced by entity properties.'
+ ),
+ ])
+ .optional(),
+ updated_at: zod.iso.datetime({}),
+ })
+ .describe(
+ 'Property definition model (service representation).'
+ ),
+ id: zod
+ .uuid()
+ .describe(
+ 'Globally unique id of the assignment attaching this property to an entity.'
+ ),
+ value: zod
+ .union([
+ zod.null(),
+ zod
+ .union([
+ zod
+ .object({
+ type: zod.enum(['Boolean']),
+ value: zod
+ .boolean()
+ .describe(
+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'
+ ),
+ })
+ .describe(
+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Number']),
+ value: zod
+ .number()
.describe(
'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'
),
- zod
- .object({
- type: zod.enum(['String']),
- value: zod
- .string()
- .describe(
- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'
- ),
- })
+ })
+ .describe(
+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['String']),
+ value: zod
+ .string()
.describe(
'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'
),
- zod
- .object({
- type: zod.enum(['Date']),
- value: zod.iso
- .datetime({})
- .describe(
- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'
- ),
- })
+ })
+ .describe(
+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Date']),
+ value: zod.iso
+ .datetime({})
.describe(
'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'
),
- zod
- .object({
- type: zod.enum([
- 'SelectOption',
- ]),
- value: zod
- .array(zod.uuid())
- .describe(
- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'
- ),
- })
+ })
+ .describe(
+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'
+ ),
+ zod
+ .object({
+ type: zod.enum(['SelectOption']),
+ value: zod
+ .array(zod.uuid())
.describe(
'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'
),
- zod
- .object({
- type: zod.enum([
- 'EntityReference',
- ]),
- value: zod
- .array(
- zod
- .object({
- entity_id: zod.string(),
- entity_type: zod
- .enum([
- 'CALENDAR_EVENT',
- 'CALL_RECORD',
- 'CHANNEL',
- 'CHAT',
- 'COMPANY',
- 'DOCUMENT',
- 'PROJECT',
- 'TASK',
- 'THREAD',
- 'USER',
- ])
- .describe(
- 'Type of entity that can be referenced by entity properties.'
- ),
- specific_message_id: zod
- .uuid()
- .nullish()
- .describe(
- 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'
- ),
- })
+ })
+ .describe(
+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'
+ ),
+ zod
+ .object({
+ type: zod.enum(['EntityReference']),
+ value: zod
+ .array(
+ zod
+ .object({
+ entity_id: zod.string(),
+ entity_type: zod
+ .enum([
+ 'CALENDAR_EVENT',
+ 'CALL_RECORD',
+ 'CHANNEL',
+ 'CHAT',
+ 'COMPANY',
+ 'DOCUMENT',
+ 'PROJECT',
+ 'TASK',
+ 'THREAD',
+ 'USER',
+ ])
.describe(
- 'Entity reference for entity-type property values.'
- )
- )
+ 'Type of entity that can be referenced by entity properties.'
+ ),
+ specific_message_id: zod
+ .uuid()
+ .nullish()
+ .describe(
+ 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'
+ ),
+ })
.describe(
- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'
- ),
- })
+ 'Entity reference for entity-type property values.'
+ )
+ )
.describe(
'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'
),
- zod
- .object({
- type: zod.enum(['Link']),
- value: zod
- .array(zod.string())
- .describe(
- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'
- ),
- })
+ })
+ .describe(
+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'
+ ),
+ zod
+ .object({
+ type: zod.enum(['Link']),
+ value: zod
+ .array(zod.string())
.describe(
'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'
),
- ])
+ })
.describe(
- 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'
+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'
),
])
- .optional(),
- })
- .describe(
- 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'
- )
+ .describe(
+ 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'
+ ),
+ ])
+ .optional(),
+ })
+ .describe(
+ 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'
)
- .describe('Properties attached to the entity.'),
- })
+ )
+ .describe('Properties attached to the entity.'),
+ })
+ .describe(
+ 'Property fields that can be flattened into property-bearing Soup items.'
+ )
+ .and(
+ zod.object({
+ createdAt: zod.iso
+ .datetime({})
+ .describe('When the company was created.'),
+ description: zod
+ .string()
+ .nullish()
+ .describe(
+ "Display description from the primary domain's directory entry."
+ ),
+ domains: zod
+ .array(
+ zod
+ .object({
+ companyId: zod
+ .uuid()
+ .describe(
+ 'The id of the company the domain belongs to.'
+ ),
+ createdAt: zod.iso
+ .datetime({})
+ .describe(
+ 'When the domain record was created.'
+ ),
+ domain: zod
+ .string()
+ .describe(
+ 'The domain (lowercased, e.g. \"acme.com\").'
+ ),
+ id: zod
+ .uuid()
+ .describe('The id of the domain record.'),
+ })
+ .describe(
+ "A CRM domain as displayed in Soup. Mirrors the crm crate's\n[`CrmDomain`] with a stable wire shape that the FE can rely on."
+ )
+ )
+ .describe(
+ 'Domains associated with this company, ordered by creation time\nascending (primary first).'
+ ),
+ emailSync: zod
+ .boolean()
+ .describe(
+ 'Whether email sync is enabled for this company.'
+ ),
+ hidden: zod
+ .boolean()
+ .describe(
+ 'Whether the company is hidden from CRM listings. Soup filters\nthese out by default.'
+ ),
+ id: zod.uuid().describe('The id of the company.'),
+ name: zod
+ .string()
+ .nullish()
+ .describe(
+ "Display name from the primary domain's directory entry, or\n`None` when unresolved."
+ ),
+ teamId: zod
+ .uuid()
+ .describe(
+ 'The id of the team that owns this company record.'
+ ),
+ updatedAt: zod.iso
+ .datetime({})
+ .describe('When the company was last updated.'),
+ viewedAt: zod.iso
+ .datetime({})
+ .nullish()
+ .describe(
+ 'When the requesting user last viewed this company, or `None` if\nnever viewed. Mirrors the `viewed_at` other soup entities carry.'
+ ),
+ })
+ )
+ .describe(
+ 'A CRM company as displayed in Soup. Carries the core company\nfields plus display metadata resolved from `crm_domain_directory`\nagainst the primary (earliest-created) domain.'
+ ),
+ tag: zod.enum(['crmCompany']),
+ })
+ .describe('CRM company item.'),
+ zod
+ .object({
+ data: zod
+ .object({
+ createdAt: zod.iso
+ .datetime({})
+ .describe('Timestamp when the record was created.'),
+ foreignEntityId: zod
+ .string()
.describe(
- 'Property fields that can be flattened into property-bearing Soup items.'
+ 'Identifier assigned by the external system.'
),
- icalUid: zod
+ foreignEntitySource: zod
.string()
.describe(
- 'RFC 5545 UID used for source reconciliation.'
+ 'Source system that owns the external identifier.'
),
- id: zod.uuid().describe('Entity identifier.'),
- isReadOnly: zod
- .boolean()
+ id: zod
+ .uuid()
.describe(
- 'Whether the selected canonical source is read-only.'
+ 'Internal primary key for this foreign entity record.'
),
- location: zod
- .string()
- .nullish()
- .describe('Optional location label.'),
- organizerEmail: zod
- .string()
- .nullish()
- .describe('Organizer email.'),
- organizerName: zod
+ metadata: zod
+ .object({})
+ .describe(
+ 'Arbitrary metadata stored with the mapping.'
+ ),
+ storedForAuthEntity: zod
.string()
- .nullish()
- .describe('Organizer display name.'),
- ownerId: zod.string().describe('Owning Macro user.'),
- status: zod.string().describe('Canonical status.'),
- time: zod
- .union([
- zod
- .object({
- ends_at: zod.iso
- .datetime({})
- .describe('Exclusive end.'),
- kind: zod.enum(['timed']),
- starts_at: zod.iso
- .datetime({})
- .describe('Inclusive start.'),
- time_zone: zod
- .string()
- .nullish()
- .describe('Original IANA time zone.'),
- })
- .describe('Absolute timed event.'),
- zod
- .object({
- end_date: zod.iso
- .date()
- .describe('Exclusive end date.'),
- kind: zod.enum(['allDay']),
- start_date: zod.iso
- .date()
- .describe('Inclusive start date.'),
- })
- .describe(
- 'All-day event with an exclusive end date.'
- ),
- ])
- .describe('Timed or all-day calendar event span.'),
- title: zod.string().describe('Display title.'),
- transparency: zod
+ .describe(
+ 'Internal auth entity namespace this foreign entity is stored for.'
+ ),
+ storedForId: zod
.string()
- .describe('Availability transparency.'),
+ .describe(
+ 'Internal entity identifier this foreign entity is stored for.'
+ ),
updatedAt: zod.iso
.datetime({})
- .describe('Entity update timestamp.'),
- visibility: zod
- .string()
- .describe('Canonical visibility.'),
+ .describe(
+ 'Timestamp when the record was last updated.'
+ ),
})
- .describe('A canonical calendar event entity in Soup.'),
- tag: zod.enum(['calendarEvent']),
+ .describe(
+ 'A foreign entity record as displayed in Soup.'
+ ),
+ tag: zod.enum(['foreignEntity']),
})
- .describe('Calendar event item.'),
+ .describe('Foreign entity item.'),
zod
.object({
data: zod
@@ -21997,133 +23777,119 @@ export const postItemsSoupAstGroupedResponse = zod
)
.and(
zod.object({
+ completedAt: zod.iso
+ .datetime({})
+ .nullish()
+ .describe(
+ 'Set once a one-shot reminder has fired.'
+ ),
createdAt: zod.iso
.datetime({})
- .describe('When the company was created.'),
+ .describe('When the reminder was created.'),
description: zod
.string()
- .nullish()
.describe(
- "Display description from the primary domain's directory entry."
+ 'What to remind the user about. Doubles as the display name.'
),
- domains: zod
- .array(
+ enabled: zod
+ .boolean()
+ .describe(
+ 'When false, the dispatcher skips this reminder.'
+ ),
+ id: zod.uuid().describe('The reminder id.'),
+ nextRunAt: zod.iso
+ .datetime({})
+ .describe(
+ 'The next firing. This is what Soup sorts reminders on.'
+ ),
+ referencedEntity: zod
+ .union([
+ zod.null(),
zod
.object({
- companyId: zod
- .uuid()
+ entityType: zod
+ .enum([
+ 'user',
+ 'chat',
+ 'channel',
+ 'channel_message',
+ 'document',
+ 'project',
+ 'email_thread',
+ 'calendar_event',
+ 'team',
+ 'call',
+ 'foreign_entity',
+ 'static_file',
+ 'crm_company',
+ 'crm_contact',
+ 'reminder',
+ ])
+ .describe('The type of an entity in Macro')
+ .describe("The referenced entity's type."),
+ fileType: zod
+ .string()
+ .nullish()
.describe(
- 'The id of the company the domain belongs to.'
+ 'File type, when the reference is a document — `md`, `pdf`, and so on.'
),
- createdAt: zod.iso
+ id: zod
+ .string()
+ .describe("The referenced entity's id."),
+ subType: zod
+ .string()
+ .nullish()
+ .describe(
+ 'Sub type, when the reference is a task or snippet document.'
+ ),
+ })
+ .describe(
+ "The entity a reminder is about, resolved server-side.\n\nA reminder has no block of its own — it opens, and is iconed as, whatever it\nreferences. Which block that is depends on the referenced document's file\ntype, and the client's icon path is synchronous, so this is resolved here\nrather than costing a fetch per row."
+ ),
+ ])
+ .optional(),
+ schedule: zod
+ .union([
+ zod
+ .object({
+ remindAt: zod.iso
.datetime({})
+ .describe('The instant to fire at.'),
+ type: zod.enum(['once']),
+ })
+ .describe('Fires once, at a fixed instant.'),
+ zod
+ .object({
+ cron: zod
+ .string()
.describe(
- 'When the domain record was created.'
+ 'Cron expression, normalized to the 6-field form.'
),
- domain: zod
+ timezone: zod
.string()
.describe(
- 'The domain (lowercased, e.g. \"acme.com\").'
+ 'The timezone the cron expression is evaluated in.'
),
- id: zod
- .uuid()
- .describe('The id of the domain record.'),
+ type: zod.enum(['recurring']),
})
.describe(
- "A CRM domain as displayed in Soup. Mirrors the crm crate's\n[`CrmDomain`] with a stable wire shape that the FE can rely on."
- )
- )
- .describe(
- 'Domains associated with this company, ordered by creation time\nascending (primary first).'
- ),
- emailSync: zod
- .boolean()
- .describe(
- 'Whether email sync is enabled for this company.'
- ),
- hidden: zod
- .boolean()
- .describe(
- 'Whether the company is hidden from CRM listings. Soup filters\nthese out by default.'
- ),
- id: zod.uuid().describe('The id of the company.'),
- name: zod
- .string()
- .nullish()
- .describe(
- "Display name from the primary domain's directory entry, or\n`None` when unresolved."
- ),
- teamId: zod
- .uuid()
+ 'Fires repeatedly, on a cron schedule evaluated in `timezone`.'
+ ),
+ ])
.describe(
- 'The id of the team that owns this company record.'
+ 'How often a reminder fires, flattened for the wire.\n\nThe domain\'s [`ReminderSchedule`] is an internally-tagged enum carrying a\nvalidated cron type; Soup only needs enough to render \"once\" vs \"every\nweekday at 9am\", so the cron is exposed as a plain string.'
),
updatedAt: zod.iso
.datetime({})
- .describe('When the company was last updated.'),
- viewedAt: zod.iso
- .datetime({})
- .nullish()
- .describe(
- 'When the requesting user last viewed this company, or `None` if\nnever viewed. Mirrors the `viewed_at` other soup entities carry.'
- ),
+ .describe('When the reminder was last modified.'),
})
)
.describe(
- 'A CRM company as displayed in Soup. Carries the core company\nfields plus display metadata resolved from `crm_domain_directory`\nagainst the primary (earliest-created) domain.'
- ),
- tag: zod.enum(['crmCompany']),
- })
- .describe('CRM company item.'),
- zod
- .object({
- data: zod
- .object({
- createdAt: zod.iso
- .datetime({})
- .describe('Timestamp when the record was created.'),
- foreignEntityId: zod
- .string()
- .describe(
- 'Identifier assigned by the external system.'
- ),
- foreignEntitySource: zod
- .string()
- .describe(
- 'Source system that owns the external identifier.'
- ),
- id: zod
- .uuid()
- .describe(
- 'Internal primary key for this foreign entity record.'
- ),
- metadata: zod
- .object({})
- .describe(
- 'Arbitrary metadata stored with the mapping.'
- ),
- storedForAuthEntity: zod
- .string()
- .describe(
- 'Internal auth entity namespace this foreign entity is stored for.'
- ),
- storedForId: zod
- .string()
- .describe(
- 'Internal entity identifier this foreign entity is stored for.'
- ),
- updatedAt: zod.iso
- .datetime({})
- .describe(
- 'Timestamp when the record was last updated.'
- ),
- })
- .describe(
- 'A foreign entity record as displayed in Soup.'
+ "A reminder as displayed in Soup.\n\nReminders are user-owned rather than shared, so unlike most Soup items they\ncarry no access metadata — the repository only ever returns the caller's own."
),
- tag: zod.enum(['foreignEntity']),
+ tag: zod.enum(['reminder']),
})
- .describe('Foreign entity item.'),
+ .describe('Reminder item.'),
])
.describe('A single item in the Soup feed.')
.and(
@@ -24125,7 +25891,9 @@ export const listRemindersResponse = zod
completedAt: zod.iso
.datetime({})
.nullish()
- .describe('Set once a one-shot reminder has fired.'),
+ .describe(
+ 'Set once the owner marks the reminder as dealt with. Firing does not\nset it — a delivered reminder is waiting on its owner, not finished.'
+ ),
createdAt: zod.iso
.datetime({})
.describe('When the reminder was created.'),
@@ -24292,7 +26060,9 @@ export const getReminderResponse = zod
completedAt: zod.iso
.datetime({})
.nullish()
- .describe('Set once a one-shot reminder has fired.'),
+ .describe(
+ 'Set once the owner marks the reminder as dealt with. Firing does not\nset it — a delivered reminder is waiting on its owner, not finished.'
+ ),
createdAt: zod.iso.datetime({}).describe('When the reminder was created.'),
description: zod.string().describe('What to remind the user about.'),
enabled: zod
@@ -24384,6 +26154,12 @@ export const updateReminderParams = zod.object({
export const updateReminderBody = zod
.object({
+ completed: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'Mark the reminder as dealt with, or live again. Distinct from\n`enabled`, which controls whether the dispatcher considers it.'
+ ),
description: zod.string().optional().describe('Replacement description.'),
enabled: zod
.boolean()
@@ -24425,7 +26201,9 @@ export const updateReminderResponse = zod
completedAt: zod.iso
.datetime({})
.nullish()
- .describe('Set once a one-shot reminder has fired.'),
+ .describe(
+ 'Set once the owner marks the reminder as dealt with. Firing does not\nset it — a delivered reminder is waiting on its owner, not finished.'
+ ),
createdAt: zod.iso.datetime({}).describe('When the reminder was created.'),
description: zod.string().describe('What to remind the user about.'),
enabled: zod
diff --git a/apps/web/src/lib/service-clients/service-storage/graphql-soup.ts b/apps/web/src/lib/service-clients/service-storage/graphql-soup.ts
index 416c00e5b8..a5bb912c96 100644
--- a/apps/web/src/lib/service-clients/service-storage/graphql-soup.ts
+++ b/apps/web/src/lib/service-clients/service-storage/graphql-soup.ts
@@ -665,6 +665,13 @@ export function mapGraphqlSoupItem(item: GraphqlSoupItem): SoupApiItem | null {
// Calendar soup rendering lands with the calendar FE; skip for now.
() => null
)
+ .with(
+ { __typename: 'GraphqlSoupReminder' },
+ // Reminders ship on the REST soup path. `SoupItemFields` has no
+ // `... on GraphqlSoupReminder` selection, so remindAt/completedAt and
+ // the referenced entity aren't available here to build a row from.
+ () => null
+ )
.exhaustive();
}
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 6137a7fd09..cd37f8bb5a 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
@@ -481,6 +481,8 @@ export type GraphqlEntityFilterAst = {
projectFilter?: GraphqlProjectExpr | null | undefined;
/** The properties filter to apply. */
propertiesFilter?: GraphqlPropertiesExpr | null | undefined;
+ /** The reminder filter to apply. */
+ reminderFilter?: GraphqlReminderExpr | null | undefined;
};
/** Stable machine-readable mutation error code. */
@@ -532,6 +534,8 @@ export type GraphqlEntityType =
| 'FOREIGN_ENTITY'
/** Project entity. */
| 'PROJECT'
+ /** Reminder entity. */
+ | 'REMINDER'
/** Static file entity. */
| 'STATIC_FILE'
/** Team entity. */
@@ -731,6 +735,41 @@ export type GraphqlPropertyTargetEntityType =
/** User target. */
| 'USER';
+/** The two operands of a recursive `ReminderFilterExpr` binary expression. */
+export type GraphqlReminderBinaryExpr = {
+ /** The left-hand expression. */
+ left: GraphqlReminderExpr;
+ /** The right-hand expression. */
+ right: GraphqlReminderExpr;
+};
+
+/** A recursive `ReminderFilterExpr` filter expression. */
+export type GraphqlReminderExpr =
+ { /** Matches when both expressions match. */
+ and: GraphqlReminderBinaryExpr; literal?: never; not?: never; or?: never; }
+ | { and?: never; /** Matches a domain-specific literal condition. */
+ literal: GraphqlReminderLiteral; not?: never; or?: never; }
+ | { and?: never; literal?: never; /** Negates an expression. */
+ not: GraphqlReminderExpr; or?: never; }
+ | { and?: never; literal?: never; not?: never; /** Matches when either expression matches. */
+ or: GraphqlReminderBinaryExpr; };
+
+/** GraphQL input representing the reminder literal. */
+export type GraphqlReminderLiteral =
+ { /** Whether the reminder has already fired. */
+ completed: boolean; entity?: never; id?: never; include?: never; }
+ | { completed?: never; /** The referenced entity, as `"{type}:{id}"`. */
+ entity: string; id?: never; include?: never; }
+ | { completed?: never; entity?: never; /** The id option. */
+ id: string | number; include?: never; }
+ | { completed?: never; entity?: never; id?: never; /**
+ * Opt this query into reminders at all. Reminders are off by default, so
+ * without this (or an `id`/`entity`) Soup omits them entirely — a filter
+ * of only `completed` would otherwise silently match nothing. Must be
+ * `true`; there is no literal for excluding reminders, that is the default.
+ */
+ include: boolean; };
+
/** A typed value accepted when setting an entity property. */
export type GraphqlSetPropertyValue =
{ /** A Boolean value. */
@@ -804,7 +843,9 @@ export type GraphqlSoupEntityType =
/** Foreign entity. */
| 'FOREIGN_ENTITY'
/** Project entity. */
- | 'PROJECT';
+ | 'PROJECT'
+ /** Reminder entity. */
+ | 'REMINDER';
/** Input for continuing a single grouped Soup bin. */
export type GroupedSoupContinuationInput = {
@@ -1033,6 +1074,7 @@ type EntityMutationResultFields_GraphqlMutationSuccess_Fragment = { __typename:
| { __typename: 'GraphqlSelectOptionPropertyValue', optionIds: Array<string> }
| { __typename: 'GraphqlStringPropertyValue', stringValue: string }
| null }>, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
+ | { __typename: 'GraphqlSoupReminder', frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
| null }
> };
@@ -1107,6 +1149,7 @@ export type EntityMutationPayloadFieldsFragment = { results: Array<
| { __typename: 'GraphqlSelectOptionPropertyValue', optionIds: Array<string> }
| { __typename: 'GraphqlStringPropertyValue', stringValue: string }
| null }>, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
+ | { __typename: 'GraphqlSoupReminder', frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
| null }
> }
> };
@@ -1182,6 +1225,7 @@ export type RenameEntitiesMutation = { renameEntities: { results: Array<
| { __typename: 'GraphqlSelectOptionPropertyValue', optionIds: Array<string> }
| { __typename: 'GraphqlStringPropertyValue', stringValue: string }
| null }>, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
+ | { __typename: 'GraphqlSoupReminder', frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
| null }
> }
> } };
@@ -1257,6 +1301,7 @@ export type MoveEntitiesMutation = { moveEntities: { results: Array<
| { __typename: 'GraphqlSelectOptionPropertyValue', optionIds: Array<string> }
| { __typename: 'GraphqlStringPropertyValue', stringValue: string }
| null }>, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
+ | { __typename: 'GraphqlSoupReminder', frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
| null }
> }
> } };
@@ -1332,6 +1377,7 @@ export type UpdateEntitySharePoliciesMutation = { updateEntitySharePolicies: { r
| { __typename: 'GraphqlSelectOptionPropertyValue', optionIds: Array<string> }
| { __typename: 'GraphqlStringPropertyValue', stringValue: string }
| null }>, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
+ | { __typename: 'GraphqlSoupReminder', frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
| null }
> }
> } };
@@ -1407,6 +1453,7 @@ export type TrashEntitiesMutation = { trashEntities: { results: Array<
| { __typename: 'GraphqlSelectOptionPropertyValue', optionIds: Array<string> }
| { __typename: 'GraphqlStringPropertyValue', stringValue: string }
| null }>, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
+ | { __typename: 'GraphqlSoupReminder', frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
| null }
> }
> } };
@@ -1482,6 +1529,7 @@ export type RestoreEntitiesMutation = { restoreEntities: { results: Array<
| { __typename: 'GraphqlSelectOptionPropertyValue', optionIds: Array<string> }
| { __typename: 'GraphqlStringPropertyValue', stringValue: string }
| null }>, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
+ | { __typename: 'GraphqlSoupReminder', frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
| null }
> }
> } };
@@ -1557,6 +1605,7 @@ export type DeleteEntitiesPermanentlyMutation = { deleteEntitiesPermanently: { r
| { __typename: 'GraphqlSelectOptionPropertyValue', optionIds: Array<string> }
| { __typename: 'GraphqlStringPropertyValue', stringValue: string }
| null }>, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
+ | { __typename: 'GraphqlSoupReminder', frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
| null }
> }
> } };
@@ -1632,6 +1681,7 @@ export type DuplicateEntitiesMutation = { duplicateEntities: { results: Array<
| { __typename: 'GraphqlSelectOptionPropertyValue', optionIds: Array<string> }
| { __typename: 'GraphqlStringPropertyValue', stringValue: string }
| null }>, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
+ | { __typename: 'GraphqlSoupReminder', frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
| null }
> }
> } };
@@ -1708,6 +1758,7 @@ export type SetEntityFavoriteMutation = { setEntityFavorite:
| { __typename: 'GraphqlSelectOptionPropertyValue', optionIds: Array<string> }
| { __typename: 'GraphqlStringPropertyValue', stringValue: string }
| null }>, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
+ | { __typename: 'GraphqlSoupReminder', frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
| null }
> }
};
@@ -1808,6 +1859,15 @@ export type EntityPropertiesQuery = { user: { id: string, soup: { items: Array<
| { __typename: 'GraphqlSelectOptionPropertyValue', optionIds: Array<string> }
| { __typename: 'GraphqlStringPropertyValue', stringValue: string }
| null }> }
+ | { __typename: 'GraphqlSoupReminder', id: string, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
+ | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
+ | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
+ | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
+ | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
+ | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
+ | { __typename: 'GraphqlSelectOptionPropertyValue', optionIds: Array<string> }
+ | { __typename: 'GraphqlStringPropertyValue', stringValue: string }
+ | null }> }
> } } };
export type GroupSoupMembershipQueryVariables = Exact<{
@@ -1826,6 +1886,7 @@ export type GroupSoupMembershipQuery = { user: { id: string, groupSoup: { bins:
| { __typename: 'GraphqlSoupEmailThread', id: string }
| { __typename: 'GraphqlSoupForeignEntity', id: string }
| { __typename: 'GraphqlSoupProject', id: string }
+ | { __typename: 'GraphqlSoupReminder', id: string }
> }> } } };
export type GroupSoupQueryVariables = Exact<{
@@ -1895,6 +1956,7 @@ export type GroupSoupQuery = { user: { id: string, groupSoup: { bins: Array<{ ke
| { __typename: 'GraphqlSelectOptionPropertyValue', optionIds: Array<string> }
| { __typename: 'GraphqlStringPropertyValue', stringValue: string }
| null }>, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
+ | { __typename: 'GraphqlSoupReminder', frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
> }> } } };
type GraphqlHistoryItemFields_GraphqlSoupCalendarEvent_Fragment = { __typename: 'GraphqlSoupCalendarEvent', id: string, entityType: GraphqlSoupEntityType, frecencyScore: number | null };
@@ -1960,6 +2022,8 @@ type GraphqlHistoryItemFields_GraphqlSoupProject_Fragment = { __typename: 'Graph
| { __typename: 'GraphqlStringPropertyValue', stringValue: string }
| null }>, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> };
+type GraphqlHistoryItemFields_GraphqlSoupReminder_Fragment = { __typename: 'GraphqlSoupReminder', id: string, entityType: GraphqlSoupEntityType, frecencyScore: number | null };
+
export type GraphqlHistoryItemFieldsFragment =
| GraphqlHistoryItemFields_GraphqlSoupCalendarEvent_Fragment
| GraphqlHistoryItemFields_GraphqlSoupCall_Fragment
@@ -1971,6 +2035,7 @@ export type GraphqlHistoryItemFieldsFragment =
| GraphqlHistoryItemFields_GraphqlSoupEmailThread_Fragment
| GraphqlHistoryItemFields_GraphqlSoupForeignEntity_Fragment
| GraphqlHistoryItemFields_GraphqlSoupProject_Fragment
+ | GraphqlHistoryItemFields_GraphqlSoupReminder_Fragment
;
export type SetEntityPropertyMutationVariables = Exact<{
@@ -2052,6 +2117,7 @@ type SoupPatchFields_SoupUpdated_Fragment = { __typename: 'SoupUpdated', item:
| { __typename: 'GraphqlSelectOptionPropertyValue', optionIds: Array<string> }
| { __typename: 'GraphqlStringPropertyValue', stringValue: string }
| null }>, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
+ | { __typename: 'GraphqlSoupReminder', frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
| null };
export type SoupPatchFieldsFragment =
@@ -2126,6 +2192,7 @@ export type SoupUpdatesSubscription = { soupUpdates: Array<
| { __typename: 'GraphqlSelectOptionPropertyValue', optionIds: Array<string> }
| { __typename: 'GraphqlStringPropertyValue', stringValue: string }
| null }>, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
+ | { __typename: 'GraphqlSoupReminder', frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
| null }
> };
@@ -2196,6 +2263,7 @@ export type SoupQuery = { user: { id: string, soup: { nextCursor: string | null,
| { __typename: 'GraphqlSelectOptionPropertyValue', optionIds: Array<string> }
| { __typename: 'GraphqlStringPropertyValue', stringValue: string }
| null }>, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
+ | { __typename: 'GraphqlSoupReminder', frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
> } } };
type SoupItemFields_GraphqlSoupCalendarEvent_Fragment = { __typename: 'GraphqlSoupCalendarEvent', frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> };
@@ -2269,6 +2337,8 @@ type SoupItemFields_GraphqlSoupProject_Fragment = { __typename: 'GraphqlSoupProj
| { __typename: 'GraphqlStringPropertyValue', stringValue: string }
| null }>, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> };
+type SoupItemFields_GraphqlSoupReminder_Fragment = { __typename: 'GraphqlSoupReminder', frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> };
+
export type SoupItemFieldsFragment =
| SoupItemFields_GraphqlSoupCalendarEvent_Fragment
| SoupItemFields_GraphqlSoupCall_Fragment
@@ -2280,6 +2350,7 @@ export type SoupItemFieldsFragment =
| SoupItemFields_GraphqlSoupEmailThread_Fragment
| SoupItemFields_GraphqlSoupForeignEntity_Fragment
| SoupItemFields_GraphqlSoupProject_Fragment
+ | SoupItemFields_GraphqlSoupReminder_Fragment
;
type SoupEntityCoreFields_GraphqlSoupCalendarEvent_Fragment = { id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> };
@@ -2302,6 +2373,8 @@ type SoupEntityCoreFields_GraphqlSoupForeignEntity_Fragment = { id: string, enti
type SoupEntityCoreFields_GraphqlSoupProject_Fragment = { id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> };
+type SoupEntityCoreFields_GraphqlSoupReminder_Fragment = { id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> };
+
export type SoupEntityCoreFieldsFragment =
| SoupEntityCoreFields_GraphqlSoupCalendarEvent_Fragment
| SoupEntityCoreFields_GraphqlSoupCall_Fragment
@@ -2313,6 +2386,7 @@ export type SoupEntityCoreFieldsFragment =
| SoupEntityCoreFields_GraphqlSoupEmailThread_Fragment
| SoupEntityCoreFields_GraphqlSoupForeignEntity_Fragment
| SoupEntityCoreFields_GraphqlSoupProject_Fragment
+ | SoupEntityCoreFields_GraphqlSoupReminder_Fragment
;
export type SoupPropertyFieldsFragment = { id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
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 0935ac3794..879bc430eb 100644
--- a/apps/web/src/lib/service-clients/service-storage/openapi.json
+++ b/apps/web/src/lib/service-clients/service-storage/openapi.json
@@ -12020,6 +12020,9 @@
},
"propf": {
"description": "the filters that should be applied based on entity properties"
+ },
+ "remf": {
+ "description": "Filters applied to reminders (wire key `remf`). Unlike every other\nfilter here, empty/omitted returns **no** reminders: they are opt-in,\nso the caller must send `inc`, an id, or an entity to get any."
}
}
},
@@ -17311,6 +17314,10 @@
},
"description": "property-based filters applied across entity types"
},
+ "reminder_filters": {
+ "$ref": "#/components/schemas/ReminderFilters",
+ "description": "the bundled [ReminderFilters]"
+ },
"tag_filter_mode": {
"$ref": "#/components/schemas/TagFilterMode",
"description": "How the `tag_option_ids` combine: `any` (default) matches entities\nholding at least one selected tag, `all` requires every selected tag."
@@ -20917,7 +20924,7 @@
"completedAt": {
"type": ["string", "null"],
"format": "date-time",
- "description": "Set once a one-shot reminder has fired."
+ "description": "Set once the owner marks the reminder as dealt with. Firing does not\nset it — a delivered reminder is waiting on its owner, not finished."
},
"createdAt": {
"type": "string",
@@ -20986,6 +20993,34 @@
}
}
},
+ "ReminderFilters": {
+ "type": "object",
+ "description": "Filters for reminders.",
+ "properties": {
+ "completed": {
+ "type": ["boolean", "null"],
+ "description": "Filter on whether the reminder has already fired. `None` returns both."
+ },
+ "entities": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Restrict to reminders attached to these entities, each `\"{type}:{id}\"`."
+ },
+ "ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Reminder ids to filter by. Empty to include all of the caller's reminders."
+ },
+ "include": {
+ "type": "boolean",
+ "description": "Opt this query into reminders at all. Reminders are off by default —\nsee [`crate::ast::reminder::ReminderLiteral::Include`]. Asking for\nspecific `ids` or `entities` also opts in."
+ }
+ }
+ },
"ReminderSchedule": {
"oneOf": [
{
@@ -22630,6 +22665,21 @@
"enum": ["foreignEntity"]
}
}
+ },
+ {
+ "type": "object",
+ "description": "Reminder item.",
+ "required": ["data", "tag"],
+ "properties": {
+ "data": {
+ "$ref": "#/components/schemas/SoupReminder_SoupPropertiesField",
+ "description": "Reminder item."
+ },
+ "tag": {
+ "type": "string",
+ "enum": ["reminder"]
+ }
+ }
}
],
"description": "A single item in the Soup feed."
@@ -22883,6 +22933,172 @@
}
}
},
+ "SoupReminderReference": {
+ "type": "object",
+ "description": "The entity a reminder is about, resolved server-side.\n\nA reminder has no block of its own — it opens, and is iconed as, whatever it\nreferences. Which block that is depends on the referenced document's file\ntype, and the client's icon path is synchronous, so this is resolved here\nrather than costing a fetch per row.",
+ "required": ["id", "entityType"],
+ "properties": {
+ "entityType": {
+ "oneOf": [
+ {
+ "type": "string",
+ "description": "The type of an entity in Macro",
+ "enum": [
+ "user",
+ "chat",
+ "channel",
+ "channel_message",
+ "document",
+ "project",
+ "email_thread",
+ "calendar_event",
+ "team",
+ "call",
+ "foreign_entity",
+ "static_file",
+ "crm_company",
+ "crm_contact",
+ "reminder"
+ ]
+ }
+ ],
+ "description": "The referenced entity's type."
+ },
+ "fileType": {
+ "type": ["string", "null"],
+ "description": "File type, when the reference is a document — `md`, `pdf`, and so on."
+ },
+ "id": {
+ "type": "string",
+ "description": "The referenced entity's id."
+ },
+ "subType": {
+ "type": ["string", "null"],
+ "description": "Sub type, when the reference is a task or snippet document."
+ }
+ }
+ },
+ "SoupReminderSchedule": {
+ "oneOf": [
+ {
+ "type": "object",
+ "description": "Fires once, at a fixed instant.",
+ "required": ["remindAt", "type"],
+ "properties": {
+ "remindAt": {
+ "type": "string",
+ "format": "date-time",
+ "description": "The instant to fire at."
+ },
+ "type": {
+ "type": "string",
+ "enum": ["once"]
+ }
+ }
+ },
+ {
+ "type": "object",
+ "description": "Fires repeatedly, on a cron schedule evaluated in `timezone`.",
+ "required": ["cron", "timezone", "type"],
+ "properties": {
+ "cron": {
+ "type": "string",
+ "description": "Cron expression, normalized to the 6-field form."
+ },
+ "timezone": {
+ "type": "string",
+ "description": "The timezone the cron expression is evaluated in."
+ },
+ "type": {
+ "type": "string",
+ "enum": ["recurring"]
+ }
+ }
+ }
+ ],
+ "description": "How often a reminder fires, flattened for the wire.\n\nThe domain's [`ReminderSchedule`] is an internally-tagged enum carrying a\nvalidated cron type; Soup only needs enough to render \"once\" vs \"every\nweekday at 9am\", so the cron is exposed as a plain string."
+ },
+ "SoupReminder_SoupPropertiesField": {
+ "allOf": [
+ {
+ "type": "object",
+ "description": "Property fields that can be flattened into property-bearing Soup items.",
+ "required": ["properties"],
+ "properties": {
+ "properties": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/SoupProperty"
+ },
+ "description": "Properties attached to the entity."
+ }
+ }
+ },
+ {
+ "type": "object",
+ "required": [
+ "id",
+ "description",
+ "schedule",
+ "nextRunAt",
+ "enabled",
+ "createdAt",
+ "updatedAt"
+ ],
+ "properties": {
+ "completedAt": {
+ "type": ["string", "null"],
+ "format": "date-time",
+ "description": "Set once a one-shot reminder has fired."
+ },
+ "createdAt": {
+ "type": "string",
+ "format": "date-time",
+ "description": "When the reminder was created."
+ },
+ "description": {
+ "type": "string",
+ "description": "What to remind the user about. Doubles as the display name."
+ },
+ "enabled": {
+ "type": "boolean",
+ "description": "When false, the dispatcher skips this reminder."
+ },
+ "id": {
+ "type": "string",
+ "format": "uuid",
+ "description": "The reminder id."
+ },
+ "nextRunAt": {
+ "type": "string",
+ "format": "date-time",
+ "description": "The next firing. This is what Soup sorts reminders on."
+ },
+ "referencedEntity": {
+ "oneOf": [
+ {
+ "type": "null"
+ },
+ {
+ "$ref": "#/components/schemas/SoupReminderReference",
+ "description": "The entity this reminder is about, when attached to one, with enough\ndetail for the client to render and open it without a second fetch."
+ }
+ ]
+ },
+ "schedule": {
+ "$ref": "#/components/schemas/SoupReminderSchedule",
+ "description": "When and how often the reminder fires."
+ },
+ "updatedAt": {
+ "type": "string",
+ "format": "date-time",
+ "description": "When the reminder was last modified."
+ }
+ }
+ }
+ ],
+ "description": "A reminder as displayed in Soup.\n\nReminders are user-owned rather than shared, so unlike most Soup items they\ncarry no access metadata — the repository only ever returns the caller's own."
+ },
"SoupThreadInfo": {
"type": "object",
"description": "Thread metadata and preview replies for soup channel messages.",
@@ -23302,6 +23518,10 @@
"type": "object",
"description": "Request body for modifying a reminder. Omitted fields are left unchanged;\nthe entity association is not modifiable.\n\nEvery field is optional but **not** nullable. `Option` here means \"absent\",\nand serde cannot tell an explicit `null` from an omitted key — so a body of\n`{\"enabled\": null}` would deserialize to an empty patch and be rejected as\nhaving no fields to update. `nullable = false` keeps the schema from\nadvertising a value the API has no meaning for; the deserializer still\ntolerates `null` rather than erroring on it.",
"properties": {
+ "completed": {
+ "type": "boolean",
+ "description": "Mark the reminder as dealt with, or live again. Distinct from\n`enabled`, which controls whether the dispatcher considers it."
+ },
"description": {
"type": "string",
"description": "Replacement description."
diff --git a/apps/web/src/routes/Root.tsx b/apps/web/src/routes/Root.tsx
index bbab08c52c..339abbd624 100644
--- a/apps/web/src/routes/Root.tsx
+++ b/apps/web/src/routes/Root.tsx
@@ -357,6 +357,10 @@ const ROUTES: RouteDefinition[] = [
path: '/activity',
component: LAYOUT_ROUTE.component,
},
+ {
+ path: '/reminders',
+ component: LAYOUT_ROUTE.component,
+ },
{
path: '/calendar',
component: LAYOUT_ROUTE.component,
diff --git a/crates/ai_tools/Cargo.toml b/crates/ai_tools/Cargo.toml
index 311f3dd15a..b96ce00d05 100644
--- a/crates/ai_tools/Cargo.toml
+++ b/crates/ai_tools/Cargo.toml
@@ -66,6 +66,7 @@ models_soup = { path = "../models_soup" }
rand.workspace = true
reqwest.workspace = true
readonly_pool = { path = "../readonly_pool" }
+reminders = { path = "../reminders", default-features = false, features = ["ports"] }
rootcause = { workspace = true }
schemars.workspace = true
search_service_client = { path = "../search_service_client" }
diff --git a/crates/ai_tools/src/build_context.rs b/crates/ai_tools/src/build_context.rs
index 1e996e7df6..7b76b93364 100644
--- a/crates/ai_tools/src/build_context.rs
+++ b/crates/ai_tools/src/build_context.rs
@@ -227,6 +227,7 @@ pub async fn build_tool_service_context_from_env(
),
crm::domain::service::NoOpCrmService,
foreign_entity_service,
+ reminders::domain::service::NoOpRemindersService,
));
let s3_client = macro_aws_config::s3_client().await;
diff --git a/crates/ai_tools/src/tool_context.rs b/crates/ai_tools/src/tool_context.rs
index c1e354620e..5e2f6c3fbf 100644
--- a/crates/ai_tools/src/tool_context.rs
+++ b/crates/ai_tools/src/tool_context.rs
@@ -600,6 +600,7 @@ pub type ToolSoupService = SoupImpl<
ToolCallRecordQueryService,
crm::domain::service::NoOpCrmService,
ToolForeignEntityService,
+ reminders::domain::service::NoOpRemindersService,
>;
/// No-op notification service for properties (tools don't send assignment notifications)
diff --git a/crates/client/cache-core/src/meta.rs b/crates/client/cache-core/src/meta.rs
index 9b2dbac7b5..c6ba6d8b9a 100644
--- a/crates/client/cache-core/src/meta.rs
+++ b/crates/client/cache-core/src/meta.rs
@@ -127,7 +127,8 @@ mod tests {
assert!(entity.possible_types.contains(&"GraphqlSoupDocument"));
assert!(entity.possible_types.contains(&"GraphqlSoupForeignEntity"));
assert!(entity.possible_types.contains(&"GraphqlSoupCalendarEvent"));
- assert_eq!(entity.possible_types.len(), 10);
+ assert!(entity.possible_types.contains(&"GraphqlSoupReminder"));
+ assert_eq!(entity.possible_types.len(), 11);
assert!(type_matches("GraphqlSoupDocument", "GraphqlSoupEntity"));
assert!(!type_matches("GraphqlSoupItem", "GraphqlSoupEntity"));
}
diff --git a/crates/frecency/src/outbound/postgres/dynamic_tests.rs b/crates/frecency/src/outbound/postgres/dynamic_tests.rs
index 7cbb98f7ff..5e78042b64 100644
--- a/crates/frecency/src/outbound/postgres/dynamic_tests.rs
+++ b/crates/frecency/src/outbound/postgres/dynamic_tests.rs
@@ -963,6 +963,7 @@ async fn test_dynamic_filter_document_date_created_at_gt(pool: PgPool) {
call_filter: None,
crm_company_filter: None,
foreign_entity_filter: None,
+ reminder_filter: None,
properties_filter: None,
};
@@ -1058,6 +1059,7 @@ async fn test_dynamic_filter_document_date_created_at_lt(pool: PgPool) {
call_filter: None,
crm_company_filter: None,
foreign_entity_filter: None,
+ reminder_filter: None,
properties_filter: None,
};
@@ -1149,6 +1151,7 @@ async fn test_dynamic_filter_document_date_updated_at_gt(pool: PgPool) {
call_filter: None,
crm_company_filter: None,
foreign_entity_filter: None,
+ reminder_filter: None,
properties_filter: None,
};
@@ -1245,6 +1248,7 @@ async fn test_dynamic_filter_document_date_updated_at_lt(pool: PgPool) {
call_filter: None,
crm_company_filter: None,
foreign_entity_filter: None,
+ reminder_filter: None,
properties_filter: None,
};
diff --git a/crates/graphql_common/src/entity_type.rs b/crates/graphql_common/src/entity_type.rs
index bbf30bced6..f1aea258ec 100644
--- a/crates/graphql_common/src/entity_type.rs
+++ b/crates/graphql_common/src/entity_type.rs
@@ -24,6 +24,8 @@ pub enum GraphqlSoupEntityType {
ForeignEntity,
/// Calendar event entity.
CalendarEvent,
+ /// Reminder entity.
+ Reminder,
}
/// Canonical entity types accepted by cross-entity APIs.
@@ -83,6 +85,7 @@ impl GraphqlSoupEntityType {
EntityType::CrmCompany => Self::CrmCompany,
EntityType::ForeignEntity => Self::ForeignEntity,
EntityType::CalendarEvent => Self::CalendarEvent,
+ EntityType::Reminder => Self::Reminder,
_ => return None,
})
}
@@ -100,6 +103,7 @@ impl GraphqlSoupEntityType {
Self::CrmCompany => EntityType::CrmCompany,
Self::ForeignEntity => EntityType::ForeignEntity,
Self::CalendarEvent => EntityType::CalendarEvent,
+ Self::Reminder => EntityType::Reminder,
}
}
}
diff --git a/crates/graphql_notification/src/loaders.rs b/crates/graphql_notification/src/loaders.rs
index 4eb7b33ef0..132fc9e368 100644
--- a/crates/graphql_notification/src/loaders.rs
+++ b/crates/graphql_notification/src/loaders.rs
@@ -28,15 +28,13 @@ fn notification_item_type(entity_type: model_entity::EntityType) -> Option<Notif
EntityType::Chat => Some(NotificationItemType::Chat),
EntityType::Call => Some(NotificationItemType::Call),
EntityType::ForeignEntity => Some(NotificationItemType::Github),
+ EntityType::Reminder => Some(NotificationItemType::Reminder),
EntityType::User
| EntityType::Team
| EntityType::StaticFile
| EntityType::CrmCompany
| EntityType::CrmContact
- | EntityType::CalendarEvent
- // A reminder's notification is keyed by the reminder's own id, which
- // `NotificationItemType` has no variant for, so it has no edge here.
- | EntityType::Reminder => None,
+ | EntityType::CalendarEvent => None,
}
}
diff --git a/crates/graphql_soup/src/inputs.rs b/crates/graphql_soup/src/inputs.rs
index ed7f3f8aca..b0740a6354 100644
--- a/crates/graphql_soup/src/inputs.rs
+++ b/crates/graphql_soup/src/inputs.rs
@@ -23,6 +23,7 @@ use item_filters::{
foreign_entity::ForeignEntityLiteral,
project::ProjectLiteral,
properties::PropertyEntityType,
+ reminder::ReminderLiteral,
},
};
use macro_user_id::{cowlike::CowLike, email::EmailStr, user_id::MacroUserIdStr};
@@ -387,6 +388,8 @@ struct GraphqlEntityFilterAst {
crm_company_filter: Option<GraphqlCrmCompanyExpr>,
/// The foreign entity filter to apply.
foreign_entity_filter: Option<GraphqlForeignEntityExpr>,
+ /// The reminder filter to apply.
+ reminder_filter: Option<GraphqlReminderExpr>,
/// The properties filter to apply.
properties_filter: Option<GraphqlPropertiesExpr>,
}
@@ -409,6 +412,7 @@ impl GraphqlEntityFilterAst {
call_filter: optional_tree(self.call_filter)?,
crm_company_filter: optional_tree(self.crm_company_filter)?,
foreign_entity_filter: optional_tree(self.foreign_entity_filter)?,
+ reminder_filter: optional_tree(self.reminder_filter)?,
properties_filter: optional_tree(self.properties_filter)?,
})
}
@@ -523,6 +527,13 @@ filter_expr_input!(
ForeignEntityLiteral,
"ForeignEntityFilterExpr"
);
+filter_expr_input!(
+ GraphqlReminderExpr,
+ GraphqlReminderBinaryExpr,
+ GraphqlReminderLiteral,
+ ReminderLiteral,
+ "ReminderFilterExpr"
+);
/// GraphQL input representing the email filter ast.
#[derive(async_graphql::InputObject)]
struct GraphqlEmailFilterAst {
@@ -1064,6 +1075,42 @@ impl GraphqlCallStatus {
}
}
+/// GraphQL input representing the reminder literal.
+#[derive(async_graphql::OneofObject)]
+enum GraphqlReminderLiteral {
+ /// Opt this query into reminders at all. Reminders are off by default, so
+ /// without this (or an `id`/`entity`) Soup omits them entirely — a filter
+ /// of only `completed` would otherwise silently match nothing. Must be
+ /// `true`; there is no literal for excluding reminders, that is the default.
+ Include(bool),
+ /// The id option.
+ Id(ID),
+ /// The referenced entity, as `"{type}:{id}"`.
+ Entity(String),
+ /// Whether the reminder has already fired.
+ Completed(bool),
+}
+
+impl IntoFilterExpr<ReminderLiteral> for GraphqlReminderLiteral {
+ /// Convert this value into the expr representation.
+ fn into_expr(self) -> async_graphql::Result<Expr<ReminderLiteral>> {
+ let literal = match self {
+ // `include: false` is the default, not a literal — accepting it
+ // would opt the query in, the opposite of what was asked.
+ Self::Include(false) => {
+ return Err(async_graphql::Error::new(
+ "reminder `include` must be true; omit the filter to exclude reminders",
+ ));
+ }
+ Self::Include(true) => ReminderLiteral::Include,
+ Self::Id(id) => ReminderLiteral::Id(parse_id(id, "id")?),
+ Self::Entity(entity) => ReminderLiteral::Entity(entity),
+ Self::Completed(completed) => ReminderLiteral::Completed(completed),
+ };
+ Ok(Expr::val(literal))
+ }
+}
+
/// GraphQL input representing the crm company literal.
#[derive(async_graphql::OneofObject)]
enum GraphqlCrmCompanyLiteral {
diff --git a/crates/graphql_soup/src/loaders.rs b/crates/graphql_soup/src/loaders.rs
index e6316c09a3..ba7bdd2006 100644
--- a/crates/graphql_soup/src/loaders.rs
+++ b/crates/graphql_soup/src/loaders.rs
@@ -27,6 +27,7 @@ use item_filters::ast::{
email::EmailLiteral,
foreign_entity::ForeignEntityLiteral,
project::ProjectLiteral,
+ reminder::ReminderLiteral,
};
use macro_user_id::user_id::MacroUserIdStr;
use model_entity::{Entity, EntityType};
@@ -337,6 +338,7 @@ fn entity_filter_ast(entities: &[Entity<'static>]) -> Result<EntityFilterAst, So
let mut crm_companies = Vec::new();
let mut foreign_entities = Vec::new();
let mut calendar_events = Vec::new();
+ let mut reminders = Vec::new();
for entity in entities {
let id = Uuid::parse_str(entity.entity_id.as_ref()).map_err(|error| {
@@ -360,12 +362,11 @@ fn entity_filter_ast(entities: &[Entity<'static>]) -> Result<EntityFilterAst, So
EntityType::CrmCompany => crm_companies.push(CrmCompanyLiteral::Id(id)),
EntityType::ForeignEntity => foreign_entities.push(ForeignEntityLiteral::Id(id)),
EntityType::CalendarEvent => calendar_events.push(CalendarEventLiteral::Id(id)),
+ EntityType::Reminder => reminders.push(ReminderLiteral::Id(id)),
EntityType::User
| EntityType::Team
| EntityType::StaticFile
- | EntityType::CrmContact
- // Reminders are not a Soup entity yet.
- | EntityType::Reminder => {
+ | EntityType::CrmContact => {
return Err(rootcause::report!(
"entity type {} is not represented in Soup",
entity.entity_type
@@ -396,6 +397,7 @@ fn entity_filter_ast(entities: &[Entity<'static>]) -> Result<EntityFilterAst, So
foreign_entities,
ForeignEntityLiteral::Id(nil),
)),
+ reminder_filter: Some(literal_tree(reminders, ReminderLiteral::Id(nil))),
properties_filter: None,
})
}
diff --git a/crates/graphql_soup/src/objects.rs b/crates/graphql_soup/src/objects.rs
index 8c7b6c207c..e678eaf47d 100644
--- a/crates/graphql_soup/src/objects.rs
+++ b/crates/graphql_soup/src/objects.rs
@@ -23,6 +23,7 @@ use models_soup::{
foreign_entity::SoupForeignEntity,
item::SoupItem,
project::SoupProject,
+ reminder::{SoupReminder, SoupReminderSchedule},
};
use serde_json::Value;
use soup::domain::models::{EnrichedSoupItem, SoupPropertiesField, grouping::NestedSoupGroups};
@@ -183,6 +184,7 @@ impl<E: SoupEntityEdges> GraphqlSoupEntity<E> {
Self::ForeignEntity(entity) => entity.2 = score,
// Calendar events carry no frecency slot; scores never target them.
Self::CalendarEvent(_) => {}
+ Self::Reminder(entity) => entity.2 = score,
}
self
}
@@ -284,6 +286,8 @@ pub enum GraphqlSoupEntity<E: SoupEntityEdges> {
CrmCompany(GraphqlSoupCrmCompany<E>),
/// Foreign entity.
ForeignEntity(GraphqlSoupForeignEntity<E>),
+ /// Reminder entity.
+ Reminder(GraphqlSoupReminder<E>),
}
impl<E> GraphqlSoupEntity<E>
@@ -307,6 +311,7 @@ where
GraphqlSoupEntityType::CrmCompany => GraphqlSoupCrmCompany::<E>::type_name(),
GraphqlSoupEntityType::ForeignEntity => GraphqlSoupForeignEntity::<E>::type_name(),
GraphqlSoupEntityType::CalendarEvent => GraphqlSoupCalendarEvent::<E>::type_name(),
+ GraphqlSoupEntityType::Reminder => GraphqlSoupReminder::<E>::type_name(),
}
.into_owned(),
)
@@ -375,6 +380,12 @@ where
);
Self::ForeignEntity(GraphqlSoupForeignEntity(item, edges, None))
}
+ SoupItem::Reminder(item) => {
+ let edges = E::from_entity(
+ model_entity::EntityType::Reminder.with_entity_string(item.id.to_string()),
+ );
+ Self::Reminder(GraphqlSoupReminder(item, edges, None))
+ }
}
}
}
@@ -1774,6 +1785,140 @@ where
}
}
+/// How often a reminder fires.
+#[derive(async_graphql::Enum, Copy, Clone, Eq, PartialEq)]
+pub enum GraphqlReminderScheduleType {
+ /// Fires once, at `remindAt`.
+ Once,
+ /// Fires repeatedly, on `cron` evaluated in `timezone`.
+ Recurring,
+}
+
+/// GraphQL reminder entity.
+pub struct GraphqlSoupReminder<E: SoupEntityEdges>(SoupReminder<()>, E, Option<f64>);
+
+/// GraphQL representation of the soup reminder.
+#[Object(name = "GraphqlSoupReminder")]
+impl<E> GraphqlSoupReminder<E>
+where
+ E: SoupEntityEdges,
+{
+ /// The unique identifier.
+ async fn id(&self) -> ID {
+ ID(self.0.id.to_string())
+ }
+
+ /// Canonical entity kind.
+ async fn entity_type(&self) -> GraphqlSoupEntityType {
+ GraphqlSoupEntityType::Reminder
+ }
+
+ /// User-visible display name — a reminder's description is its name.
+ async fn display_name(&self) -> Option<String> {
+ Some(self.0.description.clone())
+ }
+
+ /// Common reminder metadata.
+ ///
+ /// `owner_id` is absent because a reminder is only ever readable by its
+ /// owner, and `parent` because a reminder is not contained by the entity it
+ /// references — see [`Self::referenced_entity`].
+ async fn metadata(&self) -> GraphqlEntityMetadata {
+ GraphqlEntityMetadata {
+ owner_id: None,
+ parent: None,
+ created_at: Some(self.0.created_at.to_rfc3339()),
+ updated_at: Some(self.0.updated_at.to_rfc3339()),
+ viewed_at: None,
+ deleted_at: None,
+ }
+ }
+
+ /// The entity this reminder is about, when it is attached to one.
+ ///
+ /// Only the reference is returned; the client resolves it into a Soup item
+ /// through the edges that already exist for that entity type.
+ async fn referenced_entity(&self) -> Option<GraphqlEntity<'static>> {
+ self.0
+ .referenced_entity
+ .as_ref()
+ .map(|r| graphql_entity(r.entity_type, &r.id))
+ }
+
+ /// What to remind the user about.
+ async fn description(&self) -> &str {
+ &self.0.description
+ }
+
+ /// Whether the reminder fires once or repeatedly.
+ async fn schedule_type(&self) -> GraphqlReminderScheduleType {
+ match self.0.schedule {
+ SoupReminderSchedule::Once { .. } => GraphqlReminderScheduleType::Once,
+ SoupReminderSchedule::Recurring { .. } => GraphqlReminderScheduleType::Recurring,
+ }
+ }
+
+ /// The instant a one-shot reminder fires at, in RFC 3339 format.
+ async fn remind_at(&self) -> Option<String> {
+ match &self.0.schedule {
+ SoupReminderSchedule::Once { remind_at } => Some(remind_at.to_rfc3339()),
+ SoupReminderSchedule::Recurring { .. } => None,
+ }
+ }
+
+ /// The cron expression a recurring reminder fires on.
+ async fn cron(&self) -> Option<&str> {
+ match &self.0.schedule {
+ SoupReminderSchedule::Recurring { cron, .. } => Some(cron),
+ SoupReminderSchedule::Once { .. } => None,
+ }
+ }
+
+ /// The timezone a recurring reminder's cron is evaluated in.
+ async fn timezone(&self) -> Option<&str> {
+ match &self.0.schedule {
+ SoupReminderSchedule::Recurring { timezone, .. } => Some(timezone),
+ SoupReminderSchedule::Once { .. } => None,
+ }
+ }
+
+ /// The next firing, in RFC 3339 format. Soup orders reminders on this.
+ async fn next_run_at(&self) -> String {
+ self.0.next_run_at.to_rfc3339()
+ }
+
+ /// When false, the dispatcher skips this reminder.
+ async fn enabled(&self) -> bool {
+ self.0.enabled
+ }
+
+ /// When a one-shot reminder fired, in RFC 3339 format.
+ async fn completed_at(&self) -> Option<String> {
+ self.0.completed_at.map(|ts| ts.to_rfc3339())
+ }
+
+ /// The created timestamp in RFC 3339 format.
+ async fn created_at(&self) -> String {
+ self.0.created_at.to_rfc3339()
+ }
+
+ /// The updated timestamp in RFC 3339 format.
+ async fn updated_at(&self) -> String {
+ self.0.updated_at.to_rfc3339()
+ }
+
+ #[graphql(flatten)]
+ /// The edges.
+ async fn edges(&self) -> E {
+ self.1.clone()
+ }
+
+ /// The viewer's frecency score for this entity, when loaded.
+ async fn frecency_score(&self) -> Option<f64> {
+ self.2
+ }
+}
+
/// Implement interface-only dispatch methods for fields whose concrete
/// GraphQL definitions are supplied by the flattened edge object.
macro_rules! impl_common_interface_edges {
@@ -1828,6 +1973,7 @@ impl_common_interface_edges!(
GraphqlSoupCall,
GraphqlSoupCrmCompany,
GraphqlSoupForeignEntity,
+ GraphqlSoupReminder,
);
/// Realtime Soup patch represented as exactly one update or cache deletion.
diff --git a/crates/item_filters/src/ast.rs b/crates/item_filters/src/ast.rs
index 3aa1eaa42f..9a0203ecee 100644
--- a/crates/item_filters/src/ast.rs
+++ b/crates/item_filters/src/ast.rs
@@ -4,7 +4,7 @@
use crate::{
CalendarEventFilters, CallFilters, ChannelFilters, ChannelThreadFilters, ChatFilters,
CrmCompanyFilters, DocumentFilters, EmailFilters, EntityFilters, ForeignEntityFilters,
- ProjectFilters, PropertyFilter,
+ ProjectFilters, PropertyFilter, ReminderFilters,
ast::{
calendar_event::CalendarEventLiteral,
call::CallLiteral,
@@ -15,6 +15,7 @@ use crate::{
foreign_entity::ForeignEntityLiteral,
project::ProjectLiteral,
properties::PropertiesLiteral,
+ reminder::ReminderLiteral,
},
};
use document::DocumentLiteral;
@@ -46,6 +47,8 @@ pub mod foreign_entity;
pub mod project;
/// contains the ast literal value for property-based filtering
pub mod properties;
+/// contains the ast literal value for reminders
+pub mod reminder;
#[cfg(test)]
mod tests;
@@ -219,6 +222,10 @@ pub struct EntityFilterAst {
#[serde(default, rename = "fef")]
#[cfg_attr(feature = "schema", schema(value_type = serde_json::Value))]
pub foreign_entity_filter: LiteralTree<ForeignEntityLiteral>,
+ /// the filters that should be applied to reminders
+ #[serde(default, rename = "remf")]
+ #[cfg_attr(feature = "schema", schema(value_type = serde_json::Value))]
+ pub reminder_filter: LiteralTree<ReminderLiteral>,
/// the filters that should be applied based on entity properties
#[serde(default, rename = "propf")]
#[cfg_attr(feature = "schema", schema(value_type = serde_json::Value))]
@@ -268,6 +275,8 @@ impl EntityFilterAst {
entity_filter.foreign_entity_filters,
)?
.map(Arc::new),
+ reminder_filter: ReminderFilters::expand_ast(entity_filter.reminder_filters)?
+ .map(Arc::new),
properties_filter: Vec::<PropertyFilter>::expand_ast(entity_filter.property_filters)?
.map(Arc::new),
}))
@@ -305,6 +314,7 @@ impl EntityFilterAst {
call_filter: None,
crm_company_filter: None,
foreign_entity_filter: None,
+ reminder_filter: None,
properties_filter: None,
}
}
@@ -338,6 +348,7 @@ impl IsEmpty for EntityFilterAst {
call_filter,
crm_company_filter,
foreign_entity_filter,
+ reminder_filter,
properties_filter,
} = self;
calendar_event_filter.is_none()
@@ -350,6 +361,7 @@ impl IsEmpty for EntityFilterAst {
&& call_filter.is_none()
&& crm_company_filter.is_none()
&& foreign_entity_filter.is_none()
+ && reminder_filter.is_none()
&& properties_filter.is_none()
}
}
diff --git a/crates/item_filters/src/ast/reminder.rs b/crates/item_filters/src/ast/reminder.rs
new file mode 100644
index 0000000000..cd6a08db4a
--- /dev/null
+++ b/crates/item_filters/src/ast/reminder.rs
@@ -0,0 +1,59 @@
+use filter_ast::{ExpandFrame, Expr, FoldTree, TryExpandNode};
+use serde::{Deserialize, Serialize};
+use uuid::Uuid;
+
+use crate::{ReminderFilters, ast::ExpandErr};
+
+/// The possible literal values in a reminder filter AST.
+#[derive(Debug, Serialize, Deserialize, Clone)]
+pub enum ReminderLiteral {
+ /// Opt this query into reminders at all.
+ ///
+ /// Unlike every other Soup entity type, reminders are **off by default** —
+ /// a query that says nothing about them gets none. Views that want them ask
+ /// explicitly, so adding reminders did not change what existing Soup views
+ /// return. Asking for specific ids or entities also counts as opting in.
+ #[serde(rename = "inc")]
+ Include,
+ /// Filter by reminder id.
+ #[serde(rename = "id")]
+ Id(Uuid),
+ /// Filter to reminders attached to this entity, as `"{type}:{id}"`.
+ #[serde(rename = "ent")]
+ Entity(String),
+ /// Filter by whether the reminder has already fired.
+ #[serde(rename = "comp")]
+ Completed(bool),
+}
+
+impl ExpandFrame<ReminderLiteral> for ReminderFilters {
+ type Err = ExpandErr;
+
+ fn expand_ast(
+ filter_request: ReminderFilters,
+ ) -> Result<Option<Expr<ReminderLiteral>>, Self::Err> {
+ let ReminderFilters {
+ include,
+ ids,
+ entities,
+ completed,
+ } = filter_request;
+
+ let include = include.then_some(Expr::val(ReminderLiteral::Include));
+
+ let ids = ids
+ .iter()
+ .map(|s| Uuid::parse_str(s))
+ .try_expand(|r| r.map(ReminderLiteral::Id), Expr::or)?;
+
+ let entities = entities
+ .into_iter()
+ .expand(ReminderLiteral::Entity, Expr::or);
+
+ let completed = completed.map(|c| Expr::val(ReminderLiteral::Completed(c)));
+
+ Ok([include, ids, entities, completed]
+ .into_iter()
+ .fold_with(Expr::and))
+ }
+}
diff --git a/crates/item_filters/src/lib.rs b/crates/item_filters/src/lib.rs
index 2820586687..b958e9ac88 100644
--- a/crates/item_filters/src/lib.rs
+++ b/crates/item_filters/src/lib.rs
@@ -404,6 +404,38 @@ impl IsEmpty for CalendarEventFilters {
}
}
+/// Filters for reminders.
+#[derive(Debug, Serialize, Deserialize, Default, PartialEq, Clone)]
+#[cfg_attr(feature = "schema", derive(utoipa::ToSchema, schemars::JsonSchema))]
+pub struct ReminderFilters {
+ /// Opt this query into reminders at all. Reminders are off by default —
+ /// see [`crate::ast::reminder::ReminderLiteral::Include`]. Asking for
+ /// specific `ids` or `entities` also opts in.
+ #[serde(default, skip_serializing_if = "std::ops::Not::not")]
+ pub include: bool,
+ /// Reminder ids to filter by. Empty to include all of the caller's reminders.
+ #[serde(default, skip_serializing_if = "Vec::is_empty")]
+ pub ids: Vec<String>,
+ /// Restrict to reminders attached to these entities, each `"{type}:{id}"`.
+ #[serde(default, skip_serializing_if = "Vec::is_empty")]
+ pub entities: Vec<String>,
+ /// Filter on whether the reminder has already fired. `None` returns both.
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub completed: Option<bool>,
+}
+
+impl IsEmpty for ReminderFilters {
+ fn is_empty(&self) -> bool {
+ let ReminderFilters {
+ include,
+ ids,
+ entities,
+ completed,
+ } = self;
+ !include && ids.is_empty() && entities.is_empty() && completed.is_none()
+ }
+}
+
/// Filters for foreign entity records.
#[derive(Debug, Serialize, Deserialize, Default, PartialEq, Clone)]
#[cfg_attr(feature = "schema", derive(utoipa::ToSchema, schemars::JsonSchema))]
@@ -699,6 +731,9 @@ pub struct EntityFilters {
/// the bundled [ForeignEntityFilters]
#[serde(default)]
pub foreign_entity_filters: ForeignEntityFilters,
+ /// the bundled [ReminderFilters]
+ #[serde(default)]
+ pub reminder_filters: ReminderFilters,
/// property-based filters applied across entity types
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub property_filters: Vec<PropertyFilter>,
@@ -726,6 +761,7 @@ impl IsEmpty for EntityFilters {
email_filters,
crm_company_filters,
foreign_entity_filters,
+ reminder_filters,
property_filters,
tag_option_ids,
// Mode is a modifier on tag_option_ids, not a filter by itself.
@@ -741,6 +777,7 @@ impl IsEmpty for EntityFilters {
&& email_filters.is_empty()
&& crm_company_filters.is_empty()
&& foreign_entity_filters.is_empty()
+ && reminder_filters.is_empty()
&& property_filters.iter().all(IsEmpty::is_empty)
&& tag_option_ids.is_empty()
}
diff --git a/crates/memory/Cargo.toml b/crates/memory/Cargo.toml
index 780f3d82b9..5548989186 100644
--- a/crates/memory/Cargo.toml
+++ b/crates/memory/Cargo.toml
@@ -23,6 +23,7 @@ macro_authorization = { path = "../macro_authorization", default-features = fals
] }
macro_user_id = { path = "../macro_user_id" }
macro_uuid = { path = "../macro_uuid" }
+reminders = { path = "../reminders", default-features = false, features = ["ports"] }
serde = { workspace = true }
serde_json = { workspace = true }
sqlx = { workspace = true }
diff --git a/crates/memory/src/context.rs b/crates/memory/src/context.rs
index e9bb150ccc..2cf2f64356 100644
--- a/crates/memory/src/context.rs
+++ b/crates/memory/src/context.rs
@@ -109,6 +109,7 @@ pub async fn build_tool_service_context(
),
crm::domain::service::NoOpCrmService,
foreign_entity_service,
+ reminders::domain::service::NoOpRemindersService,
));
// Document tool context
diff --git a/crates/models_soup/Cargo.toml b/crates/models_soup/Cargo.toml
index f463e12865..c5457a1bce 100644
--- a/crates/models_soup/Cargo.toml
+++ b/crates/models_soup/Cargo.toml
@@ -23,6 +23,7 @@ model = { path = "../model" }
model-entity = { path = "../model-entity" }
models_pagination = { path = "../models_pagination" }
models_properties = { path = "../models_properties" }
+reminders = { path = "../reminders", default-features = false }
serde = { workspace = true }
serde_json = { workspace = true }
strum = { workspace = true }
diff --git a/crates/models_soup/src/item.rs b/crates/models_soup/src/item.rs
index 8fe0c5a270..ae6e1a8afe 100644
--- a/crates/models_soup/src/item.rs
+++ b/crates/models_soup/src/item.rs
@@ -5,6 +5,7 @@ use crate::document::SoupDocument;
use crate::email_thread::SoupEnrichedEmailThreadPreview;
use crate::foreign_entity::SoupForeignEntity;
use crate::project::SoupProject;
+use crate::reminder::SoupReminder;
use crate::{
chat::SoupChat,
comms::{SoupChannel, SoupChannelThread},
@@ -44,6 +45,8 @@ pub enum SoupItem<T = ()> {
CrmCompany(SoupCrmCompany<T>),
/// Foreign entity item.
ForeignEntity(SoupForeignEntity),
+ /// Reminder item.
+ Reminder(SoupReminder<T>),
}
impl<T> SoupItem<T> {
@@ -80,6 +83,9 @@ impl<T> SoupItem<T> {
SoupItem::ForeignEntity(foreign_entity) => {
EntityType::ForeignEntity.with_entity_string(foreign_entity.id.to_string())
}
+ SoupItem::Reminder(reminder) => {
+ EntityType::Reminder.with_entity_string(reminder.id.to_string())
+ }
}
}
@@ -97,6 +103,7 @@ impl<T> SoupItem<T> {
SoupItem::CalendarEvent(event) => event.updated_at,
SoupItem::CrmCompany(company) => company.updated_at,
SoupItem::ForeignEntity(foreign_entity) => foreign_entity.updated_at,
+ SoupItem::Reminder(reminder) => reminder.updated_at,
}
}
@@ -172,6 +179,10 @@ impl<T> SoupItem<T> {
foreign_entity.created_at
}
(SoupItem::ForeignEntity(foreign_entity), _) => foreign_entity.updated_at,
+ // Reminders always order by when they fire, whatever sort was asked
+ // for — the same way emails always use their precomputed sort_ts.
+ // No other ordering means anything for a reminder.
+ (SoupItem::Reminder(reminder), _) => reminder.next_run_at,
}
}
@@ -211,6 +222,7 @@ impl<T> SoupItem<T> {
PropertiesEntityType::Company,
)),
SoupItem::ForeignEntity(_) => None,
+ SoupItem::Reminder(_) => None,
}
}
@@ -412,6 +424,29 @@ impl<T> SoupItem<T> {
SoupItem::ForeignEntity(soup_foreign_entity) => {
SoupItem::ForeignEntity(soup_foreign_entity)
}
+ SoupItem::Reminder(SoupReminder {
+ id,
+ description,
+ referenced_entity,
+ schedule,
+ next_run_at,
+ enabled,
+ completed_at,
+ created_at,
+ updated_at,
+ extra,
+ }) => SoupItem::Reminder(SoupReminder {
+ id,
+ description,
+ referenced_entity,
+ schedule,
+ next_run_at,
+ enabled,
+ completed_at,
+ created_at,
+ updated_at,
+ extra: f(extra),
+ }),
}
}
}
@@ -431,6 +466,7 @@ impl<T> Identify for SoupItem<T> {
SoupItem::CalendarEvent(event) => event.id,
SoupItem::CrmCompany(company) => company.id,
SoupItem::ForeignEntity(foreign_entity) => foreign_entity.id,
+ SoupItem::Reminder(reminder) => reminder.id,
}
}
}
diff --git a/crates/models_soup/src/lib.rs b/crates/models_soup/src/lib.rs
index ab022e0c7c..8144590944 100644
--- a/crates/models_soup/src/lib.rs
+++ b/crates/models_soup/src/lib.rs
@@ -24,5 +24,7 @@ pub mod item;
pub mod project;
/// Property models attached to Soup items.
pub mod properties;
+/// Reminder models for Soup responses.
+pub mod reminder;
pub use properties::SoupProperty;
diff --git a/crates/models_soup/src/reminder.rs b/crates/models_soup/src/reminder.rs
new file mode 100644
index 0000000000..86a9f60d01
--- /dev/null
+++ b/crates/models_soup/src/reminder.rs
@@ -0,0 +1,150 @@
+use chrono::{DateTime, Utc};
+use model_entity::{Entity, EntityType};
+use reminders::domain::models::{Reminder, ReminderForSoup, ReminderSchedule};
+use serde::{Deserialize, Serialize};
+use uuid::Uuid;
+
+/// How often a reminder fires, flattened for the wire.
+///
+/// The domain's [`ReminderSchedule`] is an internally-tagged enum carrying a
+/// validated cron type; Soup only needs enough to render "once" vs "every
+/// weekday at 9am", so the cron is exposed as a plain string.
+#[derive(Clone, Debug, Serialize, Deserialize)]
+#[cfg_attr(feature = "schema", derive(utoipa::ToSchema))]
+#[serde(rename_all = "camelCase", tag = "type")]
+pub enum SoupReminderSchedule {
+ /// Fires once, at a fixed instant.
+ #[serde(rename_all = "camelCase")]
+ Once {
+ /// The instant to fire at.
+ remind_at: DateTime<Utc>,
+ },
+ /// Fires repeatedly, on a cron schedule evaluated in `timezone`.
+ #[serde(rename_all = "camelCase")]
+ Recurring {
+ /// Cron expression, normalized to the 6-field form.
+ cron: String,
+ /// The timezone the cron expression is evaluated in.
+ timezone: String,
+ },
+}
+
+impl From<ReminderSchedule> for SoupReminderSchedule {
+ fn from(schedule: ReminderSchedule) -> Self {
+ match schedule {
+ ReminderSchedule::Once { remind_at } => Self::Once { remind_at },
+ ReminderSchedule::Recurring { cron, timezone } => Self::Recurring {
+ cron: cron.as_str().to_string(),
+ timezone: timezone.to_string(),
+ },
+ }
+ }
+}
+
+/// The entity a reminder is about, resolved server-side.
+///
+/// A reminder has no block of its own — it opens, and is iconed as, whatever it
+/// references. Which block that is depends on the referenced document's file
+/// type, and the client's icon path is synchronous, so this is resolved here
+/// rather than costing a fetch per row.
+#[derive(Clone, Debug, Serialize, Deserialize)]
+#[cfg_attr(feature = "schema", derive(utoipa::ToSchema))]
+#[serde(rename_all = "camelCase")]
+pub struct SoupReminderReference {
+ /// The referenced entity's id.
+ pub id: String,
+ /// The referenced entity's type.
+ #[cfg_attr(feature = "schema", schema(inline))]
+ pub entity_type: EntityType,
+ /// File type, when the reference is a document — `md`, `pdf`, and so on.
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub file_type: Option<String>,
+ /// Sub type, when the reference is a task or snippet document.
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub sub_type: Option<String>,
+}
+
+/// A reminder as displayed in Soup.
+///
+/// Reminders are user-owned rather than shared, so unlike most Soup items they
+/// carry no access metadata — the repository only ever returns the caller's own.
+#[derive(Clone, Debug, Serialize, Deserialize)]
+#[cfg_attr(feature = "schema", derive(utoipa::ToSchema))]
+#[serde(rename_all = "camelCase")]
+pub struct SoupReminder<T = ()> {
+ /// The reminder id.
+ pub id: Uuid,
+ /// What to remind the user about. Doubles as the display name.
+ pub description: String,
+ /// The entity this reminder is about, when attached to one, with enough
+ /// detail for the client to render and open it without a second fetch.
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub referenced_entity: Option<SoupReminderReference>,
+ /// When and how often the reminder fires.
+ pub schedule: SoupReminderSchedule,
+ /// The next firing. This is what Soup sorts reminders on.
+ pub next_run_at: DateTime<Utc>,
+ /// When false, the dispatcher skips this reminder.
+ pub enabled: bool,
+ /// Set once a one-shot reminder has fired.
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub completed_at: Option<DateTime<Utc>>,
+ /// When the reminder was created.
+ pub created_at: DateTime<Utc>,
+ /// When the reminder was last modified.
+ pub updated_at: DateTime<Utc>,
+ /// Extra fields passed from above
+ #[serde(flatten)]
+ pub extra: T,
+}
+
+impl<T> SoupReminder<T> {
+ /// The entity this reminder is about, when it is attached to one.
+ pub fn entity(&self) -> Option<Entity<'_>> {
+ self.referenced_entity
+ .as_ref()
+ .map(|r| r.entity_type.with_entity_str(&r.id))
+ }
+}
+
+impl From<ReminderForSoup> for SoupReminder<()> {
+ fn from(row: ReminderForSoup) -> Self {
+ let ReminderForSoup {
+ reminder,
+ reference,
+ } = row;
+ let Reminder {
+ id,
+ description,
+ entity_type,
+ entity_id,
+ schedule,
+ next_run_at,
+ enabled,
+ completed_at,
+ created_at,
+ updated_at,
+ } = reminder;
+ let referenced_entity = match (entity_type, entity_id) {
+ (Some(entity_type), Some(id)) => Some(SoupReminderReference {
+ id,
+ entity_type,
+ file_type: reference.as_ref().and_then(|r| r.file_type.clone()),
+ sub_type: reference.and_then(|r| r.sub_type),
+ }),
+ _ => None,
+ };
+ SoupReminder {
+ id,
+ description,
+ referenced_entity,
+ schedule: schedule.into(),
+ next_run_at,
+ enabled,
+ completed_at,
+ created_at,
+ updated_at,
+ extra: (),
+ }
+ }
+}
diff --git a/crates/notification/src/domain/models/request.rs b/crates/notification/src/domain/models/request.rs
index 5fad9f98c5..82d61720c3 100644
--- a/crates/notification/src/domain/models/request.rs
+++ b/crates/notification/src/domain/models/request.rs
@@ -30,6 +30,7 @@ pub enum NotificationItemType {
Call,
Task,
Github,
+ Reminder,
}
impl NotificationItemType {
@@ -44,6 +45,7 @@ impl NotificationItemType {
Self::Call => "call",
Self::Task => "task",
Self::Github => "github",
+ Self::Reminder => "reminder",
}
}
}
diff --git a/crates/notification/src/outbound/repository.rs b/crates/notification/src/outbound/repository.rs
index 3257600dd4..6793a694ad 100644
--- a/crates/notification/src/outbound/repository.rs
+++ b/crates/notification/src/outbound/repository.rs
@@ -253,6 +253,10 @@ fn push_include_types_filter(builder: &mut QueryBuilder<'_, Postgres>, include_t
.iter()
.any(|t| t == "github")
.then_some(GITHUB_EVENT_TYPES_SQL),
+ include_types
+ .iter()
+ .any(|t| t == "reminder")
+ .then_some("n.event_item_type = 'reminder'"),
]
.into_iter()
.flatten()
@@ -301,6 +305,10 @@ fn push_entities_filter<'a>(builder: &mut QueryBuilder<'a, Postgres>, entity_tok
builder.push_bind(entity_tokens);
builder.push(")) OR ");
+ builder.push("(n.event_item_type = 'reminder' AND 'reminder:' || n.event_item_id = ANY(");
+ builder.push_bind(entity_tokens);
+ builder.push(")) OR ");
+
builder.push("(n.event_item_type = 'foreign_entity' AND ");
builder.push(GITHUB_EVENT_TYPES_SQL);
builder.push(" AND 'github:' || n.event_item_id = ANY(");
@@ -360,6 +368,7 @@ fn notification_ref_matches_row(
event_item_type == "foreign_entity"
&& notification_event_type_is_github(notification_event_type)
}
+ NotificationItemType::Reminder => event_item_type == "reminder",
NotificationItemType::Message => false,
}
}
diff --git a/crates/reminders/src/domain/models.rs b/crates/reminders/src/domain/models.rs
index b567a705dd..92c4dccd11 100644
--- a/crates/reminders/src/domain/models.rs
+++ b/crates/reminders/src/domain/models.rs
@@ -5,7 +5,7 @@ mod test;
use std::str::FromStr;
-use chrono::{DateTime, Utc};
+use chrono::{DateTime, Timelike, Utc};
use chrono_tz::Tz;
use cron::Schedule as CronSchedule;
use macro_user_id::user_id::MacroUserIdStr;
@@ -79,6 +79,13 @@ fn truncate_to_micros(at: DateTime<Utc>) -> DateTime<Utc> {
DateTime::from_timestamp_micros(at.timestamp_micros()).unwrap_or(at)
}
+/// Drop everything finer than a minute.
+fn floor_to_minute(at: DateTime<Utc>) -> DateTime<Utc> {
+ at.with_second(0)
+ .and_then(|at| at.with_nanosecond(0))
+ .unwrap_or(at)
+}
+
/// Promote a conventional 5-field cron to the 6-field form the `cron` crate
/// parses. Anything else is passed through for `cron` to accept or reject.
fn normalize_cron(cron: String) -> String {
@@ -131,6 +138,25 @@ impl ReminderSchedule {
pub fn repeats(&self) -> bool {
matches!(self, Self::Recurring { .. })
}
+
+ /// Drop sub-minute precision from a one-shot firing.
+ ///
+ /// "Remind me in ten minutes" at 16:06:32 means 16:16, not 16:16:32. The
+ /// seconds are an artifact of when the request happened to be sent, they
+ /// are not something the owner chose, and a reminder that fires at a ragged
+ /// time reads as a bug.
+ ///
+ /// Recurring schedules are left alone: their seconds come from a cron the
+ /// owner wrote, so `30 0 9 * * *` means 09:00:30 and flooring it would
+ /// quietly ignore what they asked for.
+ pub fn floored_to_minute(self) -> Self {
+ match self {
+ Self::Once { remind_at } => Self::Once {
+ remind_at: floor_to_minute(remind_at),
+ },
+ recurring @ Self::Recurring { .. } => recurring,
+ }
+ }
}
/// A reminder belonging to a user.
@@ -160,7 +186,8 @@ pub struct Reminder {
pub next_run_at: DateTime<Utc>,
/// When false, the dispatcher skips this reminder.
pub enabled: bool,
- /// Set once a one-shot reminder has fired.
+ /// Set once the owner marks the reminder as dealt with. Firing does not
+ /// set it — a delivered reminder is waiting on its owner, not finished.
#[serde(skip_serializing_if = "Option::is_none")]
pub completed_at: Option<DateTime<Utc>>,
/// When the reminder was created.
@@ -169,6 +196,15 @@ pub struct Reminder {
pub updated_at: DateTime<Utc>,
}
+/// The `"{type}:{id}"` token identifying a reminder's referenced entity.
+///
+/// Soup filters on these rather than on a pair of columns, so the format is
+/// defined here and mirrored by `entity_type || ':' || entity_id` in the
+/// repository's Soup query.
+pub fn entity_token(entity: &Entity<'_>) -> String {
+ format!("{}:{}", entity.entity_type.as_ref(), entity.entity_id)
+}
+
impl Reminder {
/// The associated entity, when the reminder is attached to one.
pub fn entity(&self) -> Option<Entity<'_>> {
@@ -179,6 +215,35 @@ impl Reminder {
}
}
+/// Display details of the entity a reminder is about, resolved alongside the
+/// reminder itself.
+///
+/// A reminder has no block of its own — it opens, and is iconed as, whatever it
+/// references. Which block that is depends on the referenced document's file
+/// type, so resolving it client-side would mean a second fetch per row against
+/// a synchronous icon path. Reading it here keeps Soup to one round trip.
+///
+/// Only documents populate these; every other entity type is identified by its
+/// [`EntityType`] alone.
+#[derive(Debug, Clone, PartialEq, Eq, Default)]
+pub struct ReminderReference {
+ /// The referenced document's file type, e.g. `md` or `pdf`.
+ pub file_type: Option<String>,
+ /// The referenced document's sub type, e.g. `task` or `snippet`.
+ pub sub_type: Option<String>,
+}
+
+/// A reminder together with what it references, as Soup needs it.
+#[derive(Debug, Clone)]
+pub struct ReminderForSoup {
+ /// The reminder itself.
+ pub reminder: Reminder,
+ /// Details of [`Reminder::entity`], when it resolves to something readable.
+ /// `None` for a standalone reminder, a non-document entity, or a reference
+ /// that no longer exists.
+ pub reference: Option<ReminderReference>,
+}
+
/// The caller's reminders, soonest firing first.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "inbound", derive(utoipa::ToSchema))]
@@ -325,12 +390,21 @@ pub struct ReminderPatch {
pub schedule: Option<ReminderSchedule>,
/// Whether the dispatcher should consider this reminder.
pub enabled: Option<bool>,
+ /// Mark the reminder as dealt with (`true`) or live again (`false`).
+ ///
+ /// Separate from `enabled`: a disabled reminder is one the dispatcher
+ /// skips, while a completed one has been handled. Only the owner sets it —
+ /// firing does not, or a reminder would arrive already dealt with.
+ pub completed: Option<bool>,
}
impl ReminderPatch {
/// Whether the patch would change anything.
pub fn is_empty(&self) -> bool {
- self.description.is_none() && self.schedule.is_none() && self.enabled.is_none()
+ self.description.is_none()
+ && self.schedule.is_none()
+ && self.enabled.is_none()
+ && self.completed.is_none()
}
}
@@ -388,6 +462,8 @@ pub struct ReminderUpdate {
pub schedule: Option<ScheduleUpdate>,
/// Replacement enabled flag.
pub enabled: Option<bool>,
+ /// Replacement completed flag. See [`ReminderPatch::completed`].
+ pub completed: Option<bool>,
}
/// A reminder that is due to fire, with everything the dispatcher needs to
diff --git a/crates/reminders/src/domain/models/test.rs b/crates/reminders/src/domain/models/test.rs
index 01359430f5..028fb46f5d 100644
--- a/crates/reminders/src/domain/models/test.rs
+++ b/crates/reminders/src/domain/models/test.rs
@@ -439,3 +439,41 @@ fn an_unknown_operation_is_rejected() {
assert!(result.is_err());
}
+
+#[test]
+fn flooring_drops_sub_minute_precision_from_a_one_shot() {
+ // "Remind me in ten minutes" at 16:06:32 means 16:16, not 16:16:32.
+ let ragged = Utc
+ .with_ymd_and_hms(2026, 7, 1, 16, 16, 32)
+ .single()
+ .expect("unambiguous instant")
+ + chrono::Duration::nanoseconds(999);
+ let schedule = ReminderSchedule::Once { remind_at: ragged }.floored_to_minute();
+
+ let ReminderSchedule::Once { remind_at } = schedule else {
+ panic!("still a one-shot");
+ };
+ assert_eq!(remind_at, utc(2026, 7, 1, 16, 16));
+}
+
+#[test]
+fn flooring_leaves_an_already_flat_instant_alone() {
+ let flat = utc(2026, 7, 1, 16, 16);
+ let schedule = ReminderSchedule::Once { remind_at: flat }.floored_to_minute();
+
+ let ReminderSchedule::Once { remind_at } = schedule else {
+ panic!("still a one-shot");
+ };
+ assert_eq!(remind_at, flat);
+}
+
+#[test]
+fn flooring_leaves_a_cron_schedule_untouched() {
+ // The seconds in a cron are the owner's, not an artifact of request timing.
+ let schedule = ReminderSchedule::Recurring {
+ cron: ReminderCron::parse("30 0 9 * * *").expect("valid cron"),
+ timezone: New_York,
+ };
+
+ assert_eq!(schedule.clone().floored_to_minute(), schedule);
+}
diff --git a/crates/reminders/src/domain/ports.rs b/crates/reminders/src/domain/ports.rs
index 7b47dd0f0e..513fd7af51 100644
--- a/crates/reminders/src/domain/ports.rs
+++ b/crates/reminders/src/domain/ports.rs
@@ -7,8 +7,8 @@ use uuid::Uuid;
use crate::domain::models::{
CreateReminder, DeliveryOutcome, DueFiring, DueReminder, NewReminder, Reminder, ReminderBatch,
- ReminderDispatchMessage, ReminderError, ReminderFilter, ReminderPage, ReminderPatch,
- ReminderUpdate, SweepSummary,
+ ReminderDispatchMessage, ReminderError, ReminderFilter, ReminderForSoup, ReminderPage,
+ ReminderPatch, ReminderUpdate, SweepSummary,
};
/// Source of the current time.
@@ -66,6 +66,25 @@ pub trait RemindersRepo: Send + Sync + 'static {
limit: i64,
) -> impl Future<Output = Result<ReminderBatch, Self::Err>> + Send;
+ /// Read at most `limit` of the user's reminders for the Soup feed, ordered
+ /// by `next_run_at` descending to match Soup's global ordering.
+ ///
+ /// Deliberately separate from [`RemindersRepo::list_reminders`]: Soup pages
+ /// on its own cursor and sorts descending, whereas the CRUD list keysets
+ /// ascending on `(next_run_at, created_at, id)`. As in
+ /// [`RemindersRepo::list_reminders`], an undecodable row is skipped rather
+ /// than failing the whole read.
+ ///
+ /// An empty `ids`/`entities` slice means "no constraint", not "match none".
+ fn list_reminders_for_soup(
+ &self,
+ user_id: &MacroUserIdStr<'_>,
+ ids: &[Uuid],
+ entities: &[String],
+ completed: Option<bool>,
+ limit: i64,
+ ) -> impl Future<Output = Result<Vec<ReminderForSoup>, Self::Err>> + Send;
+
/// Apply `update` to one of the user's reminders, returning the new state.
fn update_reminder(
&self,
@@ -74,7 +93,14 @@ pub trait RemindersRepo: Send + Sync + 'static {
update: &ReminderUpdate,
) -> impl Future<Output = Result<Option<Reminder>, Self::Err>> + Send;
- /// Delete one of the user's reminders. Returns `true` when a row was removed.
+ /// Delete one of the user's reminders, retracting any notification it
+ /// already produced. Returns `true` when a row was removed.
+ ///
+ /// The retraction is part of this contract rather than a separate call so
+ /// the two cannot drift apart. A reminder *is* its notification's
+ /// `event_item`, so a notification outliving it would point at a row that
+ /// no longer exists: the Inbox would keep showing it, and clicking it would
+ /// resolve nothing. Both deletes happen in one transaction.
fn delete_reminder(
&self,
user_id: &MacroUserIdStr<'_>,
@@ -142,10 +168,13 @@ pub trait ReminderDispatchRepo: Send + Sync + 'static {
scheduled_for: DateTime<Utc>,
) -> impl Future<Output = Result<(), Self::Err>> + Send;
- /// Record the firing as delivered and complete the reminder, atomically.
+ /// Record the firing as delivered.
///
- /// Both halves together: a delivered firing must never leave its reminder
- /// still due, or the next sweep sends it again.
+ /// Marks the occurrence, not the reminder: delivery is not completion.
+ /// `completed_at` is the owner saying they are finished with a reminder,
+ /// and one that has just landed in their inbox is not. The sent occurrence
+ /// is what stops [`ReminderDispatchRepo::due_firings`] returning the firing
+ /// again.
fn complete_occurrence(
&self,
reminder_id: Uuid,
@@ -257,6 +286,23 @@ pub trait RemindersService: Send + Sync + 'static {
filter: ReminderFilter,
) -> impl Future<Output = Result<ReminderPage, ReminderError>> + Send;
+ /// List the user's reminders for the Soup feed.
+ ///
+ /// Soup owns pagination and ordering across every item type, so this
+ /// returns a plain bounded slice rather than a [`ReminderPage`].
+ ///
+ /// Unlike the single-reminder methods this takes a user id rather than a
+ /// receipt: Soup reads many reminders at once, so there is no one entity
+ /// to have proven access to.
+ fn list_reminders_for_soup(
+ &self,
+ user_id: &MacroUserIdStr<'_>,
+ ids: &[Uuid],
+ entities: &[String],
+ completed: Option<bool>,
+ limit: i64,
+ ) -> impl Future<Output = Result<Vec<ReminderForSoup>, ReminderError>> + Send;
+
/// Modify the reminder the receipt was minted for.
fn update_reminder(
&self,
diff --git a/crates/reminders/src/domain/service.rs b/crates/reminders/src/domain/service.rs
index 90a5524873..1b9f45315a 100644
--- a/crates/reminders/src/domain/service.rs
+++ b/crates/reminders/src/domain/service.rs
@@ -13,8 +13,8 @@ use uuid::Uuid;
use crate::domain::models::{
CreateReminder, MAX_DESCRIPTION_LEN, NewReminder, Reminder, ReminderBatch, ReminderCursor,
- ReminderError, ReminderFilter, ReminderPage, ReminderPatch, ReminderSchedule, ReminderUpdate,
- ScheduleUpdate,
+ ReminderError, ReminderFilter, ReminderForSoup, ReminderPage, ReminderPatch, ReminderSchedule,
+ ReminderUpdate, ScheduleUpdate,
};
use crate::domain::ports::{Clock, RemindersRepo, RemindersService, SystemClock};
@@ -89,6 +89,27 @@ fn derive_next_run_at(
})
}
+/// Check the schedule will fire, then store it at minute granularity.
+///
+/// Order matters. Flooring first would drag a request inside the current minute
+/// back into the past and reject it, but "remind me in thirty seconds" is a
+/// legitimate ask — it just fires on the next sweep rather than in thirty
+/// seconds, which is what minute granularity means.
+fn normalize_schedule(
+ schedule: ReminderSchedule,
+ now: DateTime<Utc>,
+) -> Result<(ReminderSchedule, DateTime<Utc>), ReminderError> {
+ let derived = derive_next_run_at(&schedule, now)?;
+ let schedule = schedule.floored_to_minute();
+ let next_run_at = match schedule {
+ // Same instant the schedule now carries, so the two cannot disagree.
+ ReminderSchedule::Once { remind_at } => remind_at,
+ // A cron's seconds are the owner's, so its firing is left as derived.
+ ReminderSchedule::Recurring { .. } => derived,
+ };
+ Ok((schedule, next_run_at))
+}
+
/// The entity a reminder attaches to, taken from the access receipt.
///
/// The receipt is the only source. A caller cannot name an entity it has not
@@ -163,7 +184,7 @@ where
let description = validate_description(description)?;
let entity = resolve_entity(user_id, entity_receipt)?;
- let next_run_at = derive_next_run_at(&schedule, self.clock.now())?;
+ let (schedule, next_run_at) = normalize_schedule(schedule, self.clock.now())?;
let new = NewReminder {
description,
@@ -265,6 +286,24 @@ where
})
}
+ #[tracing::instrument(err, skip(self))]
+ async fn list_reminders_for_soup(
+ &self,
+ user_id: &MacroUserIdStr<'_>,
+ ids: &[Uuid],
+ entities: &[String],
+ completed: Option<bool>,
+ limit: i64,
+ ) -> Result<Vec<ReminderForSoup>, ReminderError> {
+ // No re-probing on undecodable rows: Soup merges many item types and
+ // owns its own pagination, so a short slice is not a short page.
+ self.repo
+ .list_reminders_for_soup(user_id, ids, entities, completed, limit)
+ .await
+ .map_err(|e| rootcause::Report::new(e).into_dynamic())
+ .map_err(ReminderError::from)
+ }
+
#[tracing::instrument(err, skip(self, receipt, patch))]
async fn update_reminder(
&self,
@@ -280,12 +319,13 @@ where
description,
schedule,
enabled,
+ completed,
} = patch;
let description = description.map(validate_description).transpose()?;
let schedule = schedule
.map(|schedule| {
- let next_run_at = derive_next_run_at(&schedule, self.clock.now())?;
+ let (schedule, next_run_at) = normalize_schedule(schedule, self.clock.now())?;
Ok::<_, ReminderError>(ScheduleUpdate {
schedule,
next_run_at,
@@ -297,6 +337,7 @@ where
description,
schedule,
enabled,
+ completed,
};
self.repo
@@ -324,3 +365,63 @@ where
}
}
}
+
+/// No-op [`RemindersService`] for binaries that need to satisfy the bound but
+/// never surface reminders — the AI-facing services, whose tool surfaces
+/// force-filter reminders out anyway. `list_reminders_for_soup` returns empty;
+/// every other method panics. Swap for [`RemindersServiceImpl`] if you actually
+/// need reminders.
+#[derive(Clone, Debug)]
+pub struct NoOpRemindersService;
+
+impl RemindersService for NoOpRemindersService {
+ async fn create_reminder(
+ &self,
+ _user_id: &MacroUserIdStr<'_>,
+ _request: CreateReminder,
+ _entity_receipt: Option<EntityAccessReceipt<AnyEntityPermission>>,
+ ) -> Result<Reminder, ReminderError> {
+ unimplemented!("NoOpRemindersService.create_reminder")
+ }
+
+ async fn get_reminder(
+ &self,
+ _receipt: EntityAccessReceipt<OwnerAccessLevel>,
+ ) -> Result<Reminder, ReminderError> {
+ unimplemented!("NoOpRemindersService.get_reminder")
+ }
+
+ async fn list_reminders(
+ &self,
+ _user_id: &MacroUserIdStr<'_>,
+ _filter: ReminderFilter,
+ ) -> Result<ReminderPage, ReminderError> {
+ unimplemented!("NoOpRemindersService.list_reminders")
+ }
+
+ async fn list_reminders_for_soup(
+ &self,
+ _user_id: &MacroUserIdStr<'_>,
+ _ids: &[Uuid],
+ _entities: &[String],
+ _completed: Option<bool>,
+ _limit: i64,
+ ) -> Result<Vec<ReminderForSoup>, ReminderError> {
+ Ok(Vec::new())
+ }
+
+ async fn update_reminder(
+ &self,
+ _receipt: EntityAccessReceipt<OwnerAccessLevel>,
+ _patch: ReminderPatch,
+ ) -> Result<Reminder, ReminderError> {
+ unimplemented!("NoOpRemindersService.update_reminder")
+ }
+
+ async fn delete_reminder(
+ &self,
+ _receipt: EntityAccessReceipt<OwnerAccessLevel>,
+ ) -> Result<(), ReminderError> {
+ unimplemented!("NoOpRemindersService.delete_reminder")
+ }
+}
diff --git a/crates/reminders/src/domain/service/test.rs b/crates/reminders/src/domain/service/test.rs
index ee8d3125da..cb3a2f7c57 100644
--- a/crates/reminders/src/domain/service/test.rs
+++ b/crates/reminders/src/domain/service/test.rs
@@ -9,7 +9,9 @@ use entity_access::domain::models::{
use model_entity::EntityType;
use super::*;
-use crate::domain::models::{MAX_PAGE_SIZE, ReminderCron, RemindersList};
+use crate::domain::models::{
+ MAX_PAGE_SIZE, ReminderCron, ReminderForSoup, RemindersList, entity_token,
+};
const USER_A: &str = "macro|[email protected]";
const USER_B: &str = "macro|[email protected]";
@@ -287,6 +289,46 @@ impl RemindersRepo for FakeRemindersRepo {
Ok(batch)
}
+ async fn list_reminders_for_soup(
+ &self,
+ user_id: &MacroUserIdStr<'_>,
+ ids: &[Uuid],
+ entities: &[String],
+ completed: Option<bool>,
+ limit: i64,
+ ) -> Result<Vec<ReminderForSoup>, Self::Err> {
+ self.check_failing()?;
+ let mut found: Vec<Reminder> = self
+ .rows()
+ .into_iter()
+ .filter(|(owner, _)| owner == user_id.as_ref())
+ .map(|(_, reminder)| reminder)
+ .filter(|reminder| ids.is_empty() || ids.contains(&reminder.id))
+ .filter(|reminder| {
+ entities.is_empty()
+ || reminder
+ .entity()
+ .is_some_and(|e| entities.iter().any(|want| *want == entity_token(&e)))
+ })
+ .filter(|reminder| match completed {
+ Some(completed) => reminder.completed_at.is_some() == completed,
+ None => true,
+ })
+ .filter(|reminder| !self.is_unreadable(reminder.id))
+ .collect();
+ // Descending, as the SQL adapter returns.
+ found.sort_by_key(|reminder| std::cmp::Reverse((reminder.next_run_at, reminder.id)));
+ found.truncate(limit.max(0) as usize);
+ // The fake has no documents to resolve against.
+ Ok(found
+ .into_iter()
+ .map(|reminder| ReminderForSoup {
+ reminder,
+ reference: None,
+ })
+ .collect())
+ }
+
async fn update_reminder(
&self,
user_id: &MacroUserIdStr<'_>,
@@ -553,7 +595,15 @@ async fn accepts_a_one_shot_one_second_from_now() {
.await
.expect("an instant just after now should be accepted");
- assert_eq!(reminder.next_run_at, remind_at);
+ // Accepted, then floored — which lands it in the current minute, so it
+ // fires on the next sweep. Validating before flooring is what keeps this
+ // from being rejected as "remindAt must be in the future": a sub-minute
+ // request is honoured at the granularity reminders actually work at.
+ assert_eq!(
+ reminder.next_run_at,
+ now(),
+ "floored into the current minute"
+ );
}
#[tokio::test]
@@ -1296,7 +1346,7 @@ async fn rescheduling_leaves_enabled_alone() {
#[tokio::test]
async fn repository_failures_surface_as_internal_errors() {
- // Every method wraps repo errors with `anyhow::Error::from`, which the router
+ // Every method wraps repo errors in a `rootcause::Report`, which the router
// turns into a 500 with the cause logged but not returned. Without this the
// whole mapping is unexercised.
let service = service();
@@ -1525,3 +1575,43 @@ async fn pages_within_an_entity_filter() {
let unique: std::collections::HashSet<_> = seen.iter().collect();
assert_eq!(unique.len(), 3);
}
+
+#[tokio::test]
+async fn creating_floors_the_firing_to_the_minute() {
+ // What "remind me in 90 minutes" produces when the request lands at
+ // 12:00:00 and the client did the arithmetic against its own ragged clock.
+ let ragged = future() + Duration::seconds(32) + Duration::milliseconds(500);
+ let reminder = service()
+ .create_reminder(&user(USER_A), create_request(once(ragged)), None)
+ .await
+ .expect("reminder should be created");
+
+ assert_eq!(reminder.next_run_at, future());
+ // The stored schedule has to agree with the firing, or a later read would
+ // show a time the reminder will not actually fire at.
+ assert_eq!(reminder.schedule, once(future()));
+}
+
+#[tokio::test]
+async fn rescheduling_floors_the_firing_to_the_minute() {
+ let service = service();
+ let created = service
+ .create_reminder(&user(USER_A), create_request(once(future())), None)
+ .await
+ .expect("created");
+ let ragged = future() + Duration::hours(1) + Duration::seconds(45);
+
+ let reminder = service
+ .update_reminder(
+ owner_receipt(USER_A, created.id),
+ ReminderPatch {
+ schedule: Some(once(ragged)),
+ ..Default::default()
+ },
+ )
+ .await
+ .expect("reschedule should succeed");
+
+ assert_eq!(reminder.next_run_at, future() + Duration::hours(1));
+ assert_eq!(reminder.schedule, once(future() + Duration::hours(1)));
+}
diff --git a/crates/reminders/src/inbound/axum_router.rs b/crates/reminders/src/inbound/axum_router.rs
index f9aab5f9e3..a22f47e6c0 100644
--- a/crates/reminders/src/inbound/axum_router.rs
+++ b/crates/reminders/src/inbound/axum_router.rs
@@ -144,6 +144,10 @@ pub struct UpdateReminderRequest {
/// Whether the reminder should fire at all.
#[schema(nullable = false)]
pub enabled: Option<bool>,
+ /// Mark the reminder as dealt with, or live again. Distinct from
+ /// `enabled`, which controls whether the dispatcher considers it.
+ #[schema(nullable = false)]
+ pub completed: Option<bool>,
}
/// Query params for listing reminders.
@@ -425,6 +429,7 @@ where
description: req.description,
schedule: req.schedule,
enabled: req.enabled,
+ completed: req.completed,
};
let reminder = state
.service
diff --git a/crates/reminders/src/inbound/axum_router/test.rs b/crates/reminders/src/inbound/axum_router/test.rs
index c53fc6bed4..468b8e9e41 100644
--- a/crates/reminders/src/inbound/axum_router/test.rs
+++ b/crates/reminders/src/inbound/axum_router/test.rs
@@ -20,7 +20,7 @@ use tower::ServiceExt;
use uuid::Uuid;
use super::*;
-use crate::domain::models::{ReminderCursor, ReminderPage};
+use crate::domain::models::{ReminderCursor, ReminderForSoup, ReminderPage};
const USER_ID: &str = "macro|[email protected]";
const VALID_JWT: &str = "valid";
@@ -376,6 +376,22 @@ impl RemindersService for FakeRemindersService {
})
}
+ /// Unused by the router — Soup calls the service directly.
+ async fn list_reminders_for_soup(
+ &self,
+ _user_id: &MacroUserIdStr<'_>,
+ _ids: &[Uuid],
+ _entities: &[String],
+ _completed: Option<bool>,
+ _limit: i64,
+ ) -> Result<Vec<ReminderForSoup>, ReminderError> {
+ self.fail_if_configured()?;
+ Ok(vec![ReminderForSoup {
+ reminder: sample_reminder(None),
+ reference: None,
+ }])
+ }
+
async fn update_reminder(
&self,
receipt: EntityAccessReceipt<OwnerAccessLevel>,
diff --git a/crates/reminders/src/outbound/notification_notifier.rs b/crates/reminders/src/outbound/notification_notifier.rs
index 95bce80591..51b27d6f49 100644
--- a/crates/reminders/src/outbound/notification_notifier.rs
+++ b/crates/reminders/src/outbound/notification_notifier.rs
@@ -42,16 +42,12 @@ impl<I: NotificationIngress> ReminderNotifier for NotificationReminderNotifier<I
// reminder id is safe to put in a span.
#[tracing::instrument(err, skip_all, fields(reminder_id = %due.reminder.id))]
async fn notify(&self, due: &DueReminder) -> Result<(), Self::Err> {
- // A standalone reminder has no entity to hang the notification on, so
- // it is addressed at the user themselves — the same shape
- // `inbox_reauth_required` uses.
- let notification_entity = match due.reminder.entity() {
- Some(entity) => entity,
- None => EntityType::User.with_entity_str(due.owner_id.as_ref()),
- };
-
+ // The notification belongs to the reminder itself, not to whatever the
+ // reminder references. The client resolves the referenced entity through
+ // the reminder's `referencedEntity` edge.
let request = SendNotificationRequestBuilder {
- notification_entity,
+ notification_entity: EntityType::Reminder
+ .with_entity_string(due.reminder.id.to_string()),
secondary_notification_entity: None,
notification: ReminderMetadata {
reminder_id: due.reminder.id,
diff --git a/crates/reminders/src/outbound/notification_notifier/test.rs b/crates/reminders/src/outbound/notification_notifier/test.rs
index 81e008491c..0f0e3cc525 100644
--- a/crates/reminders/src/outbound/notification_notifier/test.rs
+++ b/crates/reminders/src/outbound/notification_notifier/test.rs
@@ -119,7 +119,7 @@ async fn sends_with_no_sender_so_the_owner_is_not_filtered_out() {
}
#[tokio::test]
-async fn addresses_the_notification_at_the_reminders_entity() {
+async fn addresses_the_notification_at_the_reminder_not_its_referenced_entity() {
let ingress = CapturingIngress::default();
NotificationReminderNotifier::new(ingress.clone())
@@ -127,13 +127,15 @@ async fn addresses_the_notification_at_the_reminders_entity() {
.await
.expect("notify succeeds");
+ // The referenced channel is reachable through the reminder's
+ // `referencedEntity` edge; the notification itself points at the reminder.
let entity = &ingress.last()["req"]["notification_entity"];
- assert_eq!(entity["entity_type"], "channel");
- assert_eq!(entity["entity_id"], "channel-1");
+ assert_eq!(entity["entity_type"], "reminder");
+ assert_eq!(entity["entity_id"], reminder_id().to_string());
}
#[tokio::test]
-async fn falls_back_to_the_user_when_the_reminder_has_no_entity() {
+async fn a_standalone_reminder_still_points_at_itself() {
let ingress = CapturingIngress::default();
NotificationReminderNotifier::new(ingress.clone())
@@ -141,11 +143,11 @@ async fn falls_back_to_the_user_when_the_reminder_has_no_entity() {
.await
.expect("notify succeeds");
- // `event_item_id`/`event_item_type` are NOT NULL, so a standalone reminder
- // still needs an entity; it is addressed at the user, as inbox_reauth does.
+ // `event_item_id`/`event_item_type` are NOT NULL, and the reminder is always
+ // a valid entity — so no fallback is needed.
let entity = &ingress.last()["req"]["notification_entity"];
- assert_eq!(entity["entity_type"], "user");
- assert_eq!(entity["entity_id"], OWNER);
+ assert_eq!(entity["entity_type"], "reminder");
+ assert_eq!(entity["entity_id"], reminder_id().to_string());
}
#[tokio::test]
diff --git a/crates/reminders/src/outbound/pg_reminders_repo.rs b/crates/reminders/src/outbound/pg_reminders_repo.rs
index 0b7cec15a8..0ec7258358 100644
--- a/crates/reminders/src/outbound/pg_reminders_repo.rs
+++ b/crates/reminders/src/outbound/pg_reminders_repo.rs
@@ -15,7 +15,8 @@ use uuid::Uuid;
use crate::domain::models::{
DueFiring, DueReminder, InvalidCron, NewReminder, Reminder, ReminderBatch, ReminderCron,
- ReminderCursor, ReminderFilter, ReminderSchedule, ReminderUpdate,
+ ReminderCursor, ReminderFilter, ReminderForSoup, ReminderReference, ReminderSchedule,
+ ReminderUpdate,
};
use crate::domain::ports::{ReminderDispatchRepo, RemindersRepo};
@@ -405,6 +406,110 @@ impl RemindersRepo for PgRemindersRepo {
Ok(batch)
}
+ #[tracing::instrument(err, skip(self, user_id))]
+ async fn list_reminders_for_soup(
+ &self,
+ user_id: &MacroUserIdStr<'_>,
+ ids: &[Uuid],
+ entities: &[String],
+ completed: Option<bool>,
+ limit: i64,
+ ) -> Result<Vec<ReminderForSoup>, Self::Err> {
+ // Empty means "no constraint", so bind NULL rather than an empty array
+ // — `= ANY('{}')` matches nothing.
+ let ids = (!ids.is_empty()).then_some(ids);
+ let entities = (!entities.is_empty()).then_some(entities);
+
+ let rows = sqlx::query!(
+ r#"
+ SELECT
+ r.id,
+ r.description,
+ r.entity_type,
+ r.entity_id,
+ r.remind_at,
+ r.cron,
+ r.timezone,
+ r.next_run_at,
+ r.enabled,
+ r.completed_at,
+ r.created_at,
+ r.updated_at,
+ d."fileType" as "referenced_file_type?",
+ dst.sub_type::text as "referenced_sub_type?"
+ FROM reminder r
+ -- Resolve the referenced document in the same round trip: the block
+ -- a reminder opens (and its icon) comes from the document's file
+ -- type, and the client's icon path is synchronous. "Document".id is
+ -- still TEXT while reminder.entity_id is a uuid, hence the cast.
+ LEFT JOIN "Document" d
+ ON r.entity_type = 'document'
+ AND d.id = r.entity_id::text
+ AND d."deletedAt" IS NULL
+ LEFT JOIN document_sub_type dst ON dst.document_id = d.id
+ WHERE r.user_id = $1
+ AND ($2::uuid[] IS NULL OR r.id = ANY($2))
+ AND (
+ $3::text[] IS NULL
+ OR (
+ r.entity_id IS NOT NULL
+ AND r.entity_type || ':' || r.entity_id::text = ANY($3)
+ )
+ )
+ AND ($4::bool IS NULL OR (r.completed_at IS NOT NULL) = $4)
+ -- Descending to match Soup's global ordering, so the LIMIT keeps the
+ -- same rows Soup would keep after merging every item type.
+ ORDER BY r.next_run_at DESC, r.id DESC
+ LIMIT $5
+ "#,
+ user_id.as_ref(),
+ ids as Option<&[Uuid]>,
+ entities as Option<&[String]>,
+ completed,
+ limit,
+ )
+ .fetch_all(&self.pool)
+ .await?;
+
+ // Undecodable rows are skipped rather than failing the page, matching
+ // `list_reminders`.
+ Ok(rows
+ .into_iter()
+ .filter_map(|row| {
+ let reference = match (row.referenced_file_type, row.referenced_sub_type) {
+ (None, None) => None,
+ (file_type, sub_type) => Some(ReminderReference {
+ file_type,
+ sub_type,
+ }),
+ };
+ let reminder = ReminderRow {
+ id: row.id,
+ description: row.description,
+ entity_type: row.entity_type,
+ entity_id: row.entity_id,
+ remind_at: row.remind_at,
+ cron: row.cron,
+ timezone: row.timezone,
+ next_run_at: row.next_run_at,
+ enabled: row.enabled,
+ completed_at: row.completed_at,
+ created_at: row.created_at,
+ updated_at: row.updated_at,
+ }
+ .into_reminder()
+ .inspect_err(|e| {
+ tracing::error!(error=?e, "skipping unreadable reminder");
+ })
+ .ok()?;
+ Some(ReminderForSoup {
+ reminder,
+ reference,
+ })
+ })
+ .collect())
+ }
+
#[tracing::instrument(err, skip(self, user_id, update))]
async fn update_reminder(
&self,
@@ -438,7 +543,15 @@ impl RemindersRepo for PgRemindersRepo {
timezone = CASE WHEN $4::bool THEN $7::text ELSE timezone END,
next_run_at = COALESCE($8::timestamptz, next_run_at),
enabled = COALESCE($9::bool, enabled),
- completed_at = CASE WHEN $4::bool THEN NULL ELSE completed_at END,
+ -- An explicit `completed` wins over the reschedule rule above;
+ -- COALESCE keeps re-completing an already-completed reminder
+ -- from moving its timestamp.
+ completed_at = CASE
+ WHEN $10::bool IS TRUE THEN COALESCE(completed_at, now())
+ WHEN $10::bool IS FALSE THEN NULL
+ WHEN $4::bool THEN NULL
+ ELSE completed_at
+ END,
updated_at = now()
WHERE id = $1 AND user_id = $2
RETURNING
@@ -464,6 +577,7 @@ impl RemindersRepo for PgRemindersRepo {
timezone,
next_run_at,
update.enabled,
+ update.completed,
)
.fetch_optional(&self.pool)
.await?;
@@ -477,15 +591,37 @@ impl RemindersRepo for PgRemindersRepo {
user_id: &MacroUserIdStr<'_>,
id: Uuid,
) -> Result<bool, Self::Err> {
+ let mut tx = self.pool.begin().await?;
+
let result = sqlx::query!(
r#"DELETE FROM reminder WHERE id = $1 AND user_id = $2"#,
id,
user_id.as_ref(),
)
- .execute(&self.pool)
+ .execute(tx.as_mut())
.await?;
- Ok(result.rows_affected() > 0)
+ let deleted = result.rows_affected() > 0;
+
+ if deleted {
+ // Retract the firing notification in the same transaction — see the
+ // port contract. Only after confirming the reminder was the
+ // caller's, so a miss cannot delete someone else's notification.
+ // `user_notification` cascades from this row.
+ sqlx::query!(
+ r#"
+ DELETE FROM notification
+ WHERE event_item_type = 'reminder' AND event_item_id = $1
+ "#,
+ id.to_string(),
+ )
+ .execute(tx.as_mut())
+ .await?;
+ }
+
+ tx.commit().await?;
+
+ Ok(deleted)
}
}
@@ -508,15 +644,30 @@ impl ReminderDispatchRepo for PgRemindersRepo {
// outgrow that, page it with a keyset cursor on (next_run_at, id) and
// have the handler re-enqueue itself, the way the crm cleanup lister
// does — a bare LIMIT here would silently strand the overflow.
+ //
+ // Two separate exclusions, because they mean different things. A
+ // `completed_at` reminder is one the owner has finished with and does
+ // not want. A sent occurrence is one this firing already delivered —
+ // that is what makes a delivered reminder stop being due, and it is
+ // keyed on `next_run_at`, so rescheduling makes it due again without
+ // anything having to clear it. Covered by
+ // `reminder_occurrence_firing_idx`.
let rows = sqlx::query!(
r#"
- SELECT id, next_run_at
- FROM reminder
- WHERE enabled
- AND completed_at IS NULL
- AND cron IS NULL
- AND next_run_at <= $1
- ORDER BY next_run_at
+ SELECT r.id, r.next_run_at
+ FROM reminder r
+ WHERE r.enabled
+ AND r.completed_at IS NULL
+ AND r.cron IS NULL
+ AND r.next_run_at <= $1
+ AND NOT EXISTS (
+ SELECT 1
+ FROM reminder_occurrence o
+ WHERE o.reminder_id = r.id
+ AND o.scheduled_for = r.next_run_at
+ AND o.sent_at IS NOT NULL
+ )
+ ORDER BY r.next_run_at
"#,
now,
)
@@ -639,10 +790,10 @@ impl ReminderDispatchRepo for PgRemindersRepo {
reminder_id: Uuid,
scheduled_for: DateTime<Utc>,
) -> Result<(), Self::Err> {
- // Both halves in one transaction: a delivered firing whose reminder is
- // still uncompleted would be sent again on the next sweep.
- let mut tx = self.pool.begin().await?;
-
+ // Only the occurrence. Delivery is not completion: `completed_at` means
+ // the owner is finished with the reminder, and a reminder that has just
+ // arrived in their inbox plainly is not. What stops a delivered firing
+ // being sent twice is this row, which `due_firings` excludes on.
sqlx::query!(
r#"
UPDATE reminder_occurrence
@@ -652,22 +803,9 @@ impl ReminderDispatchRepo for PgRemindersRepo {
reminder_id,
scheduled_for,
)
- .execute(&mut *tx)
- .await?;
-
- sqlx::query!(
- r#"
- UPDATE reminder
- SET completed_at = now(), updated_at = now()
- WHERE id = $1
- "#,
- reminder_id,
- )
- .execute(&mut *tx)
+ .execute(&self.pool)
.await?;
- tx.commit().await?;
-
Ok(())
}
}
diff --git a/crates/reminders/src/outbound/pg_reminders_repo/test.rs b/crates/reminders/src/outbound/pg_reminders_repo/test.rs
index dbc7da44fb..2bcf4d3775 100644
--- a/crates/reminders/src/outbound/pg_reminders_repo/test.rs
+++ b/crates/reminders/src/outbound/pg_reminders_repo/test.rs
@@ -6,7 +6,7 @@ use model_entity::EntityType;
use sqlx::PgPool;
use super::*;
-use crate::domain::models::{ReminderCursor, ScheduleUpdate};
+use crate::domain::models::{ReminderCursor, ScheduleUpdate, entity_token};
const USER_A: &str = "macro|[email protected]";
const USER_B: &str = "macro|[email protected]";
@@ -282,6 +282,102 @@ async fn update_applies_only_the_provided_fields(pool: PgPool) {
assert!(updated.updated_at >= created.updated_at);
}
+#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]
+async fn update_can_complete_and_uncomplete_a_reminder(pool: PgPool) {
+ insert_user(&pool, USER_A).await;
+ let repo = PgRemindersRepo::new(pool);
+ let created = repo
+ .create_reminder(
+ &user(USER_A),
+ &new_reminder("thing", once_at(at(2026, 8, 1, 14))),
+ )
+ .await
+ .expect("insert");
+ assert!(created.completed_at.is_none());
+
+ let completed = repo
+ .update_reminder(
+ &user(USER_A),
+ created.id,
+ &ReminderUpdate {
+ completed: Some(true),
+ ..Default::default()
+ },
+ )
+ .await
+ .expect("update should succeed")
+ .expect("reminder should exist");
+ let stamp = completed.completed_at.expect("should be completed");
+
+ // Completing twice must not move the stamp — the second call is a no-op,
+ // not a re-completion.
+ let again = repo
+ .update_reminder(
+ &user(USER_A),
+ created.id,
+ &ReminderUpdate {
+ completed: Some(true),
+ ..Default::default()
+ },
+ )
+ .await
+ .expect("update should succeed")
+ .expect("reminder should exist");
+ assert_eq!(again.completed_at, Some(stamp));
+
+ let reopened = repo
+ .update_reminder(
+ &user(USER_A),
+ created.id,
+ &ReminderUpdate {
+ completed: Some(false),
+ ..Default::default()
+ },
+ )
+ .await
+ .expect("update should succeed")
+ .expect("reminder should exist");
+ assert!(reopened.completed_at.is_none(), "undo must clear the stamp");
+}
+
+#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]
+async fn update_leaves_completion_alone_when_not_asked(pool: PgPool) {
+ insert_user(&pool, USER_A).await;
+ let repo = PgRemindersRepo::new(pool);
+ let created = repo
+ .create_reminder(
+ &user(USER_A),
+ &new_reminder("thing", once_at(at(2026, 8, 1, 14))),
+ )
+ .await
+ .expect("insert");
+ repo.update_reminder(
+ &user(USER_A),
+ created.id,
+ &ReminderUpdate {
+ completed: Some(true),
+ ..Default::default()
+ },
+ )
+ .await
+ .expect("complete");
+
+ // A description-only patch must not resurrect a completed reminder.
+ let renamed = repo
+ .update_reminder(
+ &user(USER_A),
+ created.id,
+ &ReminderUpdate {
+ description: Some("renamed".to_string()),
+ ..Default::default()
+ },
+ )
+ .await
+ .expect("update should succeed")
+ .expect("reminder should exist");
+ assert!(renamed.completed_at.is_some());
+}
+
#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]
async fn update_switching_to_recurring_clears_remind_at(pool: PgPool) {
insert_user(&pool, USER_A).await;
@@ -616,8 +712,16 @@ async fn next_run_at_is_indexed_for_the_future_dispatcher(pool: PgPool) {
// The dispatcher's query shape, so a schema change that breaks it fails here.
let due: i64 = sqlx::query_scalar(
r#"
- SELECT COUNT(*) FROM reminder
- WHERE enabled AND completed_at IS NULL AND next_run_at <= $1
+ SELECT COUNT(*) FROM reminder r
+ WHERE r.enabled
+ AND r.completed_at IS NULL
+ AND r.next_run_at <= $1
+ AND NOT EXISTS (
+ SELECT 1 FROM reminder_occurrence o
+ WHERE o.reminder_id = r.id
+ AND o.scheduled_for = r.next_run_at
+ AND o.sent_at IS NOT NULL
+ )
"#,
)
.bind(at(2026, 1, 1, 14) + Duration::seconds(1))
@@ -1052,9 +1156,19 @@ async fn due_firings_skip_disabled_and_completed(pool: PgPool) {
)
.await
.expect("disable succeeds");
- repo.complete_occurrence(completed.id, completed.next_run_at)
- .await
- .expect("complete succeeds");
+ // Completion is the owner's act now, so set it the way they would rather
+ // than by delivering the firing — delivering would exclude the row through
+ // the sent occurrence instead, and prove nothing about `completed_at`.
+ repo.update_reminder(
+ &user(USER_A),
+ completed.id,
+ &ReminderUpdate {
+ completed: Some(true),
+ ..Default::default()
+ },
+ )
+ .await
+ .expect("complete succeeds");
let due = repo.due_firings(now).await.expect("query succeeds");
@@ -1132,9 +1246,19 @@ async fn a_disabled_or_completed_reminder_does_not_resolve_its_firing(pool: PgPo
)
.await
.expect("disable succeeds");
- repo.complete_occurrence(completed.id, completed.next_run_at)
- .await
- .expect("complete succeeds");
+ // Completion is the owner's act now, so set it the way they would rather
+ // than by delivering the firing — delivering would exclude the row through
+ // the sent occurrence instead, and prove nothing about `completed_at`.
+ repo.update_reminder(
+ &user(USER_A),
+ completed.id,
+ &ReminderUpdate {
+ completed: Some(true),
+ ..Default::default()
+ },
+ )
+ .await
+ .expect("complete succeeds");
for reminder in [&disabled, &completed] {
let resolved = repo
@@ -1284,7 +1408,7 @@ async fn a_delivered_firing_is_never_reclaimed(pool: PgPool) {
}
#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]
-async fn completing_a_firing_marks_it_sent_and_completes_the_reminder(pool: PgPool) {
+async fn a_delivered_firing_stops_being_due_without_completing_the_reminder(pool: PgPool) {
insert_user(&pool, USER_A).await;
let reminder = create_due(&pool, USER_A, at(2026, 8, 1, 11)).await;
let repo = PgRemindersRepo::new(pool.clone());
@@ -1306,14 +1430,21 @@ async fn completing_a_firing_marks_it_sent_and_completes_the_reminder(pool: PgPo
.expect("occurrence exists");
assert!(sent_at.is_some());
+ // Delivery is not completion. The owner has been told about the reminder;
+ // they have not dealt with it, and the client shows it as outstanding until
+ // they say otherwise.
let stored = repo
.get_reminder(&user(USER_A), reminder.id)
.await
.expect("read succeeds")
.expect("reminder still exists");
- assert!(stored.completed_at.is_some());
+ assert!(
+ stored.completed_at.is_none(),
+ "firing must not mark the reminder as dealt with"
+ );
- // And it must drop out of the due set, or the next sweep sends it again.
+ // It must still drop out of the due set, or the next sweep sends it again —
+ // that is the sent occurrence's job now, not `completed_at`.
let due = repo
.due_firings(at(2026, 8, 1, 12))
.await
@@ -1321,6 +1452,73 @@ async fn completing_a_firing_marks_it_sent_and_completes_the_reminder(pool: PgPo
assert!(due.is_empty());
}
+#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]
+async fn a_rescheduled_reminder_becomes_due_again_after_delivery(pool: PgPool) {
+ // The sent occurrence is keyed on the firing, so moving the firing makes the
+ // reminder due again with nothing having to clear it.
+ insert_user(&pool, USER_A).await;
+ let reminder = create_due(&pool, USER_A, at(2026, 8, 1, 11)).await;
+ let repo = PgRemindersRepo::new(pool.clone());
+
+ repo.claim_occurrence(reminder.id, reminder.next_run_at, no_retry())
+ .await
+ .expect("claim succeeds");
+ repo.complete_occurrence(reminder.id, reminder.next_run_at)
+ .await
+ .expect("complete succeeds");
+
+ repo.update_reminder(
+ &user(USER_A),
+ reminder.id,
+ &ReminderUpdate {
+ schedule: Some(ScheduleUpdate {
+ schedule: once_at(at(2026, 8, 2, 11)),
+ next_run_at: at(2026, 8, 2, 11),
+ }),
+ ..Default::default()
+ },
+ )
+ .await
+ .expect("reschedule succeeds");
+
+ let due = repo
+ .due_firings(at(2026, 8, 2, 12))
+ .await
+ .expect("query succeeds");
+
+ assert_eq!(due.len(), 1);
+ assert_eq!(due[0].reminder_id, reminder.id);
+ assert_eq!(due[0].scheduled_for, at(2026, 8, 2, 11));
+}
+
+#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]
+async fn a_reminder_the_owner_completed_is_not_due(pool: PgPool) {
+ insert_user(&pool, USER_A).await;
+ let reminder = create_due(&pool, USER_A, at(2026, 8, 1, 11)).await;
+ let repo = PgRemindersRepo::new(pool.clone());
+
+ repo.update_reminder(
+ &user(USER_A),
+ reminder.id,
+ &ReminderUpdate {
+ completed: Some(true),
+ ..Default::default()
+ },
+ )
+ .await
+ .expect("complete succeeds");
+
+ let due = repo
+ .due_firings(at(2026, 8, 1, 12))
+ .await
+ .expect("query succeeds");
+
+ assert!(
+ due.is_empty(),
+ "a reminder the owner is done with never fires"
+ );
+}
+
#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]
async fn deleting_a_reminder_removes_its_occurrences(pool: PgPool) {
insert_user(&pool, USER_A).await;
@@ -1393,3 +1591,330 @@ async fn an_undecodable_row_is_isolated_to_its_own_firing(pool: PgPool) {
"and leaves its neighbour deliverable"
);
}
+
+#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]
+async fn soup_list_returns_the_users_reminders_newest_firing_first(pool: PgPool) {
+ insert_user(&pool, USER_A).await;
+ insert_user(&pool, USER_B).await;
+ let repo = PgRemindersRepo::new(pool);
+
+ repo.create_reminder(
+ &user(USER_A),
+ &new_reminder("soon", once_at(at(2026, 8, 1, 14))),
+ )
+ .await
+ .expect("insert");
+ repo.create_reminder(
+ &user(USER_A),
+ &new_reminder("later", once_at(at(2026, 9, 1, 14))),
+ )
+ .await
+ .expect("insert");
+ repo.create_reminder(
+ &user(USER_B),
+ &new_reminder("someone else's", once_at(at(2026, 8, 15, 14))),
+ )
+ .await
+ .expect("insert");
+
+ let found = repo
+ .list_reminders_for_soup(&user(USER_A), &[], &[], None, 100)
+ .await
+ .expect("soup list should succeed");
+
+ // Descending, matching Soup's global ordering — and never another user's.
+ let descriptions: Vec<&str> = found
+ .iter()
+ .map(|r| r.reminder.description.as_str())
+ .collect();
+ assert_eq!(descriptions, vec!["later", "soon"]);
+}
+
+#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]
+async fn soup_list_filters_by_id(pool: PgPool) {
+ insert_user(&pool, USER_A).await;
+ let repo = PgRemindersRepo::new(pool);
+
+ let wanted = repo
+ .create_reminder(
+ &user(USER_A),
+ &new_reminder("wanted", once_at(at(2026, 8, 1, 14))),
+ )
+ .await
+ .expect("insert");
+ repo.create_reminder(
+ &user(USER_A),
+ &new_reminder("other", once_at(at(2026, 8, 2, 14))),
+ )
+ .await
+ .expect("insert");
+
+ let found = repo
+ .list_reminders_for_soup(&user(USER_A), &[wanted.id], &[], None, 100)
+ .await
+ .expect("soup list should succeed");
+
+ assert_eq!(found.len(), 1);
+ assert_eq!(found[0].reminder.id, wanted.id);
+}
+
+#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]
+async fn soup_list_filters_by_entity_token(pool: PgPool) {
+ insert_user(&pool, USER_A).await;
+ let repo = PgRemindersRepo::new(pool);
+
+ let on_doc = NewReminder {
+ entity: Some(EntityType::Document.with_entity_string(DOC_1.to_string())),
+ ..new_reminder("on doc-1", once_at(at(2026, 8, 1, 14)))
+ };
+ let on_other_doc = NewReminder {
+ entity: Some(EntityType::Document.with_entity_string(DOC_2.to_string())),
+ ..new_reminder("on doc-2", once_at(at(2026, 8, 1, 14)))
+ };
+ // Same id, different type — proves the token is matched whole, not by id.
+ let on_chat = NewReminder {
+ entity: Some(EntityType::Chat.with_entity_string(DOC_1.to_string())),
+ ..new_reminder("on chat doc-1", once_at(at(2026, 8, 1, 14)))
+ };
+ for new in [&on_doc, &on_other_doc, &on_chat] {
+ repo.create_reminder(&user(USER_A), new)
+ .await
+ .expect("insert");
+ }
+ repo.create_reminder(
+ &user(USER_A),
+ &new_reminder("standalone", once_at(at(2026, 8, 1, 14))),
+ )
+ .await
+ .expect("insert");
+
+ let found = repo
+ .list_reminders_for_soup(
+ &user(USER_A),
+ &[],
+ &[entity_token(&EntityType::Document.with_entity_str(DOC_1))],
+ None,
+ 100,
+ )
+ .await
+ .expect("soup list should succeed");
+
+ assert_eq!(found.len(), 1);
+ assert_eq!(found[0].reminder.description, "on doc-1");
+}
+
+#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]
+async fn soup_list_filters_on_completion(pool: PgPool) {
+ insert_user(&pool, USER_A).await;
+ let repo = PgRemindersRepo::new(pool.clone());
+
+ let fired = repo
+ .create_reminder(
+ &user(USER_A),
+ &new_reminder("fired", once_at(at(2026, 8, 1, 14))),
+ )
+ .await
+ .expect("insert");
+ repo.create_reminder(
+ &user(USER_A),
+ &new_reminder("pending", once_at(at(2026, 8, 2, 14))),
+ )
+ .await
+ .expect("insert");
+
+ sqlx::query(r#"UPDATE reminder SET completed_at = now() WHERE id = $1"#)
+ .bind(fired.id)
+ .execute(&pool)
+ .await
+ .expect("complete should update");
+
+ let pending = repo
+ .list_reminders_for_soup(&user(USER_A), &[], &[], Some(false), 100)
+ .await
+ .expect("soup list should succeed");
+ assert_eq!(pending.len(), 1);
+ assert_eq!(pending[0].reminder.description, "pending");
+
+ let completed = repo
+ .list_reminders_for_soup(&user(USER_A), &[], &[], Some(true), 100)
+ .await
+ .expect("soup list should succeed");
+ assert_eq!(completed.len(), 1);
+ assert_eq!(completed[0].reminder.description, "fired");
+
+ // `None` means "no constraint", so both come back.
+ let both = repo
+ .list_reminders_for_soup(&user(USER_A), &[], &[], None, 100)
+ .await
+ .expect("soup list should succeed");
+ assert_eq!(both.len(), 2);
+}
+
+#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]
+async fn delete_retracts_the_reminders_notification(pool: PgPool) {
+ insert_user(&pool, USER_A).await;
+ let repo = PgRemindersRepo::new(pool.clone());
+
+ let created = repo
+ .create_reminder(
+ &user(USER_A),
+ &new_reminder("follow up", once_at(at(2026, 8, 1, 14))),
+ )
+ .await
+ .expect("insert");
+
+ // Stand in for the dispatcher having fired it.
+ let notification_id = macro_uuid::generate_uuid_v7();
+ sqlx::query(
+ r#"
+ INSERT INTO notification
+ (id, notification_event_type, event_item_id, event_item_type, service_sender)
+ VALUES ($1, 'reminder', $2, 'reminder', 'reminders')
+ "#,
+ )
+ .bind(notification_id)
+ .bind(created.id.to_string())
+ .execute(&pool)
+ .await
+ .expect("notification should insert");
+ sqlx::query(r#"INSERT INTO user_notification (user_id, notification_id) VALUES ($1, $2)"#)
+ .bind(USER_A)
+ .bind(notification_id)
+ .execute(&pool)
+ .await
+ .expect("user_notification should insert");
+
+ assert!(
+ repo.delete_reminder(&user(USER_A), created.id)
+ .await
+ .expect("delete should succeed")
+ );
+
+ // Otherwise the Inbox keeps a row pointing at a reminder that is gone.
+ let remaining: i64 = sqlx::query_scalar(r#"SELECT count(*) FROM notification WHERE id = $1"#)
+ .bind(notification_id)
+ .fetch_one(&pool)
+ .await
+ .expect("count should succeed");
+ assert_eq!(remaining, 0, "the firing notification should be retracted");
+
+ // `user_notification` cascades, so the junction row goes with it.
+ let junction: i64 =
+ sqlx::query_scalar(r#"SELECT count(*) FROM user_notification WHERE notification_id = $1"#)
+ .bind(notification_id)
+ .fetch_one(&pool)
+ .await
+ .expect("count should succeed");
+ assert_eq!(junction, 0);
+}
+
+#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]
+async fn delete_leaves_another_users_notification_alone(pool: PgPool) {
+ insert_user(&pool, USER_A).await;
+ insert_user(&pool, USER_B).await;
+ let repo = PgRemindersRepo::new(pool.clone());
+
+ let theirs = repo
+ .create_reminder(
+ &user(USER_B),
+ &new_reminder("theirs", once_at(at(2026, 8, 1, 14))),
+ )
+ .await
+ .expect("insert");
+
+ let notification_id = macro_uuid::generate_uuid_v7();
+ sqlx::query(
+ r#"
+ INSERT INTO notification
+ (id, notification_event_type, event_item_id, event_item_type, service_sender)
+ VALUES ($1, 'reminder', $2, 'reminder', 'reminders')
+ "#,
+ )
+ .bind(notification_id)
+ .bind(theirs.id.to_string())
+ .execute(&pool)
+ .await
+ .expect("notification should insert");
+
+ // USER_A cannot see the reminder, so the delete misses...
+ assert!(
+ !repo
+ .delete_reminder(&user(USER_A), theirs.id)
+ .await
+ .expect("delete should succeed")
+ );
+
+ // ...and must not have retracted USER_B's notification on the way past.
+ let remaining: i64 = sqlx::query_scalar(r#"SELECT count(*) FROM notification WHERE id = $1"#)
+ .bind(notification_id)
+ .fetch_one(&pool)
+ .await
+ .expect("count should succeed");
+ assert_eq!(remaining, 1);
+}
+
+#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]
+async fn soup_list_resolves_the_referenced_documents_file_type(pool: PgPool) {
+ insert_user(&pool, USER_A).await;
+ let repo = PgRemindersRepo::new(pool.clone());
+
+ let doc_id = macro_uuid::generate_uuid_v7().to_string();
+ sqlx::query(
+ r#"INSERT INTO "Document" (id, name, owner, "fileType") VALUES ($1, $2, $3, 'md')"#,
+ )
+ .bind(&doc_id)
+ .bind("awesome new file")
+ .bind(USER_A)
+ .execute(&pool)
+ .await
+ .expect("document should insert");
+ sqlx::query(r#"INSERT INTO document_sub_type (document_id, sub_type) VALUES ($1, 'task')"#)
+ .bind(&doc_id)
+ .execute(&pool)
+ .await
+ .expect("sub type should insert");
+
+ let on_doc = NewReminder {
+ entity: Some(EntityType::Document.with_entity_string(doc_id.clone())),
+ ..new_reminder("review it", once_at(at(2026, 8, 1, 14)))
+ };
+ repo.create_reminder(&user(USER_A), &on_doc)
+ .await
+ .expect("insert");
+
+ let found = repo
+ .list_reminders_for_soup(&user(USER_A), &[], &[], None, 100)
+ .await
+ .expect("soup list should succeed");
+
+ assert_eq!(found.len(), 1);
+ // Without these the client cannot tell which block to open or icon, and a
+ // referenced document would render as "unknown".
+ let reference = found[0]
+ .reference
+ .as_ref()
+ .expect("a referenced document resolves");
+ assert_eq!(reference.file_type.as_deref(), Some("md"));
+ assert_eq!(reference.sub_type.as_deref(), Some("task"));
+}
+
+#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]
+async fn soup_list_has_no_reference_for_a_standalone_reminder(pool: PgPool) {
+ insert_user(&pool, USER_A).await;
+ let repo = PgRemindersRepo::new(pool);
+
+ repo.create_reminder(
+ &user(USER_A),
+ &new_reminder("standalone", once_at(at(2026, 8, 1, 14))),
+ )
+ .await
+ .expect("insert");
+
+ let found = repo
+ .list_reminders_for_soup(&user(USER_A), &[], &[], None, 100)
+ .await
+ .expect("soup list should succeed");
+
+ assert_eq!(found.len(), 1);
+ assert!(found[0].reference.is_none());
+}
diff --git a/crates/soup/Cargo.toml b/crates/soup/Cargo.toml
index 3986134516..b6aff3aac4 100644
--- a/crates/soup/Cargo.toml
+++ b/crates/soup/Cargo.toml
@@ -40,7 +40,7 @@ outbound = [
"ports",
"properties/outbound",
]
-ports = ["crm/ports", "dep:tokio", "frecency/ports"]
+ports = ["crm/ports", "dep:tokio", "frecency/ports", "reminders/ports"]
[dependencies]
@@ -80,6 +80,7 @@ non_empty = { path = "../non_empty" }
properties = { path = "../properties", default-features = false, optional = true }
readonly_pool = { path = "../readonly_pool", optional = true }
recursion = { workspace = true }
+reminders = { path = "../reminders", default-features = false }
rootcause = { workspace = true }
schemars = { workspace = true, optional = true }
serde = { workspace = true }
diff --git a/crates/soup/src/domain/models.rs b/crates/soup/src/domain/models.rs
index 661d9aba06..78b3de171e 100644
--- a/crates/soup/src/domain/models.rs
+++ b/crates/soup/src/domain/models.rs
@@ -1,5 +1,8 @@
pub mod grouping;
+#[cfg(test)]
+mod test;
+
use call::domain::models::GetCallRecordsRequest;
use channels::domain::models::{GetChannelsRequest, GetThreadReplyRowsRequest};
use crm::domain::auth::CrmTeamReceipt;
@@ -23,6 +26,7 @@ use item_filters::{
PropertiesLiteral, PropertyEntityType, properties_filter_can_apply_to,
properties_filter_matches_propertyless,
},
+ reminder::ReminderLiteral,
},
};
use macro_user_id::user_id::MacroUserIdStr;
@@ -505,6 +509,51 @@ impl SoupRequest<Option<EntityFilterAst>> {
})
}
+ /// Build the reminder leg of the query.
+ ///
+ /// Unlike every other entity type, reminders are **opt-in**: a query that
+ /// says nothing about them gets none. Adding reminders to Soup therefore
+ /// left every existing view's results unchanged; only views that ask (today
+ /// just the Inbox Signal filter) see them.
+ ///
+ /// Reminders also carry no properties, so an active properties filter that
+ /// cannot match a propertyless item skips the leg — the same gate channels
+ /// and foreign entities use.
+ pub(crate) fn build_reminder_request(
+ &self,
+ limit: i64,
+ ) -> Option<GetRemindersRequest<'static>> {
+ if self.properties_filter_blocks_propertyless() {
+ return None;
+ }
+ // Reminders sort on `next_run_at` regardless of the requested method,
+ // so there is nothing to translate — but frecency has no reminder
+ // scoring, so that path skips them.
+ if matches!(self.cursor, SoupQuery::Frecency(_)) {
+ return None;
+ }
+
+ // Absent filter means the query never mentioned reminders, which is the
+ // opt-out. Every pre-existing Soup view lands here.
+ let tree = self.entity_ast().and_then(|a| a.reminder_filter.as_ref())?;
+ let mut extract = ReminderFilterExtract::default();
+ if !extract_reminder_filter(tree, &mut extract) {
+ // Fail closed: an unsupported AST shape would widen the result set.
+ return None;
+ }
+ if !extract.opted_in() {
+ return None;
+ }
+
+ Some(GetRemindersRequest {
+ user_id: self.user.clone(),
+ reminder_ids: extract.ids,
+ entities: extract.entities,
+ completed: extract.completed,
+ limit,
+ })
+ }
+
pub(crate) fn build_comms_request(&self) -> Option<GetChannelsRequest> {
if self.properties_filter_blocks_propertyless() {
return None;
@@ -744,6 +793,97 @@ fn or_is_ids_only(expr: &Expr<CrmCompanyLiteral>, out: &mut CrmCompanyFilterExtr
}
}
+/// Parameters for the reminder leg of a soup query.
+#[derive(Debug)]
+pub struct GetRemindersRequest<'a> {
+ /// Whose reminders to list. Reminders are private to their owner, so this
+ /// is the whole of the access check.
+ pub user_id: MacroUserIdStr<'a>,
+ /// Filter to specific reminder ids. Empty = all of the user's reminders.
+ pub reminder_ids: Vec<Uuid>,
+ /// Filter to reminders attached to these entities, each `"{type}:{id}"`.
+ /// Empty = no entity constraint.
+ pub entities: Vec<String>,
+ /// Filter on whether the reminder has fired. `None` returns both.
+ pub completed: Option<bool>,
+ /// Upper bound on rows returned — the soup paginator re-slices.
+ pub limit: i64,
+}
+
+/// Outcome of walking a `ReminderLiteral` AST.
+#[derive(Debug, Default)]
+pub(crate) struct ReminderFilterExtract {
+ pub(crate) include: bool,
+ pub(crate) ids: Vec<Uuid>,
+ pub(crate) entities: Vec<String>,
+ pub(crate) completed: Option<bool>,
+}
+
+impl ReminderFilterExtract {
+ /// Whether the query asked for reminders at all. Reminders are off unless
+ /// something in the filter names them.
+ fn opted_in(&self) -> bool {
+ self.include || !self.ids.is_empty() || !self.entities.is_empty()
+ }
+}
+
+/// Walks a `ReminderLiteral` AST collecting ids, entity tokens, and a single
+/// `Completed(bool)` constraint. Returns `false` (fail closed) on `Not(_)`, on
+/// conflicting `Completed` literals, and on an `Or` branch that is not a pure
+/// id/entity sub-tree — the same shape restrictions as the CRM extractor, for
+/// the same reason: a flat extract cannot represent those set semantics.
+fn extract_reminder_filter(expr: &Expr<ReminderLiteral>, out: &mut ReminderFilterExtract) -> bool {
+ match expr {
+ Expr::Literal(ReminderLiteral::Include) => {
+ out.include = true;
+ true
+ }
+ Expr::Literal(ReminderLiteral::Id(id)) => {
+ out.ids.push(*id);
+ true
+ }
+ Expr::Literal(ReminderLiteral::Entity(entity)) => {
+ out.entities.push(entity.clone());
+ true
+ }
+ Expr::Literal(ReminderLiteral::Completed(b)) => match out.completed {
+ Some(prev) if prev != *b => false,
+ _ => {
+ out.completed = Some(*b);
+ true
+ }
+ },
+ Expr::And(a, b) => extract_reminder_filter(a, out) && extract_reminder_filter(b, out),
+ Expr::Or(a, b) => {
+ // The repo ANDs `ids` against `entities`, so an `Or` spanning both
+ // would come out as an `And` — narrower than asked. Only reject
+ // when this `Or` actually contributes both; ids-only or
+ // entities-only branches still flatten faithfully.
+ let (ids_before, entities_before) = (out.ids.len(), out.entities.len());
+ let ok = reminder_or_is_sets_only(a, out) && reminder_or_is_sets_only(b, out);
+ ok && !(out.ids.len() > ids_before && out.entities.len() > entities_before)
+ }
+ Expr::Not(_) => false,
+ }
+}
+
+/// Helper for [`extract_reminder_filter`]: an `Or` branch must be a pure
+/// id/entity sub-tree — a `Completed`, `And`, or `Not` inside fails closed.
+fn reminder_or_is_sets_only(expr: &Expr<ReminderLiteral>, out: &mut ReminderFilterExtract) -> bool {
+ match expr {
+ Expr::Literal(ReminderLiteral::Id(id)) => {
+ out.ids.push(*id);
+ true
+ }
+ Expr::Literal(ReminderLiteral::Entity(entity)) => {
+ out.entities.push(entity.clone());
+ true
+ }
+ Expr::Or(a, b) => reminder_or_is_sets_only(a, out) && reminder_or_is_sets_only(b, out),
+ _ => false,
+ }
+}
+
/// A Soup result with both optional enrichments represented in one model.
///
/// Service methods decide which fields to populate. An unfetched enrichment
@@ -787,6 +927,9 @@ pub enum SoupErr {
/// CRM lookup failed.
#[error("A CRM error has occurred, see logs for more details")]
CrmErr,
+ /// Reminder lookup failed.
+ #[error("A reminder error has occurred, see logs for more details")]
+ ReminderErr,
/// The filter requested CRM-scoped data but the caller has no
/// qualifying team membership.
#[error("CRM-scoped queries require team membership")]
diff --git a/crates/soup/src/domain/models/test.rs b/crates/soup/src/domain/models/test.rs
new file mode 100644
index 0000000000..395f3d47bc
--- /dev/null
+++ b/crates/soup/src/domain/models/test.rs
@@ -0,0 +1,113 @@
+use super::*;
+
+fn extract(expr: &Expr<ReminderLiteral>) -> Option<ReminderFilterExtract> {
+ let mut out = ReminderFilterExtract::default();
+ extract_reminder_filter(expr, &mut out).then_some(out)
+}
+
+fn id(n: u128) -> Uuid {
+ Uuid::from_u128(n)
+}
+
+#[test]
+fn include_literal_opts_in_on_its_own() {
+ let out = extract(&Expr::val(ReminderLiteral::Include)).expect("supported shape");
+
+ assert!(out.opted_in());
+ assert!(out.ids.is_empty());
+ assert!(out.entities.is_empty());
+}
+
+#[test]
+fn completed_alone_does_not_opt_in() {
+ // The filter is meaningful but names no reminders, so Soup must still skip
+ // the leg rather than return every reminder the user has.
+ let out = extract(&Expr::val(ReminderLiteral::Completed(false))).expect("supported shape");
+
+ assert!(!out.opted_in());
+ assert_eq!(out.completed, Some(false));
+}
+
+#[test]
+fn include_and_completed_narrows_to_uncompleted() {
+ let expr = Expr::and(
+ Expr::val(ReminderLiteral::Include),
+ Expr::val(ReminderLiteral::Completed(false)),
+ );
+
+ let out = extract(&expr).expect("supported shape");
+
+ assert!(out.opted_in());
+ assert_eq!(out.completed, Some(false));
+}
+
+#[test]
+fn ids_or_ids_flattens() {
+ let expr = Expr::or(
+ Expr::val(ReminderLiteral::Id(id(1))),
+ Expr::val(ReminderLiteral::Id(id(2))),
+ );
+
+ let out = extract(&expr).expect("an ids-only Or flattens faithfully");
+
+ assert_eq!(out.ids, vec![id(1), id(2)]);
+}
+
+// The repo ANDs `ids` against `entities`, so flattening `Id OR Entity` would
+// silently return their intersection — narrower than asked.
+#[test]
+fn or_mixing_ids_and_entities_is_rejected() {
+ let expr = Expr::or(
+ Expr::val(ReminderLiteral::Id(id(1))),
+ Expr::val(ReminderLiteral::Entity("document:abc".to_string())),
+ );
+
+ assert!(extract(&expr).is_none());
+}
+
+#[test]
+fn and_mixing_ids_and_entities_is_kept() {
+ // An `And` is exactly what the repo does, so this one flattens correctly.
+ let expr = Expr::and(
+ Expr::val(ReminderLiteral::Id(id(1))),
+ Expr::val(ReminderLiteral::Entity("document:abc".to_string())),
+ );
+
+ let out = extract(&expr).expect("supported shape");
+
+ assert_eq!(out.ids, vec![id(1)]);
+ assert_eq!(out.entities, vec!["document:abc".to_string()]);
+}
+
+#[test]
+fn ids_only_or_beside_an_entity_and_is_kept() {
+ // The `Or` itself contributes only ids; the entity comes from the `And`,
+ // so the AND-flattening still matches the requested semantics.
+ let expr = Expr::and(
+ Expr::or(
+ Expr::val(ReminderLiteral::Id(id(1))),
+ Expr::val(ReminderLiteral::Id(id(2))),
+ ),
+ Expr::val(ReminderLiteral::Entity("document:abc".to_string())),
+ );
+
+ let out = extract(&expr).expect("supported shape");
+
+ assert_eq!(out.ids, vec![id(1), id(2)]);
+ assert_eq!(out.entities, vec!["document:abc".to_string()]);
+}
+
+#[test]
+fn conflicting_completed_literals_fail_closed() {
+ let expr = Expr::and(
+ Expr::val(ReminderLiteral::Completed(true)),
+ Expr::val(ReminderLiteral::Completed(false)),
+ );
+
+ assert!(extract(&expr).is_none());
+}
+
+#[test]
+fn negation_fails_closed() {
+ assert!(extract(&Expr::is_not(Expr::val(ReminderLiteral::Include))).is_none());
+}
diff --git a/crates/soup/src/domain/service.rs b/crates/soup/src/domain/service.rs
index 7099866bdf..45a474997b 100644
--- a/crates/soup/src/domain/service.rs
+++ b/crates/soup/src/domain/service.rs
@@ -1,8 +1,9 @@
use crate::domain::{
models::{
AdvancedSortParams, EnrichedSoupItem, FrecencyQueryInner, GetCrmCompaniesRequest,
- GroupedSortRequest, IntoSoupReqAst, SimpleQueryInner, SimpleSortQuery, SimpleSortRequest,
- SoupErr, SoupPropertiesField, SoupQuery, SoupRequest, SoupType, grouping::ItemGroupingInfo,
+ GetRemindersRequest, GroupedSortRequest, IntoSoupReqAst, SimpleQueryInner, SimpleSortQuery,
+ SimpleSortRequest, SoupErr, SoupPropertiesField, SoupQuery, SoupRequest, SoupType,
+ grouping::ItemGroupingInfo,
},
ports::{SoupOutput, SoupRepo, SoupService},
};
@@ -47,7 +48,9 @@ use models_soup::{
},
foreign_entity::SoupForeignEntity,
item::SoupItem,
+ reminder::SoupReminder,
};
+use reminders::domain::ports::RemindersService;
use serde::Serialize;
use std::cmp::Ordering;
use uuid::Uuid;
@@ -102,7 +105,7 @@ fn foreign_entity_to_soup_item(entity: ForeignEntity) -> SoupItem<()> {
}
/// struct which handles the actual implementation of soup with abstracted interfaces for mocking
-pub struct SoupImpl<T, U, V, C, K, Crm, F> {
+pub struct SoupImpl<T, U, V, C, K, Crm, F, Rem> {
/// the interface for interacting with the db
soup_storage: T,
/// the interface for interacting with frecency
@@ -117,9 +120,11 @@ pub struct SoupImpl<T, U, V, C, K, Crm, F> {
crm_service: Crm,
/// the interface for interacting with foreign entities
foreign_entity_service: F,
+ /// the interface for interacting with reminders
+ reminders_service: Rem,
}
-impl<T, U, V, C, K, Crm, F> SoupImpl<T, U, V, C, K, Crm, F>
+impl<T, U, V, C, K, Crm, F, Rem> SoupImpl<T, U, V, C, K, Crm, F, Rem>
where
T: SoupRepo,
anyhow::Error: From<T::Err>,
@@ -129,8 +134,10 @@ where
K: CallRecordQueryService,
Crm: CrmService,
F: ForeignEntityService,
+ Rem: RemindersService,
{
/// Creates a soup service from its repository and dependent domain services.
+ #[allow(clippy::too_many_arguments)]
pub fn new(
soup_storage: T,
frecency: U,
@@ -139,6 +146,7 @@ where
call_record_service: K,
crm_service: Crm,
foreign_entity_service: F,
+ reminders_service: Rem,
) -> Self {
SoupImpl {
soup_storage,
@@ -148,6 +156,7 @@ where
call_record_service,
crm_service,
foreign_entity_service,
+ reminders_service,
}
}
@@ -499,6 +508,41 @@ where
})))
}
+ #[tracing::instrument(err, skip(self, req))]
+ async fn handle_reminder_request(
+ &self,
+ req: Option<GetRemindersRequest<'_>>,
+ ) -> Result<impl Iterator<Item = SoupCandidate>, SoupErr> {
+ let Some(req) = req else {
+ return Ok(Either::Left(None.into_iter()));
+ };
+
+ let GetRemindersRequest {
+ user_id,
+ reminder_ids,
+ entities,
+ completed,
+ limit,
+ } = req;
+
+ let items: Vec<SoupItem<()>> = self
+ .reminders_service
+ .list_reminders_for_soup(&user_id, &reminder_ids, &entities, completed, limit)
+ .await
+ .map_err(|err| {
+ tracing::error!(error = ?err, "reminder soup request failed");
+ SoupErr::ReminderErr
+ })?
+ .into_iter()
+ .map(|reminder| SoupItem::Reminder(SoupReminder::from(reminder)))
+ .collect();
+
+ Ok(Either::Right(items.into_iter().map(|item| SoupCandidate {
+ item,
+ frecency_score: None,
+ })))
+ }
+
#[tracing::instrument(err, skip(self, req))]
async fn handle_call_request(
&self,
@@ -772,6 +816,7 @@ where
let comms_request = req.build_comms_request();
let comms_thread_request = req.build_comms_thread_request();
let call_request = req.build_call_request();
+ let reminder_request = req.build_reminder_request(limit.into());
match req.cursor {
SoupQuery::Simple(SimpleQueryInner(cursor)) => {
@@ -790,6 +835,7 @@ where
let comms_thread_soup_fut = self.handle_comms_thread_request(comms_thread_request);
let call_soup_fut = self.handle_call_request(call_request);
let crm_company_soup_fut = self.handle_crm_company_request(crm_company_request);
+ let reminder_soup_fut = self.handle_reminder_request(reminder_request);
let foreign_entity_soup_fut = self.handle_foreign_entity_request(
Some(req.user.to_string()),
foreign_entity_source_ids,
@@ -804,6 +850,7 @@ where
comms_thread_soup,
call_soup,
crm_company_soup,
+ reminder_soup,
foreign_entity_soup,
) = tokio::join!(
main_soup_fut,
@@ -812,6 +859,7 @@ where
comms_thread_soup_fut,
call_soup_fut,
crm_company_soup_fut,
+ reminder_soup_fut,
foreign_entity_soup_fut,
);
@@ -821,6 +869,7 @@ where
.chain(comms_thread_soup?)
.chain(call_soup?)
.chain(crm_company_soup?)
+ .chain(reminder_soup?)
.chain(foreign_entity_soup?)
.paginate_on(limit.into(), sort_method)
.filter_on(entity_filter)
@@ -840,7 +889,7 @@ where
}
}
-impl<T, U, V, C, K, Crm, F> SoupService for SoupImpl<T, U, V, C, K, Crm, F>
+impl<T, U, V, C, K, Crm, F, Rem> SoupService for SoupImpl<T, U, V, C, K, Crm, F, Rem>
where
T: SoupRepo,
anyhow::Error: From<T::Err>,
@@ -850,6 +899,7 @@ where
K: CallRecordQueryService,
Crm: CrmService,
F: ForeignEntityService,
+ Rem: RemindersService,
{
#[tracing::instrument(err, skip(self, req, team_receipt))]
async fn get_user_soup<R>(
diff --git a/crates/soup/src/domain/service/tests.rs b/crates/soup/src/domain/service/tests.rs
index 3d605858bb..38e757d349 100644
--- a/crates/soup/src/domain/service/tests.rs
+++ b/crates/soup/src/domain/service/tests.rs
@@ -249,6 +249,7 @@ fn foreign_entity_id_from_receipt(
})
}
use crm::domain::service::NoOpCrmService;
+use reminders::domain::service::NoOpRemindersService;
#[derive(Clone)]
struct NoopForeignEntityService;
@@ -619,6 +620,7 @@ async fn simple_soup_includes_channel_threads() {
NoopCallRecordQueryService,
NoOpCrmService,
NoopForeignEntityService,
+ NoOpRemindersService,
)
.get_user_soup(
SoupRequest {
@@ -679,6 +681,7 @@ async fn simple_soup_includes_call_records() {
call_query_service.clone(),
NoOpCrmService,
NoopForeignEntityService,
+ NoOpRemindersService,
)
.get_user_soup(
SoupRequest {
@@ -731,6 +734,7 @@ async fn simple_soup_uses_channel_thread_filters_without_touching_channel_filter
NoopCallRecordQueryService,
NoOpCrmService,
NoopForeignEntityService,
+ NoOpRemindersService,
)
.get_user_soup(
SoupRequest {
@@ -799,6 +803,7 @@ async fn simple_soup_includes_foreign_entities() {
NoopCallRecordQueryService,
NoOpCrmService,
foreign_entity_service.clone(),
+ NoOpRemindersService,
)
.get_user_soup(
SoupRequest {
@@ -880,6 +885,7 @@ async fn frecency_soup_does_not_query_foreign_entities() {
NoopCallRecordQueryService,
NoOpCrmService,
foreign_entity_service.clone(),
+ NoOpRemindersService,
)
.get_user_soup(
SoupRequest {
@@ -926,6 +932,7 @@ async fn team_receipt_contributes_team_foreign_entity_source_id() {
NoopCallRecordQueryService,
NoOpCrmService,
foreign_entity_service.clone(),
+ NoOpRemindersService,
)
.get_user_soup(
SoupRequest {
@@ -986,6 +993,7 @@ async fn crm_filters_without_team_receipt_are_rejected() {
NoopCallRecordQueryService,
NoOpCrmService,
RecordingForeignEntityService::new(Vec::new()),
+ NoOpRemindersService,
)
.get_user_soup(
SoupRequest {
@@ -1032,6 +1040,7 @@ async fn foreign_entity_filter_suppresses_non_matching_foreign_entities() {
NoopCallRecordQueryService,
NoOpCrmService,
foreign_entity_service.clone(),
+ NoOpRemindersService,
)
.get_user_soup(
SoupRequest {
@@ -1103,6 +1112,7 @@ async fn it_should_not_query_frecency() {
NoopCallRecordQueryService,
NoOpCrmService,
NoopForeignEntityService,
+ NoOpRemindersService,
)
.get_user_soup(
SoupRequest {
@@ -1164,6 +1174,7 @@ async fn properties_are_populated_once_after_pagination() {
NoopCallRecordQueryService,
NoOpCrmService,
NoopForeignEntityService,
+ NoOpRemindersService,
)
.get_user_soup_with_properties(
SoupRequest {
@@ -1237,6 +1248,7 @@ async fn frecency_is_populated_once_after_pagination() {
NoopCallRecordQueryService,
NoOpCrmService,
NoopForeignEntityService,
+ NoOpRemindersService,
)
.get_user_soup_with_frecency(
SoupRequest {
@@ -1305,6 +1317,7 @@ async fn properties_and_frecency_are_composed_after_pagination() {
NoopCallRecordQueryService,
NoOpCrmService,
NoopForeignEntityService,
+ NoOpRemindersService,
)
.get_user_soup_with_properties_and_frecency(
SoupRequest {
@@ -1378,6 +1391,7 @@ async fn grouped_properties_are_populated_by_the_service() {
NoopCallRecordQueryService,
NoOpCrmService,
NoopForeignEntityService,
+ NoOpRemindersService,
);
let items = service
.get_user_soup_grouped(GroupedSortRequest {
@@ -1468,6 +1482,7 @@ async fn it_should_query_frecency() {
NoopCallRecordQueryService,
NoOpCrmService,
NoopForeignEntityService,
+ NoOpRemindersService,
)
.get_user_soup(
SoupRequest {
@@ -1552,6 +1567,7 @@ async fn it_should_sort_frecency_descending() {
NoopCallRecordQueryService,
NoOpCrmService,
NoopForeignEntityService,
+ NoOpRemindersService,
)
.get_user_soup_with_frecency(
SoupRequest {
@@ -1650,6 +1666,7 @@ async fn frecency_should_fallback() {
NoopCallRecordQueryService,
NoOpCrmService,
NoopForeignEntityService,
+ NoOpRemindersService,
)
.get_user_soup_with_frecency(
SoupRequest {
@@ -1732,6 +1749,7 @@ async fn frecency_should_paginate() {
NoopCallRecordQueryService,
NoOpCrmService,
NoopForeignEntityService,
+ NoOpRemindersService,
)
.get_user_soup_with_frecency(
SoupRequest {
@@ -1816,6 +1834,7 @@ async fn frecency_should_resume_cursor() {
NoopCallRecordQueryService,
NoOpCrmService,
NoopForeignEntityService,
+ NoOpRemindersService,
)
.get_user_soup_with_frecency(
SoupRequest {
@@ -1916,6 +1935,7 @@ async fn frecency_fallback_cursor_should_resume() {
NoopCallRecordQueryService,
NoOpCrmService,
NoopForeignEntityService,
+ NoOpRemindersService,
)
.get_user_soup_with_frecency(
SoupRequest {
@@ -1989,6 +2009,7 @@ async fn cursor_should_return_simple_sort() {
NoopCallRecordQueryService,
NoOpCrmService,
NoopForeignEntityService,
+ NoOpRemindersService,
)
.get_user_soup(
SoupRequest {
@@ -2061,6 +2082,7 @@ async fn cursor_should_return_frecency() {
NoopCallRecordQueryService,
NoOpCrmService,
NoopForeignEntityService,
+ NoOpRemindersService,
)
.get_user_soup(
SoupRequest {
@@ -2120,6 +2142,7 @@ async fn it_should_return_is_completed_true_for_completed_tasks() {
NoopCallRecordQueryService,
NoOpCrmService,
NoopForeignEntityService,
+ NoOpRemindersService,
)
.get_user_soup(
SoupRequest {
@@ -2169,6 +2192,7 @@ async fn it_should_return_is_completed_false_for_incomplete_tasks() {
NoopCallRecordQueryService,
NoOpCrmService,
NoopForeignEntityService,
+ NoOpRemindersService,
)
.get_user_soup(
SoupRequest {
@@ -2218,6 +2242,7 @@ async fn it_should_return_is_completed_none_for_non_tasks() {
NoopCallRecordQueryService,
NoOpCrmService,
NoopForeignEntityService,
+ NoOpRemindersService,
)
.get_user_soup(
SoupRequest {
@@ -2279,6 +2304,7 @@ async fn it_should_preserve_is_completed_for_mixed_items() {
NoopCallRecordQueryService,
NoOpCrmService,
NoopForeignEntityService,
+ NoOpRemindersService,
)
.get_user_soup(
SoupRequest {
@@ -2362,6 +2388,7 @@ async fn it_should_preserve_is_completed_in_by_ids_queries() {
NoopCallRecordQueryService,
NoOpCrmService,
NoopForeignEntityService,
+ NoOpRemindersService,
)
.get_user_soup(
SoupRequest {
diff --git a/crates/soup/src/inbound/axum_router.rs b/crates/soup/src/inbound/axum_router.rs
index ce03d3092c..f9ac49497b 100644
--- a/crates/soup/src/inbound/axum_router.rs
+++ b/crates/soup/src/inbound/axum_router.rs
@@ -44,6 +44,7 @@ use item_filters::{
foreign_entity::ForeignEntityLiteral,
project::ProjectLiteral,
properties::{PropertiesLiteral, PropertyEntityType},
+ reminder::ReminderLiteral,
},
};
use macro_authorization::{
@@ -1104,6 +1105,12 @@ pub struct ApiEntityFilterAst {
#[serde(default, rename = "ccf")]
#[schema(value_type = serde_json::Value)]
pub crm_company_filter: LiteralTree<CrmCompanyLiteral>,
+ /// Filters applied to reminders (wire key `remf`). Unlike every other
+ /// filter here, empty/omitted returns **no** reminders: they are opt-in,
+ /// so the caller must send `inc`, an id, or an entity to get any.
+ #[serde(default, rename = "remf")]
+ #[schema(value_type = serde_json::Value)]
+ pub reminder_filter: LiteralTree<ReminderLiteral>,
/// the filters that should be applied based on entity properties
#[serde(default, rename = "propf")]
#[schema(value_type = serde_json::Value)]
@@ -1194,6 +1201,7 @@ impl ApiEntityFilterAst {
foreign_entity_filter,
call_filter,
crm_company_filter,
+ reminder_filter,
properties_filter,
email_crm_domains,
email_crm_addresses,
@@ -1261,6 +1269,7 @@ impl ApiEntityFilterAst {
call_filter,
crm_company_filter,
foreign_entity_filter,
+ reminder_filter,
properties_filter,
})
}
diff --git a/crates/soup/src/inbound/toolset/list_entities.rs b/crates/soup/src/inbound/toolset/list_entities.rs
index 84e641faf2..a48024a5cd 100644
--- a/crates/soup/src/inbound/toolset/list_entities.rs
+++ b/crates/soup/src/inbound/toolset/list_entities.rs
@@ -295,11 +295,14 @@ impl EntityItem {
created_by: record.created_by,
tags: resolve_applied_tags(&record.extra.properties, tag_map),
},
- // `entity_filter_ast` force-filters CrmCompany out — kept
- // loud here so a contract break is obvious, not silent.
+ // `entity_filter_ast` force-filters CrmCompany and Reminder out —
+ // kept loud here so a contract break is obvious, not silent.
SoupItem::CrmCompany(_) => {
unreachable!("ListEntities tool does not surface CrmCompany rows")
}
+ SoupItem::Reminder(_) => {
+ unreachable!("ListEntities tool does not surface Reminder rows")
+ }
SoupItem::ForeignEntity(foreign_entity) => EntityItem::ForeignEntity {
id: foreign_entity.id,
foreign_entity_id: foreign_entity.foreign_entity_id,
@@ -348,7 +351,8 @@ fn any_item_has_tags(items: &[EnrichedSoupItem]) -> bool {
SoupItem::Channel(_)
| SoupItem::ChannelThread(_)
| SoupItem::Call(_)
- | SoupItem::ForeignEntity(_) => return false,
+ | SoupItem::ForeignEntity(_)
+ | SoupItem::Reminder(_) => return false,
};
properties
.iter()
@@ -548,6 +552,9 @@ impl ListEntities {
// AI never sees one.
crm_company_filter: Some(Arc::new(Expr::val(CrmCompanyLiteral::Id(Uuid::nil())))),
foreign_entity_filter: self.foreign_entity_filter.clone(),
+ // Reminders are opt-in in Soup, so leaving this unset is already
+ // what keeps them out of the tool surface — no force-filter needed.
+ reminder_filter: None,
properties_filter,
};
@@ -620,6 +627,8 @@ impl ListEntities {
} else {
Some(Arc::new(Expr::val(ForeignEntityLiteral::Id(Uuid::nil()))))
},
+ // Same as CrmCompany — no ItemType::Reminder to toggle against.
+ reminder_filter: ast.reminder_filter,
properties_filter: ast.properties_filter,
}
}
diff --git a/crates/soup/src/outbound/pg_soup_repo.rs b/crates/soup/src/outbound/pg_soup_repo.rs
index 0ce4e7a9ff..bc74118442 100644
--- a/crates/soup/src/outbound/pg_soup_repo.rs
+++ b/crates/soup/src/outbound/pg_soup_repo.rs
@@ -266,9 +266,10 @@ pub(crate) async fn populate_properties(
SoupItem::CrmCompany(x) => properties_map.get(&x.id.to_string()),
SoupItem::Call(x) => properties_map.get(&x.call_id.to_string()),
SoupItem::CalendarEvent(x) => properties_map.get(&x.id.to_string()),
- SoupItem::Channel(_) | SoupItem::ChannelThread(_) | SoupItem::ForeignEntity(_) => {
- None
- }
+ SoupItem::Channel(_)
+ | SoupItem::ChannelThread(_)
+ | SoupItem::ForeignEntity(_)
+ | SoupItem::Reminder(_) => None,
}
.map(|properties| properties.iter().cloned().map(SoupProperty::from).collect())
.unwrap_or_default();
diff --git a/crates/soup/src/outbound/pg_soup_repo/expanded/tests.rs b/crates/soup/src/outbound/pg_soup_repo/expanded/tests.rs
index 2d995ccdac..fdb4a2f831 100644
--- a/crates/soup/src/outbound/pg_soup_repo/expanded/tests.rs
+++ b/crates/soup/src/outbound/pg_soup_repo/expanded/tests.rs
@@ -5522,6 +5522,7 @@ fn mock_empty_ast() -> EntityFilterAst {
call_filter: None,
crm_company_filter: None,
foreign_entity_filter: None,
+ reminder_filter: None,
properties_filter: None,
}
}
diff --git a/packages/sdk/generated/search/index.ts b/packages/sdk/generated/search/index.ts
index 0a7c66b43d..208aa0e94e 100644
--- a/packages/sdk/generated/search/index.ts
+++ b/packages/sdk/generated/search/index.ts
@@ -1,4 +1,4 @@
// This file is auto-generated by @hey-api/openapi-ts
export { type Options, Sdk } from './sdk.gen';
-export type { CalendarEventFilters, CallFilters, CallRecordMetadata, CallRecordSearchResponseItem, CallRecordSearchResponseItemWithMetadata, CallRecordSearchResult, CallStatus, ChannelFilters, ChannelMessageSearchResponseItem, ChannelMetadata, ChannelNameSearchResponseItem, ChannelSearchRequest, ChannelSearchResponse, ChannelSearchResponseItem, ChannelSearchResponseItemWithMetadata, ChannelSearchResult, ChannelSortTimestamp, ChannelThreadFilters, ChatFilters, ChatMessageSearchResult, ChatMetadata, ChatSearchRequest, ChatSearchResponse, ChatSearchResponseItem, ChatSearchResponseItemWithMetadata, ClientOptions, CrmCompanyFilters, CrmCompanySearchDomain, CrmCompanySearchResponseItem, DataType, DocumentFilters, DocumentMetadata, DocumentSearchRequest, DocumentSearchResponse, DocumentSearchResponseItem, DocumentSearchResponseItemWithMetadata, DocumentSearchResult, DocumentSubType, EmailFilters, EmailSearchParticipant, EmailSearchRequest, EmailSearchResponse, EmailSearchResponseItem, EmailSearchResponseItemWithMetadata, EmailSearchResult, EmptyResponse, EntityFilters, EntityReference, EntityType, ErrorResponse, FileType, ForeignEntityFilters, MatchType, NotificationFilters, ProjectFilters, ProjectMetadata, ProjectSearchMetadata, ProjectSearchRequest, ProjectSearchResponseItem, ProjectSearchResponseItemWithMetadata, ProjectSearchResult, PropertyDefinition, PropertyFilter, PropertyOwner, PropertyValue, SearchHighlight, SearchOn, SearchResponse, SharedEmailFilter, SimpleCallRecordSearchResponseBaseItemHumanReadableTimestamp, SimpleChannelSearchReponseBaseItem, SimpleChannelSearchReponseBaseItemHumanReadableTimestamp, SimpleChannelSearchResponse, SimpleChatSearchResponse, SimpleChatSearchResponseBaseItem, SimpleChatSearchResponseBaseItemHumanReadableTimestamp, SimpleDocumentSearchResponse, SimpleDocumentSearchResponseBaseItem, SimpleDocumentSearchResponseBaseItemHumanReadableTimestamp, SimpleEmailSearchResponse, SimpleEmailSearchResponseBaseItem, SimpleEmailSearchResponseBaseItemHumanReadableTimestamp, SimpleProjectSearchResponse, SimpleProjectSearchResponseBaseItem, SimpleProjectSearchResponseBaseItemHumanReadableTimestamp, SimpleUnifiedSearchBaseResponse, SimpleUnifiedSearchData, SimpleUnifiedSearchError, SimpleUnifiedSearchErrors, SimpleUnifiedSearchResponse, SimpleUnifiedSearchResponseBaseItem, SimpleUnifiedSearchResponseBaseItemHumanReadableTimestamp, SimpleUnifiedSearchResponses, SoupProperty, TagFilterMode, TaskFilters, UnifiedSearchData, UnifiedSearchError, UnifiedSearchErrors, UnifiedSearchRequest, UnifiedSearchResponse, UnifiedSearchResponse2, UnifiedSearchResponseItem, UnifiedSearchResponses } from './types.gen';
+export type { CalendarEventFilters, CallFilters, CallRecordMetadata, CallRecordSearchResponseItem, CallRecordSearchResponseItemWithMetadata, CallRecordSearchResult, CallStatus, ChannelFilters, ChannelMessageSearchResponseItem, ChannelMetadata, ChannelNameSearchResponseItem, ChannelSearchRequest, ChannelSearchResponse, ChannelSearchResponseItem, ChannelSearchResponseItemWithMetadata, ChannelSearchResult, ChannelSortTimestamp, ChannelThreadFilters, ChatFilters, ChatMessageSearchResult, ChatMetadata, ChatSearchRequest, ChatSearchResponse, ChatSearchResponseItem, ChatSearchResponseItemWithMetadata, ClientOptions, CrmCompanyFilters, CrmCompanySearchDomain, CrmCompanySearchResponseItem, DataType, DocumentFilters, DocumentMetadata, DocumentSearchRequest, DocumentSearchResponse, DocumentSearchResponseItem, DocumentSearchResponseItemWithMetadata, DocumentSearchResult, DocumentSubType, EmailFilters, EmailSearchParticipant, EmailSearchRequest, EmailSearchResponse, EmailSearchResponseItem, EmailSearchResponseItemWithMetadata, EmailSearchResult, EmptyResponse, EntityFilters, EntityReference, EntityType, ErrorResponse, FileType, ForeignEntityFilters, MatchType, NotificationFilters, ProjectFilters, ProjectMetadata, ProjectSearchMetadata, ProjectSearchRequest, ProjectSearchResponseItem, ProjectSearchResponseItemWithMetadata, ProjectSearchResult, PropertyDefinition, PropertyFilter, PropertyOwner, PropertyValue, ReminderFilters, SearchHighlight, SearchOn, SearchResponse, SharedEmailFilter, SimpleCallRecordSearchResponseBaseItemHumanReadableTimestamp, SimpleChannelSearchReponseBaseItem, SimpleChannelSearchReponseBaseItemHumanReadableTimestamp, SimpleChannelSearchResponse, SimpleChatSearchResponse, SimpleChatSearchResponseBaseItem, SimpleChatSearchResponseBaseItemHumanReadableTimestamp, SimpleDocumentSearchResponse, SimpleDocumentSearchResponseBaseItem, SimpleDocumentSearchResponseBaseItemHumanReadableTimestamp, SimpleEmailSearchResponse, SimpleEmailSearchResponseBaseItem, SimpleEmailSearchResponseBaseItemHumanReadableTimestamp, SimpleProjectSearchResponse, SimpleProjectSearchResponseBaseItem, SimpleProjectSearchResponseBaseItemHumanReadableTimestamp, SimpleUnifiedSearchBaseResponse, SimpleUnifiedSearchData, SimpleUnifiedSearchError, SimpleUnifiedSearchErrors, SimpleUnifiedSearchResponse, SimpleUnifiedSearchResponseBaseItem, SimpleUnifiedSearchResponseBaseItemHumanReadableTimestamp, SimpleUnifiedSearchResponses, SoupProperty, TagFilterMode, TaskFilters, UnifiedSearchData, UnifiedSearchError, UnifiedSearchErrors, UnifiedSearchRequest, UnifiedSearchResponse, UnifiedSearchResponse2, UnifiedSearchResponseItem, UnifiedSearchResponses } from './types.gen';
diff --git a/packages/sdk/generated/search/types.gen.ts b/packages/sdk/generated/search/types.gen.ts
index 5b67517e5e..4bbadf214d 100644
--- a/packages/sdk/generated/search/types.gen.ts
+++ b/packages/sdk/generated/search/types.gen.ts
@@ -1092,6 +1092,10 @@ export type EntityFilters = {
* property-based filters applied across entity types
*/
property_filters?: Array<PropertyFilter>;
+ /**
+ * the bundled [ReminderFilters]
+ */
+ reminder_filters?: ReminderFilters;
/**
* How the `tag_option_ids` combine: `any` (default) matches entities
* holding at least one selected tag, `all` requires every selected tag.
@@ -1434,6 +1438,30 @@ export type PropertyValue = {
value: Array<string>;
};
+/**
+ * Filters for reminders.
+ */
+export type ReminderFilters = {
+ /**
+ * Filter on whether the reminder has already fired. `None` returns both.
+ */
+ completed?: boolean | null;
+ /**
+ * Restrict to reminders attached to these entities, each `"{type}:{id}"`.
+ */
+ entities?: Array<string>;
+ /**
+ * Reminder ids to filter by. Empty to include all of the caller's reminders.
+ */
+ ids?: Array<string>;
+ /**
+ * Opt this query into reminders at all. Reminders are off by default —
+ * see [`crate::ast::reminder::ReminderLiteral::Include`]. Asking for
+ * specific `ids` or `entities` also opts in.
+ */
+ include?: boolean;
+};
+
export type SearchHighlight = {
/**
* The highlight match on the bcc (email only)
diff --git a/packages/sdk/generated/storage/index.ts b/packages/sdk/generated/storage/index.ts
index 94b5bd30b4..9e05b93cf4 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-ts
export { type Options, Sdk } from './sdk.gen';
-export type { AccessLevel, Activity, ActivityType, AddFavoriteData, AddFavoriteError, AddFavoriteErrors, AddFavoriteRequest, AddFavoriteResponse, AddFavoriteResponses, AddParticipantsData, AddParticipantsError, AddParticipantsErrors, AddParticipantsRequest, AddParticipantsResponses, AddPinHandlerData, AddPinHandlerError, AddPinHandlerErrors, AddPinHandlerResponse, AddPinHandlerResponses, AddPinRequest, Anchor, AnchorId, AnchorRequest, AnchorResponse, AnnotationIncrementalUpdate, ApiActivity, ApiAttachmentChannelReference, ApiAttachmentEntityReference, ApiAttachmentGenericReference, ApiChannelAttachment, ApiChannelAttachmentsPage, ApiChannelContextMessage, ApiChannelDetail, ApiChannelListMessage, ApiChannelListPage, ApiChannelListParticipant, ApiChannelListType, ApiChannelMessage, ApiChannelMessageKind, ApiChannelMessagesPage, ApiChannelParticipant, ApiChannelWithLatest, ApiCountedReaction, ApiEntityFilterAst, ApiGroupByField, ApiGroupMeta, ApiMessageAttachment, ApiMessageSender, ApiMessageSenderType, ApiParticipantListRole, ApiParticipantRole, ApiPropertyEntityType, ApiResolvedChannelMessage, ApiThreadInfo, ApiThreadReply, AttendeeResponseStatus, BasicDocument, BasicDocumentSubType, BomPart, Bot, BotChannel, BotChannelType, BotId, BotKind, BotOwner, BotToken, BranchNameResponse, BTreeMap, BulkWakeupRequest, BulkWakeupResponse, BulkWakeupSyncServiceDocumentsData, BulkWakeupSyncServiceDocumentsErrors, BulkWakeupSyncServiceDocumentsResponse, BulkWakeupSyncServiceDocumentsResponses, CalendarAttendee, CalendarEvent, CalendarEventFilters, CalendarOccurrence, CalendarOccurrenceItem, CalendarOccurrenceResponse, CalendarSyncStatus, CallActiveResponse, CallFilters, CallRecord, CallRecordParticipant, CallRecordPreview, CallRecordPreviewData, CallRecordTranscriptSegment, CallStatus, CallTokenResponse, CallWebhookData, CallWebhookError, CallWebhookErrors, CallWebhookResponses, Channel, ChannelCreatedMetadata, ChannelDeletedMetadata, ChannelEventAttachment, ChannelFilters, ChannelJoinCodeResponse, ChannelMentionedMetadata, ChannelMessage, ChannelMessageAttachmentCreatedMetadata, ChannelMessageAttachmentRemovedMetadata, ChannelMessageDeletedMetadata, ChannelMessageFilters, ChannelMessagePatchedMetadata, ChannelMessagePostedMetadata, ChannelParticipant, ChannelParticipantAddedMetadata, ChannelParticipantRemovedMetadata, ChannelPreview, ChannelPreviewData, ChannelSender, ChannelSharePermission, ChannelThreadFilters, ChannelTopicEvent, ChannelType, ChannelUpdatedMetadata, ChannelWebhookRequest, ChannelWebhookResponse, ChannelWithParticipants, Chat, ChatFilters, CheckActiveCallData, CheckActiveCallError, CheckActiveCallErrors, CheckActiveCallResponse, CheckActiveCallResponses, ClientOptions, CloudStorageItemType, Comment, CommentThread, CopyDocumentData, CopyDocumentError, CopyDocumentErrors, CopyDocumentQueryParams, CopyDocumentRequest, CopyDocumentResponse, CopyDocumentResponse2, CopyDocumentResponses, CreateAnchorData, CreateAnchorError, CreateAnchorErrors, CreateAnchorResponse, CreateAnchorResponses, CreateBulkDocumentResponse, CreateBulkDocumentResponseData, CreateChannelData, CreateChannelError, CreateChannelErrors, CreateChannelRequest, CreateChannelResponse, CreateChannelResponse2, CreateChannelResponses, CreateChannelScopedBotData, CreateChannelScopedBotError, CreateChannelScopedBotErrors, CreateChannelScopedBotRequest, CreateChannelScopedBotResponse, CreateChannelScopedBotResponse2, CreateChannelScopedBotResponses, CreateCommentData, CreateCommentError, CreateCommentErrors, CreateCommentRequest, CreateCommentResponse, CreateCommentResponse2, CreateCommentResponses, CreateCrmCommentData, CreateCrmCommentError, CreateCrmCommentErrors, CreateCrmCommentRequest, CreateCrmCommentResponse, CreateCrmCommentResponses, CreateCrmCompanyData, CreateCrmCompanyError, CreateCrmCompanyErrors, CreateCrmCompanyRequest, CreateCrmCompanyResponse, CreateCrmCompanyResponses, CreateCrmContactData, CreateCrmContactError, CreateCrmContactErrors, CreateCrmContactRequest, CreateCrmContactResponse, CreateCrmContactResponses, CreateDocumentData, CreateDocumentError, CreateDocumentErrors, CreateDocumentRequest, CreateDocumentResponse, CreateDocumentResponseData, CreateDocumentResponses, CreateEntityMentionData, CreateEntityMentionError, CreateEntityMentionErrors, CreateEntityMentionRequest, CreateEntityMentionResponse, CreateEntityMentionResponse2, CreateEntityMentionResponses, CreateInstructionsDocumentResponse, CreateInstructionsHandlerData, CreateInstructionsHandlerError, CreateInstructionsHandlerErrors, CreateInstructionsHandlerResponse, CreateInstructionsHandlerResponses, CreateMarkdownDocumentRequest, CreateMarkdownDocumentResponse, CreateMarkdownHandlerData, CreateMarkdownHandlerError, CreateMarkdownHandlerErrors, CreateMarkdownHandlerResponse, CreateMarkdownHandlerResponses, CreateProjectHandlerData, CreateProjectHandlerError, CreateProjectHandlerErrors, CreateProjectHandlerResponse, CreateProjectHandlerResponses, CreateProjectRequest, CreateProjectResponse, CreateReminderData, CreateReminderError, CreateReminderErrors, CreateReminderRequest, CreateReminderResponse, CreateReminderResponses, CreateSnippetHandlerData, CreateSnippetHandlerError, CreateSnippetHandlerErrors, CreateSnippetHandlerResponse, CreateSnippetHandlerResponses, CreateSnippetRequest, CreateSnippetResponse, CreateTaskHandlerData, CreateTaskHandlerError, CreateTaskHandlerErrors, CreateTaskHandlerResponse, CreateTaskHandlerResponses, CreateTaskRequest, CreateTaskResponse, CreateUnthreadedAnchorRequest, CreateUnthreadedAnchorResponse, CreateUnthreadedPdfAnchorRequest, CreateViewHandlerData, CreateViewHandlerError, CreateViewHandlerErrors, CreateViewHandlerResponse, CreateViewHandlerResponses, CreateViewRequest, CreateWebhookData, CreateWebhookError, CreateWebhookErrors, CreateWebhookRequest, CreateWebhookResponse, CreateWebhookResponse2, CreateWebhookResponses, CrmComment, CrmCommentEntityType, CrmCommentThread, CrmCompanyFilters, CrmCompanyResponse, CrmContactResponse, CrmDomainResponse, CrmPermissionRole, CrmTeamSettingsResponse, CrmThread, CustomSpeakerAssignment, DataType, DeleteAnchorData, DeleteAnchorError, DeleteAnchorErrors, DeleteAnchorInfo, DeleteAnchorResponse, DeleteAnchorResponses, DeleteCallRecordData, DeleteCallRecordError, DeleteCallRecordErrors, DeleteCallRecordResponse, DeleteCallRecordResponses, DeleteChannelData, DeleteChannelError, DeleteChannelErrors, DeleteChannelResponse, DeleteChannelResponses, DeleteCommentData, DeleteCommentError, DeleteCommentErrors, DeleteCommentRequest, DeleteCommentResponse, DeleteCommentResponse2, DeleteCommentResponses, DeleteCrmCommentData, DeleteCrmCommentError, DeleteCrmCommentErrors, DeleteCrmCommentResponse, DeleteCrmCommentResponses, DeleteCrmCommentResult, DeleteDocumentData, DeleteDocumentError, DeleteDocumentErrors, DeleteDocumentResponse, DeleteDocumentResponses, DeleteEntityMentionData, DeleteEntityMentionError, DeleteEntityMentionErrors, DeleteEntityMentionResponse, DeleteEntityMentionResponse2, DeleteEntityMentionResponses, DeleteHistoryHandlerData, DeleteHistoryHandlerError, DeleteHistoryHandlerErrors, DeleteHistoryHandlerResponse, DeleteHistoryHandlerResponses, DeleteMessageData, DeleteMessageError, DeleteMessageErrors, DeleteMessageQuery, DeleteMessageResponse, DeleteMessageResponses, DeleteProjectHandlerData, DeleteProjectHandlerError, DeleteProjectHandlerErrors, DeleteProjectHandlerResponse, DeleteProjectHandlerResponses, DeleteReminderData, DeleteReminderError, DeleteReminderErrors, DeleteReminderResponse, DeleteReminderResponses, DeleteThreadInfo, DeleteUnthreadedAnchorRequest, DeleteUnthreadedAnchorResponse, DeleteUnthreadedPdfAnchorRequest, DeleteUserDocumentViewLocationData, DeleteUserDocumentViewLocationError, DeleteUserDocumentViewLocationErrors, DeleteUserDocumentViewLocationResponse, DeleteUserDocumentViewLocationResponses, DeleteViewHandlerData, DeleteViewHandlerError, DeleteViewHandlerErrors, DeleteViewHandlerResponses, DeleteWebhookData, DeleteWebhookError, DeleteWebhookErrors, DeleteWebhookResponse, DeleteWebhookResponses, DocumentBasic, DocumentContent, DocumentContentLocation, DocumentContentState, DocumentContentUploadedMetadata, DocumentCopiedMetadata, DocumentCreatedMetadata, DocumentDeletedMetadata, DocumentFilters, DocumentInteractionMetadata, DocumentMetadata, DocumentMetadataWithContent, DocumentPermissionsToken, DocumentPermissionsTokenRequest, DocumentPermissionsTokenResponse, DocumentPreview, DocumentPreviewData, DocumentPreviewDataSubType, DocumentPurgedMetadata, DocumentResponse, DocumentResponseMetadata, DocumentResponseMetadataWithContent, DocumentStorageServiceApiVersion, DocumentSubType, DocumentSyncContentUpdatedMetadata, DocumentTeamShareResponse, DocumentTopicEvent, DocumentUpdatedMetadata, EditAnchorData, EditAnchorError, EditAnchorErrors, EditAnchorRequest, EditAnchorResponse, EditAnchorResponse2, EditAnchorResponses, EditCallRecordData, EditCallRecordError, EditCallRecordErrors, EditCallRecordRequest, EditCallRecordResponse, EditCallRecordResponses, EditCallTranscriptData, EditCallTranscriptError, EditCallTranscriptErrors, EditCallTranscriptRequest, EditCallTranscriptResponse, EditCallTranscriptResponses, EditCommentData, EditCommentError, EditCommentErrors, EditCommentRequest, EditCommentResponse, EditCommentResponse2, EditCommentResponses, EditCrmCommentData, EditCrmCommentError, EditCrmCommentErrors, EditCrmCommentRequest, EditCrmCommentResponse, EditCrmCommentResponses, EditDocumentData, EditDocumentError, EditDocumentErrors, EditDocumentResponse, EditDocumentResponse2, EditDocumentResponses, EditDocumentServiceArgs, EditPdfAnchorRequest, EditPdfPlaceableCommentAnchorRequest, EditProjectV2Data, EditProjectV2Error, EditProjectV2Errors, EditProjectV2Response, EditProjectV2Responses, EditThreadV2Data, EditThreadV2Error, EditThreadV2Errors, EditThreadV2Response, EditThreadV2Responses, EmailFilters, EmptyResponse, EntityFilters, EntityPermission, EntityPermissionResponse, EntityReference, EntityType, ErrorResponse, EventStatus, EventTime, EventTransparency, EventVisibility, ExcludedDefaultView, ExcludeDefaultViewHandlerData, ExcludeDefaultViewHandlerError, ExcludeDefaultViewHandlerErrors, ExcludeDefaultViewHandlerResponses, ExcludeDefaultViewRequest, ExportDocumentData, ExportDocumentError, ExportDocumentErrors, ExportDocumentResponse, ExportDocumentResponse2, ExportDocumentResponses, Favorite, FavoriteEntityRef, FavoritesList, FileSystemNodeWithIds, FileType, FileTypeUpdate, FolderItem, ForeignEntity, ForeignEntityFilters, GenericErrorResponse, GenericResponse, GenericSuccessResponse, GetActivitiesResponse, 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, GetCallRecordData, GetCallRecordError, GetCallRecordErrors, GetCallRecordResponse, GetCallRecordResponses, GetChannelAttachmentsData, GetChannelAttachmentsError, GetChannelAttachmentsErrors, GetChannelAttachmentsResponse, GetChannelAttachmentsResponses, GetChannelData, GetChannelError, GetChannelErrors, GetChannelJoinLinkData, GetChannelJoinLinkError, GetChannelJoinLinkErrors, GetChannelJoinLinkResponse, GetChannelJoinLinkResponses, GetChannelMessagesData, GetChannelMessagesError, GetChannelMessagesErrors, GetChannelMessagesResponse, GetChannelMessagesResponses, GetChannelParticipantsData, GetChannelParticipantsError, GetChannelParticipantsErrors, GetChannelParticipantsResponse, GetChannelParticipantsResponses, GetChannelResponse, GetChannelResponses, GetChannelsData, GetChannelsError, GetChannelsErrors, GetChannelsResponse, GetChannelsResponses, GetCompanyData, GetCompanyError, GetCompanyErrors, GetCompanyResponse, GetCompanyResponses, GetContactData, GetContactError, GetContactErrors, GetContactResponse, GetContactResponses, GetCrmTeamSettingsData, GetCrmTeamSettingsError, GetCrmTeamSettingsErrors, GetCrmTeamSettingsResponse, GetCrmTeamSettingsResponses, GetDocumentAnchorsData, GetDocumentAnchorsError, GetDocumentAnchorsErrors, GetDocumentAnchorsResponse, GetDocumentAnchorsResponses, GetDocumentBranchNameData, GetDocumentBranchNameError, GetDocumentBranchNameErrors, GetDocumentBranchNameResponse, GetDocumentBranchNameResponses, GetDocumentByTeamSlugData, GetDocumentByTeamSlugError, GetDocumentByTeamSlugErrors, GetDocumentByTeamSlugResponse, GetDocumentByTeamSlugResponses, GetDocumentCommentsData, GetDocumentCommentsError, GetDocumentCommentsErrors, GetDocumentCommentsResponse, GetDocumentCommentsResponses, 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, GetEntityPermissionData, GetEntityPermissionErrors, GetEntityPermissionResponse, GetEntityPermissionResponses, GetForeignEntityData, GetForeignEntityError, GetForeignEntityErrors, GetForeignEntityResponse, GetForeignEntityResponses, GetHistoryHandlerData, GetHistoryHandlerError, GetHistoryHandlerErrors, GetHistoryHandlerResponse, GetHistoryHandlerResponses, GetInstructionsDocumentResponse, GetInstructionsHandlerData, GetInstructionsHandlerError, GetInstructionsHandlerErrors, GetInstructionsHandlerResponse, GetInstructionsHandlerResponses, GetItemsSoupData, GetItemsSoupError, GetItemsSoupErrors, GetItemsSoupResponse, GetItemsSoupResponses, GetLocationHandlerData, GetLocationHandlerError, GetLocationHandlerErrors, GetLocationHandlerResponse, GetLocationHandlerResponses, GetMessageWithContextData, GetMessageWithContextError, GetMessageWithContextErrors, GetMessageWithContextResponse, GetMessageWithContextResponse2, GetMessageWithContextResponses, 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, GetRecentActivityHandlerData, GetRecentActivityHandlerError, GetRecentActivityHandlerErrors, GetRecentActivityHandlerResponse, GetRecentActivityHandlerResponses, GetReminderData, GetReminderError, GetReminderErrors, GetReminderResponse, GetReminderResponses, GetRingStatusData, GetRingStatusError, GetRingStatusErrors, GetRingStatusResponse, GetRingStatusResponses, GetSelfBotData, GetSelfBotError, GetSelfBotErrors, GetSelfBotResponse, GetSelfBotResponses, GetThreadRepliesData, GetThreadRepliesError, GetThreadRepliesErrors, GetThreadRepliesResponse, GetThreadRepliesResponses, GetUserDocumentsHandlerData, GetUserDocumentsHandlerError, GetUserDocumentsHandlerErrors, GetUserDocumentsHandlerResponse, GetUserDocumentsHandlerResponses, GetUserDocumentViewLocationData, GetUserDocumentViewLocationError, GetUserDocumentViewLocationErrors, GetUserDocumentViewLocationResponse, GetUserDocumentViewLocationResponses, GetUserHistoryResponse, GetViewsHandlerData, GetViewsHandlerError, GetViewsHandlerErrors, GetViewsHandlerResponse, GetViewsHandlerResponses, GetWebhookData, GetWebhookError, GetWebhookErrors, GetWebhookResponse, GetWebhookResponses, GithubPullRequest, GithubPullRequestCheckRun, GithubPullRequestComment, GithubPullRequestsResponse, GroupedInitialParams, GroupedPageParams, GroupedSoupGroupPage, GroupedSoupInitialPage, GroupedSoupPage, GroupedSoupSort, HandlerData, HandlerError, HandlerErrors, HandlerResponse, HandlerResponses, HashMap, HealthHandlerData, HealthHandlerResponse, HealthHandlerResponses, HighlightType, IngestTranscriptData, IngestTranscriptError, IngestTranscriptErrors, IngestTranscriptResponses, InitializeUserDocumentsData, InitializeUserDocumentsError, InitializeUserDocumentsErrors, InitializeUserDocumentsResponse, InitializeUserDocumentsResponses, InstallSyncData, InstallSyncErrors, InteractionReason, Item, ItemWithUserAccessLevel, JobProcessingResultHandlerData, JobProcessingResultHandlerError, JobProcessingResultHandlerErrors, JobProcessingResultHandlerResponse, JobProcessingResultHandlerResponses, JoinChannelByCodeData, JoinChannelByCodeError, JoinChannelByCodeErrors, JoinChannelByCodeResponses, JoinChannelData, JoinChannelError, JoinChannelErrors, JoinChannelResponses, LatestMessage, LeaveCallResponse, LeaveChannelData, LeaveChannelError, LeaveChannelErrors, LeaveChannelResponses, LeaveOrEndCallData, LeaveOrEndCallError, LeaveOrEndCallErrors, LeaveOrEndCallResponse, LeaveOrEndCallResponses, ListBotChannelsData, ListBotChannelsError, ListBotChannelsErrors, ListBotChannelsResponse, ListBotChannelsResponses, ListCompanyContactsData, ListCompanyContactsError, ListCompanyContactsErrors, ListCompanyContactsResponse, ListCompanyContactsResponses, ListCrmCommentsData, ListCrmCommentsError, ListCrmCommentsErrors, ListCrmCommentsResponse, ListCrmCommentsResponses, ListFavoritesData, ListFavoritesError, ListFavoritesErrors, ListFavoritesResponse, ListFavoritesResponses, ListOccurrencesData, ListOccurrencesErrors, ListOccurrencesResponse, ListOccurrencesResponses, ListRemindersData, ListRemindersError, ListRemindersErrors, ListRemindersResponse, ListRemindersResponses, ListWebhooksData, ListWebhooksError, ListWebhooksErrors, ListWebhooksResponse, ListWebhooksResponse2, ListWebhooksResponses, LocationResponseData, LocationResponseV3, MacroUserIdStr, Mentions, NewChannelAttachment, NotificationFilters, Params, ParticipantRole, PatchChannelData, PatchChannelError, PatchChannelErrors, PatchChannelRequest, PatchChannelResponse, PatchChannelResponses, PatchMessageData, PatchMessageError, PatchMessageErrors, PatchMessageRequest, PatchMessageResponse, PatchMessageResponses, PatchProjectRequestV2, PatchThreadRequestV2, PatchViewHandlerData, PatchViewHandlerError, PatchViewHandlerErrors, PatchViewHandlerResponses, PatchWebhookData, PatchWebhookError, PatchWebhookErrors, PatchWebhookRequest, PatchWebhookResponse, PatchWebhookResponses, PdfAnchor, PdfAnchorId, PdfAnchorRequest, PdfHighlightAnchor, PdfHighlightAnchorRequest, PdfHighlightRect, PdfHighlightRectAnchorRequest, PdfPlaceableCommentAnchor, PdfPlaceableCommentAnchorRequest, PermanentlyDeleteDocumentData, PermanentlyDeleteDocumentError, PermanentlyDeleteDocumentErrors, PermanentlyDeleteDocumentResponse, PermanentlyDeleteDocumentResponses, PermanentlyDeleteProjectData, PermanentlyDeleteProjectError, PermanentlyDeleteProjectErrors, PermanentlyDeleteProjectResponse, PermanentlyDeleteProjectResponses, PinnedItem, PinRequest, PostActivityData, PostActivityError, PostActivityErrors, PostActivityRequest, PostActivityResponse, PostActivityResponses, PostChannelBotWebhookData, PostChannelBotWebhookError, PostChannelBotWebhookErrors, PostChannelBotWebhookResponse, PostChannelBotWebhookResponses, PostChannelMessagesData, PostChannelMessagesError, PostChannelMessagesErrors, PostChannelMessagesResponse, PostChannelMessagesResponses, PostGroupedSoupAstGroupPageRequest, PostGroupedSoupAstInitialRequest, PostGroupedSoupAstRequest, PostItemsSoupAstData, PostItemsSoupAstError, PostItemsSoupAstErrors, PostItemsSoupAstGroupedData, PostItemsSoupAstGroupedError, PostItemsSoupAstGroupedErrors, PostItemsSoupAstGroupedResponse, PostItemsSoupAstGroupedResponses, PostItemsSoupAstResponse, PostItemsSoupAstResponses, PostItemsSoupData, PostItemsSoupError, PostItemsSoupErrors, PostItemsSoupResponse, PostItemsSoupResponses, PostMessageData, PostMessageError, PostMessageErrors, PostMessageRequest, PostMessageResponse, PostMessageResponse2, PostMessageResponses, PostReactionData, PostReactionError, PostReactionErrors, PostReactionRequest, PostReactionResponse, PostReactionResponses, PostSoupAstRequest, PostSoupRequest, PostTypingData, PostTypingError, PostTypingErrors, PostTypingRequest, PostTypingResponse, PostTypingResponses, PresaveDocumentHandlerData, PresaveDocumentHandlerError, PresaveDocumentHandlerErrors, PresaveDocumentHandlerResponse, PresaveDocumentHandlerResponses, PreSaveDocumentRequest, PreSaveDocumentResponse, PreSaveDocumentResponseData, PresignedUrl, Project, ProjectDeleteResponseData, ProjectDocumentStatus, ProjectFilters, ProjectPreview, ProjectPreviewData, PropertyDefinition, PropertyFilter, PropertyInput, PropertyOwner, PropertyValue, PutCrmTeamSettingsData, PutCrmTeamSettingsError, PutCrmTeamSettingsErrors, PutCrmTeamSettingsResponse, PutCrmTeamSettingsResponses, ReactionAction, RecentlyDeletedData, RecentlyDeletedError, RecentlyDeletedErrors, RecentlyDeletedResponse, RecentlyDeletedResponseData, RecentlyDeletedResponses, Reminder, ReminderSchedule, RemindersList, RemoveBotFromChannelByBotData, RemoveBotFromChannelByBotError, RemoveBotFromChannelByBotErrors, RemoveBotFromChannelByBotResponse, RemoveBotFromChannelByBotResponses, RemoveFavoriteByEntityData, RemoveFavoriteByEntityError, RemoveFavoriteByEntityErrors, RemoveFavoriteByEntityResponses, RemoveParticipantsData, RemoveParticipantsError, RemoveParticipantsErrors, RemoveParticipantsRequest, RemoveParticipantsResponses, RemovePinHandlerData, RemovePinHandlerError, RemovePinHandlerErrors, RemovePinHandlerResponse, RemovePinHandlerResponses, ReorderFavoritesData, ReorderFavoritesError, ReorderFavoritesErrors, ReorderFavoritesRequest, ReorderFavoritesResponses, ReorderPinRequest, ReorderPinsHandlerData, ReorderPinsHandlerError, ReorderPinsHandlerErrors, ReorderPinsHandlerResponse, ReorderPinsHandlerResponses, ResolveChannelMessageData, ResolveChannelMessageError, ResolveChannelMessageErrors, ResolveChannelMessageResponse, ResolveChannelMessageResponses, RevertDeleteDocumentData, RevertDeleteDocumentError, RevertDeleteDocumentErrors, RevertDeleteDocumentResponse, RevertDeleteDocumentResponses, RevertDeleteProjectData, RevertDeleteProjectError, RevertDeleteProjectErrors, RevertDeleteProjectResponse, RevertDeleteProjectResponses, RingStatus, RingStatusResponse, S3ObjectInfo, SaveBomPart, SaveDocumentHandlerData, SaveDocumentHandlerError, SaveDocumentHandlerErrors, SaveDocumentHandlerResponse, SaveDocumentHandlerResponses, SaveDocumentRequest, SaveDocumentResponse, SaveDocumentResponseData, 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, SetEmailSyncData, SetEmailSyncError, SetEmailSyncErrors, SetEmailSyncRequest, SetEmailSyncResponse, SetEmailSyncResponses, SetPropertyValue, SharedEmailFilter, SharePermissionV2, ShortIdResponse, SimpleMention, SimpleSaveData, SimpleSaveError, SimpleSaveErrors, SimpleSaveResponse, SimpleSaveResponses, SoupApiItem, SoupApiSort, SoupAttachment, SoupCalendarEventSoupPropertiesField, SoupCalendarEventTime, SoupCallRecordParticipant, SoupCallRecordSoupPropertiesField, SoupChannel, SoupChannelThread, SoupChatSoupPropertiesField, SoupContact, SoupCountedReaction, SoupCrmCompanySoupPropertiesField, SoupCrmDomain, SoupDocumentSoupPropertiesField, SoupDocumentSubType, SoupEmailThreadPreview, SoupEnrichedEmailThreadPreviewSoupPropertiesField, SoupForeignEntity, SoupItem, SoupLabel, SoupLabelListVisibility, SoupLabelType, SoupMessageAttachment, SoupMessageListVisibility, SoupMessageSender, SoupMessageSenderType, SoupPage, SoupProjectSoupPropertiesField, SoupPropertiesField, SoupProperty, SoupThreadInfo, SoupThreadReply, StarterDocumentsResponse, String, SuccessResponse, SyncServiceVersionId, TagFilterMode, TaskFilters, TeamRole, Thread, ThreadResponse, ToggleShareWithTeamData, ToggleShareWithTeamError, ToggleShareWithTeamErrors, ToggleShareWithTeamResponse, ToggleShareWithTeamResponses, TranscriptSegmentRequest, TypedSuccessResponse, TypedSuccessResponseGetDocumentResponseData, TypingAction, UnthreadedPdfUuidRequest, UpdateChannelSharePermission, UpdateCrmTeamSettingsRequest, UpdateOperation, UpdateReminderData, UpdateReminderError, UpdateReminderErrors, UpdateReminderRequest, UpdateReminderResponse, UpdateReminderResponses, UpdateSharePermissionRequestV2, UploadDocumentStatus, UploadExtractFolderHandlerData, UploadExtractFolderHandlerError, UploadExtractFolderHandlerErrors, UploadExtractFolderHandlerResponse, UploadExtractFolderHandlerResponses, UploadExtractFolderRequest, UploadFolderHandlerData, UploadFolderHandlerError, UploadFolderHandlerErrors, UploadFolderHandlerResponse, UploadFolderHandlerResponses, UploadFolderRequest, UpsertHistoryHandlerData, UpsertHistoryHandlerError, UpsertHistoryHandlerErrors, UpsertHistoryHandlerResponse, UpsertHistoryHandlerResponses, UpsertUserDocumentViewLocationData, UpsertUserDocumentViewLocationError, UpsertUserDocumentViewLocationErrors, UpsertUserDocumentViewLocationRequest, UpsertUserDocumentViewLocationResponse, UpsertUserDocumentViewLocationResponses, UserActivitiesResponse, UserDocumentsResponse, UserDocumentViewLocation, UserDocumentViewLocationResponse, UserPinsResponse, UserViewsResponse, ValidateDocumentPermissionsTokenData, ValidateDocumentPermissionsTokenError, ValidateDocumentPermissionsTokenErrors, ValidateDocumentPermissionsTokenResponse, ValidateDocumentPermissionsTokenResponses, ValidateWebhookData, ValidateWebhookError, ValidateWebhookErrors, ValidateWebhookResponse, ValidateWebhookResponse2, ValidateWebhookResponses, Vec, View, ViewPatch, ViewsResponse, Webhook, WebhookEvent, WebhookFilter, WebhookScope, WebhookStatus, WebhookValidationTestEvent, WithCallId, WithChannelId, WithDocumentId, WithProjectId } from './types.gen';
+export type { AccessLevel, Activity, ActivityType, AddFavoriteData, AddFavoriteError, AddFavoriteErrors, AddFavoriteRequest, AddFavoriteResponse, AddFavoriteResponses, AddParticipantsData, AddParticipantsError, AddParticipantsErrors, AddParticipantsRequest, AddParticipantsResponses, AddPinHandlerData, AddPinHandlerError, AddPinHandlerErrors, AddPinHandlerResponse, AddPinHandlerResponses, AddPinRequest, Anchor, AnchorId, AnchorRequest, AnchorResponse, AnnotationIncrementalUpdate, ApiActivity, ApiAttachmentChannelReference, ApiAttachmentEntityReference, ApiAttachmentGenericReference, ApiChannelAttachment, ApiChannelAttachmentsPage, ApiChannelContextMessage, ApiChannelDetail, ApiChannelListMessage, ApiChannelListPage, ApiChannelListParticipant, ApiChannelListType, ApiChannelMessage, ApiChannelMessageKind, ApiChannelMessagesPage, ApiChannelParticipant, ApiChannelWithLatest, ApiCountedReaction, ApiEntityFilterAst, ApiGroupByField, ApiGroupMeta, ApiMessageAttachment, ApiMessageSender, ApiMessageSenderType, ApiParticipantListRole, ApiParticipantRole, ApiPropertyEntityType, ApiResolvedChannelMessage, ApiThreadInfo, ApiThreadReply, AttendeeResponseStatus, BasicDocument, BasicDocumentSubType, BomPart, Bot, BotChannel, BotChannelType, BotId, BotKind, BotOwner, BotToken, BranchNameResponse, BTreeMap, BulkWakeupRequest, BulkWakeupResponse, BulkWakeupSyncServiceDocumentsData, BulkWakeupSyncServiceDocumentsErrors, BulkWakeupSyncServiceDocumentsResponse, BulkWakeupSyncServiceDocumentsResponses, CalendarAttendee, CalendarEvent, CalendarEventFilters, CalendarOccurrence, CalendarOccurrenceItem, CalendarOccurrenceResponse, CalendarSyncStatus, CallActiveResponse, CallFilters, CallRecord, CallRecordParticipant, CallRecordPreview, CallRecordPreviewData, CallRecordTranscriptSegment, CallStatus, CallTokenResponse, CallWebhookData, CallWebhookError, CallWebhookErrors, CallWebhookResponses, Channel, ChannelCreatedMetadata, ChannelDeletedMetadata, ChannelEventAttachment, ChannelFilters, ChannelJoinCodeResponse, ChannelMentionedMetadata, ChannelMessage, ChannelMessageAttachmentCreatedMetadata, ChannelMessageAttachmentRemovedMetadata, ChannelMessageDeletedMetadata, ChannelMessageFilters, ChannelMessagePatchedMetadata, ChannelMessagePostedMetadata, ChannelParticipant, ChannelParticipantAddedMetadata, ChannelParticipantRemovedMetadata, ChannelPreview, ChannelPreviewData, ChannelSender, ChannelSharePermission, ChannelThreadFilters, ChannelTopicEvent, ChannelType, ChannelUpdatedMetadata, ChannelWebhookRequest, ChannelWebhookResponse, ChannelWithParticipants, Chat, ChatFilters, CheckActiveCallData, CheckActiveCallError, CheckActiveCallErrors, CheckActiveCallResponse, CheckActiveCallResponses, ClientOptions, CloudStorageItemType, Comment, CommentThread, CopyDocumentData, CopyDocumentError, CopyDocumentErrors, CopyDocumentQueryParams, CopyDocumentRequest, CopyDocumentResponse, CopyDocumentResponse2, CopyDocumentResponses, CreateAnchorData, CreateAnchorError, CreateAnchorErrors, CreateAnchorResponse, CreateAnchorResponses, CreateBulkDocumentResponse, CreateBulkDocumentResponseData, CreateChannelData, CreateChannelError, CreateChannelErrors, CreateChannelRequest, CreateChannelResponse, CreateChannelResponse2, CreateChannelResponses, CreateChannelScopedBotData, CreateChannelScopedBotError, CreateChannelScopedBotErrors, CreateChannelScopedBotRequest, CreateChannelScopedBotResponse, CreateChannelScopedBotResponse2, CreateChannelScopedBotResponses, CreateCommentData, CreateCommentError, CreateCommentErrors, CreateCommentRequest, CreateCommentResponse, CreateCommentResponse2, CreateCommentResponses, CreateCrmCommentData, CreateCrmCommentError, CreateCrmCommentErrors, CreateCrmCommentRequest, CreateCrmCommentResponse, CreateCrmCommentResponses, CreateCrmCompanyData, CreateCrmCompanyError, CreateCrmCompanyErrors, CreateCrmCompanyRequest, CreateCrmCompanyResponse, CreateCrmCompanyResponses, CreateCrmContactData, CreateCrmContactError, CreateCrmContactErrors, CreateCrmContactRequest, CreateCrmContactResponse, CreateCrmContactResponses, CreateDocumentData, CreateDocumentError, CreateDocumentErrors, CreateDocumentRequest, CreateDocumentResponse, CreateDocumentResponseData, CreateDocumentResponses, CreateEntityMentionData, CreateEntityMentionError, CreateEntityMentionErrors, CreateEntityMentionRequest, CreateEntityMentionResponse, CreateEntityMentionResponse2, CreateEntityMentionResponses, CreateInstructionsDocumentResponse, CreateInstructionsHandlerData, CreateInstructionsHandlerError, CreateInstructionsHandlerErrors, CreateInstructionsHandlerResponse, CreateInstructionsHandlerResponses, CreateMarkdownDocumentRequest, CreateMarkdownDocumentResponse, CreateMarkdownHandlerData, CreateMarkdownHandlerError, CreateMarkdownHandlerErrors, CreateMarkdownHandlerResponse, CreateMarkdownHandlerResponses, CreateProjectHandlerData, CreateProjectHandlerError, CreateProjectHandlerErrors, CreateProjectHandlerResponse, CreateProjectHandlerResponses, CreateProjectRequest, CreateProjectResponse, CreateReminderData, CreateReminderError, CreateReminderErrors, CreateReminderRequest, CreateReminderResponse, CreateReminderResponses, CreateSnippetHandlerData, CreateSnippetHandlerError, CreateSnippetHandlerErrors, CreateSnippetHandlerResponse, CreateSnippetHandlerResponses, CreateSnippetRequest, CreateSnippetResponse, CreateTaskHandlerData, CreateTaskHandlerError, CreateTaskHandlerErrors, CreateTaskHandlerResponse, CreateTaskHandlerResponses, CreateTaskRequest, CreateTaskResponse, CreateUnthreadedAnchorRequest, CreateUnthreadedAnchorResponse, CreateUnthreadedPdfAnchorRequest, CreateViewHandlerData, CreateViewHandlerError, CreateViewHandlerErrors, CreateViewHandlerResponse, CreateViewHandlerResponses, CreateViewRequest, CreateWebhookData, CreateWebhookError, CreateWebhookErrors, CreateWebhookRequest, CreateWebhookResponse, CreateWebhookResponse2, CreateWebhookResponses, CrmComment, CrmCommentEntityType, CrmCommentThread, CrmCompanyFilters, CrmCompanyResponse, CrmContactResponse, CrmDomainResponse, CrmPermissionRole, CrmTeamSettingsResponse, CrmThread, CustomSpeakerAssignment, DataType, DeleteAnchorData, DeleteAnchorError, DeleteAnchorErrors, DeleteAnchorInfo, DeleteAnchorResponse, DeleteAnchorResponses, DeleteCallRecordData, DeleteCallRecordError, DeleteCallRecordErrors, DeleteCallRecordResponse, DeleteCallRecordResponses, DeleteChannelData, DeleteChannelError, DeleteChannelErrors, DeleteChannelResponse, DeleteChannelResponses, DeleteCommentData, DeleteCommentError, DeleteCommentErrors, DeleteCommentRequest, DeleteCommentResponse, DeleteCommentResponse2, DeleteCommentResponses, DeleteCrmCommentData, DeleteCrmCommentError, DeleteCrmCommentErrors, DeleteCrmCommentResponse, DeleteCrmCommentResponses, DeleteCrmCommentResult, DeleteDocumentData, DeleteDocumentError, DeleteDocumentErrors, DeleteDocumentResponse, DeleteDocumentResponses, DeleteEntityMentionData, DeleteEntityMentionError, DeleteEntityMentionErrors, DeleteEntityMentionResponse, DeleteEntityMentionResponse2, DeleteEntityMentionResponses, DeleteHistoryHandlerData, DeleteHistoryHandlerError, DeleteHistoryHandlerErrors, DeleteHistoryHandlerResponse, DeleteHistoryHandlerResponses, DeleteMessageData, DeleteMessageError, DeleteMessageErrors, DeleteMessageQuery, DeleteMessageResponse, DeleteMessageResponses, DeleteProjectHandlerData, DeleteProjectHandlerError, DeleteProjectHandlerErrors, DeleteProjectHandlerResponse, DeleteProjectHandlerResponses, DeleteReminderData, DeleteReminderError, DeleteReminderErrors, DeleteReminderResponse, DeleteReminderResponses, DeleteThreadInfo, DeleteUnthreadedAnchorRequest, DeleteUnthreadedAnchorResponse, DeleteUnthreadedPdfAnchorRequest, DeleteUserDocumentViewLocationData, DeleteUserDocumentViewLocationError, DeleteUserDocumentViewLocationErrors, DeleteUserDocumentViewLocationResponse, DeleteUserDocumentViewLocationResponses, DeleteViewHandlerData, DeleteViewHandlerError, DeleteViewHandlerErrors, DeleteViewHandlerResponses, DeleteWebhookData, DeleteWebhookError, DeleteWebhookErrors, DeleteWebhookResponse, DeleteWebhookResponses, DocumentBasic, DocumentContent, DocumentContentLocation, DocumentContentState, DocumentContentUploadedMetadata, DocumentCopiedMetadata, DocumentCreatedMetadata, DocumentDeletedMetadata, DocumentFilters, DocumentInteractionMetadata, DocumentMetadata, DocumentMetadataWithContent, DocumentPermissionsToken, DocumentPermissionsTokenRequest, DocumentPermissionsTokenResponse, DocumentPreview, DocumentPreviewData, DocumentPreviewDataSubType, DocumentPurgedMetadata, DocumentResponse, DocumentResponseMetadata, DocumentResponseMetadataWithContent, DocumentStorageServiceApiVersion, DocumentSubType, DocumentSyncContentUpdatedMetadata, DocumentTeamShareResponse, DocumentTopicEvent, DocumentUpdatedMetadata, EditAnchorData, EditAnchorError, EditAnchorErrors, EditAnchorRequest, EditAnchorResponse, EditAnchorResponse2, EditAnchorResponses, EditCallRecordData, EditCallRecordError, EditCallRecordErrors, EditCallRecordRequest, EditCallRecordResponse, EditCallRecordResponses, EditCallTranscriptData, EditCallTranscriptError, EditCallTranscriptErrors, EditCallTranscriptRequest, EditCallTranscriptResponse, EditCallTranscriptResponses, EditCommentData, EditCommentError, EditCommentErrors, EditCommentRequest, EditCommentResponse, EditCommentResponse2, EditCommentResponses, EditCrmCommentData, EditCrmCommentError, EditCrmCommentErrors, EditCrmCommentRequest, EditCrmCommentResponse, EditCrmCommentResponses, EditDocumentData, EditDocumentError, EditDocumentErrors, EditDocumentResponse, EditDocumentResponse2, EditDocumentResponses, EditDocumentServiceArgs, EditPdfAnchorRequest, EditPdfPlaceableCommentAnchorRequest, EditProjectV2Data, EditProjectV2Error, EditProjectV2Errors, EditProjectV2Response, EditProjectV2Responses, EditThreadV2Data, EditThreadV2Error, EditThreadV2Errors, EditThreadV2Response, EditThreadV2Responses, EmailFilters, EmptyResponse, EntityFilters, EntityPermission, EntityPermissionResponse, EntityReference, EntityType, ErrorResponse, EventStatus, EventTime, EventTransparency, EventVisibility, ExcludedDefaultView, ExcludeDefaultViewHandlerData, ExcludeDefaultViewHandlerError, ExcludeDefaultViewHandlerErrors, ExcludeDefaultViewHandlerResponses, ExcludeDefaultViewRequest, ExportDocumentData, ExportDocumentError, ExportDocumentErrors, ExportDocumentResponse, ExportDocumentResponse2, ExportDocumentResponses, Favorite, FavoriteEntityRef, FavoritesList, FileSystemNodeWithIds, FileType, FileTypeUpdate, FolderItem, ForeignEntity, ForeignEntityFilters, GenericErrorResponse, GenericResponse, GenericSuccessResponse, GetActivitiesResponse, 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, GetCallRecordData, GetCallRecordError, GetCallRecordErrors, GetCallRecordResponse, GetCallRecordResponses, GetChannelAttachmentsData, GetChannelAttachmentsError, GetChannelAttachmentsErrors, GetChannelAttachmentsResponse, GetChannelAttachmentsResponses, GetChannelData, GetChannelError, GetChannelErrors, GetChannelJoinLinkData, GetChannelJoinLinkError, GetChannelJoinLinkErrors, GetChannelJoinLinkResponse, GetChannelJoinLinkResponses, GetChannelMessagesData, GetChannelMessagesError, GetChannelMessagesErrors, GetChannelMessagesResponse, GetChannelMessagesResponses, GetChannelParticipantsData, GetChannelParticipantsError, GetChannelParticipantsErrors, GetChannelParticipantsResponse, GetChannelParticipantsResponses, GetChannelResponse, GetChannelResponses, GetChannelsData, GetChannelsError, GetChannelsErrors, GetChannelsResponse, GetChannelsResponses, GetCompanyData, GetCompanyError, GetCompanyErrors, GetCompanyResponse, GetCompanyResponses, GetContactData, GetContactError, GetContactErrors, GetContactResponse, GetContactResponses, GetCrmTeamSettingsData, GetCrmTeamSettingsError, GetCrmTeamSettingsErrors, GetCrmTeamSettingsResponse, GetCrmTeamSettingsResponses, GetDocumentAnchorsData, GetDocumentAnchorsError, GetDocumentAnchorsErrors, GetDocumentAnchorsResponse, GetDocumentAnchorsResponses, GetDocumentBranchNameData, GetDocumentBranchNameError, GetDocumentBranchNameErrors, GetDocumentBranchNameResponse, GetDocumentBranchNameResponses, GetDocumentByTeamSlugData, GetDocumentByTeamSlugError, GetDocumentByTeamSlugErrors, GetDocumentByTeamSlugResponse, GetDocumentByTeamSlugResponses, GetDocumentCommentsData, GetDocumentCommentsError, GetDocumentCommentsErrors, GetDocumentCommentsResponse, GetDocumentCommentsResponses, 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, GetEntityPermissionData, GetEntityPermissionErrors, GetEntityPermissionResponse, GetEntityPermissionResponses, GetForeignEntityData, GetForeignEntityError, GetForeignEntityErrors, GetForeignEntityResponse, GetForeignEntityResponses, GetHistoryHandlerData, GetHistoryHandlerError, GetHistoryHandlerErrors, GetHistoryHandlerResponse, GetHistoryHandlerResponses, GetInstructionsDocumentResponse, GetInstructionsHandlerData, GetInstructionsHandlerError, GetInstructionsHandlerErrors, GetInstructionsHandlerResponse, GetInstructionsHandlerResponses, GetItemsSoupData, GetItemsSoupError, GetItemsSoupErrors, GetItemsSoupResponse, GetItemsSoupResponses, GetLocationHandlerData, GetLocationHandlerError, GetLocationHandlerErrors, GetLocationHandlerResponse, GetLocationHandlerResponses, GetMessageWithContextData, GetMessageWithContextError, GetMessageWithContextErrors, GetMessageWithContextResponse, GetMessageWithContextResponse2, GetMessageWithContextResponses, 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, GetRecentActivityHandlerData, GetRecentActivityHandlerError, GetRecentActivityHandlerErrors, GetRecentActivityHandlerResponse, GetRecentActivityHandlerResponses, GetReminderData, GetReminderError, GetReminderErrors, GetReminderResponse, GetReminderResponses, GetRingStatusData, GetRingStatusError, GetRingStatusErrors, GetRingStatusResponse, GetRingStatusResponses, GetSelfBotData, GetSelfBotError, GetSelfBotErrors, GetSelfBotResponse, GetSelfBotResponses, GetThreadRepliesData, GetThreadRepliesError, GetThreadRepliesErrors, GetThreadRepliesResponse, GetThreadRepliesResponses, GetUserDocumentsHandlerData, GetUserDocumentsHandlerError, GetUserDocumentsHandlerErrors, GetUserDocumentsHandlerResponse, GetUserDocumentsHandlerResponses, GetUserDocumentViewLocationData, GetUserDocumentViewLocationError, GetUserDocumentViewLocationErrors, GetUserDocumentViewLocationResponse, GetUserDocumentViewLocationResponses, GetUserHistoryResponse, GetViewsHandlerData, GetViewsHandlerError, GetViewsHandlerErrors, GetViewsHandlerResponse, GetViewsHandlerResponses, GetWebhookData, GetWebhookError, GetWebhookErrors, GetWebhookResponse, GetWebhookResponses, GithubPullRequest, GithubPullRequestCheckRun, GithubPullRequestComment, GithubPullRequestsResponse, GroupedInitialParams, GroupedPageParams, GroupedSoupGroupPage, GroupedSoupInitialPage, GroupedSoupPage, GroupedSoupSort, HandlerData, HandlerError, HandlerErrors, HandlerResponse, HandlerResponses, HashMap, HealthHandlerData, HealthHandlerResponse, HealthHandlerResponses, HighlightType, IngestTranscriptData, IngestTranscriptError, IngestTranscriptErrors, IngestTranscriptResponses, InitializeUserDocumentsData, InitializeUserDocumentsError, InitializeUserDocumentsErrors, InitializeUserDocumentsResponse, InitializeUserDocumentsResponses, InstallSyncData, InstallSyncErrors, InteractionReason, Item, ItemWithUserAccessLevel, JobProcessingResultHandlerData, JobProcessingResultHandlerError, JobProcessingResultHandlerErrors, JobProcessingResultHandlerResponse, JobProcessingResultHandlerResponses, JoinChannelByCodeData, JoinChannelByCodeError, JoinChannelByCodeErrors, JoinChannelByCodeResponses, JoinChannelData, JoinChannelError, JoinChannelErrors, JoinChannelResponses, LatestMessage, LeaveCallResponse, LeaveChannelData, LeaveChannelError, LeaveChannelErrors, LeaveChannelResponses, LeaveOrEndCallData, LeaveOrEndCallError, LeaveOrEndCallErrors, LeaveOrEndCallResponse, LeaveOrEndCallResponses, ListBotChannelsData, ListBotChannelsError, ListBotChannelsErrors, ListBotChannelsResponse, ListBotChannelsResponses, ListCompanyContactsData, ListCompanyContactsError, ListCompanyContactsErrors, ListCompanyContactsResponse, ListCompanyContactsResponses, ListCrmCommentsData, ListCrmCommentsError, ListCrmCommentsErrors, ListCrmCommentsResponse, ListCrmCommentsResponses, ListFavoritesData, ListFavoritesError, ListFavoritesErrors, ListFavoritesResponse, ListFavoritesResponses, ListOccurrencesData, ListOccurrencesErrors, ListOccurrencesResponse, ListOccurrencesResponses, ListRemindersData, ListRemindersError, ListRemindersErrors, ListRemindersResponse, ListRemindersResponses, ListWebhooksData, ListWebhooksError, ListWebhooksErrors, ListWebhooksResponse, ListWebhooksResponse2, ListWebhooksResponses, LocationResponseData, LocationResponseV3, MacroUserIdStr, Mentions, NewChannelAttachment, NotificationFilters, Params, ParticipantRole, PatchChannelData, PatchChannelError, PatchChannelErrors, PatchChannelRequest, PatchChannelResponse, PatchChannelResponses, PatchMessageData, PatchMessageError, PatchMessageErrors, PatchMessageRequest, PatchMessageResponse, PatchMessageResponses, PatchProjectRequestV2, PatchThreadRequestV2, PatchViewHandlerData, PatchViewHandlerError, PatchViewHandlerErrors, PatchViewHandlerResponses, PatchWebhookData, PatchWebhookError, PatchWebhookErrors, PatchWebhookRequest, PatchWebhookResponse, PatchWebhookResponses, PdfAnchor, PdfAnchorId, PdfAnchorRequest, PdfHighlightAnchor, PdfHighlightAnchorRequest, PdfHighlightRect, PdfHighlightRectAnchorRequest, PdfPlaceableCommentAnchor, PdfPlaceableCommentAnchorRequest, PermanentlyDeleteDocumentData, PermanentlyDeleteDocumentError, PermanentlyDeleteDocumentErrors, PermanentlyDeleteDocumentResponse, PermanentlyDeleteDocumentResponses, PermanentlyDeleteProjectData, PermanentlyDeleteProjectError, PermanentlyDeleteProjectErrors, PermanentlyDeleteProjectResponse, PermanentlyDeleteProjectResponses, PinnedItem, PinRequest, PostActivityData, PostActivityError, PostActivityErrors, PostActivityRequest, PostActivityResponse, PostActivityResponses, PostChannelBotWebhookData, PostChannelBotWebhookError, PostChannelBotWebhookErrors, PostChannelBotWebhookResponse, PostChannelBotWebhookResponses, PostChannelMessagesData, PostChannelMessagesError, PostChannelMessagesErrors, PostChannelMessagesResponse, PostChannelMessagesResponses, PostGroupedSoupAstGroupPageRequest, PostGroupedSoupAstInitialRequest, PostGroupedSoupAstRequest, PostItemsSoupAstData, PostItemsSoupAstError, PostItemsSoupAstErrors, PostItemsSoupAstGroupedData, PostItemsSoupAstGroupedError, PostItemsSoupAstGroupedErrors, PostItemsSoupAstGroupedResponse, PostItemsSoupAstGroupedResponses, PostItemsSoupAstResponse, PostItemsSoupAstResponses, PostItemsSoupData, PostItemsSoupError, PostItemsSoupErrors, PostItemsSoupResponse, PostItemsSoupResponses, PostMessageData, PostMessageError, PostMessageErrors, PostMessageRequest, PostMessageResponse, PostMessageResponse2, PostMessageResponses, PostReactionData, PostReactionError, PostReactionErrors, PostReactionRequest, PostReactionResponse, PostReactionResponses, PostSoupAstRequest, PostSoupRequest, PostTypingData, PostTypingError, PostTypingErrors, PostTypingRequest, PostTypingResponse, PostTypingResponses, PresaveDocumentHandlerData, PresaveDocumentHandlerError, PresaveDocumentHandlerErrors, PresaveDocumentHandlerResponse, PresaveDocumentHandlerResponses, PreSaveDocumentRequest, PreSaveDocumentResponse, PreSaveDocumentResponseData, PresignedUrl, Project, ProjectDeleteResponseData, ProjectDocumentStatus, ProjectFilters, ProjectPreview, ProjectPreviewData, PropertyDefinition, PropertyFilter, PropertyInput, PropertyOwner, PropertyValue, PutCrmTeamSettingsData, PutCrmTeamSettingsError, PutCrmTeamSettingsErrors, PutCrmTeamSettingsResponse, PutCrmTeamSettingsResponses, ReactionAction, RecentlyDeletedData, RecentlyDeletedError, RecentlyDeletedErrors, RecentlyDeletedResponse, RecentlyDeletedResponseData, RecentlyDeletedResponses, Reminder, ReminderFilters, ReminderSchedule, RemindersList, RemoveBotFromChannelByBotData, RemoveBotFromChannelByBotError, RemoveBotFromChannelByBotErrors, RemoveBotFromChannelByBotResponse, RemoveBotFromChannelByBotResponses, RemoveFavoriteByEntityData, RemoveFavoriteByEntityError, RemoveFavoriteByEntityErrors, RemoveFavoriteByEntityResponses, RemoveParticipantsData, RemoveParticipantsError, RemoveParticipantsErrors, RemoveParticipantsRequest, RemoveParticipantsResponses, RemovePinHandlerData, RemovePinHandlerError, RemovePinHandlerErrors, RemovePinHandlerResponse, RemovePinHandlerResponses, ReorderFavoritesData, ReorderFavoritesError, ReorderFavoritesErrors, ReorderFavoritesRequest, ReorderFavoritesResponses, ReorderPinRequest, ReorderPinsHandlerData, ReorderPinsHandlerError, ReorderPinsHandlerErrors, ReorderPinsHandlerResponse, ReorderPinsHandlerResponses, ResolveChannelMessageData, ResolveChannelMessageError, ResolveChannelMessageErrors, ResolveChannelMessageResponse, ResolveChannelMessageResponses, RevertDeleteDocumentData, RevertDeleteDocumentError, RevertDeleteDocumentErrors, RevertDeleteDocumentResponse, RevertDeleteDocumentResponses, RevertDeleteProjectData, RevertDeleteProjectError, RevertDeleteProjectErrors, RevertDeleteProjectResponse, RevertDeleteProjectResponses, RingStatus, RingStatusResponse, S3ObjectInfo, SaveBomPart, SaveDocumentHandlerData, SaveDocumentHandlerError, SaveDocumentHandlerErrors, SaveDocumentHandlerResponse, SaveDocumentHandlerResponses, SaveDocumentRequest, SaveDocumentResponse, SaveDocumentResponseData, 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, SetEmailSyncData, SetEmailSyncError, SetEmailSyncErrors, SetEmailSyncRequest, SetEmailSyncResponse, SetEmailSyncResponses, SetPropertyValue, SharedEmailFilter, SharePermissionV2, ShortIdResponse, SimpleMention, SimpleSaveData, SimpleSaveError, SimpleSaveErrors, SimpleSaveResponse, SimpleSaveResponses, SoupApiItem, SoupApiSort, SoupAttachment, SoupCalendarEventSoupPropertiesField, SoupCalendarEventTime, SoupCallRecordParticipant, SoupCallRecordSoupPropertiesField, SoupChannel, SoupChannelThread, SoupChatSoupPropertiesField, SoupContact, SoupCountedReaction, SoupCrmCompanySoupPropertiesField, SoupCrmDomain, SoupDocumentSoupPropertiesField, SoupDocumentSubType, SoupEmailThreadPreview, SoupEnrichedEmailThreadPreviewSoupPropertiesField, SoupForeignEntity, SoupItem, SoupLabel, SoupLabelListVisibility, SoupLabelType, SoupMessageAttachment, SoupMessageListVisibility, SoupMessageSender, SoupMessageSenderType, SoupPage, SoupProjectSoupPropertiesField, SoupPropertiesField, SoupProperty, SoupReminderReference, SoupReminderSchedule, SoupReminderSoupPropertiesField, SoupThreadInfo, SoupThreadReply, StarterDocumentsResponse, String, SuccessResponse, SyncServiceVersionId, TagFilterMode, TaskFilters, TeamRole, Thread, ThreadResponse, ToggleShareWithTeamData, ToggleShareWithTeamError, ToggleShareWithTeamErrors, ToggleShareWithTeamResponse, ToggleShareWithTeamResponses, TranscriptSegmentRequest, TypedSuccessResponse, TypedSuccessResponseGetDocumentResponseData, TypingAction, UnthreadedPdfUuidRequest, UpdateChannelSharePermission, UpdateCrmTeamSettingsRequest, UpdateOperation, UpdateReminderData, UpdateReminderError, UpdateReminderErrors, UpdateReminderRequest, UpdateReminderResponse, UpdateReminderResponses, UpdateSharePermissionRequestV2, UploadDocumentStatus, UploadExtractFolderHandlerData, UploadExtractFolderHandlerError, UploadExtractFolderHandlerErrors, UploadExtractFolderHandlerResponse, UploadExtractFolderHandlerResponses, UploadExtractFolderRequest, UploadFolderHandlerData, UploadFolderHandlerError, UploadFolderHandlerErrors, UploadFolderHandlerResponse, UploadFolderHandlerResponses, UploadFolderRequest, UpsertHistoryHandlerData, UpsertHistoryHandlerError, UpsertHistoryHandlerErrors, UpsertHistoryHandlerResponse, UpsertHistoryHandlerResponses, UpsertUserDocumentViewLocationData, UpsertUserDocumentViewLocationError, UpsertUserDocumentViewLocationErrors, UpsertUserDocumentViewLocationRequest, UpsertUserDocumentViewLocationResponse, UpsertUserDocumentViewLocationResponses, UserActivitiesResponse, UserDocumentsResponse, UserDocumentViewLocation, UserDocumentViewLocationResponse, UserPinsResponse, UserViewsResponse, ValidateDocumentPermissionsTokenData, ValidateDocumentPermissionsTokenError, ValidateDocumentPermissionsTokenErrors, ValidateDocumentPermissionsTokenResponse, ValidateDocumentPermissionsTokenResponses, ValidateWebhookData, ValidateWebhookError, ValidateWebhookErrors, ValidateWebhookResponse, ValidateWebhookResponse2, ValidateWebhookResponses, Vec, View, ViewPatch, ViewsResponse, Webhook, WebhookEvent, WebhookFilter, WebhookScope, WebhookStatus, WebhookValidationTestEvent, WithCallId, WithChannelId, WithDocumentId, WithProjectId } from './types.gen';
diff --git a/packages/sdk/generated/storage/types.gen.ts b/packages/sdk/generated/storage/types.gen.ts
index 1fad0f8129..19c32b00f7 100644
--- a/packages/sdk/generated/storage/types.gen.ts
+++ b/packages/sdk/generated/storage/types.gen.ts
@@ -681,6 +681,12 @@ export type ApiEntityFilterAst = {
* the filters that should be applied based on entity properties
*/
propf?: unknown;
+ /**
+ * Filters applied to reminders (wire key `remf`). Unlike every other
+ * filter here, empty/omitted returns **no** reminders: they are opt-in,
+ * so the caller must send `inc`, an id, or an entity to get any.
+ */
+ remf?: unknown;
};
/**
@@ -4291,6 +4297,10 @@ export type EntityFilters = {
* property-based filters applied across entity types
*/
property_filters?: Array<PropertyFilter>;
+ /**
+ * the bundled [ReminderFilters]
+ */
+ reminder_filters?: ReminderFilters;
/**
* How the `tag_option_ids` combine: `any` (default) matches entities
* holding at least one selected tag, `all` requires every selected tag.
@@ -6067,7 +6077,8 @@ export type RecentlyDeletedResponseData = {
*/
export type Reminder = {
/**
- * Set once a one-shot reminder has fired.
+ * Set once the owner marks the reminder as dealt with. Firing does not
+ * set it — a delivered reminder is waiting on its owner, not finished.
*/
completedAt?: string | null;
/**
@@ -6108,6 +6119,30 @@ export type Reminder = {
updatedAt: string;
};
+/**
+ * Filters for reminders.
+ */
+export type ReminderFilters = {
+ /**
+ * Filter on whether the reminder has already fired. `None` returns both.
+ */
+ completed?: boolean | null;
+ /**
+ * Restrict to reminders attached to these entities, each `"{type}:{id}"`.
+ */
+ entities?: Array<string>;
+ /**
+ * Reminder ids to filter by. Empty to include all of the caller's reminders.
+ */
+ ids?: Array<string>;
+ /**
+ * Opt this query into reminders at all. Reminders are off by default —
+ * see [`crate::ast::reminder::ReminderLiteral::Include`]. Asking for
+ * specific `ids` or `entities` also opts in.
+ */
+ include?: boolean;
+};
+
/**
* When a reminder fires.
*/
@@ -7191,6 +7226,12 @@ export type SoupItem = {
*/
data: SoupForeignEntity;
tag: 'foreignEntity';
+} | {
+ /**
+ * Reminder item.
+ */
+ data: SoupReminderSoupPropertiesField;
+ tag: 'reminder';
};
/**
@@ -7382,6 +7423,105 @@ export type SoupProperty = {
value?: null | PropertyValue;
};
+/**
+ * The entity a reminder is about, resolved server-side.
+ *
+ * A reminder has no block of its own — it opens, and is iconed as, whatever it
+ * references. Which block that is depends on the referenced document's file
+ * type, and the client's icon path is synchronous, so this is resolved here
+ * rather than costing a fetch per row.
+ */
+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';
+ /**
+ * File type, when the reference is a document — `md`, `pdf`, and so on.
+ */
+ fileType?: string | null;
+ /**
+ * The referenced entity's id.
+ */
+ id: string;
+ /**
+ * Sub type, when the reference is a task or snippet document.
+ */
+ subType?: string | null;
+};
+
+/**
+ * How often a reminder fires, flattened for the wire.
+ *
+ * The domain's [`ReminderSchedule`] is an internally-tagged enum carrying a
+ * validated cron type; Soup only needs enough to render "once" vs "every
+ * weekday at 9am", so the cron is exposed as a plain string.
+ */
+export type SoupReminderSchedule = {
+ /**
+ * The instant to fire at.
+ */
+ remindAt: string;
+ type: 'once';
+} | {
+ /**
+ * Cron expression, normalized to the 6-field form.
+ */
+ cron: string;
+ /**
+ * The timezone the cron expression is evaluated in.
+ */
+ timezone: string;
+ type: 'recurring';
+};
+
+/**
+ * A reminder as displayed in Soup.
+ *
+ * Reminders are user-owned rather than shared, so unlike most Soup items they
+ * carry no access metadata — the repository only ever returns the caller's own.
+ */
+export type SoupReminderSoupPropertiesField = {
+ /**
+ * Properties attached to the entity.
+ */
+ properties: Array<SoupProperty>;
+} & {
+ /**
+ * Set once a one-shot reminder has fired.
+ */
+ completedAt?: string | null;
+ /**
+ * When the reminder was created.
+ */
+ createdAt: string;
+ /**
+ * What to remind the user about. Doubles as the display name.
+ */
+ description: string;
+ /**
+ * When false, the dispatcher skips this reminder.
+ */
+ enabled: boolean;
+ /**
+ * The reminder id.
+ */
+ id: string;
+ /**
+ * The next firing. This is what Soup sorts reminders on.
+ */
+ nextRunAt: string;
+ referencedEntity?: null | SoupReminderReference;
+ /**
+ * When and how often the reminder fires.
+ */
+ schedule: SoupReminderSchedule;
+ /**
+ * When the reminder was last modified.
+ */
+ updatedAt: string;
+};
+
/**
* Thread metadata and preview replies for soup channel messages.
*/
@@ -7660,6 +7800,11 @@ export type UpdateOperation = 'add' | 'remove' | 'replace';
* tolerates `null` rather than erroring on it.
*/
export type UpdateReminderRequest = {
+ /**
+ * Mark the reminder as dealt with, or live again. Distinct from
+ * `enabled`, which controls whether the dispatcher considers it.
+ */
+ completed?: boolean;
/**
* Replacement description.
*/
diff --git a/packages/sdk/specs/search.json b/packages/sdk/specs/search.json
index e0f68ed39f..b669d6a13c 100644
--- a/packages/sdk/specs/search.json
+++ b/packages/sdk/specs/search.json
@@ -1833,6 +1833,10 @@
},
"description": "property-based filters applied across entity types"
},
+ "reminder_filters": {
+ "$ref": "#/components/schemas/ReminderFilters",
+ "description": "the bundled [ReminderFilters]"
+ },
"tag_filter_mode": {
"$ref": "#/components/schemas/TagFilterMode",
"description": "How the `tag_option_ids` combine: `any` (default) matches entities\nholding at least one selected tag, `all` requires every selected tag."
@@ -2844,6 +2848,34 @@
],
"description": "Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to/from JSONB in the database."
},
+ "ReminderFilters": {
+ "type": "object",
+ "description": "Filters for reminders.",
+ "properties": {
+ "completed": {
+ "type": ["boolean", "null"],
+ "description": "Filter on whether the reminder has already fired. `None` returns both."
+ },
+ "entities": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Restrict to reminders attached to these entities, each `\"{type}:{id}\"`."
+ },
+ "ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Reminder ids to filter by. Empty to include all of the caller's reminders."
+ },
+ "include": {
+ "type": "boolean",
+ "description": "Opt this query into reminders at all. Reminders are off by default —\nsee [`crate::ast::reminder::ReminderLiteral::Include`]. Asking for\nspecific `ids` or `entities` also opts in."
+ }
+ }
+ },
"SearchHighlight": {
"type": "object",
"properties": {
diff --git a/packages/sdk/specs/storage.json b/packages/sdk/specs/storage.json
index 0935ac3794..879bc430eb 100644
--- a/packages/sdk/specs/storage.json
+++ b/packages/sdk/specs/storage.json
@@ -12020,6 +12020,9 @@
},
"propf": {
"description": "the filters that should be applied based on entity properties"
+ },
+ "remf": {
+ "description": "Filters applied to reminders (wire key `remf`). Unlike every other\nfilter here, empty/omitted returns **no** reminders: they are opt-in,\nso the caller must send `inc`, an id, or an entity to get any."
}
}
},
@@ -17311,6 +17314,10 @@
},
"description": "property-based filters applied across entity types"
},
+ "reminder_filters": {
+ "$ref": "#/components/schemas/ReminderFilters",
+ "description": "the bundled [ReminderFilters]"
+ },
"tag_filter_mode": {
"$ref": "#/components/schemas/TagFilterMode",
"description": "How the `tag_option_ids` combine: `any` (default) matches entities\nholding at least one selected tag, `all` requires every selected tag."
@@ -20917,7 +20924,7 @@
"completedAt": {
"type": ["string", "null"],
"format": "date-time",
- "description": "Set once a one-shot reminder has fired."
+ "description": "Set once the owner marks the reminder as dealt with. Firing does not\nset it — a delivered reminder is waiting on its owner, not finished."
},
"createdAt": {
"type": "string",
@@ -20986,6 +20993,34 @@
}
}
},
+ "ReminderFilters": {
+ "type": "object",
+ "description": "Filters for reminders.",
+ "properties": {
+ "completed": {
+ "type": ["boolean", "null"],
+ "description": "Filter on whether the reminder has already fired. `None` returns both."
+ },
+ "entities": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Restrict to reminders attached to these entities, each `\"{type}:{id}\"`."
+ },
+ "ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Reminder ids to filter by. Empty to include all of the caller's reminders."
+ },
+ "include": {
+ "type": "boolean",
+ "description": "Opt this query into reminders at all. Reminders are off by default —\nsee [`crate::ast::reminder::ReminderLiteral::Include`]. Asking for\nspecific `ids` or `entities` also opts in."
+ }
+ }
+ },
"ReminderSchedule": {
"oneOf": [
{
@@ -22630,6 +22665,21 @@
"enum": ["foreignEntity"]
}
}
+ },
+ {
+ "type": "object",
+ "description": "Reminder item.",
+ "required": ["data", "tag"],
+ "properties": {
+ "data": {
+ "$ref": "#/components/schemas/SoupReminder_SoupPropertiesField",
+ "description": "Reminder item."
+ },
+ "tag": {
+ "type": "string",
+ "enum": ["reminder"]
+ }
+ }
}
],
"description": "A single item in the Soup feed."
@@ -22883,6 +22933,172 @@
}
}
},
+ "SoupReminderReference": {
+ "type": "object",
+ "description": "The entity a reminder is about, resolved server-side.\n\nA reminder has no block of its own — it opens, and is iconed as, whatever it\nreferences. Which block that is depends on the referenced document's file\ntype, and the client's icon path is synchronous, so this is resolved here\nrather than costing a fetch per row.",
+ "required": ["id", "entityType"],
+ "properties": {
+ "entityType": {
+ "oneOf": [
+ {
+ "type": "string",
+ "description": "The type of an entity in Macro",
+ "enum": [
+ "user",
+ "chat",
+ "channel",
+ "channel_message",
+ "document",
+ "project",
+ "email_thread",
+ "calendar_event",
+ "team",
+ "call",
+ "foreign_entity",
+ "static_file",
+ "crm_company",
+ "crm_contact",
+ "reminder"
+ ]
+ }
+ ],
+ "description": "The referenced entity's type."
+ },
+ "fileType": {
+ "type": ["string", "null"],
+ "description": "File type, when the reference is a document — `md`, `pdf`, and so on."
+ },
+ "id": {
+ "type": "string",
+ "description": "The referenced entity's id."
+ },
+ "subType": {
+ "type": ["string", "null"],
+ "description": "Sub type, when the reference is a task or snippet document."
+ }
+ }
+ },
+ "SoupReminderSchedule": {
+ "oneOf": [
+ {
+ "type": "object",
+ "description": "Fires once, at a fixed instant.",
+ "required": ["remindAt", "type"],
+ "properties": {
+ "remindAt": {
+ "type": "string",
+ "format": "date-time",
+ "description": "The instant to fire at."
+ },
+ "type": {
+ "type": "string",
+ "enum": ["once"]
+ }
+ }
+ },
+ {
+ "type": "object",
+ "description": "Fires repeatedly, on a cron schedule evaluated in `timezone`.",
+ "required": ["cron", "timezone", "type"],
+ "properties": {
+ "cron": {
+ "type": "string",
+ "description": "Cron expression, normalized to the 6-field form."
+ },
+ "timezone": {
+ "type": "string",
+ "description": "The timezone the cron expression is evaluated in."
+ },
+ "type": {
+ "type": "string",
+ "enum": ["recurring"]
+ }
+ }
+ }
+ ],
+ "description": "How often a reminder fires, flattened for the wire.\n\nThe domain's [`ReminderSchedule`] is an internally-tagged enum carrying a\nvalidated cron type; Soup only needs enough to render \"once\" vs \"every\nweekday at 9am\", so the cron is exposed as a plain string."
+ },
+ "SoupReminder_SoupPropertiesField": {
+ "allOf": [
+ {
+ "type": "object",
+ "description": "Property fields that can be flattened into property-bearing Soup items.",
+ "required": ["properties"],
+ "properties": {
+ "properties": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/SoupProperty"
+ },
+ "description": "Properties attached to the entity."
+ }
+ }
+ },
+ {
+ "type": "object",
+ "required": [
+ "id",
+ "description",
+ "schedule",
+ "nextRunAt",
+ "enabled",
+ "createdAt",
+ "updatedAt"
+ ],
+ "properties": {
+ "completedAt": {
+ "type": ["string", "null"],
+ "format": "date-time",
+ "description": "Set once a one-shot reminder has fired."
+ },
+ "createdAt": {
+ "type": "string",
+ "format": "date-time",
+ "description": "When the reminder was created."
+ },
+ "description": {
+ "type": "string",
+ "description": "What to remind the user about. Doubles as the display name."
+ },
+ "enabled": {
+ "type": "boolean",
+ "description": "When false, the dispatcher skips this reminder."
+ },
+ "id": {
+ "type": "string",
+ "format": "uuid",
+ "description": "The reminder id."
+ },
+ "nextRunAt": {
+ "type": "string",
+ "format": "date-time",
+ "description": "The next firing. This is what Soup sorts reminders on."
+ },
+ "referencedEntity": {
+ "oneOf": [
+ {
+ "type": "null"
+ },
+ {
+ "$ref": "#/components/schemas/SoupReminderReference",
+ "description": "The entity this reminder is about, when attached to one, with enough\ndetail for the client to render and open it without a second fetch."
+ }
+ ]
+ },
+ "schedule": {
+ "$ref": "#/components/schemas/SoupReminderSchedule",
+ "description": "When and how often the reminder fires."
+ },
+ "updatedAt": {
+ "type": "string",
+ "format": "date-time",
+ "description": "When the reminder was last modified."
+ }
+ }
+ }
+ ],
+ "description": "A reminder as displayed in Soup.\n\nReminders are user-owned rather than shared, so unlike most Soup items they\ncarry no access metadata — the repository only ever returns the caller's own."
+ },
"SoupThreadInfo": {
"type": "object",
"description": "Thread metadata and preview replies for soup channel messages.",
@@ -23302,6 +23518,10 @@
"type": "object",
"description": "Request body for modifying a reminder. Omitted fields are left unchanged;\nthe entity association is not modifiable.\n\nEvery field is optional but **not** nullable. `Option` here means \"absent\",\nand serde cannot tell an explicit `null` from an omitted key — so a body of\n`{\"enabled\": null}` would deserialize to an empty patch and be rejected as\nhaving no fields to update. `nullable = false` keeps the schema from\nadvertising a value the API has no meaning for; the deserializer still\ntolerates `null` rather than erroring on it.",
"properties": {
+ "completed": {
+ "type": "boolean",
+ "description": "Mark the reminder as dealt with, or live again. Distinct from\n`enabled`, which controls whether the dispatcher considers it."
+ },
"description": {
"type": "string",
"description": "Replacement description."
diff --git a/services/document_cognition_service/Cargo.toml b/services/document_cognition_service/Cargo.toml
index 093d2d0621..75f6e74fa5 100644
--- a/services/document_cognition_service/Cargo.toml
+++ b/services/document_cognition_service/Cargo.toml
@@ -104,6 +104,7 @@ redis = { workspace = true, features = [
] }
regex = { workspace = true }
reqwest.workspace = true
+reminders = { path = "../../crates/reminders", default-features = false, features = ["ports"] }
roles_and_permissions = { path = "../../crates/roles_and_permissions", default-features = false, features = [
"outbound",
] }
diff --git a/services/document_cognition_service/src/api/context/test.rs b/services/document_cognition_service/src/api/context/test.rs
index 3ab5d10db4..3db8291059 100644
--- a/services/document_cognition_service/src/api/context/test.rs
+++ b/services/document_cognition_service/src/api/context/test.rs
@@ -194,6 +194,7 @@ pub async fn test_api_context(pool: sqlx::Pool<sqlx::Postgres>) -> std::sync::Ar
),
crm::domain::service::NoOpCrmService,
foreign_entity_service,
+ reminders::domain::service::NoOpRemindersService,
));
let ingress_queue = SqsQueue::new(
diff --git a/services/document_cognition_service/src/main.rs b/services/document_cognition_service/src/main.rs
index abedf4a074..71b4a5f829 100644
--- a/services/document_cognition_service/src/main.rs
+++ b/services/document_cognition_service/src/main.rs
@@ -258,6 +258,7 @@ async fn main() -> anyhow::Result<()> {
CallRecordQueryServiceImpl::new(PgCallRepo::new(db.clone())),
crm::domain::service::NoOpCrmService,
foreign_entity_service,
+ reminders::domain::service::NoOpRemindersService,
));
tracing::info!("initialized soup service");
diff --git a/services/document_storage_service/src/api/context.rs b/services/document_storage_service/src/api/context.rs
index a135c4da0a..6e6a8e142b 100644
--- a/services/document_storage_service/src/api/context.rs
+++ b/services/document_storage_service/src/api/context.rs
@@ -155,6 +155,7 @@ pub(crate) type DssSoupService = SoupImpl<
call::domain::service::CallRecordQueryServiceImpl<call::outbound::pg_call_repo::PgCallRepo>,
DssCrmService,
ForeignEntityServiceType,
+ RemindersServiceType,
>;
type DssSoupState =
diff --git a/services/document_storage_service/src/main.rs b/services/document_storage_service/src/main.rs
index 54c655df64..9878ec202b 100644
--- a/services/document_storage_service/src/main.rs
+++ b/services/document_storage_service/src/main.rs
@@ -890,6 +890,10 @@ async fn main() -> anyhow::Result<()> {
authorization_state.clone(),
);
+ // Held by value here and behind an `Arc` in the router state: the impl is a
+ // pool handle, so cloning is cheap and `SoupImpl` needs an owned service.
+ let reminders_service = RemindersServiceImpl::new(PgRemindersRepo::new(db.clone()));
+
let soup_service = Arc::new(SoupImpl::new(
PgSoupRepo::new(readonly_pool::ReadOnlyPool(readonly_db.clone())),
frecency_service,
@@ -898,6 +902,7 @@ async fn main() -> anyhow::Result<()> {
call_record_query_service,
crm_service.clone(),
foreign_entity_service_for_soup,
+ reminders_service.clone(),
));
let soup_realtime_service = Arc::new(SoupRealtimeConsumerService::new(
@@ -1006,8 +1011,6 @@ async fn main() -> anyhow::Result<()> {
authorization_state.clone(),
);
- let reminders_service = Arc::new(RemindersServiceImpl::new(PgRemindersRepo::new(db.clone())));
-
// Reminder dispatch. An EventBridge rule drops a sweep tick on this queue
// every minute; the sweep fans one message out per due firing, onto the
// same queue, and every task in the pool delivers them in parallel.
@@ -1071,7 +1074,7 @@ async fn main() -> anyhow::Result<()> {
),
favorites_service,
reminders_state: RemindersRouterState::new(
- reminders_service,
+ Arc::new(reminders_service),
entity_access_service.clone(),
authorization_state.clone(),
),
diff --git a/services/mcp_service/Cargo.toml b/services/mcp_service/Cargo.toml
index fa9b5c814a..3820a84cbf 100644
--- a/services/mcp_service/Cargo.toml
+++ b/services/mcp_service/Cargo.toml
@@ -57,6 +57,7 @@ notification = { path = "../../crates/notification", features = ["ai_tool"] }
prompt = { path = "../../crates/prompt" }
readonly_pool = { path = "../../crates/readonly_pool" }
redis = { workspace = true, features = ["aio", "tokio-comp"] }
+reminders = { path = "../../crates/reminders", default-features = false, features = ["ports"] }
rmcp = { workspace = true, features = ["transport-streamable-http-server"] }
search_service_client = { path = "../../crates/search_service_client" }
secretsmanager_client = { path = "../../crates/secretsmanager_client" }
diff --git a/services/mcp_service/src/context.rs b/services/mcp_service/src/context.rs
index da4f763292..8f45b65fd7 100644
--- a/services/mcp_service/src/context.rs
+++ b/services/mcp_service/src/context.rs
@@ -200,6 +200,7 @@ async fn build_tool_context(args: ToolContextBuildArgs<'_>) -> anyhow::Result<To
),
crm::domain::service::NoOpCrmService,
foreign_entity_service,
+ reminders::domain::service::NoOpRemindersService,
));
let s3_client = macro_aws_config::s3_client().await;
diff --git a/static_assets/schema.graphql b/static_assets/schema.graphql
index 43ae7995bf..96e76657ad 100644
--- a/static_assets/schema.graphql
+++ b/static_assets/schema.graphql
@@ -1231,6 +1231,10 @@ input GraphqlEntityFilterAst {
"""
foreignEntityFilter: GraphqlForeignEntityExpr
"""
+ The reminder filter to apply.
+ """
+ reminderFilter: GraphqlReminderExpr
+ """
The properties filter to apply.
"""
propertiesFilter: GraphqlPropertiesExpr
@@ -1886,6 +1890,81 @@ A property value represented by a type-safe GraphQL union.
"""
union GraphqlPropertyValue = GraphqlBooleanPropertyValue | GraphqlNumberPropertyValue | GraphqlStringPropertyValue | GraphqlDatePropertyValue | GraphqlSelectOptionPropertyValue | GraphqlEntityReferencePropertyValue | GraphqlLinkPropertyValue
+"""
+The two operands of a recursive `ReminderFilterExpr` binary expression.
+"""
+input GraphqlReminderBinaryExpr {
+ """
+ The left-hand expression.
+ """
+ left: GraphqlReminderExpr!
+ """
+ The right-hand expression.
+ """
+ right: GraphqlReminderExpr!
+}
+
+"""
+A recursive `ReminderFilterExpr` filter expression.
+"""
+input GraphqlReminderExpr @oneOf {
+ """
+ Matches when both expressions match.
+ """
+ and: GraphqlReminderBinaryExpr
+ """
+ Matches when either expression matches.
+ """
+ or: GraphqlReminderBinaryExpr
+ """
+ Negates an expression.
+ """
+ not: GraphqlReminderExpr
+ """
+ Matches a domain-specific literal condition.
+ """
+ literal: GraphqlReminderLiteral
+}
+
+"""
+GraphQL input representing the reminder literal.
+"""
+input GraphqlReminderLiteral @oneOf {
+ """
+ Opt this query into reminders at all. Reminders are off by default, so
+ without this (or an `id`/`entity`) Soup omits them entirely — a filter
+ of only `completed` would otherwise silently match nothing. Must be
+ `true`; there is no literal for excluding reminders, that is the default.
+ """
+ include: Boolean
+ """
+ The id option.
+ """
+ id: ID
+ """
+ The referenced entity, as `"{type}:{id}"`.
+ """
+ entity: String
+ """
+ Whether the reminder has already fired.
+ """
+ completed: Boolean
+}
+
+"""
+How often a reminder fires.
+"""
+enum GraphqlReminderScheduleType {
+ """
+ Fires once, at `remindAt`.
+ """
+ ONCE
+ """
+ Fires repeatedly, on `cron` evaluated in `timezone`.
+ """
+ RECURRING
+}
+
"""
A select-option property value.
"""
@@ -3300,6 +3379,10 @@ enum GraphqlSoupEntityType {
Calendar event entity.
"""
CALENDAR_EVENT
+ """
+ Reminder entity.
+ """
+ REMINDER
}
"""
@@ -3496,6 +3579,99 @@ type GraphqlSoupProject implements GraphqlSoupEntity {
frecencyScore: Float
}
+"""
+GraphQL representation of the soup reminder.
+"""
+type GraphqlSoupReminder implements GraphqlSoupEntity {
+ """
+ The unique identifier.
+ """
+ id: ID!
+ """
+ Canonical entity kind.
+ """
+ entityType: GraphqlSoupEntityType!
+ """
+ User-visible display name — a reminder's description is its name.
+ """
+ displayName: String
+ """
+ Common reminder metadata.
+
+ `owner_id` is absent because a reminder is only ever readable by its
+ owner, and `parent` because a reminder is not contained by the entity it
+ references — see [`Self::referenced_entity`].
+ """
+ metadata: GraphqlEntityMetadata!
+ """
+ The entity this reminder is about, when it is attached to one.
+
+ Only the reference is returned; the client resolves it into a Soup item
+ through the edges that already exist for that entity type.
+ """
+ referencedEntity: GraphqlEntity
+ """
+ What to remind the user about.
+ """
+ description: String!
+ """
+ Whether the reminder fires once or repeatedly.
+ """
+ scheduleType: GraphqlReminderScheduleType!
+ """
+ The instant a one-shot reminder fires at, in RFC 3339 format.
+ """
+ remindAt: String
+ """
+ The cron expression a recurring reminder fires on.
+ """
+ cron: String
+ """
+ The timezone a recurring reminder's cron is evaluated in.
+ """
+ timezone: String
+ """
+ The next firing, in RFC 3339 format. Soup orders reminders on this.
+ """
+ nextRunAt: String!
+ """
+ When false, the dispatcher skips this reminder.
+ """
+ enabled: Boolean!
+ """
+ When a one-shot reminder fired, in RFC 3339 format.
+ """
+ completedAt: String
+ """
+ The created timestamp in RFC 3339 format.
+ """
+ createdAt: String!
+ """
+ The updated timestamp in RFC 3339 format.
+ """
+ updatedAt: String!
+ """
+ Properties assigned to this entity that the authenticated user may view.
+ """
+ properties: [GraphqlProperty!]!
+ """
+ Notifications associated with this entity for the authenticated user.
+ """
+ notifications: [GraphqlSoupNotification!]!
+ """
+ Whether the authenticated viewer has favorited this entity.
+ """
+ isFavorited: Boolean!
+ """
+ The authenticated viewer's effective permission for this entity.
+ """
+ viewerPermission: GraphqlEntityPermission
+ """
+ The viewer's frecency score for this entity, when loaded.
+ """
+ frecencyScore: Float
+}
+
"""
A string property value.
"""