const section = (items) => ({
    count: items.length,
    tokens: items.reduce((n, i) => n + i.tokens, 0),
    items,
});
export function toPackVM(pack) {
    const essential = section(pack.essential);
    const supporting = section(pack.supporting);
    const optional = section(pack.optional);
    return {
        essential,
        supporting,
        optional,
        totals: { tokens: essential.tokens + supporting.tokens + optional.tokens },
    };
}
