flybrain/packages/brain/src/index.ts
acamilo 660c3cf00d
Some checks failed
ci / node 22 (test + typecheck) (push) Has been cancelled
ci / rust stable (cargo test --workspace --release) (push) Has been cancelled
ci / infra/tests/lint.sh (push) Has been cancelled
ci / playwright apps/stage (allowed to fail) (push) Has been cancelled
flybrain v0.4.0: public tree (history retained privately)
2026-09-21 15:09:46 +00:00

68 lines
2.2 KiB
TypeScript

/**
* `@flybrain/brain` public API.
*
* Loaders are subpath exports (`@flybrain/brain/node`, `@flybrain/brain/browser`) so a bundle
* never pulls in `node:zlib` and a server never depends on `DecompressionStream`.
*/
// Dataset layer: connectome artifact format, validation and fingerprinting.
export type { BrainDataset, BrainMetadata, CircuitRoles, Sha256Hex } from './dataset/format';
export { fingerprintDataset, validateDataset } from './dataset/format';
// Model layer: the LIF kernel, its reward-modulated plasticity, the retina projection and the
// deterministic RNG they share.
export { Xorshift32 } from './model/rng';
export { DEFAULT_RETINA_CONFIG, projectFrame, type RetinaColumns, type RetinaConfig } from './model/retina';
export {
DEFAULT_PLASTICITY_CONFIG,
PLASTICITY_VERSION,
Plasticity,
RewardModulatedStdp,
plasticityVersion,
type LearningStats,
type PlasticityConfig,
type PlasticityState,
} from './model/plasticity';
export {
DEFAULT_LIF_CONFIG,
FlyBrain,
LifNetwork,
MAX_RATE_ROLES,
NEURAL_KERNEL_VERSION,
kernelVersion,
type LifConfig,
type LifState,
} from './model/lif';
// Readout layer: population-rate decoding of network activity into output channels.
export { PopulationDecoder } from './readout/decoder';
export type { DecoderConfig, DecoderState, ExclusiveGroup, LegacyDecoderState, PulseChannel } from './readout/decoder';
export { GAMEBOY_BUTTONS, GAMEBOY_BUTTON_BITS, fromButtonMask, gameboyDecoderConfig, toButtonMask } from './readout/presets/gameboy';
export type { GameboyButton } from './readout/presets/gameboy';
export { platformerDecoderConfig } from './readout/presets/platformer';
// Agent layer: the environment-agnostic loop that composes the three layers above, plus the
// checkpoint envelope a host writes it to.
export {
DEFAULT_STIMULATION_MS,
DEFAULT_WARMUP_MS,
GAMEBOY_MS_PER_FRAME,
NeuralAgent,
type AgentConfig,
type AgentSnapshot,
type AgentState,
type RewardEvent,
type TickOptions,
type TickResult,
} from './agent/agent';
export {
AGENT_CHUNK_NAMES,
ENVELOPE_SCHEMA_VERSION,
agentFromChunks,
agentToChunks,
decodeEnvelope,
encodeEnvelope,
type AgentManifest,
type EnvelopeManifest,
type EnvelopeParts,
} from './agent/envelope';