desktop

package
v0.10.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package desktop defines the opt-in native agent-desktop helper contract.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Packet

func Packet(r Request, home string) []byte

Packet uses an anonymous stdin pipe, never argv, environment, or a spool file. All fields are UTF-8 strings prefixed with a big-endian uint32 byte length.

func RunHelper

func RunHelper(in io.Reader, out io.Writer, args []string)

RunHelper is called only in Control's dedicated, one-request subprocess mode. It never reads credentials or configuration files, or prints diagnostics.

func Schema

func Schema() map[string]any

func SchemaWithCLI added in v0.8.1

func SchemaWithCLI(native, cli bool) map[string]any

SchemaWithCLI advertises only configured backends on an execution node. The client uses Schema so it can route either backend after discovery.

Types

type Request

type Request struct {
	Command  string  `json:"command"`
	App      string  `json:"app,omitempty"`
	Ref      string  `json:"ref,omitempty"`
	Text     *string `json:"text,omitempty"`
	Secret   string  `json:"secret,omitempty"`
	MaxDepth int     `json:"maxDepth,omitempty"`
	// CLI arguments are forwarded verbatim, without a shell or command whitelist.
	Args  []string `json:"args,omitempty"`
	Stdin *string  `json:"stdin,omitempty"`
}

Request is reference-only until the destination resolves a Secret.

func Decode

func Decode(args json.RawMessage) (Request, error)

Decode rejects unknown fields and invalid combinations without echoing input.

func ReadPacket

func ReadPacket(in io.Reader) (Request, string, error)

ReadPacket validates the complete private-pipe request before native loading.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL