billion-context-omp 0.1.5 → 0.1.7
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/README.md +12 -9
- package/README.zh-CN.md +12 -9
- package/dist/compress-tool.d.ts +0 -1
- package/dist/index.js +230 -147
- package/dist/index.js.map +1 -1
- package/dist/messages.d.ts +0 -11
- package/dist/tokens.d.ts +13 -0
- package/package.json +3 -2
package/dist/messages.d.ts
CHANGED
|
@@ -45,17 +45,6 @@ export declare function isBlockRef(ref: string): boolean;
|
|
|
45
45
|
* Message refs (mNNNNN) go through byRef; block refs (bN) resolve to the
|
|
46
46
|
* earliest (min) or latest (max) covered message's raw id. "" = unresolved. */
|
|
47
47
|
export declare function boundaryRaw(ref: string, byRef: Record<string, string>, blocks: BlockLike[], pick: "min" | "max"): string;
|
|
48
|
-
/** Ranges too small to carry a meaningful summary (kernel minSummaryLength
|
|
49
|
-
* is 50 chars; a 16-token message can't support one and nets a LOSS). The
|
|
50
|
-
* "compress all ranges in one call" nudge hint makes listing them a trap:
|
|
51
|
-
* the model bundles them, the batch fails atomically, nothing gets applied
|
|
52
|
-
* (observed live: 14-range batch rejected by a 43-char summary on a
|
|
53
|
-
* 16-token range). 200 tokens ≈ 800 chars of substance — comfortably above
|
|
54
|
-
* the summary floor while still listing every genuinely compressible range. */
|
|
55
|
-
export declare const VIABLE_RANGE_MIN_TOKENS = 200;
|
|
56
|
-
export declare function viableRanges<T extends {
|
|
57
|
-
tokens: number;
|
|
58
|
-
}>(ranges: T[]): T[];
|
|
59
48
|
/** One fingerprint per range (never filtered, "-" for unresolvable
|
|
60
49
|
* boundaries) so replay-side index lookup stays aligned even for mixed
|
|
61
50
|
* message/block boundary batches. Written into the compress tool result. */
|
package/dist/tokens.d.ts
CHANGED
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
import { type CoreMessage } from "acp-kernel";
|
|
2
2
|
export declare function estimateTextTokens(text: string): number;
|
|
3
|
+
/** Union of message ids covered by ACTIVE compression blocks. Messages in
|
|
4
|
+
* this set are already pruned from the sent view — token estimates for the
|
|
5
|
+
* sent view skip them (their summary mass is counted by the kernel
|
|
6
|
+
* breakdown as `summaries`). */
|
|
3
7
|
export declare function collectCoveredMessageIds(state: {
|
|
4
8
|
blocks: {
|
|
5
9
|
active: boolean;
|
|
6
10
|
effectiveMessageIds: string[];
|
|
7
11
|
}[];
|
|
8
12
|
}): Set<string>;
|
|
13
|
+
/** Estimate the SENT-VIEW token mass (chars/4, CJK-aware) of a core-message
|
|
14
|
+
* projection: skips compress tool-calls and messages already covered by
|
|
15
|
+
* active blocks. This is the same estimation scale as the kernel's
|
|
16
|
+
* contextBreakdown, so its output can feed nudge decisions and panel lines
|
|
17
|
+
* without scale mixing. The host footer's session-tree accounting
|
|
18
|
+
* (provider-anchored, includes compressed originals, never shrinks) is a
|
|
19
|
+
* DIFFERENT scale and must never drive emergency arbitration for the sent
|
|
20
|
+
* view — a 180K-context model with a 366K tree reads as "204%" here while
|
|
21
|
+
* the real sent view is ~5%. */
|
|
9
22
|
export declare function estimateTokens(messages: CoreMessage[], coveredIds?: Set<string>): number;
|
|
10
23
|
export declare function lastUserMessageId(entries: {
|
|
11
24
|
id: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "billion-context-omp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "One billion, not one million. Model-driven context management for the oh-my-pi (omp) coding agent.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -68,7 +68,8 @@
|
|
|
68
68
|
"@oh-my-pi/pi-coding-agent": "17.3.2",
|
|
69
69
|
"@oh-my-pi/pi-utils": "17.3.2",
|
|
70
70
|
"@types/node": "^26.1.2",
|
|
71
|
-
"acp-kernel": "0.0.
|
|
71
|
+
"acp-kernel": "0.0.23",
|
|
72
|
+
"billion-context-kit": "0.2.0",
|
|
72
73
|
"tsup": "^8.5.1",
|
|
73
74
|
"tsx": "^4.23.1",
|
|
74
75
|
"typescript": "^7.0.2"
|