pi-hide-providers 0.1.5 → 0.1.7
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/hide-providers.ts +3 -10
- package/package.json +12 -13
package/hide-providers.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExtensionAPI, ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
|
|
2
|
-
import { getAgentDir } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import { getAgentDir, CONFIG_DIR_NAME } from "@earendil-works/pi-coding-agent";
|
|
3
3
|
import {
|
|
4
4
|
HIDE_COMMAND_DESCRIPTION,
|
|
5
5
|
CONFIG_FILENAME,
|
|
@@ -31,7 +31,7 @@ const globalConfigDir = getAgentDir();
|
|
|
31
31
|
const globalConfigPath = join(globalConfigDir, CONFIG_FILENAME);
|
|
32
32
|
|
|
33
33
|
function getProjectConfigPath(cwd: string): string {
|
|
34
|
-
return join(cwd,
|
|
34
|
+
return join(cwd, CONFIG_DIR_NAME, CONFIG_FILENAME);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
// Read config from disk (project overrides global)
|
|
@@ -59,7 +59,7 @@ function readConfig(cwd: string): HideProvidersConfig {
|
|
|
59
59
|
function writeConfig(cwd: string, config: HideProvidersConfig): string {
|
|
60
60
|
const projectPath = getProjectConfigPath(cwd);
|
|
61
61
|
const path = existsSync(getProjectConfigPath(cwd)) ? projectPath : globalConfigPath;
|
|
62
|
-
const dir = path === projectPath ? join(cwd,
|
|
62
|
+
const dir = path === projectPath ? join(cwd, CONFIG_DIR_NAME) : globalConfigDir;
|
|
63
63
|
|
|
64
64
|
if (!existsSync(dir)) {
|
|
65
65
|
mkdirSync(dir, { recursive: true });
|
|
@@ -159,13 +159,6 @@ export default function (pi: ExtensionAPI) {
|
|
|
159
159
|
|
|
160
160
|
if (currentRules.length > 0) {
|
|
161
161
|
patchRegistry(ctx.modelRegistry as unknown as PatchedRegistry, () => currentRules);
|
|
162
|
-
|
|
163
|
-
if (ctx.hasUI) {
|
|
164
|
-
ctx.ui.notify(
|
|
165
|
-
`pi-hide-providers: ${currentRules.length} rule(s) active — getAvailable/getAll/find patched to filter hidden models`,
|
|
166
|
-
"info",
|
|
167
|
-
);
|
|
168
|
-
}
|
|
169
162
|
}
|
|
170
163
|
});
|
|
171
164
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-hide-providers",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Hide providers and models from pi's model selector — filter the /model list and Ctrl+P cycling via a configurable blocklist",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Tom X Nguyen",
|
|
@@ -30,26 +30,25 @@
|
|
|
30
30
|
"src/",
|
|
31
31
|
"README.md"
|
|
32
32
|
],
|
|
33
|
-
"scripts": {
|
|
34
|
-
"test": "vitest run",
|
|
35
|
-
"test:watch": "vitest",
|
|
36
|
-
"test:coverage": "vitest run --coverage",
|
|
37
|
-
"typecheck": "tsc --noEmit",
|
|
38
|
-
"lint:dead": "knip --no-gitignore"
|
|
39
|
-
},
|
|
40
33
|
"devDependencies": {
|
|
41
|
-
"@earendil-works/pi-coding-agent": "0.
|
|
34
|
+
"@earendil-works/pi-coding-agent": "0.80.6",
|
|
35
|
+
"@earendil-works/pi-tui": "0.80.6",
|
|
42
36
|
"@types/node": "25.9.1",
|
|
43
37
|
"@vitest/coverage-v8": "4.1.7",
|
|
44
38
|
"knip": "6.14.1",
|
|
45
39
|
"typescript": "6.0.3",
|
|
46
|
-
"vitest": "4.1.7"
|
|
47
|
-
"@earendil-works/pi-tui": "0.79.4"
|
|
40
|
+
"vitest": "4.1.7"
|
|
48
41
|
},
|
|
49
42
|
"pi": {
|
|
50
43
|
"extensions": [
|
|
51
44
|
"./hide-providers.ts"
|
|
52
45
|
]
|
|
53
46
|
},
|
|
54
|
-
"
|
|
55
|
-
|
|
47
|
+
"scripts": {
|
|
48
|
+
"test": "vitest run",
|
|
49
|
+
"test:watch": "vitest",
|
|
50
|
+
"test:coverage": "vitest run --coverage",
|
|
51
|
+
"typecheck": "tsc --noEmit",
|
|
52
|
+
"lint:dead": "knip --no-gitignore"
|
|
53
|
+
}
|
|
54
|
+
}
|