@caupulican/pi-adaptative 0.80.90 → 0.80.93

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 (44) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/core/agent-session.d.ts +18 -0
  3. package/dist/core/agent-session.d.ts.map +1 -1
  4. package/dist/core/agent-session.js +134 -35
  5. package/dist/core/agent-session.js.map +1 -1
  6. package/dist/core/compaction/compaction.d.ts +2 -2
  7. package/dist/core/compaction/compaction.d.ts.map +1 -1
  8. package/dist/core/compaction/compaction.js +15 -5
  9. package/dist/core/compaction/compaction.js.map +1 -1
  10. package/dist/core/context/brain-curator.d.ts +21 -0
  11. package/dist/core/context/brain-curator.d.ts.map +1 -1
  12. package/dist/core/context/brain-curator.js +66 -0
  13. package/dist/core/context/brain-curator.js.map +1 -1
  14. package/dist/core/context/context-composition.d.ts +2 -0
  15. package/dist/core/context/context-composition.d.ts.map +1 -1
  16. package/dist/core/context/context-composition.js +1 -1
  17. package/dist/core/context/context-composition.js.map +1 -1
  18. package/dist/core/profile-resource-selection.d.ts.map +1 -1
  19. package/dist/core/profile-resource-selection.js +19 -6
  20. package/dist/core/profile-resource-selection.js.map +1 -1
  21. package/dist/core/resource-loader.d.ts +22 -0
  22. package/dist/core/resource-loader.d.ts.map +1 -1
  23. package/dist/core/resource-loader.js +54 -0
  24. package/dist/core/resource-loader.js.map +1 -1
  25. package/dist/core/settings-manager.d.ts +8 -0
  26. package/dist/core/settings-manager.d.ts.map +1 -1
  27. package/dist/core/settings-manager.js +25 -0
  28. package/dist/core/settings-manager.js.map +1 -1
  29. package/dist/modes/interactive/components/profile-resource-editor.d.ts.map +1 -1
  30. package/dist/modes/interactive/components/profile-resource-editor.js +11 -4
  31. package/dist/modes/interactive/components/profile-resource-editor.js.map +1 -1
  32. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  33. package/dist/modes/interactive/interactive-mode.js +65 -14
  34. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  35. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  36. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  37. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  38. package/examples/extensions/sandbox/package-lock.json +2 -2
  39. package/examples/extensions/sandbox/package.json +1 -1
  40. package/examples/extensions/with-deps/package-lock.json +2 -2
  41. package/examples/extensions/with-deps/package.json +1 -1
  42. package/examples/sdk/12-full-control.ts +4 -0
  43. package/npm-shrinkwrap.json +12 -12
  44. package/package.json +4 -4
@@ -654,6 +654,31 @@ export class SettingsManager {
654
654
  block: [...new Set(filter.block ?? [])],
655
655
  };
656
656
  }
657
+ /**
658
+ * Profile grants the user's own disable list overrides. RATIFIED precedence: a user disable
659
+ * (`disabledResources` / `!` overrides) is a hard off-switch that always WINS over a profile
660
+ * allow (the legacy disabled filter merges into every profile filter as a block, and blocks
661
+ * beat allows). This helper only SURFACES the conflict so a granted-but-disabled resource
662
+ * doesn't look like a broken grant.
663
+ */
664
+ getProfileGrantsOverriddenByUserDisable(kind) {
665
+ const disabled = this.settings.disabledResources?.[kind] ?? [];
666
+ if (!Array.isArray(disabled) || disabled.length === 0)
667
+ return [];
668
+ const registry = this.getProfileRegistry();
669
+ const conflicts = new Set();
670
+ for (const profileName of this.getActiveResourceProfileNames()) {
671
+ const filter = registry.getProfile(profileName)?.resources[kind];
672
+ for (const allowEntry of filter?.allow ?? []) {
673
+ if (allowEntry === "*")
674
+ continue;
675
+ if (disabled.includes(allowEntry) || matchesResourceProfilePattern(allowEntry, disabled)) {
676
+ conflicts.add(allowEntry);
677
+ }
678
+ }
679
+ }
680
+ return [...conflicts];
681
+ }
657
682
  isResourceAllowedByProfile(kind, resourcePath, baseDir = "") {
658
683
  const filter = this.getResourceProfileFilter(kind);
659
684
  if (filter.allow.length > 0 && !matchesResourceProfilePattern(resourcePath, filter.allow, baseDir)) {