Initial BeeOS simulator and asset pipeline
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
# BeeOS Development Notes
|
||||
|
||||
BeeOS is currently a desktop simulator and project framework for a future MicroPython/LVGL watch OS.
|
||||
|
||||
## Current development rules
|
||||
|
||||
- Keep the simulator runnable on normal Windows Python.
|
||||
- Do not require LVGL on Windows.
|
||||
- Keep HiveStore curated, even when third-party repos are supported.
|
||||
- Prefer small curated asset subsets over large full asset packs.
|
||||
- Keep package formats JSON-based and easy to inspect.
|
||||
- Keep generated firmware assets separate under `beeos/generated/`.
|
||||
|
||||
## Before packaging
|
||||
|
||||
Run:
|
||||
|
||||
```powershell
|
||||
py tools/validate_project.py --project-root .
|
||||
```
|
||||
|
||||
Optional cleanup:
|
||||
|
||||
```powershell
|
||||
py tools/clean_project.py --project-root .
|
||||
```
|
||||
@@ -0,0 +1,49 @@
|
||||
# HiveStore Repos
|
||||
|
||||
BeeOS supports multiple curated HiveStore repositories.
|
||||
|
||||
A HiveStore repo can be hosted on GitHub by committing a `hivestore_index.json` file.
|
||||
|
||||
## Create a starter repo
|
||||
|
||||
```powershell
|
||||
py tools/create_hivestore_repo.py .\my-hivestore "My HiveStore Repo"
|
||||
```
|
||||
|
||||
## Import a local repo index
|
||||
|
||||
```powershell
|
||||
py tools/import_hivestore_repo.py .\my-hivestore\hivestore_index.json --project-root .
|
||||
```
|
||||
|
||||
## Import a GitHub-hosted repo
|
||||
|
||||
```powershell
|
||||
py tools/import_hivestore_repo.py https://github.com/example/my-hivestore --project-root .
|
||||
```
|
||||
|
||||
## Repo format
|
||||
|
||||
```json
|
||||
{
|
||||
"schema": 1,
|
||||
"source_name": "My HiveStore Repo",
|
||||
"source_url": "https://github.com/example/my-hivestore",
|
||||
"packages": [
|
||||
{
|
||||
"id": "example.app.hello",
|
||||
"name": "Hello Bee",
|
||||
"type": "app",
|
||||
"version": "0.1.0",
|
||||
"author": "Example Developer",
|
||||
"description": "A simple BeeOS app.",
|
||||
"entry": "app.py",
|
||||
"permissions": ["display", "storage"],
|
||||
"repository": "https://github.com/example/hello-bee",
|
||||
"curated": true
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
If duplicate package IDs appear across enabled repos, the first enabled source wins.
|
||||
@@ -0,0 +1,39 @@
|
||||
# BeeOS Project Structure
|
||||
|
||||
```text
|
||||
beeos/
|
||||
├─ core/ Core OS simulation logic, registries, managers, runtime API
|
||||
├─ ui/ Tkinter desktop simulator and drawing components
|
||||
├─ mock/ Mock hardware providers used by the simulator
|
||||
├─ data/ Local JSON databases and HiveStore indexes
|
||||
├─ scripts/ Local BeeOS script examples
|
||||
├─ sideload/ Local package folders for sideload testing
|
||||
├─ packages/ Installed package folders
|
||||
├─ storage/ Package-local runtime storage
|
||||
├─ assets/ Source assets, including curated Lucide icons
|
||||
└─ generated/ Generated firmware-facing assets
|
||||
```
|
||||
|
||||
## Important tools
|
||||
|
||||
```text
|
||||
tools/create_package_template.py
|
||||
tools/create_hivestore_repo.py
|
||||
tools/import_hivestore_repo.py
|
||||
tools/convert_icons_for_lvgl.py
|
||||
tools/export_themes_for_lvgl.py
|
||||
tools/validate_project.py
|
||||
tools/clean_project.py
|
||||
```
|
||||
|
||||
## Runtime entry point
|
||||
|
||||
```text
|
||||
run_beeos.py
|
||||
```
|
||||
|
||||
Run it with:
|
||||
|
||||
```powershell
|
||||
py run_beeos.py
|
||||
```
|
||||
@@ -0,0 +1,54 @@
|
||||
# BeeOS Phase 3 Notes
|
||||
|
||||
## Goal
|
||||
|
||||
Phase 3 moves BeeOS from "fake install buttons" toward a real package runtime model.
|
||||
|
||||
## New architecture
|
||||
|
||||
```text
|
||||
beeos/
|
||||
├─ packages/ installed package folders
|
||||
├─ sideload/ local package import area
|
||||
├─ data/
|
||||
│ ├─ hivestore_index.json
|
||||
│ ├─ installed_packages.json
|
||||
│ └─ settings.json
|
||||
├─ core/
|
||||
│ ├─ package_manifest.py
|
||||
│ ├─ package_manager.py
|
||||
│ ├─ permissions.py
|
||||
│ └─ ...
|
||||
└─ ui/
|
||||
└─ simulator.py
|
||||
```
|
||||
|
||||
## Official HiveStore rule
|
||||
|
||||
HiveStore only shows curated listings. Sideloading is separate and developer-facing.
|
||||
|
||||
## Package manifest shape
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "beeos.app.example",
|
||||
"name": "Example App",
|
||||
"type": "app",
|
||||
"version": "0.1.0",
|
||||
"author": "BeeOS Community",
|
||||
"description": "Example package.",
|
||||
"entry": "app.py",
|
||||
"permissions": ["time", "battery"]
|
||||
}
|
||||
```
|
||||
|
||||
## Next phase
|
||||
|
||||
Phase 4 should likely focus on the BeeOS app runtime API:
|
||||
|
||||
- `beeos_api.display`
|
||||
- `beeos_api.storage`
|
||||
- `beeos_api.notifications`
|
||||
- `beeos_api.permissions`
|
||||
- simulated package execution sandbox
|
||||
- app lifecycle methods: `on_open`, `on_draw`, `on_touch`, `on_close`
|
||||
@@ -0,0 +1,55 @@
|
||||
# BeeOS Phase 4 Notes
|
||||
|
||||
## Completed in this phase
|
||||
|
||||
Phase 4 adds the first BeeOS Runtime API.
|
||||
|
||||
New core file:
|
||||
|
||||
```text
|
||||
beeos/core/runtime_api.py
|
||||
```
|
||||
|
||||
## New runtime concepts
|
||||
|
||||
- `BeeRuntime`
|
||||
- `BeeRuntimeContext`
|
||||
- `BeeDisplayAPI`
|
||||
- `BeeStorageAPI`
|
||||
- `RuntimeResult`
|
||||
|
||||
## Runtime API currently supports
|
||||
|
||||
- app lifecycle simulation
|
||||
- `BeeApp(ctx).on_open()`
|
||||
- `BeeApp(ctx).on_draw(display)`
|
||||
- `main(ctx)` fallback
|
||||
- script execution through `main(ctx)` or `run(ctx)`
|
||||
- display command capture
|
||||
- notifications through `ctx.notify(title, body)`
|
||||
- package-local JSON storage
|
||||
- permission checks through `ctx.has_permission(name)`
|
||||
- simple system APIs:
|
||||
- battery percent
|
||||
- uptime
|
||||
- RAM usage
|
||||
- PSRAM usage
|
||||
- storage usage
|
||||
- CPU usage
|
||||
|
||||
## Not real sandboxing yet
|
||||
|
||||
This is a simulator runtime. It is not a security sandbox.
|
||||
|
||||
Actual watch firmware will need much stricter execution boundaries, especially for filesystem access, networking, Bluetooth, sensors, background services, plugin hooks, and permissions.
|
||||
|
||||
## Next possible phase
|
||||
|
||||
Phase 5 should probably add:
|
||||
|
||||
- app lifecycle sessions
|
||||
- touch event delivery to apps
|
||||
- package settings pages
|
||||
- watch face runtime
|
||||
- plugin hook registry
|
||||
- basic permission approval screens
|
||||
@@ -0,0 +1,67 @@
|
||||
# BeeOS Phase 5 Notes
|
||||
|
||||
## Completed in this phase
|
||||
|
||||
Phase 5 adds:
|
||||
|
||||
- app runtime sessions
|
||||
- simulated touch delivery
|
||||
- `on_touch(event)` support
|
||||
- `on_close()` support
|
||||
- permission approval prompts
|
||||
- permission approval persistence
|
||||
- plugin hook registry placeholder
|
||||
- built-in watch face registry
|
||||
|
||||
## New files
|
||||
|
||||
```text
|
||||
beeos/core/permission_manager.py
|
||||
beeos/core/plugin_manager.py
|
||||
beeos/core/watchfaces.py
|
||||
beeos/data/permission_approvals.json
|
||||
```
|
||||
|
||||
## Runtime lifecycle now supports
|
||||
|
||||
```python
|
||||
class BeeApp:
|
||||
def __init__(self, ctx): ...
|
||||
def on_open(self): ...
|
||||
def on_draw(self, display): ...
|
||||
def on_touch(self, event): ...
|
||||
def on_close(self): ...
|
||||
```
|
||||
|
||||
## Runtime touch event format
|
||||
|
||||
```python
|
||||
{
|
||||
"type": "tap",
|
||||
"x": 205,
|
||||
"y": 260
|
||||
}
|
||||
```
|
||||
|
||||
## Permission behavior
|
||||
|
||||
HiveStore and sideload installs now show a permission approval screen before installation.
|
||||
|
||||
Approved permissions are saved to:
|
||||
|
||||
```text
|
||||
beeos/data/permission_approvals.json
|
||||
```
|
||||
|
||||
This is not real sandboxing yet. It is the first user-facing permission model.
|
||||
|
||||
## Next possible phase
|
||||
|
||||
Phase 6 should probably add:
|
||||
|
||||
- real per-permission API enforcement
|
||||
- background service/session model
|
||||
- plugin hook execution
|
||||
- notification action buttons
|
||||
- on-watch package update simulation
|
||||
- app settings pages
|
||||
@@ -0,0 +1,68 @@
|
||||
# BeeOS Phase 6 Notes
|
||||
|
||||
## Completed in this phase
|
||||
|
||||
Phase 6 integrates the uploaded Lucide icon asset pack into BeeOS.
|
||||
|
||||
New files:
|
||||
|
||||
```text
|
||||
beeos/assets/icons/lucide/
|
||||
beeos/assets/icons/lucide/manifest.json
|
||||
beeos/core/icon_manager.py
|
||||
```
|
||||
|
||||
## Why curated icons?
|
||||
|
||||
The uploaded Lucide pack contains more than 1,700 SVG icons. BeeOS should not ship the entire set on-watch.
|
||||
|
||||
Phase 6 extracts a curated watch-sized subset for:
|
||||
|
||||
- Clock
|
||||
- Health
|
||||
- HiveStore
|
||||
- Settings
|
||||
- Scripts
|
||||
- Resource Monitor
|
||||
- Developer Tools
|
||||
- GPS
|
||||
- Battery
|
||||
- Notifications
|
||||
- About
|
||||
- Bluetooth
|
||||
- Display
|
||||
- Watch Faces
|
||||
- Themes
|
||||
- Plugins
|
||||
- Permissions
|
||||
- Runtime
|
||||
- Install/remove actions
|
||||
- HiveStore package types
|
||||
|
||||
## Simulator limitation
|
||||
|
||||
Tkinter does not natively render full SVG path data. The simulator now has a lightweight asset-aware icon renderer and glyph fallbacks.
|
||||
|
||||
For real BeeOS/LVGL, the SVG files should be converted to a format LVGL can render efficiently.
|
||||
|
||||
## Next possible phase
|
||||
|
||||
Phase 7 should probably add an asset conversion tool:
|
||||
|
||||
```text
|
||||
tools/convert_icons_for_lvgl.py
|
||||
```
|
||||
|
||||
Possible outputs:
|
||||
|
||||
- PNG previews
|
||||
- monochrome PBM/bitmap icons
|
||||
- LVGL C image descriptors
|
||||
- BeeOS compact JSON draw commands
|
||||
|
||||
|
||||
## Icon-render fix
|
||||
|
||||
The original Phase 6 build included SVG assets, but the simulator still displayed fallback glyphs because Tkinter cannot draw Lucide path-based SVGs directly.
|
||||
|
||||
This fixed build adds pre-rendered PNGs and uses them for app icons.
|
||||
@@ -0,0 +1,43 @@
|
||||
# BeeOS Phase 7 Notes
|
||||
|
||||
## Completed in this phase
|
||||
|
||||
Phase 7 adds the first BeeOS asset conversion pipeline.
|
||||
|
||||
New files:
|
||||
|
||||
```text
|
||||
tools/convert_icons_for_lvgl.py
|
||||
beeos/core/asset_build.py
|
||||
beeos/generated/icons/icon_build_index.json
|
||||
beeos/generated/icons/bitmap_json/
|
||||
beeos/generated/icons/lvgl/
|
||||
beeos/generated/icons/previews/
|
||||
```
|
||||
|
||||
## Why this matters
|
||||
|
||||
The desktop simulator can use PNG icons, but the PineTime Pro firmware/LVGL port will need compact generated assets.
|
||||
|
||||
Phase 7 creates an intermediate format:
|
||||
|
||||
- compact JSON bitmap rows
|
||||
- packed 1-bit byte buffers
|
||||
- C header/source files
|
||||
- preview sheets
|
||||
|
||||
## Not final LVGL descriptors yet
|
||||
|
||||
The generated C files are firmware-friendly icon buffers, not full `lv_image_dsc_t` declarations yet.
|
||||
|
||||
A future phase can wrap these buffers in LVGL-specific image descriptors once the exact LVGL version and color format are chosen.
|
||||
|
||||
## Next possible phase
|
||||
|
||||
Phase 8 should probably add:
|
||||
|
||||
- actual LVGL image descriptor export option
|
||||
- theme export tool
|
||||
- watch face package runtime
|
||||
- HiveStore update simulation
|
||||
- app settings pages
|
||||
@@ -0,0 +1,62 @@
|
||||
# BeeOS Phase 8 Notes
|
||||
|
||||
## Completed in this phase
|
||||
|
||||
Phase 8 adds:
|
||||
|
||||
- LVGL v8 icon descriptor export
|
||||
- LVGL v9 icon descriptor export
|
||||
- theme database
|
||||
- theme manager
|
||||
- theme C/JSON export tool
|
||||
- HiveStore update detection
|
||||
- updated asset build metadata
|
||||
|
||||
## New files
|
||||
|
||||
```text
|
||||
beeos/core/theme_manager.py
|
||||
beeos/core/update_manager.py
|
||||
beeos/data/themes.json
|
||||
tools/export_themes_for_lvgl.py
|
||||
beeos/generated/icons/lvgl_v8/
|
||||
beeos/generated/icons/lvgl_v9/
|
||||
beeos/generated/themes/
|
||||
```
|
||||
|
||||
## Update detection
|
||||
|
||||
HiveStore now compares installed package versions against the curated listing version.
|
||||
|
||||
If the curated listing has a newer version, the UI can show:
|
||||
|
||||
```text
|
||||
Update available
|
||||
```
|
||||
|
||||
and the package detail button changes to:
|
||||
|
||||
```text
|
||||
Update
|
||||
```
|
||||
|
||||
## LVGL export note
|
||||
|
||||
The generated LVGL files are much closer to firmware use, but still not a final board integration.
|
||||
|
||||
Final integration will depend on:
|
||||
|
||||
- LVGL major version
|
||||
- display color format
|
||||
- memory layout
|
||||
- whether icons are drawn as alpha masks, monochrome bitmaps, or recolored images
|
||||
|
||||
## Next possible phase
|
||||
|
||||
Phase 9 should probably add:
|
||||
|
||||
- app settings pages
|
||||
- per-package settings schema
|
||||
- runtime API enforcement by permission
|
||||
- HiveStore update/install transaction log
|
||||
- basic watch face package runtime
|
||||
@@ -0,0 +1,58 @@
|
||||
# BeeOS Phase 9 Notes
|
||||
|
||||
## Completed in this phase
|
||||
|
||||
Phase 9 adds multi-repo HiveStore support.
|
||||
|
||||
New files:
|
||||
|
||||
```text
|
||||
beeos/core/hivestore_sources.py
|
||||
beeos/data/hivestore_sources.json
|
||||
beeos/data/community_hivestore_index.json
|
||||
tools/create_hivestore_repo.py
|
||||
tools/import_hivestore_repo.py
|
||||
```
|
||||
|
||||
## Behavior
|
||||
|
||||
HiveStore now loads enabled sources from:
|
||||
|
||||
```text
|
||||
beeos/data/hivestore_sources.json
|
||||
```
|
||||
|
||||
The official repo and a community demo repo are enabled by default.
|
||||
|
||||
Package listings are merged into one HiveStore list. If two sources publish the same package id, the first enabled source wins.
|
||||
|
||||
## GitHub support
|
||||
|
||||
A normal GitHub repo URL can be normalized into:
|
||||
|
||||
```text
|
||||
https://github.com/owner/repo/raw/main/hivestore_index.json
|
||||
```
|
||||
|
||||
A raw JSON URL can also be used.
|
||||
|
||||
## Simulator limitation
|
||||
|
||||
The simulator does not fetch remote repos every time it opens HiveStore. Remote fetching is handled by:
|
||||
|
||||
```text
|
||||
tools/import_hivestore_repo.py
|
||||
```
|
||||
|
||||
This keeps the watch-side runtime simple and allows cached repo indexes later.
|
||||
|
||||
## Next possible phase
|
||||
|
||||
Phase 10 should probably add:
|
||||
|
||||
- HiveStore repo update/check workflow
|
||||
- source trust labels
|
||||
- source signing/checksums
|
||||
- package download/cache simulation
|
||||
- install transaction log
|
||||
- repo search/filtering
|
||||
Reference in New Issue
Block a user