# PROMPT-TODO.md

## Task: Update project directory from 'camera-control' to 'dslr'

### TODO Items:

- [x] Search for all occurrences of 'camera-control' in the codebase
  - Found in: CLAUDE.md (2 occurrences), app.php (6 occurrences), imageRelay.php (1 occurrence)
  
- [x] Update URLs and paths in PHP files
  - [x] Update app.php endpoint URLs (lines 70-76)
  - [x] Remove imageRelay.php from dslr directory (using php-tools version instead)
  
- [x] Update documentation files
  - [x] Update CLAUDE.md App Home URL (line 190)
  - [x] Update CLAUDE.md space.txt reference (line 336)
  
- [ ] Update Google Cloud Console webhook URL configuration
  - Note: User must update webhook URL from https://www.livetimelapse.com.au/ai/google-chat/camera-control/app.php to https://www.livetimelapse.com.au/ai/google-chat/dslr/app.php
  - Also update App Home URL from https://www.livetimelapse.com.au/ai/google-chat/camera-control/app-home.php to https://www.livetimelapse.com.au/ai/google-chat/dslr/app-home.php
  
- [x] Test critical functionality after updates
  - [x] Test image capture endpoint (HTTP 200)
  - [x] Test settings endpoint (HTTP 200)
  - [x] Test main app.php endpoint (HTTP 405 - correct, requires POST)
  - Note: Image relay uses php-tools version, not local
  
- [x] Run pushover notification when complete

### Implementation Plan:

1. Update all PHP files with new URLs/paths
2. Update documentation files
3. Create reminder for user about Google Cloud Console updates
4. Test functionality
5. Send completion notification

---

## Task: Remove wrapper script and implement direct synchronous execution

### Problem Statement
The wrapper script implementation for multi-space support is not working properly on the server. Need to simplify by removing the wrapper script and ensuring direct synchronous execution of the captureImageDSLRInstall script.

### TODO Items:

- [x] Remove wrapper script code from capture.php
  - [x] Remove wrapper script creation logic (lines 140-186)
  - [x] Implement direct synchronous execution
  - [x] Keep space ID display for visibility but note limitations
  
- [x] Update documentation
  - [x] Update CLAUDE.md to reflect synchronous execution without wrapper
  - [x] Document that multi-space delivery requires imageRelay.php updates
  - [x] Update troubleshooting section
  
- [x] Test synchronous capture execution
  - [x] Verify capture runs and waits for completion
  - [x] Check full output is displayed
  - [x] Confirm no background processes are spawned
  
- [x] Update TODO.md with completion status

- [x] Send pushover notification when complete

### Implementation Plan:

1. Simplify capture.php to remove wrapper script complexity
2. Ensure direct execution with full output capture
3. Update documentation to reflect current implementation
4. Test thoroughly
5. Send completion notification

---

## Task: Modify captureImageDSLRInstall script for multi-space support

### Problem Statement
Images are currently sent to a single hardcoded Google Chat space. Need to modify the captureImageDSLRInstall script to accept a space ID parameter and pass it to imageRelay.php so images go to the requesting space.

### TODO Items:

- [x] Modify captureImageDSLRInstall script
  - [x] Accept GOOGLE_CHAT_SPACE_ID as environment variable
  - [x] Add space_id parameter to curl command
  - [x] Maintain backward compatibility
  
- [x] Update capture.php to pass space ID
  - [x] Set GOOGLE_CHAT_SPACE_ID environment variable before execution
  - [x] Pass clean space ID (without "spaces/" prefix)
  
- [x] Create newcode.txt with modified script
  - [x] Include all modifications
  - [x] Add comments explaining changes
  
- [x] Update documentation
  - [x] Update CLAUDE.md with new implementation details
  - [x] Update TODO.md with completion status
  
- [x] Send pushover notification when complete

### Implementation Plan:

1. Modify shell script to check for GOOGLE_CHAT_SPACE_ID environment variable
2. Add space_id parameter to the curl command if variable is set
3. Update capture.php to set the environment variable
4. Create newcode.txt for user to deploy
5. Update all documentation
6. Send completion notification

---

## Task: Debug capture script execution and fix image delivery

### Problem Statement
The captureImageDSLRInstall script was downloaded but produces no output when executed. No image appeared in the Google Chat space. Need to debug why the script isn't working and ensure images are sent to the requesting space.

### TODO Items:

- [x] Debug script execution
  - [x] Add error checking to capture.php
  - [x] Test with a simple echo command first
  - [x] Check script execution permissions and environment
  - [x] Add debugging output (bash -x, stderr capture)
  - [x] Check script format and first few lines
  
- [ ] Verify space routing
  - [x] Confirm space ID is being passed correctly (AAAAW5ncoDw)
  - [ ] Check if imageRelay.php supports space_id parameter
  - [ ] Understand space.txt vs dynamic space routing
  
- [ ] Fix capture process
  - [ ] Ensure script runs properly (waiting for user to test with debugging)
  - [ ] Verify image is captured and sent
  - [ ] Confirm delivery to requesting space
  
- [x] Update documentation
  - [x] Document debugging features added
  - [x] Update implementation notes in CLAUDE.md
  - [x] Add notes to TODO.md about space routing
  
- [x] Send pushover notification when complete

### Implementation Plan:

1. Add debugging to capture.php to understand script execution
2. Test basic commands to verify SSH execution works
3. Check if the downloaded script has proper format/permissions
4. Verify the image relay process
5. Fix any issues found
6. Update documentation
7. Send completion notification