Skip to content

Fleet state-location resolution

State: open/verified · Kind: module · Audience: system

  • Resolves where a product’s on-disk state lives across every product the company ships, on two axes — tier (vendor/suite/standalone, who shares the state) and home (durable/config/cache/logs/runtime, how durable it is) — over the per-OS directory table, plus an untiered scratch root.
  • A byte-identical TypeScript twin of a Rust fleet crate, kept in sync through a shared parity fixture so the two arms of one capability never split their state.

@sksizer/fleet answers “where does this state live?” for the whole product fleet. A caller builds a Fleet from injected BaseDirs (or Fleet.fromSystem(), which reads the real environment) and addresses a location by naming a tier — vendor() for state shared by every product line, suite(key) for products that share user data, or standalone(tool) for a general tool shipped outside the fleet — and a home, then optionally scopes or apps the path further. Nothing below systemBaseDirs reads the environment directly; a Fleet resolves its roots once at construction, which is what lets a nitro server (which cannot read import.meta.url) and a CLI share one seam by injecting different roots.

It is not the Tauri per-product directory; this package takes no Tauri dependency and is consumed headlessly by the platform server, the Bun CLI fleet, and the ontological CLI.

  • Fleet/FleetTier/FleetPath builder API for tier x home x scope x app addressing
  • systemBaseDirs/rootedBaseDirs for real-environment and test-rooted base directories
  • Fleet.scratch() for the untiered platform temp directory
  • Segment validation (assertSegment) rejecting empty/separator/.. path pieces
  • A parity contract (packages/fleet-parity/parity.json) asserting path-for-path equivalence with the Rust fleet crate
  • packages/ts/fleet/fleet.ts
  • packages/ts/fleet/base-dirs.ts
  • packages/ts/fleet/vendor.ts
  • packages/ts/fleet/tests/parity.test.ts
  • packages/ts/fleet/
  • packages/rust/fleet/

← Back to Capabilities