@@ -25,8 +25,6 @@ const REQUIRED_AGENT_EVENTS = [
2525 'agent_session_title_changed' ,
2626 'app_context_changed' ,
2727 'app_home_opened' ,
28- 'assistant_thread_context_changed' ,
29- 'assistant_thread_started' ,
3028 'message.im' ,
3129]
3230
@@ -58,6 +56,29 @@ describe('buildSlackManifest - interactivity', () => {
5856} )
5957
6058describe ( 'buildSlackManifest - Agent View' , ( ) => {
59+ it . each ( [
60+ { name : 'minimal' , capabilities : new Set < string > ( ) } ,
61+ { name : 'all capabilities' , capabilities : new Set ( SLACK_CAPABILITIES . map ( ( { id } ) => id ) ) } ,
62+ ] ) ( 'excludes incompatible Assistant events from $name manifests' , ( { capabilities } ) => {
63+ const manifest = buildSlackManifest ( capabilities , opts )
64+ const features = manifest . features as Record < string , unknown >
65+ const subscriptions = settingsOf ( manifest ) . event_subscriptions as { bot_events : string [ ] }
66+
67+ expect ( features . agent_view ) . toBeDefined ( )
68+ expect ( features . assistant_view ) . toBeUndefined ( )
69+ expect ( subscriptions . bot_events ) . not . toContain ( 'assistant_thread_started' )
70+ expect ( subscriptions . bot_events ) . not . toContain ( 'assistant_thread_context_changed' )
71+ expect ( subscriptions . bot_events ) . toEqual (
72+ expect . arrayContaining ( [
73+ 'app_home_opened' ,
74+ 'app_context_changed' ,
75+ 'message.im' ,
76+ 'agent_session_stopped' ,
77+ 'agent_session_title_changed' ,
78+ ] )
79+ )
80+ } )
81+
6182 it ( 'enables Agent View, Agent Sessions, streaming, and direct messages for every custom bot' , ( ) => {
6283 const manifest = buildSlackManifest ( new Set ( ) , opts )
6384 const features = manifest . features as Record < string , Record < string , unknown > >
0 commit comments