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:52

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

func Contract(ctx context.Context, root string) (corecontract.Contract, error)

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

Contract returns the hardening contract plus relevant workspace configuration context.

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

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

Prompt returns the manual hardening prompt. Provider hardening receives the same shared contract with a provider-specific output contract instead.

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

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

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:105

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

Types

type Options

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

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:39

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
	SuppressContext bool
	Progress        io.Writer
}
Fields
  • Root string
  • TaskID string
  • MarkPassed bool
  • Provider string
  • Command string
  • ProviderBinary string
  • Model string
  • SuppressContext bool
  • Progress io.Writer

type Selection

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

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

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