agent-afk 5.303.6 → 5.303.7

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.
@@ -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;