UNPKG

@sema-agent/core

Version:

Stateless, task-oriented AI agent core

29 lines (28 loc) • 2.33 kB
import type { MaybeCompactOptions } from "../auto-compaction.js"; import type { Prepared } from "./contracts.js"; /** env-tail migration — the git frame's authority shell: the single-point F3 wrap the first-frame * listings use (one `<system-reminder>` per body, body neutralized — idempotent over the already- * sanitized snapshot; the S2 breakout posture). */ export declare function wrapGitFrame(body: string, mark: string | undefined): string; /** * env-tail migration — the git lane's leg-boundary decision: read ladder (BRANCH AUTHORITY) then * the `(kind, hash)` compare. Ladder rungs: * ① nearest mirror on the active session branch — a PENDING carrier (or an announced carrier * whose frame entry is off the branch) is a MANDATORY re-announce gate, overriding everything; * ② the checkpoint mirror, only when the branch carries no mirror at all — its own `entryId` * must sit on the active branch to count as announced (a rewound frame under a descendant * checkpoint reads as pending); * ③ full absence ⇒ conservative re-announce (duplicate-tolerant by design). * Seeds `ref.announced` with the resolved prior (pendingness preserved — a suspend before the * receipt then mirrors the honest state) and returns the frame BODY to deliver, or undefined when * the announced view already matches (or the lane has nothing to say this leg). Tombstone kinds * fire on the availability FLIP EDGE only: with no prior view at all there is nothing to disown — * no frame (the probe's own onError already told the deployment). */ export declare function resolveGitLegDelivery(prepared: Prepared, cpMirror: unknown, report: (err: Error) => void): Promise<string | undefined>; /** env-tail migration — the compaction interaction option for one `maybeCompact` invocation (ALL * THREE routes — turn-boundary auto, prompt-too-long recovery, end-of-task finish — thread this * same builder, the single-source requirement): the current tuple restated as PENDING on the * compaction entry (same CAS as the new baseline) + the run's re-assert closure as the landing * hook. Empty when the lane never announced anything (nothing to preserve across the summary). */ export declare function gitRestateOption(prepared: Prepared): Pick<MaybeCompactOptions, "gitRestate">;