High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.
fix: align types with actual Go backend
Bosch075ee3b30d91
diff --git a/dashboard/src/components/molecules/InstanceCard.tsx b/dashboard/src/components/molecules/InstanceCard.tsxindex 5096e642..942008ba 100644--- a/dashboard/src/components/molecules/InstanceCard.tsx+++ b/dashboard/src/components/molecules/InstanceCard.tsx@@ -32,15 +32,9 @@ export default function InstanceCard({ instance, onOpen, onStop }: Props) {</Badge></div>- <div className="mb-3 grid grid-cols-2 gap-2 text-xs">- <div className="rounded bg-bg-elevated px-2 py-1.5">- <span className="text-text-muted">Tabs:</span>{' '}- <span className="text-text-secondary">{instance.tabs ?? 0}</span>- </div>- <div className="rounded bg-bg-elevated px-2 py-1.5">- <span className="text-text-muted">Uptime:</span>{' '}- <span className="text-text-secondary">{formatUptime(instance.startTime)}</span>- </div>+ <div className="mb-3 rounded bg-bg-elevated px-2 py-1.5 text-xs">+ <span className="text-text-muted">Uptime:</span>{' '}+ <span className="text-text-secondary">{formatUptime(instance.startTime)}</span></div><div className="mt-auto flex gap-2">diff --git a/dashboard/src/components/molecules/ProfileCard.tsx b/dashboard/src/components/molecules/ProfileCard.tsxindex 3fab0b9a..90978931 100644--- a/dashboard/src/components/molecules/ProfileCard.tsx+++ b/dashboard/src/components/molecules/ProfileCard.tsx@@ -34,7 +34,7 @@ export default function ProfileCard({ profile, instance, onLaunch, onManage }: P{isRunning && instance && (<div className="mb-3 rounded bg-bg-elevated px-2 py-1.5 text-xs text-text-muted">- Port {instance.port} · {instance.tabs ?? 0} tabs+ Port {instance.port}</div>)}diff --git a/dashboard/src/generated/types.ts b/dashboard/src/generated/types.tsindex 46b0b54b..a545a07a 100644--- a/dashboard/src/generated/types.ts+++ b/dashboard/src/generated/types.ts@@ -9,30 +9,39 @@ These types are exported to TypeScript via tygo./*** Profile represents a browser profile stored on disk.+ * Matches internal/bridge/api.go ProfileInfo*/export interface Profile {- id: string;+ id?: string;name: string;path?: string;- useWhen?: string;+ pathExists?: boolean;created: string;lastUsed: string;diskUsage: number /* int64 */;+ sizeMB?: number /* float64 */;running: boolean;+ temporary?: boolean;source?: string;+ chromeProfileName?: string;+ accountEmail?: string;+ accountName?: string;+ hasAccount?: boolean;+ useWhen?: string;+ description?: string;}/*** Instance represents a running browser instance.+ * Matches internal/bridge/api.go Instance*/export interface Instance {id: string;profileId: string;profileName: string;- port: number /* int */;+ port: string; // Note: string not intheadless: boolean;status: string; // starting/running/stopping/stopped/errorstartTime: string;- tabs: number /* int */;error?: string;}/**@@ -111,7 +120,8 @@ export interface CreateProfileResponse {* LaunchInstanceRequest is the request body for launching an instance.*/export interface LaunchInstanceRequest {- profileId: string;- port?: number /* int */;- headless?: boolean;+ profileId?: string; // profile ID (prof_XXXXXXXX)+ name?: string; // profile name+ mode?: string; // "headed" or empty for headless+ port?: string; // port number as string}diff --git a/dashboard/src/pages/ProfilesPage.tsx b/dashboard/src/pages/ProfilesPage.tsxindex c0f0efd8..e140afba 100644--- a/dashboard/src/pages/ProfilesPage.tsx+++ b/dashboard/src/pages/ProfilesPage.tsx@@ -58,9 +58,9 @@ export default function ProfilesPage() {if (!showLaunch) returntry {await api.launchInstance({- profileId: showLaunch,- port: parseInt(launchPort) || 9868,- headless: launchHeadless,+ name: showLaunch,+ port: launchPort || '9868',+ mode: launchHeadless ? '' : 'headed',})setShowLaunch(null)setLaunchPort('9868')diff --git a/internal/api/types/types.go b/internal/api/types/types.goindex 8bf35da1..86cc200d 100644--- a/internal/api/types/types.go+++ b/internal/api/types/types.go@@ -5,28 +5,37 @@ package typesimport "time"// Profile represents a browser profile stored on disk.+// Matches internal/bridge/api.go ProfileInfotype Profile struct {- ID string `json:"id"`- Name string `json:"name"`- Path string `json:"path,omitempty"`- UseWhen string `json:"useWhen,omitempty"`- Created time.Time `json:"created"`- LastUsed time.Time `json:"lastUsed"`- DiskUsage int64 `json:"diskUsage"`- Running bool `json:"running"`- Source string `json:"source,omitempty"`+ ID string `json:"id,omitempty"`+ Name string `json:"name"`+ Path string `json:"path,omitempty"`+ PathExists bool `json:"pathExists,omitempty"`+ Created time.Time `json:"created"`+ LastUsed time.Time `json:"lastUsed"`+ DiskUsage int64 `json:"diskUsage"`+ SizeMB float64 `json:"sizeMB,omitempty"`+ Running bool `json:"running"`+ Temporary bool `json:"temporary,omitempty"`+ Source string `json:"source,omitempty"`+ ChromeProfileName string `json:"chromeProfileName,omitempty"`+ AccountEmail string `json:"accountEmail,omitempty"`+ AccountName string `json:"accountName,omitempty"`+ HasAccount bool `json:"hasAccount,omitempty"`+ UseWhen string `json:"useWhen,omitempty"`+ Description string `json:"description,omitempty"`}// Instance represents a running browser instance.+// Matches internal/bridge/api.go Instancetype Instance struct {ID string `json:"id"`ProfileID string `json:"profileId"`ProfileName string `json:"profileName"`- Port int `json:"port"`+ Port string `json:"port"` // Note: string not intHeadless bool `json:"headless"`Status string `json:"status"` // starting/running/stopping/stopped/errorStartTime time.Time `json:"startTime"`- Tabs int `json:"tabs"`Error string `json:"error,omitempty"`}@@ -96,7 +105,8 @@ type CreateProfileResponse struct {// LaunchInstanceRequest is the request body for launching an instance.type LaunchInstanceRequest struct {- ProfileID string `json:"profileId"`- Port int `json:"port,omitempty"`- Headless bool `json:"headless,omitempty"`+ ProfileID string `json:"profileId,omitempty"` // profile ID (prof_XXXXXXXX)+ Name string `json:"name,omitempty"` // profile name+ Mode string `json:"mode,omitempty"` // "headed" or empty for headless+ Port string `json:"port,omitempty"` // port number as string}