pi-subagent-manager 1.4.0 → 1.4.1
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/package.json +1 -1
- package/src/orch/extensions.ts +12 -0
- package/src/ui/settings-ui.ts +2 -3
package/package.json
CHANGED
package/src/orch/extensions.ts
CHANGED
|
@@ -5,6 +5,18 @@ import { DefaultPackageManager, SettingsManager } from "@earendil-works/pi-codin
|
|
|
5
5
|
|
|
6
6
|
const MANAGER_ENTRY = fileURLToPath(new URL("../index.ts", import.meta.url));
|
|
7
7
|
|
|
8
|
+
/** Installed extensions use their npm package name, not a generic entry-point filename. */
|
|
9
|
+
export function extensionDisplayName(file: string): string {
|
|
10
|
+
const packagePath = file.split(`${path.sep}node_modules${path.sep}`).slice(1).at(-1);
|
|
11
|
+
if (packagePath) {
|
|
12
|
+
const [name, scopedName] = packagePath.split(path.sep);
|
|
13
|
+
return name.startsWith("@") ? `${name}/${scopedName}` : name;
|
|
14
|
+
}
|
|
15
|
+
return /^index\.[cm]?[jt]s$/.test(path.basename(file))
|
|
16
|
+
? path.basename(path.dirname(file))
|
|
17
|
+
: path.basename(file);
|
|
18
|
+
}
|
|
19
|
+
|
|
8
20
|
async function canonical(file: string): Promise<string> {
|
|
9
21
|
return realpath(file).catch(() => path.resolve(file));
|
|
10
22
|
}
|
package/src/ui/settings-ui.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ExtensionCommandContext, Theme } from "@earendil-works/pi-coding-agent";
|
|
2
|
-
import {
|
|
3
|
-
import { discoverSubagentExtensions } from "../orch/extensions.ts";
|
|
2
|
+
import { discoverSubagentExtensions, extensionDisplayName } from "../orch/extensions.ts";
|
|
4
3
|
import type { ConfigStore } from "../prefs/config.ts";
|
|
5
4
|
import {
|
|
6
5
|
canOpenDialog,
|
|
@@ -226,7 +225,7 @@ async function configureSubagentExtensions(
|
|
|
226
225
|
[
|
|
227
226
|
...files.map((file) => ({
|
|
228
227
|
id: file,
|
|
229
|
-
label: `${selected.has(file) ? "[x]" : "[ ]"} ${
|
|
228
|
+
label: `${selected.has(file) ? "[x]" : "[ ]"} ${extensionDisplayName(file)}`,
|
|
230
229
|
value: available.includes(file) ? (selected.has(file) ? "On" : "Off") : "Unavailable",
|
|
231
230
|
help: `${file}\n${available.includes(file) ? "Reload this extension in newly opened subagent sessions." : "Not currently discoverable/trusted; will not load. Toggle Off to remove the saved selection."}\nSpace/Enter toggles. Changes are saved only with outer Save and apply.`,
|
|
232
231
|
})),
|