agent-afk 5.310.13 → 5.311.0
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.
- package/dist/agent/daemon/handoff-store.d.ts +2 -1
- package/dist/agent/daemon/handoff-wiring.d.ts +1 -1
- package/dist/agent/daemon/scheduler.d.ts +1 -0
- package/dist/agent/daemon/scheduler.elicitation-notify.d.ts +4 -0
- package/dist/agent/daemon/scheduler.execute-agent-task.d.ts +2 -0
- package/dist/agent/daemon/session-spawn.d.ts +1 -0
- package/dist/agent/daemon.d.ts +1 -0
- package/dist/agent/elicitation-router.d.ts +4 -0
- package/dist/agent/tools/compose-agent-resolve.d.ts +1 -0
- package/dist/cli/commands/interactive/loop-iteration.boundary.d.ts +1 -3
- package/dist/cli.mjs +412 -408
- package/dist/index.mjs +182 -181
- package/dist/telegram/handoff-answer.d.ts +4 -1
- package/dist/telegram.mjs +198 -197
- package/dist/whatif/args.d.ts +2 -0
- package/dist/whatif/args.usage.d.ts +1 -1
- package/dist/whatif/run.aa.d.ts +4 -0
- package/dist/whatif/types.orchestration.d.ts +1 -0
- package/package.json +1 -1
|
@@ -18,6 +18,7 @@ export interface HandoffRecord {
|
|
|
18
18
|
answer?: unknown;
|
|
19
19
|
answeredAt?: string;
|
|
20
20
|
answerSource?: string;
|
|
21
|
+
responderIdentity?: string;
|
|
21
22
|
originalCommand: string;
|
|
22
23
|
telegramMessageId?: number;
|
|
23
24
|
}
|
|
@@ -26,5 +27,5 @@ export declare function readHandoff(taskId: string, handoffsDir?: string): Promi
|
|
|
26
27
|
export declare function deleteHandoff(taskId: string, handoffsDir?: string): Promise<void>;
|
|
27
28
|
export declare function listPendingHandoffs(handoffsDir?: string): Promise<HandoffRecord[]>;
|
|
28
29
|
export declare function withHandoffLock<T>(taskId: string, handoffsDir: string, cb: () => Promise<T>): Promise<T | null>;
|
|
29
|
-
export declare function updateHandoffAnswer(taskId: string, answer: unknown, source: string, handoffsDir?: string): Promise<UpdateHandoffResult>;
|
|
30
|
+
export declare function updateHandoffAnswer(taskId: string, answer: unknown, source: string, handoffsDir?: string, responderIdentity?: string): Promise<UpdateHandoffResult>;
|
|
30
31
|
export {};
|
|
@@ -15,5 +15,5 @@ export interface RecoveryResult {
|
|
|
15
15
|
expired: number;
|
|
16
16
|
}
|
|
17
17
|
export declare function recoverPendingHandoffs(handoffsDir?: string, queueDir?: string, bot?: Telegraf): Promise<RecoveryResult>;
|
|
18
|
-
export declare function answerHandoff(taskId: string, answer: unknown, source: string, handoffsDir?: string): Promise<boolean>;
|
|
18
|
+
export declare function answerHandoff(taskId: string, answer: unknown, source: string, handoffsDir?: string, responderIdentity?: string): Promise<boolean>;
|
|
19
19
|
export declare function cleanupHandoff(taskId: string, handoffsDir?: string): Promise<void>;
|
|
@@ -27,6 +27,7 @@ export interface SchedulerOptions {
|
|
|
27
27
|
budgetGate?: () => Promise<import('./budget-gate.js').BudgetGateResult>;
|
|
28
28
|
retrySleep?: (ms: number, signal: AbortSignal) => Promise<void>;
|
|
29
29
|
handoffsDir?: string;
|
|
30
|
+
resolveNotifyChat?: (notifyChat: number | string | undefined, taskId: string) => number | undefined;
|
|
30
31
|
}
|
|
31
32
|
export type TelemetryTrigger = 'cron' | 'sessionstart' | 'pull';
|
|
32
33
|
type TelemetryStatus = 'success' | 'error' | 'skipped' | 'blocked';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ElicitationHandler } from '../elicitation-router.js';
|
|
2
|
+
import type { Telegraf } from 'telegraf';
|
|
2
3
|
export type { ElicitationHandler };
|
|
3
4
|
export declare function formatCronElicitationMessage(taskId: string, command: string, cron: string | undefined, question: string): string;
|
|
4
5
|
export interface CronElicitationHandlerOpts {
|
|
@@ -7,5 +8,8 @@ export interface CronElicitationHandlerOpts {
|
|
|
7
8
|
handoffsDir?: string;
|
|
8
9
|
onHandoffWritten?: (message: string) => void;
|
|
9
10
|
cronExpression?: string;
|
|
11
|
+
bot?: Telegraf;
|
|
12
|
+
chatId?: number;
|
|
13
|
+
threadId?: number;
|
|
10
14
|
}
|
|
11
15
|
export declare function makeCronElicitationHandler(opts: CronElicitationHandlerOpts): ElicitationHandler;
|
|
@@ -16,6 +16,7 @@ interface AgentTaskOptions {
|
|
|
16
16
|
successfulToolNames: readonly string[];
|
|
17
17
|
}) => boolean;
|
|
18
18
|
onTaskTurnComplete?: (args: TaskTurnCompleteArgs) => void;
|
|
19
|
+
resolveNotifyChat?: (notifyChat: number | string | undefined, taskId: string) => number | undefined;
|
|
19
20
|
}
|
|
20
21
|
export interface TaskTurnCompleteArgs {
|
|
21
22
|
task: ScheduledTask;
|
|
@@ -37,6 +38,7 @@ export interface AgentTaskContext {
|
|
|
37
38
|
stateStore: StateStore;
|
|
38
39
|
mcpManager?: McpManager;
|
|
39
40
|
dispose: () => void;
|
|
41
|
+
elicitationKey: string;
|
|
40
42
|
}>;
|
|
41
43
|
writeTelemetry: (record: TelemetryRecord, task: ScheduledTask, details?: TaskCompletionDetails) => void;
|
|
42
44
|
shutdownSignal?: AbortSignal;
|
package/dist/agent/daemon.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export interface DaemonOptions {
|
|
|
20
20
|
bot?: Telegraf;
|
|
21
21
|
primaryChatId?: number;
|
|
22
22
|
primaryThreadId?: number;
|
|
23
|
+
resolveNotifyChat?: (notifyChat: number | string | undefined, taskId: string) => number | undefined;
|
|
23
24
|
oauthRefresher?: () => Promise<unknown>;
|
|
24
25
|
oauthRefreshIntervalMs?: number;
|
|
25
26
|
}
|
|
@@ -5,16 +5,20 @@ export type ElicitationHandler = (request: ElicitationRequest, options: {
|
|
|
5
5
|
}) => Promise<ElicitationResult>;
|
|
6
6
|
declare class ElicitationRouter {
|
|
7
7
|
private handler;
|
|
8
|
+
private readonly sessionHandlers;
|
|
8
9
|
private queue;
|
|
9
10
|
private queueDepth;
|
|
10
11
|
install(handler: ElicitationHandler): void;
|
|
11
12
|
uninstall(): void;
|
|
13
|
+
installForSession(key: string, handler: ElicitationHandler): void;
|
|
14
|
+
uninstallForSession(key: string): void;
|
|
12
15
|
hasHandler(): boolean;
|
|
13
16
|
pendingCount(): number;
|
|
14
17
|
route(request: ElicitationRequest, options: {
|
|
15
18
|
signal: AbortSignal;
|
|
16
19
|
onActive?: () => void;
|
|
17
20
|
sessionId?: string;
|
|
21
|
+
sessionKey?: string;
|
|
18
22
|
}): Promise<ElicitationResult>;
|
|
19
23
|
}
|
|
20
24
|
export declare const elicitationRouter: ElicitationRouter;
|
|
@@ -21,9 +21,7 @@ export declare function installPeerBoundary(opts: PeerBoundaryOpts): () => void;
|
|
|
21
21
|
export declare function reinstallPeerBoundary(opts: PeerBoundaryOpts, prevDispose: (() => void) | undefined): () => void;
|
|
22
22
|
export declare function drainAdmissionQueueFallback(text: string, q: AdmissionQueue): string;
|
|
23
23
|
export declare function applyDeferPeers(runText: string, queuedHumanTurn: boolean, surface: Pick<InputSurface, 'getCompositor'>, shellPassthrough: InjectionSource, bgResultNotifier: InjectionSource, peerNotifier: InjectionSource, admissionQueue: AdmissionQueue, processJobNotifier?: InjectionSource): string;
|
|
24
|
-
export declare function setupPeerBoundary(ctx: InteractiveCtx, surface: InputSurface, peerNotifier: PeerInboxNotifier, isQueuedHumanTurn: () => boolean, processJobNotifier?: InjectionSource
|
|
25
|
-
hasPendingInjections(): boolean;
|
|
26
|
-
}): {
|
|
24
|
+
export declare function setupPeerBoundary(ctx: InteractiveCtx, surface: InputSurface, peerNotifier: PeerInboxNotifier, isQueuedHumanTurn: () => boolean, processJobNotifier?: InjectionSource): {
|
|
27
25
|
admissionQueue: AdmissionQueue;
|
|
28
26
|
reinstall: () => void;
|
|
29
27
|
};
|