agent-afk 5.321.2 → 5.321.4

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.
@@ -7,11 +7,12 @@ export interface ExpireHandoffOpts {
7
7
  queueDir?: string;
8
8
  ttlMs?: number;
9
9
  now?: number;
10
+ isInFlight?: (taskId: string) => boolean;
10
11
  }
11
12
  export declare function isHandoffStale(record: Pick<HandoffRecord, 'createdAt'>, now: number, ttlMs?: number): boolean;
12
13
  export declare function expireHandoff(taskId: string, opts?: ExpireHandoffOpts): Promise<boolean>;
13
14
  export declare function expireStaleHandoffs(opts?: ExpireHandoffOpts): Promise<number>;
14
- export declare function sweepExpiredHandoffs(queueDir: string, now?: number, handoffsDir?: string): void;
15
+ export declare function sweepExpiredHandoffs(queueDir: string, now?: number, handoffsDir?: string, isInFlight?: (taskId: string) => boolean): void;
15
16
  export declare function resetExpirySweepThrottleForTests(): void;
16
17
  export declare function expiryNoticeRoute(route: unknown): {
17
18
  target: number;
@@ -8,6 +8,8 @@ export interface HandoffMaintenanceOpts {
8
8
  handoffsDir?: string;
9
9
  bot?: Telegraf;
10
10
  drainResumeQueue: (resumeDir: string) => Promise<void>;
11
+ recoverMainQueue?: () => void;
12
+ isInFlight?: (taskId: string) => boolean;
11
13
  intervalMs?: number;
12
14
  }
13
15
  export interface HandoffMaintenanceHandle {
@@ -0,0 +1,2 @@
1
+ import { type TaskRecord } from './task-lifecycle.js';
2
+ export declare function reclaimSingleLease(taskId: string, queueDir?: string, isInFlight?: (taskId: string) => boolean): TaskRecord | null;
@@ -7,3 +7,4 @@ export declare function completeTask(taskId: string, status: 'succeeded' | 'fail
7
7
  export declare function recoverExpiredLeases(queueDir?: string): TaskRecord[];
8
8
  export declare function getTaskRecord(taskId: string, queueDir?: string): TaskRecord | null;
9
9
  export declare function listActiveTasks(queueDir?: string): TaskRecord[];
10
+ export declare function reEnqueueRecord(record: TaskRecord, queueDir: string): void;
@@ -18,6 +18,7 @@ interface RemoteAgentInput {
18
18
  }
19
19
  export declare function parseRemoteAgentInput(raw: unknown): RemoteAgentInput | ToolResult;
20
20
  export declare function isRemoteRun(): boolean;
21
+ export declare function neutraliseRemoteOutput(text: string): string;
21
22
  export declare function createRemoteAgentHandler(deps: RemoteAgentDeps): ToolHandler;
22
23
  export declare const remoteAgentHandler: ToolHandler;
23
24
  export {};