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.
- package/dist/agent/providers/anthropic-direct/query/auto-compact.d.ts +1 -1
- package/dist/agent/providers/anthropic-direct/query-turn-driver.auto-compact.d.ts +3 -0
- package/dist/agent/providers/openai-compatible/query/compaction-guard.d.ts +1 -0
- package/dist/agent/providers/openai-compatible/query/context-overflow.d.ts +2 -0
- package/dist/agent/providers/shared/auto-compact.d.ts +3 -1
- package/dist/agent/session/register-surface-session.d.ts +20 -0
- package/dist/cli.mjs +556 -556
- package/dist/index.mjs +218 -218
- package/dist/telegram/elicitation-handler.d.ts +2 -1
- package/dist/telegram/handlers/message.d.ts +8 -6
- package/dist/telegram/session-manager.d.ts +17 -13
- package/dist/telegram.mjs +278 -278
- package/package.json +1 -1
|
@@ -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 @@
|
|
|
1
|
+
export declare function provesResponsesCompactionUnsupported(err: unknown): boolean;
|
|
@@ -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
|
|
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 {};
|