The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu
Go agent-ai-cliagent-harnessesagent-securitybrowser-extensionciclaude-codecloudcodexcursordetection-engineeringjevknowledge-basememorymobile-device-managementobservabilitysecuritysecurity-information-and-event-managementsecurity-toolstelemetrytraces
update dash
Justin D'Souzac8c068cc316e
diff --git a/cli/beacon/internal/endpoint/dashboard/server_test.go b/cli/beacon/internal/endpoint/dashboard/server_test.goindex ca218702..66598a41 100644--- a/cli/beacon/internal/endpoint/dashboard/server_test.go+++ b/cli/beacon/internal/endpoint/dashboard/server_test.go@@ -121,7 +121,7 @@ func TestStatusUsesRequestedRuntimeLogSource(t *testing.T) {// TestSummaryEndpointAggregatesAllMatchedEvents guards /api/summary against// truncated aggregation: total_events comes from the full match count, so the// breakdown counts must be computed over the same full set even when the-// request carries a small ?limit= from the Log Search view.+ // request carries a small ?limit= from the Agent Activity Sessions view.func TestSummaryEndpointAggregatesAllMatchedEvents(t *testing.T) {logPath := filepath.Join(t.TempDir(), "runtime.jsonl")mk := func(minute int) string {@@ -567,13 +567,13 @@ func TestStaticDashboardPagesServe(t *testing.T) {path stringwant string}{- {path: "/", want: "Beacon Endpoint Log Search"},- {path: "/overview.html", want: "Beacon Endpoint Security Analytics"},+ {path: "/", want: "Beacon Endpoint Agent Activity"},+ {path: "/overview.html", want: "Beacon Endpoint Agent Activity"},{path: "/tokens.html", want: "Beacon Endpoint Token Usage"},{path: "/detections.html", want: "Beacon Endpoint Detections"},{path: "/findings.html", want: "Beacon Endpoint Findings"},{path: "/inventory.html", want: "Beacon Endpoint Agent Inventory"},- {path: "/inventory-hooks.html", want: "Beacon Endpoint Hook Inventory"},+ {path: "/inventory-hooks.html", want: "Beacon Endpoint Agent Inventory"},}for _, tc := range cases {t.Run(tc.path, func(t *testing.T) {diff --git a/cli/beacon/internal/endpoint/dashboard/static/app.js b/cli/beacon/internal/endpoint/dashboard/static/app.jsindex e9a466ce..e3965449 100644--- a/cli/beacon/internal/endpoint/dashboard/static/app.js+++ b/cli/beacon/internal/endpoint/dashboard/static/app.js@@ -13,10 +13,16 @@ const state = {findingsRules: null,findingsSessions: new Map(),findingsExpanded: new Set(),+ activityView: "summary",+ inventoryView: "configs",+ inventoryRuntime: "",+ inventoryUser: "",+ inventorySearch: "",};const $ = (selector) => document.querySelector(selector);const $$ = (selector) => Array.from(document.querySelectorAll(selector));+const isActivityPage = !document.body.dataset.page;const isOverviewPage = document.body.dataset.page === "overview";const isTokensPage = document.body.dataset.page === "tokens";const isDetectionsPage = document.body.dataset.page === "detections";@@ -44,6 +50,7 @@ const formFields = ["limit","review",];+state.activityView = initialActivityView();const presets = {review: { review: "true", limit: "500" },@@ -95,6 +102,35 @@ function hydrateFiltersFromURL() {}}+function initialActivityView() {+ const params = new URLSearchParams(window.location.search);+ if (params.get("view") === "detailed") return "detailed";+ for (const field of formFields) {+ if (field !== "limit" && params.has(field)) return "detailed";+ }+ return "summary";+}++function renderActivityView() {+ if (!isActivityPage) return;+ const summary = $("#activity-summary");+ const detailed = $("#activity-detailed");+ if (summary) summary.hidden = state.activityView !== "summary";+ if (detailed) detailed.hidden = state.activityView !== "detailed";+ $$("[data-activity-view]").forEach((button) => {+ const active = button.dataset.activityView === state.activityView;+ button.classList.toggle("active", active);+ button.setAttribute("aria-selected", active ? "true" : "false");+ });+}++function setActivityView(view, { updateLocation = false } = {}) {+ if (!isActivityPage) return;+ state.activityView = view === "detailed" ? "detailed" : "summary";+ renderActivityView();+ if (updateLocation) updateURL(queryFromFilters());+}+// The limit control is a fixed <select>; a URL like ?limit=5 would otherwise// silently deselect it and the query would fall back to the server default,// so add the requested limit as a selectable option.@@ -110,7 +146,14 @@ function ensureLimitOption(select, value) {}function updateURL(query) {- const next = query ? `${window.location.pathname}?${query}` : window.location.pathname;+ const params = new URLSearchParams(query);+ if (isActivityPage && state.activityView === "detailed") {+ params.set("view", "detailed");+ } else {+ params.delete("view");+ }+ const nextQuery = params.toString();+ const next = nextQuery ? `${window.location.pathname}?${nextQuery}` : window.location.pathname;window.history.replaceState(null, "", next);}@@ -152,9 +195,11 @@ async function load({ updateLocation = false, mode = "replace" } = {}) {function render() {setText("#log-path", state.status?.log_path || "Runtime log unavailable");setText("#last-updated", state.summary?.last_event_time ? `Last event ${formatTime(state.summary.last_event_time)}` : "");+ renderActivityView();renderNewEventsIndicator();renderFilterOptions();renderCards();+ renderActivityAnalytics();renderInsights();renderSearchState();renderEvents();@@ -191,6 +236,68 @@ function renderCards() {});}+function renderActivityAnalytics() {+ renderActivitySessionChart();+ renderActivityAttention();+}++function renderActivitySessionChart() {+ const el = $("#activity-session-chart");+ if (!el) return;+ const rows = (state.summary?.top_harnesses || []).slice(0, 8);+ const total = rows.reduce((sum, item) => sum + item.count, 0);+ const max = Math.max(1, ...rows.map((item) => item.count));+ if (!rows.length) {+ el.innerHTML = emptyAnalytics("No agent sessions in this window");+ return;+ }+ el.innerHTML = `+ <div class="chart-legend">+ ${rows.slice(0, 6).map((item, index) => `<span><i style="background:${chartColor(index)}"></i>${escapeHTML(harnessLabel(item.name))}</span>`).join("")}+ </div>+ <div class="stacked-chart" aria-label="Agent sessions by source">+ ${rows.map((item, index) => {+ const height = Math.max(10, Math.round((item.count / max) * 100));+ return `+ <button type="button" class="stacked-chart-column" data-activity-harness="${escapeHTML(item.name)}">+ <span class="stacked-chart-bar" style="height:${height}%; background:${chartColor(index)}"></span>+ <span class="stacked-chart-value">${escapeHTML(item.count)}</span>+ <span class="stacked-chart-label">${escapeHTML(truncateMiddle(harnessLabel(item.name), 16))}</span>+ </button>+ `;+ }).join("")}+ </div>+ <p class="muted analytics-footnote">${escapeHTML(formatTokens(total))} local events across top harnesses</p>+ `;+ $$("[data-activity-harness]").forEach((button) => {+ button.addEventListener("click", () => applyFilters({ harness: button.dataset.activityHarness }, { reset: true }));+ });+}++function renderActivityAttention() {+ const el = $("#activity-attention");+ if (!el) return;+ const items = [+ { label: "Critical events flagged for review", value: state.summary?.critical_severity_events || 0, filters: { severity: "critical" }, tone: "danger" },+ { label: "High-severity events to triage", value: state.summary?.high_severity_events || 0, filters: { severity: "high" }, tone: "danger" },+ { label: "Failed tool calls", value: state.summary?.failed_tool_events || 0, filters: { action: "tool.failed" }, tone: "warn" },+ { label: "Sessions awaiting review", value: state.summary?.needs_review_events || 0, filters: { review: "true" }, tone: "info" },+ { label: "Denied or blocked actions", value: (state.summary?.denied_approval_events || 0) + (state.summary?.policy_blocked_events || 0), filters: { review: "true" }, tone: "danger" },+ ];+ el.innerHTML = items+ .map((item, index) => `+ <button type="button" class="attention-card attention-${item.tone}" data-attention-index="${index}">+ <span>${escapeHTML(item.label)}</span>+ <strong>${escapeHTML(item.value)}</strong>+ </button>+ `)+ .join("");+ $$("[data-attention-index]").forEach((button) => {+ const item = items[Number(button.dataset.attentionIndex)];+ button.addEventListener("click", () => applyFilters(item.filters, { reset: true }));+ });+}+function renderInsights() {if (!$("#insights")) return;const attention = attentionItems();@@ -262,9 +369,11 @@ function renderSearchState() {function renderSummaryOnly() {setText("#log-path", state.status?.log_path || "Runtime log unavailable");setText("#last-updated", state.summary?.last_event_time ? `Last event ${formatTime(state.summary.last_event_time)}` : "");+ renderActivityView();renderNewEventsIndicator();renderFilterOptions();renderCards();+ renderActivityAnalytics();renderInsights();renderSearchState();}@@ -291,11 +400,12 @@ function renderInventory(resp) {const configs = resp?.configs || [];const servers = resp?.mcp_servers || [];const skills = resp?.skills || [];- const hooks = resp?.hooks || [];+ const hooks = normalizeInventoryHooks(resp?.hooks);const existingConfigs = configs.filter((config) => config.exists);const existingSkills = skills.filter((skill) => skill.exists);const hookConfigs = existingConfigs.filter((config) => config.config_kind === "hook_config");setText("#inventory-meta", resp?.generated_at ? `Scanned ${formatTime(resp.generated_at)}` : "");+ renderInventoryWorkspace(resp, { harnesses, configs, servers, skills, hooks, existingConfigs, existingSkills, hookConfigs });renderInventoryCards(harnesses, existingConfigs, servers, existingSkills, hookConfigs);renderInventoryHarnesses(harnesses);renderInventoryConfigs(configs);@@ -308,6 +418,361 @@ function renderInventory(resp) {renderInventoryScope(resp?.user_scope || {});}+const inventoryViewLabels = {+ configs: "Configurations",+ mcp: "MCP Servers",+ skills: "Agent Skills",+ hooks: "Hooks",+};++const inventoryRuntimeLogos = {+ antigravity: "/runtime-logos/antigravity.png",+ antigravity_cli: "/runtime-logos/antigravity.png",+ claude: "/runtime-logos/claude-code.png",+ claude_code: "/runtime-logos/claude-code.png",+ claude_cowork: "/runtime-logos/claude-code.png",+ copilot: "/runtime-logos/github-copilot.png",+ copilot_cli: "/runtime-logos/github-copilot.png",+ github_copilot_cli: "/runtime-logos/github-copilot.png",+ cursor: "/runtime-logos/cursor.png",+ factory: "/runtime-logos/factory.png",+ factory_droid: "/runtime-logos/factory.png",+ vscode: "/runtime-logos/visual-studio-code.png",+};++function normalizeInventoryHooks(hooks) {+ if (Array.isArray(hooks)) return hooks;+ if (!hooks || typeof hooks !== "object") return [];+ return Object.entries(hooks).map(([target, hook]) => ({ target, ...(hook || {}) }));+}++function hydrateInventoryStateFromURL() {+ if (!$("#inventory-workspace")) return;+ const params = new URLSearchParams(window.location.search);+ const view = params.get("view");+ state.inventoryView = inventoryViewLabels[view] ? view : state.inventoryView;+ state.inventoryRuntime = params.get("runtime") || "";+ state.inventoryUser = params.get("user") || "";+ state.inventorySearch = params.get("q") || "";+ if ($("#inventory-search")) $("#inventory-search").value = state.inventorySearch;+}++function updateInventoryURL() {+ const params = new URLSearchParams(window.location.search);+ params.set("view", state.inventoryView);+ if (state.inventoryRuntime) params.set("runtime", state.inventoryRuntime);+ else params.delete("runtime");+ if (state.inventoryUser) params.set("user", state.inventoryUser);+ else params.delete("user");+ params.delete("scope");+ if (state.inventorySearch) params.set("q", state.inventorySearch);+ else params.delete("q");+ const next = `${window.location.pathname}?${params.toString()}`;+ window.history.replaceState({}, "", next);+}++function renderInventoryWorkspace(_resp, ctx) {+ if (!$("#inventory-workspace")) return;+ renderInventoryFilterOptions(ctx);+ renderInventoryViewTabs(ctx);+ renderInventoryActiveTable(ctx);+}++function inventoryRowsForView(view, ctx) {+ switch (view) {+ case "mcp":+ return ctx.servers || [];+ case "skills":+ return (ctx.skills || []).filter((skill) => skill.exists);+ case "hooks":+ if (ctx.hooks?.length) return ctx.hooks;+ return (ctx.hookConfigs || []).map((config) => ({+ target: config.runtime,+ runtime: config.runtime,+ status: config.exists ? "configured" : "not_installed",+ installed: config.exists,+ path: config.path,+ source_scope: config.scope,+ beacon_managed: config.beacon_managed,+ modified_at: config.modified_at,+ file_sha256: config.file_sha256,+ path_hash: config.path_hash,+ }));+ case "configs":+ default:+ return (ctx.configs || []).filter((config) => config.exists);+ }+}++function inventoryCounts(ctx) {+ return {+ configs: inventoryRowsForView("configs", ctx).length,+ mcp: inventoryRowsForView("mcp", ctx).length,+ skills: inventoryRowsForView("skills", ctx).length,+ hooks: inventoryRowsForView("hooks", ctx).length,+ };+}++function renderInventoryFilterOptions(ctx) {+ const userSelect = $("#inventory-user-filter");+ const runtimeSelect = $("#inventory-runtime-filter");+ const allRows = ["configs", "mcp", "skills", "hooks"].flatMap((view) => inventoryRowsForView(view, ctx));+ if (userSelect) {+ const identity = inventoryIdentity();+ userSelect.innerHTML = `+ <option value="">All users</option>+ <option value="${escapeHTML(identity.user)}"${state.inventoryUser === identity.user ? " selected" : ""}>${escapeHTML(identity.user)}</option>+ `;+ }+ if (runtimeSelect) {+ const runtimes = uniqueSorted(allRows.map(inventoryRuntimeValue).filter(Boolean), runtimeLabel);+ runtimeSelect.innerHTML = `<option value="">All runtimes</option>` + runtimes+ .map((value) => `<option value="${escapeHTML(value)}"${state.inventoryRuntime === value ? " selected" : ""}>${escapeHTML(runtimeLabel(value))}</option>`)+ .join("");+ }+}++function renderInventoryViewTabs(ctx) {+ const el = $("#inventory-view-tabs");+ if (!el) return;+ const counts = inventoryCounts(ctx);+ el.innerHTML = Object.entries(inventoryViewLabels)+ .map(([view, label]) => `+ <button type="button" class="${state.inventoryView === view ? "active" : ""}" data-inventory-view="${escapeHTML(view)}">+ ${escapeHTML(label)} (${escapeHTML(counts[view] || 0)})+ </button>+ `)+ .join("");+ $$("[data-inventory-view]").forEach((button) => {+ button.addEventListener("click", () => {+ state.inventoryView = button.dataset.inventoryView;+ updateInventoryURL();+ renderInventoryWorkspace(state.inventory, currentInventoryContext());+ });+ });+}++function renderInventoryActiveTable(ctx) {+ const table = inventoryTableForView(state.inventoryView, ctx);+ const head = $("#inventory-active-head");+ const body = $("#inventory-active-body");+ if (!head || !body) return;+ setText("#inventory-active-title", table.title);+ setText("#inventory-active-description", table.description);+ if ($("#inventory-search")) $("#inventory-search").placeholder = inventorySearchPlaceholder(state.inventoryView);+ const rows = inventoryRowsForView(state.inventoryView, ctx)+ .filter(inventoryRowMatchesFilters)+ .sort(compareInventoryRows);+ head.innerHTML = `<tr>${table.columns.map((column) => `<th>${escapeHTML(column.label)}</th>`).join("")}</tr>`;+ if (!rows.length) {+ body.innerHTML = `<tr><td colspan="${table.columns.length}" class="muted">No matching rows were found in the latest Beacon inventory snapshot.</td></tr>`;+ return;+ }+ body.innerHTML = rows+ .map((row) => `<tr>${table.columns.map((column) => `<td${column.className ? ` class="${column.className}"` : ""}>${column.render(row)}</td>`).join("")}</tr>`)+ .join("");+}++function inventorySearchPlaceholder(view) {+ switch (view) {+ case "mcp":+ return "Search MCP servers by name, status, path, or command...";+ case "skills":+ return "Search agent skills by name, status, path, or command...";+ case "hooks":+ return "Search hooks by name, status, path, or command...";+ case "configs":+ default:+ return "Search configurations by name, status, path, or command...";+ }+}++function inventoryIdentityColumns() {+ return [+ { label: "User", className: "nowrap", render: () => escapeHTML(inventoryIdentity().user) },+ { label: "Device", className: "nowrap", render: () => escapeHTML(inventoryIdentity().device) },+ ];+}++function inventoryTableForView(view, ctx) {+ const sourceSHAs = configSHAsByPathHash(ctx.configs || []);+ switch (view) {+ case "mcp":+ return {+ title: "MCP Servers",+ description: "Model Context Protocol servers declared across discovered runtime configs. Secret-bearing env keys are filtered out.",+ columns: [+ ...inventoryIdentityColumns(),+ { label: "Agent Runtime", render: (row) => inventoryRuntimeCell(inventoryRuntimeValue(row)) },+ { label: "Server", render: (row) => escapeHTML(row.server_name || row.server_name_hash || "") },+ { label: "Scope", render: (row) => badge(row.source_scope || "unknown", "badge-muted") },+ { label: "Transport", render: (row) => badge(row.transport || "unknown", "badge-muted") },+ { label: "Command", className: "mono", render: (row) => row.command_present ? escapeHTML(row.command_name || "yes") : `<span class="muted">-</span>` },+ { label: "Args", render: (row) => escapeHTML(row.args_count ?? 0) },+ { label: "Env Keys", render: envKeysCell },+ { label: "Source SHA", className: "mono sha-cell", render: (row) => hashCell(sourceSHAs.get(row.source_path_hash)) },+ { label: "Definition SHA", className: "mono sha-cell", render: (row) => hashCell(row.definition_hash) },+ { label: "Source", className: "mono path-cell", render: (row) => escapeHTML(row.source_path || row.source_path_hash || "") },+ ],+ };+ case "skills":+ return {+ title: "Agent Skills",+ description: "Local skill manifests discovered under supported agent skill roots. Skill instruction bodies are not retained.",+ columns: [+ ...inventoryIdentityColumns(),+ { label: "Agent Runtime", render: (row) => inventoryRuntimeCell(inventoryRuntimeValue(row)) },+ { label: "Skill", render: (row) => escapeHTML(row.skill_name || row.skill_name_hash || "") },+ { label: "Scope", render: (row) => badge(row.source_scope || "unknown", "badge-muted") },+ { label: "Status", render: parserBadge },+ { label: "Modified", className: "nowrap", render: (row) => row.modified_at ? escapeHTML(formatTime(row.modified_at)) : `<span class="muted">-</span>` },+ { label: "Manifest SHA", className: "mono sha-cell", render: (row) => hashCell(row.file_sha256) },+ { label: "Manifest", className: "mono path-cell", render: (row) => escapeHTML(row.manifest_path || row.manifest_path_hash || row.root_path || row.root_path_hash || "") },+ ],+ };+ case "hooks":+ return {+ title: "Hook Configurations",+ description: "Hook manifests discovered across supported runtimes. Hook command bodies are not shown here.",+ columns: [+ ...inventoryIdentityColumns(),+ { label: "Agent Runtime", render: (row) => inventoryRuntimeCell(inventoryRuntimeValue(row)) },+ { label: "Scope", render: (row) => row.source_scope || row.scope ? badge(row.source_scope || row.scope, "badge-muted") : `<span class="muted">-</span>` },+ { label: "Status", render: (row) => badge(row.status || (row.installed ? "configured" : "not_installed"), row.installed ? "badge-ok" : "badge-muted") },+ { label: "Beacon Managed", render: (row) => row.beacon_managed ? badge("managed", "badge-ok") : `<span class="muted">no</span>` },+ { label: "Modified", className: "nowrap", render: (row) => row.modified_at ? escapeHTML(formatTime(row.modified_at)) : `<span class="muted">-</span>` },+ { label: "Manifest SHA", className: "mono sha-cell", render: (row) => hashCell(row.file_sha256 || row.path_hash) },+ { label: "Manifest", className: "mono path-cell", render: (row) => escapeHTML(row.path || row.path_hash || "") },+ ],+ };+ case "configs":+ default:+ return {+ title: "Agent Runtime Configurations",+ description: "Config, hook, plugin, and profile files found on this endpoint. Paths and hashes only; file contents are never read into the dashboard.",+ columns: [+ ...inventoryIdentityColumns(),+ { label: "Agent Runtime", render: (row) => inventoryRuntimeCell(inventoryRuntimeValue(row)) },+ { label: "Scope", render: (row) => badge(row.scope || "unknown", "badge-muted") },+ { label: "Kind", render: (row) => escapeHTML(configKindLabel(row.config_kind)) },+ { label: "Parser", render: parserBadge },+ { label: "MCP", render: (row) => escapeHTML(row.mcp_server_count ?? 0) },+ { label: "Beacon Managed", render: (row) => row.beacon_managed ? badge("managed", "badge-ok") : `<span class="muted">no</span>` },+ { label: "Modified", className: "nowrap", render: (row) => row.modified_at ? escapeHTML(formatTime(row.modified_at)) : `<span class="muted">-</span>` },+ { label: "Manifest SHA", className: "mono sha-cell", render: (row) => hashCell(row.file_sha256) },+ { label: "Path", className: "mono path-cell", render: (row) => escapeHTML(row.path || row.path_hash || "") },+ ],+ };+ }+}++function inventoryRuntimeCell(value) {+ if (!value) return `<span class="muted">-</span>`;+ const label = runtimeLabel(value);+ const initials = harnessInitials(value);+ const logo = inventoryRuntimeLogos[String(value).toLowerCase()];+ return `+ <span class="inventory-runtime-cell">+ <span class="inventory-runtime-logo">+ ${logo ? `<img src="${escapeHTML(logo)}" alt="${escapeHTML(label)} logo" loading="lazy" />` : escapeHTML(initials)}+ </span>+ <span>${escapeHTML(label)}</span>+ </span>+ `;+}++function harnessInitials(value) {+ const label = runtimeLabel(value);+ const words = label.split(/\s+/).filter(Boolean);+ if (!words.length) return "?";+ if (words.length === 1) return words[0].slice(0, 2).toUpperCase();+ return words.slice(0, 2).map((word) => word[0]).join("").toUpperCase();+}++function currentInventoryContext() {+ const inventory = state.inventory || {};+ const configs = inventory.configs || [];+ const hooks = normalizeInventoryHooks(inventory.hooks);+ const existingConfigs = configs.filter((config) => config.exists);+ return {+ harnesses: inventory.harnesses || [],+ configs,+ servers: inventory.mcp_servers || [],+ skills: inventory.skills || [],+ hooks,+ existingConfigs,+ existingSkills: (inventory.skills || []).filter((skill) => skill.exists),+ hookConfigs: existingConfigs.filter((config) => config.config_kind === "hook_config"),+ };+}++function inventoryIdentity() {+ const scope = state.inventory?.user_scope || {};+ const home = scope.home_path || "";+ const user = titleCasePathBase(home) || "Local user";+ return {+ user,+ device: "Local endpoint",+ };+}++function titleCasePathBase(path) {+ const base = String(path || "").split("/").filter(Boolean).pop() || "";+ return base ? base.replace(/[-_.]+/g, " ").replace(/\b\w/g, (char) => char.toUpperCase()) : "";+}++function inventoryRuntimeValue(row) {+ return row.runtime || row.target || row.item_name || "";+}++function inventoryScopeValue(row) {+ return row.scope || row.source_scope || "";+}++function inventoryRowMatchesFilters(row) {+ if (state.inventoryRuntime && inventoryRuntimeValue(row) !== state.inventoryRuntime) return false;+ if (state.inventoryUser && state.inventoryUser !== inventoryIdentity().user) return false;+ const query = state.inventorySearch.trim().toLowerCase();+ if (!query) return true;+ return inventorySearchText(row).toLowerCase().includes(query);+}++function inventorySearchText(row) {+ return [+ inventoryRuntimeValue(row),+ runtimeLabel(inventoryRuntimeValue(row)),+ inventoryIdentity().user,+ inventoryIdentity().device,+ inventoryScopeValue(row),+ row.config_kind,+ row.parser_status,+ row.status,+ row.path,+ row.path_hash,+ row.server_name,+ row.server_name_hash,+ row.command_name,+ row.source_path,+ row.source_path_hash,+ row.skill_name,+ row.skill_name_hash,+ row.manifest_path,+ row.manifest_path_hash,+ row.definition_hash,+ row.file_sha256,+ ].filter(Boolean).join(" ");+}++function compareInventoryRows(a, b) {+ return runtimeLabel(inventoryRuntimeValue(a)).localeCompare(runtimeLabel(inventoryRuntimeValue(b)), undefined, { numeric: true, sensitivity: "base" })+ || (inventoryScopeValue(a) || "").localeCompare(inventoryScopeValue(b) || "", undefined, { numeric: true, sensitivity: "base" })+ || inventorySearchText(a).localeCompare(inventorySearchText(b), undefined, { numeric: true, sensitivity: "base" });+}++function uniqueSorted(values, labeler = (value) => value) {+ return Array.from(new Set(values)).sort((a, b) => labeler(a).localeCompare(labeler(b), undefined, { numeric: true, sensitivity: "base" }));+}+function renderInventoryCards(harnesses, configs, servers, skills = [], hooks = []) {if (!$("#inventory-cards")) return;const detected = harnesses.filter((harness) => harness.detected).length;@@ -1058,6 +1523,7 @@ function applyFilters(filters, options = {}) {window.location.href = query ? `/?${query}` : "/";return;}+ if (isActivityPage) setActivityView("detailed");setFilters(filters, options);}@@ -1144,6 +1610,9 @@ function renderTokensPage(report, session) {setText("#log-path", state.status?.log_path || "Runtime log unavailable");setText("#token-meta", `${report.events_with_usage} of ${report.total_events} events carry usage`);renderTokenCards(report.totals || {});+ renderTokenThroughput(report.series || []);+ renderTokenSplit(report.totals || {});+ renderTokenBreakdowns(report);renderUtilizationRows(report.utilization || []);renderUsageGroupRows("#token-models", report.by_model || [], "model");renderUsageGroupRows("#token-sessions", report.by_session || [], "session");@@ -1153,13 +1622,22 @@ function renderTokensPage(report, session) {renderSessionDetail(report.session_detail, session);}+function usageTotal(usage = {}) {+ return (usage.input_tokens || 0) ++ (usage.output_tokens || 0) ++ (usage.cache_read_input_tokens || 0) ++ (usage.cache_creation_input_tokens || 0) ++ (usage.reasoning_output_tokens || 0);+}+function renderTokenCards(totals) {if (!$("#token-cards")) return;+ const totalTokens = usageTotal(totals);const cards = [- { label: "Input Tokens", value: formatTokens(totals.input_tokens) },- { label: "Output Tokens", value: formatTokens(totals.output_tokens) },- { label: "Cache Read", value: formatTokens(totals.cache_read_input_tokens) },- { label: "Cache Creation", value: formatTokens(totals.cache_creation_input_tokens) },+ { label: "Total Tokens", value: formatTokens(totalTokens), hint: "local captured usage" },+ { label: "Input Tokens", value: formatTokens((totals.input_tokens || 0) + (totals.cache_read_input_tokens || 0) + (totals.cache_creation_input_tokens || 0)), hint: "fresh + cached" },+ { label: "Output Tokens", value: formatTokens((totals.output_tokens || 0) + (totals.reasoning_output_tokens || 0)), hint: "completion + reasoning" },+ { label: "Cached Tokens", value: formatTokens((totals.cache_read_input_tokens || 0) + (totals.cache_creation_input_tokens || 0)) },{ label: "Reasoning", value: formatTokens(totals.reasoning_output_tokens) },{ label: "Cost (USD)", value: totals.cost_usd ? totals.cost_usd.toFixed(4) : "-", hint: "runtime-reported only" },];@@ -1174,6 +1652,177 @@ function renderTokenCards(totals) {.join("");}+function renderTokenSplit(totals) {+ const el = $("#token-split");+ if (!el) return;+ const freshInput = totals.input_tokens || 0;+ const cached = (totals.cache_read_input_tokens || 0) + (totals.cache_creation_input_tokens || 0);+ const output = totals.output_tokens || 0;+ const reasoning = totals.reasoning_output_tokens || 0;+ const segments = [+ { name: "Input (fresh)", value: freshInput, color: "#0f7498" },+ { name: "Cached input", value: cached, color: "#10b981" },+ { name: "Output", value: output, color: "#7dd3fc" },+ { name: "Reasoning", value: reasoning, color: "#f59e0b" },+ ].filter((segment) => segment.value > 0);+ const total = segments.reduce((sum, segment) => sum + segment.value, 0);+ if (!total) {+ el.innerHTML = emptyAnalytics("No token split available for this range");+ return;+ }+ let cursor = 0;+ const stops = segments.map((segment) => {+ const start = cursor;+ cursor += (segment.value / total) * 100;+ return `${segment.color} ${start}% ${cursor}%`;+ }).join(", ");+ el.innerHTML = `+ <div class="token-donut" style="background: conic-gradient(${stops})">+ <div>+ <strong>${escapeHTML(formatCompactTokens(total))}</strong>+ <span>total tokens</span>+ </div>+ </div>+ <div class="token-split-legend">+ ${segments.map((segment) => `+ <div>+ <span><i style="background:${segment.color}"></i>${escapeHTML(segment.name)}</span>+ <em>${escapeHTML(formatWholePercent(segment.value / total))}</em>+ <strong>${escapeHTML(formatCompactTokens(segment.value))}</strong>+ </div>+ `).join("")}+ </div>+ `;+}++function renderTokenBreakdowns(report) {+ const el = $("#token-breakdowns");+ if (!el) return;+ const rows = [+ {+ title: "Tokens by model",+ breakdownTitle: "Total tokens by model",+ items: report.by_model || [],+ emptyLabel: "No model token attribution for this range.",+ },+ {+ title: "Tokens by harness",+ breakdownTitle: "Total tokens by harness",+ items: report.by_harness || [],+ emptyLabel: "No harness token attribution for this range.",+ labelFormatter: harnessLabel,+ },+ {+ title: "Tokens by session",+ breakdownTitle: "Top token sessions",+ items: report.by_session || [],+ emptyLabel: "No session token attribution for this range.",+ sessionLinks: true,+ },+ ];+ el.innerHTML = rows.map((row) => tokenBreakdownRowHTML(row)).join("");+ $$("[data-token-breakdown-session]").forEach((button) => {+ button.addEventListener("click", () => {+ const params = new URLSearchParams(window.location.search);+ params.set("session", button.dataset.tokenBreakdownSession);+ window.location.search = params.toString();+ });+ });+}++function tokenBreakdownRowHTML({ title, breakdownTitle, items, emptyLabel, labelFormatter = (value) => value, sessionLinks = false }) {+ const visibleItems = (items || [])+ .map((item) => ({ ...item, total: usageTotal(item.usage || {}) }))+ .filter((item) => item.total > 0 || (item.usage?.cost_usd || 0) > 0)+ .slice(0, 8);+ const total = visibleItems.reduce((sum, item) => sum + item.total, 0);+ const max = Math.max(1, ...visibleItems.map((item) => item.total));+ return `+ <div class="token-breakdown-row">+ <div class="analytics-panel">+ <div class="panel-title-row">+ <div>+ <h2>${escapeHTML(title)}</h2>+ <p class="muted">Token usage over the local log, stacked by the top observed values.</p>+ </div>+ </div>+ ${visibleItems.length ? `+ <div class="chart-legend">+ ${visibleItems.slice(0, 6).map((item, index) => `<span><i style="background:${chartColor(index)}"></i>${escapeHTML(truncateMiddle(labelFormatter(item.key), 20))}</span>`).join("")}+ </div>+ <div class="stacked-chart compact">+ ${visibleItems.map((item, index) => `+ <div class="stacked-chart-column">+ <span class="stacked-chart-bar" style="height:${Math.max(8, Math.round((item.total / max) * 100))}%; background:${chartColor(index)}"></span>+ <span class="stacked-chart-value">${escapeHTML(formatCompactTokens(item.total))}</span>+ <span class="stacked-chart-label">${escapeHTML(truncateMiddle(labelFormatter(item.key), 14))}</span>+ </div>+ `).join("")}+ </div>+ ` : emptyAnalytics(emptyLabel)}+ </div>+ <div class="analytics-panel">+ <div class="panel-title-row">+ <div>+ <h2>${escapeHTML(breakdownTitle)}</h2>+ <p class="muted">Total token counts for the selected range.</p>+ </div>+ <span class="panel-total">${escapeHTML(formatCompactTokens(total))}</span>+ </div>+ ${visibleItems.length ? `+ <div class="breakdown-list">+ ${visibleItems.map((item, index) => {+ const label = labelFormatter(item.key);+ const ratio = total > 0 ? item.total / total : 0;+ return `+ <button type="button" ${sessionLinks ? `data-token-breakdown-session="${escapeHTML(item.key)}"` : ""}>+ <span><i style="background:${chartColor(index)}"></i><em>${escapeHTML(truncateMiddle(label, 30))}</em></span>+ <small>${escapeHTML(formatWholePercent(ratio))}</small>+ <strong>${escapeHTML(formatCompactTokens(item.total))}</strong>+ <b style="width:${Math.max(item.total > 0 ? 4 : 0, (item.total / max) * 100)}%; background:${chartColor(index)}"></b>+ </button>+ `;+ }).join("")}+ </div>+ ` : emptyAnalytics(emptyLabel)}+ </div>+ </div>+ `;+}++function renderTokenThroughput(series) {+ const el = $("#token-throughput");+ if (!el) return;+ const rows = series+ .map((bucket) => ({ ...bucket, total: usageTotal(bucket.usage || {}) }))+ .filter((bucket) => bucket.total > 0)+ .slice(-24);+ if (!rows.length) {+ el.innerHTML = `<span class="muted">No token throughput captured yet.</span>`;+ return;+ }+ const max = Math.max(...rows.map((bucket) => bucket.total), 1);+ el.innerHTML = rows+ .map((bucket) => {+ const usage = bucket.usage || {};+ const input = (usage.input_tokens || 0) + (usage.cache_read_input_tokens || 0) + (usage.cache_creation_input_tokens || 0);+ const output = (usage.output_tokens || 0) + (usage.reasoning_output_tokens || 0);+ const inputWidth = Math.max(0, Math.round((input / max) * 100));+ const outputWidth = Math.max(0, Math.round((output / max) * 100));+ return `+ <div class="throughput-row">+ <span class="muted">${escapeHTML(formatTime(bucket.start))}</span>+ <div class="throughput-track" aria-hidden="true">+ <span class="throughput-input" style="width: ${Math.max(3, inputWidth)}%"></span>+ <span class="throughput-output" style="width: ${outputWidth}%"></span>+ </div>+ <strong>${escapeHTML(formatTokens(bucket.total))}</strong>+ </div>+ `;+ })+ .join("");+}+function renderUtilizationRows(utilization) {const tbody = $("#token-utilization");if (!tbody) return;@@ -1267,6 +1916,31 @@ function formatTokens(value) {return Number(value).toLocaleString();}+function formatCompactTokens(value) {+ const number = Number(value || 0);+ if (number >= 1000000) return `${(number / 1000000).toFixed(1)}M`;+ if (number >= 1000) return `${(number / 1000).toFixed(1)}K`;+ return number.toLocaleString();+}++function formatWholePercent(value) {+ if (value === null || value === undefined || Number.isNaN(value)) return "-";+ return `${Math.round(value * 100)}%`;+}++function chartColor(index) {+ return ["#0f7498", "#7dd3fc", "#10b981", "#f59e0b", "#8b5cf6", "#ef4444", "#64748b", "#14b8a6"][index % 8];+}++function emptyAnalytics(label) {+ return `+ <div class="empty-chart">+ <strong>${escapeHTML(label)}</strong>+ <span>Telemetry will appear here once Agent Beacon events arrive.</span>+ </div>+ `;+}+function formatRatio(ratio, contextWindow) {if (!contextWindow) return "-";return `${(ratio * 100).toFixed(1)}%`;@@ -1474,7 +2148,7 @@ function sessionDetailHTML(sessionId) {<div class="detail-head"><h3>Session timeline</h3><span class="muted">${escapeHTML(sessionId)} · ${records.length} event${records.length === 1 ? "" : "s"}</span>- <a class="text-button" href="/?session=${encodeURIComponent(sessionId)}">Open in Log Search</a>+ <a class="text-button" href="/?session=${encodeURIComponent(sessionId)}">Open in Agent Activity Sessions</a></div><ol class="session-timeline">${records.map((record) => sessionTimelineRow(record)).join("")}</ol></div>@@ -1525,6 +2199,28 @@ function summarizeFindingEvents(events) {.join("");}+const navIcons = {+ "Findings": `<svg viewBox="0 0 24 24"><path d="M21.73 18 13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"/><path d="M12 9v4"/><path d="M12 17h.01"/></svg>`,+ "Analytics": `<svg viewBox="0 0 24 24"><path d="M3 3v16a2 2 0 0 0 2 2h16"/><path d="m19 9-5 5-4-4-3 3"/></svg>`,+ "Token Usage": `<svg viewBox="0 0 24 24"><circle cx="8" cy="8" r="6"/><path d="M18.09 10.37A6 6 0 1 1 10.34 18"/><path d="M7 6h1v4"/><path d="m16.71 13.88.7.71-2.82 2.82"/></svg>`,+ "Agent Activity": `<svg viewBox="0 0 24 24"><path d="m12 14 4-4"/><path d="M3.34 19a10 10 0 1 1 17.32 0"/></svg>`,+ "Agent Inventory": `<svg viewBox="0 0 24 24"><path d="M12 8V4H8"/><rect width="16" height="12" x="4" y="8" rx="2"/><path d="M2 14h2"/><path d="M20 14h2"/><path d="M15 13v2"/><path d="M9 13v2"/></svg>`,+ "Agent Activity Sessions": `<svg viewBox="0 0 24 24"><path d="M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2"/></svg>`,+ "Detections": `<svg viewBox="0 0 24 24"><path d="M19.07 4.93A10 10 0 1 0 21.31 8.35"/><path d="M16.24 7.76A6 6 0 1 0 8.23 16.67"/><path d="M17.99 11.66A6 6 0 0 1 15.77 16.67"/><circle cx="12" cy="12" r="2"/><path d="m13.41 10.59 5.66-5.66"/></svg>`,+};++function decorateDashboardNav() {+ $$(".nav-toggle a, .nav-section-title").forEach((item) => {+ if (item.querySelector(".nav-icon")) return;+ const label = item.textContent.trim();+ const icon = navIcons[label];+ if (!icon) return;+ item.innerHTML = `<span class="nav-icon" aria-hidden="true">${icon}</span><span>${escapeHTML(label)}</span>`;+ });+}++decorateDashboardNav();+$("#min-severity")?.addEventListener("change", (event) => {const params = new URLSearchParams(window.location.search);if (event.target.value) params.set("min_severity", event.target.value);@@ -1537,6 +2233,21 @@ $("#refresh")?.addEventListener("click", () => {loader().catch(console.error);});$("#inventory-show-all")?.addEventListener("change", () => renderInventoryConfigs(state.inventory?.configs || []));+$("#inventory-runtime-filter")?.addEventListener("change", (event) => {+ state.inventoryRuntime = event.target.value;+ updateInventoryURL();+ renderInventoryWorkspace(state.inventory, currentInventoryContext());+});+$("#inventory-user-filter")?.addEventListener("change", (event) => {+ state.inventoryUser = event.target.value;+ updateInventoryURL();+ renderInventoryWorkspace(state.inventory, currentInventoryContext());+});+$("#inventory-search")?.addEventListener("input", (event) => {+ state.inventorySearch = event.target.value;+ updateInventoryURL();+ renderInventoryActiveTable(currentInventoryContext());+});$("#filters")?.addEventListener("submit", (event) => {event.preventDefault();load({ updateLocation: true }).catch(console.error);@@ -1545,6 +2256,11 @@ $("#clear-search")?.addEventListener("click", clearSearch);$("#close-drawer")?.addEventListener("click", closeDrawer);$("#new-events")?.addEventListener("click", showNewEvents);window.addEventListener("hashchange", () => scrollDetectionHashIntoView({ force: true }));+$$("[data-activity-view]").forEach((button) => {+ button.addEventListener("click", () => {+ setActivityView(button.dataset.activityView, { updateLocation: true });+ });+});$$("[data-preset]").forEach((button) => {button.addEventListener("click", () => applyPreset(button.dataset.preset));});@@ -1559,6 +2275,7 @@ if (isDetectionsPage) {loadTokens().catch(console.error);setInterval(() => loadTokens().catch(console.error), 15000);} else if (isInventoryPage) {+ hydrateInventoryStateFromURL();loadInventory().catch(console.error);setInterval(() => loadInventory().catch(console.error), 15000);} else {diff --git a/cli/beacon/internal/endpoint/dashboard/static/detections.html b/cli/beacon/internal/endpoint/dashboard/static/detections.htmlindex a470ba09..f7fa8edf 100644--- a/cli/beacon/internal/endpoint/dashboard/static/detections.html+++ b/cli/beacon/internal/endpoint/dashboard/static/detections.html@@ -10,15 +10,28 @@<header class="topbar"><div><p class="eyebrow">Local-only</p>- <h1>Beacon Endpoint Detections</h1>+ <h1>Detections</h1></div><nav class="nav-toggle" aria-label="Dashboard navigation">- <a href="/">Log Search</a>- <a href="/overview.html">Security Analytics</a>- <a href="/findings.html">Findings</a>- <a class="active" href="/detections.html" aria-current="page">Detections</a>- <a href="/inventory.html">Agent Inventory</a>- <a href="/tokens.html">Token Usage</a>+ <div class="nav-search" aria-hidden="true">Find...</div>+ <div class="nav-section">+ <div class="nav-section-title">Overview</div>+ <a href="/findings.html">Findings</a>+ </div>+ <div class="nav-section">+ <div class="nav-section-title">Analytics</div>+ <a href="/tokens.html">Token Usage</a>+ <a href="/overview.html">Agent Activity</a>+ </div>+ <div class="nav-section">+ <div class="nav-section-title">Observe</div>+ <a href="/inventory.html">Agent Inventory</a>+ <a href="/">Agent Activity Sessions</a>+ </div>+ <div class="nav-section">+ <div class="nav-section-title">Control</div>+ <a class="active" aria-current="page" href="/detections.html">Detections</a>+ </div></nav><button id="refresh">Refresh</button></header>diff --git a/cli/beacon/internal/endpoint/dashboard/static/findings.html b/cli/beacon/internal/endpoint/dashboard/static/findings.htmlindex 1e9b8245..fe1d9efe 100644--- a/cli/beacon/internal/endpoint/dashboard/static/findings.html+++ b/cli/beacon/internal/endpoint/dashboard/static/findings.html@@ -10,15 +10,28 @@<header class="topbar"><div><p class="eyebrow">Local-only</p>- <h1>Beacon Endpoint Findings</h1>+ <h1>Findings</h1></div><nav class="nav-toggle" aria-label="Dashboard navigation">- <a href="/">Log Search</a>- <a href="/overview.html">Security Analytics</a>- <a class="active" href="/findings.html" aria-current="page">Findings</a>- <a href="/detections.html">Detections</a>- <a href="/inventory.html">Agent Inventory</a>- <a href="/tokens.html">Token Usage</a>+ <div class="nav-search" aria-hidden="true">Find...</div>+ <div class="nav-section">+ <div class="nav-section-title">Overview</div>+ <a class="active" aria-current="page" href="/findings.html">Findings</a>+ </div>+ <div class="nav-section">+ <div class="nav-section-title">Analytics</div>+ <a href="/tokens.html">Token Usage</a>+ <a href="/overview.html">Agent Activity</a>+ </div>+ <div class="nav-section">+ <div class="nav-section-title">Observe</div>+ <a href="/inventory.html">Agent Inventory</a>+ <a href="/">Agent Activity Sessions</a>+ </div>+ <div class="nav-section">+ <div class="nav-section-title">Control</div>+ <a href="/detections.html">Detections</a>+ </div></nav><button id="refresh">Refresh</button></header>diff --git a/cli/beacon/internal/endpoint/dashboard/static/index.html b/cli/beacon/internal/endpoint/dashboard/static/index.htmlindex 38311db8..28af1aa4 100644--- a/cli/beacon/internal/endpoint/dashboard/static/index.html+++ b/cli/beacon/internal/endpoint/dashboard/static/index.html@@ -3,31 +3,64 @@<head><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />- <title>Beacon Endpoint Dashboard</title>+ <title>Beacon Endpoint Agent Activity</title><link rel="stylesheet" href="/styles.css" /></head>- <body>+ <body data-page="sessions"><header class="topbar"><div><p class="eyebrow">Local-only</p>- <h1>Beacon Endpoint Log Search</h1>+ <h1>Agent Activity</h1></div><nav class="nav-toggle" aria-label="Dashboard navigation">- <a class="active" href="/" aria-current="page">Log Search</a>- <a href="/overview.html">Security Analytics</a>- <a href="/findings.html">Findings</a>- <a href="/detections.html">Detections</a>- <a href="/inventory.html">Agent Inventory</a>- <a href="/tokens.html">Token Usage</a>+ <div class="nav-search" aria-hidden="true">Find...</div>+ <div class="nav-section">+ <div class="nav-section-title">Overview</div>+ <a href="/findings.html">Findings</a>+ </div>+ <div class="nav-section">+ <div class="nav-section-title">Analytics</div>+ <a href="/tokens.html">Token Usage</a>+ <a href="/overview.html">Agent Activity</a>+ </div>+ <div class="nav-section">+ <div class="nav-section-title">Observe</div>+ <a href="/inventory.html">Agent Inventory</a>+ <a class="active" aria-current="page" href="/">Agent Activity Sessions</a>+ </div>+ <div class="nav-section">+ <div class="nav-section-title">Control</div>+ <a href="/detections.html">Detections</a>+ </div></nav>- <button id="refresh">Refresh</button>+ <div class="topbar-org" aria-label="Current organization">+ <span class="topbar-org-mark" aria-hidden="true"></span>+ <span>Asymptote Labs</span>+ <span class="topbar-org-caret" aria-hidden="true"></span>+ </div>+ <button id="refresh" class="topbar-refresh" aria-label="Refresh activity" title="Refresh activity">Refresh</button></header><main>- <section class="panel search-panel">+ <section class="dashboard-hero activity-page-head">+ <div>+ <h2>Agent Activity</h2>+ <p class="muted">Detailed local endpoint sessions and events across prompts, tools, commands, files, approvals, MCP activity, models, and repositories.</p>+ </div>+ </section>++ <section class="panel status-panel">+ <div>+ <h2>Endpoint</h2>+ <p id="log-path" class="muted">Loading runtime log...</p>+ </div>+ <div id="last-updated" class="muted"></div>+ </section>++ <section id="activity-detailed" class="panel search-panel activity-view"><div class="section-head"><div>- <h2>Investigation Search</h2>+ <h2>Session Events</h2><p class="muted">Search commands, files, MCP tools, prompts, approval reasons, sessions, repositories, models, harnesses, and event messages.</p></div><div class="section-actions">@@ -120,7 +153,7 @@<label class="search-field"><span class="search-input-wrap"><span class="search-icon" aria-hidden="true"></span>- <input class="search-input" name="q" placeholder="Search logs..." autocomplete="off" aria-label="Search logs" />+ <input class="search-input" name="q" placeholder="Search agent activity..." autocomplete="off" aria-label="Search agent activity" /></span></label></div>@@ -151,15 +184,6 @@</div></section>- <section class="panel">- <div class="section-head">- <div>- <h2>Endpoint Diagnostics</h2>- <p id="log-path" class="muted">Loading runtime log...</p>- </div>- <a class="docs-link" href="/inventory.html">View agent inventory →</a>- </div>- </section></main><aside id="drawer" class="drawer" aria-hidden="true">diff --git a/cli/beacon/internal/endpoint/dashboard/static/inventory-hooks.html b/cli/beacon/internal/endpoint/dashboard/static/inventory-hooks.htmlindex 3b113df2..92dd94d2 100644--- a/cli/beacon/internal/endpoint/dashboard/static/inventory-hooks.html+++ b/cli/beacon/internal/endpoint/dashboard/static/inventory-hooks.html@@ -3,22 +3,35 @@<head><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />- <title>Beacon Endpoint Hook Inventory</title>+ <title>Beacon Endpoint Agent Inventory</title><link rel="stylesheet" href="/styles.css" /></head><body data-page="inventory-hooks"><header class="topbar"><div><p class="eyebrow">Local-only</p>- <h1>Beacon Endpoint Hook Inventory</h1>+ <h1>Agent Inventory</h1></div><nav class="nav-toggle" aria-label="Dashboard navigation">- <a href="/">Log Search</a>- <a href="/overview.html">Security Analytics</a>- <a href="/findings.html">Findings</a>- <a href="/detections.html">Detections</a>- <a class="active" href="/inventory-hooks.html" aria-current="page">Agent Inventory</a>- <a href="/tokens.html">Token Usage</a>+ <div class="nav-search" aria-hidden="true">Find...</div>+ <div class="nav-section">+ <div class="nav-section-title">Overview</div>+ <a href="/findings.html">Findings</a>+ </div>+ <div class="nav-section">+ <div class="nav-section-title">Analytics</div>+ <a href="/tokens.html">Token Usage</a>+ <a href="/overview.html">Agent Activity</a>+ </div>+ <div class="nav-section">+ <div class="nav-section-title">Observe</div>+ <a class="active" aria-current="page" href="/inventory.html">Agent Inventory</a>+ <a href="/">Agent Activity Sessions</a>+ </div>+ <div class="nav-section">+ <div class="nav-section-title">Control</div>+ <a href="/detections.html">Detections</a>+ </div></nav><button id="refresh">Refresh</button></header>diff --git a/cli/beacon/internal/endpoint/dashboard/static/inventory.html b/cli/beacon/internal/endpoint/dashboard/static/inventory.htmlindex ef9a3af4..7fa07b7c 100644--- a/cli/beacon/internal/endpoint/dashboard/static/inventory.html+++ b/cli/beacon/internal/endpoint/dashboard/static/inventory.html@@ -10,160 +10,70 @@<header class="topbar"><div><p class="eyebrow">Local-only</p>- <h1>Beacon Endpoint Agent Inventory</h1>+ <h1>Agent Inventory</h1></div><nav class="nav-toggle" aria-label="Dashboard navigation">- <a href="/">Log Search</a>- <a href="/overview.html">Security Analytics</a>- <a href="/findings.html">Findings</a>- <a href="/detections.html">Detections</a>- <a class="active" href="/inventory.html" aria-current="page">Agent Inventory</a>- <a href="/tokens.html">Token Usage</a>+ <div class="nav-search" aria-hidden="true">Find...</div>+ <div class="nav-section">+ <div class="nav-section-title">Overview</div>+ <a href="/findings.html">Findings</a>+ </div>+ <div class="nav-section">+ <div class="nav-section-title">Analytics</div>+ <a href="/tokens.html">Token Usage</a>+ <a href="/overview.html">Agent Activity</a>+ </div>+ <div class="nav-section">+ <div class="nav-section-title">Observe</div>+ <a class="active" aria-current="page" href="/inventory.html">Agent Inventory</a>+ <a href="/">Agent Activity Sessions</a>+ </div>+ <div class="nav-section">+ <div class="nav-section-title">Control</div>+ <a href="/detections.html">Detections</a>+ </div></nav><button id="refresh">Refresh</button></header><main>- <section class="panel status-panel">- <div>- <h2>Endpoint</h2>- <p id="log-path" class="muted">Loading runtime log...</p>- </div>- <div id="inventory-meta" class="muted"></div>- </section>-- <section>- <div class="section-head overview-head">- <div>- <h2>Inventory at a Glance</h2>- <p class="muted">Local discovery of installed AI agent runtimes, their telemetry posture, configuration files, and MCP servers. Read-only and offline.</p>- </div>- </div>- <div class="cards" id="inventory-cards"></div>- </section>-- <section class="panel">- <div class="section-head">- <div>- <h2>Agent Runtimes</h2>- <p class="muted">Every supported runtime Beacon probes for, with detection and telemetry status.</p>- </div>- </div>- <div id="inventory-harnesses" class="harnesses"></div>- </section>+ <div class="inventory-page-head">+ <h1>Agent Inventory</h1>+ </div>- <section class="panel">- <div class="section-head">- <div>- <h2>Discovered Configurations</h2>- <p class="muted">Config, hook, plugin, and profile files found on this endpoint. Paths and hashes only — file contents are never read into the dashboard.</p>+ <section class="inventory-workspace" id="inventory-workspace">+ <div class="inventory-controls">+ <div class="inventory-filter-grid" aria-label="Inventory filters">+ <select id="inventory-user-filter" aria-label="User filter">+ <option value="">All users</option>+ </select>+ <select id="inventory-runtime-filter" aria-label="Runtime filter">+ <option value="">All runtimes</option>+ </select></div>- <label class="inline-toggle">- <input type="checkbox" id="inventory-show-all" />- <span>Show probed paths not found</span>+ <label class="inventory-search">+ <span class="search-icon" aria-hidden="true"></span>+ <input id="inventory-search" type="search" placeholder="Search configurations by name, status, path, or command..." /></label>+ <div class="inventory-tabs" id="inventory-view-tabs" aria-label="Inventory views"></div></div>- <div class="table-wrap">- <table>- <thead>- <tr>- <th>Runtime</th>- <th>Scope</th>- <th>Kind</th>- <th>Parser</th>- <th>MCP</th>- <th>Beacon Managed</th>- <th>Modified</th>- <th>Manifest SHA</th>- <th>Path</th>- </tr>- </thead>- <tbody id="inventory-configs"></tbody>- </table>- </div>- </section>- <section class="panel">- <div class="section-head">- <div>- <h2>MCP Servers</h2>- <p class="muted">Model Context Protocol servers declared across discovered runtime configs. Secret-bearing env keys are filtered out.</p>+ <section class="panel inventory-table-panel" id="inventory-active-panel">+ <div class="section-head">+ <div>+ <h2 id="inventory-active-title">Agent Runtime Configurations</h2>+ <p id="inventory-active-description" class="muted">Config, hook, plugin, and profile files found on this endpoint. Paths and hashes only; file contents are never read into the dashboard.</p>+ </div></div>- </div>- <div class="table-wrap">- <table>- <thead>- <tr>- <th>Runtime</th>- <th>Server</th>- <th>Scope</th>- <th>Transport</th>- <th>Command</th>- <th>Args</th>- <th>Env Keys</th>- <th>Source SHA</th>- <th>Definition SHA</th>- <th>Source</th>- </tr>- </thead>- <tbody id="inventory-mcp"></tbody>- </table>- </div>- </section>-- <section class="panel">- <div class="section-head">- <div>- <h2>Agent Skills</h2>- <p class="muted">Local skill manifests discovered under supported agent skill roots. Skill instruction bodies are not retained.</p>+ <div class="table-wrap">+ <table>+ <thead id="inventory-active-head"></thead>+ <tbody id="inventory-active-body">+ <tr><td class="muted">Loading inventory...</td></tr>+ </tbody>+ </table></div>- </div>- <div class="table-wrap">- <table>- <thead>- <tr>- <th>Runtime</th>- <th>Skill</th>- <th>Scope</th>- <th>Status</th>- <th>Modified</th>- <th>Manifest SHA</th>- <th>Manifest</th>- </tr>- </thead>- <tbody id="inventory-skills"></tbody>- </table>- </div>- </section>-- <section class="panel">- <div class="section-head">- <div>- <h2>Hook Configurations</h2>- <p class="muted">Hook manifests discovered across supported runtimes. Hook command bodies are not shown here.</p>- </div>- </div>- <div class="table-wrap">- <table>- <thead>- <tr>- <th>Runtime</th>- <th>Scope</th>- <th>Status</th>- <th>Beacon Managed</th>- <th>Modified</th>- <th>Manifest SHA</th>- <th>Manifest</th>- </tr>- </thead>- <tbody id="inventory-hooks"></tbody>- </table>- </div>- </section>-- <section class="panel">- <h2>Scan Scope</h2>- <div id="inventory-scope" class="scope-grid"></div>+ </section></section></main>diff --git a/cli/beacon/internal/endpoint/dashboard/static/logo.svg b/cli/beacon/internal/endpoint/dashboard/static/logo.svgnew file mode 100644index 00000000..df37e646--- /dev/null+++ b/cli/beacon/internal/endpoint/dashboard/static/logo.svg@@ -0,0 +1,14 @@+<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">+ <defs>+ <linearGradient id="logoGradient" x1="0%" y1="0%" x2="100%" y2="100%">+ <stop offset="0%" stop-color="#4F5BFF"/>+ <stop offset="55%" stop-color="#2563EB"/>+ <stop offset="100%" stop-color="#0891D1"/>+ </linearGradient>+ <filter id="logoShadow" x="-30%" y="-20%" width="160%" height="170%" color-interpolation-filters="sRGB">+ <feDropShadow dx="0" dy="6" stdDeviation="5" flood-color="#1D4ED8" flood-opacity="0.24"/>+ </filter>+ </defs>+ <rect width="40" height="40" rx="10" fill="url(#logoGradient)" filter="url(#logoShadow)"/>+ <path d="M20 20c-2-3-4.5-5-7.5-5-4 0-6.5 2.5-6.5 5s2.5 5 6.5 5c3 0 5.5-2 7.5-5zm0 0c2 3 4.5 5 7.5 5 4 0 6.5-2.5 6.5-5s-2.5-5-6.5-5c-3 0-5.5 2-7.5 5z" stroke="white" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/>+</svg>diff --git a/cli/beacon/internal/endpoint/dashboard/static/overview.html b/cli/beacon/internal/endpoint/dashboard/static/overview.htmlindex 3baafbdd..af2f3f2b 100644--- a/cli/beacon/internal/endpoint/dashboard/static/overview.html+++ b/cli/beacon/internal/endpoint/dashboard/static/overview.html@@ -3,27 +3,51 @@<head><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />- <title>Beacon Endpoint Security Analytics</title>+ <title>Beacon Endpoint Agent Activity</title><link rel="stylesheet" href="/styles.css" /></head><body data-page="overview"><header class="topbar"><div><p class="eyebrow">Local-only</p>- <h1>Beacon Endpoint Security Analytics</h1>+ <h1>Agent Activity</h1></div><nav class="nav-toggle" aria-label="Dashboard navigation">- <a href="/">Log Search</a>- <a class="active" href="/overview.html" aria-current="page">Security Analytics</a>- <a href="/findings.html">Findings</a>- <a href="/detections.html">Detections</a>- <a href="/inventory.html">Agent Inventory</a>- <a href="/tokens.html">Token Usage</a>+ <div class="nav-search" aria-hidden="true">Find...</div>+ <div class="nav-section">+ <div class="nav-section-title">Overview</div>+ <a href="/findings.html">Findings</a>+ </div>+ <div class="nav-section">+ <div class="nav-section-title">Analytics</div>+ <a href="/tokens.html">Token Usage</a>+ <a class="active" aria-current="page" href="/overview.html">Agent Activity</a>+ </div>+ <div class="nav-section">+ <div class="nav-section-title">Observe</div>+ <a href="/inventory.html">Agent Inventory</a>+ <a href="/">Agent Activity Sessions</a>+ </div>+ <div class="nav-section">+ <div class="nav-section-title">Control</div>+ <a href="/detections.html">Detections</a>+ </div></nav><button id="refresh">Refresh</button></header><main>+ <section class="dashboard-hero analytics-hero">+ <div>+ <h2>Agent activity analytics</h2>+ <p class="muted">At-a-glance view of local AI agent activity, risk, harnesses, and models.</p>+ </div>+ <div class="range-pills" aria-label="Local analytics range">+ <span class="active">Local log</span>+ <span>Offline</span>+ </div>+ </section>+<section class="panel status-panel"><div><h2>Endpoint</h2>@@ -34,14 +58,35 @@<section><div class="section-head overview-head"><div>- <h2>Security Posture</h2>- <p class="muted">At-a-glance view of local AI agent activity, risk, harnesses, and models.</p>+ <h2>Activity overview</h2>+ <p class="muted">Current local totals, review pressure, active sessions, top harnesses, and top models.</p></div><div id="last-updated" class="muted"></div></div><div class="cards" id="cards"></div></section>+ <section class="analytics-grid">+ <div class="analytics-panel">+ <div class="panel-title-row">+ <div>+ <h2>Agent Sessions by Source</h2>+ <p class="muted">Local session and event volume grouped by the top observed agent harnesses.</p>+ </div>+ </div>+ <div id="activity-session-chart" class="chart-bars"></div>+ </div>+ <div class="analytics-panel">+ <div class="panel-title-row">+ <div>+ <h2>What Needs Attention</h2>+ <p class="muted">High-risk activity, failures, and blocked or denied actions.</p>+ </div>+ </div>+ <div id="activity-attention" class="attention-list"></div>+ </div>+ </section>+<section class="insights" id="insights"></section></main>diff --git a/cli/beacon/internal/endpoint/dashboard/static/runtime-logos/antigravity.png b/cli/beacon/internal/endpoint/dashboard/static/runtime-logos/antigravity.pngnew file mode 100644index 00000000..74760171Binary files /dev/null and b/cli/beacon/internal/endpoint/dashboard/static/runtime-logos/antigravity.png differdiff --git a/cli/beacon/internal/endpoint/dashboard/static/runtime-logos/claude-code.png b/cli/beacon/internal/endpoint/dashboard/static/runtime-logos/claude-code.pngnew file mode 100644index 00000000..a14b0cf4Binary files /dev/null and b/cli/beacon/internal/endpoint/dashboard/static/runtime-logos/claude-code.png differdiff --git a/cli/beacon/internal/endpoint/dashboard/static/runtime-logos/cursor.png b/cli/beacon/internal/endpoint/dashboard/static/runtime-logos/cursor.pngnew file mode 100644index 00000000..50cb592fBinary files /dev/null and b/cli/beacon/internal/endpoint/dashboard/static/runtime-logos/cursor.png differdiff --git a/cli/beacon/internal/endpoint/dashboard/static/runtime-logos/factory.png b/cli/beacon/internal/endpoint/dashboard/static/runtime-logos/factory.pngnew file mode 100644index 00000000..82c29c0dBinary files /dev/null and b/cli/beacon/internal/endpoint/dashboard/static/runtime-logos/factory.png differdiff --git a/cli/beacon/internal/endpoint/dashboard/static/runtime-logos/github-copilot.png b/cli/beacon/internal/endpoint/dashboard/static/runtime-logos/github-copilot.pngnew file mode 100644index 00000000..d3b4b5ccBinary files /dev/null and b/cli/beacon/internal/endpoint/dashboard/static/runtime-logos/github-copilot.png differdiff --git a/cli/beacon/internal/endpoint/dashboard/static/runtime-logos/visual-studio-code.png b/cli/beacon/internal/endpoint/dashboard/static/runtime-logos/visual-studio-code.pngnew file mode 100644index 00000000..0cceb2c7Binary files /dev/null and b/cli/beacon/internal/endpoint/dashboard/static/runtime-logos/visual-studio-code.png differdiff --git a/cli/beacon/internal/endpoint/dashboard/static/styles.css b/cli/beacon/internal/endpoint/dashboard/static/styles.cssindex 2bc59c9a..d735ce3a 100644--- a/cli/beacon/internal/endpoint/dashboard/static/styles.css+++ b/cli/beacon/internal/endpoint/dashboard/static/styles.css@@ -145,7 +145,7 @@ main {.section-head {display: flex;align-items: center;- justify-content: space-between;+ justify-content: flex-end;gap: 1rem;}@@ -813,3 +813,1388 @@ pre {.scope-grid strong {overflow-wrap: anywhere;}++/* Product dashboard skin: mirrors the hosted frontend dashboard while keeping+ the local dashboard static, offline, and limited to its existing tabs. */+:root {+ --bg: #ffffff;+ --panel: #ffffff;+ --panel-soft: #f9fafb;+ --text: #111827;+ --muted: #6b7280;+ --line: rgba(0, 0, 0, 0.1);+ --accent: #036aa2;+ --accent-soft: #e2f0f8;+ --danger: #b91c1c;+ --warn: #92400e;+ --ok: #047857;+ --sidebar-width: 18rem;+ --topbar-height: 4rem;+ --radius: 0.625rem;+ --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);+ --shadow-md: 0 16px 40px rgba(15, 23, 42, 0.08);+}++html {+ min-height: 100%;+ background: var(--bg);+}++body {+ min-height: 100vh;+ padding-left: var(--sidebar-width);+ background:+ radial-gradient(circle at 100% 0%, rgba(3, 106, 162, 0.08), transparent 32rem),+ linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);+ color: var(--text);+ font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;+ -webkit-font-smoothing: antialiased;+ -moz-osx-font-smoothing: grayscale;+}++.topbar {+ position: fixed;+ top: 0;+ right: 0;+ left: var(--sidebar-width);+ z-index: 10;+ height: var(--topbar-height);+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 1rem;+ padding: 0 1.5rem;+ border-bottom: 1px solid var(--line);+ background: rgba(255, 255, 255, 0.92);+ backdrop-filter: blur(14px);+}++.topbar > div:first-child {+ display: none;+}++.topbar > button {+ justify-self: auto;+ min-width: 0;+}++.topbar-org {+ position: absolute;+ left: 50%;+ top: 50%;+ display: inline-flex;+ align-items: center;+ gap: 0.5rem;+ color: #6b7280;+ font-size: 0.76rem;+ font-weight: 650;+ letter-spacing: -0.01em;+ transform: translate(-50%, -50%);+}++.topbar-org-mark {+ width: 1.25rem;+ height: 1.25rem;+ border-radius: 0.42rem;+ background: url("/logo.svg") center / cover no-repeat;+ box-shadow: 0 4px 12px rgba(37, 99, 235, 0.22);+}++.topbar-org-caret {+ width: 0.36rem;+ height: 0.36rem;+ border-right: 1.5px solid currentColor;+ border-bottom: 1.5px solid currentColor;+ transform: translateY(-0.12rem) rotate(45deg);+ opacity: 0.75;+}++.topbar-refresh {+ position: relative;+ width: 2.15rem;+ height: 2.15rem;+ display: inline-flex;+ align-items: center;+ justify-content: center;+ border: 0;+ border-radius: 999px;+ background: transparent;+ color: #6b7280;+ font-size: 0;+ box-shadow: none;+}++.topbar-refresh::before {+ content: "";+ width: 1.05rem;+ height: 1.05rem;+ border: 1.7px solid currentColor;+ border-right-color: transparent;+ border-radius: 999px;+}++.topbar-refresh::after {+ content: "";+ position: absolute;+ right: 0.58rem;+ top: 0.62rem;+ width: 0.32rem;+ height: 0.32rem;+ border-top: 1.7px solid currentColor;+ border-right: 1.7px solid currentColor;+ transform: rotate(18deg);+}++.topbar-refresh:hover {+ background: var(--panel-soft);+ color: var(--text);+}++.eyebrow {+ margin-bottom: 0.1rem;+ color: var(--muted);+ font-size: 0.68rem;+ font-weight: 700;+ letter-spacing: 0.09em;+}++h1 {+ color: var(--text);+ font-size: 1.05rem;+ font-weight: 650;+ line-height: 1.25;+}++h2 {+ color: var(--text);+ font-size: 0.98rem;+ font-weight: 650;+}++h3 {+ color: var(--text);+}++main {+ max-width: 96rem;+ margin: 0 auto;+ padding: calc(var(--topbar-height) + 1.5rem) 1.5rem 3rem;+ gap: 1.5rem;+}++.nav-toggle {+ position: fixed;+ top: 0;+ left: 0;+ z-index: 11;+ width: var(--sidebar-width);+ height: 100vh;+ display: flex;+ flex-direction: column;+ align-items: stretch;+ justify-content: flex-start;+ gap: 0.9rem;+ padding: 3.4rem 1rem 1rem;+ border: 0;+ border-right: 1px solid var(--line);+ border-radius: 0;+ background: rgba(255, 255, 255, 0.96);+ box-shadow: none;+}++.nav-toggle::before {+ content: "Asymptote";+ position: absolute;+ top: 0.75rem;+ left: 0.95rem;+ display: flex;+ align-items: center;+ min-height: 2rem;+ padding-left: 2.55rem;+ background: url("/logo.svg") left center / 1.9rem 1.9rem no-repeat;+ color: var(--text);+ font-size: 1.08rem;+ font-weight: 750;+ letter-spacing: -0.04em;+}++.nav-toggle::after {+ content: "\2039";+ position: absolute;+ top: 0.9rem;+ right: 1rem;+ width: 2.1rem;+ height: 2.1rem;+ display: inline-flex;+ align-items: center;+ justify-content: center;+ border: 1px solid rgba(17, 24, 39, 0.16);+ border-radius: 0.55rem;+ background: #ffffff;+ color: #6b7280;+ font-size: 1.8rem;+ font-weight: 650;+ line-height: 0.85;+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);+}++.nav-search {+ position: relative;+ height: 2.4rem;+ display: flex;+ align-items: center;+ border: 1px solid rgba(17, 24, 39, 0.1);+ border-radius: 1rem;+ background: #ffffff;+ color: var(--muted);+ font-size: 0.95rem;+ font-weight: 500;+ letter-spacing: -0.01em;+ padding: 0 3.1rem 0 2.75rem;+ box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12), 0 1px 2px rgba(15, 23, 42, 0.08);+}++.nav-search::before {+ content: "";+ position: absolute;+ left: 1rem;+ top: 50%;+ width: 0.92rem;+ height: 0.92rem;+ border: 2px solid #6b7280;+ border-radius: 999px;+ background: linear-gradient(45deg, transparent 0 48%, #6b7280 49% 62%, transparent 63%) 0.42rem 0.42rem / 0.9rem 0.9rem no-repeat;+ transform: translateY(-50%);+}++.nav-search::after {+ content: "F";+ position: absolute;+ right: 0.7rem;+ top: 50%;+ min-width: 2rem;+ height: 1.75rem;+ display: inline-flex;+ align-items: center;+ justify-content: center;+ border: 1px solid rgba(17, 24, 39, 0.16);+ border-radius: 0.875rem;+ background: #f9fafb;+ color: #6b7280;+ font-size: 0.86rem;+ font-weight: 650;+ line-height: 1;+ transform: translateY(-50%);+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);+}++.nav-search::before {+ pointer-events: none;+}++.nav-section {+ display: grid;+ gap: 0.25rem;+}++.nav-section-title {+ display: flex;+ align-items: center;+ justify-content: flex-start;+ gap: 0.55rem;+ min-height: 1.25rem;+ padding: 0 0.5rem;+ color: #9ca3af;+ font-size: 0.62rem;+ font-weight: 750;+ letter-spacing: 0.1em;+ line-height: 1;+ text-transform: uppercase;+}++.nav-toggle a {+ position: relative;+ min-width: 0;+ display: flex;+ align-items: center;+ gap: 0.6rem;+ min-height: 1.95rem;+ padding: 0.42rem 0.58rem;+ border-radius: 9px;+ color: #374151;+ font-size: 0.8rem;+ font-weight: 600;+ text-align: left;+ transition: background-color 140ms ease-out, color 140ms ease-out;+}++.nav-icon {+ flex: 0 0 auto;+ width: 1.05rem;+ height: 1.05rem;+ display: inline-flex;+ align-items: center;+ justify-content: center;+ color: #6b7280;+}++.nav-icon svg {+ width: 100%;+ height: 100%;+ fill: none;+ stroke: currentColor;+ stroke-linecap: round;+ stroke-linejoin: round;+ stroke-width: 2;+}++.nav-section-title .nav-icon {+ width: 1rem;+ height: 1rem;+ color: #6b7280;+}++.nav-toggle a.active .nav-icon,+.nav-toggle a:hover .nav-icon {+ color: currentColor;+}++.nav-toggle a.active {+ overflow: hidden;+ background: var(--accent-soft);+ color: var(--accent);+}++.nav-toggle a.active::before {+ content: "";+ position: absolute;+ left: 0;+ top: 50%;+ width: 3px;+ height: 1.5rem;+ border-radius: 0 999px 999px 0;+ background: var(--accent);+ transform: translateY(-50%);+}++.nav-toggle a:not(.active):hover {+ background: var(--panel-soft);+ color: var(--text);+}++.dashboard-hero {+ display: flex;+ align-items: flex-start;+ justify-content: space-between;+ gap: 1rem;+ padding: 0.25rem 0 0;+}++.dashboard-hero h2 {+ font-size: 1.5rem;+ font-weight: 700;+ letter-spacing: -0.03em;+}++body[data-page="sessions"] main {+ max-width: 100rem;+ padding-top: calc(var(--topbar-height) + 1.6rem);+}++.activity-page-head {+ min-height: 2.25rem;+ align-items: center;+}++.activity-page-head h2 {+ font-size: 1.42rem;+ letter-spacing: -0.04em;+}++.activity-page-head p {+ display: none;+}++.analytics-hero,+.inventory-hero {+ align-items: center;+}++.range-pills,+.inventory-tabs {+ display: inline-flex;+ flex-wrap: wrap;+ gap: 0.35rem;+}++.range-pills span,+.inventory-tabs a {+ display: inline-flex;+ align-items: center;+ min-height: 2rem;+ border: 1px solid var(--line);+ border-radius: 999px;+ background: #ffffff;+ color: #374151;+ font-size: 0.75rem;+ font-weight: 700;+ padding: 0.35rem 0.7rem;+ text-decoration: none;+ box-shadow: var(--shadow-sm);+}++.range-pills span.active,+.inventory-tabs a:hover {+ border-color: rgba(3, 106, 162, 0.22);+ background: var(--accent-soft);+ color: var(--accent);+}++.inventory-tabs {+ position: sticky;+ top: calc(var(--topbar-height) + 0.75rem);+ z-index: 1;+ border: 1px solid var(--line);+ border-radius: 14px;+ background: rgba(255, 255, 255, 0.94);+ padding: 0.5rem;+ box-shadow: var(--shadow-sm);+}++.analytics-grid,+.token-breakdown-row {+ display: grid;+ grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);+ gap: 1rem;+}++.analytics-stack {+ display: grid;+ gap: 1rem;+}++.analytics-panel {+ min-width: 0;+ border: 1px solid var(--line);+ border-radius: 14px;+ background: rgba(255, 255, 255, 0.98);+ padding: 1rem;+ box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);+}++.panel-title-row {+ display: flex;+ align-items: flex-start;+ justify-content: space-between;+ gap: 1rem;+}++.panel-title-row h2 {+ font-size: 0.88rem;+ font-weight: 700;+}++.panel-title-row p {+ margin-top: 0.35rem;+ font-size: 0.75rem;+ line-height: 1.55;+}++.panel-total {+ color: var(--muted);+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;+ font-size: 0.76rem;+}++.chart-legend {+ display: flex;+ flex-wrap: wrap;+ justify-content: flex-end;+ gap: 0.4rem 0.8rem;+ margin: 0.75rem 0 0.65rem;+ color: var(--muted);+ font-size: 0.68rem;+}++.chart-legend span,+.token-split-legend span,+.breakdown-list button span {+ min-width: 0;+ display: inline-flex;+ align-items: center;+ gap: 0.4rem;+}++.chart-legend i,+.token-split-legend i,+.breakdown-list i {+ width: 0.5rem;+ height: 0.5rem;+ flex: 0 0 auto;+ border-radius: 2px;+ background: #0f7498;+}++.chart-bars,+.stacked-chart {+ min-height: 17.8rem;+}++.stacked-chart {+ display: flex;+ align-items: end;+ gap: 0.55rem;+ padding: 0.75rem 0.35rem 0.25rem;+ border-radius: 16px;+ background:+ repeating-linear-gradient(0deg, transparent 0 3.45rem, rgba(15, 23, 42, 0.08) 3.45rem calc(3.45rem + 1px)),+ linear-gradient(180deg, rgba(248, 250, 252, 0.28), rgba(248, 250, 252, 0.7));+}++.stacked-chart.compact {+ min-height: 15.6rem;+}++.stacked-chart-column {+ min-width: 0;+ flex: 1 1 0;+ height: 13.5rem;+ display: flex;+ flex-direction: column;+ align-items: center;+ justify-content: end;+ gap: 0.35rem;+ border: 0;+ border-radius: 0;+ background: transparent;+ box-shadow: none;+ color: inherit;+ padding: 0;+}++button.stacked-chart-column:hover {+ background: transparent;+}++.stacked-chart-bar {+ width: min(2.1rem, 72%);+ min-height: 0.45rem;+ border-radius: 4px 4px 0 0;+ box-shadow: inset 0 -1px 0 rgba(15, 23, 42, 0.12);+}++.stacked-chart-value,+.stacked-chart-label {+ max-width: 100%;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ font-size: 0.68rem;+}++.stacked-chart-value {+ color: #334155;+ font-weight: 750;+}++.stacked-chart-label {+ color: var(--muted);+}++.analytics-footnote {+ margin-top: 0.75rem;+ font-size: 0.72rem;+}++.attention-list {+ display: grid;+ gap: 0.7rem;+ margin-top: 1rem;+}++.attention-card {+ display: grid;+ grid-template-columns: minmax(0, 1fr) max-content;+ align-items: center;+ gap: 1rem;+ width: 100%;+ min-height: 3.15rem;+ border: 0;+ border-radius: 12px;+ background: #f8fafc;+ color: #334155;+ padding: 0.75rem 0.85rem;+ box-shadow: none;+ text-align: left;+}++.attention-card span {+ font-size: 0.76rem;+ line-height: 1.35;+}++.attention-card strong {+ font-size: 1.05rem;+}++.attention-danger {+ background: rgba(244, 63, 94, 0.08);+ color: #9f1239;+}++.attention-warn {+ background: rgba(245, 158, 11, 0.1);+ color: #92400e;+}++.attention-info {+ background: rgba(14, 116, 144, 0.1);+ color: #0e7490;+}++.empty-chart {+ min-height: 13.75rem;+ display: grid;+ place-content: center;+ gap: 0.35rem;+ border: 1px dashed var(--line);+ border-radius: 16px;+ background: rgba(248, 250, 252, 0.7);+ color: var(--muted);+ text-align: center;+}++.empty-chart strong {+ color: var(--text);+ font-size: 0.85rem;+}++.empty-chart span {+ font-size: 0.74rem;+}++.throughput-bars {+ display: grid;+ gap: 0.7rem;+ margin-top: 1rem;+}++.throughput-row {+ display: grid;+ grid-template-columns: minmax(8.5rem, max-content) minmax(9rem, 1fr) max-content;+ align-items: center;+ gap: 0.75rem;+ font-size: 0.82rem;+}++.throughput-track {+ position: relative;+ height: 0.65rem;+ overflow: hidden;+ border-radius: 999px;+ background: #e5eef4;+}++.throughput-track span {+ position: absolute;+ top: 0;+ left: 0;+ display: block;+ height: 100%;+ border-radius: inherit;+ background: linear-gradient(90deg, #0f7498, #7dd3fc);+}++.throughput-track .throughput-input {+ background: linear-gradient(90deg, #0f7498, rgba(15, 116, 152, 0.7));+}++.throughput-track .throughput-output {+ left: auto;+ right: 0;+ background: linear-gradient(90deg, rgba(125, 211, 252, 0.45), #7dd3fc);+}++.token-split {+ display: grid;+ grid-template-columns: 10rem minmax(0, 1fr);+ align-items: center;+ gap: 1rem;+ margin-top: 1rem;+}++.token-donut {+ position: relative;+ width: 10rem;+ height: 10rem;+ display: grid;+ place-items: center;+ border-radius: 999px;+}++.token-donut::before {+ content: "";+ position: absolute;+}++.token-donut > div {+ width: 6.15rem;+ height: 6.15rem;+ display: grid;+ place-content: center;+ gap: 0.15rem;+ border-radius: 999px;+ background: #ffffff;+ text-align: center;+ box-shadow: inset 0 0 0 1px var(--line);+}++.token-donut strong {+ color: var(--text);+ font-size: 1.1rem;+ letter-spacing: -0.04em;+}++.token-donut span {+ color: #94a3b8;+ font-size: 0.56rem;+ font-weight: 750;+ letter-spacing: 0.12em;+ text-transform: uppercase;+}++.token-split-legend {+ display: grid;+ gap: 0.7rem;+}++.token-split-legend div {+ display: grid;+ grid-template-columns: minmax(0, 1fr) 2.75rem 4rem;+ align-items: center;+ gap: 0.55rem;+ color: #475569;+ font-size: 0.74rem;+}++.token-split-legend em,+.token-split-legend strong {+ font-style: normal;+ text-align: right;+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;+}++.token-split-legend em {+ color: #94a3b8;+}++.token-split-legend strong {+ color: #1e293b;+}++.breakdown-list {+ display: grid;+ gap: 0.9rem;+ margin-top: 1rem;+}++.breakdown-list button {+ position: relative;+ overflow: hidden;+ display: grid;+ grid-template-columns: minmax(0, 1fr) 2.8rem 4rem;+ align-items: center;+ gap: 0.6rem;+ border: 0;+ border-radius: 0;+ background: transparent;+ box-shadow: none;+ color: #334155;+ font-size: 0.72rem;+ padding: 0 0 0.75rem;+ text-align: left;+}++.breakdown-list button:hover {+ background: transparent;+}++.breakdown-list em {+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ font-style: normal;+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;+ font-weight: 600;+}++.breakdown-list small,+.breakdown-list strong {+ text-align: right;+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;+}++.breakdown-list small {+ color: #94a3b8;+}++.breakdown-list strong {+ color: #1e293b;+}++.breakdown-list b {+ position: absolute;+ bottom: 0;+ left: 0;+ height: 0.36rem;+ border-radius: 999px;+}++.view-toggle {+ display: inline-flex;+ gap: 0.25rem;+ border: 1px solid var(--line);+ border-radius: 12px;+ padding: 0.25rem;+ background: #eef2f7;+ box-shadow: var(--shadow-sm);+}++.view-toggle button {+ border: 0;+ border-radius: 9px;+ background: transparent;+ box-shadow: none;+ color: #374151;+ font-size: 0.85rem;+ font-weight: 700;+ padding: 0.5rem 0.8rem;+}++.view-toggle button.active {+ background: #ffffff;+ color: var(--accent);+ box-shadow: var(--shadow-sm);+}++.activity-view[hidden] {+ display: none;+}++#activity-summary {+ display: grid;+ gap: 1.5rem;+}++#activity-summary[hidden],+#activity-detailed[hidden] {+ display: none;+}++button,+input,+select {+ border-color: var(--line);+ border-radius: 9px;+ background: #ffffff;+ color: var(--text);+ box-shadow: var(--shadow-sm);+ transition: border-color 140ms ease-out, box-shadow 140ms ease-out, background-color 140ms ease-out;+}++button:hover,+select:hover {+ background: var(--panel-soft);+}++button:focus-visible,+input:focus,+select:focus {+ outline: none;+ border-color: var(--accent);+ box-shadow: 0 0 0 3px rgba(3, 106, 162, 0.16);+}++.panel,+.card {+ border-color: var(--line);+ border-radius: 14px;+ background: rgba(255, 255, 255, 0.96);+ box-shadow: var(--shadow-sm);+}++.status-panel,+.search-panel {+ box-shadow: var(--shadow-md);+}++body[data-page="sessions"] .status-panel {+ display: none;+}++body[data-page="sessions"] .search-panel {+ overflow: hidden;+ border-color: rgba(17, 24, 39, 0.1);+ border-radius: 16px;+ background: rgba(255, 255, 255, 0.98);+ padding: 0.75rem;+ box-shadow: 0 16px 42px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.06);+}++body[data-page="sessions"] .search-panel > .section-head {+ padding: 0.1rem 0.25rem 0.75rem;+}++body[data-page="sessions"] .search-form {+ margin: 0;+}++body[data-page="sessions"] .filter-section {+ border: 1px solid rgba(17, 24, 39, 0.08);+ border-radius: 13px;+ background: #ffffff;+ padding: 0.65rem;+}++body[data-page="sessions"] .primary-filters {+ grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));+}++body[data-page="sessions"] .primary-filters select,+body[data-page="sessions"] .advanced-filters input,+body[data-page="sessions"] .advanced-filters select {+ min-height: 2.28rem;+ font-size: 0.75rem;+ font-weight: 650;+}++body[data-page="sessions"] .quick-filters button,+body[data-page="sessions"] .chip,+body[data-page="sessions"] .new-events {+ min-height: 1.85rem;+ border-color: transparent;+ background: #f3f4f6;+ color: #111827;+ font-size: 0.72rem;+ font-weight: 750;+ box-shadow: none;+}++body[data-page="sessions"] .quick-filters button:hover,+body[data-page="sessions"] .chip:hover {+ background: var(--accent-soft);+ color: var(--accent);+}++body[data-page="sessions"] .search-row {+ margin-top: 0.65rem;+}++body[data-page="sessions"] .search-input {+ min-height: 2.55rem;+ border-radius: 10px;+ font-size: 0.78rem;+}++.section-head,+.status-panel {+ align-items: flex-start;+}++.section-actions {+ gap: 0.5rem;+}++.muted {+ color: var(--muted);+}++.docs-link,+.text-button,+.cell-link {+ color: var(--accent);+}++.cards {+ grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));+}++.card {+ min-height: 7.25rem;+ padding: 1rem;+ transition: border-color 140ms ease-out, box-shadow 140ms ease-out, transform 140ms ease-out;+}++button.card:hover {+ border-color: rgba(3, 106, 162, 0.28);+ background: #ffffff;+ box-shadow: var(--shadow-md);+ transform: translateY(-1px);+}++.card .value {+ color: var(--text);+ font-size: 1.95rem;+ font-weight: 720;+ letter-spacing: -0.04em;+}++.card-danger {+ border-color: rgba(185, 28, 28, 0.22);+ background: linear-gradient(180deg, #fff 0%, #fffafa 100%);+}++.card-warn {+ border-color: rgba(146, 64, 14, 0.24);+ background: linear-gradient(180deg, #fff 0%, #fffbeb 100%);+}++.filter-section,+.advanced-filters,+.harness,+.finding-detail,+.finding-detail > td {+ background: var(--panel-soft);+}++.quick-filters button,+.chip,+.badge,+.pill {+ border-color: var(--line);+ background: #ffffff;+ color: #374151;+ font-weight: 600;+}++.badge-ok {+ border-color: #a7f3d0;+ background: #ecfdf5;+ color: var(--ok);+}++.search-input {+ border-radius: 12px;+ border-color: var(--line);+ background: #ffffff;+ box-shadow: var(--shadow-sm);+}++.search-input:focus {+ border-color: var(--accent);+ box-shadow: 0 0 0 3px rgba(3, 106, 162, 0.16);+}++.table-wrap,+.panel > table {+ margin-top: 0.9rem;+}++table {+ border-collapse: separate;+ border-spacing: 0;+}++th,+td {+ border-bottom-color: var(--line);+}++th {+ background: var(--panel-soft);+ color: var(--muted);+ font-size: 0.73rem;+ font-weight: 750;+ letter-spacing: 0.06em;+ text-transform: uppercase;+}++tbody tr:hover {+ background: #f9fafb;+}++body[data-page="inventory"] main {+ max-width: 96rem;+ margin: 0 auto;+ gap: 1.5rem;+ padding-top: calc(var(--topbar-height) + 1.5rem);+}++.inventory-page-head h1 {+ color: var(--text);+ font-size: 1.5rem;+ font-weight: 650;+ letter-spacing: -0.03em;+}++.inventory-workspace {+ display: grid;+ gap: 1.25rem;+}++.inventory-controls {+ display: grid;+ gap: 0.75rem;+ border: 1px solid var(--line);+ border-radius: 14px;+ background: rgba(255, 255, 255, 0.96);+ padding: 0.75rem;+ box-shadow: var(--shadow-sm);+}++.inventory-filter-grid {+ display: grid;+ grid-template-columns: repeat(2, minmax(9rem, 11rem));+ gap: 0.5rem;+}++.inventory-filter-grid select {+ min-height: 2.5rem;+ width: 100%;+ font-size: 0.76rem;+ font-weight: 650;+}++.inventory-search {+ position: relative;+ display: block;+}++.inventory-search input {+ min-height: 2.75rem;+ width: 100%;+ padding-left: 2.6rem;+ font-size: 0.82rem;+}++.inventory-search span {+ text-transform: none;+ letter-spacing: 0;+}++.inventory-controls .inventory-tabs {+ position: static;+ top: auto;+ z-index: auto;+ border: 0;+ border-radius: 0;+ background: transparent;+ padding: 0;+ box-shadow: none;+}++.inventory-tabs button {+ display: inline-flex;+ align-items: center;+ min-height: 2rem;+ border: 1px solid transparent;+ border-radius: 999px;+ background: var(--panel-soft);+ color: #374151;+ font-size: 0.75rem;+ font-weight: 750;+ padding: 0.35rem 0.7rem;+ box-shadow: none;+}++.inventory-tabs button:hover,+.inventory-tabs button.active {+ border-color: rgba(3, 106, 162, 0.22);+ background: var(--accent-soft);+ color: var(--accent);+ box-shadow: var(--shadow-sm);+}++.inventory-table-panel {+ padding: 0;+ overflow: hidden;+ border-radius: 14px;+}++.inventory-table-panel .section-head {+ display: block;+ border-bottom: 1px solid var(--line);+ padding: 1rem 1.25rem;+ text-align: left;+}++.inventory-table-panel .section-head h2 {+ font-size: 0.875rem;+ font-weight: 650;+ letter-spacing: 0;+}++.inventory-table-panel .section-head p {+ margin-top: 0.25rem;+ font-size: 0.75rem;+}++.inventory-table-panel .table-wrap {+ margin-top: 0;+}++.inventory-table-panel th,+.inventory-table-panel td {+ padding: 0.75rem 1rem;+ vertical-align: top;+}++.inventory-table-panel th {+ background: rgba(243, 244, 246, 0.7);+ font-size: 0.72rem;+ font-weight: 650;+ letter-spacing: 0;+ text-transform: none;+}++.inventory-table-panel table {+ font-size: 0.78rem;+}++.inventory-runtime-cell {+ display: inline-flex;+ align-items: center;+ gap: 0.55rem;+ white-space: nowrap;+ font-weight: 650;+}++.inventory-runtime-logo {+ display: inline-flex;+ align-items: center;+ justify-content: center;+ width: 1.75rem;+ height: 1.75rem;+ overflow: hidden;+ border: 1px solid var(--line);+ border-radius: 0.45rem;+ background: #ffffff;+ color: #111827;+ font-size: 0.62rem;+ font-weight: 800;+ letter-spacing: -0.02em;+ box-shadow: var(--shadow-sm);+}++.inventory-runtime-logo img {+ display: block;+ width: 100%;+ height: 100%;+ object-fit: contain;+ padding: 0.18rem;+}++.drawer {+ top: var(--topbar-height);+ background: #ffffff;+ box-shadow: -24px 0 60px rgba(15, 23, 42, 0.14);+}++.drawer-head {+ background: #ffffff;+}++pre {+ color: #111827;+ background: #ffffff;+}++@media (max-width: 980px) {+ body {+ padding-left: 0;+ }++ .topbar {+ position: sticky;+ left: 0;+ height: auto;+ min-height: var(--topbar-height);+ flex-wrap: wrap;+ padding: 1rem;+ }++ .nav-toggle {+ position: static;+ order: 3;+ width: 100%;+ height: auto;+ flex-direction: row;+ overflow-x: auto;+ padding: 0.3rem;+ border: 1px solid var(--line);+ border-radius: 16px;+ background: #eef2f7;+ }++ .nav-search,+ .nav-section-title {+ display: none;+ }++ .nav-section {+ display: contents;+ }++ .nav-toggle::before,+ .nav-toggle::after {+ content: none;+ }++ .nav-toggle a {+ flex: 0 0 auto;+ min-width: max-content;+ padding: 0.6rem 0.8rem;+ }++ .nav-toggle a.active::before {+ content: none;+ }++ main {+ padding-top: 1rem;+ }++ .analytics-grid,+ .token-breakdown-row {+ grid-template-columns: 1fr;+ }+}++@media (max-width: 760px) {+ .topbar,+ .status-panel,+ .section-head {+ align-items: flex-start;+ display: flex;+ flex-direction: column;+ }++ .nav-toggle {+ width: 100%;+ }++ .nav-toggle a {+ min-width: max-content;+ }++ main {+ padding: 1rem;+ }++ .token-split {+ grid-template-columns: 1fr;+ justify-items: center;+ }++ .stacked-chart {+ overflow-x: auto;+ }++ .stacked-chart-column {+ min-width: 4.25rem;+ }++ .inventory-filter-grid {+ grid-template-columns: 1fr;+ }+}diff --git a/cli/beacon/internal/endpoint/dashboard/static/tokens.html b/cli/beacon/internal/endpoint/dashboard/static/tokens.htmlindex 6e4ec2fc..460590d8 100644--- a/cli/beacon/internal/endpoint/dashboard/static/tokens.html+++ b/cli/beacon/internal/endpoint/dashboard/static/tokens.html@@ -10,20 +10,44 @@<header class="topbar"><div><p class="eyebrow">Local-only</p>- <h1>Beacon Endpoint Token Usage</h1>+ <h1>Token Usage</h1></div><nav class="nav-toggle" aria-label="Dashboard navigation">- <a href="/">Log Search</a>- <a href="/overview.html">Security Analytics</a>- <a href="/findings.html">Findings</a>- <a href="/detections.html">Detections</a>- <a href="/inventory.html">Agent Inventory</a>- <a class="active" href="/tokens.html" aria-current="page">Token Usage</a>+ <div class="nav-search" aria-hidden="true">Find...</div>+ <div class="nav-section">+ <div class="nav-section-title">Overview</div>+ <a href="/findings.html">Findings</a>+ </div>+ <div class="nav-section">+ <div class="nav-section-title">Analytics</div>+ <a class="active" aria-current="page" href="/tokens.html">Token Usage</a>+ <a href="/overview.html">Agent Activity</a>+ </div>+ <div class="nav-section">+ <div class="nav-section-title">Observe</div>+ <a href="/inventory.html">Agent Inventory</a>+ <a href="/">Agent Activity Sessions</a>+ </div>+ <div class="nav-section">+ <div class="nav-section-title">Control</div>+ <a href="/detections.html">Detections</a>+ </div></nav><button id="refresh">Refresh</button></header><main>+ <section class="dashboard-hero analytics-hero">+ <div>+ <h2>Token usage analytics</h2>+ <p class="muted">Token consumption, runtime-reported cost, cache usage, and context-window pressure across local AI agents.</p>+ </div>+ <div class="range-pills" aria-label="Local token analytics range">+ <span class="active">Local log</span>+ <span>1h buckets</span>+ </div>+ </section>+<section class="panel status-panel"><div><h2>Endpoint</h2>@@ -42,6 +66,33 @@<div class="cards" id="token-cards"></div></section>+ <section class="analytics-grid token-analytics-grid">+ <div class="analytics-panel">+ <div class="panel-title-row">+ <div>+ <h2>Token throughput</h2>+ <p class="muted">Hourly local usage trend from the runtime log. Bars include input, cache, output, and reasoning tokens when captured.</p>+ </div>+ </div>+ <div class="chart-legend">+ <span><i class="legend-input"></i>Input</span>+ <span><i class="legend-output"></i>Output</span>+ </div>+ <div class="throughput-bars" id="token-throughput"></div>+ </div>+ <div class="analytics-panel">+ <div class="panel-title-row">+ <div>+ <h2>Token split</h2>+ <p class="muted">Fresh input, cached input, output, and reasoning share for the selected local log.</p>+ </div>+ </div>+ <div id="token-split" class="token-split"></div>+ </div>+ </section>++ <section id="token-breakdowns" class="analytics-stack"></section>+<section class="panel"><h2>Context Window Utilization</h2><p class="muted">Input plus cache tokens per call against each model's context window. Unknown models show raw input tokens.</p>