Rename list_children/read_output/kill/send_message_to to their SPEC §7 process_id-shaped names; drop report_to_parent (direction inferred by send_message) and policy_check (replaced by per-project trust gating). Add the SPEC's missing tools: start_process, restart_process, close_process, rename_process, select_process, get_process_status, get_project_status, get_process_raw_output, search_output, get_process_ports, whoami, help. Process model now distinguishes agent/terminal/command kinds with opaque p_<6hex> IDs. Command entries are session-persistent so they survive PTY exit and can be Restart'd. Status enum gains starting and stopped. screen_version, port detection, and bracketed-paste send_input land alongside. Trust gating (internal/trust) replaces the regex policy: command-preset spawns return needs_trust on first use; the user confirms in a status-line modal and the grant persists to \$XDG_DATA_HOME/patterm/projects/<key>/trust.json. Tests cover send_message direction inference (parent↔child, sibling rejection, nil caller paths) and trust grant persistence across reopen.
32 lines
1.4 KiB
Go
32 lines
1.4 KiB
Go
//go:build nocgo
|
|
|
|
// This file provides a stub GhosttyEmulator for `go vet` / `go build`
|
|
// invocations that pass the `nocgo` build tag, so the rest of the Go code can
|
|
// be checked without `libghostty-vt` being installed. The stub fails at
|
|
// construction time — there is no functional emulator in `nocgo` builds.
|
|
|
|
package vt
|
|
|
|
import "errors"
|
|
|
|
type GhosttyEmulator struct{}
|
|
|
|
func NewGhosttyEmulator(cols, rows uint16) (*GhosttyEmulator, error) {
|
|
return nil, errors.New("vt: built with -tags nocgo; libghostty-vt is unavailable")
|
|
}
|
|
|
|
func (e *GhosttyEmulator) Write(p []byte) (int, error) { return 0, errStub }
|
|
func (e *GhosttyEmulator) Resize(cols, rows uint16) error { return errStub }
|
|
func (e *GhosttyEmulator) Size() (uint16, uint16) { return 0, 0 }
|
|
func (e *GhosttyEmulator) PlainText() (string, error) { return "", errStub }
|
|
func (e *GhosttyEmulator) ScreenText() (string, error) { return "", errStub }
|
|
func (e *GhosttyEmulator) SerializeVT() ([]byte, error) { return nil, errStub }
|
|
func (e *GhosttyEmulator) Cursor() (CursorState, error) { return CursorState{}, errStub }
|
|
func (e *GhosttyEmulator) ActiveScreen() (Screen, error) { return 0, errStub }
|
|
func (e *GhosttyEmulator) OnWritePTY(fn func([]byte)) {}
|
|
func (e *GhosttyEmulator) Close() error { return nil }
|
|
|
|
var errStub = errors.New("vt: built with -tags nocgo")
|
|
|
|
var _ Emulator = (*GhosttyEmulator)(nil)
|