agent-afk 5.312.4 → 5.312.6

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.
@@ -0,0 +1,14 @@
1
+ import { type WorktreeMeta, type WorktreeCandidate, type WorktreeVerdict, type DirtyReason } from './worktree-sweep.classify.js';
2
+ import type { ExecFileFn, SweepResult } from './worktree-sweep.js';
3
+ export declare function sweepOrphanDirs(orphanedDirs: string[], effectiveDryRun: boolean, result: SweepResult): Promise<void>;
4
+ export interface CandidateProbeResult {
5
+ isDirty: boolean;
6
+ dirtyReason: DirtyReason;
7
+ commitsAhead: number;
8
+ commitsUnpushed: number;
9
+ ownerLiveness: WorktreeCandidate['ownerLiveness'];
10
+ }
11
+ export declare function probeCandidate(execFile: ExecFileFn, repoRoot: string, entryPath: string, entryHead: string | undefined, mainHead: string | undefined, meta: WorktreeMeta | undefined, ageMs: number, liveSessionCwds: string[], warnings: string[]): Promise<CandidateProbeResult>;
12
+ export declare function applyVerdictAction(verdict: WorktreeVerdict, execFile: ExecFileFn, repoRoot: string, entryPath: string, entryBranch: string | undefined, entryLockReason: string | undefined, candidate: WorktreeCandidate, meta: WorktreeMeta | undefined, result: SweepResult): Promise<void>;
13
+ export declare function resolveWorktreeAgeMs(entryPath: string, meta: WorktreeMeta | undefined): Promise<number>;
14
+ export declare function collectOrphanDirs(afkWorktreesRoot: string, registeredPaths: Set<string>, warnings: string[]): Promise<string[]>;
@@ -0,0 +1,67 @@
1
+ import { type Command } from 'commander';
2
+ import { type WorktreeExitPolicy } from './interactive/worktree-disposition.js';
3
+ import type { InteractiveCtx } from './interactive/shared.js';
4
+ import type { WorktreeHandle, DeferredWorktree } from './interactive/worktree.js';
5
+ import { initTranscript } from './interactive/transcript.js';
6
+ import type { TurnState } from './interactive/repl-loop.js';
7
+ import type { ExitReasonRef } from './interactive/interactive.signal-handlers.js';
8
+ import { env } from '../../config/env.js';
9
+ export declare function applyInteractiveOptions(cmd: Command): Command;
10
+ export interface FirstTurnHookParams {
11
+ deferred: DeferredWorktree;
12
+ apiToken: string;
13
+ ctx: InteractiveCtx;
14
+ branchPrefixOverride: string | undefined;
15
+ worktreeHandleRef: {
16
+ current: WorktreeHandle | undefined;
17
+ };
18
+ }
19
+ export declare function buildFirstTurnHook(params: FirstTurnHookParams): (firstMessage: string) => Promise<void>;
20
+ export interface DispositionResolverParams {
21
+ ctx: InteractiveCtx;
22
+ pickerAbort: AbortController;
23
+ worktreeExitPolicy: WorktreeExitPolicy;
24
+ worktreeHandleRef: {
25
+ current: WorktreeHandle | undefined;
26
+ };
27
+ }
28
+ export declare function buildDispositionResolver(params: DispositionResolverParams): (canPrompt: boolean) => Promise<void>;
29
+ export interface SessionCleanupParams {
30
+ ctx: InteractiveCtx;
31
+ worktreeHandleRef: {
32
+ current: WorktreeHandle | undefined;
33
+ };
34
+ }
35
+ export declare function registerSessionCleanup(params: SessionCleanupParams): void;
36
+ export interface SessionSubsystems {
37
+ transcript: Awaited<ReturnType<typeof initTranscript>>;
38
+ saveCurrentSession: () => string | undefined;
39
+ isSaved: () => boolean;
40
+ turnState: TurnState;
41
+ handleSigint: () => void;
42
+ removeListeners: () => void;
43
+ }
44
+ export declare function wireSessionSubsystems(ctx: InteractiveCtx, exitReasonRef: ExitReasonRef, pickerAbort: AbortController): Promise<SessionSubsystems>;
45
+ export interface StartupBannerParams {
46
+ ctx: InteractiveCtx;
47
+ worktreeHandleRef: {
48
+ current: WorktreeHandle | undefined;
49
+ };
50
+ worktreeCwd: string | undefined;
51
+ bootPruneNotice: string | undefined;
52
+ }
53
+ export declare function printStartupBanner(params: StartupBannerParams): Promise<void>;
54
+ export interface ResumeValidationResult {
55
+ ok: boolean;
56
+ }
57
+ export declare function validateResumeOption(options: {
58
+ resume?: string;
59
+ continue?: boolean;
60
+ }, spinner: {
61
+ fail: (msg: string) => void;
62
+ }): ResumeValidationResult;
63
+ export declare function resolveWorktreeSetupArg(branchPrefixOverride: string | undefined, worktreeBaseOverride: string | undefined): {
64
+ branchPrefix?: string;
65
+ baseRef?: string;
66
+ } | undefined;
67
+ export { env };