@caupulican/pi-adaptative 0.80.78 → 0.80.80
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 +23 -0
- package/dist/core/agent-session.d.ts +6 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +13 -0
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/learning/skill-curator.d.ts +7 -0
- package/dist/core/learning/skill-curator.d.ts.map +1 -1
- package/dist/core/learning/skill-curator.js +28 -0
- package/dist/core/learning/skill-curator.js.map +1 -1
- package/dist/core/resource-loader.d.ts +6 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +49 -34
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/settings-manager.d.ts +19 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +17 -2
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +6 -0
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +12 -0
- package/dist/modes/interactive/interactive-mode.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
|
@@ -341,7 +341,10 @@ export class DefaultResourceLoader {
|
|
|
341
341
|
const cliExtensionPaths = await this.packageManager.resolveExtensionSources(this.additionalExtensionPaths, {
|
|
342
342
|
temporary: true,
|
|
343
343
|
});
|
|
344
|
-
// Return all paths (enabled and disabled) from
|
|
344
|
+
// Return all paths (enabled and disabled) from resolved, CLI, AND external-resource-root sources.
|
|
345
|
+
// External-root extensions are loaded just like the others (see reload), so they MUST appear in the
|
|
346
|
+
// profile editor's universe too — otherwise they're active but unblockable, and the editor wrongly
|
|
347
|
+
// shows "(none available)" while they run (bug: external extensions invisible to the profile editor).
|
|
345
348
|
const allPaths = new Set();
|
|
346
349
|
for (const resource of resolvedPaths.extensions) {
|
|
347
350
|
allPaths.add(resource.path);
|
|
@@ -349,8 +352,49 @@ export class DefaultResourceLoader {
|
|
|
349
352
|
for (const resource of cliExtensionPaths.extensions) {
|
|
350
353
|
allPaths.add(resource.path);
|
|
351
354
|
}
|
|
355
|
+
for (const p of this.discoverExternalExtensionPaths()) {
|
|
356
|
+
allPaths.add(p);
|
|
357
|
+
}
|
|
352
358
|
return Array.from(allPaths);
|
|
353
359
|
}
|
|
360
|
+
/**
|
|
361
|
+
* Discover extension directories under every external resource root (`<root>/extensions/<name>` with an
|
|
362
|
+
* index.ts/index.js/package.json). Single source of truth shared by the load path and the profile
|
|
363
|
+
* editor's universe so the two never diverge.
|
|
364
|
+
*/
|
|
365
|
+
discoverExternalExtensionPaths() {
|
|
366
|
+
const out = [];
|
|
367
|
+
for (const root of this.settingsManager.getEffectiveExternalResourceRoots()) {
|
|
368
|
+
const extDir = join(root, "extensions");
|
|
369
|
+
if (!existsSync(extDir))
|
|
370
|
+
continue;
|
|
371
|
+
try {
|
|
372
|
+
for (const entry of readdirSync(extDir, { withFileTypes: true })) {
|
|
373
|
+
let isDir = entry.isDirectory();
|
|
374
|
+
if (entry.isSymbolicLink()) {
|
|
375
|
+
try {
|
|
376
|
+
isDir = statSync(join(extDir, entry.name)).isDirectory();
|
|
377
|
+
}
|
|
378
|
+
catch {
|
|
379
|
+
continue;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
if (!isDir)
|
|
383
|
+
continue;
|
|
384
|
+
const entryPath = join(extDir, entry.name);
|
|
385
|
+
if (existsSync(join(entryPath, "index.ts")) ||
|
|
386
|
+
existsSync(join(entryPath, "index.js")) ||
|
|
387
|
+
existsSync(join(entryPath, "package.json"))) {
|
|
388
|
+
out.push(entryPath);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
catch {
|
|
393
|
+
// silent — a missing/unreadable root must not break discovery
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
return out;
|
|
397
|
+
}
|
|
354
398
|
/**
|
|
355
399
|
* Get a loaded extension by path.
|
|
356
400
|
* Matches by path or resolvedPath.
|
|
@@ -550,39 +594,10 @@ export class DefaultResourceLoader {
|
|
|
550
594
|
// Gather effective external resource roots
|
|
551
595
|
const effectiveRoots = this.settingsManager.getEffectiveExternalResourceRoots();
|
|
552
596
|
const filterPathsByProfile = (paths, kind) => this.filterPathsByProfile(paths, kind);
|
|
553
|
-
// Discover external extensions
|
|
554
|
-
const externalExtensions =
|
|
555
|
-
for (const
|
|
556
|
-
|
|
557
|
-
if (existsSync(extDir)) {
|
|
558
|
-
try {
|
|
559
|
-
const entries = readdirSync(extDir, { withFileTypes: true });
|
|
560
|
-
for (const entry of entries) {
|
|
561
|
-
let isDir = entry.isDirectory();
|
|
562
|
-
if (entry.isSymbolicLink()) {
|
|
563
|
-
try {
|
|
564
|
-
const stats = statSync(join(extDir, entry.name));
|
|
565
|
-
isDir = stats.isDirectory();
|
|
566
|
-
}
|
|
567
|
-
catch {
|
|
568
|
-
continue;
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
if (isDir) {
|
|
572
|
-
const entryPath = join(extDir, entry.name);
|
|
573
|
-
if (existsSync(join(entryPath, "index.ts")) ||
|
|
574
|
-
existsSync(join(entryPath, "index.js")) ||
|
|
575
|
-
existsSync(join(entryPath, "package.json"))) {
|
|
576
|
-
externalExtensions.push(entryPath);
|
|
577
|
-
metadataByPath.set(entryPath, { source: "external", scope: "user", origin: "top-level" });
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
catch {
|
|
583
|
-
// silent
|
|
584
|
-
}
|
|
585
|
-
}
|
|
597
|
+
// Discover external extensions (same source the profile editor uses, so they stay in sync).
|
|
598
|
+
const externalExtensions = this.discoverExternalExtensionPaths();
|
|
599
|
+
for (const entryPath of externalExtensions) {
|
|
600
|
+
metadataByPath.set(entryPath, { source: "external", scope: "user", origin: "top-level" });
|
|
586
601
|
}
|
|
587
602
|
const extensionPaths = this.noExtensions
|
|
588
603
|
? cliEnabledExtensions
|