Skip to content

Commit 9d521d2

Browse files
zimegClaude
andcommitted
feat(types): add agent_session_stopped and agent_session_title_changed events
Type the two agent session events an agent app receives, mirroring the existing assistant events. Adds them to the SlackEvent union so bolt-js routes them type-safely. - agent_session_stopped: type, channel, user, thread_ts, streaming_message_ts (array), event_ts - agent_session_title_changed: type, channel, user, team_id, thread_ts, title, previous_title, event_ts Field sets captured from live events. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
1 parent 614ed94 commit 9d521d2

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// https://docs.slack.dev/reference/events/agent_session_stopped
2+
export interface AgentSessionStoppedEvent {
3+
type: 'agent_session_stopped';
4+
channel: string;
5+
user: string;
6+
thread_ts: string;
7+
streaming_message_ts: string[];
8+
event_ts: string;
9+
}
10+
11+
// https://docs.slack.dev/reference/events/agent_session_title_changed
12+
export interface AgentSessionTitleChangedEvent {
13+
type: 'agent_session_title_changed';
14+
channel: string;
15+
user: string;
16+
team_id: string;
17+
thread_ts: string;
18+
title: string;
19+
previous_title?: string;
20+
event_ts: string;
21+
}

‎packages/types/src/events/index.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { AgentSessionStoppedEvent, AgentSessionTitleChangedEvent } from './agents';
12
import type {
23
AppContextChangedEvent,
34
AppDeletedEvent,
@@ -88,6 +89,7 @@ import type {
8889
import type { TokensRevokedEvent } from './token';
8990
import type { UserChangeEvent, UserHuddleChangedEvent, UserProfileChangedEvent, UserStatusChangedEvent } from './user';
9091

92+
export * from './agents';
9193
export * from './app';
9294
export * from './assistant';
9395
export * from './call';
@@ -121,6 +123,8 @@ export * from './user';
121123
* This is a discriminated union. The discriminant is the `type` property.
122124
*/
123125
export type SlackEvent =
126+
| AgentSessionStoppedEvent
127+
| AgentSessionTitleChangedEvent
124128
| AppContextChangedEvent
125129
| AppDeletedEvent
126130
| AppHomeOpenedEvent

0 commit comments

Comments
 (0)