pi-model-control 0.1.1 → 0.1.2
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/extensions/shared.ts +13 -9
- package/package.json +1 -1
package/extensions/shared.ts
CHANGED
|
@@ -1,22 +1,26 @@
|
|
|
1
1
|
import type { ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
|
|
3
|
-
export const DISPLAY_LEVELS = [
|
|
3
|
+
export const DISPLAY_LEVELS = [NULL_LEVELS, "minimal", "low", "medium", "high", "max"];
|
|
4
|
+
const NULL_LEVELS = "none"
|
|
5
|
+
|
|
4
6
|
|
|
5
7
|
export function getSupportedLevels(m: any): string[] {
|
|
6
|
-
if (!m.reasoning) return [
|
|
8
|
+
if (!m.reasoning) return [NULL_LEVELS];
|
|
9
|
+
|
|
10
|
+
const map = m.thinkingLevelMap;
|
|
11
|
+
if (!map) return [NULL_LEVELS];
|
|
12
|
+
|
|
7
13
|
return DISPLAY_LEVELS.filter((level) => {
|
|
8
|
-
const piLevel = level ===
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (level === "max") return mapped !== undefined;
|
|
12
|
-
return true;
|
|
14
|
+
const piLevel = level === NULL_LEVELS ? "off" : level;
|
|
15
|
+
|
|
16
|
+
return map.hasOwnProperty(piLevel) && map[piLevel] !== null;
|
|
13
17
|
});
|
|
14
18
|
}
|
|
15
19
|
|
|
16
20
|
export function displayToPi(display: string): string {
|
|
17
|
-
return display ===
|
|
21
|
+
return display === NULL_LEVELS ? "off" : display;
|
|
18
22
|
}
|
|
19
23
|
|
|
20
24
|
export function piToDisplay(pi: string): string {
|
|
21
|
-
return pi === "off" ?
|
|
25
|
+
return pi === "off" ? NULL_LEVELS : pi;
|
|
22
26
|
}
|