Skip to content

Commit 9e83394

Browse files
authored
Merge pull request #2142 from HimethW/arazzo-extension-OTeL
Arazzo plugin UI enhancements
2 parents 26eefbe + cfbf7d4 commit 9e83394

18 files changed

Lines changed: 269 additions & 82 deletions

File tree

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# build-binaries.ps1
2+
3+
Write-Host "Starting cross-compilation for Arazzo Go Runner..." -ForegroundColor Cyan
4+
5+
# Ensure the local cli folder exists
6+
if (-Not (Test-Path "cli")) {
7+
New-Item -ItemType Directory -Path "cli" | Out-Null
8+
}
9+
10+
# --- 1. WINDOWS (x64) ---
11+
Write-Host "Building for Windows (x64)..."
12+
$env:GOOS='windows'
13+
$env:GOARCH='amd64'
14+
go build -o cli/arazzo-designer-cli.exe ./cmd/
15+
16+
# --- 2. MACOS (Intel) ---
17+
Write-Host "Building for macOS (Intel amd64)..."
18+
$env:GOOS='darwin'
19+
$env:GOARCH='amd64'
20+
go build -o cli/arazzo-designer-cli-darwin-amd64 ./cmd/
21+
22+
# --- 3. MACOS (Apple Silicon) ---
23+
Write-Host "Building for macOS (Apple Silicon arm64)..."
24+
$env:GOOS='darwin'
25+
$env:GOARCH='arm64'
26+
go build -o cli/arazzo-designer-cli-darwin-arm64 ./cmd/
27+
28+
# --- 4. LINUX (x64) ---
29+
Write-Host "Building for Linux (x64 amd64)..."
30+
$env:GOOS='linux'
31+
$env:GOARCH='amd64'
32+
go build -o cli/arazzo-designer-cli-linux-amd64 ./cmd/
33+
34+
# --- 5. LINUX (ARM64) ---
35+
Write-Host "Building for Linux (ARM64)..."
36+
$env:GOOS='linux'
37+
$env:GOARCH='arm64'
38+
go build -o cli/arazzo-designer-cli-linux-arm64 ./cmd/
39+
40+
# --- RESET ENVIRONMENT ---
41+
Write-Host "Resetting environment variables back to Windows..."
42+
$env:GOOS='windows'
43+
$env:GOARCH='amd64'
44+
45+
# --- COPY TO EXTENSION FOLDER ---
46+
$destination = "..\arazzo-designer-extension\cli"
47+
48+
Write-Host "Copying binaries to the extension folder ($destination)..."
49+
if (-Not (Test-Path $destination)) {
50+
New-Item -ItemType Directory -Path $destination | Out-Null
51+
}
52+
53+
Copy-Item -Path "cli\*" -Destination $destination -Force
54+
55+
Write-Host "All done! Binaries are built and copied." -ForegroundColor Green

workspaces/arazzo/arazzo-designer-core/src/state-machine-types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,6 @@ export interface MCPStateChangeEvent {
157157
isFileDirty: boolean;
158158
}
159159
export const onMCPStateChange: NotificationType<MCPStateChangeEvent> = { method: 'onMCPStateChange' };
160+
161+
/** Sent from the workflow panel to the extension to open/focus the overview panel. */
162+
export const focusOverviewPanel: NotificationType<string> = { method: 'focusOverviewPanel' };

workspaces/arazzo/arazzo-designer-extension/README.md

Lines changed: 58 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,97 @@
11
# Arazzo Visualizer for VS Code
22

3-
The Arazzo Visualizer VS Code extension offers the ability to **visualize and navigate [Arazzo Specification](https://www.openapis.org/arazzo-specification) workflows** through an interactive graphical interface with live updates powered by GitHub Copilot.
3+
Arazzo Visualizer helps you understand, edit, and run [Arazzo Specification](https://www.openapis.org/arazzo-specification) workflows directly inside VS Code.
44

5-
Beyond the visual features, the extension enhances the Arazzo authoring experience with syntax highlighting, intelligent code completions, and real-time validation provided by a built-in language server.
5+
It turns Arazzo files into interactive diagrams, keeps the diagram in sync with your code, and includes a built-in runner engine so you can try workflows against real APIs without leaving the editor.
66

77
## Quick Start
88

99
1. Install the extension from the VS Code Marketplace.
10-
2. Open any Arazzo file (`.arazzo.yaml`, `.arazzo.yml`).
11-
3. Click the **Arazzo Overview** icon in the editor toolbar, or use the Command Palette (`Ctrl+Shift+P` / `Cmd+Shift+P`) and run **"ArazzoDesigner: Open Arazzo Visualizer"**.
10+
2. Open an Arazzo file, such as `.arazzo.yaml`, `.arazzo.yml`, or `.arazzo.json`.
11+
3. Click the **Arazzo Overview** icon in the editor toolbar, or open the Command Palette (`Ctrl+Shift+P` / `Cmd+Shift+P`) and run **ArazzoDesigner: Open Arazzo Visualizer**.
1212

13-
The visualizer opens beside your code and stays in sync as you edit.
13+
The visualizer opens beside your file and updates as you edit.
1414

15-
## Features
15+
## Main Features
1616

17-
### Workflow Visualizer
17+
### Visualize Workflows
1818

19-
Open an Arazzo file and click the **Arazzo Visualizer** toolbar icon (or use `Ctrl+Shift+P`*"ArazzoDesigner: Open Arazzo Visualizer"*) to launch the **Overview**. The Overview gives you a bird's-eye view of every workflow defined in your specification including their names, summaries, and how many steps they contain. Click any workflow card to drill into the full **Workflow View**, which renders every step as a node, every decision branch as a labelled edge, and every success/failure path in a clean interactive diagram. Click any node to open the **Properties Panel** on the right and inspect that step's inputs, parameters, success criteria, and outputs without leaving the diagram.
19+
Read complex API flows as a clear diagram instead of scanning long YAML or JSON files.
2020

21+
- **See the full flow:** View workflows, steps, decisions, and connections in one place.
22+
- **Focus on one workflow:** Open a specific workflow when you want a closer look.
23+
- **Inspect details:** Select a step to understand the request, response, inputs, outputs, and success checks.
24+
- **Stay in sync:** Update the file and the diagram refreshes automatically.
2125

22-
---
26+
### CodeLens and Quick Actions
2327

24-
### Code Lens — Jump Straight to a Workflow
28+
The extension adds helpful actions above workflow definitions.
2529

26-
You don't always need to go through the Overview. When you open an Arazzo file, the extension adds clickable **Code Lens** action buttons directly above each workflow definition in the editor. Click **"Visualize"** on any workflow to jump straight into its Workflow View in one click, great when you know exactly which workflow you want to inspect.
30+
- **Visualize:** Open the selected workflow in the visualizer.
31+
- **Try with AI:** Run the selected workflow through Github Copilot.
2732

33+
### GitHub Copilot Support
2834

29-
---
35+
Arazzo Visualizer works with GitHub Copilot so you can create, change, and run workflows using plain English.
3036

31-
### Getting Started with GitHub Copilot
37+
Starting from scratch? Open Copilot Chat and ask for the workflow you need:
3238

33-
The Arazzo Visualizer works hand-in-hand with **GitHub Copilot**, making it easy to create and evolve Arazzo workflows using plain English — no need to memorise the spec syntax.
39+
> "Create a sample Arazzo file named toolshop.arazzo.yaml with 3 steps using the Toolshop OpenAPI specification below to list all products and create a cart:
40+
> https://api.practicesoftwaretesting.com/docs"
3441
35-
**Starting from scratch?** Open GitHub Copilot Chat and describe the workflow you want. For example:
42+
Editing an existing file? Ask Copilot for a change:
3643

37-
> *"create a sample arazzo file named petstore.arazzo.yaml with 5 steps using the petstore openAPI specification given below
38-
https://petstore3.swagger.io/api/v3/openapi.json"*
44+
> "Add a retry step if the tool list fetch fails."
3945
40-
Copilot will generate the Arazzo file for you. Open it and the extension will visualize it instantly.
46+
> "Add success criteria to the 'create cart' step to check that the status code is 200."
4147
42-
**Editing an existing file?** Ask Copilot to change it in plain language:
48+
After you save, the visualizer updates to match the latest file.
4349

44-
> *"Add a retry step if the profile fetch fails."*
45-
> *"Add success criteria to check that the status code is 200."*
50+
![Sample Demo](https://raw.githubusercontent.com/wso2/vscode-extensions/arazzo-extension/workspaces/arazzo/arazzo-designer-extension/assets/v2_visualizer_demo.gif)
4651

47-
Every time you save, the diagram **automatically re-renders** to reflect the latest state of your file — no manual refresh, no switching context.
52+
### Run Workflows
4853

54+
The visualizer shows how a workflow is designed. The built-in **Runner Engine** helps you prove that the workflow actually works.
4955

50-
---
56+
Use it to execute an Arazzo workflow from VS Code and see how each API call behaves in a real run. This makes the extension useful not only for reading workflows, but also for testing, validating, and improving them as you build.
5157

52-
### Smart Editor Support
58+
- **Run real API sequences:** Execute workflow steps in the order defined by your Arazzo file.
59+
- **Validate each step:** Check responses, status codes, success criteria, and output values as the workflow runs.
60+
- **Pass data between steps:** Use values returned by one API call in later steps, just like the workflow describes.
61+
- **Start from anywhere:** Run a workflow from the visualizer, or via CodeLens actions above each workflow.
62+
- **Use Copilot as the entry point:** Ask Copilot to run a workflow in plain English, such as `List all available products in the tool shop and create a cart`.
63+
- **Review what happened:** Use the execution logs and trace details to understand failures, slow steps, and unexpected results.
64+
- **No separate setup:** The runner is packaged with the extension, so you do not need to install another tool to try a workflow.
5365

54-
The extension includes a built-in language server that quietly improves the editing experience in the background:
66+
![Execution Demo](https://raw.githubusercontent.com/wso2/vscode-extensions/arazzo-extension/workspaces/arazzo/arazzo-designer-extension/assets/v2_execution_demo.gif)
5567

56-
- **Syntax highlighting** so Arazzo keywords and runtime expressions (`$statusCode`, `$response.body`, etc.) stand out clearly
57-
- **Intelligent completions** that suggest valid fields and values as you type
58-
- **Real-time validation** that flags missing required fields, invalid references, and structural errors in the Problems panel before you even save
59-
- **File association** so `.arazzo.yaml`, `.arazzo.yml` files are automatically recognised
68+
### Execution Logs
6069

61-
![Sample Demo](https://raw.githubusercontent.com/wso2/vscode-extensions/arazzo-extension/workspaces/arazzo/arazzo-designer-extension/assets/demo_final_final.gif)
70+
When a workflow runs, the extension shows what happened step by step.
6271

63-
---
72+
- **Live progress:** Watch the workflow as it runs.
73+
- **Clear results:** See which steps passed, which failed, and why.
74+
- **Trace details:** Review timing and request flow information when you need to troubleshoot a slow or failing workflow.
75+
76+
### Smart Editing Support
77+
78+
The extension also improves the normal editing experience for Arazzo files.
79+
80+
- **Syntax highlighting** for Arazzo keywords and runtime expressions like `$statusCode` and `$response.body`
81+
- **Suggestions** for valid fields and values while you type
82+
- **Validation** for missing fields, invalid references, and structure issues
83+
- **File recognition** for `.arazzo.yaml`, `.arazzo.yml`, `.arazzo.json`, and matching `-arazzo` file names
6484

6585
## About Arazzo
6686

67-
The [Arazzo Specification](https://spec.openapis.org/arazzo/v1.0.1.html) is an OpenAPI Initiative standard for describing sequences of API calls and the dependencies between them. It is designed for:
87+
The [Arazzo Specification](https://spec.openapis.org/arazzo/v1.0.1.html) is an OpenAPI Initiative standard for describing API workflows. It is useful when you need to show or test how several API calls work together.
88+
89+
Common use cases include:
6890

69-
- Multi-step API workflow documentation
70-
- Automated test case generation
71-
- SDK and code generation driven by real-world use cases
72-
- Regulatory compliance automation
91+
- Documenting multi-step API flows
92+
- Testing end-to-end API journeys
93+
- Describing real user or system workflows
94+
- Supporting SDK, code generation, and compliance automation
7395

7496
## Resources
7597

2.92 MB
Loading
4.2 MB
Loading

workspaces/arazzo/arazzo-designer-extension/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
},
102102
{
103103
"command": "arazzo.startMCPServer",
104-
"title": "Start MCP Server",
104+
"title": "Start Arazzo Server",
105105
"category": "Arazzo",
106106
"icon": "$(play)"
107107
},

workspaces/arazzo/arazzo-designer-extension/src/RPCLayer.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@
1616
* under the License.
1717
*/
1818

19-
import { WebviewView, WebviewPanel, window, QuickPickItem } from 'vscode';
19+
import { WebviewView, WebviewPanel, window, QuickPickItem, commands } from 'vscode';
2020
import { Messenger } from 'vscode-messenger';
2121
import { StateMachine } from './stateMachine';
22-
import { stateChanged, getVisualizerState, VisualizerLocation, getPopupVisualizerState, PopupVisualizerLocation, popupStateChanged, selectQuickPickItem, WebviewQuickPickItem, selectQuickPickItems, showConfirmMessage, showInputBox, showInfoNotification, showErrorNotification, onTraceEvent, onMCPStateChange, MCPStateChangeEvent } from '@wso2/arazzo-designer-core';
22+
import { COMMANDS } from './constants';
23+
import { stateChanged, getVisualizerState, VisualizerLocation, getPopupVisualizerState, PopupVisualizerLocation, popupStateChanged, selectQuickPickItem, WebviewQuickPickItem, selectQuickPickItems, showConfirmMessage, showInputBox, showInfoNotification, showErrorNotification, onTraceEvent, onMCPStateChange, MCPStateChangeEvent, focusOverviewPanel, EVENT_TYPE, MACHINE_VIEW } from '@wso2/arazzo-designer-core';
24+
import { openView } from './stateMachine';
2325
import { TracerServer } from './mcp/tracing';
2426
import { VisualizerWebview } from './visualizer/webview';
2527
import { StateMachinePopup } from './stateMachinePopup';
@@ -77,6 +79,11 @@ export class RPCLayer {
7779
window.showErrorMessage(message);
7880
});
7981

82+
// Handle focus-overview-panel request from the workflow panel webview
83+
RPCLayer._messenger.onNotification(focusOverviewPanel, (fileUri: string) => {
84+
commands.executeCommand(COMMANDS.OPEN_WELCOME, fileUri);
85+
});
86+
8087
// Forward trace events from the tracer server to the webview
8188
TracerServer.getInstance().onEvent((event) => {
8289
RPCLayer._messenger.sendNotification(onTraceEvent, { type: 'webview', webviewType: VisualizerWebview.viewType }, event as any);

workspaces/arazzo/arazzo-designer-extension/src/extension.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export async function activate(context: vscode.ExtensionContext) {
6969
let showCodeDisposable = vscode.commands.registerCommand('ArazzoDesigner.showCode', showCode);
7070
context.subscriptions.push(showCodeDisposable);
7171

72-
// Register the MCP Server command
72+
// Register the Start Arazzo Server command
7373
let mcpServerDisposable = vscode.commands.registerCommand('arazzo.startMCPServer', async (args?: any) => {
7474
let filePath: string | undefined;
7575
if (args && args.uri) {
@@ -79,7 +79,7 @@ export async function activate(context: vscode.ExtensionContext) {
7979
});
8080
context.subscriptions.push(mcpServerDisposable);
8181

82-
// Register the Run-workflow CodeLens provider (shows "▶ Run" when MCP server is active)
82+
// Register the Run-workflow CodeLens provider (shows "▶ Try" when arazzo server is active)
8383
const runCodeLensProvider = new RunWorkflowCodeLensProvider();
8484
context.subscriptions.push(
8585
vscode.languages.registerCodeLensProvider(
@@ -88,17 +88,17 @@ export async function activate(context: vscode.ExtensionContext) {
8888
)
8989
);
9090

91-
// Refresh CodeLenses whenever the MCP server starts or stops.
91+
// Refresh CodeLenses whenever the arazzo server starts or stops.
9292
// Also reset the dirty flag so the lens reverts from "Rerun" to "Run".
9393
onMCPServerStateChange(() => {
9494
runCodeLensProvider.setFileDirty(false);
9595
runCodeLensProvider.refresh();
96-
// Notify webview that MCP state changed
96+
// Notify webview that arazzo server state changed
9797
RPCLayer.sendMCPStateChange({ isMCPRunning: isMCPServerRunning(), isFileDirty: false });
9898
});
9999

100-
// When the active file is saved and the MCP server is serving it, switch
101-
// the CodeLens from "Run" to "Rerun" to signal the server needs restarting.
100+
// When the active file is saved and the arazzo server is serving it, switch
101+
// the CodeLens from "Try" to "Retry" to signal the server needs restarting.
102102
context.subscriptions.push(
103103
vscode.workspace.onDidSaveTextDocument(document => {
104104
const activeFile = getMCPActiveFilePath();
@@ -281,7 +281,7 @@ function initializeLanguageServer(context: vscode.ExtensionContext, runCodeLensP
281281
context.subscriptions.push(designerCommand);
282282

283283
// Register "Run Workflow" command — triggered by the Run Code Lens.
284-
// Ensures the MCP server is running, then opens Copilot with a prompt
284+
// Ensures the arazzo server is running, then opens Copilot with a prompt
285285
// to execute the specific workflow.
286286
const runWorkflowCommand = vscode.commands.registerCommand('arazzo.runWorkflow', async (args?: any) => {
287287
let filePath: string | undefined;
@@ -314,12 +314,12 @@ function initializeLanguageServer(context: vscode.ExtensionContext, runCodeLensP
314314

315315
if (!alreadyOpen) {
316316
await vscode.commands.executeCommand('arazzo.openDesigner', args);
317-
// Small delay to let the panel render before the MCP server starts
317+
// Small delay to let the panel render before the arazzo server starts
318318
await new Promise(resolve => setTimeout(resolve, 300));
319319
}
320320
}
321321

322-
// Start the MCP server if it isn't running, serving a different file,
322+
// Start the arazzo server if it isn't running, serving a different file,
323323
// or the file has been modified since the last server start (dirty).
324324
const activeMCPFilePath = getMCPActiveFilePath();
325325
if (!isMCPServerRunning() || activeMCPFilePath !== filePath || runCodeLensProvider.isFileDirty()) {

0 commit comments

Comments
 (0)