acp-kernel 0.0.1 → 0.0.2

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.
Files changed (61) hide show
  1. package/DESIGN.md +220 -0
  2. package/LICENSE +21 -0
  3. package/PROVENANCE.md +92 -0
  4. package/README.md +96 -2
  5. package/dist/boundaries.d.ts +25 -0
  6. package/dist/boundaries.d.ts.map +1 -0
  7. package/dist/compress.d.ts +37 -0
  8. package/dist/compress.d.ts.map +1 -0
  9. package/dist/compression-rules.d.ts +11 -0
  10. package/dist/compression-rules.d.ts.map +1 -0
  11. package/dist/config.d.ts +4 -0
  12. package/dist/config.d.ts.map +1 -0
  13. package/dist/decompress.d.ts +14 -0
  14. package/dist/decompress.d.ts.map +1 -0
  15. package/dist/filter/apply.d.ts +10 -0
  16. package/dist/filter/apply.d.ts.map +1 -0
  17. package/dist/filter/index.d.ts +5 -0
  18. package/dist/filter/index.d.ts.map +1 -0
  19. package/dist/filter/registry.d.ts +6 -0
  20. package/dist/filter/registry.d.ts.map +1 -0
  21. package/dist/filter/types.d.ts +28 -0
  22. package/dist/filter/types.d.ts.map +1 -0
  23. package/dist/hide-consumed.d.ts +7 -0
  24. package/dist/hide-consumed.d.ts.map +1 -0
  25. package/dist/index.d.ts +33 -0
  26. package/dist/index.d.ts.map +1 -0
  27. package/dist/index.js +2303 -0
  28. package/dist/index.js.map +1 -0
  29. package/dist/keep-markers.d.ts +9 -0
  30. package/dist/keep-markers.d.ts.map +1 -0
  31. package/dist/merge.d.ts +9 -0
  32. package/dist/merge.d.ts.map +1 -0
  33. package/dist/nudge-text.d.ts +8 -0
  34. package/dist/nudge-text.d.ts.map +1 -0
  35. package/dist/pipeline.d.ts +26 -0
  36. package/dist/pipeline.d.ts.map +1 -0
  37. package/dist/protected.d.ts +4 -0
  38. package/dist/protected.d.ts.map +1 -0
  39. package/dist/prune.d.ts +7 -0
  40. package/dist/prune.d.ts.map +1 -0
  41. package/dist/rebuild.d.ts +25 -0
  42. package/dist/rebuild.d.ts.map +1 -0
  43. package/dist/recommend.d.ts +40 -0
  44. package/dist/recommend.d.ts.map +1 -0
  45. package/dist/refs.d.ts +22 -0
  46. package/dist/refs.d.ts.map +1 -0
  47. package/dist/render-refs.d.ts +5 -0
  48. package/dist/render-refs.d.ts.map +1 -0
  49. package/dist/report.d.ts +11 -0
  50. package/dist/report.d.ts.map +1 -0
  51. package/dist/state.d.ts +10 -0
  52. package/dist/state.d.ts.map +1 -0
  53. package/dist/sync.d.ts +7 -0
  54. package/dist/sync.d.ts.map +1 -0
  55. package/dist/tokenize.d.ts +6 -0
  56. package/dist/tokenize.d.ts.map +1 -0
  57. package/dist/truncate-tools.d.ts +14 -0
  58. package/dist/truncate-tools.d.ts.map +1 -0
  59. package/dist/types.d.ts +190 -0
  60. package/dist/types.d.ts.map +1 -0
  61. package/package.json +58 -5
@@ -0,0 +1,5 @@
1
+ import type { CoreMessage, CompressionState } from "./types.js";
2
+ import type { PipelineNode } from "./pipeline.js";
3
+ export declare function renderVisibleRefs(messages: CoreMessage[], state: CompressionState): CoreMessage[];
4
+ export declare const renderRefsNode: PipelineNode;
5
+ //# sourceMappingURL=render-refs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render-refs.d.ts","sourceRoot":"","sources":["../src/render-refs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAiB,MAAM,YAAY,CAAC;AAE/E,OAAO,KAAK,EAAE,YAAY,EAA2B,MAAM,eAAe,CAAC;AAgB3E,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,WAAW,EAAE,EACvB,KAAK,EAAE,gBAAgB,GACtB,WAAW,EAAE,CAGf;AAED,eAAO,MAAM,cAAc,EAAE,YAQ5B,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { CompressionState, CoreMessage } from "./types.js";
2
+ export interface StatusReportOptions {
3
+ scope?: "compressed" | "uncompressed";
4
+ view?: "ranges" | "messages";
5
+ tool?: string;
6
+ sort?: "size" | "time" | "tool" | "age";
7
+ limit?: number;
8
+ }
9
+ export declare function buildStatusReport(state: CompressionState, messages: CoreMessage[], countTokens: (t: string) => number, options?: StatusReportOptions): string;
10
+ export declare function buildRecap(state: CompressionState, blockId?: string): string;
11
+ //# sourceMappingURL=report.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../src/report.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAoB,gBAAgB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AA2FlF,MAAM,WAAW,mBAAmB;IAChC,KAAK,CAAC,EAAE,YAAY,GAAG,cAAc,CAAC;IACtC,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,iBAAiB,CAC7B,KAAK,EAAE,gBAAgB,EACvB,QAAQ,EAAE,WAAW,EAAE,EACvB,WAAW,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,EAClC,OAAO,GAAE,mBAAwB,GAClC,MAAM,CAyBR;AAqKD,wBAAgB,UAAU,CACtB,KAAK,EAAE,gBAAgB,EACvB,OAAO,CAAC,EAAE,MAAM,GACjB,MAAM,CA6BR"}
@@ -0,0 +1,10 @@
1
+ import type { CompressionBlock, CompressionState } from "./types.js";
2
+ export declare function createInitialState(): CompressionState;
3
+ export declare function allocateBlockId(state: CompressionState): string;
4
+ export declare function allocateRunId(state: CompressionState): string;
5
+ export declare function blockById(state: CompressionState, blockId: string): CompressionBlock | undefined;
6
+ export declare function activeBlocks(state: CompressionState): CompressionBlock[];
7
+ export declare function coveredMessageIds(state: CompressionState): Set<string>;
8
+ export declare function highestActiveTier(state: CompressionState): 0 | 1 | 2 | 3;
9
+ export declare function advanceSurvival(state: CompressionState, promotionThreshold: number): void;
10
+ //# sourceMappingURL=state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAErE,wBAAgB,kBAAkB,IAAI,gBAAgB,CAcrD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,CAI/D;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,CAI7D;AAED,wBAAgB,SAAS,CACvB,KAAK,EAAE,gBAAgB,EACvB,OAAO,EAAE,MAAM,GACd,gBAAgB,GAAG,SAAS,CAE9B;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,gBAAgB,GAAG,gBAAgB,EAAE,CAExE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,GAAG,GAAG,CAAC,MAAM,CAAC,CAOtE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAMxE;AAED,wBAAgB,eAAe,CAC7B,KAAK,EAAE,gBAAgB,EACvB,kBAAkB,EAAE,MAAM,GACzB,IAAI,CAQN"}
package/dist/sync.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ import type { CompressionState, CoreMessage } from "./types.js";
2
+ export interface SyncResult {
3
+ state: CompressionState;
4
+ deactivated: string[];
5
+ }
6
+ export declare function syncBlocks(messages: CoreMessage[], state: CompressionState): SyncResult;
7
+ //# sourceMappingURL=sync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../src/sync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEhE,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,gBAAgB,CAAC;IACxB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,wBAAgB,UAAU,CACxB,QAAQ,EAAE,WAAW,EAAE,EACvB,KAAK,EAAE,gBAAgB,GACtB,UAAU,CA+CZ"}
@@ -0,0 +1,6 @@
1
+ export declare function defaultCountTokens(text: string): number;
2
+ export declare function estimateMessageTokens(text: string | undefined): number;
3
+ export declare function estimateTokensFast(text: string): number;
4
+ export type TokenCountFn = (text: string) => number;
5
+ export declare function createBpeTokenizer(): TokenCountFn;
6
+ //# sourceMappingURL=tokenize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokenize.d.ts","sourceRoot":"","sources":["../src/tokenize.ts"],"names":[],"mappings":"AAIA,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKvD;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAEtE;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGvD;AAED,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;AAEpD,wBAAgB,kBAAkB,IAAI,YAAY,CAejD"}
@@ -0,0 +1,14 @@
1
+ import type { Config, CoreMessage } from "./types.js";
2
+ export interface TruncateOptions {
3
+ minOutputTokens?: number;
4
+ keepPrefixChars?: number;
5
+ keepSuffixChars?: number;
6
+ protectRecentMessages?: number;
7
+ }
8
+ export interface TruncateResult {
9
+ messages: CoreMessage[];
10
+ truncatedCount: number;
11
+ savedTokens: number;
12
+ }
13
+ export declare function truncateLargeToolOutputs(messages: CoreMessage[], tokenCount: number, config: Config, countTokens: (text: string) => number, options?: TruncateOptions): TruncateResult;
14
+ //# sourceMappingURL=truncate-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"truncate-tools.d.ts","sourceRoot":"","sources":["../src/truncate-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEtD,MAAM,WAAW,eAAe;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAClC;AAED,MAAM,WAAW,cAAc;IAC3B,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;CACvB;AAUD,wBAAgB,wBAAwB,CACpC,QAAQ,EAAE,WAAW,EAAE,EACvB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,EACrC,OAAO,GAAE,eAAoB,GAC9B,cAAc,CAmDhB"}
@@ -0,0 +1,190 @@
1
+ export type MessageRole = "user" | "assistant" | "system" | "tool";
2
+ export type MessageContentType = "text" | "tool-call" | "tool-result" | "reasoning";
3
+ export interface CoreMessage {
4
+ id: string;
5
+ role: MessageRole;
6
+ contentType: MessageContentType;
7
+ text?: string;
8
+ toolName?: string;
9
+ toolCallId?: string;
10
+ }
11
+ export type CompressionTier = 1 | 2 | 3;
12
+ export type BlockGeneration = "young" | "old";
13
+ export interface CompressionBlock {
14
+ blockId: string;
15
+ runId: string;
16
+ tier: CompressionTier;
17
+ topic?: string;
18
+ summary: string;
19
+ directMessageIds: string[];
20
+ effectiveMessageIds: string[];
21
+ directBlockIds: string[];
22
+ /** Token count of the original messages compressed by this block (for accurate reporting). */
23
+ compressedTokens: number;
24
+ createdAt: number;
25
+ survivedCount: number;
26
+ generation: BlockGeneration;
27
+ active: boolean;
28
+ durationMs?: number;
29
+ compressCallId?: string;
30
+ }
31
+ export interface MessageRefMap {
32
+ byRaw: Record<string, string>;
33
+ byRef: Record<string, string>;
34
+ }
35
+ export interface NudgeState {
36
+ lastPerMessageNudgeTokens: number;
37
+ lastNudgeShownTokens: number;
38
+ baselineTokens: number;
39
+ anchors: Record<string, unknown>;
40
+ }
41
+ export interface CompressionStats {
42
+ tokensCompressed: number;
43
+ compressionCount: number;
44
+ }
45
+ export interface CompressionState {
46
+ blocks: CompressionBlock[];
47
+ messageRefs: MessageRefMap;
48
+ nudge: NudgeState;
49
+ stats: CompressionStats;
50
+ nextBlockId: number;
51
+ nextRunId: number;
52
+ }
53
+ export interface TierConfig {
54
+ enabled: boolean;
55
+ tier2Trigger: number;
56
+ tier3Trigger: number;
57
+ }
58
+ export interface NudgeConfig {
59
+ maxContextLimitPct: number;
60
+ minContextLimitPct: number;
61
+ frequency: number;
62
+ iterationThreshold: number;
63
+ force: "soft" | "strong";
64
+ growthRatio: number;
65
+ /** Adaptive growth threshold = modelContextLimit × this ratio, clamped to [growthFloor, growthCap]. Default 0.05 (5%). */
66
+ growthFloor: number;
67
+ /** Upper clamp for adaptive growth threshold. Default 50000. */
68
+ growthCap: number;
69
+ /** Anti-thrashing: suppress nudge unless growth ≥ max(minGrowthFloor, minGrowthRatio × growthTokens). Default 5000. */
70
+ minGrowthFloor: number;
71
+ /** Ratio for growth floor: max(minGrowthFloor, minGrowthRatio × growthTokens). Default 0.45. */
72
+ minGrowthRatio: number;
73
+ /** Emergency override: always nudge when usage ≥ this fraction. Default 0.98 (98%). */
74
+ emergencyThresholdPct: number;
75
+ }
76
+ export interface TruncateConfig {
77
+ threshold: number;
78
+ }
79
+ export interface MergeConfig {
80
+ maxSummaryLength: number;
81
+ minOldGenBlocks: number;
82
+ }
83
+ export interface CompressValidationConfig {
84
+ /** Minimum total chars of original messages in a range to allow compression. 0 = disabled. Default 5000. */
85
+ minCompressRange: number;
86
+ /** Maximum summary length (chars). Summary exceeding this is rejected unless summaryMaxChars override is used. 0 = disabled. Default 20000. */
87
+ maxSummaryLength: number;
88
+ /** Minimum summary length (chars). Summary shorter than this is rejected. 0 = disabled. Default 50. */
89
+ minSummaryLength: number;
90
+ }
91
+ export interface Config {
92
+ tiers: TierConfig;
93
+ nudge: NudgeConfig;
94
+ promotionThreshold: number;
95
+ truncate: TruncateConfig;
96
+ merge: MergeConfig;
97
+ compress: CompressValidationConfig;
98
+ protectedTools: string[];
99
+ isToolProtected?: (toolName: string, toolInputText?: string) => boolean;
100
+ preserveRecentMessages: number;
101
+ preserveRecentTokens: number;
102
+ modelContextLimit: number;
103
+ messageFilters?: import("./filter/types.js").MessageFiltersConfig;
104
+ }
105
+ export type CompressMode = "range" | "message";
106
+ export interface CompressRangeSpec {
107
+ startRef: string;
108
+ endRef: string;
109
+ summary: string;
110
+ topic?: string;
111
+ compressCallId?: string;
112
+ /** Per-call override for max summary length. Model can set this when content needs more detail. */
113
+ summaryMaxChars?: number;
114
+ }
115
+ export interface CompressCall {
116
+ mode: CompressMode;
117
+ ranges: CompressRangeSpec[];
118
+ }
119
+ export interface CompressibleRange {
120
+ startRef: string;
121
+ endRef: string;
122
+ count: number;
123
+ tokens: number;
124
+ toolPct: number;
125
+ textPct: number;
126
+ dangerous?: boolean;
127
+ }
128
+ export interface ProtectedRange {
129
+ startRef: string;
130
+ endRef: string;
131
+ count: number;
132
+ tokens: number;
133
+ tools: string[];
134
+ }
135
+ export interface ContextRanges {
136
+ compressible: CompressibleRange[];
137
+ protected: ProtectedRange[];
138
+ }
139
+ export interface Recommendation {
140
+ contextRanges: ContextRanges;
141
+ recommendedRanges: CompressibleRange[];
142
+ nothingToCompress: boolean;
143
+ }
144
+ export interface ContextBreakdown {
145
+ system: number;
146
+ tool: number;
147
+ summaries: number;
148
+ code: number;
149
+ text: number;
150
+ total: number;
151
+ growth: number;
152
+ }
153
+ export interface NudgeDecision {
154
+ shouldInject: boolean;
155
+ reason: string;
156
+ compressibleRanges: CompressibleRange[];
157
+ protectedRanges?: ProtectedRange[];
158
+ contextUsage: number;
159
+ tier: CompressionTier | null;
160
+ breakdown: Record<string, number>;
161
+ contextBreakdown?: ContextBreakdown;
162
+ }
163
+ export interface ResolvedBoundary {
164
+ startIndex: number;
165
+ endIndex: number;
166
+ protectedGaps: number[];
167
+ }
168
+ export interface ApplyCompressionResult {
169
+ state: CompressionState;
170
+ result: {
171
+ blocksCreated: number;
172
+ tokensCompressed: number;
173
+ errors: string[];
174
+ };
175
+ }
176
+ export interface ProcessTurnResult {
177
+ messages: CoreMessage[];
178
+ state: CompressionState;
179
+ nudge?: NudgeDecision;
180
+ }
181
+ export interface StatusReport {
182
+ contextUsage: number;
183
+ tokenCount: number;
184
+ modelContextLimit: number;
185
+ activeBlocks: number;
186
+ totalBlocks: number;
187
+ tokensCompressed: number;
188
+ breakdown: Record<string, number>;
189
+ }
190
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,WAAW,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEnE,MAAM,MAAM,kBAAkB,GAC5B,MAAM,GAAG,WAAW,GAAG,aAAa,GAAG,WAAW,CAAC;AAErD,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,WAAW,CAAC;IAClB,WAAW,EAAE,kBAAkB,CAAC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,eAAe,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAExC,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,KAAK,CAAC;AAE9C,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,eAAe,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC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
3
- "version": "0.0.1",
4
- "description": "Active Context Pruning — platform-agnostic compression kernel for AI coding agents. Placeholder full package coming soon.",
5
- "license": "MIT",
6
- "author": "ranxianglei"
2
+ "name": "acp-kernel",
3
+ "version": "0.0.2",
4
+ "description": "Framework-agnostic context-compression engine (model-driven, 3-tier LSM). Pure core: no host dependency.",
5
+ "license": "MIT",
6
+ "author": "ranxianglei",
7
+ "type": "module",
8
+ "homepage": "https://github.com/ranxianglei/acp-kernel#readme",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/ranxianglei/acp-kernel.git"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/ranxianglei/acp-kernel/issues"
15
+ },
16
+ "keywords": [
17
+ "acp",
18
+ "context",
19
+ "compression",
20
+ "context-management",
21
+ "llm",
22
+ "context-window",
23
+ "summarization"
24
+ ],
25
+ "main": "./dist/index.js",
26
+ "module": "./dist/index.js",
27
+ "types": "./dist/index.d.ts",
28
+ "exports": {
29
+ ".": {
30
+ "types": "./dist/index.d.ts",
31
+ "import": "./dist/index.js"
32
+ }
33
+ },
34
+ "files": [
35
+ "dist",
36
+ "README.md",
37
+ "LICENSE",
38
+ "DESIGN.md",
39
+ "PROVENANCE.md"
40
+ ],
41
+ "sideEffects": false,
42
+ "scripts": {
43
+ "clean": "rm -rf dist",
44
+ "build": "npm run clean && tsup && tsc --emitDeclarationOnly",
45
+ "typecheck": "tsc --noEmit",
46
+ "test": "node --import tsx --test tests/*.test.ts",
47
+ "format": "prettier --write .",
48
+ "format:check": "prettier --check ."
49
+ },
50
+ "devDependencies": {
51
+ "@types/node": "^22.0.0",
52
+ "prettier": "^3.3.0",
53
+ "tsup": "^8.3.0",
54
+ "tsx": "^4.19.0",
55
+ "typescript": "^5.6.0"
56
+ },
57
+ "engines": {
58
+ "node": ">=20"
59
+ }
7
60
  }