Commit Graph

169 Commits

Author SHA1 Message Date
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 b85e8dd16f fix: include version in heartbeat payload so Workers tab shows real versions
Heartbeat was sending {} — version only appeared in registration.
Agents that never re-register (most of them) stayed NULL in the DB.
Now every heartbeat carries {"version": AGENT_VERSION} so agent.php
can update the column on every check-in.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 18:36:51 +00:00
myron 188f6f8f10 fix: persist agent version on every heartbeat
update_agent_seen() now updates version column when agents include it
in their heartbeat payload. Previously version was only stored on
registration, leaving the Workers tab showing NULL for agents that
hadn't re-registered since v3.1.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 17:19:56 +00:00
myron 7f6397b514 perf: route Guardian and Vision text analysis to Groq instead of Claude
Guardian anomaly alerts and SITREP are pure text reasoning — Groq's
llama-3.3-70b-versatile handles them at near-zero cost with lower
latency. Vision Protocol image analysis stays on Claude (claude-opus-
4-8) because Groq has no vision models. Text-only sysinfo snapshots
(no image captured) also move to Groq.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 17:06:15 +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 1e57a7c90c fix: check sites locally to avoid Cloudflare CDN timeouts
facts_collector was checking https://jarvis.orbishosting.com from the
DO server itself — traffic routes through Cloudflare CDN which can
return 524 timeouts. All sites are hosted on this same OLS instance,
so check via http://127.0.0.1 with a Host header instead. This gives
direct OLS response without CDN overhead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 14:30:40 +00:00
myron 2f57908a50 fix: storeFact always bumps updated_at; fix $fresh() wrong column name
ON DUPLICATE KEY UPDATE was not touching updated_at, so if a site's
status didn't change MySQL never fired the ON UPDATE trigger and the
row timestamp stayed 6 days stale. do_server.php's 15-min freshness
window then returned empty sites.

Also fixes $fresh() querying WHERE fact_category= (non-existent column)
instead of WHERE category=, which always returned no rows.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 14:24:17 +00:00
myron 2f5e7b5a00 fix: remove missing includes/auth.php require from metrics and suggestions
Both endpoints tried to require a non-existent includes/auth.php and call
AuthMiddleware::requireAuth() — auth is already handled by api.php before
any endpoint file runs. This caused 500 errors on /api/metrics (which
blocked agent sparklines) and /api/suggestions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 14:18:33 +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 b024e51f3d feat: HA scene control via voice
- ha.php: GET scenes action returns live scene list from HA; POST scene_activate triggers by entity_id
- chat.php: ha_scene intent fetches all scenes live, fuzzy token-matches against message, calls scene.turn_on; falls back to listing available scenes if no match
- KB intents: 14 patterns covering good night/morning/goodbye/kitchen lights/ocean dawn/porch + generic activate/run/trigger/set scene

Scenes available: Good Night, Good Morning, Good Morning Work, Goodbye, Kitchen Lights On/Off, Front Porch Lights, Office Ocean Dawn, Master Bedroom

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 02:34:29 +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 c6549ee27e Agent self-healing: auto-migrate old config key names on startup
Instead of crash-looping with KeyError when config has old key names,
load_config() now detects and migrates automatically:
- server_url -> jarvis_url
- api_key -> registration_key
- adds hostname from gethostname() if missing
- adds ssl_verify (false if URL is a bare IP)
- falls back to /opt/jarvis-agent/config.json if /etc path missing

Migrated config is saved in place so the fix is permanent.
Agents self-update within 24h via the existing update_url mechanism.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 01:57:40 +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 8d64320749 agent: add nordlynx VPN status to metrics
Detects nordlynx WireGuard interface on hosts that run NordVPN and
includes active/inactive status in the metrics payload. JARVIS alerts.php
will generate a critical alert and auto-restart nordvpnd if it goes down.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 00:09:19 +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
myron 8c962b88f4 Fix Windows installer: handle per-user Python, make pywin32 postinstall non-fatal
The LocalSystem service account cannot access per-user Python installs
(AppData\Local\Programs\Python\...). When a per-user install is detected,
automatically install Python system-wide before proceeding.

- Detect per-user Python (AppData in path) and trigger system-wide install
- Extract system Python install logic into Install-PythonSystemWide function
- Check winget exit code before marking install successful
- Split pip install and postinstall into separate steps; pip failure is fatal,
  postinstall failure is a warning (service DLLs may already be registered)
- Use $LASTEXITCODE check on pip rather than try/catch (external process)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 12:27:23 +00:00
myron b19ce85d84 Windows agent: run as background Windows Service (Win 8.1+)
Replace the scheduled-task approach (required user to stay logged in) with a
proper Windows Service using pywin32. The service runs as LocalSystem, starts
at boot, and auto-restarts on failure — no PowerShell window needed.

Agent changes (jarvis-agent-windows.py):
- Add Windows Service class via pywin32 (JarvisAgentService)
- Cleanly handles SvcStop by setting a threading.Event
- main() loop uses _stop_event.wait() instead of time.sleep() so stop is immediate
- self_update() signals the stop event when running as a service (SCM restarts it)
- __main__ block dispatches to SCM entry point or HandleCommandLine (install/stop/remove)
- Falls back to direct run if pywin32 not installed (for debugging)

Installer changes (install-windows.ps1):
- pip install pywin32 + postinstall (registers service runner DLLs)
- Python search prefers system-wide install (accessible by LocalSystem)
- Downloads Python 3.11 directly from python.org for Win 8.1 machines without winget
- Removes legacy JARVIS-Agent scheduled task if present
- Registers JARVISAgent service with --startup auto
- Configures sc.exe failure recovery (restart at 5s/10s/30s)
- Updated management commands in summary (Start-Service, Stop-Service, etc.)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 12:11:38 +00:00
myron 04bd412b65 Fix 3 arc reactor bugs: metrics_json→metric_data, system nesting, message→content in conversations
- guardian_loop + sitrep: SELECT metric_data (not metrics_json which does not exist)
- guardian_loop: metrics are flat (cpu_percent at top level), not nested under system key
- guardian_loop + sitrep: filter metric_type=system to avoid parsing proxmox blobs
- guardian_loop: disk.mount key (not mountpoint) + fallback for both key names
- sitrep: same metric_data + root-level key fixes
- _guardian_inject_chat (x2): INSERT into conversations.content (not message)
- /guardian/chat endpoint (x2): SELECT content (not message) from conversations

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 01:59:58 +00:00
myron 7dc457562b Update button — popup progress modal, polls for version confirmation, live cell update
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 01:45:52 +00:00
myron 0469b31829 Agent version tracking — workers tab shows current vs latest version
- Add version column to registered_agents table
- Agents send version on registration (Linux 3.1, Windows 3.0, macOS 3.0)
- workers_list API returns latest_versions per platform
- Workers tab: VERSION column with green check (up-to-date) or red (outdated)
- Outdated agents highlight row and show blue UPDATE button
- Up-to-date agents show dimmed UPDATE button
- Update button dispatches update command immediately

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 01:44:59 +00:00
myron 4c67efe715 Agent v3.1/3.0 — Mac agent, Windows self-update, all capabilities parity
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 01:20:38 +00:00
myron 9e590dff29 Fix guardian tab stuck on loading — const ts shadowed ts() function causing ReferenceError 2026-06-12 01:13:13 +00:00
myron 146a13d8ec Fix vision protocol — always fetch all online agents for screenshot modal 2026-06-12 01:10:28 +00:00
myron 48b912574d Fix arc reactor capabilities showing blank — fall back to handlers field 2026-06-12 01:07:57 +00:00
myron b19e8e1b25 Phase 2: facts_collector TTL guards — reduce external polling
- Proxmox: skip if data < 10 min old (was: every 3 min unconditionally)
- Ollama: skip if data < 15 min old (model list rarely changes)
- Site health: skip if data < 5 min old (was: 7 HTTP calls every 3 min)
- Home Assistant: removed entirely (HA agent pushes 212 entities every 30s)

Fast local reads (CPU/mem/network pings) still run every 3 min. External
HTTP calls now fire only when data is actually stale. Saves ~140 site-check
HTTP calls/hour and ~60 Proxmox API calls/hour in steady state.
2026-06-11 21:37:26 +00:00
myron 6b906da406 deploy: auto-sync reactor.py to /opt/jarvis-arc on deploy
When deploy/reactor.py changes in a push, the deploy runner now copies it
to the runtime location and restarts jarvis-arc.service automatically.
Eliminates the two-copy drift problem — repo is now canonical.
2026-06-11 21:35:24 +00:00
myron c2c7a2627a install-agent.sh: rewrite for agent v3.0 config format
Old installer wrote to /opt/jarvis-agent/config.json with server_url/api_key/
heartbeat_interval keys and pre-registered with JARVIS. Agent v3.0 expects:
- Config at /etc/jarvis-agent/config.json with jarvis_url/registration_key/
  hostname/poll_interval/heartbeat_every keys
- api_key stored by agent itself in /var/lib/jarvis-agent/state.json
- Agent self-registers at startup using registration_key

Also adds: imagemagick install (headless screenshot support), apk support
for Alpine/WireGuard, copies to /usr/local/bin/jarvis-agent.py.
2026-06-11 21:33:53 +00:00
myron 950749323c admin: Workers page — consolidated view of all JARVIS Agent Workers
Single tab showing field agents (capabilities, status, last seen, update/screenshot
actions), cron workers (schedule, last run, run-now button), and Arc Reactor daemon
(handler count, 24h job stats, restart button). wToast for action feedback.
2026-06-11 21:31:50 +00:00
myron 6eb387899e agent v3.0: always re-register on startup to refresh capabilities
Previously agents only registered when api_key was missing (first run).
After updating to v3.0 with screenshot capability, restarted agents never
refreshed their capabilities in the DB. Now register() is called every
startup — server does UPDATE on existing agent_id so api_key is preserved.
2026-06-11 21:21:04 +00:00
myron 8b7f597e76 agent: v3.0 — fix cfg scope bug in execute_command (update + shell commands)
self_update(cfg) and shell allow_shell_commands check both referenced cfg
from run() scope, but execute_command() is a standalone function. Fixed by
calling load_config() locally in each branch that needs it.
2026-06-11 21:10:08 +00:00
myron 2767a858dd api.php: fault-isolated dispatch — ob_start+catch(Throwable) per endpoint
A ParseError or fatal in any endpoint file now returns JSON 500 for that
endpoint only. switch replaced with data-driven map. All other endpoints
continue working normally when one is broken.
2026-06-11 20:49:52 +00:00
myron 6abff8dd56 Add reactor.py to deploy/ + gitignore WireGuard .conf files in public_html
Arc Reactor was running from /opt/jarvis-arc with no version tracking.
Added to deploy/ so all fixes (metrics_json→metric_data, flat JSON parsing,
disk mount key fix) are captured. WG configs are runtime-generated secrets
and must not be committed.
2026-06-11 20:47:23 +00:00