feat: add FinalToken v1 for Claude and Codex usage (#2)

FinalToken v1: a NativeAOT tray app for Windows 11 and CachyOS that tracks
Claude Code and Codex usage and limits through their CLIs only, with no
provider sign-in and no tokens (R1-R7, D1-D11).

- Core: incremental collectors for Claude transcripts and Codex
  rollouts, limit probes through `claude -p /usage` and
  `codex app-server`, a journaled history store, the refresh engine,
  pace and popup decisions, and the snapshot.json contract.
- App (Avalonia): stats panel with limit bars, pace, projections, token
  totals, charts, limit history and breakdowns; tray, settings,
  non-activating pace popups, single-instance activation, start with
  the OS, and the Off/Ask/Automatic Stream Deck plugin install.
- Stream Deck plugin (SDK v2, NativeAOT) for Elgato and OpenDeck.
- finaltoken-cli, tools/publish.py, the documentation check and the
  agent review workflow.

Closes #1
This commit was merged in pull request #2.
This commit is contained in:
2026-10-14 22:11:19 +02:00
parent 6d67f157a5
commit f8afd11679
106 changed files with 6583 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
"""Check release assembly and manifest versions without invoking NativeAOT."""
import contextlib
import io
import json
from pathlib import Path
import tempfile
import unittest
from unittest.mock import patch
import xml.etree.ElementTree as ET
import publish
class PublishTests(unittest.TestCase):
def test_published_manifest_uses_shared_version(self):
def fake_publish(command, **kwargs):
stage = Path(command[command.index('-o') + 1])
stage.mkdir(parents=True)
(stage / (stage.name + '.exe')).write_bytes(b'synthetic executable')
with tempfile.TemporaryDirectory(prefix='finaltoken-publish-test-') as temporary:
output = Path(temporary) / 'package'
with patch('sys.argv', ['publish.py', 'win-x64', '--out', str(output)]), \
patch.object(publish.subprocess, 'run', side_effect=fake_publish), \
contextlib.redirect_stdout(io.StringIO()):
publish.main()
version = ET.parse(Path(publish.__file__).resolve().parent.parent / 'Directory.Build.props').findtext('.//Version')
self.assertIsNotNone(version)
manifest = json.loads((output / 'streamdeck/de.finalfactory.finaltoken.sdPlugin/manifest.json').read_text(encoding='utf-8'))
self.assertEqual(version + '.0', manifest['Version'])
if __name__ == '__main__':
unittest.main()