diff --git a/internal/shared/types/app_manifest.go b/internal/shared/types/app_manifest.go index a9864fc3..61755859 100644 --- a/internal/shared/types/app_manifest.go +++ b/internal/shared/types/app_manifest.go @@ -70,6 +70,7 @@ type DisplayInformation struct { type AppFeatures struct { AppHome ManifestAppHome `json:"app_home,omitempty" yaml:"app_home,flow,omitempty"` + AgentView *AgentView `json:"agent_view,omitempty" yaml:"agent_view,omitempty"` AssistantView *AssistantView `json:"assistant_view,omitempty" yaml:"assistant_view,omitempty"` BotUser BotUser `json:"bot_user,omitempty" yaml:"bot_user,flow,omitempty"` WorkflowSteps []WorkflowStep `json:"workflow_steps,omitempty" yaml:"workflow_steps,flow,omitempty"` @@ -95,6 +96,17 @@ type SuggestedPrompts struct { Message string `json:"message,omitempty" yaml:"message,omitempty"` } +type AgentView struct { + AgentDescription string `json:"agent_description,omitempty" yaml:"agent_description,omitempty"` + SuggestedPrompts []SuggestedPrompts `json:"suggested_prompts,omitempty" yaml:"suggested_prompts,flow,omitempty"` + Actions []AgentViewAction `json:"actions,omitempty" yaml:"actions,flow,omitempty"` +} + +type AgentViewAction struct { + Name string `json:"name,omitempty" yaml:"name,omitempty"` + Description string `json:"description,omitempty" yaml:"description,omitempty"` +} + type OAuthConfig struct { RedirectURLs []string `json:"redirect_urls,omitempty" yaml:"redirect_urls,flow,omitempty"` Scopes *ManifestScopes `json:"scopes,omitempty" yaml:"scopes,flow,omitempty"` diff --git a/internal/shared/types/app_manifest_test.go b/internal/shared/types/app_manifest_test.go index 174ff2d0..405be005 100644 --- a/internal/shared/types/app_manifest_test.go +++ b/internal/shared/types/app_manifest_test.go @@ -192,6 +192,40 @@ func Test_AppManifest_AppFeatures(t *testing.T) { }, want: `{"app_home":{},"assistant_view":{"assistant_description":"magic","suggested_prompts":[{"title":"visit the beach","message":"what is glass"}]},"bot_user":{"display_name":"einstein"}}`, }, + "includes agent view when provided": { + features: AppFeatures{ + AgentView: &AgentView{ + AgentDescription: "summarizes threads", + SuggestedPrompts: []SuggestedPrompts{ + { + Title: "summarize this thread", + Message: "please summarize the conversation", + }, + }, + Actions: []AgentViewAction{ + { + Name: "open_settings", + Description: "Open the agent settings panel.", + }, + }, + }, + BotUser: BotUser{ + DisplayName: "agent_smith", + }, + }, + want: `{"app_home":{},"agent_view":{"agent_description":"summarizes threads","suggested_prompts":[{"title":"summarize this thread","message":"please summarize the conversation"}],"actions":[{"name":"open_settings","description":"Open the agent settings panel."}]},"bot_user":{"display_name":"agent_smith"}}`, + }, + "omits agent view fields when empty": { + features: AppFeatures{ + AgentView: &AgentView{ + AgentDescription: "minimal", + }, + BotUser: BotUser{ + DisplayName: "agent_smith", + }, + }, + want: `{"app_home":{},"agent_view":{"agent_description":"minimal"},"bot_user":{"display_name":"agent_smith"}}`, + }, "includes search when provided": { features: AppFeatures{ BotUser: BotUser{