@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
|
@@ -4258,22 +4258,43 @@ export class InteractiveMode {
|
|
|
4258
4258
|
return undefined;
|
|
4259
4259
|
return `Auto Learn model "${modelValue}" is not in configured subscription/API models; saved as manual/unverified.`;
|
|
4260
4260
|
}
|
|
4261
|
+
collectSelfModificationCandidates(settings) {
|
|
4262
|
+
return [
|
|
4263
|
+
...(Array.isArray(settings.sourcePaths) ? settings.sourcePaths : []),
|
|
4264
|
+
...(settings.sourcePath ? [settings.sourcePath] : []),
|
|
4265
|
+
]
|
|
4266
|
+
.map((candidate) => candidate?.trim())
|
|
4267
|
+
.filter((candidate) => Boolean(candidate));
|
|
4268
|
+
}
|
|
4269
|
+
getCurrentCwdForSettings() {
|
|
4270
|
+
return this.runtimeHost?.session?.sessionManager?.getCwd?.() || process.cwd();
|
|
4271
|
+
}
|
|
4272
|
+
resolveSelfModificationSource(settings) {
|
|
4273
|
+
const cwd = this.getCurrentCwdForSettings();
|
|
4274
|
+
const resolved = this.collectSelfModificationCandidates(settings).map((candidate) => resolvePath(candidate, cwd, { trim: true }));
|
|
4275
|
+
if (resolved.length === 0)
|
|
4276
|
+
return undefined;
|
|
4277
|
+
return (resolved.find((candidate) => fs.existsSync(candidate) && fs.existsSync(path.join(candidate, "package.json"))) ?? resolved[0]);
|
|
4278
|
+
}
|
|
4261
4279
|
validateSelfModificationSource(settings) {
|
|
4262
4280
|
if (!settings.enabled)
|
|
4263
4281
|
return undefined;
|
|
4264
|
-
const
|
|
4265
|
-
|
|
4282
|
+
const cwd = this.getCurrentCwdForSettings();
|
|
4283
|
+
const resolved = this.collectSelfModificationCandidates(settings).map((candidate) => resolvePath(candidate, cwd, { trim: true }));
|
|
4284
|
+
if (resolved.length === 0)
|
|
4266
4285
|
return "Self modification is enabled, but no pi-adaptative source path is set.";
|
|
4267
|
-
const
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
if (
|
|
4271
|
-
return
|
|
4272
|
-
|
|
4273
|
-
if (!fs.existsSync(
|
|
4274
|
-
return `Self modification source path does not
|
|
4286
|
+
const valid = resolved.find((candidate) => fs.existsSync(candidate) &&
|
|
4287
|
+
fs.existsSync(path.join(candidate, "package.json")) &&
|
|
4288
|
+
fs.existsSync(path.join(candidate, "packages", "coding-agent")));
|
|
4289
|
+
if (valid)
|
|
4290
|
+
return undefined;
|
|
4291
|
+
const first = resolved[0];
|
|
4292
|
+
if (!fs.existsSync(first))
|
|
4293
|
+
return `Self modification source path does not exist: ${first}`;
|
|
4294
|
+
if (!fs.existsSync(path.join(first, "package.json"))) {
|
|
4295
|
+
return `Self modification source path has no package.json: ${first}`;
|
|
4275
4296
|
}
|
|
4276
|
-
return
|
|
4297
|
+
return `Self modification source path does not look like pi-adaptative (missing packages/coding-agent): ${first}`;
|
|
4277
4298
|
}
|
|
4278
4299
|
evaluateAutoLearn(force = false) {
|
|
4279
4300
|
const settings = this.getEffectiveAutoLearnSettings();
|
|
@@ -4292,9 +4313,12 @@ export class InteractiveMode {
|
|
|
4292
4313
|
"- Durable memory writes require the configured high-confidence policy; skills, extensions, source, settings, publishing, tagging, and releases remain proposals unless the foreground user explicitly asks.",
|
|
4293
4314
|
].join("\n");
|
|
4294
4315
|
}
|
|
4295
|
-
const
|
|
4296
|
-
?
|
|
4297
|
-
:
|
|
4316
|
+
const selfModificationSource = selfModification.enabled
|
|
4317
|
+
? this.resolveSelfModificationSource(selfModification)
|
|
4318
|
+
: undefined;
|
|
4319
|
+
const sourceAuthority = selfModification.enabled && selfModificationSource
|
|
4320
|
+
? `- Pi source: standing authority to edit the authorized selfModification source (${selfModificationSource}) for self-evolution improvements; inspect git status first, preserve unrelated user changes, run focused validation, and leave a clear rollback/test summary.`
|
|
4321
|
+
: "- Pi source: no standing source-edit authority until selfModification.enabled and selfModification.sourcePaths are set.";
|
|
4298
4322
|
return [
|
|
4299
4323
|
"Authority mode: FULL AUTONOMOUS standing grant.",
|
|
4300
4324
|
"- Memory: may apply high-confidence durable Automata memory/corrections after duplicate and corroboration checks.",
|