Skip to content

Configuration

The EdictStore constructor accepts an options object:

const store = new EdictStore(options);
PropertyTypeDefaultDescription
pathstring'./edicts.yaml'Path to the edicts file on disk
format'yaml' | 'json'Inferred from extensionStorage format. Auto-detected from file extension
maxEdictsnumber200Maximum number of active edicts
tokenBudgetnumber4000Maximum total token budget for all edicts
tokenizer(text: string) => numberchars / 4Custom tokenizer function for token counting
categoriesstring[][] (any allowed)Allowlist of permitted categories. Empty = no restriction
renderer(edicts: Edict[]) => stringBuilt-in rendererCustom renderer function for render() output
staleThresholdDaysnumber90Days before a durable edict is flagged as stale in review()
categoryLimitsRecord<string, number>undefinedPer-category soft limits. e.g., { product: 30, internal: 20 }
defaultCategoryLimitnumberundefinedDefault soft limit for categories not in categoryLimits
defaultEphemeralTtlSecondsnumber86400 (24h)Default TTL for ephemeral edicts with no explicit expiry
autoSavebooleantrueAuto-save after mutations and prune operations
const store = new EdictStore();
// Uses ./edicts.yaml, 200 max edicts, 4K token budget
const store = new EdictStore({
path: '/shared/edicts.yaml',
tokenBudget: 1000,
maxEdicts: 50,
autoSave: false, // Read-only for cron agents
});
const store = new EdictStore({
path: './edicts.yaml',
tokenBudget: 4000,
maxEdicts: 200,
categories: ['product', 'compliance', 'operations', 'team'],
categoryLimits: { product: 50, compliance: 30 },
staleThresholdDays: 60,
});
const store = new EdictStore({
path: './edicts.json',
// format auto-detected from .json extension
});
import { encode } from 'gpt-tokenizer';
const store = new EdictStore({
tokenizer: (text) => encode(text).length,
});