agent-afk 6.4.0 → 6.4.1
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-maintenance.d.ts +2 -0
- package/dist/agent/daemon/handoff-wiring.d.ts +2 -1
- package/dist/agent/daemon/scheduler.elicitation-notify.d.ts +9 -6
- package/dist/agent/daemon/scheduler.notification.d.ts +1 -1
- package/dist/agent/session-ledger-project.d.ts +1 -0
- package/dist/cli/slash/types.d.ts +4 -0
- package/dist/cli.mjs +456 -455
- package/dist/index.mjs +385 -385
- package/dist/telegram/bot.d.ts +3 -1
- package/dist/telegram/bot.polling.d.ts +5 -0
- package/dist/telegram/entry.startup.d.ts +1 -0
- package/dist/telegram/slash-context.telegram.d.ts +4 -1
- package/dist/telegram.mjs +406 -406
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Telegraf } from 'telegraf';
|
|
2
|
+
import { recoverPendingHandoffs } from './handoff-wiring.js';
|
|
2
3
|
import { RESUME_QUEUE_SUBDIR } from './handoff-expiry.js';
|
|
3
4
|
export declare const HANDOFF_MAINTENANCE_INTERVAL_MS = 30000;
|
|
4
5
|
export { RESUME_QUEUE_SUBDIR };
|
|
@@ -7,6 +8,7 @@ export interface HandoffMaintenanceOpts {
|
|
|
7
8
|
queueDir: string;
|
|
8
9
|
handoffsDir?: string;
|
|
9
10
|
bot?: Telegraf;
|
|
11
|
+
resolveNotifyChat?: Parameters<typeof recoverPendingHandoffs>[3];
|
|
10
12
|
drainResumeQueue: (resumeDir: string) => Promise<void>;
|
|
11
13
|
recoverMainQueue?: () => void;
|
|
12
14
|
isInFlight?: (taskId: string) => boolean;
|
|
@@ -16,7 +16,8 @@ export interface RecoveryResult {
|
|
|
16
16
|
renotified: number;
|
|
17
17
|
expired: number;
|
|
18
18
|
}
|
|
19
|
-
export declare function recoverPendingHandoffs(handoffsDir?: string, queueDir?: string, bot?: Telegraf): Promise<RecoveryResult>;
|
|
19
|
+
export declare function recoverPendingHandoffs(handoffsDir?: string, queueDir?: string, bot?: Telegraf, resolveNotifyChat?: (notifyChat: number | string | undefined, taskId: string) => number | undefined): Promise<RecoveryResult>;
|
|
20
20
|
export declare const MAX_ANSWER_BYTES: number;
|
|
21
21
|
export declare function answerHandoff(taskId: string, answer: unknown, source: string, handoffsDir?: string, responderIdentity?: string): Promise<boolean>;
|
|
22
22
|
export declare function cleanupHandoff(taskId: string, handoffsDir?: string): Promise<void>;
|
|
23
|
+
export declare function buildHandoffReplyMarkup(qType: string, taskId: string, choices?: readonly string[]): import('telegraf/types').InlineKeyboardMarkup | undefined;
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { type HandoffResumeContext } from './handoff-resume-context.js';
|
|
2
2
|
import type { ElicitationHandler } from '../elicitation-router.js';
|
|
3
3
|
import type { Telegraf } from 'telegraf';
|
|
4
|
-
export type { ElicitationHandler };
|
|
5
4
|
export declare function formatCronElicitationMessage(taskId: string, command: string, cron: string | undefined, question: string): string;
|
|
6
|
-
|
|
5
|
+
interface CronElicitationHandlerOpts {
|
|
7
6
|
taskId: string;
|
|
8
7
|
originalCommand: string;
|
|
9
8
|
handoffsDir?: string;
|
|
10
|
-
onHandoffWritten?: (message: string) => void;
|
|
11
9
|
cronExpression?: string;
|
|
12
|
-
bot?: Telegraf;
|
|
13
|
-
chatId?: number;
|
|
14
|
-
threadId?: number;
|
|
15
10
|
resumeContext?: HandoffResumeContext;
|
|
11
|
+
bot?: Telegraf;
|
|
12
|
+
overrideChatId?: number;
|
|
13
|
+
primaryChatId?: number;
|
|
14
|
+
primaryThreadId?: number;
|
|
15
|
+
resolveDefaultTargets?: () => readonly number[];
|
|
16
|
+
onHandoffWritten?: () => void;
|
|
16
17
|
}
|
|
18
|
+
export declare function resolveCronQuestionTargets(overrideChatId: number | undefined, resolveDefaultTargets?: () => readonly number[]): number[];
|
|
17
19
|
export declare function makeCronElicitationHandler(opts: CronElicitationHandlerOpts): ElicitationHandler;
|
|
20
|
+
export {};
|
|
@@ -4,7 +4,7 @@ export type NotificationKind = 'completion' | 'failure' | 'escalation' | 're-esc
|
|
|
4
4
|
export interface NotificationDecision {
|
|
5
5
|
state: 'due' | 'not-due' | 'suppressed';
|
|
6
6
|
kind: NotificationKind;
|
|
7
|
-
reason?: 'policy-never' | 'policy-failure' | 'no-callback';
|
|
7
|
+
reason?: 'policy-never' | 'policy-failure' | 'no-callback' | 'handoff-pending';
|
|
8
8
|
}
|
|
9
9
|
export interface NotificationOutcome {
|
|
10
10
|
target: string | number | readonly number[] | null;
|
|
@@ -86,6 +86,10 @@ export interface UiSurface {
|
|
|
86
86
|
repaintStatusLine(): void;
|
|
87
87
|
}
|
|
88
88
|
export interface SlashContext {
|
|
89
|
+
invocation?: {
|
|
90
|
+
surface: 'telegram' | 'repl';
|
|
91
|
+
responderIdentity?: string;
|
|
92
|
+
};
|
|
89
93
|
capabilities?: ReadonlySet<SurfaceCapability>;
|
|
90
94
|
choose?: Choose;
|
|
91
95
|
progress?: (event: ProgressEvent) => void;
|