SPB Git

spb/zyquo-agent Public MIT

The autonomous agent that actually operates your Mac — plans, runs real commands, verifies its own work.

Swift 94.7% Shell 4.1% Python 0.7% Makefile 0.5%
2.5 KB · 79 lines swift
Raw Blame History
1//2//  AgentZGlyph.swift3//  Zyquo Agent4//5//  Author: Simon-Pierre Boucher6//  Mail: contact@spboucher.ai7//8//  The in-app Agent brand glyph (wordmark + empty state): the family9//  Z-monogram whose lower stroke resolves into a command-prompt caret —10//  "the Z that acts". Drawn as vector paths on a normalized grid so it scales11//  from the 22pt wordmark to the 88pt hero without redesign. The full app12//  icon (Phase 5) shares this creative direction.13//1415import SwiftUI1617/// Normalized 100×100 design grid for the glyph paths.18private enum AgentGlyphGrid {19    static let unit: CGFloat = 10020}2122/// The Z stroke: top bar → diagonal → shortened bottom bar (making room for23/// the caret block that follows it).24private struct AgentZStroke: Shape {25    func path(in rect: CGRect) -> Path {26        let scale = min(rect.width, rect.height) / AgentGlyphGrid.unit27        func point(_ x: CGFloat, _ y: CGFloat) -> CGPoint {28            CGPoint(x: rect.minX + x * scale, y: rect.minY + y * scale)29        }30        var path = Path()31        path.move(to: point(18, 22))32        path.addLine(to: point(82, 22))33        path.addLine(to: point(22, 78))34        path.addLine(to: point(58, 78))35        return path36    }37}3839/// The command caret `›` finishing the Z's lower stroke.40private struct AgentCaretStroke: Shape {41    func path(in rect: CGRect) -> Path {42        let scale = min(rect.width, rect.height) / AgentGlyphGrid.unit43        func point(_ x: CGFloat, _ y: CGFloat) -> CGPoint {44            CGPoint(x: rect.minX + x * scale, y: rect.minY + y * scale)45        }46        var path = Path()47        path.move(to: point(70, 64))48        path.addLine(to: point(84, 78))49        path.addLine(to: point(70, 92))50        return path51    }52}5354/// The Zyquo Agent glyph: violet Z monogram with a command caret.55struct AgentZGlyph: View {56    /// Rendered width and height (the glyph is square).57    var size: CGFloat58    var tint: Color = ZyquoColor.accent5960    private var lineWidth: CGFloat { size * 14 / AgentGlyphGrid.unit }6162    var body: some View {63        ZStack {64            AgentZStroke()65                .stroke(66                    tint,67                    style: StrokeStyle(lineWidth: lineWidth, lineCap: .round, lineJoin: .round)68                )69            AgentCaretStroke()70                .stroke(71                    tint.opacity(0.55),72                    style: StrokeStyle(lineWidth: lineWidth, lineCap: .round, lineJoin: .round)73                )74        }75        .frame(width: size, height: size)76        .accessibilityHidden(true)77    }78}79