pi-condense 2.9.2 → 2.10.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/src/types.ts CHANGED
@@ -414,6 +414,12 @@ export interface ContextPruneConfig {
414
414
  * null (default) = disabled. Out-of-range (<= 0 or > 1) normalizes to null.
415
415
  */
416
416
  budgetTurnDelta: number | null;
417
+ /**
418
+ * Opt-in flush trigger: when the un-pruned tail past the frontier
419
+ * (frontierGapTokens) reaches this many tokens, flush at turn_end.
420
+ * null (default) disables. Config-file-only — no settings overlay row.
421
+ */
422
+ frontierGapThresholdTokens: number | null;
417
423
  }
418
424
 
419
425
  /**
@@ -426,7 +432,10 @@ export interface ContextPruneConfig {
426
432
  * into a ChainCompressionEntry by adding blockId, toolRefs, and compressedAt.
427
433
  */
428
434
  export interface ChainRange {
429
- /** Timestamp of the user message that opens the chain. */
435
+ /**
436
+ * Start anchor timestamp — a user message or an eligible (non-pruner)
437
+ * custom message. Field name kept for persisted-entry compatibility.
438
+ */
430
439
  startUserTimestamp: number;
431
440
  /**
432
441
  * All toolCallIds in the chain's middle (deduplicated). Collected from both
@@ -463,7 +472,11 @@ export interface ChainRange {
463
472
  export interface ChainCompressionEntry {
464
473
  /** Stable block ID, monotonic per session: "b1", "b2", ... */
465
474
  blockId: string;
466
- /** Timestamp of the user message that opens the chain. Keep raw; synthetic inserted after. */
475
+ /**
476
+ * Start anchor timestamp — a user message or an eligible (non-pruner)
477
+ * custom message. Field name kept for persisted-entry compatibility.
478
+ * Keep raw; synthetic inserted after.
479
+ */
467
480
  startUserTimestamp: number;
468
481
  /**
469
482
  * All toolCallIds in the chain's middle. **Diagnostic only** since the
@@ -566,6 +579,7 @@ export const DEFAULT_CONFIG: ContextPruneConfig = {
566
579
  spillThreshold: 65536,
567
580
  spillPreviewBytes: 2048,
568
581
  budgetTurnDelta: null,
582
+ frontierGapThresholdTokens: null,
569
583
  };
570
584
 
571
585
  // ── Captured batch ─────────────────────────────────────────────────────────
@@ -708,7 +722,7 @@ export interface ContextMetricsSnapshot {
708
722
  frontierGapTokens: number;
709
723
  }
710
724
 
711
- export type FlushTrigger = "budget" | "delta" | "message-end" | "manual" | "rearmed";
725
+ export type FlushTrigger = "budget" | "delta" | "frontier-gap" | "message-end" | "manual" | "rearmed";
712
726
 
713
727
  /** Payload of CUSTOM_TYPE_FLUSH_METRICS. */
714
728
  export interface FlushMetricsEntry {