Skip to main content

Code map

A condensed copy of CODEMAP.md, which is the authority: it is checked against the tree by npm run map:check and also carries the "what a change has to touch" table and the rules the conventions page summarises. Paths are under app.gap.Tsum/. The long form of every row is the file's own header comment.

Source — src/

In bundle order.

FileOwns
shared.d.tsTypes in all three compilations: SettingKey, Settings, SkillType, BubbleStrategy, RecordKey, Locale.
globals.d.tsThe host API declarations, the shared value shapes, and interface Tsum — every prototype method's signature.
settings.d.tsThe settings page schema (SettingSpec, GroupSpec, TabSpec, RowKey), Preset, PageMessage. Both page compilations.
strings.d.tsUiText, and UiStrings mapped over it. Both page compilations.
i18n.tsThe page-side i18n runtime; resolves at render time.
uiEn.ts, uiZhTw.tsOne language each, keyed by UiText. English must be complete.
taskController.tsTsumTaskController, the cooperative scheduler. Five consecutive throws from one job restart the app.
runPlan.tsThe run's task table, in the game and settings compilations, so the Run order card lists exactly what runs.
state.tsThe two script-wide globals: ts, gTaskController.
utils.tsisSameColor, absColor, channelDiff.
data.tsEvery coordinate and tuning constant, no logic: the page fingerprints, the navigation plans, one table per screen a chore walks. Shared tables only.
logEvents.tsLog — the log event vocabulary, one const enum per component.
scriptEvents.tsEmit — the emitted event vocabulary.
logs.ts, logsEn.ts, logsZhTw.tsThe log sentence registry and one table per language.
logging.tsThe structured logger: the JSONL record, the correlation ids, the flood guard, the ring of recent records a report carries.
pathfinding.tsBoard reading and chain planning, no tapping: circle detection, clustering, calculatePaths, the chroma colour model.
pages.tsPageRouter and gPages: score, observe, react, detect, peek, navigate, the page sets, and perform.
tsum.tsThe Tsum object: the fields, the geometry, the capture and touch wrappers, the coordinate conversions. Reopened by most files below.
waits.tssleep, sleepUntil, settleScreen, settleBoard, mayContinue.
appLifecycle.tsIs the game in front, getting it there, and the waits either side of a restart.
board.tsscanBoardQuick, link, and what the Bubble Strategy setting comes to.
play.tsOne round, start to finish: proving game over, the dead-scan block, the Max Round Duration cap.
mail.tsThe mailbox chore.
hearts.tsThe send-hearts sweep and the sent/received tally.
levelCap.tsThe level-cap sweep. awaitPage is shared with boxes.ts.
boxes.tsThe Box Buying chore.
fever.tsFever time: one look with no memory, plus gFever, the debounced state and its start/end broadcast.
lorcana.tsThe Lorcana transformation: the medallion reader, the state with hysteresis, the ink-stone bubbles.
skills/One file per skill plus skillCore.ts — the table below.
clickAssist.tsManual-play mode: draw a chain where the user taps.
dialogs.tsAndroid system dialogs, and the checkStall watchdog.
corpus.tsCapture of unrecognised screens, rate-limited.
report.tsThe issue-report folder a player sends in, and ReportTriggers.
walkthrough.tsThe walkthrough recorder: watches rather than plays; feeds docs/transitions.json.
roundStats.tsThe per-round CSV, template digit reading, the row id minted at the whistle.
tsums.datGenerated, not part of the bundle: the tsum library, deployed beside it.
forecast.tsWhat the script is about to do, without doing it. Read forward only.
pageHandlers.tsEvery reaction to a page, one subscription each; reading it top to bottom is the dispatch order.
index.tsThe entry point: start() / stop() / requestStop(), the run lifecycle, the globals the settings page evaluates by name. Kept thin.
quickbar.tsThe engine half of the Quick Bar, and LiveSettings.
settings.tsThe settings page: the tabs schema, rendering, persistence, share codes, the Run order card, presets.
index.html, index.cssThe settings page shell, one <template> per piece of structure.
releaseStatus.tsReleaseStatus and the channel floor: what this build may offer.
skillOptions.ts, bubbleOptions.tsThe two dropdown lists, written once for both pages.
presets.tsNamed configurations, and the store both pages read them from.
qrCode.tsA QR encoder for the share code. Settings compilation only.
quickbarPage.tsThe Quick Bar's page script: wiring only, by data-key.
quickbar.html, quickbar.cssThe Quick Bar's whole appearance.

Skills — src/skills/

FileSkillTypeWhat makes it unlike the others
skillCore.tsThe registry and everything shared: gauge read, fever hold-off, activation taps, useSkill, auto-tap, and the declarations a skill makes about the play loop.
burst.tsBurst, BurstBubblesA bare tap activates, so the play loop may fire these blind between chains.
pairTsum.tsPairTsumTwo-button activation.
donald.tsDonald, HolidayDonald
lukeJ.tsJediLukeAimed taps.
marie.tsMarie, MissBunny, Rabbit
moana.tsMoanaThe smallest.
mickeyH2015.tsHornHatMickey
snowWhite.tsSnowWhite
cinderella.tsCinderellaIts own useCinderellaSkill.
woody2.tsSheriffWoodyA drag choreography.
cabbageMickey.tsCabbageMickeyFace-colour probe.
cptLy.tsCptLightyear, CptLightyear120Timing tables, one per frame rate.
lightningMcQueenPlus.tsLightningMcQueenPlus
formalBeast.tsFormalBeastSteers the play loop: reads his twin gauge and picks chains by colour.
tiaraMinniePlus.tsTiaraMinniePlusThe largest: board signature, cloud sampling, candidate scoring.
coronationElsa.tsCoronationElsaThe only choreography that plays: a timed freeze window planned off one capture.
lorcanaAurora.tsLorcanaAuroraTwo skills with one gauge; after the card, the bubbles become a standing claim.
gaston.tsGastonOne snake down the pile from a top corner; ignores the chain settings.
rapunzelPlus.tsRapunzelPlusThe one chain that ignores colour, with its own paced drag.

Tooling — tools/

DirectoryWhatEntry point
runtime/The Node stand-in for the host: load.js, host.js, imageio.js, matcher.js, transitions.js.required by the rest
pageDocs/Renders PAGE_DISPATCH.md from the compiled router.pages:docs, pages:docs:check
eventDocs/Renders EVENTS.md from the emitEvent call sites; reads the TypeScript program.events:docs, events:docs:check
dispatchEval/Golden traces for the dispatch queue and the scheduler.dispatch:eval, dispatch:update
codemap/Checks CODEMAP.md against the tree; symbols.js is the reusable symbol extractor.map:check
i18n/What each language is missing.i18n:check
liveSettings/When each setting reaches a run in progress, by driving the bundle.live:check
release/Cuts a release into the catalogue; review.js is the note gate.release:alpha, release:beta, release:production
build/The build as a dependency graph; zip.js the deterministic archive writer.build, buildAndAdb
inline/, minify/Fold the pages into single files; whitespace-only terser.by the build

Where a name lives

A prefix usually settles it; map:check enforces every row.

NameDefined in
Tsum#* — any ts.foo() methodthe file that owns the behaviour; every signature also in globals.d.ts
Tsum#task* — the scheduled jobsplay.ts, mail.ts, hearts.ts, levelCap.ts, boxes.ts, appLifecycle.ts, clickAssist.ts, walkthrough.ts
TaskName, JobPriority, TaskSpec, runTaskTablerunPlan.ts
Config, Button, Page, PageName, PageProfiles, NavPlans, PageAnchor, PageRoutesdata.ts
PageRouter#*, PageKind, PageRole, PageCategory*, gPagespages.ts
PageDef, PageSubscription, PageEvent, PageStep, PageRouteglobals.d.ts
Fever*, gFeverfever.ts
skill*, Skill*skills/skillCore.ts, tsum.ts, globals.d.ts, shared.d.ts, skillOptions.ts
quickBar*, onPause, LiveSettingsquickbar.ts
qb*, onGapStatequickbarPage.ts
applyLiveSettings / pushLiveSettings, pullLiveSettingsindex.ts / settings.ts
preset*, Preset*presets.ts, settings.ts, settings.d.ts
stats*, myTsum*roundStats.ts
maxRound*, RoundCoast*, watchRoundEndplay.ts
Box*, buyBox*boxes.ts, shared.d.ts, data.ts
dialog*, Stall*dialogs.ts
report*, Report*report.ts
Log, EmitlogEvents.ts, scriptEvents.ts
logInfo, logWarn, logError, logDebug, LogEvent, LogFieldslogging.ts (the settings page has its own small logInfo family)
SHARE_*, share*, tabs, SettingSpecsettings.ts, settings.d.ts
qr*, QR_*qrCode.ts
UiText, UiStrings, i18n*strings.d.ts, i18n.ts

Two that are not where they sound like they are: page subscriptions live in pageHandlers.ts, never in pages.ts; and a skill's tuning tables live in its own file under a "Tuning data" heading, not in data.ts.