@taico/events 0.2.8 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -20,6 +20,8 @@ export declare const ExecutionWireEvents: {
|
|
|
20
20
|
readonly EXECUTION_ACTIVITY: "execution.activity";
|
|
21
21
|
readonly EXECUTION_ACTIVITY_POST: "execution.activity.post";
|
|
22
22
|
readonly EXECUTION_HEARTBEAT_POST: "execution.heartbeat.post";
|
|
23
|
+
readonly WORKER_HEARTBEAT_POST: "worker.heartbeat.post";
|
|
24
|
+
readonly WORKER_HARNESSES_REPORT_REQUESTED: "worker.harnesses.report.requested";
|
|
23
25
|
};
|
|
24
26
|
export type ExecutionWireEventName = (typeof ExecutionWireEvents)[keyof typeof ExecutionWireEvents];
|
|
25
27
|
/**
|
|
@@ -19,6 +19,8 @@ export const ExecutionWireEvents = {
|
|
|
19
19
|
EXECUTION_ACTIVITY: 'execution.activity',
|
|
20
20
|
EXECUTION_ACTIVITY_POST: 'execution.activity.post',
|
|
21
21
|
EXECUTION_HEARTBEAT_POST: 'execution.heartbeat.post',
|
|
22
|
+
WORKER_HEARTBEAT_POST: 'worker.heartbeat.post',
|
|
23
|
+
WORKER_HARNESSES_REPORT_REQUESTED: 'worker.harnesses.report.requested',
|
|
22
24
|
};
|
|
23
25
|
/**
|
|
24
26
|
* Type guards for event identification
|
package/package.json
CHANGED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Worker Wire Event Types for WebSocket Communication
|
|
3
|
-
*
|
|
4
|
-
* These types define the structure of events sent between backend and workers
|
|
5
|
-
* via WebSocket for the Workers domain. They serve as a contract between the
|
|
6
|
-
* backend gateway and worker clients.
|
|
7
|
-
*
|
|
8
|
-
* Import these types in both backend (for emission/reception) and worker (for emission/reception)
|
|
9
|
-
* to ensure type safety across the wire protocol.
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* Wire event names for Workers domain
|
|
13
|
-
* These are the stable, external event identifiers sent over the wire protocol.
|
|
14
|
-
*/
|
|
15
|
-
export declare const WorkerWireEvents: {
|
|
16
|
-
readonly WORKER_HELLO: "worker.hello";
|
|
17
|
-
readonly WORKER_HEARTBEAT: "worker.heartbeat";
|
|
18
|
-
readonly RUN_STARTED: "run.started";
|
|
19
|
-
readonly RUN_COMPLETED: "run.completed";
|
|
20
|
-
readonly RUN_FAILED: "run.failed";
|
|
21
|
-
readonly RUN_ASSIGNED: "run.assigned";
|
|
22
|
-
readonly STOP_REQUESTED: "stop.requested";
|
|
23
|
-
};
|
|
24
|
-
export type WorkerWireEventName = (typeof WorkerWireEvents)[keyof typeof WorkerWireEvents];
|
|
25
|
-
/**
|
|
26
|
-
* Worker hello message payload
|
|
27
|
-
* Sent by worker on connection to register itself with metadata
|
|
28
|
-
*/
|
|
29
|
-
export interface WorkerHelloPayload {
|
|
30
|
-
hostname?: string;
|
|
31
|
-
pid?: number;
|
|
32
|
-
version?: string;
|
|
33
|
-
capabilities?: string[];
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Worker heartbeat message payload
|
|
37
|
-
* Sent periodically by worker to indicate it's still alive
|
|
38
|
-
*/
|
|
39
|
-
export interface WorkerHeartbeatPayload {
|
|
40
|
-
sessionId: string;
|
|
41
|
-
timestamp: number;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Run started message payload
|
|
45
|
-
* Sent by worker when it begins executing a task
|
|
46
|
-
*/
|
|
47
|
-
export interface RunStartedPayload {
|
|
48
|
-
executionId: string;
|
|
49
|
-
sessionId: string;
|
|
50
|
-
startedAt: string;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Run completed message payload
|
|
54
|
-
* Sent by worker when task execution finishes successfully
|
|
55
|
-
*/
|
|
56
|
-
export interface RunCompletedPayload {
|
|
57
|
-
executionId: string;
|
|
58
|
-
sessionId: string;
|
|
59
|
-
completedAt: string;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Run failed message payload
|
|
63
|
-
* Sent by worker when task execution fails
|
|
64
|
-
*/
|
|
65
|
-
export interface RunFailedPayload {
|
|
66
|
-
executionId: string;
|
|
67
|
-
sessionId: string;
|
|
68
|
-
failedAt: string;
|
|
69
|
-
reason?: string;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Run assigned wire event
|
|
73
|
-
* Sent by backend to worker when a task execution is assigned
|
|
74
|
-
*/
|
|
75
|
-
export interface RunAssignedWireEvent {
|
|
76
|
-
executionId: string;
|
|
77
|
-
taskId: string;
|
|
78
|
-
agentActorId: string;
|
|
79
|
-
triggerReason?: string;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Stop requested wire event
|
|
83
|
-
* Sent by backend to worker to request stopping a running execution
|
|
84
|
-
*/
|
|
85
|
-
export interface StopRequestedWireEvent {
|
|
86
|
-
executionId: string;
|
|
87
|
-
taskId: string;
|
|
88
|
-
reason?: string;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Worker hello wire event
|
|
92
|
-
* Response sent by backend after successful registration
|
|
93
|
-
*/
|
|
94
|
-
export interface WorkerHelloResponse {
|
|
95
|
-
sessionId: string;
|
|
96
|
-
serverTime: number;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Worker heartbeat wire event
|
|
100
|
-
* Response sent by backend after processing heartbeat
|
|
101
|
-
*/
|
|
102
|
-
export interface WorkerHeartbeatResponse {
|
|
103
|
-
ok: boolean;
|
|
104
|
-
serverTime: number;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Generic acknowledgment for run lifecycle events
|
|
108
|
-
*/
|
|
109
|
-
export interface RunLifecycleAck {
|
|
110
|
-
ok: boolean;
|
|
111
|
-
executionId: string;
|
|
112
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Worker Wire Event Types for WebSocket Communication
|
|
3
|
-
*
|
|
4
|
-
* These types define the structure of events sent between backend and workers
|
|
5
|
-
* via WebSocket for the Workers domain. They serve as a contract between the
|
|
6
|
-
* backend gateway and worker clients.
|
|
7
|
-
*
|
|
8
|
-
* Import these types in both backend (for emission/reception) and worker (for emission/reception)
|
|
9
|
-
* to ensure type safety across the wire protocol.
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* Wire event names for Workers domain
|
|
13
|
-
* These are the stable, external event identifiers sent over the wire protocol.
|
|
14
|
-
*/
|
|
15
|
-
export const WorkerWireEvents = {
|
|
16
|
-
// Worker -> Backend
|
|
17
|
-
WORKER_HELLO: 'worker.hello',
|
|
18
|
-
WORKER_HEARTBEAT: 'worker.heartbeat',
|
|
19
|
-
RUN_STARTED: 'run.started',
|
|
20
|
-
RUN_COMPLETED: 'run.completed',
|
|
21
|
-
RUN_FAILED: 'run.failed',
|
|
22
|
-
// Backend -> Worker
|
|
23
|
-
RUN_ASSIGNED: 'run.assigned',
|
|
24
|
-
STOP_REQUESTED: 'stop.requested',
|
|
25
|
-
};
|