@monotykamary/pi-vcc 0.6.2 → 0.6.3

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
@@ -199,7 +199,7 @@ pi-vcc is one of four compaction approaches in the AI coding-agent ecosystem. He
199
199
  - **Scoped recall** — default search is active lineage; use `scope:"all"` for all lineages, or `scope:"compaction:N"` / `scope:"compaction:latest"` to search within a specific compaction segment's original messages
200
200
  - **Priority error tags** — outstanding context items tagged `[ERROR]`, `[WARN]`, `[INFO]`, `[RESOLVED]` for urgency at a glance
201
201
  - **Metadata footer** — each compaction summary ends with timestamp, compression ratio, and message range
202
- - **Compaction counter** — the post-compaction notification reports the ordinal and total (e.g. `"3rd compaction; 3 total"`), counted from pi-vcc compaction entries in the session file so it lines up with `scope:"compaction:N"`
202
+ - **Compaction counter** — the post-compaction notification reports the ordinal of the just-completed compaction (e.g. `"3rd compaction"`), counted from pi-vcc compaction entries in the session file so it lines up with `scope:"compaction:N"`
203
203
  - **Cache-friendly ordering** — stable sections (goal, preferences, files, commits, anchors) come first; volatile sections (outstanding context, earlier turns, current status) come last, maximizing prompt-cacheable prefix across compactions
204
204
  - **Adaptive recall view** — search results grouped by conversation segments (turns) with match indicators (`>`) and context preservation, so the agent sees the conversational structure around each match
205
205
  - **Regex search** — `vcc_recall` supports regex patterns (`hook|inject`, `fail.*build`) and OR-ranked multi-word queries
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@monotykamary/pi-vcc",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@monotykamary/pi-vcc",
9
- "version": "0.6.2",
9
+ "version": "0.6.3",
10
10
  "devDependencies": {
11
11
  "knip": "6.14.1",
12
12
  "typescript": "6.0.3"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monotykamary/pi-vcc",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "description": "Algorithmic conversation compactor for pi - transcript-preserving structured summaries, no LLM calls",
5
5
  "main": "index.ts",
6
6
  "keywords": [
@@ -15,9 +15,9 @@ export const registerPiVccCommand = (pi: ExtensionAPI) => {
15
15
  customInstructions: PI_VCC_COMPACT_INSTRUCTION,
16
16
  onComplete: () => {
17
17
  const stats = getLastCompactionStats();
18
- const { total, latestOrdinal } = countPiVccCompactionsFromSession(ctx.sessionManager);
19
- const compactionLabel = total > 0
20
- ? ` (${latestOrdinal}${ordinalSuffix(latestOrdinal)} compaction; ${total} total)`
18
+ const count = countPiVccCompactionsFromSession(ctx.sessionManager);
19
+ const compactionLabel = count > 0
20
+ ? ` (${count}${ordinalSuffix(count)} compaction)`
21
21
  : "";
22
22
  if (stats) {
23
23
  ctx.ui.notify(
@@ -4,7 +4,8 @@
4
4
  * Compaction entries are persisted to the session file as
5
5
  * `{ type: "compaction", details: { compactor: "pi-vcc", ... } }`.
6
6
  * `session_compact` fires after the new compaction entry has been appended,
7
- * so counting entries at that point includes the just-completed compaction.
7
+ * so counting entries at that point includes the just-completed compaction —
8
+ * meaning the count doubles as the 1-based ordinal of the latest one.
8
9
  *
9
10
  * `getEntries()` returns the full append-only session (all lineages), which
10
11
  * matches the `compaction:N` indexing scheme used by vcc_recall — so the
@@ -25,28 +26,22 @@ interface SessionManagerLike {
25
26
  getEntries?: () => any[];
26
27
  }
27
28
 
28
- interface CompactionCount {
29
- /** Total pi-vcc compactions in the session (includes the just-completed one). */
30
- total: number;
31
- /** 1-based ordinal of the latest compaction (== total, or 0 when none). */
32
- latestOrdinal: number;
33
- }
34
-
35
- export const countPiVccCompactions = (entries: any[]): CompactionCount => {
29
+ /** Total pi-vcc compactions in the session (includes the just-completed one). */
30
+ export const countPiVccCompactions = (entries: any[]): number => {
36
31
  let total = 0;
37
32
  for (const e of entries) {
38
33
  if (e?.type === "compaction" && e?.details?.compactor === "pi-vcc") total++;
39
34
  }
40
- return { total, latestOrdinal: total };
35
+ return total;
41
36
  };
42
37
 
43
38
  export const countPiVccCompactionsFromSession = (
44
39
  sessionManager: SessionManagerLike | undefined,
45
- ): CompactionCount => {
40
+ ): number => {
46
41
  try {
47
42
  const entries = sessionManager?.getEntries?.() ?? [];
48
43
  return countPiVccCompactions(entries);
49
44
  } catch {
50
- return { total: 0, latestOrdinal: 0 };
45
+ return 0;
51
46
  }
52
47
  };
@@ -490,9 +490,9 @@ export const registerBeforeCompactHook = (pi: ExtensionAPI) => {
490
490
  // /pi-vcc path uses its own onComplete callback in the command handler.
491
491
  if (!lastCompactWasPiVcc) {
492
492
  const stats = lastStats;
493
- const { total, latestOrdinal } = countPiVccCompactionsFromSession(ctx?.sessionManager as any);
494
- const compactionLabel = total > 0
495
- ? ` (${latestOrdinal}${ordinalSuffix(latestOrdinal)} compaction; ${total} total)`
493
+ const count = countPiVccCompactionsFromSession(ctx?.sessionManager as any);
494
+ const compactionLabel = count > 0
495
+ ? ` (${count}${ordinalSuffix(count)} compaction)`
496
496
  : "";
497
497
  if (stats) {
498
498
  setTimeout(() => {