billion-context-pi 0.1.71 → 0.1.72-pr.468.270

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 CHANGED
@@ -132,6 +132,7 @@ billion-context-pi is built for the **Pi** coding agent (`@earendil-works/pi-cod
132
132
  | `decompress` | Restore a previously compressed block's content |
133
133
  | `search_context` | Search compressed block summaries (and visible messages) by keyword |
134
134
  | `acp_status` | Show context usage, compressed blocks, compressible ranges |
135
+ | `acp_cache` | Prompt-cache reconciliation: grand ledger (input/cached/hit rate), per-request miss attribution, per-fold economics |
135
136
  | `acp_delegate` | Spawn a clean-context sub-agent for a task (review / research / implement / plan / advise) |
136
137
  | `acp_delegate_wait` | Block until a delegate run finishes (returns its result; times out otherwise) |
137
138
  | `acp_delegate_cancel` | Cancel a running delegate by runId |
@@ -171,7 +172,7 @@ If you already run another sub-agent extension (pi-subagents, pi-lens, …), tur
171
172
  ```
172
173
 
173
174
  - Equivalent object form: `{ "delegate": { "enabled": false } }`.
174
- - **What it removes:** the `acp_delegate`, `acp_delegate_wait` and `acp_delegate_cancel` tools, the `ACP_DELEGATE NOTIFICATIONS` system-prompt section, and the `ctrl+alt+f` fleet shortcut (`/acp-fleet` then reports that delegate is off). Compression is unaffected — `compress`, `decompress`, `search_context` and `acp_status` stay.
175
+ - **What it removes:** the `acp_delegate`, `acp_delegate_wait` and `acp_delegate_cancel` tools, the `ACP_DELEGATE NOTIFICATIONS` system-prompt section, and the `ctrl+alt+f` fleet shortcut (`/acp-fleet` then reports that delegate is off). Compression is unaffected — `compress`, `decompress`, `search_context`, `acp_status` and `acp_cache` stay.
175
176
  - **When it applies:** the three tools are registered at session start, so a change needs a **new session** (or a Pi restart). The system-prompt section is resolved live on every turn, so it can disappear mid-session before the tools do.
176
177
  - Want to drop only the prompt section and keep the tools? Set `{ "delegatePrompt": null }`.
177
178
  - Pi's `--exclude-tools acp_delegate,acp_delegate_wait,acp_delegate_cancel` is **not** a substitute: it hides the tools but the model still receives the `ACP_DELEGATE NOTIFICATIONS` section describing tools it cannot call. Use `delegate: false`.
@@ -220,6 +221,18 @@ billion-context-pi works out of the box with no configuration — it reads your
220
221
 
221
222
  Behavior is tuned via an optional `acp.json` config file (`~/.pi/acp.json` for global defaults, `<project>/.pi/acp.json` for per-project overrides) plus a few environment variables. For the complete reference — every key, type, default, and the precedence order — see **[CONFIGURATION.md](./CONFIGURATION.md)** ([中文](./CONFIGURATION.zh-CN.md)).
222
223
 
224
+ ### Strict JSON
225
+
226
+ `acp.json` is parsed by a **strict** JSON parser. Any of these makes the whole file fail to parse, so **every setting in it is ignored** and ACP behaves as if the file were absent:
227
+
228
+ - object keys must be double-quoted — `"enabled": false`, not `enabled: false`
229
+ - no trailing commas — `{ "enabled": false }`, not `{ "enabled": false, }`
230
+ - no comments — `//` and `/* */` are not allowed
231
+ - no BOM — Windows Notepad saves "UTF-8 with BOM" by default, which breaks parsing; use *Save as* → encoding **UTF-8** (not "UTF-8 with BOM"), or edit in VS Code (plain UTF-8)
232
+ - `enabled` must be a literal boolean `false`, not the string `"false"`
233
+
234
+ A malformed file no longer fails silently: the failure is printed to stderr at startup, shown as a warning at session start (TUI), written to `~/.pi/acp.log`, and listed under the `acp.json` section of `/acp` with the specific reason. Note the `enabled` master switch is read once when the agent starts, so after fixing the file you must fully restart the agent.
235
+
223
236
  ### Logging
224
237
 
225
238
  billion-context-pi writes a structured, always-on log to `~/.pi/acp.log` (override with `ACP_LOG_FILE`). It covers the model's whole working session and is useful for diagnosing problems:
@@ -0,0 +1,10 @@
1
+ import { Type } from "typebox";
2
+ import type { ExtensionContext, SessionEntry, ToolDefinition } from "@earendil-works/pi-coding-agent";
3
+ import type { AcpRuntime } from "./runtime.js";
4
+ import { type ToolPromptOverrides } from "./surface.js";
5
+ import { type CacheSample } from "acp-kernel";
6
+ declare const CacheParams: Type.TObject<{}>;
7
+ export declare function cacheSamples(entries: SessionEntry[]): CacheSample[];
8
+ export declare function cacheReportText(runtime: AcpRuntime, ctx: ExtensionContext): Promise<string>;
9
+ export declare function makeCacheTool(runtime: AcpRuntime, overrides?: ToolPromptOverrides): ToolDefinition<typeof CacheParams>;
10
+ export {};