KetraTerm
API · DevelopmentAll versions

fromSources

fun fromSources(sources: List<TerminalCompletionSourceEntry>, commandSpecs: List<TerminalCommandSpec> = TerminalCommandSpecs.defaults(), learningStore: TerminalCompletionLearningStore? = null, sourceFailureHandler: TerminalCompletionSourceFailureHandler = TerminalCompletionSourceFailureHandler.SYSTEM_LOGGER): TerminalCompletionEngine

Creates a deterministic merged engine from prioritized completion sources.

Provider-local ranks are fused by projected command outcome with bounded source priors, command-line context, and learned statistics. Source exceptions are reported and contribute empty results; unexpected errors are reported, fail collection, and cancel sibling sources. Source-local cancellation contributes an empty result; request cancellation cancels all work.

Return

merged completion engine.

Parameters

sources

prioritized source registrations.

commandSpecs

immutable command catalog used to classify the active command-line position for ranking. Callers must not mutate this list while the engine is alive.

learningStore

optional shared in-memory learning store. The engine reads its immutable published snapshot and performs no host I/O.

sourceFailureHandler

diagnostic sink for non-cancellation source failures.


fun fromSources(messages: TerminalCompletionMessages, sources: List<TerminalCompletionSourceEntry>, commandSpecs: List<TerminalCommandSpec> = TerminalCommandSpecs.defaults(), learningStore: TerminalCompletionLearningStore? = null, sourceFailureHandler: TerminalCompletionSourceFailureHandler = TerminalCompletionSourceFailureHandler.SYSTEM_LOGGER): TerminalCompletionEngine

Creates a merged engine with localized learned and observed descriptions.

messages changes generated presentation only. Supply a localized catalog through commandSpecs and the same text to source factories for their fallback descriptions. All token, range, source identity, and ranking behavior follows fromSources.