Documentation
¶
Overview ¶
Package clientbridge reports pmock-cli operations to a running PMOCK desktop client so the client's UI can show the same "Agent is operating" badge and data-change refresh as its built-in MCP server.
The bridge is deliberately one-way and fail-open: it only POSTs a small, validated event to 127.0.0.1 with the token the client wrote to userData/mcp/runtime.json. It never executes a business action through the client and never blocks a CLI call for more than a short timeout.
Index ¶
Constants ¶
const ( // EnvLink disables the bridge when set to 0/false/off/no. EnvLink = "PMOCK_CLIENT_LINK" // EnvRuntime overrides the runtime.json path (or its directory). EnvRuntime = "PMOCK_CLIENT_RUNTIME" )
Environment variables.
Variables ¶
This section is empty.
Functions ¶
func DeferredActivity ¶ added in v0.1.20
DeferredActivity reports whether a command's activity event must wait until the command succeeds. Power-state changes (start / restart / reset) are deferred: shouting "Agent is powering on" before the request makes the desktop client open its remote window while the phone is still off, so the window lands on a shutdown screen and never recovers. Every other operation keeps the immediate badge semantics.
Types ¶
type Event ¶
type Event struct {
Kind string `json:"kind"`
Tool string `json:"tool,omitempty"`
Action string `json:"action,omitempty"`
PhoneID string `json:"phoneId,omitempty"`
PhoneCode string `json:"phoneCode,omitempty"`
Scopes []string `json:"scopes,omitempty"`
PhoneIDs []string `json:"phoneIds,omitempty"`
SettleMS int `json:"settleMs,omitempty"`
At int64 `json:"at,omitempty"`
}
Event is the payload accepted by the client's POST /agent-event endpoint.