feat(tsl-codegen): add decoupled documentation toolkit

Generate TSL API Markdown from YAML or JSON into a configurable project scope.\nAdd file and directory lint modes, tags-aware indexing, and keyword search across tags and descriptions.\nBundle the toolkit through the playbook build and sync workflows.
This commit is contained in:
csh
2026-07-20 09:08:38 +08:00
parent 1d5304e7b6
commit c69278283f
18 changed files with 13955 additions and 12821 deletions
+7 -3
View File
@@ -19,12 +19,13 @@ def build_agents_text(ruleset_path: Path) -> str:
return text.rstrip("\n") + "\n"
def ensure_sources(repo_root: Path) -> tuple[Path, Path, Path, Path]:
def ensure_sources(repo_root: Path) -> tuple[Path, Path, Path, Path, Path]:
docs_tsl = repo_root / "docs" / "tsl"
syntax_skill = repo_root / "skills" / "tsl-syntax-reference"
api_skill = repo_root / "skills" / "tsl-api-reference"
ruleset = repo_root / "rulesets" / "tsl" / "index.md"
sources = (docs_tsl, syntax_skill, api_skill, ruleset)
codegen_toolkit = repo_root / "tools" / "tsl-codegen"
sources = (docs_tsl, syntax_skill, api_skill, ruleset, codegen_toolkit)
missing = [str(path) for path in sources if not path.exists()]
if missing:
raise FileNotFoundError("missing source path(s): " + ", ".join(missing))
@@ -47,7 +48,9 @@ def clean_output(output: Path, repo_root: Path) -> None:
def build(output: Path, repo_root: Path) -> None:
docs_tsl, syntax_skill, api_skill, ruleset = ensure_sources(repo_root)
docs_tsl, syntax_skill, api_skill, ruleset, codegen_toolkit = ensure_sources(
repo_root
)
clean_output(output, repo_root)
(output / "AGENTS.md").write_text(
@@ -56,6 +59,7 @@ def build(output: Path, repo_root: Path) -> None:
copy_tree(docs_tsl, output / "docs" / "tsl")
copy_tree(syntax_skill, output / "skills" / "tsl-syntax-reference")
copy_tree(api_skill, output / "skills" / "tsl-api-reference")
copy_tree(codegen_toolkit, output / "tools" / "tsl-codegen")
def main(argv=None) -> int: