agentic-cli 0.3.3__tar.gz → 0.4.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.
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/.gitignore +1 -1
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/CHANGELOG.md +30 -0
- agentic_cli-0.4.0/CLAUDE.md +151 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/PKG-INFO +41 -14
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/README.md +39 -13
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/environment.yml +1 -0
- agentic_cli-0.4.0/examples/memory_demo.py +78 -0
- agentic_cli-0.4.0/examples/planning_demo.py +149 -0
- agentic_cli-0.4.0/examples/research_demo/agents.py +224 -0
- agentic_cli-0.4.0/examples/research_demo/app.py +91 -0
- agentic_cli-0.4.0/examples/research_demo/commands.py +310 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/examples/research_demo/settings.py +4 -7
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/pyproject.toml +5 -1
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/__init__.py +2 -15
- agentic_cli-0.4.0/src/agentic_cli/cli/message_processor.py +408 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/config.py +17 -5
- agentic_cli-0.4.0/src/agentic_cli/constants.py +12 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/hitl/__init__.py +3 -6
- agentic_cli-0.4.0/src/agentic_cli/hitl/approval.py +84 -0
- agentic_cli-0.4.0/src/agentic_cli/hitl/checkpoints.py +70 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/knowledge_base/manager.py +79 -67
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/knowledge_base/vector_store.py +50 -4
- agentic_cli-0.4.0/src/agentic_cli/persistence/_utils.py +23 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/persistence/artifacts.py +45 -38
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/persistence/session.py +69 -17
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/tools/__init__.py +49 -7
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/tools/executor.py +8 -6
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/tools/file_read.py +28 -33
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/tools/file_write.py +65 -84
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/tools/glob_tool.py +41 -109
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/tools/grep_tool.py +27 -39
- agentic_cli-0.4.0/src/agentic_cli/tools/hitl_tools.py +157 -0
- agentic_cli-0.4.0/src/agentic_cli/tools/memory_tools.py +232 -0
- agentic_cli-0.4.0/src/agentic_cli/tools/planning_tools.py +158 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/tools/registry.py +1 -7
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/tools/search.py +41 -28
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/tools/shell/executor.py +12 -1
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/tools/standard.py +74 -34
- agentic_cli-0.4.0/src/agentic_cli/tools/task_tools.py +335 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/tools/webfetch/converter.py +36 -2
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/tools/webfetch/fetcher.py +19 -9
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/tools/webfetch_tool.py +14 -9
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/workflow/__init__.py +4 -4
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/workflow/adk_manager.py +46 -50
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/workflow/base_manager.py +193 -49
- agentic_cli-0.4.0/src/agentic_cli/workflow/context.py +32 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/workflow/events.py +13 -3
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/workflow/langgraph/manager.py +30 -38
- agentic_cli-0.4.0/src/agentic_cli/workflow/langgraph/tools/file_search.py +170 -0
- agentic_cli-0.4.0/src/agentic_cli/workflow/langgraph/tools/shell.py +171 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/workflow/settings.py +6 -0
- agentic_cli-0.4.0/tests/integration/__init__.py +0 -0
- agentic_cli-0.4.0/tests/integration/conftest.py +119 -0
- agentic_cli-0.4.0/tests/integration/helpers.py +149 -0
- agentic_cli-0.4.0/tests/integration/test_adk_integration.py +755 -0
- agentic_cli-0.4.0/tests/integration/test_langgraph_integration.py +348 -0
- agentic_cli-0.4.0/tests/integration/test_live.py +124 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/tests/test_config.py +5 -5
- agentic_cli-0.4.0/tests/test_embeddings.py +154 -0
- agentic_cli-0.4.0/tests/test_hitl.py +159 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/tests/test_langgraph.py +4 -24
- agentic_cli-0.4.0/tests/test_memory.py +234 -0
- agentic_cli-0.4.0/tests/test_planning.py +158 -0
- agentic_cli-0.4.0/tests/test_task_tools.py +661 -0
- agentic_cli-0.4.0/tests/test_thinking.py +117 -0
- agentic_cli-0.4.0/tests/test_token_caching.py +250 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/tests/test_tools.py +277 -32
- agentic_cli-0.4.0/tests/test_vector_store.py +172 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/tests/test_webfetch.py +134 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/tests/test_workflow.py +5 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/tests/tools/test_shell_security.py +6 -0
- agentic_cli-0.3.3/examples/memory_demo.py +0 -283
- agentic_cli-0.3.3/examples/planning_demo.py +0 -290
- agentic_cli-0.3.3/examples/research_demo/agents.py +0 -182
- agentic_cli-0.3.3/examples/research_demo/app.py +0 -81
- agentic_cli-0.3.3/examples/research_demo/commands.py +0 -354
- agentic_cli-0.3.3/examples/research_demo/tools.py +0 -145
- agentic_cli-0.3.3/src/agentic_cli/cli/message_processor.py +0 -348
- agentic_cli-0.3.3/src/agentic_cli/config_mixins.py +0 -119
- agentic_cli-0.3.3/src/agentic_cli/hitl/approval.py +0 -234
- agentic_cli-0.3.3/src/agentic_cli/hitl/checkpoints.py +0 -168
- agentic_cli-0.3.3/src/agentic_cli/memory/__init__.py +0 -28
- agentic_cli-0.3.3/src/agentic_cli/memory/longterm.py +0 -302
- agentic_cli-0.3.3/src/agentic_cli/memory/manager.py +0 -150
- agentic_cli-0.3.3/src/agentic_cli/memory/tools.py +0 -251
- agentic_cli-0.3.3/src/agentic_cli/memory/working.py +0 -121
- agentic_cli-0.3.3/src/agentic_cli/planning/__init__.py +0 -27
- agentic_cli-0.3.3/src/agentic_cli/planning/task_graph.py +0 -481
- agentic_cli-0.3.3/src/agentic_cli/tools/hitl_tools.py +0 -212
- agentic_cli-0.3.3/src/agentic_cli/tools/memory_tools.py +0 -199
- agentic_cli-0.3.3/src/agentic_cli/tools/planning_tools.py +0 -281
- agentic_cli-0.3.3/src/agentic_cli/workflow/context.py +0 -107
- agentic_cli-0.3.3/src/agentic_cli/workflow/langgraph/tools/file_search.py +0 -251
- agentic_cli-0.3.3/src/agentic_cli/workflow/langgraph/tools/shell.py +0 -364
- agentic_cli-0.3.3/src/agentic_cli/workflow/langgraph_manager.py +0 -32
- agentic_cli-0.3.3/src/agentic_cli/workflow/langgraph_state.py +0 -54
- agentic_cli-0.3.3/tests/test_hitl.py +0 -250
- agentic_cli-0.3.3/tests/test_memory.py +0 -596
- agentic_cli-0.3.3/tests/test_planning.py +0 -359
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/LICENSE +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/examples/arxiv_demo.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/examples/fileops_demo.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/examples/hello_agent.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/examples/hello_langgraph.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/examples/research_demo/README.md +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/examples/research_demo/__init__.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/examples/research_demo/__main__.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/examples/shell_demo.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/examples/webfetch_demo.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/examples/websearch_demo.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/requirements-dev.txt +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/requirements.txt +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/cli/__init__.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/cli/app.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/cli/builtin_commands.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/cli/commands.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/cli/settings.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/cli/settings_command.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/cli/settings_introspection.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/cli/workflow_controller.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/hitl/config.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/knowledge_base/__init__.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/knowledge_base/embeddings.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/knowledge_base/models.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/knowledge_base/sources.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/logging.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/persistence/__init__.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/resolvers.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/settings_persistence.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/tools/shell/__init__.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/tools/shell/audit.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/tools/shell/classifier.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/tools/shell/config.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/tools/shell/models.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/tools/shell/path_analyzer.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/tools/shell/preprocessor.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/tools/shell/risk_assessor.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/tools/shell/sandbox.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/tools/shell/tokenizer.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/tools/webfetch/__init__.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/tools/webfetch/robots.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/tools/webfetch/summarizer.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/tools/webfetch/validator.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/workflow/adk/__init__.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/workflow/adk/llm_event_logger.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/workflow/config.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/workflow/langgraph/__init__.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/workflow/langgraph/persistence/__init__.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/workflow/langgraph/persistence/checkpointers.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/workflow/langgraph/persistence/stores.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/workflow/langgraph/state.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/workflow/langgraph/tools/__init__.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/src/agentic_cli/workflow/thinking.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/tests/__init__.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/tests/conftest.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/tests/test_commands.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/tests/test_knowledge_base.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/tests/test_persistence.py +0 -0
- {agentic_cli-0.3.3 → agentic_cli-0.4.0}/tests/tools/__init__.py +0 -0
|
@@ -5,6 +5,36 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.4.0] - 2026-02-07
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **Task Management System**: `save_tasks`/`get_tasks` tools backed by `TaskStore` with flat JSON and atomic writes (`src/agentic_cli/tools/task_tools.py`)
|
|
13
|
+
- **Integration Tests**: Comprehensive ADK and LangGraph workflow pipeline tests (`tests/integration/`)
|
|
14
|
+
- **PDF Text Extraction**: arXiv PDF extraction in `web_fetch` tool, arXiv specialist sub-agent
|
|
15
|
+
- **Prompt Caching**: Claude model prompt caching and LLM usage tracking in LangGraph
|
|
16
|
+
- **Graceful 429 Handling**: Rate limit detection with user retry prompt and configurable delay
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- **Simplified Memory**: 5 tools → 2 (`save_memory`/`search_memory`), following Claude Code pattern
|
|
21
|
+
- **Simplified Planning**: 7 tools → 2 (`save_plan`/`get_plan`), backed by `PlanStore` (flat markdown)
|
|
22
|
+
- **Simplified HITL**: 5 tools → 2 (`request_approval`/`create_checkpoint`), async/blocking via workflow manager
|
|
23
|
+
- **Store Consolidation**: Merged store packages into corresponding tool files
|
|
24
|
+
- **Tools Review**: Standardized error handling (`{"success": bool}` dicts), improved descriptions, removed deprecated `ToolCategory` values
|
|
25
|
+
- **HITL Deadlock Fix**: Direct async callback instead of Future-based pattern for user input
|
|
26
|
+
- **Choice Dialog**: Switched from horizontal buttons to vertical radio list (`dropdown_dialog`)
|
|
27
|
+
- **Unified Tool Registration**: All 34 tools registered through consistent pattern
|
|
28
|
+
- **ContextVar Fix**: Fixed reset bug, deduplicated `_workflow_context`, removed dead modules
|
|
29
|
+
- **Task Progress Display**: Fixed stale display, auto-cleanup between messages, plan checkboxes from PlanStore
|
|
30
|
+
- **Research Demo**: Updated with task tools, removed app-specific tools, fixed Gemini API compatibility
|
|
31
|
+
|
|
32
|
+
### Fixed
|
|
33
|
+
|
|
34
|
+
- `ask_clarification` deadlock when prompting user during workflow
|
|
35
|
+
- Stale task progress display between messages
|
|
36
|
+
- ContextVar reset bug in workflow context
|
|
37
|
+
|
|
8
38
|
## [0.3.3] - 2026-02-04
|
|
9
39
|
|
|
10
40
|
### Added
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# Agentic CLI - Shared Framework for Agentic Applications
|
|
2
|
+
|
|
3
|
+
## Project Overview
|
|
4
|
+
|
|
5
|
+
Agentic CLI is a shared library providing the core infrastructure for building domain-specific CLI applications powered by LLM agents.
|
|
6
|
+
|
|
7
|
+
## Tech Stack
|
|
8
|
+
|
|
9
|
+
- **Language**: Python 3.12+
|
|
10
|
+
- **CLI UI**: `thinking_prompt` - enhanced CLI with thinking boxes and markdown
|
|
11
|
+
- **Workflow**: Google ADK + LangGraph - dual orchestration backends (selectable via settings)
|
|
12
|
+
- **Config**: `pydantic-settings` - type-safe configuration
|
|
13
|
+
- **Logging**: `structlog` - structured logging
|
|
14
|
+
|
|
15
|
+
## Project Structure
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
agentic-cli/
|
|
19
|
+
├── src/agentic_cli/
|
|
20
|
+
│ ├── __init__.py # Package exports, lazy imports
|
|
21
|
+
│ ├── config.py # BaseSettings (pydantic-settings)
|
|
22
|
+
│ ├── constants.py # Shared constants, truncate()
|
|
23
|
+
│ ├── resolvers.py # ModelResolver, PathResolver
|
|
24
|
+
│ ├── settings_persistence.py
|
|
25
|
+
│ ├── logging.py
|
|
26
|
+
│ ├── cli/
|
|
27
|
+
│ │ ├── app.py # BaseCLIApp
|
|
28
|
+
│ │ ├── commands.py # Command, CommandRegistry
|
|
29
|
+
│ │ ├── builtin_commands.py
|
|
30
|
+
│ │ ├── workflow_controller.py # WorkflowController, factory
|
|
31
|
+
│ │ ├── message_processor.py
|
|
32
|
+
│ │ └── settings*.py # Settings UI (introspection, dialog)
|
|
33
|
+
│ ├── workflow/
|
|
34
|
+
│ │ ├── base_manager.py # BaseWorkflowManager (abstract)
|
|
35
|
+
│ │ ├── adk_manager.py # GoogleADKWorkflowManager
|
|
36
|
+
│ │ ├── events.py # WorkflowEvent, EventType
|
|
37
|
+
│ │ ├── thinking.py # ThinkingDetector
|
|
38
|
+
│ │ ├── config.py # AgentConfig
|
|
39
|
+
│ │ ├── context.py # ContextVars for tool access (get_context_*())
|
|
40
|
+
│ │ ├── adk/ # ADK-specific (llm_event_logger)
|
|
41
|
+
│ │ └── langgraph/ # LangGraph orchestrator
|
|
42
|
+
│ │ ├── manager.py # LangGraphWorkflowManager
|
|
43
|
+
│ │ ├── state.py
|
|
44
|
+
│ │ ├── persistence/ # Checkpointers, stores
|
|
45
|
+
│ │ └── tools/ # LangChain-compatible wrappers
|
|
46
|
+
│ ├── tools/
|
|
47
|
+
│ │ ├── registry.py # ToolRegistry, @register_tool, ToolCategory, PermissionLevel
|
|
48
|
+
│ │ ├── executor.py # SafePythonExecutor
|
|
49
|
+
│ │ ├── standard.py # search_knowledge_base, execute_python, ask_clarification
|
|
50
|
+
│ │ ├── file_read.py # read_file, diff_compare
|
|
51
|
+
│ │ ├── file_write.py # write_file, edit_file
|
|
52
|
+
│ │ ├── glob_tool.py # glob
|
|
53
|
+
│ │ ├── grep_tool.py # grep
|
|
54
|
+
│ │ ├── search.py # web_search (Tavily/Brave backends)
|
|
55
|
+
│ │ ├── webfetch_tool.py # web_fetch (orchestrator)
|
|
56
|
+
│ │ ├── memory_tools.py # save_memory, search_memory + MemoryStore
|
|
57
|
+
│ │ ├── planning_tools.py # save_plan, get_plan + PlanStore
|
|
58
|
+
│ │ ├── task_tools.py # save_tasks, get_tasks + TaskStore
|
|
59
|
+
│ │ ├── hitl_tools.py # request_approval, create_checkpoint
|
|
60
|
+
│ │ ├── shell/ # 8-layer shell security
|
|
61
|
+
│ │ └── webfetch/ # Fetcher, converter, validator, robots
|
|
62
|
+
│ ├── hitl/
|
|
63
|
+
│ │ ├── config.py # ApprovalRule, HITLConfig
|
|
64
|
+
│ │ ├── approval.py # ApprovalManager
|
|
65
|
+
│ │ └── checkpoints.py # CheckpointManager
|
|
66
|
+
│ ├── knowledge_base/
|
|
67
|
+
│ │ ├── models.py # Document, SearchResult
|
|
68
|
+
│ │ ├── embeddings.py # EmbeddingService
|
|
69
|
+
│ │ ├── vector_store.py # VectorStore (FAISS)
|
|
70
|
+
│ │ └── manager.py # KnowledgeBaseManager
|
|
71
|
+
│ └── persistence/
|
|
72
|
+
│ ├── session.py # SessionPersistence
|
|
73
|
+
│ ├── artifacts.py # ArtifactManager
|
|
74
|
+
│ └── _utils.py # Atomic write utilities
|
|
75
|
+
├── tests/
|
|
76
|
+
│ ├── conftest.py # MockContext, MockVectorStore, MockEmbeddingService
|
|
77
|
+
│ ├── test_*.py # Unit tests
|
|
78
|
+
│ ├── tools/ # Tool-specific tests
|
|
79
|
+
│ └── integration/ # ADK & LangGraph pipeline tests
|
|
80
|
+
└── examples/ # Demo scripts
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Running Commands
|
|
84
|
+
|
|
85
|
+
**IMPORTANT**: Always use `conda run -n agenticcli` prefix for running commands:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
# Create the environment (first time only)
|
|
89
|
+
conda env create -f environment.yml
|
|
90
|
+
|
|
91
|
+
# Install package
|
|
92
|
+
conda run -n agenticcli pip install -e .
|
|
93
|
+
|
|
94
|
+
# Run tests
|
|
95
|
+
conda run -n agenticcli python -m pytest tests/ -v
|
|
96
|
+
|
|
97
|
+
# Run Python
|
|
98
|
+
conda run -n agenticcli python -c "from agentic_cli import BaseCLIApp; print(BaseCLIApp)"
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Branching Strategy
|
|
102
|
+
|
|
103
|
+
- **main**: Stable branch, matches latest release. Only updated via merges from `develop` when releasing.
|
|
104
|
+
- **develop**: Integration branch for ongoing work. Small fixes can be committed directly here.
|
|
105
|
+
- **feature/\***: Feature branches for larger changes. Branch from `develop`, merge back to `develop`.
|
|
106
|
+
|
|
107
|
+
Workflow:
|
|
108
|
+
1. For small fixes: commit directly to `develop`
|
|
109
|
+
2. For features: create `feature/<name>` from `develop`, work there, merge back to `develop`
|
|
110
|
+
3. When ready to release: merge `develop` → `main` and tag the release
|
|
111
|
+
|
|
112
|
+
## Development Principles
|
|
113
|
+
|
|
114
|
+
### Code Style
|
|
115
|
+
- Follow PEP 8 style guidelines
|
|
116
|
+
- Use type hints throughout
|
|
117
|
+
- Prefer descriptive variable names
|
|
118
|
+
|
|
119
|
+
### Key Design Decisions
|
|
120
|
+
- **Abstract base classes**: BaseCLIApp and BaseWorkflowManager for domain extension
|
|
121
|
+
- **Dual orchestrator**: ADK and LangGraph backends, selectable via settings
|
|
122
|
+
- **Lazy initialization**: Defer heavy imports until needed
|
|
123
|
+
- **Event-based streaming**: Real-time updates via AsyncGenerator
|
|
124
|
+
- **UI-agnostic workflow**: WorkflowEvent objects can be consumed by any UI
|
|
125
|
+
|
|
126
|
+
### Key Design Patterns
|
|
127
|
+
- **Tool error handling**: All tools return `{"success": bool, ...}` dicts. Never raise `ToolError`.
|
|
128
|
+
- **Tool registration**: Use `@register_tool(category=..., permission_level=..., description=...)` decorator. Tools are auto-discovered via the global `ToolRegistry`.
|
|
129
|
+
- **Store consolidation**: Stores (MemoryStore, PlanStore, TaskStore) live inside their tool files (e.g. `memory_tools.py`), not in separate packages.
|
|
130
|
+
- **Context access**: Tools use `get_context_*()` functions from `workflow.context` to access managers and stores via ContextVars.
|
|
131
|
+
- **Atomic writes**: Use `atomic_write_json`/`atomic_write_text` from `persistence/_utils.py` for file persistence.
|
|
132
|
+
|
|
133
|
+
### Console Output
|
|
134
|
+
All console output must go through `ThinkingPromptSession` methods. Never use `rich.Console` or `print()` directly.
|
|
135
|
+
|
|
136
|
+
Available session methods:
|
|
137
|
+
- `session.add_response(text, markdown=True)` - Display text/markdown response
|
|
138
|
+
- `session.add_rich(renderable)` - Display Rich renderables (Panel, Table, etc.)
|
|
139
|
+
- `session.add_message(role, content)` - Add message to history
|
|
140
|
+
- `session.add_error(content)` - Display error message
|
|
141
|
+
- `session.add_warning(content)` - Display warning message
|
|
142
|
+
- `session.add_success(content)` - Display success message
|
|
143
|
+
- `session.clear()` - Clear the terminal screen
|
|
144
|
+
|
|
145
|
+
## Testing
|
|
146
|
+
|
|
147
|
+
- **Framework**: pytest with `asyncio_mode = "auto"`
|
|
148
|
+
- **MockContext**: From `tests/conftest.py` — provides isolated settings and temp dirs for all tests
|
|
149
|
+
- **MockVectorStore** and **MockEmbeddingService**: In-tree mocks for testing without ML dependencies
|
|
150
|
+
- **FAISS tests**: Guard with `pytest.importorskip("faiss")` since FAISS is not installed in dev env
|
|
151
|
+
- **Integration tests**: `tests/integration/` covers ADK and LangGraph pipeline tests
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: agentic-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: A framework for building domain-specific agentic CLI applications
|
|
5
5
|
Project-URL: Homepage, https://github.com/shoom1/agentic-cli
|
|
6
6
|
Project-URL: Repository, https://github.com/shoom1/agentic-cli
|
|
@@ -21,6 +21,7 @@ Requires-Dist: numpy>=1.26.0
|
|
|
21
21
|
Requires-Dist: prompt-toolkit>=3.0.0
|
|
22
22
|
Requires-Dist: pydantic-settings>=2.0.0
|
|
23
23
|
Requires-Dist: pydantic>=2.0.0
|
|
24
|
+
Requires-Dist: pypdf>=4.0.0
|
|
24
25
|
Requires-Dist: rich>=13.0.0
|
|
25
26
|
Requires-Dist: structlog>=24.0.0
|
|
26
27
|
Requires-Dist: thinking-prompt>=0.2.0
|
|
@@ -572,21 +573,23 @@ async for event in manager.process(message, user_id="user1"):
|
|
|
572
573
|
|
|
573
574
|
### Task Progress Display
|
|
574
575
|
|
|
575
|
-
When using
|
|
576
|
+
When using plan checkboxes or task tools, the CLI thinking box dynamically shows task progress:
|
|
576
577
|
|
|
577
578
|
```
|
|
578
|
-
Calling:
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
579
|
+
Calling: web_search
|
|
580
|
+
--- Tasks: 1/3 ---
|
|
581
|
+
Research:
|
|
582
|
+
[x] Gather data
|
|
583
|
+
[ ] Analyze results
|
|
584
|
+
Writing:
|
|
585
|
+
[ ] Draft report
|
|
583
586
|
```
|
|
584
587
|
|
|
585
|
-
Status icons:
|
|
586
|
-
-
|
|
587
|
-
-
|
|
588
|
-
-
|
|
589
|
-
-
|
|
588
|
+
Status icons (task tools):
|
|
589
|
+
- `[x]` Completed
|
|
590
|
+
- `[>]` In progress
|
|
591
|
+
- `[ ]` Pending
|
|
592
|
+
- `[-]` Cancelled
|
|
590
593
|
|
|
591
594
|
## Examples
|
|
592
595
|
|
|
@@ -648,20 +651,27 @@ agentic-cli/
|
|
|
648
651
|
├── src/agentic_cli/
|
|
649
652
|
│ ├── __init__.py # Package exports
|
|
650
653
|
│ ├── config.py # BaseSettings, SettingsContext
|
|
654
|
+
│ ├── constants.py # Shared constants (truncation, limits)
|
|
655
|
+
│ ├── logging.py # Structlog configuration
|
|
651
656
|
│ ├── cli/
|
|
652
657
|
│ │ ├── app.py # BaseCLIApp
|
|
653
658
|
│ │ ├── commands.py # Command, CommandRegistry
|
|
659
|
+
│ │ ├── builtin_commands.py
|
|
654
660
|
│ │ ├── workflow_controller.py # Workflow orchestration
|
|
655
661
|
│ │ └── message_processor.py # Event stream processing
|
|
656
662
|
│ ├── workflow/
|
|
663
|
+
│ │ ├── base_manager.py # BaseWorkflowManager (abstract)
|
|
657
664
|
│ │ ├── events.py # WorkflowEvent, EventType
|
|
658
665
|
│ │ ├── config.py # AgentConfig
|
|
666
|
+
│ │ ├── context.py # Context variables for tools
|
|
667
|
+
│ │ ├── thinking.py # ThinkingDetector
|
|
659
668
|
│ │ ├── adk_manager.py # GoogleADKWorkflowManager
|
|
660
669
|
│ │ └── langgraph/ # LangGraph submodule
|
|
661
670
|
│ │ ├── manager.py # LangGraphWorkflowManager
|
|
662
671
|
│ │ ├── state.py # AgentState, CheckpointData
|
|
663
672
|
│ │ └── persistence/ # Checkpointers and stores
|
|
664
673
|
│ ├── tools/
|
|
674
|
+
│ │ ├── registry.py # ToolRegistry, ToolCategory, PermissionLevel
|
|
665
675
|
│ │ ├── executor.py # SafePythonExecutor
|
|
666
676
|
│ │ ├── file_read.py # read_file, diff_compare
|
|
667
677
|
│ │ ├── file_write.py # write_file, edit_file
|
|
@@ -669,14 +679,31 @@ agentic-cli/
|
|
|
669
679
|
│ │ ├── glob_tool.py # glob, list_dir (file discovery)
|
|
670
680
|
│ │ ├── search.py # Web search (Tavily, Brave)
|
|
671
681
|
│ │ ├── webfetch_tool.py # Web content fetching
|
|
682
|
+
│ │ ├── memory_tools.py # MemoryStore, save/search_memory
|
|
683
|
+
│ │ ├── planning_tools.py # PlanStore, save/get_plan
|
|
684
|
+
│ │ ├── task_tools.py # TaskStore, save/get_tasks
|
|
685
|
+
│ │ ├── hitl_tools.py # request_approval, create_checkpoint
|
|
686
|
+
│ │ ├── standard.py # ArXiv tools, ask_clarification
|
|
672
687
|
│ │ └── shell/ # Shell executor with security
|
|
673
688
|
│ │ ├── executor.py # Main entry point (disabled by default)
|
|
674
689
|
│ │ ├── tokenizer.py # Command parsing
|
|
675
690
|
│ │ ├── classifier.py # Risk classification
|
|
676
691
|
│ │ ├── sandbox.py # Execution sandboxing
|
|
677
692
|
│ │ └── audit.py # Security logging
|
|
678
|
-
│
|
|
679
|
-
│
|
|
693
|
+
│ ├── knowledge_base/
|
|
694
|
+
│ │ ├── manager.py # KnowledgeBaseManager
|
|
695
|
+
│ │ ├── models.py # Document, SearchResult
|
|
696
|
+
│ │ ├── embeddings.py # EmbeddingService
|
|
697
|
+
│ │ ├── vector_store.py # VectorStore
|
|
698
|
+
│ │ └── sources.py # ArxivSearchSource, SearchSourceRegistry
|
|
699
|
+
│ ├── persistence/
|
|
700
|
+
│ │ ├── session.py # SessionPersistence
|
|
701
|
+
│ │ ├── artifacts.py # ArtifactManager
|
|
702
|
+
│ │ └── _utils.py # Atomic write utilities
|
|
703
|
+
│ └── hitl/
|
|
704
|
+
│ ├── approval.py # ApprovalManager
|
|
705
|
+
│ ├── checkpoints.py # CheckpointManager
|
|
706
|
+
│ └── config.py # HITLConfig
|
|
680
707
|
├── examples/
|
|
681
708
|
│ ├── hello_agent.py # Basic ADK example
|
|
682
709
|
│ ├── hello_langgraph.py # Basic LangGraph example
|
|
@@ -533,21 +533,23 @@ async for event in manager.process(message, user_id="user1"):
|
|
|
533
533
|
|
|
534
534
|
### Task Progress Display
|
|
535
535
|
|
|
536
|
-
When using
|
|
536
|
+
When using plan checkboxes or task tools, the CLI thinking box dynamically shows task progress:
|
|
537
537
|
|
|
538
538
|
```
|
|
539
|
-
Calling:
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
539
|
+
Calling: web_search
|
|
540
|
+
--- Tasks: 1/3 ---
|
|
541
|
+
Research:
|
|
542
|
+
[x] Gather data
|
|
543
|
+
[ ] Analyze results
|
|
544
|
+
Writing:
|
|
545
|
+
[ ] Draft report
|
|
544
546
|
```
|
|
545
547
|
|
|
546
|
-
Status icons:
|
|
547
|
-
-
|
|
548
|
-
-
|
|
549
|
-
-
|
|
550
|
-
-
|
|
548
|
+
Status icons (task tools):
|
|
549
|
+
- `[x]` Completed
|
|
550
|
+
- `[>]` In progress
|
|
551
|
+
- `[ ]` Pending
|
|
552
|
+
- `[-]` Cancelled
|
|
551
553
|
|
|
552
554
|
## Examples
|
|
553
555
|
|
|
@@ -609,20 +611,27 @@ agentic-cli/
|
|
|
609
611
|
├── src/agentic_cli/
|
|
610
612
|
│ ├── __init__.py # Package exports
|
|
611
613
|
│ ├── config.py # BaseSettings, SettingsContext
|
|
614
|
+
│ ├── constants.py # Shared constants (truncation, limits)
|
|
615
|
+
│ ├── logging.py # Structlog configuration
|
|
612
616
|
│ ├── cli/
|
|
613
617
|
│ │ ├── app.py # BaseCLIApp
|
|
614
618
|
│ │ ├── commands.py # Command, CommandRegistry
|
|
619
|
+
│ │ ├── builtin_commands.py
|
|
615
620
|
│ │ ├── workflow_controller.py # Workflow orchestration
|
|
616
621
|
│ │ └── message_processor.py # Event stream processing
|
|
617
622
|
│ ├── workflow/
|
|
623
|
+
│ │ ├── base_manager.py # BaseWorkflowManager (abstract)
|
|
618
624
|
│ │ ├── events.py # WorkflowEvent, EventType
|
|
619
625
|
│ │ ├── config.py # AgentConfig
|
|
626
|
+
│ │ ├── context.py # Context variables for tools
|
|
627
|
+
│ │ ├── thinking.py # ThinkingDetector
|
|
620
628
|
│ │ ├── adk_manager.py # GoogleADKWorkflowManager
|
|
621
629
|
│ │ └── langgraph/ # LangGraph submodule
|
|
622
630
|
│ │ ├── manager.py # LangGraphWorkflowManager
|
|
623
631
|
│ │ ├── state.py # AgentState, CheckpointData
|
|
624
632
|
│ │ └── persistence/ # Checkpointers and stores
|
|
625
633
|
│ ├── tools/
|
|
634
|
+
│ │ ├── registry.py # ToolRegistry, ToolCategory, PermissionLevel
|
|
626
635
|
│ │ ├── executor.py # SafePythonExecutor
|
|
627
636
|
│ │ ├── file_read.py # read_file, diff_compare
|
|
628
637
|
│ │ ├── file_write.py # write_file, edit_file
|
|
@@ -630,14 +639,31 @@ agentic-cli/
|
|
|
630
639
|
│ │ ├── glob_tool.py # glob, list_dir (file discovery)
|
|
631
640
|
│ │ ├── search.py # Web search (Tavily, Brave)
|
|
632
641
|
│ │ ├── webfetch_tool.py # Web content fetching
|
|
642
|
+
│ │ ├── memory_tools.py # MemoryStore, save/search_memory
|
|
643
|
+
│ │ ├── planning_tools.py # PlanStore, save/get_plan
|
|
644
|
+
│ │ ├── task_tools.py # TaskStore, save/get_tasks
|
|
645
|
+
│ │ ├── hitl_tools.py # request_approval, create_checkpoint
|
|
646
|
+
│ │ ├── standard.py # ArXiv tools, ask_clarification
|
|
633
647
|
│ │ └── shell/ # Shell executor with security
|
|
634
648
|
│ │ ├── executor.py # Main entry point (disabled by default)
|
|
635
649
|
│ │ ├── tokenizer.py # Command parsing
|
|
636
650
|
│ │ ├── classifier.py # Risk classification
|
|
637
651
|
│ │ ├── sandbox.py # Execution sandboxing
|
|
638
652
|
│ │ └── audit.py # Security logging
|
|
639
|
-
│
|
|
640
|
-
│
|
|
653
|
+
│ ├── knowledge_base/
|
|
654
|
+
│ │ ├── manager.py # KnowledgeBaseManager
|
|
655
|
+
│ │ ├── models.py # Document, SearchResult
|
|
656
|
+
│ │ ├── embeddings.py # EmbeddingService
|
|
657
|
+
│ │ ├── vector_store.py # VectorStore
|
|
658
|
+
│ │ └── sources.py # ArxivSearchSource, SearchSourceRegistry
|
|
659
|
+
│ ├── persistence/
|
|
660
|
+
│ │ ├── session.py # SessionPersistence
|
|
661
|
+
│ │ ├── artifacts.py # ArtifactManager
|
|
662
|
+
│ │ └── _utils.py # Atomic write utilities
|
|
663
|
+
│ └── hitl/
|
|
664
|
+
│ ├── approval.py # ApprovalManager
|
|
665
|
+
│ ├── checkpoints.py # CheckpointManager
|
|
666
|
+
│ └── config.py # HITLConfig
|
|
641
667
|
├── examples/
|
|
642
668
|
│ ├── hello_agent.py # Basic ADK example
|
|
643
669
|
│ ├── hello_langgraph.py # Basic LangGraph example
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
"""Standalone demo for the simplified memory system.
|
|
3
|
+
|
|
4
|
+
Demonstrates:
|
|
5
|
+
1. Storing memories with optional tags
|
|
6
|
+
2. Searching memories by substring
|
|
7
|
+
3. Loading all memories for system prompt injection
|
|
8
|
+
4. Persistence across instances
|
|
9
|
+
|
|
10
|
+
Usage:
|
|
11
|
+
conda run -n agenticcli python examples/memory_demo.py
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
import tempfile
|
|
15
|
+
from pathlib import Path
|
|
16
|
+
|
|
17
|
+
from agentic_cli.tools.memory_tools import MemoryStore, MemoryItem
|
|
18
|
+
from agentic_cli.config import BaseSettings
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class DemoSettings(BaseSettings):
|
|
22
|
+
"""Settings for demo with temp directory."""
|
|
23
|
+
|
|
24
|
+
workspace_dir: Path = Path(".")
|
|
25
|
+
|
|
26
|
+
def __init__(self, temp_dir: Path, **kwargs):
|
|
27
|
+
super().__init__(workspace_dir=temp_dir, **kwargs)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def main():
|
|
31
|
+
print("\n" + "#" * 60)
|
|
32
|
+
print("# Memory System Demo (Simplified)")
|
|
33
|
+
print("#" * 60)
|
|
34
|
+
|
|
35
|
+
with tempfile.TemporaryDirectory() as temp_dir:
|
|
36
|
+
temp_path = Path(temp_dir)
|
|
37
|
+
settings = DemoSettings(temp_path)
|
|
38
|
+
|
|
39
|
+
# --- Store memories ---
|
|
40
|
+
print("\n Storing memories:")
|
|
41
|
+
store = MemoryStore(settings)
|
|
42
|
+
|
|
43
|
+
id1 = store.store("User prefers markdown output", tags=["preference"])
|
|
44
|
+
print(f" Stored: {id1[:8]}... [preference]")
|
|
45
|
+
|
|
46
|
+
id2 = store.store("Basel III requires 99% VaR confidence", tags=["fact", "finance"])
|
|
47
|
+
print(f" Stored: {id2[:8]}... [fact, finance]")
|
|
48
|
+
|
|
49
|
+
id3 = store.store("Python 3.12 is the project runtime")
|
|
50
|
+
print(f" Stored: {id3[:8]}... (no tags)")
|
|
51
|
+
|
|
52
|
+
# --- Search ---
|
|
53
|
+
print("\n Search for 'Basel':")
|
|
54
|
+
for item in store.search("Basel"):
|
|
55
|
+
print(f" - {item.content}")
|
|
56
|
+
|
|
57
|
+
print("\n Search for 'Python':")
|
|
58
|
+
for item in store.search("Python"):
|
|
59
|
+
print(f" - {item.content}")
|
|
60
|
+
|
|
61
|
+
# --- Load all (system prompt injection) ---
|
|
62
|
+
print("\n All memories (for system prompt):")
|
|
63
|
+
print(store.load_all())
|
|
64
|
+
|
|
65
|
+
# --- Persistence ---
|
|
66
|
+
print("\n Persistence test:")
|
|
67
|
+
store2 = MemoryStore(settings)
|
|
68
|
+
results = store2.search("")
|
|
69
|
+
print(f" New instance loaded {len(results)} memories")
|
|
70
|
+
assert len(results) == 3
|
|
71
|
+
|
|
72
|
+
print("\n" + "#" * 60)
|
|
73
|
+
print("# Demo Complete!")
|
|
74
|
+
print("#" * 60 + "\n")
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
if __name__ == "__main__":
|
|
78
|
+
main()
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
"""Standalone demo for the PlanStore planning system.
|
|
3
|
+
|
|
4
|
+
This demo shows the simplified flat-markdown planning pattern:
|
|
5
|
+
1. Agent creates a plan with markdown checkboxes
|
|
6
|
+
2. Agent updates the plan as tasks complete
|
|
7
|
+
3. Framework just stores the string
|
|
8
|
+
|
|
9
|
+
Usage:
|
|
10
|
+
conda run -n agenticcli python examples/planning_demo.py
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from agentic_cli.tools.planning_tools import PlanStore
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def demo_basic_plan():
|
|
17
|
+
"""Demo creating and retrieving a plan."""
|
|
18
|
+
print("\n" + "=" * 60)
|
|
19
|
+
print("Basic Plan Demo")
|
|
20
|
+
print("=" * 60)
|
|
21
|
+
|
|
22
|
+
store = PlanStore()
|
|
23
|
+
|
|
24
|
+
# Agent creates a plan
|
|
25
|
+
plan = (
|
|
26
|
+
"## Research Plan: Python History\n"
|
|
27
|
+
"\n"
|
|
28
|
+
"- [ ] Search for key milestones in Python development\n"
|
|
29
|
+
"- [ ] Identify major version releases and their features\n"
|
|
30
|
+
"- [ ] Find notable Python community events\n"
|
|
31
|
+
"- [ ] Write summary document\n"
|
|
32
|
+
)
|
|
33
|
+
store.save(plan)
|
|
34
|
+
|
|
35
|
+
print(" Created plan:")
|
|
36
|
+
print(store.get())
|
|
37
|
+
print()
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def demo_progress_tracking():
|
|
41
|
+
"""Demo updating plan with progress."""
|
|
42
|
+
print("\n" + "=" * 60)
|
|
43
|
+
print("Progress Tracking Demo")
|
|
44
|
+
print("=" * 60)
|
|
45
|
+
|
|
46
|
+
store = PlanStore()
|
|
47
|
+
|
|
48
|
+
# Initial plan
|
|
49
|
+
store.save(
|
|
50
|
+
"## ML Pipeline\n"
|
|
51
|
+
"- [ ] Prepare dataset\n"
|
|
52
|
+
"- [ ] Train model\n"
|
|
53
|
+
"- [ ] Evaluate performance\n"
|
|
54
|
+
"- [ ] Deploy to production\n"
|
|
55
|
+
)
|
|
56
|
+
print(" Initial plan:")
|
|
57
|
+
print(store.get())
|
|
58
|
+
|
|
59
|
+
# Agent completes first two tasks
|
|
60
|
+
store.save(
|
|
61
|
+
"## ML Pipeline\n"
|
|
62
|
+
"- [x] Prepare dataset\n"
|
|
63
|
+
"- [x] Train model (accuracy: 94.2%)\n"
|
|
64
|
+
"- [ ] Evaluate performance\n"
|
|
65
|
+
"- [ ] Deploy to production\n"
|
|
66
|
+
)
|
|
67
|
+
print("\n After completing 2 tasks:")
|
|
68
|
+
print(store.get())
|
|
69
|
+
|
|
70
|
+
# Agent adds notes and completes more
|
|
71
|
+
store.save(
|
|
72
|
+
"## ML Pipeline\n"
|
|
73
|
+
"- [x] Prepare dataset\n"
|
|
74
|
+
"- [x] Train model (accuracy: 94.2%)\n"
|
|
75
|
+
"- [x] Evaluate performance\n"
|
|
76
|
+
" - Precision: 0.93, Recall: 0.95\n"
|
|
77
|
+
" - Exceeds baseline by 12%\n"
|
|
78
|
+
"- [ ] Deploy to production\n"
|
|
79
|
+
)
|
|
80
|
+
print("\n After evaluation with notes:")
|
|
81
|
+
print(store.get())
|
|
82
|
+
print()
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def demo_plan_revision():
|
|
86
|
+
"""Demo revising a plan mid-execution."""
|
|
87
|
+
print("\n" + "=" * 60)
|
|
88
|
+
print("Plan Revision Demo")
|
|
89
|
+
print("=" * 60)
|
|
90
|
+
|
|
91
|
+
store = PlanStore()
|
|
92
|
+
|
|
93
|
+
# Original plan
|
|
94
|
+
store.save(
|
|
95
|
+
"## API Integration\n"
|
|
96
|
+
"- [x] Design API schema\n"
|
|
97
|
+
"- [ ] Implement endpoints\n"
|
|
98
|
+
"- [ ] Write tests\n"
|
|
99
|
+
)
|
|
100
|
+
print(" Original plan:")
|
|
101
|
+
print(store.get())
|
|
102
|
+
|
|
103
|
+
# Agent discovers need for auth — revises plan
|
|
104
|
+
store.save(
|
|
105
|
+
"## API Integration\n"
|
|
106
|
+
"- [x] Design API schema\n"
|
|
107
|
+
"- [x] Implement endpoints\n"
|
|
108
|
+
"- [ ] Add authentication (discovered requirement)\n"
|
|
109
|
+
"- [ ] Write tests\n"
|
|
110
|
+
"- [ ] Update documentation\n"
|
|
111
|
+
)
|
|
112
|
+
print("\n Revised plan (added auth + docs):")
|
|
113
|
+
print(store.get())
|
|
114
|
+
print()
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def demo_clear():
|
|
118
|
+
"""Demo clearing the plan."""
|
|
119
|
+
print("\n" + "=" * 60)
|
|
120
|
+
print("Clear Plan Demo")
|
|
121
|
+
print("=" * 60)
|
|
122
|
+
|
|
123
|
+
store = PlanStore()
|
|
124
|
+
store.save("- [ ] Some task")
|
|
125
|
+
print(f" Has plan: {not store.is_empty()}")
|
|
126
|
+
|
|
127
|
+
store.clear()
|
|
128
|
+
print(f" After clear, is empty: {store.is_empty()}")
|
|
129
|
+
print()
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
def main():
|
|
133
|
+
"""Run all demos."""
|
|
134
|
+
print("\n" + "#" * 60)
|
|
135
|
+
print("# PlanStore Planning System Demo")
|
|
136
|
+
print("#" * 60)
|
|
137
|
+
|
|
138
|
+
demo_basic_plan()
|
|
139
|
+
demo_progress_tracking()
|
|
140
|
+
demo_plan_revision()
|
|
141
|
+
demo_clear()
|
|
142
|
+
|
|
143
|
+
print("\n" + "#" * 60)
|
|
144
|
+
print("# Demo Complete!")
|
|
145
|
+
print("#" * 60 + "\n")
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
if __name__ == "__main__":
|
|
149
|
+
main()
|