3.1 KiB
3.1 KiB
Implementation Plan: Manual Slop Headless Backend
Phase 1: Project Setup & Headless Scaffold
- Task: Update dependencies (
02fc847)- Add
fastapianduvicorntopyproject.toml(and syncrequirements.txtviauv).
- Add
- Task: Implement headless startup
- Modify
gui_2.py(or createheadless.py) to parse a--headlessCLI flag. - Update config parsing in
config.tomlto support headless configuration sections. - Bypass Dear PyGui initialization if headless mode is active.
- Modify
- [~] Task: Create foundational API application
- Set up the core FastAPI application instance.
- Implement
/healthand/statusendpoints for Docker lifecycle checks.
- Task: Conductor - User Manual Verification 'Project Setup & Headless Scaffold' (Protocol in workflow.md)
Phase 2: Core API Routes & Authentication
- Task: Implement API Key Security
- Create a dependency/middleware in FastAPI to validate
X-API-KEY. - Configure the API key validator to read from environment variables or
manual_slop.toml(supporting Unraid template secrets). - Add tests for authorized and unauthorized API access.
- Create a dependency/middleware in FastAPI to validate
- Task: Implement AI Generation Endpoint
- Create a
/api/v1/generatePOST endpoint. - Map request payloads to
ai_client.pyunified wrappers. - Return standard JSON responses with the generated text and token metrics.
- Create a
- Task: Conductor - User Manual Verification 'Core API Routes & Authentication' (Protocol in workflow.md)
Phase 3: Remote Tool Confirmation Mechanism
- Task: Refactor Execution Engine for Async Wait
- Modify
shell_runner.pyand tool-call loops to support a non-blocking "Pending Confirmation" state instead of launching a GUI modal.
- Modify
- Task: Implement Pending Action Queue
- Create an in-memory (or file-backed) queue for tracking unconfirmed PowerShell scripts.
- Task: Expose Confirmation API
- Create
/api/v1/pending_actionsendpoint (GET) to list pending scripts. - Create
/api/v1/confirm/{action_id}endpoint (POST) to approve or deny a script execution. - Ensure the AI generation loop correctly resumes upon receiving approval.
- Create
- Task: Conductor - User Manual Verification 'Remote Tool Confirmation Mechanism' (Protocol in workflow.md)
Phase 4: Session & Context Management via API
- Task: Expose Session History
- Create endpoints to list, retrieve, and delete session logs from the
project_history.toml.
- Create endpoints to list, retrieve, and delete session logs from the
- Task: Expose Context Configuration
- Create endpoints to list currently tracked files/folders in the project scope.
- Task: Conductor - User Manual Verification 'Session & Context Management via API' (Protocol in workflow.md)
Phase 5: Dockerization
- Task: Create Dockerfile
- Write a
Dockerfileusingpython:3.11-slimas a base. - Configure
uvinside the container for fast dependency installation. - Expose the API port (e.g., 8000) and set the container entrypoint.
- Write a
- Task: Conductor - User Manual Verification 'Dockerization' (Protocol in workflow.md)