Attach run artifacts to app notifications

This commit is contained in:
2026-11-12 18:39:03 +00:00
parent f102ff94ea
commit d42d7a3534
10 changed files with 266 additions and 18 deletions
+1
View File
@@ -56,6 +56,7 @@ type NotificationPolicy struct {
On []string `json:"on"`
Destination string `json:"destination"`
Artifacts []string `json:"artifacts,omitempty"`
Open string `json:"open,omitempty"`
}
// Public phone setup only. Never include publishing endpoints or credentials.
+17 -5
View File
@@ -72,17 +72,29 @@ type AppNotification struct {
Kind string `json:"kind"`
Title string `json:"title"`
Message string `json:"message"`
// Click is the same deep link ntfy gets (pipelines://run/<id>,
// pipelines://chat/<id>).
Click string `json:"click"`
Priority int `json:"priority"`
Tags []string `json:"tags"`
// Click is the app tap target (normally the same run deep link ntfy gets).
Click string `json:"click"`
RunClick string `json:"run_click,omitempty"`
Artifact *NotificationArtifact `json:"artifact,omitempty"`
Preview string `json:"preview,omitempty"`
Priority int `json:"priority"`
Tags []string `json:"tags"`
// CreatedAt is RFC3339 (UTC).
CreatedAt string `json:"created_at"`
// Group is "run:<id>" or "chat:<id>" for Android notification grouping.
Group string `json:"group"`
}
// NotificationArtifact is the run artifact opened by an app notification.
type NotificationArtifact struct {
RunID int64 `json:"run_id"`
Sequence int `json:"sequence"`
Path string `json:"path"`
Name string `json:"name"`
URL string `json:"url"`
MediaType string `json:"media_type"`
}
// ValidateClearNotifications checks a clear_notifications id list.
func ValidateClearNotifications(ids []string) ([]string, error) {
if len(ids) == 0 {