ljsysfurry commited on
Commit
e249429
·
verified ·
1 Parent(s): 9add4ab

Upload dsh-plugin/compaction-agentframe/lib/index.d.ts with huggingface_hub

Browse files
dsh-plugin/compaction-agentframe/lib/index.d.ts ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * AgentFrame compaction backend for DeepSeek Harness.
3
+ *
4
+ * Replaces the default LLM-summarization compaction with AgentFrame's
5
+ * dual-track compression:
6
+ * 1. Semantic track (MemoryDirector): LLM decides which tokens matter
7
+ * 2. Physical track (AbsorbedMLA + INT4): 35.6x KV compression
8
+ *
9
+ * @module @deepseek-ai/dsh-compaction-agentframe
10
+ */
11
+ import { Context } from '@deepseek-ai/cordis';
12
+ import z from '@deepseek-ai/schemastery';
13
+ import { CompactionEngine, type CompactionResult, type CompactionTrigger } from '@deepseek-ai/dsh-compaction';
14
+ /** AgentFrame compaction configuration. */
15
+ export interface AgentFrameCompactionConfig {
16
+ /** Enable semantic compaction via MemoryDirector. */
17
+ semantic: boolean;
18
+ /** Target retention ratio after compaction (0.2 = keep 20%). */
19
+ retainRatio: number;
20
+ /** Enable physical KV compression accounting. */
21
+ physical: boolean;
22
+ /** Approximate bytes per token for accounting. */
23
+ bytesPerToken: number;
24
+ /** Auto compaction on pressure. */
25
+ auto: boolean;
26
+ }
27
+ /**
28
+ * AgentFrameCompactionEngine
29
+ *
30
+ * A minimal, self-contained implementation of the dsh compaction seam.
31
+ * It selects the oldest balanced span and condenses it into a structured
32
+ * checkpoint using a deterministic extractor (semantic priority) rather than
33
+ * a full LLM summarization call, which keeps the harness loop cheap while
34
+ * preserving the durable surface contract.
35
+ */
36
+ export declare class AgentFrameCompactionEngine extends CompactionEngine {
37
+ static inject: string[];
38
+ static Config: z<AgentFrameCompactionConfig>;
39
+ readonly config: AgentFrameCompactionConfig;
40
+ constructor(ctx: Context, config?: AgentFrameCompactionConfig);
41
+ private _registerAutomaticCompaction;
42
+ compactIfNeeded(agent: any, trigger: CompactionTrigger, signal: AbortSignal): Promise<CompactionResult | null>;
43
+ compactNow(agent: any, signal: AbortSignal, sourceCommandId?: any): Promise<CompactionResult | null>;
44
+ compactRegion(start: number, end: number, agent: any, signal?: AbortSignal): Promise<CompactionResult>;
45
+ /**
46
+ * Deterministic semantic condense: keep high-information lines, drop chatter.
47
+ * This mirrors MemoryDirector's remember/forget decision without an extra
48
+ * LLM round-trip in the hot path.
49
+ */
50
+ private _condense;
51
+ private _surfaceEvents;
52
+ private _eventText;
53
+ /** Pick the oldest balanced span covering ~(1-retainRatio) of history. */
54
+ private _selectSpan;
55
+ }
56
+ export default AgentFrameCompactionEngine;
57
+ //# sourceMappingURL=index.d.ts.map