Skip to content

High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.

tools: enhance API doc generator to include profiles and orchestrator endpoints; regenerate api-reference.md (72 endpoints)

Mario87fe3905ff1b
diff --git a/docs/references/api-reference.md b/docs/references/api-reference.md
index 1601cda3..f55355b4 100644
--- a/docs/references/api-reference.md
+++ b/docs/references/api-reference.md
@@ -1,8 +1,6 @@
-# API Reference v2
+# API Reference (Auto-Generated)
-Auto-generated from Go code in `internal/handlers/handlers.go`
-
-Generated: 2026-03-01T00:20:37Z
+Generated: 2026-03-01T00:24:41Z
---
@@ -10,10 +8,32 @@ Generated: 2026-03-01T00:20:37Z
| Method | Path | Handler | Notes |
|--------|------|---------|-------|
+| DELETE | `/profiles/{name}` | handleDeleteByPath | |
+| GET | `/` | | |
| GET | `/cookies` | HandleGetCookies | |
+| GET | `/dashboard` | | |
+| GET | `/dashboard/` | | |
+| GET | `/dashboard/agents` | handleAgents | |
+| GET | `/dashboard/events` | handleSSE | |
| GET | `/download` | HandleDownload | |
| GET | `/health` | HandleHealth | |
+| GET | `/instances` | handleList | |
+| GET | `/instances/tabs` | handleAllTabs | |
+| GET | `/instances/{id}/cookies` | proxyToInstance | |
+| GET | `/instances/{id}/download` | proxyToInstance | |
+| GET | `/instances/{id}/logs` | handleLogsByID | |
+| GET | `/instances/{id}/pdf` | proxyToInstance | |
+| GET | `/instances/{id}/proxy/screencast` | handleProxyScreencast | |
+| GET | `/instances/{id}/screencast` | proxyToInstance | |
+| GET | `/instances/{id}/screenshot` | proxyToInstance | |
+| GET | `/instances/{id}/snapshot` | proxyToInstance | |
+| GET | `/instances/{id}/tabs` | proxyToInstance | |
+| GET | `/instances/{id}/text` | proxyToInstance | |
| GET | `/pdf` | HandlePDF | |
+| GET | `/profiles` | handleList | |
+| GET | `/profiles/{id}/instance` | handleProfileInstance | |
+| GET | `/profiles/{name}/analytics` | handleAnalyticsByPath | |
+| GET | `/profiles/{name}/logs` | handleLogsByPath | |
| GET | `/screencast` | HandleScreencast | |
| GET | `/screencast/tabs` | HandleScreencastAll | |
| GET | `/screenshot` | HandleScreenshot | |
@@ -22,13 +42,34 @@ Generated: 2026-03-01T00:20:37Z
| GET | `/tabs` | HandleTabs | |
| GET | `/text` | HandleText | |
| GET | `/welcome` | | |
+| PATCH | `/profiles/meta` | handleUpdateMeta | |
+| PATCH | `/profiles/{name}` | handleUpdateByPath | |
| POST | `/action` | HandleAction | |
| POST | `/actions` | HandleActions | |
| POST | `/cookies` | HandleSetCookies | |
| POST | `/ensure-chrome` | HandleEnsureChrome | |
| POST | `/evaluate` | HandleEvaluate | |
| POST | `/fingerprint/rotate` | HandleFingerprintRotate | |
+| POST | `/instances/launch` | handleLaunchByName | |
+| POST | `/instances/{id}/action` | proxyToInstance | |
+| POST | `/instances/{id}/actions` | proxyToInstance | |
+| POST | `/instances/{id}/cookies` | proxyToInstance | |
+| POST | `/instances/{id}/ensure-chrome` | proxyToInstance | |
+| POST | `/instances/{id}/evaluate` | proxyToInstance | |
+| POST | `/instances/{id}/navigate` | proxyToInstance | |
+| POST | `/instances/{id}/stop` | handleStopByInstanceID | |
+| POST | `/instances/{id}/tab` | proxyToInstance | |
+| POST | `/instances/{id}/tab/lock` | proxyToInstance | |
+| POST | `/instances/{id}/tab/unlock` | proxyToInstance | |
+| POST | `/instances/{id}/upload` | proxyToInstance | |
| POST | `/navigate` | HandleNavigate | |
+| POST | `/profiles/create` | handleCreate | |
+| POST | `/profiles/import` | handleImport | |
+| POST | `/profiles/{id}/start` | handleStartByID | |
+| POST | `/profiles/{id}/stop` | handleStopByID | |
+| POST | `/profiles/{name}/reset` | handleResetByPath | |
+| POST | `/start/{id}` | handleStartByID | |
+| POST | `/stop/{id}` | handleStopByID | |
| POST | `/tab` | HandleTab | |
| POST | `/tab/lock` | HandleTabLock | |
| POST | `/tab/unlock` | HandleTabUnlock | |
@@ -38,10 +79,34 @@ Generated: 2026-03-01T00:20:37Z
## Detailed Endpoints
+### DELETE /profiles/{name}
+
+**Handler:** `handleDeleteByPath`
+
+### GET /
+
+**Handler:** ``
+
### GET /cookies
**Handler:** `HandleGetCookies`
+### GET /dashboard
+
+**Handler:** ``
+
+### GET /dashboard/
+
+**Handler:** ``
+
+### GET /dashboard/agents
+
+**Handler:** `handleAgents`
+
+### GET /dashboard/events
+
+**Handler:** `handleSSE`
+
### GET /download
**Handler:** `HandleDownload`
@@ -50,10 +115,74 @@ Generated: 2026-03-01T00:20:37Z
**Handler:** `HandleHealth`
+### GET /instances
+
+**Handler:** `handleList`
+
+### GET /instances/tabs
+
+**Handler:** `handleAllTabs`
+
+### GET /instances/{id}/cookies
+
+**Handler:** `proxyToInstance`
+
+### GET /instances/{id}/download
+
+**Handler:** `proxyToInstance`
+
+### GET /instances/{id}/logs
+
+**Handler:** `handleLogsByID`
+
+### GET /instances/{id}/pdf
+
+**Handler:** `proxyToInstance`
+
+### GET /instances/{id}/proxy/screencast
+
+**Handler:** `handleProxyScreencast`
+
+### GET /instances/{id}/screencast
+
+**Handler:** `proxyToInstance`
+
+### GET /instances/{id}/screenshot
+
+**Handler:** `proxyToInstance`
+
+### GET /instances/{id}/snapshot
+
+**Handler:** `proxyToInstance`
+
+### GET /instances/{id}/tabs
+
+**Handler:** `proxyToInstance`
+
+### GET /instances/{id}/text
+
+**Handler:** `proxyToInstance`
+
### GET /pdf
**Handler:** `HandlePDF`
+### GET /profiles
+
+**Handler:** `handleList`
+
+### GET /profiles/{id}/instance
+
+**Handler:** `handleProfileInstance`
+
+### GET /profiles/{name}/analytics
+
+**Handler:** `handleAnalyticsByPath`
+
+### GET /profiles/{name}/logs
+
+**Handler:** `handleLogsByPath`
+
### GET /screencast
**Handler:** `HandleScreencast`
@@ -86,6 +215,14 @@ Generated: 2026-03-01T00:20:37Z
**Handler:** ``
+### PATCH /profiles/meta
+
+**Handler:** `handleUpdateMeta`
+
+### PATCH /profiles/{name}
+
+**Handler:** `handleUpdateByPath`
+
### POST /action
**Handler:** `HandleAction`
@@ -110,10 +247,86 @@ Generated: 2026-03-01T00:20:37Z
**Handler:** `HandleFingerprintRotate`
+### POST /instances/launch
+
+**Handler:** `handleLaunchByName`
+
+### POST /instances/{id}/action
+
+**Handler:** `proxyToInstance`
+
+### POST /instances/{id}/actions
+
+**Handler:** `proxyToInstance`
+
+### POST /instances/{id}/cookies
+
+**Handler:** `proxyToInstance`
+
+### POST /instances/{id}/ensure-chrome
+
+**Handler:** `proxyToInstance`
+
+### POST /instances/{id}/evaluate
+
+**Handler:** `proxyToInstance`
+
+### POST /instances/{id}/navigate
+
+**Handler:** `proxyToInstance`
+
+### POST /instances/{id}/stop
+
+**Handler:** `handleStopByInstanceID`
+
+### POST /instances/{id}/tab
+
+**Handler:** `proxyToInstance`
+
+### POST /instances/{id}/tab/lock
+
+**Handler:** `proxyToInstance`
+
+### POST /instances/{id}/tab/unlock
+
+**Handler:** `proxyToInstance`
+
+### POST /instances/{id}/upload
+
+**Handler:** `proxyToInstance`
+
### POST /navigate
**Handler:** `HandleNavigate`
+### POST /profiles/create
+
+**Handler:** `handleCreate`
+
+### POST /profiles/import
+
+**Handler:** `handleImport`
+
+### POST /profiles/{id}/start
+
+**Handler:** `handleStartByID`
+
+### POST /profiles/{id}/stop
+
+**Handler:** `handleStopByID`
+
+### POST /profiles/{name}/reset
+
+**Handler:** `handleResetByPath`
+
+### POST /start/{id}
+
+**Handler:** `handleStartByID`
+
+### POST /stop/{id}
+
+**Handler:** `handleStopByID`
+
### POST /tab
**Handler:** `HandleTab`
@@ -134,15 +347,6 @@ Generated: 2026-03-01T00:20:37Z
## Notes
-- This documentation is **auto-generated** from Go code
+- This documentation is auto-generated from Go code
- For full implementation details, see `internal/handlers/*.go`
- Query parameters and request bodies are defined in each handler
-- To regenerate: `go run scripts/gen-api-docs/main.go > docs/references/api-reference.md`
-
----
-
-## Related Documentation
-
-- [API Reference (Full)](endpoints.md) — Comprehensive API reference with examples and details
-- [CLI Reference](cli-commands.md) — Command-line interface documentation
-- [Configuration](configuration.md) — Environment variables and settings
diff --git a/scripts/gen-api-docs/main.go b/scripts/gen-api-docs/main.go
index 214ae43e..d02cfddb 100644
--- a/scripts/gen-api-docs/main.go
+++ b/scripts/gen-api-docs/main.go
@@ -6,6 +6,7 @@ import (
"go/parser"
"go/token"
"log"
+ "os"
"regexp"
"sort"
"strings"
@@ -20,8 +21,40 @@ type Endpoint struct {
}
func main() {
- // Parse handlers.go to extract routes
- endpoints := extractEndpoints("internal/handlers/handlers.go")
+ // Parse all relevant files for routes
+ var endpoints []Endpoint
+
+ // Main handlers
+ endpoints = append(endpoints, extractEndpoints("internal/handlers/handlers.go")...)
+
+ // Dashboard handlers
+ endpoints = append(endpoints, extractEndpoints("internal/dashboard/dashboard.go")...)
+
+ // Profiles service
+ profiles, err := findProfilesFile()
+ if err == nil {
+ endpoints = append(endpoints, extractEndpoints(profiles)...)
+ }
+
+ // Orchestrator service
+ orchestrator, err := findOrchestratorFile()
+ if err == nil {
+ endpoints = append(endpoints, extractEndpoints(orchestrator)...)
+ }
+
+ // Remove duplicates
+ endpointMap := make(map[string]Endpoint)
+ for _, ep := range endpoints {
+ key := ep.Method + " " + ep.Path
+ if _, exists := endpointMap[key]; !exists {
+ endpointMap[key] = ep
+ }
+ }
+
+ endpoints = make([]Endpoint, 0, len(endpointMap))
+ for _, ep := range endpointMap {
+ endpoints = append(endpoints, ep)
+ }
// Sort by method then path
sort.Slice(endpoints, func(i, j int) bool {
@@ -84,6 +117,37 @@ func main() {
fmt.Println("")
}
+func findProfilesFile() (string, error) {
+ // Look for profiles service implementation
+ matches := []string{
+ "internal/profiles/handlers.go",
+ "internal/profiles/profiles.go",
+ "internal/handler/profiles.go",
+ "internal/bridge/profiles.go",
+ }
+ for _, path := range matches {
+ if _, err := os.Stat(path); err == nil {
+ return path, nil
+ }
+ }
+ return "", fmt.Errorf("profiles file not found")
+}
+
+func findOrchestratorFile() (string, error) {
+ // Look for orchestrator service implementation
+ matches := []string{
+ "internal/orchestrator/handlers.go",
+ "internal/orchestrator/orchestrator.go",
+ "internal/bridge/orchestrator.go",
+ }
+ for _, path := range matches {
+ if _, err := os.Stat(path); err == nil {
+ return path, nil
+ }
+ }
+ return "", fmt.Errorf("orchestrator file not found")
+}
+
func extractEndpoints(filePath string) []Endpoint {
fset := token.NewFileSet()
file, err := parser.ParseFile(fset, filePath, nil, parser.ParseComments)
@@ -93,15 +157,18 @@ func extractEndpoints(filePath string) []Endpoint {
var endpoints []Endpoint
- // Find RegisterRoutes function
+ // Find any RegisterHandlers or RegisterRoutes function
for _, decl := range file.Decls {
funcDecl, ok := decl.(*ast.FuncDecl)
- if !ok || funcDecl.Name.Name != "RegisterRoutes" {
+ if !ok {
continue
}
- // Extract HandleFunc calls
- endpoints = extractHandleFuncCalls(funcDecl.Body)
+ // Look for RegisterHandlers or RegisterRoutes
+ if funcDecl.Name.Name == "RegisterHandlers" || funcDecl.Name.Name == "RegisterRoutes" {
+ // Extract HandleFunc calls
+ endpoints = append(endpoints, extractHandleFuncCalls(funcDecl.Body)...)
+ }
}
return endpoints