agent-afk 5.118.2 → 5.119.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/manifest/index.d.ts +5 -0
- package/dist/agent/manifest/reconcile.d.ts +22 -0
- package/dist/agent/manifest/types.d.ts +29 -0
- package/dist/agent/manifest/worktree.d.ts +3 -0
- package/dist/agent/manifest/write.d.ts +21 -0
- package/dist/agent/plugins/update.d.ts +9 -0
- package/dist/agent/tools/subagent-executor.d.ts +5 -0
- package/dist/agent/witness-sweep.d.ts +2 -0
- package/dist/cli.mjs +566 -566
- package/dist/config/env.d.ts +3 -0
- package/dist/index.mjs +195 -195
- package/dist/paths.d.ts +2 -0
- package/dist/telegram.mjs +268 -268
- package/package.json +1 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { WaveUnitStatus, PromptDigest, WaveUnit, WaveManifest, } from './types.js';
|
|
2
|
+
export { computePromptDigest, buildWaveUnit, createManifest, writeManifestSync, readManifest, updateWaveUnit, } from './write.js';
|
|
3
|
+
export { isWorktreeCwd, extractWorktreePath, checkWorktreePresence, } from './worktree.js';
|
|
4
|
+
export type { ResumableUnit, StaleManifestOffer, ReconcileResult } from './reconcile.js';
|
|
5
|
+
export { reconcileWaveManifests, formatResumptionOffer, shouldSurfaceResumptionOffer, sweepExpiredManifests, } from './reconcile.js';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { WaveManifest, WaveUnit } from './types.js';
|
|
2
|
+
export interface ResumableUnit {
|
|
3
|
+
unit: WaveUnit;
|
|
4
|
+
worktreeStatus: 'ok' | 'missing';
|
|
5
|
+
}
|
|
6
|
+
export interface StaleManifestOffer {
|
|
7
|
+
manifest: WaveManifest;
|
|
8
|
+
resumable: ResumableUnit[];
|
|
9
|
+
blocked: WaveUnit[];
|
|
10
|
+
}
|
|
11
|
+
export interface ReconcileResult {
|
|
12
|
+
offers: StaleManifestOffer[];
|
|
13
|
+
deletedExpired: number;
|
|
14
|
+
}
|
|
15
|
+
export declare function reconcileWaveManifests(opts: {
|
|
16
|
+
sessionId: string;
|
|
17
|
+
}): ReconcileResult;
|
|
18
|
+
export declare function formatResumptionOffer(offer: StaleManifestOffer): string;
|
|
19
|
+
export declare function shouldSurfaceResumptionOffer(isInteractive: boolean): boolean;
|
|
20
|
+
export declare function sweepExpiredManifests(): {
|
|
21
|
+
deleted: number;
|
|
22
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type WaveUnitStatus = 'pending' | 'running' | 'done' | 'failed' | 'skipped';
|
|
2
|
+
export interface PromptDigest {
|
|
3
|
+
sha256: string;
|
|
4
|
+
head: string;
|
|
5
|
+
byteLen: number;
|
|
6
|
+
}
|
|
7
|
+
export interface WaveUnit {
|
|
8
|
+
id: string;
|
|
9
|
+
status: WaveUnitStatus;
|
|
10
|
+
promptDigest: PromptDigest;
|
|
11
|
+
cwd: string | undefined;
|
|
12
|
+
model: string;
|
|
13
|
+
startedAt: string | undefined;
|
|
14
|
+
settledAt: string | undefined;
|
|
15
|
+
errorMessage: string | undefined;
|
|
16
|
+
upstreamIds: string[];
|
|
17
|
+
worktreePath: string | undefined;
|
|
18
|
+
}
|
|
19
|
+
export interface WaveManifest {
|
|
20
|
+
version: 1;
|
|
21
|
+
waveId: string;
|
|
22
|
+
parentSessionId: string;
|
|
23
|
+
traceLabel: string | null;
|
|
24
|
+
createdAt: string;
|
|
25
|
+
updatedAt: string;
|
|
26
|
+
expiresAt: string;
|
|
27
|
+
source: 'agent-tool' | 'compose-dag' | 'skill-fanout';
|
|
28
|
+
units: WaveUnit[];
|
|
29
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { WaveManifest, WaveUnit, WaveUnitStatus, PromptDigest } from './types.js';
|
|
2
|
+
export declare function computePromptDigest(prompt: string): PromptDigest;
|
|
3
|
+
export declare function buildWaveUnit(opts: {
|
|
4
|
+
id: string;
|
|
5
|
+
prompt: string;
|
|
6
|
+
cwd: string | undefined;
|
|
7
|
+
model: string;
|
|
8
|
+
upstreamIds?: string[];
|
|
9
|
+
}): WaveUnit;
|
|
10
|
+
export declare function createManifest(opts: {
|
|
11
|
+
source: WaveManifest['source'];
|
|
12
|
+
parentSessionId: string;
|
|
13
|
+
traceLabel: string | null;
|
|
14
|
+
units: WaveUnit[];
|
|
15
|
+
}): string | undefined;
|
|
16
|
+
export declare function writeManifestSync(manifest: WaveManifest): void;
|
|
17
|
+
export declare function readManifest(waveId: string): WaveManifest | undefined;
|
|
18
|
+
export declare function updateWaveUnit(waveId: string, unitId: string, newStatus: WaveUnitStatus, extra?: {
|
|
19
|
+
errorMessage?: string;
|
|
20
|
+
cwd?: string;
|
|
21
|
+
}): void;
|
|
@@ -5,6 +5,7 @@ export interface UpdateOptions {
|
|
|
5
5
|
export interface UpdateDeps {
|
|
6
6
|
pluginsDir?: string;
|
|
7
7
|
indexPath?: string;
|
|
8
|
+
cacheDir?: string;
|
|
8
9
|
gitRunner?: git.GitRunner;
|
|
9
10
|
now?: () => Date;
|
|
10
11
|
}
|
|
@@ -24,10 +25,18 @@ export type UpdateOutcome = {
|
|
|
24
25
|
} | {
|
|
25
26
|
name: string;
|
|
26
27
|
status: 'skipped-local';
|
|
28
|
+
} | {
|
|
29
|
+
name: string;
|
|
30
|
+
status: 'skipped-marketplace';
|
|
31
|
+
marketplace: string;
|
|
27
32
|
} | {
|
|
28
33
|
name: string;
|
|
29
34
|
status: 'missing-dir';
|
|
30
35
|
dir: string;
|
|
36
|
+
} | {
|
|
37
|
+
name: string;
|
|
38
|
+
status: 'removed-by-marketplace';
|
|
39
|
+
marketplace: string;
|
|
31
40
|
};
|
|
32
41
|
export declare function updatePlugin(name: string, options?: UpdateOptions, deps?: UpdateDeps): Promise<UpdateOutcome>;
|
|
33
42
|
export declare function updateAll(deps?: UpdateDeps): Promise<UpdateOutcome[]>;
|
|
@@ -56,6 +56,11 @@ export declare class SubagentExecutor implements SubagentControl {
|
|
|
56
56
|
describeAgentTool(): AnthropicToolDef;
|
|
57
57
|
private readonly promotionTriggers;
|
|
58
58
|
private readonly activeForegroundHandles;
|
|
59
|
+
private currentWaveId;
|
|
60
|
+
private currentWaveCallIds;
|
|
61
|
+
notifyWaveStart(calls: ReadonlyArray<ToolCall>, sessionId: string, traceLabel: string | null): void;
|
|
62
|
+
notifyWaveEnd(): void;
|
|
63
|
+
private updateCurrentWaveUnit;
|
|
59
64
|
hasPromotableForeground(): boolean;
|
|
60
65
|
hasActiveForeground(): boolean;
|
|
61
66
|
private cancelGeneration;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { sweepExpiredManifests as sweepWaveManifests } from './manifest/reconcile.js';
|
|
1
2
|
export declare const WITNESS_MAX_AGE_DAYS_DEFAULT = 30;
|
|
2
3
|
export declare const WITNESS_MAX_BYTES_DEFAULT: number;
|
|
3
4
|
export declare const WITNESS_EVICTION_GRACE_MS: number;
|
|
@@ -18,3 +19,4 @@ export interface WitnessSweepResult {
|
|
|
18
19
|
}
|
|
19
20
|
export declare function sweepWitnessTree(options?: WitnessSweepOptions): Promise<WitnessSweepResult>;
|
|
20
21
|
export declare const WITNESS_SWEEP_START_DELAY_MS = 5000;
|
|
22
|
+
export { sweepWaveManifests as sweepExpiredWaveManifests };
|