billion-context-pi 0.1.49 → 0.1.50-pr.221.21

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.
@@ -3,6 +3,7 @@ import type { CoreMessage } from "acp-kernel";
3
3
  type AgentMessage = SessionMessageEntry["message"];
4
4
  export declare function entriesToCoreMessages(entries: SessionEntry[]): CoreMessage[];
5
5
  export declare function extractText(content: unknown): string;
6
+ export declare function countImageBlocks(content: unknown): number;
6
7
  export declare function messageIdentity(message: unknown): string;
7
8
  export declare function messageRef(message: unknown): string | undefined;
8
9
  export declare function matchesStoredText(stored: string, visible: string): boolean;
package/dist/tokens.d.ts CHANGED
@@ -1,11 +1,20 @@
1
1
  import { type CoreMessage } from "acp-kernel";
2
+ import type { SessionMessageEntry } from "@earendil-works/pi-coding-agent";
3
+ type AgentMessage = SessionMessageEntry["message"];
2
4
  export declare function collectCoveredMessageIds(state: {
3
5
  blocks: {
4
6
  active: boolean;
5
7
  effectiveMessageIds: string[];
6
8
  }[];
7
9
  }): Set<string>;
8
- export declare function estimateTokens(messages: CoreMessage[], coveredIds?: Set<string>): number;
10
+ export declare const IMAGE_TOKEN_COST = 1600;
11
+ export declare function modelSupportsImages(model: unknown): boolean;
12
+ export declare function collectImageTokens(entries: {
13
+ id: string;
14
+ type?: string;
15
+ message?: AgentMessage;
16
+ }[], visionCapable: boolean): Map<string, number>;
17
+ export declare function estimateTokens(messages: CoreMessage[], coveredIds?: Set<string>, imageTokensById?: Map<string, number>): number;
9
18
  /** Scale a raw (uncalibrated) sent-view estimate by the per-model density
10
19
  * learned from provider usage (density = real/estimate). Used for nudge /
11
20
  * usage / emergency arbitration at every processTurn site so the decision
@@ -20,3 +29,4 @@ export declare function lastUserMessageId(entries: {
20
29
  role?: string;
21
30
  };
22
31
  }[]): string | undefined;
32
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "billion-context-pi",
3
- "version": "0.1.49",
3
+ "version": "0.1.50-pr.221.21",
4
4
  "description": "One billion, not one million. Model-driven context management for the Pi coding agent.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",