Commit Graph

23 Commits

Author SHA1 Message Date
Mario Lavoie
0266fda42b Make KB Capture project-centric
- Sessions now live inside project folders: <Project>/_capture/<session>/
- Project picker dropdown (scans projects folder)
- Auto-discovers projects with KB/ folder or _context.md
- Windows: D:/ATODrive/Projects
- Linux: ~/obsidian-vault/2-Projects

This aligns with the KB structure where Mario updates:
- KB/dev/gen-XXX.md (session captures)
- Images/screenshot-sessions/ (frames)
2026-02-09 12:53:46 +00:00
Mario Lavoie
d5371cfe75 Add KB Capture v2 - clip-based recording system
New features:
- Clip-based workflow: record short clips, keep or delete
- Toggle recording with Ctrl+Shift+R
- Session management (start, clips, end)
- Modern CustomTkinter GUI with dark theme
- Global hotkeys for hands-free control
- Whisper transcription (local, no API)
- FFmpeg screen + audio capture
- Export to clawdbot_export/ for Mario processing

Files added:
- recorder.py: FFmpeg screen recording
- session.py: Session/clip management
- hotkeys.py: Global hotkey registration
- kb_capture.py: Main application logic
- gui_capture.py: Modern GUI
- export.py: Merge clips, transcribe, export

Docs:
- docs/KB-CAPTURE.md: Full documentation

Entry point: uv run kb-capture
2026-02-09 12:50:22 +00:00
Mario Lavoie
571855823f fix(gui): Simplified project selection workflow
Fixes:
- Single 'Select Project Folder' button replaces confusing New/Open
- Auto-creates project if folder is empty or has no project.json
- Auto-opens project if project.json exists
- Removed editable project name field (was confusing)
- Fixed 'directory not empty' error - now handles existing folders gracefully
- Better error messages and confirmations
- Project path shown as read-only label

The flow is now:
1. Click 'Select Project Folder'
2. Pick any folder
3. If new: project created automatically
   If existing: project opened automatically

TODO: Multilingual transcription support (Whisper handles mixed FR/EN poorly)
2026-01-28 15:31:12 +00:00
Mario Lavoie
ca01c7a944 feat(gui): Add topic field and smart video naming
- Added AddVideoDialog for entering session topic when adding videos
- Videos now renamed to: gen-{num}_{topic}_{timestamp}.ext
- Shows next generation number in UI
- Shows project info (total videos, pending, processed)
- Better error handling and user feedback
- Cleaner layout with sections

When adding a video, user can enter a topic like 'lateral-support-detail'
and the video is automatically renamed to a standardized format.
2026-01-28 15:19:14 +00:00
Mario Lavoie
e8cca0b9c5 Update README with hybrid workflow and GUI docs 2026-01-28 11:52:16 +00:00
Mario Lavoie
5fbd744cca Add Windows GUI for CAD-Documenter
- New gui.py with CustomTkinter interface
- Project create/open
- Video list management
- Process with export-only option
- Progress feedback
- Entry point: cad-doc-gui

Install GUI deps: uv pip install customtkinter
2026-01-28 02:53:16 +00:00
Mario Lavoie
2c517addc5 Fix KeyError: use .get() for all optional result fields 2026-01-28 02:27:45 +00:00
Mario Lavoie
fb2db882ba Fix export-only mode: don't show component results 2026-01-28 02:27:12 +00:00
Mario Lavoie
da8526772b Fix --all flag to actually reprocess all videos 2026-01-28 02:26:14 +00:00
Mario Lavoie
3e40e5b7a0 Add frame_extraction, vision, transcription to Config 2026-01-28 02:24:03 +00:00
Mario Lavoie
257e166689 Fix more Windows encoding: remove all emoji/Unicode 2026-01-28 02:18:32 +00:00
Mario Lavoie
20335e533a Fix Windows encoding: replace Unicode symbols with ASCII 2026-01-28 02:15:01 +00:00
Mario Lavoie
47c1f14160 Add missing VisionConfig class 2026-01-28 02:13:06 +00:00
Mario Lavoie
a1891974c9 Add missing FrameExtractionConfig class 2026-01-28 02:12:17 +00:00
Mario Lavoie
6890ca0283 Add --export-only mode for Clawdbot hybrid workflow
- New flag: cad-doc project process --export-only
- Extracts frames and transcribes locally (no API calls)
- Exports to clawdbot_export/ folder for Clawdbot processing
- New 'exported' status for videos awaiting Clawdbot
- Updated CLI status display to show exported count
2026-01-28 01:59:17 +00:00
Mario Lavoie
fce07c75e9 Add context documents and APM integration
Context Documents:
- context.py: ContextLoader loads project-specific context for LLM
  - project-brief.md, terminology.md, materials-standard.md
  - naming-conventions.md, existing-components.md
  - Templates auto-created with new projects
  - Context injected into vision analysis prompts

APM Integration:
- apm_integration.py: Client for Atomaste Part Manager
  - APMClient: search, get_part, create_part
  - ComponentMatcher: fuzzy matches components to APM parts
  - Auto-suggests P/N during video processing
  - Falls back gracefully if APM not available

Updates:
- project.py: Creates context/ folder with templates
- incremental.py: Loads context, uses APM for P/N lookup
- vision_analyzer.py: Accepts context parameter for prompts

Usage:
- Edit context/*.md files to give LLM project knowledge
- APM P/N lookup happens automatically if apm CLI available
2026-01-28 01:06:40 +00:00
Mario Lavoie
3ee0b14a2b Add iterative project mode for multi-video documentation
New features:
- project.py: Project management with VideoEntry, ComponentKnowledge
  - Tracks videos, components, changes over time
  - Accumulates knowledge across multiple videos
  - Change history tracking per component
  - Atomizer hints merging

- incremental.py: Incremental processing
  - Processes videos in chronological order
  - Detects explicit changes from transcript (supersedes, adds, updates)
  - Merges component info intelligently
  - UnifiedDocumentGenerator for final output

- cli_project.py: New CLI commands
  - cad-doc project init <path> - Create new project
  - cad-doc project add <project> <video> - Add video
  - cad-doc project process <project> - Process pending videos
  - cad-doc project generate <project> - Generate unified docs
  - cad-doc project status <project> - Show project status
  - cad-doc project list-components <project> - List all components

Usage:
  cad-doc project init ./my-bracket
  cp video1.mp4 video2.mp4 ./my-bracket/videos/
  cad-doc project add ./my-bracket videos/video1.mp4
  cad-doc project add ./my-bracket videos/video2.mp4
  cad-doc project process ./my-bracket
  cad-doc project generate ./my-bracket
2026-01-28 00:37:45 +00:00
Mario Lavoie
d2e63a335a Fix video_processor.py with enhanced frame extraction
- Add VideoMetadata dataclass with has_audio flag
- Implement hybrid frame extraction mode
- Add blur score calculation
- Better scene change detection
- Proper config integration
2026-01-27 20:22:53 +00:00
Mario Lavoie
ae5367dab5 Add uv.lock and transcript parsing prompt 2026-01-27 20:20:03 +00:00
Mario Lavoie
ca51b10c45 Add comprehensive documentation and examples
- docs/USAGE.md: Full usage guide with CLI options, Python API, troubleshooting
- docs/ATOMIZER_INTEGRATION.md: Guide for FEA/Atomizer integration
- examples/sample_config.toml: Annotated configuration example
- README.md: Expanded with installation, usage, architecture
2026-01-27 20:18:28 +00:00
Mario Lavoie
148180c12e Full implementation - Vision AI, config, improved pipeline
Major changes:
- vision_analyzer.py: Real OpenAI/Anthropic vision API integration
  - Component detection with confidence scores
  - Atomizer hints extraction (objectives, constraints, parameters)
  - Material and feature identification
  - Timeline correlation with transcript

- config.py: Full configuration system
  - API settings (provider, keys, models)
  - Processing settings (Whisper model, frame interval, scene detection)
  - Output settings (BOM, hints, PDF template)
  - Config file support (~/.cad-documenter.toml)

- audio_analyzer.py: Enhanced transcription
  - Audio stream detection
  - Graceful fallback for missing audio
  - Keyword extraction
  - Technical term detection
  - Timeline correlation

- video_processor.py: Smart frame extraction
  - Scene change detection via ffmpeg
  - Configurable thresholds
  - Best frame selection

- doc_generator.py: Improved output
  - Better Markdown templates
  - BOM CSV export
  - Atomizer hints JSON
  - Component cards

- cli.py: Rich CLI with progress indicators
  - Config file support
  - --init-config flag
  - Verbose mode
  - Better error messages

- tests: Comprehensive test suite
2026-01-27 20:16:44 +00:00
Mario Lavoie
1e94a98e5b Initial project scaffold - Phase 1 MVP structure
Core modules:
- cli.py: Command-line interface with Click
- pipeline.py: Main orchestrator
- video_processor.py: Frame extraction with ffmpeg
- audio_analyzer.py: Whisper transcription
- vision_analyzer.py: Component detection (placeholder)
- doc_generator.py: Markdown + PDF output

Also includes:
- pyproject.toml with uv/hatch config
- Prompts for AI analysis
- Basic tests
- ROADMAP.md with 4-week plan
2026-01-27 20:05:34 +00:00
621234cbdf Initial commit 2026-01-27 20:02:59 +00:00