Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go
1.2 KB
Raw Blame
// User-facing limits enforced symmetrically on the front-end (UI counter +
// disabled save) and the back-end (handler validation + DB CHECK constraint).
// Kept in core so both apps and the test suite read from one source.
export const AGENT_DESCRIPTION_MAX_LENGTH = 255;

/**
 * Description length the way the server counts it: Unicode code points
 * (`utf8.RuneCountInString` in the handler, `char_length` in the DB check),
 * not UTF-16 units. `"πŸ˜€".length` is 2 but counts as 1 here. Use this for the
 * counter and every save/submit gate so they always agree.
 */
export function agentDescriptionLength(description: string): number {
  return [...description].length;
}

export function isAgentDescriptionWithinLimit(description: string): boolean {
  return agentDescriptionLength(description) <= AGENT_DESCRIPTION_MAX_LENGTH;
}

export const AGENT_CONVERSATION_STARTERS_MAX = 3;
export const AGENT_CONVERSATION_STARTER_LABEL_MAX_LENGTH = 80;
export const AGENT_CONVERSATION_STARTER_MAX_LENGTH = 4000;

// Valid range for the per-agent scheduler cap. Kept here so creation,
// duplication, and settings editing cannot silently drift.
export const AGENT_MAX_CONCURRENT_TASKS_MIN = 1;
export const AGENT_MAX_CONCURRENT_TASKS_MAX = 50;