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
//! # Handler trait.
//!
//! [`ApiHandler`] defines the transport-agnostic API surface.
//! Implement this trait to plug custom logic (auth, rate limiting, metrics) between the wire layer and the supervisor.
use Pin;
use async_trait;
use ;
use Stream;
use crateApiError;
/// Boxed stream of [`OutputEvent`]s — the wire-side surface of live task logs.
pub type OutputEventStream = ;
/// Task execution API handler.
///
/// ## Also
///
/// - [`SupervisorApiAdapter`](crate::SupervisorApiAdapter) ready-to-use implementation.
/// - [`ApiError`](crate::ApiError) error type returned by all methods.
///
/// This trait abstracts the backend implementation, allowing users to:
/// - Use the provided [`SupervisorApiAdapter`](crate::SupervisorApiAdapter)
/// - Implement custom handlers with additional logic (auth, rate limiting, etc.)
///
/// ## API surface
///
/// | Method | HTTP | gRPC |
/// |--------------------|-----------------------------------|---------------------|
/// | `submit_task` | `POST /api/v1/tasks` | `SubmitTask` |
/// | `get_task_status` | `GET /api/v1/tasks/{id}` | `GetTaskStatus` |
/// | `query_tasks` | `GET /api/v1/tasks` | `ListTasks` |
/// | `list_task_runs` | `GET /api/v1/tasks/{id}/runs` | `ListTaskRuns` |
/// | `delete_task` | `DELETE /api/v1/tasks/{id}` | `DeleteTask` |
/// | `stream_task_logs` | `GET /api/v1/tasks/{id}/logs` | `StreamTaskLogs` |