Documentation
¶
Overview ¶
Package action exposes kitty-browse's versioned, native Chromium automation API. Browser and tab lifetimes remain owned by the host application.
Index ¶
- Constants
- func Execute(ctx context.Context, req Request, sess *browser.Session) (json.RawMessage, error)
- func RequestTimeout(req Request) (time.Duration, error)
- func ValidateRequest(req Request) error
- type Capability
- type Error
- type ExplicitSelection
- type Info
- type Meta
- type Request
- type Response
- type TabInfo
- type Target
Constants ¶
const APIVersion = "v1"
const Backend = "native-cdp"
Variables ¶
This section is empty.
Functions ¶
func Execute ¶
Execute dispatches a request only to native Session/CDP implementations. Browser lifecycle operations are returned to the host rather than mutating Session state behind the UI's back.
func RequestTimeout ¶
RequestTimeout validates and converts the public millisecond timeout. A zero value means the stable 30-second default.
func ValidateRequest ¶
ValidateRequest checks the versioned request envelope. An omitted version is the v1 compatibility spelling; versions are otherwise matched exactly.
Types ¶
type Capability ¶
type Capability struct {
Name string `json:"name"`
Description string `json:"description"`
ReadOnly bool `json:"readOnly"`
InputSchema json.RawMessage `json:"inputSchema"`
}
func Capabilities ¶
func Capabilities() []Capability
Capabilities describes only the native surface. Host-managed entries are declarations: Execute returns host_action_required for those actions.
type Error ¶
type Error struct {
Code string `json:"code"`
Message string `json:"message"`
Retryable bool `json:"retryable"`
Details json.RawMessage `json:"details"`
}
type ExplicitSelection ¶ added in v0.2.9
type ExplicitSelection struct {
Revision uint64 `json:"revision"`
TabID string `json:"tabId"`
TargetID string `json:"targetId"`
}
ExplicitSelection is the latest successful control-API tab activation. Its revision is scoped to one browser instance and does not change on reads, popup reconciliation, or manual selection in a visible pane.
type Info ¶
type Info struct {
APIVersion string `json:"apiVersion"`
BrowserID string `json:"browserId"`
LoginProfile string `json:"loginProfile,omitempty"`
ActiveTabID string `json:"activeTabId"`
Backend string `json:"backend"`
Tabs []TabInfo `json:"tabs"`
Capabilities []Capability `json:"capabilities"`
ExplicitSelection *ExplicitSelection `json:"explicitSelection,omitempty"`
}
type Request ¶
type Request struct {
APIVersion string `json:"apiVersion,omitempty"`
ID string `json:"id"`
Action string `json:"action"`
Params json.RawMessage `json:"params"`
Args []string `json:"args"`
Target Target `json:"target"`
TimeoutMS int `json:"timeoutMs"`
}
func ParseCommand ¶
ParseCommand converts the documented CLI vocabulary to the stable API request. It never provides a catch-all passthrough.