worker

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package worker exposes the bot's one-shot operations over a private, versioned local HTTP service. The current transport is a Unix-domain socket; the request and event schemas are independent of that transport so mutual TLS can be added without changing bot semantics.

Index

Constants

View Source
const (
	ProtocolVersion = 1
	MinimumProtocol = 1
)

Variables

This section is empty.

Functions

func Serve

func Serve(ctx context.Context, socketPath string, info Initialize, run RunFunc, log *slog.Logger) error

Types

type Event

type Event struct {
	Type     string    `json:"type"`
	Seq      uint64    `json:"seq"`
	Progress *Progress `json:"progress,omitempty"`
	Result   *Result   `json:"result,omitempty"`
	Error    string    `json:"error,omitempty"`
}

type FeatureResearch added in v0.1.2

type FeatureResearch struct {
	Focus string `json:"focus,omitempty"`
	// A nil maximum preserves the default; an explicit zero must fail validation.
	MaxIssues *int `json:"max_issues,omitempty"`
}

FeatureResearch controls discovery; it does not replace saved scan candidates.

type Initialize

type Initialize struct {
	Protocol        int      `json:"protocol"`
	MinimumProtocol int      `json:"minimum_protocol"`
	Bot             string   `json:"bot"`
	Version         string   `json:"version"`
	Capabilities    []string `json:"capabilities"`
}

type IssueOwnership

type IssueOwnership struct {
	PR     int    `json:"pr"`
	Branch string `json:"branch"`
	Issue  int    `json:"issue"`
}

type IssueResult

type IssueResult struct {
	Owned []IssueOwnership `json:"owned"`
}

type Progress

type Progress struct {
	Phase string `json:"phase"`
	Task  string `json:"task"`
}

type Request

type Request struct {
	FeatureResearch *FeatureResearch   `json:"feature_research,omitempty"`
	Protocol        int                `json:"protocol"`
	Remote          string             `json:"remote"`
	Branch          string             `json:"branch"`
	Directory       string             `json:"directory"`
	StateDirectory  string             `json:"state_directory"`
	Repo            string             `json:"repo"`
	Host            string             `json:"host"`
	Agent           runner.AgentConfig `json:"agent"`
	Verify          []string           `json:"verify,omitempty"`
	PR              int                `json:"pr,omitempty"`
	BaseSHA         string             `json:"base_sha,omitempty"`
	HeadSHA         string             `json:"head_sha,omitempty"`
}

type Result

type Result struct {
	Issue  *IssueResult  `json:"issue,omitempty"`
	Review *ReviewResult `json:"review,omitempty"`
}

type ReviewResult

type ReviewResult struct {
	Complete  bool              `json:"complete"`
	Findings  map[string]string `json:"findings,omitempty"`
	ExactBase string            `json:"exact_base,omitempty"`
	ExactHead string            `json:"exact_head,omitempty"`
}

type RunFunc

type RunFunc func(context.Context, Request, func(Progress)) (Result, error)

Jump to

Keyboard shortcuts

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