trellis
Version:
Agentic State Engine — event-sourced causal graph with branching, decision traces, and realtime sync for AI-native applications
30 lines • 1.36 kB
TypeScript
/**
* trellis-handoffs envelope — parse, validate, serialize.
*/
export declare const HANDOFF_ROLES: readonly ["strategist", "designer", "architect", "executor", "reviewer", "optimizer", "synthesist", "writer", "human"];
export type HandoffRole = (typeof HANDOFF_ROLES)[number];
export declare const HANDOFF_STATUSES: readonly ["HANDOFF", "CLARIFY", "REJECT", "BLOCKED", "DECISION"];
export type HandoffStatus = (typeof HANDOFF_STATUSES)[number];
export interface HandoffEnvelope {
from: HandoffRole;
to: HandoffRole;
re: string;
status: HandoffStatus;
body?: string;
refs?: string[];
in_reply_to?: string;
}
export declare function extractYamlFooter(text: string): string | null;
export declare function parseEnvelope(text: string): HandoffEnvelope;
export declare function validateEnvelope(env: HandoffEnvelope): {
ok: true;
} | {
ok: false;
errors: string[];
};
export declare function formatEnvelope(env: HandoffEnvelope): string;
export declare function formatTurnBanner(env: HandoffEnvelope, stage?: string): string;
export declare function formatIssueDescription(env: HandoffEnvelope, stage?: string): string;
export declare function isWaitingOnHuman(env: HandoffEnvelope): boolean;
export declare function tryParseEnvelope(description?: string): HandoffEnvelope | undefined;
//# sourceMappingURL=envelope.d.ts.map