Skip to main content

Repository tour

game-automation-scripts/
├── CODEMAP.md the index: which file owns what, which document answers what
├── CONTRIBUTING.md the short version of this site
├── LICENSE · NOTICE Apache-2.0, and what was inherited from where
├── .github/workflows/ builds and publishes this site
├── website/ this site (Docusaurus)
└── app.gap.Tsum/ the only package: the Disney Tsum Tsum script
├── src/ the script -- concatenated into one bundle, no imports
│ └── skills/ one file per skill, plus the shared core
├── tools/ the build and what runs inside it, the checks, the release
├── docs/ data the generated documents are built from
├── build/ · dist/ build output, git-ignored
├── config.json release identity: the game, one entry per channel
├── package.json the version lives here and nowhere else
├── tsconfig*.json three compilations (game, settings page, Quick Bar page)
└── build.sh · build.ps1 · debug_deploy.ps1

CODEMAP.md first

The repository's own rule is read CODEMAP.md before searching the tree. It is a set of tables: one row per source file, one per skill, one per tool directory, one per name family (Tsum#*, Page*, skill*…), then the rules that are silent when broken and a table of what a change has to touch. Every row is checked against the tree by npm run map:check, so it is current. This site's code map is a condensed copy; the original is the authority.

src/ in five groups

The bundle is one global scope, so files are best understood by what they own rather than by what they import (they import nothing). In load order:

GroupFilesOwns
Types and vocabulariesshared.d.ts, globals.d.ts, settings.d.ts, strings.d.ts, logEvents.ts, scriptEvents.tsThe host API declarations, interface Tsum, and every const enum the code names things by: SettingKey, SkillType, PageName, Log, Emit.
The runindex.ts, runPlan.ts, taskController.ts, state.tsstart() / stop(), the table of scheduled jobs, the cooperative scheduler, the two globals ts and gTaskController.
Seeing the screendata.ts, pages.ts, pageHandlers.ts, forecast.ts, dialogs.ts, corpus.ts, walkthrough.tsEvery coordinate and fingerprint (data.ts), the router that decides which screen is up (pages.ts), every reaction to one (pageHandlers.ts), and the odd cases: system dialogs, unknown screens, the recorder.
Playingtsum.ts, waits.ts, appLifecycle.ts, board.ts, pathfinding.ts, play.ts, fever.ts, lorcana.ts, skills/, clickAssist.ts, roundStats.ts, mail.ts, hearts.ts, levelCap.ts, boxes.tsThe Tsum object (the world one run is played in), the waits, reading the board and drawing chains, one round start to finish, the skills, and the chores.
The two pagessettings.ts, index.html, index.css, quickbar.ts, quickbarPage.ts, quickbar.html, quickbar.css, presets.ts, skillOptions.ts, bubbleOptions.ts, releaseStatus.ts, i18n.ts, uiEn.ts, uiZhTw.ts, qrCode.ts, logs.ts, logsEn.ts, logsZhTw.ts, logging.ts, report.ts, utils.tsThe settings page and the Quick Bar (separate compilations), the lists both share, translations, the logger, and the issue report.

The entry point is deliberately thin. Its header comment says why:

app.gap.Tsum/src/index.ts
loading...

tools/

Everything here runs in Node on the PC against the built bundle, never on the device.

DirectoryWhat it doesRun with
tools/build/The build, as a dependency graph of stepsnpm run build
tools/runtime/A Node stand-in for the host: loads build/index.js in a vm and shims the ~15 natives under it. Every offline tool goes through this, so the code under test is the production coderequired by the others
tools/pageDocs/Renders PAGE_DISPATCH.md by asking the compiled router for its real dispatch ordernpm run pages:docs
tools/eventDocs/Renders EVENTS.md from the emitEvent call sitesnpm run events:docs
tools/dispatchEval/Golden traces for the dispatch queue and the scheduler: a change for page A that moved page B's trace fails herenpm run dispatch:eval
tools/liveSettings/When each setting reaches a run in progress, checked by driving the bundlenpm run live:check
tools/codemap/Checks CODEMAP.md against the treenpm run map:check
tools/i18n/What each language is missingnpm run i18n:check
tools/inline/, tools/minify/Fold the pages into single files; strip whitespace from what shipsby the build
tools/release/Cut a release into the cataloguenpm run release:<channel>

docs/

Not documentation — data. transitions.json is the observed page graph (which screen followed which, recorded by the walkthrough mode) and media.json a clip library. PAGE_DISPATCH.md's sitemap is drawn from the first.