Skip to content

armgit / orca

Public Imported from GitHub
0

Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

906 B
Raw Blame
import { measureUtf8ByteLength } from './utf8-byte-limits'

export const MAX_ORCA_YAML_BYTES = 256 * 1024
export const MAX_ORCA_YAML_CODE_UNITS = 256 * 1024
export const MAX_ORCA_YAML_FIELD_BYTES = 64 * 1024
export const MAX_ORCA_YAML_FIELD_CODE_UNITS = 64 * 1024
export const MAX_ORCA_YAML_COLLECTION_ENTRIES = 256
// Keep ordinary anchor reuse; map merge conversion has a separate work budget.
export const MAX_ORCA_YAML_ALIAS_COUNT = 100

export function isOrcaYamlTextWithinLimit(content: string): boolean {
  return (
    content.length <= MAX_ORCA_YAML_CODE_UNITS &&
    !measureUtf8ByteLength(content, { stopAfterBytes: MAX_ORCA_YAML_BYTES }).exceededLimit
  )
}

export function isOrcaYamlFieldWithinLimit(value: string): boolean {
  return (
    value.length <= MAX_ORCA_YAML_FIELD_CODE_UNITS &&
    !measureUtf8ByteLength(value, { stopAfterBytes: MAX_ORCA_YAML_FIELD_BYTES }).exceededLimit
  )
}