Skip to content

Commit 3941720

Browse files
authored
Merge pull request #186 from vstorm-co/0.3.39
refactor: remove old folders and bump to 0.3.39
2 parents 04c802b + 3540759 commit 3941720

71 files changed

Lines changed: 203 additions & 1487 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.3.39] - 2026-07-26
9+
10+
The pre-`features/` import paths are gone.
11+
12+
### Removed
13+
14+
- **`pydantic_deep.toolsets`, `pydantic_deep.capabilities`, `pydantic_deep.processors` and `pydantic_deep.improve` are deleted** (`pydantic_deep/__init__.py`). Every feature moved into `pydantic_deep/features/<name>/` in 0.3.34, which said the old deep import paths would be removed in the next minor release; since then the four packages have been deprecation shims, re-exporting the moved names and warning on import. They are now removed — `features/` is the only import location.
15+
- The blessed top-level surface is unchanged: `from pydantic_deep import SkillsToolset, HooksCapability, EvictionCapability, ...` still works, and `tests/test_public_api.py` (replacing `tests/test_feature_shims.py`) asserts each re-export is the same object as the one in its feature package.
16+
- Deep imports must move to the feature package: `pydantic_deep.toolsets.memory``pydantic_deep.features.memory`, `pydantic_deep.capabilities.hooks``pydantic_deep.features.hooks`, `pydantic_deep.processors.eviction``pydantic_deep.features.eviction`, `pydantic_deep.improve``pydantic_deep.features.improve`, and likewise for `context`, `browser`, `skills`, `plan`, `teams`, `forking`, `checkpointing`, `liteparse`, `patch`, `history_archive`, `message_queue`, `stuck_loop`, `periodic_reminder`.
17+
- Logger names follow the modules: code filtering on `pydantic_deep.capabilities.hooks` or `pydantic_deep.capabilities.periodic_reminder` should now use `pydantic_deep.features.hooks.capability` / `pydantic_deep.features.periodic_reminder.capability`.
18+
19+
### Fixed
20+
21+
- **`examples/skills_usage.py` discovery demos run again** (`examples/skills_usage.py`). `--discover` and `--load` imported `discover_skills` / `load_skill_instructions`, which stopped existing well before the reorg, so both modes died on `ImportError`. They now use `SkillsDirectory.get_skills()` and read `Skill` attributes instead of dict keys.
22+
823
## [0.3.38] - 2026-07-24
924

1025
MCP resources and skills reach the model, the CLI talks to any

CLAUDE.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
2424
- `pydantic_deep/` — Core library (agent, deps, models, instructions, types)
2525
- `pydantic_deep/features/<name>/` — One vertical-slice package per feature
2626
(`capability.py` + `toolset.py` + `service.py`/`types.py`). Organize by
27-
feature, not by kind. The old `toolsets/`, `capabilities/`, and `processors/`
28-
paths now hold deprecation shims that re-export from `features/`.
27+
feature, not by kind — `features/` is the only import location; the old
28+
`toolsets/`, `capabilities/`, `processors/` and `improve/` shims were removed
29+
in 0.3.39.
2930
- `apps/cli/` — CLI + TUI application (Textual-based terminal AI assistant)
3031
- `apps/deepresearch/` — Full-featured research reference app
3132
- `tests/` — Unit tests
@@ -50,7 +51,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
5051
- `DockerSandbox`: Isolated Docker container execution
5152
- `CompositeBackend`: Combines multiple backends with routing
5253

53-
**Toolsets (`pydantic_deep/toolsets/`)**
54+
**Toolsets (`pydantic_deep/features/<name>/toolset.py`)**
5455
- `TodoToolset`: Task planning and tracking tools (read_todos, write_todos) - from [pydantic-ai-todo](https://github.com/vstorm-co/pydantic-ai-todo)
5556
- `create_console_toolset`: File operations (ls, read, write, edit, glob, grep, execute) - from [pydantic-ai-backend](https://github.com/vstorm-co/pydantic-ai-backend)
5657
- `SubAgentToolset`: Spawn and delegate to subagents - from [subagents-pydantic-ai](https://github.com/vstorm-co/subagents-pydantic-ai)
@@ -114,12 +115,12 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
114115
- Hook methods: `before_tool_execute`, `after_tool_execute`, `on_tool_execute_error`
115116
- `EXIT_ALLOW = 0`, `EXIT_DENY = 2`: Claude Code exit code conventions
116117

117-
**Capabilities (`pydantic_deep/capabilities/`)**
118+
**Capabilities (`pydantic_deep/features/<name>/capability.py`)**
118119
- `SkillsCapability`: Injects skills system prompt and manages skill discovery
119120
- `ContextFilesCapability`: Auto-discovers and injects context files (DEEP.md, AGENTS.md, CLAUDE.md, SOUL.md)
120121
- `MemoryCapability`: Persistent memory management with read/write/update tools
121-
- `TeamCapability`: Agent team coordination and management
122-
- `PlanCapability`: Planning mode with ask_user + save_plan tools
122+
- `BrowserCapability`, `StuckLoopDetection`, `PeriodicReminderCapability`,
123+
`HooksCapability`, `EvictionCapability`, `PatchToolCallsCapability`
123124
- All extend pydantic-ai's `AbstractCapability`
124125

125126
**Persistent Memory (`pydantic_deep/features/memory/`)**
@@ -235,7 +236,7 @@ agent = create_deep_agent(
235236
```python
236237
from pydantic_deep import create_deep_agent
237238
from pydantic_ai_shields import CostTracking
238-
from pydantic_deep.capabilities.hooks import HooksCapability, Hook, HookEvent
239+
from pydantic_deep.features.hooks import HooksCapability, Hook, HookEvent
239240

240241
agent = create_deep_agent(
241242
model="anthropic:claude-sonnet-4-6",

docs/api/capabilities.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,31 @@ conceptual overview.
99

1010
## SkillsCapability
1111

12-
::: pydantic_deep.capabilities.SkillsCapability
12+
::: pydantic_deep.features.skills.SkillsCapability
1313
options:
1414
show_source: false
1515

1616
## ContextFilesCapability
1717

18-
::: pydantic_deep.capabilities.ContextFilesCapability
18+
::: pydantic_deep.features.context.ContextFilesCapability
1919
options:
2020
show_source: false
2121

2222
## MemoryCapability
2323

24-
::: pydantic_deep.capabilities.MemoryCapability
24+
::: pydantic_deep.features.memory.MemoryCapability
2525
options:
2626
show_source: false
2727

2828
## BrowserCapability
2929

30-
::: pydantic_deep.capabilities.BrowserCapability
30+
::: pydantic_deep.features.browser.BrowserCapability
3131
options:
3232
show_source: false
3333

3434
## StuckLoopDetection
3535

36-
::: pydantic_deep.capabilities.StuckLoopDetection
36+
::: pydantic_deep.features.stuck_loop.StuckLoopDetection
3737
options:
3838
show_source: false
3939

@@ -43,7 +43,7 @@ conceptual overview.
4343

4444
## PeriodicReminderCapability
4545

46-
::: pydantic_deep.capabilities.PeriodicReminderCapability
46+
::: pydantic_deep.features.periodic_reminder.PeriodicReminderCapability
4747
options:
4848
show_source: false
4949

docs/api/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ Complete API documentation for pydantic-deep.
88
|--------|-------------|
99
| [`pydantic_deep.agent`](agent.md) | Agent factory and configuration |
1010
| [Backends](backends.md) | Storage backends (via [pydantic-ai-backend](https://github.com/vstorm-co/pydantic-ai-backend)) |
11-
| [`pydantic_deep.toolsets`](toolsets.md) | Tool collections |
12-
| [`pydantic_deep.capabilities`](capabilities.md) | Lifecycle capabilities |
13-
| [`pydantic_deep.processors`](processors.md) | History processors |
11+
| [Toolsets](toolsets.md) | Tool collections |
12+
| [Capabilities](capabilities.md) | Lifecycle capabilities |
13+
| [Processors](processors.md) | History processors |
1414
| [`pydantic_deep.mcp`](mcp.md) | MCP client support |
1515
| [Forking](forking.md) | Live Run Forking (parallel branches) |
1616
| [`pydantic_deep.spec`](spec.md) | Declarative agent specs (YAML/JSON) |
@@ -60,7 +60,7 @@ from pydantic_deep import (
6060
# Toolsets (from their respective packages)
6161
from pydantic_ai_backends import create_console_toolset
6262
from pydantic_ai_todo import create_todo_toolset
63-
from pydantic_deep.toolsets import SubAgentToolset, SkillsToolset
63+
from pydantic_deep import SubAgentToolset, SkillsToolset
6464
```
6565

6666
### Creating an Agent

docs/c4/2-architecture-overview.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -598,32 +598,32 @@ flowchart LR
598598
| **Dependencies** | BackendProtocol, UploadedFile, FileData, Todo types |
599599
| **Location** | `pydantic_deep/deps.py` |
600600

601-
### Module: Toolsets (`toolsets/`)
601+
### Module: Toolsets (`features/*/toolset.py`)
602602

603603
| Attribute | Details |
604604
|-----------|---------|
605605
| **Purpose** | Provide tools the agent can call |
606606
| **Key Components** | 9 toolsets spanning planning, filesystem, subagents, skills, checkpoints, memory, teams |
607607
| **Dependencies** | pydantic-ai FunctionToolset, pydantic-ai-backend, pydantic-ai-todo, subagents-pydantic-ai |
608-
| **Location** | `pydantic_deep/toolsets/` |
608+
| **Location** | `pydantic_deep/features/<name>/toolset.py` |
609609

610-
### Module: Capabilities (`capabilities/`)
610+
### Module: Capabilities (`features/*/capability.py`)
611611

612612
| Attribute | Details |
613613
|-----------|---------|
614614
| **Purpose** | Wrap toolsets into pydantic-ai's capability interface |
615615
| **Key Components** | 6 capabilities, each a thin adapter layer |
616-
| **Dependencies** | toolsets.*, pydantic-ai AbstractCapability |
617-
| **Location** | `pydantic_deep/capabilities/` |
616+
| **Dependencies** | features.*, pydantic-ai AbstractCapability |
617+
| **Location** | `pydantic_deep/features/<name>/capability.py` |
618618

619-
### Module: Processors (`processors/`)
619+
### Module: Processors (`features/{eviction,patch,history_archive}/`)
620620

621621
| Attribute | Details |
622622
|-----------|---------|
623623
| **Purpose** | Transform message history before sending to LLM |
624624
| **Key Components** | 2 processors + 1 search toolset |
625625
| **Dependencies** | pydantic-ai messages, pydantic-ai-backend BackendProtocol |
626-
| **Location** | `pydantic_deep/processors/` |
626+
| **Location** | `pydantic_deep/features/{eviction,patch,history_archive}/` |
627627

628628
---
629629

@@ -651,4 +651,4 @@ flowchart LR
651651

652652
---
653653

654-
*This architecture documentation follows the C4 model for visualizing software architecture. For implementation details, refer to the source code and API documentation.*
654+
*This architecture documentation follows the C4 model for visualizing software architecture. For implementation details, refer to the source code and API documentation.*

docs/c4/4b-deep-dive-toolsets-and-capabilities.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ Wraps `AgentMemoryToolset` with both tools and instruction injection.
480480

481481
### 4. PlanCapability
482482

483-
**Source:** `pydantic_deep/capabilities/plan.py`
483+
**Source:** `pydantic_deep/features/plan/`
484484

485485
Wraps `create_plan_toolset()` providing `ask_user` and `save_plan` tools.
486486

@@ -507,7 +507,7 @@ Wraps `SkillsToolset` with skill discovery, loading, and instruction injection.
507507

508508
### 6. TeamCapability
509509

510-
**Source:** `pydantic_deep/capabilities/teams.py`
510+
**Source:** `pydantic_deep/features/teams/`
511511

512512
Wraps `create_team_toolset()` for multi-agent coordination.
513513

@@ -915,4 +915,4 @@ class XxxCapability(AbstractCapability[Any]):
915915
| MemoryCapability | Yes | Yes |
916916
| PlanCapability | Yes | No |
917917
| SkillsCapability | Yes | Yes |
918-
| TeamCapability | Yes | No |
918+
| TeamCapability | Yes | No |

docs/concepts/agents.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ See [Structured Output](../learn/structured-output.md) for more details.
299299
Automatically summarize long conversations:
300300

301301
```python
302-
from pydantic_deep.processors import create_summarization_processor
302+
from pydantic_deep import create_summarization_processor
303303

304304
processor = create_summarization_processor(
305305
trigger=("tokens", 100000),

examples/security_gate/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Security Gate Example
22

3-
Demonstrates [`default_security_hook()`][pydantic_deep.capabilities.hooks.default_security_hook]
3+
Demonstrates [`default_security_hook()`][pydantic_deep.features.hooks.default_security_hook]
44
the built-in safety preset that blocks destructive commands, path-traversal
55
writes, and credential reads, plus redacts secret-shaped tokens from tool output.
66

examples/security_gate/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import asyncio
1111

1212
from pydantic_deep import default_security_hook
13-
from pydantic_deep.capabilities.hooks import DEFAULT_BLOCKED_COMMANDS, HookEvent, HookInput
13+
from pydantic_deep.features.hooks import DEFAULT_BLOCKED_COMMANDS, HookEvent, HookInput
1414

1515

1616
def _pre_input(tool_name: str, args: dict[str, object]) -> HookInput:

examples/skills_usage.py

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -101,38 +101,35 @@ def get_user_data(user_id):
101101

102102

103103
async def demo_skill_discovery():
104-
"""Demonstrate skill discovery from multiple directories."""
105-
from pydantic_deep.toolsets.skills import discover_skills
104+
"""Demonstrate skill discovery from a directory."""
105+
from pydantic_deep.features.skills import SkillsDirectory
106106

107107
print("Discovering skills from:", SKILLS_DIR)
108108
print()
109109

110-
skills = discover_skills([{"path": str(SKILLS_DIR), "recursive": True}])
111-
112-
for skill in skills:
113-
print(f"Skill: {skill['name']}")
114-
print(f" Description: {skill['description']}")
115-
print(f" Version: {skill['version']}")
116-
print(f" Tags: {', '.join(skill['tags'])}")
117-
print(f" Path: {skill['path']}")
118-
if skill.get("resources"):
119-
print(f" Resources: {', '.join(skill['resources'])}")
110+
for uri, skill in SkillsDirectory(path=SKILLS_DIR).get_skills().items():
111+
print(f"Skill: {skill.name}")
112+
print(f" Description: {skill.description}")
113+
print(f" URI: {uri}")
114+
if skill.resources:
115+
print(f" Resources: {', '.join(r.name for r in skill.resources)}")
116+
if skill.scripts:
117+
print(f" Scripts: {', '.join(s.name for s in skill.scripts)}")
120118
print()
121119

122120

123121
async def demo_skill_loading():
124122
"""Demonstrate loading full skill instructions."""
125-
from pydantic_deep.toolsets.skills import discover_skills, load_skill_instructions
123+
from pydantic_deep.features.skills import SkillsDirectory
126124

127-
skills = discover_skills([{"path": str(SKILLS_DIR), "recursive": True}])
125+
skills = list(SkillsDirectory(path=SKILLS_DIR).get_skills().values())
128126

129127
if skills:
130128
skill = skills[0]
131-
print(f"Loading full instructions for: {skill['name']}")
129+
print(f"Loading full instructions for: {skill.name}")
132130
print("=" * 60)
133131

134-
instructions = load_skill_instructions(skill["path"])
135-
print(instructions[:500] + "..." if len(instructions) > 500 else instructions)
132+
print(skill.content[:500] + "..." if len(skill.content) > 500 else skill.content)
136133

137134

138135
if __name__ == "__main__":

0 commit comments

Comments
 (0)