{
    "tailapp": 2,
    "manifest": {
        "format": 2,
        "app_id": "remote",
        "name": "Remote",
        "version": 1,
        "schema": "tailapps/v0",
        "exported_at": 1795026113,
        "from": "gallery",
        "connections": [],
        "files": {
            "app.json": "265a697a3c61634be347beb4185ad2c3803677908b3ec6d00c3400261aeb527f"
        },
        "signature": "zKuFVHzgnc6N7k6nPw3T3fQ+YtGu6fer2RJ6YgadQ5cX55mgnZr3E7S1N6sWicVATLNFhhR95fC9J5uaWCjWAw==",
        "key_id": "gallery-1"
    },
    "app": {
        "schema": "tailapps/v0",
        "app": "remote",
        "name": "Remote",
        "description": "iPhone buttons that run commands on your Mac (deploy to Vercel, git pull, git status) in one project folder; the Mac replies to that phone. Turn on Sync to My Devices on both.",
        "icon": "av.remote",
        "version": 1,
        "permissions": [
            "script:run.sh",
            "inbox:jobs",
            "send:jobs",
            "inbox:results",
            "send:results"
        ],
        "settings": {
            "project": {
                "type": "folder",
                "label": "Project folder",
                "required": true,
                "sync": false,
                "platforms": [
                    "macos"
                ]
            }
        },
        "scripts": {
            "run.sh": "#!/bin/sh\n# Runs one of three fixed jobs in the project folder ($2) and prints { job, ok, output } as JSON.\n# $1 names the job; it is never run as a command, and anything else is refused. Always exits 0, so the\n# app can reply to the phone that asked even when the job fails.\njob=\"$1\"\ndir=\"$2\"\nreply() { printf '%s' \"$3\" | tail -n 15 | jq -Rs --arg job \"$1\" --argjson ok \"$2\" '{job: $job, ok: $ok, output: .}'; }\nif ! cd \"$dir\" 2>/dev/null; then\n  reply \"$job\" false \"The project folder is missing. Pick it again in Settings.\"\n  exit 0\nfi\ncase \"$job\" in\n  deploy) out=$(vercel deploy --prod --yes 2>&1) ;;\n  pull) out=$(git pull --ff-only 2>&1) ;;\n  status) out=$(git status --short --branch 2>&1) ;;\n  *) reply \"$job\" false \"Unknown job\"; exit 0 ;;\nesac\nif [ $? -eq 0 ]; then reply \"$job\" true \"$out\"; else reply \"$job\" false \"$out\"; fi\n"
        },
        "state": {
            "last": {
                "type": "object",
                "default": []
            },
            "waiting": {
                "type": "text",
                "default": "",
                "sync": false
            }
        },
        "sources": {
            "jobs": {
                "inbox": "jobs",
                "on_receive": "asked",
                "platforms": [
                    "macos"
                ]
            },
            "results": {
                "inbox": "results",
                "on_receive": "answered"
            }
        },
        "actions": {
            "run": {
                "args": {
                    "job": "enum:deploy|pull|status"
                },
                "confirm": "Run {$args.job} in the project folder?",
                "timeout": 660,
                "steps": [
                    {
                        "script": "run.sh",
                        "args": [
                            "$args.job",
                            "$settings.project"
                        ],
                        "timeout": 600,
                        "as": "out"
                    },
                    {
                        "set": {
                            "last": {
                                "job": "$out.job",
                                "ok": "$out.ok",
                                "output": "$out.output",
                                "at": "$now"
                            }
                        }
                    }
                ]
            },
            "ask": {
                "args": {
                    "job": "enum:deploy|pull|status"
                },
                "confirm": "Ask your Mac to run {$args.job}?",
                "steps": [
                    {
                        "send": {
                            "jobs": {
                                "job": "$args.job",
                                "at": "$now"
                            }
                        }
                    },
                    {
                        "set": {
                            "waiting": "$args.job"
                        }
                    }
                ]
            },
            "asked": {
                "timeout": 660,
                "steps": [
                    {
                        "if": "$args.event.job | map:{deploy:true, else:false}",
                        "then": [
                            {
                                "script": "run.sh",
                                "args": [
                                    "deploy",
                                    "$settings.project"
                                ],
                                "timeout": 600,
                                "as": "out"
                            },
                            {
                                "set": {
                                    "last": {
                                        "job": "$out.job",
                                        "ok": "$out.ok",
                                        "output": "$out.output",
                                        "at": "$now"
                                    }
                                }
                            },
                            {
                                "send": {
                                    "results": {
                                        "job": "$out.job",
                                        "ok": "$out.ok",
                                        "output": "$out.output",
                                        "at": "$now"
                                    }
                                },
                                "to": "$args.from_id",
                                "alert": "Deploy on your Mac: {$out.ok | map:{true:'done', else:'failed'}}"
                            }
                        ]
                    },
                    {
                        "if": "$args.event.job | map:{pull:true, else:false}",
                        "then": [
                            {
                                "script": "run.sh",
                                "args": [
                                    "pull",
                                    "$settings.project"
                                ],
                                "timeout": 600,
                                "as": "out"
                            },
                            {
                                "set": {
                                    "last": {
                                        "job": "$out.job",
                                        "ok": "$out.ok",
                                        "output": "$out.output",
                                        "at": "$now"
                                    }
                                }
                            },
                            {
                                "send": {
                                    "results": {
                                        "job": "$out.job",
                                        "ok": "$out.ok",
                                        "output": "$out.output",
                                        "at": "$now"
                                    }
                                },
                                "to": "$args.from_id",
                                "alert": "Pull on your Mac: {$out.ok | map:{true:'done', else:'failed'}}"
                            }
                        ]
                    },
                    {
                        "if": "$args.event.job | map:{status:true, else:false}",
                        "then": [
                            {
                                "script": "run.sh",
                                "args": [
                                    "status",
                                    "$settings.project"
                                ],
                                "timeout": 600,
                                "as": "out"
                            },
                            {
                                "set": {
                                    "last": {
                                        "job": "$out.job",
                                        "ok": "$out.ok",
                                        "output": "$out.output",
                                        "at": "$now"
                                    }
                                }
                            },
                            {
                                "send": {
                                    "results": {
                                        "job": "$out.job",
                                        "ok": "$out.ok",
                                        "output": "$out.output",
                                        "at": "$now"
                                    }
                                },
                                "to": "$args.from_id",
                                "alert": "Status on your Mac: {$out.ok | map:{true:'done', else:'failed'}}"
                            }
                        ]
                    }
                ]
            },
            "answered": {
                "steps": [
                    {
                        "if": "$args.event.job",
                        "then": [
                            {
                                "set": {
                                    "last": {
                                        "job": "$args.event.job",
                                        "ok": "$args.event.ok",
                                        "output": "$args.event.output",
                                        "at": "$args.event.at"
                                    },
                                    "waiting": ""
                                }
                            }
                        ]
                    }
                ]
            },
            "forget": {
                "steps": [
                    {
                        "set": {
                            "waiting": ""
                        }
                    }
                ]
            }
        },
        "cards": [
            {
                "id": "main",
                "layout": {
                    "column": [
                        {
                            "row": [
                                {
                                    "text": "$last.job | map:{deploy:'Deploy', pull:'Pull', status:'Status', else:'Nothing run yet'}",
                                    "emphasis": "strong",
                                    "grow": true
                                },
                                {
                                    "badge": "$last.ok | map:{true:'Done', else:'Failed'}",
                                    "tone": "$last.ok | map:{true:'good', else:'bad'}",
                                    "when": "$last.job"
                                }
                            ],
                            "align": "center"
                        },
                        {
                            "text": "$last.output | default:'Press a button to run a job.'",
                            "size": "xs",
                            "mono": true,
                            "lines": 8
                        },
                        {
                            "text": "{$last.job | upper} \u00b7 {$last.at | ago}",
                            "size": "xs",
                            "emphasis": "subtle",
                            "when": "$last.job"
                        },
                        {
                            "row": [
                                {
                                    "text": "Waiting for your Mac to run {$waiting}\u2026",
                                    "size": "s",
                                    "tone": "accent",
                                    "grow": true
                                },
                                {
                                    "button": "Stop Waiting",
                                    "on": "forget",
                                    "style": "plain"
                                }
                            ],
                            "align": "center",
                            "when": "$waiting",
                            "platforms": [
                                "ios"
                            ]
                        },
                        {
                            "row": [
                                {
                                    "button": "Deploy",
                                    "on": "run",
                                    "args": {
                                        "job": "deploy"
                                    },
                                    "style": "primary",
                                    "disabled": "$running.run"
                                },
                                {
                                    "button": "Pull",
                                    "on": "run",
                                    "args": {
                                        "job": "pull"
                                    },
                                    "disabled": "$running.run"
                                },
                                {
                                    "button": "Status",
                                    "on": "run",
                                    "args": {
                                        "job": "status"
                                    },
                                    "disabled": "$running.run"
                                }
                            ],
                            "gap": "s",
                            "platforms": [
                                "macos"
                            ]
                        },
                        {
                            "grid": [
                                {
                                    "button": "Deploy",
                                    "on": "ask",
                                    "args": {
                                        "job": "deploy"
                                    },
                                    "style": "primary",
                                    "size": "l",
                                    "disabled": "$waiting"
                                },
                                {
                                    "button": "Pull",
                                    "on": "ask",
                                    "args": {
                                        "job": "pull"
                                    },
                                    "size": "l",
                                    "disabled": "$waiting"
                                },
                                {
                                    "button": "Status",
                                    "on": "ask",
                                    "args": {
                                        "job": "status"
                                    },
                                    "size": "l",
                                    "disabled": "$waiting"
                                }
                            ],
                            "columns": 3,
                            "gap": "s",
                            "platforms": [
                                "ios"
                            ]
                        }
                    ],
                    "gap": "s"
                }
            }
        ],
        "views": {
            "menubar": {
                "icon": "av.remote",
                "card": "main",
                "label": "$last.ok | map:{true:'', false:'Failed', else:''}",
                "label_tone": "$last.ok | map:{true:'neutral', else:'bad'}"
            },
            "floating": {
                "card": "main",
                "width": "default"
            }
        }
    },
    "app_json": "{\n  \"schema\": \"tailapps/v0\",\n  \"app\": \"remote\",\n  \"name\": \"Remote\",\n  \"description\": \"iPhone buttons that run commands on your Mac (deploy to Vercel, git pull, git status) in one project folder; the Mac replies to that phone. Turn on Sync to My Devices on both.\",\n  \"icon\": \"av.remote\",\n  \"version\": 1,\n  \"permissions\": [\n    \"script:run.sh\",\n    \"inbox:jobs\",\n    \"send:jobs\",\n    \"inbox:results\",\n    \"send:results\"\n  ],\n  \"settings\": {\n    \"project\": {\n      \"type\": \"folder\",\n      \"label\": \"Project folder\",\n      \"required\": true,\n      \"sync\": false,\n      \"platforms\": [\n        \"macos\"\n      ]\n    }\n  },\n  \"scripts\": {\n    \"run.sh\": \"#!/bin/sh\\n# Runs one of three fixed jobs in the project folder ($2) and prints { job, ok, output } as JSON.\\n# $1 names the job; it is never run as a command, and anything else is refused. Always exits 0, so the\\n# app can reply to the phone that asked even when the job fails.\\njob=\\\"$1\\\"\\ndir=\\\"$2\\\"\\nreply() { printf '%s' \\\"$3\\\" | tail -n 15 | jq -Rs --arg job \\\"$1\\\" --argjson ok \\\"$2\\\" '{job: $job, ok: $ok, output: .}'; }\\nif ! cd \\\"$dir\\\" 2>/dev/null; then\\n  reply \\\"$job\\\" false \\\"The project folder is missing. Pick it again in Settings.\\\"\\n  exit 0\\nfi\\ncase \\\"$job\\\" in\\n  deploy) out=$(vercel deploy --prod --yes 2>&1) ;;\\n  pull) out=$(git pull --ff-only 2>&1) ;;\\n  status) out=$(git status --short --branch 2>&1) ;;\\n  *) reply \\\"$job\\\" false \\\"Unknown job\\\"; exit 0 ;;\\nesac\\nif [ $? -eq 0 ]; then reply \\\"$job\\\" true \\\"$out\\\"; else reply \\\"$job\\\" false \\\"$out\\\"; fi\\n\"\n  },\n  \"state\": {\n    \"last\": {\n      \"type\": \"object\",\n      \"default\": {}\n    },\n    \"waiting\": {\n      \"type\": \"text\",\n      \"default\": \"\",\n      \"sync\": false\n    }\n  },\n  \"sources\": {\n    \"jobs\": {\n      \"inbox\": \"jobs\",\n      \"on_receive\": \"asked\",\n      \"platforms\": [\n        \"macos\"\n      ]\n    },\n    \"results\": {\n      \"inbox\": \"results\",\n      \"on_receive\": \"answered\"\n    }\n  },\n  \"actions\": {\n    \"run\": {\n      \"args\": {\n        \"job\": \"enum:deploy|pull|status\"\n      },\n      \"confirm\": \"Run {$args.job} in the project folder?\",\n      \"timeout\": 660,\n      \"steps\": [\n        {\n          \"script\": \"run.sh\",\n          \"args\": [\n            \"$args.job\",\n            \"$settings.project\"\n          ],\n          \"timeout\": 600,\n          \"as\": \"out\"\n        },\n        {\n          \"set\": {\n            \"last\": {\n              \"job\": \"$out.job\",\n              \"ok\": \"$out.ok\",\n              \"output\": \"$out.output\",\n              \"at\": \"$now\"\n            }\n          }\n        }\n      ]\n    },\n    \"ask\": {\n      \"args\": {\n        \"job\": \"enum:deploy|pull|status\"\n      },\n      \"confirm\": \"Ask your Mac to run {$args.job}?\",\n      \"steps\": [\n        {\n          \"send\": {\n            \"jobs\": {\n              \"job\": \"$args.job\",\n              \"at\": \"$now\"\n            }\n          }\n        },\n        {\n          \"set\": {\n            \"waiting\": \"$args.job\"\n          }\n        }\n      ]\n    },\n    \"asked\": {\n      \"timeout\": 660,\n      \"steps\": [\n        {\n          \"if\": \"$args.event.job | map:{deploy:true, else:false}\",\n          \"then\": [\n            {\n              \"script\": \"run.sh\",\n              \"args\": [\n                \"deploy\",\n                \"$settings.project\"\n              ],\n              \"timeout\": 600,\n              \"as\": \"out\"\n            },\n            {\n              \"set\": {\n                \"last\": {\n                  \"job\": \"$out.job\",\n                  \"ok\": \"$out.ok\",\n                  \"output\": \"$out.output\",\n                  \"at\": \"$now\"\n                }\n              }\n            },\n            {\n              \"send\": {\n                \"results\": {\n                  \"job\": \"$out.job\",\n                  \"ok\": \"$out.ok\",\n                  \"output\": \"$out.output\",\n                  \"at\": \"$now\"\n                }\n              },\n              \"to\": \"$args.from_id\",\n              \"alert\": \"Deploy on your Mac: {$out.ok | map:{true:'done', else:'failed'}}\"\n            }\n          ]\n        },\n        {\n          \"if\": \"$args.event.job | map:{pull:true, else:false}\",\n          \"then\": [\n            {\n              \"script\": \"run.sh\",\n              \"args\": [\n                \"pull\",\n                \"$settings.project\"\n              ],\n              \"timeout\": 600,\n              \"as\": \"out\"\n            },\n            {\n              \"set\": {\n                \"last\": {\n                  \"job\": \"$out.job\",\n                  \"ok\": \"$out.ok\",\n                  \"output\": \"$out.output\",\n                  \"at\": \"$now\"\n                }\n              }\n            },\n            {\n              \"send\": {\n                \"results\": {\n                  \"job\": \"$out.job\",\n                  \"ok\": \"$out.ok\",\n                  \"output\": \"$out.output\",\n                  \"at\": \"$now\"\n                }\n              },\n              \"to\": \"$args.from_id\",\n              \"alert\": \"Pull on your Mac: {$out.ok | map:{true:'done', else:'failed'}}\"\n            }\n          ]\n        },\n        {\n          \"if\": \"$args.event.job | map:{status:true, else:false}\",\n          \"then\": [\n            {\n              \"script\": \"run.sh\",\n              \"args\": [\n                \"status\",\n                \"$settings.project\"\n              ],\n              \"timeout\": 600,\n              \"as\": \"out\"\n            },\n            {\n              \"set\": {\n                \"last\": {\n                  \"job\": \"$out.job\",\n                  \"ok\": \"$out.ok\",\n                  \"output\": \"$out.output\",\n                  \"at\": \"$now\"\n                }\n              }\n            },\n            {\n              \"send\": {\n                \"results\": {\n                  \"job\": \"$out.job\",\n                  \"ok\": \"$out.ok\",\n                  \"output\": \"$out.output\",\n                  \"at\": \"$now\"\n                }\n              },\n              \"to\": \"$args.from_id\",\n              \"alert\": \"Status on your Mac: {$out.ok | map:{true:'done', else:'failed'}}\"\n            }\n          ]\n        }\n      ]\n    },\n    \"answered\": {\n      \"steps\": [\n        {\n          \"if\": \"$args.event.job\",\n          \"then\": [\n            {\n              \"set\": {\n                \"last\": {\n                  \"job\": \"$args.event.job\",\n                  \"ok\": \"$args.event.ok\",\n                  \"output\": \"$args.event.output\",\n                  \"at\": \"$args.event.at\"\n                },\n                \"waiting\": \"\"\n              }\n            }\n          ]\n        }\n      ]\n    },\n    \"forget\": {\n      \"steps\": [\n        {\n          \"set\": {\n            \"waiting\": \"\"\n          }\n        }\n      ]\n    }\n  },\n  \"cards\": [\n    {\n      \"id\": \"main\",\n      \"layout\": {\n        \"column\": [\n          {\n            \"row\": [\n              {\n                \"text\": \"$last.job | map:{deploy:'Deploy', pull:'Pull', status:'Status', else:'Nothing run yet'}\",\n                \"emphasis\": \"strong\",\n                \"grow\": true\n              },\n              {\n                \"badge\": \"$last.ok | map:{true:'Done', else:'Failed'}\",\n                \"tone\": \"$last.ok | map:{true:'good', else:'bad'}\",\n                \"when\": \"$last.job\"\n              }\n            ],\n            \"align\": \"center\"\n          },\n          {\n            \"text\": \"$last.output | default:'Press a button to run a job.'\",\n            \"size\": \"xs\",\n            \"mono\": true,\n            \"lines\": 8\n          },\n          {\n            \"text\": \"{$last.job | upper} \u00b7 {$last.at | ago}\",\n            \"size\": \"xs\",\n            \"emphasis\": \"subtle\",\n            \"when\": \"$last.job\"\n          },\n          {\n            \"row\": [\n              {\n                \"text\": \"Waiting for your Mac to run {$waiting}\u2026\",\n                \"size\": \"s\",\n                \"tone\": \"accent\",\n                \"grow\": true\n              },\n              {\n                \"button\": \"Stop Waiting\",\n                \"on\": \"forget\",\n                \"style\": \"plain\"\n              }\n            ],\n            \"align\": \"center\",\n            \"when\": \"$waiting\",\n            \"platforms\": [\n              \"ios\"\n            ]\n          },\n          {\n            \"row\": [\n              {\n                \"button\": \"Deploy\",\n                \"on\": \"run\",\n                \"args\": {\n                  \"job\": \"deploy\"\n                },\n                \"style\": \"primary\",\n                \"disabled\": \"$running.run\"\n              },\n              {\n                \"button\": \"Pull\",\n                \"on\": \"run\",\n                \"args\": {\n                  \"job\": \"pull\"\n                },\n                \"disabled\": \"$running.run\"\n              },\n              {\n                \"button\": \"Status\",\n                \"on\": \"run\",\n                \"args\": {\n                  \"job\": \"status\"\n                },\n                \"disabled\": \"$running.run\"\n              }\n            ],\n            \"gap\": \"s\",\n            \"platforms\": [\n              \"macos\"\n            ]\n          },\n          {\n            \"grid\": [\n              {\n                \"button\": \"Deploy\",\n                \"on\": \"ask\",\n                \"args\": {\n                  \"job\": \"deploy\"\n                },\n                \"style\": \"primary\",\n                \"size\": \"l\",\n                \"disabled\": \"$waiting\"\n              },\n              {\n                \"button\": \"Pull\",\n                \"on\": \"ask\",\n                \"args\": {\n                  \"job\": \"pull\"\n                },\n                \"size\": \"l\",\n                \"disabled\": \"$waiting\"\n              },\n              {\n                \"button\": \"Status\",\n                \"on\": \"ask\",\n                \"args\": {\n                  \"job\": \"status\"\n                },\n                \"size\": \"l\",\n                \"disabled\": \"$waiting\"\n              }\n            ],\n            \"columns\": 3,\n            \"gap\": \"s\",\n            \"platforms\": [\n              \"ios\"\n            ]\n          }\n        ],\n        \"gap\": \"s\"\n      }\n    }\n  ],\n  \"views\": {\n    \"menubar\": {\n      \"icon\": \"av.remote\",\n      \"card\": \"main\",\n      \"label\": \"$last.ok | map:{true:'', false:'Failed', else:''}\",\n      \"label_tone\": \"$last.ok | map:{true:'neutral', else:'bad'}\"\n    },\n    \"floating\": {\n      \"card\": \"main\",\n      \"width\": \"default\"\n    }\n  }\n}\n",
    "files": []
}