@taico/events 0.8.6 → 0.9.1
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/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
# @taico/events
|
|
2
2
|
|
|
3
|
-
[](https://badge.socket.dev/npm/package/@taico/events/0.9.1)
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -19,12 +19,14 @@ export declare const ExecutionWireEvents: {
|
|
|
19
19
|
readonly EXECUTION_DELETED: "execution.deleted";
|
|
20
20
|
readonly EXECUTION_ACTIVITY: "execution.activity";
|
|
21
21
|
readonly EXECUTION_ACTIVITY_POST: "execution.activity.post";
|
|
22
|
+
readonly EXECUTION_TRACE_POST: "execution.trace.post";
|
|
22
23
|
readonly EXECUTION_HEARTBEAT_POST: "execution.heartbeat.post";
|
|
23
24
|
readonly WORKER_HEARTBEAT_POST: "worker.heartbeat.post";
|
|
24
25
|
readonly WORKER_HARNESSES_REPORT_REQUESTED: "worker.harnesses.report.requested";
|
|
25
26
|
readonly TASK_EXECUTION_QUEUED: "task.execution.queued";
|
|
26
27
|
readonly EXECUTION_INTERRUPT_REQUEST: "execution.interrupt.request";
|
|
27
28
|
readonly EXECUTIONS_CHANGED: "executions.changed";
|
|
29
|
+
readonly EXECUTION_TRACES_CHANGED: "execution.traces.changed";
|
|
28
30
|
};
|
|
29
31
|
export type ExecutionWireEventName = (typeof ExecutionWireEvents)[keyof typeof ExecutionWireEvents];
|
|
30
32
|
/**
|
|
@@ -18,12 +18,14 @@ export const ExecutionWireEvents = {
|
|
|
18
18
|
EXECUTION_DELETED: 'execution.deleted',
|
|
19
19
|
EXECUTION_ACTIVITY: 'execution.activity',
|
|
20
20
|
EXECUTION_ACTIVITY_POST: 'execution.activity.post',
|
|
21
|
+
EXECUTION_TRACE_POST: 'execution.trace.post',
|
|
21
22
|
EXECUTION_HEARTBEAT_POST: 'execution.heartbeat.post',
|
|
22
23
|
WORKER_HEARTBEAT_POST: 'worker.heartbeat.post',
|
|
23
24
|
WORKER_HARNESSES_REPORT_REQUESTED: 'worker.harnesses.report.requested',
|
|
24
25
|
TASK_EXECUTION_QUEUED: 'task.execution.queued',
|
|
25
26
|
EXECUTION_INTERRUPT_REQUEST: 'execution.interrupt.request',
|
|
26
27
|
EXECUTIONS_CHANGED: 'executions.changed',
|
|
28
|
+
EXECUTION_TRACES_CHANGED: 'execution.traces.changed',
|
|
27
29
|
};
|
|
28
30
|
/**
|
|
29
31
|
* Type guards for event identification
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export interface ExecutionTracesChangedWireEvent {
|
|
2
|
+
executionId: string;
|
|
3
|
+
}
|
|
4
|
+
/** Raw JSON from a harness, without formatter filtering or normalization. */
|
|
5
|
+
export type HarnessJson = null | boolean | number | string | HarnessJson[] | {
|
|
6
|
+
[key: string]: HarnessJson;
|
|
7
|
+
};
|
|
8
|
+
export interface ExecutionTraceEvent {
|
|
9
|
+
sequence: number;
|
|
10
|
+
emittedAt: string;
|
|
11
|
+
runnerSessionId: string | null;
|
|
12
|
+
payload: HarnessJson;
|
|
13
|
+
}
|
|
14
|
+
export type ExecutionTraceSource = "worker" | "harness";
|
|
15
|
+
export interface PostExecutionTracePayload {
|
|
16
|
+
executionId: string;
|
|
17
|
+
/** Omitted by older workers: defaults to harness. */
|
|
18
|
+
source?: ExecutionTraceSource;
|
|
19
|
+
/** SDK identity for harness events; worker events have no harness. */
|
|
20
|
+
harness: string | null;
|
|
21
|
+
events: ExecutionTraceEvent[];
|
|
22
|
+
}
|
|
23
|
+
/** Permanent rejections are quarantined locally instead of retried forever. */
|
|
24
|
+
export interface ExecutionTraceAck {
|
|
25
|
+
ok: boolean;
|
|
26
|
+
permanent?: boolean;
|
|
27
|
+
retryable?: "disconnected";
|
|
28
|
+
error?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare const EXECUTION_TRACE_BATCH_BYTES: number;
|
|
31
|
+
export declare const EXECUTION_TRACE_MAX_BYTES: number;
|
|
32
|
+
export declare const EXECUTION_TRACE_BATCH_SIZE = 100;
|
|
33
|
+
/** Worker lifecycle records share the execution sequence with harness events. */
|
|
34
|
+
export type ExecutionStep = "workspace" | "setup" | "agent" | "finish";
|
|
35
|
+
export type ExecutionStepStatus = "running" | "completed" | "failed" | "interrupted" | "cancelled";
|
|
36
|
+
export type ExecutionRepositoryProgress = {
|
|
37
|
+
slug: string;
|
|
38
|
+
repository: string;
|
|
39
|
+
action: "clone" | "fetch";
|
|
40
|
+
status: "running" | "completed" | "failed";
|
|
41
|
+
};
|
|
42
|
+
export type ExecutionStepEvent = {
|
|
43
|
+
type: "taico.execution.step";
|
|
44
|
+
step: ExecutionStep;
|
|
45
|
+
status: ExecutionStepStatus;
|
|
46
|
+
message?: string;
|
|
47
|
+
repository?: ExecutionRepositoryProgress;
|
|
48
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// Keep batches below Socket.IO's transport limit. A single event can exceed the
|
|
2
|
+
// batching target; the server accepts frames up to EXECUTION_TRACE_MAX_BYTES.
|
|
3
|
+
export const EXECUTION_TRACE_BATCH_BYTES = 512 * 1024;
|
|
4
|
+
export const EXECUTION_TRACE_MAX_BYTES = 16 * 1024 * 1024;
|
|
5
|
+
export const EXECUTION_TRACE_BATCH_SIZE = 100;
|