Skip to content

Commit 7b51ffa

Browse files
authored
Agent Builder (#74)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit # Release Notes * **New Features** * Introduced Agent Studio for creating, testing, and managing custom AI agents with persistent storage. * Added Mini Apps framework enabling users to launch and interact with mini applications within the AI Chat panel. * New tools for searching custom agents, calling agents from other agents, and saving research reports. * **Improvements** * Enhanced agent lifecycle management with improved initialization and refresh workflows. * Simplified final output handling and reporting mechanisms. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent fc26a3e commit 7b51ffa

File tree

73 files changed

+18305
-507
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+18305
-507
lines changed

config/gni/devtools_grd_files.gni

Lines changed: 54 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,31 @@ grd_files_bundled_sources = [
685685
"front_end/panels/ai_chat/ui/TodoListDisplay.js",
686686
"front_end/panels/ai_chat/ui/FileListDisplay.js",
687687
"front_end/panels/ai_chat/ui/FileContentViewer.js",
688+
"front_end/panels/ai_chat/ui/AgentStudioBridge.js",
689+
"front_end/panels/ai_chat/ui/AgentStudioController.js",
690+
"front_end/panels/ai_chat/ui/AgentStudioView.js",
691+
"front_end/panels/ai_chat/ui/SchemaEditor.js",
692+
"front_end/panels/ai_chat/ui/agent_studio/AgentStudioSPA.js",
693+
"front_end/panels/ai_chat/ui/settings/advanced/BrowsingHistorySettings.js",
694+
"front_end/panels/ai_chat/ui/settings/advanced/EvaluationSettings.js",
695+
"front_end/panels/ai_chat/ui/settings/advanced/MCPSettings.js",
696+
"front_end/panels/ai_chat/ui/settings/advanced/TracingSettings.js",
697+
"front_end/panels/ai_chat/ui/settings/advanced/VectorDBSettings.js",
698+
"front_end/panels/ai_chat/ui/settings/components/AdvancedToggle.js",
699+
"front_end/panels/ai_chat/ui/settings/components/ModelSelectorFactory.js",
700+
"front_end/panels/ai_chat/ui/settings/components/SettingsFooter.js",
701+
"front_end/panels/ai_chat/ui/settings/components/SettingsHeader.js",
702+
"front_end/panels/ai_chat/ui/settings/constants.js",
703+
"front_end/panels/ai_chat/ui/settings/i18n-strings.js",
704+
"front_end/panels/ai_chat/ui/settings/providerConfigs.js",
705+
"front_end/panels/ai_chat/ui/settings/providers/BaseProviderSettings.js",
706+
"front_end/panels/ai_chat/ui/settings/providers/GenericProviderSettings.js",
707+
"front_end/panels/ai_chat/ui/settings/providers/LiteLLMSettings.js",
708+
"front_end/panels/ai_chat/ui/settings/providers/OpenRouterSettings.js",
709+
"front_end/panels/ai_chat/ui/settings/types.js",
710+
"front_end/panels/ai_chat/ui/settings/utils/storage.js",
711+
"front_end/panels/ai_chat/ui/settings/utils/styles.js",
712+
"front_end/panels/ai_chat/ui/settings/utils/validation.js",
688713
"front_end/panels/ai_chat/ui/ConversationHistoryList.js",
689714
"front_end/panels/ai_chat/ui/conversationHistoryStyles.js",
690715
"front_end/panels/ai_chat/ui/CustomProviderDialog.js",
@@ -715,6 +740,9 @@ grd_files_bundled_sources = [
715740
"front_end/panels/ai_chat/core/VersionChecker.js",
716741
"front_end/panels/ai_chat/core/LLMConfigurationManager.js",
717742
"front_end/panels/ai_chat/core/CustomProviderManager.js",
743+
"front_end/panels/ai_chat/core/AgentStorageManager.js",
744+
"front_end/panels/ai_chat/core/AgentStudioIntegration.js",
745+
"front_end/panels/ai_chat/core/AgentTestRunner.js",
718746
"front_end/panels/ai_chat/LLM/LLMTypes.js",
719747
"front_end/panels/ai_chat/LLM/LLMProvider.js",
720748
"front_end/panels/ai_chat/LLM/LLMProviderRegistry.js",
@@ -732,6 +760,10 @@ grd_files_bundled_sources = [
732760
"front_end/panels/ai_chat/LLM/GenericOpenAIProvider.js",
733761
"front_end/panels/ai_chat/LLM/LLMClient.js",
734762
"front_end/panels/ai_chat/LLM/MessageSanitizer.js",
763+
"front_end/panels/ai_chat/LLM/AnthropicProvider.js",
764+
"front_end/panels/ai_chat/LLM/CerebrasProvider.js",
765+
"front_end/panels/ai_chat/LLM/GenericOpenAIProvider.js",
766+
"front_end/panels/ai_chat/LLM/GoogleAIProvider.js",
735767
"front_end/panels/ai_chat/tools/Tools.js",
736768
"front_end/panels/ai_chat/tools/SequentialThinkingTool.js",
737769
"front_end/panels/ai_chat/tools/CombinedExtractionTool.js",
@@ -751,6 +783,7 @@ grd_files_bundled_sources = [
751783
"front_end/panels/ai_chat/tools/RenderWebAppTool.js",
752784
"front_end/panels/ai_chat/tools/GetWebAppDataTool.js",
753785
"front_end/panels/ai_chat/tools/RemoveWebAppTool.js",
786+
"front_end/panels/ai_chat/tools/SaveResearchReportTool.js",
754787
"front_end/panels/ai_chat/tools/FileStorageManager.js",
755788
"front_end/panels/ai_chat/tools/CreateFileTool.js",
756789
"front_end/panels/ai_chat/tools/UpdateFileTool.js",
@@ -760,21 +793,34 @@ grd_files_bundled_sources = [
760793
"front_end/panels/ai_chat/tools/ExecuteCodeTool.js",
761794
"front_end/panels/ai_chat/tools/UpdateTodoTool.js",
762795
"front_end/panels/ai_chat/tools/VisualIndicatorTool.js",
796+
"front_end/panels/ai_chat/tools/ReadabilityExtractorTool.js",
797+
"front_end/panels/ai_chat/tools/CallCustomAgentTool.js",
798+
"front_end/panels/ai_chat/tools/SearchCustomAgentsTool.js",
799+
"front_end/panels/ai_chat/tools/mini_app/CloseMiniAppTool.js",
800+
"front_end/panels/ai_chat/tools/mini_app/ExecuteMiniAppActionTool.js",
801+
"front_end/panels/ai_chat/tools/mini_app/GetMiniAppStateTool.js",
802+
"front_end/panels/ai_chat/tools/mini_app/LaunchMiniAppTool.js",
803+
"front_end/panels/ai_chat/tools/mini_app/ListMiniAppsTool.js",
804+
"front_end/panels/ai_chat/tools/mini_app/UpdateMiniAppStateTool.js",
763805
"front_end/panels/ai_chat/common/utils.js",
764806
"front_end/panels/ai_chat/common/log.js",
765807
"front_end/panels/ai_chat/common/context.js",
766808
"front_end/panels/ai_chat/common/page.js",
767-
"front_end/panels/ai_chat/core/structured_response.js",
768-
"front_end/panels/ai_chat/models/ChatTypes.js",
809+
"front_end/panels/ai_chat/mini_apps/GenericMiniAppBridge.js",
810+
"front_end/panels/ai_chat/mini_apps/MiniAppEventBus.js",
811+
"front_end/panels/ai_chat/mini_apps/MiniAppInitialization.js",
812+
"front_end/panels/ai_chat/mini_apps/MiniAppRegistry.js",
813+
"front_end/panels/ai_chat/mini_apps/MiniAppStorageManager.js",
814+
"front_end/panels/ai_chat/mini_apps/apps/agent_studio/AgentStudioMiniApp.js",
815+
"front_end/panels/ai_chat/mini_apps/types/MiniAppTypes.js",
816+
"front_end/panels/ai_chat/models/ChatTypes.js",
769817
"front_end/panels/ai_chat/ui/input/ChatInput.js",
770818
"front_end/panels/ai_chat/ui/input/InputBar.js",
771819
"front_end/panels/ai_chat/ui/markdown/MarkdownRenderers.js",
772820
"front_end/panels/ai_chat/ui/message/MessageList.js",
773821
"front_end/panels/ai_chat/ui/message/ModelMessage.js",
774822
"front_end/panels/ai_chat/ui/message/MessageCombiner.js",
775-
"front_end/panels/ai_chat/ui/message/StructuredResponseRender.js",
776-
"front_end/panels/ai_chat/ui/message/StructuredResponseController.js",
777-
"front_end/panels/ai_chat/ui/message/GlobalActionsRow.js",
823+
"front_end/panels/ai_chat/ui/message/GlobalActionsRow.js",
778824
"front_end/panels/ai_chat/ui/message/ToolResultMessage.js",
779825
"front_end/panels/ai_chat/ui/message/UserMessage.js",
780826
"front_end/panels/ai_chat/ui/model_selector/ModelSelector.js",
@@ -819,6 +865,7 @@ grd_files_bundled_sources = [
819865
"front_end/panels/ai_chat/evaluation/framework/MarkdownReportGenerator.js",
820866
"front_end/panels/ai_chat/evaluation/framework/types.js",
821867
"front_end/panels/ai_chat/evaluation/test-cases/action-agent-tests.js",
868+
"front_end/panels/ai_chat/evaluation/test-cases/html-to-markdown-tests.js",
822869
"front_end/panels/ai_chat/evaluation/test-cases/research-agent-tests.js",
823870
"front_end/panels/ai_chat/evaluation/test-cases/schema-extractor-tests.js",
824871
"front_end/panels/ai_chat/evaluation/test-cases/streamlined-schema-extractor-tests.js",
@@ -844,6 +891,8 @@ grd_files_bundled_sources = [
844891
"front_end/panels/ai_chat/utils/ContentChunker.js",
845892
"front_end/panels/ai_chat/vendor/readability-source.js",
846893
"front_end/panels/ai_chat/tools/LLMTracingWrapper.js",
894+
"front_end/panels/ai_chat/utils/ContentChunker.js",
895+
"front_end/panels/ai_chat/vendor/readability-source.js",
847896
"front_end/panels/animation/animation-meta.js",
848897
"front_end/panels/animation/animation.js",
849898
"front_end/panels/application/application-meta.js",

front_end/panels/ai_chat/BUILD.gn

Lines changed: 61 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,16 @@ generate_css("css_files") {
1717

1818
devtools_module("ai_chat") {
1919
sources = [
20+
"core/AgentStorageManager.ts",
21+
"core/AgentStudioIntegration.ts",
22+
"core/AgentTestRunner.ts",
2023
"ui/AIChatPanel.ts",
2124
"ui/ChatView.ts",
2225
"ui/message/MessageList.ts",
2326
"ui/message/UserMessage.ts",
2427
"ui/message/ModelMessage.ts",
2528
"ui/message/ToolResultMessage.ts",
2629
"ui/message/MessageCombiner.ts",
27-
"ui/message/StructuredResponseRender.ts",
28-
"ui/message/StructuredResponseController.ts",
2930
"ui/message/GlobalActionsRow.ts",
3031
"ui/markdown/MarkdownRenderers.ts",
3132
"ui/model_selector/ModelSelector.ts",
@@ -89,8 +90,7 @@ devtools_module("ai_chat") {
8990
"core/AgentService.ts",
9091
"core/Constants.ts",
9192
"core/BuildConfig.ts",
92-
"core/structured_response.ts",
93-
"core/GraphConfigs.ts",
93+
"core/GraphConfigs.ts",
9494
"core/ConfigurableGraph.ts",
9595
"core/BaseOrchestratorAgent.ts",
9696
"core/AgentDescriptorRegistry.ts",
@@ -154,7 +154,23 @@ devtools_module("ai_chat") {
154154
"tools/RenderWebAppTool.ts",
155155
"tools/GetWebAppDataTool.ts",
156156
"tools/RemoveWebAppTool.ts",
157+
"tools/SaveResearchReportTool.ts",
158+
"tools/SearchCustomAgentsTool.ts",
159+
"tools/CallCustomAgentTool.ts",
157160
"tools/VisualIndicatorTool.ts",
161+
"tools/mini_app/ListMiniAppsTool.ts",
162+
"tools/mini_app/LaunchMiniAppTool.ts",
163+
"tools/mini_app/GetMiniAppStateTool.ts",
164+
"tools/mini_app/UpdateMiniAppStateTool.ts",
165+
"tools/mini_app/ExecuteMiniAppActionTool.ts",
166+
"tools/mini_app/CloseMiniAppTool.ts",
167+
"mini_apps/types/MiniAppTypes.ts",
168+
"mini_apps/MiniAppRegistry.ts",
169+
"mini_apps/GenericMiniAppBridge.ts",
170+
"mini_apps/MiniAppStorageManager.ts",
171+
"mini_apps/MiniAppEventBus.ts",
172+
"mini_apps/MiniAppInitialization.ts",
173+
"mini_apps/apps/agent_studio/AgentStudioMiniApp.ts",
158174
"agent_framework/ConfigurableAgentTool.ts",
159175
"agent_framework/AgentRunner.ts",
160176
"agent_framework/AgentRunnerEventBus.ts",
@@ -213,6 +229,11 @@ devtools_module("ai_chat") {
213229
"mcp/MCPMetaTools.ts",
214230
"ui/mcp/MCPConnectionsDialog.ts",
215231
"ui/mcp/MCPConnectorsCatalogDialog.ts",
232+
"ui/SchemaEditor.ts",
233+
"ui/AgentStudioView.ts",
234+
"ui/AgentStudioController.ts",
235+
"ui/AgentStudioBridge.ts",
236+
"ui/agent_studio/AgentStudioSPA.ts",
216237
]
217238

218239
deps = [
@@ -237,15 +258,16 @@ devtools_module("ai_chat") {
237258

238259
# List of source files also used to determine JS outputs for metadata
239260
_ai_chat_sources = [
261+
"core/AgentStorageManager.ts",
262+
"core/AgentStudioIntegration.ts",
263+
"core/AgentTestRunner.ts",
240264
"ui/AIChatPanel.ts",
241265
"ui/ChatView.ts",
242266
"ui/message/MessageList.ts",
243267
"ui/message/UserMessage.ts",
244268
"ui/message/ModelMessage.ts",
245269
"ui/message/ToolResultMessage.ts",
246270
"ui/message/MessageCombiner.ts",
247-
"ui/message/StructuredResponseRender.ts",
248-
"ui/message/StructuredResponseController.ts",
249271
"ui/message/GlobalActionsRow.ts",
250272
"ui/markdown/MarkdownRenderers.ts",
251273
"ui/model_selector/ModelSelector.ts",
@@ -295,6 +317,11 @@ _ai_chat_sources = [
295317
"ui/customProviderStyles.ts",
296318
"ui/mcp/MCPConnectionsDialog.ts",
297319
"ui/mcp/MCPConnectorsCatalogDialog.ts",
320+
"ui/SchemaEditor.ts",
321+
"ui/AgentStudioView.ts",
322+
"ui/AgentStudioController.ts",
323+
"ui/AgentStudioBridge.ts",
324+
"ui/agent_studio/AgentStudioSPA.ts",
298325
"ai_chat_impl.ts",
299326
"models/ChatTypes.ts",
300327
"persistence/ConversationTypes.ts",
@@ -311,8 +338,7 @@ _ai_chat_sources = [
311338
"core/AgentService.ts",
312339
"core/Constants.ts",
313340
"core/BuildConfig.ts",
314-
"core/structured_response.ts",
315-
"core/GraphConfigs.ts",
341+
"core/GraphConfigs.ts",
316342
"core/ConfigurableGraph.ts",
317343
"core/BaseOrchestratorAgent.ts",
318344
"core/AgentDescriptorRegistry.ts",
@@ -376,7 +402,23 @@ _ai_chat_sources = [
376402
"tools/RenderWebAppTool.ts",
377403
"tools/GetWebAppDataTool.ts",
378404
"tools/RemoveWebAppTool.ts",
405+
"tools/SaveResearchReportTool.ts",
406+
"tools/SearchCustomAgentsTool.ts",
407+
"tools/CallCustomAgentTool.ts",
379408
"tools/VisualIndicatorTool.ts",
409+
"tools/mini_app/ListMiniAppsTool.ts",
410+
"tools/mini_app/LaunchMiniAppTool.ts",
411+
"tools/mini_app/GetMiniAppStateTool.ts",
412+
"tools/mini_app/UpdateMiniAppStateTool.ts",
413+
"tools/mini_app/ExecuteMiniAppActionTool.ts",
414+
"tools/mini_app/CloseMiniAppTool.ts",
415+
"mini_apps/types/MiniAppTypes.ts",
416+
"mini_apps/MiniAppRegistry.ts",
417+
"mini_apps/GenericMiniAppBridge.ts",
418+
"mini_apps/MiniAppStorageManager.ts",
419+
"mini_apps/MiniAppEventBus.ts",
420+
"mini_apps/MiniAppInitialization.ts",
421+
"mini_apps/apps/agent_studio/AgentStudioMiniApp.ts",
380422
"agent_framework/ConfigurableAgentTool.ts",
381423
"agent_framework/AgentRunner.ts",
382424
"agent_framework/AgentRunnerEventBus.ts",
@@ -526,11 +568,15 @@ ts_library("unittests") {
526568
"ui/__tests__/WebAppCodeViewer.test.ts",
527569
"ui/input/__tests__/InputBarClear.test.ts",
528570
"ui/message/__tests__/MessageCombiner.test.ts",
529-
"ui/message/__tests__/StructuredResponseController.test.ts",
530571
"LLM/__tests__/MessageSanitizer.test.ts",
531572
"agent_framework/__tests__/AgentRunner.sanitizeToolResult.test.ts",
532573
"agent_framework/__tests__/AgentRunner.computeToolResultText.test.ts",
533574
"agent_framework/__tests__/AgentRunner.run.flows.test.ts",
575+
"agent_framework/__tests__/AgentRunner.core.test.ts",
576+
"agent_framework/__tests__/AgentRunner.handoff.test.ts",
577+
"agent_framework/__tests__/ConfigurableAgentTool.test.ts",
578+
"agent_framework/__tests__/ToolRegistry.test.ts",
579+
"agent_framework/__tests__/AgentRunnerEventBus.test.ts",
534580
"mcp/__tests__/MCPClientSDK.test.ts",
535581
"mcp/__tests__/MCPConfig.test.ts",
536582
"mcp/__tests__/MCPIntegration.test.ts",
@@ -541,6 +587,7 @@ ts_library("unittests") {
541587
"core/__tests__/ToolNameMap.test.ts",
542588
"core/__tests__/ToolNameMapping.test.ts",
543589
"core/__tests__/ToolSurfaceProvider.test.ts",
590+
"core/__tests__/StateGraph.core.test.ts",
544591
"ui/__tests__/AIChatPanel.test.ts",
545592
"ui/__tests__/LiveAgentSessionComponent.test.ts",
546593
"ui/message/__tests__/MessageList.test.ts",
@@ -549,10 +596,15 @@ ts_library("unittests") {
549596
"tools/__tests__/ReadFileTool.test.ts",
550597
"tools/__tests__/ListFilesTool.test.ts",
551598
"tools/__tests__/FileStorageManager.test.ts",
599+
"tools/mini_app/__tests__/MiniAppTools.test.ts",
600+
"mini_apps/__tests__/MiniAppRegistry.test.ts",
601+
"mini_apps/__tests__/GenericMiniAppBridge.test.ts",
602+
"mini_apps/__tests__/MiniAppEventBus.test.ts",
552603
]
553604

554605
deps = [
555606
":ai_chat",
607+
"testing:testing",
556608
"../../testing",
557609
"../../core/sdk:bundle",
558610
"../../generated:protocol",

front_end/panels/ai_chat/agent_framework/AgentRunner.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,19 +402,21 @@ export class AgentRunner {
402402
...(actualResult.intermediateSteps || []) // History *from* the recursive call (should exist if flag is true)
403403
];
404404
// Return the result from the target agent, but with combined history
405+
// Always use 'handed_off' since this IS a handoff completion
405406
return {
406407
...actualResult,
407408
intermediateSteps: combinedIntermediateSteps,
408-
terminationReason: actualResult.terminationReason || 'handed_off',
409+
terminationReason: 'handed_off' as const,
409410
agentSession: childSession
410411
};
411412
}
412413
// Otherwise (default), omit the target's intermediate steps
413414
logger.info(`Omitting intermediateSteps from ${targetAgentTool.name} based on its config (default or flag set to false).`);
414415
// Return result from target, ensuring intermediateSteps are omitted
416+
// Always use 'handed_off' since this IS a handoff completion
415417
const finalResult = {
416418
...actualResult,
417-
terminationReason: actualResult.terminationReason || 'handed_off',
419+
terminationReason: 'handed_off' as const,
418420
agentSession: childSession
419421
};
420422
// Explicitly delete intermediateSteps if they somehow exist on actualResult (shouldn't due to target config)

0 commit comments

Comments
 (0)