The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.
TypeScript 3d-modelingagent-frameworkagent-harnessai-agentscadclaude-codecodexcoding-agentsdeveloper-toolsesp32game-developmentmcp-servermulti-agentopen-hardwareopencodeopenharnesspcbroboticsterminaltmux
Add the Harness Pulse bar widget for Omarchy
bubu-dudu3cc45a527cb8
diff --git a/integrations/omarchy/harness-pulse/AgentRing.qml b/integrations/omarchy/harness-pulse/AgentRing.qmlnew file mode 100644index 000000000..8bcdd3119--- /dev/null+++ b/integrations/omarchy/harness-pulse/AgentRing.qml@@ -0,0 +1,399 @@+import QtQuick+import QtQuick.Shapes+import QtQuick.Effects+import qs.Commons++// One agent, one ring. Fixed footprint (rings animate in place, never the row).+//+// Every motion is a state, so a glance reads it without the tooltip:+// working comet with a fading trail circles clockwise (the agent is moving)+// waiting yellow halo breathes out from the ring (it wants you, not urgently)+// permission red strobe burst plus a chromatic glitch, repeating (it is blocked on you)+// failed one strobe and glitch burst on entry, then a steady thin red ring with a+// small glitch tick every 6 s (still broken, not shouting)+// done the core fills with a burst and a shockwave ring, then holds still+// offline dim dashed ring, no motion+// idle the ring shrinks to a dot, no motion+// Animators run on the render thread; nothing repaints per frame on the GUI thread and nothing+// runs in idle, offline or a settled done ring.+Item {+ id: ring++ property var agent: ({})+ property int size: 18+ property bool reducedMotion: false+ property var theme: ({})+ property bool showGlyph: reducedMotion+ // A picture of the person the agent is waiting on, shown inside the ring only while the agent+ // waits or needs permission. If the picture is missing or unreadable, avatarInitials shows+ // instead; both empty means a plain ring.+ property string avatarPath: ""+ property string avatarInitials: ""+ /** Working ring colour: "Accent" (theme accent), "Cyan" or "Green". */+ property string workingColor: "Accent"++ readonly property string state: agent && agent.state ? agent.state : "idle"+ // Spend as a fraction of the per-agent cap, or -1 when no cap is set: drawn as the outer arc.+ readonly property real spendFraction: agent && agent.spend && agent.spend.fraction !== null && agent.spend.fraction !== undefined ? Number(agent.spend.fraction) : -1+ readonly property bool hasSpend: spendFraction >= 0+ readonly property bool waitingOnPerson: state === "waiting" || state === "permission"+ readonly property bool avatarReady: avatarPath !== "" && avatar.status === Image.Ready+ readonly property bool showAvatar: waitingOnPerson && (avatarReady || avatarInitials !== "")+ readonly property bool motion: !reducedMotion+ readonly property color accent: Color.accent+ readonly property color urgent: theme.yellow ? theme.yellow : Color.urgent+ readonly property color danger: theme.red ? theme.red : Color.urgent+ readonly property color okay: theme.green ? theme.green : Color.accent+ readonly property color glitchA: theme.cyan ? theme.cyan : accent+ readonly property color glitchB: theme.magenta ? theme.magenta : danger+ readonly property color dim: Qt.rgba(Color.foreground.r, Color.foreground.g, Color.foreground.b, 0.28)++ readonly property color stateColor: {+ switch (state) {+ case "working": return workingColor === "Cyan" ? "#22d3ee" : workingColor === "Green" ? okay : accent+ case "waiting": return urgent+ case "permission": return danger+ case "failed": return danger+ case "done": return okay+ case "offline": return dim+ default: return Qt.rgba(Color.foreground.r, Color.foreground.g, Color.foreground.b, 0.55)+ }+ }++ readonly property real lineWidth: state === "failed" ? 1.5 : 2.2+ // The outer edge belongs to the spend arc when a cap is set; the state ring sits one line in.+ readonly property real ringDiameter: size - (hasSpend ? 4.4 : 1.0)++ // Idle shrinks to a dot; waiting and permission breathe. Scale only, never width.+ property real breath: 1.0+ readonly property real coreScale: state === "idle" ? 0.42 : breath+ property real fill: state === "done" ? 1.0 : 0.0+ property real flash: 1.0++ width: size+ height: size++ Behavior on fill { NumberAnimation { duration: ring.motion ? 420 : 0; easing.type: Easing.OutBack } }++ SequentialAnimation on breath {+ running: ring.motion && ring.waitingOnPerson+ loops: Animation.Infinite+ NumberAnimation { from: 1.0; to: 1.08; duration: 600; easing.type: Easing.InOutSine }+ NumberAnimation { from: 1.08; to: 1.0; duration: 600; easing.type: Easing.InOutSine }+ onRunningChanged: if (!running) ring.breath = 1.0+ }++ onStateChanged: {+ if (!motion) return+ if (state === "failed") failBurst.restart()+ else if (state === "done") doneBurst.restart()+ }++ // ---- Waiting / permission halo: a soft disc that breathes outward behind the ring. ----+ Rectangle {+ id: halo+ anchors.centerIn: parent+ width: ring.size; height: ring.size; radius: width / 2+ color: Qt.rgba(ring.stateColor.r, ring.stateColor.g, ring.stateColor.b, 0.35)+ visible: ring.motion && ring.waitingOnPerson+ opacity: 0+ scale: 1+ SequentialAnimation {+ running: halo.visible+ loops: Animation.Infinite+ ParallelAnimation {+ ScaleAnimator { target: halo; from: 0.7; to: 1.3; duration: 1200; easing.type: Easing.OutSine }+ OpacityAnimator { target: halo; from: 0.8; to: 0.0; duration: 1200; easing.type: Easing.OutSine }+ }+ PauseAnimation { duration: ring.state === "permission" ? 200 : 600 }+ }+ }++ // ---- Strobe: a hard red flash disc (permission repeats it, failed fires it once). ----+ Rectangle {+ id: strobe+ anchors.centerIn: parent+ width: ring.size; height: ring.size; radius: width / 2+ color: ring.danger+ opacity: 0+ visible: ring.motion && (ring.state === "permission" || ring.state === "failed")+ }++ // ---- Chromatic glitch ghosts: two offset copies of the ring in cyan and magenta. ----+ Rectangle {+ id: ghostA+ anchors.centerIn: parent+ transform: Translate { id: ghostAShift; x: 0 }+ width: ring.ringDiameter; height: width; radius: width / 2+ color: "transparent"+ border.width: ring.lineWidth+ border.color: ring.glitchA+ opacity: 0+ visible: strobe.visible+ }+ Rectangle {+ id: ghostB+ anchors.centerIn: parent+ transform: Translate { id: ghostBShift; x: 0 }+ width: ring.ringDiameter; height: width; radius: width / 2+ color: "transparent"+ border.width: ring.lineWidth+ border.color: ring.glitchB+ opacity: 0+ visible: strobe.visible+ }++ // One chromatic glitch: ghosts split left and right, the core jitters, all snap back (90 ms).+ SequentialAnimation {+ id: glitch+ PropertyAction { target: ghostA; property: "opacity"; value: 0.85 }+ PropertyAction { target: ghostB; property: "opacity"; value: 0.85 }+ PropertyAction { target: ghostAShift; property: "x"; value: -1.5 }+ PropertyAction { target: ghostBShift; property: "x"; value: 1.5 }+ PropertyAction { target: coreShift; property: "x"; value: 1 }+ PauseAnimation { duration: 50 }+ PropertyAction { target: ghostAShift; property: "x"; value: 1 }+ PropertyAction { target: ghostBShift; property: "x"; value: -1 }+ PropertyAction { target: coreShift; property: "x"; value: -1 }+ PauseAnimation { duration: 40 }+ PropertyAction { target: coreShift; property: "x"; value: 0 }+ PropertyAction { target: ghostA; property: "opacity"; value: 0 }+ PropertyAction { target: ghostB; property: "opacity"; value: 0 }+ }++ // Permission: three strobes and a glitch, every 1.6 s, until someone answers.+ SequentialAnimation {+ running: ring.motion && ring.state === "permission"+ loops: Animation.Infinite+ OpacityAnimator { target: strobe; from: 0; to: 0.9; duration: 50 }+ OpacityAnimator { target: strobe; from: 0.9; to: 0; duration: 90 }+ OpacityAnimator { target: strobe; from: 0; to: 0.9; duration: 50 }+ OpacityAnimator { target: strobe; from: 0.9; to: 0; duration: 90 }+ OpacityAnimator { target: strobe; from: 0; to: 0.9; duration: 50 }+ OpacityAnimator { target: strobe; from: 0.9; to: 0; duration: 90 }+ ScriptAction { script: glitch.restart() }+ PauseAnimation { duration: 1180 }+ }++ // Failed: two flashes and a glitch on entry, then only a glitch tick every 6 s.+ SequentialAnimation {+ id: failBurst+ OpacityAnimator { target: strobe; from: 0; to: 0.9; duration: 50 }+ OpacityAnimator { target: strobe; from: 0.9; to: 0; duration: 90 }+ PauseAnimation { duration: 80 }+ OpacityAnimator { target: strobe; from: 0; to: 0.9; duration: 50 }+ OpacityAnimator { target: strobe; from: 0.9; to: 0; duration: 90 }+ ScriptAction { script: glitch.restart() }+ }+ SequentialAnimation {+ running: ring.motion && ring.state === "failed"+ loops: Animation.Infinite+ PauseAnimation { duration: 6000 }+ ScriptAction { script: glitch.restart() }+ }++ // ---- Done: shockwave ring expands once as the core fills. ----+ Rectangle {+ id: shockwave+ anchors.centerIn: parent+ width: ring.size; height: ring.size; radius: width / 2+ color: "transparent"+ border.width: 1.5+ border.color: ring.okay+ opacity: 0+ visible: ring.motion+ }+ ParallelAnimation {+ id: doneBurst+ ScaleAnimator { target: shockwave; from: 0.5; to: 1.35; duration: 520; easing.type: Easing.OutCubic }+ OpacityAnimator { target: shockwave; from: 1.0; to: 0.0; duration: 520; easing.type: Easing.OutCubic }+ }++ // ---- Spend arc: the outer edge, 0 to 100 percent of the cap. Amber at 80, red at the cap. ----+ Shape {+ id: spendShape+ anchors.fill: parent+ visible: ring.hasSpend+ preferredRendererType: Shape.CurveRenderer+ property real sweep: Math.min(1, Math.max(0, ring.spendFraction)) * 360+ Behavior on sweep { NumberAnimation { duration: ring.motion ? 700 : 0; easing.type: Easing.OutCubic } }+ ShapePath {+ strokeWidth: 1.2+ strokeColor: Qt.rgba(Color.foreground.r, Color.foreground.g, Color.foreground.b, 0.12)+ fillColor: "transparent"+ PathAngleArc { centerX: ring.size / 2; centerY: ring.size / 2; radiusX: ring.size / 2 - 0.7; radiusY: radiusX; startAngle: 0; sweepAngle: 360 }+ }+ ShapePath {+ strokeWidth: 1.2+ capStyle: ShapePath.RoundCap+ fillColor: "transparent"+ strokeColor: ring.spendFraction >= 1 ? ring.danger : ring.spendFraction >= 0.8 ? ring.urgent : Qt.rgba(ring.accent.r, ring.accent.g, ring.accent.b, 0.85)+ PathAngleArc { centerX: ring.size / 2; centerY: ring.size / 2; radiusX: ring.size / 2 - 0.7; radiusY: radiusX; startAngle: -90; sweepAngle: spendShape.sweep }+ }+ }++ // ---- The state ring itself. ----+ Item {+ id: core+ anchors.centerIn: parent+ transform: Translate { id: coreShift; x: 0 }+ width: ring.ringDiameter+ height: ring.ringDiameter+ scale: ring.coreScale+ opacity: ring.flash+ Behavior on scale { enabled: ring.motion && !ring.waitingOnPerson; NumberAnimation { duration: 260; easing.type: Easing.OutCubic } }++ // Base ring. Working dims it so the comet reads; offline dashes it.+ Rectangle {+ anchors.fill: parent+ radius: width / 2+ color: "transparent"+ visible: ring.state !== "offline"+ border.width: ring.lineWidth+ border.color: ring.state === "working"+ ? Qt.rgba(ring.stateColor.r, ring.stateColor.g, ring.stateColor.b, ring.motion ? 0.22 : 1.0)+ : ring.stateColor+ Behavior on border.color { ColorAnimation { duration: ring.motion ? 220 : 0 } }+ }+ Shape {+ anchors.fill: parent+ visible: ring.state === "offline"+ preferredRendererType: Shape.CurveRenderer+ ShapePath {+ strokeWidth: 1.2+ strokeColor: ring.dim+ fillColor: "transparent"+ strokeStyle: ShapePath.DashLine+ dashPattern: [1.5, 2]+ PathAngleArc { centerX: core.width / 2; centerY: core.height / 2; radiusX: core.width / 2 - 0.6; radiusY: radiusX; startAngle: 0; sweepAngle: 360 }+ }+ }++ // Working: a comet head with a fading trail, rotating on the render thread.+ Item {+ id: comet+ anchors.fill: parent+ visible: ring.motion && ring.state === "working"+ RotationAnimator on rotation {+ running: comet.visible+ loops: Animation.Infinite+ from: 0; to: 360; duration: 1800+ }+ Shape {+ anchors.fill: parent+ preferredRendererType: Shape.CurveRenderer+ id: cometShape+ readonly property real cr: comet.width / 2 - ring.lineWidth / 2+ ShapePath {+ strokeWidth: ring.lineWidth; fillColor: "transparent"; capStyle: ShapePath.FlatCap+ strokeColor: Qt.rgba(ring.accent.r, ring.accent.g, ring.accent.b, 0.12)+ PathAngleArc { centerX: comet.width / 2; centerY: comet.height / 2; radiusX: cometShape.cr; radiusY: cometShape.cr; startAngle: -210; sweepAngle: 40 }+ }+ ShapePath {+ strokeWidth: ring.lineWidth; fillColor: "transparent"; capStyle: ShapePath.FlatCap+ strokeColor: Qt.rgba(ring.accent.r, ring.accent.g, ring.accent.b, 0.3)+ PathAngleArc { centerX: comet.width / 2; centerY: comet.height / 2; radiusX: cometShape.cr; radiusY: cometShape.cr; startAngle: -170; sweepAngle: 30 }+ }+ ShapePath {+ strokeWidth: ring.lineWidth; fillColor: "transparent"; capStyle: ShapePath.FlatCap+ strokeColor: Qt.rgba(ring.accent.r, ring.accent.g, ring.accent.b, 0.6)+ PathAngleArc { centerX: comet.width / 2; centerY: comet.height / 2; radiusX: cometShape.cr; radiusY: cometShape.cr; startAngle: -140; sweepAngle: 25 }+ }+ ShapePath {+ strokeWidth: ring.lineWidth; fillColor: "transparent"; capStyle: ShapePath.RoundCap+ strokeColor: ring.accent+ PathAngleArc { centerX: comet.width / 2; centerY: comet.height / 2; radiusX: cometShape.cr; radiusY: cometShape.cr; startAngle: -115; sweepAngle: 25 }+ }+ }+ // Bright head at 12 o'clock with a glow, so the leading edge is unmistakable.+ Rectangle {+ width: ring.lineWidth + 1.6; height: width; radius: width / 2+ x: comet.width / 2 - width / 2+ y: ring.lineWidth / 2 - height / 2+ color: Qt.lighter(ring.accent, 1.5)+ layer.enabled: true+ layer.effect: MultiEffect { shadowEnabled: true; shadowColor: ring.accent; shadowBlur: 0.6; shadowHorizontalOffset: 0; shadowVerticalOffset: 0 }+ }+ }+ // Reduced motion working: a static half arc so the state still reads.+ Shape {+ anchors.fill: parent+ visible: !ring.motion && ring.state === "working"+ preferredRendererType: Shape.CurveRenderer+ ShapePath {+ strokeWidth: ring.lineWidth; fillColor: "transparent"+ strokeColor: ring.accent+ PathAngleArc { centerX: core.width / 2; centerY: core.height / 2; radiusX: core.width / 2 - ring.lineWidth / 2; radiusY: radiusX; startAngle: -90; sweepAngle: 180 }+ }+ }++ // Done: the core fills to a solid dot.+ Rectangle {+ anchors.centerIn: parent+ width: parent.width; height: parent.height; radius: width / 2+ color: ring.okay+ scale: ring.fill+ visible: ring.fill > 0.01+ }+ }++ // The face of the person being waited on, round-masked inside the ring. Fades in and out; the+ // ring itself is unchanged so the footprint never moves.+ Item {+ id: avatarHolder+ anchors.centerIn: parent+ width: ring.size - 6+ height: ring.size - 6+ visible: opacity > 0+ opacity: ring.showAvatar ? 1.0 : 0.0+ scale: ring.breath+ Behavior on opacity { NumberAnimation { duration: ring.reducedMotion ? 0 : 220 } }+ Image {+ id: avatar+ anchors.fill: parent+ source: ring.avatarPath !== "" ? "file://" + ring.avatarPath : ""+ fillMode: Image.PreserveAspectCrop+ asynchronous: true+ cache: true+ visible: false+ }+ Rectangle {+ id: avatarMask+ anchors.fill: parent+ radius: width / 2+ color: "white"+ visible: false+ layer.enabled: true+ }+ MultiEffect {+ anchors.fill: parent+ visible: ring.avatarReady+ source: avatar+ maskEnabled: true+ maskSource: avatarMask+ }+ // Fallback: initials on a disc in the state colour.+ Rectangle {+ anchors.fill: parent+ radius: width / 2+ visible: !ring.avatarReady+ color: Qt.rgba(ring.stateColor.r, ring.stateColor.g, ring.stateColor.b, 0.85)+ Text {+ anchors.centerIn: parent+ text: ring.avatarInitials+ color: Color.background+ font.pixelSize: Math.max(6, parent.height * (ring.avatarInitials.length > 1 ? 0.48 : 0.62))+ font.bold: true+ }+ }+ }++ Text {+ anchors.centerIn: parent+ visible: ring.showGlyph && !ring.showAvatar+ text: ring.agent && ring.agent.glyph ? ring.agent.glyph : ""+ color: ring.state === "done" ? Color.background : ring.stateColor+ font.pixelSize: Math.max(8, ring.size * 0.55)+ font.bold: true+ }+}diff --git a/integrations/omarchy/harness-pulse/FleetView.qml b/integrations/omarchy/harness-pulse/FleetView.qmlnew file mode 100644index 000000000..aeaf19547--- /dev/null+++ b/integrations/omarchy/harness-pulse/FleetView.qml@@ -0,0 +1,682 @@+pragma ComponentBehavior: Bound+import QtQuick+import QtQuick.Shapes+import QtQuick.Effects+import qs.Commons+import "Model.js" as Model++// The popup: a live fleet view. Fixed size; nothing in here scrolls except the bounded activity+// ticker, which scrolls in place. Every animation answers a question:+// orbit turning something on that machine is working (stops when nothing is)+// hub glow and tether something on that machine needs you+// spend gauges sweeping how much of each agent's cap is used (redrawn from zero on open)+// triangle pulsing two agents touched the same file, folder or branch inside the hour+// ticker slide-in what just changed, newest on top+// hexagon charging how far through the 2 s hold-to-stop you are+// All motion stops while the popup is closed, and reducedMotion freezes it (values still show).+Item {+ id: fleet++ property var agents: []+ property var alerts: []+ property var subs: []+ property string subsPick: ""+ property string hostname: ""+ property bool daemonUp: false+ property bool active: false+ property bool reducedMotion: false+ property string workingColor: "Accent"+ property var theme: ({})+ property string lastStop: ""+ property string logoMode: "Harness" // Omarchy, Harness, Custom or None+ property string logoPath: ""+ property int nowMs: Date.now()+ signal stopAllRequested()++ readonly property bool motion: active && !reducedMotion+ readonly property color accent: Color.accent+ readonly property color fg: Color.foreground+ readonly property color urgent: theme.yellow ? theme.yellow : Color.urgent+ readonly property color danger: theme.red ? theme.red : Color.urgent+ readonly property color okay: theme.green ? theme.green : Color.accent+ readonly property color faint: Qt.rgba(fg.r, fg.g, fg.b, 0.14)+ readonly property color muted: Qt.rgba(fg.r, fg.g, fg.b, 0.55)+ readonly property var groups: Model.groupByMachine(agents, hostname).slice(0, 3)+ readonly property var counts: Model.stateCounts(agents)++ function colorFor(state) {+ switch (state) {+ case "working": return accent+ case "waiting": return urgent+ case "permission": return danger+ case "failed": return danger+ case "done": return okay+ case "offline": return Qt.rgba(fg.r, fg.g, fg.b, 0.28)+ default: return muted+ }+ }+ function hexPoints(cx, cy, r) {+ var pts = []+ for (var i = 0; i <= 6; i++) {+ var a = Math.PI / 180 * (60 * i - 90)+ pts.push(Qt.point(cx + r * Math.cos(a), cy + r * Math.sin(a)))+ }+ return pts+ }++ // Spend gauges redraw from zero each time the popup opens, so the quantity is drawn, not stamped.+ property bool revealed: false+ onActiveChanged: {+ revealed = false+ if (active) revealTimer.restart()+ }+ Timer { id: revealTimer; interval: 60; onTriggered: fleet.revealed = true }++ implicitWidth: 480+ implicitHeight: column.implicitHeight++ // Faint scanlines on the orbit field only (idle texture, never over text), 8 percent.+ Column {+ id: column+ width: parent.width+ spacing: 10++ // ---------------- Header: title, daemon, state chips, collision badge ----------------+ Item {+ width: parent.width+ height: 26+ Row {+ anchors.verticalCenter: parent.verticalCenter+ spacing: 8+ Text {+ text: fleet.daemonUp ? "⬡" : "⬢"+ color: fleet.daemonUp ? fleet.accent : fleet.muted+ font.pixelSize: 18+ anchors.verticalCenter: parent.verticalCenter+ }+ Column {+ anchors.verticalCenter: parent.verticalCenter+ Text { text: "HARNESS FLEET"; color: fleet.fg; font.pixelSize: 11; font.bold: true; font.letterSpacing: 2 }+ Text {+ text: fleet.daemonUp ? (fleet.agents.length + " agents on " + fleet.groups.length + " machine" + (fleet.groups.length === 1 ? "" : "s")) : "daemon not running"+ color: fleet.muted; font.pixelSize: 10+ }+ }+ }+ Row {+ anchors.right: badge.left+ anchors.rightMargin: 10+ anchors.verticalCenter: parent.verticalCenter+ spacing: 6+ Repeater {+ model: ["permission", "waiting", "failed", "working", "done"]+ delegate: Rectangle {+ id: chip+ required property string modelData+ readonly property int n: fleet.counts[chip.modelData] || 0+ height: 18+ width: chipText.implicitWidth + 12+ radius: 9+ color: chip.n > 0 ? Qt.rgba(fleet.colorFor(chip.modelData).r, fleet.colorFor(chip.modelData).g, fleet.colorFor(chip.modelData).b, 0.16) : "transparent"+ border.width: 1+ border.color: chip.n > 0 ? fleet.colorFor(chip.modelData) : fleet.faint+ Text {+ id: chipText+ anchors.centerIn: parent+ text: Model.glyphFor(chip.modelData) + " " + chip.n+ color: chip.n > 0 ? fleet.colorFor(chip.modelData) : fleet.muted+ font.pixelSize: 10+ font.bold: chip.n > 0+ }+ }+ }+ }+ // Collision badge: a red triangle that pulses while an alert is live. Its slot is always+ // reserved so the header never shifts; with no alert it is a faint outline.+ Item {+ id: badge+ anchors.right: parent.right+ anchors.verticalCenter: parent.verticalCenter+ width: 26; height: 24+ readonly property bool live: fleet.alerts.length > 0+ Shape {+ id: tri+ anchors.fill: parent+ preferredRendererType: Shape.CurveRenderer+ transformOrigin: Item.Center+ ShapePath {+ strokeWidth: 1.6+ joinStyle: ShapePath.RoundJoin+ strokeColor: badge.live ? fleet.danger : fleet.faint+ fillColor: badge.live ? Qt.rgba(fleet.danger.r, fleet.danger.g, fleet.danger.b, 0.25) : "transparent"+ PathPolyline { path: [Qt.point(13, 2), Qt.point(24.5, 22), Qt.point(1.5, 22), Qt.point(13, 2)] }+ }+ }+ Rectangle {+ id: triGlow+ anchors.centerIn: parent+ width: 30; height: 30; radius: 15+ color: "transparent"+ border.width: 2+ border.color: fleet.danger+ opacity: 0+ visible: badge.live && fleet.motion+ }+ SequentialAnimation {+ running: badge.live && fleet.motion+ loops: Animation.Infinite+ ParallelAnimation {+ ScaleAnimator { target: tri; from: 1.0; to: 1.15; duration: 240; easing.type: Easing.OutQuad }+ ScaleAnimator { target: triGlow; from: 0.6; to: 1.4; duration: 700; easing.type: Easing.OutCubic }+ OpacityAnimator { target: triGlow; from: 0.9; to: 0; duration: 700; easing.type: Easing.OutCubic }+ }+ ScaleAnimator { target: tri; from: 1.15; to: 1.0; duration: 300; easing.type: Easing.InOutQuad }+ PauseAnimation { duration: 600 }+ onRunningChanged: if (!running) tri.scale = 1+ }+ Text {+ anchors.horizontalCenter: parent.horizontalCenter+ y: 9+ text: badge.live ? String(fleet.alerts.length) : "△"+ visible: badge.live+ color: fleet.fg+ font.pixelSize: 10+ font.bold: true+ }+ }+ }++ // ---------------- Orbit field: one hub per machine, agents in orbit ----------------+ Rectangle {+ id: field+ width: parent.width+ height: 176+ radius: 10+ color: Qt.rgba(fleet.fg.r, fleet.fg.g, fleet.fg.b, 0.03)+ border.width: 1+ border.color: fleet.faint+ clip: true++ // Scanlines: 8 percent, static, never over text (the machine label sits below the lines' tile).+ Column {+ anchors.fill: parent+ opacity: 0.08+ spacing: 3+ Repeater {+ model: Math.floor(field.height / 3)+ delegate: Rectangle { width: field.width; height: 1; color: fleet.accent }+ }+ }++ // Idle / connecting: the chosen logo and one line of status. While the daemon is down the logo+ // breathes (still trying); with the daemon up and no agents it holds still (nothing to do).+ Column {+ anchors.centerIn: parent+ spacing: 10+ visible: fleet.groups.length === 0+ Item {+ id: logoBox+ anchors.horizontalCenter: parent.horizontalCenter+ // A wordmark gets a wide box, the hexagon a square one; the column height stays the same.+ width: imageOk ? 200 : 64; height: 64+ visible: fleet.logoMode !== "None"+ readonly property string imagePath: fleet.logoMode === "Omarchy" ? "/usr/share/omarchy/logo.svg"+ : fleet.logoMode === "Custom" ? fleet.logoPath : ""+ readonly property bool imageOk: logoImage.status === Image.Ready+ opacity: 0.85+ SequentialAnimation on opacity {+ running: fleet.motion && !fleet.daemonUp && logoBox.visible+ loops: Animation.Infinite+ NumberAnimation { from: 0.85; to: 0.3; duration: 1200; easing.type: Easing.InOutSine }+ NumberAnimation { from: 0.3; to: 0.85; duration: 1200; easing.type: Easing.InOutSine }+ onRunningChanged: if (!running) logoBox.opacity = 0.85+ }+ Image {+ id: logoImage+ anchors.fill: parent+ source: logoBox.imagePath !== "" ? "file://" + logoBox.imagePath : ""+ sourceSize.width: 400; sourceSize.height: 128+ fillMode: Image.PreserveAspectFit+ asynchronous: true+ visible: false+ }+ MultiEffect {+ anchors.fill: parent+ source: logoImage+ visible: logoBox.imageOk+ // Tint to the theme so the Omarchy mark follows the palette like everything else.+ brightness: fleet.logoMode === "Omarchy" ? 1.0 : 0.0+ colorization: fleet.logoMode === "Omarchy" ? 1.0 : 0.0+ colorizationColor: fleet.accent+ }+ // Harness mark (and the fallback when an image logo cannot be read): a drawn hexagon.+ Shape {+ anchors.fill: parent+ visible: !logoBox.imageOk+ preferredRendererType: Shape.CurveRenderer+ ShapePath {+ strokeWidth: 2.5+ joinStyle: ShapePath.RoundJoin+ strokeColor: fleet.accent+ fillColor: "transparent"+ PathPolyline { path: fleet.hexPoints(logoBox.width / 2, 32, 28) }+ }+ ShapePath {+ strokeWidth: 1.2+ joinStyle: ShapePath.RoundJoin+ strokeColor: Qt.rgba(fleet.accent.r, fleet.accent.g, fleet.accent.b, 0.5)+ fillColor: Qt.rgba(fleet.accent.r, fleet.accent.g, fleet.accent.b, 0.12)+ PathPolyline { path: fleet.hexPoints(logoBox.width / 2, 32, 16) }+ }+ }+ }+ Text {+ anchors.horizontalCenter: parent.horizontalCenter+ text: fleet.daemonUp ? "No agents. Nothing is moving, so nothing animates." : "Connecting to the Harness daemon..."+ color: fleet.muted+ font.pixelSize: 11+ }+ }++ Row {+ anchors.centerIn: parent+ spacing: 4+ Repeater {+ model: fleet.groups+ delegate: Item {+ id: tile+ required property var modelData+ readonly property var group: modelData+ readonly property int n: Math.min(8, group.agents.length)+ width: Math.min(156, (field.width - 16) / Math.max(1, fleet.groups.length))+ height: field.height+ readonly property real cx: width / 2+ readonly property real cy: 78+ readonly property real orbitR: 56++ // Orbit angle. Turns only while something on this machine works (one turn per 24 s).+ property real angle: 0+ NumberAnimation on angle {+ running: fleet.motion && tile.group.working+ loops: Animation.Infinite+ from: 0; to: 360; duration: 24000+ }++ // Orbit track, dashed.+ Shape {+ anchors.fill: parent+ preferredRendererType: Shape.CurveRenderer+ ShapePath {+ strokeWidth: 1+ strokeColor: tile.group.working ? Qt.rgba(fleet.accent.r, fleet.accent.g, fleet.accent.b, 0.35) : fleet.faint+ fillColor: "transparent"+ strokeStyle: ShapePath.DashLine+ dashPattern: [2, 4]+ PathAngleArc { centerX: tile.cx; centerY: tile.cy; radiusX: tile.orbitR; radiusY: tile.orbitR; startAngle: 0; sweepAngle: 360 }+ }+ }++ // Tethers from the hub to every agent that needs a person: they breathe with the hub.+ Repeater {+ model: tile.n+ delegate: Shape {+ id: tether+ required property int index+ readonly property var a: tile.group.agents[index]+ readonly property real rad: Math.PI / 180 * (tile.angle + index * 360 / tile.n - 90)+ anchors.fill: parent+ visible: a && (a.state === "waiting" || a.state === "permission" || a.state === "failed")+ opacity: hubGlow.opacity * 0.9 + 0.25+ preferredRendererType: Shape.CurveRenderer+ ShapePath {+ strokeWidth: 1.2+ strokeColor: fleet.colorFor(tether.a ? tether.a.state : "idle")+ fillColor: "transparent"+ startX: tile.cx; startY: tile.cy+ PathLine { x: tile.cx + (tile.orbitR - 10) * Math.cos(tether.rad); y: tile.cy + (tile.orbitR - 10) * Math.sin(tether.rad) }+ }+ }+ }++ // Hub: a hexagon for the machine. Glows (urgency) when anything on it needs you.+ Rectangle {+ id: hubGlow+ x: tile.cx - 30; y: tile.cy - 30+ width: 60; height: 60; radius: 30+ color: Qt.rgba(fleet.urgent.r, fleet.urgent.g, fleet.urgent.b, 0.22)+ visible: tile.group.needsYou+ opacity: 0.5+ SequentialAnimation on opacity {+ running: fleet.motion && tile.group.needsYou+ loops: Animation.Infinite+ NumberAnimation { from: 0.25; to: 0.9; duration: 900; easing.type: Easing.InOutSine }+ NumberAnimation { from: 0.9; to: 0.25; duration: 900; easing.type: Easing.InOutSine }+ }+ layer.enabled: visible+ layer.effect: MultiEffect { blurEnabled: true; blur: 0.8; blurMax: 24 }+ }+ Shape {+ anchors.fill: parent+ preferredRendererType: Shape.CurveRenderer+ ShapePath {+ strokeWidth: 1.8+ joinStyle: ShapePath.RoundJoin+ strokeColor: tile.group.needsYou ? fleet.urgent : fleet.accent+ fillColor: Qt.rgba(Color.background.r, Color.background.g, Color.background.b, 0.9)+ PathPolyline { path: fleet.hexPoints(tile.cx, tile.cy, 24) }+ }+ }+ Text {+ x: tile.cx - width / 2; y: tile.cy - height / 2+ width: 44+ horizontalAlignment: Text.AlignHCenter+ elide: Text.ElideMiddle+ text: tile.group.machine+ color: fleet.fg+ font.pixelSize: tile.group.machine.length > 7 ? 8 : 10+ font.bold: tile.group.machine === fleet.hostname+ }++ // Agent nodes: the same ring as the bar, upright, riding the orbit.+ Repeater {+ model: tile.n+ delegate: AgentRing {+ required property int index+ readonly property real rad: Math.PI / 180 * (tile.angle + index * 360 / tile.n - 90)+ size: 20+ x: tile.cx + tile.orbitR * Math.cos(rad) - width / 2+ y: tile.cy + tile.orbitR * Math.sin(rad) - height / 2+ agent: tile.group.agents[index] || ({})+ reducedMotion: !fleet.motion+ showGlyph: !fleet.motion+ theme: fleet.theme+ workingColor: fleet.workingColor+ }+ }++ Text {+ anchors.horizontalCenter: parent.horizontalCenter+ anchors.bottom: parent.bottom+ anchors.bottomMargin: 4+ text: tile.group.agents.length + " agent" + (tile.group.agents.length === 1 ? "" : "s")+ color: fleet.muted+ font.pixelSize: 10+ }+ }+ }+ }+ }++ // ---------------- Subscriptions: weekly use per plan, banked below (harness subs) ----------------+ Item {+ width: parent.width+ height: 82+ Text {+ id: spendLabel+ text: "THIS WEEK"+ color: fleet.muted+ font.pixelSize: 9; font.bold: true; font.letterSpacing: 2+ }+ Text {+ anchors.left: spendLabel.right; anchors.leftMargin: 8+ visible: gaugeRow.count === 0+ text: "no subscriptions detected"+ color: fleet.muted+ font.pixelSize: 10+ }+ Row {+ y: 14+ spacing: 6+ Repeater {+ id: gaugeRow+ model: fleet.subs.slice(0, 8)+ delegate: Item {+ id: gauge+ required property var modelData+ readonly property real f: Math.max(0, Number(modelData.used) || 0)+ readonly property real banked: Number(modelData.banked) || 0+ // Over pace (negative banked) is the warning, not raw use: 60 percent used on day six is fine.+ readonly property color tone: f >= 1 ? fleet.danger : banked < -0.1 ? fleet.danger : banked < 0 ? fleet.urgent : fleet.accent+ width: 64; height: 68+ property real shown: fleet.revealed ? Math.min(1, f) : 0+ Behavior on shown { NumberAnimation { duration: fleet.motion ? 900 : 0; easing.type: Easing.OutCubic } }+ Shape {+ id: gaugeShape+ width: 40; height: 40+ anchors.horizontalCenter: parent.horizontalCenter+ preferredRendererType: Shape.CurveRenderer+ ShapePath {+ strokeWidth: 4; capStyle: ShapePath.RoundCap; fillColor: "transparent"+ strokeColor: fleet.faint+ PathAngleArc { centerX: 20; centerY: 20; radiusX: 17; radiusY: 17; startAngle: 135; sweepAngle: 270 }+ }+ ShapePath {+ strokeWidth: 4; capStyle: ShapePath.RoundCap; fillColor: "transparent"+ strokeColor: gauge.tone+ PathAngleArc { centerX: 20; centerY: 20; radiusX: 17; radiusY: 17; startAngle: 135; sweepAngle: Math.max(0.1, 270 * gauge.shown) }+ }+ }+ // At or over the cap the gauge pulses once per second (the brake is on).+ Rectangle {+ anchors.centerIn: gaugeShape+ width: 40; height: 40; radius: 20+ color: "transparent"; border.width: 2; border.color: fleet.danger+ visible: gauge.f >= 1+ opacity: 0.2+ SequentialAnimation on opacity {+ running: fleet.motion && gauge.f >= 1+ loops: Animation.Infinite+ NumberAnimation { from: 0.9; to: 0.0; duration: 1000; easing.type: Easing.OutCubic }+ }+ }+ Text {+ anchors.centerIn: gaugeShape+ text: Math.round(gauge.f * 100) + "%"+ color: gauge.tone+ font.pixelSize: 9; font.bold: true+ }+ Text {+ anchors.horizontalCenter: parent.horizontalCenter+ anchors.bottom: parent.bottom+ width: parent.width+ horizontalAlignment: Text.AlignHCenter+ elide: Text.ElideRight+ text: (fleet.subsPick === gauge.modelData.id ? "▸ " : "") + gauge.modelData.name+ color: fleet.subsPick === gauge.modelData.id ? fleet.accent : fleet.muted+ font.pixelSize: 9+ }+ Text {+ anchors.horizontalCenter: parent.horizontalCenter+ y: 40+ text: (gauge.banked >= 0 ? "+" : "") + Math.round(gauge.banked * 100) + "% banked"+ color: gauge.banked >= 0 ? fleet.okay : gauge.tone+ font.pixelSize: 8+ }+ }+ }+ }+ }++ // ---------------- Collisions: fixed two lines, always reserved ----------------+ Column {+ width: parent.width+ height: 30+ Repeater {+ model: 2+ delegate: Text {+ required property int index+ readonly property var alert: fleet.alerts[index]+ width: parent.width+ elide: Text.ElideRight+ text: alert ? "△ " + alert.kind + ": " + alert.detail : (index === 0 ? "no collisions in the last hour" : "")+ color: alert ? fleet.danger : fleet.muted+ font.pixelSize: 10+ font.family: "monospace"+ }+ }+ }++ // ---------------- Activity ticker: bounded, scrolls in place ----------------+ Rectangle {+ width: parent.width+ height: 96+ radius: 8+ color: Qt.rgba(fleet.fg.r, fleet.fg.g, fleet.fg.b, 0.03)+ border.width: 1+ border.color: fleet.faint+ ListView {+ id: ticker+ anchors.fill: parent+ anchors.margins: 6+ clip: true+ spacing: 1+ model: tickerModel+ boundsBehavior: Flickable.StopAtBounds+ add: Transition {+ enabled: fleet.motion+ NumberAnimation { property: "x"; from: -24; to: 0; duration: 260; easing.type: Easing.OutCubic }+ NumberAnimation { property: "opacity"; from: 0; to: 1; duration: 260 }+ }+ displaced: Transition {+ enabled: fleet.motion+ NumberAnimation { property: "y"; duration: 200; easing.type: Easing.OutCubic }+ }+ delegate: Row {+ required property string t+ required property string glyph+ required property string st+ required property string who+ required property string what+ required property int index+ spacing: 6+ height: 16+ opacity: index === 0 ? 1.0 : 0.8+ Text { text: parent.t; color: fleet.muted; font.pixelSize: 10; font.family: "monospace" }+ Text { text: parent.glyph; color: fleet.colorFor(parent.st); font.pixelSize: 11; font.bold: true; width: 12 }+ Text { text: parent.who; color: fleet.fg; font.pixelSize: 10; font.bold: true }+ Text { text: parent.what; color: fleet.muted; font.pixelSize: 10; width: 300; elide: Text.ElideRight }+ }+ Text {+ anchors.centerIn: parent+ visible: ticker.count === 0+ text: "activity shows here as agents change state"+ color: fleet.muted+ font.pixelSize: 10+ }+ }+ }++ // ---------------- Hold-to-stop hexagon ----------------+ Item {+ width: parent.width+ height: 56++ Item {+ id: stopHex+ width: 52; height: 52+ property real hold: 0+ readonly property real c: 26+ readonly property real r: 23+ readonly property bool charging: stopMouse.pressed && fleet.daemonUp++ NumberAnimation on hold {+ id: charge+ running: false+ from: 0; to: 1; duration: 2000+ onFinished: if (stopHex.hold >= 1) { fleet.stopAllRequested(); drain.restart() }+ }+ NumberAnimation on hold { id: drain; running: false; to: 0; duration: fleet.reducedMotion ? 0 : 240; easing.type: Easing.OutCubic }++ // Charge core: the inner hexagon grows with the hold.+ Shape {+ anchors.fill: parent+ preferredRendererType: Shape.CurveRenderer+ scale: stopHex.hold+ visible: stopHex.hold > 0.01+ ShapePath {+ strokeWidth: 0+ strokeColor: "transparent"+ fillColor: Qt.rgba(fleet.danger.r, fleet.danger.g, fleet.danger.b, 0.25 + 0.5 * stopHex.hold)+ PathPolyline { path: fleet.hexPoints(stopHex.c, stopHex.c, stopHex.r - 3) }+ }+ }+ // Six edges, dim at rest; each lights as the hold passes its sixth.+ Repeater {+ model: 6+ delegate: Shape {+ id: edge+ required property int index+ readonly property var p: fleet.hexPoints(stopHex.c, stopHex.c, stopHex.r)+ readonly property bool lit: stopHex.hold * 6 > index+ anchors.fill: parent+ preferredRendererType: Shape.CurveRenderer+ ShapePath {+ strokeWidth: edge.lit ? 3 : 1.6+ capStyle: ShapePath.RoundCap+ strokeColor: edge.lit ? fleet.danger : Qt.rgba(fleet.danger.r, fleet.danger.g, fleet.danger.b, fleet.daemonUp ? 0.55 : 0.2)+ fillColor: "transparent"+ startX: edge.p[edge.index].x; startY: edge.p[edge.index].y+ PathLine { x: edge.p[edge.index + 1].x; y: edge.p[edge.index + 1].y }+ }+ }+ }+ // Crackle: a dashed hexagon spinning around the charge while held.+ Shape {+ id: crackle+ anchors.fill: parent+ visible: stopHex.charging && !fleet.reducedMotion+ preferredRendererType: Shape.CurveRenderer+ RotationAnimator on rotation { running: crackle.visible; loops: Animation.Infinite; from: 0; to: 360; duration: 900 }+ ShapePath {+ strokeWidth: 1+ strokeColor: Qt.lighter(fleet.danger, 1.4)+ fillColor: "transparent"+ strokeStyle: ShapePath.DashLine+ dashPattern: [1, 5]+ PathPolyline { path: fleet.hexPoints(stopHex.c, stopHex.c, stopHex.r + 2) }+ }+ }+ Text {+ anchors.centerIn: parent+ text: "■"+ color: stopHex.hold > 0.5 ? fleet.fg : fleet.danger+ font.pixelSize: 14+ }+ MouseArea {+ id: stopMouse+ anchors.fill: parent+ enabled: fleet.daemonUp+ onPressed: { drain.stop(); charge.from = stopHex.hold; charge.duration = Math.max(1, 2000 * (1 - stopHex.hold)); charge.restart() }+ onReleased: { if (charge.running) { charge.stop(); drain.restart() } }+ onCanceled: { charge.stop(); drain.restart() }+ }+ }+ Column {+ anchors.left: stopHex.right+ anchors.leftMargin: 12+ anchors.verticalCenter: parent.verticalCenter+ spacing: 2+ Text {+ text: stopHex.charging ? "STOPPING IN " + (2 * (1 - stopHex.hold)).toFixed(1) + " S, RELEASE TO CANCEL" : "HOLD 2 S TO STOP EVERY AGENT"+ color: stopHex.charging ? fleet.danger : fleet.fg+ font.pixelSize: 10; font.bold: true; font.letterSpacing: 1+ }+ Text {+ text: fleet.lastStop !== "" ? fleet.lastStop : "on " + (fleet.hostname || "this machine") + ", cancels every running turn"+ color: fleet.muted+ font.pixelSize: 10+ }+ }+ }+ }++ ListModel { id: tickerModel }+ // Bounded ticker: newest on top, at most 40 rows kept.+ function pushEvents(list) {+ for (var i = 0; i < list.length; i++) {+ var e = list[i]+ tickerModel.insert(0, { t: Model.clock(e.at), glyph: e.glyph, st: e.state, who: e.name + (e.machine ? "@" + e.machine : ""), what: e.text })+ }+ while (tickerModel.count > 40) tickerModel.remove(tickerModel.count - 1)+ }+}diff --git a/integrations/omarchy/harness-pulse/Model.js b/integrations/omarchy/harness-pulse/Model.jsnew file mode 100644index 000000000..9439b7bef--- /dev/null+++ b/integrations/omarchy/harness-pulse/Model.js@@ -0,0 +1,159 @@+.pragma library++// Attention states the daemon emits. Anything unknown renders as idle.+var STATES = ["working", "waiting", "permission", "failed", "done", "idle", "offline"];++// Glyphs are the non-colour channel (accessibility, reducedMotion).+var GLYPHS = {+ working: "◐", // half circle+ waiting: "?",+ permission: "!",+ failed: "✗", // ballot x+ done: "●", // filled circle+ idle: "○", // ring+ offline: "·" // middle dot+};++function normaliseState(s) {+ return STATES.indexOf(s) >= 0 ? s : "idle";+}++function glyphFor(state) {+ return GLYPHS[normaliseState(state)] || GLYPHS.idle;+}++// Parse one JSON line from pulse-feed. Returns {ok, agents, hostname, error}.+function parseFeedLine(line) {+ try {+ var d = JSON.parse(line);+ if (!d || typeof d !== "object") return { ok: false, agents: [], error: "bad payload" };+ if (d.error) return { ok: false, agents: [], error: String(d.error) };+ var agents = Array.isArray(d.agents) ? d.agents : [];+ var alerts = Array.isArray(d.alerts) ? d.alerts : [];+ return {+ ok: true,+ hostname: d.hostname || "",+ // Weekly subscription use from the daemon (harness subs): used and banked are fractions.+ subs: d.subscriptions && Array.isArray(d.subscriptions.subs) ? d.subscriptions.subs.map(function (x) {+ return { id: String(x.id || ""), name: String(x.name || x.id || ""), used: Number(x.used) || 0,+ banked: Number(x.bankedSigned) || 0, tone: String(x.tone || ""), resetsInMs: Number(x.resetsInMs) || 0 };+ }) : [],+ pick: d.subscriptions ? String(d.subscriptions.pick || "") : "",+ // Collision alerts from the daemon: two agents on one file, folder or branch inside the hour.+ alerts: alerts.map(function (x) {+ return { kind: String(x.kind || ""), detail: String(x.detail || ""), at: Number(x.at) || 0 };+ }),+ agents: agents.map(function (a) {+ return {+ agentId: String(a.agentId || ""),+ name: String(a.name || a.agentId || "agent"),+ engine: String(a.engine || ""),+ machine: String(a.machine || d.hostname || ""),+ state: normaliseState(a.state),+ since: Number(a.since) || 0,+ detail: String(a.detail || ""),+ label: String(a.label || a.state || ""),+ glyph: a.glyph ? String(a.glyph) : glyphFor(a.state),+ lane: a.lane ? String(a.lane) : "",+ spend: a.spend && typeof a.spend === "object"+ ? { usd: Number(a.spend.usd) || 0, tokens: Number(a.spend.tokens) || 0,+ fraction: (a.spend.fraction === null || a.spend.fraction === undefined) ? null : Number(a.spend.fraction) }+ : null+ };+ })+ };+ } catch (e) {+ return { ok: false, agents: [], error: "parse: " + e };+ }+}++// Rank: what needs a person first. Permission and waiting float left.+var RANK = { permission: 0, waiting: 1, failed: 2, done: 3, working: 4, idle: 5, offline: 6 };++function sortAgents(agents) {+ return agents.slice().sort(function (a, b) {+ var r = RANK[a.state] - RANK[b.state];+ if (r !== 0) return r;+ return a.since - b.since;+ });+}++// Six-digit hex colours from colors.toml, keyed by name (blue, yellow, red...).+function parseThemeColors(text) {+ var out = {};+ var re = /^\s*([A-Za-z0-9_]+)\s*=\s*"?#?([0-9a-fA-F]{6})"?/gm;+ var m;+ while ((m = re.exec(text)) !== null) out[m[1].toLowerCase()] = "#" + m[2];+ return out;+}++function ago(sinceMs, nowMs) {+ if (!sinceMs) return "";+ var s = Math.max(0, Math.round((nowMs - sinceMs) / 1000));+ if (s < 60) return s + "s";+ if (s < 3600) return Math.round(s / 60) + "m";+ return Math.round(s / 3600) + "h";+}++// Fleet view: agents grouped by machine, this host first, then by name. Each group carries+// whether anything on it needs a person, so the hub can glow.+function groupByMachine(agents, hostname) {+ var groups = {};+ var order = [];+ for (var i = 0; i < agents.length; i++) {+ var m = agents[i].machine || hostname || "local";+ if (!groups[m]) { groups[m] = { machine: m, agents: [], needsYou: false, working: false, spendUsd: 0 }; order.push(m); }+ var g = groups[m];+ g.agents.push(agents[i]);+ if (agents[i].state === "waiting" || agents[i].state === "permission" || agents[i].state === "failed") g.needsYou = true;+ if (agents[i].state === "working") g.working = true;+ if (agents[i].spend && agents[i].spend.usd) g.spendUsd += agents[i].spend.usd;+ }+ order.sort(function (a, b) {+ if (a === hostname) return -1;+ if (b === hostname) return 1;+ return a < b ? -1 : a > b ? 1 : 0;+ });+ return order.map(function (m) { return groups[m]; });+}++// Count per state, for the header chips.+function stateCounts(agents) {+ var out = { working: 0, waiting: 0, permission: 0, failed: 0, done: 0, idle: 0, offline: 0 };+ for (var i = 0; i < agents.length; i++) out[agents[i].state] = (out[agents[i].state] || 0) + 1;+ return out;+}++// Activity ticker: compare the previous {agentId: state} map with the new agents and return one+// event per change. First sight of an agent is an event too ("joined"). Returns {events, map}.+function diffStates(prevMap, agents, nowMs) {+ var map = {};+ var events = [];+ for (var i = 0; i < agents.length; i++) {+ var a = agents[i];+ var key = a.agentId || (a.machine + "/" + a.name);+ map[key] = a.state;+ var before = prevMap ? prevMap[key] : undefined;+ if (before === a.state) continue;+ events.push({+ at: nowMs,+ name: a.name,+ machine: a.machine,+ state: a.state,+ glyph: glyphFor(a.state),+ text: before === undefined ? "joined, " + (a.label || a.state) : before + " > " + (a.label || a.state)+ });+ }+ if (prevMap) {+ for (var k in prevMap) {+ if (map[k] === undefined) events.push({ at: nowMs, name: k.split("/").pop(), machine: "", state: "offline", glyph: glyphFor("offline"), text: "left the fleet" });+ }+ }+ return { events: events, map: map };+}++function clock(ms) {+ var d = new Date(ms);+ function two(n) { return n < 10 ? "0" + n : "" + n; }+ return two(d.getHours()) + ":" + two(d.getMinutes()) + ":" + two(d.getSeconds());+}diff --git a/integrations/omarchy/harness-pulse/Panel.qml b/integrations/omarchy/harness-pulse/Panel.qmlnew file mode 100644index 000000000..2416e826c--- /dev/null+++ b/integrations/omarchy/harness-pulse/Panel.qml@@ -0,0 +1,378 @@+import QtQuick+import QtQuick.Controls+import QtQuick.Shapes+import Quickshell+import Quickshell.Io+import qs.Commons+import qs.Ui+import "Model.js" as Model++Panel {+ id: root+ moduleName: "pi.harness-pulse"+ ipcTarget: "harness-pulse"+ // The shared Panel IPC gives `open`, `close` and `toggle` on harness-pulse for the fleet popup.+ manageIpc: true++ // The bar (Omarchy's or menubar-overload) draws tooltips itself and only for a target whose+ // tooltipHovered is true; a tooltip drawn inside the widget is clipped to the bar's height.+ property bool tooltipHovered: false+ function hoverTip(text) { tooltipHovered = true; if (bar && bar.showTooltip) bar.showTooltip(root, text) }+ function unhoverTip() { tooltipHovered = false; if (bar && bar.hideTooltip) bar.hideTooltip(root) }++ readonly property int refreshIntervalSec: {+ var v = Number(setting("refreshIntervalSec", 1))+ return isFinite(v) ? Math.max(1, Math.min(30, Math.round(v))) : 1+ }+ readonly property int maxAgents: {+ var v = Number(setting("maxAgents", 8))+ return isFinite(v) ? Math.max(1, Math.min(24, Math.round(v))) : 8+ }+ readonly property bool reducedMotion: setting("reducedMotion", false) === true+ readonly property string workingColor: String(setting("workingColor", "Accent"))+ readonly property bool showMachine: setting("showMachine", true) !== false+ readonly property string focusWindowClass: String(setting("focusWindowClass", "com.autonomous.harness"))+ // The face shown inside a ring that waits on you. "Auto": avatarPath when set, else ~/.face, else+ // initials. "Initials": always initials. "None": plain ring. Nothing personal ships in the plugin.+ readonly property string avatarMode: String(setting("avatar", "Auto") || "Auto")+ readonly property string avatarSetting: String(setting("avatarPath", "") || "")+ readonly property string homeDir: Quickshell.env("HOME") || ""+ function expandHome(p) { return p.indexOf("~/") === 0 ? root.homeDir + p.substring(1) : p }+ // The candidate picture is probed once here, so a missing ~/.face costs one warning, not one per ring.+ readonly property string avatarPath: avatarProbe.status === Image.Ready ? avatarCandidate : ""+ Image { id: avatarProbe; visible: false; asynchronous: true; sourceSize.width: 64; sourceSize.height: 64; source: root.avatarCandidate !== "" ? "file://" + root.avatarCandidate : "" }+ readonly property string avatarCandidate: avatarMode !== "Auto" ? ""+ : (avatarSetting !== "" ? expandHome(avatarSetting) : (homeDir !== "" ? homeDir + "/.face" : ""))+ readonly property string avatarInitials: {+ if (avatarMode === "None") return ""+ var s = String(setting("avatarInitials", "") || "").trim()+ if (s === "") s = String(Quickshell.env("USER") || "").substring(0, 1)+ return s.substring(0, 2).toUpperCase()+ }+ // Logo for the popup's idle and connecting states: Omarchy (read from the system at runtime,+ // never bundled), Harness (a drawn hexagon mark), Custom (logoPath) or None.+ readonly property string logoMode: String(setting("logo", "Harness") || "Harness")+ readonly property string logoPath: expandHome(String(setting("logoPath", "") || ""))+ readonly property int ringSize: {+ var v = Number(setting("ringSize", 18))+ return isFinite(v) ? Math.max(12, Math.min(28, Math.round(v))) : 18+ }++ property var agents: []+ property var alerts: []+ property var subs: []+ property string subsPick: ""+ property string lastStop: ""+ property string hostname: ""+ property string lastError: ""+ property bool daemonUp: false+ property var theme: ({})+ property int nowMs: Date.now()+ // agentId -> last state, for the fleet view activity ticker.+ property var lastStates: null++ readonly property string helperPath: {+ var p = Qt.resolvedUrl("pulse-feed").toString()+ return p.indexOf("file://") === 0 ? p.substring(7) : p+ }++ // The bar row never grows: a fixed slot per ring up to maxAgents, plus a status glyph.+ readonly property int slotWidth: ringSize + 6+ // "Summary" (default): one ring for the most urgent agent plus a count. "Rings": one ring per agent.+ readonly property bool summaryBar: String(setting("barMode", "Summary")) !== "Rings"+ readonly property int needsYou: agents.filter(function (a) { return a.state === "waiting" || a.state === "permission" }).length+ readonly property int workingCount: agents.filter(function (a) { return a.state === "working" }).length+ readonly property string countText: needsYou > 0 ? String(needsYou) : String(agents.length)+ readonly property int countWidth: summaryBar && agents.length > 0 ? countText.length * Math.max(7, ringSize * 0.5) + 6 : 0+ // One short line: bar tooltips render inside the bar's window, so a second line is clipped.+ readonly property string fleetSummary: {+ if (!daemonUp) return "Harness daemon not running"+ if (agents.length === 0) return "Harness: no agents"+ var parts = [agents.length + " agent" + (agents.length === 1 ? "" : "s")]+ if (needsYou > 0) parts.push(needsYou + " waiting on you")+ if (workingCount > 0) parts.push(workingCount + " working")+ return "Harness · " + parts.join(" · ")+ }++ implicitWidth: statusGlyph.width + 4 + (collisionBadge.visible ? collisionBadge.width + 4 : 0) + (summaryBar ? slotWidth + countWidth : Math.max(1, Math.min(maxAgents, agents.length)) * slotWidth)+ implicitHeight: ringSize + 4++ // Theme palette (yellow/red/green) for the state colours; shell Color.* for the rest.+ FileView {+ id: themeFile+ path: Quickshell.env("HOME") + "/.local/state/omarchy/current/theme/colors.toml"+ watchChanges: true+ preload: false+ onLoaded: root.theme = Model.parseThemeColors(text())+ onFileChanged: reload()+ }+ Component.onCompleted: themeFile.reload()++ // The clock only ticks while a tooltip or the popup could show it.+ Timer { interval: 1000; running: true; repeat: true; onTriggered: root.nowMs = Date.now() }++ // pulse-feed polls the daemon and prints one JSON line per poll; exit 3 means daemon down.+ Process {+ id: feed+ command: ["python3", root.helperPath, "--interval", String(root.refreshIntervalSec)]+ running: true+ stdout: SplitParser {+ onRead: function (line) {+ var r = Model.parseFeedLine(line)+ if (!r.ok) { root.lastError = r.error; root.daemonUp = false; return }+ root.lastError = ""+ root.daemonUp = true+ root.hostname = r.hostname+ root.agents = Model.sortAgents(r.agents)+ root.alerts = r.alerts || []+ root.subs = r.subs || []+ root.subsPick = r.pick || ""+ var d = Model.diffStates(root.lastStates, root.agents, Date.now())+ root.lastStates = d.map+ if (d.events.length > 0) fleetView.pushEvents(d.events)+ }+ }+ onExited: function (code) {+ root.daemonUp = false+ // A minute without the daemon: the last roster is stale, so drop it rather than show ghosts.+ if (code === 3) { root.agents = []; root.alerts = []; root.lastStates = null }+ if (code === 3) root.lastError = "Harness daemon not running"+ else if (code !== 0) root.lastError = "pulse-feed exited " + code+ restart.start()+ }+ }+ Timer { id: restart; interval: 5000; repeat: false; onTriggered: feed.running = true }++ // Hyprland with a Lua config (0.56+, Omarchy 4) reads `hyprctl dispatch X` as `hl.dispatch(X)` and+ // refuses the classic `focuswindow class:...` form; older Hyprland knows only that form. Try the Lua+ // dispatcher first and fall back, so the same widget focuses the window on either.+ Process {+ id: focus+ command: ["sh", "-c",+ "hyprctl dispatch \"hl.dsp.focus({ window = 'class:^($1)$' })\" 2>/dev/null | grep -qx ok || hyprctl dispatch focuswindow \"class:^($1)$\"",+ "focus", root.focusWindowClass]+ running: false+ }++ Row {+ id: row+ anchors.verticalCenter: parent.verticalCenter+ spacing: 0++ // Status glyph: the daemon itself. Non-colour, one character.+ Text {+ id: statusGlyph+ anchors.verticalCenter: parent.verticalCenter+ text: root.daemonUp ? "⬡" : "⬢" // hexagon outline vs filled+ color: root.daemonUp ? Color.foreground : Qt.rgba(Color.foreground.r, Color.foreground.g, Color.foreground.b, 0.35)+ font.pixelSize: root.ringSize * 0.7+ Behavior on color { ColorAnimation { duration: root.reducedMotion ? 0 : 220 } }++ // Hold-to-stop: press and hold the hexagon for two seconds to cancel every agent turn on this+ // machine. A red ring drains around the hexagon while held; release early and nothing happens.+ property real hold: 0+ NumberAnimation on hold {+ id: holdAnim+ running: false+ from: 0; to: 1; duration: 2000+ onFinished: { if (statusGlyph.hold >= 1) { stopAll.running = true; statusGlyph.hold = 0 } }+ }+ // Shape, not Canvas: a Canvas repainted per frame flickers on the bar.+ Shape {+ id: holdArc+ anchors.centerIn: parent+ width: root.ringSize + 4; height: root.ringSize + 4+ visible: statusGlyph.hold > 0+ preferredRendererType: Shape.CurveRenderer+ ShapePath {+ strokeWidth: 2+ capStyle: ShapePath.RoundCap+ fillColor: "transparent"+ strokeColor: (root.theme && root.theme.red) ? root.theme.red : Color.urgent+ PathAngleArc { centerX: holdArc.width / 2; centerY: holdArc.height / 2; radiusX: holdArc.width / 2 - 1.5; radiusY: radiusX; startAngle: -90; sweepAngle: (1 - statusGlyph.hold) * 360 }+ }+ }+ MouseArea {+ anchors.fill: parent+ enabled: root.daemonUp+ hoverEnabled: true+ acceptedButtons: Qt.LeftButton | Qt.RightButton+ property double pressedAt: 0+ // A quick click opens the fleet popup; only a 2 s hold stops agents. Right-click also opens it.+ onPressed: function (mouse) {+ if (mouse.button === Qt.RightButton) return+ pressedAt = Date.now(); statusGlyph.hold = 0; holdAnim.restart()+ }+ onReleased: function (mouse) {+ holdAnim.stop(); statusGlyph.hold = 0+ if (mouse.button === Qt.RightButton || Date.now() - pressedAt < 400) root.toggle()+ }+ onCanceled: { holdAnim.stop(); statusGlyph.hold = 0 }+ onEntered: root.hoverTip(root.lastStop !== "" ? root.lastStop : "Click: fleet · Hold 2 s: stop all")+ onExited: root.unhoverTip()+ }+ }+ Process {+ id: stopAll+ command: ["python3", root.helperPath, "--stop-all"]+ running: false+ stdout: SplitParser {+ onRead: function (line) {+ try { var d = JSON.parse(line); root.lastStop = d.cancelled ? "Stopped " + d.cancelled.length + " agent(s)" : "Stop failed: " + (d.error || "unknown") }+ catch (e) { root.lastStop = "Stop failed" }+ }+ }+ }+ Item { width: 4; height: 1 }++ // Collision badge: two agents on one file, folder or branch in the last hour. Only present when+ // there is something to say, so the bar stays quiet otherwise (it takes a fixed slot only+ // while visible, and the ring row shifts by one glyph, never by a layout reflow).+ Text {+ id: collisionBadge+ anchors.verticalCenter: parent.verticalCenter+ visible: root.alerts.length > 0+ text: "△" + (root.alerts.length > 1 ? String(root.alerts.length) : "")+ color: (root.theme && root.theme.red) ? root.theme.red : Color.urgent+ font.pixelSize: root.ringSize * 0.7+ font.bold: true+ opacity: 1.0+ SequentialAnimation on opacity {+ running: collisionBadge.visible && !root.reducedMotion+ loops: Animation.Infinite+ NumberAnimation { from: 1.0; to: 0.45; duration: 900; easing.type: Easing.InOutSine }+ NumberAnimation { from: 0.45; to: 1.0; duration: 900; easing.type: Easing.InOutSine }+ }+ MouseArea {+ anchors.fill: parent+ hoverEnabled: true+ onEntered: root.hoverTip((function () {+ var lines = []+ for (var i = 0; i < root.alerts.length && i < 6; i++) lines.push(root.alerts[i].kind + ": " + root.alerts[i].detail)+ return lines.slice(0, 1).join("").slice(0, 60)+ })())+ onExited: root.unhoverTip()+ }+ }+ Item { width: collisionBadge.visible ? 4 : 0; height: 1 }++ Repeater {+ model: root.summaryBar ? (root.agents.length > 0 ? 1 : 0) : Math.min(root.maxAgents, root.agents.length)+ delegate: Item {+ required property int index+ readonly property var agent: root.agents[index] || ({})+ width: root.slotWidth + (root.summaryBar ? root.countWidth : 0)+ height: root.ringSize + 4++ Text {+ id: countLabel+ visible: root.summaryBar+ anchors.right: parent.right+ anchors.verticalCenter: parent.verticalCenter+ text: root.countText+ color: root.needsYou > 0 ? agentRing.stateColor : Color.foreground+ opacity: root.needsYou > 0 ? 1 : 0.6+ font.pixelSize: Math.max(10, root.ringSize - 6)+ font.bold: root.needsYou > 0+ }++ // A soft dot travels along the row toward a ring that waits on you (leads the eye on wide bars).+ Rectangle {+ id: pulseDot+ width: 4; height: 4; radius: 2+ y: parent.height / 2 - 2+ color: agentRing.stateColor+ opacity: 0+ visible: !root.reducedMotion && (agent.state === "waiting" || agent.state === "permission")+ SequentialAnimation on x {+ running: pulseDot.visible+ loops: Animation.Infinite+ PropertyAction { target: pulseDot; property: "opacity"; value: 0.0 }+ NumberAnimation { from: -root.slotWidth * 2; to: root.slotWidth / 2 - 2; duration: 900; easing.type: Easing.InOutQuad }+ PropertyAction { target: pulseDot; property: "opacity"; value: 0.0 }+ PauseAnimation { duration: 1500 }+ }+ SequentialAnimation on opacity {+ running: pulseDot.visible+ loops: Animation.Infinite+ NumberAnimation { from: 0; to: 0.85; duration: 300 }+ NumberAnimation { from: 0.85; to: 0; duration: 600 }+ PauseAnimation { duration: 1500 }+ }+ }++ AgentRing {+ id: agentRing+ anchors.verticalCenter: parent.verticalCenter+ x: (root.slotWidth - width) / 2+ size: root.ringSize+ agent: parent.agent+ reducedMotion: root.reducedMotion+ theme: root.theme+ avatarPath: root.avatarPath+ avatarInitials: root.avatarInitials+ workingColor: root.workingColor+ }++ MouseArea {+ anchors.fill: parent+ hoverEnabled: true+ acceptedButtons: Qt.LeftButton | Qt.RightButton+ // Left and right: the fleet popup (the Harness app is optional; Orca users never open it).+ onClicked: root.toggle()+ onEntered: root.hoverTip(root.summaryBar ? root.fleetSummary : (agent.name || "agent") + " · " + (agent.label || agent.state) + (agent.since ? " " + Model.ago(agent.since, root.nowMs) : ""))+ onExited: root.unhoverTip()+ }+ }+ }+ }++ MouseArea {+ anchors.fill: parent+ enabled: root.agents.length === 0+ hoverEnabled: true+ acceptedButtons: Qt.LeftButton | Qt.RightButton+ onClicked: root.toggle()+ onEntered: root.hoverTip(root.fleetSummary)+ onExited: root.unhoverTip()+ }++ // ---- Fleet popup: right-click the widget (or `toggle` over IPC). ----+ KeyboardPanel {+ id: popup+ anchorItem: row+ owner: root+ bar: root.bar+ open: root.opened+ focusTarget: keyCatcher+ contentWidth: popup.fittedContentWidth(480)+ contentHeight: popup.fittedContentHeight(fleetView.implicitHeight, 620)++ PanelKeyCatcher {+ id: keyCatcher+ anchors.fill: parent+ onCloseRequested: root.close()+ onTabRequested: function (direction) { root.switchPanel(direction) }++ FleetView {+ id: fleetView+ anchors.fill: parent+ agents: root.agents+ alerts: root.alerts+ subs: root.subs+ subsPick: root.subsPick+ hostname: root.hostname+ daemonUp: root.daemonUp+ active: root.opened+ reducedMotion: root.reducedMotion+ workingColor: root.workingColor+ theme: root.theme+ logoMode: root.logoMode+ logoPath: root.logoPath+ lastStop: root.lastStop+ nowMs: root.nowMs+ onStopAllRequested: stopAll.running = true+ }+ }+ }+}diff --git a/integrations/omarchy/harness-pulse/README.md b/integrations/omarchy/harness-pulse/README.mdnew file mode 100644index 000000000..81da029c4--- /dev/null+++ b/integrations/omarchy/harness-pulse/README.md@@ -0,0 +1,96 @@+# Harness Pulse (pi.harness-pulse)++An [Omarchy](https://omarchy.org) bar widget: one ring per coding agent this computer's Harness+daemon runs, on the bar. Written by Fred Nix ([@nixfred](https://github.com/nixfred)) in his fork,+[github.com/nixfred/openharness](https://github.com/nixfred/openharness) (MIT).++It shows the agents the Harness app shows — the daemon's own agents — and nothing else.++State language on the bar (every animation sits behind the `reducedMotion` setting, and every state+also has a glyph so colour is never the only signal):++- working: a comet with a fading three-step trail and a glowing head circles clockwise (1.8 s a turn)+- waiting on you: the ring breathes (1.0 to 1.08, 1.2 s), a soft halo swells out of it in the theme+ yellow, and a dot travels along the bar toward it+- permission: the same breath and halo in theme red, plus a repeating red strobe (three flashes) and a+ chromatic glitch+- failed: two strobes and a glitch on entry, then a steady thin red ring with one glitch tick every 6 s+- done, unreviewed: the core fills to a solid dot with an overshoot and a shockwave ring, then holds+- offline: a dim dashed ring, no motion+- idle: the ring shrinks to a dot, no motion+- spend: the outer arc, 0 to 100 percent of the per-agent cap (`harness spend set`); theme yellow from+ 80 percent, red at the cap++Rings never change the row height or width; all motion is scale, opacity, rotation or a translate+inside a fixed slot. Animations use Shape paths and render-thread animators, not Canvas, and nothing+runs in idle, offline or a settled done ring.++The daemon glyph at the left is a hexagon: outline when the daemon is up, filled when it is not.+**Hold it 2 s to stop every agent on this machine** (`harness stop-all`); a red ring drains while held+and releasing early cancels.++Left-click a ring to focus the Harness window (Hyprland's Lua dispatcher on 0.56+, `focuswindow` on+older versions; change `focusWindowClass` if the class differs). Hover for name, engine, machine,+lane, state, spend and detail.++## Fleet view (right-click, or IPC)++Right-click the widget, or run `qs ipc call harness-pulse toggle` (also `open`, `close`). Escape+closes it. The popup has a fixed size and never scrolls; only the activity ticker scrolls, in place.++- Orbit field: one hexagon hub per machine, its agents riding a dashed orbit as the same rings as the+ bar. The orbit turns only while something works. The hub glows and a tether reaches out to every+ agent that waits on you, needs permission or failed.+- State chips: a count per state with its glyph.+- Spend: one 270 degree gauge per agent with a cap. Gauges sweep up from zero each time the popup+ opens, and one at or over its cap pulses red.+- Activity ticker: every state change, newest on top. Bounded at 40 rows.+- Hold-to-stop hexagon: press and hold. The six edges light one by one; release early and it drains.+- Idle and connecting: the chosen logo (see `logo`), breathing while the daemon is not answering.++All popup motion stops while the popup is closed.++## Settings++All settings are in the bar's widget settings (manifest `schema`), stored in+`~/.config/omarchy/shell.json` under the widget.++| Setting | Default | What it does |+|---|---|---|+| `reducedMotion` | `false` | Stops every animation on the bar and in the fleet view. |+| `ringSize` | `18` | Ring diameter in logical px, 12 to 28. |+| `maxAgents` | `8` | Rings on the bar, most urgent first (1 to 24). |+| `refreshIntervalSec` | `1` | How often `pulse-feed` polls the daemon (1 to 30 s). |+| `showMachine` | `true` | Show `@machine` in ring tooltips. |+| `focusWindowClass` | `com.autonomous.harness` | Window class a left-click focuses. |+| `avatar` | `Auto` | The face inside a ring that waits on you. `Auto`: `avatarPath` when set, else `~/.face`, else initials. `Initials`: always initials. `None`: a plain ring. |+| `avatarPath` | empty | Picture for `Auto`, round-cropped. `~/` is expanded. |+| `avatarInitials` | empty | One or two letters for the initials disc. Empty uses the first letter of `$USER`. |+| `logo` | `Harness` | Idle and connecting logo in the fleet view: `Harness`, `Omarchy` (read from `/usr/share/omarchy/logo.svg` at runtime; nothing is bundled), `Custom` (`logoPath`) or `None`. |+| `logoPath` | empty | Image for `logo: Custom` (SVG or PNG). `~/` is expanded. |++## Data++`pulse-feed` (python3, no dependencies) polls `GET /api/attention` on the local daemon, over its Unix+socket `~/.harness/cli/data/daemon-18473.sock` first and 127.0.0.1:18473 second, once per+`refreshIntervalSec`, and prints one JSON line per poll. Nothing leaves the machine. Exit 3 means the+daemon was unreachable for a minute; the widget restarts the feed every 5 s. `HARNESS_PORT` and+`HARNESS_SOCKET` override the defaults. The hold-to-stop calls `POST /api/stop-all` the same way.++## Install++From a checkout of this repository, on the Omarchy machine:++```+cp -r integrations/omarchy/harness-pulse ~/.config/omarchy/plugins/pi.harness-pulse+omarchy restart shell+```++Never `omarchy refresh`: that is a factory reset of the bar. Add the widget with the bar's own IPC if+it does not appear:++```+omarchy-shell shell putBarWidget pi.harness-pulse '{"section":"right","index":1}'+```++`Super + Shift + Space` shows the bar if it is hidden.diff --git a/integrations/omarchy/harness-pulse/manifest.json b/integrations/omarchy/harness-pulse/manifest.jsonnew file mode 100644index 000000000..6b637fb1c--- /dev/null+++ b/integrations/omarchy/harness-pulse/manifest.json@@ -0,0 +1,155 @@+{+ "schemaVersion": 1,+ "id": "pi.harness-pulse",+ "name": "Harness Pulse",+ "version": "0.3.0",+ "author": "Fred Nix",+ "description": "One ring per coding agent on every linked Harness machine. Working throws a comet, waiting breathes a halo toward you, permission strobes red with a glitch, done fills with a burst, failed flashes then holds, offline sits dim. Right-click for a live fleet view: machines with agents in orbit, spend gauges, an activity ticker and a hold-to-stop hexagon. Reads the local Harness daemon's attention feed; nothing leaves the machine.",+ "kinds": [+ "bar-widget"+ ],+ "entryPoints": {+ "barWidget": "Panel.qml"+ },+ "barWidget": {+ "displayName": "Harness Pulse",+ "description": "Agent attention rings for OpenHarness: which agent is working, which one is waiting on you, which one finished. Right-click for the fleet view.",+ "category": "Development",+ "allowMultiple": false,+ "defaultSection": "right",+ "defaults": {+ "refreshIntervalSec": 1,+ "maxAgents": 8,+ "reducedMotion": false,+ "showMachine": true,+ "focusWindowClass": "com.autonomous.harness",+ "ringSize": 18,+ "avatar": "Auto",+ "avatarPath": "",+ "avatarInitials": "",+ "logo": "Harness",+ "logoPath": "",+ "workingColor": "Accent",+ "barMode": "Summary"+ },+ "schema": [+ {+ "key": "barMode",+ "type": "enum",+ "label": "Bar layout",+ "options": [+ "Summary",+ "Rings"+ ],+ "description": "Summary: one ring for the most urgent agent and a count. Rings: one ring per agent.",+ "defaultValue": "Summary"+ },+ {+ "key": "reducedMotion",+ "type": "boolean",+ "label": "Reduced motion",+ "description": "Stops every animation on the bar and in the fleet view. States still read from colour, a glyph and a word.",+ "defaultValue": false+ },+ {+ "key": "workingColor",+ "type": "enum",+ "label": "Working ring colour",+ "options": [+ "Accent",+ "Cyan",+ "Green"+ ],+ "description": "Colour of a ring while its agent works. Accent follows your theme.",+ "defaultValue": "Accent"+ },+ {+ "key": "ringSize",+ "type": "integer",+ "label": "Ring size (px)",+ "min": 12,+ "max": 28,+ "step": 1,+ "defaultValue": 18+ },+ {+ "key": "maxAgents",+ "type": "integer",+ "label": "Rings on the bar",+ "description": "Most urgent first; the rest are in the fleet view.",+ "min": 1,+ "max": 24,+ "step": 1,+ "defaultValue": 8+ },+ {+ "key": "refreshIntervalSec",+ "type": "integer",+ "label": "Refresh interval (seconds)",+ "min": 1,+ "max": 30,+ "step": 1,+ "defaultValue": 1+ },+ {+ "key": "showMachine",+ "type": "boolean",+ "label": "Show machine in tooltips",+ "defaultValue": true+ },+ {+ "key": "focusWindowClass",+ "type": "string",+ "label": "Harness window class",+ "description": "Left-click on a ring focuses the window with this class.",+ "defaultValue": "com.autonomous.harness"+ },+ {+ "key": "avatar",+ "type": "enum",+ "label": "Face in a waiting ring",+ "options": [+ "Auto",+ "Initials",+ "None"+ ],+ "description": "Auto: the picture below, else ~/.face, else your initials. Initials: always initials. None: a plain ring.",+ "defaultValue": "Auto"+ },+ {+ "key": "avatarPath",+ "type": "path",+ "label": "Avatar picture",+ "description": "Any square-ish image; it is round-cropped. Empty uses ~/.face.",+ "defaultValue": ""+ },+ {+ "key": "avatarInitials",+ "type": "string",+ "label": "Initials",+ "description": "One or two letters. Empty uses the first letter of your user name.",+ "defaultValue": ""+ },+ {+ "key": "logo",+ "type": "enum",+ "label": "Idle and connecting logo",+ "options": [+ "Harness",+ "Omarchy",+ "Custom",+ "None"+ ],+ "description": "Shown in the fleet view when there are no agents or the daemon is not answering. Omarchy reads /usr/share/omarchy/logo.svg at runtime.",+ "defaultValue": "Harness"+ },+ {+ "key": "logoPath",+ "type": "path",+ "label": "Custom logo",+ "description": "Image used when the logo is Custom (SVG or PNG).",+ "defaultValue": ""+ }+ ]+ }+}diff --git a/integrations/omarchy/harness-pulse/pulse-feed b/integrations/omarchy/harness-pulse/pulse-feednew file mode 100755index 000000000..cef4b3fdf--- /dev/null+++ b/integrations/omarchy/harness-pulse/pulse-feed@@ -0,0 +1,113 @@+#!/usr/bin/env python3+"""pulse-feed: poll the local Harness daemon's attention feed and print one JSON line per poll.++Tries the Unix socket first (~/.harness/cli/data/daemon-<port>.sock, HTTP over AF_UNIX), then+127.0.0.1:<port>. Exit 0 on a clean stop, 3 when the daemon cannot be reached for a whole+minute. Never prints anything that is not a JSON object.+"""+import argparse+import http.client+import json+import os+import socket+import sys+import time++PORT = int(os.environ.get("HARNESS_PORT", "18473"))+SOCK = os.path.expanduser(os.environ.get("HARNESS_SOCKET", f"~/.harness/cli/data/daemon-{PORT}.sock"))+PATH = "/api/attention"+UNREACHABLE_LIMIT_SEC = 60+++class UnixHTTPConnection(http.client.HTTPConnection):+ def __init__(self, path, timeout=2.0):+ super().__init__("localhost", timeout=timeout)+ self.unix_path = path++ def connect(self):+ s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)+ s.settimeout(self.timeout)+ s.connect(self.unix_path)+ self.sock = s+++def fetch_once():+ errors = []+ conns = []+ if os.path.exists(SOCK):+ conns.append(("unix", lambda: UnixHTTPConnection(SOCK)))+ conns.append(("tcp", lambda: http.client.HTTPConnection("127.0.0.1", PORT, timeout=2.0)))+ for name, make in conns:+ try:+ c = make()+ c.request("GET", PATH, headers={"Host": f"127.0.0.1:{PORT}", "Accept": "application/json"})+ r = c.getresponse()+ body = r.read()+ c.close()+ if r.status != 200:+ errors.append(f"{name}: HTTP {r.status}")+ continue+ return json.loads(body.decode("utf-8", "replace")), None+ except (OSError, http.client.HTTPException, ValueError) as e:+ errors.append(f"{name}: {e.__class__.__name__}")+ return None, "; ".join(errors) or "unreachable"+++def stop_all():+ """Panic stop: POST /api/stop-all. Prints one JSON line, exit 0 on success, 1 otherwise."""+ headers = {"Host": f"127.0.0.1:{PORT}", "Content-Type": "application/json", "x-adapter-local": "1"}+ conns = []+ if os.path.exists(SOCK):+ conns.append(lambda: UnixHTTPConnection(SOCK))+ conns.append(lambda: http.client.HTTPConnection("127.0.0.1", PORT, timeout=5.0))+ for make in conns:+ try:+ c = make()+ c.request("POST", "/api/stop-all", body="{}", headers=headers)+ r = c.getresponse()+ body = r.read().decode("utf-8", "replace")+ c.close()+ print(body, flush=True)+ return 0 if r.status == 200 else 1+ except (OSError, http.client.HTTPException):+ continue+ print(json.dumps({"error": "unreachable"}), flush=True)+ return 1+++def main():+ ap = argparse.ArgumentParser()+ ap.add_argument("--interval", type=float, default=1.0)+ ap.add_argument("--once", action="store_true")+ ap.add_argument("--stop-all", action="store_true")+ a = ap.parse_args()+ if a.stop_all:+ sys.exit(stop_all())+ interval = max(0.5, a.interval)+ down_since = None+ while True:+ data, err = fetch_once()+ if data is not None:+ down_since = None+ out = {"hostname": data.get("hostname", ""), "machineId": data.get("machineId", ""),+ "at": data.get("at", int(time.time() * 1000)), "agents": data.get("agents", []),+ "alerts": data.get("alerts", []), "subscriptions": data.get("subscriptions")}+ else:+ down_since = down_since or time.time()+ out = {"error": err, "agents": []}+ if time.time() - down_since > UNREACHABLE_LIMIT_SEC:+ print(json.dumps(out), flush=True)+ sys.exit(3)+ print(json.dumps(out), flush=True)+ if a.once:+ return+ time.sleep(interval)+++if __name__ == "__main__":+ try:+ main()+ except KeyboardInterrupt:+ pass+ except BrokenPipeError:+ sys.exit(0)