ljsysfurry commited on
Commit
fc59aa8
·
verified ·
1 Parent(s): 1b5cc93

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

Browse files
dsh-plugin/compaction-agentframe/lib/types/index.d.ts ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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): decide 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.
34
+ */
35
+ export declare class AgentFrameCompactionEngine extends CompactionEngine {
36
+ static inject: string[];
37
+ static Config: z<AgentFrameCompactionConfig>;
38
+ readonly config: AgentFrameCompactionConfig;
39
+ constructor(ctx: Context, config?: Partial<AgentFrameCompactionConfig>);
40
+ private _registerAutomaticCompaction;
41
+ compactIfNeeded(agent: any, _trigger: CompactionTrigger, signal: AbortSignal): Promise<CompactionResult | null>;
42
+ compactNow(agent: any, signal: AbortSignal, _sourceCommandId?: any): Promise<CompactionResult | null>;
43
+ compactRegion(start: number, end: number, agent: any, _signal?: AbortSignal): Promise<CompactionResult>;
44
+ /** Append an event to the session log, tolerating signature differences. */
45
+ private _append;
46
+ /**
47
+ * Deterministic semantic condense: keep high-information lines, drop chatter.
48
+ * This mirrors MemoryDirector's remember/forget decision without an extra
49
+ * LLM round-trip in the hot path.
50
+ */
51
+ private _condense;
52
+ private _surfaceEvents;
53
+ private _eventText;
54
+ /** Pick the oldest balanced span covering ~(1-retainRatio) of history. */
55
+ private _selectSpan;
56
+ }
57
+ export default AgentFrameCompactionEngine;
58
+ //# sourceMappingURL=index.d.ts.map