AI as a first-class UI layer
SKOne treats model-backed surfaces like any other component: typed contracts, explicit states, testable behaviour.
The provider contract
Components depend on SKAIProvider, never on a vendor SDK. Swapping backend never changes UI code.
interface SKAIProvider {
suspend fun complete(request: SKAIRequest): SKAIResponse
fun stream(request: SKAIRequest): Flow<SKAIChunk>
val capabilities: SKAICapabilities
}AI components (2.0)
Planned for the SKOne 2.0 AI milestone, designed against the provider contract above.
SKAIChat
Streaming conversation surface with message states, retries and tool call rendering.
SKAIChat(
provider = SKAIProvider.current,
messages = state.messages,
onSend = viewModel::send
)SKPromptField
Prompt input with token counting, attachments and slash-command completion.
SKPromptField(
value = prompt,
onValueChange = { prompt = it },
maxTokens = 4_096
)SKVoiceInput
On-device speech capture with waveform feedback and partial transcript streaming.
SKVoiceInput(
locale = Locale.getDefault(),
onTranscript = { prompt = it }
)SKAISuggestion
Inline suggestion chips generated from the current form or screen context.
SKAISuggestion(
context = SKAIContext.of(formState),
onAccept = form::apply
)SKAILoading
Model-aware loading state that distinguishes thinking, streaming and tool execution.
SKAILoading(phase = SKAIPhase.Streaming)SKAIAgent
Agent runtime host binding tools, memory and a provider to a composable surface.
SKAIAgent(
tools = listOf(SearchTool, InvoiceTool),
memory = SKMemory.session(),
provider = SKAIProvider.current
)