Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
feat: skills (#5327)
Eric Hayes100dbaf732bf
diff --git a/.github/workspace-dep-closures.json b/.github/workspace-dep-closures.jsonindex 875a3b90e7..724e0e7302 100644--- a/.github/workspace-dep-closures.json+++ b/.github/workspace-dep-closures.json@@ -123,12 +123,14 @@"crates/search_service_client","crates/secretsmanager_client","crates/share_permission_db_utils",+ "crates/skills","crates/soup","crates/sqs_client","crates/sqs_worker","crates/sync_service","crates/sync_service_client","crates/system_properties",+ "crates/system_skills","crates/task_dedup","crates/teams","crates/unfurl",@@ -295,12 +297,14 @@"crates/search_service_client","crates/secretsmanager_client","crates/share_permission_db_utils",+ "crates/skills","crates/soup","crates/sqs_client","crates/sqs_worker","crates/sync_service","crates/sync_service_client","crates/system_properties",+ "crates/system_skills","crates/task_dedup","crates/teams","crates/unfurl",@@ -460,6 +464,7 @@"crates/sync_service","crates/sync_service_client","crates/system_properties",+ "crates/system_skills","crates/task_dedup","crates/teams","crates/unfurl",@@ -756,12 +761,14 @@"crates/search_service_client","crates/secretsmanager_client","crates/share_permission_db_utils",+ "crates/skills","crates/soup","crates/sqs_client","crates/sqs_worker","crates/sync_service","crates/sync_service_client","crates/system_properties",+ "crates/system_skills","crates/task_dedup","crates/teams","crates/unfurl",@@ -1017,6 +1024,7 @@"crates/sync_service","crates/sync_service_client","crates/system_properties",+ "crates/system_skills","crates/task_dedup","crates/unfurl","crates/workspace-hack"@@ -1414,6 +1422,7 @@"crates/sync_service","crates/sync_service_client","crates/system_properties",+ "crates/system_skills","crates/task_dedup","crates/unfurl","crates/user_quota",@@ -1526,6 +1535,7 @@"crates/search_service_client","crates/secretsmanager_client","crates/share_permission_db_utils",+ "crates/skills","crates/soup","crates/sqs_client","crates/sqs_worker",@@ -1534,6 +1544,7 @@"crates/sync_service","crates/sync_service_client","crates/system_properties",+ "crates/system_skills","crates/task_dedup","crates/teams","crates/unfurl",@@ -1669,6 +1680,7 @@"crates/search_service_client","crates/secretsmanager_client","crates/share_permission_db_utils",+ "crates/skills","crates/soup","crates/soup_realtime","crates/sqs_client",@@ -1676,6 +1688,7 @@"crates/sync_service","crates/sync_service_client","crates/system_properties",+ "crates/system_skills","crates/task_dedup","crates/teams","crates/unfurl",@@ -1825,6 +1838,7 @@"crates/sync_service","crates/sync_service_client","crates/system_properties",+ "crates/system_skills","crates/task_dedup","crates/unfurl","crates/workspace-hack",@@ -1908,6 +1922,7 @@"crates/sync_service","crates/sync_service_client","crates/system_properties",+ "crates/system_skills","crates/task_dedup","crates/unfurl","crates/workspace-hack"@@ -2705,6 +2720,7 @@"crates/sync_service","crates/sync_service_client","crates/system_properties",+ "crates/system_skills","crates/task_dedup","crates/unfurl","crates/workspace-hack"@@ -2946,6 +2962,7 @@"crates/sync_service","crates/sync_service_client","crates/system_properties",+ "crates/system_skills","crates/task_dedup","crates/unfurl","crates/workspace-hack"@@ -3181,6 +3198,7 @@"crates/sync_service","crates/sync_service_client","crates/system_properties",+ "crates/system_skills","crates/task_dedup","crates/unfurl","crates/workspace-hack"@@ -3859,12 +3877,14 @@"crates/search_service_client","crates/secretsmanager_client","crates/share_permission_db_utils",+ "crates/skills","crates/soup","crates/sqs_client","crates/sqs_worker","crates/sync_service","crates/sync_service_client","crates/system_properties",+ "crates/system_skills","crates/task_dedup","crates/teams","crates/unfurl",@@ -3970,12 +3990,14 @@"crates/search_service_client","crates/secretsmanager_client","crates/share_permission_db_utils",+ "crates/skills","crates/soup","crates/sqs_client","crates/sqs_worker","crates/sync_service","crates/sync_service_client","crates/system_properties",+ "crates/system_skills","crates/task_dedup","crates/teams","crates/unfurl",@@ -4732,6 +4754,7 @@"crates/sync_service","crates/sync_service_client","crates/system_properties",+ "crates/system_skills","crates/task_dedup","crates/unfurl","crates/workspace-hack"@@ -5025,12 +5048,14 @@"crates/search_service_client","crates/secretsmanager_client","crates/share_permission_db_utils",+ "crates/skills","crates/soup","crates/sqs_client","crates/sqs_worker","crates/sync_service","crates/sync_service_client","crates/system_properties",+ "crates/system_skills","crates/task_dedup","crates/teams","crates/unfurl",@@ -5137,6 +5162,7 @@"crates/sync_service","crates/sync_service_client","crates/system_properties",+ "crates/system_skills","crates/task_dedup","crates/unfurl","crates/user_quota",@@ -5448,6 +5474,83 @@"crates/share_permission_db_utils","crates/workspace-hack"],+ "skills": [+ "crates/agent",+ "crates/ai_toolset",+ "crates/ai_usage",+ "crates/attachment",+ "crates/authentication_service_client",+ "crates/bot_id",+ "crates/call",+ "crates/channel_sender",+ "crates/channels",+ "crates/connection",+ "crates/connection_gateway_client",+ "crates/connection_gateway_models",+ "crates/contacts",+ "crates/cowlike",+ "crates/crm",+ "crates/document_sub_type",+ "crates/email",+ "crates/email_utils",+ "crates/entity_access",+ "crates/entity_access_db_utils",+ "crates/entity_access_management",+ "crates/entity_mutation",+ "crates/filter_ast",+ "crates/foreign_entity",+ "crates/frecency",+ "crates/invite_email",+ "crates/item_filters",+ "crates/kafka_util",+ "crates/last_online_tracker",+ "crates/macro_auth",+ "crates/macro_authorization",+ "crates/macro_aws_config",+ "crates/macro_env",+ "crates/macro_env_var",+ "crates/macro_event_broker",+ "crates/macro_event_topics",+ "crates/macro_service_urls",+ "crates/macro_user_id",+ "crates/macro_uuid",+ "crates/mention_utils",+ "crates/model",+ "crates/model-entity",+ "crates/model-error-response",+ "crates/model_file_type",+ "crates/model_notifications",+ "crates/model_user",+ "crates/models_bulk_upload",+ "crates/models_entity_access_management",+ "crates/models_grouping",+ "crates/models_opensearch",+ "crates/models_pagination",+ "crates/models_permissions",+ "crates/models_properties",+ "crates/models_search",+ "crates/models_search_cursor",+ "crates/models_soup",+ "crates/non_empty",+ "crates/notification",+ "crates/opensearch_client",+ "crates/opensearch_query_builder",+ "crates/prompt",+ "crates/properties",+ "crates/rate_limit",+ "crates/readonly_pool",+ "crates/reminders",+ "crates/remote_env_var",+ "crates/search_service_client",+ "crates/share_permission_db_utils",+ "crates/skills",+ "crates/soup",+ "crates/sqs_worker",+ "crates/system_properties",+ "crates/system_skills",+ "crates/unfurl",+ "crates/workspace-hack"+ ],"sns_client": ["crates/sns_client","crates/workspace-hack"@@ -5609,6 +5712,7 @@"crates/sync_service","crates/sync_service_client","crates/system_properties",+ "crates/system_skills","crates/task_dedup","crates/unfurl","crates/workspace-hack"@@ -5795,6 +5899,11 @@"crates/system_properties","crates/workspace-hack"],+ "system_skills": [+ "crates/prompt",+ "crates/system_skills",+ "crates/workspace-hack"+ ],"task_dedup": ["crates/agent","crates/ai_toolset",@@ -6205,6 +6314,7 @@"crates/sync_service","crates/sync_service_client","crates/system_properties",+ "crates/system_skills","crates/task_dedup","crates/unfurl","crates/webhook",diff --git a/.sqlx/query-056dbddac4957596098ed8444564f7eb4ee08f375c95d9e40bd879d1439a8342.json b/.sqlx/query-056dbddac4957596098ed8444564f7eb4ee08f375c95d9e40bd879d1439a8342.jsonindex e10b8729ca..cd05714685 100644--- a/.sqlx/query-056dbddac4957596098ed8444564f7eb4ee08f375c95d9e40bd879d1439a8342.json+++ b/.sqlx/query-056dbddac4957596098ed8444564f7eb4ee08f375c95d9e40bd879d1439a8342.json@@ -32,7 +32,8 @@"kind": {"Enum": ["task",- "snippet"+ "snippet",+ "skill"]}}diff --git a/.sqlx/query-17b1a9529bc693aeb668fd0c432d6b55a4c527fd3105bfa9cf83dbc70516011c.json b/.sqlx/query-17b1a9529bc693aeb668fd0c432d6b55a4c527fd3105bfa9cf83dbc70516011c.jsonindex 6aac09106d..ca9d6020a3 100644--- a/.sqlx/query-17b1a9529bc693aeb668fd0c432d6b55a4c527fd3105bfa9cf83dbc70516011c.json+++ b/.sqlx/query-17b1a9529bc693aeb668fd0c432d6b55a4c527fd3105bfa9cf83dbc70516011c.json@@ -47,7 +47,8 @@"kind": {"Enum": ["task",- "snippet"+ "snippet",+ "skill"]}}diff --git a/.sqlx/query-1b30e7bb6b67b93826781122a191e243db4c43ec8630b32ea48b1c7e31724264.json b/.sqlx/query-1b30e7bb6b67b93826781122a191e243db4c43ec8630b32ea48b1c7e31724264.jsonindex 29a3ad393c..ed6b13f9a6 100644--- a/.sqlx/query-1b30e7bb6b67b93826781122a191e243db4c43ec8630b32ea48b1c7e31724264.json+++ b/.sqlx/query-1b30e7bb6b67b93826781122a191e243db4c43ec8630b32ea48b1c7e31724264.json@@ -82,7 +82,8 @@"kind": {"Enum": ["task",- "snippet"+ "snippet",+ "skill"]}}diff --git a/.sqlx/query-2611958405cf94c91ef85a09da00b0a8701621b42e4c57e74d2da40062d577d4.json b/.sqlx/query-2611958405cf94c91ef85a09da00b0a8701621b42e4c57e74d2da40062d577d4.jsonindex 06196d06b6..0c1488f814 100644--- a/.sqlx/query-2611958405cf94c91ef85a09da00b0a8701621b42e4c57e74d2da40062d577d4.json+++ b/.sqlx/query-2611958405cf94c91ef85a09da00b0a8701621b42e4c57e74d2da40062d577d4.json@@ -82,7 +82,8 @@"kind": {"Enum": ["task",- "snippet"+ "snippet",+ "skill"]}}diff --git a/.sqlx/query-2930435da61e2e75a6ec3a127f3f1591934bb55a9f2fed8e47dd4406085fa6b2.json b/.sqlx/query-2930435da61e2e75a6ec3a127f3f1591934bb55a9f2fed8e47dd4406085fa6b2.jsonindex 1ccf0c370f..840ff5983d 100644--- a/.sqlx/query-2930435da61e2e75a6ec3a127f3f1591934bb55a9f2fed8e47dd4406085fa6b2.json+++ b/.sqlx/query-2930435da61e2e75a6ec3a127f3f1591934bb55a9f2fed8e47dd4406085fa6b2.json@@ -47,7 +47,8 @@"kind": {"Enum": ["task",- "snippet"+ "snippet",+ "skill"]}}diff --git a/.sqlx/query-2d1112d21440f0dfdf8fcbec264389f7abdcc74544558d60d817f56ff0c14524.json b/.sqlx/query-2d1112d21440f0dfdf8fcbec264389f7abdcc74544558d60d817f56ff0c14524.jsonindex 9d5f4be71c..11eb14246f 100644--- a/.sqlx/query-2d1112d21440f0dfdf8fcbec264389f7abdcc74544558d60d817f56ff0c14524.json+++ b/.sqlx/query-2d1112d21440f0dfdf8fcbec264389f7abdcc74544558d60d817f56ff0c14524.json@@ -32,7 +32,8 @@"kind": {"Enum": ["task",- "snippet"+ "snippet",+ "skill"]}}diff --git a/.sqlx/query-31dbb9af47386234da706e7c3175a7a2e43c2231040cc399488418eab9f6023a.json b/.sqlx/query-31dbb9af47386234da706e7c3175a7a2e43c2231040cc399488418eab9f6023a.jsonindex 88bcfc4608..54f38556ec 100644--- a/.sqlx/query-31dbb9af47386234da706e7c3175a7a2e43c2231040cc399488418eab9f6023a.json+++ b/.sqlx/query-31dbb9af47386234da706e7c3175a7a2e43c2231040cc399488418eab9f6023a.json@@ -12,7 +12,8 @@"kind": {"Enum": ["task",- "snippet"+ "snippet",+ "skill"]}}diff --git a/.sqlx/query-41ef28446ebbd766c0778fd56fb8ee8094c2cb84ed3f4dab9e890d441611722b.json b/.sqlx/query-41ef28446ebbd766c0778fd56fb8ee8094c2cb84ed3f4dab9e890d441611722b.jsonindex 4eaee7da4e..eb24feeff3 100644--- a/.sqlx/query-41ef28446ebbd766c0778fd56fb8ee8094c2cb84ed3f4dab9e890d441611722b.json+++ b/.sqlx/query-41ef28446ebbd766c0778fd56fb8ee8094c2cb84ed3f4dab9e890d441611722b.json@@ -82,7 +82,8 @@"kind": {"Enum": ["task",- "snippet"+ "snippet",+ "skill"]}}diff --git a/.sqlx/query-43aedaff60665c1bf3dea9dc3e58908fd19aa1f6dd274803963698d6b95760ce.json b/.sqlx/query-43aedaff60665c1bf3dea9dc3e58908fd19aa1f6dd274803963698d6b95760ce.jsonindex 2bef26ac3f..7bf7fc2688 100644--- a/.sqlx/query-43aedaff60665c1bf3dea9dc3e58908fd19aa1f6dd274803963698d6b95760ce.json+++ b/.sqlx/query-43aedaff60665c1bf3dea9dc3e58908fd19aa1f6dd274803963698d6b95760ce.json@@ -52,7 +52,8 @@"kind": {"Enum": ["task",- "snippet"+ "snippet",+ "skill"]}}diff --git a/.sqlx/query-5293063d6203fdce622e3265581cb505e07534de33d0275ed860aea9f6614fc7.json b/.sqlx/query-5293063d6203fdce622e3265581cb505e07534de33d0275ed860aea9f6614fc7.jsonindex b51c26591f..c52e9f3380 100644--- a/.sqlx/query-5293063d6203fdce622e3265581cb505e07534de33d0275ed860aea9f6614fc7.json+++ b/.sqlx/query-5293063d6203fdce622e3265581cb505e07534de33d0275ed860aea9f6614fc7.json@@ -82,7 +82,8 @@"kind": {"Enum": ["task",- "snippet"+ "snippet",+ "skill"]}}diff --git a/.sqlx/query-5959ff0d2410e3f2599a53bc1bf0de19c2d6e90cb030f64dccf965a0515b467e.json b/.sqlx/query-5959ff0d2410e3f2599a53bc1bf0de19c2d6e90cb030f64dccf965a0515b467e.jsonindex 0d532ee4ad..cf33b5b7c3 100644--- a/.sqlx/query-5959ff0d2410e3f2599a53bc1bf0de19c2d6e90cb030f64dccf965a0515b467e.json+++ b/.sqlx/query-5959ff0d2410e3f2599a53bc1bf0de19c2d6e90cb030f64dccf965a0515b467e.json@@ -67,7 +67,8 @@"kind": {"Enum": ["task",- "snippet"+ "snippet",+ "skill"]}}diff --git a/.sqlx/query-68c14c7f2106ef2b3e27c398fa1ccfc398c0116e929e921a2b0d8d78ff035823.json b/.sqlx/query-68c14c7f2106ef2b3e27c398fa1ccfc398c0116e929e921a2b0d8d78ff035823.jsonindex f5d7cb73f1..ee78110d96 100644--- a/.sqlx/query-68c14c7f2106ef2b3e27c398fa1ccfc398c0116e929e921a2b0d8d78ff035823.json+++ b/.sqlx/query-68c14c7f2106ef2b3e27c398fa1ccfc398c0116e929e921a2b0d8d78ff035823.json@@ -17,7 +17,8 @@"kind": {"Enum": ["task",- "snippet"+ "snippet",+ "skill"]}}diff --git a/.sqlx/query-6ea5fe0c08693b233361460d1a1b46168b4bf9848d252242a06569301144a4f6.json b/.sqlx/query-6ea5fe0c08693b233361460d1a1b46168b4bf9848d252242a06569301144a4f6.jsonindex 2f6283b3bf..89d00a6b77 100644--- a/.sqlx/query-6ea5fe0c08693b233361460d1a1b46168b4bf9848d252242a06569301144a4f6.json+++ b/.sqlx/query-6ea5fe0c08693b233361460d1a1b46168b4bf9848d252242a06569301144a4f6.json@@ -32,7 +32,8 @@"kind": {"Enum": ["task",- "snippet"+ "snippet",+ "skill"]}}diff --git a/.sqlx/query-7fc9da48b6c62ab0db6327e300eb80eafcff34b2d5d13621a688883acc3db154.json b/.sqlx/query-7fc9da48b6c62ab0db6327e300eb80eafcff34b2d5d13621a688883acc3db154.jsonindex f8b30182d4..4fa39ebc40 100644--- a/.sqlx/query-7fc9da48b6c62ab0db6327e300eb80eafcff34b2d5d13621a688883acc3db154.json+++ b/.sqlx/query-7fc9da48b6c62ab0db6327e300eb80eafcff34b2d5d13621a688883acc3db154.json@@ -87,7 +87,8 @@"kind": {"Enum": ["task",- "snippet"+ "snippet",+ "skill"]}}diff --git a/.sqlx/query-8b7e81c3b4f31c86100de517e1978a1879039b7230aa83df18f583106c97a18f.json b/.sqlx/query-8b7e81c3b4f31c86100de517e1978a1879039b7230aa83df18f583106c97a18f.jsonindex cb673d055d..e2da6e6383 100644--- a/.sqlx/query-8b7e81c3b4f31c86100de517e1978a1879039b7230aa83df18f583106c97a18f.json+++ b/.sqlx/query-8b7e81c3b4f31c86100de517e1978a1879039b7230aa83df18f583106c97a18f.json@@ -87,7 +87,8 @@"kind": {"Enum": ["task",- "snippet"+ "snippet",+ "skill"]}}diff --git a/.sqlx/query-96a2c0a064e56b4fd812c2768403fc086f4518149772d661222d54592df920d3.json b/.sqlx/query-96a2c0a064e56b4fd812c2768403fc086f4518149772d661222d54592df920d3.jsonindex f884197d2e..719c9beed7 100644--- a/.sqlx/query-96a2c0a064e56b4fd812c2768403fc086f4518149772d661222d54592df920d3.json+++ b/.sqlx/query-96a2c0a064e56b4fd812c2768403fc086f4518149772d661222d54592df920d3.json@@ -12,7 +12,8 @@"kind": {"Enum": ["task",- "snippet"+ "snippet",+ "skill"]}}diff --git a/.sqlx/query-a9fee4b6ef042c94f5dfc2ba668423e760ba3632bfae3aef9da1f146b7a9c638.json b/.sqlx/query-a9fee4b6ef042c94f5dfc2ba668423e760ba3632bfae3aef9da1f146b7a9c638.jsonindex 3ee681677b..aa46dbd21b 100644--- a/.sqlx/query-a9fee4b6ef042c94f5dfc2ba668423e760ba3632bfae3aef9da1f146b7a9c638.json+++ b/.sqlx/query-a9fee4b6ef042c94f5dfc2ba668423e760ba3632bfae3aef9da1f146b7a9c638.json@@ -47,7 +47,8 @@"kind": {"Enum": ["task",- "snippet"+ "snippet",+ "skill"]}}diff --git a/.sqlx/query-b509140ce307b4e440349fae476518b06d6247bf27821c9bea2f04c1eb999768.json b/.sqlx/query-b509140ce307b4e440349fae476518b06d6247bf27821c9bea2f04c1eb999768.jsonindex b0fb21d85c..f8785d2dd4 100644--- a/.sqlx/query-b509140ce307b4e440349fae476518b06d6247bf27821c9bea2f04c1eb999768.json+++ b/.sqlx/query-b509140ce307b4e440349fae476518b06d6247bf27821c9bea2f04c1eb999768.json@@ -82,7 +82,8 @@"kind": {"Enum": ["task",- "snippet"+ "snippet",+ "skill"]}}diff --git a/.sqlx/query-c9fce1ac31e4e4f9992809c650e85fe45f4dc1e66d4b5a846c734b308c74fa70.json b/.sqlx/query-c9fce1ac31e4e4f9992809c650e85fe45f4dc1e66d4b5a846c734b308c74fa70.jsonindex 452e680e85..190c10d985 100644--- a/.sqlx/query-c9fce1ac31e4e4f9992809c650e85fe45f4dc1e66d4b5a846c734b308c74fa70.json+++ b/.sqlx/query-c9fce1ac31e4e4f9992809c650e85fe45f4dc1e66d4b5a846c734b308c74fa70.json@@ -87,7 +87,8 @@"kind": {"Enum": ["task",- "snippet"+ "snippet",+ "skill"]}}diff --git a/.sqlx/query-cc55e105bd5f6916a779d57ed7e4379c7fdaca83a33355842cf8b0b29d25a517.json b/.sqlx/query-cc55e105bd5f6916a779d57ed7e4379c7fdaca83a33355842cf8b0b29d25a517.jsonindex 91afbc0b52..4161f6d908 100644--- a/.sqlx/query-cc55e105bd5f6916a779d57ed7e4379c7fdaca83a33355842cf8b0b29d25a517.json+++ b/.sqlx/query-cc55e105bd5f6916a779d57ed7e4379c7fdaca83a33355842cf8b0b29d25a517.json@@ -87,7 +87,8 @@"kind": {"Enum": ["task",- "snippet"+ "snippet",+ "skill"]}}diff --git a/.sqlx/query-cfbec090ff3b62415ec0c215aa52bdafe162fb8c8fd217a8fcaf613e39525b0f.json b/.sqlx/query-cfbec090ff3b62415ec0c215aa52bdafe162fb8c8fd217a8fcaf613e39525b0f.jsonindex 358d08c4ed..ee2c38dc5b 100644--- a/.sqlx/query-cfbec090ff3b62415ec0c215aa52bdafe162fb8c8fd217a8fcaf613e39525b0f.json+++ b/.sqlx/query-cfbec090ff3b62415ec0c215aa52bdafe162fb8c8fd217a8fcaf613e39525b0f.json@@ -37,7 +37,8 @@"kind": {"Enum": ["task",- "snippet"+ "snippet",+ "skill"]}}diff --git a/.sqlx/query-d86be6e3a5bac69df99498b43dfc645a882c4f965226e71fc300d84a081ad30d.json b/.sqlx/query-d86be6e3a5bac69df99498b43dfc645a882c4f965226e71fc300d84a081ad30d.jsonindex d4ba5f46e7..d3b429235f 100644--- a/.sqlx/query-d86be6e3a5bac69df99498b43dfc645a882c4f965226e71fc300d84a081ad30d.json+++ b/.sqlx/query-d86be6e3a5bac69df99498b43dfc645a882c4f965226e71fc300d84a081ad30d.json@@ -87,7 +87,8 @@"kind": {"Enum": ["task",- "snippet"+ "snippet",+ "skill"]}}diff --git a/.sqlx/query-da98ce3985fbf5eaed5300bb94b3354c7b4bd005b9e5657a702bd39846ff0917.json b/.sqlx/query-da98ce3985fbf5eaed5300bb94b3354c7b4bd005b9e5657a702bd39846ff0917.jsonindex 5aa5cecd85..69f2544e3c 100644--- a/.sqlx/query-da98ce3985fbf5eaed5300bb94b3354c7b4bd005b9e5657a702bd39846ff0917.json+++ b/.sqlx/query-da98ce3985fbf5eaed5300bb94b3354c7b4bd005b9e5657a702bd39846ff0917.json@@ -12,7 +12,8 @@"kind": {"Enum": ["task",- "snippet"+ "snippet",+ "skill"]}}diff --git a/.sqlx/query-dd4f7c4b90b6340ea7f4a7d6eb16347612e9d197979f9d4a4df40314f22559f8.json b/.sqlx/query-dd4f7c4b90b6340ea7f4a7d6eb16347612e9d197979f9d4a4df40314f22559f8.jsonindex 6522361cd3..cb968b7cc4 100644--- a/.sqlx/query-dd4f7c4b90b6340ea7f4a7d6eb16347612e9d197979f9d4a4df40314f22559f8.json+++ b/.sqlx/query-dd4f7c4b90b6340ea7f4a7d6eb16347612e9d197979f9d4a4df40314f22559f8.json@@ -82,7 +82,8 @@"kind": {"Enum": ["task",- "snippet"+ "snippet",+ "skill"]}}diff --git a/.sqlx/query-ecd59864bf9f241755a73ed370146370580a768c26a4c9f6b1fe9d8244abdb36.json b/.sqlx/query-ecd59864bf9f241755a73ed370146370580a768c26a4c9f6b1fe9d8244abdb36.jsonindex c1ea54d83e..c67e2c1de8 100644--- a/.sqlx/query-ecd59864bf9f241755a73ed370146370580a768c26a4c9f6b1fe9d8244abdb36.json+++ b/.sqlx/query-ecd59864bf9f241755a73ed370146370580a768c26a4c9f6b1fe9d8244abdb36.json@@ -47,7 +47,8 @@"kind": {"Enum": ["task",- "snippet"+ "snippet",+ "skill"]}}diff --git a/.sqlx/query-f61fae90a53682f217091f1ecbdaa60d2eb5b7b0ff90863b0d0dc288779a5f7f.json b/.sqlx/query-f61fae90a53682f217091f1ecbdaa60d2eb5b7b0ff90863b0d0dc288779a5f7f.jsonindex 2333f15f8b..ea8c6ba8ad 100644--- a/.sqlx/query-f61fae90a53682f217091f1ecbdaa60d2eb5b7b0ff90863b0d0dc288779a5f7f.json+++ b/.sqlx/query-f61fae90a53682f217091f1ecbdaa60d2eb5b7b0ff90863b0d0dc288779a5f7f.json@@ -57,7 +57,8 @@"kind": {"Enum": ["task",- "snippet"+ "snippet",+ "skill"]}}diff --git a/.sqlx/query-fab6b92c5781874261b3c3ca673d0bf0ad8155e25cf77aa57dafdcb133f30509.json b/.sqlx/query-fab6b92c5781874261b3c3ca673d0bf0ad8155e25cf77aa57dafdcb133f30509.jsonindex bbff4acae2..ba478af6f9 100644--- a/.sqlx/query-fab6b92c5781874261b3c3ca673d0bf0ad8155e25cf77aa57dafdcb133f30509.json+++ b/.sqlx/query-fab6b92c5781874261b3c3ca673d0bf0ad8155e25cf77aa57dafdcb133f30509.json@@ -12,7 +12,8 @@"kind": {"Enum": ["task",- "snippet"+ "snippet",+ "skill"]}}diff --git a/.sqlx/query-fcd4b67db8a3a8de51b0bb55880c5934f900adbadcc5549165e709cb1cd345b5.json b/.sqlx/query-fcd4b67db8a3a8de51b0bb55880c5934f900adbadcc5549165e709cb1cd345b5.jsonindex 671a73cb36..628a760f1c 100644--- a/.sqlx/query-fcd4b67db8a3a8de51b0bb55880c5934f900adbadcc5549165e709cb1cd345b5.json+++ b/.sqlx/query-fcd4b67db8a3a8de51b0bb55880c5934f900adbadcc5549165e709cb1cd345b5.json@@ -92,7 +92,8 @@"kind": {"Enum": ["task",- "snippet"+ "snippet",+ "skill"]}}diff --git a/Cargo.lock b/Cargo.lockindex 5250c87ca2..47fbeb27fa 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -302,6 +302,7 @@ dependencies = ["secretsmanager_client","serde","serde_json",+ "skills","soup","sqlx","sqs_client",@@ -4686,6 +4687,7 @@ dependencies = ["sha2 0.10.9","sqlx","sync_service_client",+ "system_skills","task_dedup","thiserror 2.0.18","tokio",@@ -13788,6 +13790,35 @@ dependencies = ["typenum",]+[[package]]+name = "skills"+version = "0.1.0"+dependencies = [+ "ai_toolset",+ "anyhow",+ "async-trait",+ "chrono",+ "cowlike",+ "document_sub_type",+ "email",+ "filter_ast",+ "item_filters",+ "macro_user_id",+ "models_pagination",+ "models_search",+ "models_soup",+ "schemars 1.2.1",+ "search_service_client",+ "serde",+ "soup",+ "system_skills",+ "thiserror 2.0.18",+ "tokio",+ "tracing",+ "uuid",+ "workspace-hack",+]+[[package]]name = "slab"version = "0.4.12"@@ -14601,6 +14632,15 @@ dependencies = ["workspace-hack",]+[[package]]+name = "system_skills"+version = "0.1.0"+dependencies = [+ "prompt",+ "uuid",+ "workspace-hack",+]+[[package]]name = "tabular"version = "0.2.0"diff --git a/Cargo.toml b/Cargo.tomlindex c1ad24f027..7887dca8fb 100644--- a/Cargo.toml+++ b/Cargo.toml@@ -48,7 +48,9 @@ members = ["crates/properties_service","crates/reminders","crates/search_service",+ "crates/skills","crates/soup_realtime",+ "crates/system_skills","crates/task_dedup","crates/unfurl","crates/worker-rs-otel",diff --git a/apps/web/src/components/app/split-layout/componentRegistry.tsx b/apps/web/src/components/app/split-layout/componentRegistry.tsxindex 75a2afe133..04eea3040e 100644--- a/apps/web/src/components/app/split-layout/componentRegistry.tsx+++ b/apps/web/src/components/app/split-layout/componentRegistry.tsx@@ -13,6 +13,7 @@ import { useAnalytics } from '@app/lib/analytics/analytics-context';import { globalSplitManager } from '@app/signal/splitLayout';import { ChannelCompose } from '@block-channel/component/Compose';import { EmailCompose } from '@block-email/component/compose/Compose';+import { ComposeSkill } from '@block-md/component/ComposeSkill';import { ComposeTask } from '@block-md/component/ComposeTask';import {CRM_VIEW_URL_PARAM,@@ -523,6 +524,10 @@ registerComponent('task-compose', (params) => {usePageViewTracking('task-compose');return <ComposeTask {...params} />;});+registerComponent('skill-compose', (params) => {+ usePageViewTracking('skill-compose');+ return <ComposeSkill {...params} />;+});registerComponent('import-linear',lazy(() => import('@app/features/integrations/import-linear/ImportLinear'))diff --git a/apps/web/src/features/block-md/component/ComposeSkill.tsx b/apps/web/src/features/block-md/component/ComposeSkill.tsxnew file mode 100644index 0000000000..78519108c2--- /dev/null+++ b/apps/web/src/features/block-md/component/ComposeSkill.tsx@@ -0,0 +1,443 @@+import { useSplitLayout } from '@components/app/split-layout/layout';+import { useSplitPanelOrThrow } from '@components/app/split-layout/layoutUtils';+import { buildConfig } from '@core/component/LexicalMarkdown/builder/MarkdownConfigBuilder';+import { MarkdownShell } from '@core/component/LexicalMarkdown/builder/MarkdownShell';+import { createLexicalWrapper } from '@core/component/LexicalMarkdown/context/LexicalWrapperContext';+import {+ autoRegister,+ singleLinePlugin,+} from '@core/component/LexicalMarkdown/plugins';+import {+ $getCaretRect,+ forceSetTextContent,+ initializeEditorEmpty,+ isRectFlushWith,+ trimWhitespace,+} from '@core/component/LexicalMarkdown/utils';+import type { PortalScope } from '@core/component/ScopedPortal';+import { toast } from '@core/component/Toast/Toast';+import { registerHotkey, useHotkeyDOMScope } from '@core/hotkey/hotkeys';+import { createSkill } from '@core/util/create';+import { buildSimpleEntityUrl } from '@core/util/url';+import { mergeRegister } from '@lexical/utils';+import ArrowSquareOutIcon from '@phosphor/arrow-square-out.svg';+import ArrowsOutIcon from '@phosphor/arrows-out.svg';+import SplitIcon from '@phosphor/square-half.svg';+import XIcon from '@phosphor/x.svg';+import { onElementConnect } from '@solid-primitives/lifecycle';+import { Button, Hotkey, Scroll } from '@ui';+import {+ $getRoot,+ COMMAND_PRIORITY_NORMAL,+ KEY_ARROW_DOWN_COMMAND,+ KEY_ENTER_COMMAND,+ KEY_ESCAPE_COMMAND,+ type LexicalEditor,+} from 'lexical';+import {+ type Accessor,+ createEffect,+ createSignal,+ on,+ onCleanup,+ onMount,+ Show,+ untrack,+} from 'solid-js';++function composerTitleNavigationPlugin(+ bodyEditor: Accessor<LexicalEditor | undefined>+) {+ const focusBodyStart = (event: KeyboardEvent | null) => {+ const editor = bodyEditor();+ if (!editor) return false;+ event?.preventDefault();+ event?.stopPropagation();+ editor.update(() => {+ const firstChild = $getRoot().getFirstChild();+ firstChild?.selectStart();+ });+ editor.focus();+ return true;+ };++ return (titleEditor: LexicalEditor) =>+ mergeRegister(+ titleEditor.registerCommand(+ KEY_ENTER_COMMAND,+ (event) => focusBodyStart(event),+ COMMAND_PRIORITY_NORMAL+ ),+ titleEditor.registerCommand(+ KEY_ARROW_DOWN_COMMAND,+ (event) => {+ const rect = titleEditor.getRootElement()?.getBoundingClientRect();+ if (!rect) return false;+ const caret = $getCaretRect() ?? rect;+ if (!isRectFlushWith(caret, rect, 'bottom', 5)) return false;+ return focusBodyStart(event);+ },+ COMMAND_PRIORITY_NORMAL+ )+ );+}++function ComposeSkillTitleEditor(props: {+ value: Accessor<string>;+ onChange: (value: string) => void;+ disabled: Accessor<boolean>;+ bodyEditor: Accessor<LexicalEditor | undefined>;+ containerRef: Accessor<HTMLDivElement | undefined>;+ onUserInput: () => void;+ ref?: (el: HTMLDivElement) => void;+}) {+ const [state, setState] = createSignal(props.value());+ const [showPlaceholder, setShowPlaceholder] = createSignal(+ props.value().trim() === ''+ );+ const [rootConnected, setRootConnected] = createSignal(false);++ const { editor, plugins, cleanup } = createLexicalWrapper({+ namespace: 'skill-composer-title',+ type: 'title',+ isInteractable: () => !props.disabled(),+ });++ initializeEditorEmpty(editor);+ forceSetTextContent(editor, props.value());++ plugins+ .plainText()+ .history(400)+ .use(singleLinePlugin())+ .use(composerTitleNavigationPlugin(props.bodyEditor))+ .state<string>(setState, 'plain');++ plugins.onUpdate(({ editorState }) => {+ if (!editorState) return;+ setShowPlaceholder(+ editorState.read(() => $getRoot().getTextContent().trim() === '')+ );+ });++ createEffect(() => {+ editor.setEditable(!props.disabled());+ });++ createEffect(+ on(+ state,+ (next) => {+ if (next === props.value()) return;+ props.onUserInput();+ props.onChange(next);+ },+ { defer: true }+ )+ );++ createEffect(() => {+ const next = props.value();+ if (!untrack(rootConnected)) return;+ if (next === untrack(state)) return;+ forceSetTextContent(editor, next);+ });++ autoRegister(+ editor.registerCommand(+ KEY_ESCAPE_COMMAND,+ (event) => {+ props.containerRef()?.focus();+ event?.preventDefault();+ event?.stopPropagation();+ return true;+ },+ COMMAND_PRIORITY_NORMAL+ )+ );++ const onConnect = (el: HTMLDivElement) => {+ editor.setRootElement(el);+ setRootConnected(true);+ onCleanup(() => {+ trimWhitespace(editor, { trailing: true });+ cleanup();+ });+ };++ return (+ <div class="relative w-full">+ <div+ contentEditable={!props.disabled()}+ class="ph-no-capture w-full text-xl font-medium outline-none whitespace-pre-wrap wrap-break-words"+ ref={(el) => {+ props.ref?.(el);+ onElementConnect(el, () => onConnect(el));+ }}+ />+ <Show when={showPlaceholder()}>+ <div class="pointer-events-none absolute top-1.5 text-xl font-medium text-ink-placeholder">+ New skill+ </div>+ </Show>+ </div>+ );+}++export type ComposeSkillSuccess = {+ documentId: string;+ title: string;+ content: string;+};++export interface ComposeSkillProps {+ onClose?: () => void;+ initialTitle?: string;+ initialContent?: string;+ placeholder?: string;+ /**+ * When provided, replaces the default success behavior (auto-copy link ++ * toast) so the caller can handle the created skill however it needs.+ * Also fires when the skill is created via "Continue editing in split".+ */+ onSuccess?: (result: ComposeSkillSuccess) => void;+}++/**+ * Popover dialog for creating a skill — a trimmed-down sibling of+ * [`ComposeTask`]: just a name, markdown instructions, and a create button.+ * Skills have no properties, tags, or assignees, so none of that appears.+ */+export function ComposeSkill(props: ComposeSkillProps) {+ const splitPanel = useSplitPanelOrThrow();+ const { openWithSplit } = useSplitLayout();++ const [title, setTitle] = createSignal(props.initialTitle ?? '');+ const [content, setContent] = createSignal(props.initialContent ?? '');+ const [bodyEditor, setBodyEditor] = createSignal<LexicalEditor>();+ const [containerRef, setContainerRef] = createSignal<HTMLDivElement>();+ const [attachHotkeys, composeHotkeyScope] = useHotkeyDOMScope(+ 'compose-skill',+ true+ );+ const [errorMessage, setErrorMessage] = createSignal<string>('');+ const [isCreating, setIsCreating] = createSignal(false);++ const showSkillCreatedToast = async (documentId: string) => {+ const url = buildSimpleEntityUrl({ type: 'skill', id: documentId });+ let linkCopied = false;+ try {+ await navigator.clipboard.writeText(url);+ linkCopied = true;+ } catch {+ toast.failure('Failed to copy link to clipboard');+ }++ toast.success('Skill created', {+ subtext: linkCopied ? 'Link copied' : undefined,+ actions: [+ {+ label: 'Open',+ icon: ArrowSquareOutIcon,+ onClick: () => {+ openWithSplit(+ { type: 'skill', id: documentId },+ { referredFrom: null }+ );+ },+ },+ {+ label: 'Open (New Split)',+ icon: SplitIcon,+ onClick: () => {+ openWithSplit(+ { type: 'skill', id: documentId },+ { referredFrom: null, preferNewSplit: true }+ );+ },+ },+ ],+ });+ };++ // Unlike ComposeTask there is no draft persistence, so the dialog stays+ // open while the create request is in flight — a failure keeps the user's+ // input instead of dropping it.+ const submitSkill = async () => {+ const skillTitle = title().trim();+ const skillContent = content().trim();++ setIsCreating(true);+ const documentId = await createSkill({+ title: skillTitle,+ content: skillContent,+ source: 'skill_composer',+ });+ setIsCreating(false);++ if (!documentId) {+ toast.failure('Failed to create Skill');+ return null;+ }++ splitPanel.handle.close();+ props.onClose?.();+ props.onSuccess?.({+ documentId,+ title: skillTitle,+ content: skillContent,+ });+ return documentId;+ };++ const handleCreateSkill = async () => {+ if (isCreating()) return;++ if (!title().trim()) {+ setErrorMessage('Please give this skill a name');+ return;+ }+ setErrorMessage('');++ const documentId = await submitSkill();+ if (documentId && !props.onSuccess) {+ showSkillCreatedToast(documentId);+ }+ };++ const handleContinueInSplit = async () => {+ if (isCreating()) return;+ setErrorMessage('');++ const documentId = await submitSkill();+ if (!documentId) return;++ openWithSplit(+ { type: 'skill', id: documentId },+ { referredFrom: 'launcher', preferNewSplit: true }+ );+ };++ const handleClose = () => {+ splitPanel.handle.close();+ props.onClose?.();+ };++ onMount(() => {+ const container = containerRef();+ if (container) {+ attachHotkeys(container);+ }+ });++ registerHotkey({+ hotkey: 'cmd+enter',+ scopeId: composeHotkeyScope,+ description: 'Create skill',+ keyDownHandler: () => {+ handleCreateSkill();+ return true;+ },+ runWithInputFocused: true,+ });++ const editorConfig = buildConfig('markdown')+ .withMentions()+ .withEmojis()+ .withActions()+ .withCode()+ .withMedia({ fileDrop: true })+ .withSelectionData()+ .withHistory()+ .onChange(setContent)+ .onEscape(() => {+ containerRef()?.focus();+ return true;+ });++ const editor = editorConfig.buildHandle().lexical;+ setBodyEditor(editor);+ const portalScope = (): PortalScope =>+ splitPanel.handle.isPopover() ? 'local' : 'block';++ return (+ <div+ class="portal-scope flex flex-col relative h-full max-h-full min-h-0 p-4 gap-4"+ tabIndex={-1}+ ref={setContainerRef}+ >+ <div class="flex items-center gap-1">+ <div class="flex-1 flex items-center">+ <Show when={splitPanel?.handle.isPopover()}>+ <Button+ onMouseDown={handleContinueInSplit}+ disabled={isCreating()}+ tabIndex={-1}+ tooltip="Continue editing in split"+ size="icon-sm"+ >+ <ArrowsOutIcon />+ </Button>+ </Show>+ </div>+ <Show when={splitPanel?.handle.isPopover()}>+ <Button+ onMouseDown={handleClose}+ tabIndex={-1}+ tooltip="Close"+ size="icon-sm"+ >+ <XIcon />+ </Button>+ </Show>+ </div>+ <div class="flex-1 min-h-0 flex flex-col overflow-hidden">+ <div class="shrink-0 flex gap-2 items-center px-2 mb-4">+ <ComposeSkillTitleEditor+ value={title}+ onChange={setTitle}+ disabled={isCreating}+ bodyEditor={bodyEditor}+ containerRef={containerRef}+ onUserInput={() => {+ if (errorMessage()) {+ setErrorMessage('');+ }+ }}+ />+ </div>++ <div class="overflow-auto scrollbar-hidden mb-6 min-h-24 grow px-2">+ <Scroll>+ <MarkdownShell+ config={editorConfig}+ initialValue={props.initialContent || undefined}+ placeholder={props.placeholder ?? 'Add instructions...'}+ portalScope={portalScope()}+ />+ </Scroll>+ </div>+ </div>++ <Show when={errorMessage()}>+ <div class="w-full border-b border-edge-muted" />+ <div class="p-2">+ <div class="text-sm text-failure-ink px-3 py-2">{errorMessage()}</div>+ </div>+ </Show>++ <div class="shrink-0 flex justify-end items-end gap-2">+ <Button+ onClick={handleCreateSkill}+ disabled={title().trim().length === 0 || isCreating()}+ variant={title().trim().length === 0 ? 'ghost' : 'active'}+ depth={3}+ class="gap-3 rounded-lg border-0"+ >+ Create Skill+ <Hotkey shortcut="cmd+enter" theme="current" />+ </Button>+ </div>+ </div>+ );+}diff --git a/apps/web/src/features/block-md/component/TopBar.tsx b/apps/web/src/features/block-md/component/TopBar.tsxindex a79997baec..9e26ded70e 100644--- a/apps/web/src/features/block-md/component/TopBar.tsx+++ b/apps/web/src/features/block-md/component/TopBar.tsx@@ -40,7 +40,7 @@ import GitBranch from '@phosphor/git-branch.svg';import IconLink from '@phosphor/link.svg';import TerminalWindowIcon from '@phosphor/terminal-window.svg';import { blockNameToItemType } from '@service-storage/client';-import { type Accessor, createEffect, on, onCleanup } from 'solid-js';+import { type Accessor, createEffect, on, onCleanup, Show } from 'solid-js';import { useHistory } from '../history/HistoryContext';import {DispatchAgentButton,@@ -62,6 +62,7 @@ export function TopBar(props: { name?: Accessor<string | undefined> } = {}) {const shareCtx = useShareDialogContext();const blockAliasedName = useBlockAliasedName();const isTask = blockAliasedName === 'task';+ const isSkill = blockAliasedName === 'skill';const dispatchAgentActions = useDispatchAgentSplitFileActions();const copyLink = () => {@@ -219,6 +220,11 @@ export function TopBar(props: { name?: Accessor<string | undefined> } = {}) {<><SplitHeaderLeft><BlockItemSplitLabel name={name} />+ <Show when={isSkill}>+ <span class="ml-1.5 inline-flex shrink-0 items-center self-center rounded-sm bg-hover px-1.5 py-0.5 text-[10px] font-medium leading-none text-ink-muted">+ Skill+ </span>+ </Show></SplitHeaderLeft><SplitHeaderRight>diff --git a/apps/web/src/features/block-md/definition.ts b/apps/web/src/features/block-md/definition.tsindex 5656d60edc..f3c67c58d9 100644--- a/apps/web/src/features/block-md/definition.ts+++ b/apps/web/src/features/block-md/definition.ts@@ -30,6 +30,7 @@ export const definition = defineBlock({aliases: [{ name: 'task', defaultFileName: 'New Task' },{ name: 'snippet', defaultFileName: 'New Snippet' },+ { name: 'skill', defaultFileName: 'New Skill' },],component: MarkdownBlock,accepted: {diff --git a/apps/web/src/features/entity/extractors/entity-icon.tsx b/apps/web/src/features/entity/extractors/entity-icon.tsxindex 03ba30ce57..8bd5b351d2 100644--- a/apps/web/src/features/entity/extractors/entity-icon.tsx+++ b/apps/web/src/features/entity/extractors/entity-icon.tsx@@ -21,6 +21,7 @@ import {isCallEntity,isChannelEntity,isChannelMessageEntity,+ isSkillEntity,isSnippetEntity,isTaskEntity,} from '../types/entity';@@ -113,6 +114,7 @@ export function EntityIcon(props: EntityIconProps) {.when(isChannelMessageEntity, ({ channelType }) => channelType).when(isTaskEntity, () => 'task').when(isSnippetEntity, () => 'snippet')+ .when(isSkillEntity, () => 'skill').with({ type: 'document' }, ({ fileType }) => {return fileType ?? 'default';})diff --git a/apps/web/src/features/entity/types/entity.ts b/apps/web/src/features/entity/types/entity.tsindex eaaeb7ab6e..c090a2ce4b 100644--- a/apps/web/src/features/entity/types/entity.ts+++ b/apps/web/src/features/entity/types/entity.ts@@ -150,10 +150,10 @@ export type ChatEntity = EntityBase & {properties?: SoupProperty[];};-/** Named sub types - 'task' and 'snippet' */-export type NamedSubType = 'task' | 'snippet';+/** Named sub types - 'task', 'snippet' and 'skill' */+export type NamedSubType = 'task' | 'snippet' | 'skill';-/** SubType for documents - tasks and snippets */+/** SubType for documents - tasks, snippets and skills */export type SubType = {type: NamedSubType;is_completed?: boolean;@@ -181,6 +181,13 @@ export type SnippetEntity = EntityBase & {projectId?: string;};+export type SkillEntity = EntityBase & {+ type: 'document';+ fileType: 'md';+ subType: { type: 'skill' };+ projectId?: string;+};+export type MarkdownEntity = EntityBase & {type: 'document';fileType: 'md';@@ -398,6 +405,14 @@ export const isSnippetEntity = ();};+export const isSkillEntity = (entity: EntityData): entity is SkillEntity => {+ return (+ entity.type === 'document' &&+ entity.fileType === 'md' &&+ entity.subType?.type === 'skill'+ );+};+export const isGithubPrEntity = (entity: EntityData): entity is GithubPullRequestEntity => {@@ -501,13 +516,14 @@ const _isPureDocumentEntity = (return (entity.type === 'document' &&entity.subType?.type !== 'task' &&- entity.subType?.type !== 'snippet'+ entity.subType?.type !== 'snippet' &&+ entity.subType?.type !== 'skill');};export type EntityType = EntityData['type'];-export type ExpandedEntityType = EntityType | 'task' | 'snippet';+export type ExpandedEntityType = EntityType | 'task' | 'snippet' | 'skill';export type EntityWithProperties<T extends EntityData> = T & {properties?: SoupProperty[];diff --git a/apps/web/src/features/entity/utils/buildEntityData.ts b/apps/web/src/features/entity/utils/buildEntityData.tsindex 7776ca1531..d419aaa927 100644--- a/apps/web/src/features/entity/utils/buildEntityData.ts+++ b/apps/web/src/features/entity/utils/buildEntityData.ts@@ -9,6 +9,7 @@ import type {EmailEntity,EntityData,ProjectEntity,+ SkillEntity,SnippetEntity,TaskEntity,} from '../types/entity';@@ -77,6 +78,16 @@ export function buildEntityData(projectId: args.projectId,}))+ .with(+ 'skill',+ (): SkillEntity => ({+ ...base,+ type: 'document',+ fileType: 'md',+ subType: { type: 'skill' },+ projectId: args.projectId,+ })+ ).with('md',(): DocumentEntity => ({diff --git a/apps/web/src/features/next-soup/filters/configs/document-type-query.ts b/apps/web/src/features/next-soup/filters/configs/document-type-query.tsindex 706c10d76c..3227812298 100644--- a/apps/web/src/features/next-soup/filters/configs/document-type-query.ts+++ b/apps/web/src/features/next-soup/filters/configs/document-type-query.ts@@ -13,6 +13,7 @@ const DOCUMENT_TYPE_FILTER_IDS = ['file-docx','file-video','doc-snippet',+ 'doc-skill','file-other',] as const satisfies readonly FilterID[];@@ -32,7 +33,7 @@ const documentTypeExpressions: Record<op: 'and',clauses: [{ include: { fileType: ['md'] } },- { exclude: { subType: ['snippet', 'task'] } },+ { exclude: { subType: ['snippet', 'task', 'skill'] } },],},'doc-canvas': { include: { fileType: ['canvas'] } },@@ -48,6 +49,13 @@ const documentTypeExpressions: Record<{ include: { subType: ['snippet'] } },],},+ 'doc-skill': {+ op: 'and',+ clauses: [+ { include: { fileType: ['md'] } },+ { include: { subType: ['skill'] } },+ ],+ },'file-other': {include: { fileAssoc: ['assoc:other'] },exclude: { fileAssoc: ['assoc:document', 'assoc:image', 'assoc:video'] },diff --git a/apps/web/src/features/next-soup/filters/configs/document.ts b/apps/web/src/features/next-soup/filters/configs/document.tsindex 325e31d499..1fa4677665 100644--- a/apps/web/src/features/next-soup/filters/configs/document.ts+++ b/apps/web/src/features/next-soup/filters/configs/document.ts@@ -1,5 +1,5 @@import { codeFileExtensions } from '@block-code/util/languageSupport';-import { isDocumentEntity } from '@entity';+import { isDocumentEntity, isSkillEntity } from '@entity';import {config,IMAGE_EXTENSIONS,@@ -21,6 +21,14 @@ const docSnippetFilter = config({query: { include: { fileAssoc: ['assoc:md'] } },});+const docSkillFilter = config({+ id: 'doc-skill',+ predicate: isSkillEntity,+ // Skills are markdown documents in storage; subtype is enforced client-side+ // so this composes with other file-type OR filters.+ query: { include: { fileAssoc: ['assoc:md'] } },+});+const docCanvasFilter = config({id: 'doc-canvas',predicate: (e) => isDocumentEntity(e) && e.fileType === 'canvas',@@ -40,6 +48,7 @@ export const emailAttachmentsFilter = config({export const DOCUMENT_CONTEXTUAL_FILTERS = [docMarkdownFilter,docSnippetFilter,+ docSkillFilter,docCanvasFilter,emailAttachmentsFilter,] as const;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.tsindex db050d5530..c20d52a2dd 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@@ -212,6 +212,12 @@ export const VIEW_TAB_PRESETS: Record<ListView, ViewTabConfig> = {filters: defineQueryFilters({}),clientFilters: { and: ['automation'] },}),+ skills: () => ({+ filters: defineQueryFilters({+ include: { subType: ['skill'] },+ }),+ clientFilters: { and: ['doc-skill'] },+ }),},},mail: {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.tsxindex 6a5fd46206..b6fd40b775 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@@ -249,6 +249,22 @@ export function EmptyState(props: {/></Match>+ <Match+ when={props.listView === 'agents' && soup.activeTab() === 'skills'}+ >+ <EmptyStatePanel+ graphic={EmptyStateAiGraphic}+ title="No skills yet"+ description="Skills are markdown documents with instructions AI follows. Reference one with / in any AI input."+ primaryAction={{+ label: 'New skill',+ icon: PlusIcon,+ onClick: () => runCreateAction('skill'),+ }}+ documentationUrl={`${DOCS_BASE}/product/agents`}+ />+ </Match>+<Match when={props.listView === 'agents'}><EmptyStatePanelgraphic={EmptyStateAiGraphic}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.tsxindex d840075839..a0bcb117b9 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@@ -355,6 +355,11 @@ const DOCUMENTS_FILTER_CATEGORIES: FilterCategory[] = [label: 'Snippets',icon: () => <EntityIcon targetType="snippet" size="xs" />,},+ {+ id: 'doc-skill',+ label: 'Skills',+ icon: () => <EntityIcon targetType="skill" size="xs" />,+ },{id: 'file-other',label: 'Other',diff --git a/apps/web/src/features/next-soup/soup-view/soup-view-create-button.tsx b/apps/web/src/features/next-soup/soup-view/soup-view-create-button.tsxindex 80dfe0f035..760922aff2 100644--- a/apps/web/src/features/next-soup/soup-view/soup-view-create-button.tsx+++ b/apps/web/src/features/next-soup/soup-view/soup-view-create-button.tsx@@ -29,7 +29,7 @@ const VIEW_CREATE_BLOCKNAMES: Partial<> = {documents: ['md', 'snippet', 'canvas', 'code', 'project'],tasks: ['task'],- agents: ['chat', 'automation'],+ agents: ['chat', 'automation', 'skill'],mail: ['email'],channels: ['channel'],folders: ['project'],diff --git a/apps/web/src/features/next-soup/soup-view/tab-lists.ts b/apps/web/src/features/next-soup/soup-view/tab-lists.tsindex 1f47535a09..c6bb1efad0 100644--- a/apps/web/src/features/next-soup/soup-view/tab-lists.ts+++ b/apps/web/src/features/next-soup/soup-view/tab-lists.ts@@ -27,6 +27,7 @@ export const VIEW_TAB_LISTS: Record<TabbedListView, TabItem[]> = {{ value: 'running', label: 'Running' },{ value: 'shared', label: 'Shared' },{ value: 'automations', label: 'Automations' },+ { value: 'skills', label: 'Skills' },],mail: [{ value: 'important', label: 'Signal' },diff --git a/apps/web/src/lib/constants/list-views.ts b/apps/web/src/lib/constants/list-views.tsindex 79b533ded4..43cd4718df 100644--- a/apps/web/src/lib/constants/list-views.ts+++ b/apps/web/src/lib/constants/list-views.ts@@ -75,7 +75,12 @@ export const soupItemMatchesListView = (view: ListView | undefined): boolean =>match(view)- .with('agents', () => item.tag === 'chat')+ .with(+ 'agents',+ () =>+ item.tag === 'chat' ||+ (item.tag === 'document' && item.data.subType?.type === 'skill')+ ).with('mail', () => item.tag === 'emailThread').with('documents',diff --git a/apps/web/src/lib/core/block.ts b/apps/web/src/lib/core/block.tsindex e4cf037eeb..3f9b2eeb98 100644--- a/apps/web/src/lib/core/block.ts+++ b/apps/web/src/lib/core/block.ts@@ -85,7 +85,7 @@ export type BlockName = (typeof BlockRegistry)[BlockNameKeys];* List of strongly-typed, valid aliases that can be used as pseudo-differentiated* block types.*/-export const BlockAliasRegistry = ['csv', 'task', 'snippet'] as const;+export const BlockAliasRegistry = ['csv', 'task', 'snippet', 'skill'] as const;type BlockAliasKeys = keyof typeof BlockAliasRegistry & number;@@ -160,6 +160,7 @@ const _ValidBlockCombinations: BlockCombinationRules = {company: allBlockNames,task: allBlockNames,snippet: allBlockNames,+ skill: allBlockNames,automation: allBlockNames,csv: allBlockNames,pr: allBlockNames,@@ -184,6 +185,7 @@ export const ValidNestingCombinations: BlockCombinationRules = {company: new Set([]),task: new Set([]),snippet: new Set([]),+ skill: new Set([]),automation: new Set([]),csv: new Set([]),pr: new Set([]),diff --git a/apps/web/src/lib/core/component/AI/component/input/buildChatEditor.ts b/apps/web/src/lib/core/component/AI/component/input/buildChatEditor.tsindex 46d5042671..f1e112afff 100644--- a/apps/web/src/lib/core/component/AI/component/input/buildChatEditor.ts+++ b/apps/web/src/lib/core/component/AI/component/input/buildChatEditor.ts@@ -13,6 +13,7 @@ import { tablePlugin } from '@core/component/LexicalMarkdown/plugins/tables/tablexport function buildChatEditor() {return buildConfig('chat').namespace('chat-markdown-area')+ .withSkills().withEmojis().withLinks({ floatingMenu: true, autoLinkMatchMode: 'common-tlds' }).withHistory({ timeGap: 400 })diff --git a/apps/web/src/lib/core/component/AI/component/tool/ReadContent.tsx b/apps/web/src/lib/core/component/AI/component/tool/ReadContent.tsxindex a333d45141..073133767c 100644--- a/apps/web/src/lib/core/component/AI/component/tool/ReadContent.tsx+++ b/apps/web/src/lib/core/component/AI/component/tool/ReadContent.tsx@@ -1,26 +1,51 @@+import { EntityIcon } from '@core/component/EntityIcon';import { ItemPreview } from '@core/component/ItemPreview';import Newspaper from '@phosphor-icons/core/regular/newspaper.svg';-import { Suspense } from 'solid-js';+import { useSystemSkillsQuery } from '@queries/storage/system-skills';+import { Show, Suspense } from 'solid-js';import { BaseTool } from './BaseTool';import { createToolRenderer } from './ToolRenderer';const handler = createToolRenderer({name: 'ReadContent',- render: (ctx) => (- <BaseTool icon={Newspaper} renderContext={ctx.renderContext} type="call">- <div class="min-w-0 flex-1">- Read <span class="text-ink">document</span>{' '}- <span class="text-ink-placeholder">·</span>{' '}- <Suspense>- <ItemPreview- class="inline-flex align-middle ring-0"- id={ctx.tool.data.documentId}- type="document"- />- </Suspense>- </div>- </BaseTool>- ),+ render: (ctx) => {+ // System skills have no document behind them, so the item preview would+ // report them deleted — render the static skill name instead.+ const systemSkills = useSystemSkillsQuery();+ return (+ <BaseTool icon={Newspaper} renderContext={ctx.renderContext} type="call">+ <div class="min-w-0 flex-1">+ <Show+ when={systemSkills.getSystemSkill(ctx.tool.data.documentId)}+ fallback={+ <>+ Read <span class="text-ink">document</span>{' '}+ <span class="text-ink-placeholder">·</span>{' '}+ <Suspense>+ <ItemPreview+ class="inline-flex align-middle ring-0"+ id={ctx.tool.data.documentId}+ type="document"+ />+ </Suspense>+ </>+ }+ >+ {(skill) => (+ <>+ Read <span class="text-ink">skill</span>{' '}+ <span class="text-ink-placeholder">·</span>{' '}+ <span class="inline-flex items-center gap-1 align-middle text-ink">+ <EntityIcon targetType="skill" size="xs" />+ {skill().name}+ </span>+ </>+ )}+ </Show>+ </div>+ </BaseTool>+ );+ },});export const readContentHandler = handler;diff --git a/apps/web/src/lib/core/component/AI/component/tool/SearchSkills.tsx b/apps/web/src/lib/core/component/AI/component/tool/SearchSkills.tsxnew file mode 100644index 0000000000..a32c2a3487--- /dev/null+++ b/apps/web/src/lib/core/component/AI/component/tool/SearchSkills.tsx@@ -0,0 +1,113 @@+import { getEntityClickContent } from '@channel/Attachments/attachment-utils';+import { useSplitLayout } from '@components/app/split-layout/layout';+import { buildEntityData, EntityRowIcon, EntityRowTitle } from '@entity';+import MagnifyingGlass from '@phosphor-icons/core/regular/magnifying-glass.svg';+import type { NamedTool } from '@service-cognition/generated/tools/tool';+import { createSignal, For, Show } from 'solid-js';+import { BaseTool } from './BaseTool';+import { Tool } from './Tool';+import { createToolRenderer } from './ToolRenderer';++type SkillSearchResult = NamedTool<+ 'SearchSkills',+ 'response'+>['data']['results'][number];++type SkillToolName = 'SearchSkills' | 'ListSkills';++function SkillResultRow(props: { result: SkillSearchResult }) {+ const { insertSplit } = useSplitLayout();++ const entity = () =>+ buildEntityData({+ id: props.result.documentId,+ name: props.result.name,+ blockName: 'skill',+ });++ const openSkill = () => {+ const skill = entity();+ if (!skill) return;+ insertSplit(getEntityClickContent(skill));+ };++ return (+ <Show when={entity()}>+ {(skill) => (+ <button+ type="button"+ class="block w-full text-left hover:bg-surface-hover"+ onClick={openSkill}+ >+ <Tool.ListItem icon={<EntityRowIcon entity={skill()} />}>+ <div class="flex min-w-0 items-center gap-2">+ <span class="min-w-0 truncate text-ink">+ <EntityRowTitle entity={skill()} />+ </span>+ </div>+ </Tool.ListItem>+ </button>+ )}+ </Show>+ );+}++const createHandler = (name: SkillToolName) =>+ createToolRenderer({+ name,+ render: (ctx) => {+ const [isExpanded, setIsExpanded] = createSignal(false);+ const results = () => ctx.response?.data.results ?? [];+ const hitCount = () => results().length;+ const hasResults = () => hitCount() > 0;+ const statusText = () => {+ if (!ctx.response) return undefined;+ if (hitCount() === 0) return 'No Results';+ if (hitCount() === 1) return '1 skill';+ return `${hitCount()} skills`;+ };++ return (+ <BaseTool+ icon={MagnifyingGlass}+ renderContext={ctx.renderContext}+ type="call"+ response={+ hasResults() && isExpanded() ? (+ <div class="max-h-120 overflow-y-auto">+ <Tool.List>+ <For each={results()}>+ {(result) => <SkillResultRow result={result} />}+ </For>+ </Tool.List>+ </div>+ ) : undefined+ }+ >+ <div class="flex min-w-0 flex-1 items-center justify-between gap-3 overflow-hidden">+ <div class="flex min-w-0 flex-1 items-center gap-2 overflow-hidden">+ <Show+ when={'name' in ctx.tool.data && ctx.tool.data.name}+ fallback={<span class="min-w-0 truncate">List skills</span>}+ >+ {(query) => (+ <span class="min-w-0 truncate">+ Search skills <span class="text-ink"> {query()} </span>+ </span>+ )}+ </Show>+ </div>+ <Tool.ResultToggle+ expanded={isExpanded()}+ onToggle={() => setIsExpanded((expanded) => !expanded)}+ showToggle={hasResults()}+ status={statusText()}+ />+ </div>+ </BaseTool>+ );+ },+ });++export const searchSkillsHandler = createHandler('SearchSkills');+export const listSkillsHandler = createHandler('ListSkills');diff --git a/apps/web/src/lib/core/component/AI/component/tool/handler.tsx b/apps/web/src/lib/core/component/AI/component/tool/handler.tsxindex ebce5158a0..568772869e 100644--- a/apps/web/src/lib/core/component/AI/component/tool/handler.tsx+++ b/apps/web/src/lib/core/component/AI/component/tool/handler.tsx@@ -50,6 +50,7 @@ import { readProjectHandler } from './ReadProject';import { readThreadHandler } from './ReadThread';import { renameDocumentHandler } from './RenameDocument';import { contentSearchHandler, nameSearchHandler } from './Search';+import { listSkillsHandler, searchSkillsHandler } from './SearchSkills';import { searchToolsHandler } from './SearchTools';import { selfKnowledgeHandler } from './SelfKnowledge';import { sendChannelMessageHandler } from './SendChannelMessage';@@ -78,6 +79,7 @@ const toolHandlers: ToolHandlerMap<RenderContext> = {ListEntities: listEntitiesHandler,ListInboxes: listInboxesHandler,ListLabels: listLabelsHandler,+ ListSkills: listSkillsHandler,ListNotifications: listNotificationsHandler,ListTags: listTagsHandler,ListTeamMembers: listTeamMembersHandler,@@ -106,6 +108,7 @@ const toolHandlers: ToolHandlerMap<RenderContext> = {ReadMetadata: readMetadataHandler,ReadProject: readProjectHandler,RenameDocument: renameDocumentHandler,+ SearchSkills: searchSkillsHandler,SearchTools: searchToolsHandler,SelfKnowledge: selfKnowledgeHandler,SendChannelMessage: sendChannelMessageHandler,diff --git a/apps/web/src/lib/core/component/AI/signal/attachment.ts b/apps/web/src/lib/core/component/AI/signal/attachment.tsindex 58b2f8d3a7..549b01a2ed 100644--- a/apps/web/src/lib/core/component/AI/signal/attachment.ts+++ b/apps/web/src/lib/core/component/AI/signal/attachment.ts@@ -93,6 +93,8 @@ export const useGetChatAttachmentInfo = () => {): Attachment | undefined => {if (mention.itemType === 'document') {return getDocumentAttachment(mention.itemId, mention.fileType);+ } else if (mention.itemType === 'skill') {+ return { entity_id: mention.itemId, entity_type: 'skill' };} else if (mention.itemType === 'call') {return { entity_id: mention.itemId, entity_type: 'document' };} else if (mention.itemType === 'channel') {diff --git a/apps/web/src/lib/core/component/EntityIcon.tsx b/apps/web/src/lib/core/component/EntityIcon.tsxindex 973f850171..5817acb7ed 100644--- a/apps/web/src/lib/core/component/EntityIcon.tsx+++ b/apps/web/src/lib/core/component/EntityIcon.tsx@@ -32,6 +32,7 @@ import WideFileImage from '@icon/wide-file-image.svg';import WideFileMd from '@icon/wide-file-md.svg';import WideFiles from '@icon/wide-files.svg';import WideFolder from '@icon/wide-folder.svg';+import WideGear from '@icon/wide-gear.svg';import WideGlobe from '@icon/wide-globe.svg';import WideSnippet from '@icon/wide-snippet.svg';import WideStar from '@icon/wide-star.svg';@@ -284,6 +285,12 @@ export const ENTITY_ICON_CONFIGS: Record<EntityWithValidIcon, IconConfig> = {background: 'bg-snippet/20',prettyName: 'Snippet',},+ skill: {+ icon: WideGear,+ foreground: 'text-default',+ background: 'bg-default/20',+ prettyName: 'Skill',+ },automation: {icon: WideAutomation,foreground: 'text-default',@@ -370,6 +377,7 @@ const WIDE_ICONS: Record<pr: GithubIcon,task: WideTask,snippet: WideSnippet,+ skill: WideGear,automation: WideAutomation,crm_company: AnimatedCompanyIcon,company: AnimatedCompanyIcon,diff --git a/apps/web/src/lib/core/component/FileList/constants.tsx b/apps/web/src/lib/core/component/FileList/constants.tsxindex b5d4da3f83..763336b2ec 100644--- a/apps/web/src/lib/core/component/FileList/constants.tsx+++ b/apps/web/src/lib/core/component/FileList/constants.tsx@@ -76,6 +76,7 @@ const _fileTypeColors: Record<BlockName | BlockAlias | 'default', string> = {unknown: defaultFileColor,task: defaultFileColor,snippet: 'bg-snippet/20 group/item',+ skill: defaultFileColor,automation: defaultFileColor,pr: defaultFileColor,};diff --git a/apps/web/src/lib/core/component/LexicalMarkdown/builder/MarkdownConfigBuilder.ts b/apps/web/src/lib/core/component/LexicalMarkdown/builder/MarkdownConfigBuilder.tsindex f924dc41b2..602425d0f8 100644--- a/apps/web/src/lib/core/component/LexicalMarkdown/builder/MarkdownConfigBuilder.ts+++ b/apps/web/src/lib/core/component/LexicalMarkdown/builder/MarkdownConfigBuilder.ts@@ -169,6 +169,17 @@ export class EditorConfigBuilder implements EditorBuilder {return this;}+ /**+ * Enable the skills (`/`) typeahead menu — for AI markdown areas. Lists+ * skill documents; selecting one inserts a document mention for the skill.+ * Requires mentions and only takes effect when actions are disabled, since+ * both own the `/` trigger.+ */+ withSkills(): this {+ this.state.skills = true;+ return this;+ }+singleLine(): this {this.state.singleLine = true;return this;diff --git a/apps/web/src/lib/core/component/LexicalMarkdown/builder/MarkdownShell.tsx b/apps/web/src/lib/core/component/LexicalMarkdown/builder/MarkdownShell.tsxindex 27ffaace18..22978b9c2a 100644--- a/apps/web/src/lib/core/component/LexicalMarkdown/builder/MarkdownShell.tsx+++ b/apps/web/src/lib/core/component/LexicalMarkdown/builder/MarkdownShell.tsx@@ -25,6 +25,7 @@ import { EmojiMenu } from '../component/menu/EmojiMenu';import { FloatingFormatMenu } from '../component/menu/FloatingFormatMenu';import { FloatingLinkMenu } from '../component/menu/FloatingLinkMenu';import { MentionsMenu } from '../component/menu/MentionsMenu';+import { SkillsMenu } from '../component/menu/SkillsMenu';import { SnippetsMenu } from '../component/menu/SnippetsMenu';import { TagsMenu } from '../component/menu/TagsMenu';import { DragInsertIndicator } from '../component/misc/DragInsertIndicator';@@ -334,6 +335,18 @@ export const MarkdownShell: Component<)}</Show>+ {/* Skills Menu */}+ <Show when={state.skillsMenuOps}>+ {(menu) => (+ <SkillsMenu+ editor={editor}+ menu={menu()}+ useBlockBoundary={false}+ portalScope={props.portalScope}+ />+ )}+ </Show>+{/* Floating Link & Selection Format Menus */}<Showwhen={diff --git a/apps/web/src/lib/core/component/LexicalMarkdown/builder/buildHandleFromConfig.ts b/apps/web/src/lib/core/component/LexicalMarkdown/builder/buildHandleFromConfig.tsindex adfb2ed3b8..9e437a1681 100644--- a/apps/web/src/lib/core/component/LexicalMarkdown/builder/buildHandleFromConfig.ts+++ b/apps/web/src/lib/core/component/LexicalMarkdown/builder/buildHandleFromConfig.ts@@ -21,6 +21,7 @@ import {mentionsPlugin,selectionDataPlugin,singleLinePlugin,+ skillsPlugin,snippetsPlugin,tabIndentationPlugin,tagsPlugin,@@ -84,6 +85,18 @@ export function buildHandleFromConfig(config: EditorConfig): EditorHandle {config.mentions && !config.mentions.entities && config.snippets !== false? createMenuOperations(): undefined;+ // Skills (`/` menu) are opt-in for AI markdown areas. They share the `/`+ // trigger with the actions slash menu, so they only activate when actions+ // are disabled, and they read from quickAccess like snippets, so editors+ // with a custom mention entity source are excluded.+ const skillsMenuOps =+ config.skills &&+ !actionsMenuOps &&+ config.mentions &&+ !config.mentions.entities &&+ config.type !== 'plain-text'+ ? createMenuOperations()+ : undefined;const accessoryStoreResult = config.code ? createAccessoryStore() : undefined;const accessoryStore = accessoryStoreResult?.[0];@@ -191,6 +204,10 @@ export function buildHandleFromConfig(config: EditorConfig): EditorHandle {}));}++ if (skillsMenuOps) {+ plugins.use(skillsPlugin({ menu: skillsMenuOps }));+ }}// Media (images, videos)@@ -288,7 +305,8 @@ export function buildHandleFromConfig(config: EditorConfig): EditorHandle {(mentionsMenuOps?.isOpen() ?? false) ||(tagsMenuOps?.isOpen() ?? false) ||(emojisMenuOps?.isOpen() ?? false) ||- (snippetsMenuOps?.isOpen() ?? false),+ (snippetsMenuOps?.isOpen() ?? false) ||+ (skillsMenuOps?.isOpen() ?? false),}));}@@ -313,7 +331,8 @@ export function buildHandleFromConfig(config: EditorConfig): EditorHandle {const emojis = emojisMenuOps?.isOpen() ?? false;const actions = actionsMenuOps?.isOpen() ?? false;const snippets = snippetsMenuOps?.isOpen() ?? false;- return mentions || tags || emojis || actions || snippets;+ const skills = skillsMenuOps?.isOpen() ?? false;+ return mentions || tags || emojis || actions || snippets || skills;},};@@ -335,6 +354,7 @@ export function buildHandleFromConfig(config: EditorConfig): EditorHandle {tagsMenuOps,emojisMenuOps,snippetsMenuOps,+ skillsMenuOps,accessoryStore,dragInsertStore,draggableBlockStore,diff --git a/apps/web/src/lib/core/component/LexicalMarkdown/builder/types.ts b/apps/web/src/lib/core/component/LexicalMarkdown/builder/types.tsindex 5e7336ea52..c2d8b04487 100644--- a/apps/web/src/lib/core/component/LexicalMarkdown/builder/types.ts+++ b/apps/web/src/lib/core/component/LexicalMarkdown/builder/types.ts@@ -143,6 +143,12 @@ export interface EditorConfig {tags?: TagsOptions;/** Snippets (`;` menu) follow mentions by default; pass false to opt out. */snippets?: false;+ /**+ * Skills (`/` menu) are opt-in for AI markdown areas. Skills share the `/`+ * trigger with the actions slash menu, so this only takes effect when+ * actions are disabled.+ */+ skills?: boolean;emojis?: EmojisOptions;links?: LinksOptions;history?: HistoryOptions;@@ -179,6 +185,7 @@ export interface EditorInternals {tagsMenuOps: ReturnType<typeof createMenuOperations> | undefined;emojisMenuOps: ReturnType<typeof createMenuOperations> | undefined;snippetsMenuOps: ReturnType<typeof createMenuOperations> | undefined;+ skillsMenuOps: ReturnType<typeof createMenuOperations> | undefined;accessoryStore: ReturnType<typeof createAccessoryStore>[0] | undefined;dragInsertStore: ReturnType<typeof createDragInsertStore>[0] | undefined;draggableBlockStore:diff --git a/apps/web/src/lib/core/component/LexicalMarkdown/component/decorator/DocumentMention.tsx b/apps/web/src/lib/core/component/LexicalMarkdown/component/decorator/DocumentMention.tsxindex 75b2d46100..1d4c4d549b 100644--- a/apps/web/src/lib/core/component/LexicalMarkdown/component/decorator/DocumentMention.tsx+++ b/apps/web/src/lib/core/component/LexicalMarkdown/component/decorator/DocumentMention.tsx@@ -42,6 +42,7 @@ import {type PreviewItemNoAccess,useItemPreview,} from '@queries/preview';+import { useSystemSkillsQuery } from '@queries/storage/system-skills';import { blockNameToItemType } from '@service-storage/client';import { createCallback } from '@solid-primitives/rootless';import {@@ -102,6 +103,58 @@ function MentionContainer(props: {);}+/**+ * Skill mentions render as `/Skill Name` in the accent color rather than the+ * icon-and-underline pill other document mentions use. Same mention node and+ * data attributes — only the visual differs.+ *+ * Clicking opens the skill document. The listener is a native (`on:click`)+ * one rather than Solid's delegated `onClick`: inside an editable editor+ * Lexical stops click propagation before it reaches the document-level+ * delegation, so skill mentions in the chat input would otherwise be inert.+ * System skills have no document behind them and never open.+ */+function SkillSlashText(props: {+ documentId: string;+ name: string;+ collapsed?: boolean;+ dimmed?: boolean;+}) {+ const systemSkills = useSystemSkillsQuery();+ const openSkill = createCallback((e: MouseEvent) => {+ if (systemSkills.isSystemSkillId(props.documentId)) return;+ // Also keeps the outer mention click handler (read-only contexts) from+ // opening the skill a second time.+ e.stopPropagation();+ openDocument(+ 'skill',+ props.documentId,+ undefined,+ openInNewSplitForMention(e.shiftKey, true)+ );+ });+ return (+ <span+ class="pointer-events-auto mx-1 text-accent"+ classList={{ 'opacity-50': props.dimmed }}+ on:mousedown={(e) => e.preventDefault()}+ on:click={openSkill}+ >+ <span+ data-document-mention="true"+ data-document-id={props.documentId}+ data-block-name="skill"+ data-document-name={props.name}+ >+ /+ <Show when={!props.collapsed}>+ {props.name.replaceAll('\n', ' ').trim()}+ </Show>+ </span>+ </span>+ );+}+function InlineTaskProperties(props: { taskId: string }) {const { properties, isLoading } = useEntityProperties(props.taskId,@@ -181,128 +234,166 @@ function InlinePreview(props: {props.documentName);});+ const isSkill = () => props.blockName === 'skill';+return (<Switch><Match when={item().loading}>- <MentionContainer- icon={- <EntityIcon- targetType={props.blockName as any}- size="fill"- class="animate-pulse"+ <Show+ when={isSkill()}+ fallback={+ <MentionContainer+ icon={+ <EntityIcon+ targetType={props.blockName as any}+ size="fill"+ class="animate-pulse"+ />+ }+ text={+ <span+ data-document-mention="true"+ data-document-id={props.entity.id}+ data-block-name={props.blockName}+ data-document-name={props.documentName}+ class="opacity-50"+ >+ <Show when={props.documentName} fallback={'Loading...'}>+ {(name) => name().replaceAll('\n', ' ').trim()}+ </Show>+ </span>+ }+ collapsed={props.collapsed}/>}- text={- <span- data-document-mention="true"- data-document-id={props.entity.id}- data-block-name={props.blockName}- data-document-name={props.documentName}- class="opacity-50"- >- <Show when={props.documentName} fallback={'Loading...'}>- {(name) => name().replaceAll('\n', ' ').trim()}- </Show>- </span>- }- collapsed={props.collapsed}- />+ >+ <SkillSlashText+ documentId={props.entity.id}+ name={props.documentName ?? ''}+ collapsed={props.collapsed}+ dimmed+ />+ </Show></Match><Match when={shouldShowFallback()}>- <MentionContainer- icon={<EntityIcon targetType={props.blockName as any} size="fill" />}- text={- <span- data-document-mention="true"- data-document-id={props.entity.id}- data-block-name={props.blockName}- data-document-name={props.documentName}- >- <Show when={props.documentName} fallback={'Unknown'}>- {(name) => name().replaceAll('\n', ' ').trim()}- </Show>- <span class="relative text-[0.8em] text-current/50 rounded-md">- {(() => {- const accessories = mentionsAccessories(- props.blockName as BlockName,- props.blockParams- );- if (accessories) {- return (- <>- {` ${accessories.note ?? ''}`}- {getMentionsIcon(accessories.icon)}- </>- );- }- })()}- </span>- </span>+ <Show+ when={isSkill()}+ fallback={+ <MentionContainer+ icon={+ <EntityIcon targetType={props.blockName as any} size="fill" />+ }+ text={+ <span+ data-document-mention="true"+ data-document-id={props.entity.id}+ data-block-name={props.blockName}+ data-document-name={props.documentName}+ >+ <Show when={props.documentName} fallback={'Unknown'}>+ {(name) => name().replaceAll('\n', ' ').trim()}+ </Show>+ <span class="relative text-[0.8em] text-current/50 rounded-md">+ {(() => {+ const accessories = mentionsAccessories(+ props.blockName as BlockName,+ props.blockParams+ );+ if (accessories) {+ return (+ <>+ {` ${accessories.note ?? ''}`}+ {getMentionsIcon(accessories.icon)}+ </>+ );+ }+ })()}+ </span>+ </span>+ }+ collapsed={props.collapsed}+ />}- collapsed={props.collapsed}- />+ >+ <SkillSlashText+ documentId={props.entity.id}+ name={props.documentName ?? ''}+ collapsed={props.collapsed}+ />+ </Show></Match><Match when={matches(item(), isAccessiblePreviewItem)}>{(accessibleItem) => (- <MentionContainer- icon={- <ItemEntityIcon- size="fill"- theme={- accessibleItem().type !== 'channel' &&- props.theme?.['document-mention'] === 'chat-blue'- ? 'monochrome'- : undefined+ <Show+ when={isSkill()}+ fallback={+ <MentionContainer+ icon={+ <ItemEntityIcon+ size="fill"+ theme={+ accessibleItem().type !== 'channel' &&+ props.theme?.['document-mention'] === 'chat-blue'+ ? 'monochrome'+ : undefined+ }+ />+ }+ text={+ <span+ data-document-mention="true"+ data-document-id={accessibleItem().id}+ data-block-name={props.blockName}+ data-document-name={accessibleItem().name}+ >+ {accessibleItem().name.replaceAll('\n', ' ').trim()}+ <Show+ when={+ accessibleItem().type === 'call' &&+ accessibleItem().updatedAt+ }+ >+ {(timeStamp) => {+ return (+ <span class="text-current/50 text-[0.8em]">+ {` ${formatDate(timeStamp(), { showTime: true })}`}+ </span>+ );+ }}+ </Show>+ <span class="relative text-[0.8em] text-current/50 rounded-xs">+ {(() => {+ const accessories = mentionsAccessories(+ props.blockName as BlockName,+ props.blockParams+ );+ if (accessories) {+ return (+ <>+ {` ${accessories.note ?? ''}`}+ {getMentionsIcon(accessories.icon)}+ </>+ );+ }+ })()}+ </span>+ <Show when={props.blockName === 'task'}>+ <Suspense>+ <InlineTaskProperties taskId={accessibleItem().id} />+ </Suspense>+ </Show>+ </span>}+ collapsed={props.collapsed}/>}- text={- <span- data-document-mention="true"- data-document-id={accessibleItem().id}- data-block-name={props.blockName}- data-document-name={accessibleItem().name}- >- {accessibleItem().name.replaceAll('\n', ' ').trim()}- <Show- when={- accessibleItem().type === 'call' &&- accessibleItem().updatedAt- }- >- {(timeStamp) => {- return (- <span class="text-current/50 text-[0.8em]">- {` ${formatDate(timeStamp(), { showTime: true })}`}- </span>- );- }}- </Show>- <span class="relative text-[0.8em] text-current/50 rounded-xs">- {(() => {- const accessories = mentionsAccessories(- props.blockName as BlockName,- props.blockParams- );- if (accessories) {- return (- <>- {` ${accessories.note ?? ''}`}- {getMentionsIcon(accessories.icon)}- </>- );- }- })()}- </span>- <Show when={props.blockName === 'task'}>- <Suspense>- <InlineTaskProperties taskId={accessibleItem().id} />- </Suspense>- </Show>- </span>- }- collapsed={props.collapsed}- />+ >+ <SkillSlashText+ documentId={accessibleItem().id}+ name={accessibleItem().name}+ collapsed={props.collapsed}+ />+ </Show>)}</Match><Match when={(item() as PreviewItemNoAccess).access === 'no_access'}>@@ -320,15 +411,54 @@ export function DocumentMention(props: DocumentMentionDecoratorProps) {if (lexicalWrapper?.skipPreviewFetch) {return <DocumentMentionStatic {...props} />;}+ const systemSkills = useSystemSkillsQuery();+ return (+ <Switch>+ <Match when={systemSkills.getSystemSkill(props.documentId)}>+ {(skill) => <SystemSkillMention name={skill().name} {...props} />}+ </Match>+ {/* Until the (once-per-session) system skill list arrives, ids can't be+ classified — render from the stored name so a system skill never+ flashes the preview service's "Deleted" state. */}+ <Match when={systemSkills.query.isPending}>+ <DocumentMentionStatic {...props} />+ </Match>+ <Match when={true}>+ <Suspense>+ <DocumentMentionInner {...props} />+ </Suspense>+ </Match>+ </Switch>+ );+}++/**+ * Mention pill for a built-in system skill. System skills are static strings+ * in code, not documents, so there is nothing to preview-fetch and nothing to+ * open — the pill never navigates.+ */+function SystemSkillMention(+ props: DocumentMentionDecoratorProps & { name: string }+) {return (- <Suspense>- <DocumentMentionInner {...props} />- </Suspense>+ <SkillSlashText+ documentId={props.documentId}+ name={props.name}+ collapsed={props.collapsed}+ />);}/** Lightweight mention display that skips all backend fetches. Uses only the stored name. */function DocumentMentionStatic(props: DocumentMentionDecoratorProps) {+ if (props.blockName === 'skill') {+ return (+ <SkillSlashText+ documentId={props.documentId}+ name={props.documentName ?? ''}+ />+ );+ }return (<MentionContainericon={<EntityIcon targetType={props.blockName as any} size="fill" />}diff --git a/apps/web/src/lib/core/component/LexicalMarkdown/component/menu/MentionsMenu/utils/entityUtils.ts b/apps/web/src/lib/core/component/LexicalMarkdown/component/menu/MentionsMenu/utils/entityUtils.tsindex 0b0802c46d..569961f177 100644--- a/apps/web/src/lib/core/component/LexicalMarkdown/component/menu/MentionsMenu/utils/entityUtils.ts+++ b/apps/web/src/lib/core/component/LexicalMarkdown/component/menu/MentionsMenu/utils/entityUtils.ts@@ -18,6 +18,7 @@ export function getBlockNameFromEntity(.with('project', () => 'project' as const).with('task', () => 'task' as const).with('snippet', () => 'snippet' as const)+ .with('skill', () => 'skill' as const).with('note', () => 'md' as const).with('crm_company', () => 'company' as const).otherwise(() => {diff --git a/apps/web/src/lib/core/component/LexicalMarkdown/component/menu/SkillsMenu/SkillsMenu.tsx b/apps/web/src/lib/core/component/LexicalMarkdown/component/menu/SkillsMenu/SkillsMenu.tsxnew file mode 100644index 0000000000..3af3db574a--- /dev/null+++ b/apps/web/src/lib/core/component/LexicalMarkdown/component/menu/SkillsMenu/SkillsMenu.tsx@@ -0,0 +1,333 @@+import { useAnalytics } from '@app/lib/analytics/analytics-context';+import type {+ ComposeSkillProps,+ ComposeSkillSuccess,+} from '@block-md/component/ComposeSkill';+import { useSplitLayout } from '@components/app/split-layout/layout';+import { type PortalScope, ScopedPortal } from '@core/component/ScopedPortal';+import type { EntityItem } from '@core/context/quickAccess';+import { searchQuickAccessEntities } from '@core/context/quickAccess/entity-search';+import clickOutside from '@core/directive/clickOutside';+import { debouncedDependent } from '@core/util/debounce';+import { useIsKeyPressActive } from '@core/util/useIsKeyPressActive';+import PlusIcon from '@phosphor/plus.svg';+import { useSystemSkillsQuery } from '@queries/storage/system-skills';+import type { SystemSkillSummary } from '@service-storage/generated/schemas/systemSkillSummary';+import { cn, Surface } from '@ui';+import type { LexicalEditor } from 'lexical';+import {+ createEffect,+ createSignal,+ For,+ onCleanup,+ onMount,+ Show,+ Suspense,+ untrack,+} from 'solid-js';+import { floatWithSelection } from '../../../directive/floatWithSelection';+import { INSERT_DOCUMENT_MENTION_COMMAND } from '../../../plugins/mentions';+import {+ CLOSE_SKILL_SEARCH_COMMAND,+ REMOVE_SKILL_SEARCH_COMMAND,+} from '../../../plugins/skills';+import type { MenuOperations } from '../../../shared/inlineMenu';+import { MentionsMenuItem } from '../MentionsMenu/components/MentionsMenuItem';+import { useEntityMention } from '../MentionsMenu/hooks/useEntityMention';+import { useMenuKeyboardNavigation } from '../useMenuKeyboardNavigation';++false && clickOutside;+false && floatWithSelection;++// Height consumed by Surface's border + vertical padding+const PANEL_DECORATION_HEIGHT = 18;++/**+ * A built-in system skill as a menu item. System skills are static strings in+ * code, not documents, so they are appended to the quick-access list here+ * rather than flowing through the soup queries.+ */+function systemSkillItem(skill: SystemSkillSummary): EntityItem {+ return {+ kind: 'entity',+ id: skill.id,+ bucket: 'skill',+ searchText: skill.name.toLowerCase(),+ sortTimestamp: 0,+ timestamps: {},+ data: {+ id: skill.id,+ name: skill.name,+ ownerId: '',+ type: 'document',+ fileType: 'md',+ subType: { type: 'skill' },+ },+ };+}++type SkillsMenuProps = {+ editor: LexicalEditor;+ menu: MenuOperations;+ /** whether the menu checks against block boundary in floating middleware. uses floating-ui default if false. */+ useBlockBoundary?: boolean;+ portalScope?: PortalScope;+};++/**+ * Typeahead menu opened by typing `/` in an AI markdown area. Lists skill+ * documents the user can access; selecting one inserts a document mention+ * for the skill at the cursor, which the AI reads with its document tools.+ */+export function SkillsMenu(props: SkillsMenuProps) {+ return (+ <Suspense>+ <SkillsMenuInner {...props} />+ </Suspense>+ );+}++function SkillsMenuInner(props: SkillsMenuProps) {+ const analytics = useAnalytics();++ const searchTerm = debouncedDependent(props.menu.searchTerm, 60);+ const activeSearchTerm = () => (props.menu.isOpen() ? searchTerm() : '');++ const { entities: userSkills } = useEntityMention({+ buckets: ['skill'],+ searchTerm: activeSearchTerm,+ });++ const systemSkills = useSystemSkillsQuery();+ const systemSkillItems = () => systemSkills.skills().map(systemSkillItem);++ // User skills first, system skills at the bottom, both narrowed by the+ // active search term.+ const skills = () => [+ ...userSkills(),+ ...searchQuickAccessEntities(systemSkillItems(), activeSearchTerm()),+ ];++ const [selectedIndex, setSelectedIndex] = createSignal(0);+ const [mountSelection, setMountSelection] = createSignal<Selection | null>();+ const [escapeSpaceState, setEscapeSpaceState] = createSignal<+ 'start' | 'single' | null+ >('start');++ const { isKeypressActive } = useIsKeyPressActive();+ const setSelectedIndexFromMouse = (index: number) => {+ if (isKeypressActive()) return;+ setSelectedIndex(index);+ };++ const [menuOpen, setMenuOpen] = [props.menu.isOpen, props.menu.setIsOpen];++ createEffect(() => {+ if (menuOpen()) {+ setMountSelection(document.getSelection());+ setSelectedIndex(0);+ setEscapeSpaceState('start');+ } else {+ setMountSelection(null);+ }+ });++ createEffect(() => {+ searchTerm();+ setSelectedIndex(0);+ });++ // Selectable rows: every skill plus the trailing "New skill" row.+ const itemCount = () => skills().length + 1;++ createEffect(() => {+ if (selectedIndex() >= itemCount()) {+ setSelectedIndex(itemCount() - 1);+ }+ });++ const closeMenu = () => {+ props.editor.dispatchCommand(CLOSE_SKILL_SEARCH_COMMAND, undefined);+ setMenuOpen(false);+ };++ const insertSkill = (item: EntityItem) => {+ analytics.track('skills_menu_use', {});+ props.editor.dispatchCommand(REMOVE_SKILL_SEARCH_COMMAND, undefined);+ props.editor.dispatchCommand(INSERT_DOCUMENT_MENTION_COMMAND, {+ documentId: item.id,+ documentName: item.data.name ?? '',+ blockName: 'skill',+ });+ setMenuOpen(false);+ };++ const itemAction = (item: EntityItem) => {+ insertSkill(item);+ };++ const { popoverSplit } = useSplitLayout();++ /**+ * Opens the skill composer dialog; when the skill is created there, its+ * mention is inserted at the cursor so the AI picks it up.+ */+ const createNewSkill = () => {+ props.editor.dispatchCommand(REMOVE_SKILL_SEARCH_COMMAND, undefined);+ setMenuOpen(false);+ const onSuccess = ({ documentId, title }: ComposeSkillSuccess) => {+ props.editor.dispatchCommand(INSERT_DOCUMENT_MENTION_COMMAND, {+ documentId,+ documentName: title,+ blockName: 'skill',+ });+ };+ popoverSplit({+ type: 'component',+ id: 'skill-compose',+ params: { onSuccess } satisfies ComposeSkillProps,+ });+ };++ useMenuKeyboardNavigation({+ isActive: menuOpen,+ onUp: () => {+ setSelectedIndex((selectedIndex() - 1 + itemCount()) % itemCount());+ },+ onDown: () => {+ setSelectedIndex((selectedIndex() + 1) % itemCount());+ },+ onLeft: () => {+ // block horizontal arrows+ },+ onRight: () => {+ // block horizontal arrows+ },+ onSelect: () => {+ const selectedItem = skills()[selectedIndex()];+ if (selectedItem) {+ itemAction(selectedItem);+ } else {+ void createNewSkill();+ }+ },+ onClose: closeMenu,+ onSpace: () => {+ switch (escapeSpaceState()) {+ case 'single':+ case 'start':+ closeMenu();+ return true;+ case null:+ setEscapeSpaceState('single');+ return false;+ }+ return false;+ },+ onOtherKey: () => {+ setEscapeSpaceState(null);+ },+ });++ const focusOut = () => {+ closeMenu();+ };+ onMount(() => {+ document.addEventListener('focusout', focusOut);+ onCleanup(() => {+ document.removeEventListener('focusout', focusOut);+ });+ });++ const [menuAvailableHeight, setMenuAvailableHeight] = createSignal<+ number | undefined+ >(undefined);++ const contentMaxHeight = () => {+ const h = menuAvailableHeight();+ if (h === undefined) return 256;+ return Math.min(256, Math.max(0, h - PANEL_DECORATION_HEIGHT));+ };++ return (+ <Show when={menuOpen()}>+ <ScopedPortal scope={props.portalScope}>+ <div+ class="w-96 max-w-[calc(100cqw-1rem-2px)] cursor-default select-none z-modal-content menu-open-animation"+ use:floatWithSelection={{+ selection: untrack(mountSelection),+ reactiveOnContainer: props.editor.getRootElement(),+ useBlockBoundary: props.useBlockBoundary,+ onAvailableHeight: setMenuAvailableHeight,+ }}+ use:clickOutside={() => {+ closeMenu();+ }}+ on:touchstart={(e) => e.stopPropagation()}+ >+ <Surface+ depth={2}+ class="pt-2 pb-1.5 shadow-lg shadow-drop-shadow rounded-xl"+ >+ <div class="px-3.5 pb-1 text-xs font-medium text-ink-muted">+ Skills+ </div>+ <Show+ when={skills().length > 0}+ fallback={+ <div class="px-3.5 pb-1 text-ink-extra-muted">+ {searchTerm() ? 'No results' : 'No skills yet'}+ </div>+ }+ >+ <div+ class="overflow-y-auto scrollbar-hidden"+ style={{ 'max-height': `${contentMaxHeight()}px` }}+ >+ <For each={skills()}>+ {(item, index) => (+ <MentionsMenuItem+ item={item}+ index={index()}+ selected={index() === selectedIndex()}+ itemAction={() => itemAction(item)}+ setIndex={setSelectedIndexFromMouse}+ setOpen={setMenuOpen}+ />+ )}+ </For>+ </div>+ </Show>+ <div class="mt-1 pt-1 border-t border-edge">+ <div+ on:mouseup={(e) => {+ e.preventDefault();+ e.stopPropagation();+ }}+ on:mousedown={(e) => {+ e.preventDefault();+ e.stopPropagation();+ }}+ on:click={(e) => {+ void createNewSkill();+ e.stopPropagation();+ }}+ on:mousemove={() => setSelectedIndexFromMouse(skills().length)}+ class={cn('group flex items-center p-1.5 mx-1.5 rounded-md', {+ 'bg-ink/5': selectedIndex() === skills().length,+ })}+ >+ <div class="mr-2 flex items-center">+ <PlusIcon class="size-4 text-ink-muted" />+ </div>+ <span class="text-ink text-xs sm:text-sm font-medium">+ New skill+ </span>+ </div>+ </div>+ </Surface>+ </div>+ </ScopedPortal>+ </Show>+ );+}diff --git a/apps/web/src/lib/core/component/LexicalMarkdown/component/menu/SkillsMenu/index.ts b/apps/web/src/lib/core/component/LexicalMarkdown/component/menu/SkillsMenu/index.tsnew file mode 100644index 0000000000..9c71ff8ae3--- /dev/null+++ b/apps/web/src/lib/core/component/LexicalMarkdown/component/menu/SkillsMenu/index.ts@@ -0,0 +1 @@+export { SkillsMenu } from './SkillsMenu';diff --git a/apps/web/src/lib/core/component/LexicalMarkdown/plugins/index.ts b/apps/web/src/lib/core/component/LexicalMarkdown/plugins/index.tsindex c84401ad59..30ab5380f4 100644--- a/apps/web/src/lib/core/component/LexicalMarkdown/plugins/index.ts+++ b/apps/web/src/lib/core/component/LexicalMarkdown/plugins/index.ts@@ -36,6 +36,7 @@ export * from './popup';export * from './selection-data';export * from './shared';export * from './single-line';+export * from './skills';export * from './snippets';export * from './tab-indentation';export * from './tables';diff --git a/apps/web/src/lib/core/component/LexicalMarkdown/plugins/mentions/mentionsPlugin.ts b/apps/web/src/lib/core/component/LexicalMarkdown/plugins/mentions/mentionsPlugin.tsindex 54419ece49..84307b2e91 100644--- a/apps/web/src/lib/core/component/LexicalMarkdown/plugins/mentions/mentionsPlugin.ts+++ b/apps/web/src/lib/core/component/LexicalMarkdown/plugins/mentions/mentionsPlugin.ts@@ -137,7 +137,8 @@ export type ItemMention = {| 'group'| 'automation'| 'crm_company'- | 'crm_contact';+ | 'crm_contact'+ | 'skill';itemId: string;fileType?: string;documentName?: string;@@ -176,7 +177,12 @@ function $mentionItemFromNode(node: MentionNode): ItemMention {// task/snippet aliases are markdown documentselse if (blockName === 'task') fileType = 'md';else if (blockName === 'snippet') fileType = 'md';- else if (blockName === 'csv') fileType = 'csv';+ // skills are their own attachment type: either a markdown skill+ // document or a built-in system skill+ else if (blockName === 'skill') {+ fileType = 'md';+ itemType = 'skill';+ } else if (blockName === 'csv') fileType = 'csv';else if (blockName === 'canvas') fileType = 'canvas';else if (blockName === 'code') {const blockParams = node.getBlockParams();diff --git a/apps/web/src/lib/core/component/LexicalMarkdown/plugins/skills/index.ts b/apps/web/src/lib/core/component/LexicalMarkdown/plugins/skills/index.tsnew file mode 100644index 0000000000..11a9fcb09a--- /dev/null+++ b/apps/web/src/lib/core/component/LexicalMarkdown/plugins/skills/index.ts@@ -0,0 +1 @@+export * from './skillsPlugin';diff --git a/apps/web/src/lib/core/component/LexicalMarkdown/plugins/skills/skillsPlugin.ts b/apps/web/src/lib/core/component/LexicalMarkdown/plugins/skills/skillsPlugin.tsnew file mode 100644index 0000000000..7be6563aab--- /dev/null+++ b/apps/web/src/lib/core/component/LexicalMarkdown/plugins/skills/skillsPlugin.ts@@ -0,0 +1,144 @@+import { mergeRegister } from '@lexical/utils';+import type { PeerIdValidator } from '@macro-inc/lexical-core';+import {+ $collapseInlineSearch,+ $createInlineSearchNode,+ $handleInlineSearchNodeMutation,+ $handleInlineSearchNodeTransform,+ $removeInlineSearch,+ InlineSearchNode,+ InlineSearchNodesType,+ validTriggerPosition,+} from '@macro-inc/lexical-core';+import {+ $insertNodes,+ COMMAND_PRIORITY_CRITICAL,+ COMMAND_PRIORITY_HIGH,+ COMMAND_PRIORITY_LOW,+ createCommand,+ KEY_ENTER_COMMAND,+ KEY_ESCAPE_COMMAND,+ type LexicalCommand,+ type LexicalEditor,+} from 'lexical';+import type { MenuOperations } from '../../shared/inlineMenu';++const TYPE_SKILL_SYMBOL_COMMAND: LexicalCommand<void> = createCommand(+ 'SKILL_SYMBOL_COMMAND'+);++export const CLOSE_SKILL_SEARCH_COMMAND: LexicalCommand<void> = createCommand(+ 'CLOSE_SKILL_SEARCH_COMMAND'+);++export const REMOVE_SKILL_SEARCH_COMMAND: LexicalCommand<void> = createCommand(+ 'REMOVE_SKILL_SEARCH_COMMAND'+);++type SkillsPluginProps = {+ menu: MenuOperations;+ peerIdValidator?: PeerIdValidator;+};++// Validators for the position of the / trigger: start of line or after+// whitespace, matching the standard slash (actions) menu trigger.+const beforeRegex = /\s$/;+const afterRegex = /^\s/;++/**+ * Registers the `/` trigger for the skills menu in AI markdown areas. Typing+ * `/` at a valid trigger position (start of line or after whitespace) opens a+ * typeahead listing skill documents; selecting one inserts a document mention+ * for the skill at the cursor (see SkillsMenu).+ *+ * Skills share the `/` symbol with the standard markdown slash (actions)+ * menu, so this plugin must only be enabled in editors where the actions+ * menu is disabled — AI chat inputs.+ */+function registerSkillsPlugin(editor: LexicalEditor, props: SkillsPluginProps) {+ function registerSymbolListener() {+ const listener = (e: KeyboardEvent) => {+ if (e.key === '/') {+ editor.dispatchCommand(TYPE_SKILL_SYMBOL_COMMAND, undefined);+ }+ };++ return editor.registerRootListener((root, prev) => {+ if (root) {+ root.addEventListener('keydown', listener);+ }+ if (prev) {+ prev.removeEventListener('keydown', listener);+ }+ });+ }++ const { menu } = props;++ function typeSymbolCommand() {+ const shouldTrigger = validTriggerPosition(editor, beforeRegex, afterRegex);+ if (shouldTrigger) {+ editor.update(() => {+ $insertNodes([$createInlineSearchNode('/')]);+ });+ return true;+ }+ return false;+ }++ return mergeRegister(+ registerSymbolListener(),+ // When you type /+ editor.registerCommand(+ TYPE_SKILL_SYMBOL_COMMAND,+ typeSymbolCommand,+ COMMAND_PRIORITY_LOW+ ),+ editor.registerCommand(+ CLOSE_SKILL_SEARCH_COMMAND,+ () => $collapseInlineSearch(props.peerIdValidator),+ COMMAND_PRIORITY_LOW+ ),+ editor.registerCommand(+ KEY_ESCAPE_COMMAND,+ () => $collapseInlineSearch(props.peerIdValidator),+ COMMAND_PRIORITY_HIGH+ ),+ editor.registerCommand(+ REMOVE_SKILL_SEARCH_COMMAND,+ () => $removeInlineSearch(props.peerIdValidator),+ COMMAND_PRIORITY_HIGH+ ),+ // Menu ENTERS should not propagate to the editor.+ editor.registerCommand(+ KEY_ENTER_COMMAND,+ () => menu.isOpen(),+ COMMAND_PRIORITY_CRITICAL+ ),+ editor.registerNodeTransform(InlineSearchNode, (node: InlineSearchNode) =>+ $handleInlineSearchNodeTransform(node, InlineSearchNodesType.Actions)+ ),+ editor.registerMutationListener(+ InlineSearchNode,+ (mutatedNodes, { prevEditorState }) =>+ $handleInlineSearchNodeMutation(+ editor,+ prevEditorState,+ mutatedNodes,+ InlineSearchNodesType.Actions,+ {+ onDestroy: () => menu.closeMenu(),+ onCreate: () => menu.openMenu(),+ onUpdate: (search) => {+ menu.setSearchTerm(search);+ },+ },+ props.peerIdValidator+ )+ )+ );+}++export function skillsPlugin(props: SkillsPluginProps) {+ return (editor: LexicalEditor) => registerSkillsPlugin(editor, props);+}diff --git a/apps/web/src/lib/core/context/quickAccess/QuickAccessSource.tsx b/apps/web/src/lib/core/context/quickAccess/QuickAccessSource.tsxindex de6daf574b..a634fa94c5 100644--- a/apps/web/src/lib/core/context/quickAccess/QuickAccessSource.tsx+++ b/apps/web/src/lib/core/context/quickAccess/QuickAccessSource.tsx@@ -7,10 +7,16 @@ import {useIsConnectedSecondaryInbox,} from '@core/user';import type { DateValue } from '@core/util/date';-import type { ChannelEntity, CrmCompanyEntity, SnippetEntity } from '@entity';+import type {+ ChannelEntity,+ CrmCompanyEntity,+ SkillEntity,+ SnippetEntity,+} from '@entity';import { queryReadyGate } from '@queries/gate';import { type HistoryItem, useHistoryQuery } from '@queries/history/history';import { useQuickAccessCrmCompaniesQuery } from '@queries/soup/quick-access-crm-companies';+import { useQuickAccessSkillsQuery } from '@queries/soup/quick-access-skills';import { useQuickAccessSnippetsQuery } from '@queries/soup/quick-access-snippets';import { useRecentlyViewedSoupQuery } from '@queries/soup/recently-viewed';import { useInstructionsMdIdQuery } from '@queries/storage/instructions-md';@@ -129,6 +135,7 @@ function getBucketForHistoryItem(item: HistoryItem): EntityBucket {case 'document': {if (item.subType?.type === 'task') return 'task';if (item.subType?.type === 'snippet') return 'snippet';+ if (item.subType?.type === 'skill') return 'skill';if (item.fileType === 'md') return 'note';return 'document';}@@ -184,6 +191,10 @@ function getSnippetVersion(snippet: SnippetEntity, viewedAt?: string): string {return `${snippet.name}|${snippet.updatedAt}|${viewedAt}`;}+function getSkillVersion(skill: SkillEntity, viewedAt?: string): string {+ return `${skill.name}|${skill.updatedAt}|${viewedAt}`;+}+/*** Merge two *already* sorted index arrays into a single sorted array.*/@@ -236,6 +247,8 @@ export function createQuickAccessValue(): QuickAccessContextValue {useQuickAccessCrmCompaniesQuery();const { query: snippetsQuery, snippets: snippetsAccessor } =useQuickAccessSnippetsQuery();+ const { query: skillsQuery, skills: skillsAccessor } =+ useQuickAccessSkillsQuery();// globally hidden idsconst [hiddenIds, setHiddenIds] = createSignal<Set<string>>(new Set());@@ -578,6 +591,68 @@ export function createQuickAccessValue(): QuickAccessContextValue {}}+ // Process skills (live soup list, complements the history feed which+ // only has skills the user has opened). Widens the pool to shared+ // skills so the `/` menu lists skills the user has never opened.+ // History-fed entries win for skills the user has already opened.+ const skillData = skillsAccessor();+ for (const skill of skillData) {+ if (hidden.has(skill.id)) continue;+ if (seenIds.has(skill.id)) continue;+ seenIds.add(skill.id);++ const viewedAt = viewedAtMap.get(skill.id) ?? skill.viewedAt ?? undefined;++ const version = getSkillVersion(skill, viewedAt as string | undefined);+ const cached = itemCache.get(skill.id);++ if (!cached || cached.version !== version) {+ const reason = !cached+ ? 'new'+ : `changed (${cached.version} -> ${version})`;+ transformedItems.push({+ id: skill.id,+ name: skill.name,+ type: 'skill',+ reason,+ });+ const entity: SkillEntity = {+ ...skill,+ viewedAt: (viewedAt ?? skill.viewedAt) as DateValue | null,+ };+ const viewedAtMs = toTimestamp(viewedAt);+ const updatedAtMs = toTimestamp(skill.updatedAt);+ const sortTimestamp = viewedAtMs || updatedAtMs;++ const quickAccessItem: QuickAccessItem = {+ kind: 'entity',+ id: skill.id,+ bucket: 'skill',+ searchText: getEntitySearchText(entity),+ sortTimestamp,+ timestamps: {+ viewedAt,+ updatedAt: skill.updatedAt,+ createdAt: skill.createdAt,+ },+ data: entity,+ };++ itemCache.set(skill.id, { item: quickAccessItem, version });+ allEntries.push({+ id: skill.id,+ bucket: 'skill',+ sortTimestamp,+ });+ } else {+ allEntries.push({+ id: skill.id,+ bucket: cached.item.bucket,+ sortTimestamp: cached.item.sortTimestamp,+ });+ }+ }+// Clean up stale cache entries (items that no longer exist)for (const id of itemCache.keys()) {if (!seenIds.has(id)) {@@ -645,6 +720,7 @@ export function createQuickAccessValue(): QuickAccessContextValue {indices.get('note') ?? [],indices.get('task') ?? [],indices.get('snippet') ?? [],+ indices.get('skill') ?? [],indices.get('chat') ?? [],indices.get('project') ?? [],]),@@ -725,6 +801,7 @@ export function createQuickAccessValue(): QuickAccessContextValue {historyQuery.refetch();crmCompaniesQuery.refetch();snippetsQuery.refetch();+ skillsQuery.refetch();};return {diff --git a/apps/web/src/lib/core/context/quickAccess/types.ts b/apps/web/src/lib/core/context/quickAccess/types.tsindex 74c140f93c..167d7bc61c 100644--- a/apps/web/src/lib/core/context/quickAccess/types.ts+++ b/apps/web/src/lib/core/context/quickAccess/types.ts@@ -8,6 +8,7 @@ import type {EmailEntity,EntityData,ProjectEntity,+ SkillEntity,SnippetEntity,TaskEntity,} from '@entity';@@ -24,6 +25,7 @@ export type Bucket =| 'document'| 'task'| 'snippet'+ | 'skill'| 'note'| 'chat'| 'project'@@ -39,6 +41,7 @@ const ALL_BUCKETS: Bucket[] = ['document','task','snippet',+ 'skill','note','chat','project',@@ -51,7 +54,15 @@ export type BucketCombination = 'all' | 'channels' | 'documents';export const BUCKET_COMBINATIONS: Record<BucketCombination, Bucket[]> = {all: ALL_BUCKETS,channels: ['dm', 'channel'],- documents: ['document', 'note', 'task', 'snippet', 'chat', 'project'],+ documents: [+ 'document',+ 'note',+ 'task',+ 'snippet',+ 'skill',+ 'chat',+ 'project',+ ],};type ItemTimestamps = {@@ -114,6 +125,7 @@ export type BucketItemMap = {document: EntityItem<DocumentEntity>;task: EntityItem<TaskEntity>;snippet: EntityItem<SnippetEntity>;+ skill: EntityItem<SkillEntity>;note: EntityItem<DocumentEntity>;chat: EntityItem<ChatEntity>;project: EntityItem<ProjectEntity>;diff --git a/apps/web/src/lib/core/util/create.ts b/apps/web/src/lib/core/util/create.tsindex 1c0cfa311f..280060dd4c 100644--- a/apps/web/src/lib/core/util/create.ts+++ b/apps/web/src/lib/core/util/create.ts@@ -209,6 +209,54 @@ export async function createSnippet(return documentId;}+type CreateSkillArgs = {+ title?: string;+ content?: string;+ projectId?: string;+ /** UI surface the creation originated from, for analytics. */+ source?: string;+};++/**+ * Creates a skill using the create_skill endpoint.+ * Content is initialized via sync service. Skills are markdown documents+ * containing instructions that AI reads and follows when the skill is+ * referenced in an AI input.+ */+export async function createSkill(+ args?: CreateSkillArgs+): Promise<string | undefined> {+ const result = await storageServiceClient.createSkill({+ skillName: args?.title ?? '',+ markdown: args?.content ?? '',+ projectId: args?.projectId,+ });++ invalidateUserQuota();++ if (result.isErr()) return;++ const { documentId } = result.value;++ setPreviewOnCreate({+ itemId: documentId,+ itemType: 'document',+ name: args?.title ?? '',+ fileType: 'md',+ subType: { type: 'skill' },+ });+ refetchSoupEntity(documentId, 'document');++ analytics.track('create_entity', {+ entityType: 'skill',+ entityId: documentId,+ projectId: args?.projectId,+ source: args?.source,+ });++ return documentId;+}+export async function createCodeFileFromText({code,extension,diff --git a/apps/web/src/lib/queries/history/graphql.ts b/apps/web/src/lib/queries/history/graphql.tsindex 3195a9fb84..c22e5253f2 100644--- a/apps/web/src/lib/queries/history/graphql.ts+++ b/apps/web/src/lib/queries/history/graphql.ts@@ -36,6 +36,8 @@ function transformDocumentSubType(};case 'GraphqlSnippetSubType':return { type: 'snippet' };+ case 'GraphqlSkillSubType':+ return { type: 'skill' };}}diff --git a/apps/web/src/lib/queries/notification/user-notifications.ts b/apps/web/src/lib/queries/notification/user-notifications.tsindex 274bf1e641..fd67648bd5 100644--- a/apps/web/src/lib/queries/notification/user-notifications.ts+++ b/apps/web/src/lib/queries/notification/user-notifications.ts@@ -872,7 +872,8 @@ function notificationEntityTypeToSoupTag('static_file','crm_company','crm_contact',- 'calendar_event'+ 'calendar_event',+ 'skill'),() => null)diff --git a/apps/web/src/lib/queries/preview/preview.ts b/apps/web/src/lib/queries/preview/preview.tsindex c164f34993..fade33cf14 100644--- a/apps/web/src/lib/queries/preview/preview.ts+++ b/apps/web/src/lib/queries/preview/preview.ts@@ -263,7 +263,7 @@ export function setPreviewOnCreate({itemType: ItemType;name?: string;fileType?: string;- subType?: { type: 'task' | 'snippet'; is_completed?: boolean };+ subType?: { type: 'task' | 'snippet' | 'skill'; is_completed?: boolean };}) {const defaultPreviewItem: AccessiblePreviewItem = {id: itemId,diff --git a/apps/web/src/lib/queries/soup/quick-access-skills.ts b/apps/web/src/lib/queries/soup/quick-access-skills.tsnew file mode 100644index 0000000000..5191fe1212--- /dev/null+++ b/apps/web/src/lib/queries/soup/quick-access-skills.ts@@ -0,0 +1,41 @@+import { QUERY_FILTERS_BASE } from '@app/features/next-soup/filters/query-filters';+import { isSkillEntity, type SkillEntity } from '@entity';+import { useSoupItemsQuery } from '@queries/soup/items';+import { createMemo } from 'solid-js';++const QUICK_ACCESS_SKILLS_LIMIT = 500;+const STALE_TIME = 5 * 60 * 1000;++/**+ * Quick Access feed of all skills the user can access — their own plus+ * shared ones.+ *+ * This is the parallel live source feeding the `'skill'` bucket — the+ * recently-viewed history feed only covers skills the user has opened,+ * this one widens the pool so the `/` menu lists shared skills the user has+ * never opened.+ *+ * Every other entity type is filtered out by extending `QUERY_FILTERS_BASE`;+ * documents are narrowed to the skill sub type.+ */+export function useQuickAccessSkillsQuery() {+ const query = useSoupItemsQuery(+ () => ({+ params: {+ limit: QUICK_ACCESS_SKILLS_LIMIT,+ sort_method: 'viewed_updated',+ },+ body: {+ ...QUERY_FILTERS_BASE,+ document_filters: { sub_types: ['skill'] },+ },+ }),+ () => ({ staleTime: STALE_TIME })+ );++ const skills = createMemo<SkillEntity[]>(+ () => query.data?.filter(isSkillEntity) ?? []+ );++ return { query, skills };+}diff --git a/apps/web/src/lib/queries/soup/transform-utils.ts b/apps/web/src/lib/queries/soup/transform-utils.tsindex bd7272f957..66762795e2 100644--- a/apps/web/src/lib/queries/soup/transform-utils.ts+++ b/apps/web/src/lib/queries/soup/transform-utils.ts@@ -387,7 +387,9 @@ export const useSearchResponseItemMapper = () => {? { type: 'task' }: result.sub_type === 'snippet'? { type: 'snippet' }- : null,+ : result.sub_type === 'skill'+ ? { type: 'skill' }+ : null,id: result.document_id,name: formatDisplayName(result.name || blockNameToDefaultFile(result.file_type),diff --git a/apps/web/src/lib/queries/storage/system-skills.ts b/apps/web/src/lib/queries/storage/system-skills.tsnew file mode 100644index 0000000000..9551b2977d--- /dev/null+++ b/apps/web/src/lib/queries/storage/system-skills.ts@@ -0,0 +1,43 @@+import { storageServiceClient } from '@service-storage/client';+import type { SystemSkillSummary } from '@service-storage/generated/schemas/systemSkillSummary';+import { useQuery } from '@tanstack/solid-query';+import { createMemo } from 'solid-js';++const SYSTEM_SKILLS_QUERY_KEY = ['storage', 'system-skills'] as const;++/**+ * Built-in system skills served by the storage service. System skills are+ * static, code-defined AI instructions (crates/system_skills) with well-known+ * ids: they surface in the skills menu and skill mentions like user skills,+ * but have no document behind them and must never be opened as documents.+ *+ * The list is fixed per deploy, so it is fetched once and cached forever.+ */+export function useSystemSkillsQuery() {+ const query = useQuery(() => ({+ queryKey: SYSTEM_SKILLS_QUERY_KEY,+ queryFn: async () => {+ const result = await storageServiceClient.getSystemSkills();+ if (result.isErr()) {+ throw new Error('Failed to fetch system skills');+ }+ return result.value.skills;+ },+ staleTime: Number.POSITIVE_INFINITY,+ refetchOnWindowFocus: false,+ }));++ const skills = createMemo<SystemSkillSummary[]>(() => query.data ?? []);+ const byId = createMemo(+ () => new Map(skills().map((skill) => [skill.id, skill]))+ );++ return {+ query,+ skills,+ /** Look up a system skill; undefined while loading or for other ids. */+ getSystemSkill: (id: string) => byId().get(id),+ /** Whether `id` belongs to a (loaded) system skill. */+ isSystemSkillId: (id: string) => byId().has(id),+ };+}diff --git a/apps/web/src/lib/service-clients/service-cognition/generated/schemas/attachmentType.ts b/apps/web/src/lib/service-clients/service-cognition/generated/schemas/attachmentType.tsindex 8d93d71d5a..bc3cf11d7b 100644--- a/apps/web/src/lib/service-clients/service-cognition/generated/schemas/attachmentType.ts+++ b/apps/web/src/lib/service-clients/service-cognition/generated/schemas/attachmentType.ts@@ -15,4 +15,5 @@ export const AttachmentType = {channel: 'channel',email: 'email',project: 'project',+ skill: 'skill',} as const;diff --git a/apps/web/src/lib/service-clients/service-cognition/generated/schemas/entityType.ts b/apps/web/src/lib/service-clients/service-cognition/generated/schemas/entityType.tsindex 9557256b10..127383b6f8 100644--- a/apps/web/src/lib/service-clients/service-cognition/generated/schemas/entityType.ts+++ b/apps/web/src/lib/service-clients/service-cognition/generated/schemas/entityType.ts@@ -27,4 +27,5 @@ export const EntityType = {crm_company: 'crm_company',crm_contact: 'crm_contact',reminder: 'reminder',+ skill: 'skill',} as const;diff --git a/apps/web/src/lib/service-clients/service-cognition/generated/tools/schemas.ts b/apps/web/src/lib/service-clients/service-cognition/generated/tools/schemas.tsindex 80a5e4409a..92029eace7 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@@ -282,7 +282,11 @@ export const SearchToolResponse = z.object({sub_type: z.union([z.any().superRefine((x, ctx) => {- const schemas = [z.literal('task'), z.literal('snippet')];+ const schemas = [+ z.literal('task'),+ z.literal('snippet'),+ z.literal('skill'),+ ];const errors = schemas.reduce<z.ZodError[]>((errors, schema) =>((result) =>@@ -1745,6 +1749,20 @@ export const ListNotificationsResponse = z.object({),});+export const ListSkills = z.record(z.any());++export const ListSkillsResponse = z.object({+ results: z.array(+ z.object({+ documentId: z.string().uuid(),+ name: z.string(),+ updatedAt: z+ .union([z.string().datetime({ offset: true }), z.null()])+ .optional(),+ })+ ),+});+export const ListTags = z.record(z.any());export const ListTagsResponse = z.object({@@ -2962,7 +2980,11 @@ export const ReadMetadataResponse = z.object({subType: z.union([z.any().superRefine((x, ctx) => {- const schemas = [z.literal('task'), z.literal('snippet')];+ const schemas = [+ z.literal('task'),+ z.literal('snippet'),+ z.literal('skill'),+ ];const errors = schemas.reduce<z.ZodError[]>((errors, schema) =>((result) => (result.error ? [...errors, result.error] : errors))(@@ -3042,6 +3064,43 @@ export const RenameDocumentResponse = z.object({success: z.boolean(),});+export const SearchSkills = z.object({+ matchType: z+ .any()+ .superRefine((x, ctx) => {+ const schemas = [z.literal('partial'), z.literal('exact')];+ const errors = schemas.reduce<z.ZodError[]>(+ (errors, schema) =>+ ((result) => (result.error ? [...errors, result.error] : errors))(+ schema.safeParse(x)+ ),+ []+ );+ if (schemas.length - errors.length !== 1) {+ ctx.addIssue({+ path: ctx.path,+ code: 'invalid_union',+ unionErrors: errors,+ message: 'Invalid input: Should pass single schema',+ });+ }+ })+ .optional(),+ name: z.string(),+});++export const SearchSkillsResponse = z.object({+ results: z.array(+ z.object({+ documentId: z.string().uuid(),+ name: z.string(),+ updatedAt: z+ .union([z.string().datetime({ offset: true }), z.null()])+ .optional(),+ })+ ),+});+export const SearchTools = z.object({ query: z.string() });export const SearchToolsResponse = z.object({diff --git a/apps/web/src/lib/service-clients/service-cognition/generated/tools/tool.ts b/apps/web/src/lib/service-clients/service-cognition/generated/tools/tool.tsindex eead264678..6c9b1be31f 100644--- a/apps/web/src/lib/service-clients/service-cognition/generated/tools/tool.ts+++ b/apps/web/src/lib/service-clients/service-cognition/generated/tools/tool.ts@@ -75,6 +75,7 @@ type ToolParserMap = {call: types.ListNotifications;response: types.ListNotificationsResponse;};+ ListSkills: { call: types.ListSkills; response: types.ListSkillsResponse };ListTags: { call: types.ListTags; response: types.ListTagsResponse };ListTeamMembers: {call: types.ListTeamMembers;@@ -122,6 +123,10 @@ type ToolParserMap = {call: types.RenameDocument;response: types.RenameDocumentResponse;};+ SearchSkills: {+ call: types.SearchSkills;+ response: types.SearchSkillsResponse;+ };SearchTools: { call: types.SearchTools; response: types.SearchToolsResponse };SelfKnowledge: {call: types.SelfKnowledge;@@ -226,6 +231,10 @@ const toolParserMap = {call: schemas.ListNotifications,response: schemas.ListNotificationsResponse,},+ ListSkills: {+ call: schemas.ListSkills,+ response: schemas.ListSkillsResponse,+ },ListTags: { call: schemas.ListTags, response: schemas.ListTagsResponse },ListTeamMembers: {call: schemas.ListTeamMembers,@@ -282,6 +291,10 @@ const toolParserMap = {call: schemas.RenameDocument,response: schemas.RenameDocumentResponse,},+ SearchSkills: {+ call: schemas.SearchSkills,+ response: schemas.SearchSkillsResponse,+ },SearchTools: {call: schemas.SearchTools,response: schemas.SearchToolsResponse,@@ -388,6 +401,7 @@ type ToolDataMap = {call: types.ListNotifications;response: types.ListNotificationsResponse;};+ ListSkills: { call: types.ListSkills; response: types.ListSkillsResponse };ListTags: { call: types.ListTags; response: types.ListTagsResponse };ListTeamMembers: {call: types.ListTeamMembers;@@ -435,6 +449,10 @@ type ToolDataMap = {call: types.RenameDocument;response: types.RenameDocumentResponse;};+ SearchSkills: {+ call: types.SearchSkills;+ response: types.SearchSkillsResponse;+ };SearchTools: { call: types.SearchTools; response: types.SearchToolsResponse };SelfKnowledge: {call: types.SelfKnowledge;diff --git a/apps/web/src/lib/service-clients/service-cognition/generated/tools/types.ts b/apps/web/src/lib/service-clients/service-cognition/generated/tools/types.tsindex a53599cd62..1df6d43d44 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@@ -178,7 +178,7 @@ export type DocumentContentState = 'unknown' | 'pending' | 'ready';* The document sub type enum represents all values of document sub types.* These values should match the `document_sub_type_value` table in macrodb.*/-export type DocumentSubType = 'task' | 'snippet';+export type DocumentSubType = 'task' | 'snippet' | 'skill';export type EmailPreset = 'signal';/*** Item returned by the list entities AI tool.@@ -231,7 +231,8 @@ export type EntityItem =*/name: string;/**- * The document's sub type: "task" for Macro tasks, "snippet" for snippets.+ * The document's sub type: "task" for Macro tasks, "snippet" for snippets,+ * "skill" for skills.*/subType?: string | null;/**@@ -450,6 +451,10 @@ export type SearchResult = {type: 'web_search_result';url: string;};+/**+ * How search terms are matched against skill names.+ */+export type SearchSkillsMatchType = 'partial' | 'exact';/*** A search result annotated with the caller-visible tags on the item.*/@@ -2114,7 +2119,7 @@ export interface ListEntities {[k: string]: unknown;};/**- * Full soup AST document filter (df). Use the same shape as /items/soup/ast, e.g. {"l":{"id":"..."}}. For Macro tasks, use {"l":{"dst":"task"}}. For "completed yesterday", AND the task subtype with updatedAt bounds, e.g. {"&":[{"l":{"dst":"task"}},{"&":[{"l":{"ua":{"gte":"<start>"}}},{"l":{"ua":{"lt":"<end>"}}}]}]} using ISO timestamps.+ * Full soup AST document filter (df). Use the same shape as /items/soup/ast, e.g. {"l":{"id":"..."}}. For Macro tasks, use {"l":{"dst":"task"}}; for skills, {"l":{"dst":"skill"}}. For "completed yesterday", AND the task subtype with updatedAt bounds, e.g. {"&":[{"l":{"dst":"task"}},{"&":[{"l":{"ua":{"gte":"<start>"}}},{"l":{"ua":{"lt":"<end>"}}}]}]} using ISO timestamps.*/df?: {[k: string]: unknown;@@ -2398,6 +2403,37 @@ export interface NotificationItem {*/senderId?: string | null;}+/**+ * List the skills the user can access, most recently updated first. Skills are markdown documents containing instructions for AI to read and follow; after finding a relevant skill, read its instructions with ReadContent using the returned document id. Use this to discover what skills exist; when looking for a specific skill by name, prefer SearchSkills.+ */+export type ListSkills = {};+/**+ * Response for a skill listing.+ */+export interface ListSkillsResponse {+ /**+ * The user's skills, most recently updated first.+ */+ results: SkillSearchResult[];+}+/**+ * A skill matched by a skill search.+ */+export interface SkillSearchResult {+ /**+ * The document id of the skill. Read the skill's instructions with+ * ReadContent using this id.+ */+ documentId: string;+ /**+ * The name of the skill.+ */+ name: string;+ /**+ * When the skill was last updated, when known.+ */+ updatedAt?: string | null;+}/*** List the tags available to the user: their personal tag set plus their team's set when they belong to a team. Each tag has a human-readable label, an option id, and optionally a color. Refer to tags by label when talking to the user. To filter items by tag, pass the labels to the tags argument of ListEntities, ContentSearch, or NameSearch. To apply or remove a tag on an entity, call SetEntityProperty with the set's propertyDefinitionId and the tag's option id in add_option_ids or remove_option_ids — never rewrite the full value to add or remove one tag. Call this before tag operations when you don't already know the user's tags.*/@@ -3455,6 +3491,25 @@ export interface RenameDocumentResponse {*/success: boolean;}+/**+ * Search the user's skills by name. Skills are markdown documents containing instructions for AI to read and follow; when the user references a skill (or a request matches one), find it with this tool and then read its instructions with ReadContent using the returned document id. This is keyword search against skill names: pass 1-3 targeted keywords that would literally appear in the skill's name, not a natural-language description. Matching defaults to prefix; set matchType to 'exact' for whole-token matching. Only skills the user can access are returned, most recently updated first.+ */+export interface SearchSkills {+ matchType?: SearchSkillsMatchType;+ /**+ * The skill name to search. Pass 1-3 keywords drawn from words that would literally appear in the skill's name. The whole query is matched as a single adjacent phrase prefix, so long phrases will not match.+ */+ name: string;+}+/**+ * Response for a skill search.+ */+export interface SearchSkillsResponse {+ /**+ * The matched skills, most recently updated first.+ */+ results: SkillSearchResult[];+}export interface SearchToolResponse {results: TaggedSearchResult[];}diff --git a/apps/web/src/lib/service-clients/service-cognition/openapi.json b/apps/web/src/lib/service-clients/service-cognition/openapi.jsonindex 917b516d35..fa427b660d 100644--- a/apps/web/src/lib/service-clients/service-cognition/openapi.json+++ b/apps/web/src/lib/service-clients/service-cognition/openapi.json@@ -2009,7 +2009,7 @@},"AttachmentType": {"type": "string",- "enum": ["document", "image", "channel", "email", "project"]+ "enum": ["document", "image", "channel", "email", "project", "skill"]},"CallToolRequest": {"type": "object",@@ -2627,7 +2627,8 @@"static_file","crm_company","crm_contact",- "reminder"+ "reminder",+ "skill"]},"ErrorBody": {diff --git a/apps/web/src/lib/service-clients/service-connection/generated/schemas/entityType.ts b/apps/web/src/lib/service-clients/service-connection/generated/schemas/entityType.tsindex 8c089fb361..d34cb8e0a9 100644--- a/apps/web/src/lib/service-clients/service-connection/generated/schemas/entityType.ts+++ b/apps/web/src/lib/service-clients/service-connection/generated/schemas/entityType.ts@@ -27,4 +27,5 @@ export const EntityType = {crm_company: 'crm_company',crm_contact: 'crm_contact',reminder: 'reminder',+ skill: 'skill',} as const;diff --git a/apps/web/src/lib/service-clients/service-connection/openapi.json b/apps/web/src/lib/service-clients/service-connection/openapi.jsonindex aef453ef56..6eed27ced6 100644--- a/apps/web/src/lib/service-clients/service-connection/openapi.json+++ b/apps/web/src/lib/service-clients/service-connection/openapi.json@@ -259,7 +259,8 @@"static_file","crm_company","crm_contact",- "reminder"+ "reminder",+ "skill"]},"GenericErrorResponse": {diff --git a/apps/web/src/lib/service-clients/service-notification/generated/schemas/entityType.ts b/apps/web/src/lib/service-clients/service-notification/generated/schemas/entityType.tsindex 39669e2fa4..c906b5cfb1 100644--- a/apps/web/src/lib/service-clients/service-notification/generated/schemas/entityType.ts+++ b/apps/web/src/lib/service-clients/service-notification/generated/schemas/entityType.ts@@ -27,4 +27,5 @@ export const EntityType = {crm_company: 'crm_company',crm_contact: 'crm_contact',reminder: 'reminder',+ skill: 'skill',} as const;diff --git a/apps/web/src/lib/service-clients/service-notification/generated/schemas/index.ts b/apps/web/src/lib/service-clients/service-notification/generated/schemas/index.tsindex f338a9898e..98d6811363 100644--- a/apps/web/src/lib/service-clients/service-notification/generated/schemas/index.ts+++ b/apps/web/src/lib/service-clients/service-notification/generated/schemas/index.ts@@ -159,6 +159,8 @@ export * from './notifEventOneOfTwothreeTag';export * from './notificationBulkRequest';export * from './notificationDocumentSubType';export * from './notificationDocumentSubTypeOneOf';+export * from './notificationDocumentSubTypeOneOfFive';+export * from './notificationDocumentSubTypeOneOfFiveType';export * from './notificationDocumentSubTypeOneOfThree';export * from './notificationDocumentSubTypeOneOfThreeType';export * from './notificationDocumentSubTypeOneOfType';diff --git a/apps/web/src/lib/service-clients/service-notification/generated/schemas/notificationDocumentSubType.ts b/apps/web/src/lib/service-clients/service-notification/generated/schemas/notificationDocumentSubType.tsindex 23388dd27d..ef44e2a299 100644--- a/apps/web/src/lib/service-clients/service-notification/generated/schemas/notificationDocumentSubType.ts+++ b/apps/web/src/lib/service-clients/service-notification/generated/schemas/notificationDocumentSubType.ts@@ -5,6 +5,7 @@* OpenAPI spec version: 0.1.0*/import type { NotificationDocumentSubTypeOneOf } from './notificationDocumentSubTypeOneOf';+import type { NotificationDocumentSubTypeOneOfFive } from './notificationDocumentSubTypeOneOfFive';import type { NotificationDocumentSubTypeOneOfThree } from './notificationDocumentSubTypeOneOfThree';/**@@ -13,4 +14,5 @@ Serializes as `{ "type": "task" }` matching the storage service pattern.*/export type NotificationDocumentSubType =| NotificationDocumentSubTypeOneOf- | NotificationDocumentSubTypeOneOfThree;+ | NotificationDocumentSubTypeOneOfThree+ | NotificationDocumentSubTypeOneOfFive;diff --git a/apps/web/src/lib/service-clients/service-notification/generated/schemas/notificationDocumentSubTypeOneOfFive.ts b/apps/web/src/lib/service-clients/service-notification/generated/schemas/notificationDocumentSubTypeOneOfFive.tsnew file mode 100644index 0000000000..efd29eac84--- /dev/null+++ b/apps/web/src/lib/service-clients/service-notification/generated/schemas/notificationDocumentSubTypeOneOfFive.ts@@ -0,0 +1,11 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * notification_service+ * OpenAPI spec version: 0.1.0+ */+import type { NotificationDocumentSubTypeOneOfFiveType } from './notificationDocumentSubTypeOneOfFiveType';++export type NotificationDocumentSubTypeOneOfFive = {+ type: NotificationDocumentSubTypeOneOfFiveType;+};diff --git a/apps/web/src/lib/service-clients/service-notification/generated/schemas/notificationDocumentSubTypeOneOfFiveType.ts b/apps/web/src/lib/service-clients/service-notification/generated/schemas/notificationDocumentSubTypeOneOfFiveType.tsnew file mode 100644index 0000000000..c723761b5e--- /dev/null+++ b/apps/web/src/lib/service-clients/service-notification/generated/schemas/notificationDocumentSubTypeOneOfFiveType.ts@@ -0,0 +1,14 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * notification_service+ * OpenAPI spec version: 0.1.0+ */++export type NotificationDocumentSubTypeOneOfFiveType =+ (typeof NotificationDocumentSubTypeOneOfFiveType)[keyof typeof NotificationDocumentSubTypeOneOfFiveType];++// eslint-disable-next-line @typescript-eslint/no-redeclare+export const NotificationDocumentSubTypeOneOfFiveType = {+ skill: 'skill',+} as const;diff --git a/apps/web/src/lib/service-clients/service-notification/generated/zod.ts b/apps/web/src/lib/service-clients/service-notification/generated/zod.tsindex bd7311a28f..3980f88996 100644--- a/apps/web/src/lib/service-clients/service-notification/generated/zod.ts+++ b/apps/web/src/lib/service-clients/service-notification/generated/zod.ts@@ -143,6 +143,7 @@ export const listTypedNotificationsResponse = zod'crm_company','crm_contact','reminder',+ 'skill',]).describe('The type of an entity in Macro'),})@@ -267,6 +268,9 @@ export const listTypedNotificationsResponse = zodzod.object({type: zod.enum(['snippet']),}),+ zod.object({+ type: zod.enum(['skill']),+ }),]).describe('The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'@@ -307,6 +311,9 @@ export const listTypedNotificationsResponse = zodzod.object({type: zod.enum(['snippet']),}),+ zod.object({+ type: zod.enum(['skill']),+ }),]).describe('The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'@@ -351,6 +358,9 @@ export const listTypedNotificationsResponse = zodzod.object({type: zod.enum(['snippet']),}),+ zod.object({+ type: zod.enum(['skill']),+ }),]).describe('The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'@@ -397,6 +407,9 @@ export const listTypedNotificationsResponse = zodzod.object({type: zod.enum(['snippet']),}),+ zod.object({+ type: zod.enum(['skill']),+ }),]).describe('The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'@@ -647,6 +660,9 @@ export const listTypedNotificationsResponse = zodzod.object({type: zod.enum(['snippet']),}),+ zod.object({+ type: zod.enum(['skill']),+ }),]).describe('The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'@@ -1427,6 +1443,7 @@ export const bulkGetTypedNotificationsByEventItemIdsResponse = zod'crm_company','crm_contact','reminder',+ 'skill',]).describe('The type of an entity in Macro'),})@@ -1551,6 +1568,9 @@ export const bulkGetTypedNotificationsByEventItemIdsResponse = zodzod.object({type: zod.enum(['snippet']),}),+ zod.object({+ type: zod.enum(['skill']),+ }),]).describe('The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'@@ -1591,6 +1611,9 @@ export const bulkGetTypedNotificationsByEventItemIdsResponse = zodzod.object({type: zod.enum(['snippet']),}),+ zod.object({+ type: zod.enum(['skill']),+ }),]).describe('The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'@@ -1635,6 +1658,9 @@ export const bulkGetTypedNotificationsByEventItemIdsResponse = zodzod.object({type: zod.enum(['snippet']),}),+ zod.object({+ type: zod.enum(['skill']),+ }),]).describe('The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'@@ -1681,6 +1707,9 @@ export const bulkGetTypedNotificationsByEventItemIdsResponse = zodzod.object({type: zod.enum(['snippet']),}),+ zod.object({+ type: zod.enum(['skill']),+ }),]).describe('The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'@@ -1931,6 +1960,9 @@ export const bulkGetTypedNotificationsByEventItemIdsResponse = zodzod.object({type: zod.enum(['snippet']),}),+ zod.object({+ type: zod.enum(['skill']),+ }),]).describe('The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'@@ -2705,6 +2737,7 @@ export const getTypedNotificationsByEventItemIdResponse = zod'crm_company','crm_contact','reminder',+ 'skill',]).describe('The type of an entity in Macro'),})@@ -2829,6 +2862,9 @@ export const getTypedNotificationsByEventItemIdResponse = zodzod.object({type: zod.enum(['snippet']),}),+ zod.object({+ type: zod.enum(['skill']),+ }),]).describe('The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'@@ -2869,6 +2905,9 @@ export const getTypedNotificationsByEventItemIdResponse = zodzod.object({type: zod.enum(['snippet']),}),+ zod.object({+ type: zod.enum(['skill']),+ }),]).describe('The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'@@ -2913,6 +2952,9 @@ export const getTypedNotificationsByEventItemIdResponse = zodzod.object({type: zod.enum(['snippet']),}),+ zod.object({+ type: zod.enum(['skill']),+ }),]).describe('The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'@@ -2959,6 +3001,9 @@ export const getTypedNotificationsByEventItemIdResponse = zodzod.object({type: zod.enum(['snippet']),}),+ zod.object({+ type: zod.enum(['skill']),+ }),]).describe('The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'@@ -3209,6 +3254,9 @@ export const getTypedNotificationsByEventItemIdResponse = zodzod.object({type: zod.enum(['snippet']),}),+ zod.object({+ type: zod.enum(['skill']),+ }),]).describe('The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'@@ -3994,6 +4042,7 @@ export const getTypedNotificationByIdResponse = zod'crm_company','crm_contact','reminder',+ 'skill',]).describe('The type of an entity in Macro'),})@@ -4112,6 +4161,9 @@ export const getTypedNotificationByIdResponse = zodzod.object({type: zod.enum(['snippet']),}),+ zod.object({+ type: zod.enum(['skill']),+ }),]).describe('The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'@@ -4150,6 +4202,9 @@ export const getTypedNotificationByIdResponse = zodzod.object({type: zod.enum(['snippet']),}),+ zod.object({+ type: zod.enum(['skill']),+ }),]).describe('The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'@@ -4190,6 +4245,9 @@ export const getTypedNotificationByIdResponse = zodzod.object({type: zod.enum(['snippet']),}),+ zod.object({+ type: zod.enum(['skill']),+ }),]).describe('The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'@@ -4232,6 +4290,9 @@ export const getTypedNotificationByIdResponse = zodzod.object({type: zod.enum(['snippet']),}),+ zod.object({+ type: zod.enum(['skill']),+ }),]).describe('The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'@@ -4466,6 +4527,9 @@ export const getTypedNotificationByIdResponse = zodzod.object({type: zod.enum(['snippet']),}),+ zod.object({+ type: zod.enum(['skill']),+ }),]).describe('The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'diff --git a/apps/web/src/lib/service-clients/service-notification/openapi.json b/apps/web/src/lib/service-clients/service-notification/openapi.jsonindex 4fbfcda375..6827822e9c 100644--- a/apps/web/src/lib/service-clients/service-notification/openapi.json+++ b/apps/web/src/lib/service-clients/service-notification/openapi.json@@ -1505,7 +1505,8 @@"static_file","crm_company","crm_contact",- "reminder"+ "reminder",+ "skill"]},"ErrorResponse": {@@ -2381,6 +2382,16 @@"enum": ["snippet"]}}+ },+ {+ "type": "object",+ "required": ["type"],+ "properties": {+ "type": {+ "type": "string",+ "enum": ["skill"]+ }+ }}],"description": "The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern."diff --git a/apps/web/src/lib/service-clients/service-search/generated/models/documentSubType.ts b/apps/web/src/lib/service-clients/service-search/generated/models/documentSubType.tsindex 36c53bdd2a..833d9fda5e 100644--- a/apps/web/src/lib/service-clients/service-search/generated/models/documentSubType.ts+++ b/apps/web/src/lib/service-clients/service-search/generated/models/documentSubType.ts@@ -16,4 +16,5 @@ export type DocumentSubType =export const DocumentSubType = {task: 'task',snippet: 'snippet',+ skill: 'skill',} as const;diff --git a/apps/web/src/lib/service-clients/service-search/openapi.json b/apps/web/src/lib/service-clients/service-search/openapi.jsonindex b4e27a579e..79f55767dc 100644--- a/apps/web/src/lib/service-clients/service-search/openapi.json+++ b/apps/web/src/lib/service-clients/service-search/openapi.json@@ -1422,7 +1422,7 @@"DocumentSubType": {"type": "string","description": "The document sub type enum represents all values of document sub types.\nThese values should match the `document_sub_type_value` table in macrodb.",- "enum": ["task", "snippet"]+ "enum": ["task", "snippet", "skill"]},"EmailFilters": {"type": "object",diff --git a/apps/web/src/lib/service-clients/service-storage/client.ts b/apps/web/src/lib/service-clients/service-storage/client.tsindex c5f0874dd8..307a2b0cd0 100644--- a/apps/web/src/lib/service-clients/service-storage/client.ts+++ b/apps/web/src/lib/service-clients/service-storage/client.ts@@ -69,6 +69,8 @@ import type { CreateMarkdownDocumentRequest } from './generated/schemas/createMaimport type { CreateMarkdownHandler200 } from './generated/schemas/createMarkdownHandler200';import type { CreateProjectResponse } from './generated/schemas/createProjectResponse';import type { CreateReminderRequest } from './generated/schemas/createReminderRequest';+import type { CreateSkillHandler200 } from './generated/schemas/createSkillHandler200';+import type { CreateSkillRequest } from './generated/schemas/createSkillRequest';import type { CreateSnippetHandler200 } from './generated/schemas/createSnippetHandler200';import type { CreateSnippetRequest } from './generated/schemas/createSnippetRequest';import type { CreateTaskHandler200 } from './generated/schemas/createTaskHandler200';@@ -112,6 +114,7 @@ import type { GetOrCreatePrivateRequest } from './generated/schemas/getOrCreatePimport type { GetPendingProjectsHandler200 } from './generated/schemas/getPendingProjectsHandler200';import type { GetProjectContentResponse } from './generated/schemas/getProjectContentResponse';import type { GetProjectResponse } from './generated/schemas/getProjectResponse';+import type { GetSystemSkillsHandler200 } from './generated/schemas/getSystemSkillsHandler200';import type { GithubPullRequestsResponse } from './generated/schemas/githubPullRequestsResponse';import type { GroupedSoupGroupPage } from './generated/schemas/groupedSoupGroupPage';import type { GroupedSoupInitialPage } from './generated/schemas/groupedSoupInitialPage';@@ -1359,6 +1362,43 @@ export const storageServiceClient = {return ok(response);},+ /**+ * Creates a skill and initializes its sync-service content on the backend.+ * Skills are markdown documents containing instructions that AI reads and+ * follows when the skill is referenced in an AI input.+ */+ async createSkill(request: CreateSkillRequest) {+ const result = await dssFetch<CreateSkillHandler200>(+ `/documents/create_skill`,+ {+ method: 'POST',+ body: JSON.stringify(request),+ }+ );++ if (!result.isOk()) {+ const errors = result.error;+ if (errors[0].message.includes('403')) {+ showPaywall(PaywallKey.FILE_LIMIT);+ }+ return err(result.error);+ }++ const response = result.value;+ return ok(response);+ },++ /**+ * Lists the built-in system skills. System skills are static, code-defined+ * AI instructions with well-known ids; they surface like skill documents+ * but have no document behind them and must not be opened as documents.+ */+ async getSystemSkills() {+ return dssFetch<GetSystemSkillsHandler200>(`/documents/system_skills`, {+ method: 'GET',+ });+ },+async getSnippetRaw(args: {documentId: string;}): Promise<SerializedEditorState> {diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/addFavoriteRequestEntityType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/addFavoriteRequestEntityType.tsindex 1de663095e..b3e695f963 100644--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/addFavoriteRequestEntityType.ts+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/addFavoriteRequestEntityType.ts@@ -23,4 +23,5 @@ export type AddFavoriteRequestEntityType =| 'static_file'| 'crm_company'| 'crm_contact'- | 'reminder';+ | 'reminder'+ | 'skill';diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/basicDocumentSubType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/basicDocumentSubType.tsindex 619a0b67ec..4ea0dfc89d 100644--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/basicDocumentSubType.ts+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/basicDocumentSubType.ts@@ -5,6 +5,7 @@* OpenAPI spec version: 0.1.0*/import type { BasicDocumentSubTypeOneOf } from './basicDocumentSubTypeOneOf';+import type { BasicDocumentSubTypeOneOfFive } from './basicDocumentSubTypeOneOfFive';import type { BasicDocumentSubTypeOneOfThree } from './basicDocumentSubTypeOneOfThree';/**@@ -13,4 +14,5 @@ This ensures type-safety: task properties only exist when the document is a task*/export type BasicDocumentSubType =| BasicDocumentSubTypeOneOf- | BasicDocumentSubTypeOneOfThree;+ | BasicDocumentSubTypeOneOfThree+ | BasicDocumentSubTypeOneOfFive;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/basicDocumentSubTypeOneOfFive.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/basicDocumentSubTypeOneOfFive.tsnew file mode 100644index 0000000000..e65b70c798--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/basicDocumentSubTypeOneOfFive.ts@@ -0,0 +1,14 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { BasicDocumentSubTypeOneOfFiveType } from './basicDocumentSubTypeOneOfFiveType';++/**+ * A skill document — markdown instructions for AI+ */+export type BasicDocumentSubTypeOneOfFive = {+ type: BasicDocumentSubTypeOneOfFiveType;+};diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/basicDocumentSubTypeOneOfFiveType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/basicDocumentSubTypeOneOfFiveType.tsnew file mode 100644index 0000000000..b6a89e21c4--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/basicDocumentSubTypeOneOfFiveType.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 BasicDocumentSubTypeOneOfFiveType =+ (typeof BasicDocumentSubTypeOneOfFiveType)[keyof typeof BasicDocumentSubTypeOneOfFiveType];++// eslint-disable-next-line @typescript-eslint/no-redeclare+export const BasicDocumentSubTypeOneOfFiveType = {+ skill: 'skill',+} as const;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/createReminderRequestEntityType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/createReminderRequestEntityType.tsindex 9be952da01..3febe25c02 100644--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/createReminderRequestEntityType.ts+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/createReminderRequestEntityType.ts@@ -24,4 +24,5 @@ export type CreateReminderRequestEntityType =| 'static_file'| 'crm_company'| 'crm_contact'- | 'reminder';+ | 'reminder'+ | 'skill';diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/createSkillHandler200.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/createSkillHandler200.tsnew file mode 100644index 0000000000..921b2a5f15--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/createSkillHandler200.ts@@ -0,0 +1,14 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++/**+ * Response for creating a skill.+ */+export type CreateSkillHandler200 = {+ /** The document ID of the created skill. */+ documentId: string;+};diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/createSkillRequest.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/createSkillRequest.tsnew file mode 100644index 0000000000..b7ccdf5124--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/createSkillRequest.ts@@ -0,0 +1,22 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { CreateSkillRequestMarkdown } from './createSkillRequestMarkdown';+import type { CreateSkillRequestProjectId } from './createSkillRequestProjectId';++/**+ * Request body for creating a skill — a markdown document containing+instructions that AI reads and follows when the skill is referenced in an+AI input.+ */+export interface CreateSkillRequest {+ /** Markdown source text. Defaults to an empty skill document. */+ markdown?: CreateSkillRequestMarkdown;+ /** Optional project ID to associate the skill with. */+ projectId?: CreateSkillRequestProjectId;+ /** The name of the skill. */+ skillName: string;+}diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/createSkillRequestMarkdown.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/createSkillRequestMarkdown.tsnew file mode 100644index 0000000000..f712f94251--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/createSkillRequestMarkdown.ts@@ -0,0 +1,11 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++/**+ * Markdown source text. Defaults to an empty skill document.+ */+export type CreateSkillRequestMarkdown = string | null;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/createSkillRequestProjectId.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/createSkillRequestProjectId.tsnew file mode 100644index 0000000000..9baa3ed8c8--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/createSkillRequestProjectId.ts@@ -0,0 +1,11 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++/**+ * Optional project ID to associate the skill with.+ */+export type CreateSkillRequestProjectId = string | null;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/createSkillResponse.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/createSkillResponse.tsnew file mode 100644index 0000000000..92d7a06c2c--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/createSkillResponse.ts@@ -0,0 +1,14 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++/**+ * Response for creating a skill.+ */+export interface CreateSkillResponse {+ /** The document ID of the created skill. */+ documentId: string;+}diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/documentPreviewDataSubType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/documentPreviewDataSubType.tsindex 6e823b9a41..d1f95b0127 100644--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/documentPreviewDataSubType.ts+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/documentPreviewDataSubType.ts@@ -5,6 +5,7 @@* OpenAPI spec version: 0.1.0*/import type { DocumentPreviewDataSubTypeOneOf } from './documentPreviewDataSubTypeOneOf';+import type { DocumentPreviewDataSubTypeOneOfFive } from './documentPreviewDataSubTypeOneOfFive';import type { DocumentPreviewDataSubTypeOneOfThree } from './documentPreviewDataSubTypeOneOfThree';/**@@ -13,4 +14,5 @@ Task-related properties are encoded within the variant to ensure valid states.*/export type DocumentPreviewDataSubType =| DocumentPreviewDataSubTypeOneOf- | DocumentPreviewDataSubTypeOneOfThree;+ | DocumentPreviewDataSubTypeOneOfThree+ | DocumentPreviewDataSubTypeOneOfFive;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/documentPreviewDataSubTypeOneOfFive.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/documentPreviewDataSubTypeOneOfFive.tsnew file mode 100644index 0000000000..8a834cb70f--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/documentPreviewDataSubTypeOneOfFive.ts@@ -0,0 +1,14 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { DocumentPreviewDataSubTypeOneOfFiveType } from './documentPreviewDataSubTypeOneOfFiveType';++/**+ * A skill document — markdown instructions for AI+ */+export type DocumentPreviewDataSubTypeOneOfFive = {+ type: DocumentPreviewDataSubTypeOneOfFiveType;+};diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/documentPreviewDataSubTypeOneOfFiveType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/documentPreviewDataSubTypeOneOfFiveType.tsnew file mode 100644index 0000000000..761e25de9a--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/documentPreviewDataSubTypeOneOfFiveType.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 DocumentPreviewDataSubTypeOneOfFiveType =+ (typeof DocumentPreviewDataSubTypeOneOfFiveType)[keyof typeof DocumentPreviewDataSubTypeOneOfFiveType];++// eslint-disable-next-line @typescript-eslint/no-redeclare+export const DocumentPreviewDataSubTypeOneOfFiveType = {+ skill: 'skill',+} as const;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/documentSubType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/documentSubType.tsindex 5493c3fcb1..98c3e43e5f 100644--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/documentSubType.ts+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/documentSubType.ts@@ -16,4 +16,5 @@ export type DocumentSubType =export const DocumentSubType = {task: 'task',snippet: 'snippet',+ skill: 'skill',} as const;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/favoriteEntityRefEntityType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/favoriteEntityRefEntityType.tsindex 97456cdc19..8b896061cf 100644--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/favoriteEntityRefEntityType.ts+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/favoriteEntityRefEntityType.ts@@ -23,4 +23,5 @@ export type FavoriteEntityRefEntityType =| 'static_file'| 'crm_company'| 'crm_contact'- | 'reminder';+ | 'reminder'+ | 'skill';diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/favoriteEntityType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/favoriteEntityType.tsindex b7ed62fa0b..0532b1659b 100644--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/favoriteEntityType.ts+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/favoriteEntityType.ts@@ -23,4 +23,5 @@ export type FavoriteEntityType =| 'static_file'| 'crm_company'| 'crm_contact'- | 'reminder';+ | 'reminder'+ | 'skill';diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/getSystemSkillsHandler200.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/getSystemSkillsHandler200.tsnew file mode 100644index 0000000000..2046a6d6f9--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/getSystemSkillsHandler200.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 { SystemSkillSummary } from './systemSkillSummary';++/**+ * Response listing the built-in system skills.+ */+export type GetSystemSkillsHandler200 = {+ /** Every system skill, in display order. */+ skills: SystemSkillSummary[];+};diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/index.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/index.tsindex 610a7cbfe5..a1205d78ef 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@@ -130,6 +130,8 @@ export * from './basicDocumentProjectId';export * from './basicDocumentSha';export * from './basicDocumentSubType';export * from './basicDocumentSubTypeOneOf';+export * from './basicDocumentSubTypeOneOfFive';+export * from './basicDocumentSubTypeOneOfFiveType';export * from './basicDocumentSubTypeOneOfThree';export * from './basicDocumentSubTypeOneOfThreeType';export * from './basicDocumentSubTypeOneOfType';@@ -337,6 +339,11 @@ export * from './createProjectResponse';export * from './createReminderRequest';export * from './createReminderRequestEntityId';export * from './createReminderRequestEntityType';+export * from './createSkillHandler200';+export * from './createSkillRequest';+export * from './createSkillRequestMarkdown';+export * from './createSkillRequestProjectId';+export * from './createSkillResponse';export * from './createSnippetHandler200';export * from './createSnippetRequest';export * from './createSnippetRequestMarkdown';@@ -458,6 +465,8 @@ export * from './documentPreviewData';export * from './documentPreviewDataFileType';export * from './documentPreviewDataSubType';export * from './documentPreviewDataSubTypeOneOf';+export * from './documentPreviewDataSubTypeOneOfFive';+export * from './documentPreviewDataSubTypeOneOfFiveType';export * from './documentPreviewDataSubTypeOneOfThree';export * from './documentPreviewDataSubTypeOneOfThreeType';export * from './documentPreviewDataSubTypeOneOfType';@@ -654,6 +663,7 @@ export * from './getProjectResponse';export * from './getProjectResponseData';export * from './getProjectsResponse';export * from './getRecentActivityHandlerParams';+export * from './getSystemSkillsHandler200';export * from './getUserDocumentsHandlerParams';export * from './getUserHistoryResponse';export * from './githubPullRequest';@@ -1016,6 +1026,8 @@ export * from './soupDocumentSoupPropertiesFieldAllOfTwoSubType';export * from './soupDocumentSoupPropertiesFieldAllOfTwoViewedAt';export * from './soupDocumentSubType';export * from './soupDocumentSubTypeOneOf';+export * from './soupDocumentSubTypeOneOfFive';+export * from './soupDocumentSubTypeOneOfFiveType';export * from './soupDocumentSubTypeOneOfThree';export * from './soupDocumentSubTypeOneOfThreeType';export * from './soupDocumentSubTypeOneOfType';@@ -1100,6 +1112,7 @@ export * from './starterDocumentsResponse';export * from './string';export * from './successResponse';export * from './syncServiceVersionID';+export * from './systemSkillSummary';export * from './tagFilterMode';export * from './taskFilters';export * from './taskFiltersIncludeCbmAtmNc';diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/listRemindersEntityType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/listRemindersEntityType.tsindex 1e003e1a58..cd54d6c44b 100644--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/listRemindersEntityType.ts+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/listRemindersEntityType.ts@@ -25,4 +25,5 @@ export const ListRemindersEntityType = {crm_company: 'crm_company',crm_contact: 'crm_contact',reminder: 'reminder',+ skill: 'skill',} as const;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/reminderEntityType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/reminderEntityType.tsindex e3978086e6..4eb9bcdef4 100644--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/reminderEntityType.ts+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/reminderEntityType.ts@@ -24,4 +24,5 @@ export type ReminderEntityType =| 'static_file'| 'crm_company'| 'crm_contact'- | 'reminder';+ | 'reminder'+ | 'skill';diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupDocumentSubType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupDocumentSubType.tsindex 8db581f571..d3c4aa1c38 100644--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupDocumentSubType.ts+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupDocumentSubType.ts@@ -5,6 +5,7 @@* OpenAPI spec version: 0.1.0*/import type { SoupDocumentSubTypeOneOf } from './soupDocumentSubTypeOneOf';+import type { SoupDocumentSubTypeOneOfFive } from './soupDocumentSubTypeOneOfFive';import type { SoupDocumentSubTypeOneOfThree } from './soupDocumentSubTypeOneOfThree';/**@@ -13,4 +14,5 @@ This ensures type-safety: task properties only exist when the document is a task*/export type SoupDocumentSubType =| SoupDocumentSubTypeOneOf- | SoupDocumentSubTypeOneOfThree;+ | SoupDocumentSubTypeOneOfThree+ | SoupDocumentSubTypeOneOfFive;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupDocumentSubTypeOneOfFive.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupDocumentSubTypeOneOfFive.tsnew file mode 100644index 0000000000..92cc6371ce--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupDocumentSubTypeOneOfFive.ts@@ -0,0 +1,14 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { SoupDocumentSubTypeOneOfFiveType } from './soupDocumentSubTypeOneOfFiveType';++/**+ * A skill document — markdown instructions for AI+ */+export type SoupDocumentSubTypeOneOfFive = {+ type: SoupDocumentSubTypeOneOfFiveType;+};diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupDocumentSubTypeOneOfFiveType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupDocumentSubTypeOneOfFiveType.tsnew file mode 100644index 0000000000..274cdef4f6--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupDocumentSubTypeOneOfFiveType.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 SoupDocumentSubTypeOneOfFiveType =+ (typeof SoupDocumentSubTypeOneOfFiveType)[keyof typeof SoupDocumentSubTypeOneOfFiveType];++// eslint-disable-next-line @typescript-eslint/no-redeclare+export const SoupDocumentSubTypeOneOfFiveType = {+ skill: 'skill',+} as const;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.tsindex 83a5c014b9..af74f2f497 100644--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderReferenceEntityType.ts+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupReminderReferenceEntityType.ts@@ -23,4 +23,5 @@ export type SoupReminderReferenceEntityType =| 'static_file'| 'crm_company'| 'crm_contact'- | 'reminder';+ | 'reminder'+ | 'skill';diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/systemSkillSummary.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/systemSkillSummary.tsnew file mode 100644index 0000000000..7f896eaf42--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/systemSkillSummary.ts@@ -0,0 +1,18 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++/**+ * A built-in system skill: static, code-defined AI instructions surfaced+through the same tools as user-authored skill documents, but with no+document behind them.+ */+export interface SystemSkillSummary {+ /** The well-known id the skill is referenced by in mentions and AI tools. */+ id: string;+ /** The name of the skill. */+ name: string;+}diff --git a/apps/web/src/lib/service-clients/service-storage/generated/zod.ts b/apps/web/src/lib/service-clients/service-storage/generated/zod.tsindex 5293e44c8e..fc423a73e3 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@@ -103,6 +103,13 @@ export const getRecentActivityHandlerResponse = zod.object({type: zod.enum(['snippet']),}).describe('A snippet document — reusable markdown'),+ zod+ .object({+ type: zod.enum(['skill']),+ })+ .describe(+ 'A skill document — markdown instructions for AI'+ ),]).describe('Sub type of a document with associated properties encoded in each variant.\nThis ensures type-safety: task properties only exist when the document is a task.'@@ -576,7 +583,7 @@ export const editCommentResponse = zod.union([zod.null(),zod- .enum(['task', 'snippet'])+ .enum(['task', 'snippet', 'skill']).describe('The document sub type enum represents all values of document sub types.\nThese values should match the `document_sub_type_value` table in macrodb.'),@@ -4345,7 +4352,7 @@ export const getUserDocumentsHandlerResponse = zod.object({.union([zod.null(),zod- .enum(['task', 'snippet'])+ .enum(['task', 'snippet', 'skill']).describe('The document sub type enum represents all values of document sub types.\nThese values should match the `document_sub_type_value` table in macrodb.'),@@ -4514,7 +4521,7 @@ export const createDocumentResponse = zod.object({.union([zod.null(),zod- .enum(['task', 'snippet'])+ .enum(['task', 'snippet', 'skill']).describe('The document sub type enum represents all values of document sub types.\nThese values should match the `document_sub_type_value` table in macrodb.'),@@ -4690,7 +4697,7 @@ export const createMarkdownHandlerResponse = zod.union([zod.null(),zod- .enum(['task', 'snippet'])+ .enum(['task', 'snippet', 'skill']).describe('The document sub type enum represents all values of document sub types.\nThese values should match the `document_sub_type_value` table in macrodb.'),@@ -4707,6 +4714,34 @@ export const createMarkdownHandlerResponse = zod}).describe('Response for creating a markdown document.');+/**+ * @summary Creates a skill document with initialized markdown content in one+backend-owned lifecycle. Skills are markdown documents containing+instructions that AI reads and follows when the skill is referenced in an+AI input.+ */+export const createSkillHandlerBody = zod+ .object({+ markdown: zod+ .string()+ .nullish()+ .describe('Markdown source text. Defaults to an empty skill document.'),+ projectId: zod+ .uuid()+ .nullish()+ .describe('Optional project ID to associate the skill with.'),+ skillName: zod.string().describe('The name of the skill.'),+ })+ .describe(+ 'Request body for creating a skill — a markdown document containing\ninstructions that AI reads and follows when the skill is referenced in an\nAI input.'+ );++export const createSkillHandlerResponse = zod+ .object({+ documentId: zod.string().describe('The document ID of the created skill.'),+ })+ .describe('Response for creating a skill.');+/*** @summary Creates a snippet document with initialized markdown content in onebackend-owned lifecycle. Snippets are created personal; team sharing is@@ -4974,7 +5009,7 @@ export const createTaskHandlerResponse = zod.union([zod.null(),zod- .enum(['task', 'snippet'])+ .enum(['task', 'snippet', 'skill']).describe('The document sub type enum represents all values of document sub types.\nThese values should match the `document_sub_type_value` table in macrodb.'),@@ -5162,6 +5197,13 @@ export const getBatchPreviewHandlerResponse = zod.object({type: zod.enum(['snippet']),}).describe('A snippet document — reusable markdown'),+ zod+ .object({+ type: zod.enum(['skill']),+ })+ .describe(+ 'A skill document — markdown instructions for AI'+ ),]).describe('The sub type of a document preview with associated properties.\nTask-related properties are encoded within the variant to ensure valid states.'@@ -5285,6 +5327,13 @@ export const getDocumentByTeamSlugResponse = zod.object({type: zod.enum(['snippet']),}).describe('A snippet document — reusable markdown'),+ zod+ .object({+ type: zod.enum(['skill']),+ })+ .describe(+ 'A skill document — markdown instructions for AI'+ ),]).describe('Sub type of a document with associated properties encoded in each variant.\nThis ensures type-safety: task properties only exist when the document is a task.'@@ -5367,6 +5416,33 @@ export const handlerResponse = zod}).describe('The deterministic starter document ids for the current user.');+/**+ * @summary Lists the built-in system skills. System skills are static, code-defined+AI instructions (see the `system_skills` crate); they surface in the+skills menu and AI skill tools like user skills, but have no document+behind them, so clients must not offer to open them.+ */+export const getSystemSkillsHandlerResponse = zod+ .object({+ skills: zod+ .array(+ zod+ .object({+ id: zod+ .uuid()+ .describe(+ 'The well-known id the skill is referenced by in mentions and AI tools.'+ ),+ name: zod.string().describe('The name of the skill.'),+ })+ .describe(+ 'A built-in system skill: static, code-defined AI instructions surfaced\nthrough the same tools as user-authored skill documents, but with no\ndocument behind them.'+ )+ )+ .describe('Every system skill, in display order.'),+ })+ .describe('Response listing the built-in system skills.');+/*** Returns document metadata, user access level, and view location.* @summary Handler for `GET /documents/{document_id}`.@@ -5456,7 +5532,7 @@ export const getDocumentResponse = zod.object({.union([zod.null(),zod- .enum(['task', 'snippet'])+ .enum(['task', 'snippet', 'skill']).describe('The document sub type enum represents all values of document sub types.\nThese values should match the `document_sub_type_value` table in macrodb.'),@@ -5628,7 +5704,7 @@ export const saveDocumentHandlerResponse = zod.object({.union([zod.null(),zod- .enum(['task', 'snippet'])+ .enum(['task', 'snippet', 'skill']).describe('The document sub type enum represents all values of document sub types.\nThese values should match the `document_sub_type_value` table in macrodb.'),@@ -6301,7 +6377,7 @@ export const copyDocumentResponse = zod.union([zod.null(),zod- .enum(['task', 'snippet'])+ .enum(['task', 'snippet', 'skill']).describe('The document sub type enum represents all values of document sub types.\nThese values should match the `document_sub_type_value` table in macrodb.'),@@ -6734,7 +6810,7 @@ export const getDocumentLocationV3Response = zod.union([zod.null(),zod- .enum(['task', 'snippet'])+ .enum(['task', 'snippet', 'skill']).describe('The document sub type enum represents all values of document sub types.\nThese values should match the `document_sub_type_value` table in macrodb.'),@@ -6790,7 +6866,7 @@ export const getDocumentLocationV3Response = zod.union([zod.null(),zod- .enum(['task', 'snippet'])+ .enum(['task', 'snippet', 'skill']).describe('The document sub type enum represents all values of document sub types.\nThese values should match the `document_sub_type_value` table in macrodb.'),@@ -6857,7 +6933,7 @@ export const getDocumentLocationV3Response = zod.union([zod.null(),zod- .enum(['task', 'snippet'])+ .enum(['task', 'snippet', 'skill']).describe('The document sub type enum represents all values of document sub types.\nThese values should match the `document_sub_type_value` table in macrodb.'),@@ -7026,7 +7102,7 @@ export const simpleSaveResponse = zod.object({.union([zod.null(),zod- .enum(['task', 'snippet'])+ .enum(['task', 'snippet', 'skill']).describe('The document sub type enum represents all values of document sub types.\nThese values should match the `document_sub_type_value` table in macrodb.'),@@ -7210,7 +7286,7 @@ export const getDocumentVersionResponse = zod.object({.union([zod.null(),zod- .enum(['task', 'snippet'])+ .enum(['task', 'snippet', 'skill']).describe('The document sub type enum represents all values of document sub types.\nThese values should match the `document_sub_type_value` table in macrodb.'),@@ -7346,6 +7422,7 @@ export const listFavoritesResponse = zod'crm_company','crm_contact','reminder',+ 'skill',]).describe('The type of an entity in Macro').describe('The type of the favorited entity.'),@@ -7390,6 +7467,7 @@ export const addFavoriteBody = zod'crm_company','crm_contact','reminder',+ 'skill',]).describe('The type of an entity in Macro').describe('The type of the entity to favorite.'),@@ -7435,6 +7513,7 @@ export const addFavoriteResponse = zod'crm_company','crm_contact','reminder',+ 'skill',]).describe('The type of an entity in Macro').describe('The type of the favorited entity.'),@@ -7477,6 +7556,7 @@ export const reorderFavoritesBody = zod'crm_company','crm_contact','reminder',+ 'skill',]).describe('The type of an entity in Macro').describe('The type of the favorited entity.'),@@ -7512,6 +7592,7 @@ export const removeFavoriteByEntityParams = zod.object({'crm_company','crm_contact','reminder',+ 'skill',]).describe('The type of the favorited entity.'),entity_id: zod.string().describe('The id of the favorited entity.'),@@ -7633,6 +7714,13 @@ export const getHistoryHandlerResponse = zod.object({type: zod.enum(['snippet']),}).describe('A snippet document — reusable markdown'),+ zod+ .object({+ type: zod.enum(['skill']),+ })+ .describe(+ 'A skill document — markdown instructions for AI'+ ),]).describe('Sub type of a document with associated properties encoded in each variant.\nThis ensures type-safety: task properties only exist when the document is a task.'@@ -8093,6 +8181,13 @@ export const getItemsSoupResponse = zod.describe('A snippet document — reusable markdown'),+ zod+ .object({+ type: zod.enum(['skill']),+ })+ .describe(+ 'A skill document — markdown instructions for AI'+ ),]).describe('Sub type of a document with associated properties encoded in each variant.\nThis ensures type-safety: task properties only exist when the document is a task.'@@ -10640,6 +10735,7 @@ export const getItemsSoupResponse = zod'crm_company','crm_contact','reminder',+ 'skill',]).describe('The type of an entity in Macro').describe("The referenced entity's type."),@@ -11710,6 +11806,13 @@ export const postItemsSoupResponse = zod.describe('A snippet document — reusable markdown'),+ zod+ .object({+ type: zod.enum(['skill']),+ })+ .describe(+ 'A skill document — markdown instructions for AI'+ ),]).describe('Sub type of a document with associated properties encoded in each variant.\nThis ensures type-safety: task properties only exist when the document is a task.'@@ -14257,6 +14360,7 @@ export const postItemsSoupResponse = zod'crm_company','crm_contact','reminder',+ 'skill',]).describe('The type of an entity in Macro').describe("The referenced entity's type."),@@ -14791,6 +14895,13 @@ export const postItemsSoupAstResponse = zod.describe('A snippet document — reusable markdown'),+ zod+ .object({+ type: zod.enum(['skill']),+ })+ .describe(+ 'A skill document — markdown instructions for AI'+ ),]).describe('Sub type of a document with associated properties encoded in each variant.\nThis ensures type-safety: task properties only exist when the document is a task.'@@ -17340,6 +17451,7 @@ export const postItemsSoupAstResponse = zod'crm_company','crm_contact','reminder',+ 'skill',]).describe('The type of an entity in Macro').describe("The referenced entity's type."),@@ -18130,6 +18242,13 @@ export const postItemsSoupAstGroupedResponse = zod.describe('A snippet document — reusable markdown'),+ zod+ .object({+ type: zod.enum(['skill']),+ })+ .describe(+ 'A skill document — markdown instructions for AI'+ ),]).describe('Sub type of a document with associated properties encoded in each variant.\nThis ensures type-safety: task properties only exist when the document is a task.'@@ -20775,6 +20894,7 @@ export const postItemsSoupAstGroupedResponse = zod'crm_company','crm_contact','reminder',+ 'skill',]).describe('The type of an entity in Macro').describe("The referenced entity's type."),@@ -21217,6 +21337,13 @@ export const postItemsSoupAstGroupedResponse = zod.describe('A snippet document — reusable markdown'),+ zod+ .object({+ type: zod.enum(['skill']),+ })+ .describe(+ 'A skill document — markdown instructions for AI'+ ),]).describe('Sub type of a document with associated properties encoded in each variant.\nThis ensures type-safety: task properties only exist when the document is a task.'@@ -23862,6 +23989,7 @@ export const postItemsSoupAstGroupedResponse = zod'crm_company','crm_contact','reminder',+ 'skill',]).describe('The type of an entity in Macro').describe("The referenced entity's type."),@@ -24043,6 +24171,13 @@ export const getPinsHandlerResponse = zod.object({type: zod.enum(['snippet']),}).describe('A snippet document — reusable markdown'),+ zod+ .object({+ type: zod.enum(['skill']),+ })+ .describe(+ 'A skill document — markdown instructions for AI'+ ),]).describe('Sub type of a document with associated properties encoded in each variant.\nThis ensures type-safety: task properties only exist when the document is a task.'@@ -24181,6 +24316,13 @@ export const getPinsHandlerResponse = zod.object({type: zod.enum(['snippet']),}).describe('A snippet document — reusable markdown'),+ zod+ .object({+ type: zod.enum(['skill']),+ })+ .describe(+ 'A skill document — markdown instructions for AI'+ ),]).describe('Sub type of a document with associated properties encoded in each variant.\nThis ensures type-safety: task properties only exist when the document is a task.'@@ -25578,6 +25720,13 @@ export const getProjectContentHandlerResponse = zod.object({type: zod.enum(['snippet']),}).describe('A snippet document — reusable markdown'),+ zod+ .object({+ type: zod.enum(['skill']),+ })+ .describe(+ 'A skill document — markdown instructions for AI'+ ),]).describe('Sub type of a document with associated properties encoded in each variant.\nThis ensures type-safety: task properties only exist when the document is a task.'@@ -25792,6 +25941,13 @@ export const recentlyDeletedResponse = zod.object({type: zod.enum(['snippet']),}).describe('A snippet document — reusable markdown'),+ zod+ .object({+ type: zod.enum(['skill']),+ })+ .describe(+ 'A skill document — markdown instructions for AI'+ ),]).describe('Sub type of a document with associated properties encoded in each variant.\nThis ensures type-safety: task properties only exist when the document is a task.'@@ -25886,6 +26042,7 @@ export const listRemindersQueryParams = zod.object({'crm_company','crm_contact','reminder',+ 'skill',]).optional().describe(@@ -25967,6 +26124,7 @@ export const listRemindersResponse = zod'crm_company','crm_contact','reminder',+ 'skill',]).describe('The type of an entity in Macro'),])@@ -26051,6 +26209,7 @@ export const createReminderBody = zod'crm_company','crm_contact','reminder',+ 'skill',]).describe('The type of an entity in Macro'),])@@ -26132,6 +26291,7 @@ export const getReminderResponse = zod'crm_company','crm_contact','reminder',+ 'skill',]).describe('The type of an entity in Macro'),])@@ -26273,6 +26433,7 @@ export const updateReminderResponse = zod'crm_company','crm_contact','reminder',+ 'skill',]).describe('The type of an entity in Macro'),])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.tsindex efa74a3382..dc67d7b525 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@@ -342,6 +342,9 @@ function mapDocumentSubType(subType: GraphqlSoupDocument['subType']) {.with({ __typename: 'GraphqlSnippetSubType' }, () => ({type: 'snippet' as const,}))+ .with({ __typename: 'GraphqlSkillSubType' }, () => ({+ type: 'skill' as const,+ })).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.tsindex df693c333f..a42ff2d48c 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@@ -357,6 +357,8 @@ export type GraphqlDocumentLiteral =/** GraphQL input representing the document sub type. */export type GraphqlDocumentSubType =+ /** The skill option. */+ | 'SKILL'/** The snippet option. */| 'SNIPPET'/** The task option. */@@ -536,6 +538,8 @@ export type GraphqlEntityType =| 'PROJECT'/** Reminder entity. */| 'REMINDER'+ /** AI skill entity (skill document or built-in system skill). */+ | 'SKILL'/** Static file entity. */| 'STATIC_FILE'/** Team entity. */@@ -1046,6 +1050,7 @@ type EntityMutationResultFields_GraphqlMutationSuccess_Fragment = { __typename:| { __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: 'GraphqlSoupDocument', ownerId: string, fileType: string | null, projectId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, documentName: string, subType:+ | { __typename: 'GraphqlSkillSubType' }| { __typename: 'GraphqlSnippetSubType' }| { __typename: 'GraphqlTaskSubType', isCompleted: boolean }| null, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:@@ -1129,6 +1134,7 @@ export type EntityMutationPayloadFieldsFragment = { results: Array<| { __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: 'GraphqlSoupDocument', ownerId: string, fileType: string | null, projectId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, documentName: string, subType:+ | { __typename: 'GraphqlSkillSubType' }| { __typename: 'GraphqlSnippetSubType' }| { __typename: 'GraphqlTaskSubType', isCompleted: boolean }| null, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:@@ -1213,6 +1219,7 @@ export type RenameEntitiesMutation = { renameEntities: { results: Array<| { __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: 'GraphqlSoupDocument', ownerId: string, fileType: string | null, projectId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, documentName: string, subType:+ | { __typename: 'GraphqlSkillSubType' }| { __typename: 'GraphqlSnippetSubType' }| { __typename: 'GraphqlTaskSubType', isCompleted: boolean }| null, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:@@ -1297,6 +1304,7 @@ export type MoveEntitiesMutation = { moveEntities: { results: Array<| { __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: 'GraphqlSoupDocument', ownerId: string, fileType: string | null, projectId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, documentName: string, subType:+ | { __typename: 'GraphqlSkillSubType' }| { __typename: 'GraphqlSnippetSubType' }| { __typename: 'GraphqlTaskSubType', isCompleted: boolean }| null, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:@@ -1381,6 +1389,7 @@ export type UpdateEntitySharePoliciesMutation = { updateEntitySharePolicies: { r| { __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: 'GraphqlSoupDocument', ownerId: string, fileType: string | null, projectId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, documentName: string, subType:+ | { __typename: 'GraphqlSkillSubType' }| { __typename: 'GraphqlSnippetSubType' }| { __typename: 'GraphqlTaskSubType', isCompleted: boolean }| null, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:@@ -1465,6 +1474,7 @@ export type TrashEntitiesMutation = { trashEntities: { results: Array<| { __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: 'GraphqlSoupDocument', ownerId: string, fileType: string | null, projectId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, documentName: string, subType:+ | { __typename: 'GraphqlSkillSubType' }| { __typename: 'GraphqlSnippetSubType' }| { __typename: 'GraphqlTaskSubType', isCompleted: boolean }| null, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:@@ -1549,6 +1559,7 @@ export type RestoreEntitiesMutation = { restoreEntities: { results: Array<| { __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: 'GraphqlSoupDocument', ownerId: string, fileType: string | null, projectId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, documentName: string, subType:+ | { __typename: 'GraphqlSkillSubType' }| { __typename: 'GraphqlSnippetSubType' }| { __typename: 'GraphqlTaskSubType', isCompleted: boolean }| null, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:@@ -1633,6 +1644,7 @@ export type DeleteEntitiesPermanentlyMutation = { deleteEntitiesPermanently: { r| { __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: 'GraphqlSoupDocument', ownerId: string, fileType: string | null, projectId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, documentName: string, subType:+ | { __typename: 'GraphqlSkillSubType' }| { __typename: 'GraphqlSnippetSubType' }| { __typename: 'GraphqlTaskSubType', isCompleted: boolean }| null, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:@@ -1717,6 +1729,7 @@ export type DuplicateEntitiesMutation = { duplicateEntities: { results: Array<| { __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: 'GraphqlSoupDocument', ownerId: string, fileType: string | null, projectId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, documentName: string, subType:+ | { __typename: 'GraphqlSkillSubType' }| { __typename: 'GraphqlSnippetSubType' }| { __typename: 'GraphqlTaskSubType', isCompleted: boolean }| null, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:@@ -1802,6 +1815,7 @@ export type SetEntityFavoriteMutation = { setEntityFavorite:| { __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: 'GraphqlSoupDocument', ownerId: string, fileType: string | null, projectId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, documentName: string, subType:+ | { __typename: 'GraphqlSkillSubType' }| { __typename: 'GraphqlSnippetSubType' }| { __typename: 'GraphqlTaskSubType', isCompleted: boolean }| null, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:@@ -2008,6 +2022,7 @@ export type GroupSoupQuery = { user: { id: string, groupSoup: { bins: Array<{ ke| { __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: 'GraphqlSoupDocument', ownerId: string, fileType: string | null, projectId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, documentName: string, subType:+ | { __typename: 'GraphqlSkillSubType' }| { __typename: 'GraphqlSnippetSubType' }| { __typename: 'GraphqlTaskSubType', isCompleted: boolean }| null, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:@@ -2086,6 +2101,7 @@ type GraphqlHistoryItemFields_GraphqlSoupCrmCompany_Fragment = { __typename: 'Gr| 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_GraphqlSoupDocument_Fragment = { __typename: 'GraphqlSoupDocument', id: string, ownerId: string, fileType: string | null, projectId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, entityType: GraphqlSoupEntityType, frecencyScore: number | null, documentName: string, subType:+ | { __typename: 'GraphqlSkillSubType' }| { __typename: 'GraphqlSnippetSubType' }| { __typename: 'GraphqlTaskSubType', isCompleted: boolean }| null, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:@@ -2177,6 +2193,7 @@ type SoupPatchFields_SoupUpdated_Fragment = { __typename: 'SoupUpdated', item:| { __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: 'GraphqlSoupDocument', ownerId: string, fileType: string | null, projectId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, documentName: string, subType:+ | { __typename: 'GraphqlSkillSubType' }| { __typename: 'GraphqlSnippetSubType' }| { __typename: 'GraphqlTaskSubType', isCompleted: boolean }| null, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:@@ -2260,6 +2277,7 @@ export type SoupUpdatesSubscription = { soupUpdates: Array<| { __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: 'GraphqlSoupDocument', ownerId: string, fileType: string | null, projectId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, documentName: string, subType:+ | { __typename: 'GraphqlSkillSubType' }| { __typename: 'GraphqlSnippetSubType' }| { __typename: 'GraphqlTaskSubType', isCompleted: boolean }| null, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:@@ -2339,6 +2357,7 @@ export type SoupQuery = { user: { id: string, soup: { nextCursor: string | null,| { __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: 'GraphqlSoupDocument', ownerId: string, fileType: string | null, projectId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, documentName: string, subType:+ | { __typename: 'GraphqlSkillSubType' }| { __typename: 'GraphqlSnippetSubType' }| { __typename: 'GraphqlTaskSubType', isCompleted: boolean }| null, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:@@ -2417,6 +2436,7 @@ type SoupItemFields_GraphqlSoupCrmCompany_Fragment = { __typename: 'GraphqlSoupC| 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_GraphqlSoupDocument_Fragment = { __typename: 'GraphqlSoupDocument', ownerId: string, fileType: string | null, projectId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, documentName: string, subType:+ | { __typename: 'GraphqlSkillSubType' }| { __typename: 'GraphqlSnippetSubType' }| { __typename: 'GraphqlTaskSubType', isCompleted: boolean }| null, properties: Array<{ 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.jsonindex c586734d05..53d0e2b49c 100644--- a/apps/web/src/lib/service-clients/service-storage/openapi.json+++ b/apps/web/src/lib/service-clients/service-storage/openapi.json@@ -5586,6 +5586,73 @@}}},+ "/documents/create_skill": {+ "post": {+ "tags": ["document"],+ "summary": "Creates a skill document with initialized markdown content in one\nbackend-owned lifecycle. Skills are markdown documents containing\ninstructions that AI reads and follows when the skill is referenced in an\nAI input.",+ "operationId": "create_skill_handler",+ "requestBody": {+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/CreateSkillRequest"+ }+ }+ },+ "required": true+ },+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "type": "object",+ "description": "Response for creating a skill.",+ "required": ["documentId"],+ "properties": {+ "documentId": {+ "type": "string",+ "description": "The document ID of the created skill."+ }+ }+ }+ }+ }+ },+ "400": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ },+ "401": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ },+ "500": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ }+ }+ }+ },"/documents/create_snippet": {"post": {"tags": ["document"],@@ -6183,6 +6250,46 @@}}},+ "/documents/system_skills": {+ "get": {+ "tags": ["document"],+ "summary": "Lists the built-in system skills. System skills are static, code-defined\nAI instructions (see the `system_skills` crate); they surface in the\nskills menu and AI skill tools like user skills, but have no document\nbehind them, so clients must not offer to open them.",+ "operationId": "get_system_skills_handler",+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "type": "object",+ "description": "Response listing the built-in system skills.",+ "required": ["skills"],+ "properties": {+ "skills": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/SystemSkillSummary"+ },+ "description": "Every system skill, in display order."+ }+ }+ }+ }+ }+ },+ "401": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ }+ }+ }+ },"/documents/{document_id}": {"get": {"tags": ["document"],@@ -7822,7 +7929,8 @@"static_file","crm_company","crm_contact",- "reminder"+ "reminder",+ "skill"]}},@@ -9635,7 +9743,8 @@"static_file","crm_company","crm_contact",- "reminder"+ "reminder",+ "skill"]}},@@ -11015,7 +11124,8 @@"static_file","crm_company","crm_contact",- "reminder"+ "reminder",+ "skill"]}],@@ -12453,6 +12563,17 @@"enum": ["snippet"]}}+ },+ {+ "type": "object",+ "description": "A skill document — markdown instructions for AI",+ "required": ["type"],+ "properties": {+ "type": {+ "type": "string",+ "enum": ["skill"]+ }+ }}],"description": "Sub type of a document with associated properties encoded in each variant.\nThis ensures type-safety: task properties only exist when the document is a task."@@ -15093,7 +15214,8 @@"static_file","crm_company","crm_contact",- "reminder"+ "reminder",+ "skill"]}],@@ -15105,6 +15227,37 @@}}},+ "CreateSkillRequest": {+ "type": "object",+ "description": "Request body for creating a skill — a markdown document containing\ninstructions that AI reads and follows when the skill is referenced in an\nAI input.",+ "required": ["skillName"],+ "properties": {+ "markdown": {+ "type": ["string", "null"],+ "description": "Markdown source text. Defaults to an empty skill document."+ },+ "projectId": {+ "type": ["string", "null"],+ "format": "uuid",+ "description": "Optional project ID to associate the skill with."+ },+ "skillName": {+ "type": "string",+ "description": "The name of the skill."+ }+ }+ },+ "CreateSkillResponse": {+ "type": "object",+ "description": "Response for creating a skill.",+ "required": ["documentId"],+ "properties": {+ "documentId": {+ "type": "string",+ "description": "The document ID of the created skill."+ }+ }+ },"CreateSnippetRequest": {"type": "object","description": "Request body for creating a snippet — a reusable markdown document that can\nbe inserted into any markdown area.",@@ -16542,6 +16695,17 @@"enum": ["snippet"]}}+ },+ {+ "type": "object",+ "description": "A skill document — markdown instructions for AI",+ "required": ["type"],+ "properties": {+ "type": {+ "type": "string",+ "enum": ["skill"]+ }+ }}],"description": "The sub type of a document preview with associated properties.\nTask-related properties are encoded within the variant to ensure valid states."@@ -16689,7 +16853,7 @@"DocumentSubType": {"type": "string","description": "The document sub type enum represents all values of document sub types.\nThese values should match the `document_sub_type_value` table in macrodb.",- "enum": ["task", "snippet"]+ "enum": ["task", "snippet", "skill"]},"DocumentSyncContentUpdatedMetadata": {"type": "object",@@ -17627,7 +17791,8 @@"static_file","crm_company","crm_contact",- "reminder"+ "reminder",+ "skill"]}],@@ -17673,7 +17838,8 @@"static_file","crm_company","crm_contact",- "reminder"+ "reminder",+ "skill"]}],@@ -20991,7 +21157,8 @@"static_file","crm_company","crm_contact",- "reminder"+ "reminder",+ "skill"]}],@@ -22244,6 +22411,17 @@"enum": ["snippet"]}}+ },+ {+ "type": "object",+ "description": "A skill document — markdown instructions for AI",+ "required": ["type"],+ "properties": {+ "type": {+ "type": "string",+ "enum": ["skill"]+ }+ }}],"description": "Sub type of a document with associated properties encoded in each variant.\nThis ensures type-safety: task properties only exist when the document is a task."@@ -22992,7 +23170,8 @@"static_file","crm_company","crm_contact",- "reminder"+ "reminder",+ "skill"]}],@@ -23260,6 +23439,22 @@}}},+ "SystemSkillSummary": {+ "type": "object",+ "description": "A built-in system skill: static, code-defined AI instructions surfaced\nthrough the same tools as user-authored skill documents, but with no\ndocument behind them.",+ "required": ["id", "name"],+ "properties": {+ "id": {+ "type": "string",+ "format": "uuid",+ "description": "The well-known id the skill is referenced by in mentions and AI tools."+ },+ "name": {+ "type": "string",+ "description": "The name of the skill."+ }+ }+ },"TagFilterMode": {"type": "string","description": "How multiple `tag_option_ids` combine when filtering.",diff --git a/crates/ai_tools/Cargo.toml b/crates/ai_tools/Cargo.tomlindex b96ce00d05..451f6b014a 100644--- a/crates/ai_tools/Cargo.toml+++ b/crates/ai_tools/Cargo.toml@@ -73,6 +73,7 @@ search_service_client = { path = "../search_service_client" }serde.workspace = trueserde_json.workspace = trueprojects = { path = "../projects", default-features = false, features = ["ai_tools", "outbound", "service"] }+skills = { path = "../skills", default-features = false, features = ["ai_tools", "outbound"] }properties = { path = "../properties", features = ["ai_tools"] }soup = { path = "../soup", features = ["ai_tools", "outbound"] }sqs_client = { path = "../sqs_client", default-features = false, features = ["email", "gmail"] }diff --git a/crates/ai_tools/src/build_context.rs b/crates/ai_tools/src/build_context.rsindex 7b76b93364..3957b4aaa7 100644--- a/crates/ai_tools/src/build_context.rs+++ b/crates/ai_tools/src/build_context.rs@@ -385,8 +385,11 @@ pub async fn build_tool_service_context_from_env(let anthropic_tool_context = build_anthropic_tool_context();+ let skill_tool_context =+ crate::tool_context::build_skill_tool_context(search_client.clone(), soup_service.clone());+Ok(ToolServiceContext {- search_service_client: search_client,+ search_service_client: search_client.clone(),email_service_client: email_ext_client,soup_service,email_service: email_service_for_tools,@@ -401,6 +404,7 @@ pub async fn build_tool_service_context_from_env(project_tool_context,team_tool_context: crate::tool_context::build_team_tool_context(pool.clone()),crm_tool_context: crate::tool_context::build_crm_tool_context(pool.clone()),+ skill_tool_context,schedule_tool_context: crate::NoOpScheduleContext,anthropic_tool_context,recorder: ai_usage::pg_recorder(pool.clone()),diff --git a/crates/ai_tools/src/lib.rs b/crates/ai_tools/src/lib.rsindex 470a5ff6bc..602944c139 100644--- a/crates/ai_tools/src/lib.rs+++ b/crates/ai_tools/src/lib.rs@@ -32,6 +32,7 @@ use properties::inbound::toolset::properties_toolset;use schemas::read;use search_tools::{LoadTools, SearchTools};use self_knowledge::SelfKnowledge;+use skills::inbound::toolset::skill_toolset;use soup::inbound::toolset::{ListEntities, SoupToolContext};use std::sync::Arc;use subagent::Subagent;@@ -54,12 +55,13 @@ pub use tool_context::{ToolEntityCreator, ToolForeignEntityService, ToolFrecencyService, ToolImportService,ToolImportToolContext, ToolNotificationQueue, ToolNotificationService,ToolNotificationToolContext, ToolProjectService, ToolProjectToolContext, ToolPropertiesService,- ToolPropertiesToolContext, ToolServiceContext, ToolSoupService, ToolSystemPropertiesService,- ToolTeamService, ToolTeamToolContext, ToolUserEmailService,- build_channel_tool_context_with_dispatcher, build_channel_tool_context_with_side_effects,- build_channel_tool_context_without_side_effects, build_crm_tool_context,- build_project_tool_context, build_properties_service, build_properties_tool_context,- build_task_properties_adapter, build_team_repository, build_team_tool_context,+ ToolPropertiesToolContext, ToolServiceContext, ToolSkillService, ToolSkillToolContext,+ ToolSoupService, ToolSystemPropertiesService, ToolTeamService, ToolTeamToolContext,+ ToolUserEmailService, build_channel_tool_context_with_dispatcher,+ build_channel_tool_context_with_side_effects, build_channel_tool_context_without_side_effects,+ build_crm_tool_context, build_project_tool_context, build_properties_service,+ build_properties_tool_context, build_skill_tool_context, build_task_properties_adapter,+ build_team_repository, build_team_tool_context,};pub type AiToolSet = AsyncToolCollection<ToolServiceContext>;@@ -92,6 +94,7 @@ pub(crate) fn subagent_toolset() -> AiToolSet {.add_subtoolset::<ToolChannelToolContext>(channel_toolset()).add_subtoolset::<ToolTeamToolContext>(team_toolset()).add_subtoolset::<ToolCrmToolContext>(crm_toolset())+ .add_subtoolset::<ToolSkillToolContext>(skill_toolset()).add_subtoolset::<AnthropicToolContext>(anthropic_toolset())}diff --git a/crates/ai_tools/src/tool_context.rs b/crates/ai_tools/src/tool_context.rsindex 5e2f6c3fbf..7ae2ca6f72 100644--- a/crates/ai_tools/src/tool_context.rs+++ b/crates/ai_tools/src/tool_context.rs@@ -40,6 +40,7 @@ use notification::domain::service::SqsNotificationIngress;use notification::inbound::ai_tool::NotificationToolContext;use projects::inbound::toolset::ProjectToolContext;use properties::inbound::toolset::PropertiesToolContext;+use skills::inbound::toolset::SkillToolContext;use soup::{domain::service::SoupImpl, inbound::toolset::SoupToolContext};use std::sync::Arc;use system_properties::{@@ -235,6 +236,29 @@ pub fn build_crm_tool_context(pool: sqlx::PgPool) -> ToolCrmToolContext {}}+/// Type alias for the skill service implementation used by AI tools.+pub type ToolSkillService = skills::domain::service::SkillServiceImpl<+ skills::outbound::search_service_searcher::SearchServiceSkillSearcher,+ skills::outbound::soup_skill_lister::SoupSkillLister<ToolSoupService>,+>;++/// Type alias for the skill AI tool context.+pub type ToolSkillToolContext = SkillToolContext<ToolSkillService>;++/// Build the skill AI tool context from a search service client (skill+/// search) and the soup service (skill listing).+pub fn build_skill_tool_context(+ search_service_client: Arc<search_service_client::SearchServiceClient>,+ soup_service: Arc<ToolSoupService>,+) -> ToolSkillToolContext {+ SkillToolContext::new(skills::domain::service::SkillServiceImpl::new(+ skills::outbound::search_service_searcher::SearchServiceSkillSearcher::new(+ search_service_client,+ ),+ skills::outbound::soup_skill_lister::SoupSkillLister::new(soup_service),+ ))+}+/// Type alias for the team member listing service used by AI tools.pub type ToolTeamService = TeamRepositoryImpl;@@ -1108,6 +1132,7 @@ pub struct ToolServiceContext {pub project_tool_context: ToolProjectToolContext,pub team_tool_context: ToolTeamToolContext,pub crm_tool_context: ToolCrmToolContext,+ pub skill_tool_context: ToolSkillToolContext,pub schedule_tool_context: NoOpScheduleContext,pub anthropic_tool_context: AnthropicToolContext,/// Records token usage / cost for AI calls made with this context.diff --git a/crates/attachment/src/provider.rs b/crates/attachment/src/provider.rsindex 51b6a0e05d..780c3572f3 100644--- a/crates/attachment/src/provider.rs+++ b/crates/attachment/src/provider.rs@@ -43,7 +43,7 @@ wherefor &entity in ids.iter() {match entity.entity_type {- EntityType::Document | EntityType::Project => doc.push(entity),+ EntityType::Document | EntityType::Project | EntityType::Skill => doc.push(entity),EntityType::StaticFile => sf.push(entity),EntityType::EmailThread => email.push(entity),EntityType::Chat => chat.push(entity),diff --git a/crates/channels/src/outbound/notification_sender.rs b/crates/channels/src/outbound/notification_sender.rsindex 476f58ac83..cf9c7b0131 100644--- a/crates/channels/src/outbound/notification_sender.rs+++ b/crates/channels/src/outbound/notification_sender.rs@@ -199,6 +199,7 @@ wheresub_type: match document.sub_type.as_deref() {Some("task") => Some(NotificationDocumentSubType::Task),Some("snippet") => Some(NotificationDocumentSubType::Snippet),+ Some("skill") => Some(NotificationDocumentSubType::Skill),_ => None,},channel: to_channel_mention_metadata(mention),diff --git a/crates/chat/src/domain/service/message.rs b/crates/chat/src/domain/service/message.rsindex 06139759fe..ec2c7e3dc8 100644--- a/crates/chat/src/domain/service/message.rs+++ b/crates/chat/src/domain/service/message.rs@@ -228,5 +228,6 @@ fn attachment_type_to_entity_type(at: &AttachmentType) -> EntityType {AttachmentType::Channel => EntityType::Channel,AttachmentType::Email => EntityType::EmailThread,AttachmentType::Project => EntityType::Project,+ AttachmentType::Skill => EntityType::Skill,}}diff --git a/crates/chat/src/outbound/postgres/queries/create_message.rs b/crates/chat/src/outbound/postgres/queries/create_message.rsindex 6bcab49543..312d728f77 100644--- a/crates/chat/src/outbound/postgres/queries/create_message.rs+++ b/crates/chat/src/outbound/postgres/queries/create_message.rs@@ -12,6 +12,7 @@ fn attachment_type_to_entity_type(at: &AttachmentType) -> EntityType {AttachmentType::Channel => EntityType::Channel,AttachmentType::Email => EntityType::EmailThread,AttachmentType::Project => EntityType::Project,+ AttachmentType::Skill => EntityType::Skill,}}diff --git a/crates/document_sub_type/src/lib.rs b/crates/document_sub_type/src/lib.rsindex 4a5d8f05c9..55c1971663 100644--- a/crates/document_sub_type/src/lib.rs+++ b/crates/document_sub_type/src/lib.rs@@ -26,4 +26,7 @@ pub enum DocumentSubType {/// A snippet document — a reusable block of markdown that can be inserted/// into any markdown areaSnippet,+ /// A skill document — a markdown document containing instructions that AI+ /// can read and follow when referenced in an AI input+ Skill,}diff --git a/crates/documents/Cargo.toml b/crates/documents/Cargo.tomlindex 16d618320e..d33b6bfabb 100644--- a/crates/documents/Cargo.toml+++ b/crates/documents/Cargo.toml@@ -106,6 +106,7 @@ macro_service_urls = { path = "../macro_service_urls", optional = true }macro_sync_service_jwt = { path = "../macro_sync_service_jwt" }macro_user_id = { path = "../macro_user_id" }macro_uuid = { path = "../macro_uuid" }+system_skills = { path = "../system_skills" }model = { path = "../model" }model-entity = { path = "../model-entity" }models_permissions = { path = "../models_permissions" }@@ -148,6 +149,7 @@ reqwest = { workspace = true, optional = true }schemars = { workspace = true, optional = true }sha2 = { workspace = true, optional = true }+# Attachmentattachment = { path = "../attachment", optional = true }non_empty = { path = "../non_empty" }diff --git a/crates/documents/src/domain/create/mod.rs b/crates/documents/src/domain/create/mod.rsindex 9848a5715b..fc8c627de0 100644--- a/crates/documents/src/domain/create/mod.rs+++ b/crates/documents/src/domain/create/mod.rs@@ -127,6 +127,7 @@ enum RepoDocumentSubtype {Regular,MarkdownTask,MarkdownSnippet,+ MarkdownSkill,}impl RepoDocumentSubtype {@@ -137,6 +138,7 @@ impl RepoDocumentSubtype {RepoDocumentSubtype::MarkdownSnippet => {Some(document_sub_type::DocumentSubType::Snippet)}+ RepoDocumentSubtype::MarkdownSkill => Some(document_sub_type::DocumentSubType::Skill),}}}@@ -160,6 +162,9 @@ pub enum MarkdownSubtype {/// A snippet document — reusable markdown insertable in any markdown area./// Snippets are created personal; team sharing is toggled separately.Snippet,+ /// A skill document — markdown instructions that AI reads and follows when+ /// the skill is referenced in an AI input.+ Skill,}impl MarkdownSubtype {@@ -323,6 +328,11 @@ impl NewPlainTextDocumentBuilder<FileType, String> {"snippets must be markdown documents".to_string(),));}+ MarkdownSubtype::Skill => {+ return Err(DocumentError::BadRequest(+ "skills must be markdown documents".to_string(),+ ));+ }MarkdownSubtype::Note => {}}PlainTextDocumentKind::Text(NonMarkdownFileType::new(self.file_type)?)@@ -512,7 +522,7 @@ wheresubtype,} = document;let task = match &subtype {- MarkdownSubtype::Note | MarkdownSubtype::Snippet => None,+ MarkdownSubtype::Note | MarkdownSubtype::Snippet | MarkdownSubtype::Skill => None,MarkdownSubtype::Task {property_values,share_with_team,@@ -537,6 +547,7 @@ whereMarkdownSubtype::Note => RepoDocumentSubtype::Regular,MarkdownSubtype::Task { .. } => RepoDocumentSubtype::MarkdownTask,MarkdownSubtype::Snippet => RepoDocumentSubtype::MarkdownSnippet,+ MarkdownSubtype::Skill => RepoDocumentSubtype::MarkdownSkill,},team_id,},diff --git a/crates/documents/src/domain/models.rs b/crates/documents/src/domain/models.rsindex fbc6761890..8336fe6f86 100644--- a/crates/documents/src/domain/models.rs+++ b/crates/documents/src/domain/models.rs@@ -506,6 +506,52 @@ pub struct CreateSnippetResponse {pub document_id: String,}+/// Request body for creating a skill — a markdown document containing+/// instructions that AI reads and follows when the skill is referenced in an+/// AI input.+#[derive(serde::Serialize, serde::Deserialize, Debug)]+#[cfg_attr(feature = "axum", derive(utoipa::ToSchema))]+#[serde(rename_all = "camelCase")]+pub struct CreateSkillRequest {+ /// The name of the skill.+ pub skill_name: String,+ /// Markdown source text. Defaults to an empty skill document.+ pub markdown: Option<String>,+ /// Optional project ID to associate the skill with.+ pub project_id: Option<uuid::Uuid>,+}++/// Response for creating a skill.+#[derive(serde::Serialize, serde::Deserialize, Debug)]+#[cfg_attr(feature = "axum", derive(utoipa::ToSchema))]+#[serde(rename_all = "camelCase")]+pub struct CreateSkillResponse {+ /// The document ID of the created skill.+ pub document_id: String,+}++/// A built-in system skill: static, code-defined AI instructions surfaced+/// through the same tools as user-authored skill documents, but with no+/// document behind them.+#[derive(serde::Serialize, serde::Deserialize, Debug)]+#[cfg_attr(feature = "axum", derive(utoipa::ToSchema))]+#[serde(rename_all = "camelCase")]+pub struct SystemSkillSummary {+ /// The well-known id the skill is referenced by in mentions and AI tools.+ pub id: uuid::Uuid,+ /// The name of the skill.+ pub name: String,+}++/// Response listing the built-in system skills.+#[derive(serde::Serialize, serde::Deserialize, Debug)]+#[cfg_attr(feature = "axum", derive(utoipa::ToSchema))]+#[serde(rename_all = "camelCase")]+pub struct SystemSkillsResponse {+ /// Every system skill, in display order.+ pub skills: Vec<SystemSkillSummary>,+}+/// The team-share state of a document. The team is resolved from the document/// owner's team membership.#[derive(serde::Serialize, serde::Deserialize, Debug, Clone)]diff --git a/crates/documents/src/inbound/attachment/markdown.rs b/crates/documents/src/inbound/attachment/markdown.rsindex 7ad996bc8c..3beba35ac4 100644--- a/crates/documents/src/inbound/attachment/markdown.rs+++ b/crates/documents/src/inbound/attachment/markdown.rs@@ -2,6 +2,7 @@use attachment::image::ImageData;use attachment::{AttachmentContent, AttachmentError, AttachmentPart, ResolutionError};+use document_sub_type::DocumentSubType;use entity_access::domain::ports::EntityAccessService;use futures::future::join_all;use lexical_client::types::NewMdNode;@@ -12,7 +13,7 @@ use non_empty::NonEmpty;use crate::domain::ports::DocumentService;-use super::service::DocumentAttachmentService;+use super::service::{DocumentAttachmentService, skill_type_metadata};/// Resolve a markdown document into an [`AttachmentContent`] with interleaved/// text and image parts.@@ -37,6 +38,16 @@ pub(super) async fn resolve_markdown<DSvc: DocumentService, ESvc: EntityAccessSe})).await;+ // Skill documents are instructions for the AI to follow; mark them so the+ // model can tell them apart from ordinary attached documents.+ let parts = if document.sub_type == Some(DocumentSubType::Skill) {+ std::iter::once(skill_type_metadata())+ .chain(parts)+ .collect()+ } else {+ parts+ };+let content = NonEmpty::new(parts).map_err(|_| AttachmentError::NoContent)?;Ok(AttachmentContent {diff --git a/crates/documents/src/inbound/attachment/service.rs b/crates/documents/src/inbound/attachment/service.rsindex 03649deb39..2017145e4f 100644--- a/crates/documents/src/inbound/attachment/service.rs+++ b/crates/documents/src/inbound/attachment/service.rs@@ -71,6 +71,10 @@ impl<DSvc: DocumentService, ESvc: EntityAccessService> AttachmentService.resolve_project(user_id, &entity.entity_id).await.map_err(|error| ResolutionError::new(owned_ref, error)),+ EntityType::Skill => self+ .resolve_skill(user_id, &entity.entity_id)+ .await+ .map_err(|error| ResolutionError::new(owned_ref, error)),other => Err(ResolutionError::new(owned_ref,AttachmentError::RoutingError("DocumentAttachmentService".to_string(), other),@@ -125,6 +129,52 @@ impl<DSvc: DocumentService, ESvc: EntityAccessService> DocumentAttachmentService})}+ /// Resolve a skill reference: either a built-in system skill (static,+ /// code-defined content with a well-known id, visible to every user) or a+ /// skill document (an ordinary markdown document with the skill sub-type,+ /// access-checked like any other document).+ #[tracing::instrument(skip(self), err)]+ async fn resolve_skill(+ &self,+ user_id: &MacroUserIdStr<'_>,+ id: &str,+ ) -> Result<AttachmentContent<'static>, AttachmentError> {+ if let Some(skill) = uuid::Uuid::from_str(id)+ .ok()+ .and_then(system_skills::system_skill)+ {+ return Ok(AttachmentContent {+ reference: EntityType::Skill.with_entity_string(id.to_string()),+ name: Some(skill.name.to_string()),+ content: NonEmpty::new(vec![+ skill_type_metadata(),+ AttachmentPart::Content(skill.render_content()),+ ])+ .expect("content is non-empty"),+ });+ }++ self.entity_access_service+ .generate_entity_access_receipt::<ViewAccessLevel>(+ user_id,+ None,+ id,+ EntityType::Document,+ )+ .await+ .map_err(|e| AttachmentError::PermissionDenied(Box::new(e)))?;++ let document = self+ .document_service+ .internal_get_basic_document(id)+ .await+ .map_err(|e| AttachmentError::Internal(e.into()))?;++ let mut content = markdown::resolve_markdown(self, user_id, id, &document).await?;+ content.reference = EntityType::Skill.with_entity_string(id.to_string());+ Ok(content)+ }+#[tracing::instrument(skip(self), err)]async fn resolve_document(&self,@@ -230,6 +280,16 @@ impl<DSvc: DocumentService, ESvc: EntityAccessService> DocumentAttachmentService}}+/// Metadata part marking an attachment as a skill, so the AI treats its+/// content as instructions to follow (see the `skills` section of the system+/// prompt) rather than as a document under discussion.+pub(super) fn skill_type_metadata() -> AttachmentPart<'static> {+ AttachmentPart::Metadata {+ key: "type".to_string(),+ value: "skill".to_string(),+ }+}+pub(super) async fn fetch_url_bytes(url: &str) -> Result<Vec<u8>, AttachmentError> {// Presigned/distribution URLs are minted with the browser-facing `localhost`// host; rewrite to the in-network LocalStack host so this server-side fetchdiff --git a/crates/documents/src/inbound/axum_router.rs b/crates/documents/src/inbound/axum_router.rsindex ff7774bbfd..3a0c8ead22 100644--- a/crates/documents/src/inbound/axum_router.rs+++ b/crates/documents/src/inbound/axum_router.rs@@ -11,6 +11,8 @@//! - `GET`/`PUT /{document_id}/team_share` — get/set the document's team-share state//! - `POST /create_markdown` — create and initialize a markdown document//! - `POST /create_snippet` — create and initialize a snippet document+//! - `POST /create_skill` — create and initialize a skill document+//! - `GET /system_skills` — list the built-in system skills//! - `DELETE /{document_id}` — soft-delete a document#[cfg(test)]@@ -22,6 +24,8 @@ pub mod create_document;#[cfg(feature = "document_create")]pub mod create_markdown;#[cfg(feature = "document_create")]+pub mod create_skill;+#[cfg(feature = "document_create")]pub mod create_snippet;pub mod create_task;pub mod delete_document;@@ -35,6 +39,7 @@ pub mod get_location;pub mod get_short_id;pub mod put_interaction;pub mod put_snapshot;+pub mod system_skills;pub mod task_duplicates;pub mod team_share;@@ -59,6 +64,8 @@ use task_dedup::PgTaskDedupService;#[cfg(feature = "document_create")]use self::create_markdown::create_markdown_handler;#[cfg(feature = "document_create")]+use self::create_skill::create_skill_handler;+#[cfg(feature = "document_create")]use self::create_snippet::create_snippet_handler;use self::{copy_document::copy_document_handler,@@ -74,6 +81,7 @@ use self::{get_location::get_location_v3_handler,get_short_id::get_short_id_handler,put_snapshot::put_snapshot_handler,+ system_skills::get_system_skills_handler,task_duplicates::{delete_this_duplicate_task_handler, dismiss_task_duplicates_handler,get_task_duplicates_handler, task_similarity_search_handler,@@ -289,6 +297,10 @@ where.route("/similarity_search",axum::routing::post(task_similarity_search_handler::<T, Svc, Auth>),+ )+ .route(+ "/system_skills",+ axum::routing::get(get_system_skills_handler::<Auth>),);#[cfg(feature = "document_create")]@@ -300,6 +312,10 @@ where.route("/create_snippet",axum::routing::post(create_snippet_handler::<T, Svc, Auth>),+ )+ .route(+ "/create_skill",+ axum::routing::post(create_skill_handler::<T, Svc, Auth>),);router.with_state(state)diff --git a/crates/documents/src/inbound/axum_router/create_skill.rs b/crates/documents/src/inbound/axum_router/create_skill.rsnew file mode 100644index 0000000000..b3b3ac3b28--- /dev/null+++ b/crates/documents/src/inbound/axum_router/create_skill.rs@@ -0,0 +1,63 @@+//! Handler for `POST /documents/create_skill`.++use axum::{Json, extract::State};+use entity_access::domain::ports::EntityAccessService;+use entity_access::inbound::axum_extractors::ProjectBodyAccessLevelExtractorV2;+use macro_authorization::{MacroAuthorizationExtractor, MacroAuthorizationService, UserOrInternal};+use models_permissions::share_permission::access_level::EditAccessLevel;++use super::DocumentRouterState;+use crate::domain::create::{MarkdownSubtype, NewDocumentMetadata, NewMarkdownTextDocument};+use crate::domain::models::{CreateSkillRequest, CreateSkillResponse, DocumentError};+use crate::domain::ports::DocumentService;+use crate::domain::ports::create::DocumentCreationService;++/// Creates a skill document with initialized markdown content in one+/// backend-owned lifecycle. Skills are markdown documents containing+/// instructions that AI reads and follows when the skill is referenced in an+/// AI input.+#[utoipa::path(+ tag = "document",+ post,+ path = "/documents/create_skill",+ request_body = CreateSkillRequest,+ responses(+ (status = 200, body = inline(CreateSkillResponse)),+ (status = 400, body = model_error_response::ErrorResponse),+ (status = 401, body = model_error_response::ErrorResponse),+ (status = 500, body = model_error_response::ErrorResponse),+ )+)]+#[tracing::instrument(skip(state, user, project), fields(user_id=?user.authorization.user.macro_user_id))]+pub async fn create_skill_handler<+ T: DocumentService + DocumentCreationService,+ Svc: EntityAccessService,+ Auth: MacroAuthorizationService,+>(+ State(state): State<DocumentRouterState<T, Svc, Auth>>,+ user: MacroAuthorizationExtractor<Auth, UserOrInternal>,+ project: ProjectBodyAccessLevelExtractorV2<EditAccessLevel, CreateSkillRequest, Svc, Auth>,+) -> Result<Json<CreateSkillResponse>, DocumentError> {+ let req = project.into_inner();++ let mut metadata = NewDocumentMetadata::builder(req.skill_name);+ if let Some(project_id) = req.project_id {+ metadata = metadata.project_id(project_id);+ }++ let created = state+ .creator+ .create_markdown_text(+ user.authorization.user.macro_user_id.clone(),+ NewMarkdownTextDocument {+ metadata: metadata.build(),+ markdown: req.markdown.unwrap_or_default(),+ subtype: MarkdownSubtype::Skill,+ },+ )+ .await?;++ Ok(Json(CreateSkillResponse {+ document_id: created.document_id().to_string(),+ }))+}diff --git a/crates/documents/src/inbound/axum_router/get_branch_name.rs b/crates/documents/src/inbound/axum_router/get_branch_name.rsindex 110afe368a..3c4c3d0696 100644--- a/crates/documents/src/inbound/axum_router/get_branch_name.rs+++ b/crates/documents/src/inbound/axum_router/get_branch_name.rs@@ -72,8 +72,8 @@ pub async fn get_branch_name_handler<branch_name: task_branch_name.branch_name,}))}- Some(DocumentSubType::Snippet) | None => Err(DocumentError::BadRequest(format!(- "document {document_id} is not a task"- ))),+ Some(DocumentSubType::Snippet | DocumentSubType::Skill) | None => Err(+ DocumentError::BadRequest(format!("document {document_id} is not a task")),+ ),}}diff --git a/crates/documents/src/inbound/axum_router/system_skills.rs b/crates/documents/src/inbound/axum_router/system_skills.rsnew file mode 100644index 0000000000..a88eda4b4f--- /dev/null+++ b/crates/documents/src/inbound/axum_router/system_skills.rs@@ -0,0 +1,34 @@+//! Handler for `GET /documents/system_skills`.++use axum::Json;+use macro_authorization::{MacroAuthorizationExtractor, MacroAuthorizationService, UserOrInternal};++use crate::domain::models::{SystemSkillSummary, SystemSkillsResponse};++/// Lists the built-in system skills. System skills are static, code-defined+/// AI instructions (see the `system_skills` crate); they surface in the+/// skills menu and AI skill tools like user skills, but have no document+/// behind them, so clients must not offer to open them.+#[utoipa::path(+ tag = "document",+ get,+ path = "/documents/system_skills",+ responses(+ (status = 200, body = inline(SystemSkillsResponse)),+ (status = 401, body = model_error_response::ErrorResponse),+ )+)]+#[tracing::instrument(skip_all)]+pub async fn get_system_skills_handler<Auth: MacroAuthorizationService>(+ _user: MacroAuthorizationExtractor<Auth, UserOrInternal>,+) -> Json<SystemSkillsResponse> {+ Json(SystemSkillsResponse {+ skills: system_skills::SYSTEM_SKILLS+ .iter()+ .map(|skill| SystemSkillSummary {+ id: skill.id(),+ name: skill.name.to_string(),+ })+ .collect(),+ })+}diff --git a/crates/documents/src/inbound/toolset/read_content.rs b/crates/documents/src/inbound/toolset/read_content.rsindex ea4e3db774..2ba08c0c75 100644--- a/crates/documents/src/inbound/toolset/read_content.rs+++ b/crates/documents/src/inbound/toolset/read_content.rs@@ -106,6 +106,16 @@ where) -> ToolResult<Self::Output> {tracing::info!(params=?self, "Read metadata");+ // System skills are static, code-defined content with well-known ids+ // rather than documents; serve them before any document lookup or+ // access check (they are visible to every user).+ if let Some(skill) = system_skills::system_skill(self.document_id) {+ return Ok(ReadContentResponse {+ content: Content::Text(skill.render_content()),+ comments: Vec::new(),+ });+ }+// Get EntityAccessReceiptlet entity_access_receipt = service_context.entity_access_servicediff --git a/crates/documents/src/inbound/toolset/read_metadata.rs b/crates/documents/src/inbound/toolset/read_metadata.rsindex 0ad7dd7195..c439f618dd 100644--- a/crates/documents/src/inbound/toolset/read_metadata.rs+++ b/crates/documents/src/inbound/toolset/read_metadata.rs@@ -102,7 +102,8 @@ whereSome(task_branch_name.branch_name)}- document_sub_type::DocumentSubType::Snippet => None,+ document_sub_type::DocumentSubType::Snippet+ | document_sub_type::DocumentSubType::Skill => None,}} else {Nonediff --git a/crates/entity_access/src/domain/service.rs b/crates/entity_access/src/domain/service.rsindex 77bf29ffbc..0553905e40 100644--- a/crates/entity_access/src/domain/service.rs+++ b/crates/entity_access/src/domain/service.rs@@ -240,7 +240,8 @@ where| EntityType::StaticFile| EntityType::CalendarEvent// A reminder belongs to a user, so a team-scoped bot never reaches one.- | EntityType::Reminder => {+ | EntityType::Reminder+ | EntityType::Skill => {Err(AccessError::BadRequest("Unsupported bot entity type"))}}@@ -423,7 +424,11 @@ where// Static files are always viewable. This is wrong for ownersEntityType::StaticFile => Ok(Some(AccessLevel::View)),// These entity types either don't have access checks implemented yet, or they should not have access checks.- EntityType::Team | EntityType::User | EntityType::ChannelMessage => Ok(None),+ // Skill refs are access-checked against the underlying skill document.+ EntityType::Team+ | EntityType::User+ | EntityType::ChannelMessage+ | EntityType::Skill => Ok(None),}}diff --git a/crates/entity_access/src/outbound/pg_access_repo/mod.rs b/crates/entity_access/src/outbound/pg_access_repo/mod.rsindex 7144d52d9f..dbd217cdb9 100644--- a/crates/entity_access/src/outbound/pg_access_repo/mod.rs+++ b/crates/entity_access/src/outbound/pg_access_repo/mod.rs@@ -282,6 +282,7 @@ impl AccessRepository for PgAccessRepository {| EntityType::StaticFile| EntityType::CrmCompany| EntityType::CrmContact+ | EntityType::Skill// Reminders are user-owned, never reachable through a team scope.| EntityType::Reminder => {return Err(AccessError::BadRequest(diff --git a/crates/entity_access_db_utils/src/lib.rs b/crates/entity_access_db_utils/src/lib.rsindex 34f160a21f..65cffd792a 100644--- a/crates/entity_access_db_utils/src/lib.rs+++ b/crates/entity_access_db_utils/src/lib.rs@@ -258,6 +258,7 @@ pub async fn update_entity_access_channel_share_permissions(| EntityType::StaticFile| EntityType::CrmCompany| EntityType::CrmContact+ | EntityType::Skill| EntityType::ForeignEntity// Reminders are never channel-shared: they are private to one user.| EntityType::Reminder => {@@ -325,6 +326,7 @@ pub async fn update_entity_access_channel_share_permissions(| EntityType::StaticFile| EntityType::CrmCompany| EntityType::CrmContact+ | EntityType::Skill| EntityType::ForeignEntity// Reminders are never channel-shared: they are private to one user.| EntityType::Reminder => {diff --git a/crates/graphql_common/src/entity_type.rs b/crates/graphql_common/src/entity_type.rsindex f1aea258ec..d41e53c0f5 100644--- a/crates/graphql_common/src/entity_type.rs+++ b/crates/graphql_common/src/entity_type.rs@@ -61,6 +61,8 @@ pub enum GraphqlEntityType {CrmContact,/// Reminder entity.Reminder,+ /// AI skill entity (skill document or built-in system skill).+ Skill,}impl GraphqlSoupEntityType {@@ -127,6 +129,7 @@ impl GraphqlEntityType {EntityType::StaticFile => Self::StaticFile,EntityType::CrmContact => Self::CrmContact,EntityType::Reminder => Self::Reminder,+ EntityType::Skill => Self::Skill,}}@@ -153,6 +156,7 @@ impl GraphqlEntityType {Self::StaticFile => EntityType::StaticFile,Self::CrmContact => EntityType::CrmContact,Self::Reminder => EntityType::Reminder,+ Self::Skill => EntityType::Skill,}}}diff --git a/crates/graphql_notification/src/loaders.rs b/crates/graphql_notification/src/loaders.rsindex 132fc9e368..24f0b8fba9 100644--- a/crates/graphql_notification/src/loaders.rs+++ b/crates/graphql_notification/src/loaders.rs@@ -34,7 +34,8 @@ fn notification_item_type(entity_type: model_entity::EntityType) -> Option<Notif| EntityType::StaticFile| EntityType::CrmCompany| EntityType::CrmContact- | EntityType::CalendarEvent => None,+ | EntityType::CalendarEvent+ | EntityType::Skill => None,}}diff --git a/crates/graphql_soup/src/inputs.rs b/crates/graphql_soup/src/inputs.rsindex e4edecf809..218ecc33f1 100644--- a/crates/graphql_soup/src/inputs.rs+++ b/crates/graphql_soup/src/inputs.rs@@ -722,6 +722,8 @@ enum GraphqlDocumentSubType {Task,/// The snippet option.Snippet,+ /// The skill option.+ Skill,}impl GraphqlDocumentSubType {@@ -730,6 +732,7 @@ impl GraphqlDocumentSubType {match self {Self::Task => DocumentSubType::Task,Self::Snippet => DocumentSubType::Snippet,+ Self::Skill => DocumentSubType::Skill,}}}diff --git a/crates/graphql_soup/src/loaders.rs b/crates/graphql_soup/src/loaders.rsindex f6073c08ef..519c811e7e 100644--- a/crates/graphql_soup/src/loaders.rs+++ b/crates/graphql_soup/src/loaders.rs@@ -368,7 +368,8 @@ fn entity_filter_ast(entities: &[Entity<'static>]) -> Result<EntityFilterAst, SoEntityType::User| EntityType::Team| EntityType::StaticFile- | EntityType::CrmContact => {+ | EntityType::CrmContact+ | EntityType::Skill => {return Err(rootcause::report!("entity type {} is not represented in Soup",entity.entity_typediff --git a/crates/graphql_soup/src/objects.rs b/crates/graphql_soup/src/objects.rsindex 45c957b9f0..cdd6d0588c 100644--- a/crates/graphql_soup/src/objects.rs+++ b/crates/graphql_soup/src/objects.rs@@ -603,6 +603,13 @@ pub struct GraphqlSnippetSubType {nothing: bool,}+/// represents the skill subtype fields+#[derive(SimpleObject)]+pub struct GraphqlSkillSubType {+ /// this object has nothing as a field but we need at least 1 field+ nothing: bool,+}+/// GraphQL representation of the soup document sub type.#[derive(Union)]pub enum GraphqlSoupDocumentSubType {@@ -610,6 +617,8 @@ pub enum GraphqlSoupDocumentSubType {Task(GraphqlTaskSubType),/// the sub type is a snippetSnippet(GraphqlSnippetSubType),+ /// the sub type is a skill+ Skill(GraphqlSkillSubType),}impl GraphqlSoupDocumentSubType {@@ -622,6 +631,7 @@ impl GraphqlSoupDocumentSubType {SoupDocumentSubType::Snippet {} => {Self::Snippet(GraphqlSnippetSubType { nothing: false })}+ SoupDocumentSubType::Skill {} => Self::Skill(GraphqlSkillSubType { nothing: false }),}}}diff --git a/crates/macro_db_client/migrations/20260730212157_add_skill_document_sub_type.sql b/crates/macro_db_client/migrations/20260730212157_add_skill_document_sub_type.sqlnew file mode 100644index 0000000000..9b5e5387e5--- /dev/null+++ b/crates/macro_db_client/migrations/20260730212157_add_skill_document_sub_type.sql@@ -0,0 +1 @@+ALTER TYPE document_sub_type_value ADD VALUE IF NOT EXISTS 'skill';diff --git a/crates/macro_db_client/src/dcs/append_attachment_to_chat.rs b/crates/macro_db_client/src/dcs/append_attachment_to_chat.rsindex 5719d6a796..18c844e0dc 100644--- a/crates/macro_db_client/src/dcs/append_attachment_to_chat.rs+++ b/crates/macro_db_client/src/dcs/append_attachment_to_chat.rs@@ -10,6 +10,7 @@ fn attachment_type_to_entity_type(at: &AttachmentType) -> EntityType {AttachmentType::Channel => EntityType::Channel,AttachmentType::Email => EntityType::EmailThread,AttachmentType::Project => EntityType::Project,+ AttachmentType::Skill => EntityType::Skill,}}diff --git a/crates/macro_db_client/src/dcs/create_chat_message.rs b/crates/macro_db_client/src/dcs/create_chat_message.rsindex a46b281012..6ab3c8d1d1 100644--- a/crates/macro_db_client/src/dcs/create_chat_message.rs+++ b/crates/macro_db_client/src/dcs/create_chat_message.rs@@ -11,6 +11,7 @@ fn attachment_type_to_entity_type(at: &AttachmentType) -> EntityType {AttachmentType::Channel => EntityType::Channel,AttachmentType::Email => EntityType::EmailThread,AttachmentType::Project => EntityType::Project,+ AttachmentType::Skill => EntityType::Skill,}}diff --git a/crates/macro_db_client/src/item_access/delete.rs b/crates/macro_db_client/src/item_access/delete.rsindex 59d8ef6166..8cca3cf0a4 100644--- a/crates/macro_db_client/src/item_access/delete.rs+++ b/crates/macro_db_client/src/item_access/delete.rs@@ -41,6 +41,7 @@ pub async fn delete_user_entity_access_bulk(| EntityType::StaticFile| EntityType::CrmCompany| EntityType::CrmContact+ | EntityType::Skill| EntityType::ForeignEntity// Reminders own no entity_access rows to delete.| EntityType::Reminder => {diff --git a/crates/memory/src/context.rs b/crates/memory/src/context.rsindex 2cf2f64356..536415d155 100644--- a/crates/memory/src/context.rs+++ b/crates/memory/src/context.rs@@ -225,8 +225,11 @@ pub async fn build_tool_service_context();+ let skill_tool_context =+ ai_tools::build_skill_tool_context(search_client.clone(), soup_service.clone());+Ok(ToolServiceContext {- search_service_client: search_client,+ search_service_client: search_client.clone(),email_service_client: email_ext_client,soup_service,email_service: email_service_for_tools,@@ -243,6 +246,7 @@ pub async fn build_tool_service_context(),team_tool_context: ai_tools::build_team_tool_context(pool.clone()),crm_tool_context: ai_tools::build_crm_tool_context(pool.clone()),+ skill_tool_context,schedule_tool_context: ai_tools::NoOpScheduleContext,anthropic_tool_context: ai_tools::build_anthropic_tool_context(),recorder: ai_usage::pg_recorder(pool.clone()),diff --git a/crates/model-entity/src/lib.rs b/crates/model-entity/src/lib.rsindex addc17d293..c1447f18d9 100644--- a/crates/model-entity/src/lib.rs+++ b/crates/model-entity/src/lib.rs@@ -62,6 +62,9 @@ pub enum EntityType {CrmContact,/// The entity is a reminder set by a userReminder,+ /// The entity is an AI skill: either a skill document or a built-in+ /// system skill (see the `system_skills` crate)+ Skill,}impl EntityType {@@ -92,6 +95,9 @@ impl EntityType {// from its owner column, not from a row in the `entity_access`// table — the same shape as channels and CRM entities.EntityType::Reminder => false,+ // Skill refs are access-checked against the underlying document+ // (system skills are visible to everyone).+ EntityType::Skill => false,}}/// provide an entity string slice to upgrade this type into an [Entity]diff --git a/crates/model/src/chat/mod.rs b/crates/model/src/chat/mod.rsindex 218b90f41e..82be5de7c7 100644--- a/crates/model/src/chat/mod.rs+++ b/crates/model/src/chat/mod.rs@@ -56,6 +56,7 @@ pub enum AttachmentType {Channel,Email,Project,+ Skill,}#[derive(sqlx::FromRow, Serialize, Deserialize, Eq, PartialEq, Debug, Clone, ToSchema)]diff --git a/crates/model/src/document/mod.rs b/crates/model/src/document/mod.rsindex 710563b55c..84edc00c57 100644--- a/crates/model/src/document/mod.rs+++ b/crates/model/src/document/mod.rs@@ -50,6 +50,8 @@ pub enum BasicDocumentSubType {},/// A snippet document — reusable markdownSnippet {},+ /// A skill document — markdown instructions for AI+ Skill {},}impl BasicDocumentSubType {@@ -61,6 +63,7 @@ impl BasicDocumentSubType {is_completed: is_completed.unwrap_or_default(),}),DocumentSubType::Snippet => Some(Self::Snippet {}),+ DocumentSubType::Skill => Some(Self::Skill {}),}}}@@ -321,6 +324,8 @@ pub enum DocumentPreviewDataSubType {},/// A snippet document — reusable markdownSnippet {},+ /// A skill document — markdown instructions for AI+ Skill {},}impl DocumentPreviewDataSubType {@@ -332,6 +337,7 @@ impl DocumentPreviewDataSubType {is_completed: is_completed.unwrap_or_default(),}),DocumentSubType::Snippet => Some(Self::Snippet {}),+ DocumentSubType::Skill => Some(Self::Skill {}),}}}diff --git a/crates/model_notifications/src/metadata.rs b/crates/model_notifications/src/metadata.rsindex c77c39f1fe..353c574335 100644--- a/crates/model_notifications/src/metadata.rs+++ b/crates/model_notifications/src/metadata.rs@@ -628,6 +628,7 @@ pub struct ChannelReplyMetadata {pub enum NotificationDocumentSubType {Task,Snippet,+ Skill,}/// Someone mentioned a document in a channeldiff --git a/crates/models_properties/src/shared/entity_type.rs b/crates/models_properties/src/shared/entity_type.rsindex b657c64b10..94710bcc5f 100644--- a/crates/models_properties/src/shared/entity_type.rs+++ b/crates/models_properties/src/shared/entity_type.rs@@ -69,8 +69,8 @@ impl From<DocumentSubType> for EntityType {fn from(sub_type: DocumentSubType) -> Self {match sub_type {DocumentSubType::Task => EntityType::Task,- // No dedicated property entity type for snippets; they key under Document.- DocumentSubType::Snippet => EntityType::Document,+ // No dedicated property entity type for snippets or skills; they key under Document.+ DocumentSubType::Snippet | DocumentSubType::Skill => EntityType::Document,}}}diff --git a/crates/models_soup/src/document.rs b/crates/models_soup/src/document.rsindex eb0d5fc4e0..fe6679bfaa 100644--- a/crates/models_soup/src/document.rs+++ b/crates/models_soup/src/document.rs@@ -19,6 +19,8 @@ pub enum SoupDocumentSubType {},/// A snippet document — reusable markdownSnippet {},+ /// A skill document — markdown instructions for AI+ Skill {},}impl SoupDocumentSubType {@@ -30,6 +32,7 @@ impl SoupDocumentSubType {is_completed: is_completed.unwrap_or_default(),}),DocumentSubType::Snippet => Some(Self::Snippet {}),+ DocumentSubType::Skill => Some(Self::Skill {}),}}@@ -37,7 +40,7 @@ impl SoupDocumentSubType {pub fn is_task_completed(&self) -> Option<bool> {match self {Self::Task { is_completed } => Some(*is_completed),- Self::Snippet {} => None,+ Self::Snippet {} | Self::Skill {} => None,}}}@@ -113,13 +116,15 @@ impl<T> SoupDocument<T> {/// Returns the entity type for this document.////// Documents with a `sub_type` of `Task` return `EntityType::Task`,- /// otherwise they return `EntityType::Document`. Snippets are documents- /// as far as the entity system is concerned — their snippet-ness only- /// lives in `sub_type`.+ /// otherwise they return `EntityType::Document`. Snippets and skills are+ /// documents as far as the entity system is concerned — their snippet-ness+ /// or skill-ness only lives in `sub_type`.pub fn entity_type(&self) -> EntityType {match &self.sub_type {Some(SoupDocumentSubType::Task { .. }) => EntityType::Task,- Some(SoupDocumentSubType::Snippet {}) | None => EntityType::Document,+ Some(SoupDocumentSubType::Snippet {} | SoupDocumentSubType::Skill {}) | None => {+ EntityType::Document+ }}}}diff --git a/crates/prompt/src/lib.rs b/crates/prompt/src/lib.rsindex 137b8e1dfa..143f740284 100644--- a/crates/prompt/src/lib.rs+++ b/crates/prompt/src/lib.rs@@ -15,6 +15,7 @@ pub mod email;pub mod math;pub mod mcp_item_links;pub mod mentions;+pub mod skills;pub mod tone;pub mod tool_usage;mod types;@@ -31,9 +32,11 @@ pub static BASE_PROMPT: ComposedPrompt = tone::PROMPT.compose(&about_macro::PROMPT);/// The tool-enabled prompt: [`BASE_PROMPT`] with the tool use instructions,-/// document-content linking rules, and email inbox behavior appended.+/// skill-following rules, document-content linking rules, and email inbox+/// behavior appended.pub static TOOL_USE_PROMPT: ComposedPrompt = BASE_PROMPT.compose(&tool_usage::PROMPT)+ .compose(&skills::PROMPT).compose(&document_content_links::PROMPT).compose(&email::PROMPT);diff --git a/crates/prompt/src/skills.rs b/crates/prompt/src/skills.rsnew file mode 100644index 0000000000..13d110efcf--- /dev/null+++ b/crates/prompt/src/skills.rs@@ -0,0 +1,18 @@+//! Explains what skills are and how to follow them.++use crate::types::StaticPrompt;++static TITLE: &str = "Skills";++static INSTRUCTIONS: &str = r##"- Skills are named sets of instructions you read and follow when a skill is referenced in a request. Most are markdown documents; built-in system skills are served the same way but have no document behind them.+- An attachment marked `<metadata key=type value=skill/>` is a skill. Treat its content as instructions for the current request — not as a document under discussion.+- When a request names a skill that is not attached, find it with SearchSkills (or ListSkills) and read its instructions with ReadContent before answering.+- Apply a skill's instructions to the request that invoked it; do not carry them into unrelated requests.+"##;++static INTENT: &str = "The AI treats skill-marked attachments as instructions to follow for the \+ invoking request, and looks up skills referenced by name with the skill tools before \+ answering.";++/// The skills prompt.+pub static PROMPT: StaticPrompt<'static> = StaticPrompt::borrowed(TITLE, INSTRUCTIONS, INTENT);diff --git a/crates/properties/src/domain/service_impl/mod.rs b/crates/properties/src/domain/service_impl/mod.rsindex 4a66710822..0407eb376a 100644--- a/crates/properties/src/domain/service_impl/mod.rs+++ b/crates/properties/src/domain/service_impl/mod.rs@@ -251,7 +251,9 @@ where.and_then(|document_id| document_sub_types.get(&document_id)).map_or(EntityType::Document, |sub_type| match sub_type {DocumentSubType::Task => EntityType::Task,- DocumentSubType::Snippet => EntityType::Document,+ DocumentSubType::Snippet | DocumentSubType::Skill => {+ EntityType::Document+ }}),AccessEntityType::EmailThread => EntityType::Thread,AccessEntityType::Call => EntityType::CallRecord,diff --git a/crates/skills/Cargo.toml b/crates/skills/Cargo.tomlnew file mode 100644index 0000000000..e398a158f3--- /dev/null+++ b/crates/skills/Cargo.toml@@ -0,0 +1,55 @@+[package]+edition = "2024"+name = "skills"+publish = false+version = "0.1.0"++[features]+ai_tools = ["dep:ai_toolset", "dep:async-trait", "dep:schemars", "dep:serde", "ports"]+default = ["ai_tools", "outbound", "ports"]+outbound = [+ "dep:cowlike",+ "dep:document_sub_type",+ "dep:email",+ "dep:filter_ast",+ "dep:item_filters",+ "dep:models_pagination",+ "dep:models_search",+ "dep:models_soup",+ "dep:search_service_client",+ "dep:soup",+ "ports",+]+ports = []++[dependencies]+anyhow = { workspace = true }+chrono = { workspace = true }+macro_user_id = { path = "../macro_user_id" }+system_skills = { path = "../system_skills" }+thiserror = { workspace = true }+tracing = { workspace = true }+uuid = { workspace = true }++# AI toolset dependencies+ai_toolset = { path = "../ai_toolset", optional = true }+async-trait = { workspace = true, optional = true }+schemars = { workspace = true, optional = true }+serde = { workspace = true, optional = true }++# Outbound dependencies+cowlike = { path = "../cowlike", optional = true }+document_sub_type = { path = "../document_sub_type", optional = true }+email = { path = "../email", default-features = false, optional = true }+filter_ast = { path = "../filter_ast", optional = true }+item_filters = { path = "../item_filters", optional = true }+models_pagination = { path = "../models_pagination", optional = true }+models_search = { path = "../models_search", optional = true }+models_soup = { path = "../models_soup", optional = true }+search_service_client = { path = "../search_service_client", optional = true }+soup = { path = "../soup", default-features = false, features = ["ports"], optional = true }++workspace-hack = { version = "0.1", path = "../workspace-hack" }++[dev-dependencies]+tokio = { workspace = true, features = ["macros", "rt"] }diff --git a/crates/skills/src/domain.rs b/crates/skills/src/domain.rsnew file mode 100644index 0000000000..47511f19d5--- /dev/null+++ b/crates/skills/src/domain.rs@@ -0,0 +1,5 @@+//! Domain layer for skills: models, ports, and the service implementation.++pub mod model;+pub mod ports;+pub mod service;diff --git a/crates/skills/src/domain/model.rs b/crates/skills/src/domain/model.rsnew file mode 100644index 0000000000..8f4222e727--- /dev/null+++ b/crates/skills/src/domain/model.rs@@ -0,0 +1,38 @@+//! Domain models for skills.++use chrono::{DateTime, Utc};++/// A skill returned from a skill search.+#[derive(Debug, Clone, PartialEq, Eq)]+pub struct SkillSummary {+ /// The document id of the skill.+ pub document_id: uuid::Uuid,+ /// The name of the skill.+ pub name: String,+ /// When the skill document was last updated, when known.+ pub updated_at: Option<DateTime<Utc>>,+}++/// How search terms are matched against skill names.+#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]+pub enum SkillMatchType {+ /// Prefix matching: a single-word term matches tokens that start with it.+ #[default]+ Partial,+ /// Whole-token / exact-phrase matching, no prefix expansion.+ Exact,+}++/// Errors returned by skill operations.+#[derive(Debug, thiserror::Error)]+pub enum SkillError {+ /// The request is invalid.+ #[error("{0}")]+ InvalidRequest(String),+ /// The search backend failed.+ #[error("skill search failed")]+ SearchFailed(#[source] anyhow::Error),+ /// The listing backend failed.+ #[error("skill listing failed")]+ ListFailed(#[source] anyhow::Error),+}diff --git a/crates/skills/src/domain/ports.rs b/crates/skills/src/domain/ports.rsnew file mode 100644index 0000000000..3feb2b23fc--- /dev/null+++ b/crates/skills/src/domain/ports.rs@@ -0,0 +1,51 @@+//! Ports for skill functionality.++use macro_user_id::user_id::MacroUserIdStr;++use crate::domain::model::{SkillError, SkillMatchType, SkillSummary};++/// Outbound port: searches the skill documents visible to a user by name.+///+/// Implementations are responsible for enforcing per-user access control:+/// only skills the user can view may be returned.+pub trait SkillSearcher: Send + Sync + 'static {+ /// Search skills visible to `user_id` whose name matches `query`.+ fn search_skills_by_name(+ &self,+ user_id: &MacroUserIdStr<'_>,+ query: &str,+ match_type: SkillMatchType,+ ) -> impl Future<Output = Result<Vec<SkillSummary>, SkillError>> + Send;+}++/// Outbound port: lists the skill documents visible to a user.+///+/// Implementations are responsible for enforcing per-user access control:+/// only skills the user can view may be returned.+pub trait SkillLister: Send + Sync + 'static {+ /// List up to `limit` skills visible to `user_id`, most recently updated+ /// first.+ fn list_skills(+ &self,+ user_id: &MacroUserIdStr<'_>,+ limit: u16,+ ) -> impl Future<Output = Result<Vec<SkillSummary>, SkillError>> + Send;+}++/// Inbound port: skill use cases exposed to inbound adapters.+pub trait SkillService: Send + Sync + 'static {+ /// Search the skills visible to `user_id` whose name matches `query`,+ /// most recently updated first.+ fn search_skills(+ &self,+ user_id: &MacroUserIdStr<'_>,+ query: &str,+ match_type: SkillMatchType,+ ) -> impl Future<Output = Result<Vec<SkillSummary>, SkillError>> + Send;++ /// List the skills visible to `user_id`, most recently updated first.+ fn list_skills(+ &self,+ user_id: &MacroUserIdStr<'_>,+ ) -> impl Future<Output = Result<Vec<SkillSummary>, SkillError>> + Send;+}diff --git a/crates/skills/src/domain/service.rs b/crates/skills/src/domain/service.rsnew file mode 100644index 0000000000..3654593230--- /dev/null+++ b/crates/skills/src/domain/service.rs@@ -0,0 +1,128 @@+//! Domain service implementation for skills.++#[cfg(test)]+mod test;++use macro_user_id::user_id::MacroUserIdStr;++use crate::domain::model::{SkillError, SkillMatchType, SkillSummary};+use crate::domain::ports::{SkillLister, SkillSearcher, SkillService};++/// Maximum number of skills returned from a single listing.+const LIST_LIMIT: u16 = 100;++/// Skill domain service backed by a [`SkillSearcher`] and a [`SkillLister`].+#[derive(Debug, Clone)]+pub struct SkillServiceImpl<S, L> {+ searcher: S,+ lister: L,+}++impl<S, L> SkillServiceImpl<S, L> {+ /// Create a new skill service from a searcher and a lister.+ pub fn new(searcher: S, lister: L) -> Self {+ Self { searcher, lister }+ }+}++fn sort_most_recently_updated_first(skills: &mut [SkillSummary]) {+ skills.sort_by(|a, b| {+ b.updated_at+ .cmp(&a.updated_at)+ .then_with(|| a.document_id.cmp(&b.document_id))+ });+}++fn system_skill_summaries() -> impl Iterator<Item = SkillSummary> {+ system_skills::SYSTEM_SKILLS+ .iter()+ .map(|skill| SkillSummary {+ document_id: skill.id(),+ name: skill.name.to_string(),+ updated_at: None,+ })+}++fn tokenize(text: &str) -> Vec<String> {+ text.to_lowercase()+ .split(|c: char| !c.is_alphanumeric())+ .filter(|token| !token.is_empty())+ .map(str::to_string)+ .collect()+}++/// Matches a system skill name against a query with the same semantics the+/// search service applies to skill documents: the query tokens must appear as+/// an adjacent run of name tokens. [`SkillMatchType::Partial`] additionally+/// lets the final query token match a name-token prefix.+fn system_skill_name_matches(name: &str, query: &str, match_type: SkillMatchType) -> bool {+ let name_tokens = tokenize(name);+ let query_tokens = tokenize(query);+ if query_tokens.is_empty() || query_tokens.len() > name_tokens.len() {+ return false;+ }++ (0..=name_tokens.len() - query_tokens.len()).any(|start| {+ query_tokens+ .iter()+ .enumerate()+ .all(|(offset, query_token)| {+ let name_token = &name_tokens[start + offset];+ let is_last = offset == query_tokens.len() - 1;+ match match_type {+ SkillMatchType::Exact => name_token == query_token,+ SkillMatchType::Partial if is_last => name_token.starts_with(query_token),+ SkillMatchType::Partial => name_token == query_token,+ }+ })+ })+}++impl<S: SkillSearcher, L: SkillLister> SkillService for SkillServiceImpl<S, L> {+ #[tracing::instrument(skip(self), err)]+ async fn search_skills(+ &self,+ user_id: &MacroUserIdStr<'_>,+ query: &str,+ match_type: SkillMatchType,+ ) -> Result<Vec<SkillSummary>, SkillError> {+ let query = query.trim();+ if query.is_empty() {+ return Err(SkillError::InvalidRequest(+ "query must not be empty".to_string(),+ ));+ }++ let mut skills = self+ .searcher+ .search_skills_by_name(user_id, query, match_type)+ .await?;++ // System skills are static, so they are matched here rather than by+ // the search backend.+ skills.extend(+ system_skill_summaries()+ .filter(|skill| system_skill_name_matches(&skill.name, query, match_type)),+ );++ sort_most_recently_updated_first(&mut skills);++ Ok(skills)+ }++ #[tracing::instrument(skip(self), err)]+ async fn list_skills(+ &self,+ user_id: &MacroUserIdStr<'_>,+ ) -> Result<Vec<SkillSummary>, SkillError> {+ let mut skills = self.lister.list_skills(user_id, LIST_LIMIT).await?;++ // System skills are visible to everyone; having no update timestamp,+ // they sort after every user skill.+ skills.extend(system_skill_summaries());++ sort_most_recently_updated_first(&mut skills);++ Ok(skills)+ }+}diff --git a/crates/skills/src/domain/service/test.rs b/crates/skills/src/domain/service/test.rsnew file mode 100644index 0000000000..a37ab84d28--- /dev/null+++ b/crates/skills/src/domain/service/test.rs@@ -0,0 +1,238 @@+use std::sync::Mutex;++use chrono::{TimeZone, Utc};++use super::*;++struct FakeSearcher {+ results: Mutex<Option<Result<Vec<SkillSummary>, SkillError>>>,+}++impl FakeSearcher {+ fn returning(results: Vec<SkillSummary>) -> Self {+ Self {+ results: Mutex::new(Some(Ok(results))),+ }+ }++ fn failing() -> Self {+ Self {+ results: Mutex::new(Some(Err(SkillError::SearchFailed(anyhow::anyhow!(+ "search service unavailable"+ ))))),+ }+ }++ fn unused() -> Self {+ Self {+ results: Mutex::new(None),+ }+ }+}++impl SkillSearcher for FakeSearcher {+ async fn search_skills_by_name(+ &self,+ _user_id: &MacroUserIdStr<'_>,+ _query: &str,+ _match_type: SkillMatchType,+ ) -> Result<Vec<SkillSummary>, SkillError> {+ self.results+ .lock()+ .unwrap()+ .take()+ .expect("searcher called more than once")+ }+}++struct FakeLister {+ results: Mutex<Option<Result<Vec<SkillSummary>, SkillError>>>,+}++impl FakeLister {+ fn returning(results: Vec<SkillSummary>) -> Self {+ Self {+ results: Mutex::new(Some(Ok(results))),+ }+ }++ fn failing() -> Self {+ Self {+ results: Mutex::new(Some(Err(SkillError::ListFailed(anyhow::anyhow!(+ "soup service unavailable"+ ))))),+ }+ }++ fn unused() -> Self {+ Self {+ results: Mutex::new(None),+ }+ }+}++impl SkillLister for FakeLister {+ async fn list_skills(+ &self,+ _user_id: &MacroUserIdStr<'_>,+ _limit: u16,+ ) -> Result<Vec<SkillSummary>, SkillError> {+ self.results+ .lock()+ .unwrap()+ .take()+ .expect("lister called more than once")+ }+}++fn user() -> MacroUserIdStr<'static> {+ MacroUserIdStr::try_from("macro|[email protected]".to_string()).unwrap()+}++fn skill(id: u128, name: &str, updated_at_secs: Option<i64>) -> SkillSummary {+ SkillSummary {+ document_id: uuid::Uuid::from_u128(id),+ name: name.to_string(),+ updated_at: updated_at_secs.map(|secs| Utc.timestamp_opt(secs, 0).unwrap()),+ }+}++#[tokio::test]+async fn empty_query_is_rejected_without_calling_the_searcher() {+ let service = SkillServiceImpl::new(FakeSearcher::returning(vec![]), FakeLister::unused());++ let error = service+ .search_skills(&user(), " ", SkillMatchType::Partial)+ .await+ .unwrap_err();++ assert!(matches!(error, SkillError::InvalidRequest(_)));+}++#[tokio::test]+async fn search_results_are_sorted_most_recently_updated_first() {+ let service = SkillServiceImpl::new(+ FakeSearcher::returning(vec![+ skill(1, "older", Some(100)),+ skill(2, "newest", Some(300)),+ skill(3, "never-updated", None),+ skill(4, "newer", Some(200)),+ ]),+ FakeLister::unused(),+ );++ // A query no system skill name matches, so only searcher results return.+ let results = service+ .search_skills(&user(), "quarterly report", SkillMatchType::Partial)+ .await+ .unwrap();++ let names: Vec<&str> = results.iter().map(|s| s.name.as_str()).collect();+ assert_eq!(names, vec!["newest", "newer", "older", "never-updated"]);+}++#[tokio::test]+async fn search_includes_matching_system_skills() {+ let service = SkillServiceImpl::new(FakeSearcher::returning(vec![]), FakeLister::unused());++ let results = service+ .search_skills(&user(), "skill authoring", SkillMatchType::Partial)+ .await+ .unwrap();++ assert_eq!(+ results,+ vec![SkillSummary {+ document_id: system_skills::skill_authoring::SKILL.id(),+ name: "Skill Authoring Guide".to_string(),+ updated_at: None,+ }]+ );+}++#[tokio::test]+async fn search_excludes_non_matching_system_skills() {+ // "author" alone only prefix-matches when partial; exact must not match.+ let partial = SkillServiceImpl::new(FakeSearcher::returning(vec![]), FakeLister::unused())+ .search_skills(&user(), "author", SkillMatchType::Partial)+ .await+ .unwrap();+ let exact = SkillServiceImpl::new(FakeSearcher::returning(vec![]), FakeLister::unused())+ .search_skills(&user(), "author", SkillMatchType::Exact)+ .await+ .unwrap();++ assert_eq!(partial.len(), 1);+ assert!(exact.is_empty());+}++#[tokio::test]+async fn system_skill_matching_requires_adjacent_tokens() {+ let service = SkillServiceImpl::new(FakeSearcher::returning(vec![]), FakeLister::unused());++ // "skill guide" skips the middle token, so the phrase must not match.+ let results = service+ .search_skills(&user(), "skill guide", SkillMatchType::Partial)+ .await+ .unwrap();++ assert!(results.is_empty());+}++#[tokio::test]+async fn searcher_errors_are_propagated() {+ let service = SkillServiceImpl::new(FakeSearcher::failing(), FakeLister::unused());++ let error = service+ .search_skills(&user(), "skill", SkillMatchType::Partial)+ .await+ .unwrap_err();++ assert!(matches!(error, SkillError::SearchFailed(_)));+}++#[tokio::test]+async fn listed_skills_are_sorted_most_recently_updated_first() {+ let service = SkillServiceImpl::new(+ FakeSearcher::unused(),+ FakeLister::returning(vec![+ skill(1, "older", Some(100)),+ skill(2, "newest", Some(300)),+ skill(3, "never-updated", None),+ ]),+ );++ let results = service.list_skills(&user()).await.unwrap();++ let names: Vec<&str> = results.iter().map(|s| s.name.as_str()).collect();+ // System skills have no update timestamp, so they sort with (after, by+ // id) the never-updated user skills.+ assert_eq!(names.first(), Some(&"newest"));+ assert_eq!(names.get(1), Some(&"older"));+ assert!(names.contains(&"never-updated"));+ for system in system_skills::SYSTEM_SKILLS {+ assert!(names.contains(&system.name));+ }+}++#[tokio::test]+async fn listing_always_includes_system_skills() {+ let service = SkillServiceImpl::new(FakeSearcher::unused(), FakeLister::returning(vec![]));++ let results = service.list_skills(&user()).await.unwrap();++ let names: Vec<&str> = results.iter().map(|s| s.name.as_str()).collect();+ assert_eq!(names.len(), system_skills::SYSTEM_SKILLS.len());+ for system in system_skills::SYSTEM_SKILLS {+ assert!(names.contains(&system.name));+ }+}++#[tokio::test]+async fn lister_errors_are_propagated() {+ let service = SkillServiceImpl::new(FakeSearcher::unused(), FakeLister::failing());++ let error = service.list_skills(&user()).await.unwrap_err();++ assert!(matches!(error, SkillError::ListFailed(_)));+}diff --git a/crates/skills/src/inbound.rs b/crates/skills/src/inbound.rsnew file mode 100644index 0000000000..bb3c112477--- /dev/null+++ b/crates/skills/src/inbound.rs@@ -0,0 +1,4 @@+//! Inbound adapters for skill functionality.++#[cfg(feature = "ai_tools")]+pub mod toolset;diff --git a/crates/skills/src/inbound/toolset/list_skills.rs b/crates/skills/src/inbound/toolset/list_skills.rsnew file mode 100644index 0000000000..967d1f1262--- /dev/null+++ b/crates/skills/src/inbound/toolset/list_skills.rs@@ -0,0 +1,57 @@+use ai_toolset::{AsyncTool, RequestContext, ServiceContext, ToolCallError, ToolResult};+use async_trait::async_trait;+use schemars::JsonSchema;+use serde::{Deserialize, Serialize};++use super::SkillToolContext;+use super::search_skills::SkillSearchResult;+use crate::domain::ports::SkillService;++/// AI tool input for listing the user's skills.+#[derive(Debug, JsonSchema, Deserialize, Clone, Default)]+#[serde(rename_all = "camelCase")]+#[schemars(+ title = "ListSkills",+ description = "List the skills the user can access, most recently updated first. Skills are markdown documents containing instructions for AI to read and follow; after finding a relevant skill, read its instructions with ReadContent using the returned document id. Use this to discover what skills exist; when looking for a specific skill by name, prefer SearchSkills."+)]+pub struct ListSkills {}++/// Response for a skill listing.+#[derive(Debug, Serialize, JsonSchema)]+#[serde(rename_all = "camelCase")]+pub struct ListSkillsResponse {+ /// The user's skills, most recently updated first.+ pub results: Vec<SkillSearchResult>,+}++#[async_trait]+impl<Svc: SkillService> AsyncTool<SkillToolContext<Svc>> for ListSkills {+ type Output = ListSkillsResponse;++ #[tracing::instrument(skip_all, fields(user_id=?request_context.user_id), err)]+ async fn call(+ &self,+ service_context: ServiceContext<SkillToolContext<Svc>>,+ request_context: RequestContext,+ ) -> ToolResult<Self::Output> {+ let skills = service_context+ .service+ .list_skills(&request_context.user_id)+ .await+ .map_err(|error| ToolCallError {+ description: "failed to list skills".to_string(),+ internal_error: error.into(),+ })?;++ Ok(ListSkillsResponse {+ results: skills+ .into_iter()+ .map(|skill| SkillSearchResult {+ document_id: skill.document_id,+ name: skill.name,+ updated_at: skill.updated_at,+ })+ .collect(),+ })+ }+}diff --git a/crates/skills/src/inbound/toolset/mod.rs b/crates/skills/src/inbound/toolset/mod.rsnew file mode 100644index 0000000000..e57ead5bcf--- /dev/null+++ b/crates/skills/src/inbound/toolset/mod.rs@@ -0,0 +1,47 @@+//! Toolset inbound adapter for skills.+//!+//! Exposes the skill search and listing tools (`SearchSkills`, `ListSkills`)+//! to AI agents. Skills are markdown documents (sub type `skill`) whose+//! content is read with the existing document toolset (`ReadContent`).++mod list_skills;+mod search_skills;++use std::sync::Arc;++use ai_toolset::AsyncToolCollection;++use crate::domain::ports::SkillService;++pub use list_skills::{ListSkills, ListSkillsResponse};+pub use search_skills::{SearchSkills, SearchSkillsResponse, SkillSearchResult};++/// Service context for skill AI tools.+pub struct SkillToolContext<Svc: SkillService> {+ /// The skill domain service used to search skills.+ pub service: Arc<Svc>,+}++impl<Svc: SkillService> Clone for SkillToolContext<Svc> {+ fn clone(&self) -> Self {+ Self {+ service: self.service.clone(),+ }+ }+}++impl<Svc: SkillService> SkillToolContext<Svc> {+ /// Create a new skill tool context.+ pub fn new(service: Svc) -> Self {+ Self {+ service: Arc::new(service),+ }+ }+}++/// Create the skill toolset.+pub fn skill_toolset<Svc: SkillService>() -> AsyncToolCollection<SkillToolContext<Svc>> {+ AsyncToolCollection::new()+ .add_tool::<SearchSkills, SkillToolContext<Svc>>()+ .add_tool::<ListSkills, SkillToolContext<Svc>>()+}diff --git a/crates/skills/src/inbound/toolset/search_skills.rs b/crates/skills/src/inbound/toolset/search_skills.rsnew file mode 100644index 0000000000..fa331a5c96--- /dev/null+++ b/crates/skills/src/inbound/toolset/search_skills.rs@@ -0,0 +1,112 @@+use ai_toolset::{AsyncTool, RequestContext, ServiceContext, ToolCallError, ToolResult};+use async_trait::async_trait;+use chrono::{DateTime, Utc};+use schemars::JsonSchema;+use serde::{Deserialize, Serialize};+use uuid::Uuid;++use super::SkillToolContext;+use crate::domain::model::{SkillError, SkillMatchType};+use crate::domain::ports::SkillService;++/// How search terms are matched against skill names.+#[derive(Debug, Clone, Copy, Default, Deserialize, JsonSchema)]+#[serde(rename_all = "lowercase")]+pub enum SearchSkillsMatchType {+ /// Prefix matching: a single-word term matches tokens that start with it.+ #[default]+ Partial,+ /// Whole-token / exact-phrase matching, no prefix expansion.+ Exact,+}++impl From<SearchSkillsMatchType> for SkillMatchType {+ fn from(value: SearchSkillsMatchType) -> Self {+ match value {+ SearchSkillsMatchType::Partial => SkillMatchType::Partial,+ SearchSkillsMatchType::Exact => SkillMatchType::Exact,+ }+ }+}++/// AI tool input for searching the user's skills by name.+#[derive(Debug, JsonSchema, Deserialize, Clone)]+#[serde(rename_all = "camelCase")]+#[schemars(+ title = "SearchSkills",+ description = "Search the user's skills by name. Skills are markdown documents containing instructions for AI to read and follow; when the user references a skill (or a request matches one), find it with this tool and then read its instructions with ReadContent using the returned document id. This is keyword search against skill names: pass 1-3 targeted keywords that would literally appear in the skill's name, not a natural-language description. Matching defaults to prefix; set matchType to 'exact' for whole-token matching. Only skills the user can access are returned, most recently updated first."+)]+pub struct SearchSkills {+ /// The skill name to search.+ #[schemars(+ description = "The skill name to search. Pass 1-3 keywords drawn from words that would literally appear in the skill's name. The whole query is matched as a single adjacent phrase prefix, so long phrases will not match."+ )]+ pub name: String,++ /// Matching mode for the search terms.+ #[schemars(+ description = "Matching mode. 'partial' (the default) matches each word as a prefix, so `deplo` matches `deploy`. 'exact' matches whole tokens/phrases with no prefix expansion."+ )]+ #[serde(default)]+ pub match_type: SearchSkillsMatchType,+}++/// A skill matched by a skill search.+#[derive(Debug, Serialize, JsonSchema)]+#[serde(rename_all = "camelCase")]+pub struct SkillSearchResult {+ /// The document id of the skill. Read the skill's instructions with+ /// ReadContent using this id.+ pub document_id: Uuid,+ /// The name of the skill.+ pub name: String,+ /// When the skill was last updated, when known.+ #[serde(skip_serializing_if = "Option::is_none")]+ pub updated_at: Option<DateTime<Utc>>,+}++/// Response for a skill search.+#[derive(Debug, Serialize, JsonSchema)]+#[serde(rename_all = "camelCase")]+pub struct SearchSkillsResponse {+ /// The matched skills, most recently updated first.+ pub results: Vec<SkillSearchResult>,+}++#[async_trait]+impl<Svc: SkillService> AsyncTool<SkillToolContext<Svc>> for SearchSkills {+ type Output = SearchSkillsResponse;++ #[tracing::instrument(skip_all, fields(user_id=?request_context.user_id, name=%self.name), err)]+ async fn call(+ &self,+ service_context: ServiceContext<SkillToolContext<Svc>>,+ request_context: RequestContext,+ ) -> ToolResult<Self::Output> {+ let skills = service_context+ .service+ .search_skills(&request_context.user_id, &self.name, self.match_type.into())+ .await+ .map_err(|error| match error {+ SkillError::InvalidRequest(message) => ToolCallError {+ description: message.clone(),+ internal_error: anyhow::anyhow!(message),+ },+ error => ToolCallError {+ description: "failed to search skills".to_string(),+ internal_error: error.into(),+ },+ })?;++ Ok(SearchSkillsResponse {+ results: skills+ .into_iter()+ .map(|skill| SkillSearchResult {+ document_id: skill.document_id,+ name: skill.name,+ updated_at: skill.updated_at,+ })+ .collect(),+ })+ }+}diff --git a/crates/skills/src/lib.rs b/crates/skills/src/lib.rsnew file mode 100644index 0000000000..eb43ac5023--- /dev/null+++ b/crates/skills/src/lib.rs@@ -0,0 +1,21 @@+#![deny(missing_docs)]+//! Skills hexagonal architecture crate.+//!+//! Skills are markdown documents (document sub type `skill`) containing+//! instructions that AI reads and follows when the skill is referenced in an+//! AI input. This crate defines the skill search toolset and other skill+//! functionality.+//!+//! # Architecture+//!+//! - **domain**: domain models, ports (traits), service implementation+//! - **inbound**: adapters for incoming requests (AI toolset)+//! - **outbound**: adapters for external dependencies (search service)++pub mod domain;++#[cfg(feature = "ai_tools")]+pub mod inbound;++#[cfg(feature = "outbound")]+pub mod outbound;diff --git a/crates/skills/src/outbound.rs b/crates/skills/src/outbound.rsnew file mode 100644index 0000000000..d3ee3650fd--- /dev/null+++ b/crates/skills/src/outbound.rs@@ -0,0 +1,4 @@+//! Outbound adapters for skill functionality.++pub mod search_service_searcher;+pub mod soup_skill_lister;diff --git a/crates/skills/src/outbound/search_service_searcher.rs b/crates/skills/src/outbound/search_service_searcher.rsnew file mode 100644index 0000000000..9f1e92ef7a--- /dev/null+++ b/crates/skills/src/outbound/search_service_searcher.rs@@ -0,0 +1,82 @@+//! Outbound adapter implementing [`SkillSearcher`] via the search service.++use std::sync::Arc;++use document_sub_type::DocumentSubType;+use item_filters::{DocumentFilters, EntityFilters};+use macro_user_id::user_id::MacroUserIdStr;+use models_search::unified::{+ UnifiedSearchIndex, UnifiedSearchRequest, UnifiedSearchResponseItem,+ entity_filters_from_include,+};+use search_service_client::SearchServiceClient;++use crate::domain::model::{SkillError, SkillMatchType, SkillSummary};+use crate::domain::ports::SkillSearcher;++/// Maximum number of skills returned from a single search.+const PAGE_SIZE: i64 = 50;++/// [`SkillSearcher`] implementation backed by the search service. The search+/// service enforces per-user access control, so only skills the user can view+/// are returned.+#[derive(Clone)]+pub struct SearchServiceSkillSearcher {+ client: Arc<SearchServiceClient>,+}++impl SearchServiceSkillSearcher {+ /// Create a new searcher from a search service client.+ pub fn new(client: Arc<SearchServiceClient>) -> Self {+ Self { client }+ }+}++impl SkillSearcher for SearchServiceSkillSearcher {+ #[tracing::instrument(skip(self), err)]+ async fn search_skills_by_name(+ &self,+ user_id: &MacroUserIdStr<'_>,+ query: &str,+ match_type: SkillMatchType,+ ) -> Result<Vec<SkillSummary>, SkillError> {+ let base_filters = EntityFilters {+ document_filters: DocumentFilters {+ sub_types: vec![DocumentSubType::Skill.to_string()],+ ..Default::default()+ },+ ..Default::default()+ };++ let request = UnifiedSearchRequest {+ query: query.to_owned(),+ match_type: match match_type {+ SkillMatchType::Partial => models_search::MatchType::Partial,+ SkillMatchType::Exact => models_search::MatchType::Exact,+ },+ filters: entity_filters_from_include(vec![UnifiedSearchIndex::Documents], base_filters),+ search_on: models_search::SearchOn::Name,+ include_crm: false,+ collapse: None,+ };++ let response = self+ .client+ .search_unified(user_id.as_ref(), request, None, PAGE_SIZE)+ .await+ .map_err(SkillError::SearchFailed)?;++ Ok(response+ .results+ .into_iter()+ .filter_map(|item| match item {+ UnifiedSearchResponseItem::Document(doc) => Some(SkillSummary {+ document_id: doc.extra.id,+ name: doc.extra.document_name,+ updated_at: doc.metadata.as_ref().map(|m| m.updated_at),+ }),+ _ => None,+ })+ .collect())+ }+}diff --git a/crates/skills/src/outbound/soup_skill_lister.rs b/crates/skills/src/outbound/soup_skill_lister.rsnew file mode 100644index 0000000000..44dad576f0--- /dev/null+++ b/crates/skills/src/outbound/soup_skill_lister.rs@@ -0,0 +1,123 @@+//! Outbound adapter implementing [`SkillLister`] via the soup service.++use std::sync::Arc;++use cowlike::CowLike;+use document_sub_type::DocumentSubType;+use email::domain::models::PreviewView;+use filter_ast::Expr;+use item_filters::ast::{+ EntityFilterAst, calendar_event::CalendarEventLiteral, call::CallLiteral,+ channel::ChannelLiteral, channel::ChannelThreadLiteral, chat::ChatLiteral,+ crm_company::CrmCompanyLiteral, document::DocumentLiteral, email::EmailLiteral,+ foreign_entity::ForeignEntityLiteral, project::ProjectLiteral,+};+use macro_user_id::user_id::MacroUserIdStr;+use models_pagination::{SimpleSortMethod, TypeEraseCursor};+use models_soup::item::SoupItem;+use soup::domain::{+ models::{SoupQuery, SoupRequest, SoupSortDirection, SoupType},+ ports::SoupService,+};+use uuid::Uuid;++use crate::domain::model::{SkillError, SkillSummary};+use crate::domain::ports::SkillLister;++/// [`SkillLister`] implementation backed by the soup service, which enforces+/// per-user access control on results. Lists documents with the `skill` sub+/// type, most recently updated first.+pub struct SoupSkillLister<S> {+ soup: Arc<S>,+}++impl<S> SoupSkillLister<S> {+ /// Create a new lister from a soup service.+ pub fn new(soup: Arc<S>) -> Self {+ Self { soup }+ }+}++impl<S> Clone for SoupSkillLister<S> {+ fn clone(&self) -> Self {+ Self {+ soup: self.soup.clone(),+ }+ }+}++/// Filter AST matching only documents with the `skill` sub type: every other+/// entity type is force-filtered to the nil id so soup skips it entirely.+fn skill_only_filter() -> EntityFilterAst {+ EntityFilterAst {+ document_filter: Some(Arc::new(Expr::val(DocumentLiteral::SubType(+ DocumentSubType::Skill,+ )))),+ project_filter: Some(Arc::new(Expr::val(ProjectLiteral::ProjectId(Uuid::nil())))),+ chat_filter: Some(Arc::new(Expr::val(ChatLiteral::ChatId(Uuid::nil())))),+ email_filter: item_filters::ast::EmailFilterAst {+ tree: Some(Arc::new(Expr::val(EmailLiteral::ThreadId(Uuid::nil())))),+ crm_scope: None,+ },+ channel_filter: Some(Arc::new(Expr::val(ChannelLiteral::ChannelId(Uuid::nil())))),+ channel_thread_filter: Some(Arc::new(Expr::val(ChannelThreadLiteral::ThreadId(+ Uuid::nil(),+ )))),+ call_filter: Some(Arc::new(Expr::val(CallLiteral::CallId(Uuid::nil())))),+ crm_company_filter: Some(Arc::new(Expr::val(CrmCompanyLiteral::Id(Uuid::nil())))),+ foreign_entity_filter: Some(Arc::new(Expr::val(ForeignEntityLiteral::Id(Uuid::nil())))),+ calendar_event_filter: Some(Arc::new(Expr::val(CalendarEventLiteral::Id(Uuid::nil())))),+ // Reminders are opt-in: leaving the filter empty excludes them.+ reminder_filter: None,+ properties_filter: None,+ }+}++impl<S: SoupService> SkillLister for SoupSkillLister<S> {+ #[tracing::instrument(skip(self), err)]+ async fn list_skills(+ &self,+ user_id: &MacroUserIdStr<'_>,+ limit: u16,+ ) -> Result<Vec<SkillSummary>, SkillError> {+ let result = self+ .soup+ .get_user_soup(+ SoupRequest {+ // Expanded includes documents reachable via project access, and+ // is the only soup type that supports AST item filters (the+ // unexpanded repo path rejects them as not implemented).+ soup_type: SoupType::Expanded,+ limit,+ cursor: SoupQuery::new_sort_simple(+ SimpleSortMethod::UpdatedAt,+ skill_only_filter(),+ ),+ user: user_id.copied().into_owned(),+ // Most recently updated first.+ sort_direction: SoupSortDirection::default(),+ // Emails are force-filtered out above, so the preview view+ // and inbox links never come into play.+ email_preview_view: PreviewView::default(),+ link_ids: Vec::new(),+ },+ None,+ )+ .await+ .map_err(|e| SkillError::ListFailed(e.into()))?;++ Ok(result+ .type_erase()+ .items+ .into_iter()+ .filter_map(|item| match item {+ SoupItem::Document(doc) => Some(SkillSummary {+ document_id: doc.id,+ name: doc.name,+ updated_at: Some(doc.updated_at),+ }),+ _ => None,+ })+ .collect())+ }+}diff --git a/crates/soup/src/inbound/toolset/list_entities.rs b/crates/soup/src/inbound/toolset/list_entities.rsindex c92dbefa5b..aa7084f98c 100644--- a/crates/soup/src/inbound/toolset/list_entities.rs+++ b/crates/soup/src/inbound/toolset/list_entities.rs@@ -142,7 +142,8 @@ pub enum EntityItem {/// The document's file type (e.g. md, pdf, docx), when known.#[serde(skip_serializing_if = "Option::is_none")]file_type: Option<String>,- /// The document's sub type: "task" for Macro tasks, "snippet" for snippets.+ /// The document's sub type: "task" for Macro tasks, "snippet" for snippets,+ /// "skill" for skills.#[serde(skip_serializing_if = "Option::is_none")]sub_type: Option<String>,/// Tags on the document visible to the user.@@ -256,6 +257,7 @@ impl EntityItem {match sub_type {SoupDocumentSubType::Task { .. } => "task",SoupDocumentSubType::Snippet {} => "snippet",+ SoupDocumentSubType::Skill {} => "skill",}.to_string()}),@@ -396,7 +398,7 @@ pub struct ListEntities {/// Document entity AST filter.#[schemars(- description = "Full soup AST document filter (df). Use the same shape as /items/soup/ast, e.g. {\"l\":{\"id\":\"...\"}}. For Macro tasks, use {\"l\":{\"dst\":\"task\"}}. For \"completed yesterday\", AND the task subtype with updatedAt bounds, e.g. {\"&\":[{\"l\":{\"dst\":\"task\"}},{\"&\":[{\"l\":{\"ua\":{\"gte\":\"<start>\"}}},{\"l\":{\"ua\":{\"lt\":\"<end>\"}}}]}]} using ISO timestamps.",+ description = "Full soup AST document filter (df). Use the same shape as /items/soup/ast, e.g. {\"l\":{\"id\":\"...\"}}. For Macro tasks, use {\"l\":{\"dst\":\"task\"}}; for skills, {\"l\":{\"dst\":\"skill\"}}. For \"completed yesterday\", AND the task subtype with updatedAt bounds, e.g. {\"&\":[{\"l\":{\"dst\":\"task\"}},{\"&\":[{\"l\":{\"ua\":{\"gte\":\"<start>\"}}},{\"l\":{\"ua\":{\"lt\":\"<end>\"}}}]}]} using ISO timestamps.",with = "Option<serde_json::Value>")]#[serde(default, rename = "df")]diff --git a/crates/system_skills/Cargo.toml b/crates/system_skills/Cargo.tomlnew file mode 100644index 0000000000..52e15a5483--- /dev/null+++ b/crates/system_skills/Cargo.toml@@ -0,0 +1,10 @@+[package]+edition = "2024"+name = "system_skills"+publish = false+version = "0.1.0"++[dependencies]+prompt = { path = "../prompt" }+uuid = { workspace = true }+workspace-hack = { version = "0.1", path = "../workspace-hack" }diff --git a/crates/system_skills/src/demo.rs b/crates/system_skills/src/demo.rsnew file mode 100644index 0000000000..0e06347893--- /dev/null+++ b/crates/system_skills/src/demo.rs@@ -0,0 +1,30 @@+//! Demo system skill with obviously observable behavior, for verifying the+//! system skill plumbing end-to-end (menu, search, listing, and ReadContent).++use prompt::StaticPrompt;++use crate::SystemSkill;++static TITLE: &str = "Demo Skill";++static INSTRUCTIONS: &str = r##"Follow this skill when the user references the Demo Skill. It exists to make skill-following visible, so its rules are deliberately conspicuous.++- Start your reply with the exact line: `Demo skill active.`+- Answer the user's request in exactly three bullet points.+- End with a one-line summary prefixed with `Summary:`.++Apply these rules only to the reply that invoked the skill, not to the rest of the conversation.+"##;++static INTENT: &str = "Replies that invoke the demo skill start with \"Demo skill active.\", answer in exactly \+ three bullets, and end with a \"Summary:\" line.";++/// The skill's instructions as a composable prompt section.+pub static PROMPT: StaticPrompt<'static> = StaticPrompt::borrowed(TITLE, INSTRUCTIONS, INTENT);++/// The demo system skill.+pub static SKILL: SystemSkill = SystemSkill {+ slug: "demo",+ name: "Demo Skill",+ content: &PROMPT,+};diff --git a/crates/system_skills/src/lib.rs b/crates/system_skills/src/lib.rsnew file mode 100644index 0000000000..452de21227--- /dev/null+++ b/crates/system_skills/src/lib.rs@@ -0,0 +1,64 @@+//! Built-in "system" skills available to every user.+//!+//! System skills are defined entirely in code as composable static strings+//! (see the [`prompt`] crate) — they are not documents. They surface through+//! the same AI tools as user-authored skills (`ListSkills`, `SearchSkills`,+//! `ReadContent`) and in the skills menu, but cannot be opened or edited as+//! markdown documents.+//!+//! Each skill lives in its own module exporting a `SKILL` static, mirroring+//! how the [`prompt`] crate exports a `PROMPT` per section. Register new+//! skills in [`SYSTEM_SKILLS`]; the web app fetches them from the+//! `GET /system_skills` endpoint.+#![deny(missing_docs)]++use prompt::Section;+use uuid::Uuid;++pub mod demo;+pub mod skill_authoring;++#[cfg(test)]+mod test;++/// A built-in skill, defined as static strings rather than a document.+pub struct SystemSkill {+ /// Stable slug, unique across system skills. The skill's id derives from+ /// it — renaming a slug changes the id, so treat slugs as permanent.+ pub slug: &'static str,+ /// Display name, matched by skill search.+ pub name: &'static str,+ /// The skill's markdown instructions as a composable prompt section.+ pub content: Section,+}++/// UUIDv5 namespace for system skill ids. An arbitrary constant generated+/// once; changing it changes every system skill id.+const SYSTEM_SKILL_NAMESPACE: Uuid = uuid::uuid!("7e447d71-00ba-4440-92f1-d478d0ce8fe5");++impl SystemSkill {+ /// The skill's stable id: the UUIDv5 of its slug in+ /// [`SYSTEM_SKILL_NAMESPACE`]. Derived rather than stored so it cannot+ /// drift from the slug, and never collides with a real (v4) document id.+ pub fn id(&self) -> Uuid {+ Uuid::new_v5(&SYSTEM_SKILL_NAMESPACE, self.slug.as_bytes())+ }++ /// Render the skill's markdown instructions.+ pub fn render_content(&self) -> String {+ self.content.to_string()+ }+}++/// Every system skill, in display order.+pub static SYSTEM_SKILLS: &[&SystemSkill] = &[&skill_authoring::SKILL, &demo::SKILL];++/// Look up a system skill by its well-known id.+pub fn system_skill(id: Uuid) -> Option<&'static SystemSkill> {+ SYSTEM_SKILLS.iter().find(|skill| skill.id() == id).copied()+}++/// Whether `id` is a system skill id (and thus not a document id).+pub fn is_system_skill(id: Uuid) -> bool {+ system_skill(id).is_some()+}diff --git a/crates/system_skills/src/skill_authoring.rs b/crates/system_skills/src/skill_authoring.rsnew file mode 100644index 0000000000..777c8de2bf--- /dev/null+++ b/crates/system_skills/src/skill_authoring.rs@@ -0,0 +1,33 @@+//! System skill teaching the AI how to write effective Macro skills.++use prompt::StaticPrompt;++use crate::SystemSkill;++static TITLE: &str = "Skill Authoring Guide";++static INSTRUCTIONS: &str = r##"Follow this guide when the user asks for help writing or improving a skill.++Skills are markdown documents containing instructions the AI reads and follows when the skill is referenced in a request. A good skill:++- Opens with one sentence stating when the skill applies, so it can be judged relevant without reading the whole document.+- States concrete steps and rules, not aspirations. "Run `just prepare_db` after editing SQL" beats "keep the query cache up to date".+- Includes worked examples of correct output when format matters.+- Names its inputs: which documents, tools, or context the AI should gather before starting.+- Stays single-purpose. Split unrelated workflows into separate skills so search finds the right one.++Structure the skill with a short intro, then `##` sections in execution order. Keep it under a page; link out to reference documents for background instead of inlining them.+"##;++static INTENT: &str = "The AI writes skills that open with an applicability sentence, give concrete \+ single-purpose instructions in execution order, and stay under a page.";++/// The skill's instructions as a composable prompt section.+pub static PROMPT: StaticPrompt<'static> = StaticPrompt::borrowed(TITLE, INSTRUCTIONS, INTENT);++/// The skill authoring system skill.+pub static SKILL: SystemSkill = SystemSkill {+ slug: "skill-authoring-guide",+ name: "Skill Authoring Guide",+ content: &PROMPT,+};diff --git a/crates/system_skills/src/test.rs b/crates/system_skills/src/test.rsnew file mode 100644index 0000000000..e76ceb9ccb--- /dev/null+++ b/crates/system_skills/src/test.rs@@ -0,0 +1,48 @@+use super::*;++#[test]+fn system_skill_slugs_and_ids_are_unique() {+ let mut slugs: Vec<&str> = SYSTEM_SKILLS.iter().map(|skill| skill.slug).collect();+ slugs.sort();+ slugs.dedup();+ assert_eq!(slugs.len(), SYSTEM_SKILLS.len());++ let mut ids: Vec<Uuid> = SYSTEM_SKILLS.iter().map(|skill| skill.id()).collect();+ ids.sort();+ ids.dedup();+ assert_eq!(ids.len(), SYSTEM_SKILLS.len());+}++#[test]+fn ids_are_stable_uuidv5_derivations() {+ for skill in SYSTEM_SKILLS {+ let expected = Uuid::new_v5(&SYSTEM_SKILL_NAMESPACE, skill.slug.as_bytes());+ assert_eq!(skill.id(), expected);+ assert_eq!(skill.id().get_version(), Some(uuid::Version::Sha1));+ }+}++#[test]+fn lookup_finds_registered_skills() {+ for skill in SYSTEM_SKILLS {+ let found = system_skill(skill.id()).expect("registered skill should be found");+ assert_eq!(found.name, skill.name);+ assert!(is_system_skill(skill.id()));+ }+}++#[test]+fn unknown_id_is_not_a_system_skill() {+ assert!(!is_system_skill(Uuid::nil()));+ assert!(system_skill(Uuid::nil()).is_none());+}++#[test]+fn skills_render_non_empty_titled_markdown() {+ for skill in SYSTEM_SKILLS {+ let content = skill.render_content();+ assert!(!content.trim().is_empty());+ // StaticPrompt renders as a markdown section titled with the name.+ assert!(content.starts_with(&format!("# {}", skill.name)));+ }+}diff --git a/packages/sdk/generated/cognition/types.gen.ts b/packages/sdk/generated/cognition/types.gen.tsindex 3452030a5a..6e3edd236e 100644--- a/packages/sdk/generated/cognition/types.gen.ts+++ b/packages/sdk/generated/cognition/types.gen.ts@@ -146,7 +146,7 @@ export type AttachmentMetadata = {type: 'email';};-export type AttachmentType = 'document' | 'image' | 'channel' | 'email' | 'project';+export type AttachmentType = 'document' | 'image' | 'channel' | 'email' | 'project' | 'skill';/*** Request body for executing a pending tool call.@@ -508,7 +508,7 @@ export type Entity = {/*** The type of an entity in Macro*/-export type EntityType = 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder';+export type EntityType = 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill';/*** Error response body.diff --git a/packages/sdk/generated/connection/types.gen.ts b/packages/sdk/generated/connection/types.gen.tsindex 2315ee6f46..41182e85e8 100644--- a/packages/sdk/generated/connection/types.gen.ts+++ b/packages/sdk/generated/connection/types.gen.ts@@ -40,7 +40,7 @@ export type Entity = {/*** The type of an entity in Macro*/-export type EntityType = 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder';+export type EntityType = 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill';export type GenericErrorResponse = {/**diff --git a/packages/sdk/generated/notification/types.gen.ts b/packages/sdk/generated/notification/types.gen.tsindex 443291b3f7..5eab3d489a 100644--- a/packages/sdk/generated/notification/types.gen.ts+++ b/packages/sdk/generated/notification/types.gen.ts@@ -350,7 +350,7 @@ export type Entity = {/*** The type of an entity in Macro*/-export type EntityType = 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder';+export type EntityType = 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill';/*** A plain old json error response for use with axum.@@ -886,6 +886,8 @@ export type NotificationDocumentSubType = {type: 'task';} | {type: 'snippet';+} | {+ type: 'skill';};export type NotificationServiceApiVersion = 'v1';diff --git a/packages/sdk/generated/search/types.gen.ts b/packages/sdk/generated/search/types.gen.tsindex f0be4a4fdb..7ba9478205 100644--- a/packages/sdk/generated/search/types.gen.ts+++ b/packages/sdk/generated/search/types.gen.ts@@ -795,7 +795,7 @@ export type DocumentSearchResult = {* The document sub type enum represents all values of document sub types.* These values should match the `document_sub_type_value` table in macrodb.*/-export type DocumentSubType = 'task' | 'snippet';+export type DocumentSubType = 'task' | 'snippet' | 'skill';/*** The email filters used to filter down what emails you search over.diff --git a/packages/sdk/generated/storage/index.ts b/packages/sdk/generated/storage/index.tsindex 771b02c4fb..ac0ee0fd72 100644--- a/packages/sdk/generated/storage/index.ts+++ b/packages/sdk/generated/storage/index.ts@@ -1,4 +1,4 @@// This file is auto-generated by @hey-api/openapi-tsexport { type Options, Sdk } from './sdk.gen';-export type { AccessLevel, 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, SoupApiSortDirection, 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';+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, CreateSkillHandlerData, CreateSkillHandlerError, CreateSkillHandlerErrors, CreateSkillHandlerResponse, CreateSkillHandlerResponses, CreateSkillRequest, CreateSkillResponse, 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, GetSystemSkillsHandlerData, GetSystemSkillsHandlerError, GetSystemSkillsHandlerErrors, GetSystemSkillsHandlerResponse, GetSystemSkillsHandlerResponses, 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, SoupApiSortDirection, 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, SystemSkillSummary, 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/sdk.gen.ts b/packages/sdk/generated/storage/sdk.gen.tsindex cf8dee5565..a5b935e2d9 100644--- a/packages/sdk/generated/storage/sdk.gen.ts+++ b/packages/sdk/generated/storage/sdk.gen.ts@@ -2,7 +2,7 @@import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from './client';import { client } from './client.gen';-import type { AddFavoriteData, AddFavoriteErrors, AddFavoriteResponses, AddParticipantsData, AddParticipantsErrors, AddParticipantsResponses, AddPinHandlerData, AddPinHandlerErrors, AddPinHandlerResponses, BulkWakeupSyncServiceDocumentsData, BulkWakeupSyncServiceDocumentsErrors, BulkWakeupSyncServiceDocumentsResponses, CallWebhookData, CallWebhookErrors, CallWebhookResponses, CheckActiveCallData, CheckActiveCallErrors, CheckActiveCallResponses, CopyDocumentData, CopyDocumentErrors, CopyDocumentResponses, CreateAnchorData, CreateAnchorErrors, CreateAnchorResponses, CreateChannelData, CreateChannelErrors, CreateChannelResponses, CreateChannelScopedBotData, CreateChannelScopedBotErrors, CreateChannelScopedBotResponses, CreateCommentData, CreateCommentErrors, CreateCommentResponses, CreateCrmCommentData, CreateCrmCommentErrors, CreateCrmCommentResponses, CreateCrmCompanyData, CreateCrmCompanyErrors, CreateCrmCompanyResponses, CreateCrmContactData, CreateCrmContactErrors, CreateCrmContactResponses, CreateDocumentData, CreateDocumentErrors, CreateDocumentResponses, CreateEntityMentionData, CreateEntityMentionErrors, CreateEntityMentionResponses, CreateInstructionsHandlerData, CreateInstructionsHandlerErrors, CreateInstructionsHandlerResponses, CreateMarkdownHandlerData, CreateMarkdownHandlerErrors, CreateMarkdownHandlerResponses, CreateProjectHandlerData, CreateProjectHandlerErrors, CreateProjectHandlerResponses, CreateReminderData, CreateReminderErrors, CreateReminderResponses, CreateSnippetHandlerData, CreateSnippetHandlerErrors, CreateSnippetHandlerResponses, CreateTaskHandlerData, CreateTaskHandlerErrors, CreateTaskHandlerResponses, CreateViewHandlerData, CreateViewHandlerErrors, CreateViewHandlerResponses, CreateWebhookData, CreateWebhookErrors, CreateWebhookResponses, DeleteAnchorData, DeleteAnchorErrors, DeleteAnchorResponses, DeleteCallRecordData, DeleteCallRecordErrors, DeleteCallRecordResponses, DeleteChannelData, DeleteChannelErrors, DeleteChannelResponses, DeleteCommentData, DeleteCommentErrors, DeleteCommentResponses, DeleteCrmCommentData, DeleteCrmCommentErrors, DeleteCrmCommentResponses, DeleteDocumentData, DeleteDocumentErrors, DeleteDocumentResponses, DeleteEntityMentionData, DeleteEntityMentionErrors, DeleteEntityMentionResponses, DeleteHistoryHandlerData, DeleteHistoryHandlerErrors, DeleteHistoryHandlerResponses, DeleteMessageData, DeleteMessageErrors, DeleteMessageResponses, DeleteProjectHandlerData, DeleteProjectHandlerErrors, DeleteProjectHandlerResponses, DeleteReminderData, DeleteReminderErrors, DeleteReminderResponses, DeleteUserDocumentViewLocationData, DeleteUserDocumentViewLocationErrors, DeleteUserDocumentViewLocationResponses, DeleteViewHandlerData, DeleteViewHandlerErrors, DeleteViewHandlerResponses, DeleteWebhookData, DeleteWebhookErrors, DeleteWebhookResponses, EditAnchorData, EditAnchorErrors, EditAnchorResponses, EditCallRecordData, EditCallRecordErrors, EditCallRecordResponses, EditCallTranscriptData, EditCallTranscriptErrors, EditCallTranscriptResponses, EditCommentData, EditCommentErrors, EditCommentResponses, EditCrmCommentData, EditCrmCommentErrors, EditCrmCommentResponses, EditDocumentData, EditDocumentErrors, EditDocumentResponses, EditProjectV2Data, EditProjectV2Errors, EditProjectV2Responses, EditThreadV2Data, EditThreadV2Errors, EditThreadV2Responses, ExcludeDefaultViewHandlerData, ExcludeDefaultViewHandlerErrors, ExcludeDefaultViewHandlerResponses, ExportDocumentData, ExportDocumentErrors, ExportDocumentResponses, GetActivityData, GetActivityErrors, GetActivityResponses, GetAttachmentReferencesData, GetAttachmentReferencesErrors, GetAttachmentReferencesResponses, GetBatchCallRecordPreviewData, GetBatchCallRecordPreviewErrors, GetBatchCallRecordPreviewResponses, GetBatchChannelPreviewData, GetBatchChannelPreviewErrors, GetBatchChannelPreviewResponses, GetBatchPreviewHandlerData, GetBatchPreviewHandlerErrors, GetBatchPreviewHandlerResponses, GetBatchProjectPreviewData, GetBatchProjectPreviewErrors, GetBatchProjectPreviewResponses, GetCallRecordData, GetCallRecordErrors, GetCallRecordResponses, GetChannelAttachmentsData, GetChannelAttachmentsErrors, GetChannelAttachmentsResponses, GetChannelData, GetChannelErrors, GetChannelJoinLinkData, GetChannelJoinLinkErrors, GetChannelJoinLinkResponses, GetChannelMessagesData, GetChannelMessagesErrors, GetChannelMessagesResponses, GetChannelParticipantsData, GetChannelParticipantsErrors, GetChannelParticipantsResponses, GetChannelResponses, GetChannelsData, GetChannelsErrors, GetChannelsResponses, GetCompanyData, GetCompanyErrors, GetCompanyResponses, GetContactData, GetContactErrors, GetContactResponses, GetCrmTeamSettingsData, GetCrmTeamSettingsErrors, GetCrmTeamSettingsResponses, GetDocumentAnchorsData, GetDocumentAnchorsErrors, GetDocumentAnchorsResponses, GetDocumentBranchNameData, GetDocumentBranchNameErrors, GetDocumentBranchNameResponses, GetDocumentByTeamSlugData, GetDocumentByTeamSlugErrors, GetDocumentByTeamSlugResponses, GetDocumentCommentsData, GetDocumentCommentsErrors, GetDocumentCommentsResponses, GetDocumentData, GetDocumentErrors, GetDocumentGithubPullRequestsData, GetDocumentGithubPullRequestsErrors, GetDocumentGithubPullRequestsResponses, GetDocumentListHandlerData, GetDocumentListHandlerErrors, GetDocumentListHandlerResponses, GetDocumentLocationV3Data, GetDocumentLocationV3Errors, GetDocumentLocationV3Responses, GetDocumentPermissionsTokenData, GetDocumentPermissionsTokenErrors, GetDocumentPermissionsTokenResponses, GetDocumentPermissionsV2Data, GetDocumentPermissionsV2Errors, GetDocumentPermissionsV2Responses, GetDocumentProcessingResultData, GetDocumentProcessingResultErrors, GetDocumentProcessingResultResponses, GetDocumentResponses, GetDocumentShortIdData, GetDocumentShortIdErrors, GetDocumentShortIdResponses, GetDocumentTeamShareData, GetDocumentTeamShareErrors, GetDocumentTeamShareResponses, GetDocumentVersionData, GetDocumentVersionErrors, GetDocumentVersionResponses, GetDocumentViewsHandlerData, GetDocumentViewsHandlerErrors, GetDocumentViewsHandlerResponses, GetEntityPermissionData, GetEntityPermissionErrors, GetEntityPermissionResponses, GetForeignEntityData, GetForeignEntityErrors, GetForeignEntityResponses, GetHistoryHandlerData, GetHistoryHandlerErrors, GetHistoryHandlerResponses, GetInstructionsHandlerData, GetInstructionsHandlerErrors, GetInstructionsHandlerResponses, GetItemsSoupData, GetItemsSoupErrors, GetItemsSoupResponses, GetLocationHandlerData, GetLocationHandlerErrors, GetLocationHandlerResponses, GetMessageWithContextData, GetMessageWithContextErrors, GetMessageWithContextResponses, GetOrCreateCallData, GetOrCreateCallErrors, GetOrCreateCallResponses, GetOrCreateDmData, GetOrCreateDmErrors, GetOrCreateDmResponses, GetOrCreatePrivateData, GetOrCreatePrivateErrors, GetOrCreatePrivateResponses, GetPendingProjectsHandlerData, GetPendingProjectsHandlerErrors, GetPendingProjectsHandlerResponses, GetPinsHandlerData, GetPinsHandlerErrors, GetPinsHandlerResponses, GetProjectContentHandlerData, GetProjectContentHandlerErrors, GetProjectContentHandlerResponses, GetProjectHandlerData, GetProjectHandlerErrors, GetProjectHandlerResponses, GetProjectPermissionsV2Data, GetProjectPermissionsV2Errors, GetProjectPermissionsV2Responses, GetProjectsHandlerData, GetProjectsHandlerErrors, GetProjectsHandlerResponses, GetProjectUserAccessLevelData, GetProjectUserAccessLevelErrors, GetProjectUserAccessLevelResponses, GetRecentActivityHandlerData, GetRecentActivityHandlerErrors, GetRecentActivityHandlerResponses, GetReminderData, GetReminderErrors, GetReminderResponses, GetRingStatusData, GetRingStatusErrors, GetRingStatusResponses, GetSelfBotData, GetSelfBotErrors, GetSelfBotResponses, GetThreadRepliesData, GetThreadRepliesErrors, GetThreadRepliesResponses, GetUserDocumentsHandlerData, GetUserDocumentsHandlerErrors, GetUserDocumentsHandlerResponses, GetUserDocumentViewLocationData, GetUserDocumentViewLocationErrors, GetUserDocumentViewLocationResponses, GetViewsHandlerData, GetViewsHandlerErrors, GetViewsHandlerResponses, GetWebhookData, GetWebhookErrors, GetWebhookResponses, HandlerData, HandlerErrors, HandlerResponses, HealthHandlerData, HealthHandlerResponses, IngestTranscriptData, IngestTranscriptErrors, IngestTranscriptResponses, InitializeUserDocumentsData, InitializeUserDocumentsErrors, InitializeUserDocumentsResponses, InstallSyncData, InstallSyncErrors, JobProcessingResultHandlerData, JobProcessingResultHandlerErrors, JobProcessingResultHandlerResponses, JoinChannelByCodeData, JoinChannelByCodeErrors, JoinChannelByCodeResponses, JoinChannelData, JoinChannelErrors, JoinChannelResponses, LeaveChannelData, LeaveChannelErrors, LeaveChannelResponses, LeaveOrEndCallData, LeaveOrEndCallErrors, LeaveOrEndCallResponses, ListBotChannelsData, ListBotChannelsErrors, ListBotChannelsResponses, ListCompanyContactsData, ListCompanyContactsErrors, ListCompanyContactsResponses, ListCrmCommentsData, ListCrmCommentsErrors, ListCrmCommentsResponses, ListFavoritesData, ListFavoritesErrors, ListFavoritesResponses, ListOccurrencesData, ListOccurrencesErrors, ListOccurrencesResponses, ListRemindersData, ListRemindersErrors, ListRemindersResponses, ListWebhooksData, ListWebhooksErrors, ListWebhooksResponses, PatchChannelData, PatchChannelErrors, PatchChannelResponses, PatchMessageData, PatchMessageErrors, PatchMessageResponses, PatchViewHandlerData, PatchViewHandlerErrors, PatchViewHandlerResponses, PatchWebhookData, PatchWebhookErrors, PatchWebhookResponses, PermanentlyDeleteDocumentData, PermanentlyDeleteDocumentErrors, PermanentlyDeleteDocumentResponses, PermanentlyDeleteProjectData, PermanentlyDeleteProjectErrors, PermanentlyDeleteProjectResponses, PostActivityData, PostActivityErrors, PostActivityResponses, PostChannelBotWebhookData, PostChannelBotWebhookErrors, PostChannelBotWebhookResponses, PostChannelMessagesData, PostChannelMessagesErrors, PostChannelMessagesResponses, PostItemsSoupAstData, PostItemsSoupAstErrors, PostItemsSoupAstGroupedData, PostItemsSoupAstGroupedErrors, PostItemsSoupAstGroupedResponses, PostItemsSoupAstResponses, PostItemsSoupData, PostItemsSoupErrors, PostItemsSoupResponses, PostMessageData, PostMessageErrors, PostMessageResponses, PostReactionData, PostReactionErrors, PostReactionResponses, PostTypingData, PostTypingErrors, PostTypingResponses, PresaveDocumentHandlerData, PresaveDocumentHandlerErrors, PresaveDocumentHandlerResponses, PutCrmTeamSettingsData, PutCrmTeamSettingsErrors, PutCrmTeamSettingsResponses, RecentlyDeletedData, RecentlyDeletedErrors, RecentlyDeletedResponses, RemoveBotFromChannelByBotData, RemoveBotFromChannelByBotErrors, RemoveBotFromChannelByBotResponses, RemoveFavoriteByEntityData, RemoveFavoriteByEntityErrors, RemoveFavoriteByEntityResponses, RemoveParticipantsData, RemoveParticipantsErrors, RemoveParticipantsResponses, RemovePinHandlerData, RemovePinHandlerErrors, RemovePinHandlerResponses, ReorderFavoritesData, ReorderFavoritesErrors, ReorderFavoritesResponses, ReorderPinsHandlerData, ReorderPinsHandlerErrors, ReorderPinsHandlerResponses, ResolveChannelMessageData, ResolveChannelMessageErrors, ResolveChannelMessageResponses, RevertDeleteDocumentData, RevertDeleteDocumentErrors, RevertDeleteDocumentResponses, RevertDeleteProjectData, RevertDeleteProjectErrors, RevertDeleteProjectResponses, SaveDocumentHandlerData, SaveDocumentHandlerErrors, SaveDocumentHandlerResponses, SetCompanyHiddenData, SetCompanyHiddenErrors, SetCompanyHiddenResponses, SetContactHiddenData, SetContactHiddenErrors, SetContactHiddenResponses, SetCrmCompanyNameData, SetCrmCompanyNameErrors, SetCrmCompanyNameResponses, SetCrmContactNameData, SetCrmContactNameErrors, SetCrmContactNameResponses, SetDocumentTeamShareData, SetDocumentTeamShareErrors, SetDocumentTeamShareResponses, SetEmailSyncData, SetEmailSyncErrors, SetEmailSyncResponses, SimpleSaveData, SimpleSaveErrors, SimpleSaveResponses, ToggleShareWithTeamData, ToggleShareWithTeamErrors, ToggleShareWithTeamResponses, UpdateReminderData, UpdateReminderErrors, UpdateReminderResponses, UploadExtractFolderHandlerData, UploadExtractFolderHandlerErrors, UploadExtractFolderHandlerResponses, UploadFolderHandlerData, UploadFolderHandlerErrors, UploadFolderHandlerResponses, UpsertHistoryHandlerData, UpsertHistoryHandlerErrors, UpsertHistoryHandlerResponses, UpsertUserDocumentViewLocationData, UpsertUserDocumentViewLocationErrors, UpsertUserDocumentViewLocationResponses, ValidateDocumentPermissionsTokenData, ValidateDocumentPermissionsTokenErrors, ValidateDocumentPermissionsTokenResponses, ValidateWebhookData, ValidateWebhookErrors, ValidateWebhookResponses } from './types.gen';+import type { AddFavoriteData, AddFavoriteErrors, AddFavoriteResponses, AddParticipantsData, AddParticipantsErrors, AddParticipantsResponses, AddPinHandlerData, AddPinHandlerErrors, AddPinHandlerResponses, BulkWakeupSyncServiceDocumentsData, BulkWakeupSyncServiceDocumentsErrors, BulkWakeupSyncServiceDocumentsResponses, CallWebhookData, CallWebhookErrors, CallWebhookResponses, CheckActiveCallData, CheckActiveCallErrors, CheckActiveCallResponses, CopyDocumentData, CopyDocumentErrors, CopyDocumentResponses, CreateAnchorData, CreateAnchorErrors, CreateAnchorResponses, CreateChannelData, CreateChannelErrors, CreateChannelResponses, CreateChannelScopedBotData, CreateChannelScopedBotErrors, CreateChannelScopedBotResponses, CreateCommentData, CreateCommentErrors, CreateCommentResponses, CreateCrmCommentData, CreateCrmCommentErrors, CreateCrmCommentResponses, CreateCrmCompanyData, CreateCrmCompanyErrors, CreateCrmCompanyResponses, CreateCrmContactData, CreateCrmContactErrors, CreateCrmContactResponses, CreateDocumentData, CreateDocumentErrors, CreateDocumentResponses, CreateEntityMentionData, CreateEntityMentionErrors, CreateEntityMentionResponses, CreateInstructionsHandlerData, CreateInstructionsHandlerErrors, CreateInstructionsHandlerResponses, CreateMarkdownHandlerData, CreateMarkdownHandlerErrors, CreateMarkdownHandlerResponses, CreateProjectHandlerData, CreateProjectHandlerErrors, CreateProjectHandlerResponses, CreateReminderData, CreateReminderErrors, CreateReminderResponses, CreateSkillHandlerData, CreateSkillHandlerErrors, CreateSkillHandlerResponses, CreateSnippetHandlerData, CreateSnippetHandlerErrors, CreateSnippetHandlerResponses, CreateTaskHandlerData, CreateTaskHandlerErrors, CreateTaskHandlerResponses, CreateViewHandlerData, CreateViewHandlerErrors, CreateViewHandlerResponses, CreateWebhookData, CreateWebhookErrors, CreateWebhookResponses, DeleteAnchorData, DeleteAnchorErrors, DeleteAnchorResponses, DeleteCallRecordData, DeleteCallRecordErrors, DeleteCallRecordResponses, DeleteChannelData, DeleteChannelErrors, DeleteChannelResponses, DeleteCommentData, DeleteCommentErrors, DeleteCommentResponses, DeleteCrmCommentData, DeleteCrmCommentErrors, DeleteCrmCommentResponses, DeleteDocumentData, DeleteDocumentErrors, DeleteDocumentResponses, DeleteEntityMentionData, DeleteEntityMentionErrors, DeleteEntityMentionResponses, DeleteHistoryHandlerData, DeleteHistoryHandlerErrors, DeleteHistoryHandlerResponses, DeleteMessageData, DeleteMessageErrors, DeleteMessageResponses, DeleteProjectHandlerData, DeleteProjectHandlerErrors, DeleteProjectHandlerResponses, DeleteReminderData, DeleteReminderErrors, DeleteReminderResponses, DeleteUserDocumentViewLocationData, DeleteUserDocumentViewLocationErrors, DeleteUserDocumentViewLocationResponses, DeleteViewHandlerData, DeleteViewHandlerErrors, DeleteViewHandlerResponses, DeleteWebhookData, DeleteWebhookErrors, DeleteWebhookResponses, EditAnchorData, EditAnchorErrors, EditAnchorResponses, EditCallRecordData, EditCallRecordErrors, EditCallRecordResponses, EditCallTranscriptData, EditCallTranscriptErrors, EditCallTranscriptResponses, EditCommentData, EditCommentErrors, EditCommentResponses, EditCrmCommentData, EditCrmCommentErrors, EditCrmCommentResponses, EditDocumentData, EditDocumentErrors, EditDocumentResponses, EditProjectV2Data, EditProjectV2Errors, EditProjectV2Responses, EditThreadV2Data, EditThreadV2Errors, EditThreadV2Responses, ExcludeDefaultViewHandlerData, ExcludeDefaultViewHandlerErrors, ExcludeDefaultViewHandlerResponses, ExportDocumentData, ExportDocumentErrors, ExportDocumentResponses, GetActivityData, GetActivityErrors, GetActivityResponses, GetAttachmentReferencesData, GetAttachmentReferencesErrors, GetAttachmentReferencesResponses, GetBatchCallRecordPreviewData, GetBatchCallRecordPreviewErrors, GetBatchCallRecordPreviewResponses, GetBatchChannelPreviewData, GetBatchChannelPreviewErrors, GetBatchChannelPreviewResponses, GetBatchPreviewHandlerData, GetBatchPreviewHandlerErrors, GetBatchPreviewHandlerResponses, GetBatchProjectPreviewData, GetBatchProjectPreviewErrors, GetBatchProjectPreviewResponses, GetCallRecordData, GetCallRecordErrors, GetCallRecordResponses, GetChannelAttachmentsData, GetChannelAttachmentsErrors, GetChannelAttachmentsResponses, GetChannelData, GetChannelErrors, GetChannelJoinLinkData, GetChannelJoinLinkErrors, GetChannelJoinLinkResponses, GetChannelMessagesData, GetChannelMessagesErrors, GetChannelMessagesResponses, GetChannelParticipantsData, GetChannelParticipantsErrors, GetChannelParticipantsResponses, GetChannelResponses, GetChannelsData, GetChannelsErrors, GetChannelsResponses, GetCompanyData, GetCompanyErrors, GetCompanyResponses, GetContactData, GetContactErrors, GetContactResponses, GetCrmTeamSettingsData, GetCrmTeamSettingsErrors, GetCrmTeamSettingsResponses, GetDocumentAnchorsData, GetDocumentAnchorsErrors, GetDocumentAnchorsResponses, GetDocumentBranchNameData, GetDocumentBranchNameErrors, GetDocumentBranchNameResponses, GetDocumentByTeamSlugData, GetDocumentByTeamSlugErrors, GetDocumentByTeamSlugResponses, GetDocumentCommentsData, GetDocumentCommentsErrors, GetDocumentCommentsResponses, GetDocumentData, GetDocumentErrors, GetDocumentGithubPullRequestsData, GetDocumentGithubPullRequestsErrors, GetDocumentGithubPullRequestsResponses, GetDocumentListHandlerData, GetDocumentListHandlerErrors, GetDocumentListHandlerResponses, GetDocumentLocationV3Data, GetDocumentLocationV3Errors, GetDocumentLocationV3Responses, GetDocumentPermissionsTokenData, GetDocumentPermissionsTokenErrors, GetDocumentPermissionsTokenResponses, GetDocumentPermissionsV2Data, GetDocumentPermissionsV2Errors, GetDocumentPermissionsV2Responses, GetDocumentProcessingResultData, GetDocumentProcessingResultErrors, GetDocumentProcessingResultResponses, GetDocumentResponses, GetDocumentShortIdData, GetDocumentShortIdErrors, GetDocumentShortIdResponses, GetDocumentTeamShareData, GetDocumentTeamShareErrors, GetDocumentTeamShareResponses, GetDocumentVersionData, GetDocumentVersionErrors, GetDocumentVersionResponses, GetDocumentViewsHandlerData, GetDocumentViewsHandlerErrors, GetDocumentViewsHandlerResponses, GetEntityPermissionData, GetEntityPermissionErrors, GetEntityPermissionResponses, GetForeignEntityData, GetForeignEntityErrors, GetForeignEntityResponses, GetHistoryHandlerData, GetHistoryHandlerErrors, GetHistoryHandlerResponses, GetInstructionsHandlerData, GetInstructionsHandlerErrors, GetInstructionsHandlerResponses, GetItemsSoupData, GetItemsSoupErrors, GetItemsSoupResponses, GetLocationHandlerData, GetLocationHandlerErrors, GetLocationHandlerResponses, GetMessageWithContextData, GetMessageWithContextErrors, GetMessageWithContextResponses, GetOrCreateCallData, GetOrCreateCallErrors, GetOrCreateCallResponses, GetOrCreateDmData, GetOrCreateDmErrors, GetOrCreateDmResponses, GetOrCreatePrivateData, GetOrCreatePrivateErrors, GetOrCreatePrivateResponses, GetPendingProjectsHandlerData, GetPendingProjectsHandlerErrors, GetPendingProjectsHandlerResponses, GetPinsHandlerData, GetPinsHandlerErrors, GetPinsHandlerResponses, GetProjectContentHandlerData, GetProjectContentHandlerErrors, GetProjectContentHandlerResponses, GetProjectHandlerData, GetProjectHandlerErrors, GetProjectHandlerResponses, GetProjectPermissionsV2Data, GetProjectPermissionsV2Errors, GetProjectPermissionsV2Responses, GetProjectsHandlerData, GetProjectsHandlerErrors, GetProjectsHandlerResponses, GetProjectUserAccessLevelData, GetProjectUserAccessLevelErrors, GetProjectUserAccessLevelResponses, GetRecentActivityHandlerData, GetRecentActivityHandlerErrors, GetRecentActivityHandlerResponses, GetReminderData, GetReminderErrors, GetReminderResponses, GetRingStatusData, GetRingStatusErrors, GetRingStatusResponses, GetSelfBotData, GetSelfBotErrors, GetSelfBotResponses, GetSystemSkillsHandlerData, GetSystemSkillsHandlerErrors, GetSystemSkillsHandlerResponses, GetThreadRepliesData, GetThreadRepliesErrors, GetThreadRepliesResponses, GetUserDocumentsHandlerData, GetUserDocumentsHandlerErrors, GetUserDocumentsHandlerResponses, GetUserDocumentViewLocationData, GetUserDocumentViewLocationErrors, GetUserDocumentViewLocationResponses, GetViewsHandlerData, GetViewsHandlerErrors, GetViewsHandlerResponses, GetWebhookData, GetWebhookErrors, GetWebhookResponses, HandlerData, HandlerErrors, HandlerResponses, HealthHandlerData, HealthHandlerResponses, IngestTranscriptData, IngestTranscriptErrors, IngestTranscriptResponses, InitializeUserDocumentsData, InitializeUserDocumentsErrors, InitializeUserDocumentsResponses, InstallSyncData, InstallSyncErrors, JobProcessingResultHandlerData, JobProcessingResultHandlerErrors, JobProcessingResultHandlerResponses, JoinChannelByCodeData, JoinChannelByCodeErrors, JoinChannelByCodeResponses, JoinChannelData, JoinChannelErrors, JoinChannelResponses, LeaveChannelData, LeaveChannelErrors, LeaveChannelResponses, LeaveOrEndCallData, LeaveOrEndCallErrors, LeaveOrEndCallResponses, ListBotChannelsData, ListBotChannelsErrors, ListBotChannelsResponses, ListCompanyContactsData, ListCompanyContactsErrors, ListCompanyContactsResponses, ListCrmCommentsData, ListCrmCommentsErrors, ListCrmCommentsResponses, ListFavoritesData, ListFavoritesErrors, ListFavoritesResponses, ListOccurrencesData, ListOccurrencesErrors, ListOccurrencesResponses, ListRemindersData, ListRemindersErrors, ListRemindersResponses, ListWebhooksData, ListWebhooksErrors, ListWebhooksResponses, PatchChannelData, PatchChannelErrors, PatchChannelResponses, PatchMessageData, PatchMessageErrors, PatchMessageResponses, PatchViewHandlerData, PatchViewHandlerErrors, PatchViewHandlerResponses, PatchWebhookData, PatchWebhookErrors, PatchWebhookResponses, PermanentlyDeleteDocumentData, PermanentlyDeleteDocumentErrors, PermanentlyDeleteDocumentResponses, PermanentlyDeleteProjectData, PermanentlyDeleteProjectErrors, PermanentlyDeleteProjectResponses, PostActivityData, PostActivityErrors, PostActivityResponses, PostChannelBotWebhookData, PostChannelBotWebhookErrors, PostChannelBotWebhookResponses, PostChannelMessagesData, PostChannelMessagesErrors, PostChannelMessagesResponses, PostItemsSoupAstData, PostItemsSoupAstErrors, PostItemsSoupAstGroupedData, PostItemsSoupAstGroupedErrors, PostItemsSoupAstGroupedResponses, PostItemsSoupAstResponses, PostItemsSoupData, PostItemsSoupErrors, PostItemsSoupResponses, PostMessageData, PostMessageErrors, PostMessageResponses, PostReactionData, PostReactionErrors, PostReactionResponses, PostTypingData, PostTypingErrors, PostTypingResponses, PresaveDocumentHandlerData, PresaveDocumentHandlerErrors, PresaveDocumentHandlerResponses, PutCrmTeamSettingsData, PutCrmTeamSettingsErrors, PutCrmTeamSettingsResponses, RecentlyDeletedData, RecentlyDeletedErrors, RecentlyDeletedResponses, RemoveBotFromChannelByBotData, RemoveBotFromChannelByBotErrors, RemoveBotFromChannelByBotResponses, RemoveFavoriteByEntityData, RemoveFavoriteByEntityErrors, RemoveFavoriteByEntityResponses, RemoveParticipantsData, RemoveParticipantsErrors, RemoveParticipantsResponses, RemovePinHandlerData, RemovePinHandlerErrors, RemovePinHandlerResponses, ReorderFavoritesData, ReorderFavoritesErrors, ReorderFavoritesResponses, ReorderPinsHandlerData, ReorderPinsHandlerErrors, ReorderPinsHandlerResponses, ResolveChannelMessageData, ResolveChannelMessageErrors, ResolveChannelMessageResponses, RevertDeleteDocumentData, RevertDeleteDocumentErrors, RevertDeleteDocumentResponses, RevertDeleteProjectData, RevertDeleteProjectErrors, RevertDeleteProjectResponses, SaveDocumentHandlerData, SaveDocumentHandlerErrors, SaveDocumentHandlerResponses, SetCompanyHiddenData, SetCompanyHiddenErrors, SetCompanyHiddenResponses, SetContactHiddenData, SetContactHiddenErrors, SetContactHiddenResponses, SetCrmCompanyNameData, SetCrmCompanyNameErrors, SetCrmCompanyNameResponses, SetCrmContactNameData, SetCrmContactNameErrors, SetCrmContactNameResponses, SetDocumentTeamShareData, SetDocumentTeamShareErrors, SetDocumentTeamShareResponses, SetEmailSyncData, SetEmailSyncErrors, SetEmailSyncResponses, SimpleSaveData, SimpleSaveErrors, SimpleSaveResponses, ToggleShareWithTeamData, ToggleShareWithTeamErrors, ToggleShareWithTeamResponses, UpdateReminderData, UpdateReminderErrors, UpdateReminderResponses, UploadExtractFolderHandlerData, UploadExtractFolderHandlerErrors, UploadExtractFolderHandlerResponses, UploadFolderHandlerData, UploadFolderHandlerErrors, UploadFolderHandlerResponses, UpsertHistoryHandlerData, UpsertHistoryHandlerErrors, UpsertHistoryHandlerResponses, UpsertUserDocumentViewLocationData, UpsertUserDocumentViewLocationErrors, UpsertUserDocumentViewLocationResponses, ValidateDocumentPermissionsTokenData, ValidateDocumentPermissionsTokenErrors, ValidateDocumentPermissionsTokenResponses, ValidateWebhookData, ValidateWebhookErrors, ValidateWebhookResponses } from './types.gen';export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {/**@@ -968,6 +968,23 @@ export class Sdk extends HeyApiClient {});}+ /**+ * Creates a skill document with initialized markdown content in one+ * backend-owned lifecycle. Skills are markdown documents containing+ * instructions that AI reads and follows when the skill is referenced in an+ * AI input.+ */+ public createSkillHandler<ThrowOnError extends boolean = false>(options: Options<CreateSkillHandlerData, ThrowOnError>): RequestResult<CreateSkillHandlerResponses, CreateSkillHandlerErrors, ThrowOnError> {+ return (options.client ?? this.client).post<CreateSkillHandlerResponses, CreateSkillHandlerErrors, ThrowOnError>({+ url: '/documents/create_skill',+ ...options,+ headers: {+ 'Content-Type': 'application/json',+ ...options.headers+ }+ });+ }+/*** Creates a snippet document with initialized markdown content in one* backend-owned lifecycle. Snippets are created personal; team sharing is@@ -1075,6 +1092,16 @@ export class Sdk extends HeyApiClient {return (options?.client ?? this.client).get<HandlerResponses, HandlerErrors, ThrowOnError>({ url: '/documents/starter_docs', ...options });}+ /**+ * Lists the built-in system skills. System skills are static, code-defined+ * AI instructions (see the `system_skills` crate); they surface in the+ * skills menu and AI skill tools like user skills, but have no document+ * behind them, so clients must not offer to open them.+ */+ public getSystemSkillsHandler<ThrowOnError extends boolean = false>(options?: Options<GetSystemSkillsHandlerData, ThrowOnError>): RequestResult<GetSystemSkillsHandlerResponses, GetSystemSkillsHandlerErrors, ThrowOnError> {+ return (options?.client ?? this.client).get<GetSystemSkillsHandlerResponses, GetSystemSkillsHandlerErrors, ThrowOnError>({ url: '/documents/system_skills', ...options });+ }+/*** Handler for `DELETE /documents/{document_id}`.*diff --git a/packages/sdk/generated/storage/types.gen.ts b/packages/sdk/generated/storage/types.gen.tsindex 0e184082bb..f74911a4c5 100644--- a/packages/sdk/generated/storage/types.gen.ts+++ b/packages/sdk/generated/storage/types.gen.ts@@ -31,7 +31,7 @@ export type AddFavoriteRequest = {/*** The type of the entity to favorite.*/- entityType: 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder';+ entityType: 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill';};/**@@ -984,6 +984,8 @@ export type BasicDocumentSubType = {type: 'task';} | {type: 'snippet';+} | {+ type: 'skill';};export type BomPart = {@@ -2850,13 +2852,43 @@ export type CreateReminderRequest = {/*** Type of the entity to attach the reminder to. Requires `entityId`.*/- entityType?: null | 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder';+ entityType?: null | 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill';/*** When and how often the reminder fires.*/schedule: ReminderSchedule;};+/**+ * Request body for creating a skill — a markdown document containing+ * instructions that AI reads and follows when the skill is referenced in an+ * AI input.+ */+export type CreateSkillRequest = {+ /**+ * Markdown source text. Defaults to an empty skill document.+ */+ markdown?: string | null;+ /**+ * Optional project ID to associate the skill with.+ */+ projectId?: string | null;+ /**+ * The name of the skill.+ */+ skillName: string;+};++/**+ * Response for creating a skill.+ */+export type CreateSkillResponse = {+ /**+ * The document ID of the created skill.+ */+ documentId: string;+};+/*** Request body for creating a snippet — a reusable markdown document that can* be inserted into any markdown area.@@ -3810,6 +3842,8 @@ export type DocumentPreviewDataSubType = {type: 'task';} | {type: 'snippet';+} | {+ type: 'skill';};/**@@ -3922,7 +3956,7 @@ export type DocumentStorageServiceApiVersion = 'v1' | 'v2';* The document sub type enum represents all values of document sub types.* These values should match the `document_sub_type_value` table in macrodb.*/-export type DocumentSubType = 'task' | 'snippet';+export type DocumentSubType = 'task' | 'snippet' | 'skill';/*** Metadata for [`DocumentTopicEvent::SyncContentUpdated`].@@ -4491,7 +4525,7 @@ export type Favorite = {/*** The type of the favorited entity.*/- entityType: 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder';+ entityType: 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill';/*** File type of the favorited document, when applicable.*/@@ -4513,7 +4547,7 @@ export type FavoriteEntityRef = {/*** The type of the favorited entity.*/- entityType: 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder';+ entityType: 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill';};/**@@ -6106,7 +6140,7 @@ export type Reminder = {/*** Type of the associated entity, when the reminder is attached to one.*/- entityType?: null | 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder';+ entityType?: null | 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill';/*** Reminder id.*/@@ -6974,6 +7008,8 @@ export type SoupDocumentSubType = {type: 'task';} | {type: 'snippet';+} | {+ type: 'skill';};/**@@ -7456,7 +7492,7 @@ export type SoupReminderReference = {/*** The referenced entity's type.*/- entityType: 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder';+ entityType: 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill';/*** File type, when the reference is a document — `md`, `pdf`, and so on.*/@@ -7631,6 +7667,22 @@ export type SyncServiceVersionId = {peer: string;};+/**+ * A built-in system skill: static, code-defined AI instructions surfaced+ * through the same tools as user-authored skill documents, but with no+ * document behind them.+ */+export type SystemSkillSummary = {+ /**+ * The well-known id the skill is referenced by in mentions and AI tools.+ */+ id: string;+ /**+ * The name of the skill.+ */+ name: string;+};+/*** How multiple `tag_option_ids` combine when filtering.*/@@ -10333,6 +10385,35 @@ export type CreateMarkdownHandlerResponses = {export type CreateMarkdownHandlerResponse = CreateMarkdownHandlerResponses[keyof CreateMarkdownHandlerResponses];+export type CreateSkillHandlerData = {+ body: CreateSkillRequest;+ path?: never;+ query?: never;+ url: '/documents/create_skill';+};++export type CreateSkillHandlerErrors = {+ 400: ErrorResponse;+ 401: ErrorResponse;+ 500: ErrorResponse;+};++export type CreateSkillHandlerError = CreateSkillHandlerErrors[keyof CreateSkillHandlerErrors];++export type CreateSkillHandlerResponses = {+ /**+ * Response for creating a skill.+ */+ 200: {+ /**+ * The document ID of the created skill.+ */+ documentId: string;+ };+};++export type CreateSkillHandlerResponse = CreateSkillHandlerResponses[keyof CreateSkillHandlerResponses];+export type CreateSnippetHandlerData = {body: CreateSnippetRequest;path?: never;@@ -10589,6 +10670,33 @@ export type HandlerResponses = {export type HandlerResponse = HandlerResponses[keyof HandlerResponses];+export type GetSystemSkillsHandlerData = {+ body?: never;+ path?: never;+ query?: never;+ url: '/documents/system_skills';+};++export type GetSystemSkillsHandlerErrors = {+ 401: ErrorResponse;+};++export type GetSystemSkillsHandlerError = GetSystemSkillsHandlerErrors[keyof GetSystemSkillsHandlerErrors];++export type GetSystemSkillsHandlerResponses = {+ /**+ * Response listing the built-in system skills.+ */+ 200: {+ /**+ * Every system skill, in display order.+ */+ skills: Array<SystemSkillSummary>;+ };+};++export type GetSystemSkillsHandlerResponse = GetSystemSkillsHandlerResponses[keyof GetSystemSkillsHandlerResponses];+export type DeleteDocumentData = {body?: never;path: {@@ -11251,7 +11359,7 @@ export type RemoveFavoriteByEntityData = {/*** The type of an entity in Macro*/- entity_type: 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder';+ entity_type: 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill';/*** The id of the favorited entity.*/@@ -12077,7 +12185,7 @@ export type ListRemindersData = {/*** The type of an entity in Macro*/- entityType?: 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder';+ entityType?: 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'reminder' | 'skill';/*** Restrict to reminders attached to this entity id. Requires `entityType`.*/diff --git a/packages/sdk/scripts/sync-specs.ts b/packages/sdk/scripts/sync-specs.tsindex 4ea864d859..3bceb4343b 100644--- a/packages/sdk/scripts/sync-specs.ts+++ b/packages/sdk/scripts/sync-specs.ts@@ -1,35 +1,35 @@-import * as path from "node:path";-import { services } from "../services";+import * as path from 'node:path';+import { services } from '../services';const serviceClientDirectories = {- auth: "service-auth",- cognition: "service-cognition",- connection: "service-connection",- contacts: "service-contacts",- email: "service-email",- notification: "service-notification",- properties: "service-properties",- "scheduled-action": "service-scheduled-action",- search: "service-search",- "static-files": "service-static-files",- storage: "service-storage",- unfurl: "service-unfurl",+ auth: 'service-auth',+ cognition: 'service-cognition',+ connection: 'service-connection',+ contacts: 'service-contacts',+ email: 'service-email',+ notification: 'service-notification',+ properties: 'service-properties',+ 'scheduled-action': 'service-scheduled-action',+ search: 'service-search',+ 'static-files': 'service-static-files',+ storage: 'service-storage',+ unfurl: 'service-unfurl',} satisfies Record<(typeof services)[number], string>;const serviceClientsDirectory = path.resolve(- import.meta.dirname,- "../../../apps/web/src/lib/service-clients",+ import.meta.dirname,+ '../../../apps/web/src/lib/service-clients',);-const specsDirectory = path.resolve(import.meta.dirname, "../specs");+const specsDirectory = path.resolve(import.meta.dirname, '../specs');for (const service of services) {- const source = path.join(- serviceClientsDirectory,- serviceClientDirectories[service],- "openapi.json",- );- const destination = path.join(specsDirectory, `${service}.json`);+ const source = path.join(+ serviceClientsDirectory,+ serviceClientDirectories[service],+ 'openapi.json',+ );+ const destination = path.join(specsDirectory, `${service}.json`);- await Bun.write(destination, Bun.file(source));- console.log(`Synced ${service}`);+ await Bun.write(destination, Bun.file(source));+ console.log(`Synced ${service}`);}diff --git a/packages/sdk/specs/cognition.json b/packages/sdk/specs/cognition.jsonindex 917b516d35..fa427b660d 100644--- a/packages/sdk/specs/cognition.json+++ b/packages/sdk/specs/cognition.json@@ -2009,7 +2009,7 @@},"AttachmentType": {"type": "string",- "enum": ["document", "image", "channel", "email", "project"]+ "enum": ["document", "image", "channel", "email", "project", "skill"]},"CallToolRequest": {"type": "object",@@ -2627,7 +2627,8 @@"static_file","crm_company","crm_contact",- "reminder"+ "reminder",+ "skill"]},"ErrorBody": {diff --git a/packages/sdk/specs/connection.json b/packages/sdk/specs/connection.jsonindex aef453ef56..6eed27ced6 100644--- a/packages/sdk/specs/connection.json+++ b/packages/sdk/specs/connection.json@@ -259,7 +259,8 @@"static_file","crm_company","crm_contact",- "reminder"+ "reminder",+ "skill"]},"GenericErrorResponse": {diff --git a/packages/sdk/specs/notification.json b/packages/sdk/specs/notification.jsonindex 4fbfcda375..6827822e9c 100644--- a/packages/sdk/specs/notification.json+++ b/packages/sdk/specs/notification.json@@ -1505,7 +1505,8 @@"static_file","crm_company","crm_contact",- "reminder"+ "reminder",+ "skill"]},"ErrorResponse": {@@ -2381,6 +2382,16 @@"enum": ["snippet"]}}+ },+ {+ "type": "object",+ "required": ["type"],+ "properties": {+ "type": {+ "type": "string",+ "enum": ["skill"]+ }+ }}],"description": "The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern."diff --git a/packages/sdk/specs/search.json b/packages/sdk/specs/search.jsonindex b4e27a579e..79f55767dc 100644--- a/packages/sdk/specs/search.json+++ b/packages/sdk/specs/search.json@@ -1422,7 +1422,7 @@"DocumentSubType": {"type": "string","description": "The document sub type enum represents all values of document sub types.\nThese values should match the `document_sub_type_value` table in macrodb.",- "enum": ["task", "snippet"]+ "enum": ["task", "snippet", "skill"]},"EmailFilters": {"type": "object",diff --git a/packages/sdk/specs/storage.json b/packages/sdk/specs/storage.jsonindex c586734d05..53d0e2b49c 100644--- a/packages/sdk/specs/storage.json+++ b/packages/sdk/specs/storage.json@@ -5586,6 +5586,73 @@}}},+ "/documents/create_skill": {+ "post": {+ "tags": ["document"],+ "summary": "Creates a skill document with initialized markdown content in one\nbackend-owned lifecycle. Skills are markdown documents containing\ninstructions that AI reads and follows when the skill is referenced in an\nAI input.",+ "operationId": "create_skill_handler",+ "requestBody": {+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/CreateSkillRequest"+ }+ }+ },+ "required": true+ },+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "type": "object",+ "description": "Response for creating a skill.",+ "required": ["documentId"],+ "properties": {+ "documentId": {+ "type": "string",+ "description": "The document ID of the created skill."+ }+ }+ }+ }+ }+ },+ "400": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ },+ "401": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ },+ "500": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ }+ }+ }+ },"/documents/create_snippet": {"post": {"tags": ["document"],@@ -6183,6 +6250,46 @@}}},+ "/documents/system_skills": {+ "get": {+ "tags": ["document"],+ "summary": "Lists the built-in system skills. System skills are static, code-defined\nAI instructions (see the `system_skills` crate); they surface in the\nskills menu and AI skill tools like user skills, but have no document\nbehind them, so clients must not offer to open them.",+ "operationId": "get_system_skills_handler",+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "type": "object",+ "description": "Response listing the built-in system skills.",+ "required": ["skills"],+ "properties": {+ "skills": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/SystemSkillSummary"+ },+ "description": "Every system skill, in display order."+ }+ }+ }+ }+ }+ },+ "401": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ }+ }+ }+ },"/documents/{document_id}": {"get": {"tags": ["document"],@@ -7822,7 +7929,8 @@"static_file","crm_company","crm_contact",- "reminder"+ "reminder",+ "skill"]}},@@ -9635,7 +9743,8 @@"static_file","crm_company","crm_contact",- "reminder"+ "reminder",+ "skill"]}},@@ -11015,7 +11124,8 @@"static_file","crm_company","crm_contact",- "reminder"+ "reminder",+ "skill"]}],@@ -12453,6 +12563,17 @@"enum": ["snippet"]}}+ },+ {+ "type": "object",+ "description": "A skill document — markdown instructions for AI",+ "required": ["type"],+ "properties": {+ "type": {+ "type": "string",+ "enum": ["skill"]+ }+ }}],"description": "Sub type of a document with associated properties encoded in each variant.\nThis ensures type-safety: task properties only exist when the document is a task."@@ -15093,7 +15214,8 @@"static_file","crm_company","crm_contact",- "reminder"+ "reminder",+ "skill"]}],@@ -15105,6 +15227,37 @@}}},+ "CreateSkillRequest": {+ "type": "object",+ "description": "Request body for creating a skill — a markdown document containing\ninstructions that AI reads and follows when the skill is referenced in an\nAI input.",+ "required": ["skillName"],+ "properties": {+ "markdown": {+ "type": ["string", "null"],+ "description": "Markdown source text. Defaults to an empty skill document."+ },+ "projectId": {+ "type": ["string", "null"],+ "format": "uuid",+ "description": "Optional project ID to associate the skill with."+ },+ "skillName": {+ "type": "string",+ "description": "The name of the skill."+ }+ }+ },+ "CreateSkillResponse": {+ "type": "object",+ "description": "Response for creating a skill.",+ "required": ["documentId"],+ "properties": {+ "documentId": {+ "type": "string",+ "description": "The document ID of the created skill."+ }+ }+ },"CreateSnippetRequest": {"type": "object","description": "Request body for creating a snippet — a reusable markdown document that can\nbe inserted into any markdown area.",@@ -16542,6 +16695,17 @@"enum": ["snippet"]}}+ },+ {+ "type": "object",+ "description": "A skill document — markdown instructions for AI",+ "required": ["type"],+ "properties": {+ "type": {+ "type": "string",+ "enum": ["skill"]+ }+ }}],"description": "The sub type of a document preview with associated properties.\nTask-related properties are encoded within the variant to ensure valid states."@@ -16689,7 +16853,7 @@"DocumentSubType": {"type": "string","description": "The document sub type enum represents all values of document sub types.\nThese values should match the `document_sub_type_value` table in macrodb.",- "enum": ["task", "snippet"]+ "enum": ["task", "snippet", "skill"]},"DocumentSyncContentUpdatedMetadata": {"type": "object",@@ -17627,7 +17791,8 @@"static_file","crm_company","crm_contact",- "reminder"+ "reminder",+ "skill"]}],@@ -17673,7 +17838,8 @@"static_file","crm_company","crm_contact",- "reminder"+ "reminder",+ "skill"]}],@@ -20991,7 +21157,8 @@"static_file","crm_company","crm_contact",- "reminder"+ "reminder",+ "skill"]}],@@ -22244,6 +22411,17 @@"enum": ["snippet"]}}+ },+ {+ "type": "object",+ "description": "A skill document — markdown instructions for AI",+ "required": ["type"],+ "properties": {+ "type": {+ "type": "string",+ "enum": ["skill"]+ }+ }}],"description": "Sub type of a document with associated properties encoded in each variant.\nThis ensures type-safety: task properties only exist when the document is a task."@@ -22992,7 +23170,8 @@"static_file","crm_company","crm_contact",- "reminder"+ "reminder",+ "skill"]}],@@ -23260,6 +23439,22 @@}}},+ "SystemSkillSummary": {+ "type": "object",+ "description": "A built-in system skill: static, code-defined AI instructions surfaced\nthrough the same tools as user-authored skill documents, but with no\ndocument behind them.",+ "required": ["id", "name"],+ "properties": {+ "id": {+ "type": "string",+ "format": "uuid",+ "description": "The well-known id the skill is referenced by in mentions and AI tools."+ },+ "name": {+ "type": "string",+ "description": "The name of the skill."+ }+ }+ },"TagFilterMode": {"type": "string","description": "How multiple `tag_option_ids` combine when filtering.",diff --git a/packages/sdk/src/entities/documents/document.ts b/packages/sdk/src/entities/documents/document.tsindex 9da157e554..4bdd03e1a4 100644--- a/packages/sdk/src/entities/documents/document.ts+++ b/packages/sdk/src/entities/documents/document.ts@@ -84,6 +84,26 @@ export class Documentreturn new Document(client, documentId);}+ /**+ * Create a skill: a markdown document containing instructions that AI reads+ * and follows when the skill is referenced in an AI input.+ */+ static async createSkill(+ client: MacroClient,+ opts: { name: string; markdown?: string; project?: Project },+ ): Promise<Document> {+ const { documentId } = unwrap(+ await client.storage.createSkillHandler({+ body: {+ skillName: opts.name,+ markdown: opts.markdown ?? null,+ projectId: opts.project?.id ?? null,+ },+ }),+ );+ return new Document(client, documentId);+ }+/** The user's recent documents, most recent first, auto-paginated. */static recent(client: MacroClient,diff --git a/packages/sdk/src/entities/documents/namespace.ts b/packages/sdk/src/entities/documents/namespace.tsindex acf56d46c8..bf69f576b6 100644--- a/packages/sdk/src/entities/documents/namespace.ts+++ b/packages/sdk/src/entities/documents/namespace.ts@@ -2,6 +2,7 @@ import type { MacroClient } from '../../utils/client';import type { Project } from '../projects/project';import type { SearchOpts } from '../search';import { Document } from './document';+import { SystemSkill } from './system-skill';export class DocumentNamespace {constructor(private readonly client: MacroClient) {}@@ -29,6 +30,23 @@ export class DocumentNamespace {return Document.createSnippet(this.client, opts);}+ /** Create a skill: markdown instructions that AI reads and follows. */+ createSkill(opts: {+ name: string;+ markdown?: string;+ project?: Project;+ }): Promise<Document> {+ return Document.createSkill(this.client, opts);+ }++ /**+ * The built-in system skills: static AI instructions with no document+ * behind them. Unlike user skills they cannot be opened or edited.+ */+ systemSkills(): Promise<SystemSkill[]> {+ return SystemSkill.list(this.client);+ }+/** Search documents by name and content, most relevant first, auto-paginated. */search(query: string, opts?: SearchOpts): AsyncGenerator<Document> {return Document.search(this.client, query, opts);diff --git a/packages/sdk/src/entities/documents/system-skill.ts b/packages/sdk/src/entities/documents/system-skill.tsnew file mode 100644index 0000000000..31bb6f210f--- /dev/null+++ b/packages/sdk/src/entities/documents/system-skill.ts@@ -0,0 +1,23 @@+import { unwrap } from '../../utils';+import type { MacroClient } from '../../utils/client';++/**+ * A built-in system skill: static, code-defined AI instructions that surface+ * to AI like skill documents but have no document behind them. System skills+ * cannot be opened, edited, or deleted; reference them in AI inputs by id the+ * same way as skill documents.+ */+export class SystemSkill {+ private constructor(+ /** The well-known id the skill is referenced by in mentions and AI tools. */+ readonly id: string,+ /** The skill's display name. */+ readonly name: string,+ ) {}++ /** The built-in system skills, in display order. */+ static async list(client: MacroClient): Promise<SystemSkill[]> {+ const { skills } = unwrap(await client.storage.getSystemSkillsHandler());+ return skills.map((skill) => new SystemSkill(skill.id, skill.name));+ }+}diff --git a/services/document_cognition_service/src/api/context/test.rs b/services/document_cognition_service/src/api/context/test.rsindex 3db8291059..37f07c8cda 100644--- a/services/document_cognition_service/src/api/context/test.rs+++ b/services/document_cognition_service/src/api/context/test.rs@@ -372,6 +372,10 @@ pub async fn test_api_context(pool: sqlx::Pool<sqlx::Postgres>) -> std::sync::Arproject_tool_context,team_tool_context: ai_tools::build_team_tool_context(pool.clone()),crm_tool_context: ai_tools::build_crm_tool_context(pool.clone()),+ skill_tool_context: ai_tools::build_skill_tool_context(+ search_service_client.clone(),+ soup_service.clone(),+ ),schedule_tool_context: ai_tools::no_op_schedule_context(),anthropic_tool_context: ai_tools::build_anthropic_tool_context_test(),recorder: ai_usage::pg_recorder(pool.clone()),diff --git a/services/document_cognition_service/src/api/stream/util/chat_message/mod.rs b/services/document_cognition_service/src/api/stream/util/chat_message/mod.rsindex 6385cdc79e..44004df5f6 100644--- a/services/document_cognition_service/src/api/stream/util/chat_message/mod.rs+++ b/services/document_cognition_service/src/api/stream/util/chat_message/mod.rs@@ -35,6 +35,7 @@ pub async fn store_incoming_message(EntityType::Channel => AttachmentType::Channel,EntityType::EmailThread => AttachmentType::Email,EntityType::Project => AttachmentType::Project,+ EntityType::Skill => AttachmentType::Skill,_ => return None,};Some(NewAttachment {diff --git a/services/document_cognition_service/src/main.rs b/services/document_cognition_service/src/main.rsindex 71b4a5f829..93fa1841f5 100644--- a/services/document_cognition_service/src/main.rs+++ b/services/document_cognition_service/src/main.rs@@ -511,6 +511,10 @@ async fn main() -> anyhow::Result<()> {project_tool_context,team_tool_context: ai_tools::build_team_tool_context(db.clone()),crm_tool_context: ai_tools::build_crm_tool_context(db.clone()),+ skill_tool_context: ai_tools::build_skill_tool_context(+ search_service_client.clone(),+ soup_service.clone(),+ ),schedule_tool_context: ai_tools::NoOpScheduleContext,anthropic_tool_context: ai_tools::build_anthropic_tool_context(),recorder,diff --git a/services/document_storage_service/src/api/annotations/create_comment.rs b/services/document_storage_service/src/api/annotations/create_comment.rsindex 28648850f3..e5c61b2a9f 100644--- a/services/document_storage_service/src/api/annotations/create_comment.rs+++ b/services/document_storage_service/src/api/annotations/create_comment.rs@@ -156,6 +156,9 @@ pub async fn create_comment_handler(document_sub_type::DocumentSubType::Snippet => {NotificationDocumentSubType::Snippet}+ document_sub_type::DocumentSubType::Skill => {+ NotificationDocumentSubType::Skill+ }}),sender_id: sender_id.clone(),sender_profile_picture_url,diff --git a/services/document_storage_service/src/api/annotations/edit_comment.rs b/services/document_storage_service/src/api/annotations/edit_comment.rsindex ffe73a9278..53e813ff5e 100644--- a/services/document_storage_service/src/api/annotations/edit_comment.rs+++ b/services/document_storage_service/src/api/annotations/edit_comment.rs@@ -86,6 +86,9 @@ pub async fn edit_comment_handler(document_sub_type::DocumentSubType::Snippet => {NotificationDocumentSubType::Snippet}+ document_sub_type::DocumentSubType::Skill => {+ NotificationDocumentSubType::Skill+ }}),sender_id: user_id.clone().try_into().ok(),sender_profile_picture_url,diff --git a/services/document_storage_service/src/api/swagger.rs b/services/document_storage_service/src/api/swagger.rsindex 09e9b5d954..ee497323ba 100644--- a/services/document_storage_service/src/api/swagger.rs+++ b/services/document_storage_service/src/api/swagger.rs@@ -188,6 +188,8 @@ use utoipa::OpenApi;documents::export_document::handler,documents_hex::inbound::axum_router::create_task::create_task_handler,documents_hex::inbound::axum_router::create_snippet::create_snippet_handler,+ documents_hex::inbound::axum_router::create_skill::create_skill_handler,+ documents_hex::inbound::axum_router::system_skills::get_system_skills_handler,documents_hex::inbound::axum_router::team_share::get_team_share_handler,documents_hex::inbound::axum_router::team_share::set_team_share_handler,@@ -379,6 +381,8 @@ use utoipa::OpenApi;documents_hex::domain::models::CreateTaskResponse,documents_hex::domain::models::CreateSnippetRequest,documents_hex::domain::models::CreateSnippetResponse,+ documents_hex::domain::models::CreateSkillRequest,+ documents_hex::domain::models::CreateSkillResponse,documents_hex::domain::models::DocumentTeamShareResponse,documents_hex::domain::models::SetDocumentTeamShareRequest,documents_hex::domain::models::PropertyInput,diff --git a/services/document_storage_service/src/service/entity_mutation.rs b/services/document_storage_service/src/service/entity_mutation.rsindex 54b6183108..ee28f6f79d 100644--- a/services/document_storage_service/src/service/entity_mutation.rs+++ b/services/document_storage_service/src/service/entity_mutation.rs@@ -186,7 +186,8 @@ fn favoritable(entity_type: EntityType) -> bool {| EntityType::CrmContact| EntityType::CalendarEvent// Reminders are managed through the reminders API, not favorites.- | EntityType::Reminder => false,+ | EntityType::Reminder+ | EntityType::Skill => false,}}@@ -458,7 +459,8 @@ where| EntityType::CrmCompany| EntityType::CrmContact| EntityType::CalendarEvent- | EntityType::Reminder => {+ | EntityType::Reminder+ | EntityType::Skill => {return unsupported(requested, "rename");}};@@ -502,7 +504,8 @@ where| EntityType::CrmCompany| EntityType::CrmContact| EntityType::CalendarEvent- | EntityType::Reminder => {+ | EntityType::Reminder+ | EntityType::Skill => {return unsupported(requested, "move");}};@@ -548,7 +551,8 @@ where| EntityType::CrmCompany| EntityType::CrmContact| EntityType::CalendarEvent- | EntityType::Reminder => {+ | EntityType::Reminder+ | EntityType::Skill => {return unsupported(requested, "share policy updates");}};@@ -597,7 +601,8 @@ where| EntityType::CrmCompany| EntityType::CrmContact| EntityType::CalendarEvent- | EntityType::Reminder => {+ | EntityType::Reminder+ | EntityType::Skill => {return unsupported(requested, "trash");}};@@ -625,7 +630,8 @@ where| EntityType::CrmCompany| EntityType::CrmContact| EntityType::CalendarEvent- | EntityType::Reminder => {+ | EntityType::Reminder+ | EntityType::Skill => {return unsupported(requested, "restore");}};@@ -673,7 +679,8 @@ where| EntityType::CrmCompany| EntityType::CrmContact| EntityType::CalendarEvent- | EntityType::Reminder => {+ | EntityType::Reminder+ | EntityType::Skill => {return unsupported(requested, "permanent deletion");}};@@ -731,7 +738,8 @@ where| EntityType::CrmCompany| EntityType::CrmContact| EntityType::CalendarEvent- | EntityType::Reminder => {+ | EntityType::Reminder+ | EntityType::Skill => {return unsupported(requested, "duplication");}};diff --git a/services/mcp_service/src/context.rs b/services/mcp_service/src/context.rsindex 8f45b65fd7..eade952f99 100644--- a/services/mcp_service/src/context.rs+++ b/services/mcp_service/src/context.rs@@ -362,11 +362,14 @@ async fn build_tool_context(args: ToolContextBuildArgs<'_>) -> anyhow::Result<Touser_email_service,);+ let search_service_client = Arc::new(search_service_client);+ let skill_tool_context =+ ai_tools::build_skill_tool_context(search_service_client.clone(), soup_service.clone());let tool_context = ToolServiceContext {email_service_client: Arc::new(EmailServiceClientExternal::new(email_service_client.url().to_owned(),)),- search_service_client: Arc::new(search_service_client),+ search_service_client: search_service_client.clone(),soup_service,email_service: email_service_for_tools,document_tool_context,@@ -380,6 +383,7 @@ async fn build_tool_context(args: ToolContextBuildArgs<'_>) -> anyhow::Result<Toproject_tool_context,team_tool_context: ai_tools::build_team_tool_context(db.clone()),crm_tool_context: ai_tools::build_crm_tool_context(db.clone()),+ skill_tool_context,schedule_tool_context: NoOpScheduleContext,anthropic_tool_context: ai_tools::build_anthropic_tool_context(),recorder: ai_usage::pg_recorder(db.clone()),diff --git a/static_assets/schema.graphql b/static_assets/schema.graphqlindex e88c8be620..05347eef6e 100644--- a/static_assets/schema.graphql+++ b/static_assets/schema.graphql@@ -880,6 +880,10 @@ enum GraphqlDocumentSubType {The snippet option."""SNIPPET+ """+ The skill option.+ """+ SKILL}"""@@ -1405,6 +1409,10 @@ enum GraphqlEntityType {Reminder entity."""REMINDER+ """+ AI skill entity (skill document or built-in system skill).+ """+ SKILL}"""@@ -2083,6 +2091,16 @@ enum GraphqlSimpleSortMethod {VIEWED_UPDATED}+"""+represents the skill subtype fields+"""+type GraphqlSkillSubType {+ """+ this object has nothing as a field but we need at least 1 field+ """+ nothing: Boolean!+}+"""represents the snippet subtype fields"""@@ -2804,7 +2822,7 @@ type GraphqlSoupDocument implements GraphqlSoupEntity {"""GraphQL representation of the soup document sub type."""-union GraphqlSoupDocumentSubType = GraphqlTaskSubType | GraphqlSnippetSubType+union GraphqlSoupDocumentSubType = GraphqlTaskSubType | GraphqlSnippetSubType | GraphqlSkillSubType"""GraphQL representation of the soup email attachment.