pi-goosedump 0.12.8 → 0.12.10

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.
Files changed (2) hide show
  1. package/dist/index.ts +5 -12
  2. package/package.json +2 -2
package/dist/index.ts CHANGED
@@ -1676,13 +1676,15 @@ ${lines.join(`
1676
1676
  }
1677
1677
  }));
1678
1678
  }
1679
- function maybeAutoCompact(ctx, resumeAfter) {
1679
+ function maybeAutoCompact(ctx) {
1680
1680
  if (!goosedumpAvailable || !shouldOverrideDefaultCompaction)
1681
1681
  return;
1682
1682
  if (!counterTriggered || compactionQueued)
1683
1683
  return;
1684
1684
  if (ctx.hasPendingMessages())
1685
1685
  return;
1686
+ if (!ctx.isIdle())
1687
+ return;
1686
1688
  if (!hasCompactableHistory(ctx))
1687
1689
  return;
1688
1690
  syncCompactCounters(ctx, true);
@@ -1693,13 +1695,6 @@ ${lines.join(`
1693
1695
  compactionQueued = false;
1694
1696
  syncCompactCounters(ctx, true);
1695
1697
  updateStatus(ctx);
1696
- if (resumeAfter && !ctx.hasPendingMessages()) {
1697
- pi.sendMessage({
1698
- customType: "goosedump-autocompact-resume",
1699
- content: "The session was compacted to reduce context size. Continue the task you were working on from where you left off.",
1700
- display: false
1701
- }, { triggerTurn: true });
1702
- }
1703
1698
  },
1704
1699
  onError: (error) => {
1705
1700
  compactionQueued = false;
@@ -1720,11 +1715,9 @@ ${lines.join(`
1720
1715
  pi.on("turn_end", async (event, ctx) => {
1721
1716
  if (isCompletedAssistant(event.message))
1722
1717
  noteCompletedTurn(ctx);
1723
- if (event.toolResults.length > 0)
1724
- maybeAutoCompact(ctx, true);
1725
1718
  });
1726
- pi.on("agent_end", async (_event, ctx) => {
1727
- maybeAutoCompact(ctx, false);
1719
+ pi.on("agent_settled", async (_event, ctx) => {
1720
+ maybeAutoCompact(ctx);
1728
1721
  });
1729
1722
  pi.on("session_before_compact", async (event, ctx) => {
1730
1723
  if (!shouldOverrideDefaultCompaction || !goosedumpAvailable)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-goosedump",
3
- "version": "0.12.8",
3
+ "version": "0.12.10",
4
4
  "description": "Pi extension for goosedump-backed session-history search, entry expansion, and compaction",
5
5
  "keywords": [
6
6
  "compaction",
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@earendil-works/pi-tui": "^0.82.1",
41
- "@jarkkojs/goosedump": "^0.12.8",
41
+ "@jarkkojs/goosedump": "^0.12.10",
42
42
  "@sinclair/typebox": "^0.34.49"
43
43
  },
44
44
  "devDependencies": {