agent-afk 5.141.1 → 5.143.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/cli/commands/interactive/plain-progress.d.ts +12 -0
- package/dist/cli/commands/interactive/tool-lane-render.d.ts +2 -0
- package/dist/cli/commands/interactive/tool-lane.d.ts +2 -0
- package/dist/cli/commands/interactive/turn-handler.context-progress.d.ts +2 -0
- package/dist/cli/commands/interactive/turn-handler.plain-hooks.d.ts +14 -0
- package/dist/cli/commands/interactive/turn-handler.ttfb.d.ts +5 -1
- package/dist/cli.mjs +587 -587
- package/dist/index.mjs +1 -1
- package/dist/telegram.mjs +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { OutputEvent, SubagentProgressMeta } from '../../../agent/types.js';
|
|
2
|
+
import type { ToolResultChunk, ToolUseDetailChunk } from '../../../agent/types/message-types.js';
|
|
3
|
+
import type { CompletionWriter } from './shared.js';
|
|
4
|
+
export interface PlainProgressState {
|
|
5
|
+
readonly toolStartTimes: Map<string, number>;
|
|
6
|
+
readonly subagentStartTimes: Map<string, number>;
|
|
7
|
+
readonly subagentLabels: Map<string, string>;
|
|
8
|
+
}
|
|
9
|
+
export declare function createPlainProgressState(): PlainProgressState;
|
|
10
|
+
export declare function recordToolStart(state: PlainProgressState, chunk: ToolUseDetailChunk): void;
|
|
11
|
+
export declare function emitPlainToolCompletion(state: PlainProgressState, chunk: ToolResultChunk, toolName: string | undefined, writer: CompletionWriter): void;
|
|
12
|
+
export declare function observePlainSubagentEvent(state: PlainProgressState, event: OutputEvent, meta: SubagentProgressMeta, writer: CompletionWriter): void;
|
|
@@ -13,10 +13,12 @@ interface ToolEntryFields {
|
|
|
13
13
|
thinkingTail?: string;
|
|
14
14
|
diff?: DiffPayload;
|
|
15
15
|
headerEmitted?: boolean;
|
|
16
|
+
startedAt: number;
|
|
16
17
|
}
|
|
17
18
|
export type ToolEntry = ToolEntryFields & {
|
|
18
19
|
kind: 'tool';
|
|
19
20
|
};
|
|
21
|
+
export declare function freshToolEntry(toolUseId: string, toolName: string, toolInput: string, prefix: string, agentContext?: string): ToolEntry;
|
|
20
22
|
export interface TextEntry {
|
|
21
23
|
kind: 'text';
|
|
22
24
|
toolUseId: string;
|
|
@@ -8,6 +8,7 @@ export declare class ToolLane {
|
|
|
8
8
|
private entries;
|
|
9
9
|
private order;
|
|
10
10
|
private agentIdStack;
|
|
11
|
+
private lastElapsedSecond;
|
|
11
12
|
addStart(toolUseId: string, toolName: string, toolInput: string): void;
|
|
12
13
|
addStartWithAgentContext(toolUseId: string, toolName: string, toolInput: string, agentContext: string | undefined, maxWidth?: number): void;
|
|
13
14
|
mergeAgentLabel(parentToolUseId: string, label: string, maxWidth?: number): boolean;
|
|
@@ -18,6 +19,7 @@ export declare class ToolLane {
|
|
|
18
19
|
addDiff(toolUseId: string, diff: DiffPayload): void;
|
|
19
20
|
upsertTextChild(toolUseId: string, agentContext: string, text: string): void;
|
|
20
21
|
removeTextChildrenUnder(agentContext: string): void;
|
|
22
|
+
checkElapsedDisplayNeedsUpdate(): boolean;
|
|
21
23
|
hasPending(): boolean;
|
|
22
24
|
hasEntry(id: string): boolean;
|
|
23
25
|
findLastSkillEntryId(): string | undefined;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { OutputEvent, SubagentProgressMeta } from '../../../agent/types.js';
|
|
2
|
+
import type { ToolResultChunk, ToolUseDetailChunk } from '../../../agent/types/message-types.js';
|
|
3
|
+
import type { CompletionWriter } from './shared.js';
|
|
4
|
+
import type { TurnTtfbState } from './turn-handler.ttfb.js';
|
|
5
|
+
export declare class PlainTurnHooks {
|
|
6
|
+
private readonly state;
|
|
7
|
+
private readonly writer;
|
|
8
|
+
private readonly ttfb;
|
|
9
|
+
constructor(writer: CompletionWriter, ttfb: TurnTtfbState);
|
|
10
|
+
onToolStart(chunk: ToolUseDetailChunk): void;
|
|
11
|
+
onToolResult(chunk: ToolResultChunk, toolName: string | undefined): void;
|
|
12
|
+
onSubagentEvent(event: OutputEvent, meta: SubagentProgressMeta): void;
|
|
13
|
+
onFirstContent(stdout: NodeJS.WriteStream): void;
|
|
14
|
+
}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import type { OutputEvent } from '../../../agent/types.js';
|
|
2
2
|
import type { CompletionWriter } from './shared.js';
|
|
3
|
+
import { PlainTurnHooks } from './turn-handler.plain-hooks.js';
|
|
3
4
|
export interface TurnTtfbState {
|
|
4
5
|
readonly startedAt: number;
|
|
5
6
|
received: boolean;
|
|
7
|
+
waitingLineEmitted: boolean;
|
|
8
|
+
plainHooks?: PlainTurnHooks;
|
|
6
9
|
}
|
|
7
10
|
export declare function createTurnTtfbState(startedAt: number): TurnTtfbState;
|
|
8
11
|
export declare function ttfbRendererOptions(state: TurnTtfbState): {
|
|
9
12
|
turnStartedAt?: number;
|
|
10
13
|
};
|
|
11
14
|
export declare function observeFirstContent(state: TurnTtfbState, event: OutputEvent, streamingStarted: boolean): boolean;
|
|
12
|
-
export declare function emitPlainTtfbWaiting(completionWriter: CompletionWriter | undefined): void;
|
|
15
|
+
export declare function emitPlainTtfbWaiting(completionWriter: CompletionWriter | undefined, stdout?: NodeJS.WriteStream, state?: TurnTtfbState): void;
|
|
16
|
+
export declare function eraseWaitingLineIfNeeded(state: TurnTtfbState, stdout?: NodeJS.WriteStream): void;
|