agent-afk 5.110.4 → 5.111.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.
@@ -1,2 +1,2 @@
1
- export { computeUsedTokens, contextWindowTokensUsed, contextFullnessFraction, buildContextUsageFields, shouldAutoCompact, } from '../../shared/auto-compact.js';
1
+ export { computeUsedTokens, contextWindowTokensUsed, contextFullnessFraction, buildContextUsageFields, shouldAutoCompact, guardContextOverflow, safeAutoCompactThresholdFor, } from '../../shared/auto-compact.js';
2
2
  export type { ContextUsageApiBreakdown, ContextUsageFields, } from '../../shared/auto-compact.js';
@@ -0,0 +1,3 @@
1
+ import type { ProviderEvent } from '../../provider.js';
2
+ import type { TurnDriverContext } from './query-turn-driver.js';
3
+ export declare function maybeAutoCompact(ctx: TurnDriverContext): AsyncGenerator<ProviderEvent, void, void>;
@@ -0,0 +1 @@
1
+ export declare function provesResponsesCompactionUnsupported(err: unknown): boolean;
@@ -0,0 +1,2 @@
1
+ import type { ProviderUsage } from '../../../provider.js';
2
+ export declare function checkContextOverflow(lastUsage: Partial<ProviderUsage> | null, currentModel: string, maxOutputTokens: number | undefined, configuredModel: string): Error | null;
@@ -17,4 +17,6 @@ export declare function buildContextUsageFields(last: ProviderUsage | null | und
17
17
  export declare function shouldAutoCompact(usedTokens: number, contextLimit: number, threshold: number): boolean;
18
18
  export declare function contextFullnessFraction(usedTokens: number, contextLimit: number): number;
19
19
  export declare const DEFAULT_AUTO_COMPACT_THRESHOLD = 0.9;
20
- export declare function resolveAutoCompactThreshold(autoCompact: AgentConfig['autoCompact']): number | undefined;
20
+ export declare function safeAutoCompactThresholdFor(model: string): number;
21
+ export declare function guardContextOverflow(knownInputTokens: number, maxOutputTokens: number, contextLimit: number, model: string): void;
22
+ export declare function resolveAutoCompactThreshold(autoCompact: AgentConfig['autoCompact'], model?: string): number | undefined;
@@ -0,0 +1,20 @@
1
+ import type { AgentModelInput } from '../types.js';
2
+ import { type SessionRegistry, type SessionHandle, type SessionSurface } from './session-registry.js';
3
+ interface RegisterableSession {
4
+ readonly sessionId?: string;
5
+ waitForInitialization?(): Promise<unknown>;
6
+ }
7
+ export interface RegisterSurfaceSessionOptions {
8
+ surface: SessionSurface;
9
+ model: AgentModelInput;
10
+ cwd?: string;
11
+ name?: string;
12
+ sdkSessionId?: string;
13
+ registry?: SessionRegistry;
14
+ }
15
+ export interface SurfaceSessionRegistration {
16
+ handle: SessionHandle | undefined;
17
+ dispose(): void;
18
+ }
19
+ export declare function registerSurfaceSession(session: RegisterableSession, opts: RegisterSurfaceSessionOptions): SurfaceSessionRegistration;
20
+ export {};