From 94ce01007d3906c487e1abc647e20f55d5d821eb Mon Sep 17 00:00:00 2001 From: Austin Date: Sat, 25 Jul 2026 11:30:07 -0700 Subject: [PATCH] Wire up dynamic agent registry, integrations, agent-time tracking, UI modernization - server.py: dynamic agent execution engine (cli/http/mcp), live agent registry (/api/agents register/unregister), integrations API, agent stats & skill scoring, kanban task delete, plugin uninstall, agent-time tracking + /test page - dashboard: modernized agent-health, plugins marketplace, smart-router, styles; added agent-time monitor page + terminal page - scheduler.py rewrite; start.sh / start-agentic-os.sh improvements - skills: added firebase-*, notion-knowledge-capture, xcode-project-setup, audit/test plugins; updated learnings across skills - brain/ docs + data registry files (agent-registry, integrations, router-keywords) - .gitignore: exclude runtime artifacts (pid, graphify-out, logs) Verified live on :8081 - all new endpoints return 200 and register/unregister persists to data/agent-registry.json. --- .gitignore | 5 + AGENTS.md | 2 +- CHANGELOG.md | 72 ++ OPERATIONAL-NOTES.md | 28 + agents/hermes/USER.md | 2 +- brain/active-projects.md | 26 +- brain/business-brain.md | 2 +- brain/github-activity.md | 19 + brain/health-report.md | 32 + brain/journal/2026-06-25.md | 1 + brain/journal/2026-06-28.md | 1 + brain/log.md | 23 + brain/memory.md | 13 +- brain/recent-decisions.md | 6 +- brain/skill-usage.md | 38 + dashboard/AGENT_TIME_MONITOR.md | 65 ++ dashboard/api.js | 12 +- dashboard/index.html | 3 + dashboard/pages/agent-health.js | 291 ++++--- dashboard/pages/agent-time-monitor.html | 222 +++++ dashboard/pages/agent-time.js | 176 ++++ dashboard/pages/journal.js | 3 +- dashboard/pages/plugins.js | 196 ++++- dashboard/pages/smart-router.js | 69 +- dashboard/pages/terminal.js | 150 ++++ dashboard/serve_monitor.py | 163 ++++ dashboard/start-monitor.sh | 10 + dashboard/styles.css | 71 ++ dashboard/test.html | 20 + dashboard/utils.js | 2 + data/agent-registry.json | 47 ++ data/agent-stats.json | 1 + data/agent-time.json | 83 ++ data/goals.json | 16 +- data/integrations.json | 11 + data/kanban/0f822987.json | 4 +- data/kanban/1314316c.json | 12 + data/kanban/7a250df7.json | 12 + data/kanban/8893ad14.json | 4 +- data/router-keywords.json | 29 + docs/GRAPHIFY_MEMORY.md | 58 ++ docs/README.md | 636 ++++++++++++++ registry/plugins.json | 2 +- scheduler/jobs/test-audit-job.json | 10 + scheduler/scheduler.py | 118 ++- scripts/analyze_agent_time.py | 229 +++++ scripts/update-api-docs.py | 89 ++ server.py | 883 ++++++++++++++++++-- skills-lock.json | 77 ++ skills/audit-test-plugin/SKILL.md | 34 + skills/audit-test-plugin/eval.json | 7 + skills/audit-test-plugin/learnings.md | 6 + skills/audit-test-plugin/score-history.json | 1 + skills/backup-skill/learnings.md | 4 + skills/brainstorming/learnings.md | 4 + skills/code-review/learnings.md | 21 + skills/code-review/score-history.json | 2 +- skills/daily-standup/learnings.md | 128 +-- skills/daily-standup/score-history.json | 2 +- skills/firebase-ai-logic-basics | 1 + skills/firebase-app-hosting-basics | 1 + skills/firebase-auth-basics | 1 + skills/firebase-basics | 1 + skills/firebase-crashlytics | 1 + skills/firebase-data-connect | 1 + skills/firebase-firestore | 1 + skills/firebase-hosting-basics | 1 + skills/firebase-remote-config-basics | 1 + skills/firebase-security-rules-auditor | 1 + skills/goal-planner/learnings.md | 3 + skills/memory-consolidation/learnings.md | 50 ++ skills/notion-knowledge-capture | 1 + skills/tdd-cycle/learnings.md | 4 + skills/test-plugin/SKILL.md | 34 + skills/test-plugin/eval.json | 7 + skills/test-plugin/learnings.md | 9 + skills/test-plugin/score-history.json | 1 + skills/xcode-project-setup | 1 + start-agentic-os.sh | 43 + start.sh | 109 ++- 80 files changed, 4177 insertions(+), 348 deletions(-) create mode 100644 CHANGELOG.md create mode 100644 OPERATIONAL-NOTES.md create mode 100644 brain/github-activity.md create mode 100644 brain/health-report.md create mode 100644 brain/journal/2026-06-25.md create mode 100644 brain/journal/2026-06-28.md create mode 100644 brain/log.md create mode 100644 brain/skill-usage.md create mode 100644 dashboard/AGENT_TIME_MONITOR.md create mode 100644 dashboard/pages/agent-time-monitor.html create mode 100644 dashboard/pages/agent-time.js create mode 100644 dashboard/pages/terminal.js create mode 100644 dashboard/serve_monitor.py create mode 100755 dashboard/start-monitor.sh create mode 100644 dashboard/test.html create mode 100644 data/agent-registry.json create mode 100644 data/agent-stats.json create mode 100644 data/agent-time.json create mode 100644 data/integrations.json create mode 100644 data/kanban/1314316c.json create mode 100644 data/kanban/7a250df7.json create mode 100644 data/router-keywords.json create mode 100644 docs/GRAPHIFY_MEMORY.md create mode 100644 docs/README.md create mode 100644 scheduler/jobs/test-audit-job.json create mode 100644 scripts/analyze_agent_time.py create mode 100644 scripts/update-api-docs.py create mode 100644 skills-lock.json create mode 100644 skills/audit-test-plugin/SKILL.md create mode 100644 skills/audit-test-plugin/eval.json create mode 100644 skills/audit-test-plugin/learnings.md create mode 100644 skills/audit-test-plugin/score-history.json create mode 120000 skills/firebase-ai-logic-basics create mode 120000 skills/firebase-app-hosting-basics create mode 120000 skills/firebase-auth-basics create mode 120000 skills/firebase-basics create mode 120000 skills/firebase-crashlytics create mode 120000 skills/firebase-data-connect create mode 120000 skills/firebase-firestore create mode 120000 skills/firebase-hosting-basics create mode 120000 skills/firebase-remote-config-basics create mode 120000 skills/firebase-security-rules-auditor create mode 120000 skills/notion-knowledge-capture create mode 100644 skills/test-plugin/SKILL.md create mode 100644 skills/test-plugin/eval.json create mode 100644 skills/test-plugin/learnings.md create mode 100644 skills/test-plugin/score-history.json create mode 120000 skills/xcode-project-setup create mode 100755 start-agentic-os.sh diff --git a/.gitignore b/.gitignore index f25e75c..a7b616c 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,8 @@ audit/* data/settings.json data/chat-history.json data/cost-history.json +.agentic-os.pid +graphify-out/ +brain/graphify-out/ +skills/*/graphify-out/ +*.log diff --git a/AGENTS.md b/AGENTS.md index e71bc63..3eb3849 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -317,7 +317,7 @@ Your role is to act as the **kernel** of this system: route tasks to the right a | Detail | Info | |--------|------| | **Budget** | Strictly free tiers (GCP Free, GitHub Student Pack, Colab, Kaggle) | -| **Active Project** | CloudMart — GCP DevOps multi-region e-commerce platform | +|| **Active Projects** | Kitchen-Inventory (catering kitchen management on antigravity), Pendleton-comms-live (walkie talkie for catering events on Railway) | | **CLI Tools Available** | opencode, Hermes Agent, Gemini CLI | | **Preferred Model** | Hermes: Owl Alpha (OpenRouter, free), opencode: deepseek-v4-flash-free (opencode-zen), Gemini: gemini-2.5-flash (Google OAuth) | diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e0241c9 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,72 @@ +# Changelog + +All notable changes to Agentic OS will be documented in this file. + +## [v1.3.0] - 2026-06-28 + +### Added +- **Web Terminal** — Full bash shell in browser via xterm.js + WebSocket PTY (port 8082) + - 256-color support, terminal resizing, 10k line scrollback + - Reconnect and clear buttons + - Dark theme matching dashboard +- **Dynamic Agent Registry** — Register/remove custom agents via dashboard or API + - `GET /api/agents` — list all agents + - `POST /api/agents/register` — add custom agent (CLI, HTTP, or MCP type) + - `DELETE /api/agents/:name` — remove custom agent + - Agent config stored in `data/agent-registry.json` + - Custom agents auto-appear in status, health, router +- **Agent Health Dashboard** — Complete rewrite + - Card grid view with status indicators + - Registry table with type/source/actions + - "Add Agent" modal with form (name, binary, run args, health check, router keywords) + - Remove button for custom agents +- **Smart Router Extensibility** — Custom agents can register routing keywords via `data/router-keywords.json` + +### Changed +- **Hermes Model** — Switched from `openrouter/owl-alpha` to free model chain: + 1. `qwen/qwen3-next-80b-a3b-instruct:free` (primary) + 2. `openai/gpt-oss-120b:free` (fallback 1) + 3. `google/gemma-4-31b-it:free` (fallback 2) + 4. `nvidia/nemotron-3-super-120b-a12b:free` (fallback 3) +- **Agent Discovery** — All endpoints now use dynamic registry instead of hardcoded `["opencode", "hermes", "gemini"]` + - `/api/status`, `/api/agents/health`, `/api/chat`, `/api/router/route`, `/api/agents/:name/stats` +- **Base URL** — Hermes now points to `https://openrouter.ai/api/v1` directly + +### Fixed +- Audit log malformed timestamp entry removed +- Test artifacts cleaned from kanban, goals, cost history, brain + +## [v1.2.0] - 2026-06-26 + +### Added +- Agent profiles (`agents/{opencode,hermes,gemini}/`) +- APScheduler integration (`scheduler/scheduler.py`) +- Plugin install from git repo or template (`POST /api/plugins/install`) +- Connected apps / integrations system + +## [v1.1.0] - 2026-06-05 + +### Added +- Kanban board (6-column, 13 API endpoints) +- Goals system with auto-sync to `brain/active-projects.md` +- Journal with daily entries and full-text search +- Agent health monitoring (3 endpoints) +- Smart Router with keyword-based task routing +- Learning Analytics (skill eval scores, trends) +- Session Replay (browse opencode logs) +- Cost Analytics (token usage tracking) +- Backup/restore system (tar.gz snapshots) + +## [v1.0.0] - 2026-05-17 + +### Added +- Initial release +- FastAPI backend (58+ endpoints) +- Vanilla JS SPA dashboard (21 pages) +- 3 built-in agents: OpenCode, Hermes, Gemini CLI +- 16 skills with eval scoring +- Brain/memory system (markdown files) +- Scheduler (APScheduler + Hermes cron) +- Plugin registry +- Standards system +- Prompt templates diff --git a/OPERATIONAL-NOTES.md b/OPERATIONAL-NOTES.md new file mode 100644 index 0000000..ea3897d --- /dev/null +++ b/OPERATIONAL-NOTES.md @@ -0,0 +1,28 @@ +# Operational Notes + +## Server Debugging +- Logs: `tail -f /tmp/agentic-os.log` +- If browser shows blank dashboard, check for a single failing API endpoint crashing the SPA +- Malformed JSON in `audit.log` can crash `/api/audit` — the server skips bad lines but check if it's persistent + +## WSL → Windows Browser +- Server-side 500 errors can look like connection failures from Windows browser +- WSL2 loopback and Windows loopback are separate interfaces — use `127.0.0.1` from WSL, not `localhost` from Windows + +## Hermes Config +- Config: `~/.hermes/config.yaml` +- API keys: `~/.hermes/.env` +- Current model: `qwen/qwen3-next-80b-a3b-instruct:free` (OpenRouter) +- Fallbacks: gpt-oss-120b:free → gemma-4-31b-it:free → nemotron-3-super-120b:free +- Change model: `hermes config set model.default ` + +## Agentic OS Docs +- Full docs: `docs/README.md` +- Changelog: `CHANGELOG.md` +- After API changes: `python3 scripts/update-api-docs.py` +- Skill: `software-development/agentic-os-docs` + +## Brain Guardian Cron +- Job ID: `68221afb4d45` +- Runs every 2h via Hermes cron +- Outputs: brain/health-report.md, brain/skill-usage.md, brain/github-activity.md diff --git a/agents/hermes/USER.md b/agents/hermes/USER.md index b7bdb86..da08b28 100644 --- a/agents/hermes/USER.md +++ b/agents/hermes/USER.md @@ -3,7 +3,7 @@ ## User - Name: User - Tech Stack: opencode, Hermes Agent, Gemini CLI, deepseek-v4-flash-free -- Projects: CloudMart (GCP DevOps), Agentic OS +- Projects: Kitchen-Inventory (catering kitchen management on antigravity), Pendleton-comms-live (walkie talkie on Railway), Agentic OS - Budget: Free tiers only ## Preferences diff --git a/brain/active-projects.md b/brain/active-projects.md index 25e2aa3..a760703 100644 --- a/brain/active-projects.md +++ b/brain/active-projects.md @@ -6,7 +6,25 @@ - Building complete agent orchestration platform - 8 phases planned -## CloudMart -- Status: Active (ongoing) -- GCP DevOps multi-region e-commerce platform -- GKE Autopilot, Cloud SQL, Cloud CDN, Istio, Next.js +## Kitchen-Inventory (Active) +- Status: In development — catering kitchen management system +- Deployed on antigravity (server/host) +- Key features: invoice scanner (AI vision), barcode scanner, shelf life tracker, vendor invoice parsing +- Pipeline: Invoice image → pre-process → Gemini vision (primary) → GPT-5.5 (backup) → vendor detection → Claude (text→JSON) → math audit → Firebase write +- Vendor invoices: Sysco, Vern's, US Foods (each with custom prompts) +- Shelf scans: photo → Gemini → JSON array of items +- Code under review: geminiService.ts has 18 issues (4 critical) — wrong shelf prompt in GPT fallback, analyzeImage ignores prompt, no shelf retries, bad model names, bare catches + +## Pendelton-comms-live (Active) +- Status: In development — real-time voice communication app for catering events +- Purpose: Walkie talkie for employees spread out at big catering events +- GitHub: https://github.com/Linecheck-store/Pendelton-comms-live (private) +- Last worked on: 2026-02-28 +- Tech: Node.js + Express + Socket.IO signaling, React + TypeScript frontend +- Audio: WebRTC peer-to-peer, STUN/TURN configured +- Deployed on Railway +- Known issues: audio cutting out on mobile Safari, reconnection logic needs improvement + +- [Ship Agentic OS v1](goal:c24b3d85) — Complete audit and fix all issues + +- [Push everything in the Kanban board down the line](goal:2c4b22ac) — It involves different skills to get different things done. diff --git a/brain/business-brain.md b/brain/business-brain.md index e005738..5cfd122 100644 --- a/brain/business-brain.md +++ b/brain/business-brain.md @@ -19,7 +19,7 @@ Agentic OS is a multi-agent orchestration platform that coordinates opencode, He ## Key Relationships - User: Developer — AI/ML and DevOps enthusiast - Tool stack: opencode, Hermes Agent, Gemini CLI, deepseek-v4-flash-free -- Active projects: CloudMart (GCP DevOps), Agentic OS +- Active projects: Kitchen-Inventory (on antigravity), Pendleton-comms-live (on Railway) ## Standing Decisions - All memory is stored in markdown for cross-agent compatibility diff --git a/brain/github-activity.md b/brain/github-activity.md new file mode 100644 index 0000000..4edc0fd --- /dev/null +++ b/brain/github-activity.md @@ -0,0 +1,19 @@ +# GitHub Activity Log + +> Last checked: 2026-07-25 09:44 + +## Project: Agentic OS +- Repo: ~/agentic-os (github.com/modimihir07/agentic-os) +- Last commit: d9b1b0d "Update Hermes MEMORY.md with v0.2.0 features" (2026-06-05) +- Unpushed: 0 commits +- Recent (48h): none — last commit 50 days ago +- Uncommitted local changes: AGENTS.md, agents/hermes/USER.md (modified, not committed) + +## Project: Kitchen-Inventory +- Repo: not cloned locally (deployed on antigravity server/host) +- No git activity data available from this machine + +## Project: Pendelton-comms-live +- Repo: https://github.com/Linecheck-store/Pendelton-comms-live (private) +- Not cloned locally — no git activity data available +- Last worked on: 2026-02-28 (per active-projects.md) diff --git a/brain/health-report.md b/brain/health-report.md new file mode 100644 index 0000000..06bb449 --- /dev/null +++ b/brain/health-report.md @@ -0,0 +1,32 @@ +# Brain Health Report + +> Generated: 2026-07-25 09:45 + +## Status: needs attention (activity stale ~8 days) + +### Memory Files +- memory.md: 208 words (OK, limit 600) +- active-projects.md: 3 projects (2 need status refresh) +- log.md: 23 lines (OK) +- recent-decisions.md: 1 entry, 68 words (OK) + +### Projects +- Agentic OS: Building Phase 1 — last commit 2026-06-05 (50 days ago); uncommitted changes to AGENTS.md and agents/hermes/USER.md sitting in working tree +- Kitchen-Inventory: In development — repo not cloned locally; geminiService.ts still flagged with 18 issues (4 critical) awaiting fixes +- Pendelton-comms-live: STALE — last worked on 2026-02-28 (~5 months); repo not cloned locally + +### GitHub +- Agentic OS: 0 commits in 48h, 0 unpushed, 2 modified files uncommitted +- Kitchen-Inventory / Pendelton-comms-live: repos not cloned locally — no data + +### Skills +- 2 skills with new learnings since 2026-06-28 (memory-consolidation, firebase-hosting-basics — both 2026-07-17) +- 0 skills with eval data (all 18 score-history.json files empty) +- Last skill_run: memory-consolidation 2026-07-17 (one run timed out) +- Recurring problem: agent timeouts on skill runs (opencode 06-28, hermes 07-17) + +### Alerts +1. All 3 projects show no activity in the past week — flag for review. +2. Uncommitted changes in ~/agentic-os (AGENTS.md, agents/hermes/USER.md) — commit or discard. +3. Eval scoring system unused — score-history.json files never populated. +4. Kitchen-Inventory critical code-review findings (geminiService.ts) still open. diff --git a/brain/journal/2026-06-25.md b/brain/journal/2026-06-25.md new file mode 100644 index 0000000..04bca5a --- /dev/null +++ b/brain/journal/2026-06-25.md @@ -0,0 +1 @@ +Journal entry content verification test \ No newline at end of file diff --git a/brain/journal/2026-06-28.md b/brain/journal/2026-06-28.md new file mode 100644 index 0000000..dd91ad2 --- /dev/null +++ b/brain/journal/2026-06-28.md @@ -0,0 +1 @@ +I got to figure out how to get the KanBan Board working right. diff --git a/brain/log.md b/brain/log.md new file mode 100644 index 0000000..54dd2fe --- /dev/null +++ b/brain/log.md @@ -0,0 +1,23 @@ +# Wiki Log + +> Chronological record of all wiki actions. Append-only. +> Format: `## [YYYY-MM-DD] action | subject` +> Actions: ingest, update, query, lint, create, archive, delete +> When this file exceeds 500 entries, rotate: rename to log-YYYY.md, start fresh. + +## [2026-06-26] create | Wiki initialized +- Domain: Personal knowledge base (general-purpose second brain) +- Structure created with SCHEMA.md, index.md, log.md +- Directories: raw/{articles,papers,transcripts,assets}, entities, concepts, comparisons, queries + +## [2026-06-26] ingest | Second Brain User Guide +- Source: user-provided document (full user guide) +- Created: concepts/second-brain-user-guide.md, concepts/gtd.md +- Updated: index.md (2 new entries, total: 3) +- Key topics: inbox workflow, page types, knowledge graph, journaling, people/project/idea/reference tracking, import/export, backup + +## [2026-06-28] update | Project memory cleanup +- Removed CloudMart reference (not an active project) +- Added Kitchen-Inventory: catering kitchen management system (on antigravity) — invoice scanner, barcode scanner, shelf life tracker +- Added Pendleton-comms-live: walkie talkie app for catering events (on Railway) — WebRTC, Socket.IO, React/TS +- Updated: active-projects.md, memory.md, business-brain.md, AGENTS.md diff --git a/brain/memory.md b/brain/memory.md index ddaefbf..48bd024 100644 --- a/brain/memory.md +++ b/brain/memory.md @@ -4,6 +4,7 @@ - 3 agents configured: opencode, Hermes Agent, Gemini CLI - Dashboard runs on FastAPI (Python) — localhost only - All skills follow _template/ convention +- Memory consolidation: 2026-07-17 (run — all files clean, stale truncated run log from 2026-06-29 cleaned) ## User - Name: User @@ -11,9 +12,19 @@ ## Active Work - Building Agentic OS from scratch (May 17, 2026) -- CloudMart GCP DevOps project ongoing +- Kitchen-Inventory — catering kitchen management system (on antigravity) +- Pendleton-comms-live — walkie talkie app for catering events (on Railway) ## Technology Preferences - Preferred model: deepseek-v4-flash-free - Free tiers: GCP Free, GitHub Student Dev Pack, Colab, Kaggle - Knowledge management via markdown vaults + +## Consolidated Insights (2026-06-29) +- **opencode** times out on non-code tasks (brainstorming, tdd-cycle, backup-skill, code-review, goal-planner, test-plugin) — route these to hermes +- **hermes** can also time out on complex multi-step tasks — keep queries short +- **daily-standup** is the most-run skill; hermes executes faster than opencode for it +- **Score tracking**: all 18 skills have empty score-history.json — no eval data yet +- **All learnings files** are concise (under 200 words each), no compression needed +- **No contradictions** found across skill learnings +- **recent-decisions.md**: 3 entries archived (all from 2026-05-17), 0 recent — no archiving needed diff --git a/brain/recent-decisions.md b/brain/recent-decisions.md index 1d4f322..8c330cd 100644 --- a/brain/recent-decisions.md +++ b/brain/recent-decisions.md @@ -1,6 +1,10 @@ # Recent Decisions -## 2026-05-17 +(No decisions in the last 30 days) + +## Archived (older than 30 days) + +### 2026-05-17 - Created Agentic OS project structure - 3-agent architecture: opencode (code) + Hermes (memory/channels) + Gemini CLI (research) - Web dashboard only (no CLI dashboard) — FastAPI + vanilla JS SPA diff --git a/brain/skill-usage.md b/brain/skill-usage.md new file mode 100644 index 0000000..86cf25e --- /dev/null +++ b/brain/skill-usage.md @@ -0,0 +1,38 @@ +# Skill Usage & Effectiveness + +> Last updated: 2026-07-25 + +## Audit Log Summary (164 total entries) +| Action | Count | +|--------|-------| +| kanban_task_updated | 31 | +| skill_run | 22 | +| chat_message | 15 | +| brain_update | 11 | +| journal_saved | 10 | +| settings_updated | 9 | +| kanban_task_created | 8 | +| agent_registered | 7 | +| task_routed | 5 | +| standards_discovery_run | 5 | + +## Recent Skill Runs +| Skill | Agent | Last Run | Result | +|-------|-------|----------|--------| +| memory-consolidation | hermes | 2026-07-17 | 1 completed, 1 timeout | +| firebase-hosting-basics | opencode | 2026-06-28 | timeout | + +## Eval Scores +- All 18 score-history.json files are empty — no eval data has accumulated yet. + +## New Learnings Since 2026-06-28 +- memory-consolidation/learnings.md (updated 2026-07-17) +- firebase-hosting-basics/learnings.md (updated 2026-07-17) +- goal-planner, code-review, test-plugin (updated 2026-06-29) + +## Skills Per Project +| Project | Skills Used | +|---------|-------------| +| Agentic OS | memory-consolidation, brain-guardian (Hermes cron), daily-standup, heartbeat | +| Kitchen-Inventory | code-review, firebase-hosting-basics | +| Pendelton-comms-live | (none recorded) | diff --git a/dashboard/AGENT_TIME_MONITOR.md b/dashboard/AGENT_TIME_MONITOR.md new file mode 100644 index 0000000..87e905e --- /dev/null +++ b/dashboard/AGENT_TIME_MONITOR.md @@ -0,0 +1,65 @@ +# Agentic-OS · Agent Time Monitor + +A localhost dashboard that tracks **total time the AI agents spent on the +agentic-os project**, plus an embedded graphify knowledge-graph view of the +codebase, with one-click sync of the total to **Mnemoverse** persistent memory. + +## What it measures +The project's logs (`audit/audit.log`, `data/chat-history.json`, +`data/cost-history.json`) record *events* (a chat, a skill run, a write) +but not explicit session durations. Total agent time is therefore **estimated** +with a session-gap model: + +- Each logged event is a timestamped "touch" by an agent. +- A *session* for an agent = a run of touches where each touch is within + `GAP` seconds (default 30 min) of the previous one. +- Session duration = (last touch − first touch) + `TAIL` (default 2 min, to + account for work after the last logged event). +- `total_seconds` = sum of all an agent's session durations. + +This is clearly labeled as an ESTIMATE in the UI. Tune `GAP`/`TAIL` via the +`AGENT_TIME_GAP` / `AGENT_TIME_TAIL` env vars. + +## Run it + cd ~/agentic-os + ./dashboard/start-monitor.sh # default port 8765 + # or: python3 dashboard/serve_monitor.py --port 8765 + +Then open: + http://localhost:8765/dashboard/pages/agent-time-monitor.html + +(Visiting http://localhost:8765/ redirects to the dashboard.) + +## Endpoints (server: dashboard/serve_monitor.py) +- `GET /` → redirect to dashboard +- `GET /dashboard/.../agent-time-monitor.html` → the dashboard UI +- `GET /data/agent-time.json` → computed report (totals + per-agent) +- `GET /graphify-out/graph.html` → graphify code knowledge graph +- `POST /recompute` → re-run the analyzer from logs +- `POST /sync-mnemoverse` → push total to Mnemoverse (graceful) + +## graphify integration +The interactive graph is produced by graphify (code-only, no API key needed): + + cd ~/agentic-os + graphify . --code-only # writes graphify-out/{graph.json,graph.html,GRAPH_REPORT.md} + +Rebuild any time the codebase changes; the dashboard iframe picks it up live. + +## Mnemoverse integration +Set your key to enable the "Sync total to Mnemoverse" button: + + export MNEMOVERSE_API_KEY=mk_live_xxxxxxxx + ./dashboard/start-monitor.sh + +The server calls `https://core.mnemoverse.com/api/v1/memory/write` with a +single memory holding the total agent time, the agent count, and the method. +Without a key (or offline) the button reports a clear, graceful message +instead of failing. + +## Files +- `scripts/analyze_agent_time.py` — derives total/per-agent time from logs +- `dashboard/serve_monitor.py` — localhost server (stdlib only) +- `dashboard/pages/agent-time-monitor.html` — the dashboard UI +- `data/agent-time.json` — last computed report (regenerated each run) +- `graphify-out/` — graphify graph (built separately) diff --git a/dashboard/api.js b/dashboard/api.js index bdb2284..ffcc71f 100644 --- a/dashboard/api.js +++ b/dashboard/api.js @@ -41,7 +41,10 @@ const api = { getCost: () => api.get('/api/cost'), recordCost: (data) => api.post('/api/cost/record', data), getPlugins: () => api.get('/api/plugins'), - installPlugin: (name) => api.post('/api/plugins/install', { name }), + installPlugin: (name, repo_url) => api.post('/api/plugins/install', { name, repo_url }), + uninstallPlugin: (name) => api.del(`/api/plugins/${encodeURIComponent(name)}`), + getIntegrations: () => api.get('/api/integrations'), + addIntegration: (name, url, type) => api.post('/api/integrations', { name, url, type }), getBackups: () => api.get('/api/backups'), createBackup: () => api.post('/api/backup'), restoreBackup: (file) => api.post('/api/backup/restore', { file }), @@ -89,4 +92,11 @@ const api = { // Session Replay listSessions: () => api.get('/api/sessions/list'), getSessionReplay: (id) => api.get(`/api/sessions/${encodeURIComponent(id)}/replay`), + // Agent Time Monitor + getAgentTime: (recompute = false) => api.get(`/api/agent-time${recompute ? '?recompute=true' : ''}`), + recomputeAgentTime: () => api.post('/api/agent-time/recompute', {}), + // Agent Registry + getAgents: () => api.get('/api/agents'), + registerAgent: (data) => api.post('/api/agents/register', data), + unregisterAgent: (name) => api.del(`/api/agents/${encodeURIComponent(name)}`), }; diff --git a/dashboard/index.html b/dashboard/index.html index 4f7899e..2985fd0 100644 --- a/dashboard/index.html +++ b/dashboard/index.html @@ -8,6 +8,7 @@ + @@ -33,6 +34,7 @@