Documentation
¶
Index ¶
- Constants
- Variables
- func ConfigureProcessGroup(command *exec.Cmd)
- func EnableFrontendOrphanCleanup(ctx context.Context) (context.Context, error)
- func ExpandMaxTokensOption(arguments []string) []string
- func InspectSource(ctx context.Context, path string, bytes []byte) (string, error)
- func ParseLineRange(span string) (int, int, error)
- func ParseMaxTokens(value string) (int, error)
- func SymbolQueryModes(args []string) ([]string, error)
- func WithHostProcessGroup(ctx context.Context) context.Context
- type ExecutionOutput
- type OmittedOutput
- type Plugin
- type ReaderOptions
- type Snapshot
- type Tool
Constants ¶
const ( APIVersion = "mekugi-tool-plugin/v1" ExecutionOutputBudgetBytes = 16 << 20 )
const MaxOutputTokens = 15_500
const MaxTokensArgumentError = "--max-tokens requires one integer from 1 to 15500 and cannot repeat"
Variables ¶
var LineRangePattern = regexp.MustCompile(`^[0-9]+[:-][0-9]+$`)
LineRangePattern identifies range operands before command-specific path handling.
Functions ¶
func ConfigureProcessGroup ¶
ConfigureProcessGroup makes command cancellation terminate descendants that inherited the command's standard streams instead of leaving Wait blocked.
func EnableFrontendOrphanCleanup ¶
EnableFrontendOrphanCleanup is for a dedicated authenticated frontend process, not a router or test process that owns unrelated child commands.
func ExpandMaxTokensOption ¶ added in v0.3.0
Expand only the next option, never operands owned by a command or -- boundary.
func InspectSource ¶ added in v0.3.0
InspectSource uses the same structural renderer as inspect_file on a caller's already-opened snapshot, without reopening a path or executing a frontend.
func ParseLineRange ¶ added in v0.3.0
ParseLineRange parses canonical inclusive endpoints. Callers impose their own numeric ceiling; zero starts remain available for mcat's first-row convention.
func ParseMaxTokens ¶ added in v0.3.0
func SymbolQueryModes ¶ added in v0.3.0
SymbolQueryModes projects the native parser's query modes for command display. It validates the complete invocation without loading sources or running resolvers.
Types ¶
type ExecutionOutput ¶
type ExecutionOutput struct {
OmittedOutput *OmittedOutput `json:"omittedOutput,omitempty"`
FailureClass string `json:"failureClass,omitempty"`
Stdout string `json:"stdout"`
Stderr string `json:"stderr"`
ExitCode int `json:"exitCode"`
}
func ExecuteBuiltin ¶
ExecuteBuiltin runs bundled readers in the authenticated frontend process. Configured plugins remain isolated JavaScript hosts, never native executors.
func FormatOutput ¶
func FormatOutput(ctx context.Context, arguments []string) (ExecutionOutput, error)
FormatOutput formats bounded output entirely in the frontend process.
type OmittedOutput ¶
type OmittedOutput struct {
// Host-owned mcat provenance, not part of the plugin wire protocol.
SourceRow uint64 `json:"-"`
MaxTokens int `json:"-"`
StdoutKind string `json:"stdoutKind,omitempty"`
StderrKind string `json:"stderrKind,omitempty"`
Stdout string `json:"stdout"`
Stderr string `json:"stderr"`
}
type ReaderOptions ¶ added in v0.3.0
func ParseReaderOptions ¶ added in v0.3.0
func ParseReaderOptions(args []string, allowTail bool, defaultBudget int, takesValue string) (ReaderOptions, []string, error)
ParseReaderOptions removes shared reader options and retains the -- boundary and command-specific operands, including the value of takesValue. Source: plugins/common.ts:48:99@[543de4f3] readerOptions
type Tool ¶
type Tool struct {
Specification json.RawMessage `json:"specification"`
NativeExecutor string `json:"nativeExecutor,omitempty"`
}