config

package
v1.0.27 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRepositoryURL = "git@github.com:Molten-Bot/moltenhub-code.git"
	DefaultResponseMode  = "caveman-full"
	DisabledResponseMode = "off"
)

Variables

This section is empty.

Functions

func DedupeKey

func DedupeKey(cfg Config) string

DedupeKey returns the stable payload used to identify duplicate task submissions.

func NormalizePRBody

func NormalizePRBody(body, prompt string) string

NormalizePRBody enforces the standardized pull-request body format.

func NormalizeResponseMode

func NormalizeResponseMode(mode string) string

NormalizeResponseMode returns the canonical response mode. "off" disables caveman compression.

func SupportedResponseModes

func SupportedResponseModes() []string

SupportedResponseModes returns the canonical non-default response modes.

func SupportedResponseModesWithDefault

func SupportedResponseModesWithDefault() []string

SupportedResponseModesWithDefault returns canonical response modes plus the default alias.

Types

type Config

type Config struct {
	Version                string        `json:"version"`
	RepoURL                string        `json:"repoUrl"`
	Repo                   string        `json:"repo"`
	Repos                  []string      `json:"repos"`
	LibraryTaskName        string        `json:"libraryTaskName,omitempty"`
	LibraryTaskDisplayName string        `json:"libraryTaskDisplayName,omitempty"`
	ResponseMode           string        `json:"responseMode,omitempty"`
	AgentHarness           string        `json:"agentHarness,omitempty"`
	AgentCommand           string        `json:"agentCommand,omitempty"`
	BaseBranch             string        `json:"baseBranch"`
	TargetSubdir           string        `json:"targetSubdir"`
	Prompt                 string        `json:"prompt"`
	Images                 []PromptImage `json:"images,omitempty"`
	CommitMessage          string        `json:"commitMessage"`
	PRTitle                string        `json:"prTitle"`
	PRBody                 string        `json:"prBody"`
	Labels                 []string      `json:"labels"`
	GitHubHandle           string        `json:"githubHandle"`
	Reviewers              []string      `json:"reviewers"`
	Review                 *ReviewConfig `json:"review,omitempty"`
}

Config is the v1 public contract for a harness run.

func Load

func Load(path string) (Config, error)

Load reads and validates a JSON/JSONC config from disk.

func (*Config) ApplyDefaults

func (c *Config) ApplyDefaults()

ApplyDefaults normalizes aliases and fills optional values.

func (Config) RepoList

func (c Config) RepoList() []string

RepoList returns the normalized list of repositories for this run.

func (*Config) UnmarshalJSON

func (c *Config) UnmarshalJSON(data []byte) error

UnmarshalJSON supports canonical camelCase keys plus the "branch" alias for baseBranch.

func (Config) Validate

func (c Config) Validate() error

Validate checks required values and path safety.

type PromptImage

type PromptImage struct {
	Name       string `json:"name,omitempty"`
	MediaType  string `json:"mediaType,omitempty"`
	DataBase64 string `json:"dataBase64,omitempty"`
}

PromptImage captures one prompt image attachment.

func (*PromptImage) UnmarshalJSON added in v1.0.14

func (p *PromptImage) UnmarshalJSON(data []byte) error

UnmarshalJSON accepts the canonical object shape and legacy base64 data URI strings emitted by older hub producers.

type ReviewConfig

type ReviewConfig struct {
	PRNumber                 int    `json:"prNumber,omitempty"`
	PRURL                    string `json:"prUrl,omitempty"`
	HeadBranch               string `json:"headBranch,omitempty"`
	Trigger                  string `json:"trigger,omitempty"`
	NotificationThreadID     string `json:"notificationThreadId,omitempty"`
	RequestedReviewer        string `json:"requestedReviewer,omitempty"`
	RequireRequestedReviewer bool   `json:"requireRequestedReviewer,omitempty"`
	Writeback                string `json:"writeback,omitempty"`
	AutoMerge                bool   `json:"autoMerge,omitempty"`
	MergeMethod              string `json:"mergeMethod,omitempty"`
}

ReviewConfig captures structured pull-request review context for review tasks.

Jump to

Keyboard shortcuts

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