@aliou/pi-neuralwatt 0.10.6 → 0.11.0
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/README.md +1 -0
- package/extensions/provider/commands/settings/index.ts +22 -0
- package/extensions/provider/index.ts +5 -0
- package/extensions/provider/models/aliases.ts +36 -0
- package/extensions/provider/models/index.ts +12 -0
- package/extensions/provider/models/legacy.ts +0 -4
- package/extensions/provider/models/refresh.ts +40 -11
- package/package.json +1 -1
- package/schema.json +4 -0
- package/src/config/defaults.ts +1 -0
- package/src/config/loader.ts +3 -0
- package/src/config/migration/04-enable-aliases-for-legacy-users.ts +49 -0
- package/src/config/migration/index.ts +3 -0
- package/src/config/types.ts +4 -0
package/README.md
CHANGED
|
@@ -78,6 +78,7 @@ Configure features with `/neuralwatt:settings`:
|
|
|
78
78
|
- **Quota warnings** — Enable/disable low quota notifications
|
|
79
79
|
- **Sub-bar integration** — Show/hide usage in status bar
|
|
80
80
|
- **Legacy model IDs** — Include deprecated model aliases
|
|
81
|
+
- **Alias model IDs** — Include active creator-scoped model aliases
|
|
81
82
|
- **Early access models** — Include pre-release models available only to the configured API key
|
|
82
83
|
|
|
83
84
|
The provider itself cannot be disabled — it is always loaded.
|
|
@@ -119,6 +119,18 @@ export function registerNeuralwattSettings(
|
|
|
119
119
|
: "ignore",
|
|
120
120
|
values: ["include", "ignore"],
|
|
121
121
|
},
|
|
122
|
+
{
|
|
123
|
+
id: "includeAliasedModelIds",
|
|
124
|
+
label: "Alias model IDs",
|
|
125
|
+
description:
|
|
126
|
+
"Include active creator-scoped model IDs as aliases in the model picker",
|
|
127
|
+
currentValue:
|
|
128
|
+
(tabConfig?.provider?.includeAliasedModelIds ??
|
|
129
|
+
resolved.provider.includeAliasedModelIds)
|
|
130
|
+
? "include"
|
|
131
|
+
: "ignore",
|
|
132
|
+
values: ["include", "ignore"],
|
|
133
|
+
},
|
|
122
134
|
{
|
|
123
135
|
id: "includeEarlyAccessModels",
|
|
124
136
|
label: "Early access models",
|
|
@@ -148,6 +160,16 @@ export function registerNeuralwattSettings(
|
|
|
148
160
|
};
|
|
149
161
|
}
|
|
150
162
|
|
|
163
|
+
if (id === "includeAliasedModelIds") {
|
|
164
|
+
return {
|
|
165
|
+
...config,
|
|
166
|
+
provider: {
|
|
167
|
+
...config.provider,
|
|
168
|
+
includeAliasedModelIds: newValue === "include",
|
|
169
|
+
},
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
|
|
151
173
|
if (id === "includeEarlyAccessModels") {
|
|
152
174
|
return {
|
|
153
175
|
...config,
|
|
@@ -44,6 +44,7 @@ function registerNeuralwattProvider(
|
|
|
44
44
|
|
|
45
45
|
const models = getNeuralwattModels({
|
|
46
46
|
includeLegacyModelIds: providerConfig.includeLegacyModelIds,
|
|
47
|
+
includeAliasedModelIds: providerConfig.includeAliasedModelIds,
|
|
47
48
|
});
|
|
48
49
|
|
|
49
50
|
const config: Parameters<ExtensionAPI["registerProvider"]>[1] = {
|
|
@@ -61,6 +62,8 @@ function registerNeuralwattProvider(
|
|
|
61
62
|
refreshNeuralwattModels(context, {
|
|
62
63
|
includeLegacyModelIds:
|
|
63
64
|
configLoader.getConfig().provider.includeLegacyModelIds,
|
|
65
|
+
includeAliasedModelIds:
|
|
66
|
+
configLoader.getConfig().provider.includeAliasedModelIds,
|
|
64
67
|
includeEarlyAccessModels:
|
|
65
68
|
configLoader.getConfig().provider.includeEarlyAccessModels,
|
|
66
69
|
}),
|
|
@@ -113,6 +116,8 @@ export default async function (pi: ExtensionAPI) {
|
|
|
113
116
|
if (
|
|
114
117
|
next.includeLegacyModelIds ===
|
|
115
118
|
registeredProviderSettings.includeLegacyModelIds &&
|
|
119
|
+
next.includeAliasedModelIds ===
|
|
120
|
+
registeredProviderSettings.includeAliasedModelIds &&
|
|
116
121
|
next.includeEarlyAccessModels ===
|
|
117
122
|
registeredProviderSettings.includeEarlyAccessModels
|
|
118
123
|
) {
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ProviderModelConfig } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import { NEURALWATT_MODELS } from "./public-models";
|
|
3
|
+
|
|
4
|
+
// Alternate creator-scoped model IDs that Neuralwatt accepts for active models.
|
|
5
|
+
// These are only included when `includeAliasedModelIds` is enabled.
|
|
6
|
+
export const ALIAS_MODEL_MAP = {
|
|
7
|
+
"deepseek-ai/DeepSeek-V4-Flash": "deepseek-v4-flash",
|
|
8
|
+
"zai-org/GLM-5.2-FP8": "glm-5.2",
|
|
9
|
+
"moonshotai/Kimi-K2.6": "kimi-k2.6",
|
|
10
|
+
"moonshotai/Kimi-K2.7-Code": "kimi-k2.7-code",
|
|
11
|
+
"Qwen/Qwen3.5-397B-A17B-FP8": "qwen3.5-397b",
|
|
12
|
+
"Qwen/Qwen3.6-35B-A3B": "qwen3.6-35b",
|
|
13
|
+
"nvidia/Gemma-4-31B-IT-NVFP4": "gemma-4-31b",
|
|
14
|
+
} as const;
|
|
15
|
+
|
|
16
|
+
export const ALIAS_NEURALWATT_MODEL_IDS = new Set<string>(
|
|
17
|
+
Object.keys(ALIAS_MODEL_MAP),
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
export function buildAliasNeuralwattModels(
|
|
21
|
+
canonicalModels: ProviderModelConfig[] = NEURALWATT_MODELS,
|
|
22
|
+
): ProviderModelConfig[] {
|
|
23
|
+
return Object.entries(ALIAS_MODEL_MAP).flatMap(([aliasId, canonicalId]) => {
|
|
24
|
+
const canonical = canonicalModels.find((model) => model.id === canonicalId);
|
|
25
|
+
|
|
26
|
+
if (!canonical) return [];
|
|
27
|
+
|
|
28
|
+
return [
|
|
29
|
+
{
|
|
30
|
+
...canonical,
|
|
31
|
+
id: aliasId,
|
|
32
|
+
name: `${canonical.name} (alias ID)`,
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
});
|
|
36
|
+
}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import type { ProviderModelConfig } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import { buildAliasNeuralwattModels } from "./aliases";
|
|
2
3
|
import { buildLegacyNeuralwattModels } from "./legacy";
|
|
3
4
|
import { NEURALWATT_MODELS } from "./public-models";
|
|
4
5
|
|
|
6
|
+
export {
|
|
7
|
+
ALIAS_MODEL_MAP,
|
|
8
|
+
ALIAS_NEURALWATT_MODEL_IDS,
|
|
9
|
+
buildAliasNeuralwattModels,
|
|
10
|
+
} from "./aliases";
|
|
11
|
+
|
|
5
12
|
export {
|
|
6
13
|
EARLY_ACCESS_NEURALWATT_MODELS,
|
|
7
14
|
loadEarlyAccessModels,
|
|
@@ -16,6 +23,7 @@ export { refreshNeuralwattModels } from "./refresh";
|
|
|
16
23
|
|
|
17
24
|
export function getNeuralwattModels(options?: {
|
|
18
25
|
includeLegacyModelIds?: boolean;
|
|
26
|
+
includeAliasedModelIds?: boolean;
|
|
19
27
|
}): ProviderModelConfig[] {
|
|
20
28
|
const models: ProviderModelConfig[] = [...NEURALWATT_MODELS];
|
|
21
29
|
|
|
@@ -23,5 +31,9 @@ export function getNeuralwattModels(options?: {
|
|
|
23
31
|
models.push(...buildLegacyNeuralwattModels());
|
|
24
32
|
}
|
|
25
33
|
|
|
34
|
+
if (options?.includeAliasedModelIds) {
|
|
35
|
+
models.push(...buildAliasNeuralwattModels());
|
|
36
|
+
}
|
|
37
|
+
|
|
26
38
|
return models;
|
|
27
39
|
}
|
|
@@ -9,10 +9,6 @@ export const LEGACY_MODEL_ALIAS_MAP = {
|
|
|
9
9
|
"zai-org/GLM-5.1-FP8": "glm-5.2",
|
|
10
10
|
"moonshotai/Kimi-K2.5": "kimi-k2.6",
|
|
11
11
|
"kimi-k2.5-fast": "kimi-k2.6-fast",
|
|
12
|
-
"moonshotai/Kimi-K2.6": "kimi-k2.6",
|
|
13
|
-
"Qwen/Qwen3.5-397B-A17B-FP8": "qwen3.5-397b",
|
|
14
|
-
"Qwen/Qwen3.6-35B-A3B": "qwen3.6-35b",
|
|
15
|
-
"nvidia/Gemma-4-31B-IT-NVFP4": "gemma-4-31b",
|
|
16
12
|
} as const;
|
|
17
13
|
|
|
18
14
|
export const LEGACY_NEURALWATT_MODEL_IDS = new Set<string>(
|
|
@@ -5,6 +5,10 @@ import type {
|
|
|
5
5
|
RefreshModelsContext,
|
|
6
6
|
} from "@earendil-works/pi-ai";
|
|
7
7
|
import type { ProviderModelConfig } from "@earendil-works/pi-coding-agent";
|
|
8
|
+
import {
|
|
9
|
+
ALIAS_NEURALWATT_MODEL_IDS,
|
|
10
|
+
buildAliasNeuralwattModels,
|
|
11
|
+
} from "./aliases";
|
|
8
12
|
import {
|
|
9
13
|
EARLY_ACCESS_NEURALWATT_MODELS,
|
|
10
14
|
loadEarlyAccessModels,
|
|
@@ -18,16 +22,28 @@ const API = "openai-completions" as const;
|
|
|
18
22
|
|
|
19
23
|
export interface RefreshNeuralwattModelsOptions {
|
|
20
24
|
includeLegacyModelIds: boolean;
|
|
25
|
+
includeAliasedModelIds: boolean;
|
|
21
26
|
includeEarlyAccessModels: boolean;
|
|
22
27
|
loadEarlyAccess?: typeof loadEarlyAccessModels;
|
|
23
28
|
}
|
|
24
29
|
|
|
25
30
|
function configuredModels(
|
|
26
31
|
includeLegacyModelIds: boolean,
|
|
32
|
+
includeAliasedModelIds: boolean,
|
|
33
|
+
extraCanonicalModels: ProviderModelConfig[] = [],
|
|
27
34
|
): ProviderModelConfig[] {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
35
|
+
const canonicalModels = [...NEURALWATT_MODELS, ...extraCanonicalModels];
|
|
36
|
+
const models: ProviderModelConfig[] = [...canonicalModels];
|
|
37
|
+
|
|
38
|
+
if (includeLegacyModelIds) {
|
|
39
|
+
models.push(...buildLegacyNeuralwattModels());
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (includeAliasedModelIds) {
|
|
43
|
+
models.push(...buildAliasNeuralwattModels(canonicalModels));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return models;
|
|
31
47
|
}
|
|
32
48
|
|
|
33
49
|
function toStoredModel(model: ProviderModelConfig): Model<Api> {
|
|
@@ -91,11 +107,16 @@ function cachedEarlyAccessModels(
|
|
|
91
107
|
): ProviderModelConfig[] {
|
|
92
108
|
if (!stored) return [];
|
|
93
109
|
|
|
94
|
-
const allStaticIds = new Set(
|
|
110
|
+
const allStaticIds = new Set(
|
|
111
|
+
configuredModels(true, true).map((model) => model.id),
|
|
112
|
+
);
|
|
95
113
|
|
|
96
114
|
return stored.models
|
|
97
115
|
.filter(
|
|
98
|
-
(model) =>
|
|
116
|
+
(model) =>
|
|
117
|
+
model.provider === PROVIDER_ID &&
|
|
118
|
+
!allStaticIds.has(model.id) &&
|
|
119
|
+
!ALIAS_NEURALWATT_MODEL_IDS.has(model.id),
|
|
99
120
|
)
|
|
100
121
|
.map(toProviderModel);
|
|
101
122
|
}
|
|
@@ -115,7 +136,10 @@ export async function refreshNeuralwattModels(
|
|
|
115
136
|
context: RefreshModelsContext,
|
|
116
137
|
options: RefreshNeuralwattModelsOptions,
|
|
117
138
|
): Promise<ProviderModelConfig[]> {
|
|
118
|
-
const baseline = configuredModels(
|
|
139
|
+
const baseline = configuredModels(
|
|
140
|
+
options.includeLegacyModelIds,
|
|
141
|
+
options.includeAliasedModelIds,
|
|
142
|
+
);
|
|
119
143
|
const stored = await context.store.read();
|
|
120
144
|
|
|
121
145
|
if (!options.includeEarlyAccessModels) {
|
|
@@ -127,7 +151,11 @@ export async function refreshNeuralwattModels(
|
|
|
127
151
|
cachedEarlyAccessModels(stored),
|
|
128
152
|
baseline,
|
|
129
153
|
);
|
|
130
|
-
const cachedCatalog =
|
|
154
|
+
const cachedCatalog = configuredModels(
|
|
155
|
+
options.includeLegacyModelIds,
|
|
156
|
+
options.includeAliasedModelIds,
|
|
157
|
+
cachedEarlyAccess,
|
|
158
|
+
);
|
|
131
159
|
|
|
132
160
|
if (!context.allowNetwork || context.signal?.aborted) {
|
|
133
161
|
return cachedCatalog;
|
|
@@ -146,10 +174,11 @@ export async function refreshNeuralwattModels(
|
|
|
146
174
|
throw new Error("Neuralwatt model catalog refresh failed");
|
|
147
175
|
}
|
|
148
176
|
|
|
149
|
-
const catalog =
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
177
|
+
const catalog = configuredModels(
|
|
178
|
+
options.includeLegacyModelIds,
|
|
179
|
+
options.includeAliasedModelIds,
|
|
180
|
+
configuredEarlyAccessModels(earlyAccess, baseline),
|
|
181
|
+
);
|
|
153
182
|
await persistModels(context, catalog);
|
|
154
183
|
return catalog;
|
|
155
184
|
}
|
package/package.json
CHANGED
package/schema.json
CHANGED
|
@@ -31,6 +31,10 @@
|
|
|
31
31
|
"NeuralwattProviderConfig": {
|
|
32
32
|
"additionalProperties": false,
|
|
33
33
|
"properties": {
|
|
34
|
+
"includeAliasedModelIds": {
|
|
35
|
+
"description": "Include alternate creator-scoped Neuralwatt model IDs in the model picker.",
|
|
36
|
+
"type": "boolean"
|
|
37
|
+
},
|
|
34
38
|
"includeEarlyAccessModels": {
|
|
35
39
|
"description": "Include early-access Neuralwatt models discovered via the authenticated API.",
|
|
36
40
|
"type": "boolean"
|
package/src/config/defaults.ts
CHANGED
package/src/config/loader.ts
CHANGED
|
@@ -18,6 +18,9 @@ function normalizeResolvedConfig(
|
|
|
18
18
|
includeLegacyModelIds:
|
|
19
19
|
config.provider?.includeLegacyModelIds ??
|
|
20
20
|
DEFAULT_CONFIG.provider.includeLegacyModelIds,
|
|
21
|
+
includeAliasedModelIds:
|
|
22
|
+
config.provider?.includeAliasedModelIds ??
|
|
23
|
+
DEFAULT_CONFIG.provider.includeAliasedModelIds,
|
|
21
24
|
includeEarlyAccessModels:
|
|
22
25
|
config.provider?.includeEarlyAccessModels ??
|
|
23
26
|
DEFAULT_CONFIG.provider.includeEarlyAccessModels,
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { Migration } from "@aliou/pi-utils-settings";
|
|
2
|
+
import type { NeuralwattConfig } from "../types";
|
|
3
|
+
|
|
4
|
+
/** The provider section before alias IDs got a separate setting. */
|
|
5
|
+
interface PreviousProviderConfig {
|
|
6
|
+
includeLegacyModelIds?: boolean;
|
|
7
|
+
includeAliasedModelIds?: boolean;
|
|
8
|
+
includeEarlyAccessModels?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function previousProvider(
|
|
12
|
+
config: NeuralwattConfig,
|
|
13
|
+
): PreviousProviderConfig | undefined {
|
|
14
|
+
if (!("provider" in config)) return undefined;
|
|
15
|
+
const { provider } = config;
|
|
16
|
+
return provider && typeof provider === "object"
|
|
17
|
+
? (provider as PreviousProviderConfig)
|
|
18
|
+
: undefined;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Creator-scoped active model IDs were split out of the legacy model ID setting.
|
|
23
|
+
* Preserve behavior for users who had explicitly enabled legacy model IDs.
|
|
24
|
+
*/
|
|
25
|
+
export const enableAliasesForLegacyUsersMigration: Migration<NeuralwattConfig> =
|
|
26
|
+
{
|
|
27
|
+
name: "enable-alias-model-ids-for-legacy-users",
|
|
28
|
+
shouldRun: (config) => {
|
|
29
|
+
const provider = previousProvider(config);
|
|
30
|
+
return (
|
|
31
|
+
provider?.includeLegacyModelIds === true &&
|
|
32
|
+
provider.includeAliasedModelIds === undefined
|
|
33
|
+
);
|
|
34
|
+
},
|
|
35
|
+
message:
|
|
36
|
+
"[neuralwatt] active model aliases now use `provider.includeAliasedModelIds`; it was enabled because legacy model IDs were enabled.",
|
|
37
|
+
run: (config) => {
|
|
38
|
+
const provider = previousProvider(config);
|
|
39
|
+
if (!provider) return config;
|
|
40
|
+
|
|
41
|
+
return {
|
|
42
|
+
...config,
|
|
43
|
+
provider: {
|
|
44
|
+
...provider,
|
|
45
|
+
includeAliasedModelIds: true,
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
};
|
|
@@ -7,13 +7,16 @@ export {
|
|
|
7
7
|
flatToNestedConfigMigration,
|
|
8
8
|
} from "./02-flat-to-nested-config";
|
|
9
9
|
export { renameHiddenToEarlyAccessMigration } from "./03-rename-hidden-to-early-access";
|
|
10
|
+
export { enableAliasesForLegacyUsersMigration } from "./04-enable-aliases-for-legacy-users";
|
|
10
11
|
|
|
11
12
|
import { disableLegacyModelIdsByDefaultMigration } from "./01-disable-legacy-model-ids-by-default";
|
|
12
13
|
import { flatToNestedConfigMigration } from "./02-flat-to-nested-config";
|
|
13
14
|
import { renameHiddenToEarlyAccessMigration } from "./03-rename-hidden-to-early-access";
|
|
15
|
+
import { enableAliasesForLegacyUsersMigration } from "./04-enable-aliases-for-legacy-users";
|
|
14
16
|
|
|
15
17
|
export const migrations: Migration<NeuralwattConfig>[] = [
|
|
16
18
|
disableLegacyModelIdsByDefaultMigration,
|
|
17
19
|
flatToNestedConfigMigration,
|
|
18
20
|
renameHiddenToEarlyAccessMigration,
|
|
21
|
+
enableAliasesForLegacyUsersMigration,
|
|
19
22
|
];
|
package/src/config/types.ts
CHANGED
|
@@ -2,6 +2,9 @@ export interface NeuralwattProviderConfig {
|
|
|
2
2
|
/** Include legacy Neuralwatt model IDs in the model picker. */
|
|
3
3
|
includeLegacyModelIds?: boolean;
|
|
4
4
|
|
|
5
|
+
/** Include alternate creator-scoped Neuralwatt model IDs in the model picker. */
|
|
6
|
+
includeAliasedModelIds?: boolean;
|
|
7
|
+
|
|
5
8
|
/** Include early-access Neuralwatt models discovered via the authenticated API. */
|
|
6
9
|
includeEarlyAccessModels?: boolean;
|
|
7
10
|
}
|
|
@@ -41,6 +44,7 @@ export interface NeuralwattConfig {
|
|
|
41
44
|
export interface ResolvedNeuralwattConfig {
|
|
42
45
|
provider: {
|
|
43
46
|
includeLegacyModelIds: boolean;
|
|
47
|
+
includeAliasedModelIds: boolean;
|
|
44
48
|
includeEarlyAccessModels: boolean;
|
|
45
49
|
};
|
|
46
50
|
quotaCommand: {
|