@caupulican/pi-adaptative 0.80.74 → 0.80.75

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 (29) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/core/agent-session.d.ts +10 -0
  3. package/dist/core/agent-session.d.ts.map +1 -1
  4. package/dist/core/agent-session.js +42 -6
  5. package/dist/core/agent-session.js.map +1 -1
  6. package/dist/core/compaction/compaction.d.ts +22 -0
  7. package/dist/core/compaction/compaction.d.ts.map +1 -1
  8. package/dist/core/compaction/compaction.js +31 -3
  9. package/dist/core/compaction/compaction.js.map +1 -1
  10. package/dist/core/memory/providers/file-store.d.ts.map +1 -1
  11. package/dist/core/memory/providers/file-store.js +33 -2
  12. package/dist/core/memory/providers/file-store.js.map +1 -1
  13. package/dist/core/resource-loader.d.ts +19 -1
  14. package/dist/core/resource-loader.d.ts.map +1 -1
  15. package/dist/core/resource-loader.js +69 -5
  16. package/dist/core/resource-loader.js.map +1 -1
  17. package/dist/core/settings-manager.d.ts +6 -0
  18. package/dist/core/settings-manager.d.ts.map +1 -1
  19. package/dist/core/settings-manager.js +8 -0
  20. package/dist/core/settings-manager.js.map +1 -1
  21. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  22. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  23. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  24. package/examples/extensions/sandbox/package-lock.json +2 -2
  25. package/examples/extensions/sandbox/package.json +1 -1
  26. package/examples/extensions/with-deps/package-lock.json +2 -2
  27. package/examples/extensions/with-deps/package.json +1 -1
  28. package/npm-shrinkwrap.json +12 -12
  29. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,3 +1,23 @@
1
+ ## [0.80.75] - 2026-06-28
2
+
3
+ ### Changed
4
+
5
+ - Compaction cost guard (long-session savings): compaction now also triggers once context passes a
6
+ configurable fraction of the model's window (`compaction.triggerPercent`, default 0.7) — not only when
7
+ it's nearly full — so per-turn input cost stays bounded on large-window models, while an anti-thrashing
8
+ gate skips an early compaction that would barely shrink the context. The summary is now produced by a
9
+ cheap auxiliary model when one is available (`compaction.model`, default `"auto"` picks the cheapest
10
+ authed model that can hold the context and is cheaper than the session model; falls back to the session
11
+ model), instead of always using the main model.
12
+
13
+ ### Fixed
14
+
15
+ - Hardened context/memory threat scanning: added detection and neutralization of invisible/bidirectional
16
+ control characters (zero-width, bidi overrides/isolates — the "Trojan Source" vector), and a broader,
17
+ scoped pattern set. Context-file and memory reads strip hidden characters and continue; high-privilege
18
+ memory writes are scanned in a stricter scope (exfil/backdoor/persistence patterns) and rejected
19
+ outright.
20
+
1
21
  ## [0.80.74] - 2026-06-28
2
22
 
3
23
  ### Fixed
@@ -309,6 +309,16 @@ export declare class AgentSession {
309
309
  get modelRegistry(): ModelRegistry;
310
310
  private _getRequiredRequestAuth;
311
311
  private _getCompactionRequestAuth;
312
+ /**
313
+ * Resolve the model used to SUMMARIZE during compaction (cost guard, #30). A compaction summary is an
314
+ * extraction task — it does not need the main (expensive) model. Selection:
315
+ * - an explicit `compaction.model` setting wins, but only if its provider is authed (else fall back);
316
+ * - `"auto"` (default) picks the CHEAPEST authed model whose context window can hold a compaction
317
+ * (capability floor), and ONLY if it is strictly cheaper than the session model — so we never
318
+ * downgrade to an equally-priced but weaker summarizer (agy's floor: don't degrade the checkpoint);
319
+ * - otherwise the session model is used (safe default).
320
+ */
321
+ private _resolveCompactionModel;
312
322
  /**
313
323
  * Install tool hooks once on the Agent instance.
314
324
  *