INNER CODE UNIT · Python

text_files

uvwt/agentdock · core-skills/skill-authoring/run.py:131

def text_files(source: Path) -> list[Path]:
    files: list[Path] = []
    for path in sorted(source.rglob("*")):
        if path.is_symlink() or not path.is_file():
            continue
        if path.name == "SKILL.md" or path.suffix.lower() in TEXT_SUFFIXES:
            files.append(path)
        if len(files) > MAX_FILES:
            fail("TOO_MANY_FILES", f"Skill contains more than {MAX_FILES} text files")
    return files


def line_number(content: str, offset: int) -> int:
    return content.count("\n", 0, offset) + 1


ADVISORY_MARKERS = (
    "不得", "禁止", "不应", "不要", "明确废弃", "硬错误", "检查以下",

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…