@activefs/config
v0.1.1
Published
Unified ActiveFS state-root configuration, auth, and policy helpers.
Readme
@activefs/config
Install @activefs/config when host code needs to discover or manage an
ActiveFS state root programmatically. Most users should let the activefs CLI
create and update .activefs/config.json.
The package requires Node.js 22 or newer.
Install
npm install @activefs/configRead workspace configuration
Run this example from a project directory:
import {
loadActiveFSConfig,
resolveActiveFSState
} from "@activefs/config";
const state = resolveActiveFSState(process.cwd());
const config = await loadActiveFSConfig(state.stateDir);
console.log(state.stateDir);
console.log(Object.keys(config.remotes));In a new project, the remote list is empty. Loading missing configuration does not create files; write helpers create the state directory only when they save configuration.
What this package owns
- state-root discovery and canonical state paths;
.activefs/config.jsonloading, normalization, and saving;- remote descriptors and optional mountpoint associations; and
- host-managed auth-provider descriptors and local policy helpers.
Configuration describes how to reach a source. It does not become the authority for source data or final access decisions. Store credential descriptors in config, not raw Source API secrets; the source still interprets identity and policy.
