billion-context-pi-lean 0.1.83-lean.10 → 0.2.0
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 +62 -50
- package/dist/{chunk-HTPJ5GG7.js → chunk-PPYOZRUP.js} +2 -2
- package/dist/{chunk-HTPJ5GG7.js.map → chunk-PPYOZRUP.js.map} +1 -1
- package/dist/config-panel.d.ts +61 -0
- package/dist/config.d.ts +6 -4
- package/dist/contract.js +1 -1
- package/dist/idle-compact.d.ts +39 -0
- package/dist/index.js +15893 -13991
- package/dist/index.js.map +1 -1
- package/dist/user-config.d.ts +7 -1
- package/lean/index.ts +1 -1
- package/package.json +2 -1
- package/dist/update.d.ts +0 -43
package/dist/user-config.d.ts
CHANGED
|
@@ -4,13 +4,13 @@ import type { PiPromptSections } from "./system-prompt.js";
|
|
|
4
4
|
import type { NudgeSectionsConfig, ToolPromptsConfig } from "./surface.js";
|
|
5
5
|
import type { DegenerationGuardConfig } from "./degeneration.js";
|
|
6
6
|
import type { ThrottleRetryConfig } from "./throttle-retry.js";
|
|
7
|
+
import type { IdleCompactConfig } from "./idle-compact.js";
|
|
7
8
|
/** User-facing config keys (subset of AdapterConfig). Loaded from
|
|
8
9
|
* ~/.<CONFIG_DIR_NAME>/acp.json (global) and <cwd>/.<CONFIG_DIR_NAME>/acp.json
|
|
9
10
|
* (project-local overrides project-global). Project wins over global. */
|
|
10
11
|
export interface UserAcpConfig {
|
|
11
12
|
enabled?: boolean;
|
|
12
13
|
debug?: boolean;
|
|
13
|
-
autoUpdate?: boolean;
|
|
14
14
|
modelContextLimit?: number;
|
|
15
15
|
protectedTools?: string[];
|
|
16
16
|
protectedLatestTools?: string[];
|
|
@@ -21,6 +21,7 @@ export interface UserAcpConfig {
|
|
|
21
21
|
compress?: CompressConfig;
|
|
22
22
|
outputHeadroomMaxPct?: number | string;
|
|
23
23
|
throttleRetry?: boolean | ThrottleRetryConfig;
|
|
24
|
+
idleCompact?: boolean | IdleCompactConfig;
|
|
24
25
|
repetitionGuard?: boolean | RepetitionGuardConfig;
|
|
25
26
|
degenerationGuard?: boolean | DegenerationGuardConfig;
|
|
26
27
|
prompts?: Partial<Prompts>;
|
|
@@ -59,3 +60,8 @@ export declare function applyUserConfig(adapter: AdapterConfig, user: UserAcpCon
|
|
|
59
60
|
* acp.json still overrides the global value. A present-but-unparseable file
|
|
60
61
|
* is never overwritten. */
|
|
61
62
|
export declare function saveCompressionModelId(value: string | null): Promise<void>;
|
|
63
|
+
/** Read-modify-write the GLOBAL acp.json, keeping every key the mutator does
|
|
64
|
+
* not touch. A present-but-unparseable file is never overwritten. Calls are
|
|
65
|
+
* serialized so quick successive changes (settings panel) never read the same
|
|
66
|
+
* old snapshot and drop each other. */
|
|
67
|
+
export declare function updateGlobalAcpConfig(mutate: (current: Record<string, unknown>) => void): Promise<void>;
|
package/lean/index.ts
CHANGED
|
@@ -322,7 +322,7 @@ function facadeTool(tools: Map<string, CapturedTool>): ToolDefinition<typeof FAC
|
|
|
322
322
|
}
|
|
323
323
|
|
|
324
324
|
export function createLeanAcpExtension(
|
|
325
|
-
upstream: UpstreamExtension = createAcpExtension({
|
|
325
|
+
upstream: UpstreamExtension = createAcpExtension({ externalSystemPrompt: true }),
|
|
326
326
|
): (pi: ExtensionAPI) => void {
|
|
327
327
|
return (pi: ExtensionAPI): void => {
|
|
328
328
|
const tools = new Map<string, CapturedTool>();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "billion-context-pi-lean",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Lean fork of billion-context-pi for Pi: long-session context compression with an optional cheap summary model — 486 initialization tokens, 94% fewer than the original.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -79,6 +79,7 @@
|
|
|
79
79
|
"@earendil-works/pi-tui": "0.83.0",
|
|
80
80
|
"@types/node": "^26.1.2",
|
|
81
81
|
"acp-kernel": "0.0.101",
|
|
82
|
+
"billion-context-pi": "0.1.83",
|
|
82
83
|
"tsup": "^8.5.1",
|
|
83
84
|
"tsx": "^4.23.1",
|
|
84
85
|
"typescript": "^7.0.2"
|
package/dist/update.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
export declare const readOnlyMarkerFile: (extDir: string) => string;
|
|
2
|
-
export type NpmRunner = (args: string[], opts: {
|
|
3
|
-
cwd?: string;
|
|
4
|
-
timeout: number;
|
|
5
|
-
}) => Promise<{
|
|
6
|
-
code: number;
|
|
7
|
-
stdout: string;
|
|
8
|
-
stderr: string;
|
|
9
|
-
}>;
|
|
10
|
-
export declare const runNpm: NpmRunner;
|
|
11
|
-
export declare function setRunNpmForTest(impl: NpmRunner): void;
|
|
12
|
-
export type NodeRunner = (args: string[], opts: {
|
|
13
|
-
timeout: number;
|
|
14
|
-
}) => Promise<{
|
|
15
|
-
code: number;
|
|
16
|
-
stdout: string;
|
|
17
|
-
stderr: string;
|
|
18
|
-
}>;
|
|
19
|
-
export declare const runNode: NodeRunner;
|
|
20
|
-
export declare function setRunNodeForTest(impl: NodeRunner): void;
|
|
21
|
-
export declare function setInstalledSpecForTest(spec: string | null): void;
|
|
22
|
-
export declare function isAutoUpdatableSpec(spec: string): boolean;
|
|
23
|
-
/**
|
|
24
|
-
* Registry dist-tag the auto-updater should track for a spec.
|
|
25
|
-
* - `stable`, `dev`, `pr-327`, `latest` → that dist-tag
|
|
26
|
-
* - ranges (`^1.2.3`, `>=1.0.0`, `*`) → `latest`
|
|
27
|
-
* - exact pins / non-registry specs → undefined (never auto-update)
|
|
28
|
-
* - exact *prerelease* versions → `latest`: npm records tag installs
|
|
29
|
-
* (`@pr-N`, `@dev`) as the resolved exact version, so without this
|
|
30
|
-
* fallback those users would freeze on a stale PR/dev build forever
|
|
31
|
-
*/
|
|
32
|
-
export declare function specUpdateTag(spec: string): string | undefined;
|
|
33
|
-
export declare function isVersionNewer(latest: string, current: string): boolean;
|
|
34
|
-
export declare function findNpmRoot(extDir: string): string | undefined;
|
|
35
|
-
export declare function findExtensionDir(): Promise<string | undefined>;
|
|
36
|
-
export type InstallOutcome = "ok" | "failed" | "rolled-back" | "read-only";
|
|
37
|
-
export declare function verifyInstall(npmDir: string, latest: string): Promise<{
|
|
38
|
-
ok: boolean;
|
|
39
|
-
reason?: string;
|
|
40
|
-
}>;
|
|
41
|
-
export declare function autoInstallLatest(latest: string, extDirOverride?: string): Promise<InstallOutcome>;
|
|
42
|
-
export declare function checkForUpdate(autoUpdate: boolean, notify?: (msg: string) => void): Promise<void>;
|
|
43
|
-
export declare function resetUpdateStateForTest(): void;
|