input

package
v0.11.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.0, MIT Imports: 2 Imported by: 0

Documentation

Overview

Package input classifies user-typed text into intent categories so the TUI can route or hint accordingly. Phase 1.5 #2 (master plan).

The classifier is deliberately heuristic — fast, deterministic, no LLM call. False positives are corrected by the user (they edit and resend); false negatives just mean a missed hint, not a broken interaction.

Three labels:

  • KindShell: a literal shell command. Routes to direct exec ($hell).
  • KindNL: natural language for the agent. Default.
  • KindAmbiguous: looks like it could be either. UI can show a hint ("press $ to run as shell, Enter to ask agent").

We DON'T attempt to be exhaustive. The high-confidence shell signal is strong (leading $, common commands, metacharacters). Everything else stays NL. The Ambiguous label is reserved for short single-word inputs that are ALSO a real command name (`ls`, `git`, `npm`) — those are the only place the user might be unsure.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Kind

type Kind int

Kind is the classification result.

const (
	// KindNL is natural language (the agent path). Default.
	KindNL Kind = iota
	// KindShell is a literal shell command (the $hell path).
	KindShell
	// KindAmbiguous looks like both. Surface a hint, let user pick.
	KindAmbiguous
)

func Classify

func Classify(input string) Kind

Classify returns the kind for a single input line. Empty / whitespace input returns KindNL (no signal to act on).

func (Kind) String

func (k Kind) String() string

Jump to

Keyboard shortcuts

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