hostctl

package
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 28 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const CLIUsage = `` /* 703-byte string literal not displayed */
View Source
const IdentityUsage = "" /* 164-byte string literal not displayed */
View Source
const LinkUsage = "" /* 140-byte string literal not displayed */
View Source
const MaxTaskRequest = 1024 * 1024
View Source
const MaxTaskResponse = 8 * 1024 * 1024
View Source
const ServiceUsage = "" /* 333-byte string literal not displayed */
View Source
const TaskUsage = "" /* 656-byte string literal not displayed */

Variables

This section is empty.

Functions

func Bootstrap

func Bootstrap(ctx context.Context, profile string, endpoint *link.Link) error

func Connect

func Connect(ctx context.Context, profile string) (link.Transport, error)

Connect attaches a Client to the running Node's owner-only control socket. The control channel carries commands and subscriptions, not binary streams. Closing a controller never shuts down the Node or replays admitted work.

func PrintHelp

func PrintHelp(stdout io.Writer) error

func ReportSharing

func ReportSharing(ctx context.Context, endpoint *link.Link, origin string, stdout, stderr io.Writer) error

func RunCLI

func RunCLI(ctx context.Context, args []string, stdin io.Reader, stdout, stderr io.Writer, handlers CLIHandlers) (int, error)

RunCLI dispatches Host commands. Legacy task commands keep their established parsers; new interactive flows use this small command table.

func RunIdentity

func RunIdentity(ctx context.Context, args []string, stdout io.Writer) (int, error)

RunIdentity uses the owner-only Host control transport and the same durable admission as remote controllers. Uncertain results include their original ID.

func RunInstalledCommand

func RunInstalledCommand(ctx context.Context, action string, args []string) error
func RunLink(ctx context.Context, args []string, stdin *bufio.Reader, interactive bool, stdout, stderr io.Writer) error

func RunMenu

func RunMenu(ctx context.Context, input *bufio.Reader, output io.Writer) (string, error)

func RunShare

func RunShare(ctx context.Context, args []string, stdout, stderr io.Writer) error

func RunTask

func RunTask(ctx context.Context, options TaskOptions, output io.Writer) (int, error)

Types

type CLIHandlers

type CLIHandlers struct {
	Service    func(context.Context, []string) (int, error)
	Acceptance func(context.Context, []string) (int, error)
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func Listen

func Listen(profile string, endpoint *link.Link, transport link.Transport) (*Server, error)

func (*Server) Close

func (server *Server) Close() error

func (*Server) Serve

func (server *Server) Serve(ctx context.Context) error

type ServiceOptions

type ServiceOptions struct {
	Profile        string
	Network        link.NetworkScope
	Bootstrap      bool
	PairingService string
	Telemetry      *bool
}

func ParseService

func ParseService(args []string) (ServiceOptions, bool, error)

func (ServiceOptions) Environment

func (options ServiceOptions) Environment(name string) string

Environment reads the process environment for the Node's telemetry. The `--telemetry off` choice answers as the environment opt-out; `on` adds nothing, so an environment opt-out and the saved preference keep precedence.

type Target

type Target struct {
	Kind             string
	Session          protocol.SessionID
	ExpectedRevision *uint64
	Worktree         protocol.WorktreeID
	Config           *protocol.SessionConfig
	Execution        protocol.ConversationExecution
	Team             *protocol.TeamSelection
	Association      *protocol.ConversationAssociation
}

func (Target) MarshalJSON

func (target Target) MarshalJSON() ([]byte, error)

func (*Target) UnmarshalJSON

func (target *Target) UnmarshalJSON(body []byte) error

type Task

type Task struct {
	Command string
	Version uint8
	Request protocol.RequestID
	Target  Target
	Message protocol.ConversationInput
	Title   string
	Wait    bool
	Timeout uint64
	Session *protocol.SessionID
	Turn    *protocol.TurnID
}

func (Task) MarshalJSON

func (task Task) MarshalJSON() ([]byte, error)

func (Task) Result

func (task Task) Result() TaskResult

func (*Task) UnmarshalJSON

func (task *Task) UnmarshalJSON(body []byte) error

type TaskOptions

type TaskOptions struct {
	Profile string
	Task    Task
	Wait    bool
}

func ParseTask

func ParseTask(args []string, stdin io.Reader) (TaskOptions, bool, error)

type TaskResult

type TaskResult struct {
	Version   uint8                           `json:"version"`
	Node      *protocol.NodeID                `json:"node"`
	Request   *protocol.RequestID             `json:"request"`
	Session   *protocol.SessionID             `json:"session"`
	Turn      *protocol.TurnID                `json:"turn"`
	Revision  *uint64                         `json:"revision"`
	State     string                          `json:"state"`
	Text      string                          `json:"text"`
	Error     *protocol.Fault                 `json:"error"`
	Approvals []protocol.ConversationApproval `json:"approvals"`
	Questions []protocol.ConversationQuestion `json:"questions"`
}

func (TaskResult) ExitCode

func (result TaskResult) ExitCode() int

func (*TaskResult) UnmarshalJSON

func (result *TaskResult) UnmarshalJSON(body []byte) error

Jump to

Keyboard shortcuts

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