{
    "tailapp": 2,
    "manifest": {
        "format": 2,
        "app_id": "on-air",
        "name": "On Air",
        "version": 1,
        "schema": "tailapps/v0",
        "exported_at": 1795564604,
        "from": "gallery",
        "connections": [],
        "files": {
            "app.json": "84a09b84aa1d3fe52f6aa062e1472aa8141da3505ef4485901bf9bcf0f3d0d84"
        },
        "signature": "z/ONiFAjmoHdD0Upn4+9hI1DWs1V/w/aj47Csg/8h6z3ewe6rE5lafeg4ksVRObu7djlHRDXdQ8QV+b6jp6sBQ==",
        "key_id": "gallery-1"
    },
    "app": {
        "schema": "tailapps/v0",
        "app": "on-air",
        "name": "On Air",
        "description": "On air in the menu bar while any app uses your mic or camera, the app in front, time away, and recent calls. It only knows that something listens, never what. Mac only.",
        "icon": "dot.radiowaves.left.and.right",
        "version": 1,
        "permissions": [
            "activity",
            "activity.apps"
        ],
        "sync": "never",
        "sources": {
            "mac": {
                "activity": [
                    "mic",
                    "camera",
                    "front_app",
                    "idle"
                ],
                "on_change": {
                    "action": "follow",
                    "watch": "{$mac.mic} {$mac.camera}"
                }
            }
        },
        "state": {
            "on_air": {
                "type": "bool",
                "default": false
            },
            "was": {
                "type": "bool",
                "default": false
            },
            "calls": {
                "type": "list",
                "default": []
            }
        },
        "actions": {
            "follow": {
                "steps": [
                    {
                        "set": {
                            "was": "$on_air"
                        }
                    },
                    {
                        "if": "$mac.mic",
                        "then": [
                            {
                                "set": {
                                    "on_air": true
                                }
                            }
                        ],
                        "else": [
                            {
                                "if": "$mac.camera",
                                "then": [
                                    {
                                        "set": {
                                            "on_air": true
                                        }
                                    }
                                ],
                                "else": [
                                    {
                                        "set": {
                                            "on_air": false
                                        }
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "if": "$on_air",
                        "then": [
                            {
                                "if": "$was | map:{true:false, else:true}",
                                "then": [
                                    {
                                        "push": {
                                            "calls": {
                                                "at": "$now",
                                                "app": "$mac.front_app.name"
                                            }
                                        },
                                        "max": 20
                                    }
                                ]
                            }
                        ]
                    }
                ]
            },
            "clear": {
                "steps": [
                    {
                        "set": {
                            "calls": []
                        }
                    }
                ]
            }
        },
        "cards": [
            {
                "id": "main",
                "layout": {
                    "column": [
                        {
                            "column": [
                                {
                                    "cell": "Microphone",
                                    "leading": "mic",
                                    "subtitle": "$mac.mic | map:{true:'In use', else:'Not in use'}",
                                    "status": "$mac.mic | map:{true:'bad', else:'neutral'}"
                                },
                                {
                                    "cell": "Camera",
                                    "leading": "video",
                                    "subtitle": "$mac.camera | map:{true:'In use', else:'Not in use'}",
                                    "status": "$mac.camera | map:{true:'bad', else:'neutral'}"
                                },
                                {
                                    "cell": "In front",
                                    "leading": "macwindow",
                                    "subtitle": "$mac.front_app.name | default:'\u2014'"
                                },
                                {
                                    "cell": "You",
                                    "leading": "person",
                                    "subtitle": "$mac.idle | map:{0:'Here', else:'Away'}",
                                    "trailing": "$mac.idle | duration"
                                }
                            ],
                            "style": "inset"
                        },
                        {
                            "section": "Calls",
                            "trailing": {
                                "button": "Clear",
                                "on": "clear",
                                "style": "plain"
                            },
                            "when": "$calls",
                            "children": [
                                {
                                    "list": "$calls",
                                    "limit": 10,
                                    "item": {
                                        "cell": "$item.at | date:'short'",
                                        "subtitle": "In front: {$item.app}",
                                        "trailing": "$item.at | ago"
                                    }
                                }
                            ]
                        }
                    ],
                    "gap": "m"
                }
            }
        ],
        "views": {
            "menubar": {
                "icon": "dot.radiowaves.left.and.right",
                "card": "main",
                "label": "$on_air | map:{true:'On air', else:''}",
                "label_tone": "$on_air | map:{true:'bad', else:'neutral'}"
            }
        }
    },
    "app_json": "{\n  \"schema\": \"tailapps/v0\",\n  \"app\": \"on-air\",\n  \"name\": \"On Air\",\n  \"description\": \"On air in the menu bar while any app uses your mic or camera, the app in front, time away, and recent calls. It only knows that something listens, never what. Mac only.\",\n  \"icon\": \"dot.radiowaves.left.and.right\",\n  \"version\": 1,\n  \"permissions\": [\"activity\", \"activity.apps\"],\n  \"sync\": \"never\",\n  \"sources\": {\n    \"mac\": {\n      \"activity\": [\"mic\", \"camera\", \"front_app\", \"idle\"],\n      \"on_change\": { \"action\": \"follow\", \"watch\": \"{$mac.mic} {$mac.camera}\" }\n    }\n  },\n  \"state\": {\n    \"on_air\": { \"type\": \"bool\", \"default\": false },\n    \"was\": { \"type\": \"bool\", \"default\": false },\n    \"calls\": { \"type\": \"list\", \"default\": [] }\n  },\n  \"actions\": {\n    \"follow\": {\n      \"steps\": [\n        { \"set\": { \"was\": \"$on_air\" } },\n        {\n          \"if\": \"$mac.mic\",\n          \"then\": [{ \"set\": { \"on_air\": true } }],\n          \"else\": [{ \"if\": \"$mac.camera\", \"then\": [{ \"set\": { \"on_air\": true } }], \"else\": [{ \"set\": { \"on_air\": false } }] }]\n        },\n        {\n          \"if\": \"$on_air\",\n          \"then\": [\n            { \"if\": \"$was | map:{true:false, else:true}\", \"then\": [{ \"push\": { \"calls\": { \"at\": \"$now\", \"app\": \"$mac.front_app.name\" } }, \"max\": 20 }] }\n          ]\n        }\n      ]\n    },\n    \"clear\": {\n      \"steps\": [{ \"set\": { \"calls\": [] } }]\n    }\n  },\n  \"cards\": [\n    {\n      \"id\": \"main\",\n      \"layout\": {\n        \"column\": [\n          {\n            \"column\": [\n              { \"cell\": \"Microphone\", \"leading\": \"mic\", \"subtitle\": \"$mac.mic | map:{true:'In use', else:'Not in use'}\", \"status\": \"$mac.mic | map:{true:'bad', else:'neutral'}\" },\n              { \"cell\": \"Camera\", \"leading\": \"video\", \"subtitle\": \"$mac.camera | map:{true:'In use', else:'Not in use'}\", \"status\": \"$mac.camera | map:{true:'bad', else:'neutral'}\" },\n              { \"cell\": \"In front\", \"leading\": \"macwindow\", \"subtitle\": \"$mac.front_app.name | default:'\u2014'\" },\n              { \"cell\": \"You\", \"leading\": \"person\", \"subtitle\": \"$mac.idle | map:{0:'Here', else:'Away'}\", \"trailing\": \"$mac.idle | duration\" }\n            ],\n            \"style\": \"inset\"\n          },\n          {\n            \"section\": \"Calls\",\n            \"trailing\": { \"button\": \"Clear\", \"on\": \"clear\", \"style\": \"plain\" },\n            \"when\": \"$calls\",\n            \"children\": [\n              { \"list\": \"$calls\", \"limit\": 10, \"item\": { \"cell\": \"$item.at | date:'short'\", \"subtitle\": \"In front: {$item.app}\", \"trailing\": \"$item.at | ago\" } }\n            ]\n          }\n        ],\n        \"gap\": \"m\"\n      }\n    }\n  ],\n  \"views\": {\n    \"menubar\": {\n      \"icon\": \"dot.radiowaves.left.and.right\",\n      \"card\": \"main\",\n      \"label\": \"$on_air | map:{true:'On air', else:''}\",\n      \"label_tone\": \"$on_air | map:{true:'bad', else:'neutral'}\"\n    }\n  }\n}\n",
    "files": []
}