How scriptoriumlab/scriptorium-inkstone works
Inkstone is a platform-independent input-method service: Brush forwards key events, Inkstone updates authoritative composition and candidate state, and Ink receives render updates or reports user actions. The main path runs from the IPC server through the session orchestrator and engine manager to the Pinyin engine, which segments input and looks up dictionary entries to assemble candidates. Managers coordinate selection and notification; the server translates protocol messages and bridges candidate state to the UI. The README documents ranking, paging, and committed/uncommitted state, but sampled code does not establish complete implementations for all of them. External links follow documented protocol boundaries.
Main entry points: server.cpp IPC server · pinyin_engine.cpp Pinyin engine · session_orchestrator.cpp Session orchestrator · engine_manager.cpp Engine manager
Components 13
Runtime and IPC
- Application entry
inkstone/app.cpp - IPC server
inkstone/server.cpp - UI bridge
inkstone/server.cpp
Session orchestration
- Session orchestrator
manager/src/session_orchestrator.cpp - Engine manager
manager/src/engine_manager.cpp - Candidate manager
manager/src/candidate_manager.cpp
Input capabilities
- Engine interface
core/include/scriptorium/core/engine/input_engine.h - Pinyin engine
core/src/engine/pinyin_engine.cpp - Pinyin tokenizer
core/src/tokenizer/tokenizer.cpp - Dictionary lookup
core/src/dictionary/dictionary.cpp - Pinyin entries
data/pinyin_dictionary.txt
External processes
- Brush adapter
- Ink presentation
Connections 15
- Application entry → IPC server: starts
- Brush adapter → IPC server: sends key events
- IPC server → Session orchestrator: dispatches key events
- Session orchestrator → Engine manager: updates engine
- Engine manager → Engine interface: calls engine
- Pinyin engine → Engine interface: implements
- Pinyin engine → Pinyin tokenizer: segments input
- Pinyin engine → Dictionary lookup: looks up entries
- Pinyin engine → Pinyin entries: loads entries
- Session orchestrator → Candidate manager: updates candidates
- Candidate manager → UI bridge: notifies observer
- UI bridge → Ink presentation: sends render state
- Ink presentation → IPC server: sends user action
- IPC server → Session orchestrator: requests selection
- IPC server → Brush adapter: returns instruction