agent-afk 5.293.1 → 5.295.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/done-evidence.d.ts +9 -0
- package/dist/agent/facets/derive.pr-detect.d.ts +3 -0
- package/dist/agent/facets/schema.d.ts +2 -0
- package/dist/agent/providers/openai-compatible/responses-translate.d.ts +6 -0
- package/dist/agent/session/agent-session.d.ts +3 -0
- package/dist/agent/session/hooks-dispatch.d.ts +12 -1
- package/dist/agent/session/stream-consumer.d.ts +2 -2
- package/dist/agent/session/stream-consumer.tool-events.d.ts +16 -0
- package/dist/agent/session/turn-stream-runner.d.ts +2 -0
- package/dist/agent/session/turn-stream-runner.stop.d.ts +13 -0
- package/dist/agent/terminal-state-gate.d.ts +10 -0
- package/dist/agent/tools/handlers/wait-for.limits.d.ts +2 -0
- package/dist/agent/trace/events.d.ts +6 -0
- package/dist/agent/trace/events.session-phase.d.ts +2 -0
- package/dist/agent/trace/types.d.ts +1 -1
- package/dist/agent/trace/types.session-phase.d.ts +1 -1
- package/dist/agent/types/session-types.d.ts +7 -0
- package/dist/cli/_lib/stream-renderer-process.d.ts +1 -0
- package/dist/cli/_lib/stream-renderer.d.ts +1 -0
- package/dist/cli/commands/chat.session-wiring.d.ts +7 -0
- package/dist/cli/commands/interactive/loop-iteration.stop-wiring.d.ts +3 -0
- package/dist/cli/commands/interactive/terminal-state-gate.d.ts +1 -10
- package/dist/cli/input/spinner.d.ts +2 -0
- package/dist/cli/input/work-derived-verb.d.ts +8 -0
- package/dist/cli/terminal-compositor.d.ts +2 -0
- package/dist/cli/terminal-compositor.scrollback.d.ts +1 -1
- package/dist/cli.mjs +327 -326
- package/dist/config/env.d.ts +1 -1
- package/dist/config/env.ui.d.ts +1 -1
- package/dist/index.mjs +133 -132
- package/dist/telegram.mjs +162 -158
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface ToolEventMin {
|
|
2
|
+
toolName: string;
|
|
3
|
+
input: string;
|
|
4
|
+
isError?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const DONE_EVIDENCE_TOOLS: ReadonlySet<string>;
|
|
7
|
+
export declare function isVerificationCommand(input: string): boolean;
|
|
8
|
+
export declare function classifyDoneEvidence(toolEvents: readonly ToolEventMin[]): 'no-code-changes' | 'verified' | 'unverified';
|
|
9
|
+
export declare function doneHasCorroboratingEvidence(toolEvents: readonly ToolEventMin[]): boolean;
|
|
@@ -122,6 +122,7 @@ export declare const SubagentToolSummarySchema: z.ZodObject<{
|
|
|
122
122
|
tool_calls: z.ZodNumber;
|
|
123
123
|
tool_errors: z.ZodNumber;
|
|
124
124
|
tool_counts: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
125
|
+
detected_pr_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
125
126
|
}, z.core.$strip>;
|
|
126
127
|
export type SubagentToolSummary = z.infer<typeof SubagentToolSummarySchema>;
|
|
127
128
|
export declare const SessionFacetSchema: z.ZodObject<{
|
|
@@ -214,6 +215,7 @@ export declare const SessionFacetSchema: z.ZodObject<{
|
|
|
214
215
|
tool_calls: z.ZodNumber;
|
|
215
216
|
tool_errors: z.ZodNumber;
|
|
216
217
|
tool_counts: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
218
|
+
detected_pr_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
217
219
|
}, z.core.$strip>>>;
|
|
218
220
|
}, z.core.$loose>;
|
|
219
221
|
export type SessionFacet = z.infer<typeof SessionFacetSchema>;
|
|
@@ -27,6 +27,12 @@ export interface ResponsesStreamEvent {
|
|
|
27
27
|
incomplete_details?: {
|
|
28
28
|
reason?: string;
|
|
29
29
|
};
|
|
30
|
+
error?: {
|
|
31
|
+
code?: string;
|
|
32
|
+
message?: string;
|
|
33
|
+
} | null;
|
|
30
34
|
};
|
|
35
|
+
code?: string | null;
|
|
36
|
+
message?: string;
|
|
31
37
|
}
|
|
32
38
|
export declare function translateResponsesEvent(event: ResponsesStreamEvent, state: StreamState, sessionId: string): Generator<ProviderEvent>;
|
|
@@ -5,10 +5,12 @@ import type { ProviderCommandInfo, ProviderCompactResult, ProviderQuery, Provide
|
|
|
5
5
|
import type { AccountInfo, AgentConfig, AgentInfo, AgentModelInput, IAgentSession, InputStreamRef, McpServerStatus, Message, ModelInfo, OutputEvent, PermissionMode, ResponseMetadata, RewindFilesResult, SDKControlGetContextUsageResponse, SendMessageOptions, SessionIdentity, SessionMetadata, SessionState, StructuredMessageOptions } from '../types.js';
|
|
6
6
|
import type { ZodType } from 'zod';
|
|
7
7
|
import type { ElicitationRequest } from '../types/sdk-types.js';
|
|
8
|
+
import type { StopWiring } from '../types/session-types.js';
|
|
8
9
|
import type { MessageJournal } from '../journal/index.js';
|
|
9
10
|
export declare class AgentSession implements IAgentSession {
|
|
10
11
|
private readonly ownedTraceWriter;
|
|
11
12
|
private config;
|
|
13
|
+
private stopWiring;
|
|
12
14
|
private readonly planExit;
|
|
13
15
|
private currentState;
|
|
14
16
|
private providerQuery;
|
|
@@ -45,6 +47,7 @@ export declare class AgentSession implements IAgentSession {
|
|
|
45
47
|
sendMessageStream(content: string | ContentBlockParam[]): AsyncIterableIterator<OutputEvent>;
|
|
46
48
|
interrupt(): Promise<void>;
|
|
47
49
|
setBeforeNextRound(cb: (() => string | undefined) | undefined): void;
|
|
50
|
+
wireStopHook(wiring: StopWiring): void;
|
|
48
51
|
reset(): Promise<void>;
|
|
49
52
|
private onAbort;
|
|
50
53
|
private makeConfigDeps;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { HookRegistry, SessionEndContext, SessionStartContext } from '../hooks.js';
|
|
1
|
+
import type { HookRegistry, SessionEndContext, SessionStartContext, StopContext } from '../hooks.js';
|
|
2
2
|
import type { TraceSink } from '../trace/index.js';
|
|
3
3
|
export interface SessionHookDispatchOptions {
|
|
4
4
|
signal?: AbortSignal;
|
|
@@ -7,3 +7,14 @@ export interface SessionHookDispatchOptions {
|
|
|
7
7
|
}
|
|
8
8
|
export declare function dispatchSessionStart(registry: HookRegistry | undefined, context: SessionStartContext, options?: SessionHookDispatchOptions): Promise<string | undefined>;
|
|
9
9
|
export declare function dispatchSessionEnd(registry: HookRegistry | undefined, context: SessionEndContext, options?: SessionHookDispatchOptions): Promise<void>;
|
|
10
|
+
export interface StopHookDispatchOptions extends SessionHookDispatchOptions {
|
|
11
|
+
hasNextTurn: boolean;
|
|
12
|
+
surface?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface StopHookDispatchResult {
|
|
15
|
+
injectContext?: string;
|
|
16
|
+
wasBlocked?: boolean;
|
|
17
|
+
blockedReason?: string;
|
|
18
|
+
wasTimeout?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare function dispatchStopHook(registry: HookRegistry | undefined, context: StopContext, options: StopHookDispatchOptions): Promise<StopHookDispatchResult>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { ProviderEvent, ProviderUsage } from '../provider.js';
|
|
2
|
+
import { type ToolEventAccumulator } from './stream-consumer.tool-events.js';
|
|
2
3
|
import type { Message, OutputEvent, ResponseMetadata, SessionMetadata } from '../types.js';
|
|
3
4
|
import { BudgetExceededError } from '../../utils/errors.js';
|
|
4
5
|
import type { TraceSink } from '../trace/index.js';
|
|
5
|
-
export type TransformDeps = {
|
|
6
|
+
export type TransformDeps = ToolEventAccumulator & {
|
|
6
7
|
conversationHistory: Message[];
|
|
7
8
|
getSessionMetadata: () => SessionMetadata;
|
|
8
9
|
setSessionMetadata: (updater: (prev: SessionMetadata) => SessionMetadata) => void;
|
|
@@ -12,7 +13,6 @@ export type TransformDeps = {
|
|
|
12
13
|
maxBudgetUsd?: number;
|
|
13
14
|
abortBudget?: (reason: BudgetExceededError) => void;
|
|
14
15
|
_runningCostUsd?: number;
|
|
15
|
-
_successfulToolNames?: string[];
|
|
16
16
|
traceWriter?: TraceSink;
|
|
17
17
|
};
|
|
18
18
|
export declare function parsePersistedOutput(content: string): {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ProviderEvent } from '../provider.js';
|
|
2
|
+
import type { ToolEventMin } from '../done-evidence.js';
|
|
3
|
+
type ToolUseStartEvent = Extract<ProviderEvent, {
|
|
4
|
+
type: 'tool.use.start';
|
|
5
|
+
}>;
|
|
6
|
+
type ToolOutputEvent = Extract<ProviderEvent, {
|
|
7
|
+
type: 'tool.output';
|
|
8
|
+
}>;
|
|
9
|
+
export interface ToolEventAccumulator {
|
|
10
|
+
_successfulToolNames?: string[];
|
|
11
|
+
_pendingToolInputs?: Map<string, string>;
|
|
12
|
+
_turnToolEvents?: ToolEventMin[];
|
|
13
|
+
}
|
|
14
|
+
export declare function recordToolUseStart(acc: ToolEventAccumulator, event: ToolUseStartEvent): void;
|
|
15
|
+
export declare function recordToolOutput(acc: ToolEventAccumulator, event: ToolOutputEvent): void;
|
|
16
|
+
export {};
|
|
@@ -7,6 +7,7 @@ import type { SessionStateManager } from './session-state.js';
|
|
|
7
7
|
import type { AgentConfig, OutputEvent, ResponseMetadata, SessionState } from '../types.js';
|
|
8
8
|
import type { ProviderQuery, ProviderEvent } from '../provider.js';
|
|
9
9
|
import type { Message } from '../types.js';
|
|
10
|
+
import type { StopWiring } from '../types/session-types.js';
|
|
10
11
|
export interface TurnRunnerDeps {
|
|
11
12
|
getConfig: () => AgentConfig;
|
|
12
13
|
getAbortController: () => AbortController;
|
|
@@ -31,6 +32,7 @@ export interface TurnRunnerDeps {
|
|
|
31
32
|
getProviderQuery: () => ProviderQuery;
|
|
32
33
|
getLedgerMetadata: () => ReturnType<SessionStateManager['getSessionMetadata']>;
|
|
33
34
|
observeProviderEvent?: (event: ProviderEvent) => void;
|
|
35
|
+
getStopWiring?: () => StopWiring | undefined;
|
|
34
36
|
}
|
|
35
37
|
export declare class TurnStreamRunner {
|
|
36
38
|
private readonly deps;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AgentConfig } from '../types.js';
|
|
2
|
+
import type { Message } from '../types.js';
|
|
3
|
+
import type { StopWiring } from '../types/session-types.js';
|
|
4
|
+
import { type ToolEventMin } from '../done-evidence.js';
|
|
5
|
+
export interface TurnStopParams {
|
|
6
|
+
config: AgentConfig;
|
|
7
|
+
wiring: StopWiring | undefined;
|
|
8
|
+
sessionId: string | undefined;
|
|
9
|
+
signal: AbortSignal;
|
|
10
|
+
conversationHistory: readonly Message[];
|
|
11
|
+
toolEvents: readonly ToolEventMin[];
|
|
12
|
+
}
|
|
13
|
+
export declare function dispatchTurnStop(p: TurnStopParams): Promise<void>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HookHandler } from './hooks.js';
|
|
2
|
+
import type { PermissionMode } from './types/sdk-types.js';
|
|
3
|
+
export declare const DEFAULT_MAX_TERMINAL_STATE_INJECTIONS = 3;
|
|
4
|
+
export declare const TERMINAL_STATE_GATE_CORRECTION: string;
|
|
5
|
+
export interface TerminalStateGateOptions {
|
|
6
|
+
getPermissionMode: () => PermissionMode;
|
|
7
|
+
isEnabled: () => boolean;
|
|
8
|
+
maxInjectionsPerSession?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function createTerminalStateGate(opts: TerminalStateGateOptions): HookHandler;
|
|
@@ -94,6 +94,7 @@ export declare const HookEventNameSchema: z.ZodEnum<{
|
|
|
94
94
|
PostToolUseFailure: "PostToolUseFailure";
|
|
95
95
|
SessionStart: "SessionStart";
|
|
96
96
|
SessionEnd: "SessionEnd";
|
|
97
|
+
Stop: "Stop";
|
|
97
98
|
SubagentStart: "SubagentStart";
|
|
98
99
|
SubagentStop: "SubagentStop";
|
|
99
100
|
}>;
|
|
@@ -104,6 +105,7 @@ export declare const HookDecisionPayloadSchema: z.ZodObject<{
|
|
|
104
105
|
PostToolUseFailure: "PostToolUseFailure";
|
|
105
106
|
SessionStart: "SessionStart";
|
|
106
107
|
SessionEnd: "SessionEnd";
|
|
108
|
+
Stop: "Stop";
|
|
107
109
|
SubagentStart: "SubagentStart";
|
|
108
110
|
SubagentStop: "SubagentStop";
|
|
109
111
|
}>;
|
|
@@ -459,6 +461,7 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
459
461
|
PostToolUseFailure: "PostToolUseFailure";
|
|
460
462
|
SessionStart: "SessionStart";
|
|
461
463
|
SessionEnd: "SessionEnd";
|
|
464
|
+
Stop: "Stop";
|
|
462
465
|
SubagentStart: "SubagentStart";
|
|
463
466
|
SubagentStop: "SubagentStop";
|
|
464
467
|
}>;
|
|
@@ -765,6 +768,7 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
765
768
|
connection_retry: "connection_retry";
|
|
766
769
|
usage_notice: "usage_notice";
|
|
767
770
|
tool_degraded: "tool_degraded";
|
|
771
|
+
stop_inject_dropped: "stop_inject_dropped";
|
|
768
772
|
}>;
|
|
769
773
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
770
774
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -836,6 +840,7 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
836
840
|
PostToolUseFailure: "PostToolUseFailure";
|
|
837
841
|
SessionStart: "SessionStart";
|
|
838
842
|
SessionEnd: "SessionEnd";
|
|
843
|
+
Stop: "Stop";
|
|
839
844
|
SubagentStart: "SubagentStart";
|
|
840
845
|
SubagentStop: "SubagentStop";
|
|
841
846
|
}>;
|
|
@@ -1168,6 +1173,7 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1168
1173
|
connection_retry: "connection_retry";
|
|
1169
1174
|
usage_notice: "usage_notice";
|
|
1170
1175
|
tool_degraded: "tool_degraded";
|
|
1176
|
+
stop_inject_dropped: "stop_inject_dropped";
|
|
1171
1177
|
}>;
|
|
1172
1178
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
1173
1179
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -32,6 +32,7 @@ export declare const SessionPhaseNameSchema: z.ZodEnum<{
|
|
|
32
32
|
connection_retry: "connection_retry";
|
|
33
33
|
usage_notice: "usage_notice";
|
|
34
34
|
tool_degraded: "tool_degraded";
|
|
35
|
+
stop_inject_dropped: "stop_inject_dropped";
|
|
35
36
|
}>;
|
|
36
37
|
export declare const SessionPhasePayloadSchema: z.ZodObject<{
|
|
37
38
|
phase: z.ZodEnum<{
|
|
@@ -67,6 +68,7 @@ export declare const SessionPhasePayloadSchema: z.ZodObject<{
|
|
|
67
68
|
connection_retry: "connection_retry";
|
|
68
69
|
usage_notice: "usage_notice";
|
|
69
70
|
tool_degraded: "tool_degraded";
|
|
71
|
+
stop_inject_dropped: "stop_inject_dropped";
|
|
70
72
|
}>;
|
|
71
73
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
72
74
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -30,7 +30,7 @@ export interface ToolCallCompletedPayload {
|
|
|
30
30
|
testResult?: import('../tools/handlers/test-runner-detector.js').TestResult;
|
|
31
31
|
}
|
|
32
32
|
export type ToolCallPayload = ToolCallStartedPayload | ToolCallCompletedPayload;
|
|
33
|
-
export type HookEventName = 'PreToolUse' | 'PostToolUse' | 'PostToolUseFailure' | 'SessionStart' | 'SessionEnd' | 'SubagentStart' | 'SubagentStop';
|
|
33
|
+
export type HookEventName = 'PreToolUse' | 'PostToolUse' | 'PostToolUseFailure' | 'SessionStart' | 'SessionEnd' | 'Stop' | 'SubagentStart' | 'SubagentStop';
|
|
34
34
|
export type AfkApprovalOutcome = 'carve-out' | 'approved' | 'denied' | 'unrecognised' | 'timeout' | 'decline' | 'cancel' | 'hard-block';
|
|
35
35
|
export interface HookDecisionPayload {
|
|
36
36
|
hookEvent: HookEventName;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type SessionPhaseName = 'bootstrap_start' | 'bootstrap_done' | 'session_init_start' | 'session_init_done' | 'mcp_connect_start' | 'mcp_connect_done' | 'mcp_server_start' | 'mcp_server_done' | 'loop_start' | 'loop_end' | 'model_ttfb' | 'interrupt_halt' | 'rate_limit' | 'ttfb_timeout' | 'usage_limit_pause' | 'usage_limit_resume' | 'overload_pause' | 'overload_resume' | 'idle_watchdog_fired' | 'pause_extension_granted' | 'suspected_loop' | 'compaction_disabled' | 'boot_warning' | 'workspace_subscribed' | 'workspace_delivery' | 'gate_shape' | 'session_id_assigned' | 'many_image_degraded' | 'stream_accepted_after_drop' | 'connection_retry' | 'usage_notice' | 'tool_degraded';
|
|
1
|
+
export type SessionPhaseName = 'bootstrap_start' | 'bootstrap_done' | 'session_init_start' | 'session_init_done' | 'mcp_connect_start' | 'mcp_connect_done' | 'mcp_server_start' | 'mcp_server_done' | 'loop_start' | 'loop_end' | 'model_ttfb' | 'interrupt_halt' | 'rate_limit' | 'ttfb_timeout' | 'usage_limit_pause' | 'usage_limit_resume' | 'overload_pause' | 'overload_resume' | 'idle_watchdog_fired' | 'pause_extension_granted' | 'suspected_loop' | 'compaction_disabled' | 'boot_warning' | 'workspace_subscribed' | 'workspace_delivery' | 'gate_shape' | 'session_id_assigned' | 'many_image_degraded' | 'stream_accepted_after_drop' | 'connection_retry' | 'usage_notice' | 'tool_degraded' | 'stop_inject_dropped';
|
|
2
2
|
export interface SessionPhasePayload {
|
|
3
3
|
phase: SessionPhaseName;
|
|
4
4
|
durationMs?: number;
|
|
@@ -150,6 +150,7 @@ export interface IAgentSession {
|
|
|
150
150
|
sendMessageStructured?<T>(content: string, schema: ZodType<T>, options?: StructuredMessageOptions): Promise<T>;
|
|
151
151
|
interrupt(): Promise<void>;
|
|
152
152
|
setBeforeNextRound?(cb: (() => string | undefined) | undefined): void;
|
|
153
|
+
wireStopHook?(wiring: StopWiring): void;
|
|
153
154
|
reset(): Promise<void>;
|
|
154
155
|
readonly abortSignal: AbortSignal;
|
|
155
156
|
abort(reason: string): void;
|
|
@@ -181,3 +182,9 @@ export interface IAgentSession {
|
|
|
181
182
|
rewindConversation(turnIndex: number): Promise<ProviderRewindConversationResult>;
|
|
182
183
|
close(): Promise<void>;
|
|
183
184
|
}
|
|
185
|
+
export interface StopWiring {
|
|
186
|
+
getHasNextTurn: () => boolean;
|
|
187
|
+
onStopInjectContext?: (text: string) => void;
|
|
188
|
+
onStopBlocked?: (reason: string | undefined) => void;
|
|
189
|
+
onStopTimeout?: () => void;
|
|
190
|
+
}
|
|
@@ -26,6 +26,7 @@ export interface ProcessCtx {
|
|
|
26
26
|
coordinator: CommitCoordinator;
|
|
27
27
|
childActivity: ChildActivityTracker;
|
|
28
28
|
inFlightTools: InFlightToolTracker;
|
|
29
|
+
rootTools: InFlightToolTracker;
|
|
29
30
|
sources: Map<string, SourceState>;
|
|
30
31
|
subagentMarkdown: Map<string, StreamingMarkdownRenderer>;
|
|
31
32
|
lastProgressByTask: Map<string, ProgressEvent>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AgentSession } from '../../agent/session.js';
|
|
2
|
+
type SubagentCompletionArgs = Parameters<AgentSession['recordSubagentCompletion']>;
|
|
3
|
+
export interface SubagentSuccessSource {
|
|
4
|
+
setOnSubagentSucceeded(cb: (...args: SubagentCompletionArgs) => void): void;
|
|
5
|
+
}
|
|
6
|
+
export declare function wireOneShotChatSession(session: AgentSession, sources: readonly SubagentSuccessSource[]): void;
|
|
7
|
+
export {};
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import type { PermissionMode } from '../../../agent/types/sdk-types.js';
|
|
3
|
-
export declare const DEFAULT_MAX_TERMINAL_STATE_INJECTIONS = 3;
|
|
4
|
-
export declare const TERMINAL_STATE_GATE_CORRECTION: string;
|
|
5
|
-
export interface TerminalStateGateOptions {
|
|
6
|
-
getPermissionMode: () => PermissionMode;
|
|
7
|
-
isEnabled: () => boolean;
|
|
8
|
-
maxInjectionsPerSession?: number;
|
|
9
|
-
}
|
|
10
|
-
export declare function createTerminalStateGate(opts: TerminalStateGateOptions): HookHandler;
|
|
1
|
+
export { DEFAULT_MAX_TERMINAL_STATE_INJECTIONS, TERMINAL_STATE_GATE_CORRECTION, type TerminalStateGateOptions, createTerminalStateGate, } from '../../../agent/terminal-state-gate.js';
|
|
@@ -3,6 +3,7 @@ export interface SpinnerControllerOptions {
|
|
|
3
3
|
onTick: () => void;
|
|
4
4
|
goblin?: boolean;
|
|
5
5
|
workVerb?: () => string | undefined;
|
|
6
|
+
contextTip?: () => string | undefined;
|
|
6
7
|
}
|
|
7
8
|
export declare class SpinnerController {
|
|
8
9
|
private state;
|
|
@@ -11,6 +12,7 @@ export declare class SpinnerController {
|
|
|
11
12
|
private readonly onTick;
|
|
12
13
|
private readonly goblin;
|
|
13
14
|
private readonly workVerb;
|
|
15
|
+
private readonly contextTip;
|
|
14
16
|
constructor(opts: SpinnerControllerOptions);
|
|
15
17
|
private pickVerb;
|
|
16
18
|
set(config: {
|
|
@@ -3,11 +3,18 @@ export declare class InFlightToolTracker {
|
|
|
3
3
|
private readonly inFlight;
|
|
4
4
|
start(toolUseId: string, toolName: string): void;
|
|
5
5
|
finish(toolUseId: string): void;
|
|
6
|
+
has(toolName: string): boolean;
|
|
6
7
|
current(): string | undefined;
|
|
7
8
|
reset(): void;
|
|
8
9
|
}
|
|
10
|
+
export declare const WAIT_HINT_TOOL = "wait_for";
|
|
11
|
+
export declare function waitHintText(state: {
|
|
12
|
+
waiting: boolean;
|
|
13
|
+
queued: boolean;
|
|
14
|
+
}): string | undefined;
|
|
9
15
|
export interface ActiveToolNameSink {
|
|
10
16
|
setActiveToolName?(toolName: string | undefined): void;
|
|
17
|
+
setRootWaitActive?(active: boolean): void;
|
|
11
18
|
}
|
|
12
19
|
interface MaybeToolEvent {
|
|
13
20
|
type: string;
|
|
@@ -18,4 +25,5 @@ interface MaybeToolEvent {
|
|
|
18
25
|
};
|
|
19
26
|
}
|
|
20
27
|
export declare function noteToolEvent(event: MaybeToolEvent, tracker: InFlightToolTracker, sink: ActiveToolNameSink | null | undefined): boolean;
|
|
28
|
+
export declare function noteRootWaitEvent(event: MaybeToolEvent, tracker: InFlightToolTracker, sink: ActiveToolNameSink | null | undefined): boolean;
|
|
21
29
|
export {};
|
|
@@ -66,6 +66,7 @@ export declare class TerminalCompositor {
|
|
|
66
66
|
disarmRows: number;
|
|
67
67
|
readonly spinnerController: SpinnerController;
|
|
68
68
|
private activeToolName;
|
|
69
|
+
private rootWaitActive;
|
|
69
70
|
readonly caretBlinkController: CaretBlinkController;
|
|
70
71
|
repaintCount: number;
|
|
71
72
|
pendingTrailingRepaint: boolean;
|
|
@@ -128,6 +129,7 @@ export declare class TerminalCompositor {
|
|
|
128
129
|
rotateVerbEveryMs?: number;
|
|
129
130
|
}): void;
|
|
130
131
|
setActiveToolName(toolName: string | undefined): void;
|
|
132
|
+
setRootWaitActive(active: boolean): void;
|
|
131
133
|
commitAbove(text: string): void;
|
|
132
134
|
clearCommittedBand(): void;
|
|
133
135
|
forgetCommittedBand(): void;
|
|
@@ -8,4 +8,4 @@ export declare function buildBandMeta(logicalLines: readonly string[], width: nu
|
|
|
8
8
|
export declare function scrollbackFlushLines(rows: readonly string[], meta: readonly BandRowMeta[] | undefined, count: number): string[];
|
|
9
9
|
export declare function snapFlushCountToLogicalBoundary(meta: readonly BandRowMeta[] | undefined, count: number, total: number): number;
|
|
10
10
|
export declare function buildScrollbackArchiveEscape(lines: readonly string[], anchorFloor: number, bottomRow: number, width: number): string;
|
|
11
|
-
export declare function formatTipRow(text: string, cols: number): string;
|
|
11
|
+
export declare function formatTipRow(text: string, cols: number, label?: string): string;
|