Host-Independent Design
LightMem2 separates component packages and host adapters.
From the components/README.md:
- Component packages: reusable runtime logic, state and policy layers, host-agnostic contracts
- Host adapters: installation and bootstrap, transcript/session bridging, host-specific command and hook surfaces
From the adapters/README.md:
Adapter responsibilities (keep inside adapter layer):
- Host install and uninstall flow
- Host config mutation
- Request / response hook wiring
- Session and transcript bridging
- Host-specific command registration
- Runtime bootstrap and doctor checks
- Host-owned path resolution
Shared package responsibilities (keep in shared packages):
- Runtime contracts in
packages/kernel/ - Host-neutral execution primitives in
packages/runtime-core/ - State and policy logic in
packages/layers/* - Host abstraction helpers in
packages/host-adapter/ - Shared command semantics in
packages/product-surface/ - Standalone product entrypoints in
products/
From the HOSTS.md boundary section:
components/tokenpilot/packages/*— reusable component logiccomponents/tokenpilot/products/*— shared product surfacescomponents/tokenpilot/adapters/<host>— host-specific integration layer
Related Pages
- Plugin Directory Structure — where to place shared vs. host-specific code
- Runtime API — the shared packages and their public contracts
- Adapter Architecture