-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathnotification.tsp
More file actions
134 lines (109 loc) · 4.63 KB
/
Copy pathnotification.tsp
File metadata and controls
134 lines (109 loc) · 4.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/**
* @module Shep.Common.Enums.Notification
*
* Defines enums for the agent notification subsystem. These enums classify
* the types of agent lifecycle events that trigger notifications and the
* severity levels used for rendering (toast color, icon, urgency).
*
* ## Notification Events
*
* Notifications are emitted for a curated set of meaningful agent lifecycle
* transitions: started, phase completed, waiting for approval, completed,
* and failed. Intermediate heartbeats and user-initiated states (cancelled)
* are excluded to avoid noise.
*
* ## Severity Mapping
*
* | Event | Severity |
* |--------------------|----------|
* | Agent Started | info |
* | Phase Completed | info |
* | Waiting Approval | warning |
* | Agent Completed | success |
* | Agent Failed | error |
* | PR Merged | success |
* | PR Closed | warning |
* | PR Checks Passed | success |
* | PR Checks Failed | error |
* | PR Blocked | warning |
* | MR Review Ready | info |
* | Workflow Started | info |
* | Workflow Completed | success |
* | Workflow Failed | error |
*/
/**
* Types of agent lifecycle events that trigger notifications.
*
* ```
* agent_started ──► phase_completed (×N) ──► agent_completed
* └──► waiting_approval ──► ...
* └──► agent_failed
* ```
*/
@doc("Types of agent lifecycle notification events")
enum NotificationEventType {
@doc("Agent has started running")
AgentStarted: "agent_started",
@doc("Agent completed a workflow phase (analyze, requirements, research, plan, implement)")
PhaseCompleted: "phase_completed",
@doc("Agent is paused awaiting human approval")
WaitingApproval: "waiting_approval",
@doc("Agent completed successfully")
AgentCompleted: "agent_completed",
@doc("Agent execution failed with an error")
AgentFailed: "agent_failed",
@doc("Pull request was merged on GitHub")
PrMerged: "pr_merged",
@doc("Pull request was closed without merging on GitHub")
PrClosed: "pr_closed",
@doc("Pull request CI checks passed")
PrChecksPassed: "pr_checks_passed",
@doc("Pull request CI checks failed")
PrChecksFailed: "pr_checks_failed",
@doc("Pull request has merge conflicts and cannot be merged")
PrBlocked: "pr_blocked",
@doc("Feature is ready for merge review — PR created and waiting for approval")
MergeReviewReady: "merge_review_ready",
@doc("Cloud deployment status changed — emitted by the in-process cloud deployment event bus")
CloudDeploymentUpdated: "cloud_deployment_updated",
@doc("Application row changed — one or more of setupComplete, status, gitRemoteUrl, or cloudDeploymentProvider transitioned since the last poll")
ApplicationUpdated: "application_updated",
@doc("A new OperationLogEntry was appended for a long-running operation (scaffold, cloud deploy, git publish, repo sync)")
OperationLogAppended: "operation_log_appended",
@doc("A non-blocking AgentQuestion was raised by a running agent and is awaiting an answer (spec 093)")
AgentQuestionPending: "agent_question_pending",
@doc("A blocking AgentQuestion was raised by a running agent — the agent is paused and MUST be answered (spec 093)")
AgentQuestionBlocking: "agent_question_blocking",
@doc("An inter-agent message could not be delivered or was rejected by the hub (spec 093)")
AgentMessageBlocked: "agent_message_blocked",
@doc("Supervisor agent escalated a decision back to the user (spec 093)")
SupervisorEscalated: "supervisor_escalated",
@doc("Supervisor agent evaluation failed (timeout, model error, exception); fell back to standard human approval (spec 093, FR-22)")
SupervisorFailed: "supervisor_failed",
@doc("Scheduled workflow execution has started")
WorkflowStarted: "workflow_started",
@doc("Scheduled workflow execution completed successfully")
WorkflowCompleted: "workflow_completed",
@doc("Scheduled workflow execution failed with an error")
WorkflowFailed: "workflow_failed",
}
/**
* Severity level for notification display rendering.
*
* Maps to toast variants:
* - info → toast.info()
* - warning → toast.warning()
* - success → toast.success()
* - error → toast.error()
*/
@doc("Severity level for notification display")
enum NotificationSeverity {
@doc("Informational event (agent started, phase completed)")
Info: "info",
@doc("Warning requiring attention (waiting for approval)")
Warning: "warning",
@doc("Successful outcome (agent completed)")
Success: "success",
@doc("Error condition (agent failed)")
Error: "error",
}