diff --git a/.ai/environment/tools.ai.yaml b/.ai/environment/tools.ai.yaml index 66be9aa..968e9c1 100644 --- a/.ai/environment/tools.ai.yaml +++ b/.ai/environment/tools.ai.yaml @@ -1,5 +1,5 @@ schema_version: 1 -generated_at_utc: "2026-03-21T04:01:27Z" +generated_at_utc: "2026-03-21T04:47:58Z" generated_from: ".ai/environment/tools.raw.yaml" generator: "scripts/generate-ai-environment.py" platform: diff --git a/.ai/environment/tools.raw.yaml b/.ai/environment/tools.raw.yaml index 6f1c959..523817d 100644 --- a/.ai/environment/tools.raw.yaml +++ b/.ai/environment/tools.raw.yaml @@ -1,5 +1,5 @@ schema_version: 1 -generated_at_utc: "2026-03-21T04:00:19Z" +generated_at_utc: "2026-03-21T04:47:28Z" generator: "scripts/collect-dev-environment.sh" platform: diff --git a/scripts/collect-dev-environment.sh b/scripts/collect-dev-environment.sh index af79bb0..8a76f2b 100644 --- a/scripts/collect-dev-environment.sh +++ b/scripts/collect-dev-environment.sh @@ -266,13 +266,3 @@ if [[ "${MODE}" == "--write" ]]; then else collect_inventory fi - -ensure_supported_mode - -if [[ "${MODE}" == "--write" ]]; then - mkdir -p "$(dirname "${OUTPUT_PATH}")" - collect_inventory > "${OUTPUT_PATH}" - printf 'Wrote %s\n' "${OUTPUT_PATH}" -else - collect_inventory -fi diff --git a/scripts/generate-ai-environment.py b/scripts/generate-ai-environment.py index 4bccbc5..0ecbdb4 100644 --- a/scripts/generate-ai-environment.py +++ b/scripts/generate-ai-environment.py @@ -76,6 +76,18 @@ def available_tool(raw: dict[str, Any], section: str, name: str) -> bool: return bool_value(raw, section, name, "installed") +def select_tool( + use_for: str, + preferred: str | None, + fallback: str | None, +) -> dict[str, str]: + return { + "preferred": choose(preferred, fallback), + "fallback": fallback or "unavailable", + "use_for": use_for, + } + + def build_ai_inventory(raw: dict[str, Any]) -> dict[str, Any]: has_python = available_tool(raw, "required_runtimes", "python3") has_node = available_tool(raw, "required_runtimes", "node") @@ -86,36 +98,36 @@ def build_ai_inventory(raw: dict[str, Any]) -> dict[str, Any]: has_bash = available_tool(raw, "required_tools", "bash") has_docker = available_tool(raw, "project_tools", "docker") - search = { - "preferred": choose("rg" if has_rg else None, "grep"), - "fallback": "grep" if has_rg else "unavailable", - "use_for": "Repository text search.", - } - json = { - "preferred": choose("jq" if has_jq else None, "python3" if has_python else None), - "fallback": "python3" if has_jq and has_python else "unavailable", - "use_for": "Inspecting or transforming JSON command output.", - } - scripting = { - "preferred": choose("python3" if has_python else None, "bash" if has_bash else None), - "fallback": "bash" if has_python and has_bash else "unavailable", - "use_for": "Non-trivial local automation and helper scripts.", - } - shell = { - "preferred": choose("bash" if has_bash else None, "sh"), - "fallback": "sh" if has_bash else "unavailable", - "use_for": "Repository shell scripts and command execution.", - } - docs = { - "preferred": choose("bun" if has_bun else None, "npm" if has_node else None), - "fallback": "npm" if has_bun and has_node else "unavailable", - "use_for": "Installing and previewing the docs site.", - } - build = { - "preferred": choose("dotnet" if has_dotnet else None, None), - "fallback": "unavailable", - "use_for": "Build, test, restore, and solution validation.", - } + search = select_tool( + use_for="Repository text search.", + preferred="rg" if has_rg else None, + fallback="grep", + ) + json = select_tool( + use_for="Inspecting or transforming JSON command output.", + preferred="jq" if has_jq else None, + fallback="python3" if has_python else None, + ) + scripting = select_tool( + use_for="Non-trivial local automation and helper scripts.", + preferred="python3" if has_python else None, + fallback="bash" if has_bash else None, + ) + shell = select_tool( + use_for="Repository shell scripts and command execution.", + preferred="bash" if has_bash else None, + fallback="sh", + ) + docs = select_tool( + use_for="Installing and previewing the docs site.", + preferred="bun" if has_bun else None, + fallback="npm" if has_node else None, + ) + build = select_tool( + use_for="Build, test, restore, and solution validation.", + preferred="dotnet" if has_dotnet else None, + fallback=None, + ) if bool_value(raw, "platform", "wsl"): platform_family = "wsl-linux"