billion-context-omp 0.1.6 → 0.1.8

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.
@@ -1,5 +1,5 @@
1
1
  import type { SessionEntry, SessionMessageEntry } from "@oh-my-pi/pi-coding-agent";
2
- import type { CoreMessage } from "acp-kernel";
2
+ import { type CoreMessage } from "acp-kernel";
3
3
  type AgentMessage = SessionMessageEntry["message"];
4
4
  export type { AgentMessage };
5
5
  export declare function entriesToCoreMessages(entries: SessionEntry[]): CoreMessage[];
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;
@@ -19,7 +19,13 @@ export interface UserAcpConfig {
19
19
  compressModel?: string;
20
20
  }
21
21
  /** Read global + project acp-omp.json, project overrides global. Returns {} on any
22
- * error (missing file, bad JSON) — never throws. */
22
+ * error (missing file, bad JSON) — never throws.
23
+ *
24
+ * `prompts` / `acknowledgePromptsRisk` are accepted from the GLOBAL config
25
+ * only (issue #32): a repo under agent control can ship a project-local
26
+ * .omp/acp-omp.json, and letting it inject arbitrary system-prompt text
27
+ * every turn is a prompt-injection surface. Project-local files may tune
28
+ * everything else (thresholds, models, timeouts) but not the prompts. */
23
29
  export declare function loadUserConfig(cwd: string): Promise<UserAcpConfig>;
24
30
  /** Merge user config onto an adapter config: user config wins for the keys it
25
31
  * sets. Used at session_start to apply runtime-discovered config. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "billion-context-omp",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
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,8 +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.23",
72
- "billion-context-kit": "0.1.1",
71
+ "acp-kernel": "0.0.24",
72
+ "billion-context-kit": "0.2.0",
73
73
  "tsup": "^8.5.1",
74
74
  "tsx": "^4.23.1",
75
75
  "typescript": "^7.0.2"