import type { ActionEntry, DashboardSyncAction } from '@auden.to/protocol'; /** Per-session count of run-log lines already uploaded. */ export type ActionCursors = Record; export type PendingActionsResult = { /** Verdict-less actions ready to upload, oldest session-line first. */ actions: DashboardSyncAction[]; /** Cursors to persist once the upload succeeds. */ cursors: ActionCursors; /** Sessions skipped because they cannot be given a stable id. */ skippedSessions: string[]; /** * Per session, this machine's transcript path as the agent reported it — * local-only, and never part of `actions` (see `ActionEntrySchema`). * * Collected here rather than by a second pass over the run logs because * these lines are already open and parsed: the Stop hook fires once per * assistant turn, so a separate read per session would be a per-turn cost * bought for a string this loop is holding anyway. The consequence is that * it covers exactly the sessions with pending actions; a session with none * falls back to the filename lookup, which is what resolved it before this * existed (docs/plans/default-transcript-discovery-plan.md → slice 2). */ transcriptPaths: Record; }; export declare function toActionType(toolName: string): string; /** * Build the one-line description the server grades against. * * Mechanical by design (see the module comment). Command text is sanitized * before inclusion — `sanitizeCommand` strips heredoc bodies, private keys, * URL credentials, `KEY=value` secrets and known token shapes, then caps * length — because a raw shell command can carry both secrets and bulk file * content, and this string leaves the machine. */ export declare function toActionSummary(entry: ActionEntry): string; /** * Identity for a run-log line written before the hook assigned ids. * * Globally unique because it is anchored to the agent's session id, which is * a UUID — the property that makes it safe against `actions.id` being a bare * global primary key with unscoped conflict handling. A hash of the action's * *content* alone would not be: two users performing the same edit would * collide, and the second would be silently dropped as a retry. * * Consequently this is only valid for a real session id; `UNKNOWN_SESSION` * entries are skipped rather than given a colliding id. */ export declare function deriveLegacyActionId(sessionId: string, lineIndex: number): string; /** Read persisted cursors; an unreadable or malformed file starts from zero. */ export declare function readActionCursors(path: string): Promise; /** Persist cursors after a successful upload. */ export declare function writeActionCursors(path: string, cursors: ActionCursors): Promise; /** * Collect every run-log line not yet uploaded, as verdict-less sync actions. * * Run logs are append-only, so a per-session line count is a valid high-water * mark. Malformed lines are counted but not sent: skipping them without * advancing the cursor would wedge every later line in that session behind a * permanently invalid one. */ export declare function readPendingActions(runsDir: string, cursors: ActionCursors, narrationDisabledRepoIds?: ReadonlySet | null): Promise; //# sourceMappingURL=action-queue.d.ts.map