huitzo-cli 0.0.0__py3-none-any.whl

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.
Files changed (41) hide show
  1. huitzo_cli/__init__.py +14 -0
  2. huitzo_cli/auth.py +146 -0
  3. huitzo_cli/commands/__init__.py +1 -0
  4. huitzo_cli/commands/auth.py +61 -0
  5. huitzo_cli/commands/build.py +81 -0
  6. huitzo_cli/commands/config_cmd.py +98 -0
  7. huitzo_cli/commands/dashboard.py +145 -0
  8. huitzo_cli/commands/dev.py +113 -0
  9. huitzo_cli/commands/init.py +142 -0
  10. huitzo_cli/commands/registry.py +105 -0
  11. huitzo_cli/commands/secrets.py +197 -0
  12. huitzo_cli/commands/test.py +56 -0
  13. huitzo_cli/commands/validate.py +64 -0
  14. huitzo_cli/config.py +219 -0
  15. huitzo_cli/docs_server/__init__.py +1 -0
  16. huitzo_cli/docs_server/server.py +128 -0
  17. huitzo_cli/main.py +72 -0
  18. huitzo_cli/sandbox/__init__.py +1 -0
  19. huitzo_cli/sandbox/proxy.py +75 -0
  20. huitzo_cli/templates/dashboard/App.css.j2 +19 -0
  21. huitzo_cli/templates/dashboard/App.tsx.j2 +21 -0
  22. huitzo_cli/templates/dashboard/index.css.j2 +58 -0
  23. huitzo_cli/templates/dashboard/index.html.j2 +13 -0
  24. huitzo_cli/templates/dashboard/main.tsx.j2 +10 -0
  25. huitzo_cli/templates/dashboard/package.json.j2 +19 -0
  26. huitzo_cli/templates/dashboard/tsconfig.json.j2 +25 -0
  27. huitzo_cli/templates/dashboard/tsconfig.node.json.j2 +10 -0
  28. huitzo_cli/templates/dashboard/vite.config.ts.j2 +15 -0
  29. huitzo_cli/templates/pack/.gitignore.j2 +13 -0
  30. huitzo_cli/templates/pack/README.md.j2 +52 -0
  31. huitzo_cli/templates/pack/__init__.py.j2 +3 -0
  32. huitzo_cli/templates/pack/hello.py.j2 +20 -0
  33. huitzo_cli/templates/pack/huitzo.yaml.j2 +11 -0
  34. huitzo_cli/templates/pack/pyproject.toml.j2 +31 -0
  35. huitzo_cli/templates/pack/test_hello.py.j2 +22 -0
  36. huitzo_cli/validator.py +133 -0
  37. huitzo_cli/version.py +14 -0
  38. huitzo_cli-0.0.0.dist-info/METADATA +19 -0
  39. huitzo_cli-0.0.0.dist-info/RECORD +41 -0
  40. huitzo_cli-0.0.0.dist-info/WHEEL +4 -0
  41. huitzo_cli-0.0.0.dist-info/entry_points.txt +2 -0
@@ -0,0 +1,15 @@
1
+ import { defineConfig } from 'vite'
2
+ import react from '@vitejs/plugin-react'
3
+
4
+ export default defineConfig({
5
+ plugins: [react()],
6
+ server: {
7
+ port: 3000,
8
+ proxy: {
9
+ '/api': {
10
+ target: 'http://localhost:8080',
11
+ changeOrigin: true,
12
+ },
13
+ },
14
+ },
15
+ })
@@ -0,0 +1,13 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *.egg-info/
4
+ dist/
5
+ build/
6
+ .pytest_cache/
7
+ .mypy_cache/
8
+ .coverage
9
+ htmlcov/
10
+ .venv/
11
+ venv/
12
+ .env
13
+ .DS_Store
@@ -0,0 +1,52 @@
1
+ # {{ pack_name }}
2
+
3
+ {{ description }}
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install -e .
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```bash
14
+ # Run tests
15
+ pytest tests/ -v
16
+
17
+ # Validate
18
+ huitzo validate
19
+
20
+ # Build
21
+ huitzo build
22
+
23
+ # Develop
24
+ huitzo dev
25
+ ```
26
+
27
+ ## Development
28
+
29
+ This pack includes a simple `hello` command that demonstrates the Huitzo SDK pattern.
30
+
31
+ ### Running Tests
32
+
33
+ ```bash
34
+ pytest tests/ -v --cov=src/{{ module_name }}
35
+ ```
36
+
37
+ ### Type Checking
38
+
39
+ ```bash
40
+ mypy src/ --strict
41
+ ```
42
+
43
+ ### Formatting
44
+
45
+ ```bash
46
+ ruff format .
47
+ ruff check .
48
+ ```
49
+
50
+ ## License
51
+
52
+ Proprietary - Huitzo Inc.
@@ -0,0 +1,3 @@
1
+ """{{ pack_name }} Intelligence Pack."""
2
+
3
+ __version__ = "0.0.0"
@@ -0,0 +1,20 @@
1
+ """
2
+ Module: commands
3
+ Description: Example commands for {{ pack_name }}
4
+
5
+ Implements:
6
+ - docs/sdk/commands.md
7
+ """
8
+
9
+ from huitzo_sdk import Context, command
10
+
11
+
12
+ @command("hello", namespace="{{ namespace }}")
13
+ async def hello_world(args: dict, ctx: Context) -> dict:
14
+ """A simple hello world command.
15
+
16
+ Returns:
17
+ Dictionary with greeting message
18
+ """
19
+ name = args.get("name", "World")
20
+ return {"message": f"Hello, {name}!"}
@@ -0,0 +1,11 @@
1
+ name: {{ pack_name }}
2
+ namespace: {{ namespace }}
3
+ version: 0.0.0
4
+ visibility: private
5
+ description: {{ description }}
6
+ author: {{ author }}
7
+
8
+ commands:
9
+ - name: hello
10
+ description: A simple hello world command
11
+ enabled: true
@@ -0,0 +1,31 @@
1
+ [project]
2
+ name = "{{ pack_name }}"
3
+ version = "0.0.0"
4
+ description = "{{ description }}"
5
+ requires-python = ">=3.11"
6
+ dependencies = ["huitzo-sdk>=0.0.1"]
7
+ authors = [{ name = "{{ author }}", email = "{{ author_email }}" }]
8
+
9
+ [project.optional-dependencies]
10
+ dev = ["pytest>=9.0", "pytest-asyncio>=1.0", "pytest-cov>=7.0", "mypy>=1.19", "ruff>=0.14"]
11
+
12
+ [project.entry-points."huitzo.packs"]
13
+ {{ namespace }} = "{{ module_name }}"
14
+
15
+ [build-system]
16
+ requires = ["hatchling"]
17
+ build-backend = "hatchling.build"
18
+
19
+ [tool.hatch.build.targets.wheel]
20
+ packages = ["src/{{ module_name }}"]
21
+
22
+ [tool.pytest.ini_options]
23
+ asyncio_mode = "auto"
24
+ testpaths = ["tests"]
25
+
26
+ [tool.mypy]
27
+ strict = true
28
+
29
+ [tool.ruff]
30
+ target-version = "py311"
31
+ line-length = 100
@@ -0,0 +1,22 @@
1
+ """
2
+ Module: test_commands
3
+ Description: Tests for {{ pack_name }} commands
4
+ """
5
+
6
+ import pytest
7
+
8
+ from {{ module_name }}.commands import hello_world
9
+
10
+
11
+ @pytest.mark.asyncio
12
+ async def test_hello_world_default() -> None:
13
+ """Test hello_world with default name."""
14
+ result = await hello_world({}, None) # type: ignore
15
+ assert result["message"] == "Hello, World!"
16
+
17
+
18
+ @pytest.mark.asyncio
19
+ async def test_hello_world_with_name() -> None:
20
+ """Test hello_world with custom name."""
21
+ result = await hello_world({"name": "Alice"}, None) # type: ignore
22
+ assert result["message"] == "Hello, Alice!"
@@ -0,0 +1,133 @@
1
+ """
2
+ Module: validator
3
+ Description: Pack validation logic
4
+
5
+ Implements:
6
+ - docs/cli/reference.md#huitzo-validate
7
+ """
8
+
9
+ from pathlib import Path
10
+ from typing import Optional
11
+
12
+ import yaml
13
+ from pydantic import BaseModel, Field
14
+
15
+
16
+ class ValidationResult(BaseModel):
17
+ """Result of pack validation."""
18
+
19
+ valid: bool
20
+ errors: list[str] = Field(default_factory=list)
21
+ warnings: list[str] = Field(default_factory=list)
22
+
23
+
24
+ class PackValidator:
25
+ """Validates Intelligence Pack structure and configuration."""
26
+
27
+ def __init__(self, pack_root: Optional[Path] = None) -> None:
28
+ """Initialize validator.
29
+
30
+ Args:
31
+ pack_root: Root directory of pack. If None, uses current directory.
32
+ """
33
+ self.pack_root = pack_root or Path.cwd()
34
+
35
+ def validate(self, strict: bool = False) -> ValidationResult:
36
+ """Validate pack structure.
37
+
38
+ Args:
39
+ strict: If True, treat warnings as errors
40
+
41
+ Returns:
42
+ ValidationResult with status and messages
43
+ """
44
+ errors = []
45
+ warnings = []
46
+
47
+ # Check pyproject.toml
48
+ pyproject_path = self.pack_root / "pyproject.toml"
49
+ if not pyproject_path.exists():
50
+ errors.append("pyproject.toml not found")
51
+ else:
52
+ try:
53
+ import tomllib # Python 3.11+
54
+ except ImportError:
55
+ try:
56
+ import tomli as tomllib # type: ignore
57
+ except ImportError:
58
+ warnings.append("Could not validate pyproject.toml (tomli not installed)")
59
+
60
+ if "tomllib" in locals():
61
+ try:
62
+ with open(pyproject_path, "rb") as f:
63
+ pyproject = tomllib.load(f)
64
+ if "project" not in pyproject:
65
+ errors.append("pyproject.toml missing [project] section")
66
+ if "project" in pyproject and "entry-points" not in pyproject.get(
67
+ "project", {}
68
+ ):
69
+ warnings.append("pyproject.toml missing huitzo.packs entry point")
70
+ except Exception as e:
71
+ errors.append(f"Invalid pyproject.toml: {e}")
72
+
73
+ # Check huitzo.yaml
74
+ huitzo_yaml_path = self.pack_root / "huitzo.yaml"
75
+ if not huitzo_yaml_path.exists():
76
+ errors.append("huitzo.yaml not found")
77
+ else:
78
+ try:
79
+ with open(huitzo_yaml_path) as f:
80
+ huitzo_config = yaml.safe_load(f)
81
+
82
+ if not huitzo_config:
83
+ errors.append("huitzo.yaml is empty")
84
+ else:
85
+ required_fields = ["name", "namespace", "version", "visibility"]
86
+ for field in required_fields:
87
+ if field not in huitzo_config:
88
+ errors.append(f"huitzo.yaml missing required field: {field}")
89
+
90
+ if huitzo_config.get("visibility") not in ["public", "private"]:
91
+ errors.append("huitzo.yaml visibility must be 'public' or 'private'")
92
+
93
+ except yaml.YAMLError as e:
94
+ errors.append(f"Invalid YAML in huitzo.yaml: {e}")
95
+ except Exception as e:
96
+ errors.append(f"Error reading huitzo.yaml: {e}")
97
+
98
+ # Check source directory
99
+ src_dir = self.pack_root / "src"
100
+ if not src_dir.exists():
101
+ warnings.append("src/ directory not found")
102
+ else:
103
+ # Look for Python packages
104
+ found_package = False
105
+ for item in src_dir.iterdir():
106
+ if item.is_dir() and not item.name.startswith("_"):
107
+ if (item / "__init__.py").exists():
108
+ found_package = True
109
+ break
110
+
111
+ if not found_package:
112
+ warnings.append("No Python package found in src/")
113
+
114
+ # Check tests
115
+ tests_dir = self.pack_root / "tests"
116
+ if not tests_dir.exists():
117
+ warnings.append("tests/ directory not found")
118
+ elif not list(tests_dir.glob("test_*.py")):
119
+ warnings.append("No tests found in tests/ directory")
120
+
121
+ # Check README
122
+ readme_path = self.pack_root / "README.md"
123
+ if not readme_path.exists():
124
+ warnings.append("README.md not found")
125
+
126
+ # Determine validity
127
+ valid = len(errors) == 0
128
+ if strict and len(warnings) > 0:
129
+ errors.extend(warnings)
130
+ warnings = []
131
+ valid = False
132
+
133
+ return ValidationResult(valid=valid, errors=errors, warnings=warnings)
huitzo_cli/version.py ADDED
@@ -0,0 +1,14 @@
1
+ """
2
+ Module: version
3
+ Description: Version management for Huitzo CLI
4
+
5
+ Implements:
6
+ - docs/cli/reference.md#version-management
7
+ """
8
+
9
+ __version__ = "0.0.0"
10
+
11
+
12
+ def get_version() -> str:
13
+ """Get the current version of Huitzo CLI."""
14
+ return __version__
@@ -0,0 +1,19 @@
1
+ Metadata-Version: 2.4
2
+ Name: huitzo-cli
3
+ Version: 0.0.0
4
+ Summary: Huitzo CLI for developers building Intelligence Packs
5
+ Requires-Python: >=3.11
6
+ Requires-Dist: httpx>=0.28
7
+ Requires-Dist: jinja2>=3.1
8
+ Requires-Dist: pydantic>=2.12
9
+ Requires-Dist: pyyaml>=6.0
10
+ Requires-Dist: rich>=14.0
11
+ Requires-Dist: typer>=0.15
12
+ Requires-Dist: websockets>=14.0
13
+ Provides-Extra: dev
14
+ Requires-Dist: mypy>=1.19; extra == 'dev'
15
+ Requires-Dist: pytest-asyncio>=1.0; extra == 'dev'
16
+ Requires-Dist: pytest-cov>=7.0; extra == 'dev'
17
+ Requires-Dist: pytest>=9.0; extra == 'dev'
18
+ Requires-Dist: ruff>=0.14; extra == 'dev'
19
+ Requires-Dist: types-pyyaml>=6.0; extra == 'dev'
@@ -0,0 +1,41 @@
1
+ huitzo_cli/__init__.py,sha256=rXi0M7o7FXheWXfm0_kWGShRql_M9EfbfZ2nx7tWPLM,338
2
+ huitzo_cli/auth.py,sha256=GOjf29E_2cmnf-AquKxAF6ksPywftSmmNJizOB9eo9E,4122
3
+ huitzo_cli/config.py,sha256=WlcykYPcGXS3hmR76N2zVj0gmkFJ98J2yMRf-6Ex0qk,6719
4
+ huitzo_cli/main.py,sha256=LG22LK-6pbq5Nc6NSdwN30zm0BcRpreF5f4BU82Bheg,2543
5
+ huitzo_cli/validator.py,sha256=bjQXHJfWATze5prFky25ZWfpq3_UB21cw3n34GgntFo,4629
6
+ huitzo_cli/version.py,sha256=X38MJD02zKPEiQs2NPuTJmusuYq2GApFMGpQk97Ve3s,254
7
+ huitzo_cli/commands/__init__.py,sha256=YNkZ7ATnYNlwOS-DEIW74vgWaOIJvzfIFn1HmOVDF20,31
8
+ huitzo_cli/commands/auth.py,sha256=FWcpztl1SUr5Vs_7V9D9tcFXRjdRrEoaUIF_4y5gPk4,1600
9
+ huitzo_cli/commands/build.py,sha256=OSA24kbS0egG6wlGs_A0FZrBulitfhcf_HxiTgG4kgs,2275
10
+ huitzo_cli/commands/config_cmd.py,sha256=u21-icm2aauUOGRiRsWKVhE_YaYLH7J-L52XDxTHY4U,2534
11
+ huitzo_cli/commands/dashboard.py,sha256=839kerZkODtUdfuokLYC0iB9EX2oDYcqPXdZAEPuH0k,4320
12
+ huitzo_cli/commands/dev.py,sha256=1bnQ59fQC2qq9NsbVDzJQGsX3JqU58NfZxHdGxOD9Jc,3837
13
+ huitzo_cli/commands/init.py,sha256=WbTjcb9YFJvGPCsy1JTMLv6gma9_Tfg6AzurWm6JDk4,4658
14
+ huitzo_cli/commands/registry.py,sha256=Qj9iuaayMVZ94trQGmhRNSc0uh3gHmWbRr6M30CKnrY,3261
15
+ huitzo_cli/commands/secrets.py,sha256=YNf_1rKhG3RHutYykzlaQOEjxD-8OIRPMzzuc0BN5R8,5325
16
+ huitzo_cli/commands/test.py,sha256=srPMxZbmCZNkIS4Sa9ee3aksjl-_LEq4hwFJaVYunU4,1552
17
+ huitzo_cli/commands/validate.py,sha256=64fvIrqBO4apt8_xOLsDc1Aqw08_YieUVnmcm5S99og,1688
18
+ huitzo_cli/docs_server/__init__.py,sha256=6BJEqm81Wx9o6m_z_ZRi4W-14gDXgmuQR4-k8obFYVQ,34
19
+ huitzo_cli/docs_server/server.py,sha256=Cp-xS8ZnFTkyX83MPc2b5NAeGu7GczU-QBxg1lttSEM,3769
20
+ huitzo_cli/sandbox/__init__.py,sha256=J1QzbAj99cQIpqZtS60vywKYJBfbVcp73AdCYzLcZDo,33
21
+ huitzo_cli/sandbox/proxy.py,sha256=aFQK2am7qKIi8-0wm23HRYUAT1k9ztNIcgBLv8vyRuo,1946
22
+ huitzo_cli/templates/dashboard/App.css.j2,sha256=pzotF_goJ43j1i0_wqp_KGOkJABcL_ORGpZo4npT4-c,286
23
+ huitzo_cli/templates/dashboard/App.tsx.j2,sha256=M05If2Rn6cv7_SxeUljcTJPSh4dzYSEYrMJpmiwNVY8,439
24
+ huitzo_cli/templates/dashboard/index.css.j2,sha256=pqQuFpxWX4t_eztzLagms9vPehfv2OmFqZt7_ruGQ48,1012
25
+ huitzo_cli/templates/dashboard/index.html.j2,sha256=kMOjEKOcv6ejRunEs0A-Crg5yY_X-jO7Fjxsq5rRqAw,369
26
+ huitzo_cli/templates/dashboard/main.tsx.j2,sha256=q-DtwfkfXUFLv7jzNfiHG0v07fB6hhqyJeNoqDGc22s,236
27
+ huitzo_cli/templates/dashboard/package.json.j2,sha256=bf8FyKHFYl8w5CDkY9a_cUOokLLCgobv7TOXfjwT75Q,356
28
+ huitzo_cli/templates/dashboard/tsconfig.json.j2,sha256=BG6lfE_8LplHIMqd5OPBd6zRwxxTiaOFDOe8KPhpink,610
29
+ huitzo_cli/templates/dashboard/tsconfig.node.json.j2,sha256=niq7Fp6oe3GQYTodTaV8pghGOkU71CMfo67uXjCDcN0,213
30
+ huitzo_cli/templates/dashboard/vite.config.ts.j2,sha256=i5FZ3EkTsB5x5gxpceCSsovWTYVwaqbfOCD1jGQWSUk,280
31
+ huitzo_cli/templates/pack/.gitignore.j2,sha256=5115hcJm0aZjbAdN4hi5SOzj9fZnpdOJpCPbKQKUKK0,123
32
+ huitzo_cli/templates/pack/README.md.j2,sha256=MZIIb_7Ly8jpVT9U-uRJZXdo3_PwBxNpVdkym2VVagw,534
33
+ huitzo_cli/templates/pack/__init__.py.j2,sha256=h_TKjqd9FIhEUvpWabPb8HMiOcdwfmtf0FbBNIgEJ1Y,64
34
+ huitzo_cli/templates/pack/hello.py.j2,sha256=Dozx-RxN711P0SmdvNQ4yAqh0wp1FHezyeUxfno4cqs,441
35
+ huitzo_cli/templates/pack/huitzo.yaml.j2,sha256=sFYvosFq7dRfx56_YgqNevvLqj_y4iwvnA-fSV3xjyc,227
36
+ huitzo_cli/templates/pack/pyproject.toml.j2,sha256=PzdvzNSPlhZAkTuOVbiGsxpHkTE8Ww0N1CX70dzQkQU,721
37
+ huitzo_cli/templates/pack/test_hello.py.j2,sha256=9WMn4WHdfs_VOc5NyjhDAiavuz69SEC2wB1Wt9_u9U0,601
38
+ huitzo_cli-0.0.0.dist-info/METADATA,sha256=wcZ77913cDwb3LBOqL_O9ZmagRamSjmNzu9s9DTMcng,631
39
+ huitzo_cli-0.0.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
40
+ huitzo_cli-0.0.0.dist-info/entry_points.txt,sha256=noYI3TUYA5pKyOF57Bmq9EtuiV0LKKQa735njC6HiMk,47
41
+ huitzo_cli-0.0.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.28.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ huitzo = huitzo_cli.main:app