feat: define browser domain and application contracts

This commit is contained in:
QiuSW
2026-07-22 14:53:39 +08:00
parent f8aaaeda21
commit a5260496f3
7 changed files with 255 additions and 30 deletions
+1 -27
View File
@@ -4,33 +4,7 @@ MVP 首先提供本地 Go application service 和 CLI;是否增加 loopback HT
## 核心类型
```go
type BrowserKind string
const (
BrowserChrome BrowserKind = "chrome"
BrowserEdge BrowserKind = "edge"
)
type LaunchSpec struct {
Kind BrowserKind
Executable string
UserDataDir string
ProfileDirectory string
TargetURL string
ProxyServer string
Headless bool
ExtraArgs []string
}
type InstanceView struct {
ID string
Kind BrowserKind
PID int
UserDataDir string
Status string
ExitCode *int
}
```
代码权威类型位于 `internal/domain/browser.go`:`BrowserKind`、`LaunchSpec`、`InstanceStatus`、`InstanceView`、`BrowserEvent` 和稳定错误码。`LaunchSpec.Normalize()` 负责当前已确定的 browser kind、绝对 user data dir 和 http/https URL 校验。
## Application service