@caupulican/pi-adaptative 0.80.84 → 0.80.86
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 +29 -0
- package/dist/core/agent-session.d.ts +20 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +113 -6
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/cost-guard.d.ts +1 -1
- package/dist/core/cost-guard.d.ts.map +1 -1
- package/dist/core/cost-guard.js +2 -2
- package/dist/core/cost-guard.js.map +1 -1
- package/dist/core/profile-registry.d.ts +2 -1
- package/dist/core/profile-registry.d.ts.map +1 -1
- package/dist/core/profile-registry.js +32 -2
- package/dist/core/profile-registry.js.map +1 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +3 -1
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/settings-manager.d.ts +2 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +33 -3
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/modes/interactive/components/profile-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/profile-selector.js +2 -0
- package/dist/modes/interactive/components/profile-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +3 -0
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +3 -0
- package/dist/modes/print-mode.js.map +1 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +12 -12
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,32 @@
|
|
|
1
|
+
## [0.80.86] - 2026-06-29
|
|
2
|
+
|
|
3
|
+
### Added
|
|
4
|
+
|
|
5
|
+
- Added dynamic token estimation checks for model context windows, warning the user if the base configuration (system prompt and tools) uses more than 70% of the context window.
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Fixed adaptive scaling of compaction parameters (`reserveTokens` and `keepRecentTokens`) for models with small context windows to avoid immediate auto-compaction loops.
|
|
10
|
+
- Fixed a scope redeclaration issue with `activeProfileNames` in the resource loader.
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## [0.80.85] - 2026-06-29
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- Fixed proactive cost-guard estimates treating model prices as per-token instead of per-million,
|
|
18
|
+
which could show impossible per-turn warnings in the footer.
|
|
19
|
+
- Fixed trusted external resource-root settings profiles not constraining startup tools, preventing
|
|
20
|
+
simple prompts from activating every external extension tool schema.
|
|
21
|
+
- Fixed active resource profiles so blocked extensions are excluded from the extension runtime itself,
|
|
22
|
+
preventing their commands, tools, handlers, shortcuts, and renderers from being visible or callable.
|
|
23
|
+
- Fixed the no-profile default runtime to expose only Pi's built-in default tools, with extension
|
|
24
|
+
commands, handlers, tools, and provider registrations disabled until an explicit profile enables them.
|
|
25
|
+
- Fixed profile-gated extension runtimes to preserve allowed provider-only, handler-only, shortcut-only,
|
|
26
|
+
and renderer-only extensions even when the active profile also restricts tools or slash commands.
|
|
27
|
+
- Fixed explicit empty active profile selections so they suppress trusted external-root profile fallback.
|
|
28
|
+
- Fixed no-profile extension gating to preserve explicitly supplied SDK inline extension factories while still suppressing configured/discovered extensions unless a profile selects them.
|
|
29
|
+
|
|
1
30
|
## [0.80.84] - 2026-06-29
|
|
2
31
|
|
|
3
32
|
### Added
|
|
@@ -50,6 +50,9 @@ export type AgentSessionEvent = Exclude<AgentEvent, {
|
|
|
50
50
|
} | {
|
|
51
51
|
type: "thinking_level_changed";
|
|
52
52
|
level: ThinkingLevel;
|
|
53
|
+
} | {
|
|
54
|
+
type: "warning";
|
|
55
|
+
message: string;
|
|
53
56
|
} | {
|
|
54
57
|
type: "compaction_end";
|
|
55
58
|
reason: "manual" | "threshold" | "overflow";
|
|
@@ -285,6 +288,7 @@ export declare class AgentSession {
|
|
|
285
288
|
private _activeModelRouterIntent?;
|
|
286
289
|
private _modelRouterSessionBuffer?;
|
|
287
290
|
private _modelRouterEscalationRequested;
|
|
291
|
+
private _isModelRouterRetry;
|
|
288
292
|
private _lastModelRouterDecision?;
|
|
289
293
|
private _lastModelRouterSkipReason?;
|
|
290
294
|
private _lastModelRouterIntent?;
|
|
@@ -661,6 +665,19 @@ export declare class AgentSession {
|
|
|
661
665
|
* Cancel in-progress branch summarization.
|
|
662
666
|
*/
|
|
663
667
|
abortBranchSummary(): void;
|
|
668
|
+
/**
|
|
669
|
+
* Check if compaction is needed and run it.
|
|
670
|
+
* Called after agent_end and before prompt submission.
|
|
671
|
+
*
|
|
672
|
+
* Two cases:
|
|
673
|
+
* 1. Overflow: LLM returned context overflow error, remove error message from agent state, compact, auto-retry
|
|
674
|
+
* 2. Threshold: Context over threshold, compact, NO auto-retry (user continues manually)
|
|
675
|
+
*
|
|
676
|
+
* @param assistantMessage The assistant message to check
|
|
677
|
+
* @param skipAbortedCheck If false, include aborted messages (for pre-prompt check). Default: true
|
|
678
|
+
*/
|
|
679
|
+
private _getAdaptedCompactionSettings;
|
|
680
|
+
private _checkContextWindowUsageWarning;
|
|
664
681
|
private _checkCompaction;
|
|
665
682
|
private _runAutoCompaction;
|
|
666
683
|
/**
|
|
@@ -682,6 +699,9 @@ export declare class AgentSession {
|
|
|
682
699
|
* so reload() can re-apply it after a live settings/profile edit.
|
|
683
700
|
*/
|
|
684
701
|
private _deriveToolProfileFilter;
|
|
702
|
+
private _isToolOrCommandAllowedByProfile;
|
|
703
|
+
private _hasToolOrCommandProfileGate;
|
|
704
|
+
private _filterExtensionsForRuntime;
|
|
685
705
|
private _reapplyActiveProfileModelSettings;
|
|
686
706
|
private _initializeMemory;
|
|
687
707
|
/** Register a memory provider contributed by an extension; applied on the next memory (re)init. */
|