ai-push-hooks 0.1.14 → 0.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -24,9 +24,9 @@ pnpm add -D ai-push-hooks
24
24
 
25
25
  Requirements:
26
26
 
27
- - Python 3.10+ (`python3` or `python`) is required, including npm installs.
28
- - `opencode-cli` (or `opencode`) is required for `llm` and `apply` steps.
29
- - `gh` is required only if you use PR creation via `gh_pr_create`.
27
+ - [Python 3.10+](https://www.python.org/downloads/) (`python3` or `python`) is required, including npm installs.
28
+ - [OpenCode CLI](https://github.com/sst/opencode) is required for `llm` and `apply` steps. The expected executable is `opencode`; `opencode-cli` is also accepted for compatibility.
29
+ - [GitHub CLI (`gh`)](https://cli.github.com/manual/installation) is required only if you use PR creation via `gh_pr_create`.
30
30
 
31
31
  ## Quick start
32
32
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-push-hooks",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "description": "Modular AI push-hook workflow runner",
5
5
  "license": "MIT",
6
6
  "repository": {
package/pyproject.toml CHANGED
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ai-push-hooks"
7
- version = "0.1.14"
7
+ version = "0.1.15"
8
8
  description = "Modular AI push-hook workflow runner"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -1,7 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import json
4
- import os
5
4
  import pathlib
6
5
  import re
7
6
  import shutil
@@ -26,24 +25,14 @@ def sanitize_filename_component(value: str) -> str:
26
25
  return cleaned.strip("-") or "value"
27
26
 
28
27
 
29
- def prefer_opencode_cli_candidate(candidate: str) -> str:
30
- path = pathlib.Path(candidate)
31
- if path.name != "opencode":
32
- return candidate
33
- sibling = path.with_name("opencode-cli")
34
- if sibling.exists() and os.access(sibling, os.X_OK):
35
- return str(sibling)
36
- return candidate
37
-
38
-
39
28
  def resolve_opencode_executable() -> str:
29
+ opencode_path = shutil.which("opencode")
30
+ if opencode_path:
31
+ return opencode_path
40
32
  cli_path = shutil.which("opencode-cli")
41
33
  if cli_path:
42
34
  return cli_path
43
- opencode_path = shutil.which("opencode")
44
- if opencode_path:
45
- return prefer_opencode_cli_candidate(opencode_path)
46
- raise HookError("opencode is required but not installed")
35
+ raise HookError("opencode (or opencode-cli) is required but not installed")
47
36
 
48
37
 
49
38
  def parse_opencode_json_run_output(raw: str) -> tuple[str | None, str]: