eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
112 lines (111 loc) • 4.21 kB
TypeScript
export declare const MAX_ACTIVITY_EVENTS_PER_BATCH = 100;
export type ActivityWorkKind = "root-turn" | "subagent" | "remote-agent" | "task";
export type ActivityWorkPhase = "running" | "completed" | "failed" | "cancelled";
export type ActivityActionKind = "tool" | "skill";
export type ActivityActionPhase = "running" | "completed" | "failed" | "rejected" | "cancelled";
export type ActivityBlockerKind = "approval" | "authorization" | "input";
export type ActivityBlockerPhase = "blocked" | "completed" | "cancelled" | "failed";
export interface ActivityWorkIdentityV1 {
readonly callId?: string;
readonly id: string;
readonly kind: ActivityWorkKind;
readonly name?: string;
readonly parentId?: string;
readonly rootSessionId: string;
readonly rootTurnId: string;
readonly sessionId?: string;
readonly turnId?: string;
}
export interface PendingActivitySettlementV1 {
readonly entityKind: "action" | "blocker" | "work";
readonly eventId: string;
readonly outcome: ActivityActionPhase | ActivityBlockerPhase | ActivityWorkPhase;
readonly settledAt: string;
}
export interface ActivityWorkStateV1 extends ActivityWorkIdentityV1 {
readonly phase: ActivityWorkPhase;
readonly settledAt?: string;
readonly startedAt: string;
}
export interface ActivityActionIdentityV1 {
readonly id: string;
readonly kind: ActivityActionKind;
readonly name: string;
readonly parentWorkId: string;
readonly rootTurnId: string;
readonly stepIndex: number;
}
export interface ActivityActionStateV1 extends ActivityActionIdentityV1 {
readonly label?: string;
readonly phase: ActivityActionPhase;
readonly settledAt?: string;
readonly startedAt: string;
}
export interface ActivityBlockerIdentityV1 {
readonly id: string;
readonly kind: ActivityBlockerKind;
readonly label?: string;
readonly parentActionId?: string;
readonly parentWorkId: string;
readonly rootTurnId: string;
}
export interface ActivityBlockerStateV1 extends ActivityBlockerIdentityV1 {
readonly phase: ActivityBlockerPhase;
readonly settledAt?: string;
readonly startedAt: string;
}
export type ActivityEventV1 = {
readonly eventId: string;
readonly kind: "work.started";
readonly startedAt: string;
readonly work: ActivityWorkIdentityV1;
} | {
readonly eventId: string;
readonly kind: "work.settled";
readonly outcome: Exclude<ActivityWorkPhase, "running">;
readonly settledAt: string;
readonly workId: string;
} | {
readonly action: ActivityActionIdentityV1;
readonly eventId: string;
readonly kind: "action.started";
readonly startedAt: string;
} | {
readonly actionId: string;
readonly eventId: string;
readonly kind: "action.settled";
readonly outcome: Exclude<ActivityActionPhase, "running">;
readonly settledAt: string;
} | {
readonly actionId: string;
readonly eventId: string;
readonly kind: "action.label.updated";
readonly label: string;
} | {
readonly blocker: ActivityBlockerIdentityV1;
readonly eventId: string;
readonly kind: "blocker.started";
readonly startedAt: string;
} | {
readonly blockerId: string;
readonly eventId: string;
readonly kind: "blocker.settled";
readonly outcome: Exclude<ActivityBlockerPhase, "blocked">;
readonly settledAt: string;
};
export interface ActivityBatchV1 {
readonly events: readonly ActivityEventV1[];
readonly version: 1;
}
export interface ActivitySnapshotV1 {
readonly actions: Readonly<Record<string, ActivityActionStateV1>>;
readonly blockers: Readonly<Record<string, ActivityBlockerStateV1>>;
readonly pendingSettlements: Readonly<Record<string, PendingActivitySettlementV1>>;
readonly revision: number;
readonly seenEventIds: readonly string[];
readonly version: 1;
readonly work: Readonly<Record<string, ActivityWorkStateV1>>;
}
export declare function parseActivityWorkIdentityV1(value: unknown): ActivityWorkIdentityV1 | undefined;
/** Parses known lifecycle events while ignoring additive unknown event kinds. */
export declare function parseActivityBatchV1(value: unknown): ActivityBatchV1 | undefined;