@caupulican/pi-adaptative 0.80.91 → 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.
- package/CHANGELOG.md +17 -0
- package/dist/core/agent-session.d.ts +18 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +134 -36
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +2 -2
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +15 -5
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/context/brain-curator.d.ts +21 -0
- package/dist/core/context/brain-curator.d.ts.map +1 -1
- package/dist/core/context/brain-curator.js +66 -0
- package/dist/core/context/brain-curator.js.map +1 -1
- package/dist/core/settings-manager.d.ts +8 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +25 -0
- package/dist/core/settings-manager.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
|
@@ -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)) {
|