@caupulican/pi-adaptative 0.80.37 → 0.80.40
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 -1
- package/README.md +1 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +16 -8
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +1 -0
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/provider-display-names.d.ts.map +1 -1
- package/dist/core/provider-display-names.js +1 -0
- package/dist/core/provider-display-names.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 +1 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +3 -0
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +3 -1
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +3 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +38 -14
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/docs/adaptive-extension-shared-state-audit.md +1 -1
- package/docs/providers.md +16 -0
- 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
|
@@ -758,19 +758,27 @@ export class AgentSession {
|
|
|
758
758
|
if (!settings.enabled) {
|
|
759
759
|
return `Pi self-modification guardrails (local setting inactive):
|
|
760
760
|
- Do not modify Pi core, the installed Pi runtime, or pi-adaptative harness source for self-evolution.
|
|
761
|
-
- If self-modification is needed, ask the user to enable \`selfModification.enabled\` and set \`selfModification.sourcePath\` to the pi-adaptative source checkout.`;
|
|
762
|
-
}
|
|
763
|
-
|
|
764
|
-
|
|
761
|
+
- If self-modification is needed, ask the user to enable \`selfModification.enabled\` and set \`selfModification.sourcePaths\` (or legacy \`selfModification.sourcePath\`) to the pi-adaptative source checkout.`;
|
|
762
|
+
}
|
|
763
|
+
// Resolve from an ordered candidate list first (portable WSL/Termux switching
|
|
764
|
+
// from settings alone), then fall back to the legacy single sourcePath.
|
|
765
|
+
const rawCandidates = [
|
|
766
|
+
...(Array.isArray(settings.sourcePaths) ? settings.sourcePaths : []),
|
|
767
|
+
...(settings.sourcePath ? [settings.sourcePath] : []),
|
|
768
|
+
]
|
|
769
|
+
.map((candidate) => candidate?.trim())
|
|
770
|
+
.filter((candidate) => Boolean(candidate));
|
|
771
|
+
if (rawCandidates.length === 0) {
|
|
765
772
|
return `Pi self-modification guardrails (local setting active, source missing):
|
|
766
|
-
- Self-modification is enabled, but \`selfModification.sourcePath\` is
|
|
767
|
-
- Do not modify Pi core or runtime output. Ask the user to set \`selfModification.
|
|
773
|
+
- Self-modification is enabled, but no \`selfModification.sourcePaths\`/\`selfModification.sourcePath\` value is set.
|
|
774
|
+
- Do not modify Pi core or runtime output. Ask the user to set \`selfModification.sourcePaths\` to the pi-adaptative source checkout before proceeding.`;
|
|
768
775
|
}
|
|
769
|
-
const
|
|
776
|
+
const resolvedCandidates = rawCandidates.map((candidate) => resolvePath(candidate, this._cwd, { trim: true }));
|
|
777
|
+
const sourcePath = resolvedCandidates.find((candidate) => existsSync(candidate) && existsSync(resolvePath("package.json", candidate))) ?? resolvedCandidates[0];
|
|
770
778
|
const sourceLooksValid = existsSync(sourcePath) && existsSync(resolvePath("package.json", sourcePath));
|
|
771
779
|
const sourceStatus = sourceLooksValid
|
|
772
780
|
? sourcePath
|
|
773
|
-
: `${sourcePath} (missing or not a source checkout; ask the user to correct \`selfModification.
|
|
781
|
+
: `${sourcePath} (missing or not a source checkout; ask the user to correct \`selfModification.sourcePaths\` before editing)`;
|
|
774
782
|
const autonomy = this.settingsManager.getAutonomySettings();
|
|
775
783
|
const settingsGate = autonomy.mode === "full"
|
|
776
784
|
? "In autonomy.mode=full, autonomy/autoLearn setting tuning is covered by the standing autonomy grant; ask before changing credentials, provider auth, package sources, or unrelated preferences."
|