Files
breeze/scripts/generate-node-app-codec.py
T
waozi d14a67dc59 Add Chess and node-listed apps with beta apps in Settings
Chess is an optional app in More apps: play the computer at Easy, Medium
or Hard, or invite a friend from the friend list and play through the
account's node. It runs through a generic host interface (host_api 12) for
apps the node offers, so later apps need no host code or APK. More apps
lists the node's inbe.* apps that this build can run; installed marks sync
in private.inbe.v1.app-installs and app records in
private.inbe.v1.app.<name>, which released versions skip.

A release may carry "channel":"beta" (package-release.py --node-app NAME
--beta). Beta apps show only where Settings › About › Show beta apps is on;
turning it on reads the node's list again. Publishing offers only the upload
key over ssh.
2026-10-17 07:35:10 -03:00

33 lines
1.4 KiB
Python

#!/usr/bin/env python3
"""Generate src/cells/node_app_codec.zi with Kryon's widget codec generator.
These are the records every app the node offers exchanges with the host
through the generic app interface (src/cells/node_app_types.zi).
Pass --check to verify the file is current."""
from pathlib import Path
import subprocess
import sys
ROOT = Path(__file__).resolve().parent.parent
KRYON = ROOT / 'build/packages/kryon'
KRYON_MODULES = ['session']
APP_TYPES = ['node_app_types']
ROOTS = ['AppMessage', 'AppUiFrame', 'AppPerson', 'AppShared', 'AppSharedItem',
'AppInvitation', 'AppSharedCommand']
command = [sys.executable, str(KRYON / 'scripts/generate-widget-codecs.py'),
'--output', str(ROOT / 'src/cells/node_app_codec.zi'),
'--uses', str(KRYON / 'src/backend/widget_codec.zi'),
'--generated-by', 'scripts/generate-node-app-codec.py']
for module in KRYON_MODULES:
command += ['--source', str(KRYON / 'src/ui' / (module + '.zi'))]
for name in APP_TYPES:
command += ['--source', str(ROOT / 'src/cells' / (name + '.zi'))]
for root in ROOTS:
command += ['--root', root]
for line in ['"std/bundle_host"', '"std/byte_text_linux"', '"hosted_values"', '"widget_codec"',
*(f', file "{name}.zi";' for name in APP_TYPES), *(f'"{module}"' for module in KRYON_MODULES)]:
command += ['--import', line]
command += sys.argv[1:]
sys.exit(subprocess.run(command).returncode)