zouroboros-core
v2.0.0
Published
Core types, configuration, and utilities for Zouroboros
Downloads
20
Readme
zouroboros-core
Core types, configuration, and utilities for Zouroboros
Installation
npm install zouroboros-core
# or
pnpm add zouroboros-coreUsage
import {
loadConfig,
saveConfig,
setConfigValue,
DEFAULT_CONFIG,
ZouroborosConfig
} from 'zouroboros-core';
// Load configuration
const config = loadConfig();
// Get a nested value
const dbPath = getConfigValue<string>(config, 'memory.dbPath');
// Update configuration
const updated = setConfigValue(config, 'memory.autoCapture', false);
saveConfig(updated);
// Initialize new configuration
const newConfig = await initConfig({
workspaceRoot: '/home/workspace',
dataDir: '/home/user/.zouroboros'
});API
Types
All core types are exported from this package:
ZouroborosConfig- Main configuration interfaceMemoryConfig,MemoryEntry,EpisodicMemory- Memory system typesSwarmConfig,SwarmCampaign,SwarmTask- Swarm orchestration typesPersona,SafetyRule- Persona management typesSeedSpec,EvaluationReport- Workflow types- And more...
Configuration
loadConfig(path?)- Load configuration from filesaveConfig(config, path?)- Save configuration to fileinitConfig(options?)- Initialize new configurationgetConfigValue(config, path)- Get nested config valuesetConfigValue(config, path, value)- Set nested config valuevalidateConfig(config)- Validate configuration structuremergeConfig(partial)- Merge partial config with defaults
Constants
DEFAULT_CONFIG- Default configuration objectDEFAULT_CONFIG_PATH- Default configuration file pathZOUROBOROS_VERSION- Current versionDECAY_DAYS- Memory decay periodsCOMPLEXITY_THRESHOLDS- Complexity scoring thresholds- And more...
Utilities
generateUUID()- Generate UUID v4now()- Get current ISO timestampretry(fn, options)- Retry with exponential backoffformatBytes(bytes)- Format bytes to human readableformatDuration(ms)- Format milliseconds to durationdeepMerge(target, source)- Deep merge objects- And more...
License
MIT
