Skip to content

Commit f0d20ad

Browse files
authored
feat: add support for 'features.agent_view' app manifest property (#596)
* feat: add agent_view manifest types Adds AgentView and AgentViewAction structs and an AgentView field on AppFeatures so manifests using the new agent_view property survive JSON/YAML round-trips through the CLI. Mirrors AssistantView and reuses the existing SuggestedPrompts type. * test: drop redundant agent_view round-trip test The agent_view JSON marshal cases live in Test_AppManifest_AppFeatures alongside other features. The standalone round-trip test had no precedent for sibling properties like assistant_view.
1 parent 2851328 commit f0d20ad

2 files changed

Lines changed: 46 additions & 0 deletions

File tree

internal/shared/types/app_manifest.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ type DisplayInformation struct {
7070

7171
type AppFeatures struct {
7272
AppHome ManifestAppHome `json:"app_home,omitempty" yaml:"app_home,flow,omitempty"`
73+
AgentView *AgentView `json:"agent_view,omitempty" yaml:"agent_view,omitempty"`
7374
AssistantView *AssistantView `json:"assistant_view,omitempty" yaml:"assistant_view,omitempty"`
7475
BotUser BotUser `json:"bot_user,omitempty" yaml:"bot_user,flow,omitempty"`
7576
WorkflowSteps []WorkflowStep `json:"workflow_steps,omitempty" yaml:"workflow_steps,flow,omitempty"`
@@ -95,6 +96,17 @@ type SuggestedPrompts struct {
9596
Message string `json:"message,omitempty" yaml:"message,omitempty"`
9697
}
9798

99+
type AgentView struct {
100+
AgentDescription string `json:"agent_description,omitempty" yaml:"agent_description,omitempty"`
101+
SuggestedPrompts []SuggestedPrompts `json:"suggested_prompts,omitempty" yaml:"suggested_prompts,flow,omitempty"`
102+
Actions []AgentViewAction `json:"actions,omitempty" yaml:"actions,flow,omitempty"`
103+
}
104+
105+
type AgentViewAction struct {
106+
Name string `json:"name,omitempty" yaml:"name,omitempty"`
107+
Description string `json:"description,omitempty" yaml:"description,omitempty"`
108+
}
109+
98110
type OAuthConfig struct {
99111
RedirectURLs []string `json:"redirect_urls,omitempty" yaml:"redirect_urls,flow,omitempty"`
100112
Scopes *ManifestScopes `json:"scopes,omitempty" yaml:"scopes,flow,omitempty"`

internal/shared/types/app_manifest_test.go

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,40 @@ func Test_AppManifest_AppFeatures(t *testing.T) {
192192
},
193193
want: `{"app_home":{},"assistant_view":{"assistant_description":"magic","suggested_prompts":[{"title":"visit the beach","message":"what is glass"}]},"bot_user":{"display_name":"einstein"}}`,
194194
},
195+
"includes agent view when provided": {
196+
features: AppFeatures{
197+
AgentView: &AgentView{
198+
AgentDescription: "summarizes threads",
199+
SuggestedPrompts: []SuggestedPrompts{
200+
{
201+
Title: "summarize this thread",
202+
Message: "please summarize the conversation",
203+
},
204+
},
205+
Actions: []AgentViewAction{
206+
{
207+
Name: "open_settings",
208+
Description: "Open the agent settings panel.",
209+
},
210+
},
211+
},
212+
BotUser: BotUser{
213+
DisplayName: "agent_smith",
214+
},
215+
},
216+
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"}}`,
217+
},
218+
"omits agent view fields when empty": {
219+
features: AppFeatures{
220+
AgentView: &AgentView{
221+
AgentDescription: "minimal",
222+
},
223+
BotUser: BotUser{
224+
DisplayName: "agent_smith",
225+
},
226+
},
227+
want: `{"app_home":{},"agent_view":{"agent_description":"minimal"},"bot_user":{"display_name":"agent_smith"}}`,
228+
},
195229
"includes search when provided": {
196230
features: AppFeatures{
197231
BotUser: BotUser{

0 commit comments

Comments
 (0)