canopy-agent-factory 1.0.0__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.
- canopy_agent_factory-1.0.0/.gitignore +18 -0
- canopy_agent_factory-1.0.0/PKG-INFO +45 -0
- canopy_agent_factory-1.0.0/README.md +38 -0
- canopy_agent_factory-1.0.0/canopy_agent_factory/__init__.py +28 -0
- canopy_agent_factory-1.0.0/canopy_agent_factory/_factory.py +874 -0
- canopy_agent_factory-1.0.0/pyproject.toml +23 -0
- canopy_agent_factory-1.0.0/tests/__init__.py +0 -0
- canopy_agent_factory-1.0.0/tests/test_factory.py +428 -0
- canopy_agent_factory-1.0.0/tests/test_templates_baseline.py +46 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
__pycache__/
|
|
2
|
+
*.pyc
|
|
3
|
+
.venv/
|
|
4
|
+
*.egg-info/
|
|
5
|
+
dist/
|
|
6
|
+
build/
|
|
7
|
+
.pytest_cache/
|
|
8
|
+
uv.lock
|
|
9
|
+
.superpowers/
|
|
10
|
+
.gstack/
|
|
11
|
+
.claude/settings.local.json
|
|
12
|
+
.claude/worktrees/
|
|
13
|
+
node_modules/
|
|
14
|
+
# package-lock.json is COMMITTED on purpose. CI ran a bare `npm install`, which
|
|
15
|
+
# re-resolves from the live registry on every run — so the gws-mcp gate reddened on
|
|
16
|
+
# every open branch at once when npm's resolver choked (`Cannot read properties of
|
|
17
|
+
# null (reading 'edgesOut')`, canopy#594), and could equally have gone GREEN on a
|
|
18
|
+
# tree nobody had tested. A gate whose inputs move under it is not a gate.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: canopy-agent-factory
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Stamp out a new Claude Code agent from the canopy operating model — a self-contained, zero-runtime-dependency factory. Pip-installable into canopy / canopy-web / any second consumer.
|
|
5
|
+
Requires-Python: >=3.11
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
|
|
8
|
+
# canopy-agent-factory
|
|
9
|
+
|
|
10
|
+
Stamp out a new Claude Code agent from the canopy operating model — a persona, the `turn`
|
|
11
|
+
orchestrator, reads-free / writes-gated guarding via a config-driven PreToolUse hook, and a
|
|
12
|
+
canopy-web-ready layout. Extracted from the `canopy` distribution's
|
|
13
|
+
`src/orchestrator/agent_factory.py` so a second consumer (canopy-web, a Django app) can
|
|
14
|
+
scaffold an agent repo without inheriting canopy's video-tooling dependency footprint
|
|
15
|
+
(Pillow, NumPy).
|
|
16
|
+
|
|
17
|
+
Zero runtime dependencies. Versions independently of `canopy`.
|
|
18
|
+
|
|
19
|
+
## Public API
|
|
20
|
+
|
|
21
|
+
```python
|
|
22
|
+
from canopy_agent_factory import AgentSpec, create_agent, normalize_slug, AgentFactoryError
|
|
23
|
+
from canopy_agent_factory import templates, gating_config # canonical stamp-table baseline
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
- `AgentSpec` — dataclass describing the agent to scaffold.
|
|
27
|
+
- `create_agent(spec, target_dir, *, force=False) -> list[Path]` — writes the templated
|
|
28
|
+
files into `target_dir` (caller-supplied; this function does no `git init` and no other
|
|
29
|
+
I/O beyond writing the scaffold) and returns the paths it wrote.
|
|
30
|
+
- `normalize_slug(raw) -> str` — validate + normalize an agent slug.
|
|
31
|
+
- `AgentFactoryError` — raised for bad input or an unsafe target directory.
|
|
32
|
+
- `templates() -> Mapping[str, str]` — the canonical stamp table (repo-relative path →
|
|
33
|
+
rendered-template source), read-only. Ground truth for "what a factory-stamped agent
|
|
34
|
+
looks like"; used by canopy's fleet-alignment lens to diff real agent repos against the
|
|
35
|
+
baseline.
|
|
36
|
+
- `gating_config() -> str` — the canonical `config/gating.json` body a stamped agent ships
|
|
37
|
+
with.
|
|
38
|
+
|
|
39
|
+
## Development
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
uv run --with pytest pytest -q
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Runs standalone — no orchestrator import, no Django.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# canopy-agent-factory
|
|
2
|
+
|
|
3
|
+
Stamp out a new Claude Code agent from the canopy operating model — a persona, the `turn`
|
|
4
|
+
orchestrator, reads-free / writes-gated guarding via a config-driven PreToolUse hook, and a
|
|
5
|
+
canopy-web-ready layout. Extracted from the `canopy` distribution's
|
|
6
|
+
`src/orchestrator/agent_factory.py` so a second consumer (canopy-web, a Django app) can
|
|
7
|
+
scaffold an agent repo without inheriting canopy's video-tooling dependency footprint
|
|
8
|
+
(Pillow, NumPy).
|
|
9
|
+
|
|
10
|
+
Zero runtime dependencies. Versions independently of `canopy`.
|
|
11
|
+
|
|
12
|
+
## Public API
|
|
13
|
+
|
|
14
|
+
```python
|
|
15
|
+
from canopy_agent_factory import AgentSpec, create_agent, normalize_slug, AgentFactoryError
|
|
16
|
+
from canopy_agent_factory import templates, gating_config # canonical stamp-table baseline
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
- `AgentSpec` — dataclass describing the agent to scaffold.
|
|
20
|
+
- `create_agent(spec, target_dir, *, force=False) -> list[Path]` — writes the templated
|
|
21
|
+
files into `target_dir` (caller-supplied; this function does no `git init` and no other
|
|
22
|
+
I/O beyond writing the scaffold) and returns the paths it wrote.
|
|
23
|
+
- `normalize_slug(raw) -> str` — validate + normalize an agent slug.
|
|
24
|
+
- `AgentFactoryError` — raised for bad input or an unsafe target directory.
|
|
25
|
+
- `templates() -> Mapping[str, str]` — the canonical stamp table (repo-relative path →
|
|
26
|
+
rendered-template source), read-only. Ground truth for "what a factory-stamped agent
|
|
27
|
+
looks like"; used by canopy's fleet-alignment lens to diff real agent repos against the
|
|
28
|
+
baseline.
|
|
29
|
+
- `gating_config() -> str` — the canonical `config/gating.json` body a stamped agent ships
|
|
30
|
+
with.
|
|
31
|
+
|
|
32
|
+
## Development
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
uv run --with pytest pytest -q
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Runs standalone — no orchestrator import, no Django.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"""canopy-agent-factory — stamp out a new Claude Code agent from the canopy operating model.
|
|
2
|
+
|
|
3
|
+
Zero-runtime-dependency, published separately from the `canopy` distribution so a second
|
|
4
|
+
consumer (e.g. a Django web app) can scaffold an agent repo without inheriting canopy's
|
|
5
|
+
video-tooling dependency footprint (Pillow, NumPy). See `_factory.py` for the implementation;
|
|
6
|
+
this module re-exports only the public surface.
|
|
7
|
+
"""
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from ._factory import (
|
|
11
|
+
AgentFactoryError,
|
|
12
|
+
AgentSpec,
|
|
13
|
+
create_agent,
|
|
14
|
+
gating_config,
|
|
15
|
+
normalize_slug,
|
|
16
|
+
templates,
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
__all__ = [
|
|
20
|
+
"AgentFactoryError",
|
|
21
|
+
"AgentSpec",
|
|
22
|
+
"create_agent",
|
|
23
|
+
"gating_config",
|
|
24
|
+
"normalize_slug",
|
|
25
|
+
"templates",
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
__version__ = "1.0.0"
|