Skip to content

Commit 636d1ea

Browse files
authored
Merge pull request #202 from fix/make-it-agent-ready-2
feat: Agent readiness — Link headers, markdown negotiation, A2A/MCP compliance
2 parents b055dd7 + ee0ac25 commit 636d1ea

12 files changed

Lines changed: 372 additions & 4 deletions

File tree

public/.well-known/agent-card.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,22 @@
33
"name": "Bayan Flow",
44
"description": "Interactive educational tool for learning algorithms through step-by-step visual animations with clarity (بيان). Features sorting, pathfinding, searching, tree traversal, and graph algorithms with Python code examples and real-time complexity analysis.",
55
"url": "https://bayanflow.com",
6+
"version": "0.5.0",
67
"capabilities": ["visualization", "education", "code-execution", "video-export"],
78
"category": "education",
9+
"skills": [
10+
{
11+
"name": "algorithm-visualization",
12+
"description": "Browse and explore interactive algorithm visualizations across sorting, pathfinding, searching, tree traversal, and graph categories.",
13+
"url": "https://bayanflow.com/app"
14+
},
15+
{
16+
"name": "complexity-analysis",
17+
"description": "View time and space complexity information for any algorithm.",
18+
"url": "https://bayanflow.com/app"
19+
}
20+
],
21+
"supportedInterfaces": ["web", "mcp"],
822
"features": [
923
"45 interactive algorithm visualizations",
1024
"Real-time complexity analysis",

public/.well-known/mcp.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"serverInfo": {
3+
"name": "Bayan Flow",
4+
"version": "0.5.0"
5+
},
6+
"description": "Interactive algorithm visualizer — 45 algorithms across sorting, pathfinding, searching, tree traversal, and graph categories with step-by-step animation, Python code editing, and complexity analysis.",
7+
"endpoint": "/mcp",
8+
"homepageUrl": "https://bayanflow.com",
9+
"capabilities": {
10+
"tools": [
11+
{
12+
"name": "bayan_flow_info",
13+
"description": "Get information about Bayan Flow, an interactive algorithm visualizer with 45 algorithms across sorting, pathfinding, searching, tree traversal, and graph categories. Optionally filter by category name.",
14+
"inputSchema": {
15+
"type": "object",
16+
"properties": {
17+
"category": {
18+
"type": "string",
19+
"description": "Optional algorithm category name (sorting, pathfinding, searching, tree, graph)"
20+
}
21+
}
22+
}
23+
},
24+
{
25+
"name": "list_algorithms",
26+
"description": "List all available algorithms with their names, categories, and time/space complexity.",
27+
"inputSchema": {
28+
"type": "object",
29+
"properties": {
30+
"category": {
31+
"type": "string",
32+
"description": "Filter by category: sorting, pathfinding, searching, tree, graph"
33+
}
34+
}
35+
}
36+
}
37+
],
38+
"resources": [
39+
{
40+
"name": "algorithm_catalog",
41+
"description": "Full catalog of 45 algorithms with descriptions and complexity."
42+
}
43+
]
44+
}
45+
}

public/_headers

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline' 'wasm-unsafe-eval' blob: https://cloud.umami.is https://static.cloudflareinsights.com https://cdn.jsdelivr.net https://accounts.google.com; connect-src 'self' blob: https://cloud.umami.is https://gateway.umami.is https://cloudflareinsights.com https://api.github.com https://cdn.jsdelivr.net https://www.remotion.pro https://qketsapzqpzmccljfjcm.supabase.co https://accounts.google.com https://oauth2.googleapis.com; img-src 'self' data: blob: https://api.producthunt.com https://lh3.googleusercontent.com; style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net; font-src 'self' data:; worker-src 'self' blob:; media-src 'self' blob:; frame-src https://www.youtube-nocookie.com https://accounts.google.com; object-src 'none'; base-uri 'self'; form-action 'self'
99
Link: <https://bayanflow.com/sitemap.xml>; rel="sitemap"
1010
Link: </.well-known/api-catalog>; rel="api-catalog"
11+
Link: </.well-known/agent-card.json>; rel="service-desc"
1112
Link: </.well-known/oauth-protected-resource>; rel="oauth-protected-resource"
1213
Link: </.well-known/mcp/server-card.json>; rel="mcp-server-card"
13-
Link: </auth.md>; rel="auth-md"
14-
Link: </llms.txt>; rel="llms-txt"
14+
Link: </auth.md>; rel="service-doc"
15+
Link: </llms.txt>; rel="describedby"
1516

1617
/assets/*
1718
Cache-Control: public, max-age=31536000, immutable
@@ -30,11 +31,14 @@
3031
Content-Type: application/json
3132

3233
/.well-known/api-catalog
33-
Content-Type: application/linkset+json
34+
Content-Type: application/linkset+json; profile="https://www.rfc-editor.org/info/rfc9727"
3435

3536
/.well-known/mcp/server-card.json
3637
Content-Type: application/json
3738

39+
/.well-known/mcp.json
40+
Content-Type: application/json
41+
3842
/.well-known/oauth-authorization-server
3943
Content-Type: application/json
4044

public/markdown/_fallback.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Bayan Flow
2+
3+
> Interactive algorithm visualizer for learning computer science through step-by-step animations.
4+
5+
## What Is It
6+
7+
Bayan Flow is a free, client-side single-page application that visualizes 45 algorithms across five categories. All computation runs in the browser — no server-side APIs.
8+
9+
## Quick Links
10+
11+
- **App**: https://bayanflow.com/app — Start visualizing algorithms
12+
- **API Catalog**: https://bayanflow.com/.well-known/api-catalog — Machine-readable API discovery
13+
- **Agent Card**: https://bayanflow.com/.well-known/agent-card.json — Agent capabilities and skills
14+
- **MCP Server**: https://bayanflow.com/.well-known/mcp.json — MCP tool definitions
15+
- **Auth Guide**: https://bayanflow.com/auth.md — Authentication documentation
16+
- **Algorithm Catalog**: https://bayanflow.com/llms.txt — Full algorithm listing
17+
18+
## Agent Integration
19+
20+
Bayan Flow supports agent discovery via:
21+
- HTTP Link headers (RFC 8288)
22+
- .well-known API catalog (RFC 9727)
23+
- MCP server card for tool access
24+
- WebMCP client-side tool registration

public/markdown/app.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Algorithm Visualizer
2+
3+
> Interactive step-by-step visualization of 45 algorithms across five categories.
4+
5+
## How It Works
6+
7+
1. Select a category and algorithm from the sidebar
8+
2. The app generates random input and runs the algorithm, recording each step
9+
3. Steps are animated with color-coded state changes
10+
4. Complexity panel shows interactive time/space complexity charts
11+
12+
## Features
13+
14+
- Step-by-step animation with configurable speed (Slow/Medium/Fast/Very Fast)
15+
- Real-time time and space complexity analysis
16+
- Python code execution in the browser via Pyodide (WebAssembly)
17+
- HD video export with optional sound
18+
- Multi-language support (English, French, Arabic with RTL)
19+
- Google sign-in for saved preferences and favorites
20+
21+
## Algorithm Categories
22+
23+
- **Sorting**: Bubble, Selection, Insertion, Merge, Quick, Heap, Counting, Radix, Shell, Cocktail Shaker, Gnome, Comb, Tim, Bitonic
24+
- **Pathfinding**: Dijkstra, A*, BFS, DFS, Greedy Best-First, Bidirectional BFS, Jump Point Search, Bellman-Ford
25+
- **Searching**: Linear, Binary, Jump, Exponential, Ternary, Fibonacci
26+
- **Tree Traversal**: Pre-order, In-order, Post-order, Level-order, BFS, DFS, Morris In-order
27+
- **Graph**: BFS, DFS, Topological Sort, Bellman-Ford, Floyd-Warshall, Kruskal, Prim, Tarjan, Kosaraju, Ford-Fulkerson
28+
29+
## Agent Integration
30+
31+
Agents can query algorithm information via MCP server card at https://bayanflow.com/.well-known/mcp.json

public/markdown/index.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Bayan Flow
2+
3+
> Interactive algorithm visualizer for learning computer science through step-by-step animations.
4+
5+
## What Is It
6+
7+
Bayan Flow is a free, client-side single-page application that visualizes 45 algorithms across five categories. All computation runs in the browser — no server-side APIs.
8+
9+
## Categories
10+
11+
- **Sorting** (14): Bubble, Selection, Insertion, Merge, Quick, Heap, Counting, Radix, Shell, Cocktail Shaker, Gnome, Comb, Tim, Bitonic
12+
- **Pathfinding** (8): Dijkstra, A*, BFS, DFS, Greedy Best-First, Bidirectional BFS, Jump Point Search, Bellman-Ford
13+
- **Searching** (6): Linear, Binary, Jump, Exponential, Ternary, Fibonacci
14+
- **Tree Traversal** (7): Pre-order, In-order, Post-order, Level-order, BFS, DFS, Morris In-order
15+
- **Graph** (10): BFS, DFS, Topological Sort, Bellman-Ford, Floyd-Warshall, Kruskal, Prim, Tarjan, Kosaraju, Ford-Fulkerson
16+
17+
## Key URLs
18+
19+
- App: https://bayanflow.com/app
20+
- API Catalog: https://bayanflow.com/.well-known/api-catalog
21+
- Agent Card: https://bayanflow.com/.well-known/agent-card.json
22+
- MCP Server: https://bayanflow.com/.well-known/mcp.json
23+
- Auth Guide: https://bayanflow.com/auth.md

public/markdown/privacy.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Privacy Policy
2+
3+
> How Bayan Flow collects and uses data.
4+
5+
## Data Collection
6+
7+
Bayan Flow is a client-side application. Algorithm execution and visualization happen entirely in your browser.
8+
9+
### With Account (Google Sign-In)
10+
11+
When you sign in with Google, we store:
12+
- Email address
13+
- Display name
14+
- Profile photo URL
15+
- Account preferences and favorites
16+
17+
This data is stored in Supabase PostgreSQL (eu-central-1 region).
18+
19+
### Without Account
20+
21+
No personal data is collected. Algorithm visualizations work entirely in your browser.
22+
23+
## Third-Party Services
24+
25+
- **Google Analytics (Umami)**: Anonymous usage statistics
26+
- **Cloudflare**: Hosting and CDN
27+
- **Supabase**: Authentication and data storage (signed-in users only)
28+
- **Google Identity Services**: OAuth sign-in
29+
30+
## Contact
31+
32+
For privacy questions, email contact@bayanflow.com or open an issue at https://github.com/ayoub3bidi/bayan-flow

public/markdown/roadmap.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Roadmap
2+
3+
> Planned features and improvements for Bayan Flow.
4+
5+
## Current Release (v0.5.0)
6+
7+
- 45 algorithms across 5 categories
8+
- Step-by-step visualization with configurable speed
9+
- Real-time complexity analysis
10+
- Python code execution via Pyodide
11+
- HD video export with sound
12+
- Multi-language support (EN/FR/AR)
13+
- Google sign-in for saved preferences
14+
15+
## Planned
16+
17+
- Additional algorithms and data structures
18+
- Improved visualization animations
19+
- Enhanced code panel with more language support
20+
- Community-contributed algorithm explanations
21+
- Mobile-optimized touch interactions
22+
23+
## Contributing
24+
25+
Contributions welcome at https://github.com/ayoub3bidi/bayan-flow

public/markdown/terms.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Terms of Use
2+
3+
> Terms and conditions for using Bayan Flow.
4+
5+
## Acceptable Use
6+
7+
Bayan Flow is free for educational use. You may:
8+
- Use visualizations for learning and teaching
9+
- Export videos for personal or educational purposes
10+
- Share links to specific algorithms
11+
12+
## Intellectual Property
13+
14+
- Algorithm implementations and visualizations are open source (Elastic-2.0 OR Commercial license)
15+
- Bayan Flow name and branding are trademarked
16+
- Third-party algorithm descriptions are attributed where applicable
17+
18+
## Disclaimer
19+
20+
Bayan Flow is provided "as is" for educational purposes. We make no warranties about the accuracy of complexity analysis or algorithm implementations.
21+
22+
## Contact
23+
24+
For questions, email contact@bayanflow.com or open an issue at https://github.com/ayoub3bidi/bayan-flow

worker/index.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
export default {
2+
async fetch(request, env) {
3+
const accept = request.headers.get('Accept') || '';
4+
5+
if (accept.includes('text/markdown')) {
6+
const url = new URL(request.url);
7+
const path = url.pathname === '/' ? '/index' : url.pathname;
8+
const mdPath = `/markdown${path}.md`;
9+
10+
const init = {
11+
method: request.method,
12+
headers: request.headers,
13+
};
14+
const mdResponse = await env.ASSETS.fetch(
15+
new Request(new URL(mdPath, request.url).toString(), init)
16+
);
17+
18+
if (mdResponse.ok) {
19+
return new Response(mdResponse.body, {
20+
headers: {
21+
'Content-Type': 'text/markdown; charset=utf-8',
22+
'Access-Control-Allow-Origin': '*',
23+
},
24+
});
25+
}
26+
27+
const fallbackResponse = await env.ASSETS.fetch(
28+
new Request(
29+
new URL('/markdown/_fallback.md', request.url).toString(),
30+
init
31+
)
32+
);
33+
return new Response(fallbackResponse.body, {
34+
headers: {
35+
'Content-Type': 'text/markdown; charset=utf-8',
36+
'Access-Control-Allow-Origin': '*',
37+
},
38+
});
39+
}
40+
41+
return env.ASSETS.fetch(request);
42+
},
43+
};

0 commit comments

Comments
 (0)