jaymd96-pants-clawthor 0.1.1__tar.gz → 0.1.3__tar.gz
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.
- {jaymd96_pants_clawthor-0.1.1 → jaymd96_pants_clawthor-0.1.3}/PKG-INFO +1 -1
- {jaymd96_pants_clawthor-0.1.1 → jaymd96_pants_clawthor-0.1.3}/pyproject.toml +1 -1
- {jaymd96_pants_clawthor-0.1.1 → jaymd96_pants_clawthor-0.1.3}/src/pants_clawthor/register.py +1 -6
- jaymd96_pants_clawthor-0.1.3/src/pants_clawthor/rules.py +85 -0
- jaymd96_pants_clawthor-0.1.1/src/pants_clawthor/rules.py +0 -57
- {jaymd96_pants_clawthor-0.1.1 → jaymd96_pants_clawthor-0.1.3}/.gitignore +0 -0
- {jaymd96_pants_clawthor-0.1.1 → jaymd96_pants_clawthor-0.1.3}/BUILD +0 -0
- {jaymd96_pants_clawthor-0.1.1 → jaymd96_pants_clawthor-0.1.3}/LICENSE +0 -0
- {jaymd96_pants_clawthor-0.1.1 → jaymd96_pants_clawthor-0.1.3}/MANIFEST.in +0 -0
- {jaymd96_pants_clawthor-0.1.1 → jaymd96_pants_clawthor-0.1.3}/README.md +0 -0
- {jaymd96_pants_clawthor-0.1.1 → jaymd96_pants_clawthor-0.1.3}/src/pants_clawthor/__init__.py +0 -0
- {jaymd96_pants_clawthor-0.1.1 → jaymd96_pants_clawthor-0.1.3}/src/pants_clawthor/targets.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: jaymd96-pants-clawthor
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.3
|
|
4
4
|
Summary: Pants plugin for compiling Clawthor Claude Code plugins
|
|
5
5
|
Project-URL: Homepage, https://github.com/anthropics/clawthor
|
|
6
6
|
Project-URL: Documentation, https://github.com/anthropics/clawthor/tree/main/pants-plugin
|
{jaymd96_pants_clawthor-0.1.1 → jaymd96_pants_clawthor-0.1.3}/src/pants_clawthor/register.py
RENAMED
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
"""Register clawthor plugin with Pants."""
|
|
2
2
|
|
|
3
|
-
from pants.engine.rules import collect_rules
|
|
4
|
-
from pants.engine.target import TargetRuleset
|
|
5
|
-
|
|
6
3
|
from pants_clawthor.rules import rules as clawthor_rules
|
|
7
4
|
from pants_clawthor.targets import ClaudoPluginTarget
|
|
8
5
|
|
|
9
6
|
|
|
10
7
|
def rules():
|
|
11
8
|
"""Register all rules for the clawthor plugin."""
|
|
12
|
-
return [
|
|
13
|
-
*collect_rules(clawthor_rules),
|
|
14
|
-
]
|
|
9
|
+
return [*clawthor_rules()]
|
|
15
10
|
|
|
16
11
|
|
|
17
12
|
def target_types():
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"""Build rules for Clawthor plugin compilation."""
|
|
2
|
+
|
|
3
|
+
import subprocess
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
|
|
6
|
+
from pants.engine.console import Console
|
|
7
|
+
from pants.engine.goal import Goal, GoalSubsystem
|
|
8
|
+
from pants.engine.rules import collect_rules, goal_rule
|
|
9
|
+
from pants.engine.target import Targets
|
|
10
|
+
|
|
11
|
+
from pants_clawthor.targets import (
|
|
12
|
+
ClaudoPluginDefinitionField,
|
|
13
|
+
ClaudoPluginMarketplaceModeField,
|
|
14
|
+
ClaudoPluginOutputDirField,
|
|
15
|
+
ClaudoPluginTarget,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class ClawthorCompileSubsystem(GoalSubsystem):
|
|
20
|
+
name = "clawthor-compile"
|
|
21
|
+
help = "Compile Clawthor definitions into Claude Code plugins."
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class ClawthorCompile(Goal):
|
|
25
|
+
subsystem_cls = ClawthorCompileSubsystem
|
|
26
|
+
environment_behavior = Goal.EnvironmentBehavior.LOCAL_ONLY
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
@goal_rule
|
|
30
|
+
async def clawthor_compile(
|
|
31
|
+
targets: Targets,
|
|
32
|
+
console: Console,
|
|
33
|
+
) -> ClawthorCompile:
|
|
34
|
+
"""Compile Clawthor definitions into Claude Code plugins."""
|
|
35
|
+
exit_code = 0
|
|
36
|
+
|
|
37
|
+
claude_targets = [t for t in targets if isinstance(t, ClaudoPluginTarget)]
|
|
38
|
+
|
|
39
|
+
if not claude_targets:
|
|
40
|
+
console.print_stderr("No claude_plugin targets found.")
|
|
41
|
+
return ClawthorCompile(exit_code=1)
|
|
42
|
+
|
|
43
|
+
for target in claude_targets:
|
|
44
|
+
definition_file = target[ClaudoPluginDefinitionField].value
|
|
45
|
+
output_dir = target[ClaudoPluginOutputDirField].value
|
|
46
|
+
marketplace_mode = target[ClaudoPluginMarketplaceModeField].value.lower() == "true"
|
|
47
|
+
|
|
48
|
+
# Build clawthor command
|
|
49
|
+
cmd = ["clawthor", "compile", definition_file, output_dir]
|
|
50
|
+
if marketplace_mode:
|
|
51
|
+
cmd.append("--marketplace")
|
|
52
|
+
|
|
53
|
+
spec_path = target.address.spec_path or "."
|
|
54
|
+
console.print_stdout(
|
|
55
|
+
f"Compiling {target.address} ({definition_file} -> {output_dir}/)..."
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
try:
|
|
59
|
+
result = subprocess.run(
|
|
60
|
+
cmd,
|
|
61
|
+
cwd=spec_path,
|
|
62
|
+
capture_output=True,
|
|
63
|
+
text=True,
|
|
64
|
+
check=False,
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
if result.returncode != 0:
|
|
68
|
+
console.print_stderr(f"Compilation failed for {target.address}:")
|
|
69
|
+
console.print_stderr(result.stderr)
|
|
70
|
+
exit_code = 1
|
|
71
|
+
else:
|
|
72
|
+
console.print_stdout(f"Successfully compiled {target.address}")
|
|
73
|
+
if result.stdout.strip():
|
|
74
|
+
console.print_stdout(result.stdout.strip())
|
|
75
|
+
except FileNotFoundError:
|
|
76
|
+
console.print_stderr(
|
|
77
|
+
"clawthor command not found. Install the clawthor gem: gem install clawthor"
|
|
78
|
+
)
|
|
79
|
+
exit_code = 1
|
|
80
|
+
|
|
81
|
+
return ClawthorCompile(exit_code=exit_code)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def rules():
|
|
85
|
+
return collect_rules()
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"""Build rules for Clawthor plugin compilation."""
|
|
2
|
-
|
|
3
|
-
import os
|
|
4
|
-
import shutil
|
|
5
|
-
import subprocess
|
|
6
|
-
from pathlib import Path
|
|
7
|
-
|
|
8
|
-
from pants.engine.engine_types import ProcessResult
|
|
9
|
-
from pants.engine.fs import Digest, MergedDigest
|
|
10
|
-
from pants.engine.process import Process, ProcessResult
|
|
11
|
-
from pants.engine.rules import rule
|
|
12
|
-
from pants.engine.target import Target
|
|
13
|
-
from pants.util.dirutil import safe_mkdir
|
|
14
|
-
|
|
15
|
-
from pants_clawthor.targets import ClaudoPluginTarget
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
@rule
|
|
19
|
-
async def compile_claude_plugin(target: ClaudoPluginTarget) -> ProcessResult:
|
|
20
|
-
"""Compile a Clawthor definition into a Claude Code plugin."""
|
|
21
|
-
|
|
22
|
-
definition_file = target[ClaudoPluginDefinitionField].value
|
|
23
|
-
output_dir = target[ClaudoPluginOutputDirField].value
|
|
24
|
-
marketplace_mode = target[ClaudoPluginMarketplaceModeField].value.lower() == "true"
|
|
25
|
-
|
|
26
|
-
# Build clawthor command
|
|
27
|
-
cmd = ["clawthor", "compile", definition_file, output_dir]
|
|
28
|
-
if marketplace_mode:
|
|
29
|
-
cmd.append("--marketplace")
|
|
30
|
-
|
|
31
|
-
# Run clawthor
|
|
32
|
-
try:
|
|
33
|
-
result = subprocess.run(
|
|
34
|
-
cmd,
|
|
35
|
-
cwd=target.address.spec_path,
|
|
36
|
-
capture_output=True,
|
|
37
|
-
text=True,
|
|
38
|
-
check=False,
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
if result.returncode != 0:
|
|
42
|
-
raise RuntimeError(
|
|
43
|
-
f"Clawthor compilation failed:\n{result.stderr}"
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
return ProcessResult(
|
|
47
|
-
exit_code=result.returncode,
|
|
48
|
-
stdout=result.stdout,
|
|
49
|
-
stderr=result.stderr,
|
|
50
|
-
)
|
|
51
|
-
except FileNotFoundError:
|
|
52
|
-
raise RuntimeError(
|
|
53
|
-
"clawthor command not found. Install the clawthor gem: gem install clawthor"
|
|
54
|
-
)
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
rules = [compile_claude_plugin]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{jaymd96_pants_clawthor-0.1.1 → jaymd96_pants_clawthor-0.1.3}/src/pants_clawthor/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|