{
  "accessibility" : [
    "Status is always a symbol and a word; colour only reinforces it.",
    "Each task header and each step is one combined element (\"Group by topic, Running, Topic 3 of 5\"); running ones have the \"updates frequently\" trait.",
    "The progress bar is labelled with the task title and its value is \"2 of 5 steps completed\".",
    "Errors read \"Error: <message>\". The cancel button reads \"Cancel, <task title>\".",
    "The step list is a system `DisclosureGroup`: keyboard and VoiceOver expansion are the system's."
  ],
  "category" : "ai",
  "changelog" : [
    {
      "changes" : [
        "Release 1.1.0: see the project changelog."
      ],
      "date" : "2026-12-03",
      "version" : "1.1.0"
    },
    {
      "changes" : [
        "Initial release."
      ],
      "date" : "2026-12-02",
      "version" : "1.0.0"
    }
  ],
  "dependencies" : [
    {
      "id" : "glass-foundation",
      "version" : "1.1.0"
    }
  ],
  "description" : "Tasks and observable steps with status, progress, errors and cancellation.",
  "examples" : [
    {
      "code" : "import SwiftUI\nimport SPGlassKit\n\npublic struct GlassAgentPanelExample: GlassExample {\n    public static let componentID = \"glass-agent-panel\"\n\n    /// Fictitious tasks: nothing is executed, the example only edits these values.\n    @State private var tasks = [\n        GlassAgentTask(id: \"t1\", title: \"Prepare the sample weekly digest\", status: .running, steps: [\n            GlassAgentStep(id: \"s1\", title: \"Collect sample notes\", status: .succeeded, detail: \"12 notes found\"),\n            GlassAgentStep(id: \"s2\", title: \"Group by topic\", status: .running, detail: \"Topic 3 of 5\"),\n            GlassAgentStep(id: \"s3\", title: \"Write the digest\", status: .pending),\n        ]),\n        GlassAgentTask(id: \"t2\", title: \"Rename sample files with a deliberately long task title that wraps over two lines\", status: .failed, steps: [\n            GlassAgentStep(id: \"s1\", title: \"List files\", status: .succeeded),\n            GlassAgentStep(id: \"s2\", title: \"Apply new names\", status: .failed, detail: \"4 of 9 renamed\", errorMessage: \"Sample failure: a file with this name already exists.\"),\n        ]),\n        GlassAgentTask(id: \"t3\", title: \"Translate sample page\", status: .succeeded, steps: [\n            GlassAgentStep(id: \"s1\", title: \"Detect language\", status: .succeeded),\n            GlassAgentStep(id: \"s2\", title: \"Translate\", status: .succeeded),\n        ]),\n        GlassAgentTask(id: \"t4\", title: \"Queued sample export\", status: .pending),\n        GlassAgentTask(id: \"t5\", title: \"Sample clean-up\", status: .cancelled, steps: [\n            GlassAgentStep(id: \"s1\", title: \"Scan\", status: .cancelled),\n        ], errorMessage: nil),\n    ]\n\n    public init() {}\n\n    public var body: some View {\n        ScrollView {\n            VStack(alignment: .leading, spacing: 12) {\n                Text(\"Sample data · simulated tasks, no agent is running\")\n                    .font(.caption)\n                    .foregroundStyle(.secondary)\n                GlassAgentPanel(tasks: tasks) { task in\n                    cancel(task.id)\n                }\n                GlassButton(\"Advance the running task\", systemImage: \"forward.frame\") { advance() }\n                Divider()\n                Text(\"No task\")\n                    .font(.headline)\n                GlassAgentPanel(tasks: [])\n            }\n            .padding()\n        }\n    }\n\n    private func cancel(_ id: String) {\n        guard let index = tasks.firstIndex(where: { $0.id == id }) else { return }\n        tasks[index].status = .cancelled\n        for step in tasks[index].steps.indices where !tasks[index].steps[step].status.isTerminal {\n            tasks[index].steps[step].status = .cancelled\n        }\n    }\n\n    /// Completes the running step of the first running task and starts the next one.\n    private func advance() {\n        guard let index = tasks.firstIndex(where: { $0.status == .running }) else { return }\n        if let running = tasks[index].steps.firstIndex(where: { $0.status == .running }) {\n            tasks[index].steps[running].status = .succeeded\n        }\n        if let next = tasks[index].steps.firstIndex(where: { $0.status == .pending }) {\n            tasks[index].steps[next].status = .running\n        } else {\n            tasks[index].status = .succeeded\n        }\n    }\n}\n\n#Preview(\"GlassAgentPanel\") { GlassAgentPanelExample().glassTheme(.obsidian) }\n",
      "title" : "GlassAgentPanel example"
    }
  ],
  "files" : [
    {
      "bytes" : 18345,
      "path" : "AI/AI/GlassAgentPanel.swift",
      "sha256" : "8217875e84f8ba64baf96e71cc306080840a8c294d772a350d172149ba8df83d"
    }
  ],
  "frameworks" : [

  ],
  "id" : "glass-agent-panel",
  "kind" : "content-component",
  "license" : "MIT",
  "minimumOS" : {
    "iOS" : "26.0",
    "iPadOS" : "26.0",
    "macOS" : "26.0"
  },
  "name" : "GlassAgentPanel",
  "platforms" : [
    "iOS",
    "iPadOS",
    "macOS"
  ],
  "schemaVersion" : 1,
  "sha256" : "9f1fdbec04e33294640174822d0d1b2aa68a4b25ffef350086f436fee86fca98",
  "symbols" : [
    "GlassAgentStatus",
    "GlassAgentStep",
    "GlassAgentTask",
    "GlassAgentProgress",
    "GlassAgentPanel"
  ],
  "version" : "1.1.0"
}
