agent-afk 5.318.10 → 5.318.12

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 HandoffRecord } from './handoff-store.js';
2
+ export declare const DEFAULT_HANDOFF_TTL_MS: number;
3
+ export declare const EXPIRY_SWEEP_INTERVAL_MS = 60000;
4
+ export interface ExpireHandoffOpts {
5
+ handoffsDir?: string;
6
+ queueDir?: string;
7
+ ttlMs?: number;
8
+ now?: number;
9
+ }
10
+ export declare function isHandoffStale(record: Pick<HandoffRecord, 'createdAt'>, now: number, ttlMs?: number): boolean;
11
+ export declare function expireHandoff(taskId: string, opts?: ExpireHandoffOpts): Promise<boolean>;
12
+ export declare function expireStaleHandoffs(opts?: ExpireHandoffOpts): Promise<number>;
13
+ export declare function sweepExpiredHandoffs(queueDir: string, now?: number): void;
14
+ export declare function resetExpirySweepThrottleForTests(): void;
@@ -18,6 +18,7 @@ export interface HandoffRecord {
18
18
  answer?: unknown;
19
19
  answeredAt?: string;
20
20
  answerSource?: string;
21
+ expiredAt?: string;
21
22
  responderIdentity?: string;
22
23
  originalCommand: string;
23
24
  telegramMessageId?: number;
@@ -2,7 +2,7 @@ import { type QueuedTask } from './queue-store.js';
2
2
  import { type TaskRecord, type TaskState } from './task-lifecycle.js';
3
3
  export declare function leaseTask(task: QueuedTask, srcPath: string, leaseTtlMs?: number, queueDir?: string): TaskRecord;
4
4
  export declare function renewLease(taskId: string, leaseTtlMs?: number, queueDir?: string): void;
5
- export declare function setLeaseState(taskId: string, state: TaskState, queueDir?: string): void;
5
+ export declare function setLeaseState(taskId: string, state: TaskState, queueDir?: string, expectedState?: TaskState): boolean;
6
6
  export declare function completeTask(taskId: string, status: 'succeeded' | 'failed', error?: string, queueDir?: string): void;
7
7
  export declare function recoverExpiredLeases(queueDir?: string): TaskRecord[];
8
8
  export declare function getTaskRecord(taskId: string, queueDir?: string): TaskRecord | null;
@@ -29,7 +29,8 @@ import { testRunHandler } from './test-run.js';
29
29
  import { getFacetHandler } from './get-facet.js';
30
30
  import { jsonQueryHandler, createJsonQueryHandler } from './json-query.js';
31
31
  import { modelCompleteHandler } from './model-complete.js';
32
+ import { remoteAgentHandler } from './remote-agent.js';
32
33
  import { clipboardWriteHandler, clipboardReadHandler, createClipboardWriteHandler, createClipboardReadHandler } from './clipboard.js';
33
34
  import { listSessionsHandler, sendToSessionHandler } from './peer.js';
34
35
  export declare function createBuiltinHandlers(permissionMode?: string, cwd?: string): Map<string, ToolHandler>;
35
- export { bashHandler, readFileHandler, extractDocumentHandler, writeFileHandler, editFileHandler, globHandler, grepHandler, listDirectoryHandler, sendTelegramHandler, webScrapeHandler, webRequestHandler, imageGenerateHandler, imageEditHandler, createImageEditHandler, viewImageHandler, createViewImageHandler, createScheduleHandler, updateScheduleHandler, listSchedulesHandler, getScheduleHistoryHandler, cancelScheduleHandler, terminalFontSizeHandler, createWorktreeHandler, configGetHandler, configSetHandler, askQuestionHandler, waitForHandler, patchApplyHandler, browserOpenHandler, browserObserveHandler, browserActHandler, browserScreenshotHandler, browserCloseHandler, testRunHandler, getFacetHandler, jsonQueryHandler, modelCompleteHandler, createJsonQueryHandler, clipboardWriteHandler, clipboardReadHandler, createClipboardWriteHandler, createClipboardReadHandler, listSessionsHandler, sendToSessionHandler, };
36
+ export { bashHandler, readFileHandler, extractDocumentHandler, writeFileHandler, editFileHandler, globHandler, grepHandler, listDirectoryHandler, sendTelegramHandler, webScrapeHandler, webRequestHandler, imageGenerateHandler, imageEditHandler, createImageEditHandler, viewImageHandler, createViewImageHandler, createScheduleHandler, updateScheduleHandler, listSchedulesHandler, getScheduleHistoryHandler, cancelScheduleHandler, terminalFontSizeHandler, createWorktreeHandler, configGetHandler, configSetHandler, askQuestionHandler, waitForHandler, patchApplyHandler, browserOpenHandler, browserObserveHandler, browserActHandler, browserScreenshotHandler, browserCloseHandler, testRunHandler, getFacetHandler, jsonQueryHandler, modelCompleteHandler, remoteAgentHandler, createJsonQueryHandler, clipboardWriteHandler, clipboardReadHandler, createClipboardWriteHandler, createClipboardReadHandler, listSessionsHandler, sendToSessionHandler, };
@@ -0,0 +1,23 @@
1
+ import type { ToolHandler, ToolResult } from '../types.js';
2
+ import { type RemoteHost } from '../../../remote/hosts.js';
3
+ import { type SshRunner } from '../../../remote/ssh-runner.js';
4
+ import { type ReadUnlockPassword } from '../../../remote/keychain-unlock.js';
5
+ export declare const MAX_REPLY_CHARS = 100000;
6
+ export interface RemoteAgentDeps {
7
+ runner: SshRunner;
8
+ loadHosts: () => Promise<Record<string, RemoteHost>>;
9
+ readUnlockPassword?: ReadUnlockPassword;
10
+ sleep?: (ms: number, signal: AbortSignal) => Promise<void>;
11
+ }
12
+ interface RemoteAgentInput {
13
+ host: string;
14
+ prompt: string;
15
+ cwd?: string;
16
+ model?: string;
17
+ resume?: string;
18
+ }
19
+ export declare function parseRemoteAgentInput(raw: unknown): RemoteAgentInput | ToolResult;
20
+ export declare function isRemoteRun(): boolean;
21
+ export declare function createRemoteAgentHandler(deps: RemoteAgentDeps): ToolHandler;
22
+ export declare const remoteAgentHandler: ToolHandler;
23
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { AnthropicToolDef } from './types.js';
2
+ export declare const remoteAgentTool: AnthropicToolDef;