Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 15 additions & 6 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@ The authoritative detailed design is

## Ownership

- `crates/pocket-pi-agentos` owns App catalog, runtime lifecycle, foreground
selection, schedules, App Tool routing, and App-scoped FS/SQLite mounts.
- `crates/pocket-pi-app-pack` composes the build-selected App artifacts without
moving their product logic into the AgentOS runtime or host adapters.
- `crates/pocket-pi-agentos` owns the in-memory `InstalledAppIndex`, runtime
lifecycle, foreground selection, schedules, App Tool routing, and App-scoped
FS/SQLite mounts. There is no separate persistent App Catalog service.
- `tools/xtask` packages ordinary Apps without moving their product logic into
the AgentOS runtime or host adapters.
- HTTP is the current package ingress. It hands the complete `.pocketapp` to the
Installer, which alone validates, stores credentials, creates `current` and
activates runtime metadata. A future UART ingress must use the same boundary.
- `crates/pocket-pi-embedded` provides the bounded JavaScript Agent Loop bridge.
In AgentOS hosts, the loop is loaded from the Pi Agent System App release into
the same PocketJS Guest as its Root View.
Expand All @@ -50,6 +54,11 @@ Opening Robinhood or Exa changes only the foreground View; it does not restart
or replace the Agent. Model and native Tool transport complete asynchronously
and return events to that persistent Guest.

Ordinary View and Data Action Guests load on demand and use separate three-entry
LRU caches. Only the foreground View ticks or renders. On ESP32-P4, App QuickJS
heaps and large worker stacks allocate explicitly from PSRAM without changing
the platform-wide `malloc()` policy.

Ordinary Apps receive capability-scoped data roots. Pi Agent alone owns the
top-level `/workspace` and cross-App Tool Registry.

Expand All @@ -58,7 +67,6 @@ top-level `/workspace` and cross-App Tool Registry.
```text
apps/ PocketJS System/ordinary App sources and bundles
crates/pocket-pi-agentos/ App Supervisor and AgentOS contracts
crates/pocket-pi-app-pack/ build-selected embedded App composition
crates/pocket-pi-embedded/ embedded pi-agent-core bridge and host traits
crates/pocket-pi-tools/ native workspace/shell/time/schedule Tools
crates/pocket-pi-protocols/ provider codecs
Expand All @@ -71,7 +79,8 @@ tools/uart-model-bridge.py UART framing and provisioning CLI
## Build entry points

```sh
cargo xtask build agentos-apps
cargo xtask build pi-agent
cargo xtask build app <id> [credentials.json]
cargo xtask build esp32-p4
cargo xtask build esp32-p4-sim
cargo xtask run esp32-p4-sim
Expand Down
96 changes: 74 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[workspace]
resolver = "2"
members = [
"crates/pocket-pi-app-pack",
"crates/pocket-pi-agentos",
"crates/pocket-pi-embedded",
"crates/pocket-pi-protocols",
Expand All @@ -24,30 +23,31 @@ log = "0.4"
pocket-pi-protocols = { path = "crates/pocket-pi-protocols" }
serde = { version = "1", default-features = false, features = ["derive", "alloc"] }
serde_json = { version = "1", default-features = false, features = ["alloc"] }
tar = "0.4"

[workspace.dependencies.pocketjs-core]
git = "https://github.com/pocket-stack/pocketjs.git"
rev = "9c809bbd047ddc75c27caa4990951a78d942477a"
rev = "e12cf12f82cc60b636368119d49a06eb9ed2a3d5"

[workspace.dependencies.pocket-mod]
git = "https://github.com/pocket-stack/pocketjs.git"
rev = "9c809bbd047ddc75c27caa4990951a78d942477a"
rev = "e12cf12f82cc60b636368119d49a06eb9ed2a3d5"

[workspace.dependencies.pocket-ui-surface]
git = "https://github.com/pocket-stack/pocketjs.git"
rev = "9c809bbd047ddc75c27caa4990951a78d942477a"
rev = "e12cf12f82cc60b636368119d49a06eb9ed2a3d5"

[workspace.dependencies.pocket-db]
git = "https://github.com/pocket-stack/pocketjs.git"
rev = "9c809bbd047ddc75c27caa4990951a78d942477a"
rev = "e12cf12f82cc60b636368119d49a06eb9ed2a3d5"

[workspace.dependencies.pocket-fs]
git = "https://github.com/pocket-stack/pocketjs.git"
rev = "9c809bbd047ddc75c27caa4990951a78d942477a"
rev = "e12cf12f82cc60b636368119d49a06eb9ed2a3d5"

[workspace.dependencies.pocket-net]
git = "https://github.com/pocket-stack/pocketjs.git"
rev = "9c809bbd047ddc75c27caa4990951a78d942477a"
rev = "e12cf12f82cc60b636368119d49a06eb9ed2a3d5"

[profile.release]
opt-level = 2
Loading
Loading