Skip to content

About

Pocket Shell explores interaction models for Pocket apps across different devices and form factors — from touchscreens to Nintendo 3DS and Sony PSP.

Topics

Resources

Contributing

Stars

83 stars

Watchers

0 watching

Forks

Repository files navigation

Pocket Shell

Pocket Shell is a launcher for the Pocket Applets, small apps built on PocketJS that run from one set of packages on the Nintendo 3DS's touch screen and on the M5Stack Tab5's landscape panel. This repository holds the launcher, the iOS 6 kit the launcher and the applets draw with (ui/) and their icon family (ui/art/icons), and builds the launcher for the 3DS, the Tab5 and the PSP. The applets are in pocket-nexus/applets, which builds them against this repository. The Tab5's firmware is in devices/m5stack.

Home Hacker News Notes
Home on the Tab5: seven applets, a dock and the floating home ball Hacker News on the Tab5 Notes on the Tab5, typed on the Tab5 keyboard
YouTube Camera Settings
YouTube on the Tab5 The camera preview on the Tab5 Settings, the Applets page, on the Tab5
Home on the 3DS Notes on the 3DS
The home screen on the 3DS touch screen with Claude's room on the top screen The Notes list at 320x240

The Tab5 pictures are the device's framebuffer at its logical 640x360 (the panel shows it at 2x); the 3DS Home picture is a capture from the console, and the 3DS Notes list is a simulator render at 320x240. Each applet lays itself out by size class from one source, so the 3DS and the Tab5 install the same programs: see shells/3ds.

To use them, Pocket Hub, an app for the Mac, installs Pocket Shell on a 3DS and carries the applets. On the 3DS, which speaks Pocket Link 2, Hub writes the console's pairing onto its SD card through ftpd during that install; there is no code to scan, and the console links to the Mac by itself when Pocket Shell starts. Tap Mac on the home screen to install the applets the Mac offers. A Tab5 speaks Pocket Link 2 and pairs by a code it shows: Settings > Mac > Pair a Computer... lists the computers whose Hub it hears and shows 6 digits for the one chosen, and Hub on that computer asks for them. Pocket Hub is not released yet. The Tab5 firmware's build compiles this launcher from shells/3ds/shell and embeds it.

The shells as explorations

The repository holds three shells, and two more on an archive branch. Each explored one way of operating a small computer; what each taught is in docs/EXPLORATIONS.md.

Shell Modality explored Source and documentation
Pocket Shell on the 3DS and the Tab5 A touch-screen launcher with installed applets; on the 3DS, Claude's room on the top screen and L+R to talk or type; on the Tab5, a floating home ball and a keyboard shells/3ds
Touch navigation Full-screen gestures over sixteen mock apps on the iPod touch 4 and the Nokia E7 shells/touch
Embedded desktop Windows, a pointer and a keyboard, with Classic 98, XP and Aqua themes in the browser preview and Pocket Studio computers; does not build against the pinned PocketJS shells/desktop
The Omarchy-style 3DS shell and the iPod touch 4 remote (archived) Tiling windows on the top screen with shoulder chords and a deck on the touch screen; a handheld that mirrors and controls a Linux desktop branch archive/3ds-omarchy-ipod-remote

The former pocket-desktop project is the embedded desktop interface in this repository. Its application code, assets, tests, browser build scripts, browser preview and website are under shells/desktop/. They do not build against the pinned PocketJS, which removed the demo manifests, the manifest module and the Pocket System they read (pocket-nexus/pocketjs#705); the root checks, the workspaces, the release's version files and CI leave the directory out. The import preserves its Git history. Existing installed package IDs and desktop artifact names remain stable. The archived shells are main at 78b94b2 before they were removed; they are not built or tested on main, and work on one starts from the archive branch, whose README and AGENTS.md describe that tree.

The former pocket-m5 project is the M5Stack firmware in this repository, under devices/m5stack/. The import preserves its Git history. Its app ids (dev.pocket-nexus.m5.tab5-demo, dev.pocket-nexus.m5.unit-swap) and its host id (tab5-home) are unchanged. Firmware releases up to v0.1.4 are pocket-m5's; this repository publishes none.

Repository layout

shells/
  3ds/       shell (the launcher), scripts, test, media
  touch/     src (gesture model and mock apps), scripts, test, host config
  desktop/   src/system-ui, scripts, test, assets, docs, preview, site, manifests; does not build at this pin
devices/
  3ds/       the Nintendo 3DS host program (C, the platform's media, offload, SOC and worker sources, a Rust archive, its Makefile and build), host contract, tests
  psp/       the PSP program (a Rust crate over PocketJS's PSP library), its host contract, host tests
  services/  portable C host services the 3DS program and the Tab5 firmware compile: the .pocket reader, the Pocket Link 2 client, launcher, fs, JSON, SHA-256, photo images, media stream headers, quirc
  m5stack/   M5Stack Tab5 firmware (ESP-IDF): programs, platforms, apps, tools, tests, docs
ui/          the iOS 6 kit the launcher and the applets draw with: navigation, tables, alerts, text, touch; art/icons, the icon family
cli/         pocket-shell.ts: check an app contract and compile it into a .pocket package; other commands go to PocketJS's CLI
runtime/
  spec/      contracts: the app contract, the .pocket package and its admission, Pocket Link 1 and 2, applet, agent, owner setup, Wi-Fi, device, camera, media
  manifest/  the app contract's loader, validation and resolution into a build plan; host build inputs
  package/   a package variant's sections, bytecode sections, a variant as a PocketJS bundle, package tools, the applet check
  schema/    pocket-2.json, the app contract's JSON schema, and its generator
  src/       guest modules: applet surface, link, channel, launcher, system sheet, agent, Wi-Fi, device, camera, media
  sim/       the 3DS console simulator and its link, Wi-Fi, camera and agent fakes
  test/      tests of the modules above; fixtures, the admission corpus among them
link/
  v2/        Pocket Link 2 reference codec, device, Hub and the Hub's command line
  *.ts       fetch.ts, the Hub's destination policy; media-stream.ts, the companion's media stream; 3ds-dev.ts, the 3DS development tool
  vectors/   Pocket Link 2 conformance vectors
  test/      tests of the reference implementation
docs/        APP-CONTRACT.md, POCKET-PACKAGE.md, POCKET-LINK.md, APPLETS.md, POCKET-AGENT.md, MEDIA.md; asset policy; explorations
scripts/     setup, the asset check, the release, repository paths and process helpers
vendor/
  pocketjs/  PocketJS submodule: the UI framework, the compiler and host contracts, the engine crates, the PSP library, the 3DS platform's hooks and input, the PICA renderer

shells/3ds and shells/touch are Bun packages of the root workspace with their own TypeScript configurations; shells/desktop is outside the workspace and the checks. The root configuration type-checks scripts, cli, runtime, link, ui and the TypeScript of devices/3ds, devices/services and devices/psp. devices/m5stack is a third Bun package in the same workspace; its C sources build with ESP-IDF. devices/3ds, devices/psp and devices/services are not Bun packages: devices/3ds builds in the devkitARM container with a Rust archive (bun run 3ds), devices/psp with PocketJS's PSP toolchain (bun run psp), and the 3DS program and the Tab5 firmware compile devices/services. See the asset policy and review for generated outputs, source inputs and retained documentation fixtures. Application code is separate; UI APIs come from @pocketjs/framework/*, the launcher's applet surface, link, launcher, agent, Wi-Fi and camera modules come from runtime/src as @pocket-shell/runtime/<module> (bun run setup links the package), and its navigation, tables, alerts and icon tiles come from ui/.

Development

Run commands from the repository root. Bun (the version in .bun-version, which the pinned PocketJS runs on), Rust and the wasm32-unknown-unknown Rust target are required for the complete check. Native targets have additional requirements in their shell's README; the Tab5 firmware needs ESP-IDF, as devices/m5stack describes.

git clone --recurse-submodules https://github.com/pocket-nexus/pocket-shell.git
cd pocket-shell
bun run setup
rustup target add wasm32-unknown-unknown
bun run check                    # types, unit and simulator tests for the link, the runtime, the CLI and the 3DS and touch shells
bun run check:3ds                # or check:touch
bun run check:devices            # host tests of devices/3ds, devices/psp and devices/services (needs a C compiler, Rust, libjpeg and pkg-config)

shells/desktop has no root commands at this pin; its README says why it does not build.

bun run pair --host <console-ip> # once, while ftpd runs on the 3DS: write this computer's pairing onto its card
bun run deploy                   # build Pocket Shell's .3dsx, install it over the Pocket Link and restart into it
bun run push [hn]                # rebuild and hot-push the launcher (or install Hacker News)
bun run offer                    # build the applets (3DS and Tab5 packages) and serve them from the reference Pocket Link 2 Hub
bun run tab5 [app…]              # build the launcher and the applets for the M5Stack Tab5 into dist/tab5
bun run psp                      # build the PSP EBOOT (the launcher) from devices/psp; packages and bundles in dist/psp
bun run shot                     # capture both console screens
bun run 3ds                      # full console binary in dist/3ds
bun run touch guest
bun run touch deploy             # portrait gesture shell on the connected iPod
bun run check:m5stack            # Tab5 firmware: clang-format check and host tests (needs a C compiler)
bun run m5stack app build apps/unit-swap/pocket.app.json   # compile one of the firmware's own apps
bun run pocket-shell check --manifest shells/3ds/shell/pocket.app.json --project-root shells/3ds --target devices/3ds/pocket.host.json
                                 # resolve and type-check one app contract against a host contract; `compile` writes its .pocket

The launcher builds from this repository alone. The commands that build an applet (bun run 3ds <applet>, bun run push <applet>, bun run tab5 <applet>, bun run offer) read a checkout of pocket-nexus/applets at POCKET_APPLETS_ROOT, by default ../applets beside this repository. With no checkout there, bun run tab5 and bun run psp build the launcher, and bun run offer or a command that names an applet stops with one line that names the variable and the path it read. shells/3ds has what the checkout needs.

PocketJS is pinned through vendor/pocketjs, the one submodule. PocketJS is UI infrastructure and this repository is the Runtime built on it: the app contract, the .pocket container, Pocket Link, the applets, the application catalog and switching between applications on a device are here. Changes to the UI framework, the compiler, the engine, the PSP library, the 3DS platform's hooks and input and the PICA renderer belong upstream; this repository selects their commit through its submodule pin. The applets depend on this repository and not the reverse: the kit and the icon family were imported from pocket-nexus/applets at 4660dfe, and a change to either lands here. The Pocket Link's contract, TypeScript reference implementation and specification, the applet rules and the agent's contract and guest modules are in runtime/, link/ and docs/: they were imported from PocketJS at 89e10438, and PocketJS removed its copies at 89162fb7. The 3DS host program (the agent stage, the launcher's storage, the program's side of the Pocket Link) is devices/3ds and the Pocket Link's C client with the other portable host services is devices/services: they were imported from PocketJS at 806ac202, with the 3DS platform's media, offload, SOC and worker sources (devices/3ds/platform), and PocketJS has removed them. The 3DS build reads the platform's hooks and input source (platforms/3ds), the PICA renderer, the QuickJS facade and the engine crates from vendor/pocketjs. Companion media playback (runtime/spec/media.ts, @pocket-shell/runtime/media, link/media-stream.ts, docs/MEDIA.md) and the PSP program's app switching, veil, Pocket Link carrier and media player (devices/psp) came from PocketJS before pocket-nexus/pocketjs#708 and #710 removed them.

The app contract (pocket.app.json: its schema, loader and resolver), the .pocket package format with its admission rules, the applet check and the CLI that compiles an application into a package are in runtime/ and cli/. They were imported from PocketJS at 806ac202. PocketJS has neither an app contract nor a .pocket container since pocket-nexus/pocketjs#705 and #706: its applications put their build inputs in the app section of pocket.host.config.ts, and its programs boot one compiled application, a bundle (.pkb, PocketJS contracts/spec/bundle.ts). The 3DS, Tab5 and PSP packages and pocket-nexus/applets build with the app contract here; shells/touch builds from the app section of its host config with PocketJS's CLI. The 3DS program and the Tab5 firmware boot and install .pocket files: they read them with devices/services/pocket_container.c, and PocketJS admits and boots the variant the reader states. The PSP program embeds admitted variants as bundles. PocketJS supplies the host contracts, the JSON Schema subset and its validator, the animation theme and the compiler: the CLI writes the resolved build plan to a file, and vendor/pocketjs/tools/build.ts --plan=<file> turns it into the JavaScript bundle and the asset pack, with the agent's overlay (runtime/src/agent-layer.tsx) as a --layer for a Solid app that declares system.agent.

Releases

The repository has one SemVer version: the root package.json, the 3DS and touch shells' package.json and the launcher's app contract (shells/3ds/shell/pocket.app.json) name it, the touch shell's host config reads it from its package.json, and About on the console shows it. shells/desktop takes no part. A release is a pull request that raises it:

bun run release                  # auto: the bump the Conventional Commits since the last tag ask for
bun run release minor            # or patch / major, or an exact version such as 0.3.0-rc.1
bun run release --dry-run        # prepare the change from HEAD under .pocket-build/release/ and open nothing

The command branches release/v<version> from origin/main in a worktree of its own, raises every version and bun.lock, and opens the pull request chore(release): v<version> with the changes since the last tag. auto raises the major for a breaking change (the minor below 1.0.0), the minor for a feat, the patch otherwise.

Merging it is the release. Release 3DS (.github/workflows/release-3ds.yml) sees the root package.json's version rise on main, tags the merge commit v<version>, builds the .3dsx from it and publishes the GitHub release Pocket Shell v<version>; a version with a suffix (0.3.0-rc.1) is a prerelease. A published release is never replaced. If a run fails after tagging, run the workflow by hand with that version to publish the tag again. Releases up to v2026.11.12 were named by their date.

The Tab5 firmware has no release here. M5Stack firmware (.github/workflows/firmware-m5stack.yml) builds it on pull requests and on pushes to main and uploads the packaged files as the pocket-shell-tab5 workflow artifact.

License

GNU GPL version 3. Root, 3DS, PSP, touch and M5Stack firmware code uses GPL-3.0-or-later; imported desktop code retains GPL-3.0-only. runtime/, link/, devices/3ds, devices/services, the PSP program's sources from PocketJS and the specifications imported from PocketJS (MIT) are distributed under GPL-3.0-or-later. ui/ was imported from pocket-nexus/applets, which is GPL-3.0-or-later. PocketJS and third-party fonts retain their own licenses. See LICENSING.md, LICENSE and contribution rules.

About

Pocket Shell explores interaction models for Pocket apps across different devices and form factors — from touchscreens to Nintendo 3DS and Sony PSP.

Topics

Resources

Contributing

Stars

83 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages