@caupulican/pi-adaptative 0.80.89 → 0.80.91

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 (31) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/core/agent-session.d.ts.map +1 -1
  3. package/dist/core/agent-session.js +18 -0
  4. package/dist/core/agent-session.js.map +1 -1
  5. package/dist/core/context/context-composition.d.ts +2 -0
  6. package/dist/core/context/context-composition.d.ts.map +1 -1
  7. package/dist/core/context/context-composition.js +1 -1
  8. package/dist/core/context/context-composition.js.map +1 -1
  9. package/dist/core/profile-resource-selection.d.ts.map +1 -1
  10. package/dist/core/profile-resource-selection.js +19 -6
  11. package/dist/core/profile-resource-selection.js.map +1 -1
  12. package/dist/core/resource-loader.d.ts +22 -0
  13. package/dist/core/resource-loader.d.ts.map +1 -1
  14. package/dist/core/resource-loader.js +54 -0
  15. package/dist/core/resource-loader.js.map +1 -1
  16. package/dist/modes/interactive/components/profile-resource-editor.d.ts.map +1 -1
  17. package/dist/modes/interactive/components/profile-resource-editor.js +11 -4
  18. package/dist/modes/interactive/components/profile-resource-editor.js.map +1 -1
  19. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  20. package/dist/modes/interactive/interactive-mode.js +65 -14
  21. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  22. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  23. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  24. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  25. package/examples/extensions/sandbox/package-lock.json +2 -2
  26. package/examples/extensions/sandbox/package.json +1 -1
  27. package/examples/extensions/with-deps/package-lock.json +2 -2
  28. package/examples/extensions/with-deps/package.json +1 -1
  29. package/examples/sdk/12-full-control.ts +4 -0
  30. package/npm-shrinkwrap.json +12 -12
  31. package/package.json +4 -4
@@ -932,6 +932,7 @@ export class AgentSession {
932
932
  },
933
933
  spawned: { cost: spawned.cost, reports: spawned.reports },
934
934
  adjustments: { memoryEvidenceTokens, enforcementSavedTokens },
935
+ extraObservations: this._resourceLoader.getAgentsDiagnostics().map((diagnostic) => diagnostic.message),
935
936
  });
936
937
  }
937
938
  /** Bounded plain-text rendering of {@link getContextCompositionReport} for the /context command. */
@@ -3859,6 +3860,23 @@ export class AgentSession {
3859
3860
  }
3860
3861
  }
3861
3862
  }
3863
+ // Strict UAC: the active profile is the COMPLETE grant, so a tool the profile names
3864
+ // explicitly is itself a request for that tool — it must ACTIVATE from the registry even
3865
+ // if the session never requested it. Without this, activation is only ever the requested
3866
+ // defaults ∩ allow-list, and a profile granting non-default tools (a search-only profile's
3867
+ // grep/find) yields an empty or truncated tool set on load and /reload. A blanket "*"
3868
+ // stays grant-only: activation then still derives from the request/defaults above.
3869
+ const explicitAllowPatterns = toolProfileFilter?.allow.filter((pattern) => pattern !== "*") ?? [];
3870
+ if (explicitAllowPatterns.length > 0) {
3871
+ for (const toolName of this._toolRegistry.keys()) {
3872
+ if (!isAllowedTool(toolName))
3873
+ continue;
3874
+ if (matchesResourceProfilePattern(toolName, explicitAllowPatterns)) {
3875
+ nextActiveToolNames.push(toolName);
3876
+ autoActivated.push(toolName);
3877
+ }
3878
+ }
3879
+ }
3862
3880
  // artifact_retrieve companion auto-activation is enforced inside
3863
3881
  // setActiveToolsByName() itself (not duplicated here), so every activation path --
3864
3882
  // including the public, extension-exposed setActiveTools() -- gets the same