Internal

internal/adapters/cli/harden

Package harden builds the CLI-facing prompt context for hardening rounds.

import "github.com/nilstate/scafld/v2/internal/adapters/cli/harden"

Package harden builds the CLI-facing prompt context for hardening rounds.

Functions

func BuildInput(ctx context.Context, opts RunOptions) (appharden.Input, error)

Source: internal/adapters/cli/harden/selection.go:49

BuildInput returns the app-layer harden input for CLI execution.

func Prompt(ctx context.Context, root string) string

Source: internal/adapters/cli/harden/prompt.go:14

Prompt returns the hardening prompt plus relevant workspace configuration context.

func ResultText(stderr io.Writer, out appharden.Output) (string, bool)

Source: internal/adapters/cli/harden/selection.go:74

ResultText formats non-JSON harden output. The boolean reports whether the text should be wrapped in the standard success envelope.

func Select(ctx context.Context, opts Options) (Selection, error)

Source: internal/adapters/cli/harden/selection.go:91

Select loads config, applies CLI overrides, and returns a harden provider.

Types

type Options

Source: internal/adapters/cli/harden/selection.go:19

Options configures harden-provider selection for the CLI.

type Options struct {
	Root            string
	TaskID          string
	Provider        string
	Command         string
	ProviderBinary  string
	Model           string
	DiagnosticsPath string
	Progress        io.Writer
}
Fields
  • Root string
  • TaskID string
  • Provider string
  • Command string
  • ProviderBinary string
  • Model string
  • DiagnosticsPath string
  • Progress io.Writer

type RunOptions

Source: internal/adapters/cli/harden/selection.go:37

RunOptions configures the app harden input assembled by the CLI adapter.

type RunOptions struct {
	Root           string
	TaskID         string
	MarkPassed     bool
	Provider       string
	Command        string
	ProviderBinary string
	Model          string
	Progress       io.Writer
}
Fields
  • Root string
  • TaskID string
  • MarkPassed bool
  • Provider string
  • Command string
  • ProviderBinary string
  • Model string
  • Progress io.Writer

type Selection

Source: internal/adapters/cli/harden/selection.go:31

Selection is the provider and context budget chosen for a harden run.

type Selection struct {
	Provider        appharden.Provider
	ContextMaxBytes int
}
Fields
  • Provider appharden.Provider
  • ContextMaxBytes int