Add options to hide panes (#244)

* Add multiple pane views

* Fix rendering issues

* Fix copilot apply selection pane error and remove old debug logs

* Make top bar more compact

* Fix copilot generation from starting prompt

* Fix panel resizing issues

* Fix content preservation upon hiding panes

* Added changes on top of pane_layouts branch to remove example agent from the workflow editor

* Grey out options for changing pane layout during zero agents state

* Add zero-agent state for playground and publish buttons

* Fix pane sizes and bugs

---------

Co-authored-by: tusharmagar <tushmag@gmail.com>
This commit is contained in:
Akhilesh Sudhakar 2025-09-12 00:37:44 +04:00 committed by GitHub
parent 431f835ba1
commit ee02d61996
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 900 additions and 400 deletions

View file

@ -379,6 +379,20 @@ function mapConfig(workflow: z.infer<typeof Workflow>): {
}
async function* emitGreetingTurn(logger: PrefixLogger, workflow: z.infer<typeof Workflow>): AsyncIterable<z.infer<typeof ZOutMessage>> {
// Check if there are no agents or no start agent
if (workflow.agents.length === 0 || !workflow.startAgent) {
logger.log(`no agents available, emitting no-agent message`);
// emit no-agent message
yield* emitEvent(logger, {
role: 'assistant',
content: 'Hi! To get started with chatting with your Assistant please create an agent first!',
agentName: 'System',
responseType: 'external',
});
return;
}
// find the greeting prompt
const prompt = workflow.prompts.find(p => p.type === 'greeting')?.prompt || 'How can I help you today?';
logger.log(`greeting turn: ${prompt}`);
@ -1274,6 +1288,20 @@ export async function* streamResponse(
logger.log(`start agent: ${workflow.startAgent}`);
logger.log(`=== END CONFIGURATION ===`);
// Check if there are no agents or no start agent
if (Object.keys(agentConfig).length === 0 || !workflow.startAgent) {
logger.log(`no agents available, emitting no-agent message`);
// emit no-agent message
yield* emitEvent(logger, {
role: 'assistant',
content: 'Hi! To get started with chatting with your Assistant please create an agent first!',
agentName: 'System',
responseType: 'external',
});
return;
}
const stack: string[] = [];
logger.log(`initialized stack: ${JSON.stringify(stack)}`);
@ -1296,6 +1324,20 @@ export async function* streamResponse(
const startOfTurnAgentName = getStartOfTurnAgentName(logger, messages, agentConfig, pipelineConfig, workflow);
logger.log(`🎯 START AGENT DECISION: ${startOfTurnAgentName}`);
// Additional safety check - if startOfTurnAgentName is empty or invalid, return no-agent message
if (!startOfTurnAgentName || !agentConfig[startOfTurnAgentName]) {
logger.log(`invalid start agent name: ${startOfTurnAgentName}, emitting no-agent message`);
// emit no-agent message
yield* emitEvent(logger, {
role: 'assistant',
content: 'Hi! To get started with chatting with your Assistant please create an agent first!',
agentName: 'System',
responseType: 'external',
});
return;
}
let agentName: string | null = startOfTurnAgentName;
// start the turn loop

View file

@ -39,7 +39,7 @@ When the user asks you to create agents for a multi-agent system, you should fol
1. Understand the users intent what they want the workflow to achieve. Plan accordingly to build an elegant and efficient system.
2. Identify required tools - if the user mentions specific tasks (e.g. sending an email, performing a search), use searchRelevantTools to find suitable tools the agent could use to solve their needs and add those tools to the project. Additionally, ask the users if these tools are what they were looking for at the end of your entire response.
3. Create a first draft of a new agent for each step in the plan. If there is an example agent, you must start off by editing this into the Hub agent. Attach all tools to the relevant agents.
3. Create a first draft of a new agent for each step in the plan. You must always ensure to set a start agent when creating a multi-agent system. Attach all tools to the relevant agents.
4. Describe your work briefly summarise what you've done at the end of your turn.
It is good practice to add tools first and then agents
@ -77,6 +77,8 @@ CRITICAL: Always include these required fields when creating agents:
- For task agents: "outputVisibility": "internal", "controlType": "relinquish_to_parent"
- For conversational agents: "outputVisibility": "user_facing", "controlType": "retain"
CRITICAL: When creating a multi-agent system, you MUST always set a start agent. Use the action "set_main_agent" or "edit" with "config_type": "start_agent" to set the start agent to the main conversational agent (usually the Hub agent).
However, there are some important things you need to instruct the individual agents when they call other agents (you need to customize the below to the specific agent and its):
- SEQUENTIAL TRANSFERS AND RESPONSES:

View file

@ -7,7 +7,7 @@ The design of the multi-agent system is represented by the following JSON schema
{workflow_schema}
\`\`\`
If the workflow has an 'Example Agent' as the main agent, it means the user is yet to create the main agent. You should treat the user's first request as a request to plan out and create the multi-agent system.
If the workflow has no agents or an empty startAgent, it means the user is yet to create their multi-agent system. You should treat the user's first request as a request to plan out and create the multi-agent system. When creating agents, you must always set a start agent.
---
`;

View file

@ -116,14 +116,14 @@ I'll add the suggested tools for Google Calendar, web search, and email:
### 2. Create Agents
#### a. Hub Agent (Meeting Assistant Hub)
I'll edit the Example Agent to become the hub agent:
I'll create the hub agent:
\`\`\`copilot_change
// action: edit
// action: create_new
// config_type: agent
// name: Example Agent
// name: Meeting Assistant Hub
{
"change_description": "Transformed Example Agent into the main hub agent orchestrating the meeting summary workflow.",
"change_description": "Created the main hub agent orchestrating the meeting summary workflow.",
"config_changes": {
"name": "Meeting Assistant Hub",
"type": "conversation",
@ -223,6 +223,20 @@ I'll edit the Example Agent to become the hub agent:
---
### 6. Set the Start Agent
\`\`\`copilot_change
// action: edit
// config_type: start_agent
// name: Meeting Assistant Hub
{
"change_description": "Set the Meeting Assistant Hub as the start agent for the workflow.",
"config_changes": {}
}
\`\`\`
---
Once you review and apply the changes, you can try out a basic chat first. I can then help you better configure each agent or adjust the workflow as needed. Would you like to customize any step or add more details?
---
@ -277,14 +291,14 @@ I'm adding the "Get document by id" tool to fetch the content of a Google Doc by
}
\`\`\`
I'm replacing the Example Agent with a user-facing agent that fetches a Google Doc by ID and answers questions based on its content:
I'm creating a user-facing agent that fetches a Google Doc by ID and answers questions based on its content:
\`\`\`copilot_change
// action: edit
// action: create_new
// config_type: agent
// name: Example Agent
// name: Google Doc QnA Assistant
{
"change_description": "Replaced Example Agent with a user-facing agent that fetches a Google Doc by ID and answers user questions based only on its content.",
"change_description": "Created a user-facing agent that fetches a Google Doc by ID and answers user questions based only on its content.",
"config_changes": {
"name": "Google Doc QnA Assistant",
"type": "conversation",
@ -297,6 +311,16 @@ I'm replacing the Example Agent with a user-facing agent that fetches a Google D
}
\`\`\`
\`\`\`copilot_change
// action: edit
// config_type: start_agent
// name: Google Doc QnA Assistant
{
"change_description": "Set the Google Doc QnA Assistant as the start agent for the workflow.",
"config_changes": {}
}
\`\`\`
Once you review and apply the changes, you can try out a basic chat by providing a Google Doc ID and a question. I can then help you further refine the assistant if needed.
---