@stratusagent/state
v0.6.0
Published
Shared Stratus state wiring: config resolution, credential storage, the soul roster, file-backed agent memory, and provider construction — used by the CLI and the gateway alike
Readme
@stratusagent/state
Shared Stratus state wiring — the code that knows where ~/.stratus lives and how to turn it into a running agent:
- Config resolution:
resolveRuntimeConfigwith the full precedence chain (flags/selection →STRATUS_*env vars → config file → defaults), including the trust rules that keep stored credentials away from endpoints chosen by auto-discovered project configs. - Credentials:
loadCredentials/saveCredentialsfor~/.stratus/credentials.json(written 0600). - Soul roster:
loadRosterSoulsreads~/.stratus/agents/*.md;loadSoulFileparses one soul with path-seeded identity. - Agent memory:
createFileMemoryStore(append-only JSONL keyed by agent id) plusmigrateLegacyMemoryfor pre-global memory files. - Provider wiring:
createRuntimeProviderbuilds the right provider (demo / OpenAI-compatible / Anthropic API / Claude Code subscription runtime) from a resolved config, fallback model included.
Both @stratusagent/cli and @stratusagent/gateway depend on this package — the CLI depends on the gateway for stratus serve, so this layer exists to keep that dependency acyclic. Every function takes a StateEnvironment (processEnv / cwd / homeDir overrides) instead of touching process globals, so hosts and tests pin their own world.
