167 Commits

Author SHA1 Message Date
myron 90e4ded7c9 Fix 8 issues from code review
- ha-poller: replace recursive main() retry with while loop (stack overflow fix)
- ha-poller: advance last_push on empty HA response (log spam fix)
- ha-poller: use datetime.now(timezone.utc) instead of deprecated utcnow()
- ping-probe: always call update_status() unconditionally so offline devices register as offline
- agent.php: heartbeat reads status from payload instead of hardcoding 'online'
- phone-probe: delegate JSON building to python3 (bash concatenation injection fix)
- netscan + phone-probe: read registration key from /etc/jarvis-agent/reg-key
- admin/index.php: sync ha_list skipDomains with ha.php (14 missing domains added)
- facts_collector: self-check JARVIS via 127.0.0.1 instead of Cloudflare hairpin
2026-06-29 20:58:22 -05:00
myron 84cd2ded50 Add HA poller, fix domain filters, create missing DB tables, update schema
- jarvis-ha-poller.py: new service polling HA entities → JARVIS (running on VM211)
- ha.php: add camera/siren/remote/todo/lawn_mower to skipDomains
- db/schema.sql: add tasks, appointments, usage_patterns tables; fix registered_agents enum (windows/macos) + version column

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-29 15:44:28 -05:00
myron 89a82a1573 Add Windows agent installer, fix Linux install URL
- install-windows.ps1: one-liner PowerShell installs Python, pywin32,
  downloads agent, creates config, installs Windows Service (auto-start)
- install.sh: fix JARVIS_URL from hardcoded LAN IP to https://jarvis.orbishosting.com
- install.sh: fix ssl_verify default to true for external agents

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-29 13:56:37 -05:00
myron 2f4b4ef5c3 feat: HA tab — filter scenes/media_player, nightly full resync cron, remove JS polling
- ha.php skipDomains: added media_player, scene
- ha.php skipKeywords: konnected, energy/power/voltage/current, full camera list
- stats_cache.php: same filter updates, removed scene/media_player from sync
- Removed JS setInterval polling; entity state kept fresh by HA agent push
- Added nightly 3am cron for full HA entity resync
2026-06-22 03:56:47 +00:00
myron 21e0b81a98 feat: HA tab — filter konnected/energy/camera/media_player, add 30s auto-refresh
- Added to skipDomains: media_player
- Added to skipKeywords: konnected, energy/power/voltage/current,
  camera controls (infrared, email, FTP, push, siren, hub ringtone, manual record),
  system noise (CEC scanner, ESPHome builder, Echo DND)
- Auto-refresh every 30s when HA tab is active
2026-06-22 03:53:06 +00:00
myron 95d49f15cb fix: kiosk voice reliability — stopListening on exit, exitVoiceMode kiosk guard
- stopListening() called in both toggleKiosk exit and _onFsChange so mic
  stops when leaving kiosk (was staying live indefinitely)
- exitVoiceMode() now returns early if kiosk-mode active so the 30-min
  idle timer and face-detection loop cannot kill the always-on mic
2026-06-21 14:26:54 +00:00
myron 51b598dd5d fix: kiosk voice — use startListening() directly, no TTS greeting blocking mic 2026-06-21 05:20:56 +00:00
myron 6f0459be85 feat: kiosk auto-starts voice mode and blocks sleep — isolated patches only 2026-06-21 05:17:55 +00:00
myron a6d4365f16 feat: kiosk mode CSS hiding (safe) — no voice JS patches 2026-06-21 05:15:38 +00:00
myron 383de0146c revert: restore all files to 52ddee3 — kiosk JS patches broke JARVIS completely 2026-06-21 05:10:30 +00:00
myron aaf9f9d56a revert: restore safe JS, keep only kiosk-mode CSS class toggle — voice patches caused JS crash 2026-06-21 05:03:56 +00:00
myron aa88a2f73b fix: missing quotes around kiosk-mode string caused ReferenceError breaking all buttons 2026-06-21 04:59:21 +00:00
myron f1d73e7b6a feat: kiosk always-on mic — auto-start voice on kiosk entry, no sleep, no wake word needed 2026-06-21 04:55:29 +00:00
myron 572f1b1816 feat: show HTTPS redirect banner on Silk/tablet when loaded via HTTP (mic/camera fix) 2026-06-21 04:45:40 +00:00
myron 1838e02d56 feat: hide network status panel in kiosk mode; bump cache version 2026-06-21 04:41:33 +00:00
myron 178040c18b chore: bump asset version to 20260621 to bust Silk browser cache 2026-06-21 04:30:28 +00:00
myron 45845a1f61 feat: kiosk-mode hides server, agents, guardian panels + HA/agents/memory/proxmox from bottom bar
- Adds body.kiosk-mode class on fullscreen entry/exit
- Hides: #server-panel, #tab-agents, #tab-guardian, tab buttons
- Hides bottom bar: Home Assistant, Agents, Memory, Proxmox
- Falls back to INTEL tab if agents/guardian was active on kiosk entry
- All elements remain visible in normal/tablet mode
2026-06-21 04:07:32 +00:00
myron 52ddee3e78 Fire HD 8 tablet mode: auto-detect Silk UA, optimised layout + touch targets 2026-06-19 16:17:48 +00:00
myron ab1aa16ac8 Add kiosk mode button for Fire tablet Silk browser 2026-06-19 16:02:51 +00:00
myron 1979c5f667 fix: install-agent.sh default URL updated to http://10.48.200.211 (JARVIS VM) 2026-06-18 12:34:32 +00:00
myron 1b071f4f67 fix: repair broken define in webhook.php (missing closing quote from prior sed) 2026-06-18 04:44:36 +00:00
myron 5cbaeda730 docs: update INFRASTRUCTURE-REFERENCE and CLAUDE.md for JARVIS VM migration
- JARVIS moved from DO to PVE1 VM 211 (10.48.200.211, 8c/16GB)
- Access: http://jarvis.orbishosting.com:1972 (FortiGate VIP)
- Stack: nginx + PHP 8.3 + MariaDB + Redis + Arc Reactor
- Ollama VM IP: 10.48.200.95 → 10.48.200.210 (Reolink owns .95)
- FusionPBX SSH now direct via Tailscale (100.74.46.120)
- DO role: websites only (JARVIS fully removed)
- Agent URLs updated: http://10.48.200.211 (LAN direct)
- DO agent uses Tailscale: http://100.77.178.42

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-18 04:38:02 +00:00
myron b7aea1371c feat: add DO server (web host) monitoring block to JARVIS Server panel
- /api/do now includes do_server key with jarvis-do agent metrics
  (CPU, RAM, disk, uptime from Tailscale-connected DO server agent)
- Front page JARVIS SERVER panel has WEB HOST section with live
  CPU/RAM/DISK bars from DO server agent data
- Panel title updated to show 10.48.200.211 (JARVIS VM IP)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-18 04:08:54 +00:00
myron 49694e76e1 fix: update service monitor for JARVIS VM (nginx/php-fpm/mariadb instead of OLS/mysql) 2026-06-18 04:01:36 +00:00
myron 38ab8d2977 migrate: update all references from DO server to PVE1 JARVIS VM
- config.php: JARVIS_IP → 10.48.200.211, HA_URL → direct LAN 10.48.200.97
- facts_collector/stats_cache: Proxmox API → direct 10.48.200.90 (not DDNS)
- chat.php: system context updated to reflect PVE1/nginx instead of DO/OLS
- do_server.php: display IP → 10.48.200.211 (reads /proc for JARVIS VM stats)
- jarvis-app.js: service labels nginx/mariadb instead of lshttpd
- jarvis-overlays.js: network map JARVIS node IP → 10.48.200.211
- index.html: DO SERVER labels → JARVIS VM, cache bust v=20260618a
- jarvis-agents.js: agent install URL uses window.location.origin

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-18 02:25:36 +00:00
myron 0b7f2d013b refactor: Phase 3 — split jarvis-protocols.js into 3 panel files
A single SyntaxError in the 1668-line monolith kills every panel
(proven by the apostrophe bug on 2026-06-17). Split into:

  panels/jarvis-arc.js       (608 lines) — Arc Reactor, Intel, Comms, Guardian
  panels/jarvis-agents.js    (715 lines) — Missions, Directives, Memory,
                                           Clearance, Agents tab, Sites, Vision
  panels/jarvis-assistant.js (345 lines) — Chat History, Suggestions,
                                           Mobile, Command Palette, Topo map

A parse error in any one file now fails only that group of panels.
escHtml() stays in jarvis-arc.js (loads first) and remains global.
All other dependencies (api, speak, addMessage) come from jarvis-app.js.
Version param bumped to ?v=20260617b to force Cloudflare cache miss.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 19:10:31 +00:00
myron 8085a113d5 fix: sync public_html/agent/jarvis-agent.py with agent source
public_html/agent/ is what agents download for self-update.
It was 5 days out of date — missing the version-in-heartbeat fix
and all other v3.1 changes. Now mirrors agent/jarvis-agent.py exactly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 18:45:54 +00:00
myron dd2f48193b fix: add data-cfasync=false to face-api.js to suppress Rocket Loader
One untagged script tag is enough for Cloudflare Rocket Loader to
activate its bootstrap and inject mainScript.js, which declares
mainScriptFlag. When mainScript.js loads twice (script + eval), it
throws SyntaxError: Identifier 'mainScriptFlag' has already been
declared. All script tags now have data-cfasync=false.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 14:43:29 +00:00
myron 9623d7323a fix: cache-bust JS files to force Cloudflare to serve fixed jarvis-protocols.js
jarvis-protocols.js had a syntax error (apostrophe in single-quoted string)
that Cloudflare was caching (4h TTL). Adding ?v=20260617 to all JS script
tags forces a cache miss so the browser gets the fixed file immediately.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 14:02:53 +00:00
myron 9169324148 fix: escape apostrophe in jarvis-protocols.js line 1432
'What's playing on Jellyfin' — the apostrophe inside the single-quoted
string caused a SyntaxError that prevented the entire file from loading,
making checkArcStatus and all other panel functions undefined.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 14:02:04 +00:00
myron f8aaaf725c fix: scope session_start() skip to machine-agent calls only
agent/list and agent/status are browser-facing and need $_SESSION loaded
to verify auth. Only skip session_start() for machine-agent sub-actions
(heartbeat, metrics, ha_state, command_result, register) that fire every
10-30s. Previous fix skipped session for all agent/* causing the agents
panel to return 401 to the browser.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 13:49:45 +00:00
myron 025c6d6fec Fix session explosion: skip session_start for agent/netscan/ping endpoints
Agent heartbeats (every 10s from 13 agents) were creating empty session files
because session_start() ran unconditionally. Over months this produced millions
of 0-byte files in the session directory, causing PHP session GC to hang and
making all browser API calls intermittently timeout (panels show offline/empty).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 13:23:53 +00:00
myron f304ada4d3 Fix chat URL routing and agent.php fact_type column error
- sendMessage() was fetching /api.php?action=chat which bypasses the
  /api/* rewrite rule; api.php parsed endpoint as "api.php" → 404.
  Fixed to /api/chat so the rewrite routes it correctly to chat.php.

- agent.php HA entity map INSERT used non-existent fact_type column,
  causing PDOException on every agent heartbeat. Fixed to use the
  correct (category, fact_key, fact_value) columns.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 12:33:09 +00:00
myron 6195f9bd3b feat: implement 7 JARVIS UI enhancements
#1  Voice waveform: Web Audio API drives wave-bar heights in real time
#2  Ambient dim mode: panels fade to 12% after 90s idle
#6  Streaming AI replies: Groq tokens via SSE; frontend ReadableStream
#7  Quick-note capture: N key / "note: text" saves to kb_facts instantly
#8  Cancel in-flight request: AbortController + CANCEL button
#9  Accent color themes: Stark Blue / Widow Red / Hulk Green, localStorage
#10 Browser push notifications: critical alerts when tab is backgrounded

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 11:39:45 +00:00
myron 58070c7f06 Move weather widget from right panel to left panel
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 03:52:50 +00:00
myron 2c712a4fc6 Add live voice transcript, keyboard shortcuts, agent topology map
#3 Live Voice Transcript: Real-time subtitle bar at bottom of screen shows
what JARVIS hears as you speak. Interim results appear word-by-word via
SpeechRecognition.onresult interim events; bar fades 3.2s after final result.

#4 Keyboard Shortcuts: Global keydown handler (skips input fields):
F5=refresh all, Esc=close modals/overlays, M=mute mic toggle,
Space=focus chat input, 1/2/3/4=switch HOME/ALERTS/NEWS/AGENTS tabs.
Shortcut hints added to Ctrl+K palette footer.

#5 Agent Topology Map: TOPOLOGY button in AGENTS tab switches from card
view to animated ring-based canvas showing all agents by type (Proxmox=green
inner ring, HA=yellow mid ring, Linux/Windows=blue outer ring). Live particles
flow hub→agents; offline nodes shown in red. Reads from rendered agent cards.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 03:32:48 +00:00
myron b014fd96ab Fix HA toggle (Rocket Loader) and network map cleanup
HA toggle broken after modularization: separate <script src> files are
deferred by Cloudflare Rocket Loader, so inline onchange handlers fire
before toggleHA() is defined. Fix: add data-cfasync="false" to all
four JARVIS script tags to prevent Rocket Loader interference.

Network map cleanup:
- Deduplicate agent devices by hostname — two homeassistant agents
  (10.48.200.97 and 172.30.32.1) now show as one node; prefer online
  over offline, then most-recently-seen
- Offline agents excluded from inner rings — jellyfin (offline June 3)
  and mini_it12 (offline June 12) no longer appear on the map
- DB-pinned devices (Yealink phones) unaffected; still show in devices ring

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 03:20:37 +00:00
myron b2aa3280e1 Add morning briefing, command palette, and boot animations
#11 Smart Morning Briefing: auto-speaks once per day before noon — fetches
tasks, appointments, active alerts, and weather, composes a ~2-sentence TTS
summary. Stored in localStorage (jarvis_brief_YYYY-MM-DD) to fire only once.

#12 Quick Command Palette (Ctrl+K): frosted-glass overlay with 20 pre-loaded
commands across 6 groups (Network/Agents/Planner/Media/Smart Home/System).
Fuzzy filter as you type, arrow-key navigation, Enter to fire. Matches are
highlighted. Backdrop click or Escape to close.

#13 Live Boot Animation: stat bars and numbers now count from 0 on first render
via tickTo() change. Arc Reactor rings spin in with staggered delays (0.08s
per ring) on login using boot-spin CSS class + @keyframes arcBootSpin.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 03:00:16 +00:00
myron 462ce257a8 Modularize JARVIS frontend into separate CSS/JS files
Split monolithic 261KB index.html into maintainable modules:
- assets/css/jarvis.css (65KB, 1103 lines) — all styles
- assets/js/jarvis-effects.js (23KB) — particle canvas, sparklines, panel float, face tracking, glitch
- assets/js/jarvis-overlays.js (17KB) — sleep mode, network map
- assets/js/jarvis-app.js (60KB) — globals, init, login, API, panels, chat, voice, alerts, weather, news, planner
- assets/js/jarvis-protocols.js (69KB) — arc reactor, intel/comms/guardian/mission/directives/clearance/sites/vision, history search, suggestions, mobile

index.html is now a 25KB thin HTML shell with link/script tags.
Load order preserved; all cross-file dependencies resolve at runtime after window.load.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 02:55:35 +00:00
myron 9f92e4d5e4 Add JARVIS improvements: mobile UI, sparklines, suggestions, multi-step commands, Arc Reactor health, tier badges
- Mobile UI: 3-button bottom nav with panel switcher
- Chat history search: search modal with keyword query
- News filtering: category filter with localStorage persistence
- Proactive reminders: planner/appointment alerts at login and every 5 min
- Proactive alerts: polls every 60s, speaks new critical/warning alerts
- Agent sparklines: 2h CPU+MEM sparkline on each online agent card
- Tier source badge: KB/GROQ/CLAUDE/OLLAMA pill shown after each reply
- VM suggestions: 24h resource analysis via voice command
- HA scene control: fuzzy-match scene activation via voice
- Jellyfin control: pause/stop/next/previous via voice and KB
- Pattern suggestions: usage_patterns table + proactive chips every 30 min
- Multi-step commands: compound "X and Y" command parsing (Tier 0.5)
- Arc Reactor health: warning=amber/1.2s, critical=red/0.6s pulse encoding
- Cross-session history: last 6 turns loaded from prior session
- Restart agent: voice command to restart any JARVIS agent
- New endpoints: history.php, metrics.php, suggestions.php, jellyfin.php

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 02:49:05 +00:00
myron bde8909490 feat: tier source badge + VM resource suggestions
- Tier badge (#9): addMessage() gains source param; sourceBadge() maps source string to KB/GROQ/CLAUDE/OLLAMA pill rendered after typing finishes; sendMessage() passes data.source through; CSS badges styled with domain colors
- VM suggestions (#10): vm_suggestions intent queries 24h avg CPU+MEM per agent, flags hosts with >80% avg CPU, <5% CPU on 2GB+ RAM, >85% avg MEM, or <25% MEM on 2GB+ RAM; 8 KB intents; say "VM resource suggestions" or "optimize VMs"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 02:38:24 +00:00
myron c29d1bf4c7 feat: proactive alerts, Jellyfin control, agent sparklines, CCR roster fix
- Proactive alerts (#1): polls every 60s; baselines on load so old alerts are silent; speaks new critical/warning alerts aloud if voice active; adds chat bubble for all new alerts
- Jellyfin control (#2): pause/stop/next/previous via voice — auto-detects active session; 12 KB intents; jellyfin.php control action uses Jellyfin General Commands API
- Agent sparklines (#6): metrics.php returns 2h CPU+MEM history per agent; SVG polyline sparklines rendered in each agent card (cyan=CPU, green=MEM); non-blocking fetch so existing view shows instantly
- Agent health CCR (#7): updated hourly cloud routine to current 13-agent roster, removed ollama-ai and alien-pc, added all active agents with correct IPs/IDs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 02:30:13 +00:00
myron e381858299 feat: voice agent commands, cross-session memory, proactive reminders
- Voice commands (#3): say "restart the homebridge agent" or "restart mediastack agent" → queues restart_service to that agent; lists options if no hostname matched; 6 KB intents added
- Persistent context (#4): chat.php now loads last 6 turns from most recent prior session before current session history, giving JARVIS memory across page reloads
- Proactive reminders (#5): 3s after login, auto-announces overdue tasks / tasks due today / upcoming appointments; 5-min interval checks for appointments starting within 15 min and speaks alert once

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 02:23:48 +00:00
myron c74a9af8be feat: mobile UI, chat history search, news source filtering
- Mobile (#11): responsive 3-button bottom nav (STATS/CHAT/INFO), panel switching, compact topbar, touch-friendly inputs; panels show one-at-a-time on screens <900px
- Search (#12): 🔍 button next to TRANSMIT opens search modal; history.php endpoint queries conversations table; results show role, timestamp, and snippet
- News filter (#13): ⚙ gear on NEWS tab reveals category checkboxes; hidden categories stored in localStorage; empty-state message when all hidden

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 02:18:10 +00:00
myron 290389abef feat: voice routing, Jellyfin integration, context-aware briefing
- Voice routing (#2): focus_mode and show_panels KB intents → chat.php → ui_action response field → index.html dispatch; removed local JS regex intercepts
- Jellyfin (#3): jellyfin.php endpoint (sessions/library/search/recent), JELLYFIN_URL/API_KEY in config.php, api.php router, now_playing/library KB intents in chat.php
- Daily briefing (#4): time-of-day greeting (morning/afternoon/evening), weather lead from api_cache, offline agent count summary

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 02:07:18 +00:00
myron 5d12ed6f62 Fix network map not opening from chat/voice
Two issues:
1. NM_OPEN_RE regex was too narrow — phrases like "show me the network",
   "open the network", "show network status" did not match, so they fell
   through to the API which returned text but never opened the map.
   Broadened regex to catch natural network-related phrases.
2. When the network_scan intent IS triggered via API, the map never opened
   because the API response handler only processed reply/arc_job.
   chat.php now returns open_network_map:true for network_scan intent,
   and the client calls openNetMap() when that flag is present.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 01:33:31 +00:00
myron 5bbd3a9098 Add DOCS tab to admin panel with infrastructure reference download 2026-06-15 04:05:53 +00:00
myron 205fc37c12 Fix Windows agent: exit(1) after self-update so SCM restarts the service
After writing the updated script, _stop_event.set() caused a clean exit
(code 0). SCM failure recovery only fires on non-zero exit, so the service
stayed down permanently after every auto-update.

Fix: set _update_restart=True before signalling stop; SvcDoRun() checks
the flag after main() returns and calls sys.exit(1), which triggers the
sc.exe failure recovery chain (restart/5s/10s/30s configured at install).
2026-06-13 14:30:20 +00:00
myron 29c3439d0a Fix installer: use if-not fallbacks so iex piping works (param defaults don't apply via iex)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 12:38:45 +00:00
myron b4a37981af Embed default registration key so irm | iex works without prompting
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 12:37:08 +00:00