docs: update native app specifications and TODO for Phase 5 completion
- Synchronize Functional Spec with new system handlers (Wallpaper, Power, Recording, Displays). - Update Automation Scripts with finalized AppleScript handlers for PowerPoint and Keynote. - Mark IDAA and Phase 5 automation tasks as completed in TODO.md.
This commit is contained in:
@@ -2,37 +2,46 @@
|
||||
|
||||
**Target OS:** macOS (Primary), Linux/Windows (Secondary)
|
||||
**Languages:** AppleScript (`osascript`), Bash (`sh`), Node.js `child_process`
|
||||
**Implementation:** `src/main/shell_handlers.ts` (Electron App)
|
||||
|
||||
## 1. Presentation Control (AppleScript)
|
||||
## 1. Presentation Launch & Control (AppleScript)
|
||||
To provide a seamless "Podium Experience," the app uses AppleScript to control third-party presentation software.
|
||||
|
||||
### 1.1 Microsoft PowerPoint
|
||||
* **Intent:** `powerpoint:start`
|
||||
* **Script:**
|
||||
* **Launch:** `powerpoint:launch`
|
||||
```applescript
|
||||
tell application "Microsoft PowerPoint"
|
||||
activate
|
||||
open (POSIX file "[FILE_PATH]")
|
||||
run slide show settings of active presentation
|
||||
delay 1
|
||||
run slide show of active presentation
|
||||
end tell
|
||||
```
|
||||
* **Intent:** `powerpoint:quit`
|
||||
* **Script:** `quit application "Microsoft PowerPoint" saving no`
|
||||
* **Control:**
|
||||
* **Next:** `tell application "Microsoft PowerPoint" to next slide of slide show view of active presentation`
|
||||
* **Prev:** `tell application "Microsoft PowerPoint" to previous slide of slide show view of active presentation`
|
||||
* **Start:** `tell application "Microsoft PowerPoint" to run slide show of active presentation`
|
||||
* **Stop:** `tell application "Microsoft PowerPoint" to stop slide show of active presentation`
|
||||
* **Quit:** `quit application "Microsoft PowerPoint" saving no`
|
||||
|
||||
### 1.2 Apple Keynote
|
||||
* **Intent:** `keynote:start`
|
||||
* **Script:**
|
||||
* **Launch:** `keynote:launch`
|
||||
```applescript
|
||||
tell application "Keynote"
|
||||
activate
|
||||
open (POSIX file "[FILE_PATH]")
|
||||
delay 1
|
||||
start (front document)
|
||||
end tell
|
||||
```
|
||||
* **Control:**
|
||||
* **Next:** `tell application "Keynote" to show next`
|
||||
* **Prev:** `tell application "Keynote" to show previous`
|
||||
* **Start:** `tell application "Keynote" to start (front document)`
|
||||
* **Stop:** `tell application "Keynote" to stop`
|
||||
|
||||
### 1.3 Adobe Acrobat (PDF)
|
||||
* **Intent:** `acrobat:fullscreen`
|
||||
* **Script:**
|
||||
* **Launch:** `acrobat:fullscreen`
|
||||
```applescript
|
||||
tell application "Adobe Acrobat Reader"
|
||||
activate
|
||||
@@ -42,6 +51,13 @@ To provide a seamless "Podium Experience," the app uses AppleScript to control t
|
||||
end tell
|
||||
```
|
||||
|
||||
### 1.4 LibreOffice (Linux Testing)
|
||||
* **Launch:** `libreoffice:launch`
|
||||
```bash
|
||||
libreoffice --impress "[FILE_PATH]"
|
||||
```
|
||||
* **Note:** LibreOffice control on Linux is currently limited to launch-only.
|
||||
|
||||
## 2. Process Management (Bash/Node)
|
||||
The app must ensure that only one presentation is "Active" to prevent audio overlap or confusion.
|
||||
|
||||
@@ -107,19 +123,19 @@ To keep the bridge secure, we do **not** send raw scripts from the UI. Instead,
|
||||
|
||||
**Renderer Call:**
|
||||
```javascript
|
||||
native_app.launcher.execIntent('presentation:start', { path: '/tmp/my_deck.pptx' });
|
||||
window.aetherNative.launch_presentation({ path: '/tmp/my_deck.pptx', app: 'powerpoint' });
|
||||
window.aetherNative.control_presentation({ app: 'powerpoint', action: 'next' });
|
||||
```
|
||||
|
||||
**Main Process Handler:**
|
||||
**Main Process Handler (`src/main/shell_handlers.ts`):**
|
||||
1. Verify the file path is within the allowed `[tmp]` directory.
|
||||
2. Identify the file extension (`.pptx`).
|
||||
3. Select the corresponding AppleScript template.
|
||||
4. Replace `[FILE_PATH]` and execute via `child_process.exec`.
|
||||
2. Select the corresponding AppleScript template based on `app` and `action`.
|
||||
3. Replace `[FILE_PATH]` and execute via `child_process.exec`.
|
||||
|
||||
## 7. Linux Development Mocking
|
||||
Since development happens on Arch Linux, the `execIntent` handler will check `process.platform`:
|
||||
- If `darwin`: Execute `osascript` or `sh`.
|
||||
- If `linux`: Write the intended command to a log file at `~/OSIT/automation_debug.log` and simulate a "Success" return.
|
||||
- If `darwin`: Execute `osascript`.
|
||||
- If `linux`: Use `libreoffice` for launch, or log intent for control commands.
|
||||
- **Recording Mock:** Use `ffmpeg` or generate a fake `.mp4` file to test the sync/upload logic.
|
||||
|
||||
## 8. Refresh & Sync Loops
|
||||
|
||||
Reference in New Issue
Block a user