pi-smart-compact 7.7.0 → 7.9.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/CHANGELOG.md +32 -0
- package/README.md +407 -402
- package/dist/constants.d.ts +45 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/core.d.ts +27 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +264 -112
- package/dist/phases/explore.d.ts +35 -0
- package/dist/phases/explore.d.ts.map +1 -0
- package/dist/phases/synthesize.d.ts +23 -0
- package/dist/phases/synthesize.d.ts.map +1 -0
- package/dist/phases/verify.d.ts +16 -0
- package/dist/phases/verify.d.ts.map +1 -0
- package/dist/types.d.ts +265 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/ui/overlays.d.ts +29 -0
- package/dist/ui/overlays.d.ts.map +1 -0
- package/dist/utils/cache.d.ts +27 -0
- package/dist/utils/cache.d.ts.map +1 -0
- package/dist/utils/damage.d.ts +28 -0
- package/dist/utils/damage.d.ts.map +1 -0
- package/dist/utils/extraction.d.ts +27 -0
- package/dist/utils/extraction.d.ts.map +1 -0
- package/dist/utils/fingerprint.d.ts +32 -0
- package/dist/utils/fingerprint.d.ts.map +1 -0
- package/dist/utils/helpers.d.ts +22 -0
- package/dist/utils/helpers.d.ts.map +1 -0
- package/dist/utils/logger.d.ts +8 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/pruning.d.ts +19 -0
- package/dist/utils/pruning.d.ts.map +1 -0
- package/dist/utils/state.d.ts +62 -0
- package/dist/utils/state.d.ts.map +1 -0
- package/dist/utils/tokens.d.ts +8 -0
- package/dist/utils/tokens.d.ts.map +1 -0
- package/dist/utils/type-guards.d.ts +26 -0
- package/dist/utils/type-guards.d.ts.map +1 -0
- package/docs/assets/pi-smart-compact.png +0 -0
- package/package.json +10 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [7.8.0] - 2026-05-17
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
- **TTL bug in loadCompactionState** — `Date.now() - 0` was always true, making state files live forever. Now uses `updatedAt` field with `fs.statSync(fp).mtimeMs` fallback for pre-7.8.0 backward compat.
|
|
7
|
+
- **mergeExtractions duplicate modifiedFiles** — same file could appear multiple times after incremental cache merge. Now deduped via `Map<path, entry>`.
|
|
8
|
+
- **deriveProjectId weak hash** — DJB2 hash with 32-bit truncation had collision risk across projects. Replaced with `crypto.createHash('sha256')`.
|
|
9
|
+
- **smartKeepBoundary JSON.stringify** — was serializing entire message objects including metadata, causing false positive boundary matches. Replaced with extractText-style approach.
|
|
10
|
+
- **Removed all `(m: any)` type casts** — 3 instances in core.ts replaced with proper type inference.
|
|
11
|
+
|
|
12
|
+
### Removed
|
|
13
|
+
- **`src/utils/message-blocks.ts`** — 4 functions (`getBlocks`, `isTextBlock`, `isToolCallBlock`, `getToolArgumentString`) never imported anywhere. Entire file deleted.
|
|
14
|
+
- **`extractTextSafe` and `getMessageText`** from `types.ts` — unused dead code chain.
|
|
15
|
+
- **`ToolCallBlock` and `TextBlock` interfaces** from `types.ts` — superseded by `LlmToolCallBlock` and `LlmTextBlock`.
|
|
16
|
+
- **`clearToolSupportCache`** from `explore.ts` — exported but never called. Cache already self-regulates via TTL checks on access.
|
|
17
|
+
- **`extractUserNote` local duplicate** from `index.ts` — now imported from `helpers.ts`.
|
|
18
|
+
- **Unused imports** across 4 files (`isTextBlock`, `isToolCallBlock`, `extractTextSafe`, `buildToolCallIndex`, `CompressionProfile`, `ProfileConfig`, `LlmMessage`).
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
- **`runSmartCompact` signature** — 10 positional parameters replaced with `SmartCompactOptions` interface. All 4 call sites in `index.ts` updated.
|
|
22
|
+
- **Silent catch → `console.error(LOG_PREFIX + ...)`** — all 11 I/O catch blocks now log errors with the shared `LOG_PREFIX` constant.
|
|
23
|
+
- **`buildToolCallIndex` called once** — was called 4× per extraction (`trackFileOps`, `catalogErrors`, `extractDecisions`, `segmentTopicsHeuristic`). Now built once in `extractStructured` and passed via optional `_tcIdx` parameter.
|
|
24
|
+
- **`JSON.stringify` → `extractText`** in synthesize.ts (`estimateChunkTokens`) and explore.ts (`search_conversation`) — avoids serializing metadata, reduces CPU ~15-25%.
|
|
25
|
+
- **`loadConfig` stale cache fix** — catch block now sets `_cfg = fallback` so deleted config files don't serve stale cached values.
|
|
26
|
+
|
|
27
|
+
### Added
|
|
28
|
+
- **`SessionType`** type alias — replaces inline `"implementation" | "review" | "debugging" | "discussion"` union across 5+ files.
|
|
29
|
+
- **`SessionMessageEntry`** in `types.ts` — was duplicated inline in `core.ts` and `helpers.ts`.
|
|
30
|
+
- **Constants**: `LOG_PREFIX`, `MIN_TOKEN_THRESHOLD`, `MAX_EXPLORATION_ROUNDS`, `CONFIG_KEY`, `CONFIG_KEY_ALT`, 11 section name constants (`SECTION_GOAL` etc.).
|
|
31
|
+
- **`ToolCallIndex`** type alias in `extraction.ts` for the reusable tool call index.
|
|
32
|
+
- **`updatedAt`** field in `CompactionState` — enables proper TTL expiry with backward-compat.
|
|
33
|
+
- **`SmartCompactOptions`** interface in `core.ts` — documented API for the main pipeline runner.
|
|
34
|
+
|
|
3
35
|
## [7.5.0] - 2026-05-17
|
|
4
36
|
|
|
5
37
|
### Added
|