// Kayser v2 — Top bar with status + trust progress launcher. // Plain-English design for non-technical users. function KxV2TopBar({ watching, handledToday, trustPct, trustLevel, onOpenStatus, onOpenTrust, onOpenSettings, onOpenThreads, __hidden, activity }) { if (__hidden) return null; const act = activity || kxv2DefaultActivity(watching, handledToday); return (
{/* Conversations launcher */} {/* Kayser avatar */} {/* Activity block (replaces numeric "Watching X · Handled Y") */} {/* Settings ⋯ */}
{/* Trust progress strip */}
); } // Honest, plain-English status string for what Kayser is doing right now. // Build the top-line "status" copy. ``handledToday == null`` means the // task-completion substrate isn't ready yet (trust v1 fix) — we drop // the "handled X on my own" tail and just talk about what's active. function kxv2DefaultActivity(watching, handledToday) { const handledTail = handledToday == null ? '' : ` · handled ${handledToday} on my own today`; // In production this comes from the Hermes loop state. For the demo, derive a friendly snapshot. if (watching > 8) return { short: 'Watching', color: KX2.warn, detail: `${watching} things on my radar${handledTail}` }; if (watching > 0) return { short: 'Watching', color: KX2.edit, detail: `${watching} active conversation${watching === 1 ? '' : 's'}${handledTail}` }; return { short: 'Quiet', color: KX2.approve, detail: `Nothing needs you right now${handledTail}` }; } // Plain-English trust progress strip. // "I handle X of every 10 things on my own. Approve more and I'll handle more." function KxV2TrustStrip({ pct, onTap, compact }) { // Null / "not yet ready" state — the task-completion substrate // hasn't shipped yet, so showing a percentage would be a lie. // Render a calm placeholder instead. See docs/trust-v2-plan.md. const notReady = pct == null; const outOfTen = Math.round((pct || 0) / 10); const label = notReady ? "Setting up. I'll show your autonomy level here once I've handled work for you." : pct < 25 ? "I ask before everything. Approve me a few times and I'll start handling routine things." : pct < 50 ? `I handle ${outOfTen} of every 10 routine things on my own.` : pct < 75 ? `I handle ${outOfTen} of every 10 things on my own — more if you keep approving.` : "I handle most things on my own. You review the day, not every action."; return ( ); } // Reusable trust ring SVG — kept for the trust sheet's hero gauge function TrustRing({ pct, size = 36, stroke = 3, color = KX2.brand, track = 'rgba(255,255,255,.10)' }) { const r = (size - stroke) / 2; const c = 2 * Math.PI * r; const dash = (Math.max(0, Math.min(100, pct)) / 100) * c; return ( ); } Object.assign(window, { KxV2TopBar, TrustRing, KxV2TrustStrip, kxv2DefaultActivity });