agent-afk 5.303.6 → 5.303.8
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/hooks.d.ts +2 -0
- package/dist/agent/providers/openai-compatible/query/stream-drive.d.ts +1 -0
- package/dist/agent/providers/openai-compatible/query/stream-drive.stream-error.d.ts +2 -1
- package/dist/agent/unproven-diagnosis-detect.d.ts +7 -0
- package/dist/cli/commands/interactive/loop-stage.d.ts +3 -0
- package/dist/cli/health-rail.d.ts +3 -0
- package/dist/cli/terminal-compositor.d.ts +9 -0
- package/dist/cli/terminal-compositor.frame.d.ts +1 -0
- package/dist/cli/terminal-compositor.input-dispatch.d.ts +1 -0
- package/dist/cli/terminal-compositor.lifecycle.cpr.d.ts +38 -0
- package/dist/cli/terminal-compositor.lifecycle.d.ts +9 -0
- package/dist/cli/terminal-compositor.reset.d.ts +1 -0
- package/dist/cli.mjs +352 -340
- package/dist/config/env.d.ts +8 -0
- package/dist/config/env.hooks.d.ts +9 -0
- package/dist/index.mjs +143 -143
- package/dist/telegram.mjs +175 -167
- package/package.json +1 -1
package/dist/agent/hooks.d.ts
CHANGED
|
@@ -87,6 +87,8 @@ export interface StopContext {
|
|
|
87
87
|
doneEvidenceClassification?: 'no-code-changes' | 'verified' | 'unverified';
|
|
88
88
|
stopHookActive?: boolean;
|
|
89
89
|
continuation?: number;
|
|
90
|
+
assistantText?: string;
|
|
91
|
+
successfulToolNames?: readonly string[];
|
|
90
92
|
}
|
|
91
93
|
export interface UserPromptSubmitContext {
|
|
92
94
|
event: 'UserPromptSubmit';
|
|
@@ -11,6 +11,7 @@ export interface StreamDriveStrategy<TEvent> {
|
|
|
11
11
|
createStream: (signal: AbortSignal) => Promise<AsyncIterable<TEvent>>;
|
|
12
12
|
translate: (event: TEvent, state: StreamState) => Iterable<ProviderEvent>;
|
|
13
13
|
clarifyError: (err: unknown) => Error;
|
|
14
|
+
expectsTrailingUsage?: boolean;
|
|
14
15
|
}
|
|
15
16
|
export interface StreamDriveContext {
|
|
16
17
|
controller: AbortController;
|
|
@@ -5,6 +5,7 @@ export interface RetryAction {
|
|
|
5
5
|
reason: 'stall_timeout' | 'ttfb_timeout' | 'retry-after' | 'backoff' | 'network_termination';
|
|
6
6
|
attempt: number;
|
|
7
7
|
errorCode?: string;
|
|
8
|
+
awaitingUsage?: true;
|
|
8
9
|
}
|
|
9
10
|
export interface FatalAction {
|
|
10
11
|
kind: 'fatal';
|
|
@@ -18,7 +19,7 @@ export interface FallThroughAction {
|
|
|
18
19
|
error: unknown;
|
|
19
20
|
}
|
|
20
21
|
export type StreamErrorAction = RetryAction | FatalAction | AcceptAction | FallThroughAction;
|
|
21
|
-
export declare function classifyStreamError(err: unknown, contentYieldedThisAttempt: boolean, streamRetries: number, stallMs: number, stallTimedOut?: boolean, ttfbTimedOut?: boolean, terminalFinishReason?: string | null, usageReceived?: boolean): {
|
|
22
|
+
export declare function classifyStreamError(err: unknown, contentYieldedThisAttempt: boolean, streamRetries: number, stallMs: number, stallTimedOut?: boolean, ttfbTimedOut?: boolean, terminalFinishReason?: string | null, usageReceived?: boolean, expectsTrailingUsage?: boolean): {
|
|
22
23
|
action: StreamErrorAction;
|
|
23
24
|
newStreamRetries: number;
|
|
24
25
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { HookHandler } from './hooks.js';
|
|
2
|
+
export declare function hasCauseUnknownPhrase(text: string): boolean;
|
|
3
|
+
export declare const INSTRUMENTATION_TOOL_NAMES: ReadonlySet<string>;
|
|
4
|
+
export declare function hasInstrumentationEvidence(successfulToolNames: readonly string[]): boolean;
|
|
5
|
+
export declare function createUnprovenDiagnosisDetectHook(deps?: {
|
|
6
|
+
isEnabled?: () => boolean;
|
|
7
|
+
}): HookHandler;
|
|
@@ -23,7 +23,10 @@ export declare class LoopStageBar {
|
|
|
23
23
|
private started;
|
|
24
24
|
private currentStage;
|
|
25
25
|
private resizeUnsub;
|
|
26
|
+
private resizeImmediateUnsub;
|
|
26
27
|
private onRowCountChange?;
|
|
28
|
+
private lastPaintedRow;
|
|
29
|
+
private preResizePaintedRow;
|
|
27
30
|
constructor(opts: {
|
|
28
31
|
getExtraRows: () => number;
|
|
29
32
|
stream?: NodeJS.WriteStream;
|
|
@@ -18,7 +18,10 @@ export declare class HealthRail {
|
|
|
18
18
|
private snapshot;
|
|
19
19
|
private onRowCountChange?;
|
|
20
20
|
private resizeUnsub;
|
|
21
|
+
private resizeImmediateUnsub;
|
|
21
22
|
private tickInterval;
|
|
23
|
+
private lastPaintedRow;
|
|
24
|
+
private preResizePaintedRow;
|
|
22
25
|
private totalBgSubsEver;
|
|
23
26
|
private totalFgSubsEver;
|
|
24
27
|
constructor(opts: HealthRailOptions);
|
|
@@ -91,6 +91,15 @@ export declare class TerminalCompositor {
|
|
|
91
91
|
top: number;
|
|
92
92
|
bottom: number;
|
|
93
93
|
} | null;
|
|
94
|
+
cprPending: boolean;
|
|
95
|
+
cprBurst: {
|
|
96
|
+
dirty: boolean;
|
|
97
|
+
originalExpectedRow: number;
|
|
98
|
+
currentRows: number;
|
|
99
|
+
growTotal: number;
|
|
100
|
+
shrinkTotal: number;
|
|
101
|
+
requeryCt: number;
|
|
102
|
+
} | null;
|
|
94
103
|
bandGeometryStale: boolean;
|
|
95
104
|
lifecycleStateDirty: boolean;
|
|
96
105
|
commitInFlight: boolean;
|
|
@@ -49,6 +49,7 @@ export interface KeyDispatchHost {
|
|
|
49
49
|
readonly onOpenEditor?: () => void;
|
|
50
50
|
readonly onOpenOutputViewer?: () => void;
|
|
51
51
|
readonly onSubmit?: (payload: SubmissionPayload) => void;
|
|
52
|
+
readonly cprPending: boolean;
|
|
52
53
|
}
|
|
53
54
|
export declare function applyEdit(self: KeyDispatchHost, next: InputCoreState): boolean;
|
|
54
55
|
export declare function dispatchKey(self: KeyDispatchHost, char: string | undefined, key: KeyInfo): void;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export declare const CPR_REPLY_RE: RegExp;
|
|
2
|
+
export declare function parseCprReply(s: string): {
|
|
3
|
+
row: number;
|
|
4
|
+
col: number;
|
|
5
|
+
} | null;
|
|
6
|
+
export declare const CPR_REQUEST = "\u001B[6n";
|
|
7
|
+
export declare const CPR_TIMEOUT_MS = 120;
|
|
8
|
+
export declare const CPR_MAX_REQUERY = 8;
|
|
9
|
+
export interface CprHost {
|
|
10
|
+
readonly stdout: NodeJS.WriteStream;
|
|
11
|
+
readonly stdin: NodeJS.ReadStream;
|
|
12
|
+
readonly armed: boolean;
|
|
13
|
+
cprPending: boolean;
|
|
14
|
+
cprBurst: {
|
|
15
|
+
dirty: boolean;
|
|
16
|
+
originalExpectedRow: number;
|
|
17
|
+
currentRows: number;
|
|
18
|
+
growTotal: number;
|
|
19
|
+
shrinkTotal: number;
|
|
20
|
+
requeryCt: number;
|
|
21
|
+
} | null;
|
|
22
|
+
lastMeasuredFrameTop: number;
|
|
23
|
+
lastMeasuredFrameBottom: number;
|
|
24
|
+
committedBandTopRow: number;
|
|
25
|
+
committedBandBottomRow: number;
|
|
26
|
+
pendingResizeErase: {
|
|
27
|
+
top: number;
|
|
28
|
+
bottom: number;
|
|
29
|
+
} | null;
|
|
30
|
+
logUpdate: {
|
|
31
|
+
topRow?: number;
|
|
32
|
+
resetGeometry?: () => void;
|
|
33
|
+
} | null;
|
|
34
|
+
anchorRow: number | undefined;
|
|
35
|
+
repaint(): void;
|
|
36
|
+
}
|
|
37
|
+
export declare function requestCprOrMarkDirty(self: CprHost, expectedRow: number, newRows: number, rowDelta: number): void;
|
|
38
|
+
export declare function requestCprAndApplyDelta(self: CprHost, expectedRow: number, newRows: number, rowDelta: number): void;
|
|
@@ -35,6 +35,15 @@ export interface LifecycleHost {
|
|
|
35
35
|
top: number;
|
|
36
36
|
bottom: number;
|
|
37
37
|
} | null;
|
|
38
|
+
cprPending: boolean;
|
|
39
|
+
cprBurst: {
|
|
40
|
+
dirty: boolean;
|
|
41
|
+
originalExpectedRow: number;
|
|
42
|
+
currentRows: number;
|
|
43
|
+
growTotal: number;
|
|
44
|
+
shrinkTotal: number;
|
|
45
|
+
requeryCt: number;
|
|
46
|
+
} | null;
|
|
38
47
|
committedBand: string[];
|
|
39
48
|
committedBandMeta: BandRowMeta[];
|
|
40
49
|
committedBandTopRow: number;
|