Skip to content

Commit 5158a00

Browse files
Sg312icecrasher321waleedlatif1emir-karabegSiddharth Sim
authored
feat(copilot-v1): Copilot v1 (#662)
* Fix docs agent * Doc agent fixes * Refactor copilot * Lint * Update yaml editor * Lint * Fix block tool * Lint * Get block metadata tool * Lint * Yaml changes * Lint * Fixes? * Lint * Better yaml language * Lint * UPdate * Lint * Fix condition blocks * lint * Fix start block * Fix starter block stuff * Lint * Fix yaml ui * Lint * get yaml tool * Lint * hi * Lint * Agnet * Copilot UI * Lint * Better workflow builder * Lint * REHYDRATION * Lint * Auto layout * Lint * Fixes * Lint * Chatbar sizing * Lint * Initial chat fixes * Lint * Dropdown overflow * Lint * UI text * Lint * Sample question pills * Lint * Ui button * Fix dropdown appearance * Lint * Modal fixes * UI Updates * Lint * Initial ask vs agent mode * Lint * Ask vs agent * Lint * Ask udpate * Ui fixes * Lint * User message width * Chat leak fix * Lint * Agent ui * Checkpointing * Lint * Checkpoints * Lint * Tweaks * Sample questions * Lint * Modal full screen mode * Lint * Prompt updates * Cleaning * Lint * Prompt update * Streaming v1 * Lint * Tool call inline * Lint * Checkpoint * Lint * Fix lint * Sizing * Lint * Copilot ui tool call fixes * Remove output from tool call ui * Updates * Lint * Checkpoitn * Loading icon * Lint * Pulse * Lint * Modal fixes * Sidebar padding * Checkpoint * checkpoint * feat(platform): new UI and templates (#639) (#693) * improvement: control bar * improvement: debug flow * improvement: control bar hovers and skeleton loading * improvement: completed control bar * improvement: panel tab selector complete * refactor: deleted notifications and history dropdown * improvement: chat UI complete * fix: tab change on control bar run * improvement: finshed console (audio display not working) * fix: text wrapping in console content * improvement: audio UI * improvement: image display * feat: add input to console * improvement: code input and showing input on errors * feat: download chat and console * improvement: expandable panel and console visibility * improvement: empty state UI * improvement: finished variables * fix: image in console entry * improvement: sidebar and templates ui * feat: uploading and fetching templates * improvement: sidebar and control bar * improvement: templates * feat: templates done * fix(sockets): remove package-lock * fix: sidebar scroll going over sidebar height (#709) * Checkpoint * Fix build error * Checkpoitn * Docs updates * Checkpoint * Streaming vs non streaming * Clean up yaml save * Fix revert checkpoitn yaml * Doc fixes * Small docs fix * Clean up old yaml docs * Doc updates * Hide copilot * Revert width * Db migration fixes * Add snapshot * Remove space from mdx * Add spaces * Lint * Address greptile comments * lint fix * Hide copilot --------- Co-authored-by: Vikhyath Mondreti <vikhyathvikku@gmail.com> Co-authored-by: Waleed Latif <walif6@gmail.com> Co-authored-by: Emir Karabeg <78010029+emir-karabeg@users.noreply.github.com> Co-authored-by: Siddharth Sim <sidstudio@SiddharthsMBP2.attlocal.net>
1 parent 31d909b commit 5158a00

File tree

96 files changed

+19700
-2670
lines changed

Some content is hidden

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

96 files changed

+19700
-2670
lines changed

apps/docs/content/docs/blocks/loop.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,4 +172,4 @@ After a loop completes, you can access aggregated results:
172172

173173
- **Set reasonable limits**: Keep iteration counts reasonable to avoid long execution times
174174
- **Use ForEach for collections**: When processing arrays or objects, use ForEach instead of For loops
175-
- **Handle errors gracefully**: Consider adding error handling inside loops for robust workflows
175+
- **Handle errors gracefully**: Consider adding error handling inside loops for robust workflows

apps/docs/content/docs/blocks/parallel.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,4 +207,4 @@ Understanding when to use each:
207207

208208
- **Independent operations only**: Ensure operations don't depend on each other
209209
- **Handle rate limits**: Add delays or throttling for API-heavy workflows
210-
- **Error handling**: Each instance should handle its own errors gracefully
210+
- **Error handling**: Each instance should handle its own errors gracefully

apps/docs/content/docs/blocks/response.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,4 +182,5 @@ headers:
182182
- **Structure your responses consistently**: Maintain a consistent JSON structure across all your API endpoints for better developer experience
183183
- **Include relevant metadata**: Add timestamps and version information to help with debugging and monitoring
184184
- **Handle errors gracefully**: Use conditional logic in your workflow to set appropriate error responses with descriptive messages
185-
- **Validate variable references**: Ensure all referenced variables exist and contain the expected data types before the Response block executes
185+
- **Validate variable references**: Ensure all referenced variables exist and contain the expected data types before the Response block executes
186+

apps/docs/content/docs/blocks/workflow.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,4 +256,4 @@ return {
256256
- **Document dependencies**: Clearly document which workflows depend on others and maintain dependency maps
257257
- **Test independently**: Ensure child workflows can be tested and validated independently from parent workflows
258258
- **Monitor performance**: Be aware that nested workflows can impact overall execution time and resource usage
259-
- **Use semantic naming**: Give workflows descriptive names that clearly indicate their purpose and functionality
259+
- **Use semantic naming**: Give workflows descriptive names that clearly indicate their purpose and functionality

apps/docs/content/docs/meta.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"execution",
1515
"---Advanced---",
1616
"./variables/index",
17+
"yaml",
1718
"---SDKs---",
1819
"./sdks/python",
1920
"./sdks/typescript"

apps/docs/content/docs/tools/index.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,14 @@ Tools typically return structured data that can be processed by subsequent block
6464
- Status information
6565

6666
Refer to each tool's specific documentation to understand its exact output format.
67+
68+
## YAML Configuration
69+
70+
For detailed YAML workflow configuration and syntax, see the [YAML Workflow Reference](/yaml) documentation. This includes comprehensive guides for:
71+
72+
- **Block Reference Syntax**: How to connect and reference data between blocks
73+
- **Tool Configuration**: Using tools in both standalone blocks and agent configurations
74+
- **Environment Variables**: Secure handling of API keys and credentials
75+
- **Complete Examples**: Real-world workflow patterns and configurations
76+
77+
For specific tool parameters and configuration options, refer to each tool's individual documentation page.
Lines changed: 238 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,238 @@
1+
---
2+
title: Block Reference Syntax
3+
description: How to reference data between blocks in YAML workflows
4+
---
5+
6+
import { Callout } from 'fumadocs-ui/components/callout'
7+
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
8+
9+
Block references are the foundation of data flow in Sim Studio workflows. Understanding how to correctly reference outputs from one block as inputs to another is essential for building functional workflows.
10+
11+
## Basic Reference Rules
12+
13+
### 1. Use Block Names, Not Block IDs
14+
15+
<Tabs items={['Correct', 'Incorrect']}>
16+
<Tab>
17+
```yaml
18+
# Block definition
19+
email-sender:
20+
type: agent
21+
name: "Email Generator"
22+
# ... configuration
23+
24+
# Reference the block
25+
next-block:
26+
inputs:
27+
userPrompt: "Process this: <emailgenerator.content>"
28+
```
29+
</Tab>
30+
<Tab>
31+
```yaml
32+
# Block definition
33+
email-sender:
34+
type: agent
35+
name: "Email Generator"
36+
# ... configuration
37+
38+
# ❌ Don't reference by block ID
39+
next-block:
40+
inputs:
41+
userPrompt: "Process this: <email-sender.content>"
42+
```
43+
</Tab>
44+
</Tabs>
45+
46+
### 2. Convert Names to Reference Format
47+
48+
To create a block reference:
49+
50+
1. **Take the block name**: "Email Generator"
51+
2. **Convert to lowercase**: "email generator"
52+
3. **Remove spaces and special characters**: "emailgenerator"
53+
4. **Add property**: `<emailgenerator.content>`
54+
55+
### 3. Use Correct Properties
56+
57+
Different block types expose different properties:
58+
59+
- **Agent blocks**: `.content` (the AI response)
60+
- **Function blocks**: `.output` (the return value)
61+
- **API blocks**: `.output` (the response data)
62+
- **Tool blocks**: `.output` (the tool result)
63+
64+
## Reference Examples
65+
66+
### Common Block References
67+
68+
```yaml
69+
# Agent block outputs
70+
<agentname.content> # Primary AI response
71+
<agentname.tokens> # Token usage information
72+
<agentname.cost> # Estimated cost
73+
<agentname.tool_calls> # Tool execution details
74+
75+
# Function block outputs
76+
<functionname.output> # Function return value
77+
<functionname.error> # Error information (if any)
78+
79+
# API block outputs
80+
<apiname.output> # Response data
81+
<apiname.status> # HTTP status code
82+
<apiname.headers> # Response headers
83+
84+
# Tool block outputs
85+
<toolname.output> # Tool execution result
86+
```
87+
88+
### Multi-Word Block Names
89+
90+
```yaml
91+
# Block name: "Data Processor 2"
92+
<dataprocessor2.output>
93+
94+
# Block name: "Email Validation Service"
95+
<emailvalidationservice.output>
96+
97+
# Block name: "Customer Info Agent"
98+
<customerinfoagent.content>
99+
```
100+
101+
## Special Reference Cases
102+
103+
### Starter Block
104+
105+
<Callout type="warning">
106+
The starter block is always referenced as `<start.input>` regardless of its actual name.
107+
</Callout>
108+
109+
```yaml
110+
# Starter block definition
111+
my-custom-start:
112+
type: starter
113+
name: "Custom Workflow Start"
114+
# ... configuration
115+
116+
# Always reference as 'start'
117+
agent-1:
118+
inputs:
119+
userPrompt: <start.input> # ✅ Correct
120+
# userPrompt: <customworkflowstart.input> # ❌ Wrong
121+
```
122+
123+
### Loop Variables
124+
125+
Inside loop blocks, special variables are available:
126+
127+
```yaml
128+
# Available in loop child blocks
129+
<loop.index> # Current iteration (0-based)
130+
<loop.currentItem> # Current item being processed (forEach loops)
131+
<loop.items> # Full collection (forEach loops)
132+
```
133+
134+
### Parallel Variables
135+
136+
Inside parallel blocks, special variables are available:
137+
138+
```yaml
139+
# Available in parallel child blocks
140+
<parallel.index> # Instance number (0-based)
141+
<parallel.currentItem> # Item for this instance
142+
<parallel.items> # Full collection
143+
```
144+
145+
## Complex Reference Examples
146+
147+
### Nested Data Access
148+
149+
When referencing complex objects, use dot notation:
150+
151+
```yaml
152+
# If an agent returns structured data
153+
data-analyzer:
154+
type: agent
155+
name: "Data Analyzer"
156+
inputs:
157+
responseFormat: |
158+
{
159+
"schema": {
160+
"type": "object",
161+
"properties": {
162+
"analysis": {"type": "object"},
163+
"summary": {"type": "string"},
164+
"metrics": {"type": "object"}
165+
}
166+
}
167+
}
168+
169+
# Reference nested properties
170+
next-step:
171+
inputs:
172+
userPrompt: |
173+
Summary: <dataanalyzer.analysis.summary>
174+
Score: <dataanalyzer.metrics.score>
175+
Full data: <dataanalyzer.content>
176+
```
177+
178+
### Multiple References in Text
179+
180+
```yaml
181+
email-composer:
182+
type: agent
183+
inputs:
184+
userPrompt: |
185+
Create an email with the following information:
186+
187+
Customer: <customeragent.content>
188+
Order Details: <orderprocessor.output>
189+
Support Ticket: <ticketanalyzer.content>
190+
191+
Original request: <start.input>
192+
```
193+
194+
### References in Code Blocks
195+
196+
When using references in function blocks, they're replaced as JavaScript values:
197+
198+
```yaml
199+
data-processor:
200+
type: function
201+
inputs:
202+
code: |
203+
// References are replaced with actual values
204+
const customerData = <customeragent.content>;
205+
const orderInfo = <orderprocessor.output>;
206+
const originalInput = <start.input>;
207+
208+
// Process the data
209+
return {
210+
customer: customerData.name,
211+
orderId: orderInfo.id,
212+
processed: true
213+
};
214+
```
215+
216+
## Reference Validation
217+
218+
Sim Studio validates all references when importing YAML:
219+
220+
### Valid References
221+
- Block exists in the workflow
222+
- Property is appropriate for block type
223+
- No circular dependencies
224+
- Proper syntax formatting
225+
226+
### Common Errors
227+
- **Block not found**: Referenced block doesn't exist
228+
- **Wrong property**: Using `.content` on a function block
229+
- **Typos**: Misspelled block names or properties
230+
- **Circular references**: Block references itself directly or indirectly
231+
232+
## Best Practices
233+
234+
1. **Use descriptive block names**: Makes references more readable
235+
2. **Be consistent**: Use the same naming convention throughout
236+
3. **Check references**: Ensure all referenced blocks exist
237+
4. **Avoid deep nesting**: Keep reference chains manageable
238+
5. **Document complex flows**: Add comments to explain reference relationships

0 commit comments

Comments
 (0)