Commit Graph

12 Commits

Author SHA1 Message Date
Gemini AI 13bce7500c feat: Full code review, bug fixes, and philosophy book generation
This commit includes:
- A full code review and bug fixes for language drift, package loading, and CLI crashes.
- The generated 15,000-word philosophy manuscript.
- CODE_REVIEW.md and CHANGELOG.md documenting the process.
2026-05-20 21:15:11 +00:00
mrhavens ef932973cd feat: Add --thread-id and --resume flags for checkpointing
- Add --thread-id flag to CLI for checkpointing
- Add --resume flag to resume from checkpoint
- Generate UUID if no thread_id provided
- Display thread_id for user to save for resume

Usage:
  opus generate --concept "My book" --thread-id abc123
  # If fails:
  opus generate --concept "My book" --thread-id abc123 --resume
2026-03-13 23:24:41 +00:00
mrhavens b46e87ff76 feat: Nonfiction Intake System - All Three Paths
This commit completes Issue #18 (Purpose Classifier), adds Intake Agent
and CLI integration:

1. PURPOSE CLASSIFIER (Issue #18 - DONE earlier)
   - Keyword-based classification into 6 ReaderPurposes
   - LLM-enhanced classification for nuanced cases

2. INTAKE AGENT (NEW - addresses Issue #20, #23)
   - Created opus_orchestrator/nonfiction/intake.py
   - Intelligent agent that combines:
     * Explicit flags (--purpose, --category)
     * Keyword classification (auto-detect)
     * Conversational questions (when ambiguous)
   - IntakeAgent class with process() method
   - determine_intake() convenience function
   - get_questions() for conversational mode
   - Source tracking: explicit | classifier | intake | hybrid

3. CLI INTEGRATION (Issue #23)
   - Added --purpose flag: learn, understand, transform, decide, reference, inspire
   - Added --category flag: business, leadership, memoir, etc.
   - Both passed to orchestrator

Usage:
  # Explicit
  opus generate --book-type nonfiction --purpose transform --category self_help

  # Auto-classify
  opus generate --book-type nonfiction --concept "How to build a startup"

  # Programmatic
  result = await determine_intake(
    concept="Leadership for introverts",
    purpose="transform",  # or None for auto
    category="leadership",
    mode="auto"  # or "conversational"
  )
2026-03-13 20:46:06 +00:00
mrhavens 0f647e4e93 Add rigorous nonfiction frameworks
NEW frameworks:
- Diátaxis Tutorial - Learn by doing a project
- Diátaxis How-To - Accomplish a specific task
- Diátaxis Explanation - Clarify and deepen understanding
- Diátaxis Reference - Complete information lookup
- Technical Manual - From foundations to mastery
- Codebase Tour - Document code systematically
- API Documentation - Complete API reference

NonfictionGenerator class to use these frameworks.
CLI integration with --framework flag.

Example:
opus generate --framework codebase-tour --concept 'Linux Kernel'
2026-03-13 08:43:54 +00:00
mrhavens f946bb3714 Add web UI and S3 upload endpoints
- Web UI: novice-friendly interface at / and /ui
- Upload endpoint: /upload for file uploads
- S3 upload: /upload/s3 for uploading to S3/MinIO
- CLI: opus ui command to start web UI only
- Full HTML/CSS/JS interface with drag-drop, tabs, etc.
2026-03-13 03:55:10 +00:00
mrhavens 64cdabd2f8 Add local file/directory ingestion support
- LocalIngestor class for files and directories
- CLI: opus ingest-local PATH
- Generate from local: opus generate --local ./my-notes/
- Support for extensions, recursive scanning, summarize
- Pattern-based exclusion (.git, __pycache__, etc.)
2026-03-13 03:45:43 +00:00
mrhavens a6b43cd623 Add output options: save to S3 and GitHub
New CLI options:
--save-s3 BUCKET/PATH      Save manuscript to S3
--save-s3-endpoint URL    S3 endpoint for MinIO/DO Spaces
--save-repo OWNER/REPO    Commit to GitHub repo
--save-branch NAME        GitHub branch (default: main)
--save-commit-msg MSG    Commit message

Full pipeline example:
opus generate --repo owner/notes --save-repo owner/manuscripts --save-branch develop
2026-03-13 03:37:57 +00:00
mrhavens b89dc444ed Fix: API generate endpoint handling, remove use_autogen param
- Handle dict result properly in /generate endpoint
- Remove use_autogen from API (not supported in run_opus)
- API client now works: tested via CLI with local server
2026-03-13 03:33:42 +00:00
mrhavens 86dcb5e8f9 Add API client mode to CLI
Now CLI works in both local and client/server mode:

# Local mode (default)
opus generate --concept ...

# API client mode
opus --api-url http://localhost:8000 generate --concept ...
opus --api-url https://opus-api.example.com generate --repo owner/repo

OpusAPIClient class for programmatic API access.
2026-03-13 03:21:19 +00:00
mrhavens c248487d2e Add S3/MinIO ingestion support
- S3Ingestor class for S3-compatible storage
- Supports: AWS S3, MinIO, DigitalOcean Spaces, Wasabi
- CLI: opus ingest-s3 --bucket my-bucket --prefix notes/
- Features: list objects, download, upload, text extraction

Environment:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_REGION
- S3_ENDPOINT_URL (for MinIO/non-AWS)
2026-03-13 03:18:02 +00:00
mrhavens 64bea5cae6 Add comprehensive CLI, OpenAPI server, and documentation
CLI Commands:
- generate: Full manuscript generation with full GitHub content
- serve: Start FastAPI server with OpenAPI docs
- ingest: Standalone GitHub ingestion
- frameworks: List all story frameworks
- config: Show configuration
- docs: Show comprehensive docs (terminal/markdown/html)
- api: Export OpenAPI spec

Server:
- FastAPI with /docs, /redoc interactive docs
- /generate, /ingest, /frameworks, /health endpoints
- OpenAPI 3.0 specification

Documentation:
- Terminal, markdown, and HTML formats
- Full API reference
- Framework documentation
- Environment variables guide
- Project structure

Fix: Use full GitHub content as seed (not just 5000 chars)
2026-03-13 03:10:01 +00:00
mrhavens 4b8ae306e6 Add CrewAI integration + CLI for standalone running
- OpusCrew base class with CrewAI LLM integration
- FictionCrew: Writer, Editor, Proofreader agents
- NonfictionCrew: Researcher, Writer, Fact-Checker, Editor agents
- CLI entry point: python -m opus_orchestrator
- Commands: generate, frameworks, config
- Test: generated 282-word story with CrewAI crews

Usage:
    python -m opus_orchestrator generate --concept 'Your idea' --use-crewai
    python -m opus_orchestrator frameworks
    python -m opus_orchestrator config
2026-03-13 02:53:52 +00:00