tempScriptPath returns os.TempDir()/flow-warp- .sh. UUID is 16 crypto/rand bytes hex-encoded — sufficient uniqueness for concurrent spawns. No dependency on internal/app's UUID helper because backend packages shouldn't import app.
()
| 223 | // spawns. No dependency on internal/app's UUID helper because backend |
| 224 | // packages shouldn't import app. |
| 225 | func tempScriptPath() (string, error) { |
| 226 | var buf [16]byte |
| 227 | if _, err := rand.Read(buf[:]); err != nil { |
| 228 | return "", fmt.Errorf("generate warp script id: %w", err) |
| 229 | } |
| 230 | name := fmt.Sprintf("flow-warp-%s.sh", hex.EncodeToString(buf[:])) |
| 231 | return filepath.Join(os.TempDir(), name), nil |
| 232 | } |
| 233 | |
| 234 | // isAccessibilityDenied reports whether an osascript failure looks |
| 235 | // like a missing-Accessibility-permission error. Matches the same |