pdo-agent 2.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.
- pdo/__init__.py +21 -0
- pdo/agent/__init__.py +6 -0
- pdo/agent/core.py +275 -0
- pdo/agent/delegate.py +56 -0
- pdo/agent/executor.py +87 -0
- pdo/agent/memory.py +191 -0
- pdo/agent/messages.py +87 -0
- pdo/agent/planner.py +38 -0
- pdo/agent/reviewer.py +25 -0
- pdo/agent/router.py +37 -0
- pdo/api.py +65 -0
- pdo/banner.py +53 -0
- pdo/config.py +151 -0
- pdo/llm.py +211 -0
- pdo/logging_setup.py +34 -0
- pdo/main.py +961 -0
- pdo/mcp.py +264 -0
- pdo/prompts/system.md +46 -0
- pdo/providers.py +86 -0
- pdo/rag.py +191 -0
- pdo/serve.py +124 -0
- pdo/skills.py +59 -0
- pdo/theme.py +47 -0
- pdo/tools/__init__.py +6 -0
- pdo/tools/base.py +89 -0
- pdo/tools/code.py +48 -0
- pdo/tools/data.py +57 -0
- pdo/tools/edit.py +55 -0
- pdo/tools/filesystem.py +175 -0
- pdo/tools/git.py +44 -0
- pdo/tools/memory.py +70 -0
- pdo/tools/rag.py +60 -0
- pdo/tools/registry.py +203 -0
- pdo/tools/search.py +83 -0
- pdo/tools/shell.py +125 -0
- pdo/tools/web.py +163 -0
- pdo_agent-2.0.0.dist-info/METADATA +456 -0
- pdo_agent-2.0.0.dist-info/RECORD +42 -0
- pdo_agent-2.0.0.dist-info/WHEEL +5 -0
- pdo_agent-2.0.0.dist-info/entry_points.txt +2 -0
- pdo_agent-2.0.0.dist-info/licenses/LICENSE +21 -0
- pdo_agent-2.0.0.dist-info/top_level.txt +1 -0
pdo/logging_setup.py
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"""Structured logging configuration.
|
|
2
|
+
|
|
3
|
+
Logs go to a rotating file under the PDO logs directory (never to stdout, which
|
|
4
|
+
is reserved for the interactive session). Only the ``pdo`` logger namespace is
|
|
5
|
+
configured so we don't interfere with a host application's logging.
|
|
6
|
+
"""
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
import logging
|
|
10
|
+
from logging.handlers import RotatingFileHandler
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
|
|
13
|
+
from .config import get_logs_dir
|
|
14
|
+
|
|
15
|
+
_LOG_FORMAT = "%(asctime)s %(levelname)-7s %(name)s: %(message)s"
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def configure_logging(level: int = logging.INFO) -> Path:
|
|
19
|
+
"""Configure file logging for the ``pdo`` namespace and return the log path."""
|
|
20
|
+
log_path = get_logs_dir() / "pdo.log"
|
|
21
|
+
|
|
22
|
+
handler = RotatingFileHandler(
|
|
23
|
+
log_path, maxBytes=1_000_000, backupCount=3, encoding="utf-8"
|
|
24
|
+
)
|
|
25
|
+
handler.setFormatter(logging.Formatter(_LOG_FORMAT))
|
|
26
|
+
|
|
27
|
+
pdo_logger = logging.getLogger("pdo")
|
|
28
|
+
pdo_logger.setLevel(level)
|
|
29
|
+
pdo_logger.handlers.clear()
|
|
30
|
+
pdo_logger.addHandler(handler)
|
|
31
|
+
# Don't propagate to the root logger; we own this namespace's output.
|
|
32
|
+
pdo_logger.propagate = False
|
|
33
|
+
|
|
34
|
+
return log_path
|