termfc 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +100 -0
  3. package/dist/cli.js +3534 -0
  4. package/package.json +49 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 juunghyun
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,100 @@
1
+ # ⚽ termfc
2
+
3
+ **FIFA World Cup 2026™ live text commentary in your terminal.**
4
+
5
+ Live scores, a ticking match clock, minute-by-minute commentary in Korean or
6
+ English, goal celebrations in ASCII — without leaving your terminal.
7
+
8
+ ```
9
+ ████████╗███████╗██████╗ ███╗ ███╗███████╗ ██████╗
10
+ ╚══██╔══╝██╔════╝██╔══██╗████╗ ████║██╔════╝██╔════╝
11
+ ██║ █████╗ ██████╔╝██╔████╔██║█████╗ ██║
12
+ ██║ ██╔══╝ ██╔══██╗██║╚██╔╝██║██╔══╝ ██║
13
+ ██║ ███████╗██║ ██║██║ ╚═╝ ██║██║ ██████╗
14
+ ╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═════╝
15
+ ```
16
+
17
+ ## Quick start
18
+
19
+ ```bash
20
+ npx termfc # list live + upcoming matches, pick one to join
21
+ npx termfc demo # offline demo (Portugal vs Spain, R16 2026) — try this first
22
+ ```
23
+
24
+ or install globally:
25
+
26
+ ```bash
27
+ npm i -g termfc
28
+ termfc
29
+ ```
30
+
31
+ Requires Node.js >= 20. Zero runtime dependencies (single bundled file).
32
+
33
+ ## Usage
34
+
35
+ ```
36
+ termfc live + upcoming matches, pick one to join
37
+ termfc live matches in progress
38
+ termfc schedule schedule window (recent results + next matches)
39
+ termfc watch <team|id> join a match directly (termfc watch KOR)
40
+ termfc replay [file] replay a recorded match (no arg: list recordings)
41
+ termfc demo bundled offline demo match
42
+
43
+ --lang ko|en commentary language (default: ko, persisted)
44
+ --speed N replay/demo speed multiplier
45
+ --no-anim skip entrance/goal animations
46
+ --no-record don't record watched matches
47
+ ```
48
+
49
+ While watching: `q` quit · `s` skip animation.
50
+
51
+ ## What you get
52
+
53
+ - **Live commentary** — every shot, save, corner, foul, card, VAR call and
54
+ goal, timestamped with the match clock (`90'+1'`), in Korean (FIFA's
55
+ official Korean feed) or English.
56
+ - **Ticking clock** — sources report whole minutes; termfc interpolates a
57
+ per-second clock locally, freezes it at half-time, and shows stoppage time.
58
+ - **Score header + win probability** — live score always pinned on top, with
59
+ a Poisson-model win/draw/loss estimate (derived from pre-match odds when
60
+ available; clearly labelled as an estimate).
61
+ - **Goal celebrations** — ASCII fireworks with the scorer's name; entrance
62
+ animation with both flags and the trophy when you join a match.
63
+ - **Replays** — every watched match is recorded locally as JSONL and can be
64
+ replayed at any speed. A finished R16 match ships with the package as an
65
+ offline demo.
66
+ - **Resilience** — FIFA's public endpoints are the primary source with ESPN
67
+ as an automatic fallback (sticky per session, duplicate-goal suppression on
68
+ switch). Network loss keeps the last snapshot on screen with a retry
69
+ countdown — never a blank screen.
70
+
71
+ ## Data sources & disclaimers
72
+
73
+ termfc reads the same public, keyless JSON endpoints that fifa.com and
74
+ espn.com use in the browser. It is **not affiliated with or endorsed by FIFA
75
+ or ESPN**. These endpoints are undocumented and may change or disappear at
76
+ any time — the adapter layer isolates that risk, and polling is deliberately
77
+ polite (~10s intervals, identified User-Agent). Match facts (scores, times,
78
+ events) are not copyrightable; ESPN's prose commentary is never
79
+ redistributed — sentences for the ESPN fallback are generated locally from
80
+ structured event data.
81
+
82
+ ## Development
83
+
84
+ ```bash
85
+ npm install
86
+ npm test # vitest — unit + real-response fixture tests
87
+ npm run build # tsup -> dist/cli.js (single ESM file)
88
+ node dist/cli.js demo
89
+ node scripts/dump-fifa-events.mjs # refresh event-code map from live data
90
+ node scripts/make-demo.mjs # rebuild the bundled demo match
91
+ ```
92
+
93
+ Architecture (ports & adapters): `core/` pure logic (model, diff, clock,
94
+ state machine, win probability) · `data/` FIFA/ESPN adapters + failover
95
+ behind one provider port · `engine/` polling loop · `ui/` self-contained ANSI
96
+ renderer (no TUI framework) · `replay/` JSONL recorder/player.
97
+
98
+ ## License
99
+
100
+ MIT