alpiecode 10.10.10__tar.gz → 10.10.12__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.
Files changed (163) hide show
  1. alpiecode-10.10.12/PKG-INFO +770 -0
  2. {alpiecode-10.10.10 → alpiecode-10.10.12}/pyproject.toml +2 -1
  3. alpiecode-10.10.12/src/alpiecode.egg-info/PKG-INFO +770 -0
  4. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/alpiecode.egg-info/SOURCES.txt +5 -0
  5. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/__init__.py +1 -1
  6. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/backends/local_backend.py +32 -5
  7. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/context.py +6 -0
  8. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/convergence.py +5 -1
  9. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/execution_safety.py +14 -0
  10. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/executor.py +188 -9
  11. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/local_model.py +37 -4
  12. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/orchestrator.py +68 -63
  13. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/progress.py +3 -1
  14. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/prompt.py +16 -6
  15. alpiecode-10.10.12/src/codeagent/tool_boundary.py +50 -0
  16. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/tools.py +15 -31
  17. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/verifier.py +6 -2
  18. {alpiecode-10.10.10 → alpiecode-10.10.12}/test/test_deloop_and_sessions.py +2 -1
  19. {alpiecode-10.10.10 → alpiecode-10.10.12}/test/test_local_model_download.py +18 -0
  20. alpiecode-10.10.12/test/test_nested_xml_tools.py +71 -0
  21. alpiecode-10.10.12/test/test_observed_evidence.py +47 -0
  22. alpiecode-10.10.12/test/test_repair_evidence.py +34 -0
  23. {alpiecode-10.10.10 → alpiecode-10.10.12}/test/test_report_convergence.py +55 -0
  24. {alpiecode-10.10.10 → alpiecode-10.10.12}/test/test_task_assessment.py +4 -4
  25. alpiecode-10.10.12/test/test_tool_boundary.py +45 -0
  26. {alpiecode-10.10.10 → alpiecode-10.10.12}/test/test_verifier.py +17 -0
  27. alpiecode-10.10.10/PKG-INFO +0 -18
  28. alpiecode-10.10.10/src/alpiecode.egg-info/PKG-INFO +0 -18
  29. {alpiecode-10.10.10 → alpiecode-10.10.12}/README.md +0 -0
  30. {alpiecode-10.10.10 → alpiecode-10.10.12}/setup.cfg +0 -0
  31. {alpiecode-10.10.10 → alpiecode-10.10.12}/setup.py +0 -0
  32. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/alpiecode/__init__.py +0 -0
  33. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/alpiecode.egg-info/dependency_links.txt +0 -0
  34. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/alpiecode.egg-info/entry_points.txt +0 -0
  35. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/alpiecode.egg-info/requires.txt +0 -0
  36. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/alpiecode.egg-info/top_level.txt +0 -0
  37. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/__main__.py +0 -0
  38. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/agent.py +0 -0
  39. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/assessment.py +0 -0
  40. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/backends/__init__.py +0 -0
  41. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/backends/base.py +0 -0
  42. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/backends/openai_backend.py +0 -0
  43. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/blueprints.py +0 -0
  44. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/cache.py +0 -0
  45. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/capabilities.py +0 -0
  46. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/chat_tags.py +0 -0
  47. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/cli.py +0 -0
  48. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/client.py +0 -0
  49. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/compaction.py +0 -0
  50. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/config.py +0 -0
  51. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/diff_preview.py +0 -0
  52. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/discovery.py +0 -0
  53. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/doctor.py +0 -0
  54. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/dream_rsi.py +0 -0
  55. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/evaluation.py +0 -0
  56. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/git_ops.py +0 -0
  57. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/github.py +0 -0
  58. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/grounding.py +0 -0
  59. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/guardian.py +0 -0
  60. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/guardrails.py +0 -0
  61. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/ipython_ext.py +0 -0
  62. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/lifecycle.py +0 -0
  63. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/media.py +0 -0
  64. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/memory.py +0 -0
  65. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/metrics.py +0 -0
  66. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/onboarding.py +0 -0
  67. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/paths.py +0 -0
  68. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/project_template.py +0 -0
  69. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/rephraser.py +0 -0
  70. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/server.py +0 -0
  71. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/session.py +0 -0
  72. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/accessibility-audit/SKILL.md +0 -0
  73. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/accessibility-testing/SKILL.md +0 -0
  74. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/accessibility-ui-components/SKILL.md +0 -0
  75. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/agentic-workflows/SKILL.md +0 -0
  76. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/api-design/SKILL.md +0 -0
  77. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/architecture-design/SKILL.md +0 -0
  78. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/backend-engineering/SKILL.md +0 -0
  79. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/browser-automation/SKILL.md +0 -0
  80. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/cli-development/SKILL.md +0 -0
  81. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/cloud-infrastructure/SKILL.md +0 -0
  82. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/code-generation/SKILL.md +0 -0
  83. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/code-review/SKILL.md +0 -0
  84. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/codebase-onboarding/SKILL.md +0 -0
  85. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/cost-optimization/SKILL.md +0 -0
  86. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/data-analysis/SKILL.md +0 -0
  87. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/data-engineering/SKILL.md +0 -0
  88. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/database-engineering/SKILL.md +0 -0
  89. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/dependency-management/SKILL.md +0 -0
  90. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/dependency-security/SKILL.md +0 -0
  91. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/dependency-upgrades/SKILL.md +0 -0
  92. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/devops-ci-cd/SKILL.md +0 -0
  93. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/docker-containers/SKILL.md +0 -0
  94. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/documentation/SKILL.md +0 -0
  95. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/documentation-site/SKILL.md +0 -0
  96. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/e2e-testing/SKILL.md +0 -0
  97. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/error-handling-resilience/SKILL.md +0 -0
  98. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/feature-development/SKILL.md +0 -0
  99. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/frontend-engineering/SKILL.md +0 -0
  100. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/git-workflow/SKILL.md +0 -0
  101. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/incident-response/SKILL.md +0 -0
  102. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/legacy-code-modernization/SKILL.md +0 -0
  103. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/llm-application-engineering/SKILL.md +0 -0
  104. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/localization-i18n/SKILL.md +0 -0
  105. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/mcp-server-development/SKILL.md +0 -0
  106. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/migration-engineering/SKILL.md +0 -0
  107. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/mobile-development/SKILL.md +0 -0
  108. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/model-evaluation/SKILL.md +0 -0
  109. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/nodejs-services/SKILL.md +0 -0
  110. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/observability/SKILL.md +0 -0
  111. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/performance-optimization/SKILL.md +0 -0
  112. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/privacy-data-protection/SKILL.md +0 -0
  113. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/prompt-engineering/SKILL.md +0 -0
  114. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/python-engineering/SKILL.md +0 -0
  115. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/rag-retrieval/SKILL.md +0 -0
  116. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/react-engineering/SKILL.md +0 -0
  117. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/release-management/SKILL.md +0 -0
  118. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/requirements-analysis/SKILL.md +0 -0
  119. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/responsive-design/SKILL.md +0 -0
  120. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/safe-refactoring/SKILL.md +0 -0
  121. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/secure-coding/SKILL.md +0 -0
  122. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/systematic-debugging/SKILL.md +0 -0
  123. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/technical-planning/SKILL.md +0 -0
  124. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/technical-research/SKILL.md +0 -0
  125. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/technical-writing/SKILL.md +0 -0
  126. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/test-engineering/SKILL.md +0 -0
  127. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/tool-integration/SKILL.md +0 -0
  128. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/typescript-engineering/SKILL.md +0 -0
  129. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/visual-regression-testing/SKILL.md +0 -0
  130. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/web-performance/SKILL.md +0 -0
  131. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/web-security-testing/SKILL.md +0 -0
  132. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills/workflow-automation/SKILL.md +0 -0
  133. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/skills.py +0 -0
  134. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/slash.py +0 -0
  135. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/subagent.py +0 -0
  136. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/system1.py +0 -0
  137. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/updater.py +0 -0
  138. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/vision.py +0 -0
  139. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/vscode_installer.py +0 -0
  140. {alpiecode-10.10.10 → alpiecode-10.10.12}/src/codeagent/walkthrough.py +0 -0
  141. {alpiecode-10.10.10 → alpiecode-10.10.12}/test/test_adaptive_resilience.py +0 -0
  142. {alpiecode-10.10.10 → alpiecode-10.10.12}/test/test_chat_tags_and_offline_multimodal.py +0 -0
  143. {alpiecode-10.10.10 → alpiecode-10.10.12}/test/test_cli_ui.py +0 -0
  144. {alpiecode-10.10.10 → alpiecode-10.10.12}/test/test_context_and_trajectory.py +0 -0
  145. {alpiecode-10.10.10 → alpiecode-10.10.12}/test/test_dream_rsi.py +0 -0
  146. {alpiecode-10.10.10 → alpiecode-10.10.12}/test/test_execution_recovery.py +0 -0
  147. {alpiecode-10.10.10 → alpiecode-10.10.12}/test/test_frontier_architecture.py +0 -0
  148. {alpiecode-10.10.10 → alpiecode-10.10.12}/test/test_gpu_detection.py +0 -0
  149. {alpiecode-10.10.10 → alpiecode-10.10.12}/test/test_lifecycle_and_portfolio.py +0 -0
  150. {alpiecode-10.10.10 → alpiecode-10.10.12}/test/test_memory_optimization.py +0 -0
  151. {alpiecode-10.10.10 → alpiecode-10.10.12}/test/test_non_thinking_and_local_stream.py +0 -0
  152. {alpiecode-10.10.10 → alpiecode-10.10.12}/test/test_onboarding.py +0 -0
  153. {alpiecode-10.10.10 → alpiecode-10.10.12}/test/test_project_templates.py +0 -0
  154. {alpiecode-10.10.10 → alpiecode-10.10.12}/test/test_release_foundations.py +0 -0
  155. {alpiecode-10.10.10 → alpiecode-10.10.12}/test/test_security_config.py +0 -0
  156. {alpiecode-10.10.10 → alpiecode-10.10.12}/test/test_skills_engine.py +0 -0
  157. {alpiecode-10.10.10 → alpiecode-10.10.12}/test/test_slash_and_diff.py +0 -0
  158. {alpiecode-10.10.10 → alpiecode-10.10.12}/test/test_subagents.py +0 -0
  159. {alpiecode-10.10.10 → alpiecode-10.10.12}/test/test_token_economy_and_256k.py +0 -0
  160. {alpiecode-10.10.10 → alpiecode-10.10.12}/test/test_truncation_resilience.py +0 -0
  161. {alpiecode-10.10.10 → alpiecode-10.10.12}/test/test_visual_grounding.py +0 -0
  162. {alpiecode-10.10.10 → alpiecode-10.10.12}/test/test_walkthrough.py +0 -0
  163. {alpiecode-10.10.10 → alpiecode-10.10.12}/test/test_web_resilience_and_guardrails.py +0 -0
@@ -0,0 +1,770 @@
1
+ Metadata-Version: 2.4
2
+ Name: alpiecode
3
+ Version: 10.10.12
4
+ Summary: AlpieCode
5
+ Requires-Python: >=3.9
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: huggingface_hub>=0.20.0
8
+ Requires-Dist: rich>=13.0
9
+ Requires-Dist: click>=8.0
10
+ Requires-Dist: httpx[http2]>=0.24.0
11
+ Requires-Dist: beautifulsoup4>=4.12.0
12
+ Requires-Dist: yt-dlp>=2024.0.0
13
+ Requires-Dist: prompt-toolkit>=3.0.0
14
+ Provides-Extra: server
15
+ Requires-Dist: fastapi>=0.100.0; extra == "server"
16
+ Requires-Dist: uvicorn>=0.20.0; extra == "server"
17
+ Requires-Dist: sse-starlette>=2.0.0; extra == "server"
18
+ Provides-Extra: ffmpeg
19
+ Requires-Dist: imageio-ffmpeg>=0.4.0; extra == "ffmpeg"
20
+
21
+ # AlpieCode
22
+
23
+ [![Python Version](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue.svg)](https://www.python.org/)
24
+ [![Version](https://img.shields.io/badge/alpiecode-v10.0.2-emerald.svg)](https://github.com/169Pi/codeagent-poc)
25
+ [![VS Code Extension](https://img.shields.io/badge/vscode%20extension-v8.0.8-blueviolet.svg)](https://marketplace.visualstudio.com/)
26
+ [![FastAPI](https://img.shields.io/badge/FastAPI-0.100%2B-009688.svg)](https://fastapi.tiangolo.com/)
27
+ [![Jupyter & Colab](https://img.shields.io/badge/Jupyter%20%7C%20Colab-Ready-f37726.svg)](https://colab.research.google.com/)
28
+ [![Platforms](https://img.shields.io/badge/platform-Linux%20%7C%20WSL2%20%7C%20macOS%20%7C%20Windows-lightgrey.svg)](https://github.com/169Pi/codeagent-poc)
29
+ [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
30
+
31
+ > **Powered by 169Pi Alpie Vision-Language-Action Models (Local GGUF & Remote Cloud API)**
32
+ > *An enterprise-grade, autonomous software engineering agent seamlessly integrated across the Command Line (CLI), VS Code Extension, FastAPI Backend Server, Python SDK, Jupyter Notebooks, and Google Colab.*
33
+
34
+ ---
35
+
36
+ ## 📑 Table of Contents
37
+ 1. [🌟 Overview & Capabilities](#-overview--capabilities)
38
+ 2. [🏗️ Core Architecture & Hybrid Dual-Engine](#️-core-architecture--hybrid-dual-engine)
39
+ 3. [⚡ System 1 (Jev Architecture) & Performance Engine](#-system-1-jev-architecture--performance-engine)
40
+ 4. [📊 Performance & Optimization Benchmarks](#-performance--optimization-benchmarks)
41
+ 5. [📦 Complete Installation Guide](#-complete-installation-guide)
42
+ 6. [🚀 Backend API Server (`alpiecode serve`)](#-backend-api-server-alpiecode-serve)
43
+ 7. [⌨️ Command-Line Interface (CLI) Full Reference](#️-command-line-interface-cli-full-reference)
44
+ 8. [💻 VS Code Extension Deep-Dive](#-vs-code-extension-deep-dive)
45
+ 9. [🐍 Python SDK Reference (Programmatic Usage)](#-python-sdk-reference-programmatic-usage)
46
+ 10. [📓 Jupyter Notebooks, JupyterLab & Google Colab](#-jupyter-notebooks-jupyterlab--google-colab)
47
+ 11. [🛠️ 15 Built-In Autonomous Agent Tools](#️-15-built-in-autonomous-agent-tools)
48
+ 12. [🛡️ Safety Guardian, Git Checkpoints & Memory System](#️-safety-guardian-git-checkpoints--memory-system)
49
+ 13. [⚙️ Configuration & Environment Variables](#️-configuration--environment-variables)
50
+ 14. [❓ FAQ & Troubleshooting](#-faq--troubleshooting)
51
+
52
+ ---
53
+
54
+ ## 🌟 Overview & Capabilities
55
+
56
+ **AlpieCode** is an autonomous software engineering assistant that acts as a principal developer in your repository. Rather than simply generating isolated snippets, AlpieCode operates as a full-loop agent:
57
+ - **Discovers & Understands**: Recursively indexes codebases, reads files, and executes ripgrep regex searches.
58
+ - **Reasons & Plans**: Formulates implementation plans, manages checkpointed deliverables, and explains complex architectures.
59
+ - **Generates & Modifies**: Writes production code, applies surgical whitespace-accurate diff patches, and refactors existing components.
60
+ - **Executes & Self-Heals**: Executes commands in an isolated sandbox, automatically captures build/test errors, and iterates until tests pass.
61
+ - **Works Everywhere**: From the terminal and VS Code sidebar to automated Python scripts and interactive Google Colab notebooks.
62
+
63
+ ### 🎯 Feature Matrix Across Interfaces
64
+ | Feature / Capability | CLI | VS Code Extension | Python SDK | Jupyter & Colab |
65
+ | :--- | :---: | :---: | :---: | :---: |
66
+ | **Autonomous Coding Loops (`run`)** | ✅ | ✅ | ✅ | ✅ |
67
+ | **Multi-Turn Interactive Chat** | ✅ | ✅ | ✅ | ✅ |
68
+ | **Architectural Planning (`plan`)** | ✅ | ✅ | ✅ | ✅ |
69
+ | **Deep Code Explanation (`explain`)** | ✅ | ✅ | ✅ | ✅ |
70
+ | **Interactive Diff / Plan-First Review** | — | ✅ (Accept/Reject/Edit) | — | — |
71
+ | **Inline Ghost-Text Code Autocomplete** | — | ✅ (Tab to accept) | — | — |
72
+ | **Live Token Speed & Counter Meter** | — | ✅ | — | ✅ |
73
+ | **Multimodal Vision (Images/Screenshots)** | ✅ (`--image`) | ✅ (Paste / Upload) | ✅ | ✅ |
74
+ | **Video & YouTube URL Analysis** | ✅ (`--video`, `--url`) | — | ✅ | — |
75
+ | **Autonomous GitHub Repo Analysis** | ✅ (`--github`) | ✅ | ✅ | — |
76
+ | **Proactive `.venv` & Dependency Setup** | ✅ | ✅ | ✅ | ✅ |
77
+ | **Persistent Project Memory** | ✅ | ✅ | ✅ | ✅ |
78
+ | **Zero-Crash Smart GGUF Fallback** | ✅ | ✅ | ✅ | ✅ |
79
+
80
+ ---
81
+
82
+ ## 🏗️ Core Architecture & Hybrid Dual-Engine
83
+
84
+ AlpieCode employs an intelligent **Hybrid Dual-Engine** routing system that pairs the speed and depth of cloud Vision-Language-Action models with the resilience of completely offline local GGUF models.
85
+
86
+ ```
87
+ ┌────────────────────────────────────────────────────────────────────────────────────────┐
88
+ │ CLIENT LAYER │
89
+ │ VS Code Extension Terminal CLI Python SDK Jupyter / Colab │
90
+ │ (Sidebar & Ghost-Text) (alpiecode run/chat) (import alpiecode) (%alpie / %%alpie)│
91
+ └──────────────────────────┬───────────────────────┬──────────────────────┬──────────────┘
92
+ │ │ │
93
+ ▼ ▼ ▼
94
+ ┌────────────────────────────────────────────────────────────────────────────────────────┐
95
+ │ FASTAPI BACKEND SERVER (`alpiecode serve`) │
96
+ │ • POST /chat (SSE Stream) • POST /completion (Inline Ghost) • GET /sessions │
97
+ │ • POST /cancel/{id} • GET /health • GET /metrics │
98
+ └──────────────────────────────────────────┬─────────────────────────────────────────────┘
99
+ │
100
+ ▼
101
+ ┌────────────────────────────────────────────────────────────────────────────────────────┐
102
+ │ AGENT ORCHESTRATOR │
103
+ │ • 5-Layer Context Assembly (System + Summary + Anchors + Turns + Request) │
104
+ │ • Rolling Compaction with Lazy-Cached Summaries │
105
+ │ • Session State Isolation & Reentrancy Guards │
106
+ │ • Persistent Cross-Session Memory (~/.alpiecode/memories/) │
107
+ └──────────────────────────────────────────┬─────────────────────────────────────────────┘
108
+ │
109
+ ▼
110
+ ┌────────────────────────────────────────────────────────────────────────────────────────┐
111
+ │ HYBRID DUAL-ENGINE ROUTER │
112
+ │ │
113
+ │ ┌──────────────────────────────────────────────┐ │
114
+ │ │ Active Internet Connectivity? │ │
115
+ │ └──────────────┬────────────────┬──────────────┘ │
116
+ │ │ │ │
117
+ │ YES (Online) NO (Offline) │
118
+ │ │ │ │
119
+ │ ▼ ▼ │
120
+ │ ┌────────────────────────┐ ┌────────────────────────┐ │
121
+ │ │ OpenAIBackend │ │ LocalBackend │ │
122
+ │ │ (Remote 169Pi Cloud VLM│ │ (Local GGUF Engine) │ │
123
+ │ │ High-Throughput API) │ │ (Zero Internet Req.) │ │
124
+ │ └────────────────────────┘ └────────────────────────┘ │
125
+ └──────────────────────────────────────────┬─────────────────────────────────────────────┘
126
+ │
127
+ ▼
128
+ ┌────────────────────────────────────────────────────────────────────────────────────────┐
129
+ │ 15 AUTONOMOUS AGENT TOOLS │
130
+ │ write_file • edit_file • read_file • apply_patch • bash • list_files │
131
+ │ file_search • view_image • fetch_url • web_search • clone_repo • update_plan │
132
+ │ extract_memories • compact_context • diagnostics │
133
+ │ │ │
134
+ │ ▼ │
135
+ │ SAFETY GUARDIAN & SANDBOX GATE │
136
+ │ (Blocks destructive commands, enforces paths, sandbox execution) │
137
+ └────────────────────────────────────────────────────────────────────────────────────────┘
138
+ ```
139
+
140
+ ### ⚡ Smart Fallback Resilience
141
+ - **Network-Aware Routing**: Local GGUF fallback triggers **only when internet is genuinely unavailable**, preventing unnecessary model loading on brief cloud API delays or transient server timeouts (which are retried automatically).
142
+ - **Sanitized Chat Templates**: Converts complex multi-turn OpenAI tool schemas and system structures into sanitized templates compatible with local Jinja2 GGUF renderers.
143
+ - **Zero Crashes**: If network drops mid-session, the agent gracefully recovers or provides clear diagnostic feedback.
144
+
145
+ ---
146
+
147
+ ## ⚡ System 1 (Jev Architecture) & Performance Engine
148
+
149
+ AlpieCode introduces a **Dual-Process Cognitive Architecture** inspired by TypeSafe AI's **Jev (System 1)** framework:
150
+ - **System 1 (Fast Reflex & Decision Plane)**: A sub-5ms non-autoregressive decision engine that handles routine routing, parameter validation, test parsing, loop prevention, and error triage.
151
+ - **System 2 (Deep Thought & Generative Engine)**: The heavy reasoning LLM (169Pi Cloud VLA / Claude / GPT-4o online, or local Qwen GGUF offline) dedicated purely to code synthesis and architectural reasoning.
152
+
153
+ ```
154
+ ┌──────────────────────────────────────────────┐
155
+ │ User Coding Task │
156
+ └──────────────────────┬───────────────────────┘
157
+ │
158
+ ┌────────────────────────────────────────▼──────────────────────────────────────────────────┐
159
+ │ SYSTEM 1: Jev Decision Plane (<5ms) │
160
+ │ • Tool Call Validation • Repeated Loop Detection • Test Result Triage │
161
+ │ • Surgical Diff Enforcement • Context Noise Filtering │
162
+ └────────────────────────────────────────┬──────────────────────────────────────────────────┘
163
+ │
164
+ ┌───────────────────┴───────────────────┐
165
+ ▼ ▼
166
+ ┌───────────────────────────┐ ┌───────────────────────────┐
167
+ │ Online Cloud Backend │ │ Offline Local Engine │
168
+ │ (169Pi / Claude / GPT) │ │ (llama.cpp Qwen GGUF) │
169
+ │ • Sub-12s Task Completion│ │ • Zero Context Overflow │
170
+ │ • >75% Token Savings │ │ • Zero Syntax Crash Loops│
171
+ └───────────────────────────┘ └───────────────────────────┘
172
+ ```
173
+
174
+ ### Key Capabilities
175
+
176
+ 1. **⚡ TypeSafe System 1 Decision Loop (`src/codeagent/system1.py`)**:
177
+ - **Loop & Oscillation Detection**: Tracks tool call signatures. If the agent fails an operation twice (e.g. repeated syntax errors), System 1 intercepts the turn and forces a targeted `edit_file` directive rather than an infinite full-file rewrite.
178
+ - **Automated Test Health Parser**: Fast regex engine parsing pytest, unittest, and npm test outputs in <1ms to determine test success without burning LLM inference.
179
+ - **Tool Parameter Validator**: Pre-execution validation preventing malformed or missing parameters.
180
+
181
+ 2. **🚀 Multi-Tier Caching System (`src/codeagent/cache.py`)**:
182
+ - **`FileReadCache`**: In-memory cache for repeated file reads keyed by `(path, mtime, size, line_range)`. Cuts read latency from 1.2ms to **<0.05ms** (24x speedup).
183
+ - **`TestResultCache`**: Disk-persisted cache in `~/.alpiecode/cache/test_cache.json` keyed by a workspace file fingerprint (`hash(mtimes)`). Unchanged test suites re-run in **<1ms** with zero redundant execution.
184
+ - **`ResponseCache`**: Disk-backed LRU cache for pure text explanations and Q&A.
185
+
186
+ 3. **🗜️ Context Noise Filtering (`src/codeagent/context.py`)**:
187
+ - Compresses 50+ lines of clean passing test noise down to a 2-line summary (`[Clean Test Output]`).
188
+ - On test failures, preserves critical tracebacks and failure frames while stripping passing test dots, achieving **>75% token reduction**.
189
+
190
+ 4. **📊 Real-Time Performance Observability (`src/codeagent/metrics.py`)**:
191
+ - At the conclusion of every task, AlpieCode renders an end-of-task summary:
192
+ ```text
193
+ ╭──────────────────────── 📊 Task Performance Summary ────────────────────────╮
194
+ │ ⏱️ Latency: 12.22s | 🧠 LLM Calls: 2 (5425ms) │
195
+ │ 🛠️ Tools Time: 153.5ms (1 calls) | 📦 Context Prep: 6253ms | ⚡ Cache: 1│
196
+ ╰─────────────────────────────────────────────────────────────────────────────╯
197
+ ```
198
+
199
+ 5. **📜 Agent Operational Guidelines (`agents.md`)**:
200
+ - Operational rules defining the **Investigate → Plan → Surgical Edit → Verify → Complete** cycle, enforcing surgical diffs for files >100 lines and zero stub implementations.
201
+
202
+ ---
203
+
204
+ ## 📊 Performance & Optimization Benchmarks
205
+
206
+ Comprehensive benchmarks comparing AlpieCode before vs. after the System 1 Jev engine and caching upgrade:
207
+
208
+ | Benchmark Metric | Baseline (v9.0) | With System 1 & Caching (v10.0.2) | Improvement |
209
+ | :--- | :---: | :---: | :---: |
210
+ | **Simple Test & Verify Task Latency** | 45.57s | **12.22s** | **3.7x faster (73% drop)** |
211
+ | **Repeated File Read Latency** | 1.20 ms | **<0.05 ms** | **24x faster** (In-Memory Cache) |
212
+ | **Unchanged Test Suite Re-run** | 3,500 ms | **<1.0 ms** | **Instant (Zero-Latency Cache)** |
213
+ | **Test Output Context Token Footprint**| ~3,500 tokens (500 lines) | **~80 tokens (4 lines)** | **>75% Context Compression** |
214
+ | **Syntax Error Retry Recovery** | Infinite full-file loop | **Loop intercepted on Turn 2** | Self-healing surgical diff |
215
+ | **Full Regression Test Suite** | 52 passed | **96 passed (100% green)** | Complete reliability |
216
+
217
+ ---
218
+
219
+ ## 📦 Complete Installation Guide
220
+
221
+ ### 1. Prerequisites
222
+ - **Python**: `>= 3.9` (Recommended: Python 3.10, 3.11, or 3.12)
223
+ - **Platforms**:
224
+ - **Linux**: Ubuntu 20.04+, Debian 11+, Fedora, Arch Linux
225
+ - **Windows**: Native Windows 10/11 or Windows Subsystem for Linux (WSL2 / Ubuntu)
226
+ - **macOS**: Apple Silicon (M1/M2/M3/M4) & Intel
227
+ - **Dev Tools (Recommended)**: `git`, `curl`, `ripgrep` (optional, falls back automatically)
228
+
229
+ ---
230
+
231
+ ### 2. Python Package Installation
232
+
233
+ #### Option A: Quick Install via pip (Any Virtual Environment)
234
+ Activate any virtual environment of your choice (`venv`, `conda`, `uv`, `virtualenv`, `poetry`) and install directly:
235
+ ```bash
236
+ # 1. Activate your preferred virtual environment (e.g. venv)
237
+ python3 -m venv myenv
238
+ source myenv/bin/activate # On Windows: myenv\Scripts\activate
239
+
240
+ # Or using Conda:
241
+ # conda create -n alpie python=3.11 -y && conda activate alpie
242
+
243
+ # 2. Install AlpieCode
244
+ pip install alpiecode
245
+ ```
246
+
247
+ #### Option B: From Source / Editable Mode (Recommended for Developers)
248
+ ```bash
249
+ # Clone the repository
250
+ git clone https://github.com/169Pi/codeagent-poc.git
251
+ cd codeagent-poc
252
+
253
+ # Create and activate a virtual environment
254
+ python3 -m venv .venv
255
+ source .venv/bin/activate # On Windows: .venv\Scripts\activate
256
+
257
+ # Install in editable mode with all dependencies
258
+ pip install -e .
259
+ ```
260
+
261
+ #### Option C: From Wheel (.whl)
262
+ ```bash
263
+ # Build the distribution
264
+ python3 -m pip install --upgrade build
265
+ python3 -m build
266
+
267
+ # Install the wheel
268
+ pip install dist/alpiecode-9.0.1-py3-none-any.whl
269
+ ```
270
+
271
+ #### Verify CLI Installation:
272
+ ```bash
273
+ alpiecode version
274
+ # Output: alpiecode 10.0.2
275
+
276
+ alpiecode doctor
277
+ ```
278
+
279
+ ---
280
+
281
+ ### 3. VS Code Extension Installation
282
+
283
+ The VS Code extension provides the AI sidebar, plan-first review, and inline ghost-text completions.
284
+
285
+ #### Automatic Installation (Zero Configuration)
286
+ Simply launch the AlpieCode backend server from your terminal:
287
+ ```bash
288
+ alpiecode serve
289
+ ```
290
+ If the VS Code extension is not already installed, AlpieCode **automatically packages and installs the `.vsix` into VS Code**!
291
+
292
+ #### Manual Installation via CLI:
293
+ ```bash
294
+ # Using the pre-built VSIX file
295
+ code --install-extension vscode/alpiecode-8.0.8.vsix
296
+ ```
297
+
298
+ #### Manual Packaging (For Extension Developers):
299
+ ```bash
300
+ cd vscode
301
+ npm install
302
+ npm run compile
303
+ npx @vscode/vsce package
304
+ code --install-extension alpiecode-8.0.8.vsix
305
+ ```
306
+
307
+ ---
308
+
309
+ ## 🚀 Backend API Server (`alpiecode serve`)
310
+
311
+ The AlpieCode FastAPI server runs as a high-concurrency daemon connecting local development environments, VS Code sidebars, remote IDEs, and external scripts to the autonomous agent engine.
312
+
313
+ ### Launching the Server
314
+ ```bash
315
+ # Default: binds to 127.0.0.1 on port 7169
316
+ alpiecode serve
317
+
318
+ # Custom Host and Port:
319
+ alpiecode serve --host 0.0.0.0 --port 8080
320
+ ```
321
+
322
+ ```text
323
+ _ _ _ ____ _
324
+ / \ | |_ _| | ___ / ___|___ __| | ___
325
+ / _ \ | | '_ \ |/ _ \ | / _ \ / _` |/ _ \
326
+ / ___ \| | |_) | | __/ |__| (_) | (_| | __/
327
+ /_/ \_\_|_.__/|_|\___|\____\___/ \__,_|\___|
328
+
329
+ ✅ AlpieCode VS Code extension is installed.
330
+ 🚀 Starting AlpieCode Server on http://127.0.0.1:7169
331
+ INFO: Uvicorn running on http://127.0.0.1:7169 (Press CTRL+C to quit)
332
+ ```
333
+
334
+ ### REST & SSE API Endpoints Reference
335
+
336
+ | Method | Endpoint | Description | Payload / Parameters |
337
+ | :--- | :--- | :--- | :--- |
338
+ | `POST` | `/chat` | Executes an agent task, streaming events in real time via **Server-Sent Events (SSE)**. | `{"task": str, "workdir": str, "session_id": Optional[str], "image": Optional[str], "reasoning_level": "thinking"\|"high"\|"low"}` |
339
+ | `POST` | `/completion` | Provides ultra-low-latency inline code completions (ghost text) ahead of cursor. | `{"prompt": str, "suffix": str, "language": str, "max_tokens": int}` |
340
+ | `GET` | `/health` | Health diagnostic check reporting server uptime, backend availability, and cache stats. | *None* |
341
+ | `GET` | `/sessions` | Lists active multi-turn sessions with token counts and workspace paths. | *None* |
342
+ | `DELETE`| `/sessions/{session_id}` | Deletes a session container and cleans up associated resources. | `session_id` in path |
343
+ | `POST` | `/cancel/{session_id}` | Gracefully cancels an in-progress agent task. | `session_id` in path |
344
+ | `GET` | `/metrics` | Returns token usage, speeds, and agent execution performance statistics. | *None* |
345
+
346
+ ---
347
+
348
+ ## ⌨️ Command-Line Interface (CLI) Full Reference
349
+
350
+ The `alpiecode` CLI provides a developer-friendly command suite:
351
+
352
+ ```text
353
+ usage: alpiecode [-h] [-v] [--workdir WORKDIR] [--image IMAGE] [--video VIDEO]
354
+ [--url URL] [--github GITHUB] [--max-turns MAX_TURNS]
355
+ [--thinking] [--no-thinking] [--no-update] [--quiet] [--debug]
356
+ {version,init,serve,run,chat,plan,diff,undo,doctor,explain} ...
357
+ ```
358
+
359
+ ---
360
+
361
+ ### 1. `alpiecode run "<task>"`
362
+ Executes an end-to-end autonomous software engineering task:
363
+ ```bash
364
+ # Standard task in the current directory:
365
+ alpiecode run "Create a FastAPI app with SQLite auth and JWT tokens"
366
+
367
+ # Specify a target project directory:
368
+ alpiecode run "Fix all failing pytest tests" --workdir /path/to/project
369
+
370
+ # Multimodal image analysis (mockup to code, UI bug fix):
371
+ alpiecode run "Implement this dashboard layout in React and Tailwind" --image ./mockup.png
372
+
373
+ # Video walkthrough or screen recording analysis:
374
+ alpiecode run "Reproduce and fix the UI crash shown in this screen recording" --video ./bug_repro.mp4
375
+
376
+ # Analyze a YouTube tutorial or demonstration URL:
377
+ alpiecode run "Implement the architecture explained in this video" --url "https://youtube.com/watch?v=xyz"
378
+
379
+ # Analyze and clone an open-source GitHub repository:
380
+ alpiecode run "Analyze the plugin architecture of this repo and summarize it" --github "psf/requests"
381
+
382
+ # Force deep reasoning mode or fast execution mode:
383
+ alpiecode run "Audit the cryptographic security of auth.py" --thinking
384
+ alpiecode run "Add docstrings to all functions in utils.py" --no-thinking
385
+
386
+ # Show full agent discovery intelligence and tool arguments:
387
+ alpiecode run "Refactor database migrations" --debug
388
+ ```
389
+
390
+ ---
391
+
392
+ ### 2. `alpiecode chat`
393
+ Starts a persistent, interactive terminal REPL with multi-turn memory:
394
+ ```bash
395
+ alpiecode chat
396
+ ```
397
+ *Features:*
398
+ - Retains context, variable names, and architectural decisions across turns.
399
+ - Rolling compaction prevents context window overflow.
400
+ - Checkpoints git state after each turn for easy rollback.
401
+ - Exit anytime by typing `exit`, `quit`, or pressing `Ctrl+C`.
402
+
403
+ ---
404
+
405
+ ### 3. `alpiecode plan "<task>"`
406
+ Generates an actionable architectural plan **without making file modifications**:
407
+ ```bash
408
+ alpiecode plan "Migrate the frontend from JavaScript to TypeScript"
409
+ ```
410
+ *Process:*
411
+ 1. Explores existing files and types (`list_files`, `file_search`, `read_file`).
412
+ 2. Synthesizes a structured checklist plan with milestones.
413
+ 3. Outputs clear implementation steps and risk assessments.
414
+
415
+ ---
416
+
417
+ ### 4. `alpiecode explain "<target>"`
418
+ Deep-dives into a local file, function, or technical concept:
419
+ ```bash
420
+ # Explain a local file:
421
+ alpiecode explain src/codeagent/orchestrator.py
422
+
423
+ # Explain a technical concept or codebase component:
424
+ alpiecode explain "How does the rolling context compaction work in AlpieCode?"
425
+ ```
426
+
427
+ ---
428
+
429
+ ### 5. `alpiecode diff`
430
+ Inspects all file changes and diffs made by AlpieCode since the last git checkpoint:
431
+ ```bash
432
+ alpiecode diff
433
+ ```
434
+
435
+ ---
436
+
437
+ ### 6. `alpiecode undo`
438
+ Instantly rolls back all file edits made during the last AlpieCode session:
439
+ ```bash
440
+ alpiecode undo
441
+ ```
442
+
443
+ ---
444
+
445
+ ### 7. `alpiecode doctor`
446
+ Runs an instant system and environment diagnostic suite:
447
+ ```bash
448
+ alpiecode doctor
449
+ ```
450
+ *Health Checks:*
451
+ - **Python Runtime**: Python version and active virtual environment status.
452
+ - **Hardware Acceleration**: CUDA availability, GPU device name, and VRAM.
453
+ - **Network & Latency**: DNS resolution, ping latency (ms), and remote API reachability.
454
+ - **Compilers & Dev Tools**: Presence of `gcc`, `g++`, `git`, `node`, `java`, etc.
455
+ - **VS Code Extension**: Installation verification and version check.
456
+
457
+ ---
458
+
459
+ ### 8. `alpiecode init`
460
+ Interactive CLI wizard to configure endpoints, API keys, models, and defaults:
461
+ ```bash
462
+ alpiecode init
463
+ ```
464
+
465
+ ---
466
+
467
+ ## 💻 VS Code Extension Deep-Dive
468
+
469
+ The AlpieCode VS Code extension integrates directly into your daily IDE workflow.
470
+
471
+ ```
472
+ ┌────────────────────────────────────────────────────────┐
473
+ │ ALPIECODE CHAT ⚡ 48 tok/s · 1.4k│
474
+ ├────────────────────────────────────────────────────────┤
475
+ │ 🤖 Mode: [Online Cloud VLM] Reasoning: [High (Thinking)▼]
476
+ │ │
477
+ │ 👤 Create a login endpoint with rate limiting. │
478
+ │ │
479
+ │ 🤖 ── Proposed Changes: auth.py ───────────────────── │
480
+ │ ┌────────────────────────────────────────────────────┐ │
481
+ │ │ 📋 Change Plan Card │ │
482
+ │ │ - from flask import Flask │ │
483
+ │ │ + from flask import Flask, request, jsonify │ │
484
+ │ │ + from flask_limiter import Limiter │ │
485
+ │ │ │ │
486
+ │ │ [✅ Accept] [❌ Reject] [✏️ Edit Request] │ │
487
+ │ └────────────────────────────────────────────────────┘ │
488
+ │ │
489
+ │ 📦 'flask_limiter' required but not installed. │
490
+ │ [Create .venv & Install] [Install Globally] [Skip] │
491
+ ├────────────────────────────────────────────────────────┤
492
+ │ > Type /plan, /explain, /doctor, or ask a question... │
493
+ │ [📎 Image] [📋 Plan-First: ON] [Send ❯] │
494
+ └────────────────────────────────────────────────────────┘
495
+ ```
496
+
497
+ ### 1. 📋 Plan-First Review & Change Approval Workflow
498
+ - When modifying existing files, AlpieCode presents an interactive **Change Plan Card** with side-by-side / unified diffs (`-` red / `+` green).
499
+ - **`✅ Accept`**: Commits the change, opens the file in your active editor, and runs verification.
500
+ - **`❌ Reject`**: Discards the modification cleanly.
501
+ - **`✏️ Edit Request`**: Opens an inline input box to provide steering instructions (e.g. *"Use Redis backend for rate limiting"*).
502
+
503
+ ---
504
+
505
+ ### 2. 🗂️ Persistent Multi-Turn Conversation History
506
+ - **Active Thread Context**: Each chat conversation maintains a persistent `sessionId`. The model retains all prior turns, files discussed, and tool results.
507
+ - **History Drawer**: Click the **History** button (`🕒`) in the sidebar header to view, reload, or delete up to **50 past conversations** saved in VS Code global storage.
508
+
509
+ ---
510
+
511
+ ### 3. 🧠 Reasoning Level Selector
512
+ Toggle model behavior directly in the sidebar dropdown:
513
+ - 🧠 **High (Thinking)**: Maximal chain-of-thought reasoning, multi-step problem solving, and complex architectural design.
514
+ - ⚡ **Low (Fast)**: Direct code generation with zero reasoning overhead for quick one-liners and docstring edits.
515
+
516
+ ---
517
+
518
+ ### 4. ⚡ Slash Commands (`/`)
519
+ Type **`/`** in the chat input to invoke quick commands:
520
+ - `📋 /plan <task>` — Creates a structured architectural plan without modifying code.
521
+ - `💡 /explain <file>` — Explains code, architecture, or algorithms step-by-step.
522
+ - `🩺 /doctor` — Executes full system diagnostic checks in the chat window.
523
+
524
+ ---
525
+
526
+ ### 5. 🖱️ Right-Click Context Menu Actions
527
+ Highlight any code in your editor, right-click, and choose:
528
+ - **Fix This Error**: Automatically aggregates language diagnostics (errors, warnings) and selected code to generate an instant fix.
529
+ - **Generate Tests**: Writes unit tests (pytest, jest, etc.) for the selected function or class.
530
+ - **Explain Code**: Explains the selected snippet line-by-line.
531
+ - **Refactor / Optimize**: Cleans, modernizes, and improves the performance of the highlighted block.
532
+ - **Ask About Selection**: Prompts for a custom question regarding the highlighted code.
533
+
534
+ ---
535
+
536
+ ### 6. 👻 Inline Ghost-Text Code Autocomplete
537
+ As you write code in any file, AlpieCode streams inline suggestions ahead of your cursor:
538
+ - Non-intrusive gray ghost-text suggestions.
539
+ - Press **`Tab`** to accept the suggestion, or keep typing to ignore.
540
+ - Intelligent debounce and circuit breakers ensure zero editor lag.
541
+
542
+ ---
543
+
544
+ ### 7. 🐍 Proactive Virtual Environment (`.venv`) Auto-Prompt
545
+ When generated code requires external libraries (`numpy`, `pandas`, `fastapi`, etc.):
546
+ - AlpieCode scans the AST imports before execution.
547
+ - If packages are missing, an interactive prompt appears:
548
+ ```text
549
+ 📦 'fastapi' is required but not installed in your active environment.
550
+ 🐍 No virtual environment detected. Create one?
551
+
552
+ [Create .venv & Install] [Install Globally] [Skip]
553
+ ```
554
+ - Choosing **Create .venv & Install** automatically spins up `.venv`, installs the packages, and runs the script using `.venv/bin/python3`.
555
+
556
+ ---
557
+
558
+ ### 8. 📊 Live Token & Speed Meter
559
+ Displays real-time performance indicators in the sidebar header:
560
+ `🟢 Online API` ── `⚡ 46 tok/s · 📊 1,820 tokens`
561
+
562
+ ---
563
+
564
+ ### 9. 📎 Multimodal Image Attachment
565
+ - Drag-and-drop UI screenshots directly into the chat.
566
+ - Paste images directly from your clipboard (**`Ctrl+V`** / **`Cmd+V`**).
567
+ - Click **`📎 Image`** to browse and attach mockups, architecture diagrams, or error screenshots.
568
+
569
+ ---
570
+
571
+ ### 10. ⚙️ Extension Settings (`settings.json`)
572
+ Configure AlpieCode in your VS Code settings:
573
+ ```json
574
+ {
575
+ "alpiecode.serverUrl": "http://127.0.0.1:7169",
576
+ "alpiecode.showReasoning": true,
577
+ "alpiecode.enableAutocomplete": true,
578
+ "alpiecode.autoRunCode": true,
579
+ "alpiecode.autoFixErrors": true,
580
+ "alpiecode.planFirstReview": true,
581
+ "alpiecode.githubUsername": "my-github-handle",
582
+ "alpiecode.confirmGitPush": true
583
+ }
584
+ ```
585
+
586
+ ---
587
+
588
+ ## 🐍 Python SDK Reference (Programmatic Usage)
589
+
590
+ Automate engineering workflows directly in Python scripts and CI/CD pipelines:
591
+
592
+ ```python
593
+ import alpiecode
594
+
595
+ # 1. Execute an autonomous engineering task
596
+ alpiecode.run(
597
+ task="Build a benchmark script comparing Polars vs Pandas on 10M rows",
598
+ workdir="./benchmarks",
599
+ reasoning_level="thinking" # "thinking" | "high" | "low"
600
+ )
601
+
602
+ # 2. Generate an implementation plan
603
+ alpiecode.plan(
604
+ task="Refactor authentication layer to use OAuth2 and JWT tokens",
605
+ workdir="."
606
+ )
607
+
608
+ # 3. Explain a file or architecture
609
+ alpiecode.explain(
610
+ target="src/codeagent/orchestrator.py",
611
+ workdir="."
612
+ )
613
+
614
+ # 4. Run system health diagnostics
615
+ status_code = alpiecode.doctor()
616
+ ```
617
+
618
+ ---
619
+
620
+ ## 📓 Jupyter Notebooks, JupyterLab & Google Colab
621
+
622
+ AlpieCode delivers a first-class developer experience inside Jupyter Notebooks and Google Colab with reactive UI cards and live status badges.
623
+
624
+ ```
625
+ ┌─────────────────────────────────────────────────────────────┐
626
+ │ 🤖 AlpieCode Agent [RUNNING] │
627
+ │ Task: Train an XGBoost model on iris dataset │
628
+ │ │
629
+ │ ✓ $ python -m pip install xgboost scikit-learn │
630
+ │ ✓ write_file train.py │
631
+ │ ✓ $ python train.py │
632
+ │ │
633
+ │ ✨ Code block automatically populated in next cell. │
634
+ │ Hit Shift+Enter to run. │
635
+ └─────────────────────────────────────────────────────────────┘
636
+ ```
637
+
638
+ ### 1. Setup in Colab or Jupyter
639
+ In any notebook cell:
640
+ ```python
641
+ # Install AlpieCode (in Colab)
642
+ !pip install alpiecode
643
+
644
+ # Load the IPython magic extension
645
+ %load_ext alpiecode
646
+ ```
647
+
648
+ ---
649
+
650
+ ### 2. Magic Commands
651
+
652
+ #### Single-Line Magic (`%alpie`)
653
+ ```python
654
+ %alpie Create a function to calculate Fibonacci numbers using memoization
655
+ ```
656
+
657
+ #### Multi-Line Cell Magic (`%%alpie`)
658
+ ```python
659
+ %%alpie
660
+ Create an end-to-end data pipeline script data_pipeline.py:
661
+ 1. Load dataset from https://raw.githubusercontent.com/mwaskom/seaborn-data/master/iris.csv
662
+ 2. Preprocess features with StandardScaler
663
+ 3. Train an XGBoost classifier with 5-fold cross validation
664
+ 4. Print the mean accuracy and confusion matrix
665
+ ```
666
+
667
+ #### Auto-Insert Code into Next Cell (`--insert` / `--code`)
668
+ Use `--insert` to have AlpieCode **automatically populate the generated code into the very next notebook cell**, ready for you to press **`Shift+Enter`**:
669
+ ```python
670
+ %alpie --insert Build a PyTorch neural network for MNIST digit classification
671
+ ```
672
+
673
+ #### Specialized Notebook Magics:
674
+ ```python
675
+ # Plan without modifying files
676
+ %alpie_plan Build a custom PyTorch dataset loader for audio spectrograms
677
+
678
+ # Explain code or notebook variables
679
+ %alpie_explain model.py
680
+
681
+ # System diagnostic check
682
+ %alpie_doctor
683
+
684
+ # Reset conversation context between notebook sections
685
+ %alpie_reset
686
+ ```
687
+
688
+ ---
689
+
690
+ ## 🛠️ 15 Built-In Autonomous Agent Tools
691
+
692
+ The AlpieCode orchestrator autonomously selects and coordinates 15 specialized tools:
693
+
694
+ | # | Tool Name | Category | Description | Key Inputs |
695
+ | :-: | :--- | :--- | :--- | :--- |
696
+ | **1** | `write_file` | File System | Creates new files or completely overwrites existing files safely. | `path`, `content` |
697
+ | **2** | `edit_file` | File System | Replaces specific text blocks with surgical whitespace matching. | `path`, `old_str`, `new_str` |
698
+ | **3** | `read_file` | File System | Reads entire files or specific line ranges (`start_line`, `end_line`). | `path`, `start_line`, `end_line` |
699
+ | **4** | `apply_patch` | File System | Applies standard unified diff format patches. | `patch` |
700
+ | **5** | `bash` | Execution | Runs shell commands inside an isolated sandbox with safety gates. | `command`, `timeout` |
701
+ | **6** | `list_files` | Discovery | Recursively lists repository files with pattern matching & pruning. | `path`, `pattern`, `max_depth` |
702
+ | **7** | `file_search` | Discovery | High-speed ripgrep regex search across codebase contents. | `query`, `path`, `include` |
703
+ | **8** | `view_image` | Vision | Inspects and analyzes images, UI mockups, and screenshots. | `path` |
704
+ | **9** | `fetch_url` | Research | Fetches and extracts clean documentation and web pages. | `url` |
705
+ | **10**| `web_search` | Research | Queries DuckDuckGo for live API documentation and references. | `query`, `max_results` |
706
+ | **11**| `clone_repo` | Repository | Clones open-source repositories for local reference. | `repo_url`, `destination` |
707
+ | **12**| `update_plan` | Planning | Updates structured milestone checklists (`[x]` / `[ ]`). | `plan` |
708
+ | **13**| `extract_memories`| Memory | Extracts and persists project patterns and build commands. | `memories` |
709
+ | **14**| `compact_context` | Optimization| Compresses conversation history to prevent context overflow. | `summary` |
710
+ | **15**| `diagnostics` | Intelligence | Queries compiler and linter diagnostics for active files. | `path` |
711
+
712
+ ---
713
+
714
+ ## 🛡️ Safety Guardian, Git Checkpoints & Memory System
715
+
716
+ ### 1. Safety Guardian Gate (`src/codeagent/guardian.py`)
717
+ - **Destructive Command Blocking**: Intercepts and blocks commands like `rm -rf /`, `mkfs`, raw disk partitioning, fork bombs, and system-level modifications.
718
+ - **Sandbox Boundary Enforcement**: Prohibits writes outside the active project root directory (`workdir`).
719
+ - **Rate-Limited Auto-Fix Loops**: Automatically stops recursive error-fixing loops after **3 attempts** to prevent token waste and infinite loops.
720
+
721
+ ### 2. Git Checkpointing & Undo (`src/codeagent/git_ops.py`)
722
+ - **Automatic Checkpoints**: AlpieCode automatically creates temporary git checkpoints before executing tasks and after each multi-turn step.
723
+ - **One-Click Rollback**: Run `alpiecode undo` or reject a proposed plan in VS Code to restore your workspace to its exact prior state.
724
+
725
+ ### 3. Persistent Cross-Session Memory (`src/codeagent/memory.py`)
726
+ - Automatically captures project architecture patterns, build scripts, test conventions, and known quirks.
727
+ - Persisted locally in `~/.alpiecode/memories/` and injected into future sessions so the agent never asks the same question twice.
728
+
729
+ ### 4. Cross-Platform WSL2 Path Normalization
730
+ - Automatically translates Windows UNC paths (`\\wsl.localhost\...` and `\\wsl$\...`) to native Linux paths (`/home/...`) and routes commands through `wsl -d Ubuntu -- bash -c "..."` seamlessly.
731
+
732
+ ---
733
+
734
+ ## ⚙️ Configuration & Environment Variables
735
+
736
+ Configure AlpieCode globally via `alpiecode init` or by exporting environment variables:
737
+
738
+ | Environment Variable | Default Value | Description |
739
+ | :--- | :--- | :--- |
740
+ | `OPENAI_API_BASE` | `https://test.169pi.ai/v1` | URL for the high-throughput 169Pi cloud VLM endpoint. |
741
+ | `OPENAI_API_KEY` | `EMPTY` | API authentication key (if required). |
742
+ | `ALPIECODE_MODEL` | `alpie_9b` | Target model name. |
743
+ | `ALPIECODE_SERVER_URL` | `http://127.0.0.1:7169` | Default URL for backend API server. |
744
+ | `ALPIECODE_N_CTX` | `262144` (Online) / `32768` (Offline) | Maximum context window size in tokens. |
745
+ | `ALPIECODE_TEMPERATURE` | `0.6` (Thinking) / `0.0` (Fast) | Model sampling temperature. |
746
+
747
+ ---
748
+
749
+ ## ❓ FAQ & Troubleshooting
750
+
751
+ #### Q: How does the agent decide when to use Local GGUF vs. the Online API?
752
+ > **A:** AlpieCode always prioritizes the high-throughput **Online Cloud API**. It only switches to the **Local GGUF Engine** if an internet check confirms the system is genuinely offline. Transient server delays or timeouts retry automatically rather than falling back.
753
+
754
+ #### Q: How do I reload the VS Code extension after updating the backend?
755
+ > **A:** In VS Code, press **`Ctrl+Shift+P`** (or **`Cmd+Shift+P`** on macOS) and select **`Developer: Reload Window`**.
756
+
757
+ #### Q: Port 7169 is already in use. How do I change the port?
758
+ > **A:** Start the server with a custom port:
759
+ > ```bash
760
+ > alpiecode serve --port 8080
761
+ > ```
762
+ > Then update the `alpiecode.serverUrl` setting in VS Code:
763
+ > ```json
764
+ > "alpiecode.serverUrl": "http://127.0.0.1:8080"
765
+ > ```
766
+
767
+ #### Q: Can I run AlpieCode completely offline on an airplane or air-gapped machine?
768
+ > **A:** Yes! AlpieCode includes full offline GGUF local model execution. Simply run any CLI command (`alpiecode run "..."`) or start the local server, and it will execute locally using CPU or CUDA hardware acceleration with zero internet access required.
769
+
770
+ ---