@voodocs/cli 0.4.2 → 1.0.0
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/CHANGELOG.md +312 -0
- package/lib/cli/__init__.py +53 -0
- package/lib/cli/benchmark.py +311 -0
- package/lib/cli/fix.py +244 -0
- package/lib/cli/generate.py +310 -0
- package/lib/cli/test_cli.py +215 -0
- package/lib/cli/validate.py +364 -0
- package/lib/darkarts/__init__.py +11 -5
- package/lib/darkarts/annotations/__init__.py +11 -3
- package/lib/darkarts/annotations/darkarts_parser.py +1 -1
- package/lib/darkarts/annotations/types.py +16 -3
- package/lib/darkarts/cli_darkarts.py +1 -1
- package/lib/darkarts/context/__init__.py +11 -3
- package/lib/darkarts/context/ai_integrations.py +7 -21
- package/lib/darkarts/context/commands.py +1 -1
- package/lib/darkarts/context/diagram.py +8 -22
- package/lib/darkarts/context/models.py +7 -22
- package/lib/darkarts/context/module_utils.py +1 -1
- package/lib/darkarts/context/ui.py +1 -1
- package/lib/darkarts/context/validation.py +1 -1
- package/lib/darkarts/context/yaml_utils.py +8 -23
- package/lib/darkarts/core/__init__.py +12 -2
- package/lib/darkarts/core/interface.py +16 -2
- package/lib/darkarts/core/loader.py +17 -2
- package/lib/darkarts/core/plugin.py +16 -3
- package/lib/darkarts/core/registry.py +17 -2
- package/lib/darkarts/exceptions.py +17 -3
- package/lib/darkarts/plugins/voodocs/__init__.py +12 -2
- package/lib/darkarts/plugins/voodocs/ai_native_plugin.py +16 -5
- package/lib/darkarts/plugins/voodocs/annotation_validator.py +16 -3
- package/lib/darkarts/plugins/voodocs/api_spec_generator.py +16 -3
- package/lib/darkarts/plugins/voodocs/documentation_generator.py +16 -3
- package/lib/darkarts/plugins/voodocs/html_exporter.py +16 -3
- package/lib/darkarts/plugins/voodocs/instruction_generator.py +1 -1
- package/lib/darkarts/plugins/voodocs/pdf_exporter.py +16 -3
- package/lib/darkarts/plugins/voodocs/test_generator.py +16 -3
- package/lib/darkarts/telemetry.py +16 -3
- package/lib/darkarts/validation/README.md +147 -0
- package/lib/darkarts/validation/__init__.py +91 -0
- package/lib/darkarts/validation/autofix.py +297 -0
- package/lib/darkarts/validation/benchmark.py +426 -0
- package/lib/darkarts/validation/benchmark_wrapper.py +22 -0
- package/lib/darkarts/validation/config.py +257 -0
- package/lib/darkarts/validation/performance.py +412 -0
- package/lib/darkarts/validation/performance_wrapper.py +37 -0
- package/lib/darkarts/validation/semantic.py +461 -0
- package/lib/darkarts/validation/semantic_wrapper.py +77 -0
- package/lib/darkarts/validation/test_validation.py +160 -0
- package/lib/darkarts/validation/types.py +97 -0
- package/lib/darkarts/validation/watch.py +239 -0
- package/package.json +19 -6
- package/voodocs_cli.py +28 -0
- package/cli.py +0 -1646
- package/lib/darkarts/cli.py +0 -128
package/lib/darkarts/cli.py
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Command-line interface for DarkArts.
|
|
3
|
-
"""
|
|
4
|
-
|
|
5
|
-
import sys
|
|
6
|
-
import argparse
|
|
7
|
-
from pathlib import Path
|
|
8
|
-
from darkarts.core import DarkArts
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
def main():
|
|
12
|
-
"""Main CLI entry point."""
|
|
13
|
-
parser = argparse.ArgumentParser(
|
|
14
|
-
description="DarkArts - General-purpose AI reasoning platform",
|
|
15
|
-
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
16
|
-
epilog="""
|
|
17
|
-
Examples:
|
|
18
|
-
# Solve a math problem
|
|
19
|
-
darkarts solve "Solve x^2 + 5x + 6 = 0" --plugin math
|
|
20
|
-
|
|
21
|
-
# Generate code documentation
|
|
22
|
-
darkarts solve myfile.py --plugin voodocs --file
|
|
23
|
-
|
|
24
|
-
# Auto-detect plugin
|
|
25
|
-
darkarts solve "Find the largest n where n^2 < 100"
|
|
26
|
-
|
|
27
|
-
# List available plugins
|
|
28
|
-
darkarts list
|
|
29
|
-
"""
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
subparsers = parser.add_subparsers(dest="command", help="Command to execute")
|
|
33
|
-
|
|
34
|
-
# Solve command
|
|
35
|
-
solve_parser = subparsers.add_parser("solve", help="Solve a problem")
|
|
36
|
-
solve_parser.add_argument("input", help="Problem text or file path")
|
|
37
|
-
solve_parser.add_argument("--plugin", "-p", help="Plugin to use (auto-detect if not specified)")
|
|
38
|
-
solve_parser.add_argument("--file", "-f", action="store_true", help="Treat input as file path")
|
|
39
|
-
solve_parser.add_argument("--explain", "-e", action="store_true", help="Generate explanation")
|
|
40
|
-
solve_parser.add_argument("--level", "-l", default="student",
|
|
41
|
-
choices=["student", "teacher", "expert"],
|
|
42
|
-
help="Explanation level")
|
|
43
|
-
solve_parser.add_argument("--output", "-o", help="Output file path")
|
|
44
|
-
|
|
45
|
-
# List command
|
|
46
|
-
list_parser = subparsers.add_parser("list", help="List available plugins")
|
|
47
|
-
|
|
48
|
-
# Parse arguments
|
|
49
|
-
args = parser.parse_args()
|
|
50
|
-
|
|
51
|
-
if not args.command:
|
|
52
|
-
parser.print_help()
|
|
53
|
-
return 1
|
|
54
|
-
|
|
55
|
-
# Initialize DarkArts
|
|
56
|
-
da = DarkArts()
|
|
57
|
-
|
|
58
|
-
if args.command == "list":
|
|
59
|
-
return list_plugins(da)
|
|
60
|
-
|
|
61
|
-
elif args.command == "solve":
|
|
62
|
-
return solve_problem(da, args)
|
|
63
|
-
|
|
64
|
-
return 0
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
def list_plugins(da: DarkArts) -> int:
|
|
68
|
-
"""List available plugins."""
|
|
69
|
-
print("Available Plugins:")
|
|
70
|
-
print("=" * 60)
|
|
71
|
-
|
|
72
|
-
for plugin in da.list_plugins():
|
|
73
|
-
print(f"\n{plugin.name} v{plugin.version}")
|
|
74
|
-
print(f" {plugin.description}")
|
|
75
|
-
print(f" Capabilities: {', '.join(plugin.capabilities)}")
|
|
76
|
-
if plugin.dependencies:
|
|
77
|
-
print(f" Dependencies: {', '.join(plugin.dependencies)}")
|
|
78
|
-
|
|
79
|
-
print()
|
|
80
|
-
return 0
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
def solve_problem(da: DarkArts, args) -> int:
|
|
84
|
-
"""Solve a problem."""
|
|
85
|
-
# Get input
|
|
86
|
-
if args.file:
|
|
87
|
-
try:
|
|
88
|
-
input_text = Path(args.input).read_text()
|
|
89
|
-
except Exception as e:
|
|
90
|
-
print(f"Error reading file: {e}", file=sys.stderr)
|
|
91
|
-
return 1
|
|
92
|
-
else:
|
|
93
|
-
input_text = args.input
|
|
94
|
-
|
|
95
|
-
# Solve
|
|
96
|
-
try:
|
|
97
|
-
result = da.solve(input_text, plugin=args.plugin)
|
|
98
|
-
except Exception as e:
|
|
99
|
-
print(f"Error: {e}", file=sys.stderr)
|
|
100
|
-
return 1
|
|
101
|
-
|
|
102
|
-
if not result.success:
|
|
103
|
-
print(f"Failed: {result.error}", file=sys.stderr)
|
|
104
|
-
return 1
|
|
105
|
-
|
|
106
|
-
# Output result
|
|
107
|
-
output_text = str(result.result)
|
|
108
|
-
|
|
109
|
-
if args.explain:
|
|
110
|
-
explanation = da.explain(result, level=args.level, plugin=args.plugin)
|
|
111
|
-
output_text = f"{output_text}\n\n{'=' * 60}\nExplanation:\n{'=' * 60}\n\n{explanation}"
|
|
112
|
-
|
|
113
|
-
# Write output
|
|
114
|
-
if args.output:
|
|
115
|
-
try:
|
|
116
|
-
Path(args.output).write_text(output_text)
|
|
117
|
-
print(f"Output written to: {args.output}")
|
|
118
|
-
except Exception as e:
|
|
119
|
-
print(f"Error writing output: {e}", file=sys.stderr)
|
|
120
|
-
return 1
|
|
121
|
-
else:
|
|
122
|
-
print(output_text)
|
|
123
|
-
|
|
124
|
-
return 0
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
if __name__ == "__main__":
|
|
128
|
-
sys.exit(main())
|