Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions internal/shared/types/app_manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ type AppFeatures struct {
ManifestSlashCommandsItems []ManifestSlashCommandsItem `json:"slash_commands,omitempty" yaml:"slash_commands,flow,omitempty"`
Search *Search `json:"search,omitempty" yaml:"search,flow,omitempty"`
RichPreviews *RichPreviews `json:"rich_previews,omitempty" yaml:"rich_previews,flow,omitempty"`
CodeChannels *CodeChannels `json:"code_channels,omitempty" yaml:"code_channels,flow,omitempty"`
}

type RichPreviews struct {
Expand Down Expand Up @@ -289,6 +290,15 @@ type Search struct {
EnableAIAnswers *bool `json:"enable_ai_answers,omitempty" yaml:"enable_ai_answers,omitempty"`
}

// CodeChannels contains settings for apps that create code channels: dedicated
// channels where an agent collaborates with a user on a task. Enabled is a
// pointer so an explicit `false` (feature turned off) is distinguishable from
// an unset field.
type CodeChannels struct {
Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
SlashCommandURL string `json:"slash_command_url,omitempty" yaml:"slash_command_url,omitempty"`
}

// Workflow defines the structure of a workflow in the app manifest.
type Workflow struct {
Title string `json:"title" yaml:"title"`
Expand Down
23 changes: 23 additions & 0 deletions internal/shared/types/app_manifest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,29 @@ func Test_AppManifest_AppFeatures(t *testing.T) {
},
want: `{"app_home":{},"bot_user":{"display_name":"business_bot"},"rich_previews":{"entity_types":["slack#/entities/file"]}}`,
},
"includes code channels when provided": {
features: AppFeatures{
BotUser: BotUser{
DisplayName: "coding_agent",
},
CodeChannels: &CodeChannels{
Enabled: new(true),
SlashCommandURL: "https://example.com/slack/code-channel-commands",
},
},
want: `{"app_home":{},"bot_user":{"display_name":"coding_agent"},"code_channels":{"enabled":true,"slash_command_url":"https://example.com/slack/code-channel-commands"}}`,
},
"serializes code channels disabled explicitly": {
features: AppFeatures{
BotUser: BotUser{
DisplayName: "coding_agent",
},
CodeChannels: &CodeChannels{
Enabled: new(false),
},
},
want: `{"app_home":{},"bot_user":{"display_name":"coding_agent"},"code_channels":{"enabled":false}}`,
},
}
for name, tc := range tests {
t.Run(name, func(t *testing.T) {
Expand Down
Loading