framework
Version:
The (AI) Framework: turnkey, zero-config AI orchestration that wraps a coding-agent CLI (Claude Code) as a black box and takes you from an idea to a running app. Vite for AI.
66 lines • 3.27 kB
JavaScript
/** The preference key each axis value is stored under. */
const METHOD_KEYS = { browser: 'notifyBrowser', discord: 'notifyDiscord' };
const CATEGORY_KEYS = {
humanIntervention: 'notifyHumanIntervention',
newActivity: 'notifyNewActivity',
};
/**
* What each cell means when nobody has said.
*
* The polarities are not uniform, and that is the point of writing them down once: the browser
* bell and the "needs you" baseline fire unless you turn them off, while everything that reaches
* outward (Discord) or is loosely informative (plain activity) is opt-in.
*/
export const NOTIFICATION_DEFAULTS = {
methods: { browser: true, discord: false },
categories: { humanIntervention: true, newActivity: false },
};
/** Whether a delivery method is switched on, with its default applied. */
export function notifyMethodEnabled(preferences, method) {
return preferences[METHOD_KEYS[method]] ?? NOTIFICATION_DEFAULTS.methods[method];
}
/** Whether a category is switched on, with its default applied. */
export function notifyCategoryEnabled(preferences, category) {
return preferences[CATEGORY_KEYS[category]] ?? NOTIFICATION_DEFAULTS.categories[category];
}
/**
* Whether this cell of the 2×2 delivers: both the method and the category have to be on.
*
* One function rather than an `&&` at each call site — that open-coding is exactly what let a
* category's polarity be wrong in one place and right in another.
*/
export function notifies(preferences, method, category) {
return notifyMethodEnabled(preferences, method) && notifyCategoryEnabled(preferences, category);
}
/**
* How far either way the automatic-consumption slider reaches, in percentage points (#960).
*
* Here rather than in `registry.ts` for the reason this module exists: the slider that writes the
* value is in the browser and the sanitizer that clamps it is in the daemon, so the bound has to
* be one number both can import.
*/
export const MAX_SPEND_OFFSET = 50;
/**
* Where the slider sits before anyone has touched it, in percentage points (#960 Edit): half a
* day's worth of the week's allowance, ahead of the boundary.
*
* Landing exactly on the boundary reads as generous on paper but stops unattended work the moment
* the account is precisely on pace, which is normal jitter rather than overspending. A half-day
* cushion gives it room to breathe without meaningfully loosening the spend-boundary policy (#879).
*/
export const DEFAULT_SPEND_OFFSET = 100 / (7 * 2);
/**
* How many agents the routine keeps going at once when `autoPmConcurrency` is unset (#1204).
*
* Two, not one: the point of the setting is that the routine may overlap work, and a default of
* one would leave the feature invisible until someone finds the control. Two is the smallest
* number that shows it while staying conservative about quota.
*/
export const DEFAULT_AUTO_PM_CONCURRENCY = 2;
/**
* The most agents the routine may be asked to keep going at once (#1204). Like
* {@link MAX_SPEND_OFFSET}, the control that writes the value is in the browser and the sanitizer
* that clamps it is in the daemon, so the bound has to be one number both can import.
*/
export const MAX_AUTO_PM_CONCURRENCY = 10;
//# sourceMappingURL=preference-defaults.js.map