Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
155bdba
docs: design Telegram Mini App runtime
Jul 17, 2026
f9526d9
docs: plan Telegram Mini App implementation
Jul 17, 2026
d1814ec
feat: verify Telegram Mini App launches
Jul 17, 2026
c5d0e38
feat: authenticate Telegram Mini App users
Jul 17, 2026
14e1dba
feat: add Telegram Mini App bootstrap clients
Jul 17, 2026
ea08f2d
fix: harden Telegram auth transports
Jul 17, 2026
c6c0689
fix: test oversized Mini App envelopes
Jul 17, 2026
687a6b6
feat: add Telegram Mini App runtime
Jul 17, 2026
a77ed8f
fix: gate Telegram runtime capabilities
Jul 17, 2026
c8d5910
fix: harden Telegram runtime subscriptions
Jul 17, 2026
e0ced1a
fix: serialize Telegram runtime cleanup
Jul 17, 2026
c17503d
feat: build shared Telegram Mini App shell
Jul 17, 2026
b908c28
fix: harden shared application builds
Jul 17, 2026
ee5970c
fix: recover interrupted application builds
Jul 17, 2026
b95146f
fix: reject symlinked build locks
Jul 17, 2026
358ad97
fix: publish build locks atomically
Jul 17, 2026
82fc30b
fix: recover abandoned build claims
Jul 17, 2026
e4b1d0f
fix: reconcile build recovery quarantines
Jul 17, 2026
e11b34f
feat: bootstrap Salvo inside Telegram
Jul 17, 2026
aaae490
fix: align Telegram Mini App navigation
Jul 17, 2026
9d64a3b
fix: distinguish Mini App service failures
Jul 17, 2026
b2dae80
fix: serialize Telegram runtime state
Jul 17, 2026
6bfefa2
fix: preserve Telegram startup state
Jul 17, 2026
745c194
fix: restore haptic runtime guard
Jul 17, 2026
24c2bd7
feat: open Telegram rooms and replays
Jul 17, 2026
21dfca2
fix: retain Telegram launch intent
Jul 17, 2026
9f5fd68
fix: preserve Telegram share context
Jul 17, 2026
5851140
fix: preserve online connection status
Jul 17, 2026
6b8c663
fix: preserve online error state
Jul 17, 2026
d9636b8
feat: polish Telegram Mini App experience
Jul 17, 2026
83dbe4d
fix: scope Telegram Mini App polish
Jul 17, 2026
9fa5547
fix: harden Telegram Mini App layout
Jul 17, 2026
a2c4d1f
test: enforce phone viewport geometry
Jul 17, 2026
9094488
test: harden Chrome layout harness
Jul 17, 2026
0502129
test: observe Chrome navigation failures
Jul 17, 2026
7b1c778
docs: document Telegram Mini App delivery
Jul 17, 2026
3268ef0
docs: clarify Telegram shell SDK loading
Jul 17, 2026
b0e95e5
test: restore core coverage gate
Jul 17, 2026
26be176
fix: prevent online self-play rating abuse
Jul 17, 2026
235f33f
ci: gate native builds on web verification
Jul 17, 2026
cdd5367
test: cover critical build publication paths
Jul 17, 2026
dc75943
test: cover critical worker routes
Jul 17, 2026
12c62d0
test: enforce critical per-file coverage
Jul 17, 2026
ea29fd2
Merge remote-tracking branch 'origin/main' into codex/telegram-mini-a…
Jul 17, 2026
1eb4b94
test: stabilize build coverage gate
Jul 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/mobile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,46 @@ jobs:
run: npm run coverage

- name: Build
env:
SALVO_BUILD_ID: ${{ github.sha }}
run: npm run build

- name: Verify Telegram Mini App artifacts
env:
SALVO_BUILD_ID: ${{ github.sha }}
shell: bash
run: |
set -euo pipefail
test -f dist/telegram/index.html
sdk_occurrences="$(
awk '
{
remainder = $0
token = "telegram-web-app.js"
while ((position = index(remainder, token)) > 0) {
count += 1
remainder = substr(remainder, position + length(token))
}
}
END { print count + 0 }
' dist/telegram/index.html
)"
test "$sdk_occurrences" -eq 1
! grep -Fq 'telegram-web-app.js' dist/index.html
web_app="$(grep -oE 'app\.[a-f0-9]{10}\.js' dist/index.html)"
telegram_app="$(grep -oE 'app\.[a-f0-9]{10}\.js' dist/telegram/index.html)"
test "$web_app" = "$telegram_app"
test -f "dist/$web_app"
web_styles="$(grep -oE 'styles\.[a-f0-9]{10}\.css' dist/index.html)"
telegram_styles="$(grep -oE 'styles\.[a-f0-9]{10}\.css' dist/telegram/index.html)"
test "$web_styles" = "$telegram_styles"
test -f "dist/$web_styles"
grep -Fq "buildId: \"$SALVO_BUILD_ID\"" dist/index.html
grep -Fq "buildId: \"$SALVO_BUILD_ID\"" dist/telegram/index.html

android:
runs-on: ubuntu-latest
needs: web
steps:
- name: Checkout
uses: actions/checkout@v7
Expand All @@ -62,6 +98,8 @@ jobs:
run: npm ci

- name: Sync native projects
env:
SALVO_BUILD_ID: ${{ github.sha }}
run: npm run mobile:sync

- name: Test, lint, and assemble Android
Expand All @@ -87,6 +125,7 @@ jobs:

ios:
runs-on: macos-26
needs: web
steps:
- name: Checkout
uses: actions/checkout@v7
Expand All @@ -104,6 +143,8 @@ jobs:
run: npm ci

- name: Sync native projects
env:
SALVO_BUILD_ID: ${{ github.sha }}
run: npm run mobile:sync

- name: Build iOS Simulator
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,43 @@ jobs:
run: npm run coverage

- name: Build
env:
SALVO_BUILD_ID: ${{ github.sha }}
run: npm run build

- name: Verify Telegram Mini App artifacts
env:
SALVO_BUILD_ID: ${{ github.sha }}
shell: bash
run: |
set -euo pipefail
test -f dist/telegram/index.html
sdk_occurrences="$(
awk '
{
remainder = $0
token = "telegram-web-app.js"
while ((position = index(remainder, token)) > 0) {
count += 1
remainder = substr(remainder, position + length(token))
}
}
END { print count + 0 }
' dist/telegram/index.html
)"
test "$sdk_occurrences" -eq 1
! grep -Fq 'telegram-web-app.js' dist/index.html
web_app="$(grep -oE 'app\.[a-f0-9]{10}\.js' dist/index.html)"
telegram_app="$(grep -oE 'app\.[a-f0-9]{10}\.js' dist/telegram/index.html)"
test "$web_app" = "$telegram_app"
test -f "dist/$web_app"
web_styles="$(grep -oE 'styles\.[a-f0-9]{10}\.css' dist/index.html)"
telegram_styles="$(grep -oE 'styles\.[a-f0-9]{10}\.css' dist/telegram/index.html)"
test "$web_styles" = "$telegram_styles"
test -f "dist/$web_styles"
grep -Fq "buildId: \"$SALVO_BUILD_ID\"" dist/index.html
grep -Fq "buildId: \"$SALVO_BUILD_ID\"" dist/telegram/index.html

- name: Configure Pages
uses: actions/configure-pages@v6

Expand Down
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Salvo is a browser Battleship game for GitHub Pages with three localizations, sa

Live build: https://agent-axiom.github.io/agents-salvo/

Telegram Mini App: https://agent-axiom.github.io/agents-salvo/telegram/

![Salvo paper board artwork](src/assets/salvo-board-action.png)

## Features
Expand Down Expand Up @@ -34,6 +36,16 @@ npm start

After `npm start`, open `http://localhost:5173`.

## Telegram Mini App

In [@BotFather](https://t.me/BotFather), select the Salvo bot, open the Main Mini App setup, and set its URL to `https://agent-axiom.github.io/agents-salvo/telegram/`.

When opened inside Telegram, the Mini App automatically sends Telegram's signed `initData` to the Cloudflare Worker. The Worker verifies the signature and freshness before creating the existing Salvo session, so players do not complete a separate login flow.

The browser, Telegram Mini App, iOS app, and Android app use one source tree and one `npm run build`. That build emits the regular and Telegram HTML shells with one shared hashed JavaScript bundle and stylesheet; only the Telegram shell loads the Telegram SDK.

Pages and the Mini App update immediately when the Pages artifact is published. Native apps do not load Pages at startup: each APK or iOS app packages the build from a selected commit and changes only when that commit is packaged and released.

## iOS And Android Development

The mobile apps bundle the same `dist/` build as GitHub Pages; they do not load the public site at startup. Agent, training, and same-device battles therefore work offline. Online rooms, Telegram login, profiles, and leaderboards require access to the Cloudflare Worker.
Expand Down Expand Up @@ -90,7 +102,7 @@ API publishing is available after RuStore has one active version. Run `Check RuS
2. In Settings -> Pages, select GitHub Actions.
3. Run the `Deploy GitHub Pages` workflow or push to `main`.

The workflow runs `npm test`, builds `dist`, and publishes it as a Pages artifact.
The workflow runs the test and coverage gates, builds `dist`, verifies both HTML shells and their shared hashed assets, and publishes the result as a Pages artifact.

## Online Backend

Expand Down
14 changes: 13 additions & 1 deletion README.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

Публичная версия: https://agent-axiom.github.io/agents-salvo/

Публичный Telegram Mini App: https://agent-axiom.github.io/agents-salvo/telegram/

![Иллюстрация бумажного поля Залпа](src/assets/salvo-board-action.png)

## Возможности
Expand Down Expand Up @@ -34,6 +36,16 @@ npm start

После `npm start` открыть `http://localhost:5173`.

## Telegram Mini App

В [@BotFather](https://t.me/BotFather) нужно выбрать бота «Залпа», открыть настройку Main Mini App и указать URL `https://agent-axiom.github.io/agents-salvo/telegram/`.

При запуске внутри Telegram Mini App автоматически отправляет подписанный Telegram `initData` в Cloudflare Worker. Worker проверяет подпись и срок действия данных, а затем создаёт существующую сессию «Залпа», поэтому отдельный вход не требуется.

Браузер, Telegram Mini App, iOS-приложение и Android-приложение используют единое дерево исходного кода и одну команду `npm run build`. Эта сборка создаёт обычный и Telegram HTML shell с общими хешированными JavaScript bundle и stylesheet; Telegram SDK загружается только в Telegram shell.

Pages и Mini App обновляются сразу после публикации Pages artifact. Нативные приложения не загружают Pages при старте: каждый APK или iOS app содержит сборку выбранного коммита и меняется только после упаковки и выпуска этого коммита.

## Разработка приложений для iOS и Android

Мобильные приложения используют тот же локально собранный `dist/`, что и GitHub Pages, и не загружают публичный сайт при старте. Поэтому бои с агентом, тренировки и PvP на одном устройстве работают без интернета. Для online-комнат, Telegram-авторизации, профилей и лидерборда нужен доступ к Cloudflare Worker.
Expand Down Expand Up @@ -90,7 +102,7 @@ API-публикация доступна после появления перв
2. В Settings -> Pages выбрать GitHub Actions.
3. Запустить workflow `Deploy GitHub Pages` или сделать push в `main`.

Workflow прогоняет `npm test`, собирает `dist` и публикует его как Pages artifact.
Workflow прогоняет тесты и coverage gates, собирает `dist`, проверяет оба HTML shell и общие хешированные артефакты и публикует результат как Pages artifact.

## Online backend

Expand Down
14 changes: 13 additions & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

在线版本:https://agent-axiom.github.io/agents-salvo/

Telegram Mini App:https://agent-axiom.github.io/agents-salvo/telegram/

![纸上海战棋棋盘插图](src/assets/salvo-board-action.png)

## 功能
Expand Down Expand Up @@ -34,6 +36,16 @@ npm start

运行 `npm start` 后打开 `http://localhost:5173`。

## Telegram Mini App

在 [@BotFather](https://t.me/BotFather) 中选择齐射机器人,打开 Main Mini App 设置,并将 URL 设为 `https://agent-axiom.github.io/agents-salvo/telegram/`。

从 Telegram 内打开时,Mini App 会自动将 Telegram 签名的 `initData` 发送到 Cloudflare Worker。Worker 验证签名和数据时效后创建现有的齐射会话,因此玩家无需再次登录。

浏览器、Telegram Mini App、iOS 应用和 Android 应用共享同一份源代码,并由一次 `npm run build` 生成。该构建会输出普通 HTML shell 和 Telegram HTML shell,两者引用同一组带哈希的 JavaScript bundle 和 stylesheet;只有 Telegram shell 加载 Telegram SDK。

发布 Pages artifact 后,Pages 和 Mini App 会立即更新。原生应用启动时不会加载 Pages:每个 APK 或 iOS 应用会打包所选提交的构建,只有在该提交完成打包和发布后才会更新。

## iOS 和 Android 开发

移动应用打包的 `dist/` 与 GitHub Pages 使用同一份构建产物,启动时不会加载公开网站。因此,智能体对战、训练和同机双人模式可离线运行。在线房间、Telegram 登录、玩家档案和排行榜需要连接 Cloudflare Worker。
Expand Down Expand Up @@ -90,7 +102,7 @@ RuStore 中出现首个已上线版本后,才可使用 API 发布。先运行
2. 在 Settings -> Pages 中选择 GitHub Actions。
3. 运行 `Deploy GitHub Pages` workflow,或推送到 `main`。

Workflow 会运行 `npm test`,构建 `dist`,并发布为 Pages artifact。
Workflow 会运行测试和 coverage gates,构建 `dist`,验证两个 HTML shell 及其共享的带哈希资源,并将结果发布为 Pages artifact。

## 在线后端

Expand Down
Loading