Contributing
How to work on Twig without fighting the monorepo.
Layout
apps/native Android app (Expo)
apps/cli Laptop companion (Bun + Ink)
apps/fumadocs twig.bhalala.org
packages/core Domain types
packages/memory Filesystem + index + recall
packages/harness Model + tools + dreams
packages/link USB protocolmemory and harness take injected adapters. Do not import expo-* or node:fs into those
packages. Phone bindings live in apps/native/lib/adapters/; laptop bindings in apps/cli/src/adapters/.
Commands
bun install
bun run test
bun run check-types
bun run dev:native
bun run companion
bun run dev:webRules of the house
- Phone owns state. The laptop never becomes source of truth.
- Journals append before files change. Versions keep prior bytes.
- Dreams are one model call per unit and must be restart-safe.
- Scripts run only on the laptop. Macros run on the phone.
- UI copy stays plain. No paths, JSON, or token counts in the default chrome.
Browser emulator
bun run emu:up && bun run emu:wait && bun run emu:adb
bun run emu:open
bun run companionLinux + KVM for the container. On Apple Silicon, run compose remotely and set TWIG_EMU_HOST.
See Browser Android emulator.
License
MIT. See License.