Commit Graph

27 Commits

Author SHA1 Message Date
Scott Idem
86ea73bfbd fix(display): fail fast on invalid mode in display_control path; update docs
- Primary display_control path now validates mode explicitly ('mirror'|'extend')
  and returns an error instead of silently defaulting to extend.
  Passes mode directly to binary (simpler, avoids redundant ternary).
- README: update set_display_layout bridge table row to correctly describe
  display_control as primary and displayplacer as fallback.
- README: add one-time 'Build display_control Binary' section in Development
  with xcode-select, build, test, and git commit steps.
2026-05-20 17:04:39 -04:00
Scott Idem
a14c7c7a3f feat(display): add display_control CoreGraphics binary, replace displayplacer as primary path
Derived from OSIT MasterKey app (LegacyUtilities.m, Ian Kohl 2019).
Uses CGConfigureDisplayMirrorOfDisplay — native macOS API, no Homebrew dependency.
Handler now tries display_control first; falls back to displayplacer for missing binary
or per-device configStr overrides. Build the binary via scripts/build-display-control.sh
on a Mac (requires Xcode CLT only), then commit resources/bin/display_control.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 16:48:19 -04:00
Scott Idem
9df9d884e5 fix(display): fix mirror_of_display syntax, add Homebrew fallback, update docs
- `mirror:` was wrong; correct displayplacer param is `mirror_of_display:<uuid>`
- Same fix applied to the strip regex (extend path) and mirror detection check
- Binary lookup now tries resources/bin → /opt/homebrew/bin → /usr/local/bin
  so dev/venue Macs with `brew install displayplacer` work without bundling
- Updated TODO_AGENTS.md: marks auto-detection complete, documents one-time
  brew install step, bundling path, and optional per-device configStr override

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 16:33:25 -04:00
Scott Idem
e37fd1ddbb docs: sync README and list_tools() to current handler reality
README: correct set_display_layout (auto-detection default, configStr optional);
update set_wallpaper signature ({path?,url?,url_external?,display?,api_key?,
account_id?}); remove stale note on launch_presentation -e flag (hardened 2026-05-11).

list_tools(): expand from 13 entries to 22 — adds copy_from_cache_to_temp,
set_wallpaper, set_display_layout, window_control, power_control,
manage_recording, update_app, open_external, get_device_config; updates
launch_from_cache params (adds native_template); adds category comments;
improves all descriptions to reflect current behavior.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 15:39:27 -04:00
Scott Idem
a1e74829e8 fix(display): auto-detect displays for mirror/extend via displayplacer list
The handler was a stub that required an explicit configStr — the Svelte
caller never provides one, so mirror/extend silently failed every launch.

Now auto-detects connected displays:
- mirror: parses displayplacer list output, adds mirror:<primary_id> to
  secondary display(s); removes any existing mirror key first.
- extend: re-applies current layout if already extended; otherwise strips
  mirror keys and computes side-by-side origins from each display's width.
- configStr still takes priority when provided (manual per-device override).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 15:23:01 -04:00
Scott Idem
1008a55ec3 Adjust Linux wallpaper test mode 2026-05-13 18:57:27 -04:00
Scott Idem
c8fdb8b1e7 Harden wallpaper downloads 2026-05-13 18:43:58 -04:00
Scott Idem
bb51771dc7 Expand wallpaper handling 2026-05-13 18:08:49 -04:00
Scott Idem
7693b12aeb Clarify native template bridge contract 2026-05-13 11:44:36 -04:00
Scott Idem
72d928f907 Rename launch payload to native_template 2026-05-13 11:28:09 -04:00
Scott Idem
9b98b454fd Align launcher terminology docs 2026-05-13 11:25:55 -04:00
Scott Idem
ca4fddd57f fix(bridge): expose copy_from_cache_to_temp + harden launch_presentation
copy_from_cache_to_temp IPC handler was registered in file_handlers.ts
but never added to the preload bridge, making it unreachable from Svelte
despite being the documented preferred primitive for custom launch flows.

launch_presentation was the last handler still using osascript -e with
inline path injection. Converted to the temp-.scpt-file approach already
used by run_osascript and launch_from_cache — prevents breakage on
presentation filenames with spaces, quotes, or parentheses.

Also adds a pre-copy existence check to launch_from_cache so a missing
cache entry returns a meaningful error instead of a raw ENOENT.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 17:15:36 -04:00
Scott Idem
bab08cd8a7 fix(packaging): workaround yauzl/Node 26 hang + fix API bootstrap contract
Packaging was silently hanging forever because yauzl 2.10.0 read streams
emit no data events under Node 26, causing extract-zip to block indefinitely
inside @electron/packager 20. Fix: postinstall script patches
@electron/packager/dist/unzip.js to use bsdtar (libarchive) instead.
bsdtar was chosen over 7z because 7z refuses chained symlinks in macOS
.app framework bundles. Both package:linux and package:mac now produce
correct output.

Also corrects the V3 API bootstrap contract in api_client.ts:
- SearchQuery body was wrapped in an extra {search_query: ...} layer — removed
- x-no-account-id header standardised to 'bypass'
- Redundant x-no-account-id removed from file download headers
- Smoke test rewritten to validate the real two-step bootstrap path

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 16:48:15 -04:00
Scott Idem
36aed19169 feat(launcher): thin primitive architecture + run_osascript hardening
- file_handlers: add script_template param to native:launch-from-cache
  (AppleScript or shell: prefix; falls back to hardcoded defaults when null)
- file_handlers: add native:copy-from-cache-to-temp as composable primitive
  (copies cached file to temp, returns path — caller handles launch logic)
- shell_handlers: harden native:run-osascript with temp .scpt file approach
  (replaces -e flag; handles multi-line scripts and paths with special chars)
- README: rewrite Native Bridge section — full method table, composable
  pattern example, configurable launch scripts note
- deploy/devices.conf: update IPs for devices 03-06, uncomment entries
2026-05-11 13:40:05 -04:00
Scott Idem
002c27e73c fix(file_handlers): use keystroke Cmd+Return to start pptx slideshow
Replace unreliable AppleScript PowerPoint API (run slide show of settings)
with System Events keystroke approach, matching proven behavior from the
old MasterKey app. Opens the file, waits 3s for load, then sends Cmd+Return
to start the slideshow from slide 1.
2026-04-20 17:01:04 -04:00
Scott Idem
01797f28aa fix: use correct protocol for app URL and suppress DevTools in production
- Use app_base_url from the device record directly instead of always
  falling back to localhost; use https for real domains and http for
  localhost dev URLs only.
- Suppress DevTools in packaged .app builds (app.isPackaged check)
  so they only open during development.
2026-04-20 14:26:43 -04:00
Scott Idem
2af6b3954b fix: write AppleScript to temp .scpt file instead of using -e flag
The -e flag approach breaks on multi-line AppleScript and on file paths
containing spaces or quote characters. Write the script to a temp file
in os.tmpdir() and invoke osascript with the file path instead. The
temp file is cleaned up after execution.
2026-04-20 14:26:34 -04:00
Scott Idem
2ad6bce8db fix: repair file_handlers.ts backtick escaping; update README
file_handlers.ts had AI-generated escaped backticks (\`) and template
literal dollar signs (\${) throughout, causing TypeScript compile errors
("Invalid character", "Unterminated template literal"). Fixed all 15
affected lines.

README updated: corrected seed config path from resources/seed_config.json
to ~/seed.json (external to app bundle by design), added explanation of
why it's kept external (no re-signing needed per device), and documented
the 2-char hash prefix cache layout with consistency warning.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 11:50:06 -04:00
Scott Idem
7c0bb6719d feat(file): implement hardened caching with SHA-256 verification
- Added .tmp -> .file download pattern with integrity checks.\n- Implemented auto-purge for stale temp files (>5 mins).\n- Added verify_hash support to check-cache handler.\n- Improved error handling for network interruptions.
2026-02-10 14:07:45 -05:00
Scott Idem
fb8af70742 feat: implement Phase 5 system handlers (automation, power, recording)
- Implement window control, wallpaper reset, and power management.
- Add Aperture recording wrapper and displayplacer layout control.
- Add self-update logic stub for local/remote sources.
- Register and expose handlers via context bridge.
2026-01-30 11:34:53 -05:00
Scott Idem
3d7aa1ab92 feat(native): implement Phase 5 AppleScript handlers and remote control
- Implemented specialized PowerPoint/Keynote handlers with auto-focus and slideshow start.
- Added native:control-presentation for remote navigation (next/prev/stop).
- Added native:list-tools handler for self-documenting the bridge API.
- Added a comprehensive project README.md.
2026-01-26 16:18:00 -05:00
Scott Idem
083fc56337 feat(bridge): implement presentation-aware handover and robust placeholder resolution
- Upgraded launch_from_cache to automatically trigger LibreOffice/AppleScript launchers after file copy.
- Hardened expandPath to resolve [home] and [tmp] placeholders anywhere in strings via global regex.
- Enhanced get-device-info telemetry to provide absolute home and tmp paths to the UI.
- Exposed native:launch-presentation in preload and implemented explicit LibreOffice (--impress) support on Linux.
2026-01-26 15:12:11 -05:00
Scott Idem
e942b234c4 Fix: Finalize Phase 3 OS interactions and telemetry bridge
- Implemented get_device_info for OS/Network telemetry.
- Added run_cmd_sync using execSync for blocking-style commands.
- Implemented kill_processes (plural) to support multiple process termination.
- Standardized open_local_file_v2 and all bridge methods to snake_case.
- Synchronized preload and main handlers with SvelteKit relay expectations.
2026-01-23 17:23:14 -05:00
Scott Idem
f6875acc72 Enhance: Support flexible hash prefix length and organized caching
- Updated organized path logic to accept variable prefix length.
- Refactored IPC handlers to pass hash_prefix_length from frontend.
- Standardized parameter structures for check-cache and download-to-cache.
2026-01-23 16:56:10 -05:00
Scott Idem
280de213c1 Fix: Standardize Electron bridge and implement robust caching
- Refactored all IPC methods and parameters to snake_case for consistency with SvelteKit.
- Implemented exhaustive background caching engine with download locking.
- Reverted to legacy-proven flat hash storage pattern (hash.file).
- Added axios for reliable stream-based binary downloads.
- Updated preload and main handlers to support recursive room data fetching.
2026-01-23 16:30:23 -05:00
Scott Idem
30db989b2c Enhance: Implement dynamic launcher URL and restore package.json
- Added logic to construct launcher URL based on hydrated device context.
- Implemented dev/production host fallback for demo.localhost.
- Restored missing package.json with proper start and build scripts.
- Finalized IPC handlers for seed and device configuration.
2026-01-23 14:08:31 -05:00
Scott Idem
0497f5767b Initial scaffold for Aether Native V3 Electron Launcher 2026-01-23 13:54:20 -05:00