pi-smart-compact 9.3.0 → 9.3.1
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/CHANGELOG.md +6 -0
- package/dist/constants.d.ts +1 -1
- package/dist/index.js +7 -4
- package/dist/infra/paths.d.ts +9 -0
- package/dist/infra/paths.d.ts.map +1 -1
- package/dist/provider-eval.js +3 -2
- package/dist/provider-scenario-eval.js +3 -2
- package/dist/telemetry-report.js +3 -2
- package/dist/utils/session-log.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [9.3.1] - 2026-08-15
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- **Windows / GUI launches resolve `~/.pi/agent` correctly.** `home()` fell back to `"/tmp"` whenever `HOME` was unset — which is every Windows launch (Windows uses `USERPROFILE`, not `HOME`) and GUI launches that strip the environment. Settings, caches, run-locks, and backups were silently routed to `C:\tmp\.pi\agent`, so `settings.json` configuration (mode, models, thresholds, everything under `smartCompact`) was invisible to the extension. The fallback is now `os.homedir()`, matching how the pi host itself resolves its agent directory. The duplicated pattern in the session-log reader was unified onto the same helper (also fixing its path cache key).
|
|
8
|
+
|
|
3
9
|
## [9.3.0] - 2026-08-15
|
|
4
10
|
|
|
5
11
|
### Added
|
package/dist/constants.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import type { CompressionProfile, ProfileConfig } from "./types.ts";
|
|
|
8
8
|
* `package.json#version`. Do not hand-edit this line for releases; bump
|
|
9
9
|
* package.json and run `bun run sync-version`.
|
|
10
10
|
*/
|
|
11
|
-
export declare const VERSION = "9.3.
|
|
11
|
+
export declare const VERSION = "9.3.1";
|
|
12
12
|
export declare const CHARS_PER_TOKEN = 3.8;
|
|
13
13
|
export declare const MIN_COMPACTION_SAVING_RATIO = 0.1;
|
|
14
14
|
export declare const ESTIMATOR_ROUNDING_TOLERANCE_TOKENS = 1;
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { StringEnum } from "@earendil-works/pi-ai";
|
|
|
7
7
|
import { Type as Type2 } from "typebox";
|
|
8
8
|
|
|
9
9
|
// src/constants.ts
|
|
10
|
-
var VERSION = "9.3.
|
|
10
|
+
var VERSION = "9.3.1";
|
|
11
11
|
var CHARS_PER_TOKEN = 3.8;
|
|
12
12
|
var MIN_COMPACTION_SAVING_RATIO = 0.1;
|
|
13
13
|
var ESTIMATOR_ROUNDING_TOLERANCE_TOKENS = 1;
|
|
@@ -585,8 +585,9 @@ import fs2 from "fs";
|
|
|
585
585
|
|
|
586
586
|
// src/infra/paths.ts
|
|
587
587
|
import path2 from "path";
|
|
588
|
+
import os from "os";
|
|
588
589
|
function home() {
|
|
589
|
-
return process.env.HOME ??
|
|
590
|
+
return process.env.HOME ?? os.homedir();
|
|
590
591
|
}
|
|
591
592
|
function piAgentDir() {
|
|
592
593
|
return path2.join(home(), ".pi", "agent");
|
|
@@ -7448,7 +7449,7 @@ function findLogInDirectory(directory, sessionId) {
|
|
|
7448
7449
|
return match ? path11.join(directory, match.name) : null;
|
|
7449
7450
|
}
|
|
7450
7451
|
function findSessionLogFile(sessionId, cwd) {
|
|
7451
|
-
const home2 =
|
|
7452
|
+
const home2 = home();
|
|
7452
7453
|
const now = Date.now();
|
|
7453
7454
|
const directDirectory = cwd ? sessionDirectoryForCwd(cwd) : null;
|
|
7454
7455
|
const cacheKey = sessionId + "\x00" + (directDirectory ?? "*");
|
|
@@ -7559,7 +7560,9 @@ async function resolveCompactionMessages(sessionId, toCompactEntries, cwd) {
|
|
|
7559
7560
|
for (const entry of toCompactEntries) {
|
|
7560
7561
|
if (!entry.id)
|
|
7561
7562
|
continue;
|
|
7562
|
-
const converted = convertToLlm([
|
|
7563
|
+
const converted = convertToLlm([
|
|
7564
|
+
asBranchMessage(entry.message)
|
|
7565
|
+
]);
|
|
7563
7566
|
if (!converted.length)
|
|
7564
7567
|
continue;
|
|
7565
7568
|
const logMsg = logMap.get(entry.id);
|
package/dist/infra/paths.d.ts
CHANGED
|
@@ -15,6 +15,15 @@
|
|
|
15
15
|
* `process.env.HOME` at call time. That way tests can override HOME in
|
|
16
16
|
* `beforeEach` and the next call sees the new root.
|
|
17
17
|
*/
|
|
18
|
+
/**
|
|
19
|
+
* `HOME` wins so tests can override the root; when it is unset (every
|
|
20
|
+
* Windows launch — Windows uses `USERPROFILE` — and GUI launches that strip
|
|
21
|
+
* the environment) fall back to `os.homedir()`, matching how the pi host
|
|
22
|
+
* resolves `~/.pi/agent`. The old `"/tmp"` fallback routed settings,
|
|
23
|
+
* caches, and run-locks to `C:\tmp` on Windows, making settings.json
|
|
24
|
+
* invisible to the extension.
|
|
25
|
+
*/
|
|
26
|
+
export declare function home(): string;
|
|
18
27
|
/** Root pi agent directory (`~/.pi/agent`). */
|
|
19
28
|
export declare function piAgentDir(): string;
|
|
20
29
|
/** Shared cache root (`~/.pi/agent/.cache`). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/infra/paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/infra/paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH;;;;;;;GAOG;AACH,wBAAgB,IAAI,IAAI,MAAM,CAE7B;AAED,+CAA+C;AAC/C,wBAAgB,UAAU,IAAI,MAAM,CAEnC;AAED,gDAAgD;AAChD,wBAAgB,QAAQ,IAAI,MAAM,CAEjC;AAED,8EAA8E;AAC9E,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAED,qCAAqC;AACrC,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AAED,kCAAkC;AAClC,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED,6CAA6C;AAC7C,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED,qCAAqC;AACrC,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED,gCAAgC;AAChC,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED,yBAAyB;AACzB,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,qEAAqE;AACrE,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED,qEAAqE;AACrE,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAED,+DAA+D;AAC/D,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED,gCAAgC;AAChC,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,iDAAiD;AACjD,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAK7D;AAED,uDAAuD;AACvD,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED,sDAAsD;AACtD,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAK7D;AAED,iFAAiF;AACjF,wBAAgB,+BAA+B,CAC9C,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GACf,MAAM,CAIR;AAED,iFAAiF;AACjF,wBAAgB,yBAAyB,CACxC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,GAClB,MAAM,CAKR;AAED,0EAA0E;AAC1E,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE9D;AAED,mCAAmC;AACnC,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C"}
|
package/dist/provider-eval.js
CHANGED
|
@@ -156,7 +156,7 @@ function formatProviderEvaluation(report) {
|
|
|
156
156
|
import fs2 from "fs";
|
|
157
157
|
|
|
158
158
|
// src/constants.ts
|
|
159
|
-
var VERSION = "9.3.
|
|
159
|
+
var VERSION = "9.3.1";
|
|
160
160
|
var SETTLED_TRIGGER_COOLDOWN_MS = 10 * 60000;
|
|
161
161
|
var COMPACT_SYSTEM_PREFIX = "You are an expert conversation summarizer for a coding agent. " + "Produce structured markdown summaries. " + "Follow output format exactly. " + "Use EXACT names \u2014 never paraphrase code identifiers. " + "Trust deterministic extraction data over intuition.";
|
|
162
162
|
var PROFILES = {
|
|
@@ -707,8 +707,9 @@ function warn(msg, err) {
|
|
|
707
707
|
|
|
708
708
|
// src/infra/paths.ts
|
|
709
709
|
import path from "path";
|
|
710
|
+
import os from "os";
|
|
710
711
|
function home() {
|
|
711
|
-
return process.env.HOME ??
|
|
712
|
+
return process.env.HOME ?? os.homedir();
|
|
712
713
|
}
|
|
713
714
|
function piAgentDir() {
|
|
714
715
|
return path.join(home(), ".pi", "agent");
|
|
@@ -5,7 +5,7 @@ var __require = import.meta.require;
|
|
|
5
5
|
import { ModelRegistry, ModelRuntime } from "@earendil-works/pi-coding-agent";
|
|
6
6
|
|
|
7
7
|
// src/constants.ts
|
|
8
|
-
var VERSION = "9.3.
|
|
8
|
+
var VERSION = "9.3.1";
|
|
9
9
|
var SETTLED_TRIGGER_COOLDOWN_MS = 10 * 60000;
|
|
10
10
|
var COMPACT_SYSTEM_PREFIX = "You are an expert conversation summarizer for a coding agent. " + "Produce structured markdown summaries. " + "Follow output format exactly. " + "Use EXACT names \u2014 never paraphrase code identifiers. " + "Trust deterministic extraction data over intuition.";
|
|
11
11
|
var PROFILES = {
|
|
@@ -727,8 +727,9 @@ function warn(msg, err) {
|
|
|
727
727
|
|
|
728
728
|
// src/infra/paths.ts
|
|
729
729
|
import path from "path";
|
|
730
|
+
import os from "os";
|
|
730
731
|
function home() {
|
|
731
|
-
return process.env.HOME ??
|
|
732
|
+
return process.env.HOME ?? os.homedir();
|
|
732
733
|
}
|
|
733
734
|
function piAgentDir() {
|
|
734
735
|
return path.join(home(), ".pi", "agent");
|
package/dist/telemetry-report.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
var __require = import.meta.require;
|
|
3
3
|
|
|
4
4
|
// src/constants.ts
|
|
5
|
-
var VERSION = "9.3.
|
|
5
|
+
var VERSION = "9.3.1";
|
|
6
6
|
var SETTLED_TRIGGER_COOLDOWN_MS = 10 * 60000;
|
|
7
7
|
var COMPACT_SYSTEM_PREFIX = "You are an expert conversation summarizer for a coding agent. " + "Produce structured markdown summaries. " + "Follow output format exactly. " + "Use EXACT names \u2014 never paraphrase code identifiers. " + "Trust deterministic extraction data over intuition.";
|
|
8
8
|
var PROFILES = {
|
|
@@ -490,8 +490,9 @@ function readJsonlTail(target, limit, maxBytes = 512 * 1024) {
|
|
|
490
490
|
|
|
491
491
|
// src/infra/paths.ts
|
|
492
492
|
import path from "path";
|
|
493
|
+
import os from "os";
|
|
493
494
|
function home() {
|
|
494
|
-
return process.env.HOME ??
|
|
495
|
+
return process.env.HOME ?? os.homedir();
|
|
495
496
|
}
|
|
496
497
|
function piAgentDir() {
|
|
497
498
|
return path.join(home(), ".pi", "agent");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-log.d.ts","sourceRoot":"","sources":["../../src/utils/session-log.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"session-log.d.ts","sourceRoot":"","sources":["../../src/utils/session-log.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AA6EnE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAE/C;AAwBD,kEAAkE;AAClE,wBAAgB,+BAA+B,IAAI,IAAI,CAGtD;AA2GD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,OAAO,CAEhE;AAiFD,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,UAAU,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,wBAAsB,yBAAyB,CAC7C,SAAS,EAAE,MAAM,EACjB,gBAAgB,EAAE,mBAAmB,EAAE,EACvC,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,yBAAyB,EAAE,GAAG,IAAI,CAAC,CAoC7C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-smart-compact",
|
|
3
|
-
"version": "9.3.
|
|
3
|
+
"version": "9.3.1",
|
|
4
4
|
"description": "Verification-oriented smart compaction extension for Pi Coding Agent — deterministic extraction, exploration, synthesis, verification, metrics, and safety checks.",
|
|
5
5
|
"packageManager": "bun@1.3.14",
|
|
6
6
|
"engines": {
|