agent-afk 5.310.14 → 5.312.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/artifact-registry/store.d.ts +8 -0
- package/dist/agent/artifact-registry/types.d.ts +45 -0
- 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/cli.mjs +446 -442
- package/dist/index.mjs +201 -200
- package/dist/paths.artifact.d.ts +3 -0
- package/dist/paths.d.ts +2 -2
- package/dist/paths.wave.d.ts +2 -0
- package/dist/telegram.mjs +223 -222
- 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
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ArtifactListFilter, ArtifactPutOptions, ArtifactRecord } from './types.js';
|
|
2
|
+
export declare function artifactPut(opts: ArtifactPutOptions, _storeDir?: string, _indexPath?: string): Promise<ArtifactRecord>;
|
|
3
|
+
export declare function artifactGet(id: string, _indexPath?: string): ArtifactRecord | undefined;
|
|
4
|
+
export declare function artifactList(filter?: ArtifactListFilter, _indexPath?: string): ArtifactRecord[];
|
|
5
|
+
export declare function artifactRead(id: string, _indexPath?: string): Promise<Buffer>;
|
|
6
|
+
export declare function artifactCount(_indexPath?: string): number;
|
|
7
|
+
export declare function compactIndex(_indexPath?: string): Promise<void>;
|
|
8
|
+
export declare function listStoreBlobs(_storeDir?: string): string[];
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export type ArtifactRetention = 'permanent' | 'session' | `ttl:${number}`;
|
|
2
|
+
export interface ArtifactRecord {
|
|
3
|
+
id: string;
|
|
4
|
+
uri: string;
|
|
5
|
+
media_type: string;
|
|
6
|
+
hash: string;
|
|
7
|
+
size: number;
|
|
8
|
+
producer: {
|
|
9
|
+
session_id?: string;
|
|
10
|
+
subagent_id?: string;
|
|
11
|
+
tool_name?: string;
|
|
12
|
+
task_id?: string;
|
|
13
|
+
};
|
|
14
|
+
inputs: string[];
|
|
15
|
+
tags: Record<string, string>;
|
|
16
|
+
created_at: number;
|
|
17
|
+
retention: ArtifactRetention;
|
|
18
|
+
}
|
|
19
|
+
export type ArtifactPutOptions = ({
|
|
20
|
+
path: string;
|
|
21
|
+
content?: never;
|
|
22
|
+
} | {
|
|
23
|
+
content: Buffer | string;
|
|
24
|
+
path?: never;
|
|
25
|
+
}) & {
|
|
26
|
+
media_type?: string;
|
|
27
|
+
producer?: ArtifactRecord['producer'];
|
|
28
|
+
inputs?: string[];
|
|
29
|
+
tags?: Record<string, string>;
|
|
30
|
+
retention?: ArtifactRetention;
|
|
31
|
+
};
|
|
32
|
+
export interface ArtifactListFilter {
|
|
33
|
+
session_id?: string;
|
|
34
|
+
subagent_id?: string;
|
|
35
|
+
tool_name?: string;
|
|
36
|
+
media_type?: string;
|
|
37
|
+
since?: number;
|
|
38
|
+
until?: number;
|
|
39
|
+
retention?: ArtifactRetention;
|
|
40
|
+
tag?: {
|
|
41
|
+
key: string;
|
|
42
|
+
value: string;
|
|
43
|
+
};
|
|
44
|
+
limit?: number;
|
|
45
|
+
}
|
|
@@ -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;
|