Store
AXIS Solid store: AppState shape, activePlugins, persistence rules, logging, and alignment helpers.
This page
The Solid store is the control-plane nexus of AXIS. Plugins read configuration from it; UI binds reactively; persistence snapshots a safe subset to pynescript.axis.v1.
Abstract
| Export | Role |
|---|---|
store / setStore | createStore<AppState> |
persist | Debounced localStorage write |
setActivePlugin | Kinded selection + flat field mirrors |
appendLog / status helpers | Operator-visible telemetry |
STORAGE_KEY | pynescript.axis.v1 |
| MCP | src/mcp/dispatch.ts reads/writes allowlisted store paths; snapshots redact secrets |
Types: src/store/types.ts.
Conceptual model
Rendering…
AppState map
| Field | Persistence | Notes |
|---|---|---|
bars | no | Session history |
symbol, interval, exchange | yes | Market context |
source, engine | yes | Flat mirrors |
endpoint | yes | Server engine base URL |
activePlugins | yes | Canonical four-tuple |
pluginsConfig | yes | Per-plugin fields |
scripts, panes | yes | Indicator list + layout |
live | partial | streamId important |
theme | yes | dark/light |
editor, watchlist, panels | yes | Chrome geometry |
stream.status | yes/volatile | Connection hint |
status, statusMessage, lastRunMs | yes* | UX; ok to restore |
lastRun | no | Forced null on hydrate |
logs | no | Forced empty |
profilerEnabled | yes | Editor profiler (line % when engine provides profile) |
inlineDebugEnabled | yes | End-of-line Debug chips from last-run logs |
debugPinsEnabled | yes | Chart pin markers + editor pin gutter |
editorRulerEnabled | yes | 80-col guide (default on) |
editorWrapEnabled | yes | Soft line wrap (default on; stats strip wrap toggle) |
panelChrome / alertsPanel / layerPanel / dataViewPanel | yes | Dock chrome (side-by-side left/right) |
pineTablesLocation | yes | Per-script Pine table placement (chart default / bottom Tables panel) |
chartLayout / savedLayouts | yes | Multi-chart grid + named layouts |
compare | prefs yes | Second-symbol overlay (bars ephemeral) |
drawingTool | reset cursor | On hydrate |
drawings / drawingPrefs / drawingUi | yes | User annotations + toolbar prefs |
selectedDrawingId | no | Ephemeral selection |
*Status fields may restore but boot also appends fresh logs.
Defaults (product)
Representative defaults from store:
| Key | Default |
|---|---|
| symbol | BTCUSDT |
| interval | 1d |
| source / active source | binance-rest |
| stream | binance-ws |
| engine | server |
| storage | local |
| endpoint | demo/API host or localhost depending on build era |
| editor width | 460 docked open |
| watchlist | majors on Main, 15s refresh; named lists persist |
Treat demo endpoints as overridable—operators should set local URLs in desk topology.
setActivePlugin
setActivePlugin(kind, id):
activePlugins[kind] = id
if source → source = id
if engine → engine = id
if stream → live.streamId = id
persist()
Prevents registry/store split brain (architecture overview).
Logging
appendLog(level, message, source?)
levels: info | ok | warn | error
MAX_LOGS = 500
setStatus maps app status to log levels for important transitions.
Legacy path (removed)
The pre-Solid vanilla state.js shell was removed in 2.21.0 (see legacy shell). Product AXIS uses the Solid store only — there is no dual-write target anymore.
Invariants
- Hydrate never restores
lastRunorlogs. - Persist strips
bars. - Key migration is read-repair (state namespaces).
pluginsConfigkeys prefer`${'{'}kind{'}'}:${'{'}id{'}'}`.- Store is not a plugin registry—ids must exist in registry to function at runtime.
Failure modes
| Mode | Behavior |
|---|---|
| JSON parse fail | Defaults |
| localStorage throws | No-op persist |
| Unknown plugin id | UI may show id; run/load fails at getActive* |
| Oversized drawings | Quota risk—export/clear |
Testing notes
- Import
tests/setup.tsfor localStorage stubs - Unit coverage includes store + migration patterns
- Do not require real IDB in pure store tests