Documentation
¶
Index ¶
- Constants
- func CombineStreams(stdout, stderr string) string
- func ResolveBudgetWithAdapter(profile Profile, inv Invocation, fallbackLines int, adapter BudgetAdapter) (OutputBudget, *BudgetAdaptation)
- func SanitizeFileName(value string) string
- type BudgetAdaptation
- type BudgetAdapter
- type Classification
- type ClassifiedCommand
- type Engine
- func (e *Engine) Execute(ctx context.Context, inv Invocation, passthrough bool) (Result, error)
- func (e *Engine) ExecuteStreaming(ctx context.Context, inv Invocation, passthrough bool, ...) (Result, error)
- func (e *Engine) Explain(inv Invocation) Profile
- func (e *Engine) ExplainBudget(inv Invocation) (OutputBudget, *BudgetAdaptation)
- func (e *Engine) ExplainDecisions(inv Invocation) []ExplainDecision
- func (e *Engine) ExplainPreferences(inv Invocation) (Invocation, []PreferenceDecision)
- func (e *Engine) Profiles() []Profile
- func (e *Engine) SetBudgetAdapter(adapter BudgetAdapter)
- type Execution
- type ExplainDecision
- type FastPathDecision
- type GitCommandFacts
- type HistoryBudgetAdapter
- type HistoryBudgetAdapterOptions
- type Invocation
- type JavaScriptCommandFacts
- type OutputBudget
- type PartialResult
- type PreferenceDecision
- type Profile
- type ProfileCapabilities
- type RecoveryPlan
- type RenderedExecution
- type Result
- type StreamReducer
- type StreamReducerDone
- type StreamReducerPreview
- type StreamRenderFactory
Constants ¶
View Source
const ( FastPathBypassKindNone = "" FastPathBypassKindTinyOutput = "tiny-output" FastPathBypassKindFamilyRule = "family-rule" FastPathBypassKindEmptyPreferredStream = "empty-preferred-stream" )
View Source
const ( ConfidenceHigh = "high" ConfidenceMedium = "medium" ConfidenceLow = "low" )
View Source
const ( SourceBuiltin = "built-in" SourceProject = "project-local" SourcePreference = "project-preference" SourceFallback = "fallback" )
View Source
const ( StreamAuto = "auto" StreamStdoutOnly = "stdout-only" StreamStderrOnly = "stderr-only" StreamStdoutFirst = "stdout-first" StreamStderrFirst = "stderr-first" )
View Source
const ( StructuredModeNone = "" StructuredModePreferred = "preferred" StructuredModeStdoutOnly = "stdout-only" StructuredModeStdoutRequired = "stdout-required" )
View Source
const ( FastPathBypassNever = "" FastPathBypassSafeOnly = "safe-only" FastPathBypassSmallOutput = "small-output" )
View Source
const BudgetAdaptationSourceHistory = "history"
View Source
const RecoveryKindFullOutput = "full-output"
Variables ¶
This section is empty.
Functions ¶
func CombineStreams ¶
func ResolveBudgetWithAdapter ¶ added in v0.4.0
func ResolveBudgetWithAdapter(profile Profile, inv Invocation, fallbackLines int, adapter BudgetAdapter) (OutputBudget, *BudgetAdaptation)
func SanitizeFileName ¶
Types ¶
type BudgetAdaptation ¶ added in v0.4.0
type BudgetAdaptation struct {
Source string
Fingerprint string
Direction string
Reason string
Confidence string
Samples int
Scale float64
Suggested OutputBudget
Applied OutputBudget
}
type BudgetAdapter ¶ added in v0.4.0
type BudgetAdapter interface {
AdaptBudget(profile Profile, inv Invocation, budget OutputBudget) (OutputBudget, *BudgetAdaptation)
}
type Classification ¶ added in v0.5.0
type Classification struct {
Command ClassifiedCommand
Display ClassifiedCommand
}
type ClassifiedCommand ¶ added in v0.5.0
type ClassifiedCommand struct {
Head string
Subcommand string
Git GitCommandFacts
JavaScript JavaScriptCommandFacts
}
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) ExecuteStreaming ¶
func (e *Engine) ExecuteStreaming( ctx context.Context, inv Invocation, passthrough bool, onPartial func(PartialResult), ) (Result, error)
func (*Engine) Explain ¶
func (e *Engine) Explain(inv Invocation) Profile
func (*Engine) ExplainBudget ¶ added in v0.4.0
func (e *Engine) ExplainBudget(inv Invocation) (OutputBudget, *BudgetAdaptation)
func (*Engine) ExplainDecisions ¶
func (e *Engine) ExplainDecisions(inv Invocation) []ExplainDecision
func (*Engine) ExplainPreferences ¶
func (e *Engine) ExplainPreferences(inv Invocation) (Invocation, []PreferenceDecision)
func (*Engine) SetBudgetAdapter ¶ added in v0.4.0
func (e *Engine) SetBudgetAdapter(adapter BudgetAdapter)
type ExplainDecision ¶
type FastPathDecision ¶
type FastPathDecision struct {
BypassCompression bool
BypassKind string
Reason string
WarnLatency bool
}
func DecideFastPath ¶
func DecideFastPath(profile Profile, inv Invocation, rawBytes, rawTokens int, duration time.Duration, exitCode int) FastPathDecision
type GitCommandFacts ¶ added in v0.5.0
type HistoryBudgetAdapter ¶ added in v0.4.0
type HistoryBudgetAdapter struct {
// contains filtered or unexported fields
}
func NewHistoryBudgetAdapter ¶ added in v0.4.0
func NewHistoryBudgetAdapter(store *history.Store) *HistoryBudgetAdapter
func NewHistoryBudgetAdapterWithOptions ¶ added in v0.4.0
func NewHistoryBudgetAdapterWithOptions(store *history.Store, opts HistoryBudgetAdapterOptions) *HistoryBudgetAdapter
func (*HistoryBudgetAdapter) AdaptBudget ¶ added in v0.4.0
func (a *HistoryBudgetAdapter) AdaptBudget(profile Profile, inv Invocation, budget OutputBudget) (OutputBudget, *BudgetAdaptation)
type HistoryBudgetAdapterOptions ¶ added in v0.4.0
type Invocation ¶
type Invocation struct {
Command []string
Display []string
Cwd string
Verbose int
UltraCompact bool
ReasoningBudgetMode string
Advanced config.Advanced
Classification Classification
}
func Classify ¶ added in v0.5.0
func Classify(inv Invocation) Invocation
type JavaScriptCommandFacts ¶ added in v0.5.0
type OutputBudget ¶
type OutputBudget struct {
MaxLines int
MaxBytes int
MaxTokens int
MinFailures int
MinAnchors int
MinHints int
NoisePrefiltering bool
SemanticCompaction bool
AdaptiveBudgets bool
EarlyCaptureStop bool
AggressiveRewrites bool
}
func ExpandBudgetForFailureEscape ¶
func ExpandBudgetForFailureEscape(budget OutputBudget, inv Invocation) OutputBudget
func ResolveBudget ¶
func ResolveBudget(profile Profile, inv Invocation, fallbackLines int) OutputBudget
type PartialResult ¶
type PreferenceDecision ¶
type Profile ¶
type Profile struct {
Name string
Description string
Source string
Confidence string
Capabilities ProfileCapabilities
StreamPreference string
Budget OutputBudget
LatencyBudget time.Duration
Match func(Invocation) bool
Prepare func(Invocation) []string
Render func(Invocation, Execution) string
StreamRender StreamRenderFactory
ParseBytes func(Execution) int
Explain []string
}
type ProfileCapabilities ¶ added in v0.5.0
type RecoveryPlan ¶ added in v0.5.0
type RenderedExecution ¶
type RenderedExecution struct {
Text string
RawCombined string
BytesParsed int
BytesEmitted int
RawTokens int
FilteredTokens int
FallbackUsed bool
}
func RenderExecution ¶
func RenderExecution(profile Profile, inv Invocation, exec Execution, fallbackLines int, passthrough bool) RenderedExecution
type StreamReducer ¶
type StreamReducerDone ¶
type StreamReducerDone interface {
Done() bool
}
type StreamReducerPreview ¶
type StreamReducerPreview interface {
Preview() string
}
type StreamRenderFactory ¶
type StreamRenderFactory func(Invocation, OutputBudget) StreamReducer
Source Files
¶
- budget_adaptation.go
- classification.go
- compression.go
- custom_rule_compile.go
- custom_rule_explain.go
- custom_rule_match.go
- custom_rule_render.go
- custom_rule_rewrite.go
- custom_rules.go
- engine.go
- engine_execute.go
- engine_explain.go
- fastpath.go
- match.go
- output.go
- output_guard.go
- profile.go
- profile_capabilities.go
- recovery.go
- render.go
- run.go
- tee.go
- types.go
Click to show internal directories.
Click to hide internal directories.