Skip to content

Commit 3bcc7a3

Browse files
authored
Merge pull request #261 from microsoft/vyokky/dev
Vyokky/dev
2 parents 772a9f9 + d5c38b3 commit 3bcc7a3

117 files changed

Lines changed: 10974 additions & 10797 deletions

File tree

Some content is hidden

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

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ datasUFO
5252
# Ignore mkdocs build output
5353
documents/site/
5454

55+
# Ignore frontend environment files with auto-generated content
56+
galaxy/webui/frontend/.env.development.local
57+
5558
# Ignore config files with sensitive data (API keys)
5659
config/*/agents.yaml
5760
config/*/agent.yaml

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
![Python Version](https://img.shields.io/badge/Python-3776AB?&logo=python&logoColor=white-blue&label=3.10%20%7C%203.11) 
2323
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) 
2424
[![Documentation](https://img.shields.io/badge/Documentation-%230ABAB5?style=flat&logo=readthedocs&logoColor=black)](https://microsoft.github.io/UFO/) 
25-
[![YouTube](https://img.shields.io/badge/YouTube-white?logo=youtube&logoColor=%23FF0000)](https://www.youtube.com/watch?v=QT_OhygMVXU) 
25+
[![YouTube](https://img.shields.io/badge/YouTube-white?logo=youtube&logoColor=%23FF0000)](https://www.youtube.com/watch?v=NGrVWGcJL8o) 
2626

2727

2828
</div>

README_ZH.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
![Python Version](https://img.shields.io/badge/Python-3776AB?&logo=python&logoColor=white-blue&label=3.10%20%7C%203.11)&ensp;
2222
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)&ensp;
2323
[![Documentation](https://img.shields.io/badge/Documentation-%230ABAB5?style=flat&logo=readthedocs&logoColor=black)](https://microsoft.github.io/UFO/)&ensp;
24-
[![YouTube](https://img.shields.io/badge/YouTube-white?logo=youtube&logoColor=%23FF0000)](https://www.youtube.com/watch?v=QT_OhygMVXU)&ensp;
24+
[![YouTube](https://img.shields.io/badge/YouTube-white?logo=youtube&logoColor=%23FF0000)](https://www.youtube.com/watch?v=NGrVWGcJL8o)&ensp;
2525
</div>
2626

2727
<p align="center">

documents/docs/aip/endpoints.md

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# AIP Endpoints
22

3-
!!!quote "Complete Client/Server Implementations"
4-
Endpoints combine protocol, transport, and resilience components to provide production-ready AIP communication for servers, clients, and orchestrators.
3+
Endpoints combine protocol, transport, and resilience components to provide production-ready AIP communication for servers, clients, and orchestrators.
54

65
## Endpoint Types at a Glance
76

@@ -38,15 +37,14 @@ graph TB
3837

3938
The dashed arrows indicate capabilities that the base class provides to all subclasses. This inheritance design ensures consistent behavior across all endpoint types while allowing specialization for server, client, and orchestrator roles.
4039

41-
!!!info "Base Endpoint Components"
42-
All endpoints inherit from `AIPEndpoint`, which provides:
43-
44-
- **Protocol**: Message serialization and handling
45-
- **Reconnection Strategy**: Automatic reconnection with backoff
46-
- **Timeout Manager**: Operation timeout management
47-
- **Session Handlers**: Per-session state tracking
40+
**Base Endpoint Components:**
4841

49-
---
42+
All endpoints inherit from `AIPEndpoint`, which provides:
43+
44+
- **Protocol**: Message serialization and handling
45+
- **Reconnection Strategy**: Automatic reconnection with backoff
46+
- **Timeout Manager**: Operation timeout management
47+
- **Session Handlers**: Per-session state tracking
5048

5149
## Base Endpoint: AIPEndpoint
5250

@@ -83,18 +81,17 @@ await endpoint.stop()
8381

8482
## DeviceServerEndpoint
8583

86-
!!!tip "Server-Side Device Management"
87-
Wraps UFO's server-side WebSocket handler with AIP protocol support for managing multiple device connections simultaneously.
84+
Wraps UFO's server-side WebSocket handler with AIP protocol support for managing multiple device connections simultaneously.
8885

8986
### Configuration
9087

9188
```python
9289
from aip.endpoints import DeviceServerEndpoint
9390

9491
endpoint = DeviceServerEndpoint(
95-
client_manager=client_manager, # WebSocket connection manager
96-
session_manager=session_manager, # Session state manager
97-
local=False # Local vs remote deployment
92+
ws_manager=ws_manager, # WebSocket connection manager
93+
session_manager=session_manager, # Session state manager
94+
local=False # Local vs remote deployment
9895
)
9996
```
10097

@@ -105,7 +102,7 @@ from fastapi import FastAPI, WebSocket
105102
from aip.endpoints import DeviceServerEndpoint
106103

107104
app = FastAPI()
108-
endpoint = DeviceServerEndpoint(client_manager, session_manager)
105+
endpoint = DeviceServerEndpoint(ws_manager, session_manager)
109106

110107
@app.websocket("/ws")
111108
async def websocket_route(websocket: WebSocket):
@@ -122,8 +119,9 @@ async def websocket_route(websocket: WebSocket):
122119
| **Result Aggregation** | Collect and format execution results | Unified response handling |
123120
| **Auto Task Cancellation** | Cancel tasks on disconnect | Prevent orphaned tasks |
124121

125-
!!!success "Backward Compatibility"
126-
The Device Server Endpoint maintains full compatibility with UFO's existing WebSocket handler.
122+
**Backward Compatibility:**
123+
124+
The Device Server Endpoint maintains full compatibility with UFO's existing WebSocket handler.
127125

128126
### Task Cancellation on Disconnection
129127

@@ -139,8 +137,7 @@ await endpoint.cancel_device_tasks(
139137

140138
## DeviceClientEndpoint
141139

142-
!!!tip "Client-Side Device Operations"
143-
Wraps UFO's client-side WebSocket client with AIP protocol support, automatic reconnection, and heartbeat management.
140+
Wraps UFO's client-side WebSocket client with AIP protocol support, automatic reconnection, and heartbeat management.
144141

145142
### Configuration
146143

@@ -159,7 +156,7 @@ endpoint = DeviceClientEndpoint(
159156

160157
| Feature | Default Behavior | Configuration |
161158
|---------|------------------|---------------|
162-
| **Heartbeat** | Starts on connection | 20s interval (configurable) |
159+
| **Heartbeat** | Starts on connection | 20s interval (fixed) |
163160
| **Reconnection** | Exponential backoff | `max_retries=3`, `initial_backoff=2.0` |
164161
| **Message Routing** | Auto-routes to UFO client | Handled internally |
165162
| **Connection Management** | Auto-connect on start | Transparent to user |
@@ -199,8 +196,7 @@ endpoint = DeviceClientEndpoint(
199196

200197
## ConstellationEndpoint
201198

202-
!!!tip "Orchestrator-Side Multi-Device Coordination"
203-
Enables the ConstellationClient to communicate with multiple devices simultaneously, managing connections, tasks, and queries.
199+
Enables the ConstellationClient to communicate with multiple devices simultaneously, managing connections, tasks, and queries.
204200

205201
### Configuration
206202

@@ -234,6 +230,8 @@ connection = await endpoint.connect_to_device(
234230
)
235231
```
236232

233+
Learn more about [AgentProfile configuration](../galaxy/client/device_manager.md) in the Galaxy documentation.
234+
237235
### Sending Tasks
238236

239237
```python
@@ -398,8 +396,8 @@ await endpoint.stop()
398396

399397
## Resilience Features
400398

401-
!!!success "Built-In Resilience"
402-
All endpoints include automatic reconnection, timeout management, and heartbeat monitoring.
399+
!!!warning "Built-In Resilience"
400+
All endpoints include automatic reconnection, timeout management, and heartbeat monitoring for production reliability.
403401

404402
### Resilience Configuration
405403

@@ -484,12 +482,13 @@ class CustomEndpoint(DeviceClientEndpoint):
484482

485483
## Best Practices
486484

487-
!!!tip "Endpoint Selection"
488-
| Use Case | Endpoint Type |
489-
|----------|---------------|
490-
| Device agent server | `DeviceServerEndpoint` |
491-
| Device agent client | `DeviceClientEndpoint` |
492-
| Multi-device orchestrator | `ConstellationEndpoint` |
485+
**Endpoint Selection:**
486+
487+
| Use Case | Endpoint Type |
488+
|----------|---------------|
489+
| Device agent server | `DeviceServerEndpoint` |
490+
| Device agent client | `DeviceClientEndpoint` |
491+
| Multi-device orchestrator | `ConstellationEndpoint` |
493492

494493
!!!warning "Configuration Guidelines"
495494
- **Set appropriate timeouts** based on deployment environment
@@ -539,4 +538,7 @@ from aip.endpoints import (
539538
- [Resilience](./resilience.md) - Reconnection and heartbeat management
540539
- [Messages](./messages.md) - Message types and validation
541540
- [Overview](./overview.md) - System architecture and design
541+
- [Galaxy Client](../galaxy/client/overview.md) - Multi-device orchestration with ConstellationClient
542+
- [UFO Server](../server/websocket_handler.md) - WebSocket server implementation
543+
- [UFO Client](../client/websocket_client.md) - WebSocket client implementation
542544

documents/docs/aip/messages.md

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# AIP Message Reference
22

3-
!!!quote "Strongly-Typed Communication"
4-
AIP uses **Pydantic-based messages** for automatic validation, serialization, and type safety. All messages transmit as JSON over WebSocket.
3+
AIP uses **Pydantic-based messages** for automatic validation, serialization, and type safety. All messages transmit as JSON over WebSocket.
54

65
## Message Overview
76

@@ -59,8 +58,7 @@ Unidirectional arrows indicate request-response patterns, while bidirectional ar
5958

6059
## Core Data Structures
6160

62-
!!!info "Foundation Types"
63-
These Pydantic models form the building blocks for all AIP messages.
61+
These Pydantic models form the building blocks for all AIP messages.
6462

6563
### Essential Types Summary
6664

@@ -105,8 +103,7 @@ control = ControlInfo(
105103
)
106104
```
107105

108-
<details>
109-
<summary><b>Complete Field List</b></summary>
106+
**Complete Field List:**
110107

111108
| Field | Type | Description |
112109
|-------|------|-------------|
@@ -123,8 +120,6 @@ control = ControlInfo(
123120
| `source` | str? | Data source identifier |
124121
| `text_content` | str? | Text content |
125122

126-
</details>
127-
128123
### WindowInfo
129124

130125
Window metadata (extends ControlInfo).
@@ -143,8 +138,9 @@ Window metadata (extends ControlInfo).
143138

144139
MCP tool capability definition.
145140

146-
!!!tip "Tool Advertisement"
147-
Device agents use `MCPToolInfo` to advertise their capabilities during registration.
141+
**Tool Advertisement:**
142+
143+
Device agents use `MCPToolInfo` to advertise their capabilities during registration.
148144

149145
```python
150146
tool_info = MCPToolInfo(
@@ -174,6 +170,8 @@ tool_info = MCPToolInfo(
174170
| `meta` | dict? | Metadata |
175171
| `annotations` | dict? | Additional annotations |
176172

173+
Learn more about [MCP tools and capabilities](../mcp/overview.md).
174+
177175
---
178176

179177
## Command and Result Structures
@@ -200,8 +198,9 @@ cmd = Command(
200198
| `tool_type` | str || `"data_collection"` or `"action"` |
201199
| `call_id` | str | | Unique identifier for correlation |
202200

203-
!!!tip "Call ID Correlation"
204-
Use `call_id` to match commands with their results in the `Result` object.
201+
**Call ID Correlation:**
202+
203+
Use `call_id` to match commands with their results in the `Result` object.
205204

206205
### ResultStatus
207206

@@ -281,8 +280,9 @@ The `CONTINUE → CONTINUE` self-loop represents multi-turn execution where task
281280
| `OK` | ✓ Acknowledgment | Heartbeat, health check passed |
282281
| `ERROR` | ⚠️ Protocol error | Protocol-level error |
283282

284-
!!!success "Multi-Turn Execution"
285-
`CONTINUE` enables agents to request additional commands before marking a task as complete, supporting complex multi-step workflows.
283+
**Multi-Turn Execution:**
284+
285+
`CONTINUE` enables agents to request additional commands before marking a task as complete, supporting complex multi-step workflows.
286286

287287
---
288288

@@ -320,8 +320,7 @@ constellation_msg = ClientMessage(
320320

321321
## ClientMessage (Client → Server)
322322

323-
!!!tip "Client-Initiated Messages"
324-
Devices and constellation clients use `ClientMessage` to communicate with the server.
323+
Devices and constellation clients use `ClientMessage` to communicate with the server.
325324

326325
### Message Types
327326

@@ -394,8 +393,7 @@ results_msg = ClientMessage(
394393

395394
## ServerMessage (Server → Client)
396395

397-
!!!tip "Server-Initiated Messages"
398-
Device services use `ServerMessage` to assign tasks and send commands to clients.
396+
Device services use `ServerMessage` to assign tasks and send commands to clients.
399397

400398
### Message Types
401399

@@ -490,8 +488,8 @@ task_end_msg = ServerMessage(
490488

491489
## Message Validation
492490

493-
!!!success "Built-In Validation"
494-
AIP provides `MessageValidator` class for ensuring message integrity.
491+
!!!warning "Built-In Validation"
492+
AIP provides `MessageValidator` class for ensuring message integrity. Always validate messages before processing to prevent protocol errors.
495493

496494
### Validation Methods
497495

@@ -520,15 +518,11 @@ if MessageValidator.validate_command_results(client_message):
520518
await process_results(client_message)
521519
```
522520

523-
!!!warning "Validation Best Practice"
524-
Always validate messages before processing to prevent protocol errors and ensure data integrity.
525-
526521
---
527522

528523
## Message Correlation
529524

530-
!!!info "Request-Response Chaining"
531-
AIP uses identifier chains to maintain conversation context across multiple message exchanges.
525+
AIP uses identifier chains to maintain conversation context across multiple message exchanges.
532526

533527
### Correlation Pattern
534528

@@ -561,8 +555,9 @@ Each new request includes `prev_response_id` pointing to the previous server res
561555

562556
### Session Tracking
563557

564-
!!!tip "Session-Based Grouping"
565-
All messages within a task execution share the same `session_id` for traceability.
558+
**Session-Based Grouping:**
559+
560+
All messages within a task execution share the same `session_id` for traceability.
566561

567562
```python
568563
# All messages use same session_id
@@ -596,10 +591,11 @@ task_end_msg.session_id = SESSION_ID
596591
- Always provide meaningful error messages
597592
- Use `ResultStatus.FAILURE` with descriptive `error` field
598593

599-
!!!tip "Extensibility"
600-
- Use `metadata` field for custom data without breaking protocol
601-
- Leverage Pydantic's validation for type safety
602-
- Always correlate messages with `prev_response_id`
594+
**Extensibility:**
595+
596+
- Use `metadata` field for custom data without breaking protocol
597+
- Leverage Pydantic's validation for type safety
598+
- Always correlate messages with `prev_response_id`
603599

604600
---
605601

@@ -627,3 +623,6 @@ from aip.messages import (
627623
- [Protocol Guide](./protocols.md) - How protocols construct and use messages
628624
- [Endpoints](./endpoints.md) - How endpoints handle messages
629625
- [Overview](./overview.md) - High-level message flow in system architecture
626+
- [Transport Layer](./transport.md) - WebSocket transport for message delivery
627+
- [Resilience](./resilience.md) - Message retry and timeout handling
628+
- [MCP Integration](../mcp/overview.md) - How MCP tools integrate with AIP messages

0 commit comments

Comments
 (0)