MCPcopy Index your code
hub / github.com/openai/plugins / _bounded_preflight_text

Function _bounded_preflight_text

plugins/codex-security/scripts/workbench_db.py:665–671  ·  view source on GitHub ↗
(value: Any, maximum: int, label: str)

Source from the content-addressed store, hash-verified

663
664
665def _bounded_preflight_text(value: Any, maximum: int, label: str) -> str:
666 if not isinstance(value, str):
667 raise SystemExit(f"Capability preflight {label} must be text.")
668 normalized = value.strip()
669 if not normalized or _javascript_string_length(normalized) > maximum:
670 raise SystemExit(f"Capability preflight {label} must contain 1 to {maximum} characters.")
671 return normalized
672
673
674def _javascript_string_length(value: str) -> int:

Callers 2

Calls 1

Tested by

no test coverage detected